From 4f518437eae00ec2556ec0ec6fb436c83bc3efc9 Mon Sep 17 00:00:00 2001 From: Hayden Chen Date: Mon, 21 Aug 2023 13:03:44 +0800 Subject: [PATCH] feat: :sparkles: save pan zoom view-mode status --- package.json | 6 +++--- pnpm-lock.yaml | 8 ++++---- src/components/Editor.tsx | 1 - src/lib/constants.ts | 9 ++++++++- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index c182e18..2d58550 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "Excalidraw", + "name": "excalidraw", "version": "1.3.0", "main": "dist/index.html", "logseq": { @@ -12,7 +12,7 @@ "preview": "vite preview" }, "dependencies": { - "@excalidraw/excalidraw": "^0.15.2", + "@excalidraw/excalidraw": "^0.15.3", "@logseq/libs": "^0.0.14", "@radix-ui/react-alert-dialog": "^1.0.3", "@radix-ui/react-context-menu": "^2.1.3", @@ -56,4 +56,4 @@ "vite": "^3.2.4", "vite-plugin-importer": "^0.2.5" } -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dda3118..287db4f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2,8 +2,8 @@ lockfileVersion: '6.0' dependencies: '@excalidraw/excalidraw': - specifier: ^0.15.2 - version: 0.15.2(react-dom@18.2.0)(react@18.2.0) + specifier: ^0.15.3 + version: 0.15.3(react-dom@18.2.0)(react@18.2.0) '@logseq/libs': specifier: ^0.0.14 version: 0.0.14 @@ -508,8 +508,8 @@ packages: dev: true optional: true - /@excalidraw/excalidraw@0.15.2(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-rTI02kgWSTXiUdIkBxt9u/581F3eXcqQgJdIxmz54TFtG3ughoxO5fr4t7Fr2LZIturBPqfocQHGKZ0t2KLKgw==} + /@excalidraw/excalidraw@0.15.3(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-/gpY7fgMO/AEaFLWnPqzbY8H7ly+/zocFf7D0Is5sWNMD2mhult5tana12lXKLSJ6EAz7ubo1A7LajXzvJXJDA==} peerDependencies: react: ^17.0.2 || ^18.2.0 react-dom: ^17.0.2 || ^18.2.0 diff --git a/src/components/Editor.tsx b/src/components/Editor.tsx index 7086d84..b2bbde0 100644 --- a/src/components/Editor.tsx +++ b/src/components/Editor.tsx @@ -175,7 +175,6 @@ const Editor: React.FC< : { theme }, files: excalidrawData?.files || undefined, libraryItems, - scrollToContent: true, }} onChange={onExcalidrawChange} onLibraryChange={onLibraryChange} diff --git a/src/lib/constants.ts b/src/lib/constants.ts index f1e6170..e6f4885 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -1,5 +1,5 @@ -import { type AppState } from "@excalidraw/excalidraw/types/types"; import { type ExcalidrawData } from "@/type"; +import { AppState } from "@excalidraw/excalidraw/types/types"; export const FONT_ID = { "Hand-drawn": "Virgil", @@ -71,4 +71,11 @@ export const NEW_FILE_EXCALIDRAW_DATA: ExcalidrawData = { export const APP_STATE_PROPERTIES: Array = [ "gridSize", "viewBackgroundColor", + "zoom", + "offsetTop", + "offsetLeft", + "scrollX", + "scrollY", + "viewModeEnabled", + "zenModeEnabled", ];