@deot/docs-client 1.1.5 → 1.1.7
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/README.md +22 -6
- package/dist/chunks/{compile-BHD98Ttf-BJaenUUQ.js → compile-CM_OyqYN-rhv4v6Tt.js} +634 -1734
- package/dist/chunks/{compiler-sfc.esm-browser-B4_kBkG5.js → compiler-sfc.esm-browser-5dA1IWMJ.js} +185 -305
- package/dist/chunks/{script-DjUf9uWK-Cu5Kla_E.js → css-DleINdoA-Brc23sJ9.js} +2716 -2641
- package/dist/chunks/{dist-COjpr4FU.js → dist-DHJhaOSs.js} +2 -2
- package/dist/chunks/{dist-C8z9l0mA.js → dist-DSypl37f.js} +1 -1
- package/dist/chunks/{dist-BQyOK8Qy.js → dist-Wm6vE6kM.js} +2 -2
- package/dist/chunks/{echarts-Dk-pu7GM.js → echarts-BBzcOaek.js} +1075 -1290
- package/dist/chunks/{html2canvas-Deo0mM5K.js → html2canvas-DoKTvaOT.js} +3 -13
- package/dist/chunks/{index.es-UlJ0gfdF.js → index.es-wVPQxEPP.js} +32 -37
- package/dist/chunks/{jspdf.es.min-CJc40v7q.js → jspdf.es.min-Zm27YeAg.js} +1080 -1053
- package/dist/chunks/{jsx-CwMPlI4_-CAiik-V7.js → jsx-CwMPlI4_-CBhlIHLh.js} +8002 -8541
- package/dist/chunks/{jszip.min-BbVwZKYP.js → jszip.min-Da8UgalE.js} +5 -5
- package/dist/chunks/{lodash-Cxf6dD_I.js → lodash-CYyW02I7.js} +10 -14
- package/dist/chunks/{photoswipe.esm-B0V-xGTB.js → photoswipe.esm-D52MAtDT.js} +11 -38
- package/dist/chunks/{purify.es-BiqY1C6m.js → purify.es-DhHsvqCe.js} +1 -23
- package/dist/chunks/{vue-router-C0mj8Ot5.js → vue-router-LT2FR3OX.js} +384 -372
- package/dist/chunks/{vue.runtime.esm-bundler-XxHGOLq2.js → vue.runtime.esm-bundler-Bk0CnRBe.js} +11 -39
- package/dist/eval/chunks/browser-Cmwcvs-d.js +4 -0
- package/dist/eval/chunks/chunk-rhk8Qtmk-CUgXtmq_.js +4 -0
- package/dist/eval/chunks/compile-CM_OyqYN-rhv4v6Tt.js +7 -0
- package/dist/eval/chunks/compiler-sfc.esm-browser-5dA1IWMJ.js +4 -0
- package/dist/eval/chunks/css-DleINdoA-Brc23sJ9.js +8 -0
- package/dist/eval/chunks/dayjs.min-B3g34Qcz.js +4 -0
- package/dist/eval/chunks/dist-0ySyXNpo.js +4 -0
- package/dist/eval/chunks/dist-B44jICwZ.js +5 -0
- package/dist/eval/chunks/dist-BUw25nXJ.js +6 -0
- package/dist/eval/chunks/dist-BeOE8qTX.js +4 -0
- package/dist/eval/chunks/dist-C3V7reR4.js +4 -0
- package/dist/eval/chunks/dist-CI9Lp9Cj.js +4 -0
- package/dist/eval/chunks/dist-CQir6D4y.js +5 -0
- package/dist/eval/chunks/dist-Cxf7_ocf.js +4 -0
- package/dist/eval/chunks/dist-DF4kisl2.js +5 -0
- package/dist/eval/chunks/dist-DHJhaOSs.js +5 -0
- package/dist/eval/chunks/dist-DLj8yJdm.js +4 -0
- package/dist/eval/chunks/dist-DSypl37f.js +5 -0
- package/dist/eval/chunks/dist-DWn6r6un.js +4 -0
- package/dist/eval/chunks/dist-DWqBe2Ah.js +6 -0
- package/dist/eval/chunks/dist-D_Uqh6m9.js +4 -0
- package/dist/eval/chunks/dist-DcIU51zW.js +4 -0
- package/dist/eval/chunks/dist-Wm6vE6kM.js +1 -0
- package/dist/eval/chunks/dist-kiZUqqzR.js +4 -0
- package/dist/eval/chunks/dist-oZ12SGqg.js +4 -0
- package/dist/eval/chunks/dist-va7FmnW4.js +4 -0
- package/dist/eval/chunks/echarts-BBzcOaek.js +4 -0
- package/dist/eval/chunks/eval-runtime-e7f6eb9af5d4.js +1 -0
- package/dist/eval/chunks/html2canvas-DoKTvaOT.js +4 -0
- package/dist/eval/chunks/index.es-wVPQxEPP.js +5 -0
- package/dist/eval/chunks/jspdf.es.min-Zm27YeAg.js +78 -0
- package/dist/eval/chunks/jsx-CwMPlI4_-CBhlIHLh.js +4 -0
- package/dist/eval/chunks/jszip.min-Da8UgalE.js +4 -0
- package/dist/eval/chunks/lodash-CYyW02I7.js +4 -0
- package/dist/eval/chunks/photoswipe.esm-D52MAtDT.js +4 -0
- package/dist/eval/chunks/purify.es-DhHsvqCe.js +4 -0
- package/dist/eval/chunks/rolldown-runtime-Ce3zPWPd.js +4 -0
- package/dist/eval/chunks/vue-router-LT2FR3OX.js +5 -0
- package/dist/eval/chunks/vue.runtime.esm-bundler-Bk0CnRBe.js +4 -0
- package/dist/eval/index.js +24 -0
- package/dist/eval/index.style.css +21 -0
- package/dist/index.cjs +895 -354
- package/dist/index.js +81684 -37415
- package/dist/index.style.css +3 -3
- package/package.json +16 -11
- package/dist/chunks/cdn-DQoETju_-DS-873Vi.js +0 -38
- package/dist/chunks/dist-9UPCn_ag.js +0 -24601
- package/dist/chunks/dist-uXnwGrO3.js +0 -76
- package/dist/chunks/files-BqucFldk-B-hTQ-ip.js +0 -148
- package/dist/chunks/linker-xqjVl0X0-CWWI367H.js +0 -118
- package/dist/chunks/local-sandbox-DvcgaBOa-CzJxrdVx.js +0 -298
- package/dist/chunks/modules-BGzPcoRR-C9BWX8hC.js +0 -154
- package/dist/chunks/pinia-pDJilYOg.js +0 -326
- package/dist/chunks/remote-mq4zvrI1-Bib9tTkb.js +0 -104
- package/dist/chunks/store-BOyC8F2y-CbodPye0.js +0 -17037
- package/dist/chunks/vc-components-C7ruefOT.js +0 -6
- package/dist/chunks/vc-components-m3l_xrd8.js +0 -6
package/dist/index.cjs
CHANGED
|
@@ -13,6 +13,10 @@ let es_module_lexer = require("es-module-lexer");
|
|
|
13
13
|
let _deot_helper_unicode = require("@deot/helper-unicode");
|
|
14
14
|
let _deot_docs_playground = require("@deot/docs-playground");
|
|
15
15
|
let _deot_helper_dom = require("@deot/helper-dom");
|
|
16
|
+
let codemirror = require("codemirror");
|
|
17
|
+
let _codemirror_state = require("@codemirror/state");
|
|
18
|
+
let _codemirror_lang_json = require("@codemirror/lang-json");
|
|
19
|
+
let _codemirror_lang_markdown = require("@codemirror/lang-markdown");
|
|
16
20
|
//#region packages/client/src/utils/runtime.ts
|
|
17
21
|
var PRODUCTION_RUNTIME = Object.freeze({ mode: "production" });
|
|
18
22
|
var initializeDocsRuntime = (target = window, config = target.$docs || {
|
|
@@ -74,7 +78,7 @@ var getEnvironmentBase = (config) => {
|
|
|
74
78
|
const segments = location.pathname.split("/").filter(Boolean);
|
|
75
79
|
const configuredLanguages = Object.keys(config.locales);
|
|
76
80
|
const languages = configuredLanguages.length ? configuredLanguages : ["zh-CN"];
|
|
77
|
-
const routeIndex = /^__docs\/preview
|
|
81
|
+
const routeIndex = /^__docs\/(?:preview|raw-editor|markdown-editor)$/.test(segments.slice(-2).join("/")) ? segments.length - 2 : segments.findIndex((segment) => languages.includes(segment));
|
|
78
82
|
if (routeIndex >= 0) {
|
|
79
83
|
const deploymentSegments = segments.slice(0, routeIndex);
|
|
80
84
|
return new URL(`/${deploymentSegments.join("/")}${deploymentSegments.length ? "/" : ""}`, location.origin).href;
|
|
@@ -748,14 +752,14 @@ var setSidebarItems = (next) => {
|
|
|
748
752
|
};
|
|
749
753
|
//#endregion
|
|
750
754
|
//#region packages/client/src/components/layout/default-footer.vue?vue&type=script&setup=true&lang.ts
|
|
751
|
-
var _hoisted_1$
|
|
752
|
-
var _hoisted_2$
|
|
755
|
+
var _hoisted_1$33 = ["data-content-width"];
|
|
756
|
+
var _hoisted_2$26 = {
|
|
753
757
|
key: 0,
|
|
754
758
|
class: "docs-footer__inner"
|
|
755
759
|
};
|
|
756
|
-
var _hoisted_3$
|
|
757
|
-
var _hoisted_4$
|
|
758
|
-
var _hoisted_5$
|
|
760
|
+
var _hoisted_3$19 = { class: "docs-footer__content" };
|
|
761
|
+
var _hoisted_4$13 = { class: "docs-footer__title" };
|
|
762
|
+
var _hoisted_5$10 = {
|
|
759
763
|
key: 0,
|
|
760
764
|
class: "docs-footer__links"
|
|
761
765
|
};
|
|
@@ -888,11 +892,11 @@ var default_footer_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
888
892
|
key: 0,
|
|
889
893
|
class: "docs-footer",
|
|
890
894
|
"data-content-width": contentWidth.value
|
|
891
|
-
}, [groups.value.length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2$
|
|
895
|
+
}, [groups.value.length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2$26, [(0, vue.createElementVNode)("div", _hoisted_3$19, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(groups.value, (group) => {
|
|
892
896
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("section", {
|
|
893
897
|
key: group.label,
|
|
894
898
|
class: "docs-footer__group"
|
|
895
|
-
}, [(0, vue.createElementVNode)("h2", _hoisted_4$
|
|
899
|
+
}, [(0, vue.createElementVNode)("h2", _hoisted_4$13, (0, vue.toDisplayString)(group.label), 1), group.children?.length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("ul", _hoisted_5$10, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(group.children, (item) => {
|
|
896
900
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("li", { key: `${item.label}:${item.value || ""}` }, [item.value && isExternal(item.value) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
|
|
897
901
|
key: 0,
|
|
898
902
|
href: item.value,
|
|
@@ -929,13 +933,13 @@ var default_footer_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
929
933
|
alt: ""
|
|
930
934
|
}, null, 8, _hoisted_12$5)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createTextVNode)(" " + (0, vue.toDisplayString)(brandLabel.value), 1)]),
|
|
931
935
|
_: 1
|
|
932
|
-
}, 8, ["to"])), poweredBy.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_13$4, (0, vue.toDisplayString)(poweredBy.value), 1)) : (0, vue.createCommentVNode)("v-if", true)])])], 8, _hoisted_1$
|
|
936
|
+
}, 8, ["to"])), poweredBy.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_13$4, (0, vue.toDisplayString)(poweredBy.value), 1)) : (0, vue.createCommentVNode)("v-if", true)])])], 8, _hoisted_1$33)) : (0, vue.createCommentVNode)("v-if", true);
|
|
933
937
|
};
|
|
934
938
|
}
|
|
935
939
|
});
|
|
936
940
|
//#endregion
|
|
937
941
|
//#region packages/client/src/components/search/highlight-text.vue?vue&type=script&setup=true&lang.ts
|
|
938
|
-
var _hoisted_1$
|
|
942
|
+
var _hoisted_1$32 = {
|
|
939
943
|
key: 0,
|
|
940
944
|
class: "docs-search-highlight"
|
|
941
945
|
};
|
|
@@ -964,7 +968,7 @@ var highlight_text_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
964
968
|
});
|
|
965
969
|
return (_ctx, _cache) => {
|
|
966
970
|
return (0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(parts.value, (part, index) => {
|
|
967
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: `${index}:${part.text}` }, [part.match ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("mark", _hoisted_1$
|
|
971
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: `${index}:${part.text}` }, [part.match ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("mark", _hoisted_1$32, (0, vue.toDisplayString)(part.text), 1)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [(0, vue.createTextVNode)((0, vue.toDisplayString)(part.text), 1)], 64))], 64);
|
|
968
972
|
}), 128);
|
|
969
973
|
};
|
|
970
974
|
}
|
|
@@ -1932,9 +1936,13 @@ var resolveDependencyUrl = (specifier, importer) => {
|
|
|
1932
1936
|
};
|
|
1933
1937
|
var collectStyleImports = (code) => [...code.matchAll(STYLE_IMPORT_RE)].map((match) => match[2] || match[3] || match[5]).filter((value) => !/^(?:[a-z][a-z\d+.-]*:|\/)/i.test(value)).map((value) => value.startsWith(".") ? value : `./${value}`);
|
|
1934
1938
|
var collectModuleImports = async (code) => {
|
|
1935
|
-
await es_module_lexer.init;
|
|
1939
|
+
await (0, es_module_lexer.init)();
|
|
1936
1940
|
try {
|
|
1937
|
-
return (0, es_module_lexer.parse)(code)[0].
|
|
1941
|
+
return (0, es_module_lexer.parse)(code)[0].flatMap((item) => {
|
|
1942
|
+
if (item.type === "dynamic") return item.specifier && !item.glob ? [item.specifier] : [];
|
|
1943
|
+
if (item.type === "import-meta" || item.typeOnly) return [];
|
|
1944
|
+
return [item.specifier];
|
|
1945
|
+
});
|
|
1938
1946
|
} catch {
|
|
1939
1947
|
return [...code.replace(/\b(?:import|export)\s+type\b(?!\s+from\b)\s*(?:\{[^}]*\}|\*\s+as\s+[\w$]+|[\w$]+)(?:\s+from\s*(['"])[^'"]+\1)?\s*;?/g, "").matchAll(/(?:\bfrom\s+|import\s*\(\s*|import\s+)['"]([^'"]+)['"]/g)].map((match) => match[1]);
|
|
1940
1948
|
}
|
|
@@ -2311,12 +2319,12 @@ var docsMarkdownIndicator = (options) => {
|
|
|
2311
2319
|
var docsMarkdownInlineContent = (props) => typeof props.content === "string" ? props.content : void 0;
|
|
2312
2320
|
//#endregion
|
|
2313
2321
|
//#region packages/client/src/components/renderer/markdown.vue?vue&type=script&setup=true&lang.ts
|
|
2314
|
-
var _hoisted_1$
|
|
2315
|
-
var _hoisted_2$
|
|
2322
|
+
var _hoisted_1$31 = { class: "docs-renderer-markdown" };
|
|
2323
|
+
var _hoisted_2$25 = {
|
|
2316
2324
|
key: 0,
|
|
2317
2325
|
class: "docs-renderer-markdown__error"
|
|
2318
2326
|
};
|
|
2319
|
-
var _hoisted_3$
|
|
2327
|
+
var _hoisted_3$18 = {
|
|
2320
2328
|
key: 1,
|
|
2321
2329
|
class: "docs-renderer-markdown__loading"
|
|
2322
2330
|
};
|
|
@@ -2408,7 +2416,7 @@ var markdown_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2408
2416
|
unsubscribe?.();
|
|
2409
2417
|
});
|
|
2410
2418
|
return (_ctx, _cache) => {
|
|
2411
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$
|
|
2419
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$31, [error.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2$25, (0, vue.toDisplayString)(error.value), 1)) : loading.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_3$18, (0, vue.toDisplayString)((0, vue.unref)(t)("client.common.loading")), 1)) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_deot_docs_markdown.Markdown), {
|
|
2412
2420
|
key: 2,
|
|
2413
2421
|
value: content.value,
|
|
2414
2422
|
indicator: indicator.value,
|
|
@@ -2427,13 +2435,13 @@ var markdown_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2427
2435
|
});
|
|
2428
2436
|
//#endregion
|
|
2429
2437
|
//#region packages/client/src/components/renderer/markdown-editor.vue?vue&type=script&setup=true&lang.ts
|
|
2430
|
-
var _hoisted_1$
|
|
2431
|
-
var _hoisted_2$
|
|
2432
|
-
var _hoisted_3$
|
|
2433
|
-
var _hoisted_4$
|
|
2438
|
+
var _hoisted_1$30 = { class: "docs-renderer-module-editor" };
|
|
2439
|
+
var _hoisted_2$24 = { class: "docs-renderer-field is-wide" };
|
|
2440
|
+
var _hoisted_3$17 = { class: "docs-renderer-field is-wide" };
|
|
2441
|
+
var _hoisted_4$12 = { class: "docs-renderer-field is-wide is-inline" };
|
|
2434
2442
|
//#endregion
|
|
2435
2443
|
//#region packages/client/src/components/renderer/markdown-editor.vue
|
|
2436
|
-
var markdown_editor_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
2444
|
+
var markdown_editor_default$1 = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
2437
2445
|
__name: "markdown-editor",
|
|
2438
2446
|
props: {
|
|
2439
2447
|
node: {},
|
|
@@ -2469,19 +2477,19 @@ var markdown_editor_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2469
2477
|
} });
|
|
2470
2478
|
};
|
|
2471
2479
|
return (_ctx, _cache) => {
|
|
2472
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$
|
|
2473
|
-
(0, vue.createElementVNode)("div", _hoisted_2$
|
|
2480
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$30, [
|
|
2481
|
+
(0, vue.createElementVNode)("div", _hoisted_2$24, [(0, vue.createElementVNode)("label", null, (0, vue.toDisplayString)((0, vue.unref)(t)("renderer.editor.source")), 1), (0, vue.createVNode)((0, vue.unref)(_deot_vc.Input), {
|
|
2474
2482
|
"model-value": String(__props.modelValue.source || ""),
|
|
2475
2483
|
placeholder: (0, vue.unref)(t)("renderer.editor.markdownSourceHint"),
|
|
2476
2484
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = (value) => update({ source: value }))
|
|
2477
2485
|
}, null, 8, ["model-value", "placeholder"])]),
|
|
2478
|
-
(0, vue.createElementVNode)("div", _hoisted_3$
|
|
2486
|
+
(0, vue.createElementVNode)("div", _hoisted_3$17, [(0, vue.createElementVNode)("label", null, (0, vue.toDisplayString)((0, vue.unref)(t)("renderer.editor.markdownContent")), 1), (0, vue.createVNode)((0, vue.unref)(_deot_vc.Textarea), {
|
|
2479
2487
|
"model-value": String(__props.modelValue.content || ""),
|
|
2480
2488
|
rows: 8,
|
|
2481
2489
|
placeholder: (0, vue.unref)(t)("renderer.editor.markdownContentHint"),
|
|
2482
2490
|
"onUpdate:modelValue": handleContent
|
|
2483
2491
|
}, null, 8, ["model-value", "placeholder"])]),
|
|
2484
|
-
(0, vue.createElementVNode)("div", _hoisted_4$
|
|
2492
|
+
(0, vue.createElementVNode)("div", _hoisted_4$12, [(0, vue.createElementVNode)("label", null, (0, vue.toDisplayString)((0, vue.unref)(t)("markdown.indicator.label")), 1), (0, vue.createVNode)((0, vue.unref)(_deot_vc.Switch), {
|
|
2485
2493
|
"model-value": indicatorEnabled.value,
|
|
2486
2494
|
"onUpdate:modelValue": patchIndicator
|
|
2487
2495
|
}, null, 8, ["model-value"])])
|
|
@@ -2490,6 +2498,23 @@ var markdown_editor_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2490
2498
|
}
|
|
2491
2499
|
});
|
|
2492
2500
|
//#endregion
|
|
2501
|
+
//#region packages/client/src/modules/preview/raw.ts
|
|
2502
|
+
/**
|
|
2503
|
+
* raw 只负责 JSON 编解码;具体页面独立校验自己的配置。
|
|
2504
|
+
* @param value Router 已解码的单个 raw 参数。
|
|
2505
|
+
* @returns 解码后的 JSON 值。
|
|
2506
|
+
*/
|
|
2507
|
+
var readRaw = (value) => {
|
|
2508
|
+
if (typeof value !== "string" || !value) throw new TypeError("raw must be a single encoded JSON value");
|
|
2509
|
+
return JSON.parse((0, _deot_helper_unicode.decode)(value));
|
|
2510
|
+
};
|
|
2511
|
+
var createRawUrl = (value, target, base) => {
|
|
2512
|
+
const url = new URL(target.trim(), base);
|
|
2513
|
+
if (!target.trim() || !/^https?:$/.test(url.protocol)) throw new TypeError("target must be an HTTP(S) or relative URL");
|
|
2514
|
+
url.searchParams.set("raw", (0, _deot_helper_unicode.encode)(JSON.stringify(value)));
|
|
2515
|
+
return url.href;
|
|
2516
|
+
};
|
|
2517
|
+
//#endregion
|
|
2493
2518
|
//#region packages/client/src/modules/preview/config.ts
|
|
2494
2519
|
var previewConfigKey = Symbol("preview-config");
|
|
2495
2520
|
var isPlainObject = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -2533,10 +2558,7 @@ var normalizePreviewConfig = (value) => {
|
|
|
2533
2558
|
* @returns 当前链接的预览配置。
|
|
2534
2559
|
*/
|
|
2535
2560
|
var readPreviewConfig = (query) => {
|
|
2536
|
-
if (query.raw !== void 0)
|
|
2537
|
-
if (typeof query.raw !== "string" || !query.raw) throw new TypeError("raw must be a single encoded configuration");
|
|
2538
|
-
return normalizePreviewConfig(JSON.parse((0, _deot_helper_unicode.decode)(query.raw)));
|
|
2539
|
-
}
|
|
2561
|
+
if (query.raw !== void 0) return normalizePreviewConfig(readRaw(query.raw));
|
|
2540
2562
|
const styles = Array.isArray(query.styles) ? query.styles : typeof query.styles === "string" ? query.styles.split(",") : [];
|
|
2541
2563
|
return {
|
|
2542
2564
|
url: typeof query.url === "string" ? query.url.trim() : "",
|
|
@@ -2546,17 +2568,6 @@ var readPreviewConfig = (query) => {
|
|
|
2546
2568
|
};
|
|
2547
2569
|
};
|
|
2548
2570
|
/**
|
|
2549
|
-
* 使用 Unicode helper 编码并正确转义 Base64 的 +、/、=。
|
|
2550
|
-
* @param config 预览配置。
|
|
2551
|
-
* @param base 站点部署根地址。
|
|
2552
|
-
* @returns 可直接分享的预览链接。
|
|
2553
|
-
*/
|
|
2554
|
-
var createPreviewUrl = (config, base) => {
|
|
2555
|
-
const url = new URL("__docs/preview", base);
|
|
2556
|
-
url.searchParams.set("raw", (0, _deot_helper_unicode.encode)(JSON.stringify(config)));
|
|
2557
|
-
return url.href;
|
|
2558
|
-
};
|
|
2559
|
-
/**
|
|
2560
2571
|
* 根据资源 URL 的 pathname 选择预览组件。
|
|
2561
2572
|
* @param source 资源地址。
|
|
2562
2573
|
* @param base 解析相对地址的页面地址。
|
|
@@ -2637,11 +2648,11 @@ var acquirePreviewStyles = (urls, onError) => {
|
|
|
2637
2648
|
};
|
|
2638
2649
|
//#endregion
|
|
2639
2650
|
//#region packages/client/src/components/remote-sfc/remote-sfc.vue?vue&type=script&setup=true&lang.ts
|
|
2640
|
-
var _hoisted_1$
|
|
2651
|
+
var _hoisted_1$29 = {
|
|
2641
2652
|
key: 0,
|
|
2642
2653
|
class: "docs-remote-sfc__error"
|
|
2643
2654
|
};
|
|
2644
|
-
var _hoisted_2$
|
|
2655
|
+
var _hoisted_2$23 = {
|
|
2645
2656
|
key: 1,
|
|
2646
2657
|
class: "docs-remote-sfc__loading"
|
|
2647
2658
|
};
|
|
@@ -2680,7 +2691,6 @@ var remote_sfc_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2680
2691
|
...siteImportMap,
|
|
2681
2692
|
imports: {
|
|
2682
2693
|
...siteImportMap.imports,
|
|
2683
|
-
...config.modules,
|
|
2684
2694
|
...JSON.parse(previewModules.value)
|
|
2685
2695
|
}
|
|
2686
2696
|
}
|
|
@@ -2696,7 +2706,7 @@ var remote_sfc_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2696
2706
|
locale: locale.value,
|
|
2697
2707
|
styleless: true,
|
|
2698
2708
|
...overrides,
|
|
2699
|
-
local: overrides.local ?? site.local
|
|
2709
|
+
local: overrides.local ?? site.local,
|
|
2700
2710
|
...previewStyleHead.value ? { previewOptions: {
|
|
2701
2711
|
...site.previewOptions,
|
|
2702
2712
|
headHTML: `${site.previewOptions?.headHTML || ""}${previewStyleHead.value}`
|
|
@@ -2704,7 +2714,7 @@ var remote_sfc_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2704
2714
|
options: playgroundOptions.value
|
|
2705
2715
|
};
|
|
2706
2716
|
});
|
|
2707
|
-
const useIframeViewport = (0, vue.computed)(() => !!preview?.value &&
|
|
2717
|
+
const useIframeViewport = (0, vue.computed)(() => !!preview?.value && playgroundProps.value.local === false && playgroundProps.value.styleless && !Array.isArray(playgroundProps.value.viewport));
|
|
2708
2718
|
const previewStyleHead = (0, vue.computed)(() => {
|
|
2709
2719
|
try {
|
|
2710
2720
|
return parsePreviewStyleUrls(preview?.value?.styles, location.href).map((url) => `<link rel="stylesheet" href="${url.replaceAll("&", "&").replaceAll("\"", """)}">`).join("");
|
|
@@ -2748,6 +2758,7 @@ var remote_sfc_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2748
2758
|
const activeLoads = /* @__PURE__ */ new Set();
|
|
2749
2759
|
const visit = async (url, logicalSource) => {
|
|
2750
2760
|
if (current !== generation || visited.has(url)) return;
|
|
2761
|
+
visited.add(url);
|
|
2751
2762
|
const type = getResourceType(url);
|
|
2752
2763
|
const source = logicalSource || toLogicalResourceSource(config, langSnapshot, url);
|
|
2753
2764
|
const identity = createResourceIdentity(config, langSnapshot, type, source);
|
|
@@ -2763,11 +2774,13 @@ var remote_sfc_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2763
2774
|
priority: 100,
|
|
2764
2775
|
signal: activeController.signal
|
|
2765
2776
|
});
|
|
2777
|
+
} catch (reason) {
|
|
2778
|
+
visited.delete(url);
|
|
2779
|
+
throw reason;
|
|
2766
2780
|
} finally {
|
|
2767
2781
|
activeLoads.delete(key);
|
|
2768
2782
|
}
|
|
2769
2783
|
if (current !== generation) return;
|
|
2770
|
-
visited.add(url);
|
|
2771
2784
|
subscriptions.push(Gateway.subscribe(identity, reload));
|
|
2772
2785
|
let content = github && type === "module" ? await github.expandGlob(record.content, url) : record.content;
|
|
2773
2786
|
if (!github && type !== "style") assertResolvableSourceGlobs(content, url);
|
|
@@ -2823,7 +2836,7 @@ var remote_sfc_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2823
2836
|
clearSubscriptions();
|
|
2824
2837
|
});
|
|
2825
2838
|
return (_ctx, _cache) => {
|
|
2826
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)(["docs-remote-sfc", { "docs-remote-sfc--viewport": useIframeViewport.value }]) }, [error.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$
|
|
2839
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)(["docs-remote-sfc", { "docs-remote-sfc--viewport": useIframeViewport.value }]) }, [error.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$29, (0, vue.toDisplayString)(error.value), 1)) : loading.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2$23, (0, vue.toDisplayString)((0, vue.unref)(t)("client.common.loading")), 1)) : PlaygroundComponent.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(PlaygroundComponent.value), (0, vue.mergeProps)({ key: `${revision.value}:${playgroundProps.value.local}` }, playgroundProps.value, { onNavigate: handleNavigate }), null, 16)) : (0, vue.createCommentVNode)("v-if", true)], 2);
|
|
2827
2840
|
};
|
|
2828
2841
|
}
|
|
2829
2842
|
});
|
|
@@ -2849,10 +2862,10 @@ var sfc_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2849
2862
|
});
|
|
2850
2863
|
//#endregion
|
|
2851
2864
|
//#region packages/client/src/components/renderer/source-editor.vue?vue&type=script&setup=true&lang.ts
|
|
2852
|
-
var _hoisted_1$
|
|
2865
|
+
var _hoisted_1$28 = { class: "docs-renderer-module-editor" };
|
|
2853
2866
|
//#endregion
|
|
2854
2867
|
//#region packages/client/src/components/renderer/source-editor.vue
|
|
2855
|
-
var source_editor_default$
|
|
2868
|
+
var source_editor_default$2 = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
2856
2869
|
__name: "source-editor",
|
|
2857
2870
|
props: {
|
|
2858
2871
|
node: {},
|
|
@@ -2869,7 +2882,7 @@ var source_editor_default$1 = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2869
2882
|
source
|
|
2870
2883
|
});
|
|
2871
2884
|
return (_ctx, _cache) => {
|
|
2872
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$
|
|
2885
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$28, [(0, vue.createElementVNode)("label", null, (0, vue.toDisplayString)((0, vue.unref)(t)("renderer.editor.source")), 1), (0, vue.createVNode)((0, vue.unref)(_deot_vc.Input), {
|
|
2873
2886
|
"model-value": String(__props.modelValue.source || ""),
|
|
2874
2887
|
"onUpdate:modelValue": handleUpdate
|
|
2875
2888
|
}, null, 8, ["model-value"])]);
|
|
@@ -2892,7 +2905,7 @@ var MarkdownModule = (0, _deot_docs_renderer.defineRendererModule)({
|
|
|
2892
2905
|
validate: validateDocsMarkdownProps
|
|
2893
2906
|
},
|
|
2894
2907
|
viewer: markdown_default,
|
|
2895
|
-
editor: markdown_editor_default,
|
|
2908
|
+
editor: markdown_editor_default$1,
|
|
2896
2909
|
frames: { sortable: {
|
|
2897
2910
|
movable: true,
|
|
2898
2911
|
deletable: true,
|
|
@@ -2930,7 +2943,7 @@ var SfcModule = (0, _deot_docs_renderer.defineRendererModule)({
|
|
|
2930
2943
|
}]
|
|
2931
2944
|
},
|
|
2932
2945
|
viewer: sfc_default,
|
|
2933
|
-
editor: source_editor_default$
|
|
2946
|
+
editor: source_editor_default$2,
|
|
2934
2947
|
frames: { sortable: {
|
|
2935
2948
|
movable: true,
|
|
2936
2949
|
deletable: true,
|
|
@@ -4581,11 +4594,11 @@ var SearchManager = class {
|
|
|
4581
4594
|
var Search = new SearchManager();
|
|
4582
4595
|
//#endregion
|
|
4583
4596
|
//#region packages/client/src/components/search/search.vue?vue&type=script&setup=true&lang.ts
|
|
4584
|
-
var _hoisted_1$
|
|
4585
|
-
var _hoisted_2$
|
|
4586
|
-
var _hoisted_3$
|
|
4587
|
-
var _hoisted_4$
|
|
4588
|
-
var _hoisted_5$
|
|
4597
|
+
var _hoisted_1$27 = ["aria-label"];
|
|
4598
|
+
var _hoisted_2$22 = { class: "docs-search__header" };
|
|
4599
|
+
var _hoisted_3$16 = ["placeholder", "aria-label"];
|
|
4600
|
+
var _hoisted_4$11 = { class: "docs-search__actions" };
|
|
4601
|
+
var _hoisted_5$9 = ["aria-label"];
|
|
4589
4602
|
var _hoisted_6$6 = { class: "docs-search__body" };
|
|
4590
4603
|
var _hoisted_7$6 = { class: "docs-search__content" };
|
|
4591
4604
|
var _hoisted_8$6 = {
|
|
@@ -4616,17 +4629,17 @@ var _hoisted_16$2 = {
|
|
|
4616
4629
|
key: 1,
|
|
4617
4630
|
class: "docs-search__result-excerpt"
|
|
4618
4631
|
};
|
|
4619
|
-
var _hoisted_17$
|
|
4632
|
+
var _hoisted_17$1 = {
|
|
4620
4633
|
key: 0,
|
|
4621
4634
|
class: "docs-search__state"
|
|
4622
4635
|
};
|
|
4623
|
-
var _hoisted_18
|
|
4624
|
-
var _hoisted_19
|
|
4636
|
+
var _hoisted_18 = { class: "docs-search__group-title" };
|
|
4637
|
+
var _hoisted_19 = [
|
|
4625
4638
|
"data-search-index",
|
|
4626
4639
|
"onMouseenter",
|
|
4627
4640
|
"onClick"
|
|
4628
4641
|
];
|
|
4629
|
-
var _hoisted_20
|
|
4642
|
+
var _hoisted_20 = { class: "docs-search__result-content" };
|
|
4630
4643
|
var _hoisted_21 = { class: "docs-search__result-title" };
|
|
4631
4644
|
var _hoisted_22 = {
|
|
4632
4645
|
key: 0,
|
|
@@ -4836,7 +4849,7 @@ var search_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4836
4849
|
"aria-label": (0, vue.unref)(t)("client.search.dialogLabel"),
|
|
4837
4850
|
onKeydown: handleKeydown
|
|
4838
4851
|
}, [
|
|
4839
|
-
(0, vue.createElementVNode)("header", _hoisted_2$
|
|
4852
|
+
(0, vue.createElementVNode)("header", _hoisted_2$22, [
|
|
4840
4853
|
_cache[2] || (_cache[2] = (0, vue.createElementVNode)("span", {
|
|
4841
4854
|
class: "docs-search__icon",
|
|
4842
4855
|
"aria-hidden": "true"
|
|
@@ -4852,8 +4865,8 @@ var search_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4852
4865
|
"aria-label": (0, vue.unref)(t)("client.search.placeholder"),
|
|
4853
4866
|
onCompositionstart: _cache[1] || (_cache[1] = ($event) => composing.value = true),
|
|
4854
4867
|
onCompositionend: handleCompositionEnd
|
|
4855
|
-
}, null, 40, _hoisted_3$
|
|
4856
|
-
(0, vue.createElementVNode)("div", _hoisted_4$
|
|
4868
|
+
}, null, 40, _hoisted_3$16), [[vue.vModelText, keyword.value]]),
|
|
4869
|
+
(0, vue.createElementVNode)("div", _hoisted_4$11, [keyword.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
4857
4870
|
key: 0,
|
|
4858
4871
|
class: "docs-search__clear",
|
|
4859
4872
|
type: "button",
|
|
@@ -4863,7 +4876,7 @@ var search_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4863
4876
|
type: "button",
|
|
4864
4877
|
"aria-label": (0, vue.unref)(t)("client.search.close"),
|
|
4865
4878
|
onClick: handleClose
|
|
4866
|
-
}, " esc ", 8, _hoisted_5$
|
|
4879
|
+
}, " esc ", 8, _hoisted_5$9)])
|
|
4867
4880
|
]),
|
|
4868
4881
|
(0, vue.createElementVNode)("div", _hoisted_6$6, [(0, vue.createVNode)((0, vue.unref)(_deot_vc.Scroller), {
|
|
4869
4882
|
class: "docs-search__scroller",
|
|
@@ -4901,9 +4914,9 @@ var search_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4901
4914
|
}, "↵", -1))
|
|
4902
4915
|
], 42, _hoisted_11$4);
|
|
4903
4916
|
}), 128)),
|
|
4904
|
-
!results.value.length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_17$
|
|
4917
|
+
!results.value.length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_17$1, (0, vue.toDisplayString)(preparedCount.value ? (0, vue.unref)(t)("client.search.noResults") : (0, vue.unref)(t)("client.search.noCachedDocuments")), 1)) : (0, vue.createCommentVNode)("v-if", true)
|
|
4905
4918
|
], 64)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 3 }, [
|
|
4906
|
-
(0, vue.createElementVNode)("div", _hoisted_18
|
|
4919
|
+
(0, vue.createElementVNode)("div", _hoisted_18, (0, vue.toDisplayString)((0, vue.unref)(t)("client.search.recent")), 1),
|
|
4907
4920
|
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(history.value, (item, index) => {
|
|
4908
4921
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
4909
4922
|
key: item.id,
|
|
@@ -4918,7 +4931,7 @@ var search_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4918
4931
|
class: "docs-search__history-icon",
|
|
4919
4932
|
"aria-hidden": "true"
|
|
4920
4933
|
}, "↶", -1)),
|
|
4921
|
-
(0, vue.createElementVNode)("span", _hoisted_20
|
|
4934
|
+
(0, vue.createElementVNode)("span", _hoisted_20, [(0, vue.createElementVNode)("span", _hoisted_21, (0, vue.toDisplayString)(item.sectionTitle || item.title), 1), item.sectionTitle ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_22, (0, vue.toDisplayString)(item.title), 1)) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
4922
4935
|
(0, vue.createElementVNode)("button", {
|
|
4923
4936
|
class: (0, vue.normalizeClass)(["docs-search__history-action", { "docs-search__history-action--active": item.pinned }]),
|
|
4924
4937
|
type: "button",
|
|
@@ -4931,7 +4944,7 @@ var search_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4931
4944
|
"aria-label": (0, vue.unref)(t)("client.search.remove"),
|
|
4932
4945
|
onClick: (0, vue.withModifiers)(($event) => handleRemoveHistory(item.id), ["stop"])
|
|
4933
4946
|
}, " × ", 8, _hoisted_24)
|
|
4934
|
-
], 42, _hoisted_19
|
|
4947
|
+
], 42, _hoisted_19);
|
|
4935
4948
|
}), 128)),
|
|
4936
4949
|
!history.value.length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_25, (0, vue.toDisplayString)((0, vue.unref)(t)("client.search.noRecent")), 1)) : (0, vue.createCommentVNode)("v-if", true)
|
|
4937
4950
|
], 64))])]),
|
|
@@ -4946,7 +4959,7 @@ var search_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4946
4959
|
(0, vue.createElementVNode)("span", null, [_cache[7] || (_cache[7] = (0, vue.createElementVNode)("kbd", null, "↵", -1)), (0, vue.createTextVNode)(" " + (0, vue.toDisplayString)((0, vue.unref)(t)("client.search.selectHint")), 1)]),
|
|
4947
4960
|
(0, vue.createElementVNode)("span", null, [_cache[8] || (_cache[8] = (0, vue.createElementVNode)("kbd", null, "ESC", -1)), (0, vue.createTextVNode)(" " + (0, vue.toDisplayString)((0, vue.unref)(t)("client.search.closeHint")), 1)])
|
|
4948
4961
|
])
|
|
4949
|
-
], 40, _hoisted_1$
|
|
4962
|
+
], 40, _hoisted_1$27)]);
|
|
4950
4963
|
};
|
|
4951
4964
|
}
|
|
4952
4965
|
});
|
|
@@ -4963,8 +4976,8 @@ var DocsSearch = new _deot_vc.Portal(search_default, {
|
|
|
4963
4976
|
});
|
|
4964
4977
|
//#endregion
|
|
4965
4978
|
//#region packages/client/src/components/search/trigger.vue?vue&type=script&setup=true&lang.ts
|
|
4966
|
-
var _hoisted_1$
|
|
4967
|
-
var _hoisted_2$
|
|
4979
|
+
var _hoisted_1$26 = ["aria-label"];
|
|
4980
|
+
var _hoisted_2$21 = { class: "docs-search-trigger__shortcut" };
|
|
4968
4981
|
//#endregion
|
|
4969
4982
|
//#region packages/client/src/components/search/trigger.vue
|
|
4970
4983
|
var trigger_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -5008,7 +5021,7 @@ var trigger_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5008
5021
|
}, [_cache[0] || (_cache[0] = (0, vue.createElementVNode)("span", {
|
|
5009
5022
|
class: "docs-search-trigger__icon",
|
|
5010
5023
|
"aria-hidden": "true"
|
|
5011
|
-
}, null, -1)), (0, vue.createElementVNode)("kbd", _hoisted_2$
|
|
5024
|
+
}, null, -1)), (0, vue.createElementVNode)("kbd", _hoisted_2$21, (0, vue.toDisplayString)((0, vue.unref)(shortcut)), 1)], 8, _hoisted_1$26);
|
|
5012
5025
|
};
|
|
5013
5026
|
}
|
|
5014
5027
|
});
|
|
@@ -5117,12 +5130,12 @@ var CLIENT_ICON_DEFINITIONS = {
|
|
|
5117
5130
|
};
|
|
5118
5131
|
//#endregion
|
|
5119
5132
|
//#region packages/client/src/components/icon/icon.vue?vue&type=script&setup=true&lang.ts
|
|
5120
|
-
var _hoisted_1$
|
|
5133
|
+
var _hoisted_1$25 = [
|
|
5121
5134
|
"data-icon",
|
|
5122
5135
|
"fill",
|
|
5123
5136
|
"stroke"
|
|
5124
5137
|
];
|
|
5125
|
-
var _hoisted_2$
|
|
5138
|
+
var _hoisted_2$20 = ["d"];
|
|
5126
5139
|
//#endregion
|
|
5127
5140
|
//#region packages/client/src/components/icon/icon.vue
|
|
5128
5141
|
var icon_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -5154,13 +5167,13 @@ var icon_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5154
5167
|
"stroke-linecap": "round",
|
|
5155
5168
|
"stroke-linejoin": "round",
|
|
5156
5169
|
"aria-hidden": "true"
|
|
5157
|
-
}, [(0, vue.createElementVNode)("path", { d: definition.value.path }, null, 8, _hoisted_2$
|
|
5170
|
+
}, [(0, vue.createElementVNode)("path", { d: definition.value.path }, null, 8, _hoisted_2$20)], 12, _hoisted_1$25);
|
|
5158
5171
|
};
|
|
5159
5172
|
}
|
|
5160
5173
|
});
|
|
5161
5174
|
//#endregion
|
|
5162
5175
|
//#region packages/client/src/components/theme-toggler/index.vue?vue&type=script&setup=true&lang.ts
|
|
5163
|
-
var _hoisted_1$
|
|
5176
|
+
var _hoisted_1$24 = [
|
|
5164
5177
|
"aria-checked",
|
|
5165
5178
|
"aria-label",
|
|
5166
5179
|
"onKeydown"
|
|
@@ -5198,7 +5211,7 @@ var theme_toggler_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5198
5211
|
}, null, 8, ["model-value"]), (0, vue.createVNode)((0, vue.unref)(icon_default), {
|
|
5199
5212
|
name: isDark.value ? "moon" : "sun",
|
|
5200
5213
|
class: (0, vue.normalizeClass)(["theme-toggler__icon", isDark.value ? "is-dark" : "is-light"])
|
|
5201
|
-
}, null, 8, ["name", "class"])], 40, _hoisted_1$
|
|
5214
|
+
}, null, 8, ["name", "class"])], 40, _hoisted_1$24)) : (0, vue.createCommentVNode)("v-if", true);
|
|
5202
5215
|
};
|
|
5203
5216
|
}
|
|
5204
5217
|
});
|
|
@@ -5246,11 +5259,11 @@ var takeInlineRendererDocument = (from) => {
|
|
|
5246
5259
|
};
|
|
5247
5260
|
//#endregion
|
|
5248
5261
|
//#region packages/client/src/components/layout/default-header.vue?vue&type=script&setup=true&lang.ts
|
|
5249
|
-
var _hoisted_1$
|
|
5250
|
-
var _hoisted_2$
|
|
5251
|
-
var _hoisted_3$
|
|
5252
|
-
var _hoisted_4$
|
|
5253
|
-
var _hoisted_5$
|
|
5262
|
+
var _hoisted_1$23 = { class: "docs-header" };
|
|
5263
|
+
var _hoisted_2$19 = ["href"];
|
|
5264
|
+
var _hoisted_3$15 = ["src"];
|
|
5265
|
+
var _hoisted_4$10 = ["src"];
|
|
5266
|
+
var _hoisted_5$8 = { class: "docs-header__search" };
|
|
5254
5267
|
var _hoisted_6$5 = ["aria-label"];
|
|
5255
5268
|
var _hoisted_7$5 = ["aria-expanded"];
|
|
5256
5269
|
var _hoisted_8$5 = ["href"];
|
|
@@ -5276,7 +5289,7 @@ var _hoisted_15$1 = [
|
|
|
5276
5289
|
"aria-label"
|
|
5277
5290
|
];
|
|
5278
5291
|
var _hoisted_16$1 = { class: "docs-header__tools" };
|
|
5279
|
-
var _hoisted_17
|
|
5292
|
+
var _hoisted_17 = [
|
|
5280
5293
|
"title",
|
|
5281
5294
|
"aria-label",
|
|
5282
5295
|
"aria-expanded"
|
|
@@ -5439,7 +5452,7 @@ var default_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5439
5452
|
if (action === "database") router.push(databasePath.value);
|
|
5440
5453
|
};
|
|
5441
5454
|
return (_ctx, _cache) => {
|
|
5442
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)("header", _hoisted_1$
|
|
5455
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("header", _hoisted_1$23, [
|
|
5443
5456
|
brandExternal.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
|
|
5444
5457
|
key: 0,
|
|
5445
5458
|
class: "docs-header__brand",
|
|
@@ -5451,7 +5464,7 @@ var default_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5451
5464
|
class: "docs-header__brand-logo",
|
|
5452
5465
|
src: brandLogo.value,
|
|
5453
5466
|
alt: ""
|
|
5454
|
-
}, null, 8, _hoisted_3$
|
|
5467
|
+
}, null, 8, _hoisted_3$15)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createTextVNode)(" " + (0, vue.toDisplayString)(brandLabel.value), 1)], 8, _hoisted_2$19)) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(vue_router.RouterLink), {
|
|
5455
5468
|
key: 1,
|
|
5456
5469
|
class: "docs-header__brand",
|
|
5457
5470
|
to: brandPath.value
|
|
@@ -5461,10 +5474,10 @@ var default_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5461
5474
|
class: "docs-header__brand-logo",
|
|
5462
5475
|
src: brandLogo.value,
|
|
5463
5476
|
alt: ""
|
|
5464
|
-
}, null, 8, _hoisted_4$
|
|
5477
|
+
}, null, 8, _hoisted_4$10)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createTextVNode)(" " + (0, vue.toDisplayString)(brandLabel.value), 1)]),
|
|
5465
5478
|
_: 1
|
|
5466
5479
|
}, 8, ["to"])),
|
|
5467
|
-
(0, vue.createElementVNode)("div", _hoisted_5$
|
|
5480
|
+
(0, vue.createElementVNode)("div", _hoisted_5$8, [(0, vue.createVNode)((0, vue.unref)(trigger_default))]),
|
|
5468
5481
|
navItems.value.length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("nav", {
|
|
5469
5482
|
key: 2,
|
|
5470
5483
|
class: "docs-header__nav",
|
|
@@ -5631,7 +5644,7 @@ var default_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5631
5644
|
}, [(0, vue.createVNode)((0, vue.unref)(icon_default), {
|
|
5632
5645
|
name: "more",
|
|
5633
5646
|
size: 22
|
|
5634
|
-
})], 8, _hoisted_17
|
|
5647
|
+
})], 8, _hoisted_17)]),
|
|
5635
5648
|
_: 1
|
|
5636
5649
|
}, 8, ["modelValue"])])
|
|
5637
5650
|
])
|
|
@@ -5696,11 +5709,11 @@ var pickSidebarIconValue = (icon, selected) => {
|
|
|
5696
5709
|
};
|
|
5697
5710
|
//#endregion
|
|
5698
5711
|
//#region packages/client/src/components/layout/sidebar-glyph.vue?vue&type=script&setup=true&lang.ts
|
|
5699
|
-
var _hoisted_1$
|
|
5712
|
+
var _hoisted_1$22 = {
|
|
5700
5713
|
key: 0,
|
|
5701
5714
|
class: "docs-sidebar__icon"
|
|
5702
5715
|
};
|
|
5703
|
-
var _hoisted_2$
|
|
5716
|
+
var _hoisted_2$18 = ["src"];
|
|
5704
5717
|
//#endregion
|
|
5705
5718
|
//#region packages/client/src/components/layout/sidebar-glyph.vue
|
|
5706
5719
|
var sidebar_glyph_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -5716,12 +5729,12 @@ var sidebar_glyph_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5716
5729
|
const kind = (0, vue.computed)(() => resolveSidebarIconKind(value.value));
|
|
5717
5730
|
const src = (0, vue.computed)(() => toSidebarIconSrc(value.value));
|
|
5718
5731
|
return (_ctx, _cache) => {
|
|
5719
|
-
return value.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_1$
|
|
5732
|
+
return value.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_1$22, [kind.value === "url" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("img", {
|
|
5720
5733
|
key: 0,
|
|
5721
5734
|
class: "docs-sidebar__media",
|
|
5722
5735
|
src: src.value,
|
|
5723
5736
|
alt: ""
|
|
5724
|
-
}, null, 8, _hoisted_2$
|
|
5737
|
+
}, null, 8, _hoisted_2$18)) : kind.value === "type" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_deot_vc.Icon), {
|
|
5725
5738
|
key: 1,
|
|
5726
5739
|
class: "docs-sidebar__glyph",
|
|
5727
5740
|
type: value.value,
|
|
@@ -5732,14 +5745,14 @@ var sidebar_glyph_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5732
5745
|
});
|
|
5733
5746
|
//#endregion
|
|
5734
5747
|
//#region packages/client/src/components/layout/default-sidebar.vue?vue&type=script&setup=true&lang.ts
|
|
5735
|
-
var _hoisted_1$
|
|
5736
|
-
var _hoisted_2$
|
|
5737
|
-
var _hoisted_3$
|
|
5748
|
+
var _hoisted_1$21 = ["href"];
|
|
5749
|
+
var _hoisted_2$17 = { class: "docs-sidebar__text" };
|
|
5750
|
+
var _hoisted_3$14 = {
|
|
5738
5751
|
key: 0,
|
|
5739
5752
|
class: "docs-sidebar__tag"
|
|
5740
5753
|
};
|
|
5741
|
-
var _hoisted_4$
|
|
5742
|
-
var _hoisted_5$
|
|
5754
|
+
var _hoisted_4$9 = { class: "docs-sidebar__text" };
|
|
5755
|
+
var _hoisted_5$7 = {
|
|
5743
5756
|
key: 0,
|
|
5744
5757
|
class: "docs-sidebar__tag"
|
|
5745
5758
|
};
|
|
@@ -5787,9 +5800,9 @@ var default_sidebar_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5787
5800
|
href: item.value
|
|
5788
5801
|
}, [
|
|
5789
5802
|
(0, vue.createVNode)(sidebar_glyph_default, { item }, null, 8, ["item"]),
|
|
5790
|
-
(0, vue.createElementVNode)("span", _hoisted_2$
|
|
5791
|
-
item.tag ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_3$
|
|
5792
|
-
], 8, _hoisted_1$
|
|
5803
|
+
(0, vue.createElementVNode)("span", _hoisted_2$17, (0, vue.toDisplayString)(item.label), 1),
|
|
5804
|
+
item.tag ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_3$14, (0, vue.toDisplayString)(item.tag), 1)) : (0, vue.createCommentVNode)("v-if", true)
|
|
5805
|
+
], 8, _hoisted_1$21)) : item.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(vue_router.RouterLink), {
|
|
5793
5806
|
key: 1,
|
|
5794
5807
|
class: (0, vue.normalizeClass)(["docs-sidebar__link", { "is-active": isItemActive(item.value) }]),
|
|
5795
5808
|
to: toPath(item.value)
|
|
@@ -5799,8 +5812,8 @@ var default_sidebar_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5799
5812
|
item,
|
|
5800
5813
|
selected: isItemActive(item.value)
|
|
5801
5814
|
}, null, 8, ["item", "selected"]),
|
|
5802
|
-
(0, vue.createElementVNode)("span", _hoisted_4$
|
|
5803
|
-
item.tag ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_5$
|
|
5815
|
+
(0, vue.createElementVNode)("span", _hoisted_4$9, (0, vue.toDisplayString)(item.label), 1),
|
|
5816
|
+
item.tag ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_5$7, (0, vue.toDisplayString)(item.tag), 1)) : (0, vue.createCommentVNode)("v-if", true)
|
|
5804
5817
|
]),
|
|
5805
5818
|
_: 2
|
|
5806
5819
|
}, 1032, ["class", "to"])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_6$4, [
|
|
@@ -5819,8 +5832,8 @@ var default_sidebar_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5819
5832
|
});
|
|
5820
5833
|
//#endregion
|
|
5821
5834
|
//#region packages/client/src/components/layout/content-width-toggle.vue?vue&type=script&setup=true&lang.ts
|
|
5822
|
-
var _hoisted_1$
|
|
5823
|
-
var _hoisted_2$
|
|
5835
|
+
var _hoisted_1$20 = ["aria-label"];
|
|
5836
|
+
var _hoisted_2$16 = [
|
|
5824
5837
|
"aria-checked",
|
|
5825
5838
|
"aria-label",
|
|
5826
5839
|
"tabindex",
|
|
@@ -5887,20 +5900,20 @@ var content_width_toggle_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5887
5900
|
class: "docs-content-width__icon",
|
|
5888
5901
|
name: option.icon,
|
|
5889
5902
|
size: 12
|
|
5890
|
-
}, null, 8, ["name"])], 10, _hoisted_2$
|
|
5891
|
-
}), 128))], 40, _hoisted_1$
|
|
5903
|
+
}, null, 8, ["name"])], 10, _hoisted_2$16);
|
|
5904
|
+
}), 128))], 40, _hoisted_1$20);
|
|
5892
5905
|
};
|
|
5893
5906
|
}
|
|
5894
5907
|
});
|
|
5895
5908
|
//#endregion
|
|
5896
5909
|
//#region packages/client/src/components/layout/page-header.vue?vue&type=script&setup=true&lang.ts
|
|
5897
|
-
var _hoisted_1$
|
|
5898
|
-
var _hoisted_2$
|
|
5910
|
+
var _hoisted_1$19 = { class: "docs-page-header" };
|
|
5911
|
+
var _hoisted_2$15 = {
|
|
5899
5912
|
key: 0,
|
|
5900
5913
|
class: "docs-page-header__start"
|
|
5901
5914
|
};
|
|
5902
|
-
var _hoisted_3$
|
|
5903
|
-
var _hoisted_4$
|
|
5915
|
+
var _hoisted_3$13 = { class: "docs-page-header__eyebrow" };
|
|
5916
|
+
var _hoisted_4$8 = { class: "docs-page-header__end" };
|
|
5904
5917
|
//#endregion
|
|
5905
5918
|
//#region packages/client/src/components/layout/page-header.vue
|
|
5906
5919
|
var page_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -5914,13 +5927,13 @@ var page_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5914
5927
|
return findSidebarSection(sidebarItems.value, route.path, lang.value);
|
|
5915
5928
|
});
|
|
5916
5929
|
return (_ctx, _cache) => {
|
|
5917
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)("header", _hoisted_1$
|
|
5930
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("header", _hoisted_1$19, [section.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2$15, [(0, vue.createElementVNode)("p", _hoisted_3$13, (0, vue.toDisplayString)(section.value.label), 1)])) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createElementVNode)("div", _hoisted_4$8, [(0, vue.createVNode)(content_width_toggle_default)])]);
|
|
5918
5931
|
};
|
|
5919
5932
|
}
|
|
5920
5933
|
});
|
|
5921
5934
|
//#endregion
|
|
5922
5935
|
//#region packages/client/src/components/layout/page-footer.vue?vue&type=script&setup=true&lang.ts
|
|
5923
|
-
var _hoisted_1$
|
|
5936
|
+
var _hoisted_1$18 = ["aria-label"];
|
|
5924
5937
|
//#endregion
|
|
5925
5938
|
//#region packages/client/src/components/layout/page-footer.vue
|
|
5926
5939
|
var page_footer_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -5976,7 +5989,7 @@ var page_footer_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5976
5989
|
d: "M6.22 4.22a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1 0\n 1.06l-3.25 3.25a.75.75 0 0 1-1.06-1.06L8.94 8 6.22 5.28a.75.75 0 0 1 0-1.06Z"
|
|
5977
5990
|
})], -1))]),
|
|
5978
5991
|
_: 1
|
|
5979
|
-
}, 8, ["to", "aria-label"])) : (0, vue.createCommentVNode)("v-if", true)], 8, _hoisted_1$
|
|
5992
|
+
}, 8, ["to", "aria-label"])) : (0, vue.createCommentVNode)("v-if", true)], 8, _hoisted_1$18)) : (0, vue.createCommentVNode)("v-if", true);
|
|
5980
5993
|
};
|
|
5981
5994
|
}
|
|
5982
5995
|
});
|
|
@@ -6104,8 +6117,8 @@ var resolveOutlineScrollerHeight = (maxHeight, listSize) => {
|
|
|
6104
6117
|
};
|
|
6105
6118
|
//#endregion
|
|
6106
6119
|
//#region packages/client/src/components/layout/page-outline.vue?vue&type=script&setup=true&lang.ts
|
|
6107
|
-
var _hoisted_1$
|
|
6108
|
-
var _hoisted_2$
|
|
6120
|
+
var _hoisted_1$17 = ["aria-label"];
|
|
6121
|
+
var _hoisted_2$14 = { class: "docs-page-outline__title" };
|
|
6109
6122
|
var SCROLL_THRESHOLD = 80;
|
|
6110
6123
|
//#endregion
|
|
6111
6124
|
//#region packages/client/src/components/layout/page-outline.vue
|
|
@@ -6345,7 +6358,7 @@ var page_outline_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6345
6358
|
class: "docs-page-outline",
|
|
6346
6359
|
style: (0, vue.normalizeStyle)(rootStyle.value),
|
|
6347
6360
|
"aria-label": (0, vue.unref)(t)("client.page.outline")
|
|
6348
|
-
}, [(0, vue.createElementVNode)("p", _hoisted_2$
|
|
6361
|
+
}, [(0, vue.createElementVNode)("p", _hoisted_2$14, (0, vue.toDisplayString)((0, vue.unref)(t)("client.page.outline")), 1), (0, vue.createVNode)((0, vue.unref)(_deot_vc.Scroller), {
|
|
6349
6362
|
ref_key: "outlineScroller",
|
|
6350
6363
|
ref: outlineScroller,
|
|
6351
6364
|
class: "docs-page-outline__scroller",
|
|
@@ -6361,7 +6374,7 @@ var page_outline_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6361
6374
|
onSelect: handleSelect
|
|
6362
6375
|
}, null, 8, ["items", "active-id"])]),
|
|
6363
6376
|
_: 1
|
|
6364
|
-
}, 8, ["show-bar", "height"])], 12, _hoisted_1$
|
|
6377
|
+
}, 8, ["show-bar", "height"])], 12, _hoisted_1$17)) : (0, vue.createCommentVNode)("v-if", true);
|
|
6365
6378
|
};
|
|
6366
6379
|
}
|
|
6367
6380
|
});
|
|
@@ -6384,25 +6397,25 @@ var omitRouteQuery = (query, keys) => {
|
|
|
6384
6397
|
};
|
|
6385
6398
|
//#endregion
|
|
6386
6399
|
//#region packages/client/src/components/layout/resource-slot.vue?vue&type=script&setup=true&lang.ts
|
|
6387
|
-
var _hoisted_1$
|
|
6400
|
+
var _hoisted_1$16 = [
|
|
6388
6401
|
"data-slot",
|
|
6389
6402
|
"data-resource-type",
|
|
6390
6403
|
"data-content-width"
|
|
6391
6404
|
];
|
|
6392
|
-
var _hoisted_2$
|
|
6405
|
+
var _hoisted_2$13 = {
|
|
6393
6406
|
key: 0,
|
|
6394
6407
|
class: "docs-resource-slot__error",
|
|
6395
6408
|
role: "alert"
|
|
6396
6409
|
};
|
|
6397
|
-
var _hoisted_3$
|
|
6410
|
+
var _hoisted_3$12 = {
|
|
6398
6411
|
key: 5,
|
|
6399
6412
|
class: "docs-resource-slot__page"
|
|
6400
6413
|
};
|
|
6401
|
-
var _hoisted_4$
|
|
6414
|
+
var _hoisted_4$7 = {
|
|
6402
6415
|
key: 0,
|
|
6403
6416
|
class: "docs-resource-slot__error"
|
|
6404
6417
|
};
|
|
6405
|
-
var _hoisted_5$
|
|
6418
|
+
var _hoisted_5$6 = {
|
|
6406
6419
|
key: 6,
|
|
6407
6420
|
class: "docs-resource-slot__error"
|
|
6408
6421
|
};
|
|
@@ -6835,14 +6848,14 @@ var resource_slot_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6835
6848
|
"data-resource-type": resourceType.value || void 0,
|
|
6836
6849
|
"data-content-width": __props.name === "content" && resourceType.value === "markdown" ? (0, vue.unref)(contentWidth) : void 0,
|
|
6837
6850
|
style: (0, vue.normalizeStyle)({ minHeight: transitionMinHeight.value })
|
|
6838
|
-
}, [styleError.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2$
|
|
6851
|
+
}, [styleError.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2$13, (0, vue.toDisplayString)(styleError.value), 1)) : (0, vue.createCommentVNode)("v-if", true), builtin.value === "header" ? ((0, vue.openBlock)(), (0, vue.createBlock)(default_header_default, { key: 1 })) : builtin.value === "footer" ? ((0, vue.openBlock)(), (0, vue.createBlock)(default_footer_default, { key: 2 })) : sidebarItems.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(default_sidebar_default, {
|
|
6839
6852
|
key: 3,
|
|
6840
6853
|
items: sidebarItems.value
|
|
6841
6854
|
}, null, 8, ["items"])) : resourceType.value === "sfc" && source.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(remote_sfc_default), {
|
|
6842
6855
|
key: 4,
|
|
6843
6856
|
source: source.value,
|
|
6844
6857
|
lang: lang.value
|
|
6845
|
-
}, null, 8, ["source", "lang"])) : pageDocument.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_3$
|
|
6858
|
+
}, null, 8, ["source", "lang"])) : pageDocument.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_3$12, [error.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_4$7, (0, vue.toDisplayString)(error.value), 1)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createVNode)((0, vue.unref)(_deot_docs_renderer.Renderer), {
|
|
6846
6859
|
document: pageDocument.value,
|
|
6847
6860
|
modules: (0, vue.unref)(rendererModules),
|
|
6848
6861
|
context: rendererContext.value,
|
|
@@ -6852,7 +6865,7 @@ var resource_slot_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6852
6865
|
"modules",
|
|
6853
6866
|
"context",
|
|
6854
6867
|
"fit"
|
|
6855
|
-
])])) : error.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_5$
|
|
6868
|
+
])])) : error.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_5$6, (0, vue.toDisplayString)(error.value), 1)) : loading.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_6$3, (0, vue.toDisplayString)((0, vue.unref)(t)("client.common.loading")), 1)) : resourceType.value === "markdown" && __props.name === "content" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_7$3, [(0, vue.createElementVNode)("div", {
|
|
6856
6869
|
ref: bindArticle,
|
|
6857
6870
|
class: "docs-resource-slot__article"
|
|
6858
6871
|
}, [
|
|
@@ -6886,7 +6899,7 @@ var resource_slot_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
6886
6899
|
key: 10,
|
|
6887
6900
|
class: "docs-resource-slot__builtin",
|
|
6888
6901
|
"data-builtin": builtin.value
|
|
6889
|
-
}, null, 8, _hoisted_8$3)) : (0, vue.createCommentVNode)("v-if", true)], 12, _hoisted_1$
|
|
6902
|
+
}, null, 8, _hoisted_8$3)) : (0, vue.createCommentVNode)("v-if", true)], 12, _hoisted_1$16);
|
|
6890
6903
|
};
|
|
6891
6904
|
}
|
|
6892
6905
|
});
|
|
@@ -8005,11 +8018,11 @@ var listRendererEditorDemos = (lang) => RENDERER_EDITOR_DEMOS.map((name) => ({
|
|
|
8005
8018
|
var createRendererEditorDemoDocument = (demo, lang) => factories[demo](lang);
|
|
8006
8019
|
//#endregion
|
|
8007
8020
|
//#region packages/client/src/app.vue?vue&type=script&setup=true&lang.ts
|
|
8008
|
-
var _hoisted_1$
|
|
8009
|
-
var _hoisted_2$
|
|
8010
|
-
var _hoisted_3$
|
|
8011
|
-
var _hoisted_4$
|
|
8012
|
-
var _hoisted_5$
|
|
8021
|
+
var _hoisted_1$15 = { class: "docs-app__header" };
|
|
8022
|
+
var _hoisted_2$12 = ["aria-label", "aria-expanded"];
|
|
8023
|
+
var _hoisted_3$11 = ["aria-label"];
|
|
8024
|
+
var _hoisted_4$6 = { class: "docs-layout__main" };
|
|
8025
|
+
var _hoisted_5$5 = { class: "docs-layout__footer" };
|
|
8013
8026
|
//#endregion
|
|
8014
8027
|
//#region packages/client/src/app.vue
|
|
8015
8028
|
var app_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -8066,14 +8079,14 @@ var app_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8066
8079
|
"docs-app--mobile-sidebar-open": mobileSidebarOpen.value
|
|
8067
8080
|
}]),
|
|
8068
8081
|
onKeydown: (0, vue.withKeys)(closeMobileSidebar, ["esc"])
|
|
8069
|
-
}, [(0, vue.createElementVNode)("div", _hoisted_1$
|
|
8082
|
+
}, [(0, vue.createElementVNode)("div", _hoisted_1$15, [(0, vue.createElementVNode)("button", {
|
|
8070
8083
|
type: "button",
|
|
8071
8084
|
class: (0, vue.normalizeClass)(["docs-app__sidebar-toggle", { "is-open": mobileSidebarOpen.value }]),
|
|
8072
8085
|
"aria-label": (0, vue.unref)(t)(mobileSidebarOpen.value ? "client.header.closeSidebar" : "client.header.openSidebar"),
|
|
8073
8086
|
"aria-expanded": mobileSidebarOpen.value,
|
|
8074
8087
|
"aria-controls": "docs-mobile-sidebar",
|
|
8075
8088
|
onClick: toggleMobileSidebar
|
|
8076
|
-
}, [(0, vue.createVNode)((0, vue.unref)(icon_default), { name: mobileSidebarOpen.value ? "close" : "menu" }, null, 8, ["name"])], 10, _hoisted_2$
|
|
8089
|
+
}, [(0, vue.createVNode)((0, vue.unref)(icon_default), { name: mobileSidebarOpen.value ? "close" : "menu" }, null, 8, ["name"])], 10, _hoisted_2$12), (0, vue.createVNode)((0, vue.unref)(resource_slot_default), { name: "header" })]), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(["docs-layout", {
|
|
8077
8090
|
"docs-layout--database": isUtilityShell.value,
|
|
8078
8091
|
"docs-layout--editor": isEditorShell.value,
|
|
8079
8092
|
"docs-layout--home": (0, vue.unref)(route).meta?.docsHome
|
|
@@ -8098,7 +8111,7 @@ var app_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8098
8111
|
class: "docs-layout__sidebar-mask",
|
|
8099
8112
|
"aria-label": (0, vue.unref)(t)("client.header.closeSidebar"),
|
|
8100
8113
|
onClick: closeMobileSidebar
|
|
8101
|
-
}, null, 8, _hoisted_3$
|
|
8114
|
+
}, null, 8, _hoisted_3$11),
|
|
8102
8115
|
(0, vue.createVNode)((0, vue.unref)(_deot_vc.Scroller), {
|
|
8103
8116
|
ref_key: "mainScroller",
|
|
8104
8117
|
ref: mainScroller,
|
|
@@ -8115,12 +8128,12 @@ var app_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8115
8128
|
class: "docs-layout__rail docs-layout__rail--start",
|
|
8116
8129
|
"aria-hidden": "true"
|
|
8117
8130
|
}, null, -1)),
|
|
8118
|
-
(0, vue.createElementVNode)("main", _hoisted_4$
|
|
8131
|
+
(0, vue.createElementVNode)("main", _hoisted_4$6, [(0, vue.createVNode)((0, vue.unref)(vue_router.RouterView)), (0, vue.createVNode)((0, vue.unref)(vue_router.RouterView), { name: "extra" })]),
|
|
8119
8132
|
_cache[1] || (_cache[1] = (0, vue.createElementVNode)("div", {
|
|
8120
8133
|
class: "docs-layout__rail docs-layout__rail--end",
|
|
8121
8134
|
"aria-hidden": "true"
|
|
8122
8135
|
}, null, -1)),
|
|
8123
|
-
(0, vue.createElementVNode)("div", _hoisted_5$
|
|
8136
|
+
(0, vue.createElementVNode)("div", _hoisted_5$5, [(0, vue.createVNode)((0, vue.unref)(resource_slot_default), { name: "footer" })])
|
|
8124
8137
|
]),
|
|
8125
8138
|
_: 1
|
|
8126
8139
|
}, 512)
|
|
@@ -8248,16 +8261,16 @@ var prune = async () => {
|
|
|
8248
8261
|
};
|
|
8249
8262
|
//#endregion
|
|
8250
8263
|
//#region packages/client/src/components/paging/filter/filter-item.vue?vue&type=script&setup=true&lang.ts
|
|
8251
|
-
var _hoisted_1$
|
|
8252
|
-
var _hoisted_2$
|
|
8264
|
+
var _hoisted_1$14 = { class: "docs-paging-filter-item" };
|
|
8265
|
+
var _hoisted_2$11 = {
|
|
8253
8266
|
key: 0,
|
|
8254
8267
|
class: "docs-paging-filter-item__label"
|
|
8255
8268
|
};
|
|
8256
|
-
var _hoisted_3$
|
|
8269
|
+
var _hoisted_3$10 = {
|
|
8257
8270
|
key: 1,
|
|
8258
8271
|
class: "docs-paging-filter-item__range"
|
|
8259
8272
|
};
|
|
8260
|
-
var _hoisted_4$
|
|
8273
|
+
var _hoisted_4$5 = { class: "docs-paging-filter-item__separator" };
|
|
8261
8274
|
//#endregion
|
|
8262
8275
|
//#region packages/client/src/components/paging/filter/filter-item.vue
|
|
8263
8276
|
var filter_item_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -8306,7 +8319,7 @@ var filter_item_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8306
8319
|
emit("search");
|
|
8307
8320
|
};
|
|
8308
8321
|
return (_ctx, _cache) => {
|
|
8309
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$
|
|
8322
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$14, [__props.module.label ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_2$11, (0, vue.toDisplayString)(__props.module.label), 1)) : (0, vue.createCommentVNode)("v-if", true), __props.module.type === "range" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_3$10, [
|
|
8310
8323
|
(0, vue.createVNode)((0, vue.unref)(_deot_vc.InputNumber), (0, vue.mergeProps)({
|
|
8311
8324
|
"model-value": getNumberValue(__props.startValue),
|
|
8312
8325
|
"data-filter": __props.module.field[0],
|
|
@@ -8319,7 +8332,7 @@ var filter_item_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8319
8332
|
"data-filter",
|
|
8320
8333
|
"placeholder"
|
|
8321
8334
|
]),
|
|
8322
|
-
(0, vue.createElementVNode)("span", _hoisted_4$
|
|
8335
|
+
(0, vue.createElementVNode)("span", _hoisted_4$5, (0, vue.toDisplayString)(__props.module.separator || "-"), 1),
|
|
8323
8336
|
(0, vue.createVNode)((0, vue.unref)(_deot_vc.InputNumber), (0, vue.mergeProps)({
|
|
8324
8337
|
"model-value": getNumberValue(__props.endValue),
|
|
8325
8338
|
"data-filter": __props.module.field[1],
|
|
@@ -8382,8 +8395,8 @@ var filter_item_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8382
8395
|
});
|
|
8383
8396
|
//#endregion
|
|
8384
8397
|
//#region packages/client/src/components/paging/filter/index.vue?vue&type=script&setup=true&lang.ts
|
|
8385
|
-
var _hoisted_1$
|
|
8386
|
-
var _hoisted_2$
|
|
8398
|
+
var _hoisted_1$13 = { class: "docs-paging-filter" };
|
|
8399
|
+
var _hoisted_2$10 = { class: "docs-paging-filter__operate" };
|
|
8387
8400
|
//#endregion
|
|
8388
8401
|
//#region packages/client/src/components/paging/filter/index.vue
|
|
8389
8402
|
var filter_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -8437,7 +8450,7 @@ var filter_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8437
8450
|
emit("search", value);
|
|
8438
8451
|
};
|
|
8439
8452
|
return (_ctx, _cache) => {
|
|
8440
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$
|
|
8453
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$13, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.modules, (module) => {
|
|
8441
8454
|
return (0, vue.openBlock)(), (0, vue.createBlock)(filter_item_default, {
|
|
8442
8455
|
key: getModuleKey(module),
|
|
8443
8456
|
module,
|
|
@@ -8457,7 +8470,7 @@ var filter_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8457
8470
|
"onUpdate:startValue",
|
|
8458
8471
|
"onUpdate:endValue"
|
|
8459
8472
|
]);
|
|
8460
|
-
}), 128)), (0, vue.createElementVNode)("div", _hoisted_2$
|
|
8473
|
+
}), 128)), (0, vue.createElementVNode)("div", _hoisted_2$10, [(0, vue.createVNode)((0, vue.unref)(_deot_vc.Button), {
|
|
8461
8474
|
type: "primary",
|
|
8462
8475
|
onClick: handleSearch
|
|
8463
8476
|
}, {
|
|
@@ -8472,9 +8485,9 @@ var filter_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8472
8485
|
});
|
|
8473
8486
|
//#endregion
|
|
8474
8487
|
//#region packages/client/src/components/paging/paging.vue?vue&type=script&setup=true&lang.ts
|
|
8475
|
-
var _hoisted_1$
|
|
8476
|
-
var _hoisted_2$
|
|
8477
|
-
var _hoisted_3$
|
|
8488
|
+
var _hoisted_1$12 = { class: "docs-paging" };
|
|
8489
|
+
var _hoisted_2$9 = { class: "docs-paging__pagination" };
|
|
8490
|
+
var _hoisted_3$9 = { class: "docs-paging__pagination-control" };
|
|
8478
8491
|
//#endregion
|
|
8479
8492
|
//#region packages/client/src/components/paging/paging.vue
|
|
8480
8493
|
var paging_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -8620,7 +8633,7 @@ var paging_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8620
8633
|
refreshAffix
|
|
8621
8634
|
});
|
|
8622
8635
|
return (_ctx, _cache) => {
|
|
8623
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$
|
|
8636
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$12, [
|
|
8624
8637
|
__props.filterModules.length ? ((0, vue.openBlock)(), (0, vue.createBlock)(filter_default, {
|
|
8625
8638
|
key: 0,
|
|
8626
8639
|
modules: __props.filterModules,
|
|
@@ -8654,12 +8667,12 @@ var paging_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8654
8667
|
ref_key: "footerAffix",
|
|
8655
8668
|
ref: footerAffix
|
|
8656
8669
|
}, affixOptions.value[1]), {
|
|
8657
|
-
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("footer", _hoisted_2$
|
|
8670
|
+
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("footer", _hoisted_2$9, [(0, vue.renderSlot)(_ctx.$slots, "footer-extra", {
|
|
8658
8671
|
current: current.value,
|
|
8659
8672
|
pageSize: pageSize.value,
|
|
8660
8673
|
total: total.value,
|
|
8661
8674
|
loading: loading.value
|
|
8662
|
-
}), (0, vue.createElementVNode)("div", _hoisted_3$
|
|
8675
|
+
}), (0, vue.createElementVNode)("div", _hoisted_3$9, [(0, vue.createVNode)((0, vue.unref)(_deot_vc.Pagination), {
|
|
8663
8676
|
count: total.value,
|
|
8664
8677
|
current: current.value,
|
|
8665
8678
|
"page-size": pageSize.value,
|
|
@@ -8683,7 +8696,7 @@ var paging_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8683
8696
|
});
|
|
8684
8697
|
//#endregion
|
|
8685
8698
|
//#region packages/client/src/components/tag/tag.vue?vue&type=script&setup=true&lang.ts
|
|
8686
|
-
var _hoisted_1$
|
|
8699
|
+
var _hoisted_1$11 = ["data-type"];
|
|
8687
8700
|
//#endregion
|
|
8688
8701
|
//#region packages/client/src/components/tag/tag.vue
|
|
8689
8702
|
var tag_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -8728,17 +8741,17 @@ var tag_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8728
8741
|
backgroundColor: currentColor.value[0],
|
|
8729
8742
|
color: currentColor.value[1]
|
|
8730
8743
|
})
|
|
8731
|
-
}, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(["docs-tag__label", { "docs-tag__label--ellipsis": __props.ellipsis }]) }, [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(currentLabel.value), 1)])], 2)], 12, _hoisted_1$
|
|
8744
|
+
}, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(["docs-tag__label", { "docs-tag__label--ellipsis": __props.ellipsis }]) }, [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(currentLabel.value), 1)])], 2)], 12, _hoisted_1$11);
|
|
8732
8745
|
};
|
|
8733
8746
|
}
|
|
8734
8747
|
});
|
|
8735
8748
|
//#endregion
|
|
8736
8749
|
//#region packages/client/src/pages/database/index.vue?vue&type=script&setup=true&lang.ts
|
|
8737
|
-
var _hoisted_1$
|
|
8738
|
-
var _hoisted_2$
|
|
8739
|
-
var _hoisted_3$
|
|
8740
|
-
var _hoisted_4$
|
|
8741
|
-
var _hoisted_5$
|
|
8750
|
+
var _hoisted_1$10 = { class: "docs-database" };
|
|
8751
|
+
var _hoisted_2$8 = { class: "docs-database__header" };
|
|
8752
|
+
var _hoisted_3$8 = ["title"];
|
|
8753
|
+
var _hoisted_4$4 = { class: "docs-database__toolbar" };
|
|
8754
|
+
var _hoisted_5$4 = { class: "docs-database__toolbar-primary" };
|
|
8742
8755
|
var _hoisted_6$2 = { class: "docs-database__button-content" };
|
|
8743
8756
|
var _hoisted_7$2 = { class: "docs-database__button-content" };
|
|
8744
8757
|
var _hoisted_8$2 = { class: "docs-database__columns" };
|
|
@@ -8974,11 +8987,11 @@ var database_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
8974
8987
|
statusRefreshTimer = void 0;
|
|
8975
8988
|
});
|
|
8976
8989
|
return (_ctx, _cache) => {
|
|
8977
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)("section", _hoisted_1$
|
|
8990
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("section", _hoisted_1$10, [(0, vue.createElementVNode)("header", _hoisted_2$8, [(0, vue.createElementVNode)("div", null, [(0, vue.createElementVNode)("h1", null, (0, vue.toDisplayString)((0, vue.unref)(t)("client.database.title")), 1), (0, vue.createElementVNode)("p", null, [
|
|
8978
8991
|
(0, vue.createTextVNode)(" deot-docs / resources · " + (0, vue.toDisplayString)((0, vue.unref)(t)("client.database.records", { count: records.value.length })) + " · ", 1),
|
|
8979
|
-
(0, vue.createElementVNode)("span", { title: (0, vue.unref)(currentNamespace) }, (0, vue.toDisplayString)((0, vue.unref)(currentNamespace)), 9, _hoisted_3$
|
|
8992
|
+
(0, vue.createElementVNode)("span", { title: (0, vue.unref)(currentNamespace) }, (0, vue.toDisplayString)((0, vue.unref)(currentNamespace)), 9, _hoisted_3$8),
|
|
8980
8993
|
(0, vue.createTextVNode)(" " + (0, vue.toDisplayString)((0, vue.unref)(t)("client.database.cache", { size: namespaceCacheSize.value })), 1)
|
|
8981
|
-
])]), (0, vue.createElementVNode)("div", _hoisted_4$
|
|
8994
|
+
])]), (0, vue.createElementVNode)("div", _hoisted_4$4, [(0, vue.createElementVNode)("div", _hoisted_5$4, [
|
|
8982
8995
|
(0, vue.createVNode)((0, vue.unref)(_deot_vc.Button), {
|
|
8983
8996
|
type: "primary",
|
|
8984
8997
|
disabled: loading.value,
|
|
@@ -9228,14 +9241,14 @@ var database_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9228
9241
|
});
|
|
9229
9242
|
//#endregion
|
|
9230
9243
|
//#region packages/client/src/pages/renderer-editor-demos/components/card.vue?vue&type=script&setup=true&lang.ts
|
|
9231
|
-
var _hoisted_1$
|
|
9232
|
-
var _hoisted_2$
|
|
9233
|
-
var _hoisted_3$
|
|
9234
|
-
var _hoisted_4$
|
|
9244
|
+
var _hoisted_1$9 = { class: "docs-renderer-editor-demos-card__name" };
|
|
9245
|
+
var _hoisted_2$7 = { class: "docs-renderer-editor-demos-card__title" };
|
|
9246
|
+
var _hoisted_3$7 = { class: "docs-renderer-editor-demos-card__desc" };
|
|
9247
|
+
var _hoisted_4$3 = {
|
|
9235
9248
|
key: 0,
|
|
9236
9249
|
class: "docs-renderer-editor-demos-card__modules"
|
|
9237
9250
|
};
|
|
9238
|
-
var _hoisted_5$
|
|
9251
|
+
var _hoisted_5$3 = { class: "docs-renderer-editor-demos-card__action" };
|
|
9239
9252
|
//#endregion
|
|
9240
9253
|
//#region packages/client/src/pages/renderer-editor-demos/components/card.vue
|
|
9241
9254
|
var card_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -9259,22 +9272,22 @@ var card_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9259
9272
|
class: "docs-renderer-editor-demos-card__accent",
|
|
9260
9273
|
"aria-hidden": "true"
|
|
9261
9274
|
}, null, -1)),
|
|
9262
|
-
(0, vue.createElementVNode)("span", _hoisted_1$
|
|
9263
|
-
(0, vue.createElementVNode)("strong", _hoisted_2$
|
|
9264
|
-
(0, vue.createElementVNode)("p", _hoisted_3$
|
|
9265
|
-
__props.item.modules.length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("ul", _hoisted_4$
|
|
9275
|
+
(0, vue.createElementVNode)("span", _hoisted_1$9, (0, vue.toDisplayString)(__props.item.name), 1),
|
|
9276
|
+
(0, vue.createElementVNode)("strong", _hoisted_2$7, (0, vue.toDisplayString)(__props.item.title), 1),
|
|
9277
|
+
(0, vue.createElementVNode)("p", _hoisted_3$7, (0, vue.toDisplayString)(__props.item.description), 1),
|
|
9278
|
+
__props.item.modules.length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("ul", _hoisted_4$3, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.item.modules, (type) => {
|
|
9266
9279
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("li", { key: type }, (0, vue.toDisplayString)(type), 1);
|
|
9267
9280
|
}), 128))])) : (0, vue.createCommentVNode)("v-if", true),
|
|
9268
|
-
(0, vue.createElementVNode)("span", _hoisted_5$
|
|
9281
|
+
(0, vue.createElementVNode)("span", _hoisted_5$3, (0, vue.toDisplayString)(__props.action || (0, vue.unref)(t)("client.demos.open")), 1)
|
|
9269
9282
|
], 4);
|
|
9270
9283
|
};
|
|
9271
9284
|
}
|
|
9272
9285
|
});
|
|
9273
9286
|
//#endregion
|
|
9274
9287
|
//#region packages/client/src/pages/renderer-editor-demos/components/gallery.vue?vue&type=script&setup=true&lang.ts
|
|
9275
|
-
var _hoisted_1$
|
|
9276
|
-
var _hoisted_2$
|
|
9277
|
-
var _hoisted_3$
|
|
9288
|
+
var _hoisted_1$8 = { class: "docs-renderer-editor-demos-gallery" };
|
|
9289
|
+
var _hoisted_2$6 = { class: "docs-renderer-editor-demos-gallery__intro" };
|
|
9290
|
+
var _hoisted_3$6 = { class: "docs-renderer-editor-demos-gallery__grid" };
|
|
9278
9291
|
//#endregion
|
|
9279
9292
|
//#region packages/client/src/pages/renderer-editor-demos/components/gallery.vue
|
|
9280
9293
|
var gallery_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -9295,7 +9308,7 @@ var gallery_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9295
9308
|
if (isRendererEditorDemo(name)) emit("open", name);
|
|
9296
9309
|
};
|
|
9297
9310
|
return (_ctx, _cache) => {
|
|
9298
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)("section", _hoisted_1$
|
|
9311
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("section", _hoisted_1$8, [(0, vue.createElementVNode)("header", _hoisted_2$6, [(0, vue.createElementVNode)("h1", null, (0, vue.toDisplayString)((0, vue.unref)(t)("client.demos.title")), 1), (0, vue.createElementVNode)("p", null, (0, vue.toDisplayString)((0, vue.unref)(t)("client.demos.subtitle")), 1)]), (0, vue.createElementVNode)("div", _hoisted_3$6, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(items.value, (item) => {
|
|
9299
9312
|
return (0, vue.openBlock)(), (0, vue.createBlock)(card_default, {
|
|
9300
9313
|
key: item.name,
|
|
9301
9314
|
item,
|
|
@@ -9311,7 +9324,7 @@ var gallery_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9311
9324
|
});
|
|
9312
9325
|
//#endregion
|
|
9313
9326
|
//#region packages/client/src/pages/renderer-editor-demos/components/stage.vue?vue&type=script&setup=true&lang.ts
|
|
9314
|
-
var _hoisted_1$
|
|
9327
|
+
var _hoisted_1$7 = { class: "docs-renderer-editor-demos-stage" };
|
|
9315
9328
|
//#endregion
|
|
9316
9329
|
//#region packages/client/src/pages/renderer-editor-demos/components/stage.vue
|
|
9317
9330
|
var stage_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -9374,7 +9387,7 @@ var stage_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9374
9387
|
document.value = createRendererEditorDemoDocument(props.name, lang.value);
|
|
9375
9388
|
}, { immediate: true });
|
|
9376
9389
|
return (_ctx, _cache) => {
|
|
9377
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$
|
|
9390
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$7, [document.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_deot_docs_renderer.Combo), {
|
|
9378
9391
|
key: 0,
|
|
9379
9392
|
modelValue: document.value,
|
|
9380
9393
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => document.value = $event),
|
|
@@ -9434,12 +9447,12 @@ var renderer_editor_demos_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9434
9447
|
});
|
|
9435
9448
|
//#endregion
|
|
9436
9449
|
//#region packages/client/src/pages/renderer-editor/index.vue?vue&type=script&setup=true&lang.ts
|
|
9437
|
-
var _hoisted_1$
|
|
9438
|
-
var _hoisted_2$
|
|
9450
|
+
var _hoisted_1$6 = { class: "docs-renderer-editor-page" };
|
|
9451
|
+
var _hoisted_2$5 = {
|
|
9439
9452
|
key: 0,
|
|
9440
9453
|
class: "docs-renderer-editor-page__error"
|
|
9441
9454
|
};
|
|
9442
|
-
var _hoisted_3$
|
|
9455
|
+
var _hoisted_3$5 = {
|
|
9443
9456
|
key: 1,
|
|
9444
9457
|
class: "docs-renderer-editor-page__loading"
|
|
9445
9458
|
};
|
|
@@ -9642,7 +9655,7 @@ var renderer_editor_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9642
9655
|
controller?.abort();
|
|
9643
9656
|
});
|
|
9644
9657
|
return (_ctx, _cache) => {
|
|
9645
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$
|
|
9658
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$6, [error.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2$5, (0, vue.toDisplayString)(error.value), 1)) : loading.value || !document.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_3$5, (0, vue.toDisplayString)((0, vue.unref)(t)("client.common.loading")), 1)) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_deot_docs_renderer.Combo), {
|
|
9646
9659
|
key: 2,
|
|
9647
9660
|
modelValue: document.value,
|
|
9648
9661
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => document.value = $event),
|
|
@@ -9662,12 +9675,12 @@ var renderer_editor_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9662
9675
|
});
|
|
9663
9676
|
//#endregion
|
|
9664
9677
|
//#region packages/client/src/pages/home/index.vue?vue&type=script&setup=true&lang.ts
|
|
9665
|
-
var _hoisted_1$
|
|
9666
|
-
var _hoisted_2$
|
|
9678
|
+
var _hoisted_1$5 = { class: "docs-home" };
|
|
9679
|
+
var _hoisted_2$4 = {
|
|
9667
9680
|
key: 0,
|
|
9668
9681
|
class: "docs-home__error"
|
|
9669
9682
|
};
|
|
9670
|
-
var _hoisted_3$
|
|
9683
|
+
var _hoisted_3$4 = {
|
|
9671
9684
|
key: 2,
|
|
9672
9685
|
class: "docs-home__loading"
|
|
9673
9686
|
};
|
|
@@ -9763,7 +9776,7 @@ var home_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9763
9776
|
unsubscribe?.();
|
|
9764
9777
|
});
|
|
9765
9778
|
return (_ctx, _cache) => {
|
|
9766
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)("section", _hoisted_1$
|
|
9779
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("section", _hoisted_1$5, [error.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2$4, (0, vue.toDisplayString)(error.value), 1)) : (0, vue.createCommentVNode)("v-if", true), document.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_deot_docs_renderer.Renderer), {
|
|
9767
9780
|
key: 1,
|
|
9768
9781
|
document: document.value,
|
|
9769
9782
|
modules: (0, vue.unref)(rendererModules),
|
|
@@ -9774,7 +9787,7 @@ var home_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9774
9787
|
"modules",
|
|
9775
9788
|
"context",
|
|
9776
9789
|
"fit"
|
|
9777
|
-
])) : loading.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_3$
|
|
9790
|
+
])) : loading.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_3$4, (0, vue.toDisplayString)((0, vue.unref)(t)("client.common.loading")), 1)) : (0, vue.createCommentVNode)("v-if", true)]);
|
|
9778
9791
|
};
|
|
9779
9792
|
}
|
|
9780
9793
|
});
|
|
@@ -9790,12 +9803,12 @@ var retry = async (row) => Resource.playground.retry(getNamespace(), row);
|
|
|
9790
9803
|
var subscribeStatus = (listener) => Resource.playground.subscribeStatus(listener);
|
|
9791
9804
|
//#endregion
|
|
9792
9805
|
//#region packages/client/src/pages/playground-resource/components/source-editor.vue?vue&type=script&setup=true&lang.ts
|
|
9793
|
-
var _hoisted_1$
|
|
9794
|
-
var _hoisted_2$
|
|
9795
|
-
var _hoisted_3$
|
|
9806
|
+
var _hoisted_1$4 = { class: "docs-playground-resource-source-editor__meta" };
|
|
9807
|
+
var _hoisted_2$3 = ["title"];
|
|
9808
|
+
var _hoisted_3$3 = { class: "docs-playground-resource-source-editor__label" };
|
|
9796
9809
|
//#endregion
|
|
9797
9810
|
//#region packages/client/src/pages/playground-resource/components/source-editor.vue
|
|
9798
|
-
var source_editor_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
9811
|
+
var source_editor_default$1 = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
9799
9812
|
__name: "source-editor",
|
|
9800
9813
|
props: {
|
|
9801
9814
|
row: {},
|
|
@@ -9834,15 +9847,15 @@ var source_editor_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9834
9847
|
onClose: handleClose
|
|
9835
9848
|
}, {
|
|
9836
9849
|
default: (0, vue.withCtx)(() => [
|
|
9837
|
-
(0, vue.createElementVNode)("div", _hoisted_1$
|
|
9850
|
+
(0, vue.createElementVNode)("div", _hoisted_1$4, [
|
|
9838
9851
|
(0, vue.createElementVNode)("p", null, [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("client.playgroundResource.kind")), 1), (0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(["docs-playground-resource__kind", { "is-style": __props.row.kind === "style" }]) }, (0, vue.toDisplayString)(kindLabel.value), 3)]),
|
|
9839
9852
|
(0, vue.createElementVNode)("p", null, [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("client.playgroundResource.alias")), 1), (0, vue.createElementVNode)("code", null, (0, vue.toDisplayString)(__props.row.alias), 1)]),
|
|
9840
9853
|
(0, vue.createElementVNode)("p", null, [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("client.playgroundResource.defaultUrl")), 1), (0, vue.createElementVNode)("code", {
|
|
9841
9854
|
class: "docs-playground-resource__ellipsis",
|
|
9842
9855
|
title: __props.row.defaultUrl || "-"
|
|
9843
|
-
}, (0, vue.toDisplayString)(__props.row.defaultUrl || "-"), 9, _hoisted_2$
|
|
9856
|
+
}, (0, vue.toDisplayString)(__props.row.defaultUrl || "-"), 9, _hoisted_2$3)])
|
|
9844
9857
|
]),
|
|
9845
|
-
(0, vue.createElementVNode)("label", _hoisted_3$
|
|
9858
|
+
(0, vue.createElementVNode)("label", _hoisted_3$3, (0, vue.toDisplayString)((0, vue.unref)(t)("client.playgroundResource.currentUrl")), 1),
|
|
9846
9859
|
(0, vue.createVNode)((0, vue.unref)(_deot_vc.Textarea), {
|
|
9847
9860
|
modelValue: draft.value,
|
|
9848
9861
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => draft.value = $event),
|
|
@@ -9860,18 +9873,18 @@ var source_editor_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
9860
9873
|
/**
|
|
9861
9874
|
* Playground 资源地址编辑弹层。与搜索/预览一致:单例先销毁旧实例,再打开新会话。
|
|
9862
9875
|
*/
|
|
9863
|
-
var SourceEditor = new _deot_vc.Portal(source_editor_default, {
|
|
9876
|
+
var SourceEditor = new _deot_vc.Portal(source_editor_default$1, {
|
|
9864
9877
|
name: "docs-playground-resource-source-editor",
|
|
9865
9878
|
leaveDelay: 0,
|
|
9866
9879
|
multiple: false
|
|
9867
9880
|
});
|
|
9868
9881
|
//#endregion
|
|
9869
9882
|
//#region packages/client/src/pages/playground-resource/index.vue?vue&type=script&setup=true&lang.ts
|
|
9870
|
-
var _hoisted_1$
|
|
9871
|
-
var _hoisted_2$
|
|
9872
|
-
var _hoisted_3$
|
|
9873
|
-
var _hoisted_4$
|
|
9874
|
-
var _hoisted_5$
|
|
9883
|
+
var _hoisted_1$3 = { class: "docs-playground-resource" };
|
|
9884
|
+
var _hoisted_2$2 = { class: "docs-playground-resource__header" };
|
|
9885
|
+
var _hoisted_3$2 = ["title"];
|
|
9886
|
+
var _hoisted_4$2 = { class: "docs-playground-resource__hint" };
|
|
9887
|
+
var _hoisted_5$2 = { class: "docs-playground-resource__toolbar" };
|
|
9875
9888
|
var _hoisted_6$1 = { class: "docs-playground-resource__toolbar-primary" };
|
|
9876
9889
|
var _hoisted_7$1 = { class: "docs-playground-resource__button-content" };
|
|
9877
9890
|
var _hoisted_8$1 = { class: "docs-playground-resource__button-content" };
|
|
@@ -10105,15 +10118,15 @@ var playground_resource_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
10105
10118
|
SourceEditor.destroy();
|
|
10106
10119
|
});
|
|
10107
10120
|
return (_ctx, _cache) => {
|
|
10108
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)("section", _hoisted_1$
|
|
10121
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("section", _hoisted_1$3, [(0, vue.createElementVNode)("header", _hoisted_2$2, [(0, vue.createElementVNode)("div", null, [
|
|
10109
10122
|
(0, vue.createElementVNode)("h1", null, (0, vue.toDisplayString)((0, vue.unref)(t)("client.playgroundResource.title")), 1),
|
|
10110
10123
|
(0, vue.createElementVNode)("p", null, [
|
|
10111
10124
|
(0, vue.createTextVNode)(" deot-docs-playground-resource / resources · " + (0, vue.toDisplayString)((0, vue.unref)(t)("client.playgroundResource.records", { count: rows.value.length })) + " · ", 1),
|
|
10112
|
-
(0, vue.createElementVNode)("span", { title: (0, vue.unref)(currentNamespace) }, (0, vue.toDisplayString)((0, vue.unref)(currentNamespace)), 9, _hoisted_3$
|
|
10125
|
+
(0, vue.createElementVNode)("span", { title: (0, vue.unref)(currentNamespace) }, (0, vue.toDisplayString)((0, vue.unref)(currentNamespace)), 9, _hoisted_3$2),
|
|
10113
10126
|
(0, vue.createTextVNode)(" " + (0, vue.toDisplayString)((0, vue.unref)(t)("client.playgroundResource.cache", { size: namespaceCacheSize.value })), 1)
|
|
10114
10127
|
]),
|
|
10115
|
-
(0, vue.createElementVNode)("p", _hoisted_4$
|
|
10116
|
-
]), (0, vue.createElementVNode)("div", _hoisted_5$
|
|
10128
|
+
(0, vue.createElementVNode)("p", _hoisted_4$2, (0, vue.toDisplayString)((0, vue.unref)(t)("client.playgroundResource.hint")), 1)
|
|
10129
|
+
]), (0, vue.createElementVNode)("div", _hoisted_5$2, [(0, vue.createElementVNode)("div", _hoisted_6$1, [
|
|
10117
10130
|
(0, vue.createVNode)((0, vue.unref)(_deot_vc.Button), {
|
|
10118
10131
|
type: "primary",
|
|
10119
10132
|
disabled: loading.value,
|
|
@@ -10312,195 +10325,699 @@ var playground_resource_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
10312
10325
|
}
|
|
10313
10326
|
});
|
|
10314
10327
|
//#endregion
|
|
10315
|
-
//#region packages/client/src/pages/
|
|
10316
|
-
var
|
|
10317
|
-
|
|
10318
|
-
|
|
10319
|
-
|
|
10320
|
-
|
|
10321
|
-
|
|
10322
|
-
|
|
10323
|
-
|
|
10328
|
+
//#region packages/client/src/pages/raw-editor/components/json-editor.vue
|
|
10329
|
+
var json_editor_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
10330
|
+
__name: "json-editor",
|
|
10331
|
+
props: {
|
|
10332
|
+
modelValue: {},
|
|
10333
|
+
label: {}
|
|
10334
|
+
},
|
|
10335
|
+
emits: ["update:modelValue"],
|
|
10336
|
+
setup(__props, { emit: __emit }) {
|
|
10337
|
+
const props = __props;
|
|
10338
|
+
const emit = __emit;
|
|
10339
|
+
const host = (0, vue.ref)();
|
|
10340
|
+
const theme = new _codemirror_state.Compartment();
|
|
10341
|
+
const attributes = new _codemirror_state.Compartment();
|
|
10342
|
+
let editor;
|
|
10343
|
+
const editorTheme = () => codemirror.EditorView.theme({}, { dark: Theme.current.value === "dark" });
|
|
10344
|
+
const editorAttributes = () => codemirror.EditorView.contentAttributes.of({ "aria-label": props.label });
|
|
10345
|
+
(0, vue.onMounted)(() => {
|
|
10346
|
+
editor = new codemirror.EditorView({
|
|
10347
|
+
parent: host.value,
|
|
10348
|
+
state: _codemirror_state.EditorState.create({
|
|
10349
|
+
doc: props.modelValue,
|
|
10350
|
+
extensions: [
|
|
10351
|
+
codemirror.basicSetup,
|
|
10352
|
+
(0, _codemirror_lang_json.json)(),
|
|
10353
|
+
codemirror.EditorView.lineWrapping,
|
|
10354
|
+
theme.of(editorTheme()),
|
|
10355
|
+
attributes.of(editorAttributes()),
|
|
10356
|
+
codemirror.EditorView.updateListener.of((update) => {
|
|
10357
|
+
if (!update.docChanged) return;
|
|
10358
|
+
const value = update.state.doc.toString();
|
|
10359
|
+
if (value !== props.modelValue) emit("update:modelValue", value);
|
|
10360
|
+
})
|
|
10361
|
+
]
|
|
10362
|
+
})
|
|
10363
|
+
});
|
|
10364
|
+
});
|
|
10365
|
+
(0, vue.watch)(() => props.modelValue, (value) => {
|
|
10366
|
+
if (!editor || value === editor.state.doc.toString()) return;
|
|
10367
|
+
editor.dispatch({ changes: {
|
|
10368
|
+
from: 0,
|
|
10369
|
+
to: editor.state.doc.length,
|
|
10370
|
+
insert: value
|
|
10371
|
+
} });
|
|
10372
|
+
});
|
|
10373
|
+
(0, vue.watch)(Theme.current, () => editor?.dispatch({ effects: theme.reconfigure(editorTheme()) }));
|
|
10374
|
+
(0, vue.watch)(() => props.label, () => editor?.dispatch({ effects: attributes.reconfigure(editorAttributes()) }));
|
|
10375
|
+
(0, vue.onBeforeUnmount)(() => editor?.destroy());
|
|
10376
|
+
return (_ctx, _cache) => {
|
|
10377
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_deot_vc.Scroller), {
|
|
10378
|
+
class: "docs-raw-editor-json-editor",
|
|
10379
|
+
native: false,
|
|
10380
|
+
wheel: false,
|
|
10381
|
+
"auto-resize": true,
|
|
10382
|
+
always: true,
|
|
10383
|
+
height: "100%"
|
|
10384
|
+
}, {
|
|
10385
|
+
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
|
|
10386
|
+
ref_key: "host",
|
|
10387
|
+
ref: host,
|
|
10388
|
+
class: "docs-raw-editor-json-editor__host"
|
|
10389
|
+
}, null, 512)]),
|
|
10390
|
+
_: 1
|
|
10391
|
+
});
|
|
10392
|
+
};
|
|
10393
|
+
}
|
|
10394
|
+
});
|
|
10395
|
+
//#endregion
|
|
10396
|
+
//#region packages/client/src/pages/raw-editor/index.vue?vue&type=script&setup=true&lang.ts
|
|
10397
|
+
var _hoisted_1$2 = { class: "docs-raw-editor" };
|
|
10398
|
+
var _hoisted_2$1 = { class: "docs-raw-editor__import" };
|
|
10399
|
+
var _hoisted_3$1 = { for: "raw-import" };
|
|
10400
|
+
var _hoisted_4$1 = { class: "docs-raw-editor__actions" };
|
|
10401
|
+
var _hoisted_5$1 = ["placeholder"];
|
|
10402
|
+
var _hoisted_6 = ["disabled"];
|
|
10403
|
+
var _hoisted_7 = {
|
|
10324
10404
|
key: 0,
|
|
10325
|
-
role: "alert"
|
|
10326
|
-
|
|
10327
|
-
};
|
|
10328
|
-
var _hoisted_9 = { class: "docs-
|
|
10329
|
-
var _hoisted_10 =
|
|
10330
|
-
var _hoisted_11 =
|
|
10331
|
-
var _hoisted_12 =
|
|
10332
|
-
var _hoisted_13 = {
|
|
10333
|
-
var _hoisted_14 = {
|
|
10405
|
+
role: "alert"
|
|
10406
|
+
};
|
|
10407
|
+
var _hoisted_8 = { for: "raw-target" };
|
|
10408
|
+
var _hoisted_9 = { class: "docs-raw-editor__actions" };
|
|
10409
|
+
var _hoisted_10 = { class: "docs-raw-editor__panels" };
|
|
10410
|
+
var _hoisted_11 = { class: "docs-raw-editor__panel" };
|
|
10411
|
+
var _hoisted_12 = { class: "docs-raw-editor__panel" };
|
|
10412
|
+
var _hoisted_13 = {
|
|
10334
10413
|
key: 0,
|
|
10335
|
-
role: "alert"
|
|
10336
|
-
|
|
10337
|
-
};
|
|
10338
|
-
var _hoisted_15 = { class: "docs-
|
|
10339
|
-
var _hoisted_16 =
|
|
10340
|
-
|
|
10341
|
-
|
|
10342
|
-
var
|
|
10343
|
-
var _hoisted_20 = { key: 0 };
|
|
10344
|
-
//#endregion
|
|
10345
|
-
//#region packages/client/src/pages/preview-config-generate/index.vue
|
|
10346
|
-
var preview_config_generate_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
10414
|
+
role: "alert"
|
|
10415
|
+
};
|
|
10416
|
+
var _hoisted_14 = { id: "raw-link" };
|
|
10417
|
+
var _hoisted_15 = { class: "docs-raw-editor__actions" };
|
|
10418
|
+
var _hoisted_16 = ["href"];
|
|
10419
|
+
//#endregion
|
|
10420
|
+
//#region packages/client/src/pages/raw-editor/index.vue
|
|
10421
|
+
var raw_editor_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
10347
10422
|
__name: "index",
|
|
10348
10423
|
setup(__props) {
|
|
10349
10424
|
const route = (0, vue_router.useRoute)();
|
|
10350
|
-
const docs = getDocsConfig();
|
|
10351
10425
|
const { t } = (0, _deot_docs_locale.useLocale)();
|
|
10352
|
-
const
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
}, ...Object.entries(docs.locales).map(([value, item]) => ({
|
|
10356
|
-
value,
|
|
10357
|
-
label: item.label || value
|
|
10358
|
-
}))]);
|
|
10359
|
-
const defaults = {
|
|
10360
|
-
url: "",
|
|
10361
|
-
styles: "[]",
|
|
10362
|
-
modules: "{}",
|
|
10363
|
-
playground: "{}",
|
|
10364
|
-
lang: ""
|
|
10365
|
-
};
|
|
10366
|
-
const form = (0, vue.reactive)({ ...defaults });
|
|
10367
|
-
const jsonFields = [
|
|
10368
|
-
"styles",
|
|
10369
|
-
"modules",
|
|
10370
|
-
"playground"
|
|
10371
|
-
];
|
|
10426
|
+
const base = getDocsDeploymentBase(getDocsConfig());
|
|
10427
|
+
const jsonText = (0, vue.ref)("{}");
|
|
10428
|
+
const target = (0, vue.ref)("__docs/preview");
|
|
10372
10429
|
const importUrl = (0, vue.ref)("");
|
|
10373
10430
|
const parseError = (0, vue.ref)("");
|
|
10374
|
-
const messageOf = (
|
|
10431
|
+
const messageOf = (error) => error instanceof Error ? error.message : String(error);
|
|
10375
10432
|
const result = (0, vue.computed)(() => {
|
|
10376
10433
|
try {
|
|
10377
|
-
const config = normalizePreviewConfig({
|
|
10378
|
-
url: form.url,
|
|
10379
|
-
lang: form.lang,
|
|
10380
|
-
...Object.fromEntries(jsonFields.map((field) => [field, JSON.parse(form[field])]))
|
|
10381
|
-
});
|
|
10382
|
-
if (!resolvePreviewType(config.url, location.href)) throw new TypeError(t("client.common.previewUrlUnsupported"));
|
|
10383
|
-
parsePreviewStyleUrls(config.styles, location.href);
|
|
10384
10434
|
return {
|
|
10385
|
-
|
|
10386
|
-
href: createPreviewUrl(config, getDocsDeploymentBase(docs)),
|
|
10435
|
+
href: createRawUrl(JSON.parse(jsonText.value), target.value, base),
|
|
10387
10436
|
error: ""
|
|
10388
10437
|
};
|
|
10389
|
-
} catch (
|
|
10438
|
+
} catch (error) {
|
|
10390
10439
|
return {
|
|
10391
|
-
config: void 0,
|
|
10392
10440
|
href: "",
|
|
10393
|
-
error:
|
|
10441
|
+
error: t("client.rawEditor.invalid", { message: messageOf(error) })
|
|
10394
10442
|
};
|
|
10395
10443
|
}
|
|
10396
10444
|
});
|
|
10397
10445
|
const applyQuery = (query) => {
|
|
10398
10446
|
try {
|
|
10399
|
-
|
|
10400
|
-
if (
|
|
10401
|
-
|
|
10402
|
-
form.lang = config.lang || "";
|
|
10403
|
-
jsonFields.forEach((field) => form[field] = JSON.stringify(config[field] || {}, null, 2));
|
|
10447
|
+
if (typeof query.target === "string") target.value = query.target;
|
|
10448
|
+
if (query.raw !== void 0) jsonText.value = JSON.stringify(readRaw(query.raw), null, 2);
|
|
10449
|
+
else if (query.url !== void 0) jsonText.value = JSON.stringify(readPreviewConfig(query), null, 2);
|
|
10404
10450
|
parseError.value = "";
|
|
10405
|
-
} catch (
|
|
10406
|
-
parseError.value = messageOf(
|
|
10451
|
+
} catch (error) {
|
|
10452
|
+
parseError.value = t("client.rawEditor.invalid", { message: messageOf(error) });
|
|
10407
10453
|
}
|
|
10408
10454
|
};
|
|
10409
10455
|
const parseLink = () => {
|
|
10410
10456
|
try {
|
|
10411
|
-
const
|
|
10457
|
+
const url = new URL(importUrl.value.trim(), base);
|
|
10458
|
+
if (!/^https?:$/.test(url.protocol)) throw new TypeError("Invalid HTTP(S) URL");
|
|
10412
10459
|
const query = {};
|
|
10413
|
-
|
|
10414
|
-
const values =
|
|
10460
|
+
url.searchParams.forEach((_, key) => {
|
|
10461
|
+
const values = url.searchParams.getAll(key);
|
|
10415
10462
|
query[key] = values.length === 1 ? values[0] : values;
|
|
10416
10463
|
});
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
|
|
10464
|
+
if (query.raw === void 0 && query.url === void 0) throw new TypeError("raw or url is required");
|
|
10465
|
+
const value = query.raw !== void 0 ? readRaw(query.raw) : readPreviewConfig(query);
|
|
10466
|
+
url.searchParams.delete("raw");
|
|
10467
|
+
jsonText.value = JSON.stringify(value, null, 2);
|
|
10468
|
+
target.value = url.href;
|
|
10469
|
+
parseError.value = "";
|
|
10470
|
+
} catch (error) {
|
|
10471
|
+
parseError.value = t("client.rawEditor.invalid", { message: messageOf(error) });
|
|
10420
10472
|
}
|
|
10421
10473
|
};
|
|
10422
|
-
(0, vue.watch)(() => route.query,
|
|
10423
|
-
if (query.raw !== void 0 || query.url !== void 0) applyQuery(query);
|
|
10424
|
-
}, { immediate: true });
|
|
10474
|
+
(0, vue.watch)(() => route.query, applyQuery, { immediate: true });
|
|
10425
10475
|
return (_ctx, _cache) => {
|
|
10426
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)("section", _hoisted_1, [
|
|
10427
|
-
(0, vue.createElementVNode)("header", null, [(0, vue.createElementVNode)("h1", null, (0, vue.toDisplayString)((0, vue.unref)(t)("client.
|
|
10428
|
-
(0, vue.createElementVNode)("div",
|
|
10429
|
-
(0, vue.createElementVNode)("label",
|
|
10430
|
-
(0, vue.createElementVNode)("div",
|
|
10431
|
-
id: "
|
|
10476
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("section", _hoisted_1$2, [
|
|
10477
|
+
(0, vue.createElementVNode)("header", null, [(0, vue.createElementVNode)("h1", null, (0, vue.toDisplayString)((0, vue.unref)(t)("client.rawEditor.title")), 1), (0, vue.createElementVNode)("p", null, (0, vue.toDisplayString)((0, vue.unref)(t)("client.rawEditor.description")), 1)]),
|
|
10478
|
+
(0, vue.createElementVNode)("div", _hoisted_2$1, [
|
|
10479
|
+
(0, vue.createElementVNode)("label", _hoisted_3$1, (0, vue.toDisplayString)((0, vue.unref)(t)("client.rawEditor.importLabel")), 1),
|
|
10480
|
+
(0, vue.createElementVNode)("div", _hoisted_4$1, [(0, vue.withDirectives)((0, vue.createElementVNode)("input", {
|
|
10481
|
+
id: "raw-import",
|
|
10432
10482
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => importUrl.value = $event),
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
}, null, 8, _hoisted_6), [[vue.vModelText, importUrl.value]]), (0, vue.createElementVNode)("button", {
|
|
10483
|
+
placeholder: (0, vue.unref)(t)("client.rawEditor.parseHint")
|
|
10484
|
+
}, null, 8, _hoisted_5$1), [[vue.vModelText, importUrl.value]]), (0, vue.createElementVNode)("button", {
|
|
10436
10485
|
type: "button",
|
|
10437
10486
|
disabled: !importUrl.value.trim(),
|
|
10438
10487
|
onClick: parseLink
|
|
10439
|
-
}, (0, vue.toDisplayString)((0, vue.unref)(t)("client.
|
|
10440
|
-
parseError.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p",
|
|
10488
|
+
}, (0, vue.toDisplayString)((0, vue.unref)(t)("client.rawEditor.parse")), 9, _hoisted_6)]),
|
|
10489
|
+
parseError.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_7, (0, vue.toDisplayString)(parseError.value), 1)) : (0, vue.createCommentVNode)("v-if", true)
|
|
10441
10490
|
]),
|
|
10491
|
+
(0, vue.createElementVNode)("label", _hoisted_8, (0, vue.toDisplayString)((0, vue.unref)(t)("client.rawEditor.target")), 1),
|
|
10442
10492
|
(0, vue.createElementVNode)("div", _hoisted_9, [
|
|
10443
|
-
_cache[3] || (_cache[3] = (0, vue.createElementVNode)("label", { for: "preview-url" }, "url", -1)),
|
|
10444
10493
|
(0, vue.withDirectives)((0, vue.createElementVNode)("input", {
|
|
10445
|
-
id: "
|
|
10446
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) =>
|
|
10447
|
-
|
|
10448
|
-
|
|
10449
|
-
|
|
10450
|
-
|
|
10451
|
-
|
|
10452
|
-
|
|
10453
|
-
|
|
10454
|
-
|
|
10455
|
-
|
|
10456
|
-
rows: "4",
|
|
10457
|
-
spellcheck: "false"
|
|
10458
|
-
}, null, 8, _hoisted_12), [[vue.vModelText, form[field]]]),
|
|
10459
|
-
(0, vue.createElementVNode)("p", null, (0, vue.toDisplayString)((0, vue.unref)(t)(`client.previewConfigGenerate.${field}Hint`)), 1)
|
|
10460
|
-
], 64);
|
|
10461
|
-
}), 64)),
|
|
10462
|
-
(0, vue.createElementVNode)("label", _hoisted_13, (0, vue.toDisplayString)((0, vue.unref)(t)("client.previewConfigGenerate.language")), 1),
|
|
10463
|
-
(0, vue.createVNode)((0, vue.unref)(_deot_vc.Select), {
|
|
10464
|
-
id: "preview-lang",
|
|
10465
|
-
modelValue: form.lang,
|
|
10466
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => form.lang = $event),
|
|
10467
|
-
class: "docs-preview-config-generate__select",
|
|
10468
|
-
data: languageOptions.value,
|
|
10469
|
-
"null-value": "",
|
|
10470
|
-
placeholder: (0, vue.unref)(t)("client.previewConfigGenerate.defaultLanguage")
|
|
10471
|
-
}, null, 8, [
|
|
10472
|
-
"modelValue",
|
|
10473
|
-
"data",
|
|
10474
|
-
"placeholder"
|
|
10475
|
-
])
|
|
10494
|
+
id: "raw-target",
|
|
10495
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => target.value = $event)
|
|
10496
|
+
}, null, 512), [[vue.vModelText, target.value]]),
|
|
10497
|
+
(0, vue.createElementVNode)("button", {
|
|
10498
|
+
type: "button",
|
|
10499
|
+
onClick: _cache[2] || (_cache[2] = ($event) => target.value = "__docs/preview")
|
|
10500
|
+
}, "preview"),
|
|
10501
|
+
(0, vue.createElementVNode)("button", {
|
|
10502
|
+
type: "button",
|
|
10503
|
+
onClick: _cache[3] || (_cache[3] = ($event) => target.value = "__docs/markdown-editor")
|
|
10504
|
+
}, "markdown-editor")
|
|
10476
10505
|
]),
|
|
10477
|
-
|
|
10478
|
-
|
|
10479
|
-
|
|
10480
|
-
(0, vue.
|
|
10481
|
-
|
|
10482
|
-
|
|
10483
|
-
|
|
10484
|
-
|
|
10485
|
-
|
|
10486
|
-
|
|
10487
|
-
|
|
10506
|
+
(0, vue.createElementVNode)("div", _hoisted_10, [(0, vue.createElementVNode)("div", _hoisted_11, [(0, vue.createElementVNode)("label", null, (0, vue.toDisplayString)((0, vue.unref)(t)("client.rawEditor.json")), 1), (0, vue.createVNode)(json_editor_default, {
|
|
10507
|
+
modelValue: jsonText.value,
|
|
10508
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => jsonText.value = $event),
|
|
10509
|
+
label: (0, vue.unref)(t)("client.rawEditor.json")
|
|
10510
|
+
}, null, 8, ["modelValue", "label"])]), (0, vue.createElementVNode)("div", _hoisted_12, [
|
|
10511
|
+
(0, vue.createElementVNode)("label", null, (0, vue.toDisplayString)((0, vue.unref)(t)("client.rawEditor.link")), 1),
|
|
10512
|
+
result.value.error ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_13, (0, vue.toDisplayString)(result.value.error), 1)) : (0, vue.createCommentVNode)("v-if", true),
|
|
10513
|
+
(0, vue.createVNode)((0, vue.unref)(_deot_vc.Scroller), {
|
|
10514
|
+
native: false,
|
|
10515
|
+
"auto-resize": true,
|
|
10516
|
+
class: "docs-raw-editor__output"
|
|
10517
|
+
}, {
|
|
10518
|
+
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("pre", _hoisted_14, (0, vue.toDisplayString)(result.value.href), 1)]),
|
|
10519
|
+
_: 1
|
|
10520
|
+
}),
|
|
10521
|
+
(0, vue.createElementVNode)("div", _hoisted_15, [(0, vue.createVNode)((0, vue.unref)(_deot_vc.Clipboard), {
|
|
10488
10522
|
tag: "button",
|
|
10489
10523
|
type: "button",
|
|
10490
10524
|
value: result.value.href,
|
|
10491
10525
|
disabled: !result.value.href
|
|
10492
10526
|
}, {
|
|
10493
|
-
default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(t)("client.
|
|
10527
|
+
default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(t)("client.rawEditor.copy")), 1)]),
|
|
10494
10528
|
_: 1
|
|
10495
10529
|
}, 8, ["value", "disabled"]), result.value.href ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
|
|
10496
10530
|
key: 0,
|
|
10497
10531
|
href: result.value.href,
|
|
10498
10532
|
target: "_blank",
|
|
10499
10533
|
rel: "noopener"
|
|
10500
|
-
}, (0, vue.toDisplayString)((0, vue.unref)(t)("client.
|
|
10501
|
-
|
|
10502
|
-
|
|
10503
|
-
|
|
10534
|
+
}, (0, vue.toDisplayString)((0, vue.unref)(t)("client.rawEditor.open")), 9, _hoisted_16)) : (0, vue.createCommentVNode)("v-if", true)])
|
|
10535
|
+
])])
|
|
10536
|
+
]);
|
|
10537
|
+
};
|
|
10538
|
+
}
|
|
10539
|
+
});
|
|
10540
|
+
//#endregion
|
|
10541
|
+
//#region packages/client/src/pages/markdown-editor/components/source-editor.vue
|
|
10542
|
+
var source_editor_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
10543
|
+
__name: "source-editor",
|
|
10544
|
+
props: {
|
|
10545
|
+
modelValue: {},
|
|
10546
|
+
label: {}
|
|
10547
|
+
},
|
|
10548
|
+
emits: ["update:modelValue", "scroll"],
|
|
10549
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
10550
|
+
const props = __props;
|
|
10551
|
+
const emit = __emit;
|
|
10552
|
+
const host = (0, vue.ref)();
|
|
10553
|
+
const scroller = (0, vue.ref)();
|
|
10554
|
+
const theme = new _codemirror_state.Compartment();
|
|
10555
|
+
const attributes = new _codemirror_state.Compartment();
|
|
10556
|
+
let editor;
|
|
10557
|
+
const editorTheme = () => codemirror.EditorView.theme({}, { dark: Theme.current.value === "dark" });
|
|
10558
|
+
const editorAttributes = () => codemirror.EditorView.contentAttributes.of({ "aria-label": props.label });
|
|
10559
|
+
(0, vue.onMounted)(() => {
|
|
10560
|
+
editor = new codemirror.EditorView({
|
|
10561
|
+
parent: host.value,
|
|
10562
|
+
state: _codemirror_state.EditorState.create({
|
|
10563
|
+
doc: props.modelValue,
|
|
10564
|
+
extensions: [
|
|
10565
|
+
codemirror.basicSetup,
|
|
10566
|
+
(0, _codemirror_lang_markdown.markdown)(),
|
|
10567
|
+
codemirror.EditorView.lineWrapping,
|
|
10568
|
+
theme.of(editorTheme()),
|
|
10569
|
+
attributes.of(editorAttributes()),
|
|
10570
|
+
codemirror.EditorView.updateListener.of((update) => {
|
|
10571
|
+
if (!update.docChanged) return;
|
|
10572
|
+
const value = update.state.doc.toString();
|
|
10573
|
+
if (value !== props.modelValue) emit("update:modelValue", value);
|
|
10574
|
+
})
|
|
10575
|
+
]
|
|
10576
|
+
})
|
|
10577
|
+
});
|
|
10578
|
+
});
|
|
10579
|
+
(0, vue.watch)(() => props.modelValue, (value) => {
|
|
10580
|
+
if (!editor || value === editor.state.doc.toString()) return;
|
|
10581
|
+
editor.dispatch({ changes: {
|
|
10582
|
+
from: 0,
|
|
10583
|
+
to: editor.state.doc.length,
|
|
10584
|
+
insert: value
|
|
10585
|
+
} });
|
|
10586
|
+
});
|
|
10587
|
+
(0, vue.watch)(Theme.current, () => editor?.dispatch({ effects: theme.reconfigure(editorTheme()) }));
|
|
10588
|
+
(0, vue.watch)(() => props.label, () => editor?.dispatch({ effects: attributes.reconfigure(editorAttributes()) }));
|
|
10589
|
+
(0, vue.onBeforeUnmount)(() => editor?.destroy());
|
|
10590
|
+
__expose({
|
|
10591
|
+
getScrollElement: () => scroller.value?.$el,
|
|
10592
|
+
getLineTop: (line) => editor?.lineBlockAt(editor.state.doc.line(line).from).top ?? 0,
|
|
10593
|
+
setScrollTop: (top) => scroller.value?.setScrollTop(top)
|
|
10594
|
+
});
|
|
10595
|
+
return (_ctx, _cache) => {
|
|
10596
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_deot_vc.Scroller), {
|
|
10597
|
+
ref_key: "scroller",
|
|
10598
|
+
ref: scroller,
|
|
10599
|
+
class: "docs-markdown-editor-source-editor",
|
|
10600
|
+
native: false,
|
|
10601
|
+
wheel: false,
|
|
10602
|
+
"auto-resize": true,
|
|
10603
|
+
always: true,
|
|
10604
|
+
height: "100%",
|
|
10605
|
+
onScroll: _cache[0] || (_cache[0] = ($event) => emit("scroll"))
|
|
10606
|
+
}, {
|
|
10607
|
+
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
|
|
10608
|
+
ref_key: "host",
|
|
10609
|
+
ref: host,
|
|
10610
|
+
class: "docs-markdown-editor-source-editor__host"
|
|
10611
|
+
}, null, 512)]),
|
|
10612
|
+
_: 1
|
|
10613
|
+
}, 512);
|
|
10614
|
+
};
|
|
10615
|
+
}
|
|
10616
|
+
});
|
|
10617
|
+
//#endregion
|
|
10618
|
+
//#region packages/client/src/pages/markdown-editor/components/pane-divider.vue?vue&type=script&setup=true&lang.ts
|
|
10619
|
+
var _hoisted_1$1 = ["aria-label", "aria-valuenow"];
|
|
10620
|
+
//#endregion
|
|
10621
|
+
//#region packages/client/src/pages/markdown-editor/components/pane-divider.vue
|
|
10622
|
+
var pane_divider_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
10623
|
+
__name: "pane-divider",
|
|
10624
|
+
props: { modelValue: {} },
|
|
10625
|
+
emits: ["update:modelValue"],
|
|
10626
|
+
setup(__props, { emit: __emit }) {
|
|
10627
|
+
const props = __props;
|
|
10628
|
+
const emit = __emit;
|
|
10629
|
+
const { t } = (0, _deot_docs_locale.useLocale)();
|
|
10630
|
+
const dragging = (0, vue.ref)(false);
|
|
10631
|
+
let startX = 0;
|
|
10632
|
+
let startValue = 50;
|
|
10633
|
+
const change = (value) => emit("update:modelValue", Math.min(80, Math.max(20, value)));
|
|
10634
|
+
const start = (event) => {
|
|
10635
|
+
if (event.button !== 0) return;
|
|
10636
|
+
startX = event.clientX;
|
|
10637
|
+
startValue = props.modelValue;
|
|
10638
|
+
dragging.value = true;
|
|
10639
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
10640
|
+
};
|
|
10641
|
+
const move = (event) => {
|
|
10642
|
+
if (!dragging.value) return;
|
|
10643
|
+
const divider = event.currentTarget;
|
|
10644
|
+
const width = divider.parentElement.clientWidth - divider.offsetWidth;
|
|
10645
|
+
change(startValue + (event.clientX - startX) / width * 100);
|
|
10646
|
+
};
|
|
10647
|
+
return (_ctx, _cache) => {
|
|
10648
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
10649
|
+
class: (0, vue.normalizeClass)(["docs-markdown-editor-pane-divider", { "is-dragging": dragging.value }]),
|
|
10650
|
+
role: "separator",
|
|
10651
|
+
tabindex: "0",
|
|
10652
|
+
"aria-orientation": "vertical",
|
|
10653
|
+
"aria-label": (0, vue.unref)(t)("client.markdownEditor.resize"),
|
|
10654
|
+
"aria-valuenow": Math.round(__props.modelValue),
|
|
10655
|
+
"aria-valuemin": "20",
|
|
10656
|
+
"aria-valuemax": "80",
|
|
10657
|
+
onPointerdown: (0, vue.withModifiers)(start, ["prevent"]),
|
|
10658
|
+
onPointermove: move,
|
|
10659
|
+
onPointerup: _cache[0] || (_cache[0] = ($event) => dragging.value = false),
|
|
10660
|
+
onPointercancel: _cache[1] || (_cache[1] = ($event) => dragging.value = false),
|
|
10661
|
+
onLostpointercapture: _cache[2] || (_cache[2] = ($event) => dragging.value = false),
|
|
10662
|
+
onKeydown: [_cache[3] || (_cache[3] = (0, vue.withKeys)((0, vue.withModifiers)(($event) => change(__props.modelValue - 2), ["prevent"]), ["left"])), _cache[4] || (_cache[4] = (0, vue.withKeys)((0, vue.withModifiers)(($event) => change(__props.modelValue + 2), ["prevent"]), ["right"]))]
|
|
10663
|
+
}, null, 42, _hoisted_1$1);
|
|
10664
|
+
};
|
|
10665
|
+
}
|
|
10666
|
+
});
|
|
10667
|
+
//#endregion
|
|
10668
|
+
//#region packages/client/src/pages/markdown-editor/index.vue?vue&type=script&setup=true&lang.ts
|
|
10669
|
+
var _hoisted_1 = { class: "docs-markdown-editor" };
|
|
10670
|
+
var _hoisted_2 = { class: "docs-markdown-editor__toolbar" };
|
|
10671
|
+
var _hoisted_3 = ["disabled"];
|
|
10672
|
+
var _hoisted_4 = {
|
|
10673
|
+
key: 0,
|
|
10674
|
+
class: "docs-markdown-editor__status",
|
|
10675
|
+
role: "status"
|
|
10676
|
+
};
|
|
10677
|
+
var _hoisted_5 = {
|
|
10678
|
+
key: 1,
|
|
10679
|
+
class: "docs-markdown-editor__status",
|
|
10680
|
+
role: "alert"
|
|
10681
|
+
};
|
|
10682
|
+
var SAMPLE = "# Markdown\n\n## Hello\n\nEdit **Markdown** and preview it here.\n\n| Name | Value |\n| --- | --- |\n| Markdown | Live preview |\n\n```js\nconsole.log(\"Hello Markdown\");\n```\n";
|
|
10683
|
+
//#endregion
|
|
10684
|
+
//#region packages/client/src/pages/markdown-editor/index.vue
|
|
10685
|
+
var markdown_editor_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
10686
|
+
__name: "index",
|
|
10687
|
+
setup(__props) {
|
|
10688
|
+
const route = (0, vue_router.useRoute)();
|
|
10689
|
+
const docs = getDocsConfig();
|
|
10690
|
+
const base = getDocsDeploymentBase(docs);
|
|
10691
|
+
const namespace = getDocsNamespace(docs);
|
|
10692
|
+
const { locale, t } = (0, _deot_docs_locale.useLocale)();
|
|
10693
|
+
const lang = (0, vue.computed)(() => String(route.params.lang || locale.value.name));
|
|
10694
|
+
const messageOf = (reason) => reason instanceof Error ? reason.message : String(reason);
|
|
10695
|
+
const preview = (0, vue.computed)(() => {
|
|
10696
|
+
try {
|
|
10697
|
+
return {
|
|
10698
|
+
config: readPreviewConfig(route.query),
|
|
10699
|
+
error: ""
|
|
10700
|
+
};
|
|
10701
|
+
} catch (reason) {
|
|
10702
|
+
return {
|
|
10703
|
+
config: void 0,
|
|
10704
|
+
error: messageOf(reason)
|
|
10705
|
+
};
|
|
10706
|
+
}
|
|
10707
|
+
});
|
|
10708
|
+
const markdownDefaults = (0, vue.computed)(() => resolveDocsMarkdownComponent(docs));
|
|
10709
|
+
const playgroundDefaults = (0, vue.computed)(() => {
|
|
10710
|
+
const site = resolveDocsPlaygroundComponent(docs);
|
|
10711
|
+
const config = preview.value.config;
|
|
10712
|
+
return {
|
|
10713
|
+
...site,
|
|
10714
|
+
...config?.playground,
|
|
10715
|
+
options: {
|
|
10716
|
+
...site.options,
|
|
10717
|
+
builtinImportMap: {
|
|
10718
|
+
...site.options?.builtinImportMap,
|
|
10719
|
+
imports: {
|
|
10720
|
+
...site.options?.builtinImportMap?.imports,
|
|
10721
|
+
...config?.modules
|
|
10722
|
+
}
|
|
10723
|
+
}
|
|
10724
|
+
}
|
|
10725
|
+
};
|
|
10726
|
+
});
|
|
10727
|
+
const text = (0, vue.ref)(SAMPLE);
|
|
10728
|
+
const previewSource = (0, vue.ref)(SAMPLE);
|
|
10729
|
+
const renderedSource = (0, vue.ref)();
|
|
10730
|
+
const sourceBase = (0, vue.ref)(base);
|
|
10731
|
+
const documentKey = (0, vue.ref)(0);
|
|
10732
|
+
const loading = (0, vue.ref)(false);
|
|
10733
|
+
const exporting = (0, vue.ref)(false);
|
|
10734
|
+
const error = (0, vue.ref)("");
|
|
10735
|
+
const styleError = (0, vue.ref)("");
|
|
10736
|
+
const syncEnabled = (0, vue.ref)(false);
|
|
10737
|
+
const editorRatio = (0, vue.ref)(50);
|
|
10738
|
+
const fileInput = (0, vue.ref)();
|
|
10739
|
+
const editor = (0, vue.ref)();
|
|
10740
|
+
const previewScroller = (0, vue.ref)();
|
|
10741
|
+
const article = (0, vue.ref)();
|
|
10742
|
+
let initialText = SAMPLE;
|
|
10743
|
+
let generation = 0;
|
|
10744
|
+
let previewTimer;
|
|
10745
|
+
let draftTimer;
|
|
10746
|
+
let scrollSource = "editor";
|
|
10747
|
+
let sourceLines = [];
|
|
10748
|
+
const syncScroll = (side = scrollSource) => {
|
|
10749
|
+
if (!syncEnabled.value || side !== scrollSource || renderedSource.value !== text.value) return;
|
|
10750
|
+
const panes = {
|
|
10751
|
+
editor: {
|
|
10752
|
+
element: editor.value?.getScrollElement(),
|
|
10753
|
+
view: editor.value
|
|
10754
|
+
},
|
|
10755
|
+
preview: {
|
|
10756
|
+
element: previewScroller.value?.$el,
|
|
10757
|
+
view: previewScroller.value
|
|
10758
|
+
}
|
|
10759
|
+
};
|
|
10760
|
+
const from = panes[side].element;
|
|
10761
|
+
const to = panes[side === "editor" ? "preview" : "editor"];
|
|
10762
|
+
if (!from || !to.element) return;
|
|
10763
|
+
const end = {
|
|
10764
|
+
editor: Math.max(0, panes.editor.element.scrollHeight - panes.editor.element.clientHeight),
|
|
10765
|
+
preview: Math.max(0, panes.preview.element.scrollHeight - panes.preview.element.clientHeight)
|
|
10766
|
+
};
|
|
10767
|
+
const points = [{
|
|
10768
|
+
editor: 0,
|
|
10769
|
+
preview: 0
|
|
10770
|
+
}];
|
|
10771
|
+
const content = article.value?.querySelector(".docs-markdown-reset");
|
|
10772
|
+
const origin = content?.getBoundingClientRect().top || 0;
|
|
10773
|
+
content && [...content.children].forEach((block, index) => {
|
|
10774
|
+
const line = sourceLines[index];
|
|
10775
|
+
if (!line) return;
|
|
10776
|
+
const point = {
|
|
10777
|
+
editor: editor.value.getLineTop(line),
|
|
10778
|
+
preview: block.getBoundingClientRect().top - origin
|
|
10779
|
+
};
|
|
10780
|
+
const previous = points[points.length - 1];
|
|
10781
|
+
if (point.editor > previous.editor && point.preview > previous.preview && point.editor < end.editor && point.preview < end.preview) points.push(point);
|
|
10782
|
+
});
|
|
10783
|
+
points.push(end);
|
|
10784
|
+
let index = 1;
|
|
10785
|
+
while (index < points.length - 1 && points[index][side] <= from.scrollTop) index++;
|
|
10786
|
+
const start = points[index - 1];
|
|
10787
|
+
const finish = points[index];
|
|
10788
|
+
const progress = (from.scrollTop - start[side]) / (finish[side] - start[side] || 1);
|
|
10789
|
+
const other = side === "editor" ? "preview" : "editor";
|
|
10790
|
+
const top = start[other] + progress * (finish[other] - start[other]);
|
|
10791
|
+
if (Math.abs(to.element.scrollTop - top) <= 1) return;
|
|
10792
|
+
to.view?.setScrollTop(top);
|
|
10793
|
+
};
|
|
10794
|
+
const saveDraft = () => {
|
|
10795
|
+
if (draftTimer === void 0) return;
|
|
10796
|
+
clearTimeout(draftTimer);
|
|
10797
|
+
draftTimer = void 0;
|
|
10798
|
+
Settings.set(namespace, "markdown-editor:draft", {
|
|
10799
|
+
text: text.value,
|
|
10800
|
+
base: sourceBase.value
|
|
10801
|
+
}).catch(() => {});
|
|
10802
|
+
};
|
|
10803
|
+
const scheduleDraft = () => {
|
|
10804
|
+
clearTimeout(draftTimer);
|
|
10805
|
+
draftTimer = setTimeout(saveDraft, 300);
|
|
10806
|
+
};
|
|
10807
|
+
const replaceDocument = (value, resourceBase, initial = value) => {
|
|
10808
|
+
clearTimeout(previewTimer);
|
|
10809
|
+
text.value = previewSource.value = value;
|
|
10810
|
+
sourceBase.value = resourceBase;
|
|
10811
|
+
initialText = initial;
|
|
10812
|
+
documentKey.value++;
|
|
10813
|
+
scrollSource = "editor";
|
|
10814
|
+
(0, vue.nextTick)(() => previewScroller.value?.setScrollTop(0));
|
|
10815
|
+
};
|
|
10816
|
+
const edit = (value) => {
|
|
10817
|
+
generation++;
|
|
10818
|
+
loading.value = false;
|
|
10819
|
+
text.value = value;
|
|
10820
|
+
error.value = "";
|
|
10821
|
+
clearTimeout(previewTimer);
|
|
10822
|
+
previewTimer = setTimeout(() => previewSource.value = text.value, 150);
|
|
10823
|
+
scheduleDraft();
|
|
10824
|
+
};
|
|
10825
|
+
const load = async () => {
|
|
10826
|
+
saveDraft();
|
|
10827
|
+
const token = ++generation;
|
|
10828
|
+
error.value = "";
|
|
10829
|
+
const config = preview.value.config;
|
|
10830
|
+
loading.value = Boolean(config);
|
|
10831
|
+
if (!config) return;
|
|
10832
|
+
try {
|
|
10833
|
+
if (config.url) {
|
|
10834
|
+
const resolved = await resolveResource(docs, {
|
|
10835
|
+
source: config.url,
|
|
10836
|
+
type: "markdown",
|
|
10837
|
+
lang: lang.value
|
|
10838
|
+
});
|
|
10839
|
+
const url = new URL(resolved, base).href;
|
|
10840
|
+
const record = await Gateway.revalidate(createResourceIdentity(docs, lang.value, "markdown", config.url), {
|
|
10841
|
+
url,
|
|
10842
|
+
priority: 100
|
|
10843
|
+
});
|
|
10844
|
+
if (token === generation) replaceDocument(record.content, url);
|
|
10845
|
+
} else {
|
|
10846
|
+
const draft = await Settings.get(namespace, "markdown-editor:draft");
|
|
10847
|
+
if (token === generation) replaceDocument(draft?.text ?? SAMPLE, draft?.base || base, SAMPLE);
|
|
10848
|
+
}
|
|
10849
|
+
} catch (reason) {
|
|
10850
|
+
if (token === generation) error.value = messageOf(reason);
|
|
10851
|
+
} finally {
|
|
10852
|
+
if (token === generation) loading.value = false;
|
|
10853
|
+
}
|
|
10854
|
+
};
|
|
10855
|
+
const openFile = async (event) => {
|
|
10856
|
+
const input = event.target;
|
|
10857
|
+
const file = input.files?.[0];
|
|
10858
|
+
input.value = "";
|
|
10859
|
+
if (!file) return;
|
|
10860
|
+
generation++;
|
|
10861
|
+
error.value = "";
|
|
10862
|
+
loading.value = true;
|
|
10863
|
+
replaceDocument(await file.text(), base);
|
|
10864
|
+
loading.value = false;
|
|
10865
|
+
scheduleDraft();
|
|
10866
|
+
};
|
|
10867
|
+
const reset = () => {
|
|
10868
|
+
if (text.value !== initialText && !window.confirm(t("client.markdownEditor.confirmReset"))) return;
|
|
10869
|
+
generation++;
|
|
10870
|
+
loading.value = false;
|
|
10871
|
+
error.value = "";
|
|
10872
|
+
replaceDocument(initialText, sourceBase.value);
|
|
10873
|
+
scheduleDraft();
|
|
10874
|
+
};
|
|
10875
|
+
const onRendered = (source, lines) => {
|
|
10876
|
+
renderedSource.value = source;
|
|
10877
|
+
sourceLines = lines;
|
|
10878
|
+
article.value?.querySelectorAll("img[src], a[href]").forEach((node) => {
|
|
10879
|
+
const attr = node instanceof HTMLImageElement ? "src" : "href";
|
|
10880
|
+
const value = node.getAttribute(attr);
|
|
10881
|
+
if (!value || value.startsWith("#")) return;
|
|
10882
|
+
try {
|
|
10883
|
+
node.setAttribute(attr, new URL(value, sourceBase.value).href);
|
|
10884
|
+
} catch {}
|
|
10885
|
+
});
|
|
10886
|
+
syncScroll();
|
|
10887
|
+
};
|
|
10888
|
+
const exportPdf = async () => {
|
|
10889
|
+
exporting.value = true;
|
|
10890
|
+
await Promise.all([document.fonts?.ready, ...[...article.value?.querySelectorAll("img") || []].map((img) => img.decode?.().catch(() => {}))]);
|
|
10891
|
+
window.print();
|
|
10892
|
+
exporting.value = false;
|
|
10893
|
+
};
|
|
10894
|
+
(0, vue.watch)([
|
|
10895
|
+
() => preview.value.config?.url,
|
|
10896
|
+
() => preview.value.error,
|
|
10897
|
+
lang
|
|
10898
|
+
], load, { immediate: true });
|
|
10899
|
+
(0, vue.watch)(() => preview.value.config?.styles, (styles, _, onCleanup) => {
|
|
10900
|
+
styleError.value = "";
|
|
10901
|
+
try {
|
|
10902
|
+
onCleanup(acquirePreviewStyles(parsePreviewStyleUrls(styles, base), (url) => styleError.value = t("client.common.previewStyleFailed", { url })));
|
|
10903
|
+
} catch (reason) {
|
|
10904
|
+
styleError.value = messageOf(reason);
|
|
10905
|
+
}
|
|
10906
|
+
}, { immediate: true });
|
|
10907
|
+
(0, vue.watch)(syncEnabled, (value) => {
|
|
10908
|
+
scrollSource = "editor";
|
|
10909
|
+
syncScroll();
|
|
10910
|
+
Settings.set(namespace, "markdown-editor:sync", value).catch(() => {});
|
|
10911
|
+
});
|
|
10912
|
+
(0, vue.watch)(editorRatio, () => {
|
|
10913
|
+
(0, vue.nextTick)(() => requestAnimationFrame(() => syncScroll()));
|
|
10914
|
+
});
|
|
10915
|
+
(0, vue.onMounted)(() => {
|
|
10916
|
+
Settings.get(namespace, "markdown-editor:sync").then((value) => syncEnabled.value = value ?? false).catch(() => {});
|
|
10917
|
+
});
|
|
10918
|
+
(0, vue.onBeforeUnmount)(() => {
|
|
10919
|
+
generation++;
|
|
10920
|
+
saveDraft();
|
|
10921
|
+
clearTimeout(previewTimer);
|
|
10922
|
+
});
|
|
10923
|
+
return (_ctx, _cache) => {
|
|
10924
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("section", _hoisted_1, [
|
|
10925
|
+
(0, vue.createElementVNode)("header", _hoisted_2, [
|
|
10926
|
+
(0, vue.createElementVNode)("h1", null, (0, vue.toDisplayString)((0, vue.unref)(t)("client.markdownEditor.title")), 1),
|
|
10927
|
+
(0, vue.createElementVNode)("button", {
|
|
10928
|
+
type: "button",
|
|
10929
|
+
onClick: _cache[0] || (_cache[0] = ($event) => fileInput.value?.click())
|
|
10930
|
+
}, (0, vue.toDisplayString)((0, vue.unref)(t)("client.markdownEditor.open")), 1),
|
|
10931
|
+
(0, vue.createElementVNode)("input", {
|
|
10932
|
+
ref_key: "fileInput",
|
|
10933
|
+
ref: fileInput,
|
|
10934
|
+
type: "file",
|
|
10935
|
+
accept: ".md,.markdown,.txt,text/markdown,text/plain",
|
|
10936
|
+
hidden: "",
|
|
10937
|
+
onChange: openFile
|
|
10938
|
+
}, null, 544),
|
|
10939
|
+
(0, vue.createVNode)((0, vue.unref)(_deot_vc.Clipboard), {
|
|
10940
|
+
tag: "button",
|
|
10941
|
+
type: "button",
|
|
10942
|
+
value: text.value
|
|
10943
|
+
}, {
|
|
10944
|
+
default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(t)("client.markdownEditor.copy")), 1)]),
|
|
10945
|
+
_: 1
|
|
10946
|
+
}, 8, ["value"]),
|
|
10947
|
+
(0, vue.createElementVNode)("button", {
|
|
10948
|
+
type: "button",
|
|
10949
|
+
disabled: exporting.value || loading.value || Boolean(preview.value.error) || renderedSource.value !== text.value,
|
|
10950
|
+
onClick: exportPdf
|
|
10951
|
+
}, (0, vue.toDisplayString)((0, vue.unref)(t)("client.markdownEditor.pdf")), 9, _hoisted_3),
|
|
10952
|
+
(0, vue.createElementVNode)("button", {
|
|
10953
|
+
type: "button",
|
|
10954
|
+
onClick: reset
|
|
10955
|
+
}, (0, vue.toDisplayString)((0, vue.unref)(t)("client.markdownEditor.reset")), 1),
|
|
10956
|
+
(0, vue.createElementVNode)("label", null, [(0, vue.withDirectives)((0, vue.createElementVNode)("input", {
|
|
10957
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => syncEnabled.value = $event),
|
|
10958
|
+
type: "checkbox"
|
|
10959
|
+
}, null, 512), [[vue.vModelCheckbox, syncEnabled.value]]), (0, vue.createTextVNode)(" " + (0, vue.toDisplayString)((0, vue.unref)(t)("client.markdownEditor.sync")), 1)]),
|
|
10960
|
+
(0, vue.createVNode)(theme_toggler_default)
|
|
10961
|
+
]),
|
|
10962
|
+
loading.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_4, (0, vue.toDisplayString)((0, vue.unref)(t)("client.common.loading")), 1)) : (0, vue.createCommentVNode)("v-if", true),
|
|
10963
|
+
preview.value.error || error.value || styleError.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_5, (0, vue.toDisplayString)(preview.value.error || error.value || styleError.value), 1)) : (0, vue.createCommentVNode)("v-if", true),
|
|
10964
|
+
(0, vue.createElementVNode)("div", {
|
|
10965
|
+
class: "docs-markdown-editor__panes",
|
|
10966
|
+
style: (0, vue.normalizeStyle)({ "--docs-markdown-editor-columns": `minmax(0, ${editorRatio.value}fr) 8px minmax(0, ${100 - editorRatio.value}fr)` })
|
|
10967
|
+
}, [
|
|
10968
|
+
((0, vue.openBlock)(), (0, vue.createBlock)(source_editor_default, {
|
|
10969
|
+
key: documentKey.value,
|
|
10970
|
+
ref_key: "editor",
|
|
10971
|
+
ref: editor,
|
|
10972
|
+
"model-value": text.value,
|
|
10973
|
+
label: (0, vue.unref)(t)("client.markdownEditor.source"),
|
|
10974
|
+
onWheelCapture: _cache[2] || (_cache[2] = ($event) => (0, vue.isRef)(scrollSource) ? scrollSource.value = "editor" : scrollSource = "editor"),
|
|
10975
|
+
onPointerdownCapture: _cache[3] || (_cache[3] = ($event) => (0, vue.isRef)(scrollSource) ? scrollSource.value = "editor" : scrollSource = "editor"),
|
|
10976
|
+
onKeydownCapture: _cache[4] || (_cache[4] = ($event) => (0, vue.isRef)(scrollSource) ? scrollSource.value = "editor" : scrollSource = "editor"),
|
|
10977
|
+
"onUpdate:modelValue": edit,
|
|
10978
|
+
onScroll: _cache[5] || (_cache[5] = ($event) => syncScroll("editor"))
|
|
10979
|
+
}, null, 8, ["model-value", "label"])),
|
|
10980
|
+
(0, vue.createVNode)(pane_divider_default, {
|
|
10981
|
+
modelValue: editorRatio.value,
|
|
10982
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => editorRatio.value = $event)
|
|
10983
|
+
}, null, 8, ["modelValue"]),
|
|
10984
|
+
(0, vue.createVNode)((0, vue.unref)(_deot_vc.Scroller), {
|
|
10985
|
+
ref_key: "previewScroller",
|
|
10986
|
+
ref: previewScroller,
|
|
10987
|
+
class: "docs-markdown-editor__preview",
|
|
10988
|
+
native: false,
|
|
10989
|
+
wheel: false,
|
|
10990
|
+
"auto-resize": true,
|
|
10991
|
+
always: true,
|
|
10992
|
+
height: "100%",
|
|
10993
|
+
onWheelCapture: _cache[8] || (_cache[8] = ($event) => (0, vue.isRef)(scrollSource) ? scrollSource.value = "preview" : scrollSource = "preview"),
|
|
10994
|
+
onPointerdownCapture: _cache[9] || (_cache[9] = ($event) => (0, vue.isRef)(scrollSource) ? scrollSource.value = "preview" : scrollSource = "preview"),
|
|
10995
|
+
onKeydownCapture: _cache[10] || (_cache[10] = ($event) => (0, vue.isRef)(scrollSource) ? scrollSource.value = "preview" : scrollSource = "preview"),
|
|
10996
|
+
onScroll: _cache[11] || (_cache[11] = ($event) => syncScroll("preview"))
|
|
10997
|
+
}, {
|
|
10998
|
+
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("article", {
|
|
10999
|
+
ref_key: "article",
|
|
11000
|
+
ref: article,
|
|
11001
|
+
onLoadCapture: _cache[7] || (_cache[7] = ($event) => syncScroll())
|
|
11002
|
+
}, [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_deot_docs_markdown.Markdown), {
|
|
11003
|
+
key: documentKey.value,
|
|
11004
|
+
"model-value": previewSource.value,
|
|
11005
|
+
theme: markdownDefaults.value.theme,
|
|
11006
|
+
indicator: markdownDefaults.value.indicator,
|
|
11007
|
+
locale: (0, vue.unref)(locale),
|
|
11008
|
+
playground: playgroundDefaults.value,
|
|
11009
|
+
onRendered
|
|
11010
|
+
}, null, 8, [
|
|
11011
|
+
"model-value",
|
|
11012
|
+
"theme",
|
|
11013
|
+
"indicator",
|
|
11014
|
+
"locale",
|
|
11015
|
+
"playground"
|
|
11016
|
+
]))], 544)]),
|
|
11017
|
+
_: 1
|
|
11018
|
+
}, 512)
|
|
11019
|
+
], 4)
|
|
11020
|
+
]);
|
|
10504
11021
|
};
|
|
10505
11022
|
}
|
|
10506
11023
|
});
|
|
@@ -10569,10 +11086,21 @@ var createDocsRouter = (config, options = {}) => {
|
|
|
10569
11086
|
const isDevelopment = config.runtime?.mode === "development";
|
|
10570
11087
|
const routes = [
|
|
10571
11088
|
{
|
|
10572
|
-
path: "/__docs/
|
|
10573
|
-
component:
|
|
11089
|
+
path: "/__docs/raw-editor",
|
|
11090
|
+
component: raw_editor_default,
|
|
11091
|
+
meta: {
|
|
11092
|
+
docsRawEditor: true,
|
|
11093
|
+
docsRoute: {
|
|
11094
|
+
layout: "none",
|
|
11095
|
+
content: null
|
|
11096
|
+
}
|
|
11097
|
+
}
|
|
11098
|
+
},
|
|
11099
|
+
{
|
|
11100
|
+
path: "/__docs/markdown-editor",
|
|
11101
|
+
component: markdown_editor_default,
|
|
10574
11102
|
meta: {
|
|
10575
|
-
|
|
11103
|
+
docsMarkdownEditor: true,
|
|
10576
11104
|
docsRoute: {
|
|
10577
11105
|
layout: "none",
|
|
10578
11106
|
content: null
|
|
@@ -10709,10 +11237,13 @@ var createDocsRouter = (config, options = {}) => {
|
|
|
10709
11237
|
routes
|
|
10710
11238
|
});
|
|
10711
11239
|
router.beforeEach((to) => {
|
|
10712
|
-
if (to.meta.docsPreview || to.meta.
|
|
11240
|
+
if (to.meta.docsPreview || to.meta.docsRawEditor || to.meta.docsMarkdownEditor) {
|
|
10713
11241
|
let language = "";
|
|
10714
11242
|
try {
|
|
10715
|
-
|
|
11243
|
+
if (to.meta.docsRawEditor) {
|
|
11244
|
+
const value = to.query.raw !== void 0 ? readRaw(to.query.raw) : to.query;
|
|
11245
|
+
if (value && typeof value === "object" && "lang" in value && typeof value.lang === "string") language = value.lang;
|
|
11246
|
+
} else language = readPreviewConfig(to.query).lang || "";
|
|
10716
11247
|
} catch {}
|
|
10717
11248
|
to.params.lang = hasConfiguredLanguage(config, language) ? language : defaultLanguage;
|
|
10718
11249
|
return true;
|
|
@@ -10779,13 +11310,22 @@ var bootstrap = async (config) => {
|
|
|
10779
11310
|
app.mount("#app");
|
|
10780
11311
|
const disconnectEvents = connectResourceEvents();
|
|
10781
11312
|
let disconnected = false;
|
|
10782
|
-
let stopPrefetch
|
|
11313
|
+
let stopPrefetch;
|
|
11314
|
+
let stopPrefetchRoutes = () => {};
|
|
10783
11315
|
(async () => {
|
|
10784
11316
|
try {
|
|
10785
11317
|
await router.isReady();
|
|
10786
11318
|
if (disconnected) return;
|
|
10787
11319
|
await consumeStoredRedirect(router, config);
|
|
10788
|
-
if (
|
|
11320
|
+
if (disconnected) return;
|
|
11321
|
+
const syncPrefetch = (to) => {
|
|
11322
|
+
if (to.meta.docsPreview || to.meta.docsRawEditor || to.meta.docsMarkdownEditor) {
|
|
11323
|
+
stopPrefetch?.();
|
|
11324
|
+
stopPrefetch = void 0;
|
|
11325
|
+
} else stopPrefetch ??= Resource.prefetch.start(config);
|
|
11326
|
+
};
|
|
11327
|
+
syncPrefetch(router.currentRoute.value);
|
|
11328
|
+
stopPrefetchRoutes = router.afterEach(syncPrefetch);
|
|
10789
11329
|
} catch {}
|
|
10790
11330
|
})();
|
|
10791
11331
|
const disconnect = () => {
|
|
@@ -10793,7 +11333,8 @@ var bootstrap = async (config) => {
|
|
|
10793
11333
|
disconnected = true;
|
|
10794
11334
|
disconnectEvents();
|
|
10795
11335
|
stopLanguagePersistence();
|
|
10796
|
-
|
|
11336
|
+
stopPrefetchRoutes();
|
|
11337
|
+
stopPrefetch?.();
|
|
10797
11338
|
stopDocumentLanguage();
|
|
10798
11339
|
stopPlaygroundResource();
|
|
10799
11340
|
stopContentWidth();
|
|
@@ -10805,7 +11346,7 @@ var bootstrap = async (config) => {
|
|
|
10805
11346
|
disconnect
|
|
10806
11347
|
};
|
|
10807
11348
|
};
|
|
10808
|
-
if (typeof window !== "undefined" && typeof document !== "undefined" && document.querySelector("#app")) bootstrap();
|
|
11349
|
+
if (typeof window !== "undefined" && typeof document !== "undefined" && document.querySelector("#app:not([data-v-app])")) bootstrap();
|
|
10809
11350
|
//#endregion
|
|
10810
11351
|
exports.DOCS_RESOURCE_TYPES = DOCS_RESOURCE_TYPES;
|
|
10811
11352
|
exports.Gateway = Gateway;
|