From 8a0f6b8dddd51dfb0cf1a1f271f08453770608e1 Mon Sep 17 00:00:00 2001 From: hanaTsuk1 <101488209+hanaTsuk1@users.noreply.github.com> Date: Sat, 17 Aug 2024 14:51:48 +0800 Subject: [PATCH] =?UTF-8?q?moment=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + pnpm-lock.yaml | 13 +++++ src-tauri/capabilities/main.json | 17 +++++- src-tauri/gen/schemas/capabilities.json | 2 +- src/locales/en-US.yaml | 2 + src/locales/zh-CN.yaml | 2 + src/pages/record/moment.vue | 72 +++++++++++++++++++++++-- src/stores/useNavStore.ts | 14 ++--- 8 files changed, 111 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 87eddac..5a1547d 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,7 @@ "svg.js": "^2.7.1", "tauri-plugin-shion-history-api": "github:shion-app/history", "tauri-plugin-shion-watcher-api": "github:shion-app/watcher", + "turndown": "^7.2.0", "vee-validate": "^4.11.8", "vue": "^3.4.33", "vue-component-type-helpers": "^1.8.24", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 98f32e6..7bcdac1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -164,6 +164,9 @@ dependencies: tauri-plugin-shion-watcher-api: specifier: github:shion-app/watcher version: github.com/shion-app/watcher/146fd10c30a53dd98fe9621c8a6a4fa6ed85db11 + turndown: + specifier: ^7.2.0 + version: 7.2.0 vee-validate: specifier: ^4.11.8 version: 4.11.8(vue@3.4.34) @@ -2045,6 +2048,10 @@ packages: resolution: {integrity: sha512-SWxvzRbUQRfewlIV+OF4/YF4DkeTjMWoT8Hh9yeU/5UBVdJZj9Uf4a9+cXjknSIhIaMxZ/4N1O/s7ojApOOGjg==} dev: false + /@mixmark-io/domino@2.2.0: + resolution: {integrity: sha512-Y28PR25bHXUg88kCV7nivXrP2Nj2RueZ3/l/jdx6J9f8J4nsEGcgX0Qe6lt7Pa+J79+kPiJU3LguR6O/6zrLOw==} + dev: false + /@mrleebo/prisma-ast@0.7.0: resolution: {integrity: sha512-GTPkYf1meO2UXXIrz/SIDFWz+P4kXo2PTt36LYh/oNxV1PieYi7ZgenQk4IV0ut71Je3Z8ZoNZ8Tr7v2c1X1pg==} engines: {node: '>=16'} @@ -9158,6 +9165,12 @@ packages: safe-buffer: 5.2.1 dev: true + /turndown@7.2.0: + resolution: {integrity: sha512-eCZGBN4nNNqM9Owkv9HAtWRYfLA4h909E/WGAWWBpmB275ehNhZyk87/Tpvjbp0jjNl9XwCsbe6bm6CqFsgD+A==} + dependencies: + '@mixmark-io/domino': 2.2.0 + dev: false + /type-check@0.3.2: resolution: {integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==} engines: {node: '>= 0.8.0'} diff --git a/src-tauri/capabilities/main.json b/src-tauri/capabilities/main.json index 07d3899..9396946 100644 --- a/src-tauri/capabilities/main.json +++ b/src-tauri/capabilities/main.json @@ -25,7 +25,14 @@ "fs:allow-copy-file", "fs:allow-mkdir", "fs:allow-write-file", - "fs:allow-write-text-file", + { + "identifier": "fs:allow-write-text-file", + "allow": [ + { + "path": "**" + } + ] + }, "fs:allow-read-text-file", { "identifier": "fs:allow-exists", @@ -37,6 +44,14 @@ }, "fs:allow-remove", "fs:scope-appdata-recursive", + { + "identifier": "fs:allow-rename", + "allow": [ + { + "path": "**" + } + ] + }, "log:allow-log", "process:allow-restart", "process:allow-exit", diff --git a/src-tauri/gen/schemas/capabilities.json b/src-tauri/gen/schemas/capabilities.json index 92ce045..00c16f1 100644 --- a/src-tauri/gen/schemas/capabilities.json +++ b/src-tauri/gen/schemas/capabilities.json @@ -1 +1 @@ -{"main-capability":{"identifier":"main-capability","description":"Capability for the main window","local":true,"windows":["main"],"permissions":["core:path:default","core:event:default","core:window:default","core:window:allow-start-dragging","core:window:allow-hide","core:window:allow-minimize","core:app:default","core:resources:default","core:menu:default","core:tray:default","core:tray:allow-get-by-id","autostart:allow-disable","autostart:allow-enable","autostart:allow-is-enabled","clipboard-manager:allow-write-text","dialog:allow-open","fs:allow-copy-file","fs:allow-mkdir","fs:allow-write-file","fs:allow-write-text-file","fs:allow-read-text-file",{"identifier":"fs:allow-exists","allow":[{"path":"**"}]},"fs:allow-remove","fs:scope-appdata-recursive","log:allow-log","process:allow-restart","process:allow-exit","shell:allow-open","sql:allow-load","sql:allow-select","sql:allow-execute","sql:allow-close","store:allow-length","store:allow-entries","store:allow-set","store:allow-save","updater:default","shion-history:allow-get-config","shion-history:allow-set-config","shion-history:allow-read-history","shion-watcher:allow-resume","shion-watcher:allow-suspend","shion-watcher:allow-get-program-list","shion-watcher:allow-get-program-by-path"]}} \ No newline at end of file +{"main-capability":{"identifier":"main-capability","description":"Capability for the main window","local":true,"windows":["main"],"permissions":["core:path:default","core:event:default","core:window:default","core:window:allow-start-dragging","core:window:allow-hide","core:window:allow-minimize","core:app:default","core:resources:default","core:menu:default","core:tray:default","core:tray:allow-get-by-id","autostart:allow-disable","autostart:allow-enable","autostart:allow-is-enabled","clipboard-manager:allow-write-text","dialog:allow-open","fs:allow-copy-file","fs:allow-mkdir","fs:allow-write-file",{"identifier":"fs:allow-write-text-file","allow":[{"path":"**"}]},"fs:allow-read-text-file",{"identifier":"fs:allow-exists","allow":[{"path":"**"}]},"fs:allow-remove","fs:scope-appdata-recursive",{"identifier":"fs:allow-rename","allow":[{"path":"**"}]},"log:allow-log","process:allow-restart","process:allow-exit","shell:allow-open","sql:allow-load","sql:allow-select","sql:allow-execute","sql:allow-close","store:allow-length","store:allow-entries","store:allow-set","store:allow-save","updater:default","shion-history:allow-get-config","shion-history:allow-set-config","shion-history:allow-read-history","shion-watcher:allow-resume","shion-watcher:allow-suspend","shion-watcher:allow-get-program-list","shion-watcher:allow-get-program-by-path"]}} \ No newline at end of file diff --git a/src/locales/en-US.yaml b/src/locales/en-US.yaml index 68c7da0..975f653 100644 --- a/src/locales/en-US.yaml +++ b/src/locales/en-US.yaml @@ -150,6 +150,7 @@ about: appInfo: copy app info moment: create: Record the moment + export: Export all data inputTitle: Input title... submit: Submit edit: Edit @@ -162,6 +163,7 @@ moment: snackbar: Currently in candidate state, select the object that needs to be linked submitTip: The selected {count} item will be linked to the target. Are you sure? cancelTip: The link is about to be cancelled. Are you sure? + deprecated: The moment will be redone, please export all data in the more menu at the bottom left box: all: All tip: diff --git a/src/locales/zh-CN.yaml b/src/locales/zh-CN.yaml index 4c0226d..68e6c6c 100644 --- a/src/locales/zh-CN.yaml +++ b/src/locales/zh-CN.yaml @@ -150,6 +150,7 @@ about: appInfo: 复制应用信息 moment: create: 记录下瞬间 + export: 导出所有数据 inputTitle: 输入标题... submit: 提交 edit: 编辑 @@ -162,6 +163,7 @@ moment: snackbar: 正处于链接候选状态, 选中需要链接的对象 submitTip: 所选中{count}项将与目标链接在一起, 是否确认? cancelTip: 即将取消链接, 是否确认? + deprecated: 瞬间功能将重做,所有数据请在左下方更多菜单中导出 box: all: 全部 tip: diff --git a/src/pages/record/moment.vue b/src/pages/record/moment.vue index 013e475..0da5dd1 100644 --- a/src/pages/record/moment.vue +++ b/src/pages/record/moment.vue @@ -1,4 +1,9 @@