diff --git a/package-lock.json b/package-lock.json index 4c90a4ad..c1643993 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3306,9 +3306,9 @@ "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, "browser-nativefs": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/browser-nativefs/-/browser-nativefs-0.8.1.tgz", - "integrity": "sha512-5XQTR6eg+/hDBVoOKbCnCqUzhD7IP5RG6jCe+J+EaTHo8EnDxjEj3mod3BiEBc/4NfTLEMbrMzUPPY64KwnmNw==" + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/browser-nativefs/-/browser-nativefs-0.8.2.tgz", + "integrity": "sha512-x1dYA6lkpaLZcvvbQ1+/SSDR9H/fbzlcnKi3BDCvEe3fr3HzV5finUMX8fJspzCmPuP7fGLVO8S3UZ8RhQseFw==" }, "browser-process-hrtime": { "version": "1.0.0", diff --git a/package.json b/package.json index ebf63522..96abf130 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@types/react": "16.9.35", "@types/react-dom": "16.9.8", "@types/socket.io-client": "1.4.33", - "browser-nativefs": "0.8.1", + "browser-nativefs": "0.8.2", "i18next-browser-languagedetector": "4.2.0", "lodash.throttle": "4.1.1", "nanoid": "2.1.11", diff --git a/src/actions/actionExport.tsx b/src/actions/actionExport.tsx index e0d6cc2a..1af29885 100644 --- a/src/actions/actionExport.tsx +++ b/src/actions/actionExport.tsx @@ -1,7 +1,7 @@ import React from "react"; import { ProjectName } from "../components/ProjectName"; import { saveAsJSON, loadFromJSON } from "../data"; -import { load, save } from "../components/icons"; +import { load, save, saveAs } from "../components/icons"; import { ToolButton } from "../components/ToolButton"; import { t } from "../i18n"; import useIsMobile from "../is-mobile"; @@ -65,11 +65,13 @@ export const actionChangeShouldAddWatermark = register({ export const actionSaveScene = register({ name: "saveScene", perform: (elements, appState, value) => { - saveAsJSON(elements, appState).catch((error) => console.error(error)); + saveAsJSON(elements, appState, (window as any).handle).catch((error) => + console.error(error), + ); return { commitToHistory: false }; }, keyTest: (event) => { - return event.key === "s" && event[KEYS.CTRL_OR_CMD]; + return event.key === "s" && event[KEYS.CTRL_OR_CMD] && !event.shiftKey; }, PanelComponent: ({ updateData }) => ( { + saveAsJSON(elements, appState, null).catch((error) => console.error(error)); + return { commitToHistory: false }; + }, + keyTest: (event) => { + return event.key === "s" && event.shiftKey && event[KEYS.CTRL_OR_CMD]; + }, + PanelComponent: ({ updateData }) => ( +