@dooc-dev/dooc 0.0.22 → 0.0.23
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 +269 -263
- package/dist/engine/compiler/check.js +17 -0
- package/dist/engine/compiler/export.js +18 -1
- package/dist/engine/compiler/files.js +13 -2
- package/dist/engine/compiler/manifest.js +4 -0
- package/dist/engine/compiler/skills.d.ts +10 -0
- package/dist/engine/compiler/skills.js +95 -0
- package/dist/engine/core/content-metadata.d.ts +7 -1
- package/dist/engine/core/content-metadata.js +52 -18
- package/dist/engine/core/files.d.ts +1 -0
- package/dist/engine/core/files.js +3 -0
- package/dist/frontend/document-application.d.ts +11 -2
- package/dist/frontend/document-application.js +356 -130
- package/dist/frontend/language-picker.js +1 -0
- package/dist/frontend/locales/eng.json +17 -1
- package/dist/frontend/locales/jpn.json +17 -1
- package/dist/frontend/locales/zho.json +17 -1
- package/dist/frontend/mcp-operations.js +57 -1
- package/dist/frontend/nav-focus.d.ts +1 -1
- package/dist/frontend/nav-focus.js +25 -2
- package/dist/frontend/nav-update.js +12 -0
- package/dist/frontend/page-jump.d.ts +3 -0
- package/dist/frontend/page-jump.js +130 -0
- package/dist/frontend/resource-download.d.ts +1 -1
- package/dist/frontend/resource-download.js +118 -28
- package/dist/frontend/resource-library.js +16 -7
- package/dist/frontend/search.js +18 -5
- package/dist/frontend/theme-picker.js +11 -0
- package/dist/manifest.global.js +349 -0
- package/dist/mcp-relay.mjs +71 -1
- package/dist/plugins.global.js +4 -4
- package/dist/server/assets.d.ts +1 -0
- package/dist/server/assets.js +4 -1
- package/dist/server/build-media.d.ts +6 -0
- package/dist/server/build-media.js +136 -0
- package/dist/server/build-output.d.ts +2 -1
- package/dist/server/build-output.js +32 -2
- package/dist/server/build-split.d.ts +15 -0
- package/dist/server/build-split.js +160 -0
- package/dist/server/build.d.ts +6 -1
- package/dist/server/build.js +37 -10
- package/dist/server/cli.js +20 -2
- package/dist/server/mcp.js +14 -1
- package/dist/server/serve.d.ts +21 -2
- package/dist/server/serve.js +26 -20
- package/dist/server/static-client.js +2 -1
- package/dist/server/workspace-server.d.ts +1 -1
- package/dist/server/workspace-server.js +24 -4
- package/dist/subformats.global.js +38 -38
- package/dist/ui.global.js +68 -68
- package/dist/workspace/client.d.ts +1 -1
- package/dist/workspace/client.js +22 -3
- package/dist/workspace/mcp-tools.js +32 -0
- package/dist/workspace/mcp.js +50 -1
- package/dist/workspace/protocol.d.ts +3 -0
- package/dist/workspace/server.d.ts +1 -1
- package/dist/workspace/server.js +14 -3
- package/dist/workspace/site-icon.js +17 -12
- package/dist/workspace/textfile.js +16 -4
- package/dist/workspace-mcp-worker.global.js +234 -119
- package/dist/workspace-reader-mcp-worker.global.js +234 -119
- package/dist/workspace-reader-worker.global.js +234 -119
- package/dist/workspace-worker.global.js +234 -119
- package/package.json +2 -2
package/dist/frontend/search.js
CHANGED
|
@@ -455,21 +455,23 @@ export const mountSearch = (initial, search, labels, published, requestFile = fe
|
|
|
455
455
|
window.addEventListener("resize", fit);
|
|
456
456
|
if (sidebar)
|
|
457
457
|
new ResizeObserver(fit).observe(sidebar);
|
|
458
|
-
const open = async () => {
|
|
458
|
+
const open = async (focus = true) => {
|
|
459
459
|
const request = ++revision;
|
|
460
460
|
language =
|
|
461
461
|
JSON.parse(document.getElementById("boot")?.textContent || "null")?.contentLanguage ??
|
|
462
462
|
new URL(location.href).searchParams.get("lang") ??
|
|
463
463
|
"";
|
|
464
|
-
if (!dialog.open)
|
|
464
|
+
if (!dialog.open && focus)
|
|
465
465
|
dialog.show();
|
|
466
466
|
if (dialog.style.left)
|
|
467
467
|
position(dialog.getBoundingClientRect(), 0, 0);
|
|
468
|
-
|
|
469
|
-
|
|
468
|
+
if (focus) {
|
|
469
|
+
input.focus();
|
|
470
|
+
input.select();
|
|
471
|
+
}
|
|
470
472
|
failed = false;
|
|
471
473
|
loading = !published;
|
|
472
|
-
if (!published)
|
|
474
|
+
if (!published && focus)
|
|
473
475
|
index = [];
|
|
474
476
|
render();
|
|
475
477
|
if (published)
|
|
@@ -508,6 +510,17 @@ export const mountSearch = (initial, search, labels, published, requestFile = fe
|
|
|
508
510
|
index = [];
|
|
509
511
|
dialog.close();
|
|
510
512
|
});
|
|
513
|
+
let refreshTimer;
|
|
514
|
+
document.addEventListener("dooc:content-changed", () => {
|
|
515
|
+
if (published || !dialog.open)
|
|
516
|
+
return;
|
|
517
|
+
revision++;
|
|
518
|
+
clearTimeout(refreshTimer);
|
|
519
|
+
refreshTimer = setTimeout(() => {
|
|
520
|
+
if (dialog.open)
|
|
521
|
+
void open(false);
|
|
522
|
+
}, 120);
|
|
523
|
+
});
|
|
511
524
|
input.addEventListener("input", render);
|
|
512
525
|
input.addEventListener("keydown", (event) => {
|
|
513
526
|
if (event.isComposing)
|
|
@@ -57,7 +57,18 @@ export const mountThemePickers = (icons, themes = ["light", "dark"]) => {
|
|
|
57
57
|
const current = (button) => button.dataset.themePicker === "editor"
|
|
58
58
|
? (root.dataset.editorTheme ?? "auto")
|
|
59
59
|
: (target(button).dataset.theme ?? "auto");
|
|
60
|
+
const previewThemes = new WeakMap();
|
|
60
61
|
const sync = () => {
|
|
62
|
+
for (const pane of document.querySelectorAll(".preview-pane")) {
|
|
63
|
+
if (pane.classList.contains("resources-pane")) {
|
|
64
|
+
if (!previewThemes.has(pane))
|
|
65
|
+
previewThemes.set(pane, pane.dataset.theme ?? documentDefault);
|
|
66
|
+
}
|
|
67
|
+
else if (previewThemes.has(pane)) {
|
|
68
|
+
pane.dataset.theme = previewThemes.get(pane);
|
|
69
|
+
previewThemes.delete(pane);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
61
72
|
for (const pane of document.querySelectorAll(".resources-pane, #sidebar, #panel"))
|
|
62
73
|
if (pane.dataset.theme !== root.dataset.editorTheme)
|
|
63
74
|
pane.dataset.theme = root.dataset.editorTheme;
|