reactive-md 0.9.0 → 0.9.1
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/CHANGELOG-ch.md +13 -0
- package/CHANGELOG.md +13 -0
- package/README-ch.md +6 -6
- package/README-en.md +6 -6
- package/README.md +6 -6
- package/SECURITY-ch.md +3 -3
- package/SECURITY.md +3 -3
- package/THIRD_PARTY_NOTICES.md +111 -1
- package/cli/build.mjs +1 -0
- package/cli/init.mjs +1 -1
- package/dist-library/{LocalDocumentView-K7Y-2bRJ.js → LocalDocumentView-sthUP0ct.js} +10 -10
- package/dist-library/LocalDocumentViewCore-GiWV3bey.js +9829 -0
- package/dist-library/LocalReactiveDocumentCore-ZjQSGyHE.js +275 -0
- package/dist-library/{authoring-Co_TiE-P.js → authoring-Dsune4Hy.js} +40 -20
- package/dist-library/{compile-LhpTKqCR.js → compile-wUv8KEge.js} +1 -1
- package/dist-library/{compiler-core-DTxY-qYz.js → compiler-core-As_m-MNm.js} +2449 -1742
- package/dist-library/{compiler-DfGbQhyD.js → compiler-eOfcinZs.js} +19 -19
- package/dist-library/{component-state-BBJ08vML.js → component-state-C52ZFJGl.js} +1 -1
- package/dist-library/{config-BUo-8O5C.js → config-BadfhjdP.js} +1 -1
- package/dist-library/{config-validation-C5kJYk-J.js → config-validation-F47AcE6o.js} +49 -1
- package/dist-library/{controls-BWiLLtBO.js → controls-CcT6n7k_.js} +2433 -2409
- package/dist-library/{coordinate-BSl6enWV.js → coordinate-CWS9p5q_.js} +108 -107
- package/dist-library/{data-table-DfvytZKQ.js → data-table-Bgccxd7h.js} +68 -65
- package/dist-library/{display-lw3BT1TA.js → display-B-VhqVND.js} +1 -1
- package/dist-library/{export-C7IDW9ul.js → export-BqVmTXm8.js} +145 -87
- package/dist-library/{gallery-B8kSt1oI.js → gallery-CY6mTx8i.js} +151 -147
- package/dist-library/html-CNT4KD-2.js +757 -0
- package/dist-library/{incremental-D_6vwAAE.js → incremental-Dv0FSp_U.js} +404 -142
- package/dist-library/layout-C0YlEPGr.js +562 -0
- package/dist-library/{mount-preset-C5s9ebEH.js → mount-preset-KxvtKgJb.js} +2 -2
- package/dist-library/options-1aDLK7JY.js +121 -0
- package/dist-library/{package-core-D0POW4Gd.js → package-core-WFK1RhAZ.js} +3 -3
- package/dist-library/{parser-standard-OToYcOBL.js → parser-standard-Yuf3A_VI.js} +3270 -3778
- package/dist-library/react-D5iGiUdL.js +7 -0
- package/dist-library/reactive-md-authoring.js +16 -18
- package/dist-library/reactive-md-build.js +51 -51
- package/dist-library/reactive-md-compiler-standard.js +10 -9
- package/dist-library/reactive-md-compiler.js +3 -3
- package/dist-library/reactive-md-export.js +4 -4
- package/dist-library/reactive-md-minimal-react-preset.js +3 -3
- package/dist-library/reactive-md-pdf.js +127 -3
- package/dist-library/reactive-md-plugin-chart.js +2 -2
- package/dist-library/reactive-md-plugin-data.js +4 -4
- package/dist-library/reactive-md-plugin-diagram.js +3 -3
- package/dist-library/reactive-md-plugin-forms.js +2 -2
- package/dist-library/reactive-md-plugin-gallery.js +2 -2
- package/dist-library/reactive-md-plugin-navigation.js +2 -2
- package/dist-library/reactive-md-plugin-network.js +117 -115
- package/dist-library/reactive-md-plugin-plot.js +3 -3
- package/dist-library/reactive-md-react-minimal.js +4 -4
- package/dist-library/reactive-md-react-server.js +6 -6
- package/dist-library/reactive-md-react-unstyled.js +10 -11
- package/dist-library/reactive-md-react.js +10 -11
- package/dist-library/reactive-md-sdk.js +3 -3
- package/dist-library/reactive-md-standalone-configured.js +2 -2
- package/dist-library/reactive-md-standalone-host.js +2 -2
- package/dist-library/reactive-md-testing-browser.js +2 -2
- package/dist-library/reactive-md-testing-react.js +6 -6
- package/dist-library/reactive-md-testing.js +4 -4
- package/dist-library/reactive-md.js +280 -193
- package/dist-library/{registry-05JiqmEp.js → registry-B9NGct4d.js} +1 -1
- package/dist-library/{resources-IeJomeUT.js → resources-D2GDQS0p.js} +1 -1
- package/dist-library/{runtime-CuOyRe9f.js → runtime-kcA7bG7G.js} +341 -341
- package/dist-library/{schema-C-AeByPp.js → schema-BufhKUSM.js} +5 -5
- package/dist-library/{sdk-core-BJLJaVR5.js → sdk-core-BoJT1SIt.js} +490 -150
- package/dist-library/{session-core-BGka5D1J.js → session-core-nmJHuR9c.js} +170 -156
- package/dist-library/{shareable-jkGi2g6y.js → shareable-DpbE-59H.js} +207 -242
- package/dist-library/types/authoring/catalog.d.ts +1 -2
- package/dist-library/types/components/shared/visual-frame.d.ts +6 -2
- package/dist-library/types/local/compilation/compiler-capabilities.d.ts +3 -0
- package/dist-library/types/local/compilation/compiler-core.d.ts +11 -3
- package/dist-library/types/local/compilation/compiler-services.d.ts +8 -4
- package/dist-library/types/local/compilation/compiler.d.ts +3 -3
- package/dist-library/types/local/compilation/session/incremental.d.ts +20 -5
- package/dist-library/types/local/compilation/streaming.d.ts +27 -0
- package/dist-library/types/local/configuration/capability-policy.d.ts +3 -0
- package/dist-library/types/local/configuration/diagnostic-messages.d.ts +48 -0
- package/dist-library/types/local/configuration/options-core.d.ts +1 -2
- package/dist-library/types/local/configuration/options.d.ts +1 -0
- package/dist-library/types/local/css/author-css.d.ts +66 -0
- package/dist-library/types/local/html/extended-fragment.d.ts +41 -0
- package/dist-library/types/local/html/html.d.ts +39 -3
- package/dist-library/types/local/index.d.ts +1 -1
- package/dist-library/types/local/parsing/author-markdown.d.ts +11 -0
- package/dist-library/types/local/parsing/parse-session.d.ts +2 -2
- package/dist-library/types/local/parsing/parser-convert.d.ts +2 -1
- package/dist-library/types/local/parsing/parser-core.d.ts +8 -1
- package/dist-library/types/local/parsing/parser.d.ts +2 -2
- package/dist-library/types/local/rendering/document/ExtendedHtmlFragment.d.ts +14 -0
- package/dist-library/types/local/rendering/document/LocalDocumentViewCore.d.ts +25 -1
- package/dist-library/types/local/rendering/document/LocalReactiveDocumentCore.d.ts +1 -1
- package/dist-library/types/local/rendering/document/use-author-script.d.ts +3 -0
- package/dist-library/types/local/rendering/document/view-render-context.d.ts +11 -1
- package/dist-library/types/local/runtime/author-script-protocol.d.ts +59 -0
- package/dist-library/types/local/transport/worker.d.ts +27 -4
- package/dist-library/types/local/types.d.ts +52 -16
- package/dist-library/types/react/component-api.d.ts +10 -1
- package/dist-library/types/react/component-utils.d.ts +9 -1
- package/dist-library/types/react/sdk-core.d.ts +4 -1
- package/dist-library/types/shareable.d.ts +5 -4
- package/dist-library/types/standalone/prepare.d.ts +1 -1
- package/dist-library/types/standalone/session-core.d.ts +3 -2
- package/dist-library/{types-BFC5rzC4.js → types-BeNtPqdY.js} +1 -1
- package/dist-library/{validation-BlDL2uD9.js → validation-BEBA_HvS.js} +88 -72
- package/dist-library/{visual-frame-G8PHoj1e.js → visual-frame-CyV1FXzs.js} +6 -5
- package/dist-library/{visuals-BkYRmYGO.js → visuals-BZbZYA7w.js} +24181 -24180
- package/dist-standalone/reactive-md-standalone.js +124 -117
- package/docs/README-ch.md +2 -1
- package/docs/README.md +2 -1
- package/docs/compatibility/compatibility-ch.md +6 -6
- package/docs/compatibility/compatibility-en.md +6 -6
- package/docs/compatibility/source-versioning-ch.md +1 -1
- package/docs/compatibility/source-versioning-en.md +1 -1
- package/docs/development/component-development-ch.md +2 -2
- package/docs/development/component-development-en.md +2 -2
- package/docs/development/component-development-reference-ch.md +2 -2
- package/docs/development/component-development-reference-en.md +2 -2
- package/docs/development/component-protocol-ch.md +2 -2
- package/docs/development/component-protocol-en.md +2 -2
- package/docs/development/extension-tutorial-ch.md +3 -3
- package/docs/development/extension-tutorial-en.md +3 -3
- package/docs/integration/author-tools-ch.md +1 -1
- package/docs/integration/author-tools-en.md +1 -1
- package/docs/integration/compiler-ch.md +3 -1
- package/docs/integration/compiler-en.md +3 -1
- package/docs/integration/editor-ch.md +3 -3
- package/docs/integration/editor-en.md +3 -3
- package/docs/integration/extension-sdk-ch.md +2 -2
- package/docs/integration/extension-sdk-en.md +2 -2
- package/docs/integration/local-integration-ch.md +130 -8
- package/docs/integration/local-integration-en.md +130 -8
- package/docs/integration/shareable-export-ch.md +4 -2
- package/docs/integration/shareable-export-en.md +4 -2
- package/docs/reference/html-compatibility-ch.md +20 -67
- package/docs/reference/html-compatibility-en.md +19 -64
- package/docs/reference/public-api-ch.md +10 -7
- package/docs/reference/public-api-en.md +10 -7
- package/docs/releases/release-0.9.1-ch.md +29 -0
- package/docs/releases/release-0.9.1-en.md +29 -0
- package/examples/component-package/README-ch.md +1 -1
- package/examples/component-package/README.md +1 -1
- package/examples/game-2048-package/README-ch.md +1 -1
- package/examples/game-2048-package/README.md +1 -1
- package/examples/integration/README-ch.md +21 -2
- package/examples/integration/README.md +21 -2
- package/examples/integration/extension-sdk/README-ch.md +1 -1
- package/examples/integration/extension-sdk/README.md +1 -1
- package/examples/integration/streaming/index.html +48 -0
- package/examples/integration/streaming/main.js +175 -0
- package/examples/integration/streaming/package.json +13 -0
- package/examples/integration/streaming/worker.js +3 -0
- package/examples/minimal-extension/README-ch.md +3 -3
- package/examples/minimal-extension/README.md +3 -3
- package/examples/tetris-package/README-ch.md +1 -1
- package/examples/tetris-package/README.md +1 -1
- package/package.json +6 -1
- package/dist-library/LocalDocumentViewCore-BLG4hMuO.js +0 -9535
- package/dist-library/LocalReactiveDocumentCore-DVQ6WA9G.js +0 -259
- package/dist-library/component-utils-BvHL8VGt.js +0 -298
- package/dist-library/layout-C22VjZh0.js +0 -542
- package/dist-library/options-CdSKOi7p.js +0 -116
- package/dist-library/react-LY5qsVeP.js +0 -7
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
import { C as e, F as t, I as n, L as r, O as i, P as a, S as o, U as s, V as c, c as l, d as u, f as d, l as f, p, s as m, z as h } from "./sdk-core-BoJT1SIt.js";
|
|
2
|
+
import { n as g, t as _ } from "./tooltip-layer-HDLrSWs0.js";
|
|
3
|
+
import { useEffect as v, useId as y, useRef as b, useState as x } from "react";
|
|
4
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
5
|
+
// src/components/layout/layout.tsx
|
|
6
|
+
function T(e) {
|
|
7
|
+
let t = n(e), i = r(e), { content: o, runtime: s, mode: c, t: l } = i, u = a(e, "title", ""), d = p(e, "reset", !0) && c !== "static", [f, h] = x(null), g = () => {
|
|
8
|
+
try {
|
|
9
|
+
s.reset(o), h(null);
|
|
10
|
+
} catch (e) {
|
|
11
|
+
h(e instanceof Error ? e.message : l("Cannot reset", "无法恢复默认"));
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
return /* @__PURE__ */ w("section", {
|
|
15
|
+
...t(),
|
|
16
|
+
className: "md-panel local-panel",
|
|
17
|
+
"aria-label": u || l("Parameter panel", "参数面板"),
|
|
18
|
+
children: [
|
|
19
|
+
u || d ? /* @__PURE__ */ w("div", {
|
|
20
|
+
className: "local-panel-head",
|
|
21
|
+
children: [u ? /* @__PURE__ */ C("h3", {
|
|
22
|
+
className: "md-panel-title local-panel-title",
|
|
23
|
+
children: u
|
|
24
|
+
}) : /* @__PURE__ */ C("span", {}), d ? /* @__PURE__ */ C("button", {
|
|
25
|
+
type: "button",
|
|
26
|
+
className: "md-button md-button-quiet local-panel-reset",
|
|
27
|
+
onClick: g,
|
|
28
|
+
"aria-label": u ? l(`Reset ${u}`, `${u} 恢复默认`) : l("Reset", "恢复默认"),
|
|
29
|
+
children: l("Reset", "恢复默认")
|
|
30
|
+
}) : null]
|
|
31
|
+
}) : null,
|
|
32
|
+
/* @__PURE__ */ C("div", {
|
|
33
|
+
className: "md-panel-body local-panel-body",
|
|
34
|
+
children: i.render()
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ C(m, { message: f })
|
|
37
|
+
]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function E(e) {
|
|
41
|
+
let t = n(e), i = r(e), o = a(e, "title", "");
|
|
42
|
+
return /* @__PURE__ */ w("section", {
|
|
43
|
+
...t(),
|
|
44
|
+
className: "md-card local-card",
|
|
45
|
+
children: [o ? /* @__PURE__ */ C("h3", {
|
|
46
|
+
className: "md-card-title",
|
|
47
|
+
children: o
|
|
48
|
+
}) : null, /* @__PURE__ */ C("div", {
|
|
49
|
+
className: "md-card-body",
|
|
50
|
+
children: i.render()
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function D(e) {
|
|
55
|
+
let t = n(e), i = r(e), a = Math.min(4, Math.max(1, Math.floor(Number(e.props.columns ?? 2) || 2)));
|
|
56
|
+
return /* @__PURE__ */ C("div", {
|
|
57
|
+
className: "local-grid",
|
|
58
|
+
...t({ "--local-grid-columns": String(a) }),
|
|
59
|
+
children: i.render()
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function O(e) {
|
|
63
|
+
let t = n(e), i = r(e);
|
|
64
|
+
return /* @__PURE__ */ C("div", {
|
|
65
|
+
...t(),
|
|
66
|
+
className: "local-tabpanel-body",
|
|
67
|
+
children: i.render()
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function k() {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
function A() {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
function j() {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
function M(e) {
|
|
80
|
+
let t = n(e), u = r(e), d = y(), { content: p, mode: g, visible: _, t: v } = u, { write: S, error: T } = s(e), E = a(e, "label", ""), D = c(e), O = p.children.filter((e) => e.kind === "component" && e.name === "tab"), k = O.map((e, t) => i(e, "value") ?? `tab-${t + 1}`), A = O.map((t, n) => o(e, t, "label", k[n])), j = i(p, "initial") ?? k[0] ?? "", M = i(p, "bind") !== void 0, N = e.runtime.get(p), P = typeof N == "string" ? N : "", [F, I] = x(() => k.includes(j) ? j : k[0] ?? ""), L = b([]);
|
|
81
|
+
if (h(e, () => {
|
|
82
|
+
I(k.includes(j) ? j : k[0] ?? "");
|
|
83
|
+
}), O.length === 0) return /* @__PURE__ */ C(l, { message: v("Tabs requires at least one tab", "标签页至少需要一个 tab") });
|
|
84
|
+
if (g === "static") return /* @__PURE__ */ w("section", {
|
|
85
|
+
...t(),
|
|
86
|
+
className: "local-tabs local-static-tabs",
|
|
87
|
+
"aria-label": E || v("Tabs", "选项卡"),
|
|
88
|
+
children: [E ? /* @__PURE__ */ C("div", {
|
|
89
|
+
className: "local-tabs-label",
|
|
90
|
+
children: E
|
|
91
|
+
}) : null, O.map((e, t) => /* @__PURE__ */ w("section", {
|
|
92
|
+
className: "local-static-tab",
|
|
93
|
+
children: [/* @__PURE__ */ C("h4", {
|
|
94
|
+
className: "local-static-tab-label",
|
|
95
|
+
children: A[t]
|
|
96
|
+
}), /* @__PURE__ */ C("div", {
|
|
97
|
+
className: "local-static-tab-body",
|
|
98
|
+
children: u.render(e.children, _)
|
|
99
|
+
})]
|
|
100
|
+
}, e.id))]
|
|
101
|
+
});
|
|
102
|
+
let R = M ? k.includes(P) ? P : k[0] : k.includes(F) ? F : k[0], z = Math.max(0, k.indexOf(R)), B = (e) => {
|
|
103
|
+
let t = k[e];
|
|
104
|
+
t !== void 0 && (M ? S(t) : I(t), L.current[e]?.focus());
|
|
105
|
+
}, V = (e) => {
|
|
106
|
+
let t = -1;
|
|
107
|
+
e.key === "ArrowRight" ? t = (z + 1) % O.length : e.key === "ArrowLeft" ? t = (z - 1 + O.length) % O.length : e.key === "Home" ? t = 0 : e.key === "End" && (t = O.length - 1), !(t < 0) && (e.preventDefault(), B(t));
|
|
108
|
+
};
|
|
109
|
+
return /* @__PURE__ */ w("section", {
|
|
110
|
+
...t(),
|
|
111
|
+
className: "md-tabs local-tabs",
|
|
112
|
+
"aria-label": E || v("Tabs", "选项卡"),
|
|
113
|
+
"aria-invalid": D.invalid || void 0,
|
|
114
|
+
"aria-describedby": D.describedBy,
|
|
115
|
+
children: [
|
|
116
|
+
E ? /* @__PURE__ */ C("div", {
|
|
117
|
+
className: "local-tabs-label",
|
|
118
|
+
children: E
|
|
119
|
+
}) : null,
|
|
120
|
+
/* @__PURE__ */ C("div", {
|
|
121
|
+
className: "md-tablist local-tablist",
|
|
122
|
+
role: "tablist",
|
|
123
|
+
"aria-label": E || v("Tabs", "选项卡"),
|
|
124
|
+
onKeyDown: V,
|
|
125
|
+
children: O.map((e, t) => {
|
|
126
|
+
let n = k[t], r = n === R;
|
|
127
|
+
return /* @__PURE__ */ C("button", {
|
|
128
|
+
ref: (e) => {
|
|
129
|
+
L.current[t] = e;
|
|
130
|
+
},
|
|
131
|
+
id: `${d}-tab-${t}`,
|
|
132
|
+
type: "button",
|
|
133
|
+
role: "tab",
|
|
134
|
+
className: `md-tab local-tab${r ? " is-selected" : ""}`,
|
|
135
|
+
"aria-selected": r,
|
|
136
|
+
"aria-controls": `${d}-panel-${t}`,
|
|
137
|
+
tabIndex: r ? 0 : -1,
|
|
138
|
+
onClick: () => {
|
|
139
|
+
M ? S(n) : I(n);
|
|
140
|
+
},
|
|
141
|
+
children: A[t]
|
|
142
|
+
}, e.id);
|
|
143
|
+
})
|
|
144
|
+
}),
|
|
145
|
+
O.map((e, t) => {
|
|
146
|
+
let n = k[t] === R;
|
|
147
|
+
return /* @__PURE__ */ w("div", {
|
|
148
|
+
id: `${d}-panel-${t}`,
|
|
149
|
+
className: "md-tabpanel local-tabpanel",
|
|
150
|
+
role: "tabpanel",
|
|
151
|
+
"aria-labelledby": `${d}-tab-${t}`,
|
|
152
|
+
tabIndex: 0,
|
|
153
|
+
hidden: !n,
|
|
154
|
+
children: [/* @__PURE__ */ C(f, {
|
|
155
|
+
block: !0,
|
|
156
|
+
value: A[t]
|
|
157
|
+
}), u.render(e.children, _ && n)]
|
|
158
|
+
}, e.id);
|
|
159
|
+
}),
|
|
160
|
+
/* @__PURE__ */ C(m, { message: T })
|
|
161
|
+
]
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
function N(e) {
|
|
165
|
+
let t = n(e), u = r(e), d = y(), { content: f, mode: p, visible: g, t: _ } = u, { write: x, error: S, setError: T } = s(e), E = a(e, "label", ""), D = c(e), O = f.children.filter((e) => e.kind === "component" && e.name === "step"), k = O.map((e, t) => i(e, "value") ?? `step-${t + 1}`), A = O.map((t, n) => o(e, t, "label", k[n])), j = i(f, "initial") ?? "", M = k.includes(j) ? j : k[0] ?? "", N = e.runtime.get(f), P = typeof N == "string" ? N : "", F = b([]), I = b(!1);
|
|
166
|
+
h(e, () => {
|
|
167
|
+
T(null), I.current = !1;
|
|
168
|
+
});
|
|
169
|
+
let L = k.includes(P) ? P : M, R = Math.max(0, k.indexOf(L));
|
|
170
|
+
if (v(() => {
|
|
171
|
+
I.current && (I.current = !1, F.current[R]?.focus({ preventScroll: !0 }));
|
|
172
|
+
}, [R, L]), O.length === 0) return /* @__PURE__ */ C(l, { message: _("Steps requires at least one step", "步骤至少需要一个 step") });
|
|
173
|
+
if (p === "static") {
|
|
174
|
+
let e = O[R];
|
|
175
|
+
return /* @__PURE__ */ w("section", {
|
|
176
|
+
...t(),
|
|
177
|
+
className: "local-steps local-static-steps",
|
|
178
|
+
"aria-label": E || _("Steps", "步骤"),
|
|
179
|
+
children: [
|
|
180
|
+
E ? /* @__PURE__ */ C("div", {
|
|
181
|
+
className: "local-steps-label",
|
|
182
|
+
children: E
|
|
183
|
+
}) : null,
|
|
184
|
+
/* @__PURE__ */ C("ol", {
|
|
185
|
+
className: "local-steps-rail",
|
|
186
|
+
"aria-hidden": "true",
|
|
187
|
+
style: { "--local-steps-progress": `${O.length <= 1 ? 100 : R / (O.length - 1) * 100}%` },
|
|
188
|
+
children: O.map((e, t) => /* @__PURE__ */ C("li", {
|
|
189
|
+
className: `local-steps-dot${t < R ? " is-complete" : t === R ? " is-current" : ""}`,
|
|
190
|
+
children: /* @__PURE__ */ C("span", { children: t + 1 })
|
|
191
|
+
}, e.id))
|
|
192
|
+
}),
|
|
193
|
+
/* @__PURE__ */ C("div", {
|
|
194
|
+
className: "local-steps-nav local-static-steps-nav",
|
|
195
|
+
children: /* @__PURE__ */ C("span", {
|
|
196
|
+
className: "local-steps-status",
|
|
197
|
+
role: "status",
|
|
198
|
+
"aria-live": "polite",
|
|
199
|
+
children: _(`Step ${R + 1} of ${O.length}`, `第 ${R + 1} 步,共 ${O.length} 步`)
|
|
200
|
+
})
|
|
201
|
+
}),
|
|
202
|
+
/* @__PURE__ */ C("div", {
|
|
203
|
+
className: "local-steps-panel",
|
|
204
|
+
role: "group",
|
|
205
|
+
"aria-label": A[R],
|
|
206
|
+
children: u.render(e.children, g)
|
|
207
|
+
})
|
|
208
|
+
]
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
let z = (e) => {
|
|
212
|
+
let t = k[e];
|
|
213
|
+
t !== void 0 && (I.current = !0, x(t));
|
|
214
|
+
};
|
|
215
|
+
return /* @__PURE__ */ w("section", {
|
|
216
|
+
...t(),
|
|
217
|
+
className: "local-steps",
|
|
218
|
+
"aria-label": E || _("Steps", "步骤"),
|
|
219
|
+
"aria-invalid": D.invalid || void 0,
|
|
220
|
+
"aria-describedby": D.describedBy,
|
|
221
|
+
children: [
|
|
222
|
+
E ? /* @__PURE__ */ C("div", {
|
|
223
|
+
className: "local-steps-label",
|
|
224
|
+
children: E
|
|
225
|
+
}) : null,
|
|
226
|
+
/* @__PURE__ */ C("ol", {
|
|
227
|
+
className: "local-steps-rail",
|
|
228
|
+
"aria-hidden": "true",
|
|
229
|
+
style: { "--local-steps-progress": `${O.length <= 1 ? 100 : R / (O.length - 1) * 100}%` },
|
|
230
|
+
children: O.map((e, t) => /* @__PURE__ */ C("li", {
|
|
231
|
+
className: `local-steps-dot${t < R ? " is-complete" : t === R ? " is-current" : ""}`,
|
|
232
|
+
children: /* @__PURE__ */ C("span", { children: t + 1 })
|
|
233
|
+
}, e.id))
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ w("div", {
|
|
236
|
+
className: "local-steps-nav",
|
|
237
|
+
children: [
|
|
238
|
+
/* @__PURE__ */ C("button", {
|
|
239
|
+
type: "button",
|
|
240
|
+
className: "md-button md-button-secondary local-steps-prev",
|
|
241
|
+
disabled: R <= 0,
|
|
242
|
+
onClick: () => z(R - 1),
|
|
243
|
+
children: _("Previous", "上一步")
|
|
244
|
+
}),
|
|
245
|
+
/* @__PURE__ */ C("span", {
|
|
246
|
+
className: "local-steps-status",
|
|
247
|
+
role: "status",
|
|
248
|
+
"aria-live": "polite",
|
|
249
|
+
children: _(`Step ${R + 1} of ${O.length}`, `第 ${R + 1} 步,共 ${O.length} 步`)
|
|
250
|
+
}),
|
|
251
|
+
/* @__PURE__ */ C("button", {
|
|
252
|
+
type: "button",
|
|
253
|
+
className: "md-button md-button-secondary local-steps-next",
|
|
254
|
+
disabled: R >= O.length - 1,
|
|
255
|
+
onClick: () => z(R + 1),
|
|
256
|
+
children: _("Next", "下一步")
|
|
257
|
+
})
|
|
258
|
+
]
|
|
259
|
+
}),
|
|
260
|
+
O.map((e, t) => {
|
|
261
|
+
let n = t === R;
|
|
262
|
+
return /* @__PURE__ */ C("div", {
|
|
263
|
+
id: `${d}-step-${t}`,
|
|
264
|
+
ref: (e) => {
|
|
265
|
+
F.current[t] = e;
|
|
266
|
+
},
|
|
267
|
+
className: "local-steps-panel",
|
|
268
|
+
role: "group",
|
|
269
|
+
"aria-label": A[t],
|
|
270
|
+
tabIndex: -1,
|
|
271
|
+
hidden: !n,
|
|
272
|
+
children: u.render(e.children, g && n)
|
|
273
|
+
}, e.id);
|
|
274
|
+
}),
|
|
275
|
+
/* @__PURE__ */ C(m, { message: S })
|
|
276
|
+
]
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
function P() {
|
|
280
|
+
return null;
|
|
281
|
+
}
|
|
282
|
+
function F(e) {
|
|
283
|
+
let t = n(e), i = r(e), o = a(e, "label", "");
|
|
284
|
+
return /* @__PURE__ */ w("div", {
|
|
285
|
+
...t(),
|
|
286
|
+
className: "local-accordion",
|
|
287
|
+
role: "group",
|
|
288
|
+
"aria-label": o || i.t("Accordion", "折叠面板"),
|
|
289
|
+
children: [o ? /* @__PURE__ */ C("div", {
|
|
290
|
+
className: "local-accordion-label",
|
|
291
|
+
children: o
|
|
292
|
+
}) : null, i.render()]
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
function I(e) {
|
|
296
|
+
let t = n(e), i = r(e), o = y(), { mode: s, visible: c, t: l } = i, u = a(e, "label", l("Details", "折叠内容")), d = p(e, "open", !1), [m, g] = x(d);
|
|
297
|
+
if (h(e, () => {
|
|
298
|
+
g(d);
|
|
299
|
+
}), s === "static") return /* @__PURE__ */ w("section", {
|
|
300
|
+
...t(),
|
|
301
|
+
className: "local-disclosure local-static-disclosure",
|
|
302
|
+
children: [/* @__PURE__ */ C("h3", {
|
|
303
|
+
className: "local-disclosure-heading",
|
|
304
|
+
children: u
|
|
305
|
+
}), /* @__PURE__ */ C("div", {
|
|
306
|
+
className: "local-disclosure-panel",
|
|
307
|
+
children: i.render()
|
|
308
|
+
})]
|
|
309
|
+
});
|
|
310
|
+
let _ = `${o}-disclosure-trigger`, v = `${o}-disclosure-panel`;
|
|
311
|
+
return /* @__PURE__ */ w("div", {
|
|
312
|
+
...t(),
|
|
313
|
+
className: "local-disclosure",
|
|
314
|
+
children: [/* @__PURE__ */ w("h3", {
|
|
315
|
+
className: "local-disclosure-heading",
|
|
316
|
+
children: [/* @__PURE__ */ w("button", {
|
|
317
|
+
id: _,
|
|
318
|
+
type: "button",
|
|
319
|
+
className: "local-disclosure-trigger",
|
|
320
|
+
"data-rmd-appearance": "custom",
|
|
321
|
+
"aria-expanded": m,
|
|
322
|
+
"aria-controls": v,
|
|
323
|
+
onClick: () => g((e) => !e),
|
|
324
|
+
children: [/* @__PURE__ */ C("span", {
|
|
325
|
+
className: "local-disclosure-label",
|
|
326
|
+
children: u
|
|
327
|
+
}), /* @__PURE__ */ C("svg", {
|
|
328
|
+
className: `local-chevron${m ? " is-open" : ""}`,
|
|
329
|
+
viewBox: "0 0 24 24",
|
|
330
|
+
width: "17",
|
|
331
|
+
height: "17",
|
|
332
|
+
fill: "none",
|
|
333
|
+
stroke: "currentColor",
|
|
334
|
+
strokeWidth: "1.75",
|
|
335
|
+
strokeLinecap: "round",
|
|
336
|
+
strokeLinejoin: "round",
|
|
337
|
+
"aria-hidden": "true",
|
|
338
|
+
focusable: "false",
|
|
339
|
+
children: /* @__PURE__ */ C("path", { d: "m6 9 6 6 6-6" })
|
|
340
|
+
})]
|
|
341
|
+
}), /* @__PURE__ */ C(f, { value: u })]
|
|
342
|
+
}), /* @__PURE__ */ C("div", {
|
|
343
|
+
id: v,
|
|
344
|
+
className: "local-disclosure-panel",
|
|
345
|
+
role: "region",
|
|
346
|
+
"aria-labelledby": _,
|
|
347
|
+
hidden: !m,
|
|
348
|
+
inert: !m,
|
|
349
|
+
children: /* @__PURE__ */ C("div", {
|
|
350
|
+
className: "local-disclosure-body",
|
|
351
|
+
children: i.render(void 0, c)
|
|
352
|
+
})
|
|
353
|
+
})]
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
function L(e) {
|
|
357
|
+
let t = n(e)(), a = r(e), { content: o, t: s, visible: c } = a, u = i(o, "when"), d = e.props.when, f = typeof d == "boolean" && d, p = u !== void 0 && typeof d != "boolean", m = b(null), h = b(f), g = b(!1);
|
|
358
|
+
return v(() => {
|
|
359
|
+
if (h.current && !f) {
|
|
360
|
+
if (g.current) {
|
|
361
|
+
let e = m.current?.closest(".local-document");
|
|
362
|
+
e && (e.tabIndex = -1, e.focus({ preventScroll: !0 }));
|
|
363
|
+
}
|
|
364
|
+
g.current = !1;
|
|
365
|
+
}
|
|
366
|
+
h.current = f;
|
|
367
|
+
}, [f]), /* @__PURE__ */ w(S, { children: [p ? /* @__PURE__ */ C(l, { message: s("Cannot compute", "无法计算") }) : null, /* @__PURE__ */ C("div", {
|
|
368
|
+
style: t.style,
|
|
369
|
+
ref: (e) => {
|
|
370
|
+
m.current = e, t.ref?.(e);
|
|
371
|
+
},
|
|
372
|
+
className: "local-if md-if",
|
|
373
|
+
role: "group",
|
|
374
|
+
"aria-label": s("Conditional content", "条件内容"),
|
|
375
|
+
tabIndex: -1,
|
|
376
|
+
hidden: !f,
|
|
377
|
+
"aria-hidden": !f,
|
|
378
|
+
onFocus: () => {
|
|
379
|
+
g.current = !0;
|
|
380
|
+
},
|
|
381
|
+
onBlur: (e) => {
|
|
382
|
+
m.current?.contains(e.relatedTarget) || (g.current = !1);
|
|
383
|
+
},
|
|
384
|
+
children: a.render(void 0, c && f)
|
|
385
|
+
})] });
|
|
386
|
+
}
|
|
387
|
+
function R(e) {
|
|
388
|
+
let i = n(e), o = r(e), s = a(e, "title", ""), { tone: c, error: l } = t(e, "tone", [
|
|
389
|
+
"info",
|
|
390
|
+
"success",
|
|
391
|
+
"warning",
|
|
392
|
+
"error"
|
|
393
|
+
], "info"), d = c === "warning" || c === "error" ? "alert" : "status";
|
|
394
|
+
return /* @__PURE__ */ w(S, { children: [l ? /* @__PURE__ */ C(u, { message: o.t("Invalid tone; using the default style", "色调无效,已使用默认样式") }) : null, /* @__PURE__ */ w("div", {
|
|
395
|
+
className: `md-alert md-alert-${c} local-alert local-alert-${c}`,
|
|
396
|
+
role: d,
|
|
397
|
+
...i(),
|
|
398
|
+
children: [s ? /* @__PURE__ */ C("div", {
|
|
399
|
+
className: "md-alert-title local-alert-title",
|
|
400
|
+
children: s
|
|
401
|
+
}) : null, /* @__PURE__ */ C("div", {
|
|
402
|
+
className: "md-alert-body local-alert-body",
|
|
403
|
+
children: o.render()
|
|
404
|
+
})]
|
|
405
|
+
})] });
|
|
406
|
+
}
|
|
407
|
+
function z(i) {
|
|
408
|
+
let a = n(i), o = r(i), { tone: s, error: c } = t(i, "tone", [
|
|
409
|
+
"neutral",
|
|
410
|
+
"success",
|
|
411
|
+
"warning"
|
|
412
|
+
], "neutral"), l = e(o.content);
|
|
413
|
+
return /* @__PURE__ */ w(S, { children: [c ? /* @__PURE__ */ C(u, { message: o.t("Invalid tone; using the default style", "色调无效,已使用默认样式") }) : null, /* @__PURE__ */ C("span", {
|
|
414
|
+
className: `md-badge md-badge-${s} local-badge`,
|
|
415
|
+
...a(l ? { color: l } : void 0),
|
|
416
|
+
children: /* @__PURE__ */ C("span", {
|
|
417
|
+
className: "md-badge-label",
|
|
418
|
+
children: o.renderInline()
|
|
419
|
+
})
|
|
420
|
+
})] });
|
|
421
|
+
}
|
|
422
|
+
function B(e) {
|
|
423
|
+
let t = n(e), i = r(e), o = y(), { mode: s, t: c } = i, l = a(e, "text", c("Tooltip", "提示")), [u, d] = x(!1), p = b(null), m = b(null), h = `${o}-tooltip`, S = u && e.visible && s !== "static";
|
|
424
|
+
return g(m, S), v(() => d(!1), [
|
|
425
|
+
e.visible,
|
|
426
|
+
e.resetToken,
|
|
427
|
+
s
|
|
428
|
+
]), _(() => {
|
|
429
|
+
let e = m.current, t = p.current;
|
|
430
|
+
if (!S || !e || !t) return;
|
|
431
|
+
let n = () => {
|
|
432
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = Number.parseFloat(getComputedStyle(e).getPropertyValue("--space-2")) || 8, a = Math.max(8, Math.min(r.left, window.innerWidth - n.width - 8)), o = r.top - n.height - i, s = o >= 8 ? o : Math.max(8, Math.min(r.bottom + i, window.innerHeight - n.height - 8));
|
|
433
|
+
e.style.left = `${a}px`, e.style.top = `${s}px`;
|
|
434
|
+
};
|
|
435
|
+
n(), window.addEventListener("resize", n), window.addEventListener("scroll", n, {
|
|
436
|
+
capture: !0,
|
|
437
|
+
passive: !0
|
|
438
|
+
});
|
|
439
|
+
let r = new ResizeObserver(n);
|
|
440
|
+
return r.observe(t), r.observe(e), () => {
|
|
441
|
+
window.removeEventListener("resize", n), window.removeEventListener("scroll", n, !0), r.disconnect();
|
|
442
|
+
};
|
|
443
|
+
}, [S, l]), s === "static" ? /* @__PURE__ */ w("span", {
|
|
444
|
+
...t(),
|
|
445
|
+
className: "local-tooltip local-static-tooltip",
|
|
446
|
+
children: [/* @__PURE__ */ C("span", {
|
|
447
|
+
className: "local-tooltip-trigger",
|
|
448
|
+
children: i.renderInline()
|
|
449
|
+
}), /* @__PURE__ */ C("span", {
|
|
450
|
+
className: "md-tooltip local-tooltip-bubble is-visible",
|
|
451
|
+
role: "note",
|
|
452
|
+
children: l
|
|
453
|
+
})]
|
|
454
|
+
}) : /* @__PURE__ */ w("span", {
|
|
455
|
+
...t(),
|
|
456
|
+
className: "local-tooltip",
|
|
457
|
+
onMouseEnter: () => d(!0),
|
|
458
|
+
onMouseLeave: () => d(!1),
|
|
459
|
+
children: [
|
|
460
|
+
/* @__PURE__ */ C("span", {
|
|
461
|
+
className: "local-tooltip-trigger",
|
|
462
|
+
ref: p,
|
|
463
|
+
tabIndex: 0,
|
|
464
|
+
"aria-describedby": h,
|
|
465
|
+
onFocus: () => d(!0),
|
|
466
|
+
onBlur: () => d(!1),
|
|
467
|
+
onKeyDown: (e) => {
|
|
468
|
+
e.key === "Escape" && (e.stopPropagation(), d(!1));
|
|
469
|
+
},
|
|
470
|
+
children: i.renderInline()
|
|
471
|
+
}),
|
|
472
|
+
/* @__PURE__ */ C("span", {
|
|
473
|
+
id: h,
|
|
474
|
+
ref: m,
|
|
475
|
+
role: "tooltip",
|
|
476
|
+
popover: "manual",
|
|
477
|
+
className: `md-tooltip local-tooltip-bubble${S ? " is-visible" : ""}`,
|
|
478
|
+
children: l
|
|
479
|
+
}),
|
|
480
|
+
/* @__PURE__ */ C(f, { value: l })
|
|
481
|
+
]
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
function V(t) {
|
|
485
|
+
let a = n(t), o = r(t), s = y(), { content: c, mode: l, t: u } = o, f = `${s}-jump-feedback`, [p, m] = x(null), g = i(c, "to") ?? "", _ = o.navigation.targetId(g), v = i(c, "appearance") === "button" ? "button" : "link", b = e(c), T = _ ? `#${_}` : "#", E = _ !== void 0 && o.navigation.allowed(g);
|
|
486
|
+
if (h(t, () => m(null)), l === "static") return E && _ ? /* @__PURE__ */ C("a", {
|
|
487
|
+
href: `#${_}`,
|
|
488
|
+
className: "local-jump local-jump-link local-jump-static",
|
|
489
|
+
...a(d(b)),
|
|
490
|
+
children: o.renderInline()
|
|
491
|
+
}) : /* @__PURE__ */ C("span", {
|
|
492
|
+
className: "local-jump local-jump-static-blocked",
|
|
493
|
+
...a(d(b)),
|
|
494
|
+
children: o.renderInline()
|
|
495
|
+
});
|
|
496
|
+
let D = (e) => {
|
|
497
|
+
if (!E || !_) {
|
|
498
|
+
e.preventDefault(), m(_ ? u("Jump is blocked by the host", "跳转已被主机策略阻止") : u("Jump target not found", "找不到跳转目标"));
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
|
|
502
|
+
let t = o.navigation.jump(g);
|
|
503
|
+
t === "missing" ? (e.preventDefault(), m(u("Jump target not found", "找不到跳转目标"))) : t === "hidden" ? (e.preventDefault(), m(u("Jump target is hidden", "跳转目标当前隐藏"))) : (e.preventDefault(), m(null));
|
|
504
|
+
};
|
|
505
|
+
return /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C("a", {
|
|
506
|
+
href: E ? T : "#",
|
|
507
|
+
className: v === "button" ? "local-jump local-jump-button md-button md-button-secondary" : "local-jump local-jump-link",
|
|
508
|
+
...a(d(b)),
|
|
509
|
+
"data-local-custom-color": b ? "true" : void 0,
|
|
510
|
+
"data-local-target-missing": _ ? void 0 : "true",
|
|
511
|
+
"data-local-jump-blocked": _ && !E ? "true" : void 0,
|
|
512
|
+
"aria-describedby": p ? f : void 0,
|
|
513
|
+
onClick: D,
|
|
514
|
+
children: o.renderInline()
|
|
515
|
+
}), p ? /* @__PURE__ */ C("span", {
|
|
516
|
+
id: f,
|
|
517
|
+
className: "local-jump-feedback",
|
|
518
|
+
role: "status",
|
|
519
|
+
"aria-live": "polite",
|
|
520
|
+
children: p
|
|
521
|
+
}) : null] });
|
|
522
|
+
}
|
|
523
|
+
function H(e) {
|
|
524
|
+
let t = n(e), i = r(e).navigation.anchorId();
|
|
525
|
+
return i ? /* @__PURE__ */ C("span", {
|
|
526
|
+
...t(),
|
|
527
|
+
className: "local-anchor",
|
|
528
|
+
id: i,
|
|
529
|
+
"data-local-anchor": ""
|
|
530
|
+
}) : null;
|
|
531
|
+
}
|
|
532
|
+
function U(t) {
|
|
533
|
+
let i = n(t), a = r(t), o = e(a.content);
|
|
534
|
+
return /* @__PURE__ */ C("span", {
|
|
535
|
+
className: "local-text",
|
|
536
|
+
...i(o ? { color: o } : void 0),
|
|
537
|
+
children: a.renderInline()
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
function W(t) {
|
|
541
|
+
let i = n(t), a = r(t), o = e(a.content);
|
|
542
|
+
return /* @__PURE__ */ C("div", {
|
|
543
|
+
className: "local-section",
|
|
544
|
+
...i(o ? { color: o } : void 0),
|
|
545
|
+
children: a.render()
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
function G(e) {
|
|
549
|
+
let t = n(e), i = r(e), a = e.validation.hintFor(e.content);
|
|
550
|
+
if (!a) return null;
|
|
551
|
+
let o = a.failed || a.error, s = i.visible && o;
|
|
552
|
+
return /* @__PURE__ */ C("span", {
|
|
553
|
+
...t(),
|
|
554
|
+
id: a.id,
|
|
555
|
+
className: "local-validation-hint",
|
|
556
|
+
"data-local-validation": a.error ? "error" : a.failed ? "failed" : "passed",
|
|
557
|
+
role: s ? "status" : void 0,
|
|
558
|
+
"aria-live": s ? "polite" : void 0,
|
|
559
|
+
children: o ? a.message : null
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
export { O as _, E as a, B as b, j as c, V as d, k as f, N as g, P as h, z as i, D as l, W as m, R as n, A as o, T as p, H as r, I as s, F as t, L as u, M as v, G as x, U as y };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z as e } from "./preset-core-CKc5YXSM.js";
|
|
2
|
-
import {
|
|
3
|
-
import { r as n } from "./package-core-
|
|
2
|
+
import { G as t } from "./sdk-core-BoJT1SIt.js";
|
|
3
|
+
import { r as n } from "./package-core-WFK1RhAZ.js";
|
|
4
4
|
// src/components/mount-preset.ts
|
|
5
5
|
function r(r, i, a = []) {
|
|
6
6
|
return n({
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { b as e, g as t, y as n } from "./validation-BEBA_HvS.js";
|
|
2
|
+
import { t as r } from "./parser-standard-Yuf3A_VI.js";
|
|
3
|
+
import i from "./reactive-md-default-preset.js";
|
|
4
|
+
import { a, o, s } from "./config-BadfhjdP.js";
|
|
5
|
+
import { n as c } from "./registry-B9NGct4d.js";
|
|
6
|
+
// src/local/configuration/options.ts
|
|
7
|
+
function l(e) {
|
|
8
|
+
return n(e, {
|
|
9
|
+
defaults: c(),
|
|
10
|
+
preset: {
|
|
11
|
+
id: i.id,
|
|
12
|
+
version: i.version
|
|
13
|
+
},
|
|
14
|
+
defaultConfigKey: a(),
|
|
15
|
+
readConfig: (e) => s(e),
|
|
16
|
+
configKey: (e) => a(e),
|
|
17
|
+
capabilities: r
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function u(e) {
|
|
21
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
22
|
+
}
|
|
23
|
+
var d = 256, f = 4096, p = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new WeakMap(), g = 0;
|
|
24
|
+
function _() {
|
|
25
|
+
return g += 1, g;
|
|
26
|
+
}
|
|
27
|
+
function v(e) {
|
|
28
|
+
if (typeof e == "object" && e || typeof e == "function") {
|
|
29
|
+
let t = e, n = h.get(t);
|
|
30
|
+
return n === void 0 && (n = _(), h.set(t, n)), `unreadable#${n}`;
|
|
31
|
+
}
|
|
32
|
+
return `unreadable:${typeof e}:${String(e)}`;
|
|
33
|
+
}
|
|
34
|
+
function y(e) {
|
|
35
|
+
let t = [], n = 0, r = (e) => {
|
|
36
|
+
if (n += 1, n > f) throw RangeError("signature budget");
|
|
37
|
+
switch (typeof e) {
|
|
38
|
+
case "string": return `s${JSON.stringify(e)}`;
|
|
39
|
+
case "number": return `n${Object.is(e, -0) ? "-0" : String(e)}`;
|
|
40
|
+
case "boolean": return e ? "b1" : "b0";
|
|
41
|
+
case "undefined": return "u";
|
|
42
|
+
case "bigint": return `g${e.toString()}`;
|
|
43
|
+
case "symbol": {
|
|
44
|
+
let t = m.get(e);
|
|
45
|
+
return t === void 0 && (t = _(), m.set(e, t)), `y${t}`;
|
|
46
|
+
}
|
|
47
|
+
case "function": {
|
|
48
|
+
let t = p.get(e);
|
|
49
|
+
return t === void 0 && (t = _(), p.set(e, t)), `f${t}`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (e === null) return "null";
|
|
53
|
+
let i = e, a = t.indexOf(i);
|
|
54
|
+
if (a >= 0) return `r${a}`;
|
|
55
|
+
t.push(i);
|
|
56
|
+
try {
|
|
57
|
+
if (Array.isArray(i)) {
|
|
58
|
+
let e = Math.min(i.length, 8);
|
|
59
|
+
if (i.length > d) {
|
|
60
|
+
let t = `a#${i.length}[`;
|
|
61
|
+
for (let n = 0; n < e; n += 1) t += `${r(i[n])},`;
|
|
62
|
+
return `${t}]`;
|
|
63
|
+
}
|
|
64
|
+
let t = `a${i.length}[`;
|
|
65
|
+
for (let e = 0; e < i.length; e += 1) t += `${r(i[e])},`;
|
|
66
|
+
return `${t}]`;
|
|
67
|
+
}
|
|
68
|
+
let e = Object.keys(i);
|
|
69
|
+
if (e.length > d) {
|
|
70
|
+
let t = `o#${e.length}{`;
|
|
71
|
+
for (let n of e.slice(0, 8)) t += `${r(n)},`;
|
|
72
|
+
return `${t}}`;
|
|
73
|
+
}
|
|
74
|
+
e.sort();
|
|
75
|
+
let t = "o{";
|
|
76
|
+
for (let n of e) t += `${r(n)}:${r(i[n])},`;
|
|
77
|
+
return `${t}}`;
|
|
78
|
+
} finally {
|
|
79
|
+
t.pop();
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
try {
|
|
83
|
+
return r(e);
|
|
84
|
+
} catch {
|
|
85
|
+
return v(e);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function b(e) {
|
|
89
|
+
return S(e, !0);
|
|
90
|
+
}
|
|
91
|
+
function x(e) {
|
|
92
|
+
return S(e, !1);
|
|
93
|
+
}
|
|
94
|
+
function S(n, r) {
|
|
95
|
+
if (n === void 0 && (n = {}), !u(n)) return "invalid";
|
|
96
|
+
let i = r ? t.map((t) => {
|
|
97
|
+
let r = Object.hasOwn(n, t) ? n[t] : void 0;
|
|
98
|
+
return r === void 0 ? e[t] ? "1" : "0" : r === !0 ? "1" : r === !1 ? "0" : "!";
|
|
99
|
+
}).join("") : "", a = "";
|
|
100
|
+
if (Object.hasOwn(n, "limits")) {
|
|
101
|
+
let e = n.limits;
|
|
102
|
+
if (e === void 0) a = "default";
|
|
103
|
+
else if (!u(e)) a = "invalid";
|
|
104
|
+
else {
|
|
105
|
+
let t = (t) => !Object.hasOwn(e, t) || e[t] === void 0 ? "default" : String(e[t]);
|
|
106
|
+
a = `${t("maxSyntaxNodes")}:${t("maxParseWork")}:${t("maxMarkdownDepth")}`;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
let s = "";
|
|
110
|
+
if (Object.hasOwn(n, "hostComponents") && n.hostComponents !== void 0) {
|
|
111
|
+
let e = n.hostComponents;
|
|
112
|
+
try {
|
|
113
|
+
Array.isArray(e) ? e.length > 0 && (s = e.length > 32 ? `:hosts=oversize:${e.length}` : `:hosts=${y(e)}`) : s = `:hosts=${y(e)}`;
|
|
114
|
+
} catch {
|
|
115
|
+
s = `:hosts=${v(e)}`;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
let c = !Object.hasOwn(n, "markdownBreaks") || n.markdownBreaks === void 0 ? "-" : n.markdownBreaks === !0 ? "1" : n.markdownBreaks === !1 ? "0" : "!", l = !Object.hasOwn(n, "strict") || n.strict === void 0 || n.strict === !0 ? "strict=1" : n.strict === !1 ? "strict=0:recovery=2" : "strict=!", d = "";
|
|
119
|
+
return Object.hasOwn(n, "config") && n.config !== void 0 && (d = `:config=${o(n.config)}`), `${i}:${a}:${c}:${l}${s}${d}`;
|
|
120
|
+
}
|
|
121
|
+
export { x as n, l as r, b as t };
|