diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index cca8daf727..aa3bc6af14 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -16,10 +16,10 @@ Install pnpm: `npm install -g pnpm` Set the Electron mirror environment variable and install Electron: -* macOS/Linux: `ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@30.0.1 -D` +* macOS/Linux: `ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@28.3.1 -D` * Windows: * `SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/` - * `pnpm install electron@30.0.1 -D` + * `pnpm install electron@28.3.1 -D` NPM mirror: @@ -30,7 +30,7 @@ NPM mirror: On the desktop, go to the app folder to run: -* `pnpm install electron@30.0.1 -D` +* `pnpm install electron@28.3.1 -D` * `pnpm run dev` * `pnpm run start` diff --git a/.github/CONTRIBUTING_zh_CN.md b/.github/CONTRIBUTING_zh_CN.md index f6759fae84..3d917c8225 100644 --- a/.github/CONTRIBUTING_zh_CN.md +++ b/.github/CONTRIBUTING_zh_CN.md @@ -18,11 +18,11 @@ * macOS/Linux: ``` - ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@30.0.1 -D + ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@28.3.1 -D ``` * Windows: * `SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/` - * `pnpm install electron@30.0.1 -D` + * `pnpm install electron@28.3.1 -D` NPM 镜像: @@ -32,7 +32,7 @@ NPM 镜像: 桌面端进入 app 文件夹运行: -* `pnpm install electron@30.0.1 -D` +* `pnpm install electron@28.3.1 -D` * `pnpm run dev` * `pnpm run start` diff --git a/.vscode/PackageJsonMapping.sillot.jsonc b/.vscode/PackageJsonMapping.sillot.jsonc new file mode 100644 index 0000000000..0b233cc89e --- /dev/null +++ b/.vscode/PackageJsonMapping.sillot.jsonc @@ -0,0 +1,7 @@ +{ + "Sillot (工作区)": [ + "a:\\Github\\Hi-Windom\\Sillot\\.vscode\\extensions\\Sillot\\package.json", + "a:\\Github\\Hi-Windom\\Sillot\\app\\package.json", + "a:\\Github\\Hi-Windom\\Sillot\\docs\\starlight\\package.json", + ], +} \ No newline at end of file diff --git a/.vscode/extensions/Sillot/package.json b/.vscode/extensions/Sillot/package.json index 6525288ae0..1a636b7ba0 100644 --- a/.vscode/extensions/Sillot/package.json +++ b/.vscode/extensions/Sillot/package.json @@ -1,411 +1,428 @@ { - "name": "sillot", - "displayName": "汐洛 Sillot", - "description": "汐洛(Sillot)孵化自思源笔记(siyuan-note),致力于服务智慧新彖乄。此插件为汐洛官方插件,提供多功能一体化集成。", - "version": "0.1.2000", - "preview": true, - "repository": "https://github.com/Hi-Windom/Sillot", - "publisher": "Hi-Windom", - "icon": "media/icon.png", - "galleryBanner": { - "color": "#131824", - "theme": "dark" - }, - "keywords": [ - "ms-ceintl.vscode-language-pack-zh-hans" + "name": "sillot", + "displayName": "汐洛 Sillot", + "description": "汐洛(Sillot)孵化自思源笔记(siyuan-note),致力于服务智慧新彖乄。此插件为汐洛官方插件,提供多功能一体化集成。", + "version": "0.32.2000", + "preview": true, + "repository": "https://github.com/Hi-Windom/Sillot", + "publisher": "Hi-Windom", + "icon": "media/icon.png", + "galleryBanner": { + "color": "#131824", + "theme": "dark" + }, + "keywords": [ + "ms-ceintl.vscode-language-pack-zh-hans" + ], + "extensionDependencies": [], + "markdown": "github", + "engines": { + "vscode": "^1.88.0" + }, + "categories": [ + "Programming Languages", + "Snippets", + "Extension Packs" + ], + "activationEvents": [ + "onDidChangeTextDocument", + "onDidChangeActiveTextEditor", + "onLanguage:plaintext", + "onLanguage:json", + "onLanguage:jsonc", + "onLanguage:go", + "onLanguage:javascript", + "onLanguage:typescript", + "onLanguage:yaml", + "onLanguage:markdown", + "onLanguage:astro", + "onLanguage:csharp", + "onLanguage:kotlin", + "onLanguage:css", + "onLanguage:less", + "onLanguage:scss", + "onLanguage:python", + "onLanguage:xml", + "workspaceContains:**/.editorconfig" + ], + "main": "./dist/extension.js", + "contributes": { + "themes": [ + { + "label": "Sample Light", + "uiTheme": "vs", + "path": "./theme/Sample_Light.tmTheme" + }, + { + "label": "Sample Dark", + "uiTheme": "vs-dark", + "path": "./theme/Sample_Dark.tmTheme" + } ], - "extensionDependencies": [], - "markdown": "github", - "engines": { - "vscode": "^1.88.0" + "configuration": { + "type": "object", + "title": "汐洛插件配置", + "properties": { + "codelens-sample.enableCodeLens": { + "type": "boolean", + "default": true + }, + "typescript.useCodeSnippetsOnMethodSuggest": { + "type": "boolean", + "default": false, + "description": "Complete functions with their parameter signature." + }, + "sillot.typescript.tsdk": { + "type": [ + "string", + "null" + ], + "default": null, + "markdownDescription": "Specifies the folder path containing the tsserver and `lib*.d.ts` files to use." + } + } }, - "categories": [ - "Programming Languages", - "Snippets", - "Extension Packs" + "commands": [ + { + "command": "extension.getGitHubUser", + "title": "Get GitHub User", + "category": "GitHub 认证 (共享)" + }, + { + "command": "sillot.getGitHubUser", + "title": "Get GitHub User", + "category": "GitHub 认证 (独占)" + }, + { + "command": "sillot.helloWorld", + "title": "Hello World", + "category": "Sillot" + }, + { + "command": "sillot.openPackageOnNpm", + "title": "Open Package on NPM", + "category": "Sillot" + }, + { + "command": "sillot.测试序列化字典", + "title": "测试序列化字典", + "category": "Sillot" + }, + { + "command": "sillot.测试反序列化字典", + "title": "测试反序列化字典", + "category": "Sillot" + }, + { + "command": "sillot.pickEXE", + "title": "pickEXE", + "category": "Sillot" + }, + { + "title": "Enable CodeLens", + "command": "codelens-sample.enableCodeLens", + "category": "CodeLens Sample" + }, + { + "title": "Disable Codelens", + "command": "codelens-sample.disableCodeLens", + "category": "CodeLens Sample" + }, + { + "command": "汐洛.花字.样式_反转大小写", + "title": "♻️ 应用样式_反转大小写 abcABC... ⚠️ 恢复默认字体", + "category": "Sillot" + }, + { + "command": "汐洛.花字.样式_转大写", + "title": "♻️ 应用样式_转大写 ABCABC... ⚠️ 恢复默认字体", + "category": "Sillot" + }, + { + "command": "汐洛.花字.样式_转小写", + "title": "♻️ 应用样式_转小写 abcabc... ⚠️ 恢复默认字体", + "category": "Sillot" + }, + { + "command": "汐洛.花字.字体_默认", + "title": "♻️ 应用字体_默认 ABCabc...", + "category": "Sillot" + }, + { + "command": "汐洛.花字.字体_手写体", + "title": "♻️ 应用字体_手写体 𝓐𝓑𝓒𝒶𝒷𝒸...", + "category": "Sillot" + }, + { + "command": "汐洛.花字.字体_粗体", + "title": "♻️ 应用字体_粗体 𝗔𝗕𝗖𝗮𝗯𝗰...", + "category": "Sillot" + }, + { + "command": "汐洛.花字.字体_德文尖角", + "title": "♻️ 应用字体_德文尖角 𝕬𝕭𝕮𝔞𝔟𝔠...", + "category": "Sillot" + }, + { + "command": "汐洛.花字.字体_斜体", + "title": "♻️ 应用字体_斜体 𝘈𝘉𝘊𝘢𝘣𝘤...", + "category": "Sillot" + }, + { + "command": "汐洛.花字.字体_等宽", + "title": "♻️ 应用字体_等宽 𝙰𝙱𝙲𝚊𝚋𝚌...", + "category": "Sillot" + }, + { + "command": "汐洛.花字.字体_删除线", + "title": "♻️ 应用字体_删除线 𝙰𝙱𝙲𝚊𝚋𝚌...", + "category": "Sillot" + }, + { + "command": "汐洛.同步更新版本", + "title": "汐洛 🤍 同步更新版本", + "category": "Sillot" + }, + { + "command": "汐洛.addPackageJsonMapping", + "title": "汐洛 🤍 添加包JSON映射", + "category": "Sillot" + } ], - "activationEvents": [ - "onDidChangeTextDocument", - "onDidChangeActiveTextEditor", - "onLanguage:plaintext", - "onLanguage:json", - "onLanguage:jsonc", - "onLanguage:go", - "onLanguage:javascript", - "onLanguage:typescript", - "onLanguage:yaml", - "onLanguage:markdown", - "onLanguage:astro", - "onLanguage:csharp", - "onLanguage:kotlin", - "onLanguage:css", - "onLanguage:less", - "onLanguage:scss", - "onLanguage:python", - "onLanguage:xml", - "workspaceContains:**/.editorconfig" + "submenus": [ + { + "id": "汐洛.花字", + "label": "🦢 汐洛花字菜单 - Sillot 🌸 Menu" + } ], - "main": "./dist/extension.js", - "contributes": { - "themes": [ - { - "label": "Sample Light", - "uiTheme": "vs", - "path": "./theme/Sample_Light.tmTheme" - }, - { - "label": "Sample Dark", - "uiTheme": "vs-dark", - "path": "./theme/Sample_Dark.tmTheme" - } - ], - "configuration": { - "type": "object", - "title": "汐洛插件配置", - "properties": { - "codelens-sample.enableCodeLens": { - "type": "boolean", - "default": true - }, - "typescript.useCodeSnippetsOnMethodSuggest": { - "type": "boolean", - "default": false, - "description": "Complete functions with their parameter signature." - }, - "sillot.typescript.tsdk": { - "type": [ - "string", - "null" - ], - "default": null, - "markdownDescription": "Specifies the folder path containing the tsserver and `lib*.d.ts` files to use." - } - } + "menus": { + "汐洛.花字": [ + { + "command": "汐洛.花字.样式_反转大小写" }, - "commands": [ - { - "command": "extension.getGitHubUser", - "title": "Get GitHub User", - "category": "GitHub 认证 (共享)" - }, - { - "command": "sillot.getGitHubUser", - "title": "Get GitHub User", - "category": "GitHub 认证 (独占)" - }, - { - "command": "sillot.helloWorld", - "title": "Hello World", - "category": "Sillot" - }, - { - "command": "sillot.openPackageOnNpm", - "title": "Open Package on NPM", - "category": "Sillot" - }, - { - "command": "sillot.测试序列化字典", - "title": "测试序列化字典", - "category": "Sillot" - }, - { - "command": "sillot.测试反序列化字典", - "title": "测试反序列化字典", - "category": "Sillot" - }, - { - "command": "sillot.pickEXE", - "title": "pickEXE", - "category": "Sillot" - }, - { - "title": "Enable CodeLens", - "command": "codelens-sample.enableCodeLens", - "category": "CodeLens Sample" - }, - { - "title": "Disable Codelens", - "command": "codelens-sample.disableCodeLens", - "category": "CodeLens Sample" - }, - { - "command": "汐洛.花字.样式_反转大小写", - "title": "♻️ 应用样式_反转大小写 abcABC... ⚠️ 恢复默认字体", - "category": "Sillot" - }, - { - "command": "汐洛.花字.样式_转大写", - "title": "♻️ 应用样式_转大写 ABCABC... ⚠️ 恢复默认字体", - "category": "Sillot" - }, - { - "command": "汐洛.花字.样式_转小写", - "title": "♻️ 应用样式_转小写 abcabc... ⚠️ 恢复默认字体", - "category": "Sillot" - }, - { - "command": "汐洛.花字.字体_默认", - "title": "♻️ 应用字体_默认 ABCabc...", - "category": "Sillot" - }, - { - "command": "汐洛.花字.字体_手写体", - "title": "♻️ 应用字体_手写体 𝓐𝓑𝓒𝒶𝒷𝒸...", - "category": "Sillot" - }, - { - "command": "汐洛.花字.字体_粗体", - "title": "♻️ 应用字体_粗体 𝗔𝗕𝗖𝗮𝗯𝗰...", - "category": "Sillot" - }, - { - "command": "汐洛.花字.字体_德文尖角", - "title": "♻️ 应用字体_德文尖角 𝕬𝕭𝕮𝔞𝔟𝔠...", - "category": "Sillot" - }, - { - "command": "汐洛.花字.字体_斜体", - "title": "♻️ 应用字体_斜体 𝘈𝘉𝘊𝘢𝘣𝘤...", - "category": "Sillot" - }, - { - "command": "汐洛.花字.字体_等宽", - "title": "♻️ 应用字体_等宽 𝙰𝙱𝙲𝚊𝚋𝚌...", - "category": "Sillot" - }, - { - "command": "汐洛.花字.字体_删除线", - "title": "♻️ 应用字体_删除线 𝙰𝙱𝙲𝚊𝚋𝚌...", - "category": "Sillot" - } - ], - "submenus": [ - { - "id": "汐洛.花字", - "label": "🦢 汐洛花字菜单 - Sillot 🌸 Menu" - } - ], - "menus": { - "汐洛.花字": [ - { - "command": "汐洛.花字.样式_反转大小写" - }, - { - "command": "汐洛.花字.样式_转大写" - }, - { - "command": "汐洛.花字.样式_转小写" - }, - { - "command": "汐洛.花字.字体_默认" - }, - { - "command": "汐洛.花字.字体_手写体" - }, - { - "command": "汐洛.花字.字体_粗体" - }, - { - "command": "汐洛.花字.字体_德文尖角" - }, - { - "command": "汐洛.花字.字体_斜体" - }, - { - "command": "汐洛.花字.字体_等宽" - }, - { - "command": "汐洛.花字.字体_删除线" - } - ], - "editor/context": [ - { - "when": "editorHasSelection && resourceLangId == typescript", - "command": "sillot.openPackageOnNpm", - "group": "navigation" - }, - { - "when": "editorHasSelection", - "submenu": "汐洛.花字", - "group": "navigation" - } - ] + { + "command": "汐洛.花字.样式_转大写" }, - "viewsContainers": { - "activitybar": [ - { - "id": "package-explorer", - "title": "汐洛插件面板", - "icon": "media/dep.svg" - } - ] + { + "command": "汐洛.花字.样式_转小写" }, - "views": { - "package-explorer": [ - { - "id": "nodeDependencies", - "name": "Node Dependencies", - "icon": "media/dep.svg", - "contextualTitle": "Package Explorer" - } - ], - "explorer": [ - { - "id": "jsonOutline", - "name": "Json Outline", - "when": "jsonOutlineEnabled" - }, - { - "id": "ftpExplorer", - "name": "FTP Explorer" - }, - { - "id": "fileExplorer", - "name": "File Explorer" - }, - { - "id": "testView", - "name": "Test View" - }, - { - "id": "testViewDragAndDrop", - "name": "Test View Drag and Drop" - } - ] + { + "command": "汐洛.花字.字体_默认" }, - "languages": [ - { - "id": "dosc", - "aliases": [ - "csod", - "ds" - ], - "extensions": [ - ".dosc" - ], - "configuration": "./languages/_dosc.language-configuration.json" - }, - { - "id": "sy", - "aliases": [ - "SY", - "sy" - ], - "extensions": [ - ".sy" - ], - "configuration": "./languages/_sy.language-configuration.json" - } + { + "command": "汐洛.花字.字体_手写体" + }, + { + "command": "汐洛.花字.字体_粗体" + }, + { + "command": "汐洛.花字.字体_德文尖角" + }, + { + "command": "汐洛.花字.字体_斜体" + }, + { + "command": "汐洛.花字.字体_等宽" + }, + { + "command": "汐洛.花字.字体_删除线" + } + ], + "editor/context": [ + { + "when": "editorHasSelection && resourceLangId == typescript", + "command": "sillot.openPackageOnNpm", + "group": "navigation" + }, + { + "when": "editorHasSelection", + "submenu": "汐洛.花字", + "group": "navigation" + } + ], + "explorer/context": [ + { + "when": "resourceLangId == json && resourceFilename == package.json", + "command": "汐洛.addPackageJsonMapping", + "group": "navigation" + } + ] + }, + "viewsContainers": { + "activitybar": [ + { + "id": "package-explorer", + "title": "汐洛插件面板", + "icon": "media/dep.svg" + } + ] + }, + "views": { + "package-explorer": [ + { + "id": "nodeDependencies", + "name": "Node Dependencies", + "icon": "media/dep.svg", + "contextualTitle": "Package Explorer" + } + ], + "explorer": [ + { + "id": "jsonOutline", + "name": "Json Outline", + "when": "jsonOutlineEnabled" + }, + { + "id": "ftpExplorer", + "name": "FTP Explorer" + }, + { + "id": "fileExplorer", + "name": "File Explorer" + }, + { + "id": "testView", + "name": "Test View" + }, + { + "id": "testViewDragAndDrop", + "name": "Test View Drag and Drop" + } + ] + }, + "languages": [ + { + "id": "dosc", + "aliases": [ + "csod", + "ds" ], - "codeActions": [ - { - "languages": [ - "sy" - ], - "provider": "SyCodeActionProvider", - "providedCodeActionKinds": [ - "quickfix", - "refactor", - "source", - "organizeImports" - ], - "actions": { - "kind": "quickfix", - "title": "Fix sy error", - "description": "Fixes a JSON error in the current file" - } - } + "extensions": [ + ".dosc" ], - "semanticTokenTypes": [ - { - "id": "type", - "description": "Type names", - "defaultLegend": { - "tokenType": "type" - } - }, - { - "id": "trailingComma", - "description": "Trailing commas in JSON", - "defaultLegend": { - "tokenType": "trailingComma" - } - } + "configuration": "./languages/_dosc.language-configuration.json" + }, + { + "id": "sy", + "aliases": [ + "SY", + "sy" ], - "semanticTokenModifiers": [ - { - "id": "error", - "description": "Indicates an error" - } + "extensions": [ + ".sy" ], - "grammars": [ - { - "language": "sy", - "scopeName": "source.sy", - "path": "./grammars/sy.tmLanguage.json" - } + "configuration": "./languages/_sy.language-configuration.json" + } + ], + "codeActions": [ + { + "languages": [ + "sy" ], - "snippets": [ - { - "language": "javascript", - "path": "./snippets/sofill.json" - }, - { - "language": "typescript", - "path": "./snippets/sofill.json" - }, - { - "language": "markdown", - "path": "./snippets/md.json" - }, - { - "language": "mdx", - "path": "./snippets/md.json" - } - ] - }, - "vsce": { - "baseImagesUrl": "https://raw.githubusercontent.com/Hi-Windom/Sillot/master/app/stage/icon.png", - "dependencies": false, - "yarn": false - }, - "scripts": { - "vscode:prepublish": "pnpm run package", - "compile": "webpack", - "watch": "webpack --watch", - "package": "webpack --mode production --devtool hidden-source-map", - "vsce:package": "pnpm vsce package", - "vsce:login": "pnpm vsce login Hi-Windom", - "compile-tests": "tsc -p . --outDir out", - "watch-tests": "tsc -p . -w --outDir out", - "pretest": "pnpm run compile-tests && pnpm run compile && pnpm run lint", - "lint": "eslint src --ext ts --fix", - "test": "vscode-test", - "b:lint": "biome lint ./src --config-path ../../ --diagnostic-level error --apply && echo 'ref https://biomejs.dev/reference/cli/#biome-lint'", - "b:check": "biome check ./src --config-path ../../ --diagnostic-level error --apply && echo 'ref https://biomejs.dev/reference/cli/#biome-check'" - }, - "devDependencies": { - "@types/fs-extra": "^11.0.4", - "@types/mocha": "^10.0.6", - "@types/node": "18.x", - "@types/vscode": "^1.88.0", - "@typescript-eslint/eslint-plugin": "^7.4.0", - "@typescript-eslint/parser": "^7.4.0", - "@vscode/test-cli": "^0.0.8", - "@vscode/test-electron": "^2.3.9", - "@vscode/vsce": "^2.26.0", - "eslint": "^8.57.0", - "jsonc-parser": "^3.2.1", - "mkdirp": "^3.0.1", - "rimraf": "^5.0.5", - "ts-loader": "^9.5.1", - "typescript": "^5.3.3", - "webpack": "^5.91.0", - "webpack-cli": "^5.1.4" - }, - "dependencies": { - "@octokit/rest": "^20.1.0", - "fs-extra": "^11.2.0", - "json5": "^2.2.3" - } -} + "provider": "SyCodeActionProvider", + "providedCodeActionKinds": [ + "quickfix", + "refactor", + "source", + "organizeImports" + ], + "actions": { + "kind": "quickfix", + "title": "Fix sy error", + "description": "Fixes a JSON error in the current file" + } + } + ], + "semanticTokenTypes": [ + { + "id": "type", + "description": "Type names", + "defaultLegend": { + "tokenType": "type" + } + }, + { + "id": "trailingComma", + "description": "Trailing commas in JSON", + "defaultLegend": { + "tokenType": "trailingComma" + } + } + ], + "semanticTokenModifiers": [ + { + "id": "error", + "description": "Indicates an error" + } + ], + "grammars": [ + { + "language": "sy", + "scopeName": "source.sy", + "path": "./grammars/sy.tmLanguage.json" + } + ], + "snippets": [ + { + "language": "javascript", + "path": "./snippets/sofill.json" + }, + { + "language": "typescript", + "path": "./snippets/sofill.json" + }, + { + "language": "markdown", + "path": "./snippets/md.json" + }, + { + "language": "mdx", + "path": "./snippets/md.json" + } + ] + }, + "vsce": { + "baseImagesUrl": "https://raw.githubusercontent.com/Hi-Windom/Sillot/master/app/stage/icon.png", + "dependencies": false, + "yarn": false + }, + "scripts": { + "vscode:prepublish": "pnpm run package", + "compile": "webpack", + "watch": "webpack --watch", + "package": "webpack --mode production --devtool hidden-source-map", + "vsce:package": "pnpm vsce package", + "vsce:login": "pnpm vsce login Hi-Windom", + "compile-tests": "tsc -p . --outDir out", + "watch-tests": "tsc -p . -w --outDir out", + "pretest": "pnpm run compile-tests && pnpm run compile && pnpm run lint", + "lint": "eslint src --ext ts --fix", + "test": "vscode-test", + "b:lint": "biome lint ./src --config-path ../../ --diagnostic-level error --apply && echo 'ref https://biomejs.dev/reference/cli/#biome-lint'", + "b:check": "biome check ./src --config-path ../../ --diagnostic-level error --apply && echo 'ref https://biomejs.dev/reference/cli/#biome-check'" + }, + "devDependencies": { + "@types/fs-extra": "^11.0.4", + "@types/mocha": "^10.0.6", + "@types/node": "18.x", + "@types/vscode": "^1.88.0", + "@typescript-eslint/eslint-plugin": "^7.4.0", + "@typescript-eslint/parser": "^7.4.0", + "@vscode/test-cli": "^0.0.8", + "@vscode/test-electron": "^2.3.9", + "@vscode/vsce": "^2.26.0", + "eslint": "^8.57.0", + "jsonc-parser": "^3.2.1", + "mkdirp": "^3.0.1", + "rimraf": "^5.0.5", + "ts-loader": "^9.5.1", + "typescript": "^5.3.3", + "webpack": "^5.91.0", + "webpack-cli": "^5.1.4" + }, + "dependencies": { + "@octokit/rest": "^20.1.0", + "fs-extra": "^11.2.0", + "json5": "^2.2.3" + } +} \ No newline at end of file diff --git a/.vscode/extensions/Sillot/src/extension.const.ts b/.vscode/extensions/Sillot/src/extension.const.ts index 93d836778f..f5d651f41d 100644 --- a/.vscode/extensions/Sillot/src/extension.const.ts +++ b/.vscode/extensions/Sillot/src/extension.const.ts @@ -1,4 +1,5 @@ export const C = { extensionId: "Hi-Windom.sillot", - npmjs: "https://www.npmjs.com" + npmjs: "https://www.npmjs.com", + PackageJsonMapping: "PackageJsonMapping.sillot.jsonc", } diff --git a/.vscode/extensions/Sillot/src/extension.ts b/.vscode/extensions/Sillot/src/extension.ts index 415c9ca19a..f9b797d415 100644 --- a/.vscode/extensions/Sillot/src/extension.ts +++ b/.vscode/extensions/Sillot/src/extension.ts @@ -24,7 +24,7 @@ import { SnippetCompletionItems } from "./provider/db/Snippet"; import { StructCompletionItems } from "./provider/db/Struct"; import { TypeParameterCompletionItems } from "./provider/db/TypeParameter"; import { VariableCompletionItems } from "./provider/db/Variable"; -import path from "path"; +import path, { resolve } from "path"; import { DepNodeProvider } from "./nodeDependencies"; import { FileExplorer } from "./fileExplorer"; import { TestView } from "./testView"; @@ -59,27 +59,124 @@ class fileCompletionItemProvider implements vscode.CompletionItemProvider { } } // 序列化并保存到文件 -async function saveCompletionItemsToFile(filePath: string, items: Array) { +async function saveCompletionItemsToFile(filePath: string, items: Array | { [key: string]: any }) { // 使用 json5.stringify 格式化 JSON,使其更易读 - const serializedItems = json5.stringify(items, null, 2); + const serializedItems = json5.stringify(items, { + space: 2, + quote: '"', + }); // 使用 fs-extra 写入文件 await fs.writeFile(filePath, serializedItems, "utf-8"); } // 从文件反序列化 -async function loadCompletionItemsFromFile(filePath: string): Promise> { +async function loadCompletionItemsFromFile(filePath: string): Promise { // 使用 fs-extra 读取文件 const serializedItems = await fs.readFile(filePath, "utf-8"); // 使用 json5.parse 反序列化 JSON - const items: Array = json5.parse(serializedItems); + const items = json5.parse(serializedItems); // 返回反序列化后的数组 return items; } export async function activate(context: vscode.ExtensionContext) { + const disposable555 = vscode.commands.registerCommand("汐洛.同步更新版本", () => { + vscode.window.showInputBox({ prompt: "Enter new version" }).then(async version => { + if (version) { + const wname = vscode.workspace.name; + if (wname && vscode.workspace.workspaceFile) { + const pkgMapFile = `${path.dirname(vscode.workspace.workspaceFile.fsPath)}/${C.PackageJsonMapping}`; + Log.d(wname, pkgMapFile); + if (!(await fs.exists(pkgMapFile))) { + vscode.window.showWarningMessage("package.json 映射不存在,请先添加"); + return; + } + + const pkgMap: { [key: string]: any } = await loadCompletionItemsFromFile(pkgMapFile); + const paths: string[] = pkgMap[wname]; + // 创建快速选择框 + const quickPick = vscode.window.createQuickPick(); + quickPick.title = "选择要更新版本的文件"; + // quickPick.items = [{ label: "Option 1" }, { label: "Option 2" }, { label: "Option 3" }]; + quickPick.items = paths.map(path => ({ label: path })); + quickPick.canSelectMany = true; // 允许多选 + + // 显示快速选择框并等待用户选择 + const selectedOptions: string[] = await new Promise(resolve => { + quickPick.onDidAccept(() => { + resolve(quickPick.selectedItems.map(item => item.label)); + quickPick.dispose(); + }); + quickPick.onDidHide(() => { + resolve([]); + quickPick.dispose(); + }); + quickPick.show(); + }); + + if (selectedOptions.length > 0) { + Log.d(`Version: ${version}, Selected options:${selectedOptions.join(", ")}`); + } else { + resolve(); + } + // 遍历映射并更新版本号 + selectedOptions.forEach(async (value: string, index: number) => { + Log.d("汐洛.同步更新版本", value); + if (await fs.exists(value)) { + const pkgContent = fs.readJSONSync(value); + pkgContent.version = version; + fs.writeFileSync(value, JSON.stringify(pkgContent, null, 2)); + Log.d(`${version} -> ${value}`); + } else { + vscode.window.showWarningMessage(`已跳过无效映射 ${value}`); + } + }); + vscode.window.showInformationMessage("Version updated in all package.json files."); + } else { + vscode.window.showWarningMessage("当前不在工作区环境"); + } + } + }); + }); + + context.subscriptions.push(disposable555); + + const addMappingDisposable = vscode.commands.registerCommand("汐洛.addPackageJsonMapping", async (uri: vscode.Uri) => { + if (uri?.fsPath.endsWith("package.json")) { + const wname = vscode.workspace.name; + if (wname && vscode.workspace.workspaceFile) { + Log.d(wname, uri.fsPath); + let pkgMap: { [key: string]: any } = {}; + const pkgMapFile = `${path.dirname(vscode.workspace.workspaceFile.fsPath)}/${C.PackageJsonMapping}`; + if (await fs.exists(pkgMapFile)) { + pkgMap = await loadCompletionItemsFromFile(pkgMapFile); + } + if (!pkgMap[wname]) { + pkgMap[wname] = []; + } + if (pkgMap[wname].includes(uri.fsPath)) { + vscode.window.showInformationMessage("当前 package.json 映射已存在"); + } else { + pkgMap[wname].push(uri.fsPath); + saveCompletionItemsToFile(pkgMapFile, pkgMap); + vscode.window.showInformationMessage(`已映射到工作区 ${wname}`); + vscode.window.showWarningMessage( + `注意:目前使用绝对路径,因此移动项目后请手动修改工作区配置文件同目录下的 ${C.PackageJsonMapping} 文件` + ); + } + } else { + vscode.window.showWarningMessage("当前不在工作区环境"); + } + } else { + vscode.window.showErrorMessage("Right-click command must be executed on a package.json file."); + } + }); + + context.subscriptions.push(addMappingDisposable); + const rootPath = vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0 ? vscode.workspace.workspaceFolders[0].uri.fsPath @@ -302,7 +399,7 @@ export async function activate(context: vscode.ExtensionContext) { apply花字Transformation(c); }) ); - }) + }); const disposable5 = vscode.commands.registerCommand("sillot.pickEXE", () => { vscode.window diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json index 5e50bec899..a4466c1f47 100644 --- a/app/appearance/langs/en_US.json +++ b/app/appearance/langs/en_US.json @@ -268,7 +268,7 @@ "passwordNoMatch": "The passwords entered twice do not match", "cloudConfigTip": "Please configure in [Settings - Cloud]", "confirmUninstall": "Are you sure you want to uninstall ${name}?", - "scrollGetMore": "Don't panic... scroll up and down to load more", + "scrollGetMore": "Scroll up and down to load more", "flashcardNewCard": "New", "flashcardReviewCard": "Old", "flashcardDueCard": "Due", @@ -808,7 +808,7 @@ "moveToBottomRight": "Move to the Bottom Right", "accountDisplayTitle": "Display the title icon", "accountDisplayVIP": "Display the VIP icon", - "rollbackConfirm": "Rollback is an irreversible operation. Once the rollback is performed, the data cannot be returned to the current state. Are you sure to use ${date} to rollback?", + "rollbackConfirm": "Rollback operation cannot be undone, are you sure you want to rollback ${date} ?", "pdfTip": "PDF export does not support Dark theme", "pdfConfirm": "Do you want to continue exporting with the selected Light theme?", "import": "Import", @@ -868,7 +868,7 @@ "useDefault": "Open with default program", "previous": "Previous", "next": "Next", - "kernelFault0": "Don't panic...", + "kernelFault0": "SiYuan encountered a little problem...", "kernelFault1": "Your data should be safe, please check whether the network connection and kernel process are normal, and then restart SiYuan", "kernelFault2": "If the problem persists, please look for help or report bugs here", "fontSize": "Font Size", diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index aea451861f..13cd3ebe65 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -268,7 +268,7 @@ "passwordNoMatch": "Las contraseñas ingresadas dos veces no coinciden", "cloudConfigTip": "Configure en [Configuración - Nube]", "confirmUninstall": "¿Está seguro de que desea desinstalar ${name}?", - "scrollGetMore": "No se asuste... desplácese hacia arriba y hacia abajo para cargar más", + "scrollGetMore": "Desplácese hacia arriba y hacia abajo para cargar más", "flashcardNewCard": "Nueva Tarjeta", "flashcardReviewCard": "Vieja Tarjeta", "flashcardDueCard": "Tarjeta debida", @@ -808,7 +808,7 @@ "moveToBottomRight": "Mover a la parte inferior derecha", "accountDisplayTitle": "Mostrar el icono del título", "accountDisplayVIP": "Mostrar el icono VIP", - "rollbackConfirm": "La reversión es una operación irreversible. Una vez realizada la reversión, los datos no pueden volver al estado actual. ¿Está seguro de hacer ${date} una reversión?", + "rollbackConfirm": "La operación de retroceso no se puede deshacer, ¿estás seguro de que quieres revertir ${date} ?", "pdfTip": "La exportación de PDF no es compatible con el tema oscuro", "pdfConfirm": "¿Desea seguir exportando con el tema Claro seleccionado?", "import": "Importar", @@ -868,7 +868,7 @@ "useDefault": "Abrir con el programa por defecto", "previous": "Anterior", "next": "Siguiente", - "kernelFault0": "No entres en pánico...", + "kernelFault0": "SiYuan está teniendo un problema...", "kernelFault1": "Sus datos deben estar seguros, verifique si la conexión de red y el proceso del kernel son normales y luego reinicie SiYuan", "kernelFault2": "Si el problema persiste, busque ayuda o informe de errores aquí", "fontSize": "Tamaño de la fuente", diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index 11de22ef50..0e89d0f021 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -268,7 +268,7 @@ "passwordNoMatch": "Les mots de passe saisis deux fois ne correspondent pas", "cloudConfigTip": "Veuillez configurer dans [Paramètres - Cloud]", "confirmUninstall": "Êtes-vous sûr de vouloir désinstaller ${name} ?", - "scrollGetMore": "Ne paniquez pas... faites défiler de haut en bas pour en charger plus", + "scrollGetMore": "Faites défiler de haut en bas pour en charger plus", "flashcardNewCard": "Nouvelle carte", "flashcardReviewCard": "Ancienne carte", "flashcardDueCard": "Carte due", @@ -808,7 +808,7 @@ "moveToBottomRight": "Déplacer vers la Bas à Droit", "accountDisplayTitle": "Afficher l'icône du titre", "accountDisplayVIP": "Afficher l'icône VIP", - "rollbackConfirm": "La restauration est une opération irréversible. Une fois la restauration effectuée, les données ne peuvent pas être restaurées à leur état actuel. Êtes-vous sûr d'utiliser ${date} pour la restauration ?", + "rollbackConfirm": "L'opération de retour en arrière est irréversible. Êtes-vous sûr de vouloir revenir en arrière à la date ${date} ?", "pdfTip": "L'exportation de PDF ne supporte pas le thème Dark", "pdfConfirm": "Voulez-vous continuer à exporter avec le thème clear sélectionné ?", "import": "Importer", @@ -868,7 +868,7 @@ "useDefault": "Ouvrir avec le programme par défaut", "previous": "Précédent", "next": "Prochain", - "kernelFault0": "Ne paniquez pas...", + "kernelFault0": "SiYuan a rencontré un petit problème...", "kernelFault1": "Vos données doivent être en sécurité, veuillez vérifier si la connexion réseau et le processus du noyau sont normaux, puis redémarrez SiYuan", "kernelFault2": "Si le problème persiste, veuillez rechercher de l'aide ou signaler les bogues ici", "fontSize": "Taille de la police", diff --git a/app/appearance/langs/ja_JP.json b/app/appearance/langs/ja_JP.json index e9e8a38119..d83d3f8076 100644 --- a/app/appearance/langs/ja_JP.json +++ b/app/appearance/langs/ja_JP.json @@ -268,7 +268,7 @@ "passwordNoMatch": "入力されたパスワードが一致しません", "cloudConfigTip": "[設定] - [クラウド] で設定してください", "confirmUninstall": "${name} をアンインストールしてもよろしいですか?", - "scrollGetMore": "慌てずに... さらに読み込むには上下にスクロールしてください", + "scrollGetMore": "さらに読み込むには上下にスクロールしてください", "flashcardNewCard": "新しいカード", "flashcardReviewCard": "古いカード", "flashcardDueCard": "期限切れカード", @@ -538,7 +538,7 @@ "lastUsed": "最近使用した外観", "removedNotebook": "削除されたノートブック", "querySyntax": "クエリ構文", - "rollback": "ロークバック", + "rollback": "ロールバック", "custom": "カスタム", "feedback": "フィードバック", "inbox": "受信トレイ", @@ -808,7 +808,7 @@ "moveToBottomRight": "右底に移動", "accountDisplayTitle": "タイトルアイコンを表示", "accountDisplayVIP": "VIPアイコンを表示", - "rollbackConfirm": "ロールバックは取り返しのつかない操作です。一度実行すると、データを現在の状態に戻すことはできません。${date} を使用してロールバックしてもよろしいですか?", + "rollbackConfirm": "ロールバック操作は取り消せません。本当に ${date} をロールバックしますか?", "pdfTip": "PDF エクスポートはダークテーマに対応していません", "pdfConfirm": "選択したライトテーマでエクスポートを続行しますか?", "import": "インポート", @@ -868,7 +868,7 @@ "useDefault": "デフォルトのプログラムで開く", "previous": "前へ", "next": "次へ", - "kernelFault0": "慌てないで...", + "kernelFault0": "SiYuan が少し問題に直面しています...", "kernelFault1": "データは安全です、ネットワーク接続とカーネルプロセスが正常かどうかを確認して、SiYuan を再起動してください", "kernelFault2": "問題が解決しない場合は、こちらでヘルプやバグレポートを探してください", "fontSize": "フォントサイズ", diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json index abb6ce60c5..6efa47fd68 100644 --- a/app/appearance/langs/zh_CHT.json +++ b/app/appearance/langs/zh_CHT.json @@ -268,7 +268,7 @@ "passwordNoMatch": "兩次輸入的密碼不一致", "cloudConfigTip": "請在 [設置 - 雲端] 中進行配置", "confirmUninstall": "確定卸載 ${name} ?", - "scrollGetMore": "不要驚慌...上下滾動即可加載更多內容", + "scrollGetMore": "上下滾動即可加載更多內容", "flashcardNewCard": "新卡", "flashcardReviewCard": "舊卡", "flashcardDueCard": "到期卡", @@ -808,7 +808,7 @@ "moveToBottomRight": "移動到下側右方", "accountDisplayTitle": "首欄顯示頭銜", "accountDisplayVIP": "首欄顯示 VIP", - "rollbackConfirm": "回復是不可逆的操作,一旦執行回復後資料就無法回到當前狀態,確定使用 ${date} 進行回復嗎?", + "rollbackConfirm": "回復操作無法撤銷,確定要將 ${date} 回復嗎?", "pdfTip": "PDF 匯出不支援深色主題", "pdfConfirm": "是否使用已選擇的淺色主題繼續匯出?", "import": "導入", @@ -868,8 +868,8 @@ "useDefault": "使用預設程式打開", "previous": "上一個", "next": "下一個", - "kernelFault0": "不要驚慌...", - "kernelFault1": "你的資料應該是安全的,請檢查網絡連接和Kernel程序是否正常,然後重新啟動思源", + "kernelFault0": "思源筆記遇到了一點問題...", + "kernelFault1": "你的資料應該是安全的,請檢查網絡連接和Kernel程序是否正常,然後重新啟動思源筆記", "kernelFault2": "如果仍然出現該問題,請在這裡尋求幫助或者報告缺陷", "fontSize": "字型大小", "fontSizeTip": "字號預設為 16,該設置影響編輯器和導出 PDF/HTML 字體大小顯示", diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json index a2f5dce62c..fb9299942f 100644 --- a/app/appearance/langs/zh_CN.json +++ b/app/appearance/langs/zh_CN.json @@ -268,7 +268,7 @@ "passwordNoMatch": "两次输入的密码不一致", "cloudConfigTip": "请在 [设置 - 云端] 中进行配置", "confirmUninstall": "确定卸载 ${name} ?", - "scrollGetMore": "不要惊慌...上下滚动即可加载更多内容", + "scrollGetMore": "上下滚动即可加载更多内容", "flashcardNewCard": "新卡", "flashcardReviewCard": "旧卡", "flashcardDueCard": "到期卡", @@ -809,7 +809,7 @@ "moveToBottomRight": "移动到下侧右方", "accountDisplayTitle": "顶栏显示头衔", "accountDisplayVIP": "顶栏显示 VIP", - "rollbackConfirm": "回滚是不可逆的操作,一旦执行回滚后数据就无法回到当前状态,确定使用 ${date} 进行回滚吗?", + "rollbackConfirm": "回滚操作无法撤销,确定要将 ${date} 回滚吗?", "pdfTip": "PDF 导出不支持深色主题", "pdfConfirm": "是否使用已选择的浅色主题继续导出?", "import": "导入", @@ -869,8 +869,8 @@ "useDefault": "使用默认程序打开", "previous": "上一个", "next": "下一个", - "kernelFault0": "不要惊慌...", - "kernelFault1": "你的数据应该是安全的,请检查网络连接和内核进程是否正常,然后重新启动思源", + "kernelFault0": "思源笔记遇到了一点问题...", + "kernelFault1": "你的数据应该是安全的,请检查网络连接和内核进程是否正常,然后重新启动思源笔记", "kernelFault2": "如果仍然出现该问题,请在这里寻求帮助或者报告缺陷", "fontSize": "字号", "fontSizeTip": "字号默认为 16,该设置影响编辑器和导出 PDF/HTML 字体大小显示", diff --git a/app/package.json b/app/package.json index 3e7ffb6e32..f02dc6fea3 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "sillot", - "version": "0.32.1500", + "version": "0.32.2000", "syv": "3.0.13", "sypv": "[]", "description": "Build Your Eternal Digital Garden", @@ -163,4 +163,4 @@ "resolutions": { "lodash": "4.17.21" } -} +} \ No newline at end of file diff --git a/app/src/block/util.ts b/app/src/block/util.ts index 69a1d75925..fe484c04ef 100644 --- a/app/src/block/util.ts +++ b/app/src/block/util.ts @@ -1,6 +1,6 @@ -import {focusBlock, focusByWbr, getEditorRange} from "../protyle/util/selection"; -import {hasClosestBlock, hasClosestByClassName} from "../protyle/util/hasClosest"; -import {getNextBlock, getTopAloneElement} from "../protyle/wysiwyg/getBlock"; +import {focusByWbr, getEditorRange} from "../protyle/util/selection"; +import {hasClosestBlock} from "../protyle/util/hasClosest"; +import {getTopAloneElement} from "../protyle/wysiwyg/getBlock"; import {genListItemElement, updateListOrder} from "../protyle/wysiwyg/list"; import {transaction, updateTransaction} from "../protyle/wysiwyg/transaction"; import {scrollCenter} from "../util/highlightById"; @@ -9,6 +9,7 @@ import {hideElements} from "../protyle/ui/hideElements"; import {blockRender} from "../protyle/render/blockRender"; import {fetchPost} from "../util/fetch"; import {openFileById} from "../editor/util"; +import {openMobileFileById} from "../mobile/editor"; export const cancelSB = (protyle: IProtyle, nodeElement: Element) => { window.sout.tracker("invoked"); @@ -83,12 +84,15 @@ export const jumpToParent = (protyle: IProtyle, nodeElement: Element, type: "par if (!targetId) { return; } - + /// #if !MOBILE openFileById({ app: protyle.app, id: targetId, action: [Constants.CB_GET_FOCUS, targetId !== protyle.block.rootID && protyle.block.showAll ? Constants.CB_GET_ALL : ""] }) + /// #else + openMobileFileById(protyle.app, targetId, [Constants.CB_GET_FOCUS, targetId !== protyle.block.rootID && protyle.block.showAll ? Constants.CB_GET_ALL : ""]); + /// #endif }); }; diff --git a/app/src/config/bazaar.ts b/app/src/config/bazaar.ts index 2108a4fc57..802f7a866e 100644 --- a/app/src/config/bazaar.ts +++ b/app/src/config/bazaar.ts @@ -529,8 +529,8 @@ export const bazaar = {
${window.siyuan.languages.currentVer}
v${data.version}
${dataObj.downloaded ? window.siyuan.languages.installDate : window.siyuan.languages.releaseDate}
${dataObj.downloaded ? data.hInstallDate : data.hUpdated}
-
-
${window.siyuan.languages.pkgSize}
${data.hSize}
+
+
${window.siyuan.languages.pkgSize}
${data.hSize}
${window.siyuan.languages.installSize}
${data.hInstallSize}
diff --git a/app/src/editor/openLink.ts b/app/src/editor/openLink.ts new file mode 100644 index 0000000000..e0106e5a1a --- /dev/null +++ b/app/src/editor/openLink.ts @@ -0,0 +1,75 @@ +import {isLocalPath, pathPosix} from "../util/pathName"; +/// #if !BROWSER +import {shell} from "electron"; +/// #endif +import {getSearch} from "../util/functions"; +import {openByMobile} from "../protyle/util/compatibility"; +import {Constants} from "../constants"; +import {showMessage} from "../dialog/message"; +import {openAsset, openBy} from "./util"; + +export const openLink = (protyle: IProtyle, aLink: string, event?: MouseEvent, ctrlIsPressed = false) => { + let linkAddress = Lute.UnEscapeHTMLStr(aLink); + let pdfParams; + if (isLocalPath(linkAddress) && !linkAddress.startsWith("file://") && linkAddress.indexOf(".pdf") > -1) { + const pdfAddress = linkAddress.split("/"); + if (pdfAddress.length === 3 && pdfAddress[0] === "assets" && pdfAddress[1].endsWith(".pdf") && /\d{14}-\w{7}/.test(pdfAddress[2])) { + linkAddress = `assets/${pdfAddress[1]}`; + pdfParams = pdfAddress[2]; + } else { + pdfParams = parseInt(getSearch("page", linkAddress)); + linkAddress = linkAddress.split("?page")[0]; + } + } + /// #if MOBILE + openByMobile(linkAddress); + /// #else + if (isLocalPath(linkAddress)) { + if (Constants.SIYUAN_ASSETS_EXTS.includes(pathPosix().extname(linkAddress)) && + (!linkAddress.endsWith(".pdf") || + (linkAddress.endsWith(".pdf") && !linkAddress.startsWith("file://"))) + ) { + if (event && event.altKey) { + openAsset(protyle.app, linkAddress, pdfParams); + } else if (ctrlIsPressed) { + /// #if !BROWSER + openBy(linkAddress, "folder"); + /// #else + openByMobile(linkAddress); + /// #endif + } else if (event && event.shiftKey) { + /// #if !BROWSER + openBy(linkAddress, "app"); + /// #else + openByMobile(linkAddress); + /// #endif + } else { + openAsset(protyle.app, linkAddress, pdfParams, "right"); + } + } else { + /// #if !BROWSER + if (ctrlIsPressed) { + openBy(linkAddress, "folder"); + } else { + openBy(linkAddress, "app"); + } + /// #else + openByMobile(linkAddress); + /// #endif + } + } else if (linkAddress) { + if (0 > linkAddress.indexOf(":")) { + // 使用 : 判断,不使用 :// 判断 Open external application protocol invalid https://github.com/siyuan-note/siyuan/issues/10075 + // Support click to open hyperlinks like `www.foo.com` https://github.com/siyuan-note/siyuan/issues/9986 + linkAddress = `https://${linkAddress}`; + } + /// #if !BROWSER + shell.openExternal(linkAddress).catch((e) => { + showMessage(e); + }); + /// #else + openByMobile(linkAddress); + /// #endif + } + /// #endif +}; diff --git a/app/src/editor/util.ts b/app/src/editor/util.ts index fe4828e782..c47e56e80b 100644 --- a/app/src/editor/util.ts +++ b/app/src/editor/util.ts @@ -5,7 +5,7 @@ import {getInstanceById, getWndByLayout, pdfIsLoading, setPanelFocus} from "../l import {getDockByType} from "../layout/tabUtil"; import {getAllModels, getAllTabs} from "../layout/getAll"; import {highlightById, scrollCenter} from "../util/highlightById"; -import {getDisplayName, isLocalPath, pathPosix, showFileInFolder} from "../util/pathName"; +import {getDisplayName, pathPosix, showFileInFolder} from "../util/pathName"; import {Constants} from "../constants"; import {setEditMode} from "../protyle/util/setEditMode"; import {Files} from "../layout/dock/Files"; @@ -22,14 +22,13 @@ import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName,} from ".. import {zoomOut} from "../menus/protyle"; import {countBlockWord, countSelectWord} from "../layout/status"; import {showMessage} from "../dialog/message"; -import {getSearch, objEquals} from "../util/functions"; +import {objEquals} from "../util/functions"; import {resize} from "../protyle/util/resize"; import {Search} from "../search"; import type {App} from "../index"; import {newCardModel} from "../card/newCardTab"; import {preventScroll} from "../protyle/scroll/preventScroll"; import {clearOBG} from "../layout/dock/util"; -import {openByMobile} from "../protyle/util/compatibility"; export const openFileById = async (options: { app: App, @@ -706,69 +705,3 @@ export const openBy = (url: string, type: "folder" | "app") => { } /// #endif }; - -export const openLink = (protyle: IProtyle, aLink: string, event?: MouseEvent, ctrlIsPressed = false) => { - let linkAddress = Lute.UnEscapeHTMLStr(aLink); - let pdfParams; - if (isLocalPath(linkAddress) && !linkAddress.startsWith("file://") && linkAddress.indexOf(".pdf") > -1) { - const pdfAddress = linkAddress.split("/"); - if (pdfAddress.length === 3 && pdfAddress[0] === "assets" && pdfAddress[1].endsWith(".pdf") && /\d{14}-\w{7}/.test(pdfAddress[2])) { - linkAddress = `assets/${pdfAddress[1]}`; - pdfParams = pdfAddress[2]; - } else { - pdfParams = parseInt(getSearch("page", linkAddress)); - linkAddress = linkAddress.split("?page")[0]; - } - } - /// #if MOBILE - openByMobile(linkAddress); - /// #else - if (isLocalPath(linkAddress)) { - if (Constants.SIYUAN_ASSETS_EXTS.includes(pathPosix().extname(linkAddress)) && - (!linkAddress.endsWith(".pdf") || - (linkAddress.endsWith(".pdf") && !linkAddress.startsWith("file://"))) - ) { - if (event && event.altKey) { - openAsset(protyle.app, linkAddress, pdfParams); - } else if (ctrlIsPressed) { - /// #if !BROWSER - openBy(linkAddress, "folder"); - /// #else - openByMobile(linkAddress); - /// #endif - } else if (event && event.shiftKey) { - /// #if !BROWSER - openBy(linkAddress, "app"); - /// #else - openByMobile(linkAddress); - /// #endif - } else { - openAsset(protyle.app, linkAddress, pdfParams, "right"); - } - } else { - /// #if !BROWSER - if (ctrlIsPressed) { - openBy(linkAddress, "folder"); - } else { - openBy(linkAddress, "app"); - } - /// #else - openByMobile(linkAddress); - /// #endif - } - } else if (linkAddress) { - if (0 > linkAddress.indexOf(":")) { - // 使用 : 判断,不使用 :// 判断 Open external application protocol invalid https://github.com/siyuan-note/siyuan/issues/10075 - // Support click to open hyperlinks like `www.foo.com` https://github.com/siyuan-note/siyuan/issues/9986 - linkAddress = `https://${linkAddress}`; - } - /// #if !BROWSER - shell.openExternal(linkAddress).catch((e) => { - showMessage(e); - }); - /// #else - openByMobile(linkAddress); - /// #endif - } - /// #endif -}; diff --git a/app/src/history/history.ts b/app/src/history/history.ts index 9b96d9baef..250d3acef8 100644 --- a/app/src/history/history.ts +++ b/app/src/history/history.ts @@ -576,6 +576,7 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => { }, (response) => { iconElement.classList.add("b3-list-item__arrow--open"); let html = ""; + let ariaLabel = ""; response.data.items.forEach((docItem: { title: string, path: string, @@ -585,19 +586,28 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => { let chipClass = " b3-chip b3-chip--list "; if (docItem.op === "clean") { chipClass += "b3-chip--primary "; + ariaLabel = window.siyuan.languages.historyClean; } else if (docItem.op === "update") { chipClass += "b3-chip--info "; + ariaLabel = window.siyuan.languages.historyUpdate; } else if (docItem.op === "delete") { chipClass += "b3-chip--error "; + ariaLabel = window.siyuan.languages.historyDelete; } else if (docItem.op === "format") { chipClass += "b3-chip--pink "; + ariaLabel = window.siyuan.languages.historyFormat; } else if (docItem.op === "sync") { chipClass += "b3-chip--success "; + ariaLabel = window.siyuan.languages.historySync; } else if (docItem.op === "replace") { chipClass += "b3-chip--secondary "; + ariaLabel = window.siyuan.languages.historyReplace; + } else if (docItem.op === "outline") { + chipClass += "b3-chip--warning "; + ariaLabel = window.siyuan.languages.historyOutline; } html += `
  • - ${docItem.op.substring(0, 1).toUpperCase()} + ${docItem.op.substring(0, 1).toUpperCase()} ${escapeHtml(docItem.title)} diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts index 5f7017dda9..d880e8720f 100644 --- a/app/src/protyle/gutter/index.ts +++ b/app/src/protyle/gutter/index.ts @@ -69,9 +69,13 @@ export class Gutter { private gutterTip: string; constructor(protyle: IProtyle) { - this.gutterTip = window.siyuan.languages.gutterTip.replace("⌥→", updateHotkeyTip(window.siyuan.config.keymap.general.enter.custom)) - .replace("⌘↑", updateHotkeyTip(window.siyuan.config.keymap.editor.general.collapse.custom)) - .replace("⌥⌘A", updateHotkeyTip(window.siyuan.config.keymap.editor.general.attr.custom)); + if (!isMac()) { + this.gutterTip = window.siyuan.languages.gutterTip; + } else { + this.gutterTip = window.siyuan.languages.gutterTip.replace("⌥→", updateHotkeyTip(window.siyuan.config.keymap.general.enter.custom)) + .replace("⌘↑", updateHotkeyTip(window.siyuan.config.keymap.editor.general.collapse.custom)) + .replace("⌥⌘A", updateHotkeyTip(window.siyuan.config.keymap.editor.general.attr.custom)).replace(/⌘/g, "Ctrl+").replace(/⌥/g, "Alt+").replace(/⇧/g, "Shift+").replace(/⌃/g, "Ctrl+"); + } this.element = document.createElement("div"); this.element.className = "protyle-gutters"; this.element.addEventListener("dragstart", (event: DragEvent & { target: HTMLElement }) => { diff --git a/app/src/protyle/render/av/col.ts b/app/src/protyle/render/av/col.ts index 9a801f21e4..a216684ac8 100644 --- a/app/src/protyle/render/av/col.ts +++ b/app/src/protyle/render/av/col.ts @@ -178,7 +178,7 @@ export const getEditHTML = (options: { } else if (colData.type === "template") { html += ` `; } else if (colData.type === "relation") { const isSelf = colData.relation?.avID === options.data.id; diff --git a/app/src/protyle/render/av/openMenuPanel.ts b/app/src/protyle/render/av/openMenuPanel.ts index 280a1f7aed..a451b64623 100644 --- a/app/src/protyle/render/av/openMenuPanel.ts +++ b/app/src/protyle/render/av/openMenuPanel.ts @@ -54,14 +54,20 @@ export const openMenuPanel = (options: { avPanelElement.remove(); return; } - window.siyuan.menus.menu.remove(); const avID = options.blockElement.getAttribute("data-av-id"); - const blockID = options.blockElement.getAttribute("data-node-id"); fetchPost("/api/av/renderAttributeView", { id: avID, pageSize: Number.parseInt(options.blockElement.getAttribute("data-page-size")) || undefined, viewID: options.blockElement.getAttribute(Constants.CUSTOM_SY_AV_VIEW) }, (response) => { + avPanelElement = document.querySelector(".av__panel"); + if (avPanelElement) { + avPanelElement.remove(); + return; + } + window.siyuan.menus.menu.remove(); + const blockID = options.blockElement.getAttribute("data-node-id"); + const isCustomAttr = !options.blockElement.classList.contains("av"); const data = response.data as IAV; let html; diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts index db079ca509..faf7b553a3 100644 --- a/app/src/protyle/render/av/render.ts +++ b/app/src/protyle/render/av/render.ts @@ -228,7 +228,7 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex)} -
    +
    @@ -356,6 +356,7 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex)} addClearButton({ inputElement: searchInputElement, right: 0, + width: "1em", height: searchInputElement.clientHeight, clearCB() { viewsElement.classList.remove("av__views--show"); diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index eafe2a5e39..23e861ff8a 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -58,7 +58,7 @@ import {blockRender} from "../render/blockRender"; /// #if !MOBILE import {getAllModels} from "../../layout/getAll"; import {pushBack} from "../../util/backForward"; -import {openFileById, openLink} from "../../editor/util"; +import {openFileById} from "../../editor/util"; import {openGlobalSearch} from "../../search/util"; /// #else import {popSearch} from "../../mobile/menu/search"; @@ -91,6 +91,7 @@ import { updateCellsValue } from "../render/av/cell"; import {openEmojiPanel, unicode2Emoji} from "../../emoji"; +import {openLink} from "../../editor/openLink"; export class WYSIWYG { public lastHTMLs: { [key: string]: string } = {}; @@ -1746,6 +1747,10 @@ export class WYSIWYG { }); this.element.addEventListener("paste", (event: ClipboardEvent & { target: HTMLElement }) => { + // https://github.com/siyuan-note/siyuan/issues/11241 + if (event.target.localName === "input" && event.target.getAttribute("data-type") === "av-search") { + return; + } if (protyle.disabled) { event.stopPropagation(); event.preventDefault(); diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index 099bfe4262..7ae6bf6896 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -38,7 +38,7 @@ import {newFileContentBySelect, rename, replaceFileName} from "../../editor/rena import {insertEmptyBlock, jumpToParent} from "../../block/util"; import {isLocalPath} from "../../util/pathName"; /// #if !MOBILE -import {openBy, openFileById, openLink} from "../../editor/util"; +import {openBy, openFileById} from "../../editor/util"; /// #endif import { alignImgCenter, @@ -67,6 +67,7 @@ import {removeSearchMark} from "../toolbar/util"; import {avKeydown} from "../render/av/keydown"; import {checkFold} from "../../util/noRelyPCFunction"; import {AIActions} from "../../ai/actions"; +import {openLink} from "../../editor/openLink"; export const getContentByInlineHTML = (range: Range, cb: (content: string) => void) => { window.sout.tracker("invoked"); diff --git a/app/src/protyle/wysiwyg/remove.ts b/app/src/protyle/wysiwyg/remove.ts index 246779b0d8..2dd93eeabe 100644 --- a/app/src/protyle/wysiwyg/remove.ts +++ b/app/src/protyle/wysiwyg/remove.ts @@ -172,15 +172,15 @@ export const removeBlock = (protyle: IProtyle, blockElement: Element, range: Ran hideElements(["util"], protyle); return; } + const blockType = blockElement.getAttribute("data-type") // 空代码块直接删除 - if (blockElement.getAttribute("data-type") === "NodeCodeBlock" && getContenteditableElement(blockElement).textContent.trim() === "") { + if (blockType === "NodeCodeBlock" && getContenteditableElement(blockElement).textContent.trim() === "") { blockElement.classList.add("protyle-wysiwyg--select"); removeBlock(protyle, blockElement, range, type); return; } // 设置 bq 和代码块光标 - if (blockElement.getAttribute("data-type") === "NodeCodeBlock" || - blockElement.getAttribute("data-type") === "NodeTable") { + if (["NodeCodeBlock", "NodeTable", "NodeAttributeView"].includes(blockType)) { if (blockElement.previousElementSibling) { focusBlock(blockElement.previousElementSibling, undefined, false); } @@ -231,7 +231,7 @@ export const removeBlock = (protyle: IProtyle, blockElement: Element, range: Ran removeLi(protyle, blockElement, range, type === "Delete"); return; } - if (blockElement.getAttribute("data-type") === "NodeHeading") { + if (blockType === "NodeHeading") { turnsIntoTransaction({ protyle: protyle, selectsElement: [blockElement], diff --git a/app/src/util/addClearButton.ts b/app/src/util/addClearButton.ts index acdb88a185..280dae1eb1 100644 --- a/app/src/util/addClearButton.ts +++ b/app/src/util/addClearButton.ts @@ -16,13 +16,14 @@ export const addClearButton = (options: { inputElement: HTMLInputElement, clearCB?: () => void, right?: number, + width?: string, height?: number className?: string }) => { window.sout.tracker("-> options: ", options); options.inputElement.dataset.oldPaddingRight = options.inputElement.style.paddingRight; options.inputElement.insertAdjacentHTML("afterend", - ` + ` `); const clearElement = options.inputElement.nextElementSibling; clearElement.addEventListener("click", () => { diff --git a/docs/starlight/package.json b/docs/starlight/package.json index 4badd64fb6..4310a02918 100644 --- a/docs/starlight/package.json +++ b/docs/starlight/package.json @@ -1,28 +1,28 @@ { - "name": "starlight", - "type": "module", - "version": "0.0.1", - "scripts": { - "test": "echo 'Test your sister day by day'", - "dev": "astro dev", - "start": "astro dev", - "build": "astro check && astro build", - "preview": "astro preview", - "astro": "astro", - "pcl:aahbf": "node addAllHeadByFilename.cjs" - }, - "dependencies": { - "@astrojs/check": "^0.5.10", - "@astrojs/starlight": "^0.21.5", - "@vercel/speed-insights": "^1.0.10", - "astro": "^4.6.4", - "astro-feelback": "^0.3.4", - "sharp": "^0.33.3", - "starlight-links-validator": "^0.8.0", - "typescript": "^5.4.5" - }, - "devDependencies": { - "@types/node": "^20.12.7", - "sass": "^1.75.0" - } -} + "name": "starlight", + "type": "module", + "version": "0.32.2000", + "scripts": { + "test": "echo 'Test your sister day by day'", + "dev": "astro dev", + "start": "astro dev", + "build": "astro check && astro build", + "preview": "astro preview", + "astro": "astro", + "pcl:aahbf": "node addAllHeadByFilename.cjs" + }, + "dependencies": { + "@astrojs/check": "^0.5.10", + "@astrojs/starlight": "^0.21.5", + "@vercel/speed-insights": "^1.0.10", + "astro": "^4.6.4", + "astro-feelback": "^0.3.4", + "sharp": "^0.33.3", + "starlight-links-validator": "^0.8.0", + "typescript": "^5.4.5" + }, + "devDependencies": { + "@types/node": "^20.12.7", + "sass": "^1.75.0" + } +} \ No newline at end of file diff --git "a/docs/starlight/src/content/docs/\346\261\220\346\264\233\345\256\235\345\205\270/\345\277\253\351\200\237\345\274\200\345\247\213.md" "b/docs/starlight/src/content/docs/\346\261\220\346\264\233\345\256\235\345\205\270/\345\277\253\351\200\237\345\274\200\345\247\213.mdx" similarity index 54% rename from "docs/starlight/src/content/docs/\346\261\220\346\264\233\345\256\235\345\205\270/\345\277\253\351\200\237\345\274\200\345\247\213.md" rename to "docs/starlight/src/content/docs/\346\261\220\346\264\233\345\256\235\345\205\270/\345\277\253\351\200\237\345\274\200\345\247\213.mdx" index aa6ae5d9aa..0b9d9c7cd6 100644 --- "a/docs/starlight/src/content/docs/\346\261\220\346\264\233\345\256\235\345\205\270/\345\277\253\351\200\237\345\274\200\345\247\213.md" +++ "b/docs/starlight/src/content/docs/\346\261\220\346\264\233\345\256\235\345\205\270/\345\277\253\351\200\237\345\274\200\345\247\213.mdx" @@ -1,9 +1,13 @@ --- title: 快速开始 --- + +export const SillotNoteName = "汐洛绞架" +export const syNoteName = "思源笔记" + ## 🦢 汐洛缘起 -汐洛孵化自思源笔记。汐洛的诞生颇具传奇色彩,最开始是 Sofill-(内部代号 winsay)主题团队抱怨思源笔记UI变化频繁且难以预测,同时多空间引入的随机端口让原本的主题设置持久化面临两难选择。时壬海文东首席司空夜华了解情况后,决定依托思源笔记现有基础,构建一个新彖务客户端,命名为汐洛(Sillot)。后来,司空夜华进一步提出海文东互联的概念,汐洛作为新彖务客户端具有举足轻重的战略地位。 +汐洛孵化自{syNoteName}。汐洛的诞生颇具传奇色彩,最开始是 Sofill-(内部代号 winsay)主题团队抱怨{syNoteName}UI变化频繁且难以预测,同时多空间引入的随机端口让原本的主题设置持久化面临两难选择。时壬海文东首席司空夜华了解情况后,决定依托{syNoteName}现有基础,构建一个新彖务客户端,命名为汐洛(Sillot)。后来,司空夜华进一步提出海文东互联的概念,汐洛作为新彖务客户端具有举足轻重的战略地位。 雪千凝进一步完善了汐洛彖夲肜矩阵。 @@ -13,9 +17,9 @@ title: 快速开始 > 奕奕(ViVi)是海文东面向内部效率集成的作用域与命名空间,主要提供生态集成,即海文东互联 -### 🤍 Sillnote Siow +### 🤍 Sillot-Gibbet Siow -汐洛笔记(Sillnote)基于自思源笔记(siyuan-note),前身是思源笔记汐洛版(更早是思源笔记汐洛分支),是智慧新录乄终端(多端融合,移动端优先)。司华(Siow)是智慧新彖乄事务驱动中心,混合云原生(C# in .NET + CPython + TypeScript in Deno)设计,主要配合汐洛。汐洛司华组成了智慧新彖乄的安全可控托管。 +{SillotNoteName}(Sillnot-Gibbet)基于自{syNoteName}(siyuan-note),前身是{syNoteName}汐洛版(更早是{syNoteName}汐洛分支),是智慧新录乄终端(多端融合,移动端优先)。司华(Siow)是智慧新彖乄事务驱动中心,混合云原生(C# in .NET + CPython + TypeScript in Deno)设计,主要配合汐洛。汐洛司华组成了智慧新彖乄的安全可控托管。 ### 🤍 Hellise Potter @@ -23,27 +27,27 @@ title: 快速开始 ### 🤍 Sofill Sili -沁棘(Sofill)为汐洛生态提供基于现代技术的全链路一体化敏捷开发支持,在VSCode插件、Obsdian 插件、汐洛笔记插件、汐洛笔记主题等多路复用。司丽(Sili)在沁棘的基础上为汐洛司华与赫礼斯叵特提供桥接支持,并承担试验场功能。简单来说,沁棘是独立的仓库,司丽则随汐洛或赫礼斯分发。 +沁棘(Sofill)为汐洛生态提供基于现代技术的全链路一体化敏捷开发支持,在VSCode插件、Obsdian 插件、{SillotNoteName}插件、{SillotNoteName}主题等多路复用。司丽(Sili)在沁棘的基础上为汐洛司华与赫礼斯叵特提供桥接支持,并承担试验场功能。简单来说,沁棘是独立的仓库,司丽则随汐洛或赫礼斯分发。 ### 🤍 Winsay Lnco -风颂(Winsay)的前身是思源笔记Sofill-主题,提供统一的界面美化,涵盖思源笔记汐洛版、汐洛、赫礼斯等应用。兰可(Lnco)的前身是思源笔记Sofill+主题(仅立项),专注于侵入式扩展实现。简单来说,风颂是独立的仓库,不与应用捆绑,兰可则随汐洛或赫礼斯分发。 +风颂(Winsay)的前身是{syNoteName}Sofill-主题,提供统一的界面美化,涵盖{SillotNoteName}、赫礼斯等应用。兰可(Lnco)的前身是{syNoteName}Sofill+主题(仅立项),专注于侵入式扩展实现。简单来说,风颂是独立的仓库,不与应用捆绑,兰可则随汐洛或赫礼斯分发。 ## ❓ 常见问题 -### 🙋 汐洛笔记适合思源笔记用户吗? +### 🙋 {SillotNoteName}适合{syNoteName}用户吗? -不适合。汐洛从立项之初就没有考虑过思源笔记用户。以 v0.11 版本为标志,汐洛彻底移除“社区分支”定位,不再对思源笔记社区负责,即不再考虑思源社区开发者。 +不适合。汐洛从立项之初就没有考虑过{syNoteName}用户。以 v0.11 版本为标志,汐洛彻底移除“社区分支”定位,不再对{syNoteName}社区负责,即不再考虑思源社区开发者。 -汐洛笔记与思源笔记存在较大差异,用户感知较明显的如下: +{SillotNoteName}与{syNoteName}存在较大差异,用户感知较明显的如下: * 仅维护中文(简中)和英文(随时有可能移除) -* 绝大多数第三方主题并不适配汐洛笔记 +* 绝大多数第三方主题并不适配{SillotNoteName} * 对运行环境十分严苛,比如需要 Windows 10 及以上系统,Android 12 及以上系统,Chromium 94 及以上内核——这些都是硬性要求而不是推荐。 -不过,得益于汐洛优异的顶层设计,在这片实验的田野上总是能迸发出蓬勃向上的生机。汐洛笔记已经成为思源笔记实际上最大的试验田。 在汐洛笔记上实验通过的特性或缺陷修复,如果必要会提交至思源笔记。 +不过,得益于汐洛优异的顶层设计,在这片实验的田野上总是能迸发出蓬勃向上的生机。{SillotNoteName}已经成为{syNoteName}实际上最大的试验田。 在{SillotNoteName}上实验通过的特性或缺陷修复,如果必要会提交至{syNoteName}。 -安卓端是汐洛的开发重点。汐洛基于思源笔记安卓端做了大量优化,力图保留源代码结构。第三方SDK为汐洛提供了崩溃报告功能,并规划了美好的愿景。 +安卓端是汐洛的开发重点。汐洛基于{syNoteName}安卓端做了大量优化,力图保留源代码结构。第三方SDK为汐洛提供了崩溃报告功能,并规划了美好的愿景。 ## 🙋 为什么环境要求如此严苛? diff --git a/kernel/go.mod b/kernel/go.mod index e5e632fb6e..7cb0fb0d84 100644 --- a/kernel/go.mod +++ b/kernel/go.mod @@ -13,7 +13,7 @@ require ( github.com/88250/epub v0.0.0-20230830085737-c19055cd1f48 github.com/88250/go-humanize v0.0.0-20240424102817-4f78fac47ea7 github.com/88250/gulu v1.2.3-0.20240501100058-dfdea8ef020e - github.com/88250/lute v1.7.7-0.20240501085643-eb6f97b5b990 + github.com/88250/lute v1.7.7-0.20240502031007-b0b1449cfbd4 github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4 @@ -47,7 +47,7 @@ require ( github.com/mitchellh/go-ps v1.0.0 github.com/mssola/useragent v1.0.0 github.com/olahol/melody v1.2.1 - github.com/open-spaced-repetition/go-fsrs v1.2.0 + github.com/open-spaced-repetition/go-fsrs v1.2.1 github.com/panjf2000/ants/v2 v2.9.1 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/radovskyb/watcher v1.0.7 @@ -58,9 +58,9 @@ require ( github.com/siyuan-note/dejavu v0.0.0-20240425085007-175ccbd84526 github.com/siyuan-note/eventbus v0.0.0-20240318125243-801c98e8f025 github.com/siyuan-note/filelock v0.0.0-20240419132904-2fbfe64f1939 - github.com/siyuan-note/httpclient v0.0.0-20240419132535-231841049644 + github.com/siyuan-note/httpclient v0.0.0-20240429013218-3caa1f89f9ed github.com/siyuan-note/logging v0.0.0-20231208035918-61f884c854f0 - github.com/siyuan-note/riff v0.0.0-20240419132144-b3e8b2b89d0d + github.com/siyuan-note/riff v0.0.0-20240502024535-718add51db67 github.com/spf13/cast v1.6.0 github.com/steambap/captcha v1.4.1 github.com/studio-b12/gowebdav v0.9.0 @@ -101,10 +101,10 @@ require ( github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.19.0 // indirect github.com/go-resty/resty/v2 v2.12.0 // indirect - github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect github.com/golang/glog v1.2.1 // indirect - github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect + github.com/google/pprof v0.0.0-20240430035430-e4905b036c4e // indirect github.com/google/uuid v1.6.0 // indirect github.com/gopherjs/gopherjs v1.17.2 // indirect github.com/gorilla/context v1.1.2 // indirect @@ -133,14 +133,14 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/onsi/ginkgo/v2 v2.17.1 // indirect + github.com/onsi/ginkgo/v2 v2.17.2 // indirect github.com/otiai10/gosseract/v2 v2.4.1 // indirect github.com/pelletier/go-toml/v2 v2.2.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/qiniu/go-sdk/v7 v7.20.0 // indirect github.com/quic-go/qpack v0.4.0 // indirect - github.com/quic-go/quic-go v0.42.0 // indirect + github.com/quic-go/quic-go v0.43.0 // indirect github.com/refraction-networking/utls v1.6.4 // indirect github.com/restic/chunker v0.4.0 // indirect github.com/richardlehane/mscfb v1.0.4 // indirect diff --git a/kernel/go.sum b/kernel/go.sum index b4d30c2666..a07731c0ee 100644 --- a/kernel/go.sum +++ b/kernel/go.sum @@ -12,8 +12,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950 h1:Pa5hMiBceT github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/88250/gulu v1.2.3-0.20240501100058-dfdea8ef020e h1:sJ4Cab5UYEG1LxV9auNtfCc4ePy/TYg+m1gQx7NMDU0= github.com/88250/gulu v1.2.3-0.20240501100058-dfdea8ef020e/go.mod h1:MUfzyfmbPrRDZLqxc7aPrVYveatTHRfoUa5TynPS0i8= -github.com/88250/lute v1.7.7-0.20240501085643-eb6f97b5b990 h1:aDwkV9eHMm0v14+yCKSjBupfuh9lMZmWGWmMinJpfGc= -github.com/88250/lute v1.7.7-0.20240501085643-eb6f97b5b990/go.mod h1:VDAzL8b+oCh+e3NAlmwwLzC53ten0rZlS8NboB7ljtk= +github.com/88250/lute v1.7.7-0.20240502031007-b0b1449cfbd4 h1:FkIdQSpufRA0fCf0CVaxYJtDaA76eohFUIzyRsDY5fs= +github.com/88250/lute v1.7.7-0.20240502031007-b0b1449cfbd4/go.mod h1:VDAzL8b+oCh+e3NAlmwwLzC53ten0rZlS8NboB7ljtk= github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c h1:Dl/8S9iLyPMTElnWIBxmjaLiWrkI5P4a21ivwAn5pU0= github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4= github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY= @@ -141,8 +141,8 @@ github.com/go-playground/validator/v10 v10.19.0/go.mod h1:dbuPbCMFw/DrkbEynArYaC github.com/go-resty/resty/v2 v2.0.0/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= github.com/go-resty/resty/v2 v2.12.0 h1:rsVL8P90LFvkUYq/V5BTVe203WfRIU4gvcf+yfzJzGA= github.com/go-resty/resty/v2 v2.12.0/go.mod h1:o0yGPrkS3lOe1+eFajk6kBW8ScXzwU3hD69/gt2yB/0= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= @@ -161,8 +161,8 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= +github.com/google/pprof v0.0.0-20240430035430-e4905b036c4e h1:RsXNnXE59RTt8o3DcA+w7ICdRfR2l+Bb5aE0YMpNTO8= +github.com/google/pprof v0.0.0-20240430035430-e4905b036c4e/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -272,12 +272,12 @@ github.com/olahol/melody v1.2.1/go.mod h1:GgkTl6Y7yWj/HtfD48Q5vLKPVoZOH+Qqgfa7Cv github.com/olekukonko/tablewriter v0.0.0-20180506121414-d4647c9c7a84/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= -github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= -github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= -github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= -github.com/open-spaced-repetition/go-fsrs v1.2.0 h1:cHCggDk/gEsQGyXybWn1NchrvSSzTknaN1fTpI9ihhI= -github.com/open-spaced-repetition/go-fsrs v1.2.0/go.mod h1:WpbNs4TTKZChOHFO+ME0B9femUVZsepFT5mhAioszRg= +github.com/onsi/ginkgo/v2 v2.17.2 h1:7eMhcy3GimbsA3hEnVKdw/PQM9XN9krpKVXsZdph0/g= +github.com/onsi/ginkgo/v2 v2.17.2/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc= +github.com/onsi/gomega v1.33.0 h1:snPCflnZrpMsy94p4lXVEkHo12lmPnc3vY5XBbreexE= +github.com/onsi/gomega v1.33.0/go.mod h1:+925n5YtiFsLzzafLUHzVMBpvvRAzrydIBiSIxjX3wY= +github.com/open-spaced-repetition/go-fsrs v1.2.1 h1:vY1hSQ3gvHtfnw8ahylcZyyqusKWDkWCd1+ca4lZoSc= +github.com/open-spaced-repetition/go-fsrs v1.2.1/go.mod h1:WpbNs4TTKZChOHFO+ME0B9femUVZsepFT5mhAioszRg= github.com/otiai10/gosseract/v2 v2.4.1 h1:G8AyBpXEeSlcq8TI85LH/pM5SXk8Djy2GEXisgyblRw= github.com/otiai10/gosseract/v2 v2.4.1/go.mod h1:1gNWP4Hgr2o7yqWfs6r5bZxAatjOIdqWxJLWsTsembk= github.com/otiai10/mint v1.6.3 h1:87qsV/aw1F5as1eH1zS/yqHY85ANKVMgkDrf9rcxbQs= @@ -305,8 +305,8 @@ github.com/qiniu/go-sdk/v7 v7.20.0/go.mod h1:ZnEP1rOOi7weF+yzM2qZMHI0z1ht+KjVuNA github.com/qiniu/x v1.10.5/go.mod h1:03Ni9tj+N2h2aKnAz+6N0Xfl8FwMEDRC2PAlxekASDs= github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= -github.com/quic-go/quic-go v0.42.0 h1:uSfdap0eveIl8KXnipv9K7nlwZ5IqLlYOpJ58u5utpM= -github.com/quic-go/quic-go v0.42.0/go.mod h1:132kz4kL3F9vxhW3CtQJLDVwcFe5wdWeJXXijhsO57M= +github.com/quic-go/quic-go v0.43.0 h1:sjtsTKWX0dsHpuMJvLxGqoQdtgJnbAPWY+W+5vjYW/g= +github.com/quic-go/quic-go v0.43.0/go.mod h1:132kz4kL3F9vxhW3CtQJLDVwcFe5wdWeJXXijhsO57M= github.com/radovskyb/watcher v1.0.7 h1:AYePLih6dpmS32vlHfhCeli8127LzkIgwJGcwwe8tUE= github.com/radovskyb/watcher v1.0.7/go.mod h1:78okwvY5wPdzcb1UYnip1pvrZNIVEIh/Cm+ZuvsUYIg= github.com/refraction-networking/utls v1.6.4 h1:aeynTroaYn7y+mFtqv8D0bQ4bw0y9nJHneGxJ7lvRDM= @@ -353,12 +353,12 @@ github.com/siyuan-note/eventbus v0.0.0-20240318125243-801c98e8f025 h1:crQmKw5vZz github.com/siyuan-note/eventbus v0.0.0-20240318125243-801c98e8f025/go.mod h1:1/nGgthl89FPA7GzAcEWKl6zRRnfgyTjzLZj9bW7kuw= github.com/siyuan-note/filelock v0.0.0-20240419132904-2fbfe64f1939 h1:RQApoGXu6E5KX2Deb05c27bfJiA/Yzc34BKx+hRnCtM= github.com/siyuan-note/filelock v0.0.0-20240419132904-2fbfe64f1939/go.mod h1:0MqIa22SVvzvdI696uQAxvNmfOpD5gBh/i/wK4BECQo= -github.com/siyuan-note/httpclient v0.0.0-20240419132535-231841049644 h1:GS9sBd5AUHZVErSSXij6N3OkIP3gUjAunY+wFQQ3wAA= -github.com/siyuan-note/httpclient v0.0.0-20240419132535-231841049644/go.mod h1:ZGC3c7zrdGI7YHeZaeyJl82CIpqo0oLMZ8mXuoh9hxQ= +github.com/siyuan-note/httpclient v0.0.0-20240429013218-3caa1f89f9ed h1:QBPxwSsWnAxxnEKYn3ycvFxj61vfpD8q4zTtLH9iN9w= +github.com/siyuan-note/httpclient v0.0.0-20240429013218-3caa1f89f9ed/go.mod h1:qQsrqhPrCPJwjpHQetGcLCBh7bBCpoJ7P1uXoXJiClY= github.com/siyuan-note/logging v0.0.0-20231208035918-61f884c854f0 h1:+XjUr9UMXsczdO2bGA72p/k9wa2ShPb8ybi7CDBJ7HQ= github.com/siyuan-note/logging v0.0.0-20231208035918-61f884c854f0/go.mod h1:6mRFtAAvYPn3cDzqvyv+t8BVPGqpONDMMb5ywOhY1D4= -github.com/siyuan-note/riff v0.0.0-20240419132144-b3e8b2b89d0d h1:DraqHtxZAPP7UaQvs5+8/IHGusqrNAymr4RfGLhWRFc= -github.com/siyuan-note/riff v0.0.0-20240419132144-b3e8b2b89d0d/go.mod h1:aHCAvciLh50MaR1MmmGzKR6Zc9EhYUTjGBCfWowvYBs= +github.com/siyuan-note/riff v0.0.0-20240502024535-718add51db67 h1:YuBxDIIVBOtvQc/ZLi4SOCY0J+QMRnnco4b1Jh9+SL4= +github.com/siyuan-note/riff v0.0.0-20240502024535-718add51db67/go.mod h1:n+yT/5zCIDqRx5lEO8Vxq3kuwzjmXndXFtfJoID7jJY= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.7 h1:I6tZjLXD2Q1kjvNbIzB1wvQBsXmKXiVrhpRE8ZjP5jY=