Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
refactor: update import prefix with alias (#1433)
boojack89ab57d738df
diff --git a/web/src/components/AboutSiteDialog.tsx b/web/src/components/AboutSiteDialog.tsxindex 26044cc6b..a7c24fead 100644--- a/web/src/components/AboutSiteDialog.tsx+++ b/web/src/components/AboutSiteDialog.tsx@@ -1,5 +1,5 @@import { useTranslation } from "react-i18next";-import { useGlobalStore } from "../store/module";+import { useGlobalStore } from "@/store/module";import Icon from "./Icon";import { generateDialog } from "./Dialog";import GitHubBadge from "./GitHubBadge";diff --git a/web/src/components/ArchivedMemo.tsx b/web/src/components/ArchivedMemo.tsxindex 90c239df4..0a56f930d 100644--- a/web/src/components/ArchivedMemo.tsx+++ b/web/src/components/ArchivedMemo.tsx@@ -1,11 +1,11 @@import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import { useMemoStore } from "../store/module";-import * as utils from "../helpers/utils";-import useToggle from "../hooks/useToggle";+import { useMemoStore } from "@/store/module";+import * as utils from "@/helpers/utils";+import useToggle from "@/hooks/useToggle";import MemoContent from "./MemoContent";import MemoResources from "./MemoResources";-import "../less/memo.less";+import "@/less/memo.less";interface Props {memo: Memo;diff --git a/web/src/components/ArchivedMemoDialog.tsx b/web/src/components/ArchivedMemoDialog.tsxindex 5e484c738..531a0e788 100644--- a/web/src/components/ArchivedMemoDialog.tsx+++ b/web/src/components/ArchivedMemoDialog.tsx@@ -1,12 +1,12 @@import { useEffect, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import { useMemoStore } from "../store/module";-import useLoading from "../hooks/useLoading";+import { useMemoStore } from "@/store/module";+import useLoading from "@/hooks/useLoading";import Icon from "./Icon";import { generateDialog } from "./Dialog";import ArchivedMemo from "./ArchivedMemo";-import "../less/archived-memo-dialog.less";+import "@/less/archived-memo-dialog.less";type Props = DialogProps;diff --git a/web/src/components/AskAIDialog.tsx b/web/src/components/AskAIDialog.tsxindex 37db9ce76..6496c4893 100644--- a/web/src/components/AskAIDialog.tsx+++ b/web/src/components/AskAIDialog.tsx@@ -1,14 +1,14 @@import { Button, Textarea } from "@mui/joy";import { useEffect, useState } from "react";import { toast } from "react-hot-toast";-import * as api from "../helpers/api";-import useLoading from "../hooks/useLoading";-import { marked } from "../labs/marked";-import { useMessageStore } from "../store/zustand/message";+import { useTranslation } from "react-i18next";+import * as api from "@/helpers/api";+import useLoading from "@/hooks/useLoading";+import { marked } from "@/labs/marked";+import { useMessageStore } from "@/store/zustand/message";import Icon from "./Icon";import { generateDialog } from "./Dialog";import showSettingDialog from "./SettingDialog";-import { useTranslation } from "react-i18next";type Props = DialogProps;diff --git a/web/src/components/ChangeMemberPasswordDialog.tsx b/web/src/components/ChangeMemberPasswordDialog.tsxindex 09ffaddae..82fb8a9a5 100644--- a/web/src/components/ChangeMemberPasswordDialog.tsx+++ b/web/src/components/ChangeMemberPasswordDialog.tsx@@ -1,7 +1,7 @@import { useEffect, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import { useUserStore } from "../store/module";+import { useUserStore } from "@/store/module";import Icon from "./Icon";import { generateDialog } from "./Dialog";diff --git a/web/src/components/ChangeMemoCreatedTsDialog.tsx b/web/src/components/ChangeMemoCreatedTsDialog.tsxindex 1cdd0321d..316bf1d04 100644--- a/web/src/components/ChangeMemoCreatedTsDialog.tsx+++ b/web/src/components/ChangeMemoCreatedTsDialog.tsx@@ -2,7 +2,7 @@ import dayjs from "dayjs";import { useEffect, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import { useMemoStore } from "../store/module";+import { useMemoStore } from "@/store/module";import Icon from "./Icon";import { generateDialog } from "./Dialog";diff --git a/web/src/components/ChangePasswordDialog.tsx b/web/src/components/ChangePasswordDialog.tsxindex f8802f84f..b55638021 100644--- a/web/src/components/ChangePasswordDialog.tsx+++ b/web/src/components/ChangePasswordDialog.tsx@@ -1,7 +1,7 @@import { useEffect, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import { useUserStore } from "../store/module";+import { useUserStore } from "@/store/module";import Icon from "./Icon";import { generateDialog } from "./Dialog";diff --git a/web/src/components/ChangeResourceFilenameDialog.tsx b/web/src/components/ChangeResourceFilenameDialog.tsxindex 065107c13..9749ea917 100644--- a/web/src/components/ChangeResourceFilenameDialog.tsx+++ b/web/src/components/ChangeResourceFilenameDialog.tsx@@ -1,10 +1,10 @@import { useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import { useResourceStore } from "../store/module";+import { useResourceStore } from "@/store/module";import Icon from "./Icon";import { generateDialog } from "./Dialog";-import "../less/change-resource-filename-dialog.less";+import "@/less/change-resource-filename-dialog.less";interface Props extends DialogProps {resourceId: ResourceId;diff --git a/web/src/components/CreateIdentityProviderDialog.tsx b/web/src/components/CreateIdentityProviderDialog.tsxindex beba66146..bbc97a988 100644--- a/web/src/components/CreateIdentityProviderDialog.tsx+++ b/web/src/components/CreateIdentityProviderDialog.tsx@@ -1,9 +1,9 @@import { useEffect, useState } from "react";import { toast } from "react-hot-toast";import { Button, Divider, Input, Radio, RadioGroup, Typography } from "@mui/joy";-import * as api from "../helpers/api";-import { UNKNOWN_ID } from "../helpers/consts";-import { absolutifyLink } from "../helpers/utils";+import * as api from "@/helpers/api";+import { UNKNOWN_ID } from "@/helpers/consts";+import { absolutifyLink } from "@/helpers/utils";import { generateDialog } from "./Dialog";import Icon from "./Icon";diff --git a/web/src/components/CreateResourceDialog.tsx b/web/src/components/CreateResourceDialog.tsxindex 852b48cab..cfa407b57 100644--- a/web/src/components/CreateResourceDialog.tsx+++ b/web/src/components/CreateResourceDialog.tsx@@ -1,10 +1,10 @@import { Button, Input, Select, Option, Typography, List, ListItem, Autocomplete, Tooltip } from "@mui/joy";import React, { useRef, useState } from "react";import { toast } from "react-hot-toast";+import { useTranslation } from "react-i18next";import { useResourceStore } from "../store/module";import Icon from "./Icon";import { generateDialog } from "./Dialog";-import { useTranslation } from "react-i18next";const fileTypeAutocompleteOptions = ["image/*", "text/*", "audio/*", "video/*", "application/*"];diff --git a/web/src/components/CreateShortcutDialog.tsx b/web/src/components/CreateShortcutDialog.tsxindex f20bdc5e0..90afcc9c2 100644--- a/web/src/components/CreateShortcutDialog.tsx+++ b/web/src/components/CreateShortcutDialog.tsx@@ -2,13 +2,13 @@ import dayjs from "dayjs";import { useCallback, useEffect, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import { useShortcutStore, useTagStore } from "../store/module";-import { filterConsts, getDefaultFilter, relationConsts } from "../helpers/filter";-import useLoading from "../hooks/useLoading";+import { useShortcutStore, useTagStore } from "@/store/module";+import { filterConsts, getDefaultFilter, relationConsts } from "@/helpers/filter";+import useLoading from "@/hooks/useLoading";import Icon from "./Icon";import { generateDialog } from "./Dialog";import Selector from "./base/Selector";-import "../less/create-shortcut-dialog.less";+import "@/less/create-shortcut-dialog.less";interface Props extends DialogProps {shortcutId?: ShortcutId;diff --git a/web/src/components/CreateStorageServiceDialog.tsx b/web/src/components/CreateStorageServiceDialog.tsxindex db8e29da5..504564ff3 100644--- a/web/src/components/CreateStorageServiceDialog.tsx+++ b/web/src/components/CreateStorageServiceDialog.tsx@@ -1,7 +1,7 @@+import { Button, Input, Typography } from "@mui/joy";import { useEffect, useState } from "react";import { toast } from "react-hot-toast";-import { Button, Input, Typography } from "@mui/joy";-import * as api from "../helpers/api";+import * as api from "@/helpers/api";import { generateDialog } from "./Dialog";import Icon from "./Icon";import RequiredBadge from "./RequiredBadge";diff --git a/web/src/components/CreateTagDialog.tsx b/web/src/components/CreateTagDialog.tsxindex 452534cd4..3bbbdd479 100644--- a/web/src/components/CreateTagDialog.tsx+++ b/web/src/components/CreateTagDialog.tsx@@ -2,10 +2,10 @@ import { Input } from "@mui/joy";import React, { useEffect, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import { useTagStore } from "../store/module";-import { getTagSuggestionList } from "../helpers/api";-import { matcher } from "../labs/marked/matcher";-import Tag from "../labs/marked/parser/Tag";+import { useTagStore } from "@/store/module";+import { getTagSuggestionList } from "@/helpers/api";+import { matcher } from "@/labs/marked/matcher";+import Tag from "@/labs/marked/parser/Tag";import Icon from "./Icon";import { generateDialog } from "./Dialog";diff --git a/web/src/components/DailyMemo.tsx b/web/src/components/DailyMemo.tsxindex 93aec3145..06b967e71 100644--- a/web/src/components/DailyMemo.tsx+++ b/web/src/components/DailyMemo.tsx@@ -1,7 +1,7 @@-import * as utils from "../helpers/utils";+import * as utils from "@/helpers/utils";import MemoContent from "./MemoContent";import MemoResources from "./MemoResources";-import "../less/daily-memo.less";+import "@/less/daily-memo.less";interface Props {memo: Memo;diff --git a/web/src/components/Dialog/BaseDialog.tsx b/web/src/components/Dialog/BaseDialog.tsxindex 02ab4f24b..6ca7087fd 100644--- a/web/src/components/Dialog/BaseDialog.tsx+++ b/web/src/components/Dialog/BaseDialog.tsx@@ -1,12 +1,12 @@+import { CssVarsProvider } from "@mui/joy";import { useEffect, useRef } from "react";import { createRoot } from "react-dom/client";import { Provider } from "react-redux";-import { ANIMATION_DURATION } from "../../helpers/consts";-import store from "../../store";-import { useDialogStore } from "../../store/module";-import { CssVarsProvider } from "@mui/joy";-import theme from "../../theme";-import "../../less/base-dialog.less";+import { ANIMATION_DURATION } from "@/helpers/consts";+import store from "@/store";+import { useDialogStore } from "@/store/module";+import theme from "@/theme";+import "@/less/base-dialog.less";interface DialogConfig {dialogName: string;diff --git a/web/src/components/Dialog/CommonDialog.tsx b/web/src/components/Dialog/CommonDialog.tsxindex dc56a1859..23b2d68c3 100644--- a/web/src/components/Dialog/CommonDialog.tsx+++ b/web/src/components/Dialog/CommonDialog.tsx@@ -1,7 +1,7 @@import { useTranslation } from "react-i18next";import Icon from "../Icon";import { generateDialog } from "./BaseDialog";-import "../../less/common-dialog.less";+import "@/less/common-dialog.less";type DialogStyle = "info" | "warning";diff --git a/web/src/components/Editor/Editor.tsx b/web/src/components/Editor/Editor.tsxindex 50c22658c..1f73f3580 100644--- a/web/src/components/Editor/Editor.tsx+++ b/web/src/components/Editor/Editor.tsx@@ -1,5 +1,5 @@import { forwardRef, ReactNode, useCallback, useEffect, useImperativeHandle, useRef } from "react";-import "../../less/editor.less";+import "@/less/editor.less";export interface EditorRefActions {focus: FunctionType;diff --git a/web/src/components/EmbedMemoDialog.tsx b/web/src/components/EmbedMemoDialog.tsxindex 5bf7e26da..d33e831f2 100644--- a/web/src/components/EmbedMemoDialog.tsx+++ b/web/src/components/EmbedMemoDialog.tsx@@ -1,9 +1,9 @@+import copy from "copy-to-clipboard";import React from "react";import { toast } from "react-hot-toast";-import copy from "copy-to-clipboard";+import { useTranslation } from "react-i18next";import Icon from "./Icon";import { generateDialog } from "./Dialog";-import { useTranslation } from "react-i18next";interface Props extends DialogProps {memoId: MemoId;diff --git a/web/src/components/GitHubBadge.tsx b/web/src/components/GitHubBadge.tsxindex 78cbbc0e4..c184c67a3 100644--- a/web/src/components/GitHubBadge.tsx+++ b/web/src/components/GitHubBadge.tsx@@ -1,5 +1,5 @@import { useEffect, useState } from "react";-import * as api from "../helpers/api";+import * as api from "@/helpers/api";import Icon from "./Icon";const GitHubBadge = () => {diff --git a/web/src/components/Header.tsx b/web/src/components/Header.tsxindex 030a9bbca..5c45f2588 100644--- a/web/src/components/Header.tsx+++ b/web/src/components/Header.tsx@@ -1,8 +1,8 @@import { useEffect } from "react";import { NavLink, useLocation } from "react-router-dom";import { useTranslation } from "react-i18next";-import { useLayoutStore, useUserStore } from "../store/module";-import { resolution } from "../utils/layout";+import { useLayoutStore, useUserStore } from "@/store/module";+import { resolution } from "@/utils/layout";import Icon from "./Icon";import showSettingDialog from "./SettingDialog";import showAskAIDialog from "./AskAIDialog";diff --git a/web/src/components/Image.tsx b/web/src/components/Image.tsxindex 1a299abc8..3943f19d1 100644--- a/web/src/components/Image.tsx+++ b/web/src/components/Image.tsx@@ -1,5 +1,5 @@import showPreviewImageDialog from "./PreviewImageDialog";-import "../less/image.less";+import "@/less/image.less";interface Props {imgUrls: string[];diff --git a/web/src/components/Memo.tsx b/web/src/components/Memo.tsxindex c02b458ef..7159bf91e 100644--- a/web/src/components/Memo.tsx+++ b/web/src/components/Memo.tsx@@ -4,7 +4,7 @@ import { memo, useEffect, useRef, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";import { Link, useNavigate } from "react-router-dom";-import { useEditorStore, useFilterStore, useMemoStore, useUserStore } from "../store/module";+import { useEditorStore, useFilterStore, useMemoStore, useUserStore } from "@/store/module";import Icon from "./Icon";import MemoContent from "./MemoContent";import MemoResources from "./MemoResources";@@ -12,7 +12,7 @@ import showShareMemo from "./ShareMemoDialog";import showPreviewImageDialog from "./PreviewImageDialog";import showEmbedMemoDialog from "./EmbedMemoDialog";import showChangeMemoCreatedTsDialog from "./ChangeMemoCreatedTsDialog";-import "../less/memo.less";+import "@/less/memo.less";interface Props {memo: Memo;diff --git a/web/src/components/MemoContent.tsx b/web/src/components/MemoContent.tsxindex 894ffb210..490aa753c 100644--- a/web/src/components/MemoContent.tsx+++ b/web/src/components/MemoContent.tsx@@ -1,8 +1,8 @@import { useEffect, useRef, useState } from "react";import { useTranslation } from "react-i18next";-import { marked } from "../labs/marked";+import { marked } from "@/labs/marked";import Icon from "./Icon";-import "../less/memo-content.less";+import "@/less/memo-content.less";const MAX_EXPAND_HEIGHT = 384;diff --git a/web/src/components/MemoEditor.tsx b/web/src/components/MemoEditor.tsxindex e1f69a4a0..3b12068eb 100644--- a/web/src/components/MemoEditor.tsx+++ b/web/src/components/MemoEditor.tsx@@ -2,18 +2,18 @@ import { isNumber, last, toLower, uniq } from "lodash-es";import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import { getMatchedNodes } from "../labs/marked";-import { deleteMemoResource, upsertMemoResource } from "../helpers/api";-import { TAB_SPACE_WIDTH, UNKNOWN_ID, VISIBILITY_SELECTOR_ITEMS } from "../helpers/consts";-import { useEditorStore, useGlobalStore, useFilterStore, useMemoStore, useResourceStore, useTagStore, useUserStore } from "../store/module";-import * as storage from "../helpers/storage";+import { getMatchedNodes } from "@/labs/marked";+import { deleteMemoResource, upsertMemoResource } from "@/helpers/api";+import { TAB_SPACE_WIDTH, UNKNOWN_ID, VISIBILITY_SELECTOR_ITEMS } from "@/helpers/consts";+import { useEditorStore, useGlobalStore, useFilterStore, useMemoStore, useResourceStore, useTagStore, useUserStore } from "@/store/module";+import * as storage from "@/helpers/storage";import Icon from "./Icon";import Selector from "./base/Selector";import Editor, { EditorRefActions } from "./Editor/Editor";import ResourceIcon from "./ResourceIcon";import showResourcesSelectorDialog from "./ResourcesSelectorDialog";import showCreateResourceDialog from "./CreateResourceDialog";-import "../less/memo-editor.less";+import "@/less/memo-editor.less";const listItemSymbolList = ["- [ ] ", "- [x] ", "- [X] ", "* ", "- "];const emptyOlReg = /^(\d+)\. $/;diff --git a/web/src/components/MemoFilter.tsx b/web/src/components/MemoFilter.tsxindex 5a433718f..034aa4fb5 100644--- a/web/src/components/MemoFilter.tsx+++ b/web/src/components/MemoFilter.tsx@@ -1,11 +1,11 @@import { useEffect } from "react";import { useTranslation } from "react-i18next";import { useLocation } from "react-router-dom";-import { useFilterStore, useShortcutStore } from "../store/module";-import * as utils from "../helpers/utils";-import { getTextWithMemoType } from "../helpers/filter";+import { useFilterStore, useShortcutStore } from "@/store/module";+import * as utils from "@/helpers/utils";+import { getTextWithMemoType } from "@/helpers/filter";import Icon from "./Icon";-import "../less/memo-filter.less";+import "@/less/memo-filter.less";const MemoFilter = () => {const { t } = useTranslation();diff --git a/web/src/components/MemoList.tsx b/web/src/components/MemoList.tsxindex 8eb7b88f9..288569fa4 100644--- a/web/src/components/MemoList.tsx+++ b/web/src/components/MemoList.tsx@@ -1,13 +1,13 @@import { useEffect, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import { useFilterStore, useMemoStore, useShortcutStore, useUserStore } from "../store/module";-import { TAG_REG, LINK_REG } from "../labs/marked/parser";-import * as utils from "../helpers/utils";-import { DEFAULT_MEMO_LIMIT } from "../helpers/consts";-import { checkShouldShowMemoWithFilters } from "../helpers/filter";+import { useFilterStore, useMemoStore, useShortcutStore, useUserStore } from "@/store/module";+import { TAG_REG, LINK_REG } from "@/labs/marked/parser";+import * as utils from "@/helpers/utils";+import { DEFAULT_MEMO_LIMIT } from "@/helpers/consts";+import { checkShouldShowMemoWithFilters } from "@/helpers/filter";import Memo from "./Memo";-import "../less/memo-list.less";+import "@/less/memo-list.less";const MemoList = () => {const { t } = useTranslation();diff --git a/web/src/components/MemoResource.tsx b/web/src/components/MemoResource.tsxindex c316ccc52..09a31de20 100644--- a/web/src/components/MemoResource.tsx+++ b/web/src/components/MemoResource.tsx@@ -1,4 +1,4 @@-import { getResourceUrl } from "../utils/resource";+import { getResourceUrl } from "@/utils/resource";import Icon from "./Icon";interface Props {diff --git a/web/src/components/MemoResources.tsx b/web/src/components/MemoResources.tsxindex 2c360d640..316d8469d 100644--- a/web/src/components/MemoResources.tsx+++ b/web/src/components/MemoResources.tsx@@ -1,9 +1,9 @@-import { absolutifyLink } from "../helpers/utils";-import { getResourceUrl } from "../utils/resource";+import { absolutifyLink } from "@/helpers/utils";+import { getResourceUrl } from "@/utils/resource";import SquareDiv from "./base/SquareDiv";import showPreviewImageDialog from "./PreviewImageDialog";import MemoResource from "./MemoResource";-import "../less/memo-resources.less";+import "@/less/memo-resources.less";interface Props {resourceList: Resource[];diff --git a/web/src/components/MobileHeader.tsx b/web/src/components/MobileHeader.tsxindex c521f2831..067e0784a 100644--- a/web/src/components/MobileHeader.tsx+++ b/web/src/components/MobileHeader.tsx@@ -1,5 +1,5 @@import { useEffect, useState } from "react";-import { useLayoutStore, useFilterStore, useShortcutStore } from "../store/module";+import { useLayoutStore, useFilterStore, useShortcutStore } from "@/store/module";import Icon from "./Icon";interface Props {diff --git a/web/src/components/PreviewImageDialog.tsx b/web/src/components/PreviewImageDialog.tsxindex e045dd063..0dd836862 100644--- a/web/src/components/PreviewImageDialog.tsx+++ b/web/src/components/PreviewImageDialog.tsx@@ -1,8 +1,8 @@import React, { useState } from "react";-import * as utils from "../helpers/utils";+import * as utils from "@/helpers/utils";import Icon from "./Icon";import { generateDialog } from "./Dialog";-import "../less/preview-image-dialog.less";+import "@/less/preview-image-dialog.less";const MIN_SCALE = 0.5;const MAX_SCALE = 5;diff --git a/web/src/components/ResourceCard.tsx b/web/src/components/ResourceCard.tsxindex 68b064769..45bf88ec1 100644--- a/web/src/components/ResourceCard.tsx+++ b/web/src/components/ResourceCard.tsx@@ -2,8 +2,8 @@ import dayjs from "dayjs";import { useState } from "react";import Icon from "./Icon";import ResourceCover from "./ResourceCover";-import "../less/resource-card.less";import ResourceItemDropdown from "./ResourceItemDropdown";+import "@/less/resource-card.less";const ResourceCard = ({resource,diff --git a/web/src/components/ResourceCover.tsx b/web/src/components/ResourceCover.tsxindex b7baf4750..5288327ea 100644--- a/web/src/components/ResourceCover.tsx+++ b/web/src/components/ResourceCover.tsx@@ -1,6 +1,6 @@import React from "react";import Icon from "./Icon";-import "../less/resource-cover.less";+import "@/less/resource-cover.less";interface ResourceCoverProps {resource: Resource;diff --git a/web/src/components/ResourceSearchBar.tsx b/web/src/components/ResourceSearchBar.tsxindex 7e43df45b..2fc7e6241 100644--- a/web/src/components/ResourceSearchBar.tsx+++ b/web/src/components/ResourceSearchBar.tsx@@ -1,7 +1,7 @@import { useState, useRef } from "react";-import Icon from "./Icon";-import useDebounce from "../hooks/useDebounce";import { useTranslation } from "react-i18next";+import Icon from "./Icon";+import useDebounce from "@/hooks/useDebounce";interface ResourceSearchBarProps {setQuery: (queryText: string) => void;diff --git a/web/src/components/ResourcesSelectorDialog.tsx b/web/src/components/ResourcesSelectorDialog.tsxindex 381fa5c3a..eeaf8abab 100644--- a/web/src/components/ResourcesSelectorDialog.tsx+++ b/web/src/components/ResourcesSelectorDialog.tsx@@ -2,13 +2,13 @@ import { Button, Checkbox } from "@mui/joy";import { useEffect, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import useLoading from "../hooks/useLoading";-import { useEditorStore, useResourceStore } from "../store/module";-import { getResourceUrl } from "../utils/resource";+import useLoading from "@/hooks/useLoading";+import { useEditorStore, useResourceStore } from "@/store/module";+import { getResourceUrl } from "@/utils/resource";import Icon from "./Icon";import { generateDialog } from "./Dialog";import showPreviewImageDialog from "./PreviewImageDialog";-import "../less/resources-selector-dialog.less";+import "@/less/resources-selector-dialog.less";type Props = DialogProps;diff --git a/web/src/components/SearchBar.tsx b/web/src/components/SearchBar.tsxindex 74c4ed8c7..45419bd1f 100644--- a/web/src/components/SearchBar.tsx+++ b/web/src/components/SearchBar.tsx@@ -1,9 +1,9 @@import { useEffect, useState, useRef } from "react";-import useDebounce from "../hooks/useDebounce";-import { useFilterStore, useDialogStore, useLayoutStore } from "../store/module";-import { resolution } from "../utils/layout";-import Icon from "./Icon";import { useTranslation } from "react-i18next";+import useDebounce from "@/hooks/useDebounce";+import { useFilterStore, useDialogStore, useLayoutStore } from "@/store/module";+import { resolution } from "@/utils/layout";+import Icon from "./Icon";const SearchBar = () => {const { t } = useTranslation();diff --git a/web/src/components/SettingDialog.tsx b/web/src/components/SettingDialog.tsxindex 8b5479ede..e96f9aa4f 100644--- a/web/src/components/SettingDialog.tsx+++ b/web/src/components/SettingDialog.tsx@@ -1,7 +1,7 @@import { Option, Select } from "@mui/joy";import { useState } from "react";import { useTranslation } from "react-i18next";-import { useUserStore } from "../store/module";+import { useUserStore } from "@/store/module";import Icon from "./Icon";import { generateDialog } from "./Dialog";import BetaBadge from "./BetaBadge";@@ -11,7 +11,7 @@ import MemberSection from "./Settings/MemberSection";import SystemSection from "./Settings/SystemSection";import StorageSection from "./Settings/StorageSection";import SSOSection from "./Settings/SSOSection";-import "../less/setting-dialog.less";+import "@/less/setting-dialog.less";type SettingSection = "my-account" | "preference" | "member" | "system" | "storage" | "sso";diff --git a/web/src/components/Settings/MemberSection.tsx b/web/src/components/Settings/MemberSection.tsxindex c9b45c159..19aab8a4b 100644--- a/web/src/components/Settings/MemberSection.tsx+++ b/web/src/components/Settings/MemberSection.tsx@@ -1,12 +1,12 @@import React, { useEffect, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import { useUserStore } from "../../store/module";-import * as api from "../../helpers/api";+import { useUserStore } from "@/store/module";+import * as api from "@/helpers/api";import Dropdown from "../base/Dropdown";import { showCommonDialog } from "../Dialog/CommonDialog";import showChangeMemberPasswordDialog from "../ChangeMemberPasswordDialog";-import "../../less/settings/member-section.less";+import "@/less/settings/member-section.less";interface State {createUserUsername: string;diff --git a/web/src/components/Settings/MyAccountSection.tsx b/web/src/components/Settings/MyAccountSection.tsxindex 487c310f1..dc61b6aa5 100644--- a/web/src/components/Settings/MyAccountSection.tsx+++ b/web/src/components/Settings/MyAccountSection.tsx@@ -1,10 +1,10 @@import { useTranslation } from "react-i18next";-import { useUserStore } from "../../store/module";+import { useUserStore } from "@/store/module";import { showCommonDialog } from "../Dialog/CommonDialog";import showChangePasswordDialog from "../ChangePasswordDialog";import showUpdateAccountDialog from "../UpdateAccountDialog";import UserAvatar from "../UserAvatar";-import "../../less/settings/my-account-section.less";+import "@/less/settings/my-account-section.less";const MyAccountSection = () => {const { t } = useTranslation();diff --git a/web/src/components/Settings/PreferencesSection.tsx b/web/src/components/Settings/PreferencesSection.tsxindex a1906403f..f919d1692 100644--- a/web/src/components/Settings/PreferencesSection.tsx+++ b/web/src/components/Settings/PreferencesSection.tsx@@ -1,11 +1,11 @@import { Select, Switch, Option } from "@mui/joy";import React from "react";import { useTranslation } from "react-i18next";-import { useGlobalStore, useUserStore } from "../../store/module";-import { VISIBILITY_SELECTOR_ITEMS } from "../../helpers/consts";+import { useGlobalStore, useUserStore } from "@/store/module";+import { VISIBILITY_SELECTOR_ITEMS } from "@/helpers/consts";import AppearanceSelect from "../AppearanceSelect";import LocaleSelect from "../LocaleSelect";-import "../../less/settings/preferences-section.less";+import "@/less/settings/preferences-section.less";const PreferencesSection = () => {const { t } = useTranslation();diff --git a/web/src/components/Settings/SSOSection.tsx b/web/src/components/Settings/SSOSection.tsxindex 6a7fed6aa..e7583661e 100644--- a/web/src/components/Settings/SSOSection.tsx+++ b/web/src/components/Settings/SSOSection.tsx@@ -1,7 +1,7 @@import { useEffect, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import * as api from "../../helpers/api";+import * as api from "@/helpers/api";import showCreateIdentityProviderDialog from "../CreateIdentityProviderDialog";import Dropdown from "../base/Dropdown";import { showCommonDialog } from "../Dialog/CommonDialog";diff --git a/web/src/components/Settings/StorageSection.tsx b/web/src/components/Settings/StorageSection.tsxindex 17523548d..c60690bc5 100644--- a/web/src/components/Settings/StorageSection.tsx+++ b/web/src/components/Settings/StorageSection.tsx@@ -2,8 +2,8 @@ import { Divider, Select, Option } from "@mui/joy";import { useEffect, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import { useGlobalStore } from "../../store/module";-import * as api from "../../helpers/api";+import { useGlobalStore } from "@/store/module";+import * as api from "@/helpers/api";import showCreateStorageServiceDialog from "../CreateStorageServiceDialog";import showUpdateLocalStorageDialog from "../UpdateLocalStorageDialog";import Dropdown from "../base/Dropdown";diff --git a/web/src/components/Settings/SystemSection.tsx b/web/src/components/Settings/SystemSection.tsxindex 64b03ddd9..572f953a4 100644--- a/web/src/components/Settings/SystemSection.tsx+++ b/web/src/components/Settings/SystemSection.tsx@@ -2,8 +2,8 @@ import { useEffect, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";import { Button, Divider, Input, Switch, Textarea } from "@mui/joy";-import { useGlobalStore } from "../../store/module";-import * as api from "../../helpers/api";+import { useGlobalStore } from "@/store/module";+import * as api from "@/helpers/api";import showUpdateCustomizedProfileDialog from "../UpdateCustomizedProfileDialog";import "@/less/settings/system-section.less";diff --git a/web/src/components/ShareMemoDialog.tsx b/web/src/components/ShareMemoDialog.tsxindex 306c7d019..a262ee0a2 100644--- a/web/src/components/ShareMemoDialog.tsx+++ b/web/src/components/ShareMemoDialog.tsx@@ -5,17 +5,17 @@ import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";import copy from "copy-to-clipboard";import { toLower } from "lodash-es";-import toImage from "../labs/html2image";-import { useGlobalStore, useMemoStore, useUserStore } from "../store/module";-import { VISIBILITY_SELECTOR_ITEMS } from "../helpers/consts";-import * as utils from "../helpers/utils";-import { getMemoStats } from "../helpers/api";-import useLoading from "../hooks/useLoading";+import toImage from "@/labs/html2image";+import { useGlobalStore, useMemoStore, useUserStore } from "@/store/module";+import { VISIBILITY_SELECTOR_ITEMS } from "@/helpers/consts";+import * as utils from "@/helpers/utils";+import { getMemoStats } from "@/helpers/api";+import useLoading from "@/hooks/useLoading";import Icon from "./Icon";import { generateDialog } from "./Dialog";import MemoContent from "./MemoContent";import MemoResources from "./MemoResources";-import "../less/share-memo-dialog.less";+import "@/less/share-memo-dialog.less";interface Props extends DialogProps {memo: Memo;diff --git a/web/src/components/ShortcutList.tsx b/web/src/components/ShortcutList.tsxindex 409e5de62..6b4e03844 100644--- a/web/src/components/ShortcutList.tsx+++ b/web/src/components/ShortcutList.tsx@@ -1,10 +1,10 @@import { useEffect } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import { useFilterStore, useShortcutStore } from "../store/module";-import * as utils from "../helpers/utils";-import useToggle from "../hooks/useToggle";-import useLoading from "../hooks/useLoading";+import { useFilterStore, useShortcutStore } from "@/store/module";+import * as utils from "@/helpers/utils";+import useToggle from "@/hooks/useToggle";+import useLoading from "@/hooks/useLoading";import Icon from "./Icon";import showCreateShortcutDialog from "./CreateShortcutDialog";diff --git a/web/src/components/TagList.tsx b/web/src/components/TagList.tsxindex 9aba0e95c..7cfde78d2 100644--- a/web/src/components/TagList.tsx+++ b/web/src/components/TagList.tsx@@ -1,7 +1,7 @@import { useEffect, useState } from "react";import { useTranslation } from "react-i18next";-import { useFilterStore, useTagStore } from "../store/module";-import useToggle from "../hooks/useToggle";+import { useFilterStore, useTagStore } from "@/store/module";+import useToggle from "@/hooks/useToggle";import Icon from "./Icon";import showCreateTagDialog from "./CreateTagDialog";diff --git a/web/src/components/UpdateAccountDialog.tsx b/web/src/components/UpdateAccountDialog.tsxindex 311243e12..90b70c590 100644--- a/web/src/components/UpdateAccountDialog.tsx+++ b/web/src/components/UpdateAccountDialog.tsx@@ -2,8 +2,8 @@ import { isEqual } from "lodash-es";import { useEffect, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import { useUserStore } from "../store/module";-import { convertFileToBase64 } from "../helpers/utils";+import { useUserStore } from "@/store/module";+import { convertFileToBase64 } from "@/helpers/utils";import Icon from "./Icon";import { generateDialog } from "./Dialog";import UserAvatar from "./UserAvatar";diff --git a/web/src/components/UpdateCustomizedProfileDialog.tsx b/web/src/components/UpdateCustomizedProfileDialog.tsxindex 8f1bb66e8..0f74bbdbc 100644--- a/web/src/components/UpdateCustomizedProfileDialog.tsx+++ b/web/src/components/UpdateCustomizedProfileDialog.tsx@@ -1,8 +1,8 @@import { useState } from "react";import { useTranslation } from "react-i18next";import { toast } from "react-hot-toast";-import { useGlobalStore } from "../store/module";-import * as api from "../helpers/api";+import { useGlobalStore } from "@/store/module";+import * as api from "@/helpers/api";import Icon from "./Icon";import { generateDialog } from "./Dialog";import LocaleSelect from "./LocaleSelect";diff --git a/web/src/components/UpdateLocalStorageDialog.tsx b/web/src/components/UpdateLocalStorageDialog.tsxindex 15b128b50..d8b723ec0 100644--- a/web/src/components/UpdateLocalStorageDialog.tsx+++ b/web/src/components/UpdateLocalStorageDialog.tsx@@ -1,10 +1,10 @@-import { useState } from "react";import { Button, Input, Typography } from "@mui/joy";+import { useState } from "react";import { toast } from "react-hot-toast";-import * as api from "../helpers/api";+import { useGlobalStore } from "@/store/module";+import * as api from "@/helpers/api";import { generateDialog } from "./Dialog";import Icon from "./Icon";-import { useGlobalStore } from "../store/module";interface Props extends DialogProps {localStoragePath?: string;diff --git a/web/src/components/UpdateVersionBanner.tsx b/web/src/components/UpdateVersionBanner.tsxindex 200f10eb4..fbd081bd6 100644--- a/web/src/components/UpdateVersionBanner.tsx+++ b/web/src/components/UpdateVersionBanner.tsx@@ -1,8 +1,8 @@import { useEffect, useState } from "react";import { compare } from "semver";-import * as api from "../helpers/api";-import * as storage from "../helpers/storage";-import { useGlobalStore } from "../store/module";+import * as api from "@/helpers/api";+import * as storage from "@/helpers/storage";+import { useGlobalStore } from "@/store/module";import Icon from "./Icon";interface State {diff --git a/web/src/components/UsageHeatMap.tsx b/web/src/components/UsageHeatMap.tsxindex b81e1f321..2d7883e8b 100644--- a/web/src/components/UsageHeatMap.tsx+++ b/web/src/components/UsageHeatMap.tsx@@ -1,10 +1,10 @@import { useCallback, useEffect, useRef, useState } from "react";import { useFilterStore, useMemoStore, useUserStore } from "../store/module";import { useTranslation } from "react-i18next";-import { getMemoStats } from "../helpers/api";-import { DAILY_TIMESTAMP } from "../helpers/consts";-import * as utils from "../helpers/utils";-import "../less/usage-heat-map.less";+import { getMemoStats } from "@/helpers/api";+import { DAILY_TIMESTAMP } from "@/helpers/consts";+import * as utils from "@/helpers/utils";+import "@/less/usage-heat-map.less";const tableConfig = {width: 10,diff --git a/web/src/components/UserBanner.tsx b/web/src/components/UserBanner.tsxindex 7ca54aa3e..8e9ab3e11 100644--- a/web/src/components/UserBanner.tsx+++ b/web/src/components/UserBanner.tsx@@ -1,11 +1,11 @@import { useEffect, useState } from "react";import { useTranslation } from "react-i18next";-import { useUserStore } from "../store/module";+import { useUserStore } from "@/store/module";import Dropdown from "./base/Dropdown";-import showAboutSiteDialog from "./AboutSiteDialog";+import Icon from "./Icon";import UserAvatar from "./UserAvatar";+import showAboutSiteDialog from "./AboutSiteDialog";import showSettingDialog from "./SettingDialog";-import Icon from "./Icon";const UserBanner = () => {const { t } = useTranslation();diff --git a/web/src/components/base/DatePicker.tsx b/web/src/components/base/DatePicker.tsxindex d6ad3281f..d008b3e5d 100644--- a/web/src/components/base/DatePicker.tsx+++ b/web/src/components/base/DatePicker.tsx@@ -1,8 +1,8 @@import { useEffect, useState } from "react";-import { DAILY_TIMESTAMP } from "../../helpers/consts";-import Icon from "../Icon";-import "../../less/common/date-picker.less";import { useTranslation } from "react-i18next";+import { DAILY_TIMESTAMP } from "@/helpers/consts";+import Icon from "../Icon";+import "@/less/common/date-picker.less";interface DatePickerProps {className?: string;diff --git a/web/src/components/base/Dropdown.tsx b/web/src/components/base/Dropdown.tsxindex 2fbeafdb3..bc1003580 100644--- a/web/src/components/base/Dropdown.tsx+++ b/web/src/components/base/Dropdown.tsx@@ -1,5 +1,5 @@import { ReactNode, useEffect, useRef } from "react";-import useToggle from "../../hooks/useToggle";+import useToggle from "@/hooks/useToggle";import Icon from "../Icon";interface Props {diff --git a/web/src/components/base/Selector.tsx b/web/src/components/base/Selector.tsxindex c15f5512a..301b13ccf 100644--- a/web/src/components/base/Selector.tsx+++ b/web/src/components/base/Selector.tsx@@ -1,9 +1,9 @@+import { Tooltip } from "@mui/joy";import { memo, useEffect, useRef } from "react";import { useTranslation } from "react-i18next";-import useToggle from "../../hooks/useToggle";+import useToggle from "@/hooks/useToggle";import Icon from "../Icon";-import { Tooltip } from "@mui/joy";-import "../../less/common/selector.less";+import "@/less/common/selector.less";interface SelectorItem {text: string;diff --git a/web/src/helpers/filter.ts b/web/src/helpers/filter.tsindex 29ccbc1c3..bfb8626bc 100644--- a/web/src/helpers/filter.ts+++ b/web/src/helpers/filter.ts@@ -1,5 +1,5 @@-import { TAG_REG, LINK_REG } from "../labs/marked/parser";import dayjs from "dayjs";+import { TAG_REG, LINK_REG } from "@/labs/marked/parser";export const relationConsts = [{ text: "And", value: "AND" },diff --git a/web/src/hooks/index.ts b/web/src/hooks/index.tsnew file mode 100644index 000000000..b9e50af18--- /dev/null+++ b/web/src/hooks/index.ts@@ -0,0 +1,5 @@+export * from "./useDebounce";+export * from "./useListStyle";+export * from "./useLoading";+export * from "./useTimeoutFn";+export * from "./useToggle";diff --git a/web/src/layouts/Root.tsx b/web/src/layouts/Root.tsxindex 8f0a957f6..331021223 100644--- a/web/src/layouts/Root.tsx+++ b/web/src/layouts/Root.tsx@@ -1,6 +1,6 @@import { Outlet } from "react-router-dom";-import UpdateVersionBanner from "../components/UpdateVersionBanner";-import Header from "../components/Header";+import Header from "@/components/Header";+import UpdateVersionBanner from "@/components/UpdateVersionBanner";function Root() {return (diff --git a/web/src/main.tsx b/web/src/main.tsxindex 0863e4125..4a56c298d 100644--- a/web/src/main.tsx+++ b/web/src/main.tsx@@ -8,13 +8,14 @@ import App from "./App";import theme from "./theme";import "./helpers/polyfill";import "./i18n";+import "./less/code-highlight.less";+import "./css/global.css";+import "./css/tailwind.css";+import "dayjs/locale/zh";import "dayjs/locale/fr";import "dayjs/locale/vi";import "dayjs/locale/ru";-import "./less/code-highlight.less";-import "./css/global.css";-import "./css/tailwind.css";dayjs.extend(relativeTime);diff --git a/web/src/pages/Auth.tsx b/web/src/pages/Auth.tsxindex 322cb70e7..dd35e7c44 100644--- a/web/src/pages/Auth.tsx+++ b/web/src/pages/Auth.tsx@@ -2,14 +2,14 @@ import { Button, Divider } from "@mui/joy";import { useEffect, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import { useGlobalStore, useUserStore } from "../store/module";-import * as api from "../helpers/api";-import { absolutifyLink } from "../helpers/utils";-import useLoading from "../hooks/useLoading";-import Icon from "../components/Icon";-import AppearanceSelect from "../components/AppearanceSelect";-import LocaleSelect from "../components/LocaleSelect";-import "../less/auth.less";+import { useGlobalStore, useUserStore } from "@/store/module";+import * as api from "@/helpers/api";+import { absolutifyLink } from "@/helpers/utils";+import useLoading from "@/hooks/useLoading";+import Icon from "@/components/Icon";+import AppearanceSelect from "@/components/AppearanceSelect";+import LocaleSelect from "@/components/LocaleSelect";+import "@/less/auth.less";const Auth = () => {const { t } = useTranslation();diff --git a/web/src/pages/AuthCallback.tsx b/web/src/pages/AuthCallback.tsxindex abf6f93a6..8105880ed 100644--- a/web/src/pages/AuthCallback.tsx+++ b/web/src/pages/AuthCallback.tsx@@ -3,10 +3,10 @@ import { useEffect, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";import { useSearchParams } from "react-router-dom";-import * as api from "../helpers/api";-import { absolutifyLink } from "../helpers/utils";-import { useUserStore } from "../store/module";-import Icon from "../components/Icon";+import * as api from "@/helpers/api";+import { absolutifyLink } from "@/helpers/utils";+import { useUserStore } from "@/store/module";+import Icon from "@/components/Icon";interface State {loading: boolean;diff --git a/web/src/pages/DailyReview.tsx b/web/src/pages/DailyReview.tsxindex 1313c0aef..20da897db 100644--- a/web/src/pages/DailyReview.tsx+++ b/web/src/pages/DailyReview.tsx@@ -1,18 +1,18 @@+import dayjs from "dayjs";import { last } from "lodash-es";import { useEffect, useRef, useState } from "react";import toast from "react-hot-toast";import { useTranslation } from "react-i18next";-import { useMemoStore, useUserStore } from "../store/module";-import { DAILY_TIMESTAMP, DEFAULT_MEMO_LIMIT } from "../helpers/consts";-import * as utils from "../helpers/utils";-import MobileHeader from "../components/MobileHeader";-import useToggle from "../hooks/useToggle";-import toImage from "../labs/html2image";-import showPreviewImageDialog from "../components/PreviewImageDialog";-import Icon from "../components/Icon";-import DatePicker from "../components/base/DatePicker";-import DailyMemo from "../components/DailyMemo";-import dayjs from "dayjs";+import { useMemoStore, useUserStore } from "@/store/module";+import { DAILY_TIMESTAMP, DEFAULT_MEMO_LIMIT } from "@/helpers/consts";+import * as utils from "@/helpers/utils";+import MobileHeader from "@/components/MobileHeader";+import useToggle from "@/hooks/useToggle";+import toImage from "@/labs/html2image";+import showPreviewImageDialog from "@/components/PreviewImageDialog";+import Icon from "@/components/Icon";+import DatePicker from "@/components/base/DatePicker";+import DailyMemo from "@/components/DailyMemo";const DailyReview = () => {const { t } = useTranslation();diff --git a/web/src/pages/EmbedMemo.tsx b/web/src/pages/EmbedMemo.tsxindex a07efbb75..9151bf156 100644--- a/web/src/pages/EmbedMemo.tsx+++ b/web/src/pages/EmbedMemo.tsx@@ -3,11 +3,11 @@ import { useEffect, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";import { useParams } from "react-router-dom";-import { UNKNOWN_ID } from "../helpers/consts";-import { useMemoStore } from "../store/module";-import useLoading from "../hooks/useLoading";-import MemoContent from "../components/MemoContent";-import MemoResources from "../components/MemoResources";+import { UNKNOWN_ID } from "@/helpers/consts";+import { useMemoStore } from "@/store/module";+import useLoading from "@/hooks/useLoading";+import MemoContent from "@/components/MemoContent";+import MemoResources from "@/components/MemoResources";interface State {memo: Memo;diff --git a/web/src/pages/Explore.tsx b/web/src/pages/Explore.tsxindex 0f1429d8d..884095d36 100644--- a/web/src/pages/Explore.tsx+++ b/web/src/pages/Explore.tsx@@ -1,14 +1,14 @@import { useEffect, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import { useFilterStore, useMemoStore } from "../store/module";-import { TAG_REG } from "../labs/marked/parser";-import { DEFAULT_MEMO_LIMIT } from "../helpers/consts";-import useLoading from "../hooks/useLoading";-import MemoFilter from "../components/MemoFilter";-import Memo from "../components/Memo";-import MobileHeader from "../components/MobileHeader";import { useLocation } from "react-router-dom";+import { useFilterStore, useMemoStore } from "@/store/module";+import { TAG_REG } from "@/labs/marked/parser";+import { DEFAULT_MEMO_LIMIT } from "@/helpers/consts";+import useLoading from "@/hooks/useLoading";+import MemoFilter from "@/components/MemoFilter";+import Memo from "@/components/Memo";+import MobileHeader from "@/components/MobileHeader";interface State {memos: Memo[];diff --git a/web/src/pages/Home.tsx b/web/src/pages/Home.tsxindex 064a47841..782400a98 100644--- a/web/src/pages/Home.tsx+++ b/web/src/pages/Home.tsx@@ -1,12 +1,12 @@import { useEffect } from "react";-import { useTranslation } from "react-i18next";import { toast } from "react-hot-toast";-import { useGlobalStore, useUserStore } from "../store/module";-import MemoEditor from "../components/MemoEditor";-import MemoFilter from "../components/MemoFilter";-import MemoList from "../components/MemoList";-import MobileHeader from "../components/MobileHeader";-import HomeSidebar from "../components/HomeSidebar";+import { useTranslation } from "react-i18next";+import { useGlobalStore, useUserStore } from "@/store/module";+import MemoEditor from "@/components/MemoEditor";+import MemoFilter from "@/components/MemoFilter";+import MemoList from "@/components/MemoList";+import MobileHeader from "@/components/MobileHeader";+import HomeSidebar from "@/components/HomeSidebar";function Home() {const { t } = useTranslation();diff --git a/web/src/pages/Loading.tsx b/web/src/pages/Loading.tsxindex 62bf326e2..53c950fc3 100644--- a/web/src/pages/Loading.tsx+++ b/web/src/pages/Loading.tsx@@ -1,4 +1,4 @@-import Icon from "../components/Icon";+import Icon from "@/components/Icon";function Loading() {return (diff --git a/web/src/pages/MemoDetail.tsx b/web/src/pages/MemoDetail.tsxindex 1af9ddc92..1b08c8fd7 100644--- a/web/src/pages/MemoDetail.tsx+++ b/web/src/pages/MemoDetail.tsx@@ -3,12 +3,12 @@ import { useEffect, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";import { Link, useLocation, useParams } from "react-router-dom";-import { UNKNOWN_ID } from "../helpers/consts";-import { useGlobalStore, useMemoStore, useUserStore } from "../store/module";-import useLoading from "../hooks/useLoading";-import MemoContent from "../components/MemoContent";-import MemoResources from "../components/MemoResources";-import "../less/memo-detail.less";+import { UNKNOWN_ID } from "@/helpers/consts";+import { useGlobalStore, useMemoStore, useUserStore } from "@/store/module";+import useLoading from "@/hooks/useLoading";+import MemoContent from "@/components/MemoContent";+import MemoResources from "@/components/MemoResources";+import "@/less/memo-detail.less";interface State {memo: Memo;diff --git a/web/src/pages/NotFound.tsx b/web/src/pages/NotFound.tsxindex 884ab79e9..9fe157505 100644--- a/web/src/pages/NotFound.tsx+++ b/web/src/pages/NotFound.tsx@@ -1,6 +1,6 @@import { useTranslation } from "react-i18next";import { Link } from "react-router-dom";-import "../less/not-found.less";+import "@/less/not-found.less";const NotFound = () => {const { t } = useTranslation();diff --git a/web/src/pages/ResourcesDashboard.tsx b/web/src/pages/ResourcesDashboard.tsxindex 7be16069b..0657de802 100644--- a/web/src/pages/ResourcesDashboard.tsx+++ b/web/src/pages/ResourcesDashboard.tsx@@ -1,22 +1,22 @@import { Button } from "@mui/joy";+import copy from "copy-to-clipboard";import { useEffect, useMemo, useState } from "react";import { toast } from "react-hot-toast";import { useTranslation } from "react-i18next";-import useLoading from "../hooks/useLoading";-import { useResourceStore } from "../store/module";-import Icon from "../components/Icon";-import ResourceCard from "../components/ResourceCard";-import ResourceSearchBar from "../components/ResourceSearchBar";-import MobileHeader from "../components/MobileHeader";-import Dropdown from "../components/base/Dropdown";-import ResourceItem from "../components/ResourceItem";-import { showCommonDialog } from "../components/Dialog/CommonDialog";-import showChangeResourceFilenameDialog from "../components/ChangeResourceFilenameDialog";-import copy from "copy-to-clipboard";-import { getResourceUrl } from "../utils/resource";-import showPreviewImageDialog from "../components/PreviewImageDialog";-import showCreateResourceDialog from "../components/CreateResourceDialog";-import useListStyle from "../hooks/useListStyle";+import useLoading from "@/hooks/useLoading";+import useListStyle from "@/hooks/useListStyle";+import { useResourceStore } from "@/store/module";+import { getResourceUrl } from "@/utils/resource";+import Icon from "@/components/Icon";+import ResourceCard from "@/components/ResourceCard";+import ResourceSearchBar from "@/components/ResourceSearchBar";+import MobileHeader from "@/components/MobileHeader";+import Dropdown from "@/components/base/Dropdown";+import ResourceItem from "@/components/ResourceItem";+import { showCommonDialog } from "@/components/Dialog/CommonDialog";+import showChangeResourceFilenameDialog from "@/components/ChangeResourceFilenameDialog";+import showPreviewImageDialog from "@/components/PreviewImageDialog";+import showCreateResourceDialog from "@/components/CreateResourceDialog";const ResourcesDashboard = () => {const { t } = useTranslation();diff --git a/web/src/router/index.tsx b/web/src/router/index.tsxindex a4ba26377..e5369efb7 100644--- a/web/src/router/index.tsx+++ b/web/src/router/index.tsx@@ -1,19 +1,19 @@import { createBrowserRouter, redirect } from "react-router-dom";import { lazy } from "react";-import { isNullorUndefined } from "../helpers/utils";-import store from "../store";-import { initialGlobalState, initialUserState } from "../store/module";-import DailyReview from "../pages/DailyReview";-import ResourcesDashboard from "../pages/ResourcesDashboard";--const Root = lazy(() => import("../layouts/Root"));-const Auth = lazy(() => import("../pages/Auth"));-const AuthCallback = lazy(() => import("../pages/AuthCallback"));-const Explore = lazy(() => import("../pages/Explore"));-const Home = lazy(() => import("../pages/Home"));-const MemoDetail = lazy(() => import("../pages/MemoDetail"));-const EmbedMemo = lazy(() => import("../pages/EmbedMemo"));-const NotFound = lazy(() => import("../pages/NotFound"));+import { isNullorUndefined } from "@/helpers/utils";+import store from "@/store";+import { initialGlobalState, initialUserState } from "@/store/module";+import DailyReview from "@/pages/DailyReview";+import ResourcesDashboard from "@/pages/ResourcesDashboard";++const Root = lazy(() => import("@/layouts/Root"));+const Auth = lazy(() => import("@/pages/Auth"));+const AuthCallback = lazy(() => import("@/pages/AuthCallback"));+const Explore = lazy(() => import("@/pages/Explore"));+const Home = lazy(() => import("@/pages/Home"));+const MemoDetail = lazy(() => import("@/pages/MemoDetail"));+const EmbedMemo = lazy(() => import("@/pages/EmbedMemo"));+const NotFound = lazy(() => import("@/pages/NotFound"));const initialGlobalStateLoader = (() => {let done = false;diff --git a/web/tsconfig.json b/web/tsconfig.jsonindex d1ae59885..56a269f53 100644--- a/web/tsconfig.json+++ b/web/tsconfig.json@@ -14,7 +14,10 @@"resolveJsonModule": true,"isolatedModules": true,"noEmit": true,- "jsx": "react-jsx"+ "jsx": "react-jsx",+ "paths": {+ "@/*": ["./src/*"]+ }},"include": ["./src"]}diff --git a/web/yarn.lock b/web/yarn.lockindex cc377f7c3..8086c1d5d 100644--- a/web/yarn.lock+++ b/web/yarn.lock@@ -553,6 +553,11 @@"@swc/core-win32-ia32-msvc" "1.3.28""@swc/core-win32-x64-msvc" "1.3.28"+"@tailwindcss/line-clamp@^0.4.2":+ version "0.4.4"+ resolved "https://registry.yarnpkg.com/@tailwindcss/line-clamp/-/line-clamp-0.4.4.tgz#767cf8e5d528a5d90c9740ca66eb079f5e87d423"+ integrity sha512-5U6SY5z8N42VtrCrKlsTAA35gy2VSyYtHWCsg1H87NU1SXnEfekTVlrga9fzUDrrHcGi2Lb5KenUWb4lRQT5/g==+"@types/hoist-non-react-statics@^3.3.1":version "3.3.1"resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f"