mirror of
https://github.com/usememos/memos.git
synced 2025-02-20 21:30:55 +01:00
feat: add prettier sort import plugin (#2058)
This commit is contained in:
parent
5f819fc86f
commit
d114b630d2
@ -2,5 +2,7 @@
|
|||||||
"printWidth": 140,
|
"printWidth": 140,
|
||||||
"useTabs": false,
|
"useTabs": false,
|
||||||
"semi": true,
|
"semi": true,
|
||||||
"singleQuote": false
|
"singleQuote": false,
|
||||||
|
"plugins": ["@ianvs/prettier-plugin-sort-imports"],
|
||||||
|
"importOrder": ["<BUILTIN_MODULES>", "<THIRD_PARTY_MODULES>", "^@/(.*)$", "^[./]", ".less$"]
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
"@emotion/styled": "^11.10.5",
|
"@emotion/styled": "^11.10.5",
|
||||||
"@microsoft/fetch-event-source": "^2.0.1",
|
"@microsoft/fetch-event-source": "^2.0.1",
|
||||||
"@mui/joy": "^5.0.0-alpha.75",
|
"@mui/joy": "^5.0.0-alpha.75",
|
||||||
|
"@mui/material": "^5.14.2",
|
||||||
|
"@mui/styled-engine-sc": "^5.12.0",
|
||||||
"@reduxjs/toolkit": "^1.8.1",
|
"@reduxjs/toolkit": "^1.8.1",
|
||||||
"axios": "^0.27.2",
|
"axios": "^0.27.2",
|
||||||
"classnames": "^2.3.2",
|
"classnames": "^2.3.2",
|
||||||
@ -30,12 +32,14 @@
|
|||||||
"react-router-dom": "^6.8.2",
|
"react-router-dom": "^6.8.2",
|
||||||
"react-use": "^17.4.0",
|
"react-use": "^17.4.0",
|
||||||
"semver": "^7.3.8",
|
"semver": "^7.3.8",
|
||||||
|
"styled-components": "^6.0.5",
|
||||||
"tailwindcss": "^3.2.4",
|
"tailwindcss": "^3.2.4",
|
||||||
"textarea-caret": "^3.1.0",
|
"textarea-caret": "^3.1.0",
|
||||||
"uuid": "^9.0.0",
|
"uuid": "^9.0.0",
|
||||||
"zustand": "^4.3.6"
|
"zustand": "^4.3.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@ianvs/prettier-plugin-sort-imports": "^4.1.0",
|
||||||
"@types/lodash-es": "^4.17.5",
|
"@types/lodash-es": "^4.17.5",
|
||||||
"@types/node": "^18.0.3",
|
"@types/node": "^18.0.3",
|
||||||
"@types/qs": "^6.9.7",
|
"@types/qs": "^6.9.7",
|
||||||
|
1620
web/pnpm-lock.yaml
generated
1620
web/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -1,13 +1,13 @@
|
|||||||
import { useColorScheme } from "@mui/joy";
|
import { useColorScheme } from "@mui/joy";
|
||||||
import { useEffect, Suspense } from "react";
|
import { Suspense, useEffect } from "react";
|
||||||
import { Toaster } from "react-hot-toast";
|
import { Toaster } from "react-hot-toast";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { RouterProvider } from "react-router-dom";
|
import { RouterProvider } from "react-router-dom";
|
||||||
import router from "./router";
|
|
||||||
import { useGlobalStore } from "./store/module";
|
|
||||||
import storage from "./helpers/storage";
|
import storage from "./helpers/storage";
|
||||||
import { getSystemColorScheme } from "./helpers/utils";
|
import { getSystemColorScheme } from "./helpers/utils";
|
||||||
import Loading from "./pages/Loading";
|
import Loading from "./pages/Loading";
|
||||||
|
import router from "./router";
|
||||||
|
import { useGlobalStore } from "./store/module";
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
const { i18n } = useTranslation();
|
const { i18n } = useTranslation();
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useGlobalStore } from "@/store/module";
|
import { useGlobalStore } from "@/store/module";
|
||||||
import Icon from "./Icon";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
import GitHubBadge from "./GitHubBadge";
|
import GitHubBadge from "./GitHubBadge";
|
||||||
|
import Icon from "./Icon";
|
||||||
|
|
||||||
type Props = DialogProps;
|
type Props = DialogProps;
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { Tooltip } from "@mui/joy";
|
import { Tooltip } from "@mui/joy";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
|
import { getDateTimeString } from "@/helpers/datetime";
|
||||||
import { useMemoStore } from "@/store/module";
|
import { useMemoStore } from "@/store/module";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { getDateTimeString } from "@/helpers/datetime";
|
import { showCommonDialog } from "./Dialog/CommonDialog";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
import MemoContent from "./MemoContent";
|
import MemoContent from "./MemoContent";
|
||||||
import MemoResourceListView from "./MemoResourceListView";
|
import MemoResourceListView from "./MemoResourceListView";
|
||||||
import { showCommonDialog } from "./Dialog/CommonDialog";
|
|
||||||
import "@/less/memo.less";
|
import "@/less/memo.less";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useMemoStore } from "@/store/module";
|
|
||||||
import useLoading from "@/hooks/useLoading";
|
import useLoading from "@/hooks/useLoading";
|
||||||
import Icon from "./Icon";
|
import { useMemoStore } from "@/store/module";
|
||||||
import { generateDialog } from "./Dialog";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import ArchivedMemo from "./ArchivedMemo";
|
import ArchivedMemo from "./ArchivedMemo";
|
||||||
|
import { generateDialog } from "./Dialog";
|
||||||
|
import Icon from "./Icon";
|
||||||
import "@/less/archived-memo-dialog.less";
|
import "@/less/archived-memo-dialog.less";
|
||||||
|
|
||||||
type Props = DialogProps;
|
type Props = DialogProps;
|
||||||
|
@ -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 { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useUserStore } from "@/store/module";
|
import { useUserStore } from "@/store/module";
|
||||||
import Icon from "./Icon";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
|
import Icon from "./Icon";
|
||||||
|
|
||||||
interface Props extends DialogProps {
|
interface Props extends DialogProps {
|
||||||
user: User;
|
user: User;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { getNormalizedTimeString, getUnixTime } from "@/helpers/datetime";
|
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { getNormalizedTimeString, getUnixTime } from "@/helpers/datetime";
|
||||||
import { useMemoStore } from "@/store/module";
|
import { useMemoStore } from "@/store/module";
|
||||||
import Icon from "./Icon";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
|
import Icon from "./Icon";
|
||||||
|
|
||||||
interface Props extends DialogProps {
|
interface Props extends DialogProps {
|
||||||
memoId: MemoId;
|
memoId: MemoId;
|
||||||
|
@ -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 { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useGlobalStore, useUserStore } from "@/store/module";
|
import { useGlobalStore, useUserStore } from "@/store/module";
|
||||||
import Icon from "./Icon";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
|
import Icon from "./Icon";
|
||||||
|
|
||||||
type Props = DialogProps;
|
type Props = DialogProps;
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useResourceStore } from "@/store/module";
|
import { useResourceStore } from "@/store/module";
|
||||||
import Icon from "./Icon";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
|
import Icon from "./Icon";
|
||||||
import "@/less/change-resource-filename-dialog.less";
|
import "@/less/change-resource-filename-dialog.less";
|
||||||
|
|
||||||
interface Props extends DialogProps {
|
interface Props extends DialogProps {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { Button, Divider, Input, Option, Select, Typography } from "@mui/joy";
|
import { Button, Divider, Input, Option, Select, Typography } from "@mui/joy";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
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 { useTranslate } from "@/utils/i18n";
|
||||||
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 } from "@mui/joy";
|
import { Autocomplete, Button, Input, List, ListItem, Option, Select, Typography } 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 { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { useResourceStore } from "../store/module";
|
import { useResourceStore } from "../store/module";
|
||||||
import Icon from "./Icon";
|
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
|
import Icon from "./Icon";
|
||||||
|
|
||||||
const fileTypeAutocompleteOptions = ["image/*", "text/*", "audio/*", "video/*", "application/*"];
|
const fileTypeAutocompleteOptions = ["image/*", "text/*", "audio/*", "video/*", "application/*"];
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
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 { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useShortcutStore, useTagStore } from "@/store/module";
|
|
||||||
import { filterConsts, getDefaultFilter, relationConsts } from "@/helpers/filter";
|
|
||||||
import { getNormalizedTimeString } from "@/helpers/datetime";
|
import { getNormalizedTimeString } from "@/helpers/datetime";
|
||||||
|
import { filterConsts, getDefaultFilter, relationConsts } from "@/helpers/filter";
|
||||||
import useLoading from "@/hooks/useLoading";
|
import useLoading from "@/hooks/useLoading";
|
||||||
import Icon from "./Icon";
|
import { useShortcutStore, useTagStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
|
import Icon from "./Icon";
|
||||||
import Selector from "./kit/Selector";
|
import Selector from "./kit/Selector";
|
||||||
import "@/less/create-shortcut-dialog.less";
|
import "@/less/create-shortcut-dialog.less";
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { Button, Input, Typography } from "@mui/joy";
|
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 { useTranslate } from "@/utils/i18n";
|
|
||||||
import * as api from "@/helpers/api";
|
import * as api from "@/helpers/api";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
import RequiredBadge from "./RequiredBadge";
|
|
||||||
import LearnMore from "./LearnMore";
|
import LearnMore from "./LearnMore";
|
||||||
|
import RequiredBadge from "./RequiredBadge";
|
||||||
|
|
||||||
interface Props extends DialogProps {
|
interface Props extends DialogProps {
|
||||||
storage?: ObjectStorage;
|
storage?: ObjectStorage;
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { Button, Input } from "@mui/joy";
|
import { Button, 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 { useTranslate } from "@/utils/i18n";
|
|
||||||
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 { useTagStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
|
import Icon from "./Icon";
|
||||||
|
|
||||||
type Props = DialogProps;
|
type Props = DialogProps;
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { Button } from "@mui/joy";
|
import { Button } from "@mui/joy";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useGlobalStore } from "@/store/module";
|
|
||||||
import * as api from "@/helpers/api";
|
import * as api from "@/helpers/api";
|
||||||
import Icon from "./Icon";
|
import { useGlobalStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
|
import Icon from "./Icon";
|
||||||
|
|
||||||
type Props = DialogProps;
|
type Props = DialogProps;
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@ 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 { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import Icon from "./Icon";
|
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
|
import Icon from "./Icon";
|
||||||
|
|
||||||
interface Props extends DialogProps {
|
interface Props extends DialogProps {
|
||||||
memoId: MemoId;
|
memoId: MemoId;
|
||||||
|
@ -5,8 +5,8 @@ import { useGlobalStore, useLayoutStore, useUserStore } from "@/store/module";
|
|||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { resolution } from "@/utils/layout";
|
import { resolution } from "@/utils/layout";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
import UserBanner from "./UserBanner";
|
|
||||||
import UpgradeVersionView from "./UpgradeVersionBanner";
|
import UpgradeVersionView from "./UpgradeVersionBanner";
|
||||||
|
import UserBanner from "./UserBanner";
|
||||||
|
|
||||||
const Header = () => {
|
const Header = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useLayoutStore, useUserStore } from "../store/module";
|
import { useLayoutStore, useUserStore } from "../store/module";
|
||||||
|
import SearchBar from "./SearchBar";
|
||||||
import ShortcutList from "./ShortcutList";
|
import ShortcutList from "./ShortcutList";
|
||||||
import TagList from "./TagList";
|
import TagList from "./TagList";
|
||||||
import SearchBar from "./SearchBar";
|
|
||||||
import UsageHeatMap from "./UsageHeatMap";
|
import UsageHeatMap from "./UsageHeatMap";
|
||||||
|
|
||||||
const HomeSidebar = () => {
|
const HomeSidebar = () => {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { Tooltip } from "@mui/joy";
|
import { Tooltip } from "@mui/joy";
|
||||||
import Icon from "./Icon";
|
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
|
import Icon from "./Icon";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
className?: string;
|
className?: string;
|
||||||
url: string;
|
url: string;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Option, Select } from "@mui/joy";
|
import { Option, Select } from "@mui/joy";
|
||||||
import { availableLocales } from "@/i18n";
|
|
||||||
import { FC } from "react";
|
import { FC } from "react";
|
||||||
|
import { availableLocales } from "@/i18n";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
@ -2,22 +2,22 @@ import { Divider, Tooltip } from "@mui/joy";
|
|||||||
import { isEqual, uniqWith } from "lodash-es";
|
import { isEqual, uniqWith } from "lodash-es";
|
||||||
import { memo, useEffect, useRef, useState } from "react";
|
import { memo, useEffect, useRef, useState } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { useFilterStore, useMemoStore, useUserStore } from "@/store/module";
|
|
||||||
import { UNKNOWN_ID } from "@/helpers/consts";
|
import { UNKNOWN_ID } from "@/helpers/consts";
|
||||||
import { getRelativeTimeString } from "@/helpers/datetime";
|
import { getRelativeTimeString } from "@/helpers/datetime";
|
||||||
|
import { useFilterStore, useMemoStore, useUserStore } from "@/store/module";
|
||||||
import { useMemoCacheStore, useUserV1Store } from "@/store/v1";
|
import { useMemoCacheStore, useUserV1Store } from "@/store/v1";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
|
import showChangeMemoCreatedTsDialog from "./ChangeMemoCreatedTsDialog";
|
||||||
import { showCommonDialog } from "./Dialog/CommonDialog";
|
import { showCommonDialog } from "./Dialog/CommonDialog";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
import MemoContent from "./MemoContent";
|
import MemoContent from "./MemoContent";
|
||||||
import MemoResourceListView from "./MemoResourceListView";
|
|
||||||
import MemoRelationListView from "./MemoRelationListView";
|
|
||||||
import showShareMemo from "./ShareMemoDialog";
|
|
||||||
import showPreviewImageDialog from "./PreviewImageDialog";
|
|
||||||
import showChangeMemoCreatedTsDialog from "./ChangeMemoCreatedTsDialog";
|
|
||||||
import showMemoEditorDialog from "./MemoEditor/MemoEditorDialog";
|
import showMemoEditorDialog from "./MemoEditor/MemoEditorDialog";
|
||||||
|
import MemoRelationListView from "./MemoRelationListView";
|
||||||
|
import MemoResourceListView from "./MemoResourceListView";
|
||||||
|
import showPreviewImageDialog from "./PreviewImageDialog";
|
||||||
|
import showShareMemo from "./ShareMemoDialog";
|
||||||
import UserAvatar from "./UserAvatar";
|
import UserAvatar from "./UserAvatar";
|
||||||
import "@/less/memo.less";
|
import "@/less/memo.less";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import Icon from "@/components/Icon";
|
|
||||||
import Textarea from "@mui/joy/Textarea/Textarea";
|
import Textarea from "@mui/joy/Textarea/Textarea";
|
||||||
|
import Icon from "@/components/Icon";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { Message } from "@/store/v1/message";
|
|
||||||
import { marked } from "@/labs/marked";
|
|
||||||
import Icon from "@/components/Icon";
|
|
||||||
import Dropdown from "../kit/Dropdown";
|
|
||||||
import { useMemoStore } from "@/store/module";
|
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
|
import Icon from "@/components/Icon";
|
||||||
|
import { marked } from "@/labs/marked";
|
||||||
|
import { useMemoStore } from "@/store/module";
|
||||||
|
import { Message } from "@/store/v1/message";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
|
import Dropdown from "../kit/Dropdown";
|
||||||
|
|
||||||
interface MessageProps {
|
interface MessageProps {
|
||||||
index: number;
|
index: number;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Conversation } from "@/store/v1/conversation";
|
|
||||||
import Icon from "@/components/Icon";
|
import Icon from "@/components/Icon";
|
||||||
|
import { Conversation } from "@/store/v1/conversation";
|
||||||
|
|
||||||
interface ConversationTabProps {
|
interface ConversationTabProps {
|
||||||
item: Conversation;
|
item: Conversation;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { marked } from "@/labs/marked";
|
import { marked } from "@/labs/marked";
|
||||||
import { useUserStore } from "@/store/module";
|
import { useUserStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
import "@/less/memo-content.less";
|
import "@/less/memo-content.less";
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { toLower } from "lodash-es";
|
import { toLower } from "lodash-es";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import Selector from "@/components/kit/Selector";
|
||||||
import { VISIBILITY_SELECTOR_ITEMS } from "@/helpers/consts";
|
import { VISIBILITY_SELECTOR_ITEMS } from "@/helpers/consts";
|
||||||
import { useGlobalStore } from "@/store/module";
|
import { useGlobalStore } from "@/store/module";
|
||||||
import Selector from "@/components/kit/Selector";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
value: Visibility;
|
value: Visibility;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useTagStore } from "@/store/module";
|
|
||||||
import Icon from "@/components/Icon";
|
import Icon from "@/components/Icon";
|
||||||
|
import { useTagStore } from "@/store/module";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
onTagSelectorClick: (tag: string) => void;
|
onTagSelectorClick: (tag: string) => void;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { useTagStore } from "@/store/module";
|
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import getCaretCoordinates from "textarea-caret";
|
import getCaretCoordinates from "textarea-caret";
|
||||||
|
import { useTagStore } from "@/store/module";
|
||||||
import { EditorRefActions } from ".";
|
import { EditorRefActions } from ".";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@ -59,14 +59,14 @@ const TagSuggestions = ({ editorRef, editorActions }: Props) => {
|
|||||||
if (!position || !suggestions.length) return null;
|
if (!position || !suggestions.length) return null;
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="z-2 absolute rounded font-mono bg-zinc-200 dark:bg-zinc-600"
|
className="z-2 p-1 absolute max-w-[12rem] rounded font-mono shadow bg-zinc-200 dark:bg-zinc-600"
|
||||||
style={{ left: position.left - 6, top: position.top + position.height + 2 }}
|
style={{ left: position.left - 6, top: position.top + position.height + 2 }}
|
||||||
>
|
>
|
||||||
{suggestions.map((tag) => (
|
{suggestions.map((tag) => (
|
||||||
<div
|
<div
|
||||||
key={tag}
|
key={tag}
|
||||||
onMouseDown={() => handleSelection(tag)}
|
onMouseDown={() => handleSelection(tag)}
|
||||||
className="rounded p-1 px-2 z-1000 text-sm dark:text-gray-300 cursor-pointer hover:bg-zinc-300 dark:hover:bg-zinc-700"
|
className="rounded p-1 px-2 w-full truncate text-sm dark:text-gray-300 cursor-pointer hover:bg-zinc-300 dark:hover:bg-zinc-700"
|
||||||
>
|
>
|
||||||
#{tag}
|
#{tag}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
|
import MemoEditor from ".";
|
||||||
import { generateDialog } from "../Dialog";
|
import { generateDialog } from "../Dialog";
|
||||||
import Icon from "../Icon";
|
import Icon from "../Icon";
|
||||||
import MemoEditor from ".";
|
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
|
|
||||||
interface Props extends DialogProps {
|
interface Props extends DialogProps {
|
||||||
memoId?: MemoId;
|
memoId?: MemoId;
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
import { isNumber, last, uniq } from "lodash-es";
|
import { isNumber, last, 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 { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { getMatchedNodes } from "@/labs/marked";
|
|
||||||
import { upsertMemoResource } from "@/helpers/api";
|
import { upsertMemoResource } from "@/helpers/api";
|
||||||
import { TAB_SPACE_WIDTH, UNKNOWN_ID } from "@/helpers/consts";
|
import { TAB_SPACE_WIDTH, UNKNOWN_ID } from "@/helpers/consts";
|
||||||
import { useFilterStore, useGlobalStore, useMemoStore, useResourceStore, useTagStore, useUserStore } from "@/store/module";
|
|
||||||
import { clearContentQueryParam } from "@/helpers/utils";
|
import { clearContentQueryParam } from "@/helpers/utils";
|
||||||
import Icon from "../Icon";
|
import { getMatchedNodes } from "@/labs/marked";
|
||||||
import Editor, { EditorRefActions } from "./Editor";
|
import { useFilterStore, useGlobalStore, useMemoStore, useResourceStore, useTagStore, useUserStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import showCreateResourceDialog from "../CreateResourceDialog";
|
import showCreateResourceDialog from "../CreateResourceDialog";
|
||||||
import TagSelector from "./ActionButton/TagSelector";
|
import Icon from "../Icon";
|
||||||
import MemoVisibilitySelector from "./ActionButton/MemoVisibilitySelector";
|
import MemoVisibilitySelector from "./ActionButton/MemoVisibilitySelector";
|
||||||
import ResourceListView from "./ResourceListView";
|
import TagSelector from "./ActionButton/TagSelector";
|
||||||
|
import Editor, { EditorRefActions } from "./Editor";
|
||||||
import RelationListView from "./RelationListView";
|
import RelationListView from "./RelationListView";
|
||||||
|
import ResourceListView from "./ResourceListView";
|
||||||
import "@/less/memo-editor.less";
|
import "@/less/memo-editor.less";
|
||||||
|
|
||||||
const listItemSymbolList = ["- [ ] ", "- [x] ", "- [X] ", "* ", "- "];
|
const listItemSymbolList = ["- [ ] ", "- [x] ", "- [X] ", "* ", "- "];
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
import { useFilterStore, useShortcutStore } from "@/store/module";
|
|
||||||
import { getDateString } from "@/helpers/datetime";
|
import { getDateString } from "@/helpers/datetime";
|
||||||
import { getTextWithMemoType } from "@/helpers/filter";
|
import { getTextWithMemoType } from "@/helpers/filter";
|
||||||
|
import { useFilterStore, useShortcutStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
import "@/less/memo-filter.less";
|
import "@/less/memo-filter.less";
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
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 { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useFilterStore, useMemoStore, useShortcutStore, useUserStore } from "@/store/module";
|
|
||||||
import { TAG_REG, LINK_REG, PLAIN_LINK_REG } from "@/labs/marked/parser";
|
|
||||||
import { getTimeStampByDate } from "@/helpers/datetime";
|
|
||||||
import { DEFAULT_MEMO_LIMIT } from "@/helpers/consts";
|
import { DEFAULT_MEMO_LIMIT } from "@/helpers/consts";
|
||||||
|
import { getTimeStampByDate } from "@/helpers/datetime";
|
||||||
import { checkShouldShowMemoWithFilters } from "@/helpers/filter";
|
import { checkShouldShowMemoWithFilters } from "@/helpers/filter";
|
||||||
|
import { LINK_REG, PLAIN_LINK_REG, TAG_REG } from "@/labs/marked/parser";
|
||||||
|
import { useFilterStore, useMemoStore, useShortcutStore, useUserStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import Empty from "./Empty";
|
import Empty from "./Empty";
|
||||||
import Memo from "./Memo";
|
import Memo from "./Memo";
|
||||||
import "@/less/memo-list.less";
|
import "@/less/memo-list.less";
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import { ImageList, ImageListItem, useMediaQuery } from "@mui/material";
|
||||||
import { absolutifyLink } from "@/helpers/utils";
|
import { absolutifyLink } from "@/helpers/utils";
|
||||||
import { getResourceUrl } from "@/utils/resource";
|
import { getResourceUrl } from "@/utils/resource";
|
||||||
import SquareDiv from "./kit/SquareDiv";
|
import SquareDiv from "./kit/SquareDiv";
|
||||||
import showPreviewImageDialog from "./PreviewImageDialog";
|
|
||||||
import MemoResource from "./MemoResource";
|
import MemoResource from "./MemoResource";
|
||||||
|
import showPreviewImageDialog from "./PreviewImageDialog";
|
||||||
import "@/less/memo-resources.less";
|
import "@/less/memo-resources.less";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@ -22,10 +23,14 @@ const MemoResourceListView: React.FC<Props> = (props: Props) => {
|
|||||||
...getDefaultProps(),
|
...getDefaultProps(),
|
||||||
...props,
|
...props,
|
||||||
};
|
};
|
||||||
const availableResourceList = resourceList.filter((resource) => resource.type.startsWith("image") || resource.type.startsWith("video"));
|
const matches = useMediaQuery("(min-width:640px)");
|
||||||
const otherResourceList = resourceList.filter((resource) => !availableResourceList.includes(resource));
|
const imageResourceList = resourceList.filter((resource) => resource.type.startsWith("image"));
|
||||||
|
const videoResourceList = resourceList.filter((resource) => resource.type.startsWith("video"));
|
||||||
|
const otherResourceList = resourceList.filter(
|
||||||
|
(resource) => !imageResourceList.includes(resource) && !videoResourceList.includes(resource)
|
||||||
|
);
|
||||||
|
|
||||||
const imgUrls = availableResourceList
|
const imgUrls = imageResourceList
|
||||||
.filter((resource) => resource.type.startsWith("image"))
|
.filter((resource) => resource.type.startsWith("image"))
|
||||||
.map((resource) => {
|
.map((resource) => {
|
||||||
return getResourceUrl(resource);
|
return getResourceUrl(resource);
|
||||||
@ -38,23 +43,26 @@ const MemoResourceListView: React.FC<Props> = (props: Props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={`resource-wrapper ${className || ""}`}>
|
{imageResourceList.length > 0 && (
|
||||||
{availableResourceList.length > 0 && (
|
<div className="w-full mt-2">
|
||||||
<div className="images-wrapper">
|
<ImageList variant="masonry" cols={matches ? 3 : 2} gap={8}>
|
||||||
{availableResourceList.map((resource) => {
|
{imageResourceList.map((resource) => {
|
||||||
const url = getResourceUrl(resource);
|
const url = getResourceUrl(resource);
|
||||||
if (resource.type.startsWith("image")) {
|
|
||||||
return (
|
return (
|
||||||
<SquareDiv key={resource.id} className="memo-resource">
|
<ImageListItem onClick={() => handleImageClick(url)} key={resource.id}>
|
||||||
<img
|
<img className="shadow rounded" src={url} loading="lazy" />
|
||||||
src={resource.externalLink ? url : url + "?thumbnail=1"}
|
</ImageListItem>
|
||||||
onClick={() => handleImageClick(url)}
|
|
||||||
decoding="async"
|
|
||||||
loading="lazy"
|
|
||||||
/>
|
|
||||||
</SquareDiv>
|
|
||||||
);
|
);
|
||||||
} else if (resource.type.startsWith("video")) {
|
})}
|
||||||
|
</ImageList>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className={`resource-wrapper ${className || ""}`}>
|
||||||
|
{videoResourceList.length > 0 && (
|
||||||
|
<div className="images-wrapper">
|
||||||
|
{videoResourceList.map((resource) => {
|
||||||
|
const url = getResourceUrl(resource);
|
||||||
return (
|
return (
|
||||||
<SquareDiv key={resource.id} className="memo-resource">
|
<SquareDiv key={resource.id} className="memo-resource">
|
||||||
<video preload="metadata" controls key={resource.id}>
|
<video preload="metadata" controls key={resource.id}>
|
||||||
@ -62,13 +70,11 @@ const MemoResourceListView: React.FC<Props> = (props: Props) => {
|
|||||||
</video>
|
</video>
|
||||||
</SquareDiv>
|
</SquareDiv>
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{otherResourceList.length > 0 && (
|
{otherResourceList.length > 0 && (
|
||||||
<div className="w-full flex flex-row justify-start flex-wrap mt-2">
|
<div className="w-full flex flex-row justify-start flex-wrap mt-2">
|
||||||
{otherResourceList.map((resource) => {
|
{otherResourceList.map((resource) => {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useLayoutStore, useFilterStore, useShortcutStore } from "@/store/module";
|
import { useFilterStore, useLayoutStore, useShortcutStore } from "@/store/module";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { getDateTimeString } from "@/helpers/datetime";
|
import { getDateTimeString } from "@/helpers/datetime";
|
||||||
import Icon from "./Icon";
|
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
|
import Icon from "./Icon";
|
||||||
import "@/less/preview-image-dialog.less";
|
import "@/less/preview-image-dialog.less";
|
||||||
|
|
||||||
const MIN_SCALE = 0.5;
|
const MIN_SCALE = 0.5;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { getDateTimeString } from "@/helpers/datetime";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import { getDateTimeString } from "@/helpers/datetime";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
import ResourceCover from "./ResourceCover";
|
import ResourceCover from "./ResourceCover";
|
||||||
import ResourceItemDropdown from "./ResourceItemDropdown";
|
import ResourceItemDropdown from "./ResourceItemDropdown";
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import Icon from "./Icon";
|
|
||||||
import { getResourceUrl } from "@/utils/resource";
|
import { getResourceUrl } from "@/utils/resource";
|
||||||
import showPreviewImageDialog from "./PreviewImageDialog";
|
import Icon from "./Icon";
|
||||||
import SquareDiv from "./kit/SquareDiv";
|
import SquareDiv from "./kit/SquareDiv";
|
||||||
|
import showPreviewImageDialog from "./PreviewImageDialog";
|
||||||
import "@/less/resource-cover.less";
|
import "@/less/resource-cover.less";
|
||||||
|
|
||||||
interface ResourceCoverProps {
|
interface ResourceCoverProps {
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import copy from "copy-to-clipboard";
|
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 { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useResourceStore } from "@/store/module";
|
import { useResourceStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { getResourceUrl } from "@/utils/resource";
|
import { getResourceUrl } from "@/utils/resource";
|
||||||
import Dropdown from "./kit/Dropdown";
|
|
||||||
import Icon from "./Icon";
|
|
||||||
import { showCommonDialog } from "./Dialog/CommonDialog";
|
|
||||||
import showChangeResourceFilenameDialog from "./ChangeResourceFilenameDialog";
|
import showChangeResourceFilenameDialog from "./ChangeResourceFilenameDialog";
|
||||||
|
import { showCommonDialog } from "./Dialog/CommonDialog";
|
||||||
|
import Icon from "./Icon";
|
||||||
|
import Dropdown from "./kit/Dropdown";
|
||||||
import showPreviewImageDialog from "./PreviewImageDialog";
|
import showPreviewImageDialog from "./PreviewImageDialog";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useState, useRef } from "react";
|
import { useRef, useState } from "react";
|
||||||
|
import useDebounce from "@/hooks/useDebounce";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
import useDebounce from "@/hooks/useDebounce";
|
|
||||||
|
|
||||||
interface ResourceSearchBarProps {
|
interface ResourceSearchBarProps {
|
||||||
setQuery: (queryText: string) => void;
|
setQuery: (queryText: string) => void;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useEffect, useState, useRef } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import useDebounce from "@/hooks/useDebounce";
|
import useDebounce from "@/hooks/useDebounce";
|
||||||
import { useFilterStore } from "@/store/module";
|
import { useFilterStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
|
|
||||||
const SearchBar = () => {
|
const SearchBar = () => {
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { Button, Input } from "@mui/joy";
|
import { Button, 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 { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useUserStore } from "@/store/module";
|
|
||||||
import * as api from "@/helpers/api";
|
import * as api from "@/helpers/api";
|
||||||
import Dropdown from "../kit/Dropdown";
|
import { useUserStore } from "@/store/module";
|
||||||
import { showCommonDialog } from "../Dialog/CommonDialog";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import showChangeMemberPasswordDialog from "../ChangeMemberPasswordDialog";
|
import showChangeMemberPasswordDialog from "../ChangeMemberPasswordDialog";
|
||||||
|
import { showCommonDialog } from "../Dialog/CommonDialog";
|
||||||
|
import Dropdown from "../kit/Dropdown";
|
||||||
|
|
||||||
interface State {
|
interface State {
|
||||||
createUserUsername: string;
|
createUserUsername: string;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { Button, Input, Textarea } from "@mui/joy";
|
import { Button, Input, Textarea } from "@mui/joy";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useUserStore } from "@/store/module";
|
import { useUserStore } from "@/store/module";
|
||||||
import { showCommonDialog } from "../Dialog/CommonDialog";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import showChangePasswordDialog from "../ChangePasswordDialog";
|
import showChangePasswordDialog from "../ChangePasswordDialog";
|
||||||
|
import { showCommonDialog } from "../Dialog/CommonDialog";
|
||||||
import Icon from "../Icon";
|
import Icon from "../Icon";
|
||||||
import showUpdateAccountDialog from "../UpdateAccountDialog";
|
import showUpdateAccountDialog from "../UpdateAccountDialog";
|
||||||
import UserAvatar from "../UserAvatar";
|
import UserAvatar from "../UserAvatar";
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
|
import { Button, Input } 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 { useTranslate } from "@/utils/i18n";
|
|
||||||
import { Button, Input } from "@mui/joy";
|
|
||||||
import { useGlobalStore } from "@/store/module";
|
|
||||||
import * as api from "@/helpers/api";
|
import * as api from "@/helpers/api";
|
||||||
|
import { useGlobalStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import LearnMore from "../LearnMore";
|
import LearnMore from "../LearnMore";
|
||||||
import "@/less/settings/system-section.less";
|
import "@/less/settings/system-section.less";
|
||||||
|
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
import { Input, Button, Divider, Switch, Option, Select } from "@mui/joy";
|
import { Button, Divider, Input, Option, Select, Switch } from "@mui/joy";
|
||||||
import { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import React from "react";
|
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useGlobalStore, useUserStore } from "@/store/module";
|
|
||||||
import { VISIBILITY_SELECTOR_ITEMS } from "@/helpers/consts";
|
import { VISIBILITY_SELECTOR_ITEMS } from "@/helpers/consts";
|
||||||
|
import { useGlobalStore, useUserStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import AppearanceSelect from "../AppearanceSelect";
|
import AppearanceSelect from "../AppearanceSelect";
|
||||||
import LocaleSelect from "../LocaleSelect";
|
|
||||||
import LearnMore from "../LearnMore";
|
import LearnMore from "../LearnMore";
|
||||||
|
import LocaleSelect from "../LocaleSelect";
|
||||||
import "@/less/settings/preferences-section.less";
|
import "@/less/settings/preferences-section.less";
|
||||||
|
|
||||||
const PreferencesSection = () => {
|
const PreferencesSection = () => {
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { Divider } from "@mui/joy";
|
import { 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 { useTranslate } from "@/utils/i18n";
|
|
||||||
import * as api from "@/helpers/api";
|
import * as api from "@/helpers/api";
|
||||||
import showCreateIdentityProviderDialog from "../CreateIdentityProviderDialog";
|
|
||||||
import Dropdown from "../kit/Dropdown";
|
|
||||||
import { showCommonDialog } from "../Dialog/CommonDialog";
|
|
||||||
import LearnMore from "../LearnMore";
|
|
||||||
import { useGlobalStore } from "@/store/module";
|
import { useGlobalStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
|
import showCreateIdentityProviderDialog from "../CreateIdentityProviderDialog";
|
||||||
|
import { showCommonDialog } from "../Dialog/CommonDialog";
|
||||||
|
import Dropdown from "../kit/Dropdown";
|
||||||
|
import LearnMore from "../LearnMore";
|
||||||
|
|
||||||
interface State {
|
interface State {
|
||||||
disablePasswordLogin: boolean;
|
disablePasswordLogin: boolean;
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import { Divider, Select, Option } from "@mui/joy";
|
import { Divider, Option, Select } 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 { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useGlobalStore } from "@/store/module";
|
|
||||||
import * as api from "@/helpers/api";
|
import * as api from "@/helpers/api";
|
||||||
|
import { useGlobalStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import showCreateStorageServiceDialog from "../CreateStorageServiceDialog";
|
import showCreateStorageServiceDialog from "../CreateStorageServiceDialog";
|
||||||
import showUpdateLocalStorageDialog from "../UpdateLocalStorageDialog";
|
|
||||||
import Dropdown from "../kit/Dropdown";
|
|
||||||
import { showCommonDialog } from "../Dialog/CommonDialog";
|
import { showCommonDialog } from "../Dialog/CommonDialog";
|
||||||
|
import Dropdown from "../kit/Dropdown";
|
||||||
import LearnMore from "../LearnMore";
|
import LearnMore from "../LearnMore";
|
||||||
|
import showUpdateLocalStorageDialog from "../UpdateLocalStorageDialog";
|
||||||
|
|
||||||
const StorageSection = () => {
|
const StorageSection = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
|
import { Button, Divider, Input, Switch, Textarea, Tooltip } 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 { useTranslate } from "@/utils/i18n";
|
import * as api from "@/helpers/api";
|
||||||
import { Button, Divider, Input, Switch, Textarea, Tooltip } from "@mui/joy";
|
|
||||||
import { formatBytes } from "@/helpers/utils";
|
import { formatBytes } from "@/helpers/utils";
|
||||||
import { useGlobalStore } from "@/store/module";
|
import { useGlobalStore } from "@/store/module";
|
||||||
import * as api from "@/helpers/api";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import showUpdateCustomizedProfileDialog from "../UpdateCustomizedProfileDialog";
|
|
||||||
import Icon from "../Icon";
|
import Icon from "../Icon";
|
||||||
import LearnMore from "../LearnMore";
|
import LearnMore from "../LearnMore";
|
||||||
|
import showUpdateCustomizedProfileDialog from "../UpdateCustomizedProfileDialog";
|
||||||
import "@/less/settings/system-section.less";
|
import "@/less/settings/system-section.less";
|
||||||
import { showCommonDialog } from "../Dialog/CommonDialog";
|
import { showCommonDialog } from "../Dialog/CommonDialog";
|
||||||
import showDisablePasswordLoginDialog from "../DisablePasswordLoginDialog";
|
import showDisablePasswordLoginDialog from "../DisablePasswordLoginDialog";
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
import { Select, Option } from "@mui/joy";
|
import { Option, Select } from "@mui/joy";
|
||||||
|
import copy from "copy-to-clipboard";
|
||||||
|
import { toLower } from "lodash-es";
|
||||||
import { QRCodeSVG } from "qrcode.react";
|
import { QRCodeSVG } from "qrcode.react";
|
||||||
import React, { useEffect, useRef, useState } from "react";
|
import React, { useEffect, useRef, useState } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { getMemoStats } from "@/helpers/api";
|
||||||
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 { VISIBILITY_SELECTOR_ITEMS } from "@/helpers/consts";
|
||||||
import { getDateTimeString, getTimeStampByDate } from "@/helpers/datetime";
|
import { getDateTimeString, getTimeStampByDate } from "@/helpers/datetime";
|
||||||
import { getMemoStats } from "@/helpers/api";
|
|
||||||
import useLoading from "@/hooks/useLoading";
|
import useLoading from "@/hooks/useLoading";
|
||||||
import Icon from "./Icon";
|
import toImage from "@/labs/html2image";
|
||||||
|
import { useGlobalStore, useMemoStore, useUserStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
|
import showEmbedMemoDialog from "./EmbedMemoDialog";
|
||||||
|
import Icon from "./Icon";
|
||||||
import MemoContent from "./MemoContent";
|
import MemoContent from "./MemoContent";
|
||||||
import MemoResourceListView from "./MemoResourceListView";
|
import MemoResourceListView from "./MemoResourceListView";
|
||||||
import showEmbedMemoDialog from "./EmbedMemoDialog";
|
|
||||||
import "@/less/share-memo-dialog.less";
|
import "@/less/share-memo-dialog.less";
|
||||||
|
|
||||||
interface Props extends DialogProps {
|
interface Props extends DialogProps {
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useFilterStore, useShortcutStore } from "@/store/module";
|
|
||||||
import { getTimeStampByDate } from "@/helpers/datetime";
|
import { getTimeStampByDate } from "@/helpers/datetime";
|
||||||
import useToggle from "@/hooks/useToggle";
|
|
||||||
import useLoading from "@/hooks/useLoading";
|
import useLoading from "@/hooks/useLoading";
|
||||||
import Icon from "./Icon";
|
import useToggle from "@/hooks/useToggle";
|
||||||
|
import { useFilterStore, useShortcutStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import showCreateShortcutDialog from "./CreateShortcutDialog";
|
import showCreateShortcutDialog from "./CreateShortcutDialog";
|
||||||
|
import Icon from "./Icon";
|
||||||
|
|
||||||
const ShortcutList = () => {
|
const ShortcutList = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useFilterStore, useTagStore } from "@/store/module";
|
|
||||||
import useToggle from "@/hooks/useToggle";
|
import useToggle from "@/hooks/useToggle";
|
||||||
import Icon from "./Icon";
|
import { useFilterStore, useTagStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import showCreateTagDialog from "./CreateTagDialog";
|
import showCreateTagDialog from "./CreateTagDialog";
|
||||||
|
import Icon from "./Icon";
|
||||||
|
|
||||||
interface Tag {
|
interface Tag {
|
||||||
key: string;
|
key: string;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { isEqual } from "lodash-es";
|
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 { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useUserStore } from "@/store/module";
|
|
||||||
import { convertFileToBase64 } from "@/helpers/utils";
|
import { convertFileToBase64 } from "@/helpers/utils";
|
||||||
import Icon from "./Icon";
|
import { useUserStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
|
import Icon from "./Icon";
|
||||||
import UserAvatar from "./UserAvatar";
|
import UserAvatar from "./UserAvatar";
|
||||||
|
|
||||||
type Props = DialogProps;
|
type Props = DialogProps;
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import { Button, Input } from "@mui/joy";
|
import { Button, Input } from "@mui/joy";
|
||||||
import { useState } from "react";
|
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { toast } from "react-hot-toast";
|
|
||||||
import { useGlobalStore } from "@/store/module";
|
|
||||||
import * as api from "@/helpers/api";
|
|
||||||
import Textarea from "@mui/joy/Textarea/Textarea";
|
import Textarea from "@mui/joy/Textarea/Textarea";
|
||||||
import Icon from "./Icon";
|
import { useState } from "react";
|
||||||
import { generateDialog } from "./Dialog";
|
import { toast } from "react-hot-toast";
|
||||||
import LocaleSelect from "./LocaleSelect";
|
import * as api from "@/helpers/api";
|
||||||
|
import { useGlobalStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import AppearanceSelect from "./AppearanceSelect";
|
import AppearanceSelect from "./AppearanceSelect";
|
||||||
|
import { generateDialog } from "./Dialog";
|
||||||
|
import Icon from "./Icon";
|
||||||
|
import LocaleSelect from "./LocaleSelect";
|
||||||
|
|
||||||
type Props = DialogProps;
|
type Props = DialogProps;
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { Button, Input } from "@mui/joy";
|
import { Button, Input } from "@mui/joy";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { useGlobalStore } from "@/store/module";
|
|
||||||
import * as api from "@/helpers/api";
|
import * as api from "@/helpers/api";
|
||||||
|
import { useGlobalStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
import LearnMore from "./LearnMore";
|
import LearnMore from "./LearnMore";
|
||||||
|
@ -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 { useTranslate } from "@/utils/i18n";
|
|
||||||
import { getMemoStats } from "@/helpers/api";
|
import { getMemoStats } from "@/helpers/api";
|
||||||
import { DAILY_TIMESTAMP } from "@/helpers/consts";
|
import { DAILY_TIMESTAMP } from "@/helpers/consts";
|
||||||
import { getDateStampByDate, getDateString, getTimeStampByDate } from "@/helpers/datetime";
|
import { getDateStampByDate, getDateString, getTimeStampByDate } from "@/helpers/datetime";
|
||||||
import * as utils from "@/helpers/utils";
|
import * as utils from "@/helpers/utils";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
|
import { useFilterStore, useMemoStore, useUserStore } from "../store/module";
|
||||||
import "@/less/usage-heat-map.less";
|
import "@/less/usage-heat-map.less";
|
||||||
|
|
||||||
const tableConfig = {
|
const tableConfig = {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useGlobalStore, useUserStore } from "@/store/module";
|
import { useGlobalStore, useUserStore } from "@/store/module";
|
||||||
import Dropdown from "./kit/Dropdown";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import Icon from "./Icon";
|
|
||||||
import UserAvatar from "./UserAvatar";
|
|
||||||
import showAboutSiteDialog from "./AboutSiteDialog";
|
import showAboutSiteDialog from "./AboutSiteDialog";
|
||||||
|
import Icon from "./Icon";
|
||||||
|
import Dropdown from "./kit/Dropdown";
|
||||||
|
import UserAvatar from "./UserAvatar";
|
||||||
|
|
||||||
const UserBanner = () => {
|
const UserBanner = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { Badge, Button } from "@mui/joy";
|
import { Badge, Button } from "@mui/joy";
|
||||||
|
import classNames from "classnames";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { DAILY_TIMESTAMP } from "@/helpers/consts";
|
|
||||||
import { getMemoStats } from "@/helpers/api";
|
import { getMemoStats } from "@/helpers/api";
|
||||||
|
import { DAILY_TIMESTAMP } from "@/helpers/consts";
|
||||||
import { getDateStampByDate, isFutureDate } from "@/helpers/datetime";
|
import { getDateStampByDate, isFutureDate } from "@/helpers/datetime";
|
||||||
import { useUserStore } from "@/store/module";
|
import { useUserStore } from "@/store/module";
|
||||||
import classNames from "classnames";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import Icon from "../Icon";
|
import Icon from "../Icon";
|
||||||
import "@/less/common/date-picker.less";
|
import "@/less/common/date-picker.less";
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Tooltip } from "@mui/joy";
|
import { Tooltip } from "@mui/joy";
|
||||||
import { memo, useEffect, useRef } from "react";
|
import { memo, useEffect, useRef } from "react";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import useToggle from "@/hooks/useToggle";
|
import useToggle from "@/hooks/useToggle";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import Icon from "../Icon";
|
import Icon from "../Icon";
|
||||||
import "@/less/common/selector.less";
|
import "@/less/common/selector.less";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
import { LINK_REG, PLAIN_LINK_REG, TAG_REG } from "@/labs/marked/parser";
|
||||||
import { getUnixTimeMillis } from "./datetime";
|
import { getUnixTimeMillis } from "./datetime";
|
||||||
import { TAG_REG, LINK_REG, PLAIN_LINK_REG } from "@/labs/marked/parser";
|
|
||||||
|
|
||||||
export const relationConsts = [
|
export const relationConsts = [
|
||||||
{ text: "filter.and", value: "AND" },
|
{ text: "filter.and", value: "AND" },
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect, useRef, EffectCallback, DependencyList } from "react";
|
import React, { DependencyList, EffectCallback, useEffect, useRef } from "react";
|
||||||
|
|
||||||
const useIsoMorphicEffect = (effect: EffectCallback, deps?: DependencyList | undefined) => {
|
const useIsoMorphicEffect = (effect: EffectCallback, deps?: DependencyList | undefined) => {
|
||||||
useEffect(effect, deps);
|
useEffect(effect, deps);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import i18n, { FallbackLng, FallbackLngObjList } from "i18next";
|
import i18n, { FallbackLng, FallbackLngObjList } from "i18next";
|
||||||
import { initReactI18next } from "react-i18next";
|
|
||||||
import LanguageDetector from "i18next-browser-languagedetector";
|
import LanguageDetector from "i18next-browser-languagedetector";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
|
import { initReactI18next } from "react-i18next";
|
||||||
|
|
||||||
export const availableLocales = [
|
export const availableLocales = [
|
||||||
"de",
|
"de",
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import copy from "copy-to-clipboard";
|
import copy from "copy-to-clipboard";
|
||||||
import hljs from "highlight.js";
|
import hljs from "highlight.js";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { matcher } from "../matcher";
|
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
|
import { matcher } from "../matcher";
|
||||||
|
|
||||||
export const CODE_BLOCK_REG = /^```(\S*?)\s([\s\S]*?)```/;
|
export const CODE_BLOCK_REG = /^```(\S*?)\s([\s\S]*?)```/;
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import Emphasis from "./Emphasis";
|
|
||||||
import Bold from "./Bold";
|
|
||||||
import { marked } from "..";
|
import { marked } from "..";
|
||||||
import InlineCode from "./InlineCode";
|
|
||||||
import BoldEmphasis from "./BoldEmphasis";
|
|
||||||
import PlainText from "./PlainText";
|
|
||||||
import { matcher } from "../matcher";
|
import { matcher } from "../matcher";
|
||||||
|
import Bold from "./Bold";
|
||||||
|
import BoldEmphasis from "./BoldEmphasis";
|
||||||
|
import Emphasis from "./Emphasis";
|
||||||
|
import InlineCode from "./InlineCode";
|
||||||
|
import PlainText from "./PlainText";
|
||||||
|
|
||||||
export const LINK_REG = /\[([^\]]+)\]\(([^)]+)\)/;
|
export const LINK_REG = /\[([^\]]+)\]\(([^)]+)\)/;
|
||||||
|
|
||||||
|
@ -1,23 +1,23 @@
|
|||||||
import CodeBlock from "./CodeBlock";
|
|
||||||
import TodoList from "./TodoList";
|
|
||||||
import DoneList from "./DoneList";
|
|
||||||
import OrderedList from "./OrderedList";
|
|
||||||
import UnorderedList from "./UnorderedList";
|
|
||||||
import Paragraph from "./Paragraph";
|
|
||||||
import Br from "./Br";
|
|
||||||
import Tag from "./Tag";
|
|
||||||
import Image from "./Image";
|
|
||||||
import Link from "./Link";
|
|
||||||
import Bold from "./Bold";
|
|
||||||
import Emphasis from "./Emphasis";
|
|
||||||
import PlainLink from "./PlainLink";
|
|
||||||
import InlineCode from "./InlineCode";
|
|
||||||
import PlainText from "./PlainText";
|
|
||||||
import BoldEmphasis from "./BoldEmphasis";
|
|
||||||
import Blockquote from "./Blockquote";
|
import Blockquote from "./Blockquote";
|
||||||
import HorizontalRules from "./HorizontalRules";
|
import Bold from "./Bold";
|
||||||
import Strikethrough from "./Strikethrough";
|
import BoldEmphasis from "./BoldEmphasis";
|
||||||
|
import Br from "./Br";
|
||||||
|
import CodeBlock from "./CodeBlock";
|
||||||
|
import DoneList from "./DoneList";
|
||||||
|
import Emphasis from "./Emphasis";
|
||||||
import Heading from "./Heading";
|
import Heading from "./Heading";
|
||||||
|
import HorizontalRules from "./HorizontalRules";
|
||||||
|
import Image from "./Image";
|
||||||
|
import InlineCode from "./InlineCode";
|
||||||
|
import Link from "./Link";
|
||||||
|
import OrderedList from "./OrderedList";
|
||||||
|
import Paragraph from "./Paragraph";
|
||||||
|
import PlainLink from "./PlainLink";
|
||||||
|
import PlainText from "./PlainText";
|
||||||
|
import Strikethrough from "./Strikethrough";
|
||||||
|
import Tag from "./Tag";
|
||||||
|
import TodoList from "./TodoList";
|
||||||
|
import UnorderedList from "./UnorderedList";
|
||||||
|
|
||||||
export { TAG_REG } from "./Tag";
|
export { TAG_REG } from "./Tag";
|
||||||
export { LINK_REG } from "./Link";
|
export { LINK_REG } from "./Link";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Outlet } from "react-router-dom";
|
import { Outlet } from "react-router-dom";
|
||||||
import Header from "@/components/Header";
|
|
||||||
import DemoBanner from "@/components/DemoBanner";
|
import DemoBanner from "@/components/DemoBanner";
|
||||||
|
import Header from "@/components/Header";
|
||||||
|
|
||||||
function Root() {
|
function Root() {
|
||||||
return (
|
return (
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { CssVarsProvider } from "@mui/joy";
|
import { CssVarsProvider } from "@mui/joy";
|
||||||
import { createRoot } from "react-dom/client";
|
import { createRoot } from "react-dom/client";
|
||||||
import { Provider } from "react-redux";
|
import { Provider } from "react-redux";
|
||||||
import store from "./store";
|
|
||||||
import App from "./App";
|
import App from "./App";
|
||||||
|
import store from "./store";
|
||||||
import theme from "./theme";
|
import theme from "./theme";
|
||||||
import "./helpers/polyfill";
|
import "./helpers/polyfill";
|
||||||
import "./i18n";
|
import "./i18n";
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import { useFilterStore, useMemoStore } from "@/store/module";
|
|
||||||
import useLoading from "@/hooks/useLoading";
|
|
||||||
import ArchivedMemo from "@/components/ArchivedMemo";
|
import ArchivedMemo from "@/components/ArchivedMemo";
|
||||||
import MobileHeader from "@/components/MobileHeader";
|
|
||||||
import Empty from "@/components/Empty";
|
import Empty from "@/components/Empty";
|
||||||
import SearchBar from "@/components/SearchBar";
|
|
||||||
import MemoFilter from "@/components/MemoFilter";
|
import MemoFilter from "@/components/MemoFilter";
|
||||||
|
import MobileHeader from "@/components/MobileHeader";
|
||||||
|
import SearchBar from "@/components/SearchBar";
|
||||||
|
import useLoading from "@/hooks/useLoading";
|
||||||
|
import { useFilterStore, useMemoStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import "@/less/archived.less";
|
import "@/less/archived.less";
|
||||||
|
|
||||||
const Archived = () => {
|
const Archived = () => {
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import { Button, Divider, Input } from "@mui/joy";
|
import { Button, Divider, Input } 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 { useTranslate } from "@/utils/i18n";
|
import AppearanceSelect from "@/components/AppearanceSelect";
|
||||||
import { useGlobalStore, useUserStore } from "@/store/module";
|
import Icon from "@/components/Icon";
|
||||||
|
import LocaleSelect from "@/components/LocaleSelect";
|
||||||
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 { useGlobalStore, useUserStore } from "@/store/module";
|
||||||
import AppearanceSelect from "@/components/AppearanceSelect";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import LocaleSelect from "@/components/LocaleSelect";
|
|
||||||
|
|
||||||
const Auth = () => {
|
const Auth = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { last } from "lodash-es";
|
import { last } 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 { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useSearchParams } from "react-router-dom";
|
import { useSearchParams } from "react-router-dom";
|
||||||
|
import Icon from "@/components/Icon";
|
||||||
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 { useTranslate } from "@/utils/i18n";
|
||||||
|
|
||||||
interface State {
|
interface State {
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
|
@ -1,21 +1,20 @@
|
|||||||
|
import classNames from "classnames";
|
||||||
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 { useTranslate } from "@/utils/i18n";
|
import DailyMemo from "@/components/DailyMemo";
|
||||||
import { useMemoStore, useUserStore } from "@/store/module";
|
import Empty from "@/components/Empty";
|
||||||
import { DAILY_TIMESTAMP, DEFAULT_MEMO_LIMIT } from "@/helpers/consts";
|
|
||||||
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 Icon from "@/components/Icon";
|
||||||
import DatePicker from "@/components/kit/DatePicker";
|
import DatePicker from "@/components/kit/DatePicker";
|
||||||
import DailyMemo from "@/components/DailyMemo";
|
import MobileHeader from "@/components/MobileHeader";
|
||||||
import i18n from "@/i18n";
|
import showPreviewImageDialog from "@/components/PreviewImageDialog";
|
||||||
import { findNearestLanguageMatch } from "@/utils/i18n";
|
import { DAILY_TIMESTAMP, DEFAULT_MEMO_LIMIT } from "@/helpers/consts";
|
||||||
import { convertToMillis, getDateStampByDate, getNormalizedDateString, getTimeStampByDate, isFutureDate } from "@/helpers/datetime";
|
import { convertToMillis, getDateStampByDate, getNormalizedDateString, getTimeStampByDate, isFutureDate } from "@/helpers/datetime";
|
||||||
import Empty from "@/components/Empty";
|
import useToggle from "@/hooks/useToggle";
|
||||||
import classNames from "classnames";
|
import i18n from "@/i18n";
|
||||||
|
import toImage from "@/labs/html2image";
|
||||||
|
import { useMemoStore, useUserStore } from "@/store/module";
|
||||||
|
import { findNearestLanguageMatch, useTranslate } from "@/utils/i18n";
|
||||||
|
|
||||||
const DailyReview = () => {
|
const DailyReview = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
|
@ -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 { useParams } from "react-router-dom";
|
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 MemoContent from "@/components/MemoContent";
|
||||||
import MemoResourceListView from "@/components/MemoResourceListView";
|
import MemoResourceListView from "@/components/MemoResourceListView";
|
||||||
|
import { UNKNOWN_ID } from "@/helpers/consts";
|
||||||
import { getDateTimeString } from "@/helpers/datetime";
|
import { getDateTimeString } from "@/helpers/datetime";
|
||||||
|
import useLoading from "@/hooks/useLoading";
|
||||||
|
import { useMemoStore } from "@/store/module";
|
||||||
|
|
||||||
interface State {
|
interface State {
|
||||||
memo: Memo;
|
memo: Memo;
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
import { useFilterStore, useGlobalStore, useMemoStore } from "@/store/module";
|
import Empty from "@/components/Empty";
|
||||||
import { TAG_REG } from "@/labs/marked/parser";
|
import Memo from "@/components/Memo";
|
||||||
|
import MemoFilter from "@/components/MemoFilter";
|
||||||
|
import MobileHeader from "@/components/MobileHeader";
|
||||||
|
import SearchBar from "@/components/SearchBar";
|
||||||
import { DEFAULT_MEMO_LIMIT } from "@/helpers/consts";
|
import { DEFAULT_MEMO_LIMIT } from "@/helpers/consts";
|
||||||
import useLoading from "@/hooks/useLoading";
|
import useLoading from "@/hooks/useLoading";
|
||||||
import MemoFilter from "@/components/MemoFilter";
|
import { TAG_REG } from "@/labs/marked/parser";
|
||||||
import Memo from "@/components/Memo";
|
import { useFilterStore, useGlobalStore, useMemoStore } from "@/store/module";
|
||||||
import MobileHeader from "@/components/MobileHeader";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import Empty from "@/components/Empty";
|
|
||||||
import SearchBar from "@/components/SearchBar";
|
|
||||||
|
|
||||||
const Explore = () => {
|
const Explore = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import HomeSidebar from "@/components/HomeSidebar";
|
||||||
import { useGlobalStore, useUserStore } from "@/store/module";
|
|
||||||
import MemoEditor from "@/components/MemoEditor";
|
import MemoEditor from "@/components/MemoEditor";
|
||||||
import MemoFilter from "@/components/MemoFilter";
|
import MemoFilter from "@/components/MemoFilter";
|
||||||
import MemoList from "@/components/MemoList";
|
import MemoList from "@/components/MemoList";
|
||||||
import MobileHeader from "@/components/MobileHeader";
|
import MobileHeader from "@/components/MobileHeader";
|
||||||
import HomeSidebar from "@/components/HomeSidebar";
|
import { useGlobalStore, useUserStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
|
|
||||||
const Home = () => {
|
const Home = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
import { Button, Stack } from "@mui/joy";
|
|
||||||
import { fetchEventSource } from "@microsoft/fetch-event-source";
|
import { fetchEventSource } from "@microsoft/fetch-event-source";
|
||||||
|
import { Button, Stack } from "@mui/joy";
|
||||||
import { head } from "lodash-es";
|
import { head } from "lodash-es";
|
||||||
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 { useTranslate } from "@/utils/i18n";
|
import Empty from "@/components/Empty";
|
||||||
|
import Icon from "@/components/Icon";
|
||||||
|
import ChatInput from "@/components/MemoChat/ChatInput";
|
||||||
|
import ChatMessage from "@/components/MemoChat/ChatMessage";
|
||||||
|
import ConversationTab from "@/components/MemoChat/ConversationTab";
|
||||||
|
import MobileHeader from "@/components/MobileHeader";
|
||||||
import * as api from "@/helpers/api";
|
import * as api from "@/helpers/api";
|
||||||
import useLoading from "@/hooks/useLoading";
|
import useLoading from "@/hooks/useLoading";
|
||||||
import { Message, useMessageStore } from "@/store/v1/message";
|
|
||||||
import { Conversation, useConversationStore } from "@/store/v1/conversation";
|
import { Conversation, useConversationStore } from "@/store/v1/conversation";
|
||||||
import Icon from "@/components/Icon";
|
import { Message, useMessageStore } from "@/store/v1/message";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { generateUUID } from "@/utils/uuid";
|
import { generateUUID } from "@/utils/uuid";
|
||||||
import MobileHeader from "@/components/MobileHeader";
|
|
||||||
import ChatMessage from "@/components/MemoChat/ChatMessage";
|
|
||||||
import ChatInput from "@/components/MemoChat/ChatInput";
|
|
||||||
import ConversationTab from "@/components/MemoChat/ConversationTab";
|
|
||||||
import Empty from "@/components/Empty";
|
|
||||||
|
|
||||||
const chatStreaming = async (messageList: Array<Message>, onmessage: any, onclose: any) => {
|
const chatStreaming = async (messageList: Array<Message>, onmessage: any, onclose: any) => {
|
||||||
await fetchEventSource("/api/v1/openai/chat-streaming", {
|
await fetchEventSource("/api/v1/openai/chat-streaming", {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { Link, useLocation, useParams } from "react-router-dom";
|
import { Link, useLocation, useParams } from "react-router-dom";
|
||||||
import { useGlobalStore, useMemoStore } from "@/store/module";
|
|
||||||
import useLoading from "@/hooks/useLoading";
|
|
||||||
import Icon from "@/components/Icon";
|
import Icon from "@/components/Icon";
|
||||||
import Memo from "@/components/Memo";
|
import Memo from "@/components/Memo";
|
||||||
|
import useLoading from "@/hooks/useLoading";
|
||||||
|
import { useGlobalStore, useMemoStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
|
|
||||||
const MemoDetail = () => {
|
const MemoDetail = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import "@/less/not-found.less";
|
import "@/less/not-found.less";
|
||||||
|
|
||||||
const NotFound = () => {
|
const NotFound = () => {
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
import { Button } from "@mui/joy";
|
import { Button } from "@mui/joy";
|
||||||
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 { useTranslate } from "@/utils/i18n";
|
|
||||||
import { DEFAULT_MEMO_LIMIT } from "@/helpers/consts";
|
|
||||||
import useLoading from "@/hooks/useLoading";
|
|
||||||
import useEvent from "@/hooks/useEvent";
|
|
||||||
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/kit/Dropdown";
|
|
||||||
import ResourceItem from "@/components/ResourceItem";
|
|
||||||
import { showCommonDialog } from "@/components/Dialog/CommonDialog";
|
|
||||||
import showCreateResourceDialog from "@/components/CreateResourceDialog";
|
import showCreateResourceDialog from "@/components/CreateResourceDialog";
|
||||||
|
import { showCommonDialog } from "@/components/Dialog/CommonDialog";
|
||||||
import Empty from "@/components/Empty";
|
import Empty from "@/components/Empty";
|
||||||
|
import Icon from "@/components/Icon";
|
||||||
|
import Dropdown from "@/components/kit/Dropdown";
|
||||||
|
import MobileHeader from "@/components/MobileHeader";
|
||||||
|
import ResourceCard from "@/components/ResourceCard";
|
||||||
|
import ResourceItem from "@/components/ResourceItem";
|
||||||
|
import ResourceSearchBar from "@/components/ResourceSearchBar";
|
||||||
|
import { DEFAULT_MEMO_LIMIT } from "@/helpers/consts";
|
||||||
|
import useEvent from "@/hooks/useEvent";
|
||||||
|
import useLoading from "@/hooks/useLoading";
|
||||||
|
import { useResourceStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
|
|
||||||
const ResourcesDashboard = () => {
|
const ResourcesDashboard = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
import { Option, Select } from "@mui/joy";
|
import { Option, Select } from "@mui/joy";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
|
||||||
import { useGlobalStore, useUserStore } from "@/store/module";
|
|
||||||
import Icon from "@/components/Icon";
|
|
||||||
import BetaBadge from "@/components/BetaBadge";
|
import BetaBadge from "@/components/BetaBadge";
|
||||||
import MyAccountSection from "@/components/Settings/MyAccountSection";
|
import Icon from "@/components/Icon";
|
||||||
import PreferencesSection from "@/components/Settings/PreferencesSection";
|
|
||||||
import MemberSection from "@/components/Settings/MemberSection";
|
|
||||||
import SystemSection from "@/components/Settings/SystemSection";
|
|
||||||
import OpenAISection from "@/components/Settings/OpenAISection";
|
|
||||||
import StorageSection from "@/components/Settings/StorageSection";
|
|
||||||
import SSOSection from "@/components/Settings/SSOSection";
|
|
||||||
import MobileHeader from "@/components/MobileHeader";
|
import MobileHeader from "@/components/MobileHeader";
|
||||||
|
import MemberSection from "@/components/Settings/MemberSection";
|
||||||
|
import MyAccountSection from "@/components/Settings/MyAccountSection";
|
||||||
|
import OpenAISection from "@/components/Settings/OpenAISection";
|
||||||
|
import PreferencesSection from "@/components/Settings/PreferencesSection";
|
||||||
|
import SSOSection from "@/components/Settings/SSOSection";
|
||||||
|
import StorageSection from "@/components/Settings/StorageSection";
|
||||||
|
import SystemSection from "@/components/Settings/SystemSection";
|
||||||
|
import { useGlobalStore, useUserStore } from "@/store/module";
|
||||||
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import "@/less/setting.less";
|
import "@/less/setting.less";
|
||||||
|
|
||||||
type SettingSection = "my-account" | "preference" | "member" | "system" | "openai" | "storage" | "sso";
|
type SettingSection = "my-account" | "preference" | "member" | "system" | "openai" | "storage" | "sso";
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { createBrowserRouter, redirect } from "react-router-dom";
|
|
||||||
import { lazy } from "react";
|
import { lazy } from "react";
|
||||||
|
import { createBrowserRouter, redirect } from "react-router-dom";
|
||||||
import { isNullorUndefined } from "@/helpers/utils";
|
import { isNullorUndefined } from "@/helpers/utils";
|
||||||
import store from "@/store";
|
import Archived from "@/pages/Archived";
|
||||||
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";
|
||||||
import Setting from "@/pages/Setting";
|
import Setting from "@/pages/Setting";
|
||||||
import Archived from "@/pages/Archived";
|
import store from "@/store";
|
||||||
|
import { initialGlobalState, initialUserState } from "@/store/module";
|
||||||
|
|
||||||
const Root = lazy(() => import("@/layouts/Root"));
|
const Root = lazy(() => import("@/layouts/Root"));
|
||||||
const Auth = lazy(() => import("@/pages/Auth"));
|
const Auth = lazy(() => import("@/pages/Auth"));
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import { configureStore } from "@reduxjs/toolkit";
|
import { configureStore } from "@reduxjs/toolkit";
|
||||||
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";
|
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";
|
||||||
import globalReducer from "./reducer/global";
|
|
||||||
import userReducer from "./reducer/user";
|
|
||||||
import memoReducer from "./reducer/memo";
|
|
||||||
import shortcutReducer from "./reducer/shortcut";
|
|
||||||
import filterReducer from "./reducer/filter";
|
|
||||||
import resourceReducer from "./reducer/resource";
|
|
||||||
import dialogReducer from "./reducer/dialog";
|
import dialogReducer from "./reducer/dialog";
|
||||||
import tagReducer from "./reducer/tag";
|
import filterReducer from "./reducer/filter";
|
||||||
|
import globalReducer from "./reducer/global";
|
||||||
import layoutReducer from "./reducer/layout";
|
import layoutReducer from "./reducer/layout";
|
||||||
|
import memoReducer from "./reducer/memo";
|
||||||
|
import resourceReducer from "./reducer/resource";
|
||||||
|
import shortcutReducer from "./reducer/shortcut";
|
||||||
|
import tagReducer from "./reducer/tag";
|
||||||
|
import userReducer from "./reducer/user";
|
||||||
|
|
||||||
const store = configureStore({
|
const store = configureStore({
|
||||||
reducer: {
|
reducer: {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { last } from "lodash-es";
|
import { last } from "lodash-es";
|
||||||
import store, { useAppSelector } from "..";
|
import store, { useAppSelector } from "..";
|
||||||
import { pushDialogStack, popDialogStack, removeDialog } from "../reducer/dialog";
|
import { popDialogStack, pushDialogStack, removeDialog } from "../reducer/dialog";
|
||||||
|
|
||||||
export const useDialogStore = () => {
|
export const useDialogStore = () => {
|
||||||
const state = useAppSelector((state) => state.dialog);
|
const state = useAppSelector((state) => state.dialog);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import store, { useAppSelector } from "..";
|
import store, { useAppSelector } from "..";
|
||||||
import { setFilter, Filter } from "../reducer/filter";
|
import { Filter, setFilter } from "../reducer/filter";
|
||||||
|
|
||||||
export const useFilterStore = () => {
|
export const useFilterStore = () => {
|
||||||
const state = useAppSelector((state) => state.filter);
|
const state = useAppSelector((state) => state.filter);
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { omit } from "lodash-es";
|
import { omit } from "lodash-es";
|
||||||
import * as api from "@/helpers/api";
|
import * as api from "@/helpers/api";
|
||||||
import { DEFAULT_MEMO_LIMIT } from "@/helpers/consts";
|
import { DEFAULT_MEMO_LIMIT } from "@/helpers/consts";
|
||||||
import { useUserStore } from "./";
|
|
||||||
import store, { useAppSelector } from "../";
|
import store, { useAppSelector } from "../";
|
||||||
import { createMemo, deleteMemo, patchMemo, setIsFetching, upsertMemos } from "../reducer/memo";
|
import { createMemo, deleteMemo, patchMemo, setIsFetching, upsertMemos } from "../reducer/memo";
|
||||||
import { useMemoCacheStore } from "../v1";
|
import { useMemoCacheStore } from "../v1";
|
||||||
|
import { useUserStore } from "./";
|
||||||
|
|
||||||
export const convertResponseModelMemo = (memo: Memo): Memo => {
|
export const convertResponseModelMemo = (memo: Memo): Memo => {
|
||||||
return {
|
return {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import * as api from "@/helpers/api";
|
import * as api from "@/helpers/api";
|
||||||
import { DEFAULT_MEMO_LIMIT } from "@/helpers/consts";
|
import { DEFAULT_MEMO_LIMIT } from "@/helpers/consts";
|
||||||
import store, { useAppSelector } from "../";
|
|
||||||
import { patchResource, setResources, deleteResource, upsertResources } from "../reducer/resource";
|
|
||||||
import { useGlobalStore } from "./global";
|
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
|
import store, { useAppSelector } from "../";
|
||||||
|
import { deleteResource, patchResource, setResources, upsertResources } from "../reducer/resource";
|
||||||
|
import { useGlobalStore } from "./global";
|
||||||
|
|
||||||
const convertResponseModelResource = (resource: Resource): Resource => {
|
const convertResponseModelResource = (resource: Resource): Resource => {
|
||||||
return {
|
return {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { camelCase } from "lodash-es";
|
import { camelCase } from "lodash-es";
|
||||||
import * as api from "@/helpers/api";
|
import * as api from "@/helpers/api";
|
||||||
import storage from "@/helpers/storage";
|
|
||||||
import { UNKNOWN_USERNAME } from "@/helpers/consts";
|
import { UNKNOWN_USERNAME } from "@/helpers/consts";
|
||||||
|
import storage from "@/helpers/storage";
|
||||||
import { getSystemColorScheme } from "@/helpers/utils";
|
import { getSystemColorScheme } from "@/helpers/utils";
|
||||||
import store, { useAppSelector } from "..";
|
import store, { useAppSelector } from "..";
|
||||||
import { setAppearance, setLocale } from "../reducer/global";
|
import { setAppearance, setLocale } from "../reducer/global";
|
||||||
import { setUser, patchUser, setHost, setUserById } from "../reducer/user";
|
import { patchUser, setHost, setUser, setUserById } from "../reducer/user";
|
||||||
|
|
||||||
const defaultSetting: Setting = {
|
const defaultSetting: Setting = {
|
||||||
locale: "en",
|
locale: "en",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
import { t } from "i18next";
|
||||||
import { create } from "zustand";
|
import { create } from "zustand";
|
||||||
import { persist } from "zustand/middleware";
|
import { persist } from "zustand/middleware";
|
||||||
import { t } from "i18next";
|
|
||||||
|
|
||||||
export interface Conversation {
|
export interface Conversation {
|
||||||
name: string;
|
name: string;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import i18n, { TLocale, availableLocales } from "@/i18n";
|
|
||||||
import { FallbackLngObjList } from "i18next";
|
import { FallbackLngObjList } from "i18next";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import i18n, { availableLocales, TLocale } from "@/i18n";
|
||||||
import locales from "@/locales/en.json";
|
import locales from "@/locales/en.json";
|
||||||
import type { NestedKeyOf } from "@/types/utils/nestedKeyOf.types";
|
import type { NestedKeyOf } from "@/types/utils/nestedKeyOf.types";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user