diff --git a/apps/client/package.json b/apps/client/package.json index e54d65f7..67b25406 100644 --- a/apps/client/package.json +++ b/apps/client/package.json @@ -10,76 +10,76 @@ "format": "prettier --write \"src/**/*.tsx\" \"src/**/*.ts\"" }, "dependencies": { - "@casl/react": "^4.0.0", + "@casl/react": "^5.0.1", "@docmost/editor-ext": "workspace:*", "@emoji-mart/data": "^1.2.1", "@emoji-mart/react": "^1.1.1", "@excalidraw/excalidraw": "0.18.0-3a5ef40", - "@mantine/core": "^8.3.14", - "@mantine/dates": "^8.3.14", - "@mantine/form": "^8.3.14", - "@mantine/hooks": "^8.3.14", - "@mantine/modals": "^8.3.14", - "@mantine/notifications": "^8.3.14", - "@mantine/spotlight": "^8.3.14", - "@tabler/icons-react": "^3.36.1", - "@tanstack/react-query": "^5.90.17", + "@mantine/core": "^8.3.18", + "@mantine/dates": "^8.3.18", + "@mantine/form": "^8.3.18", + "@mantine/hooks": "^8.3.18", + "@mantine/modals": "^8.3.18", + "@mantine/notifications": "^8.3.18", + "@mantine/spotlight": "^8.3.18", + "@tabler/icons-react": "^3.40.0", + "@tanstack/react-query": "5.90.17", "alfaaz": "^1.1.0", - "axios": "^1.13.5", + "axios": "^1.13.6", "blueimp-load-image": "^5.16.0", "clsx": "^2.1.1", "emoji-mart": "^5.6.0", "file-saver": "^2.0.5", "highlightjs-sap-abap": "^0.3.0", - "i18next": "^23.16.8", - "i18next-http-backend": "^2.7.3", - "jotai": "^2.16.2", + "i18next": "^25.10.1", + "i18next-http-backend": "^3.0.2", + "jotai": "^2.18.1", "jotai-optics": "^0.4.0", "js-cookie": "^3.0.5", "jwt-decode": "^4.0.0", - "katex": "0.16.27", + "katex": "0.16.40", "lowlight": "^3.3.0", "mantine-form-zod-resolver": "^1.3.0", - "mermaid": "^11.12.2", + "mermaid": "^11.13.0", "mitt": "^3.0.1", - "posthog-js": "1.345.5", + "posthog-js": "1.363.1", "react": "^18.3.1", "react-arborist": "3.4.0", - "react-clear-modal": "^2.0.17", + "react-clear-modal": "^2.0.18", "react-dom": "^18.3.1", "react-drawio": "^1.0.7", - "react-error-boundary": "^4.1.2", - "react-helmet-async": "^2.0.5", - "react-i18next": "^15.0.1", - "react-router-dom": "^7.12.0", - "semver": "^7.7.3", + "react-error-boundary": "^6.1.1", + "react-helmet-async": "^3.0.0", + "react-i18next": "^16.5.8", + "react-router-dom": "^7.13.1", + "semver": "^7.7.4", "socket.io-client": "^4.8.3", "tiptap-extension-global-drag-handle": "^0.1.18", "zod": "^4.3.6" }, "devDependencies": { - "@eslint/js": "^9.16.0", - "@tanstack/eslint-plugin-query": "^5.62.1", - "@types/blueimp-load-image": "^5.16.0", + "@eslint/js": "^9.28.0", + "@tanstack/eslint-plugin-query": "^5.94.4", + "@types/blueimp-load-image": "^5.16.6", "@types/file-saver": "^2.0.7", "@types/js-cookie": "^3.0.6", - "@types/katex": "^0.16.7", + "@types/katex": "^0.16.8", "@types/node": "22.19.1", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", - "@vitejs/plugin-react": "^5.1.1", - "eslint": "^9.39.2", - "eslint-plugin-react": "^7.37.2", - "eslint-plugin-react-hooks": "^5.1.0", - "eslint-plugin-react-refresh": "^0.4.16", + "@vitejs/plugin-react": "^6.0.0", + "eslint": "^9.28.0", + "eslint-plugin-react": "^7.37.5", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.5.2", "globals": "^15.13.0", "optics-ts": "^2.4.1", - "postcss": "^8.4.49", - "postcss-preset-mantine": "^1.17.0", + "postcss": "^8.5.8", + "postcss-preset-mantine": "^1.18.0", "postcss-simple-vars": "^7.0.1", - "prettier": "^3.4.1", - "typescript": "^5.7.2", - "typescript-eslint": "^8.17.0", - "vite": "^7.2.4" + "prettier": "^3.8.1", + "typescript": "^5.9.3", + "typescript-eslint": "^8.57.1", + "vite": "^8.0.1" } } diff --git a/apps/client/src/features/editor/components/drawio/drawio-menu.tsx b/apps/client/src/features/editor/components/drawio/drawio-menu.tsx index 8cda0348..869decd7 100644 --- a/apps/client/src/features/editor/components/drawio/drawio-menu.tsx +++ b/apps/client/src/features/editor/components/drawio/drawio-menu.tsx @@ -8,6 +8,7 @@ import { } from "@/features/editor/components/table/types/types.ts"; import { ActionIcon, + LoadingOverlay, Modal, Text, Tooltip, @@ -46,6 +47,8 @@ export function DrawioMenu({ editor }: EditorMenuProps) { const computedColorScheme = useComputedColorScheme(); const isDirtyRef = useRef(false); const isSavingRef = useRef(false); + const [isSaving, setIsSaving] = useState(false); + const [isLoading, setIsLoading] = useState(false); const editorState = useEditorState({ editor, @@ -140,6 +143,7 @@ export function DrawioMenu({ editor }: EditorMenuProps) { if (isSavingRef.current) return; isSavingRef.current = true; + setIsSaving(true); try { const svgString = decodeBase64ToSvgString(svgXml); @@ -167,6 +171,7 @@ export function DrawioMenu({ editor }: EditorMenuProps) { isDirtyRef.current = false; } finally { isSavingRef.current = false; + setIsSaving(false); } }, [editor, editorState?.attachmentId]); @@ -196,6 +201,7 @@ export function DrawioMenu({ editor }: EditorMenuProps) { const handleOpen = useCallback(async () => { if (!editorState?.src) return; + setIsLoading(true); try { const url = getFileUrl(editorState.src); const request = await fetch(url, { @@ -213,6 +219,7 @@ export function DrawioMenu({ editor }: EditorMenuProps) { } catch (err) { console.error(err); } finally { + setIsLoading(false); isDirtyRef.current = false; open(); } @@ -307,6 +314,7 @@ export function DrawioMenu({ editor }: EditorMenuProps) { size="lg" aria-label={t("Edit")} variant="subtle" + loading={isLoading} > @@ -339,7 +347,8 @@ export function DrawioMenu({ editor }: EditorMenuProps) { - + +
{ if (!editor.isEditable) { @@ -47,6 +49,7 @@ export default function DrawioView(props: NodeViewProps) { if (isSavingRef.current) return; isSavingRef.current = true; + setIsSaving(true); try { const svgString = decodeBase64ToSvgString(svgXml); @@ -79,6 +82,7 @@ export default function DrawioView(props: NodeViewProps) { isDirtyRef.current = false; } finally { isSavingRef.current = false; + setIsSaving(false); } }; @@ -136,7 +140,8 @@ export default function DrawioView(props: NodeViewProps) { - + +
{ if (!editorState?.src) return; + setIsLoading(true); try { const url = getFileUrl(editorState.src); const request = await fetch(url, { @@ -166,6 +169,7 @@ export function ExcalidrawMenu({ editor }: EditorMenuProps) { } catch (err) { console.error(err); } finally { + setIsLoading(false); isDirtyRef.current = false; isInitialLoadRef.current = true; open(); @@ -178,6 +182,7 @@ export function ExcalidrawMenu({ editor }: EditorMenuProps) { } isSavingRef.current = true; + setIsSaving(true); try { const { exportToSvg } = await import("@excalidraw/excalidraw"); @@ -223,6 +228,7 @@ export function ExcalidrawMenu({ editor }: EditorMenuProps) { isDirtyRef.current = false; } finally { isSavingRef.current = false; + setIsSaving(false); } }, [editor, excalidrawAPI, editorState?.attachmentId]); @@ -339,6 +345,7 @@ export function ExcalidrawMenu({ editor }: EditorMenuProps) { size="lg" aria-label={t("Edit")} variant="subtle" + loading={isLoading} > @@ -390,7 +397,7 @@ export function ExcalidrawMenu({ editor }: EditorMenuProps) { bg="var(--mantine-color-body)" p="xs" > -