From 209da5e8696e96c20f1e08cb48ace6be0c1158a1 Mon Sep 17 00:00:00 2001 From: fofolee Date: Fri, 1 Mar 2024 09:24:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9B=B4=E6=96=B0=E6=8F=90?= =?UTF-8?q?=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/options/changeLog.js | 18 ++ src/pages/ConfigurationPage.vue | 213 ++++++------------ .../monaco/types/quickcommand.api.d.ts | 7 +- 3 files changed, 91 insertions(+), 147 deletions(-) create mode 100644 src/js/options/changeLog.js diff --git a/src/js/options/changeLog.js b/src/js/options/changeLog.js new file mode 100644 index 0000000..7dfd161 --- /dev/null +++ b/src/js/options/changeLog.js @@ -0,0 +1,18 @@ +const changeLog = [ + { + version: "4.1.2", + log: `一、功能调整、新增 +① 现在会自动对特殊变量里的单、双、反引号、反斜杠、换行符等特殊符号进行转义。这意味用户不再需要手动处理这些特殊情况,比如在js中使用反引号(\`)或者在 python中 使用三引号(''')来解决换行的问题。 +【 ! ! ! 】需要注意,如果之前在js中使用了 String.raw 或者在 python 中使用了 r 来对反斜杠进行处理的话,现在需要去掉这些符号,比如之前是 String.raw\`{{input}}\`,现在则需要改回 "{{input}}" +② 添加 quickcommand.runAppleScript 和 quickcommand.runPowerShell 两个方法 +③ quickcommand.showConfirmBox 现在支持渲染html以及设置宽度 +④ Mac下环境变量顺序调整为 /opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/local/sbin:$PATH +二、BUG 修复 +① 修复某些情况下调整页面大小报错的 BUG +② 修复非 quickcommand 环境自动补全重复出现的 BUG +③ 修复 alt+z 无法换行的 BUG +④ 更新内置命令-网址二维码中 qrcode 的引用地址`, + }, +]; + +export default changeLog; diff --git a/src/pages/ConfigurationPage.vue b/src/pages/ConfigurationPage.vue index 65fefb6..fa05d98 100644 --- a/src/pages/ConfigurationPage.vue +++ b/src/pages/ConfigurationPage.vue @@ -2,37 +2,19 @@
- - + + - + {{ tag }} 所有没有添加标签的命令都会归在未分类
@@ -42,78 +24,43 @@
- - - + + +
- +
-
+
- + @@ -123,88 +70,51 @@
- + ]"> - + - + - + +
- - + + - +
@@ -212,6 +122,7 @@ import { defineAsyncComponent } from "vue"; import quickcommandParser from "../js/common/quickcommandParser.js"; import importAll from "../js/common/importAll.js"; +import changeLog from "../js/options/changeLog.js" import pinyinMatch from "pinyin-match"; import CommandCard from "components/CommandCard"; import CommandEditor from "components/CommandEditor"; @@ -326,6 +237,7 @@ export default { this.changeCurrentTag(window.hexDecode(this.$route.params.tags)); this.commandCardStyle = "mini"; } + this.showChangeLog(); // 异步读取 setTimeout(this.getActivatedFeatures, 0); setTimeout(this.getAllQuickCommands, 0); @@ -602,6 +514,15 @@ export default { return; } }, + showChangeLog() { + let lastNeedLogEvent = changeLog[changeLog.length - 1]; + let loggedVersion = + this.$root.utools.whole.dbStorage.getItem("cfg_loggedVersion") || '0.0.0'; + if (loggedVersion < lastNeedLogEvent.version) { + quickcommand.showConfirmBox('
' + lastNeedLogEvent.log + '
', '更新日志', true, 700) + this.$root.utools.whole.dbStorage.setItem("cfg_loggedVersion", lastNeedLogEvent.version) + } + }, }, }; diff --git a/src/plugins/monaco/types/quickcommand.api.d.ts b/src/plugins/monaco/types/quickcommand.api.d.ts index dcd42bd..6aa1876 100644 --- a/src/plugins/monaco/types/quickcommand.api.d.ts +++ b/src/plugins/monaco/types/quickcommand.api.d.ts @@ -156,8 +156,13 @@ interface quickcommandApi { * ``` * @param message 提示的内容 * @param title 提示的标题 + * @param html 内容是支持html,默认 false */ - showConfirmBox(message?: string, title?: string): Promise; + showConfirmBox( + message?: string, + title?: string, + isHtml?: boolean + ): Promise; /** * 显示等待用户操作的按钮,用户点击后执行相关操作