@dooc-dev/dooc 0.0.28 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.global.js +1 -1
- package/dist/edit.global.js +220 -221
- package/dist/engine/compiler/check.js +5 -3
- package/dist/engine/compiler/compile.d.ts +5 -0
- package/dist/engine/compiler/compile.js +44 -23
- package/dist/engine/compiler/dialect.js +1 -1
- package/dist/engine/compiler/document-diff.d.ts +53 -0
- package/dist/engine/compiler/document-diff.js +92 -0
- package/dist/engine/compiler/export.js +11 -3
- package/dist/engine/compiler/files.d.ts +1 -0
- package/dist/engine/compiler/files.js +75 -14
- package/dist/engine/compiler/from-mdast.js +12 -1
- package/dist/engine/compiler/icons.d.ts +7 -7
- package/dist/engine/compiler/icons.js +35 -37
- package/dist/engine/compiler/manifest.d.ts +1 -0
- package/dist/engine/compiler/manifest.js +25 -0
- package/dist/engine/compiler/ops.d.ts +2 -2
- package/dist/engine/compiler/ops.js +55 -112
- package/dist/engine/compiler/resource-index.js +4 -4
- package/dist/engine/compiler/root-page.d.ts +13 -0
- package/dist/engine/compiler/root-page.js +96 -0
- package/dist/engine/compiler/sidebar-removal.d.ts +63 -0
- package/dist/engine/compiler/sidebar-removal.js +317 -0
- package/dist/engine/compiler/subformats.d.ts +3 -0
- package/dist/engine/compiler/subformats.js +126 -32
- package/dist/engine/core/blocks.d.ts +5 -0
- package/dist/engine/core/content-metadata.d.ts +9 -4
- package/dist/engine/core/content-metadata.js +100 -16
- package/dist/engine/core/file-embed.d.ts +2 -1
- package/dist/engine/core/file-embed.js +4 -0
- package/dist/engine/core/files.d.ts +1 -0
- package/dist/engine/core/files.js +6 -1
- package/dist/engine/core/format-collections.js +2 -2
- package/dist/engine/core/formats.d.ts +1 -1
- package/dist/engine/core/formats.js +1 -1
- package/dist/engine/core/html.d.ts +1 -0
- package/dist/engine/core/html.js +8 -4
- package/dist/engine/core/icons.d.ts +7 -0
- package/dist/engine/core/icons.js +38 -0
- package/dist/engine/core/subformats.d.ts +2 -1
- package/dist/engine/core/subformats.js +6 -1
- package/dist/engine/core/toc-library.d.ts +5 -0
- package/dist/engine/core/toc-library.js +27 -0
- package/dist/frontend/document-application.d.ts +5 -2
- package/dist/frontend/document-application.js +378 -172
- package/dist/frontend/edit-dialog.d.ts +1 -0
- package/dist/frontend/edit-dialog.js +12 -8
- package/dist/frontend/file-references.js +1 -1
- package/dist/frontend/locales/eng.json +62 -1
- package/dist/frontend/locales/jpn.json +62 -1
- package/dist/frontend/locales/zho.json +62 -1
- package/dist/frontend/page-jump.js +17 -10
- package/dist/frontend/resize.js +38 -12
- package/dist/frontend/resource-library.js +1 -0
- package/dist/frontend/search.js +2 -0
- package/dist/frontend/theme-picker.d.ts +2 -2
- package/dist/frontend/theme-picker.js +2 -2
- package/dist/manifest.global.js +193 -192
- package/dist/mcp-relay.mjs +8 -4
- package/dist/plugins.global.js +49 -49
- package/dist/server/cli.js +12 -0
- package/dist/server/document-diff-cli.d.ts +1 -0
- package/dist/server/document-diff-cli.js +193 -0
- package/dist/server/document-diff-report.d.ts +3 -0
- package/dist/server/document-diff-report.js +124 -0
- package/dist/server/document-diff-sources.d.ts +40 -0
- package/dist/server/document-diff-sources.js +128 -0
- package/dist/server/document-versions.d.ts +3 -1
- package/dist/server/document-versions.js +19 -70
- package/dist/server/git-diff.d.ts +1 -0
- package/dist/server/git-diff.js +22 -2
- package/dist/server/git-document-snapshot.d.ts +2 -0
- package/dist/server/git-document-snapshot.js +63 -0
- package/dist/server/operation-log.js +2 -0
- package/dist/server/serve.d.ts +2 -2
- package/dist/server/serve.js +4 -9
- package/dist/server/workspace-server.js +6 -10
- package/dist/subformats.global.js +478 -74
- package/dist/ui.global.js +435 -80
- package/dist/workspace/file-operation.d.ts +10 -0
- package/dist/workspace/file-operation.js +47 -0
- package/dist/workspace/mcp-tools.js +8 -4
- package/dist/workspace/site-icon.js +30 -23
- package/dist/workspace/textfile.js +8 -8
- package/dist/workspace-worker.global.js +238 -196
- package/package.json +2 -2
|
@@ -2,6 +2,7 @@ export declare const showDialog: (title: string, content: string | HTMLElement,
|
|
|
2
2
|
value: string;
|
|
3
3
|
label: string;
|
|
4
4
|
danger?: boolean;
|
|
5
|
+
valid?: () => boolean;
|
|
5
6
|
}[]) => Promise<string>;
|
|
6
7
|
export declare const confirmDialog: (message: string, action: string, danger?: boolean) => Promise<boolean>;
|
|
7
8
|
export declare const showNotice: (message: string) => Promise<string>;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { t } from "./i18n.js";
|
|
2
2
|
export const showDialog = (title, content, actions) => new Promise((resolve) => {
|
|
3
|
-
const previous = document.activeElement;
|
|
4
3
|
const dialog = document.createElement("dialog");
|
|
4
|
+
const finish = () => {
|
|
5
|
+
dialog.removeEventListener("close", finish);
|
|
6
|
+
dialog.remove();
|
|
7
|
+
resolve(dialog.returnValue);
|
|
8
|
+
};
|
|
5
9
|
dialog.className = "app-dialog";
|
|
6
10
|
dialog.setAttribute("aria-label", title);
|
|
7
11
|
const heading = document.createElement("h2");
|
|
@@ -17,16 +21,16 @@ export const showDialog = (title, content, actions) => new Promise((resolve) =>
|
|
|
17
21
|
button.textContent = action.label;
|
|
18
22
|
button.autofocus = action.value === "";
|
|
19
23
|
button.classList.toggle("danger", !!action.danger);
|
|
20
|
-
button.addEventListener("click", () =>
|
|
24
|
+
button.addEventListener("click", () => {
|
|
25
|
+
if (action.valid && !action.valid())
|
|
26
|
+
return;
|
|
27
|
+
dialog.close(action.value);
|
|
28
|
+
finish();
|
|
29
|
+
});
|
|
21
30
|
footer.append(button);
|
|
22
31
|
}
|
|
23
32
|
dialog.append(heading, body, footer);
|
|
24
|
-
dialog.addEventListener("close",
|
|
25
|
-
dialog.remove();
|
|
26
|
-
if (previous instanceof HTMLElement && previous.isConnected)
|
|
27
|
-
previous.focus();
|
|
28
|
-
resolve(dialog.returnValue);
|
|
29
|
-
}, { once: true });
|
|
33
|
+
dialog.addEventListener("close", finish);
|
|
30
34
|
document.body.append(dialog);
|
|
31
35
|
dialog.showModal();
|
|
32
36
|
});
|
|
@@ -22,7 +22,7 @@ export const fileReferences = (body, settings, origin) => {
|
|
|
22
22
|
if (node.type === "image" && images.has(node)) {
|
|
23
23
|
try {
|
|
24
24
|
const { file, kind } = parseFileEmbed(node.url, settings);
|
|
25
|
-
if (kind === "external")
|
|
25
|
+
if (kind === "external" || kind === "toc")
|
|
26
26
|
return;
|
|
27
27
|
references.push({
|
|
28
28
|
line: node.position?.start.line ?? 1,
|
|
@@ -147,6 +147,16 @@
|
|
|
147
147
|
"Use external changes": "Use external changes",
|
|
148
148
|
"File was deleted": "File was deleted",
|
|
149
149
|
"Cancel": "Cancel",
|
|
150
|
+
"Back": "Back",
|
|
151
|
+
"Confirm deletion": "Confirm deletion",
|
|
152
|
+
"This workspace does not support deletion review.": "Update the workspace server to review this deletion.",
|
|
153
|
+
"File deletions": "File deletions",
|
|
154
|
+
"Uncommitted changes": "Uncommitted changes",
|
|
155
|
+
"Reference removals": "Reference removals",
|
|
156
|
+
"Affected referring pages": "Affected referring pages",
|
|
157
|
+
"{count}": "{count}",
|
|
158
|
+
"Could not check Git changes. Review the deletion again.": "Could not check Git changes. Review the deletion again.",
|
|
159
|
+
"The deletion summary changed. Review the deletion again.": "The deletion summary changed. Review the deletion again.",
|
|
150
160
|
"Search documents": "Search documents",
|
|
151
161
|
"No results": "No results",
|
|
152
162
|
"Searching…": "Searching…",
|
|
@@ -206,6 +216,29 @@
|
|
|
206
216
|
"File name": "File name",
|
|
207
217
|
"Renamed to {filename}": "Renamed to {filename}",
|
|
208
218
|
"Enter a file name ending in .md": "Enter a file name ending in .md",
|
|
219
|
+
"Add files": "Add files",
|
|
220
|
+
"Drop files here": "Drop files here",
|
|
221
|
+
"Choose where to place them": "Choose where to place them",
|
|
222
|
+
"Destination folder": "Destination folder",
|
|
223
|
+
"Default upload folder": "Default upload folder",
|
|
224
|
+
"Project root": "Project root",
|
|
225
|
+
"Use destination folder": "Use destination folder",
|
|
226
|
+
"Folder for {name}": "Folder for {name}",
|
|
227
|
+
"Use existing · {path}": "Use existing · {path}",
|
|
228
|
+
"Use existing path for {name}": "Use existing path for {name}",
|
|
229
|
+
"Choose an existing path": "Choose an existing path",
|
|
230
|
+
"Enter a relative folder path": "Enter a relative folder path",
|
|
231
|
+
"Choose files from this workspace": "Choose files from this workspace",
|
|
232
|
+
"Invalid file path": "Invalid file path",
|
|
233
|
+
"Choose a file inside the document’s manifest folder": "Choose a file inside the document’s manifest folder",
|
|
234
|
+
"Choose Markdown files to add pages": "Choose Markdown files to add pages",
|
|
235
|
+
"Choose an icon": "Choose an icon",
|
|
236
|
+
"SVG requires a viewBox or width and height": "SVG requires a viewBox or width and height",
|
|
237
|
+
"Choose one SVG file": "Choose one SVG file",
|
|
238
|
+
"Search SVG files": "Search SVG files",
|
|
239
|
+
"No matching SVG files": "No matching SVG files",
|
|
240
|
+
"Choose from device": "Choose from device",
|
|
241
|
+
"Invalid SVG · {path}": "Invalid SVG · {path}",
|
|
209
242
|
"Upload files": "Upload files",
|
|
210
243
|
"Uploading {count}/{total}": "Uploading {count}/{total}",
|
|
211
244
|
"Files uploaded": "Files uploaded",
|
|
@@ -234,6 +267,8 @@
|
|
|
234
267
|
"Format collections": "Format collections",
|
|
235
268
|
"Collection": "Collection",
|
|
236
269
|
"Grid": "Grid",
|
|
270
|
+
"Expand": "Expand",
|
|
271
|
+
"Resize message input": "Resize message input",
|
|
237
272
|
"Grid layout": "Grid layout",
|
|
238
273
|
"Drag or use arrow keys to resize the grid": "Drag or use arrow keys to resize the grid",
|
|
239
274
|
"Display": "Display",
|
|
@@ -671,5 +706,31 @@
|
|
|
671
706
|
"Model": "Model",
|
|
672
707
|
"API key missing": "API key missing",
|
|
673
708
|
"Model list unavailable. Using local choices.": "Model list unavailable. Using local choices.",
|
|
674
|
-
"Enter to select; Ctrl+Enter to configure": "Enter to select; Ctrl+Enter to configure"
|
|
709
|
+
"Enter to select; Ctrl+Enter to configure": "Enter to select; Ctrl+Enter to configure",
|
|
710
|
+
"Remove “{title}” from the sidebar?": "Remove “{title}” from the sidebar?",
|
|
711
|
+
"Include child pages": "Include child pages",
|
|
712
|
+
"Files to delete": "Files to delete",
|
|
713
|
+
"Unlink": "Unlink",
|
|
714
|
+
"Delete ({count})": "Delete ({count})",
|
|
715
|
+
"Remove": "Remove",
|
|
716
|
+
"Delete files": "Delete files",
|
|
717
|
+
"Choose accent color": "Choose accent color",
|
|
718
|
+
"Save your changes before removing this entry?": "Save your changes before removing this entry?",
|
|
719
|
+
"Save the changes in the other pane before removing this entry.": "Save the changes in the other pane before removing this entry.",
|
|
720
|
+
"Save the open file changes before removing this entry.": "Save the open file changes before removing this entry.",
|
|
721
|
+
"Changed externally. Save to review the differences.": "Changed externally. Save to review the differences.",
|
|
722
|
+
"Edit root page": "Edit root page",
|
|
723
|
+
"Root page content": "Root page content",
|
|
724
|
+
"Table of contents": "Table of contents",
|
|
725
|
+
"URL": "URL",
|
|
726
|
+
"Current collection": "Current collection",
|
|
727
|
+
"Markdown file": "Markdown file",
|
|
728
|
+
"Remove sidebar reference": "Remove sidebar reference",
|
|
729
|
+
"Delete source files": "Delete source files",
|
|
730
|
+
"Source files": "Source files",
|
|
731
|
+
"Select all": "Select all",
|
|
732
|
+
"All pages": "All pages",
|
|
733
|
+
"No child pages": "No child pages",
|
|
734
|
+
"Page or manifest file": "Page or manifest file",
|
|
735
|
+
"Include all descendants": "Include all descendants"
|
|
675
736
|
}
|
|
@@ -147,6 +147,16 @@
|
|
|
147
147
|
"Use external changes": "外部の変更を使う",
|
|
148
148
|
"File was deleted": "ファイルが削除されました",
|
|
149
149
|
"Cancel": "キャンセル",
|
|
150
|
+
"Back": "戻る",
|
|
151
|
+
"Confirm deletion": "削除の確認",
|
|
152
|
+
"This workspace does not support deletion review.": "削除内容を確認するには、ワークスペースのサーバーを更新してください。",
|
|
153
|
+
"File deletions": "ファイル削除",
|
|
154
|
+
"Uncommitted changes": "未コミット差分",
|
|
155
|
+
"Reference removals": "参照外し",
|
|
156
|
+
"Affected referring pages": "リンク切れの参照元",
|
|
157
|
+
"{count}": "{count} 件",
|
|
158
|
+
"Could not check Git changes. Review the deletion again.": "Git の差分を確認できませんでした。削除内容をもう一度確認してください。",
|
|
159
|
+
"The deletion summary changed. Review the deletion again.": "削除の対象または差分が変わりました。もう一度確認してください。",
|
|
150
160
|
"Search documents": "文書を検索",
|
|
151
161
|
"No results": "見つかりませんでした",
|
|
152
162
|
"Searching…": "検索中…",
|
|
@@ -206,6 +216,29 @@
|
|
|
206
216
|
"File name": "ファイル名",
|
|
207
217
|
"Renamed to {filename}": "{filename} に変更しました",
|
|
208
218
|
"Enter a file name ending in .md": ".md で終わるファイル名を入力してください",
|
|
219
|
+
"Add files": "ファイルを追加",
|
|
220
|
+
"Drop files here": "ここにファイルをドロップ",
|
|
221
|
+
"Choose where to place them": "ドロップ後に配置先を選択",
|
|
222
|
+
"Destination folder": "配置先フォルダー",
|
|
223
|
+
"Default upload folder": "既定の配置先",
|
|
224
|
+
"Project root": "プロジェクト直下",
|
|
225
|
+
"Use destination folder": "共通の配置先を使う",
|
|
226
|
+
"Folder for {name}": "{name} の配置先",
|
|
227
|
+
"Use existing · {path}": "既存の参照 · {path}",
|
|
228
|
+
"Use existing path for {name}": "{name} の参照先",
|
|
229
|
+
"Choose an existing path": "参照するパスを選択",
|
|
230
|
+
"Enter a relative folder path": "プロジェクトからの相対パスを入力してください",
|
|
231
|
+
"Choose files from this workspace": "このワークスペースのファイルを選んでください",
|
|
232
|
+
"Invalid file path": "ファイルパスが正しくありません",
|
|
233
|
+
"Choose a file inside the document’s manifest folder": "この文書のマニフェスト配下のファイルを選んでください",
|
|
234
|
+
"Choose Markdown files to add pages": "ページとして追加する Markdown ファイルを選んでください",
|
|
235
|
+
"Choose an icon": "アイコンを選択",
|
|
236
|
+
"SVG requires a viewBox or width and height": "SVG に viewBox または幅と高さを指定してください",
|
|
237
|
+
"Choose one SVG file": "SVG ファイルを1つ選んでください",
|
|
238
|
+
"Search SVG files": "SVG ファイルを検索",
|
|
239
|
+
"No matching SVG files": "該当する SVG ファイルはありません",
|
|
240
|
+
"Choose from device": "端末から選択",
|
|
241
|
+
"Invalid SVG · {path}": "無効な SVG · {path}",
|
|
209
242
|
"Upload files": "ファイルを追加",
|
|
210
243
|
"Uploading {count}/{total}": "追加中 {count}/{total}",
|
|
211
244
|
"Files uploaded": "追加済み",
|
|
@@ -234,6 +267,8 @@
|
|
|
234
267
|
"Format collections": "フォーマットの分類",
|
|
235
268
|
"Collection": "分類",
|
|
236
269
|
"Grid": "グリッド",
|
|
270
|
+
"Expand": "縦に展開",
|
|
271
|
+
"Resize message input": "入力欄の高さを変更",
|
|
237
272
|
"Grid layout": "グリッドの配置",
|
|
238
273
|
"Drag or use arrow keys to resize the grid": "ドラッグまたは矢印キーでグリッドを調整",
|
|
239
274
|
"Display": "表示設定",
|
|
@@ -671,5 +706,31 @@
|
|
|
671
706
|
"Model": "モデル",
|
|
672
707
|
"API key missing": "API キー未設定",
|
|
673
708
|
"Model list unavailable. Using local choices.": "モデル一覧を取得できません。標準の候補を表示しています。",
|
|
674
|
-
"Enter to select; Ctrl+Enter to configure": "Enter で選択、Ctrl+Enter で設定"
|
|
709
|
+
"Enter to select; Ctrl+Enter to configure": "Enter で選択、Ctrl+Enter で設定",
|
|
710
|
+
"Remove “{title}” from the sidebar?": "サイドバーから「{title}」を削除しますか?",
|
|
711
|
+
"Include child pages": "子ページも外す",
|
|
712
|
+
"Files to delete": "削除するファイル",
|
|
713
|
+
"Unlink": "参照を外す",
|
|
714
|
+
"Delete ({count})": "削除({count}件)",
|
|
715
|
+
"Remove": "削除",
|
|
716
|
+
"Delete files": "ファイルを削除",
|
|
717
|
+
"Choose accent color": "アクセントカラーを選ぶ",
|
|
718
|
+
"Save your changes before removing this entry?": "この項目を削除する前に編集内容を保存しますか?",
|
|
719
|
+
"Save the changes in the other pane before removing this entry.": "この項目を削除する前に、もう一方のペインの変更を保存してください。",
|
|
720
|
+
"Save the open file changes before removing this entry.": "この項目を削除する前に、開いているファイルの変更を保存してください。",
|
|
721
|
+
"Changed externally. Save to review the differences.": "外部で変更されました。保存を押すと差分を確認できます。",
|
|
722
|
+
"Edit root page": "ルートページを編集",
|
|
723
|
+
"Root page content": "ルートページの内容",
|
|
724
|
+
"Table of contents": "目次",
|
|
725
|
+
"URL": "URL",
|
|
726
|
+
"Current collection": "現在のコレクション",
|
|
727
|
+
"Markdown file": "Markdown ファイル",
|
|
728
|
+
"Remove sidebar reference": "サイドバーの参照を外す",
|
|
729
|
+
"Delete source files": "元ファイルも削除",
|
|
730
|
+
"Source files": "元ファイル",
|
|
731
|
+
"Select all": "すべて選択",
|
|
732
|
+
"All pages": "すべてのページ",
|
|
733
|
+
"No child pages": "子ページはありません",
|
|
734
|
+
"Page or manifest file": "対象ページまたはマニフェストのパス",
|
|
735
|
+
"Include all descendants": "すべての下位階層を表示"
|
|
675
736
|
}
|
|
@@ -147,6 +147,16 @@
|
|
|
147
147
|
"Use external changes": "使用外部更改",
|
|
148
148
|
"File was deleted": "文件已删除",
|
|
149
149
|
"Cancel": "取消",
|
|
150
|
+
"Back": "返回",
|
|
151
|
+
"Confirm deletion": "确认删除",
|
|
152
|
+
"This workspace does not support deletion review.": "请更新工作区服务器以确认删除内容。",
|
|
153
|
+
"File deletions": "删除文件",
|
|
154
|
+
"Uncommitted changes": "未提交更改",
|
|
155
|
+
"Reference removals": "移除引用",
|
|
156
|
+
"Affected referring pages": "受影响的引用页面",
|
|
157
|
+
"{count}": "{count} 项",
|
|
158
|
+
"Could not check Git changes. Review the deletion again.": "无法检查 Git 差异,请重新确认删除内容。",
|
|
159
|
+
"The deletion summary changed. Review the deletion again.": "删除内容已更改,请重新确认。",
|
|
150
160
|
"Search documents": "搜索文档",
|
|
151
161
|
"No results": "无搜索结果",
|
|
152
162
|
"Searching…": "搜索中…",
|
|
@@ -206,6 +216,29 @@
|
|
|
206
216
|
"File name": "文件名",
|
|
207
217
|
"Renamed to {filename}": "已重命名为 {filename}",
|
|
208
218
|
"Enter a file name ending in .md": "请输入以 .md 结尾的文件名",
|
|
219
|
+
"Add files": "添加文件",
|
|
220
|
+
"Drop files here": "将文件拖放到此处",
|
|
221
|
+
"Choose where to place them": "放下后选择存放位置",
|
|
222
|
+
"Destination folder": "目标文件夹",
|
|
223
|
+
"Default upload folder": "默认上传文件夹",
|
|
224
|
+
"Project root": "项目根目录",
|
|
225
|
+
"Use destination folder": "使用目标文件夹",
|
|
226
|
+
"Folder for {name}": "{name} 的文件夹",
|
|
227
|
+
"Use existing · {path}": "使用现有文件 · {path}",
|
|
228
|
+
"Use existing path for {name}": "{name} 的现有路径",
|
|
229
|
+
"Choose an existing path": "选择现有路径",
|
|
230
|
+
"Enter a relative folder path": "请输入相对文件夹路径",
|
|
231
|
+
"Choose files from this workspace": "请选择此工作区中的文件",
|
|
232
|
+
"Invalid file path": "文件路径无效",
|
|
233
|
+
"Choose a file inside the document’s manifest folder": "请选择文档清单目录内的文件",
|
|
234
|
+
"Choose Markdown files to add pages": "请选择 Markdown 文件以添加页面",
|
|
235
|
+
"Choose an icon": "选择图标",
|
|
236
|
+
"SVG requires a viewBox or width and height": "SVG 需要 viewBox 或宽度和高度",
|
|
237
|
+
"Choose one SVG file": "请选择一个 SVG 文件",
|
|
238
|
+
"Search SVG files": "搜索 SVG 文件",
|
|
239
|
+
"No matching SVG files": "没有匹配的 SVG 文件",
|
|
240
|
+
"Choose from device": "从设备中选择",
|
|
241
|
+
"Invalid SVG · {path}": "无效的 SVG · {path}",
|
|
209
242
|
"Upload files": "上传文件",
|
|
210
243
|
"Uploading {count}/{total}": "上传中 {count}/{total}",
|
|
211
244
|
"Files uploaded": "文件已上传",
|
|
@@ -234,6 +267,8 @@
|
|
|
234
267
|
"Format collections": "格式分类",
|
|
235
268
|
"Collection": "分类",
|
|
236
269
|
"Grid": "网格",
|
|
270
|
+
"Expand": "纵向展开",
|
|
271
|
+
"Resize message input": "调整输入框高度",
|
|
237
272
|
"Grid layout": "网格布局",
|
|
238
273
|
"Drag or use arrow keys to resize the grid": "拖动或使用方向键调整网格",
|
|
239
274
|
"Display": "显示设置",
|
|
@@ -671,5 +706,31 @@
|
|
|
671
706
|
"Model": "模型",
|
|
672
707
|
"API key missing": "未设置 API 密钥",
|
|
673
708
|
"Model list unavailable. Using local choices.": "无法获取模型列表。正在使用本地选项。",
|
|
674
|
-
"Enter to select; Ctrl+Enter to configure": "Enter 选择;Ctrl+Enter 设置"
|
|
709
|
+
"Enter to select; Ctrl+Enter to configure": "Enter 选择;Ctrl+Enter 设置",
|
|
710
|
+
"Remove “{title}” from the sidebar?": "从侧边栏移除“{title}”?",
|
|
711
|
+
"Include child pages": "包含子页面",
|
|
712
|
+
"Files to delete": "要删除的文件",
|
|
713
|
+
"Unlink": "移除引用",
|
|
714
|
+
"Delete ({count})": "删除({count} 项)",
|
|
715
|
+
"Remove": "移除",
|
|
716
|
+
"Delete files": "删除文件",
|
|
717
|
+
"Choose accent color": "选择强调色",
|
|
718
|
+
"Save your changes before removing this entry?": "移除此项目之前保存更改?",
|
|
719
|
+
"Save the changes in the other pane before removing this entry.": "移除此项目之前,请保存另一窗格的更改。",
|
|
720
|
+
"Save the open file changes before removing this entry.": "移除此项目之前,请保存已打开文件的更改。",
|
|
721
|
+
"Changed externally. Save to review the differences.": "文件已在外部更改。保存时可查看差异。",
|
|
722
|
+
"Edit root page": "编辑根页面",
|
|
723
|
+
"Root page content": "根页面内容",
|
|
724
|
+
"Table of contents": "目录",
|
|
725
|
+
"URL": "URL",
|
|
726
|
+
"Current collection": "当前集合",
|
|
727
|
+
"Markdown file": "Markdown 文件",
|
|
728
|
+
"Remove sidebar reference": "移除侧栏引用",
|
|
729
|
+
"Delete source files": "同时删除源文件",
|
|
730
|
+
"Source files": "源文件",
|
|
731
|
+
"Select all": "全选",
|
|
732
|
+
"All pages": "所有页面",
|
|
733
|
+
"No child pages": "暂无子页面",
|
|
734
|
+
"Page or manifest file": "页面或清单文件路径",
|
|
735
|
+
"Include all descendants": "显示所有后代页面"
|
|
675
736
|
}
|
|
@@ -10,6 +10,7 @@ export const mountPageJump = (select) => {
|
|
|
10
10
|
}
|
|
11
11
|
catch { }
|
|
12
12
|
let held = null;
|
|
13
|
+
let clicked = null;
|
|
13
14
|
let jumped = false;
|
|
14
15
|
const reset = () => {
|
|
15
16
|
held = null;
|
|
@@ -27,6 +28,14 @@ export const mountPageJump = (select) => {
|
|
|
27
28
|
return document.querySelector("main");
|
|
28
29
|
return target.closest(editor ? ".preview-pane.active" : "main");
|
|
29
30
|
};
|
|
31
|
+
const focusPane = (pane) => {
|
|
32
|
+
if (editor && !pane.closest("#preview-panes.split"))
|
|
33
|
+
return;
|
|
34
|
+
if (!pane.hasAttribute("tabindex"))
|
|
35
|
+
pane.tabIndex = -1;
|
|
36
|
+
pane.focus({ preventScroll: true });
|
|
37
|
+
};
|
|
38
|
+
const keySurface = (target) => surface(editor && target === document.body && clicked?.isConnected ? clicked : target);
|
|
30
39
|
if (toggle) {
|
|
31
40
|
toggle.checked = enabled;
|
|
32
41
|
toggle.addEventListener("change", () => {
|
|
@@ -40,15 +49,15 @@ export const mountPageJump = (select) => {
|
|
|
40
49
|
}
|
|
41
50
|
document.addEventListener("pointerdown", (event) => {
|
|
42
51
|
const pane = surface(event.target);
|
|
52
|
+
clicked = pane;
|
|
43
53
|
if (pane !== held)
|
|
44
54
|
reset();
|
|
45
|
-
if (pane)
|
|
46
|
-
|
|
47
|
-
pane.tabIndex = -1;
|
|
48
|
-
pane.focus({ preventScroll: true });
|
|
49
|
-
}
|
|
55
|
+
if (pane)
|
|
56
|
+
focusPane(pane);
|
|
50
57
|
});
|
|
51
58
|
document.addEventListener("focusin", (event) => {
|
|
59
|
+
if (!surface(event.target))
|
|
60
|
+
clicked = null;
|
|
52
61
|
if (held && surface(event.target) !== held)
|
|
53
62
|
reset();
|
|
54
63
|
});
|
|
@@ -67,7 +76,7 @@ export const mountPageJump = (select) => {
|
|
|
67
76
|
reset();
|
|
68
77
|
return;
|
|
69
78
|
}
|
|
70
|
-
const pane =
|
|
79
|
+
const pane = keySurface(event.target);
|
|
71
80
|
if (!pane) {
|
|
72
81
|
reset();
|
|
73
82
|
return;
|
|
@@ -76,6 +85,7 @@ export const mountPageJump = (select) => {
|
|
|
76
85
|
if (!held && !event.repeat) {
|
|
77
86
|
held = pane;
|
|
78
87
|
jumped = false;
|
|
88
|
+
focusPane(pane);
|
|
79
89
|
}
|
|
80
90
|
if (held)
|
|
81
91
|
event.preventDefault();
|
|
@@ -109,9 +119,6 @@ export const mountPageJump = (select) => {
|
|
|
109
119
|
}
|
|
110
120
|
if (!destination)
|
|
111
121
|
return;
|
|
112
|
-
if (!pane.hasAttribute("tabindex"))
|
|
113
|
-
pane.tabIndex = -1;
|
|
114
|
-
pane.focus({ preventScroll: true });
|
|
115
122
|
select(document.getElementById("nav-groups"), destination.href);
|
|
116
123
|
destination.click();
|
|
117
124
|
});
|
|
@@ -119,7 +126,7 @@ export const mountPageJump = (select) => {
|
|
|
119
126
|
if (event.code !== "Space" && event.key !== " ")
|
|
120
127
|
return;
|
|
121
128
|
const pane = held;
|
|
122
|
-
const scroll = !jumped && pane &&
|
|
129
|
+
const scroll = !jumped && pane && keySurface(event.target) === pane;
|
|
123
130
|
reset();
|
|
124
131
|
if (!pane)
|
|
125
132
|
return;
|
package/dist/frontend/resize.js
CHANGED
|
@@ -65,36 +65,57 @@ export const mountPanelResize = () => {
|
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
let drag;
|
|
68
|
+
const stop = (event) => {
|
|
69
|
+
if (!drag || (event && drag.id !== event.pointerId))
|
|
70
|
+
return;
|
|
71
|
+
const { id } = drag;
|
|
72
|
+
drag = undefined;
|
|
73
|
+
if (handle.hasPointerCapture(id))
|
|
74
|
+
handle.releasePointerCapture(id);
|
|
75
|
+
handle.classList.remove("drag");
|
|
76
|
+
document.body.classList.remove("resizing");
|
|
77
|
+
persist();
|
|
78
|
+
if (document.activeElement === handle)
|
|
79
|
+
handle.blur();
|
|
80
|
+
document.dispatchEvent(new Event("docs:resize-end"));
|
|
81
|
+
};
|
|
68
82
|
handle.addEventListener("pointerdown", (event) => {
|
|
69
|
-
if (event.button !== 0 ||
|
|
83
|
+
if (event.button !== 0 ||
|
|
84
|
+
!event.isPrimary ||
|
|
85
|
+
document.body.classList.contains("resizing"))
|
|
70
86
|
return;
|
|
71
87
|
event.preventDefault();
|
|
72
|
-
|
|
88
|
+
try {
|
|
89
|
+
handle.setPointerCapture(event.pointerId);
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
73
94
|
drag = {
|
|
74
95
|
id: event.pointerId,
|
|
75
96
|
x: event.clientX,
|
|
76
97
|
width: element.getBoundingClientRect().width,
|
|
77
98
|
};
|
|
78
|
-
handle.setPointerCapture(event.pointerId);
|
|
79
99
|
handle.classList.add("drag");
|
|
80
100
|
document.body.classList.add("resizing");
|
|
101
|
+
handle.focus({ preventScroll: true });
|
|
81
102
|
});
|
|
82
103
|
handle.addEventListener("pointermove", (event) => {
|
|
83
104
|
if (drag?.id !== event.pointerId)
|
|
84
105
|
return;
|
|
106
|
+
if (event.pointerType === "mouse" && !(event.buttons & 1))
|
|
107
|
+
return stop(event);
|
|
85
108
|
apply(drag.width + options.direction * (event.clientX - drag.x));
|
|
86
109
|
});
|
|
87
|
-
|
|
88
|
-
if (drag?.id !== event.pointerId)
|
|
89
|
-
return;
|
|
90
|
-
drag = undefined;
|
|
91
|
-
handle.classList.remove("drag");
|
|
92
|
-
document.body.classList.remove("resizing");
|
|
93
|
-
persist();
|
|
94
|
-
};
|
|
95
|
-
handle.addEventListener("pointerup", stop);
|
|
110
|
+
window.addEventListener("pointerup", stop, true);
|
|
96
111
|
handle.addEventListener("pointercancel", stop);
|
|
97
112
|
handle.addEventListener("lostpointercapture", stop);
|
|
113
|
+
window.addEventListener("blur", () => stop());
|
|
114
|
+
handle.addEventListener("blur", () => stop());
|
|
115
|
+
document.addEventListener("visibilitychange", () => {
|
|
116
|
+
if (document.hidden)
|
|
117
|
+
stop();
|
|
118
|
+
});
|
|
98
119
|
handle.addEventListener("dblclick", () => {
|
|
99
120
|
preferred = undefined;
|
|
100
121
|
try {
|
|
@@ -106,6 +127,11 @@ export const mountPanelResize = () => {
|
|
|
106
127
|
apply(requested());
|
|
107
128
|
});
|
|
108
129
|
handle.addEventListener("keydown", (event) => {
|
|
130
|
+
if (event.key === "Escape" && drag) {
|
|
131
|
+
event.preventDefault();
|
|
132
|
+
stop();
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
109
135
|
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight")
|
|
110
136
|
return;
|
|
111
137
|
event.preventDefault();
|
|
@@ -11,6 +11,7 @@ export const resourceTabs = (view, libraries = REFERENCE_LIBRARIES) => view ===
|
|
|
11
11
|
["urls", "URLs"],
|
|
12
12
|
["url-previews", "URL previews"],
|
|
13
13
|
["skills", "Skills"],
|
|
14
|
+
["toc", "Table of contents"],
|
|
14
15
|
]
|
|
15
16
|
.filter(([key]) => libraries.includes(key))
|
|
16
17
|
.map(([key, label]) => `<a href="/_library/${key}"${view === key ? ' aria-current="page"' : ""}>${libraryIcon(key) ?? ""}<span data-i18n="${label}">${label}</span></a>`)
|
package/dist/frontend/search.js
CHANGED
|
@@ -19,6 +19,8 @@ export const searchIndex = (site, files = []) => {
|
|
|
19
19
|
switch (block.type) {
|
|
20
20
|
case "themeVariants":
|
|
21
21
|
return text(block.default);
|
|
22
|
+
case "pageContents":
|
|
23
|
+
return `${block.title ?? ""} ${block.file}`;
|
|
22
24
|
case "external":
|
|
23
25
|
return `${block.alt ?? ""} ${block.url}`;
|
|
24
26
|
case "h":
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const DARK_C = "\n color-scheme: dark;\n --c-bg0:#101316; --c-bg1:#16191d; --c-surface:#1b1f24; --c-raised:#22272d;\n --c-line:#2a3037; --c-line-soft:#22272c;\n --c-fg:#f5f6f7; --c-fg-muted:#b4bac0; --c-fg-faint:#8a939b; --fw-body:400;\n --c-accent
|
|
2
|
-
export declare const LIGHT_C = "\n color-scheme: light;\n --c-bg0:#ffffff; --c-bg1:#f5f7f9; --c-surface:#fbfcfd; --c-raised:#e9edf2;\n --c-line:#d5dae0; --c-line-soft:#e4e8ec;\n --c-fg:#1a1e23; --c-fg-muted:#5a636c; --c-fg-faint:#687079; --fw-body:300;\n --c-accent
|
|
1
|
+
export declare const DARK_C = "\n color-scheme: dark;\n --c-bg0:#101316; --c-bg1:#16191d; --c-surface:#1b1f24; --c-raised:#22272d;\n --c-line:#2a3037; --c-line-soft:#22272c;\n --c-fg:#f5f6f7; --c-fg-muted:#b4bac0; --c-fg-faint:#8a939b; --fw-body:400;\n --c-accent:var(--project-accent,#e65100); --c-ok:#4f9e6a; --c-danger:#c65b52; --c-warn:#c99a3a; --c-info:#6b8fbf;\n --c-shadow:rgba(0,0,0,.4);\n --doc-fg-4:#525a66; --doc-accent-2:#4a8bff; --doc-accent-fg:#ffffff;\n --doc-ok-2:#56d364; --doc-warn-2:#ffc14d; --doc-danger-2:#ff7a7a; --doc-info-2:#79b0ff;";
|
|
2
|
+
export declare const LIGHT_C = "\n color-scheme: light;\n --c-bg0:#ffffff; --c-bg1:#f5f7f9; --c-surface:#fbfcfd; --c-raised:#e9edf2;\n --c-line:#d5dae0; --c-line-soft:#e4e8ec;\n --c-fg:#1a1e23; --c-fg-muted:#5a636c; --c-fg-faint:#687079; --fw-body:300;\n --c-accent:var(--project-accent,#c24800); --c-ok:#2f7d4f; --c-danger:#b23c31; --c-warn:#8a6516; --c-info:#3a6ea5;\n --c-shadow:rgba(15,23,32,.14);\n --doc-fg-4:#9099a8; --doc-accent-2:#0277bd; --doc-accent-fg:#ffffff;\n --doc-ok-2:#2ea043; --doc-warn-2:#f59f00; --doc-danger-2:#f04848; --doc-info-2:#4a8bff;";
|
|
3
3
|
/** Run in the head before any themed content can be painted. */
|
|
4
4
|
export declare const initializeThemes: (themes?: string[]) => void;
|
|
5
5
|
/** Self-contained because published readers embed this function directly. */
|
|
@@ -3,7 +3,7 @@ export const DARK_C = `
|
|
|
3
3
|
--c-bg0:#101316; --c-bg1:#16191d; --c-surface:#1b1f24; --c-raised:#22272d;
|
|
4
4
|
--c-line:#2a3037; --c-line-soft:#22272c;
|
|
5
5
|
--c-fg:#f5f6f7; --c-fg-muted:#b4bac0; --c-fg-faint:#8a939b; --fw-body:400;
|
|
6
|
-
--c-accent
|
|
6
|
+
--c-accent:var(--project-accent,#e65100); --c-ok:#4f9e6a; --c-danger:#c65b52; --c-warn:#c99a3a; --c-info:#6b8fbf;
|
|
7
7
|
--c-shadow:rgba(0,0,0,.4);
|
|
8
8
|
--doc-fg-4:#525a66; --doc-accent-2:#4a8bff; --doc-accent-fg:#ffffff;
|
|
9
9
|
--doc-ok-2:#56d364; --doc-warn-2:#ffc14d; --doc-danger-2:#ff7a7a; --doc-info-2:#79b0ff;`;
|
|
@@ -12,7 +12,7 @@ export const LIGHT_C = `
|
|
|
12
12
|
--c-bg0:#ffffff; --c-bg1:#f5f7f9; --c-surface:#fbfcfd; --c-raised:#e9edf2;
|
|
13
13
|
--c-line:#d5dae0; --c-line-soft:#e4e8ec;
|
|
14
14
|
--c-fg:#1a1e23; --c-fg-muted:#5a636c; --c-fg-faint:#687079; --fw-body:300;
|
|
15
|
-
--c-accent
|
|
15
|
+
--c-accent:var(--project-accent,#c24800); --c-ok:#2f7d4f; --c-danger:#b23c31; --c-warn:#8a6516; --c-info:#3a6ea5;
|
|
16
16
|
--c-shadow:rgba(15,23,32,.14);
|
|
17
17
|
--doc-fg-4:#9099a8; --doc-accent-2:#0277bd; --doc-accent-fg:#ffffff;
|
|
18
18
|
--doc-ok-2:#2ea043; --doc-warn-2:#f59f00; --doc-danger-2:#f04848; --doc-info-2:#4a8bff;`;
|