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.
Files changed (162) hide show
  1. package/CHANGELOG-ch.md +13 -0
  2. package/CHANGELOG.md +13 -0
  3. package/README-ch.md +6 -6
  4. package/README-en.md +6 -6
  5. package/README.md +6 -6
  6. package/SECURITY-ch.md +3 -3
  7. package/SECURITY.md +3 -3
  8. package/THIRD_PARTY_NOTICES.md +111 -1
  9. package/cli/build.mjs +1 -0
  10. package/cli/init.mjs +1 -1
  11. package/dist-library/{LocalDocumentView-K7Y-2bRJ.js → LocalDocumentView-sthUP0ct.js} +10 -10
  12. package/dist-library/LocalDocumentViewCore-GiWV3bey.js +9829 -0
  13. package/dist-library/LocalReactiveDocumentCore-ZjQSGyHE.js +275 -0
  14. package/dist-library/{authoring-Co_TiE-P.js → authoring-Dsune4Hy.js} +40 -20
  15. package/dist-library/{compile-LhpTKqCR.js → compile-wUv8KEge.js} +1 -1
  16. package/dist-library/{compiler-core-DTxY-qYz.js → compiler-core-As_m-MNm.js} +2449 -1742
  17. package/dist-library/{compiler-DfGbQhyD.js → compiler-eOfcinZs.js} +19 -19
  18. package/dist-library/{component-state-BBJ08vML.js → component-state-C52ZFJGl.js} +1 -1
  19. package/dist-library/{config-BUo-8O5C.js → config-BadfhjdP.js} +1 -1
  20. package/dist-library/{config-validation-C5kJYk-J.js → config-validation-F47AcE6o.js} +49 -1
  21. package/dist-library/{controls-BWiLLtBO.js → controls-CcT6n7k_.js} +2433 -2409
  22. package/dist-library/{coordinate-BSl6enWV.js → coordinate-CWS9p5q_.js} +108 -107
  23. package/dist-library/{data-table-DfvytZKQ.js → data-table-Bgccxd7h.js} +68 -65
  24. package/dist-library/{display-lw3BT1TA.js → display-B-VhqVND.js} +1 -1
  25. package/dist-library/{export-C7IDW9ul.js → export-BqVmTXm8.js} +145 -87
  26. package/dist-library/{gallery-B8kSt1oI.js → gallery-CY6mTx8i.js} +151 -147
  27. package/dist-library/html-CNT4KD-2.js +757 -0
  28. package/dist-library/{incremental-D_6vwAAE.js → incremental-Dv0FSp_U.js} +404 -142
  29. package/dist-library/layout-C0YlEPGr.js +562 -0
  30. package/dist-library/{mount-preset-C5s9ebEH.js → mount-preset-KxvtKgJb.js} +2 -2
  31. package/dist-library/options-1aDLK7JY.js +121 -0
  32. package/dist-library/{package-core-D0POW4Gd.js → package-core-WFK1RhAZ.js} +3 -3
  33. package/dist-library/{parser-standard-OToYcOBL.js → parser-standard-Yuf3A_VI.js} +3270 -3778
  34. package/dist-library/react-D5iGiUdL.js +7 -0
  35. package/dist-library/reactive-md-authoring.js +16 -18
  36. package/dist-library/reactive-md-build.js +51 -51
  37. package/dist-library/reactive-md-compiler-standard.js +10 -9
  38. package/dist-library/reactive-md-compiler.js +3 -3
  39. package/dist-library/reactive-md-export.js +4 -4
  40. package/dist-library/reactive-md-minimal-react-preset.js +3 -3
  41. package/dist-library/reactive-md-pdf.js +127 -3
  42. package/dist-library/reactive-md-plugin-chart.js +2 -2
  43. package/dist-library/reactive-md-plugin-data.js +4 -4
  44. package/dist-library/reactive-md-plugin-diagram.js +3 -3
  45. package/dist-library/reactive-md-plugin-forms.js +2 -2
  46. package/dist-library/reactive-md-plugin-gallery.js +2 -2
  47. package/dist-library/reactive-md-plugin-navigation.js +2 -2
  48. package/dist-library/reactive-md-plugin-network.js +117 -115
  49. package/dist-library/reactive-md-plugin-plot.js +3 -3
  50. package/dist-library/reactive-md-react-minimal.js +4 -4
  51. package/dist-library/reactive-md-react-server.js +6 -6
  52. package/dist-library/reactive-md-react-unstyled.js +10 -11
  53. package/dist-library/reactive-md-react.js +10 -11
  54. package/dist-library/reactive-md-sdk.js +3 -3
  55. package/dist-library/reactive-md-standalone-configured.js +2 -2
  56. package/dist-library/reactive-md-standalone-host.js +2 -2
  57. package/dist-library/reactive-md-testing-browser.js +2 -2
  58. package/dist-library/reactive-md-testing-react.js +6 -6
  59. package/dist-library/reactive-md-testing.js +4 -4
  60. package/dist-library/reactive-md.js +280 -193
  61. package/dist-library/{registry-05JiqmEp.js → registry-B9NGct4d.js} +1 -1
  62. package/dist-library/{resources-IeJomeUT.js → resources-D2GDQS0p.js} +1 -1
  63. package/dist-library/{runtime-CuOyRe9f.js → runtime-kcA7bG7G.js} +341 -341
  64. package/dist-library/{schema-C-AeByPp.js → schema-BufhKUSM.js} +5 -5
  65. package/dist-library/{sdk-core-BJLJaVR5.js → sdk-core-BoJT1SIt.js} +490 -150
  66. package/dist-library/{session-core-BGka5D1J.js → session-core-nmJHuR9c.js} +170 -156
  67. package/dist-library/{shareable-jkGi2g6y.js → shareable-DpbE-59H.js} +207 -242
  68. package/dist-library/types/authoring/catalog.d.ts +1 -2
  69. package/dist-library/types/components/shared/visual-frame.d.ts +6 -2
  70. package/dist-library/types/local/compilation/compiler-capabilities.d.ts +3 -0
  71. package/dist-library/types/local/compilation/compiler-core.d.ts +11 -3
  72. package/dist-library/types/local/compilation/compiler-services.d.ts +8 -4
  73. package/dist-library/types/local/compilation/compiler.d.ts +3 -3
  74. package/dist-library/types/local/compilation/session/incremental.d.ts +20 -5
  75. package/dist-library/types/local/compilation/streaming.d.ts +27 -0
  76. package/dist-library/types/local/configuration/capability-policy.d.ts +3 -0
  77. package/dist-library/types/local/configuration/diagnostic-messages.d.ts +48 -0
  78. package/dist-library/types/local/configuration/options-core.d.ts +1 -2
  79. package/dist-library/types/local/configuration/options.d.ts +1 -0
  80. package/dist-library/types/local/css/author-css.d.ts +66 -0
  81. package/dist-library/types/local/html/extended-fragment.d.ts +41 -0
  82. package/dist-library/types/local/html/html.d.ts +39 -3
  83. package/dist-library/types/local/index.d.ts +1 -1
  84. package/dist-library/types/local/parsing/author-markdown.d.ts +11 -0
  85. package/dist-library/types/local/parsing/parse-session.d.ts +2 -2
  86. package/dist-library/types/local/parsing/parser-convert.d.ts +2 -1
  87. package/dist-library/types/local/parsing/parser-core.d.ts +8 -1
  88. package/dist-library/types/local/parsing/parser.d.ts +2 -2
  89. package/dist-library/types/local/rendering/document/ExtendedHtmlFragment.d.ts +14 -0
  90. package/dist-library/types/local/rendering/document/LocalDocumentViewCore.d.ts +25 -1
  91. package/dist-library/types/local/rendering/document/LocalReactiveDocumentCore.d.ts +1 -1
  92. package/dist-library/types/local/rendering/document/use-author-script.d.ts +3 -0
  93. package/dist-library/types/local/rendering/document/view-render-context.d.ts +11 -1
  94. package/dist-library/types/local/runtime/author-script-protocol.d.ts +59 -0
  95. package/dist-library/types/local/transport/worker.d.ts +27 -4
  96. package/dist-library/types/local/types.d.ts +52 -16
  97. package/dist-library/types/react/component-api.d.ts +10 -1
  98. package/dist-library/types/react/component-utils.d.ts +9 -1
  99. package/dist-library/types/react/sdk-core.d.ts +4 -1
  100. package/dist-library/types/shareable.d.ts +5 -4
  101. package/dist-library/types/standalone/prepare.d.ts +1 -1
  102. package/dist-library/types/standalone/session-core.d.ts +3 -2
  103. package/dist-library/{types-BFC5rzC4.js → types-BeNtPqdY.js} +1 -1
  104. package/dist-library/{validation-BlDL2uD9.js → validation-BEBA_HvS.js} +88 -72
  105. package/dist-library/{visual-frame-G8PHoj1e.js → visual-frame-CyV1FXzs.js} +6 -5
  106. package/dist-library/{visuals-BkYRmYGO.js → visuals-BZbZYA7w.js} +24181 -24180
  107. package/dist-standalone/reactive-md-standalone.js +124 -117
  108. package/docs/README-ch.md +2 -1
  109. package/docs/README.md +2 -1
  110. package/docs/compatibility/compatibility-ch.md +6 -6
  111. package/docs/compatibility/compatibility-en.md +6 -6
  112. package/docs/compatibility/source-versioning-ch.md +1 -1
  113. package/docs/compatibility/source-versioning-en.md +1 -1
  114. package/docs/development/component-development-ch.md +2 -2
  115. package/docs/development/component-development-en.md +2 -2
  116. package/docs/development/component-development-reference-ch.md +2 -2
  117. package/docs/development/component-development-reference-en.md +2 -2
  118. package/docs/development/component-protocol-ch.md +2 -2
  119. package/docs/development/component-protocol-en.md +2 -2
  120. package/docs/development/extension-tutorial-ch.md +3 -3
  121. package/docs/development/extension-tutorial-en.md +3 -3
  122. package/docs/integration/author-tools-ch.md +1 -1
  123. package/docs/integration/author-tools-en.md +1 -1
  124. package/docs/integration/compiler-ch.md +3 -1
  125. package/docs/integration/compiler-en.md +3 -1
  126. package/docs/integration/editor-ch.md +3 -3
  127. package/docs/integration/editor-en.md +3 -3
  128. package/docs/integration/extension-sdk-ch.md +2 -2
  129. package/docs/integration/extension-sdk-en.md +2 -2
  130. package/docs/integration/local-integration-ch.md +130 -8
  131. package/docs/integration/local-integration-en.md +130 -8
  132. package/docs/integration/shareable-export-ch.md +4 -2
  133. package/docs/integration/shareable-export-en.md +4 -2
  134. package/docs/reference/html-compatibility-ch.md +20 -67
  135. package/docs/reference/html-compatibility-en.md +19 -64
  136. package/docs/reference/public-api-ch.md +10 -7
  137. package/docs/reference/public-api-en.md +10 -7
  138. package/docs/releases/release-0.9.1-ch.md +29 -0
  139. package/docs/releases/release-0.9.1-en.md +29 -0
  140. package/examples/component-package/README-ch.md +1 -1
  141. package/examples/component-package/README.md +1 -1
  142. package/examples/game-2048-package/README-ch.md +1 -1
  143. package/examples/game-2048-package/README.md +1 -1
  144. package/examples/integration/README-ch.md +21 -2
  145. package/examples/integration/README.md +21 -2
  146. package/examples/integration/extension-sdk/README-ch.md +1 -1
  147. package/examples/integration/extension-sdk/README.md +1 -1
  148. package/examples/integration/streaming/index.html +48 -0
  149. package/examples/integration/streaming/main.js +175 -0
  150. package/examples/integration/streaming/package.json +13 -0
  151. package/examples/integration/streaming/worker.js +3 -0
  152. package/examples/minimal-extension/README-ch.md +3 -3
  153. package/examples/minimal-extension/README.md +3 -3
  154. package/examples/tetris-package/README-ch.md +1 -1
  155. package/examples/tetris-package/README.md +1 -1
  156. package/package.json +6 -1
  157. package/dist-library/LocalDocumentViewCore-BLG4hMuO.js +0 -9535
  158. package/dist-library/LocalReactiveDocumentCore-DVQ6WA9G.js +0 -259
  159. package/dist-library/component-utils-BvHL8VGt.js +0 -298
  160. package/dist-library/layout-C22VjZh0.js +0 -542
  161. package/dist-library/options-CdSKOi7p.js +0 -116
  162. package/dist-library/react-LY5qsVeP.js +0 -7
@@ -1,28 +1,28 @@
1
- import { c as e, s as t } from "./visuals-BkYRmYGO.js";
2
- import { A as n, E as r, I as i, M as a, O as o, P as s, T as c, _ as l, b as u, c as d, i as f, j as p, o as m, r as h, t as g } from "./component-utils-BvHL8VGt.js";
3
- import { useEffect as _, useId as v, useRef as y, useState as b } from "react";
4
- import { jsx as x, jsxs as S } from "react/jsx-runtime";
1
+ import { C as e, E as t, I as n, L as r, M as i, P as a, R as o, U as s, V as c, f as l, j as u, l as d, m as f, s as p, u as m, z as h } from "./sdk-core-BoJT1SIt.js";
2
+ import { c as g, s as _ } from "./visuals-BZbZYA7w.js";
3
+ import { useEffect as v, useId as y, useRef as b, useState as x } from "react";
4
+ import { jsx as S, jsxs as C } from "react/jsx-runtime";
5
5
  // src/components/plot/coordinate.tsx
6
- function C({ id: e, label: t, value: n, min: i, max: a, step: o, disabled: s, onCommit: c, reset: l }) {
7
- let [u, f] = b(() => String(n)), [p, m] = b(!1), h = y(n);
8
- _(() => {
9
- f(String(n)), m(!1);
10
- }, [l]), _(() => {
11
- h.current !== n && (h.current = n, p || f(String(n)));
6
+ function w({ id: e, label: t, value: n, min: r, max: a, step: o, disabled: s, onCommit: c, reset: l }) {
7
+ let [u, d] = x(() => String(n)), [p, m] = x(!1), h = b(n);
8
+ v(() => {
9
+ d(String(n)), m(!1);
10
+ }, [l]), v(() => {
11
+ h.current !== n && (h.current = n, p || d(String(n)));
12
12
  }, [n, p]);
13
13
  let g = (e) => {
14
14
  let t = e.trim();
15
15
  if (t === "" || t === "-" || t === "." || t === "-.") return null;
16
16
  let n = Number(t);
17
- return Number.isFinite(n) ? r(d(n, i, a), i, a, o) : null;
17
+ return Number.isFinite(n) ? i(f(n, r, a), r, a, o) : null;
18
18
  };
19
- return /* @__PURE__ */ S("div", {
19
+ return /* @__PURE__ */ C("div", {
20
20
  className: "local-number-field",
21
- children: [/* @__PURE__ */ x("label", {
21
+ children: [/* @__PURE__ */ S("label", {
22
22
  className: "md-label",
23
23
  htmlFor: e,
24
24
  children: t
25
- }), /* @__PURE__ */ x("input", {
25
+ }), /* @__PURE__ */ S("input", {
26
26
  id: e,
27
27
  className: "md-text-input",
28
28
  type: "text",
@@ -33,93 +33,94 @@ function C({ id: e, label: t, value: n, min: i, max: a, step: o, disabled: s, on
33
33
  onBlur: () => {
34
34
  m(!1);
35
35
  let e = g(u);
36
- f(String(e ?? n));
36
+ d(String(e ?? n));
37
37
  },
38
38
  onChange: (e) => {
39
39
  let t = e.target.value;
40
- f(t);
40
+ d(t);
41
41
  let n = g(t);
42
42
  n !== null && c(n);
43
43
  }
44
44
  })]
45
45
  });
46
46
  }
47
- function w(_) {
48
- let b = n(_), w = v(), { content: T, mode: ee, resetToken: E, t: D } = b, { write: O, writeMany: te, error: k, setError: A } = i(_), j = o(_, "label", D("Coordinate", "坐标")), { disabled: M, invalid: N } = p(_), P = s(_), F = u(_, "x-min", "x-max", -5, 5, 1), I = u(_, "y-min", "y-max", -5, 5, 1), L = r(0, F.min, F.max, F.step), R = r(0, I.min, I.max, I.step), z = r(c(_, "x", L), F.min, F.max, F.step), B = r(c(_, "y", R), I.min, I.max, I.step), V = y(null), H = y(!1), U = t();
49
- a(_, () => A(null));
47
+ function T(v) {
48
+ let x = n(v), T = r(v), E = y(), { content: D, mode: O, resetToken: k, t: A } = T, { write: j, writeMany: ee, error: te, setError: ne } = s(v), M = a(v, "label", A("Coordinate", "坐标")), { disabled: N, invalid: re } = o(v), P = c(v), F = t(v, "x-min", "x-max", -5, 5, 1), I = t(v, "y-min", "y-max", -5, 5, 1), L = i(0, F.min, F.max, F.step), R = i(0, I.min, I.max, I.step), z = i(u(v, "x", L), F.min, F.max, F.step), B = i(u(v, "y", R), I.min, I.max, I.step), V = b(null), H = b(!1), U = _();
49
+ h(v, () => ne(null));
50
50
  let W = `X: ${z} · Y: ${B}`;
51
- if (ee === "static") return /* @__PURE__ */ x(f, {
51
+ if (O === "static") return /* @__PURE__ */ S(m, {
52
+ authorRoot: x(),
52
53
  className: "local-coordinate",
53
- label: j,
54
+ label: M,
54
55
  value: W
55
56
  });
56
- let G = (e) => F.max > F.min ? 40 + (e - F.min) / (F.max - F.min) * 320 : 200, K = (e) => I.max > I.min ? 360 - (e - I.min) / (I.max - I.min) * 320 : 200, q = G(z), J = K(B), Y = G(d(0, F.min, F.max)), X = K(d(0, I.min, I.max)), Z = (e) => {
57
+ let G = (e) => F.max > F.min ? 40 + (e - F.min) / (F.max - F.min) * 320 : 200, K = (e) => I.max > I.min ? 360 - (e - I.min) / (I.max - I.min) * 320 : 200, q = G(z), J = K(B), Y = G(f(0, F.min, F.max)), X = K(f(0, I.min, I.max)), Z = (e) => {
57
58
  let t = e.step * Math.max(1, Math.ceil((e.max - e.min) / (e.step * 10))), n = Math.min(11, Math.floor((e.max - e.min) / t) + 1);
58
59
  return Array.from({ length: n }, (n, r) => e.min + r * t);
59
60
  }, Q = (e) => {
60
61
  let t = V.current?.getBoundingClientRect();
61
62
  if (!t || t.width === 0 || t.height === 0) return null;
62
- let n = d(((e.clientX - t.left) / t.width - .1) / .8, 0, 1), i = d(((e.clientY - t.top) / t.height - .1) / .8, 0, 1);
63
+ let n = f(((e.clientX - t.left) / t.width - .1) / .8, 0, 1), r = f(((e.clientY - t.top) / t.height - .1) / .8, 0, 1);
63
64
  return {
64
- x: r(F.min + n * (F.max - F.min), F.min, F.max, F.step),
65
- y: r(I.min + (1 - i) * (I.max - I.min), I.min, I.max, I.step)
65
+ x: i(F.min + n * (F.max - F.min), F.min, F.max, F.step),
66
+ y: i(I.min + (1 - r) * (I.max - I.min), I.min, I.max, I.step)
66
67
  };
67
68
  }, $ = (e, t) => {
68
- (e !== z || t !== B) && te({
69
+ (e !== z || t !== B) && ee({
69
70
  x: e,
70
71
  y: t
71
72
  });
73
+ }, ie = (e) => {
74
+ if (N) return;
75
+ let t = z, n = B;
76
+ switch (e.key) {
77
+ case "ArrowLeft":
78
+ t = i(z - F.step, F.min, F.max, F.step);
79
+ break;
80
+ case "ArrowRight":
81
+ t = i(z + F.step, F.min, F.max, F.step);
82
+ break;
83
+ case "ArrowDown":
84
+ n = i(B - I.step, I.min, I.max, I.step);
85
+ break;
86
+ case "ArrowUp":
87
+ n = i(B + I.step, I.min, I.max, I.step);
88
+ break;
89
+ case "Home":
90
+ t = F.min, n = I.min;
91
+ break;
92
+ case "End":
93
+ t = i(F.max, F.min, F.max, F.step), n = i(I.max, I.min, I.max, I.step);
94
+ break;
95
+ default: return;
96
+ }
97
+ e.preventDefault(), e.stopPropagation(), $(t, n);
72
98
  };
73
- return /* @__PURE__ */ S("div", {
99
+ return /* @__PURE__ */ C("div", {
74
100
  className: "local-coordinate",
75
- style: m(l(T)),
101
+ ...x(l(e(D))),
76
102
  role: "group",
77
- "aria-label": j,
103
+ "aria-label": M,
78
104
  "data-rmd-component": "coordinate",
79
105
  "aria-invalid": P.invalid || void 0,
80
106
  "aria-describedby": P.describedBy,
81
107
  children: [
82
- /* @__PURE__ */ x("span", {
108
+ /* @__PURE__ */ S("span", {
83
109
  className: "md-label",
84
- children: j
110
+ children: M
85
111
  }),
86
- /* @__PURE__ */ S("div", {
112
+ /* @__PURE__ */ C("div", {
87
113
  className: `local-coordinate-surface${U ? " local-mafs-surface" : ""}`,
88
- children: [/* @__PURE__ */ x("div", {
114
+ children: [/* @__PURE__ */ S("div", {
89
115
  ref: V,
90
116
  className: `local-coordinate-pad${U ? " local-mafs-coordinate" : ""}`,
91
117
  role: "group",
92
- "aria-label": D(`${j} drag area`, `${j} 拖拽区`),
93
- "aria-disabled": M || void 0,
94
- tabIndex: M ? -1 : 0,
95
- onKeyDownCapture: (e) => {
96
- if (M) return;
97
- let t = z, n = B;
98
- switch (e.key) {
99
- case "ArrowLeft":
100
- t = r(z - F.step, F.min, F.max, F.step);
101
- break;
102
- case "ArrowRight":
103
- t = r(z + F.step, F.min, F.max, F.step);
104
- break;
105
- case "ArrowDown":
106
- n = r(B - I.step, I.min, I.max, I.step);
107
- break;
108
- case "ArrowUp":
109
- n = r(B + I.step, I.min, I.max, I.step);
110
- break;
111
- case "Home":
112
- t = F.min, n = I.min;
113
- break;
114
- case "End":
115
- t = r(F.max, F.min, F.max, F.step), n = r(I.max, I.min, I.max, I.step);
116
- break;
117
- default: return;
118
- }
119
- e.preventDefault(), e.stopPropagation(), $(t, n);
120
- },
118
+ "aria-label": A(`${M} drag area`, `${M} 拖拽区`),
119
+ "aria-disabled": N || void 0,
120
+ tabIndex: N ? -1 : 0,
121
+ onKeyDownCapture: ie,
121
122
  onPointerDown: U ? void 0 : (e) => {
122
- if (M) return;
123
+ if (N) return;
123
124
  e.preventDefault(), H.current = !0, V.current?.focus({ preventScroll: !0 });
124
125
  try {
125
126
  e.currentTarget.setPointerCapture(e.pointerId);
@@ -128,7 +129,7 @@ function w(_) {
128
129
  t && $(t.x, t.y);
129
130
  },
130
131
  onPointerMove: U ? void 0 : (e) => {
131
- if (!H.current || M) return;
132
+ if (!H.current || N) return;
132
133
  let t = Q(e);
133
134
  t && $(t.x, t.y);
134
135
  },
@@ -141,50 +142,50 @@ function w(_) {
141
142
  onPointerCancel: U ? void 0 : () => {
142
143
  H.current = !1;
143
144
  },
144
- children: U ? /* @__PURE__ */ x(e, {
145
+ children: U ? /* @__PURE__ */ S(g, {
145
146
  x: z,
146
147
  y: B,
147
148
  xRange: F,
148
149
  yRange: I,
149
150
  step: F.step,
150
- disabled: M,
151
+ disabled: N,
151
152
  accent: "var(--local-accent, var(--coordinate-point))",
152
153
  onMove: $
153
- }) : /* @__PURE__ */ S("svg", {
154
+ }) : /* @__PURE__ */ C("svg", {
154
155
  className: "local-coordinate-svg",
155
156
  viewBox: "0 0 400 400",
156
157
  "aria-hidden": "true",
157
158
  focusable: "false",
158
159
  children: [
159
- /* @__PURE__ */ x("defs", { children: /* @__PURE__ */ x("marker", {
160
- id: `${w}-coordinate-arrow`,
160
+ /* @__PURE__ */ S("defs", { children: /* @__PURE__ */ S("marker", {
161
+ id: `${E}-coordinate-arrow`,
161
162
  markerWidth: "8",
162
163
  markerHeight: "8",
163
164
  refX: "6",
164
165
  refY: "4",
165
166
  orient: "auto",
166
167
  viewBox: "0 0 8 8",
167
- children: /* @__PURE__ */ x("path", {
168
+ children: /* @__PURE__ */ S("path", {
168
169
  className: "local-coordinate-arrow",
169
170
  d: "M1 1 L6 4 L1 7"
170
171
  })
171
172
  }) }),
172
- /* @__PURE__ */ S("g", {
173
+ /* @__PURE__ */ C("g", {
173
174
  className: "local-coordinate-grid",
174
175
  children: [
175
- /* @__PURE__ */ x("rect", {
176
+ /* @__PURE__ */ S("rect", {
176
177
  x: "40",
177
178
  y: "40",
178
179
  width: "320",
179
180
  height: "320"
180
181
  }),
181
- Z(F).map((e, t) => /* @__PURE__ */ x("line", {
182
+ Z(F).map((e, t) => /* @__PURE__ */ S("line", {
182
183
  x1: G(e),
183
184
  y1: "40",
184
185
  x2: G(e),
185
186
  y2: "360"
186
187
  }, `x-${t}`)),
187
- Z(I).map((e, t) => /* @__PURE__ */ x("line", {
188
+ Z(I).map((e, t) => /* @__PURE__ */ S("line", {
188
189
  x1: "40",
189
190
  y1: K(e),
190
191
  x2: "360",
@@ -192,57 +193,57 @@ function w(_) {
192
193
  }, `y-${t}`))
193
194
  ]
194
195
  }),
195
- /* @__PURE__ */ S("g", {
196
+ /* @__PURE__ */ C("g", {
196
197
  className: "local-coordinate-axes",
197
- children: [/* @__PURE__ */ x("line", {
198
+ children: [/* @__PURE__ */ S("line", {
198
199
  className: "local-coordinate-horizontal",
199
200
  x1: "26",
200
201
  y1: X,
201
202
  x2: "372",
202
203
  y2: X,
203
- markerEnd: `url(#${w}-coordinate-arrow)`
204
- }), /* @__PURE__ */ x("line", {
204
+ markerEnd: `url(#${E}-coordinate-arrow)`
205
+ }), /* @__PURE__ */ S("line", {
205
206
  className: "local-coordinate-vertical",
206
207
  x1: Y,
207
208
  y1: "374",
208
209
  x2: Y,
209
210
  y2: "24",
210
- markerEnd: `url(#${w}-coordinate-arrow)`
211
+ markerEnd: `url(#${E}-coordinate-arrow)`
211
212
  })]
212
213
  }),
213
- /* @__PURE__ */ S("g", {
214
+ /* @__PURE__ */ C("g", {
214
215
  className: "local-coordinate-axis-label",
215
- children: [/* @__PURE__ */ x("text", {
216
+ children: [/* @__PURE__ */ S("text", {
216
217
  x: "358",
217
218
  y: X - 14,
218
219
  children: "x"
219
- }), /* @__PURE__ */ x("text", {
220
+ }), /* @__PURE__ */ S("text", {
220
221
  x: Y + 12,
221
222
  y: "40",
222
223
  children: "y"
223
224
  })]
224
225
  }),
225
- /* @__PURE__ */ S("g", {
226
+ /* @__PURE__ */ C("g", {
226
227
  className: "local-coordinate-projection",
227
- children: [/* @__PURE__ */ x("line", {
228
+ children: [/* @__PURE__ */ S("line", {
228
229
  x1: q,
229
230
  y1: J,
230
231
  x2: q,
231
232
  y2: X
232
- }), /* @__PURE__ */ x("line", {
233
+ }), /* @__PURE__ */ S("line", {
233
234
  x1: q,
234
235
  y1: J,
235
236
  x2: Y,
236
237
  y2: J
237
238
  })]
238
239
  }),
239
- /* @__PURE__ */ x("circle", {
240
+ /* @__PURE__ */ S("circle", {
240
241
  className: "local-coordinate-dot",
241
242
  cx: q,
242
243
  cy: J,
243
244
  r: "10"
244
245
  }),
245
- /* @__PURE__ */ x("text", {
246
+ /* @__PURE__ */ S("text", {
246
247
  className: "local-coordinate-value",
247
248
  x: q,
248
249
  y: J > 330 ? J - 22 : J + 30,
@@ -251,42 +252,42 @@ function w(_) {
251
252
  })
252
253
  ]
253
254
  })
254
- }), /* @__PURE__ */ x("span", {
255
+ }), /* @__PURE__ */ S("span", {
255
256
  className: "local-coordinate-caption",
256
- children: D("Draggable coordinate plane", "可拖动的坐标平面")
257
+ children: A("Draggable coordinate plane", "可拖动的坐标平面")
257
258
  })]
258
259
  }),
259
- /* @__PURE__ */ x("span", {
260
+ /* @__PURE__ */ S("span", {
260
261
  className: "md-hint local-hint",
261
- children: D("Arrow keys adjust the point; Home and End jump to the lower or upper bounds.", "方向键调整坐标;Home 和 End 跳到最小或最大边界。")
262
+ children: A("Arrow keys adjust the point; Home and End jump to the lower or upper bounds.", "方向键调整坐标;Home 和 End 跳到最小或最大边界。")
262
263
  }),
263
- /* @__PURE__ */ S("div", {
264
+ /* @__PURE__ */ C("div", {
264
265
  className: "local-coordinate-fields",
265
- children: [/* @__PURE__ */ x(C, {
266
- id: `${w}-coordinate-x`,
267
- reset: E,
268
- label: `${j} X`,
266
+ children: [/* @__PURE__ */ S(w, {
267
+ id: `${E}-coordinate-x`,
268
+ reset: k,
269
+ label: `${M} X`,
269
270
  value: z,
270
271
  min: F.min,
271
272
  max: F.max,
272
273
  step: F.step,
273
- disabled: M,
274
- onCommit: (e) => O(e, "x")
275
- }), /* @__PURE__ */ x(C, {
276
- id: `${w}-coordinate-y`,
277
- reset: E,
278
- label: `${j} Y`,
274
+ disabled: N,
275
+ onCommit: (e) => j(e, "x")
276
+ }), /* @__PURE__ */ S(w, {
277
+ id: `${E}-coordinate-y`,
278
+ reset: k,
279
+ label: `${M} Y`,
279
280
  value: B,
280
281
  min: I.min,
281
282
  max: I.max,
282
283
  step: I.step,
283
- disabled: M,
284
- onCommit: (e) => O(e, "y")
284
+ disabled: N,
285
+ onCommit: (e) => j(e, "y")
285
286
  })]
286
287
  }),
287
- /* @__PURE__ */ x(h, { value: W }),
288
- /* @__PURE__ */ x(g, { message: N ? D("Cannot compute", "无法计算") : k })
288
+ /* @__PURE__ */ S(d, { value: W }),
289
+ /* @__PURE__ */ S(p, { message: re ? A("Cannot compute", "无法计算") : te })
289
290
  ]
290
291
  });
291
292
  }
292
- export { w as t };
293
+ export { T as t };
@@ -1,21 +1,21 @@
1
1
  import { rt as e } from "./preset-core-CKc5YXSM.js";
2
- import { t } from "./compile-LhpTKqCR.js";
3
- import { A as n, O as r } from "./component-utils-BvHL8VGt.js";
4
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
2
+ import { t } from "./compile-wUv8KEge.js";
3
+ import { I as n, L as r, P as i } from "./sdk-core-BoJT1SIt.js";
4
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
5
  // src/components/table/data-table.tsx
6
- var o = class extends Error {
6
+ var s = class extends Error {
7
7
  failure;
8
8
  constructor(e) {
9
9
  super(e), this.name = "DataTableFailureError", this.failure = e;
10
10
  }
11
11
  };
12
- function s(e) {
12
+ function c(e) {
13
13
  return e === null ? "" : typeof e == "string" ? e : typeof e == "number" ? Number.isFinite(e) ? String(e) : null : typeof e == "boolean" ? e ? "true" : "false" : null;
14
14
  }
15
- function c(e) {
15
+ function l(e) {
16
16
  return typeof e == "string" ? e === "" ? null : `s:${e}` : typeof e == "number" && Number.isFinite(e) ? `n:${e === 0 ? 0 : e}` : null;
17
17
  }
18
- function l(e, t, n) {
18
+ function u(e, t, n) {
19
19
  let r = { ...n };
20
20
  for (let i of t) Object.hasOwn(n, i) || Object.defineProperty(r, i, {
21
21
  enumerable: !0,
@@ -26,34 +26,34 @@ function l(e, t, n) {
26
26
  });
27
27
  return r;
28
28
  }
29
- function u(e) {
29
+ function d(e) {
30
30
  if (e.length === 0) return null;
31
31
  let t = typeof e[0];
32
32
  if (t !== "string" && t !== "number") return "rows";
33
33
  for (let n of e) if (typeof n !== t || typeof n == "number" && !Number.isFinite(n)) return "rows";
34
34
  return null;
35
35
  }
36
- function d(e, n) {
36
+ function f(e, n) {
37
37
  let r;
38
38
  try {
39
39
  r = t(n);
40
40
  } catch {
41
- throw new o("rows");
41
+ throw new s("rows");
42
42
  }
43
43
  let i;
44
44
  try {
45
- i = r.evaluate(l(e, r.dependencies, {}));
45
+ i = r.evaluate(u(e, r.dependencies, {}));
46
46
  } catch {
47
- throw new o("rows");
47
+ throw new s("rows");
48
48
  }
49
- if (!Array.isArray(i)) throw new o("rows");
50
- let a = u(i);
51
- if (a) throw new o(a);
49
+ if (!Array.isArray(i)) throw new s("rows");
50
+ let a = d(i);
51
+ if (a) throw new s(a);
52
52
  return i;
53
53
  }
54
- function f(e) {
55
- let { rows: n, columns: r, keyExpression: i, runtime: a } = e, d = e.maxRows ?? 100, f = e.budget ?? 1e5;
56
- if (!Number.isSafeInteger(d) || d <= 0 || d > 1e3) return {
54
+ function p(e) {
55
+ let { rows: n, columns: r, keyExpression: i, runtime: a } = e, o = e.maxRows ?? 100, f = e.budget ?? 1e5;
56
+ if (!Number.isSafeInteger(o) || o <= 0 || o > 1e3) return {
57
57
  ok: !1,
58
58
  failure: "max-rows"
59
59
  };
@@ -61,12 +61,12 @@ function f(e) {
61
61
  ok: !1,
62
62
  failure: "columns"
63
63
  };
64
- let p = u(n);
64
+ let p = d(n);
65
65
  if (p) return {
66
66
  ok: !1,
67
67
  failure: p
68
68
  };
69
- if (n.length > d) return {
69
+ if (n.length > o) return {
70
70
  ok: !1,
71
71
  failure: "rows-budget"
72
72
  };
@@ -103,7 +103,7 @@ function f(e) {
103
103
  failure: "text-budget"
104
104
  };
105
105
  let v = (e) => {
106
- if (_ += e, _ > f) throw new o("text-budget");
106
+ if (_ += e, _ > f) throw new s("text-budget");
107
107
  }, y = /* @__PURE__ */ new Set(), b = [];
108
108
  try {
109
109
  for (let e = 0; e < n.length; e += 1) {
@@ -112,7 +112,7 @@ function f(e) {
112
112
  index: e
113
113
  }, r = null;
114
114
  try {
115
- r = c(m.evaluate(t));
115
+ r = l(m.evaluate(t));
116
116
  } catch {
117
117
  return {
118
118
  ok: !1,
@@ -135,7 +135,7 @@ function f(e) {
135
135
  }
136
136
  let n = null;
137
137
  try {
138
- n = s(e.expression.evaluate(l(a, e.expression.dependencies, t)));
138
+ n = c(e.expression.evaluate(u(a, e.expression.dependencies, t)));
139
139
  } catch {
140
140
  n = null;
141
141
  }
@@ -153,7 +153,7 @@ function f(e) {
153
153
  });
154
154
  }
155
155
  } catch (e) {
156
- return e instanceof o ? {
156
+ return e instanceof s ? {
157
157
  ok: !1,
158
158
  failure: e.failure
159
159
  } : {
@@ -170,7 +170,7 @@ function f(e) {
170
170
  }
171
171
  };
172
172
  }
173
- function p(t, n) {
173
+ function m(t, n) {
174
174
  switch (n) {
175
175
  case "label": return t("Data table requires a label.", "数据表需要标签。");
176
176
  case "columns": return t("Data table requires between 1 and 20 column definitions.", "数据表需要 1 到 20 个列定义。");
@@ -181,28 +181,28 @@ function p(t, n) {
181
181
  case "text-budget": return t("The table content exceeds the text budget.", "数据表内容超过文本上限。");
182
182
  }
183
183
  }
184
- var m = /^\s*\{\{([\s\S]*)\}\}\s*$/;
185
- function h(e) {
184
+ var h = /^\s*\{\{([\s\S]*)\}\}\s*$/;
185
+ function g(e) {
186
186
  if (e === void 0) return null;
187
- let t = m.exec(e), n = t ? t[1].trim() : "";
187
+ let t = h.exec(e), n = t ? t[1].trim() : "";
188
188
  return n === "" ? null : n;
189
189
  }
190
- function g(e) {
190
+ function _(e) {
191
191
  return e.kind === "comment" || e.kind === "text" && e.text.trim() === "" || e.kind === "paragraph" && e.children.length === 0 && e.text.trim() === "";
192
192
  }
193
- function _(e) {
194
- let t = r(e, "label", "").trim();
193
+ function v(e) {
194
+ let t = i(e, "label", "").trim();
195
195
  if (t === "") return {
196
196
  ok: !1,
197
197
  failure: "label"
198
198
  };
199
- let n = h(e.content.attrs.rows);
199
+ let n = g(e.content.attrs.rows);
200
200
  if (!n) return {
201
201
  ok: !1,
202
202
  failure: "rows"
203
203
  };
204
- let i = h(e.content.attrs.key);
205
- if (!i) return {
204
+ let r = g(e.content.attrs.key);
205
+ if (!r) return {
206
206
  ok: !1,
207
207
  failure: "key"
208
208
  };
@@ -211,14 +211,14 @@ function _(e) {
211
211
  ok: !1,
212
212
  failure: "max-rows"
213
213
  };
214
- let s = e.content.children.filter((e) => !g(e)), c = [];
214
+ let s = e.content.children.filter((e) => !_(e)), c = [];
215
215
  for (let e of s) {
216
- let t = e.children.filter((e) => !g(e));
216
+ let t = e.children.filter((e) => !_(e));
217
217
  if (e.kind !== "component" || e.name !== "column" || t.length > 0) return {
218
218
  ok: !1,
219
219
  failure: "columns"
220
220
  };
221
- let n = (e.attrs.label ?? "").trim(), r = h(e.attrs.value);
221
+ let n = (e.attrs.label ?? "").trim(), r = g(e.attrs.value);
222
222
  if (n === "" || !r) return {
223
223
  ok: !1,
224
224
  failure: "columns"
@@ -236,58 +236,61 @@ function _(e) {
236
236
  table: {
237
237
  label: t,
238
238
  rows: n,
239
- key: i,
239
+ key: r,
240
240
  maxRows: o,
241
241
  columns: c
242
242
  }
243
243
  };
244
244
  }
245
- function v(e) {
246
- let t = n(e), r = _(e);
247
- if (!r.ok) return /* @__PURE__ */ i("div", {
245
+ function y(e) {
246
+ let t = n(e), i = r(e), c = v(e);
247
+ if (!c.ok) return /* @__PURE__ */ a("div", {
248
+ ...t(),
248
249
  className: "local-error local-data-table-error",
249
250
  role: "alert",
250
- children: p(t.t, r.failure)
251
+ children: m(i.t, c.failure)
251
252
  });
252
- let s = { evaluate: (t) => e.runtime.evaluate(t) }, c;
253
+ let l = { evaluate: (t) => e.runtime.evaluate(t) }, u;
253
254
  try {
254
- c = f({
255
- rows: d(s, r.table.rows),
256
- columns: r.table.columns,
257
- keyExpression: r.table.key,
258
- maxRows: r.table.maxRows,
259
- runtime: s
255
+ u = p({
256
+ rows: f(l, c.table.rows),
257
+ columns: c.table.columns,
258
+ keyExpression: c.table.key,
259
+ maxRows: c.table.maxRows,
260
+ runtime: l
260
261
  });
261
262
  } catch (e) {
262
- c = {
263
+ u = {
263
264
  ok: !1,
264
- failure: e instanceof o ? e.failure : "rows"
265
+ failure: e instanceof s ? e.failure : "rows"
265
266
  };
266
267
  }
267
- if (!c.ok) return /* @__PURE__ */ i("div", {
268
+ if (!u.ok) return /* @__PURE__ */ a("div", {
269
+ ...t(),
268
270
  className: "local-error local-data-table-error",
269
271
  role: "alert",
270
- children: p(t.t, c.failure)
272
+ children: m(i.t, u.failure)
271
273
  });
272
- let { model: l } = c;
273
- return /* @__PURE__ */ i("div", {
274
+ let { model: d } = u;
275
+ return /* @__PURE__ */ a("div", {
276
+ ...t(),
274
277
  className: "md-table-scroll local-data-table-scroll",
275
278
  "data-local-data-table": "",
276
- children: /* @__PURE__ */ a("table", {
279
+ children: /* @__PURE__ */ o("table", {
277
280
  className: "md-table local-data-table",
278
- "aria-label": r.table.label,
279
- children: [/* @__PURE__ */ i("thead", { children: /* @__PURE__ */ i("tr", { children: l.columns.map((e, t) => /* @__PURE__ */ i("th", {
281
+ "aria-label": c.table.label,
282
+ children: [/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { children: d.columns.map((e, t) => /* @__PURE__ */ a("th", {
280
283
  scope: "col",
281
284
  children: e
282
- }, `column-${t}`)) }) }), /* @__PURE__ */ i("tbody", { children: l.empty ? /* @__PURE__ */ i("tr", { children: /* @__PURE__ */ i("td", {
285
+ }, `column-${t}`)) }) }), /* @__PURE__ */ a("tbody", { children: d.empty ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", {
283
286
  className: "local-data-table-empty",
284
- colSpan: l.columns.length,
285
- children: t.t("No rows", "没有数据")
286
- }) }) : l.rows.map((e) => /* @__PURE__ */ i("tr", { children: e.cells.map((e, n) => /* @__PURE__ */ i("td", { children: e.ok ? e.text : /* @__PURE__ */ i("span", {
287
+ colSpan: d.columns.length,
288
+ children: i.t("No rows", "没有数据")
289
+ }) }) : d.rows.map((e) => /* @__PURE__ */ a("tr", { children: e.cells.map((e, t) => /* @__PURE__ */ a("td", { children: e.ok ? e.text : /* @__PURE__ */ a("span", {
287
290
  className: "local-error local-data-table-cell-error",
288
- children: t.t("Cannot compute", "无法计算")
289
- }) }, `cell-${n}`)) }, e.key)) })]
291
+ children: i.t("Cannot compute", "无法计算")
292
+ }) }, `cell-${t}`)) }, e.key)) })]
290
293
  })
291
294
  });
292
295
  }
293
- export { v as t };
296
+ export { y as t };