refactor: update import prefix with alias (#1433)

pull/1434/head
boojack 2 years ago committed by GitHub
parent b03778fa73
commit 89ab57d738
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,5 @@
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useGlobalStore } from "../store/module"; import { useGlobalStore } from "@/store/module";
import Icon from "./Icon"; import Icon from "./Icon";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";
import GitHubBadge from "./GitHubBadge"; import GitHubBadge from "./GitHubBadge";

@ -1,11 +1,11 @@
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useMemoStore } from "../store/module"; import { useMemoStore } from "@/store/module";
import * as utils from "../helpers/utils"; import * as utils from "@/helpers/utils";
import useToggle from "../hooks/useToggle"; import useToggle from "@/hooks/useToggle";
import MemoContent from "./MemoContent"; import MemoContent from "./MemoContent";
import MemoResources from "./MemoResources"; import MemoResources from "./MemoResources";
import "../less/memo.less"; import "@/less/memo.less";
interface Props { interface Props {
memo: Memo; memo: Memo;

@ -1,12 +1,12 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useMemoStore } from "../store/module"; import { useMemoStore } from "@/store/module";
import useLoading from "../hooks/useLoading"; import useLoading from "@/hooks/useLoading";
import Icon from "./Icon"; import Icon from "./Icon";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";
import ArchivedMemo from "./ArchivedMemo"; import ArchivedMemo from "./ArchivedMemo";
import "../less/archived-memo-dialog.less"; import "@/less/archived-memo-dialog.less";
type Props = DialogProps; type Props = DialogProps;

@ -1,14 +1,14 @@
import { Button, Textarea } from "@mui/joy"; import { Button, Textarea } from "@mui/joy";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import * as api from "../helpers/api"; import { useTranslation } from "react-i18next";
import useLoading from "../hooks/useLoading"; import * as api from "@/helpers/api";
import { marked } from "../labs/marked"; import useLoading from "@/hooks/useLoading";
import { useMessageStore } from "../store/zustand/message"; import { marked } from "@/labs/marked";
import { useMessageStore } from "@/store/zustand/message";
import Icon from "./Icon"; import Icon from "./Icon";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";
import showSettingDialog from "./SettingDialog"; import showSettingDialog from "./SettingDialog";
import { useTranslation } from "react-i18next";
type Props = DialogProps; type Props = DialogProps;

@ -1,7 +1,7 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useUserStore } from "../store/module"; import { useUserStore } from "@/store/module";
import Icon from "./Icon"; import Icon from "./Icon";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";

@ -2,7 +2,7 @@ import dayjs from "dayjs";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useMemoStore } from "../store/module"; import { useMemoStore } from "@/store/module";
import Icon from "./Icon"; import Icon from "./Icon";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";

@ -1,7 +1,7 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useUserStore } from "../store/module"; import { useUserStore } from "@/store/module";
import Icon from "./Icon"; import Icon from "./Icon";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";

@ -1,10 +1,10 @@
import { useState } from "react"; import { useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useResourceStore } from "../store/module"; import { useResourceStore } from "@/store/module";
import Icon from "./Icon"; import Icon from "./Icon";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";
import "../less/change-resource-filename-dialog.less"; import "@/less/change-resource-filename-dialog.less";
interface Props extends DialogProps { interface Props extends DialogProps {
resourceId: ResourceId; resourceId: ResourceId;

@ -1,9 +1,9 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { Button, Divider, Input, Radio, RadioGroup, Typography } from "@mui/joy"; import { Button, Divider, Input, Radio, RadioGroup, Typography } from "@mui/joy";
import * as api from "../helpers/api"; import * as api from "@/helpers/api";
import { UNKNOWN_ID } from "../helpers/consts"; import { UNKNOWN_ID } from "@/helpers/consts";
import { absolutifyLink } from "../helpers/utils"; import { absolutifyLink } from "@/helpers/utils";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";
import Icon from "./Icon"; import Icon from "./Icon";

@ -1,10 +1,10 @@
import { Button, Input, Select, Option, Typography, List, ListItem, Autocomplete, Tooltip } from "@mui/joy"; import { Button, Input, Select, Option, Typography, List, ListItem, Autocomplete, Tooltip } from "@mui/joy";
import React, { useRef, useState } from "react"; import React, { useRef, useState } from "react";
import { toast } from "react-hot-toast"; 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 Icon from "./Icon";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";
import { useTranslation } from "react-i18next";
const fileTypeAutocompleteOptions = ["image/*", "text/*", "audio/*", "video/*", "application/*"]; const fileTypeAutocompleteOptions = ["image/*", "text/*", "audio/*", "video/*", "application/*"];

@ -2,13 +2,13 @@ import dayjs from "dayjs";
import { useCallback, useEffect, useState } from "react"; import { useCallback, useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useShortcutStore, useTagStore } from "../store/module"; import { useShortcutStore, useTagStore } from "@/store/module";
import { filterConsts, getDefaultFilter, relationConsts } from "../helpers/filter"; import { filterConsts, getDefaultFilter, relationConsts } from "@/helpers/filter";
import useLoading from "../hooks/useLoading"; import useLoading from "@/hooks/useLoading";
import Icon from "./Icon"; import Icon from "./Icon";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";
import Selector from "./base/Selector"; import Selector from "./base/Selector";
import "../less/create-shortcut-dialog.less"; import "@/less/create-shortcut-dialog.less";
interface Props extends DialogProps { interface Props extends DialogProps {
shortcutId?: ShortcutId; shortcutId?: ShortcutId;

@ -1,7 +1,7 @@
import { Button, Input, Typography } from "@mui/joy";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; 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 { generateDialog } from "./Dialog";
import Icon from "./Icon"; import Icon from "./Icon";
import RequiredBadge from "./RequiredBadge"; import RequiredBadge from "./RequiredBadge";

@ -2,10 +2,10 @@ import { Input } from "@mui/joy";
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useTagStore } from "../store/module"; import { useTagStore } from "@/store/module";
import { getTagSuggestionList } from "../helpers/api"; import { getTagSuggestionList } from "@/helpers/api";
import { matcher } from "../labs/marked/matcher"; import { matcher } from "@/labs/marked/matcher";
import Tag from "../labs/marked/parser/Tag"; import Tag from "@/labs/marked/parser/Tag";
import Icon from "./Icon"; import Icon from "./Icon";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";

@ -1,7 +1,7 @@
import * as utils from "../helpers/utils"; import * as utils from "@/helpers/utils";
import MemoContent from "./MemoContent"; import MemoContent from "./MemoContent";
import MemoResources from "./MemoResources"; import MemoResources from "./MemoResources";
import "../less/daily-memo.less"; import "@/less/daily-memo.less";
interface Props { interface Props {
memo: Memo; memo: Memo;

@ -1,12 +1,12 @@
import { CssVarsProvider } from "@mui/joy";
import { useEffect, useRef } from "react"; import { useEffect, useRef } from "react";
import { createRoot } from "react-dom/client"; import { createRoot } from "react-dom/client";
import { Provider } from "react-redux"; import { Provider } from "react-redux";
import { ANIMATION_DURATION } from "../../helpers/consts"; import { ANIMATION_DURATION } from "@/helpers/consts";
import store from "../../store"; import store from "@/store";
import { useDialogStore } from "../../store/module"; import { useDialogStore } from "@/store/module";
import { CssVarsProvider } from "@mui/joy"; import theme from "@/theme";
import theme from "../../theme"; import "@/less/base-dialog.less";
import "../../less/base-dialog.less";
interface DialogConfig { interface DialogConfig {
dialogName: string; dialogName: string;

@ -1,7 +1,7 @@
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import Icon from "../Icon"; import Icon from "../Icon";
import { generateDialog } from "./BaseDialog"; import { generateDialog } from "./BaseDialog";
import "../../less/common-dialog.less"; import "@/less/common-dialog.less";
type DialogStyle = "info" | "warning"; type DialogStyle = "info" | "warning";

@ -1,5 +1,5 @@
import { forwardRef, ReactNode, useCallback, useEffect, useImperativeHandle, useRef } from "react"; import { forwardRef, ReactNode, useCallback, useEffect, useImperativeHandle, useRef } from "react";
import "../../less/editor.less"; import "@/less/editor.less";
export interface EditorRefActions { export interface EditorRefActions {
focus: FunctionType; focus: FunctionType;

@ -1,9 +1,9 @@
import copy from "copy-to-clipboard";
import React from "react"; import React from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import copy from "copy-to-clipboard"; import { useTranslation } from "react-i18next";
import Icon from "./Icon"; import Icon from "./Icon";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";
import { useTranslation } from "react-i18next";
interface Props extends DialogProps { interface Props extends DialogProps {
memoId: MemoId; memoId: MemoId;

@ -1,5 +1,5 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import * as api from "../helpers/api"; import * as api from "@/helpers/api";
import Icon from "./Icon"; import Icon from "./Icon";
const GitHubBadge = () => { const GitHubBadge = () => {

@ -1,8 +1,8 @@
import { useEffect } from "react"; import { useEffect } from "react";
import { NavLink, useLocation } from "react-router-dom"; import { NavLink, useLocation } from "react-router-dom";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useLayoutStore, useUserStore } from "../store/module"; import { useLayoutStore, useUserStore } from "@/store/module";
import { resolution } from "../utils/layout"; import { resolution } from "@/utils/layout";
import Icon from "./Icon"; import Icon from "./Icon";
import showSettingDialog from "./SettingDialog"; import showSettingDialog from "./SettingDialog";
import showAskAIDialog from "./AskAIDialog"; import showAskAIDialog from "./AskAIDialog";

@ -1,5 +1,5 @@
import showPreviewImageDialog from "./PreviewImageDialog"; import showPreviewImageDialog from "./PreviewImageDialog";
import "../less/image.less"; import "@/less/image.less";
interface Props { interface Props {
imgUrls: string[]; imgUrls: string[];

@ -4,7 +4,7 @@ import { memo, useEffect, useRef, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Link, useNavigate } from "react-router-dom"; 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 Icon from "./Icon";
import MemoContent from "./MemoContent"; import MemoContent from "./MemoContent";
import MemoResources from "./MemoResources"; import MemoResources from "./MemoResources";
@ -12,7 +12,7 @@ import showShareMemo from "./ShareMemoDialog";
import showPreviewImageDialog from "./PreviewImageDialog"; import showPreviewImageDialog from "./PreviewImageDialog";
import showEmbedMemoDialog from "./EmbedMemoDialog"; import showEmbedMemoDialog from "./EmbedMemoDialog";
import showChangeMemoCreatedTsDialog from "./ChangeMemoCreatedTsDialog"; import showChangeMemoCreatedTsDialog from "./ChangeMemoCreatedTsDialog";
import "../less/memo.less"; import "@/less/memo.less";
interface Props { interface Props {
memo: Memo; memo: Memo;

@ -1,8 +1,8 @@
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { marked } from "../labs/marked"; import { marked } from "@/labs/marked";
import Icon from "./Icon"; import Icon from "./Icon";
import "../less/memo-content.less"; import "@/less/memo-content.less";
const MAX_EXPAND_HEIGHT = 384; const MAX_EXPAND_HEIGHT = 384;

@ -2,18 +2,18 @@ import { isNumber, last, toLower, uniq } from "lodash-es";
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react"; import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { getMatchedNodes } from "../labs/marked"; import { getMatchedNodes } from "@/labs/marked";
import { deleteMemoResource, upsertMemoResource } from "../helpers/api"; import { deleteMemoResource, upsertMemoResource } from "@/helpers/api";
import { TAB_SPACE_WIDTH, UNKNOWN_ID, VISIBILITY_SELECTOR_ITEMS } from "../helpers/consts"; import { TAB_SPACE_WIDTH, UNKNOWN_ID, VISIBILITY_SELECTOR_ITEMS } from "@/helpers/consts";
import { useEditorStore, useGlobalStore, useFilterStore, useMemoStore, useResourceStore, useTagStore, useUserStore } from "../store/module"; import { useEditorStore, useGlobalStore, useFilterStore, useMemoStore, useResourceStore, useTagStore, useUserStore } from "@/store/module";
import * as storage from "../helpers/storage"; import * as storage from "@/helpers/storage";
import Icon from "./Icon"; import Icon from "./Icon";
import Selector from "./base/Selector"; import Selector from "./base/Selector";
import Editor, { EditorRefActions } from "./Editor/Editor"; import Editor, { EditorRefActions } from "./Editor/Editor";
import ResourceIcon from "./ResourceIcon"; import ResourceIcon from "./ResourceIcon";
import showResourcesSelectorDialog from "./ResourcesSelectorDialog"; import showResourcesSelectorDialog from "./ResourcesSelectorDialog";
import showCreateResourceDialog from "./CreateResourceDialog"; import showCreateResourceDialog from "./CreateResourceDialog";
import "../less/memo-editor.less"; import "@/less/memo-editor.less";
const listItemSymbolList = ["- [ ] ", "- [x] ", "- [X] ", "* ", "- "]; const listItemSymbolList = ["- [ ] ", "- [x] ", "- [X] ", "* ", "- "];
const emptyOlReg = /^(\d+)\. $/; const emptyOlReg = /^(\d+)\. $/;

@ -1,11 +1,11 @@
import { useEffect } from "react"; import { useEffect } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useLocation } from "react-router-dom"; import { useLocation } from "react-router-dom";
import { useFilterStore, useShortcutStore } from "../store/module"; import { useFilterStore, useShortcutStore } from "@/store/module";
import * as utils from "../helpers/utils"; import * as utils from "@/helpers/utils";
import { getTextWithMemoType } from "../helpers/filter"; import { getTextWithMemoType } from "@/helpers/filter";
import Icon from "./Icon"; import Icon from "./Icon";
import "../less/memo-filter.less"; import "@/less/memo-filter.less";
const MemoFilter = () => { const MemoFilter = () => {
const { t } = useTranslation(); const { t } = useTranslation();

@ -1,13 +1,13 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useFilterStore, useMemoStore, useShortcutStore, useUserStore } from "../store/module"; import { useFilterStore, useMemoStore, useShortcutStore, useUserStore } from "@/store/module";
import { TAG_REG, LINK_REG } from "../labs/marked/parser"; import { TAG_REG, LINK_REG } from "@/labs/marked/parser";
import * as utils from "../helpers/utils"; import * as utils from "@/helpers/utils";
import { DEFAULT_MEMO_LIMIT } from "../helpers/consts"; import { DEFAULT_MEMO_LIMIT } from "@/helpers/consts";
import { checkShouldShowMemoWithFilters } from "../helpers/filter"; import { checkShouldShowMemoWithFilters } from "@/helpers/filter";
import Memo from "./Memo"; import Memo from "./Memo";
import "../less/memo-list.less"; import "@/less/memo-list.less";
const MemoList = () => { const MemoList = () => {
const { t } = useTranslation(); const { t } = useTranslation();

@ -1,4 +1,4 @@
import { getResourceUrl } from "../utils/resource"; import { getResourceUrl } from "@/utils/resource";
import Icon from "./Icon"; import Icon from "./Icon";
interface Props { interface Props {

@ -1,9 +1,9 @@
import { absolutifyLink } from "../helpers/utils"; import { absolutifyLink } from "@/helpers/utils";
import { getResourceUrl } from "../utils/resource"; import { getResourceUrl } from "@/utils/resource";
import SquareDiv from "./base/SquareDiv"; import SquareDiv from "./base/SquareDiv";
import showPreviewImageDialog from "./PreviewImageDialog"; import showPreviewImageDialog from "./PreviewImageDialog";
import MemoResource from "./MemoResource"; import MemoResource from "./MemoResource";
import "../less/memo-resources.less"; import "@/less/memo-resources.less";
interface Props { interface Props {
resourceList: Resource[]; resourceList: Resource[];

@ -1,5 +1,5 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { useLayoutStore, useFilterStore, useShortcutStore } from "../store/module"; import { useLayoutStore, useFilterStore, useShortcutStore } from "@/store/module";
import Icon from "./Icon"; import Icon from "./Icon";
interface Props { interface Props {

@ -1,8 +1,8 @@
import React, { useState } from "react"; import React, { useState } from "react";
import * as utils from "../helpers/utils"; import * as utils from "@/helpers/utils";
import Icon from "./Icon"; import Icon from "./Icon";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";
import "../less/preview-image-dialog.less"; import "@/less/preview-image-dialog.less";
const MIN_SCALE = 0.5; const MIN_SCALE = 0.5;
const MAX_SCALE = 5; const MAX_SCALE = 5;

@ -2,8 +2,8 @@ import dayjs from "dayjs";
import { useState } from "react"; import { useState } from "react";
import Icon from "./Icon"; import Icon from "./Icon";
import ResourceCover from "./ResourceCover"; import ResourceCover from "./ResourceCover";
import "../less/resource-card.less";
import ResourceItemDropdown from "./ResourceItemDropdown"; import ResourceItemDropdown from "./ResourceItemDropdown";
import "@/less/resource-card.less";
const ResourceCard = ({ const ResourceCard = ({
resource, resource,

@ -1,6 +1,6 @@
import React from "react"; import React from "react";
import Icon from "./Icon"; import Icon from "./Icon";
import "../less/resource-cover.less"; import "@/less/resource-cover.less";
interface ResourceCoverProps { interface ResourceCoverProps {
resource: Resource; resource: Resource;

@ -1,7 +1,7 @@
import { useState, useRef } from "react"; import { useState, useRef } from "react";
import Icon from "./Icon";
import useDebounce from "../hooks/useDebounce";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import Icon from "./Icon";
import useDebounce from "@/hooks/useDebounce";
interface ResourceSearchBarProps { interface ResourceSearchBarProps {
setQuery: (queryText: string) => void; setQuery: (queryText: string) => void;

@ -2,13 +2,13 @@ import { Button, Checkbox } from "@mui/joy";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import useLoading from "../hooks/useLoading"; import useLoading from "@/hooks/useLoading";
import { useEditorStore, useResourceStore } from "../store/module"; import { useEditorStore, useResourceStore } from "@/store/module";
import { getResourceUrl } from "../utils/resource"; import { getResourceUrl } from "@/utils/resource";
import Icon from "./Icon"; import Icon from "./Icon";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";
import showPreviewImageDialog from "./PreviewImageDialog"; import showPreviewImageDialog from "./PreviewImageDialog";
import "../less/resources-selector-dialog.less"; import "@/less/resources-selector-dialog.less";
type Props = DialogProps; type Props = DialogProps;

@ -1,9 +1,9 @@
import { useEffect, useState, useRef } from "react"; 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 { 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 SearchBar = () => {
const { t } = useTranslation(); const { t } = useTranslation();

@ -1,7 +1,7 @@
import { Option, Select } from "@mui/joy"; import { Option, Select } from "@mui/joy";
import { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useUserStore } from "../store/module"; import { useUserStore } from "@/store/module";
import Icon from "./Icon"; import Icon from "./Icon";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";
import BetaBadge from "./BetaBadge"; import BetaBadge from "./BetaBadge";
@ -11,7 +11,7 @@ import MemberSection from "./Settings/MemberSection";
import SystemSection from "./Settings/SystemSection"; import SystemSection from "./Settings/SystemSection";
import StorageSection from "./Settings/StorageSection"; import StorageSection from "./Settings/StorageSection";
import SSOSection from "./Settings/SSOSection"; import SSOSection from "./Settings/SSOSection";
import "../less/setting-dialog.less"; import "@/less/setting-dialog.less";
type SettingSection = "my-account" | "preference" | "member" | "system" | "storage" | "sso"; type SettingSection = "my-account" | "preference" | "member" | "system" | "storage" | "sso";

@ -1,12 +1,12 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useUserStore } from "../../store/module"; import { useUserStore } from "@/store/module";
import * as api from "../../helpers/api"; import * as api from "@/helpers/api";
import Dropdown from "../base/Dropdown"; import Dropdown from "../base/Dropdown";
import { showCommonDialog } from "../Dialog/CommonDialog"; import { showCommonDialog } from "../Dialog/CommonDialog";
import showChangeMemberPasswordDialog from "../ChangeMemberPasswordDialog"; import showChangeMemberPasswordDialog from "../ChangeMemberPasswordDialog";
import "../../less/settings/member-section.less"; import "@/less/settings/member-section.less";
interface State { interface State {
createUserUsername: string; createUserUsername: string;

@ -1,10 +1,10 @@
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useUserStore } from "../../store/module"; import { useUserStore } from "@/store/module";
import { showCommonDialog } from "../Dialog/CommonDialog"; import { showCommonDialog } from "../Dialog/CommonDialog";
import showChangePasswordDialog from "../ChangePasswordDialog"; import showChangePasswordDialog from "../ChangePasswordDialog";
import showUpdateAccountDialog from "../UpdateAccountDialog"; import showUpdateAccountDialog from "../UpdateAccountDialog";
import UserAvatar from "../UserAvatar"; import UserAvatar from "../UserAvatar";
import "../../less/settings/my-account-section.less"; import "@/less/settings/my-account-section.less";
const MyAccountSection = () => { const MyAccountSection = () => {
const { t } = useTranslation(); const { t } = useTranslation();

@ -1,11 +1,11 @@
import { Select, Switch, Option } from "@mui/joy"; import { Select, Switch, Option } from "@mui/joy";
import React from "react"; import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useGlobalStore, useUserStore } from "../../store/module"; import { useGlobalStore, useUserStore } from "@/store/module";
import { VISIBILITY_SELECTOR_ITEMS } from "../../helpers/consts"; import { VISIBILITY_SELECTOR_ITEMS } from "@/helpers/consts";
import AppearanceSelect from "../AppearanceSelect"; import AppearanceSelect from "../AppearanceSelect";
import LocaleSelect from "../LocaleSelect"; import LocaleSelect from "../LocaleSelect";
import "../../less/settings/preferences-section.less"; import "@/less/settings/preferences-section.less";
const PreferencesSection = () => { const PreferencesSection = () => {
const { t } = useTranslation(); const { t } = useTranslation();

@ -1,7 +1,7 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import * as api from "../../helpers/api"; import * as api from "@/helpers/api";
import showCreateIdentityProviderDialog from "../CreateIdentityProviderDialog"; import showCreateIdentityProviderDialog from "../CreateIdentityProviderDialog";
import Dropdown from "../base/Dropdown"; import Dropdown from "../base/Dropdown";
import { showCommonDialog } from "../Dialog/CommonDialog"; import { showCommonDialog } from "../Dialog/CommonDialog";

@ -2,8 +2,8 @@ import { Divider, Select, Option } from "@mui/joy";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useGlobalStore } from "../../store/module"; import { useGlobalStore } from "@/store/module";
import * as api from "../../helpers/api"; import * as api from "@/helpers/api";
import showCreateStorageServiceDialog from "../CreateStorageServiceDialog"; import showCreateStorageServiceDialog from "../CreateStorageServiceDialog";
import showUpdateLocalStorageDialog from "../UpdateLocalStorageDialog"; import showUpdateLocalStorageDialog from "../UpdateLocalStorageDialog";
import Dropdown from "../base/Dropdown"; import Dropdown from "../base/Dropdown";

@ -2,8 +2,8 @@ import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Button, Divider, Input, Switch, Textarea } from "@mui/joy"; import { Button, Divider, Input, Switch, Textarea } from "@mui/joy";
import { useGlobalStore } from "../../store/module"; import { useGlobalStore } from "@/store/module";
import * as api from "../../helpers/api"; import * as api from "@/helpers/api";
import showUpdateCustomizedProfileDialog from "../UpdateCustomizedProfileDialog"; import showUpdateCustomizedProfileDialog from "../UpdateCustomizedProfileDialog";
import "@/less/settings/system-section.less"; import "@/less/settings/system-section.less";

@ -5,17 +5,17 @@ import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import copy from "copy-to-clipboard"; import copy from "copy-to-clipboard";
import { toLower } from "lodash-es"; import { toLower } from "lodash-es";
import toImage from "../labs/html2image"; import toImage from "@/labs/html2image";
import { useGlobalStore, useMemoStore, useUserStore } from "../store/module"; import { useGlobalStore, useMemoStore, useUserStore } from "@/store/module";
import { VISIBILITY_SELECTOR_ITEMS } from "../helpers/consts"; import { VISIBILITY_SELECTOR_ITEMS } from "@/helpers/consts";
import * as utils from "../helpers/utils"; import * as utils from "@/helpers/utils";
import { getMemoStats } from "../helpers/api"; import { getMemoStats } from "@/helpers/api";
import useLoading from "../hooks/useLoading"; import useLoading from "@/hooks/useLoading";
import Icon from "./Icon"; import Icon from "./Icon";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";
import MemoContent from "./MemoContent"; import MemoContent from "./MemoContent";
import MemoResources from "./MemoResources"; import MemoResources from "./MemoResources";
import "../less/share-memo-dialog.less"; import "@/less/share-memo-dialog.less";
interface Props extends DialogProps { interface Props extends DialogProps {
memo: Memo; memo: Memo;

@ -1,10 +1,10 @@
import { useEffect } from "react"; import { useEffect } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useFilterStore, useShortcutStore } from "../store/module"; import { useFilterStore, useShortcutStore } from "@/store/module";
import * as utils from "../helpers/utils"; import * as utils from "@/helpers/utils";
import useToggle from "../hooks/useToggle"; import useToggle from "@/hooks/useToggle";
import useLoading from "../hooks/useLoading"; import useLoading from "@/hooks/useLoading";
import Icon from "./Icon"; import Icon from "./Icon";
import showCreateShortcutDialog from "./CreateShortcutDialog"; import showCreateShortcutDialog from "./CreateShortcutDialog";

@ -1,7 +1,7 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useFilterStore, useTagStore } from "../store/module"; import { useFilterStore, useTagStore } from "@/store/module";
import useToggle from "../hooks/useToggle"; import useToggle from "@/hooks/useToggle";
import Icon from "./Icon"; import Icon from "./Icon";
import showCreateTagDialog from "./CreateTagDialog"; import showCreateTagDialog from "./CreateTagDialog";

@ -2,8 +2,8 @@ import { isEqual } from "lodash-es";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useUserStore } from "../store/module"; import { useUserStore } from "@/store/module";
import { convertFileToBase64 } from "../helpers/utils"; import { convertFileToBase64 } from "@/helpers/utils";
import Icon from "./Icon"; import Icon from "./Icon";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";
import UserAvatar from "./UserAvatar"; import UserAvatar from "./UserAvatar";

@ -1,8 +1,8 @@
import { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useGlobalStore } from "../store/module"; import { useGlobalStore } from "@/store/module";
import * as api from "../helpers/api"; import * as api from "@/helpers/api";
import Icon from "./Icon"; import Icon from "./Icon";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";
import LocaleSelect from "./LocaleSelect"; import LocaleSelect from "./LocaleSelect";

@ -1,10 +1,10 @@
import { useState } from "react";
import { Button, Input, Typography } from "@mui/joy"; import { Button, Input, Typography } from "@mui/joy";
import { useState } from "react";
import { toast } from "react-hot-toast"; 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 { generateDialog } from "./Dialog";
import Icon from "./Icon"; import Icon from "./Icon";
import { useGlobalStore } from "../store/module";
interface Props extends DialogProps { interface Props extends DialogProps {
localStoragePath?: string; localStoragePath?: string;

@ -1,8 +1,8 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { compare } from "semver"; import { compare } from "semver";
import * as api from "../helpers/api"; import * as api from "@/helpers/api";
import * as storage from "../helpers/storage"; import * as storage from "@/helpers/storage";
import { useGlobalStore } from "../store/module"; import { useGlobalStore } from "@/store/module";
import Icon from "./Icon"; import Icon from "./Icon";
interface State { interface State {

@ -1,10 +1,10 @@
import { useCallback, useEffect, useRef, useState } from "react"; import { useCallback, useEffect, useRef, useState } from "react";
import { useFilterStore, useMemoStore, useUserStore } from "../store/module"; import { useFilterStore, useMemoStore, useUserStore } from "../store/module";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { getMemoStats } from "../helpers/api"; import { getMemoStats } from "@/helpers/api";
import { DAILY_TIMESTAMP } from "../helpers/consts"; import { DAILY_TIMESTAMP } from "@/helpers/consts";
import * as utils from "../helpers/utils"; import * as utils from "@/helpers/utils";
import "../less/usage-heat-map.less"; import "@/less/usage-heat-map.less";
const tableConfig = { const tableConfig = {
width: 10, width: 10,

@ -1,11 +1,11 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useUserStore } from "../store/module"; import { useUserStore } from "@/store/module";
import Dropdown from "./base/Dropdown"; import Dropdown from "./base/Dropdown";
import showAboutSiteDialog from "./AboutSiteDialog"; import Icon from "./Icon";
import UserAvatar from "./UserAvatar"; import UserAvatar from "./UserAvatar";
import showAboutSiteDialog from "./AboutSiteDialog";
import showSettingDialog from "./SettingDialog"; import showSettingDialog from "./SettingDialog";
import Icon from "./Icon";
const UserBanner = () => { const UserBanner = () => {
const { t } = useTranslation(); const { t } = useTranslation();

@ -1,8 +1,8 @@
import { useEffect, useState } from "react"; 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 { useTranslation } from "react-i18next";
import { DAILY_TIMESTAMP } from "@/helpers/consts";
import Icon from "../Icon";
import "@/less/common/date-picker.less";
interface DatePickerProps { interface DatePickerProps {
className?: string; className?: string;

@ -1,5 +1,5 @@
import { ReactNode, useEffect, useRef } from "react"; import { ReactNode, useEffect, useRef } from "react";
import useToggle from "../../hooks/useToggle"; import useToggle from "@/hooks/useToggle";
import Icon from "../Icon"; import Icon from "../Icon";
interface Props { interface Props {

@ -1,9 +1,9 @@
import { Tooltip } from "@mui/joy";
import { memo, useEffect, useRef } from "react"; import { memo, useEffect, useRef } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import useToggle from "../../hooks/useToggle"; import useToggle from "@/hooks/useToggle";
import Icon from "../Icon"; import Icon from "../Icon";
import { Tooltip } from "@mui/joy"; import "@/less/common/selector.less";
import "../../less/common/selector.less";
interface SelectorItem { interface SelectorItem {
text: string; text: string;

@ -1,5 +1,5 @@
import { TAG_REG, LINK_REG } from "../labs/marked/parser";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { TAG_REG, LINK_REG } from "@/labs/marked/parser";
export const relationConsts = [ export const relationConsts = [
{ text: "And", value: "AND" }, { text: "And", value: "AND" },

@ -0,0 +1,5 @@
export * from "./useDebounce";
export * from "./useListStyle";
export * from "./useLoading";
export * from "./useTimeoutFn";
export * from "./useToggle";

@ -1,6 +1,6 @@
import { Outlet } from "react-router-dom"; 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() { function Root() {
return ( return (

@ -8,13 +8,14 @@ import App from "./App";
import theme from "./theme"; import theme from "./theme";
import "./helpers/polyfill"; import "./helpers/polyfill";
import "./i18n"; import "./i18n";
import "./less/code-highlight.less";
import "./css/global.css";
import "./css/tailwind.css";
import "dayjs/locale/zh"; import "dayjs/locale/zh";
import "dayjs/locale/fr"; import "dayjs/locale/fr";
import "dayjs/locale/vi"; import "dayjs/locale/vi";
import "dayjs/locale/ru"; import "dayjs/locale/ru";
import "./less/code-highlight.less";
import "./css/global.css";
import "./css/tailwind.css";
dayjs.extend(relativeTime); dayjs.extend(relativeTime);

@ -2,14 +2,14 @@ import { Button, Divider } from "@mui/joy";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useGlobalStore, useUserStore } from "../store/module"; import { useGlobalStore, useUserStore } from "@/store/module";
import * as api from "../helpers/api"; import * as api from "@/helpers/api";
import { absolutifyLink } from "../helpers/utils"; import { absolutifyLink } from "@/helpers/utils";
import useLoading from "../hooks/useLoading"; import useLoading from "@/hooks/useLoading";
import Icon from "../components/Icon"; import Icon from "@/components/Icon";
import AppearanceSelect from "../components/AppearanceSelect"; import AppearanceSelect from "@/components/AppearanceSelect";
import LocaleSelect from "../components/LocaleSelect"; import LocaleSelect from "@/components/LocaleSelect";
import "../less/auth.less"; import "@/less/auth.less";
const Auth = () => { const Auth = () => {
const { t } = useTranslation(); const { t } = useTranslation();

@ -3,10 +3,10 @@ import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useSearchParams } from "react-router-dom"; import { useSearchParams } from "react-router-dom";
import * as api from "../helpers/api"; import * as api from "@/helpers/api";
import { absolutifyLink } from "../helpers/utils"; import { absolutifyLink } from "@/helpers/utils";
import { useUserStore } from "../store/module"; import { useUserStore } from "@/store/module";
import Icon from "../components/Icon"; import Icon from "@/components/Icon";
interface State { interface State {
loading: boolean; loading: boolean;

@ -1,18 +1,18 @@
import dayjs from "dayjs";
import { last } from "lodash-es"; import { last } from "lodash-es";
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
import toast from "react-hot-toast"; import toast from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useMemoStore, useUserStore } from "../store/module"; import { useMemoStore, useUserStore } from "@/store/module";
import { DAILY_TIMESTAMP, DEFAULT_MEMO_LIMIT } from "../helpers/consts"; import { DAILY_TIMESTAMP, DEFAULT_MEMO_LIMIT } from "@/helpers/consts";
import * as utils from "../helpers/utils"; import * as utils from "@/helpers/utils";
import MobileHeader from "../components/MobileHeader"; import MobileHeader from "@/components/MobileHeader";
import useToggle from "../hooks/useToggle"; import useToggle from "@/hooks/useToggle";
import toImage from "../labs/html2image"; import toImage from "@/labs/html2image";
import showPreviewImageDialog from "../components/PreviewImageDialog"; import showPreviewImageDialog from "@/components/PreviewImageDialog";
import Icon from "../components/Icon"; import Icon from "@/components/Icon";
import DatePicker from "../components/base/DatePicker"; import DatePicker from "@/components/base/DatePicker";
import DailyMemo from "../components/DailyMemo"; import DailyMemo from "@/components/DailyMemo";
import dayjs from "dayjs";
const DailyReview = () => { const DailyReview = () => {
const { t } = useTranslation(); const { t } = useTranslation();

@ -3,11 +3,11 @@ import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useParams } from "react-router-dom"; import { useParams } from "react-router-dom";
import { UNKNOWN_ID } from "../helpers/consts"; import { UNKNOWN_ID } from "@/helpers/consts";
import { useMemoStore } from "../store/module"; import { useMemoStore } from "@/store/module";
import useLoading from "../hooks/useLoading"; import useLoading from "@/hooks/useLoading";
import MemoContent from "../components/MemoContent"; import MemoContent from "@/components/MemoContent";
import MemoResources from "../components/MemoResources"; import MemoResources from "@/components/MemoResources";
interface State { interface State {
memo: Memo; memo: Memo;

@ -1,14 +1,14 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; 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 { 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 { interface State {
memos: Memo[]; memos: Memo[];

@ -1,12 +1,12 @@
import { useEffect } from "react"; import { useEffect } from "react";
import { useTranslation } from "react-i18next";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useGlobalStore, useUserStore } from "../store/module"; import { useTranslation } from "react-i18next";
import MemoEditor from "../components/MemoEditor"; import { useGlobalStore, useUserStore } from "@/store/module";
import MemoFilter from "../components/MemoFilter"; import MemoEditor from "@/components/MemoEditor";
import MemoList from "../components/MemoList"; import MemoFilter from "@/components/MemoFilter";
import MobileHeader from "../components/MobileHeader"; import MemoList from "@/components/MemoList";
import HomeSidebar from "../components/HomeSidebar"; import MobileHeader from "@/components/MobileHeader";
import HomeSidebar from "@/components/HomeSidebar";
function Home() { function Home() {
const { t } = useTranslation(); const { t } = useTranslation();

@ -1,4 +1,4 @@
import Icon from "../components/Icon"; import Icon from "@/components/Icon";
function Loading() { function Loading() {
return ( return (

@ -3,12 +3,12 @@ import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Link, useLocation, useParams } from "react-router-dom"; import { Link, useLocation, useParams } from "react-router-dom";
import { UNKNOWN_ID } from "../helpers/consts"; import { UNKNOWN_ID } from "@/helpers/consts";
import { useGlobalStore, useMemoStore, useUserStore } from "../store/module"; import { useGlobalStore, useMemoStore, useUserStore } from "@/store/module";
import useLoading from "../hooks/useLoading"; import useLoading from "@/hooks/useLoading";
import MemoContent from "../components/MemoContent"; import MemoContent from "@/components/MemoContent";
import MemoResources from "../components/MemoResources"; import MemoResources from "@/components/MemoResources";
import "../less/memo-detail.less"; import "@/less/memo-detail.less";
interface State { interface State {
memo: Memo; memo: Memo;

@ -1,6 +1,6 @@
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import "../less/not-found.less"; import "@/less/not-found.less";
const NotFound = () => { const NotFound = () => {
const { t } = useTranslation(); const { t } = useTranslation();

@ -1,22 +1,22 @@
import { Button } from "@mui/joy"; import { Button } from "@mui/joy";
import copy from "copy-to-clipboard";
import { useEffect, useMemo, useState } from "react"; import { useEffect, useMemo, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import useLoading from "../hooks/useLoading"; import useLoading from "@/hooks/useLoading";
import { useResourceStore } from "../store/module"; import useListStyle from "@/hooks/useListStyle";
import Icon from "../components/Icon"; import { useResourceStore } from "@/store/module";
import ResourceCard from "../components/ResourceCard"; import { getResourceUrl } from "@/utils/resource";
import ResourceSearchBar from "../components/ResourceSearchBar"; import Icon from "@/components/Icon";
import MobileHeader from "../components/MobileHeader"; import ResourceCard from "@/components/ResourceCard";
import Dropdown from "../components/base/Dropdown"; import ResourceSearchBar from "@/components/ResourceSearchBar";
import ResourceItem from "../components/ResourceItem"; import MobileHeader from "@/components/MobileHeader";
import { showCommonDialog } from "../components/Dialog/CommonDialog"; import Dropdown from "@/components/base/Dropdown";
import showChangeResourceFilenameDialog from "../components/ChangeResourceFilenameDialog"; import ResourceItem from "@/components/ResourceItem";
import copy from "copy-to-clipboard"; import { showCommonDialog } from "@/components/Dialog/CommonDialog";
import { getResourceUrl } from "../utils/resource"; import showChangeResourceFilenameDialog from "@/components/ChangeResourceFilenameDialog";
import showPreviewImageDialog from "../components/PreviewImageDialog"; import showPreviewImageDialog from "@/components/PreviewImageDialog";
import showCreateResourceDialog from "../components/CreateResourceDialog"; import showCreateResourceDialog from "@/components/CreateResourceDialog";
import useListStyle from "../hooks/useListStyle";
const ResourcesDashboard = () => { const ResourcesDashboard = () => {
const { t } = useTranslation(); const { t } = useTranslation();

@ -1,19 +1,19 @@
import { createBrowserRouter, redirect } from "react-router-dom"; import { createBrowserRouter, redirect } from "react-router-dom";
import { lazy } from "react"; import { lazy } from "react";
import { isNullorUndefined } from "../helpers/utils"; import { isNullorUndefined } from "@/helpers/utils";
import store from "../store"; import store from "@/store";
import { initialGlobalState, initialUserState } from "../store/module"; import { initialGlobalState, initialUserState } from "@/store/module";
import DailyReview from "../pages/DailyReview"; import DailyReview from "@/pages/DailyReview";
import ResourcesDashboard from "../pages/ResourcesDashboard"; import ResourcesDashboard from "@/pages/ResourcesDashboard";
const Root = lazy(() => import("../layouts/Root")); const Root = lazy(() => import("@/layouts/Root"));
const Auth = lazy(() => import("../pages/Auth")); const Auth = lazy(() => import("@/pages/Auth"));
const AuthCallback = lazy(() => import("../pages/AuthCallback")); const AuthCallback = lazy(() => import("@/pages/AuthCallback"));
const Explore = lazy(() => import("../pages/Explore")); const Explore = lazy(() => import("@/pages/Explore"));
const Home = lazy(() => import("../pages/Home")); const Home = lazy(() => import("@/pages/Home"));
const MemoDetail = lazy(() => import("../pages/MemoDetail")); const MemoDetail = lazy(() => import("@/pages/MemoDetail"));
const EmbedMemo = lazy(() => import("../pages/EmbedMemo")); const EmbedMemo = lazy(() => import("@/pages/EmbedMemo"));
const NotFound = lazy(() => import("../pages/NotFound")); const NotFound = lazy(() => import("@/pages/NotFound"));
const initialGlobalStateLoader = (() => { const initialGlobalStateLoader = (() => {
let done = false; let done = false;

@ -14,7 +14,10 @@
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"noEmit": true, "noEmit": true,
"jsx": "react-jsx" "jsx": "react-jsx",
"paths": {
"@/*": ["./src/*"]
}
}, },
"include": ["./src"] "include": ["./src"]
} }

@ -553,6 +553,11 @@
"@swc/core-win32-ia32-msvc" "1.3.28" "@swc/core-win32-ia32-msvc" "1.3.28"
"@swc/core-win32-x64-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": "@types/hoist-non-react-statics@^3.3.1":
version "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" resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f"

Loading…
Cancel
Save