markdown-flow-ui 0.3.8 → 0.3.9

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 (42) hide show
  1. package/dist/_virtual/index6.cjs +1 -1
  2. package/dist/_virtual/index6.es.js +3 -5
  3. package/dist/_virtual/index6.es.js.map +1 -1
  4. package/dist/_virtual/index7.cjs +1 -1
  5. package/dist/_virtual/index7.es.js +5 -3
  6. package/dist/_virtual/index7.es.js.map +1 -1
  7. package/dist/components/ContentRender/ContentRender.cjs +2 -2
  8. package/dist/components/ContentRender/ContentRender.cjs.map +1 -1
  9. package/dist/components/ContentRender/ContentRender.d.ts +0 -2
  10. package/dist/components/ContentRender/ContentRender.es.js +361 -365
  11. package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
  12. package/dist/components/ContentRender/IframeSandbox.cjs +4 -4
  13. package/dist/components/ContentRender/IframeSandbox.cjs.map +1 -1
  14. package/dist/components/ContentRender/IframeSandbox.d.ts +0 -2
  15. package/dist/components/ContentRender/IframeSandbox.es.js +299 -296
  16. package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -1
  17. package/dist/components/ContentRender/SandboxApp.cjs +2 -2
  18. package/dist/components/ContentRender/SandboxApp.cjs.map +1 -1
  19. package/dist/components/ContentRender/SandboxApp.d.ts +4 -3
  20. package/dist/components/ContentRender/SandboxApp.es.js +110 -141
  21. package/dist/components/ContentRender/SandboxApp.es.js.map +1 -1
  22. package/dist/components/ContentRender/contentRenderI18n.cjs.map +1 -1
  23. package/dist/components/ContentRender/contentRenderI18n.d.ts +0 -2
  24. package/dist/components/ContentRender/contentRenderI18n.es.js.map +1 -1
  25. package/dist/components/ContentRender/locales/contentRender.json.cjs +1 -1
  26. package/dist/components/ContentRender/locales/contentRender.json.d.ts +0 -22
  27. package/dist/components/ContentRender/locales/contentRender.json.es.js +11 -11
  28. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.cjs +1 -1
  29. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.es.js +1 -1
  30. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-6MUBBAK2.cjs +1 -1
  31. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-6MUBBAK2.es.js +1 -1
  32. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-HFQBQIA3.cjs +1 -1
  33. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-HFQBQIA3.es.js +1 -1
  34. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-MALGAFMO.cjs +1 -1
  35. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-MALGAFMO.es.js +1 -1
  36. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-23REXITY.cjs +1 -1
  37. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-23REXITY.es.js +1 -1
  38. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-5NDRBG5M.cjs +1 -1
  39. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-5NDRBG5M.es.js +1 -1
  40. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/swimlanesDiagram-OMPLPG4O.cjs +1 -1
  41. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/swimlanesDiagram-OMPLPG4O.es.js +1 -1
  42. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- import { jsxs as ue, jsx as G } from "react/jsx-runtime";
2
- import { useRef as l, useState as q, useEffect as k } from "react";
3
- import fe from "../ui/loading-overlay-card.es.js";
4
- import { getMarkdownFlowLanguage as de, getMarkdownFlowDirection as he } from "../../lib/locale.es.js";
5
- import { getContentRenderLocaleTexts as me } from "./contentRenderI18n.es.js";
6
- import { isAnchorElement as pe, shouldForceAnchorHrefToNewTab as X, mergeAnchorRelValue as Y, resolveClosestAnchor as ge } from "./utils/link-targets.es.js";
7
- const ye = [
1
+ import { jsxs as G, jsx as E } from "react/jsx-runtime";
2
+ import { useRef as y, useState as K, useEffect as _ } from "react";
3
+ import Q from "../ui/loading-overlay-card.es.js";
4
+ import { getMarkdownFlowLanguage as J, getMarkdownFlowDirection as P } from "../../lib/locale.es.js";
5
+ import { getContentRenderLocaleTexts as X } from "./contentRenderI18n.es.js";
6
+ import { isAnchorElement as Y, shouldForceAnchorHrefToNewTab as j, mergeAnchorRelValue as F, resolveClosestAnchor as Z } from "./utils/link-targets.es.js";
7
+ const ee = [
8
8
  "src",
9
9
  "srcset",
10
10
  "sizes",
@@ -18,57 +18,52 @@ const ye = [
18
18
  "crossorigin",
19
19
  "referrerpolicy",
20
20
  "fetchpriority"
21
- ], Z = (o) => ye.map(
22
- (n) => `${n}:${o.getAttribute(n) || ""}`
23
- ).join("|"), be = (o) => {
24
- const n = /* @__PURE__ */ new Map();
25
- return o.querySelectorAll("img").forEach((f) => {
26
- const c = f, s = Z(c), d = n.get(s) || [];
27
- d.push(c), n.set(s, d);
28
- }), n;
29
- }, we = (o, n) => {
30
- const f = Array.from(o.attributes), c = new Set(
31
- f.map((s) => s.name)
21
+ ], M = (o) => ee.map(
22
+ (t) => `${t}:${o.getAttribute(t) || ""}`
23
+ ).join("|"), te = (o) => {
24
+ const t = /* @__PURE__ */ new Map();
25
+ return o.querySelectorAll("img").forEach((i) => {
26
+ const c = i, n = M(c), a = t.get(n) || [];
27
+ a.push(c), t.set(n, a);
28
+ }), t;
29
+ }, re = (o, t) => {
30
+ const i = Array.from(o.attributes), c = new Set(
31
+ i.map((n) => n.name)
32
32
  );
33
- Array.from(n.attributes).forEach((s) => {
34
- c.has(s.name) || n.removeAttribute(s.name);
35
- }), f.forEach((s) => {
36
- n.setAttribute(s.name, s.value);
33
+ Array.from(t.attributes).forEach((n) => {
34
+ c.has(n.name) || t.removeAttribute(n.name);
35
+ }), i.forEach((n) => {
36
+ t.setAttribute(n.name, n.value);
37
37
  });
38
- }, ve = (o, n) => {
39
- n.size && o.querySelectorAll("img").forEach((f) => {
40
- const c = f, s = Z(c), d = n.get(s), p = d?.shift();
41
- p && (we(c, p), c.replaceWith(p), d && d.length === 0 && n.delete(s));
38
+ }, ne = (o, t) => {
39
+ t.size && o.querySelectorAll("img").forEach((i) => {
40
+ const c = i, n = M(c), a = t.get(n), f = a?.shift();
41
+ f && (re(c, f), c.replaceWith(f), a && a.length === 0 && t.delete(n));
42
42
  });
43
- }, ke = ({
43
+ }, oe = (o) => {
44
+ const t = (o.match(/<script[\s>]/gi) || []).length, i = (o.match(/<\/script>/gi) || []).length;
45
+ return t > 0 && t === i;
46
+ }, fe = ({
44
47
  html: o,
45
- locale: n,
46
- dir: f,
48
+ locale: t,
49
+ dir: i,
47
50
  lang: c,
48
- loadingText: s,
49
- styleLoadingText: d,
50
- scriptLoadingText: p,
51
- resetToken: A = 0,
52
- mode: ee = "content",
53
- hasRootVhHeight: te = !1,
54
- stretchRootHeight: re = !1,
55
- enableScaling: z = !1,
56
- disableLoadingOverlay: L = !1
51
+ loadingText: n,
52
+ resetToken: a = 0,
53
+ mode: f = "content",
54
+ hasRootVhHeight: D = !1,
55
+ stretchRootHeight: q = !1,
56
+ enableScaling: S = !1,
57
+ disableLoadingOverlay: z = !1,
58
+ deferScripts: R = !1
57
59
  }) => {
58
- const N = me(n), T = l(null), [ne, S] = q(!1), [se, C] = q(!1), [oe, M] = q(!1), _ = l([]), H = l([]), U = l(0), V = l(0), g = l(null), y = l(null), b = l(!1), w = l(!1), W = l(A), ae = 200, u = (t) => {
59
- t.current && (clearTimeout(t.current), t.current = null);
60
- }, B = (t, a, i, D) => {
61
- const h = performance.now() - i.current, R = Math.max(0, ae - h);
62
- u(a), a.current = window.setTimeout(() => {
63
- t(!1), D?.(), a.current = null;
64
- }, R);
65
- };
66
- k(() => {
67
- const t = T.current?.ownerDocument;
68
- if (!t) return;
69
- const a = "sandbox-spinner-style";
70
- let i = t.getElementById(a);
71
- i || (i = t.createElement("style"), i.id = a, t.head?.appendChild(i)), i.textContent = `
60
+ const U = X(t), v = y(null), [V, w] = K(!1), x = y([]), A = y([]), I = y(a);
61
+ _(() => {
62
+ const s = v.current?.ownerDocument;
63
+ if (!s) return;
64
+ const l = "sandbox-layout-style";
65
+ let u = s.getElementById(l);
66
+ u || (u = s.createElement("style"), u.id = l, s.head?.appendChild(u)), u.textContent = `
72
67
  .sandbox-wrapper { align-items: center; }
73
68
  .sandbox-container { position: relative; width: 100%; }
74
69
  .sandbox-container svg,
@@ -88,139 +83,112 @@ const ye = [
88
83
  }
89
84
  .overflow-y-auto { overflow-y: visible !important; }
90
85
  `;
91
- }, []), k(() => {
92
- A !== W.current && (M(!1), W.current = A), u(g), u(y), b.current = !1, w.current = !1;
93
- const t = T.current;
94
- if (!t) return;
95
- const a = t.ownerDocument, i = a?.body;
96
- if (!i) return;
97
- const D = be(t);
98
- _.current.forEach((e) => e.remove()), _.current = [], H.current.forEach((e) => e.remove()), H.current = [], S(!1), C(!1);
99
- const h = a.createElement("div");
86
+ }, []), _(() => {
87
+ a !== I.current && (w(!1), I.current = a);
88
+ const s = v.current;
89
+ if (!s) return;
90
+ const l = s.ownerDocument, u = l?.body;
91
+ if (!u) return;
92
+ const W = te(s);
93
+ x.current.forEach((e) => e.remove()), x.current = [], A.current.forEach((e) => e.remove()), A.current = [];
94
+ const h = l.createElement("div");
100
95
  h.innerHTML = o, h.querySelectorAll("a[href]").forEach((e) => {
101
- pe(e) && X(e.getAttribute("href")) && (e.setAttribute("target", "_blank"), e.setAttribute("rel", Y(e.getAttribute("rel"))));
96
+ Y(e) && j(e.getAttribute("href")) && (e.setAttribute("target", "_blank"), e.setAttribute("rel", F(e.getAttribute("rel"))));
102
97
  });
103
- const R = (o.match(/<script[\s>]/gi) || []).length, le = (o.match(/<\/script>/gi) || []).length, O = R > 0 && R === le, v = [];
98
+ const k = !R && oe(o), b = [];
104
99
  Array.from(h.querySelectorAll("style, script")).forEach((e) => {
105
100
  if (e.tagName.toLowerCase() === "style") {
106
- const r = a.createElement("style");
107
- r.textContent = e.textContent || "", Array.from(e.attributes).forEach((m) => {
108
- r.setAttribute(m.name, m.value);
109
- }), v.push(r);
101
+ const r = l.createElement("style");
102
+ r.textContent = e.textContent || "", Array.from(e.attributes).forEach((d) => {
103
+ r.setAttribute(d.name, d.value);
104
+ }), b.push(r);
110
105
  } else {
111
- const r = a.createElement("script");
112
- Array.from(e.attributes).forEach((m) => {
113
- r.setAttribute(m.name, m.value);
114
- }), r.textContent = e.textContent || "", v.push(r);
106
+ const r = l.createElement("script");
107
+ Array.from(e.attributes).forEach((d) => {
108
+ r.setAttribute(d.name, d.value);
109
+ }), r.textContent = e.textContent || "", b.push(r);
115
110
  }
116
111
  e.remove();
117
- }), ve(h, D);
118
- const $ = v.some(
119
- (e) => e.tagName.toLowerCase() === "style"
120
- ), F = v.some(
112
+ }), ne(h, W);
113
+ const $ = b.some(
121
114
  (e) => e.tagName.toLowerCase() === "script"
122
- );
123
- $ && (b.current = !0, U.current = performance.now(), u(g), S(!0)), F && (w.current = !0, V.current = performance.now(), u(y), C(!0));
124
- const K = Array.from(h.childNodes), Q = K.length > 0;
125
- M(Q), t.replaceChildren(...K);
126
- const J = (e) => {
127
- const r = ge(e.target);
128
- r && X(r.getAttribute("href")) && (r.setAttribute("target", "_blank"), r.setAttribute(
115
+ ), L = Array.from(h.childNodes), N = L.length > 0;
116
+ w(N), s.replaceChildren(...L);
117
+ const T = (e) => {
118
+ const r = Z(e.target);
119
+ r && j(r.getAttribute("href")) && (r.setAttribute("target", "_blank"), r.setAttribute(
129
120
  "rel",
130
- Y(r.getAttribute("rel"))
121
+ F(r.getAttribute("rel"))
131
122
  ));
132
123
  };
133
- t.addEventListener("click", J, !0);
134
- let x = null;
135
- const P = () => t.childNodes.length === 0 ? !1 : (M(!0), x?.disconnect(), x = null, !0);
136
- return !Q && F && O && (x = new MutationObserver(() => {
137
- P();
138
- }), x.observe(t, {
124
+ s.addEventListener("click", T, !0);
125
+ let m = null;
126
+ const H = () => s.childNodes.length === 0 ? !1 : (w(!0), m?.disconnect(), m = null, !0);
127
+ return !N && $ && k && (m = new MutationObserver(() => {
128
+ H();
129
+ }), m.observe(s, {
139
130
  childList: !0,
140
131
  subtree: !0
141
- })), v.forEach((e) => {
132
+ })), b.forEach((e) => {
142
133
  if (e.tagName.toLowerCase() === "style") {
143
- a.head?.appendChild(e), _.current.push(e);
134
+ l.head?.appendChild(e), x.current.push(e);
144
135
  return;
145
136
  }
146
- if (O) {
147
- const r = e, m = r.textContent || "";
137
+ if (k) {
138
+ const r = e, d = r.textContent || "";
148
139
  if (!r.src)
149
140
  try {
150
- new Function(m);
141
+ new Function(d);
151
142
  } catch {
152
143
  r.remove();
153
144
  return;
154
145
  }
155
146
  try {
156
- i.appendChild(r), H.current.push(r);
147
+ u.appendChild(r), A.current.push(r);
157
148
  } catch {
158
149
  r.remove();
159
150
  }
160
151
  } else
161
152
  e.remove();
162
- }), P(), z && t.ownerDocument?.defaultView?.__mdf_triggerFitContent?.(), requestAnimationFrame(() => {
163
- $ && B(
164
- S,
165
- g,
166
- U,
167
- () => {
168
- b.current = !1;
169
- }
170
- ), F && B(
171
- C,
172
- y,
173
- V,
174
- () => {
175
- w.current = !1;
176
- }
177
- );
178
- }), () => {
179
- x?.disconnect(), t.removeEventListener("click", J, !0);
153
+ }), H(), S && s.ownerDocument?.defaultView?.__mdf_triggerFitContent?.(), () => {
154
+ m?.disconnect(), s.removeEventListener("click", T, !0);
180
155
  };
181
- }, [o, A, z]), k(
182
- () => () => {
183
- u(g), u(y);
184
- },
185
- []
186
- ), k(() => {
187
- L && (u(g), u(y), b.current = !1, w.current = !1, S(!1), C(!1));
188
- }, [L]);
189
- const E = L ? null : se || w.current ? p || s || N.sandboxScriptLoadingText : ne || b.current ? d || s || N.sandboxStyleLoadingText : oe ? null : s || N.sandboxLoadingText, j = ee === "blackboard", I = j && re, ce = {
156
+ }, [o, a, S, R]);
157
+ const p = !z && !V ? n || U.sandboxLoadingText : null, C = f === "blackboard", g = C && q, B = {
190
158
  position: "relative",
191
159
  width: "100%",
192
160
  height: "100%",
193
161
  display: "flex",
194
162
  flexDirection: "column",
195
163
  // Keep blackboard scroll behavior while centering content in non-blackboard mode
196
- justifyContent: I ? "flex-start" : j ? "space-around" : "flex-start"
197
- }, ie = {
198
- pointerEvents: E ? "none" : void 0,
199
- margin: j ? void 0 : "auto 0",
164
+ justifyContent: g ? "flex-start" : C ? "space-around" : "flex-start"
165
+ }, O = {
166
+ pointerEvents: p ? "none" : void 0,
167
+ margin: C ? void 0 : "auto 0",
200
168
  width: "100%",
201
- height: I ? "100%" : void 0,
202
- minHeight: I ? 0 : void 0,
203
- flex: I ? "1 1 auto" : void 0
169
+ height: g ? "100%" : void 0,
170
+ minHeight: g ? 0 : void 0,
171
+ flex: g ? "1 1 auto" : void 0
204
172
  };
205
- return /* @__PURE__ */ ue(
173
+ return /* @__PURE__ */ G(
206
174
  "div",
207
175
  {
208
- "data-root-vh": te ? "true" : "false",
176
+ "data-root-vh": D ? "true" : "false",
209
177
  className: "sandbox-wrapper",
210
- dir: f ?? he(n),
211
- lang: c ?? de(n),
212
- style: ce,
213
- "aria-busy": !!E,
178
+ dir: i ?? P(t),
179
+ lang: c ?? J(t),
180
+ style: B,
181
+ "aria-busy": !!p,
214
182
  children: [
215
- /* @__PURE__ */ G(
183
+ /* @__PURE__ */ E(
216
184
  "div",
217
185
  {
218
- ref: T,
186
+ ref: v,
219
187
  className: "sandbox-container",
220
- style: ie
188
+ style: O
221
189
  }
222
190
  ),
223
- E && /* @__PURE__ */ G(
191
+ p && /* @__PURE__ */ E(
224
192
  "div",
225
193
  {
226
194
  style: {
@@ -232,7 +200,7 @@ const ye = [
232
200
  justifyContent: "center",
233
201
  pointerEvents: "none"
234
202
  },
235
- children: /* @__PURE__ */ G(fe, { message: E })
203
+ children: /* @__PURE__ */ E(Q, { message: p })
236
204
  }
237
205
  )
238
206
  ]
@@ -240,6 +208,7 @@ const ye = [
240
208
  );
241
209
  };
242
210
  export {
243
- ke as default
211
+ fe as default,
212
+ oe as hasCompleteScriptTags
244
213
  };
245
214
  //# sourceMappingURL=SandboxApp.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SandboxApp.es.js","sources":["../../../src/components/ContentRender/SandboxApp.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\nimport LoadingOverlayCard from \"../ui/loading-overlay-card\";\nimport {\n getMarkdownFlowDirection,\n getMarkdownFlowLanguage,\n type MarkdownFlowLocale,\n} from \"../../lib/locale\";\nimport { getContentRenderLocaleTexts } from \"./contentRenderI18n\";\nimport type { ScalingWindow } from \"./utils/iframe-scaling\";\nimport {\n isAnchorElement,\n mergeAnchorRelValue,\n resolveClosestAnchor,\n shouldForceAnchorHrefToNewTab,\n} from \"./utils/link-targets\";\n\nexport interface SandboxAppProps {\n html: string;\n locale?: MarkdownFlowLocale;\n /** Overrides the wrapper language without changing authored HTML language. */\n lang?: string;\n /** Overrides the wrapper direction while preserving explicit direction in authored HTML. */\n dir?: React.HTMLAttributes<HTMLDivElement>[\"dir\"];\n loadingText?: string;\n styleLoadingText?: string;\n scriptLoadingText?: string;\n resetToken?: number;\n mode?: \"content\" | \"blackboard\";\n hasRootVhHeight?: boolean;\n stretchRootHeight?: boolean;\n enableScaling?: boolean;\n disableLoadingOverlay?: boolean;\n}\n\nconst IMAGE_REUSE_ATTRIBUTES = [\n \"src\",\n \"srcset\",\n \"sizes\",\n \"alt\",\n \"class\",\n \"width\",\n \"height\",\n \"style\",\n \"loading\",\n \"decoding\",\n \"crossorigin\",\n \"referrerpolicy\",\n \"fetchpriority\",\n];\n\nconst getImageReuseKey = (image: HTMLImageElement) =>\n IMAGE_REUSE_ATTRIBUTES.map(\n (attribute) => `${attribute}:${image.getAttribute(attribute) || \"\"}`\n ).join(\"|\");\n\nconst collectReusableImages = (root: ParentNode) => {\n const imageMap = new Map<string, HTMLImageElement[]>();\n root.querySelectorAll(\"img\").forEach((node) => {\n const image = node as HTMLImageElement;\n const key = getImageReuseKey(image);\n const bucket = imageMap.get(key) || [];\n bucket.push(image);\n imageMap.set(key, bucket);\n });\n return imageMap;\n};\n\nconst syncImageAttributes = (\n sourceImage: HTMLImageElement,\n targetImage: HTMLImageElement\n) => {\n const sourceAttributes = Array.from(sourceImage.attributes);\n const sourceAttributeNames = new Set(\n sourceAttributes.map((attribute) => attribute.name)\n );\n\n Array.from(targetImage.attributes).forEach((attribute) => {\n if (!sourceAttributeNames.has(attribute.name)) {\n targetImage.removeAttribute(attribute.name);\n }\n });\n\n sourceAttributes.forEach((attribute) => {\n targetImage.setAttribute(attribute.name, attribute.value);\n });\n};\n\nconst reuseRenderedImages = (\n root: ParentNode,\n imageMap: Map<string, HTMLImageElement[]>\n) => {\n if (!imageMap.size) return;\n\n root.querySelectorAll(\"img\").forEach((node) => {\n const nextImage = node as HTMLImageElement;\n const key = getImageReuseKey(nextImage);\n const bucket = imageMap.get(key);\n const preservedImage = bucket?.shift();\n if (!preservedImage) return;\n\n syncImageAttributes(nextImage, preservedImage);\n nextImage.replaceWith(preservedImage);\n\n if (bucket && bucket.length === 0) {\n imageMap.delete(key);\n }\n });\n};\n\nconst SandboxApp: React.FC<SandboxAppProps> = ({\n html,\n locale,\n dir,\n lang,\n loadingText,\n styleLoadingText,\n scriptLoadingText,\n resetToken = 0,\n mode = \"content\",\n hasRootVhHeight = false,\n stretchRootHeight = false,\n enableScaling = false,\n disableLoadingOverlay = false,\n}) => {\n const localeTexts = getContentRenderLocaleTexts(locale);\n const containerRef = useRef<HTMLDivElement>(null);\n const [isGeneratingStyles, setIsGeneratingStyles] = useState(false);\n const [isGeneratingScripts, setIsGeneratingScripts] = useState(false);\n const [hasRenderedContent, setHasRenderedContent] = useState(false);\n const appendedStylesRef = useRef<HTMLStyleElement[]>([]);\n const appendedScriptsRef = useRef<HTMLScriptElement[]>([]);\n const styleStartRef = useRef(0);\n const scriptStartRef = useRef(0);\n const styleTimerRef = useRef<number | null>(null);\n const scriptTimerRef = useRef<number | null>(null);\n const hasStylesRef = useRef(false);\n const hasScriptsRef = useRef(false);\n const prevResetTokenRef = useRef(resetToken);\n const MIN_LOADING_MS = 200;\n\n const clearTimer = (timerRef: React.MutableRefObject<number | null>) => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n };\n\n const settleStateWithMinimumDelay = (\n setter: React.Dispatch<React.SetStateAction<boolean>>,\n timerRef: React.MutableRefObject<number | null>,\n startRef: React.MutableRefObject<number>,\n onDone?: () => void\n ) => {\n const elapsed = performance.now() - startRef.current;\n const delay = Math.max(0, MIN_LOADING_MS - elapsed);\n clearTimer(timerRef);\n timerRef.current = window.setTimeout(() => {\n setter(false);\n onDone?.();\n timerRef.current = null;\n }, delay);\n };\n\n useEffect(() => {\n const doc = containerRef.current?.ownerDocument;\n if (!doc) return;\n const styleId = \"sandbox-spinner-style\";\n let styleEl = doc.getElementById(styleId) as HTMLStyleElement | null;\n if (!styleEl) {\n styleEl = doc.createElement(\"style\");\n styleEl.id = styleId;\n doc.head?.appendChild(styleEl);\n }\n styleEl.textContent = `\n .sandbox-wrapper { align-items: center; }\n .sandbox-container { position: relative; width: 100%; }\n .sandbox-container svg,\n .sandbox-container img { display: block; margin-left: auto; margin-right: auto; }\n /* Hide scroll UI without removing scroll semantics. Content roots with\n inline style=\"height:100vh; overflow-y:auto\" are the signal that\n IframeSandbox.getInnerScrollableHeight relies on to grow the iframe\n when content exceeds the viewport. We must not change overflow-y,\n but sub-pixel rounding (1px below the +1 detection threshold) can\n still surface a phantom scrollbar on content that visually fits.\n Hide the scrollbar UI globally; when content truly overflows the\n iframe is resized and no scrollbar would render anyway. */\n .sandbox-container *::-webkit-scrollbar { display: none; }\n .sandbox-container * { scrollbar-width: none; -ms-overflow-style: none; }\n .justify-\\\\[safe_center\\\\]{\n justify-content: safe center;\n }\n .overflow-y-auto { overflow-y: visible !important; }\n `;\n }, []);\n\n useEffect(() => {\n if (resetToken !== prevResetTokenRef.current) {\n setHasRenderedContent(false);\n prevResetTokenRef.current = resetToken;\n }\n clearTimer(styleTimerRef);\n clearTimer(scriptTimerRef);\n hasStylesRef.current = false;\n hasScriptsRef.current = false;\n\n const container = containerRef.current;\n if (!container) return;\n const doc = container.ownerDocument;\n const body = doc?.body;\n if (!body) return;\n const reusableImages = collectReusableImages(container);\n\n appendedStylesRef.current.forEach((node) => node.remove());\n appendedStylesRef.current = [];\n appendedScriptsRef.current.forEach((node) => node.remove());\n appendedScriptsRef.current = [];\n\n setIsGeneratingStyles(false);\n setIsGeneratingScripts(false);\n const wrapper = doc.createElement(\"div\");\n wrapper.innerHTML = html;\n wrapper.querySelectorAll(\"a[href]\").forEach((node) => {\n if (!isAnchorElement(node)) {\n return;\n }\n\n if (!shouldForceAnchorHrefToNewTab(node.getAttribute(\"href\"))) {\n return;\n }\n\n node.setAttribute(\"target\", \"_blank\");\n node.setAttribute(\"rel\", mergeAnchorRelValue(node.getAttribute(\"rel\")));\n });\n\n const openScriptCount = (html.match(/<script[\\s>]/gi) || []).length;\n const closeScriptCount = (html.match(/<\\/script>/gi) || []).length;\n const shouldExecuteScripts =\n openScriptCount > 0 && openScriptCount === closeScriptCount;\n\n const resourceQueue: HTMLElement[] = [];\n\n Array.from(wrapper.querySelectorAll(\"style, script\")).forEach((node) => {\n if (node.tagName.toLowerCase() === \"style\") {\n const cloned = doc.createElement(\"style\");\n cloned.textContent = node.textContent || \"\";\n Array.from(node.attributes).forEach((attr) => {\n cloned.setAttribute(attr.name, attr.value);\n });\n resourceQueue.push(cloned);\n } else {\n const replacement = doc.createElement(\"script\");\n Array.from(node.attributes).forEach((attr) => {\n replacement.setAttribute(attr.name, attr.value);\n });\n replacement.textContent = node.textContent || \"\";\n resourceQueue.push(replacement);\n }\n node.remove();\n });\n reuseRenderedImages(wrapper, reusableImages);\n\n const hasStyles = resourceQueue.some(\n (node) => node.tagName.toLowerCase() === \"style\"\n );\n const hasScripts = resourceQueue.some(\n (node) => node.tagName.toLowerCase() === \"script\"\n );\n if (hasStyles) {\n hasStylesRef.current = true;\n styleStartRef.current = performance.now();\n clearTimer(styleTimerRef);\n setIsGeneratingStyles(true);\n }\n if (hasScripts) {\n hasScriptsRef.current = true;\n scriptStartRef.current = performance.now();\n clearTimer(scriptTimerRef);\n setIsGeneratingScripts(true);\n }\n\n const contentNodes = Array.from(wrapper.childNodes);\n const hasInitialContent = contentNodes.length > 0;\n setHasRenderedContent(hasInitialContent);\n container.replaceChildren(...contentNodes);\n\n const handleLinkClick = (event: MouseEvent) => {\n const anchor = resolveClosestAnchor(event.target);\n if (!anchor) {\n return;\n }\n\n if (!shouldForceAnchorHrefToNewTab(anchor.getAttribute(\"href\"))) {\n return;\n }\n\n anchor.setAttribute(\"target\", \"_blank\");\n anchor.setAttribute(\n \"rel\",\n mergeAnchorRelValue(anchor.getAttribute(\"rel\"))\n );\n };\n container.addEventListener(\"click\", handleLinkClick, true);\n\n let scriptContentObserver: MutationObserver | null = null;\n const markRenderedContentFromContainer = () => {\n if (container.childNodes.length === 0) {\n return false;\n }\n\n setHasRenderedContent(true);\n scriptContentObserver?.disconnect();\n scriptContentObserver = null;\n return true;\n };\n if (!hasInitialContent && hasScripts && shouldExecuteScripts) {\n scriptContentObserver = new MutationObserver(() => {\n markRenderedContentFromContainer();\n });\n scriptContentObserver.observe(container, {\n childList: true,\n subtree: true,\n });\n }\n\n resourceQueue.forEach((node) => {\n if (node.tagName.toLowerCase() === \"style\") {\n doc.head?.appendChild(node);\n appendedStylesRef.current.push(node as HTMLStyleElement);\n return;\n }\n\n if (shouldExecuteScripts) {\n const scriptNode = node as HTMLScriptElement;\n const scriptText = scriptNode.textContent || \"\";\n const shouldValidate = !scriptNode.src;\n\n if (shouldValidate) {\n try {\n // Validate script is syntactically complete before executing\n\n new Function(scriptText);\n } catch {\n scriptNode.remove();\n return;\n }\n }\n\n try {\n body.appendChild(scriptNode);\n appendedScriptsRef.current.push(scriptNode);\n } catch {\n scriptNode.remove();\n }\n } else {\n // Defer execution until all script tags are fully received\n node.remove();\n }\n });\n markRenderedContentFromContainer();\n if (enableScaling) {\n const win = container.ownerDocument?.defaultView as ScalingWindow | null;\n win?.__mdf_triggerFitContent?.();\n }\n\n requestAnimationFrame(() => {\n if (hasStyles) {\n settleStateWithMinimumDelay(\n setIsGeneratingStyles,\n styleTimerRef,\n styleStartRef,\n () => {\n hasStylesRef.current = false;\n }\n );\n }\n if (hasScripts) {\n settleStateWithMinimumDelay(\n setIsGeneratingScripts,\n scriptTimerRef,\n scriptStartRef,\n () => {\n hasScriptsRef.current = false;\n }\n );\n }\n });\n\n return () => {\n scriptContentObserver?.disconnect();\n container.removeEventListener(\"click\", handleLinkClick, true);\n };\n }, [html, resetToken, enableScaling]);\n\n useEffect(\n () => () => {\n clearTimer(styleTimerRef);\n clearTimer(scriptTimerRef);\n },\n []\n );\n\n useEffect(() => {\n if (!disableLoadingOverlay) {\n return;\n }\n\n clearTimer(styleTimerRef);\n clearTimer(scriptTimerRef);\n hasStylesRef.current = false;\n hasScriptsRef.current = false;\n setIsGeneratingStyles(false);\n setIsGeneratingScripts(false);\n }, [disableLoadingOverlay]);\n\n const overlayMessage = (() => {\n if (disableLoadingOverlay) {\n return null;\n }\n\n if (isGeneratingScripts || hasScriptsRef.current)\n return (\n scriptLoadingText || loadingText || localeTexts.sandboxScriptLoadingText\n );\n if (isGeneratingStyles || hasStylesRef.current)\n return (\n styleLoadingText || loadingText || localeTexts.sandboxStyleLoadingText\n );\n if (!hasRenderedContent)\n return loadingText || localeTexts.sandboxLoadingText;\n return null;\n })();\n\n const isBlackboard = mode === \"blackboard\";\n const shouldStretchRootHeight = isBlackboard && stretchRootHeight;\n const sandboxWrapperStyle: React.CSSProperties = {\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n // Keep blackboard scroll behavior while centering content in non-blackboard mode\n justifyContent: shouldStretchRootHeight\n ? \"flex-start\"\n : isBlackboard\n ? \"space-around\"\n : \"flex-start\",\n };\n const sandboxContainerStyle: React.CSSProperties = {\n pointerEvents: overlayMessage ? \"none\" : undefined,\n margin: isBlackboard ? undefined : \"auto 0\",\n width: \"100%\",\n height: shouldStretchRootHeight ? \"100%\" : undefined,\n minHeight: shouldStretchRootHeight ? 0 : undefined,\n flex: shouldStretchRootHeight ? \"1 1 auto\" : undefined,\n };\n\n return (\n <div\n data-root-vh={hasRootVhHeight ? \"true\" : \"false\"}\n className=\"sandbox-wrapper\"\n dir={dir ?? getMarkdownFlowDirection(locale)}\n lang={lang ?? getMarkdownFlowLanguage(locale)}\n style={sandboxWrapperStyle}\n aria-busy={!!overlayMessage}\n >\n <div\n ref={containerRef}\n className=\"sandbox-container\"\n style={sandboxContainerStyle}\n />\n {overlayMessage && (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n zIndex: 20,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n pointerEvents: \"none\",\n }}\n >\n <LoadingOverlayCard message={overlayMessage} />\n </div>\n )}\n </div>\n );\n};\n\nexport default SandboxApp;\n"],"names":["IMAGE_REUSE_ATTRIBUTES","getImageReuseKey","image","attribute","collectReusableImages","root","imageMap","node","key","bucket","syncImageAttributes","sourceImage","targetImage","sourceAttributes","sourceAttributeNames","reuseRenderedImages","nextImage","preservedImage","SandboxApp","html","locale","dir","lang","loadingText","styleLoadingText","scriptLoadingText","resetToken","mode","hasRootVhHeight","stretchRootHeight","enableScaling","disableLoadingOverlay","localeTexts","getContentRenderLocaleTexts","containerRef","useRef","isGeneratingStyles","setIsGeneratingStyles","useState","isGeneratingScripts","setIsGeneratingScripts","hasRenderedContent","setHasRenderedContent","appendedStylesRef","appendedScriptsRef","styleStartRef","scriptStartRef","styleTimerRef","scriptTimerRef","hasStylesRef","hasScriptsRef","prevResetTokenRef","MIN_LOADING_MS","clearTimer","timerRef","settleStateWithMinimumDelay","setter","startRef","onDone","elapsed","delay","useEffect","doc","styleId","styleEl","container","body","reusableImages","wrapper","isAnchorElement","shouldForceAnchorHrefToNewTab","mergeAnchorRelValue","openScriptCount","closeScriptCount","shouldExecuteScripts","resourceQueue","cloned","attr","replacement","hasStyles","hasScripts","contentNodes","hasInitialContent","handleLinkClick","event","anchor","resolveClosestAnchor","scriptContentObserver","markRenderedContentFromContainer","scriptNode","scriptText","overlayMessage","isBlackboard","shouldStretchRootHeight","sandboxWrapperStyle","sandboxContainerStyle","jsxs","getMarkdownFlowDirection","getMarkdownFlowLanguage","jsx","LoadingOverlayCard"],"mappings":";;;;;;AAkCA,MAAMA,KAAyB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEMC,IAAmB,CAACC,MACxBF,GAAuB;AAAA,EACrB,CAACG,MAAc,GAAGA,CAAS,IAAID,EAAM,aAAaC,CAAS,KAAK,EAAE;AACpE,EAAE,KAAK,GAAG,GAENC,KAAwB,CAACC,MAAqB;AAClD,QAAMC,wBAAe,IAAA;AACrB,SAAAD,EAAK,iBAAiB,KAAK,EAAE,QAAQ,CAACE,MAAS;AAC7C,UAAML,IAAQK,GACRC,IAAMP,EAAiBC,CAAK,GAC5BO,IAASH,EAAS,IAAIE,CAAG,KAAK,CAAA;AACpC,IAAAC,EAAO,KAAKP,CAAK,GACjBI,EAAS,IAAIE,GAAKC,CAAM;AAAA,EAC1B,CAAC,GACMH;AACT,GAEMI,KAAsB,CAC1BC,GACAC,MACG;AACH,QAAMC,IAAmB,MAAM,KAAKF,EAAY,UAAU,GACpDG,IAAuB,IAAI;AAAA,IAC/BD,EAAiB,IAAI,CAACV,MAAcA,EAAU,IAAI;AAAA,EAAA;AAGpD,QAAM,KAAKS,EAAY,UAAU,EAAE,QAAQ,CAACT,MAAc;AACxD,IAAKW,EAAqB,IAAIX,EAAU,IAAI,KAC1CS,EAAY,gBAAgBT,EAAU,IAAI;AAAA,EAE9C,CAAC,GAEDU,EAAiB,QAAQ,CAACV,MAAc;AACtC,IAAAS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,cACR,SAAS;AAAA,cACT,YAAY;AAAA,cACZ,gBAAgB;AAAA,cAChB,eAAe;AAAA,YAAA;AAAA,YAGjB,UAAA,gBAAAA,EAACC,IAAA,EAAmB,SAAST,EAAA,CAAgB;AAAA,UAAA;AAAA,QAAA;AAAA,MAC/C;AAAA,IAAA;AAAA,EAAA;AAIR;"}
1
+ {"version":3,"file":"SandboxApp.es.js","sources":["../../../src/components/ContentRender/SandboxApp.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\nimport LoadingOverlayCard from \"../ui/loading-overlay-card\";\nimport {\n getMarkdownFlowDirection,\n getMarkdownFlowLanguage,\n type MarkdownFlowLocale,\n} from \"../../lib/locale\";\nimport { getContentRenderLocaleTexts } from \"./contentRenderI18n\";\nimport type { ScalingWindow } from \"./utils/iframe-scaling\";\nimport {\n isAnchorElement,\n mergeAnchorRelValue,\n resolveClosestAnchor,\n shouldForceAnchorHrefToNewTab,\n} from \"./utils/link-targets\";\n\nexport interface SandboxAppProps {\n html: string;\n locale?: MarkdownFlowLocale;\n /** Overrides the wrapper language without changing authored HTML language. */\n lang?: string;\n /** Overrides the wrapper direction while preserving explicit direction in authored HTML. */\n dir?: React.HTMLAttributes<HTMLDivElement>[\"dir\"];\n loadingText?: string;\n resetToken?: number;\n mode?: \"content\" | \"blackboard\";\n hasRootVhHeight?: boolean;\n stretchRootHeight?: boolean;\n enableScaling?: boolean;\n disableLoadingOverlay?: boolean;\n}\n\nconst IMAGE_REUSE_ATTRIBUTES = [\n \"src\",\n \"srcset\",\n \"sizes\",\n \"alt\",\n \"class\",\n \"width\",\n \"height\",\n \"style\",\n \"loading\",\n \"decoding\",\n \"crossorigin\",\n \"referrerpolicy\",\n \"fetchpriority\",\n];\n\nconst getImageReuseKey = (image: HTMLImageElement) =>\n IMAGE_REUSE_ATTRIBUTES.map(\n (attribute) => `${attribute}:${image.getAttribute(attribute) || \"\"}`\n ).join(\"|\");\n\nconst collectReusableImages = (root: ParentNode) => {\n const imageMap = new Map<string, HTMLImageElement[]>();\n root.querySelectorAll(\"img\").forEach((node) => {\n const image = node as HTMLImageElement;\n const key = getImageReuseKey(image);\n const bucket = imageMap.get(key) || [];\n bucket.push(image);\n imageMap.set(key, bucket);\n });\n return imageMap;\n};\n\nconst syncImageAttributes = (\n sourceImage: HTMLImageElement,\n targetImage: HTMLImageElement\n) => {\n const sourceAttributes = Array.from(sourceImage.attributes);\n const sourceAttributeNames = new Set(\n sourceAttributes.map((attribute) => attribute.name)\n );\n\n Array.from(targetImage.attributes).forEach((attribute) => {\n if (!sourceAttributeNames.has(attribute.name)) {\n targetImage.removeAttribute(attribute.name);\n }\n });\n\n sourceAttributes.forEach((attribute) => {\n targetImage.setAttribute(attribute.name, attribute.value);\n });\n};\n\nconst reuseRenderedImages = (\n root: ParentNode,\n imageMap: Map<string, HTMLImageElement[]>\n) => {\n if (!imageMap.size) return;\n\n root.querySelectorAll(\"img\").forEach((node) => {\n const nextImage = node as HTMLImageElement;\n const key = getImageReuseKey(nextImage);\n const bucket = imageMap.get(key);\n const preservedImage = bucket?.shift();\n if (!preservedImage) return;\n\n syncImageAttributes(nextImage, preservedImage);\n nextImage.replaceWith(preservedImage);\n\n if (bucket && bucket.length === 0) {\n imageMap.delete(key);\n }\n });\n};\n\nexport const hasCompleteScriptTags = (html: string) => {\n const openScriptCount = (html.match(/<script[\\s>]/gi) || []).length;\n const closeScriptCount = (html.match(/<\\/script>/gi) || []).length;\n return openScriptCount > 0 && openScriptCount === closeScriptCount;\n};\n\nconst SandboxApp: React.FC<SandboxAppProps & { deferScripts?: boolean }> = ({\n html,\n locale,\n dir,\n lang,\n loadingText,\n resetToken = 0,\n mode = \"content\",\n hasRootVhHeight = false,\n stretchRootHeight = false,\n enableScaling = false,\n disableLoadingOverlay = false,\n deferScripts = false,\n}) => {\n const localeTexts = getContentRenderLocaleTexts(locale);\n const containerRef = useRef<HTMLDivElement>(null);\n const [hasRenderedContent, setHasRenderedContent] = useState(false);\n const appendedStylesRef = useRef<HTMLStyleElement[]>([]);\n const appendedScriptsRef = useRef<HTMLScriptElement[]>([]);\n const prevResetTokenRef = useRef(resetToken);\n\n useEffect(() => {\n const doc = containerRef.current?.ownerDocument;\n if (!doc) return;\n const styleId = \"sandbox-layout-style\";\n let styleEl = doc.getElementById(styleId) as HTMLStyleElement | null;\n if (!styleEl) {\n styleEl = doc.createElement(\"style\");\n styleEl.id = styleId;\n doc.head?.appendChild(styleEl);\n }\n styleEl.textContent = `\n .sandbox-wrapper { align-items: center; }\n .sandbox-container { position: relative; width: 100%; }\n .sandbox-container svg,\n .sandbox-container img { display: block; margin-left: auto; margin-right: auto; }\n /* Hide scroll UI without removing scroll semantics. Content roots with\n inline style=\"height:100vh; overflow-y:auto\" are the signal that\n IframeSandbox.getInnerScrollableHeight relies on to grow the iframe\n when content exceeds the viewport. We must not change overflow-y,\n but sub-pixel rounding (1px below the +1 detection threshold) can\n still surface a phantom scrollbar on content that visually fits.\n Hide the scrollbar UI globally; when content truly overflows the\n iframe is resized and no scrollbar would render anyway. */\n .sandbox-container *::-webkit-scrollbar { display: none; }\n .sandbox-container * { scrollbar-width: none; -ms-overflow-style: none; }\n .justify-\\\\[safe_center\\\\]{\n justify-content: safe center;\n }\n .overflow-y-auto { overflow-y: visible !important; }\n `;\n }, []);\n\n useEffect(() => {\n if (resetToken !== prevResetTokenRef.current) {\n setHasRenderedContent(false);\n prevResetTokenRef.current = resetToken;\n }\n const container = containerRef.current;\n if (!container) return;\n const doc = container.ownerDocument;\n const body = doc?.body;\n if (!body) return;\n const reusableImages = collectReusableImages(container);\n\n appendedStylesRef.current.forEach((node) => node.remove());\n appendedStylesRef.current = [];\n appendedScriptsRef.current.forEach((node) => node.remove());\n appendedScriptsRef.current = [];\n\n const wrapper = doc.createElement(\"div\");\n wrapper.innerHTML = html;\n wrapper.querySelectorAll(\"a[href]\").forEach((node) => {\n if (!isAnchorElement(node)) {\n return;\n }\n\n if (!shouldForceAnchorHrefToNewTab(node.getAttribute(\"href\"))) {\n return;\n }\n\n node.setAttribute(\"target\", \"_blank\");\n node.setAttribute(\"rel\", mergeAnchorRelValue(node.getAttribute(\"rel\")));\n });\n\n const shouldExecuteScripts = !deferScripts && hasCompleteScriptTags(html);\n\n const resourceQueue: HTMLElement[] = [];\n\n Array.from(wrapper.querySelectorAll(\"style, script\")).forEach((node) => {\n if (node.tagName.toLowerCase() === \"style\") {\n const cloned = doc.createElement(\"style\");\n cloned.textContent = node.textContent || \"\";\n Array.from(node.attributes).forEach((attr) => {\n cloned.setAttribute(attr.name, attr.value);\n });\n resourceQueue.push(cloned);\n } else {\n const replacement = doc.createElement(\"script\");\n Array.from(node.attributes).forEach((attr) => {\n replacement.setAttribute(attr.name, attr.value);\n });\n replacement.textContent = node.textContent || \"\";\n resourceQueue.push(replacement);\n }\n node.remove();\n });\n reuseRenderedImages(wrapper, reusableImages);\n\n const hasScripts = resourceQueue.some(\n (node) => node.tagName.toLowerCase() === \"script\"\n );\n\n const contentNodes = Array.from(wrapper.childNodes);\n const hasInitialContent = contentNodes.length > 0;\n setHasRenderedContent(hasInitialContent);\n container.replaceChildren(...contentNodes);\n\n const handleLinkClick = (event: MouseEvent) => {\n const anchor = resolveClosestAnchor(event.target);\n if (!anchor) {\n return;\n }\n\n if (!shouldForceAnchorHrefToNewTab(anchor.getAttribute(\"href\"))) {\n return;\n }\n\n anchor.setAttribute(\"target\", \"_blank\");\n anchor.setAttribute(\n \"rel\",\n mergeAnchorRelValue(anchor.getAttribute(\"rel\"))\n );\n };\n container.addEventListener(\"click\", handleLinkClick, true);\n\n let scriptContentObserver: MutationObserver | null = null;\n const markRenderedContentFromContainer = () => {\n if (container.childNodes.length === 0) {\n return false;\n }\n\n setHasRenderedContent(true);\n scriptContentObserver?.disconnect();\n scriptContentObserver = null;\n return true;\n };\n if (!hasInitialContent && hasScripts && shouldExecuteScripts) {\n scriptContentObserver = new MutationObserver(() => {\n markRenderedContentFromContainer();\n });\n scriptContentObserver.observe(container, {\n childList: true,\n subtree: true,\n });\n }\n\n resourceQueue.forEach((node) => {\n if (node.tagName.toLowerCase() === \"style\") {\n doc.head?.appendChild(node);\n appendedStylesRef.current.push(node as HTMLStyleElement);\n return;\n }\n\n if (shouldExecuteScripts) {\n const scriptNode = node as HTMLScriptElement;\n const scriptText = scriptNode.textContent || \"\";\n const shouldValidate = !scriptNode.src;\n\n if (shouldValidate) {\n try {\n // Validate script is syntactically complete before executing\n\n new Function(scriptText);\n } catch {\n scriptNode.remove();\n return;\n }\n }\n\n try {\n body.appendChild(scriptNode);\n appendedScriptsRef.current.push(scriptNode);\n } catch {\n scriptNode.remove();\n }\n } else {\n // Leave scripts out of partial and intermediate render frames.\n node.remove();\n }\n });\n markRenderedContentFromContainer();\n if (enableScaling) {\n const win = container.ownerDocument?.defaultView as ScalingWindow | null;\n win?.__mdf_triggerFitContent?.();\n }\n\n return () => {\n scriptContentObserver?.disconnect();\n container.removeEventListener(\"click\", handleLinkClick, true);\n };\n }, [html, resetToken, enableScaling, deferScripts]);\n\n const overlayMessage =\n !disableLoadingOverlay && !hasRenderedContent\n ? loadingText || localeTexts.sandboxLoadingText\n : null;\n\n const isBlackboard = mode === \"blackboard\";\n const shouldStretchRootHeight = isBlackboard && stretchRootHeight;\n const sandboxWrapperStyle: React.CSSProperties = {\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n // Keep blackboard scroll behavior while centering content in non-blackboard mode\n justifyContent: shouldStretchRootHeight\n ? \"flex-start\"\n : isBlackboard\n ? \"space-around\"\n : \"flex-start\",\n };\n const sandboxContainerStyle: React.CSSProperties = {\n pointerEvents: overlayMessage ? \"none\" : undefined,\n margin: isBlackboard ? undefined : \"auto 0\",\n width: \"100%\",\n height: shouldStretchRootHeight ? \"100%\" : undefined,\n minHeight: shouldStretchRootHeight ? 0 : undefined,\n flex: shouldStretchRootHeight ? \"1 1 auto\" : undefined,\n };\n\n return (\n <div\n data-root-vh={hasRootVhHeight ? \"true\" : \"false\"}\n className=\"sandbox-wrapper\"\n dir={dir ?? getMarkdownFlowDirection(locale)}\n lang={lang ?? getMarkdownFlowLanguage(locale)}\n style={sandboxWrapperStyle}\n aria-busy={!!overlayMessage}\n >\n <div\n ref={containerRef}\n className=\"sandbox-container\"\n style={sandboxContainerStyle}\n />\n {overlayMessage && (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n zIndex: 20,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n pointerEvents: \"none\",\n }}\n >\n <LoadingOverlayCard message={overlayMessage} />\n </div>\n )}\n </div>\n );\n};\n\nexport default SandboxApp;\n"],"names":["IMAGE_REUSE_ATTRIBUTES","getImageReuseKey","image","attribute","collectReusableImages","root","imageMap","node","key","bucket","syncImageAttributes","sourceImage","targetImage","sourceAttributes","sourceAttributeNames","reuseRenderedImages","nextImage","preservedImage","hasCompleteScriptTags","html","openScriptCount","closeScriptCount","SandboxApp","locale","dir","lang","loadingText","resetToken","mode","hasRootVhHeight","stretchRootHeight","enableScaling","disableLoadingOverlay","deferScripts","localeTexts","getContentRenderLocaleTexts","containerRef","useRef","hasRenderedContent","setHasRenderedContent","useState","appendedStylesRef","appendedScriptsRef","prevResetTokenRef","useEffect","doc","styleId","styleEl","container","body","reusableImages","wrapper","isAnchorElement","shouldForceAnchorHrefToNewTab","mergeAnchorRelValue","shouldExecuteScripts","resourceQueue","cloned","attr","replacement","hasScripts","contentNodes","hasInitialContent","handleLinkClick","event","anchor","resolveClosestAnchor","scriptContentObserver","markRenderedContentFromContainer","scriptNode","scriptText","overlayMessage","isBlackboard","shouldStretchRootHeight","sandboxWrapperStyle","sandboxContainerStyle","jsxs","getMarkdownFlowDirection","getMarkdownFlowLanguage","jsx","LoadingOverlayCard"],"mappings":";;;;;;AAgCA,MAAMA,KAAyB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;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BvD,CAAM;AAAA,MAC5C,OAAOmD;AAAA,MACP,aAAW,CAAC,CAACH;AAAA,MAEb,UAAA;AAAA,QAAA,gBAAAQ;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,KAAK3C;AAAA,YACL,WAAU;AAAA,YACV,OAAOuC;AAAA,UAAA;AAAA,QAAA;AAAA,QAERJ,KACC,gBAAAQ;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,OAAO;AAAA,cACL,UAAU;AAAA,cACV,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,SAAS;AAAA,cACT,YAAY;AAAA,cACZ,gBAAgB;AAAA,cAChB,eAAe;AAAA,YAAA;AAAA,YAGjB,UAAA,gBAAAA,EAACC,GAAA,EAAmB,SAAST,EAAA,CAAgB;AAAA,UAAA;AAAA,QAAA;AAAA,MAC/C;AAAA,IAAA;AAAA,EAAA;AAIR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"contentRenderI18n.cjs","sources":["../../../src/components/ContentRender/contentRenderI18n.ts"],"sourcesContent":["import {\n normalizeMarkdownFlowLocale,\n type MarkdownFlowLocale,\n} from \"../../lib/locale\";\nimport localeTexts from \"./locales/contentRender.json\";\n\nexport interface ContentRenderLocaleTexts {\n confirmButtonText: string;\n copyButtonText: string;\n copiedButtonText: string;\n sandboxLoadingText: string;\n sandboxStyleLoadingText: string;\n sandboxScriptLoadingText: string;\n sandboxFullscreenButtonText: string;\n sandboxExitFullscreenButtonText: string;\n sendButtonLabel: string;\n scrollToBottomLabel: string;\n mermaidLoadingText: string;\n mermaidEmptyChartText: string;\n mermaidErrorText: string;\n footnoteLabel: string;\n footnoteBackLabel: string;\n}\n\nexport const CONTENT_RENDER_LOCALE_TEXTS: Record<\n MarkdownFlowLocale,\n ContentRenderLocaleTexts\n> = localeTexts;\n\nexport const getContentRenderLocaleTexts = (\n locale?: string | null\n): ContentRenderLocaleTexts =>\n CONTENT_RENDER_LOCALE_TEXTS[normalizeMarkdownFlowLocale(locale)];\n"],"names":["CONTENT_RENDER_LOCALE_TEXTS","localeTexts","getContentRenderLocaleTexts","locale","normalizeMarkdownFlowLocale"],"mappings":"sKAwBaA,EAGTC,EAAAA,QAESC,EACXC,GAEAH,EAA4BI,EAAAA,4BAA4BD,CAAM,CAAC"}
1
+ {"version":3,"file":"contentRenderI18n.cjs","sources":["../../../src/components/ContentRender/contentRenderI18n.ts"],"sourcesContent":["import {\n normalizeMarkdownFlowLocale,\n type MarkdownFlowLocale,\n} from \"../../lib/locale\";\nimport localeTexts from \"./locales/contentRender.json\";\n\nexport interface ContentRenderLocaleTexts {\n confirmButtonText: string;\n copyButtonText: string;\n copiedButtonText: string;\n sandboxLoadingText: string;\n sandboxFullscreenButtonText: string;\n sandboxExitFullscreenButtonText: string;\n sendButtonLabel: string;\n scrollToBottomLabel: string;\n mermaidLoadingText: string;\n mermaidEmptyChartText: string;\n mermaidErrorText: string;\n footnoteLabel: string;\n footnoteBackLabel: string;\n}\n\nexport const CONTENT_RENDER_LOCALE_TEXTS: Record<\n MarkdownFlowLocale,\n ContentRenderLocaleTexts\n> = localeTexts;\n\nexport const getContentRenderLocaleTexts = (\n locale?: string | null\n): ContentRenderLocaleTexts =>\n CONTENT_RENDER_LOCALE_TEXTS[normalizeMarkdownFlowLocale(locale)];\n"],"names":["CONTENT_RENDER_LOCALE_TEXTS","localeTexts","getContentRenderLocaleTexts","locale","normalizeMarkdownFlowLocale"],"mappings":"sKAsBaA,EAGTC,EAAAA,QAESC,EACXC,GAEAH,EAA4BI,EAAAA,4BAA4BD,CAAM,CAAC"}
@@ -4,8 +4,6 @@ export interface ContentRenderLocaleTexts {
4
4
  copyButtonText: string;
5
5
  copiedButtonText: string;
6
6
  sandboxLoadingText: string;
7
- sandboxStyleLoadingText: string;
8
- sandboxScriptLoadingText: string;
9
7
  sandboxFullscreenButtonText: string;
10
8
  sandboxExitFullscreenButtonText: string;
11
9
  sendButtonLabel: string;
@@ -1 +1 @@
1
- {"version":3,"file":"contentRenderI18n.es.js","sources":["../../../src/components/ContentRender/contentRenderI18n.ts"],"sourcesContent":["import {\n normalizeMarkdownFlowLocale,\n type MarkdownFlowLocale,\n} from \"../../lib/locale\";\nimport localeTexts from \"./locales/contentRender.json\";\n\nexport interface ContentRenderLocaleTexts {\n confirmButtonText: string;\n copyButtonText: string;\n copiedButtonText: string;\n sandboxLoadingText: string;\n sandboxStyleLoadingText: string;\n sandboxScriptLoadingText: string;\n sandboxFullscreenButtonText: string;\n sandboxExitFullscreenButtonText: string;\n sendButtonLabel: string;\n scrollToBottomLabel: string;\n mermaidLoadingText: string;\n mermaidEmptyChartText: string;\n mermaidErrorText: string;\n footnoteLabel: string;\n footnoteBackLabel: string;\n}\n\nexport const CONTENT_RENDER_LOCALE_TEXTS: Record<\n MarkdownFlowLocale,\n ContentRenderLocaleTexts\n> = localeTexts;\n\nexport const getContentRenderLocaleTexts = (\n locale?: string | null\n): ContentRenderLocaleTexts =>\n CONTENT_RENDER_LOCALE_TEXTS[normalizeMarkdownFlowLocale(locale)];\n"],"names":["CONTENT_RENDER_LOCALE_TEXTS","localeTexts","getContentRenderLocaleTexts","locale","normalizeMarkdownFlowLocale"],"mappings":";;AAwBO,MAAMA,IAGTC,GAESC,IAA8B,CACzCC,MAEAH,EAA4BI,EAA4BD,CAAM,CAAC;"}
1
+ {"version":3,"file":"contentRenderI18n.es.js","sources":["../../../src/components/ContentRender/contentRenderI18n.ts"],"sourcesContent":["import {\n normalizeMarkdownFlowLocale,\n type MarkdownFlowLocale,\n} from \"../../lib/locale\";\nimport localeTexts from \"./locales/contentRender.json\";\n\nexport interface ContentRenderLocaleTexts {\n confirmButtonText: string;\n copyButtonText: string;\n copiedButtonText: string;\n sandboxLoadingText: string;\n sandboxFullscreenButtonText: string;\n sandboxExitFullscreenButtonText: string;\n sendButtonLabel: string;\n scrollToBottomLabel: string;\n mermaidLoadingText: string;\n mermaidEmptyChartText: string;\n mermaidErrorText: string;\n footnoteLabel: string;\n footnoteBackLabel: string;\n}\n\nexport const CONTENT_RENDER_LOCALE_TEXTS: Record<\n MarkdownFlowLocale,\n ContentRenderLocaleTexts\n> = localeTexts;\n\nexport const getContentRenderLocaleTexts = (\n locale?: string | null\n): ContentRenderLocaleTexts =>\n CONTENT_RENDER_LOCALE_TEXTS[normalizeMarkdownFlowLocale(locale)];\n"],"names":["CONTENT_RENDER_LOCALE_TEXTS","localeTexts","getContentRenderLocaleTexts","locale","normalizeMarkdownFlowLocale"],"mappings":";;AAsBO,MAAMA,IAGTC,GAESC,IAA8B,CACzCC,MAEAH,EAA4BI,EAA4BD,CAAM,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"en-US":{confirmButtonText:"Submit",copyButtonText:"Copy",copiedButtonText:"Copied",sandboxLoadingText:"Loading content...",sandboxStyleLoadingText:"Building styles...",sandboxScriptLoadingText:"Building scripts cache...",sandboxFullscreenButtonText:"Fullscreen",sandboxExitFullscreenButtonText:"Exit fullscreen",sendButtonLabel:"Send",scrollToBottomLabel:"Scroll to bottom",mermaidLoadingText:"Loading Mermaid chart...",mermaidEmptyChartText:"Empty chart content",mermaidErrorText:"Unable to display the Mermaid chart",footnoteLabel:"Footnotes",footnoteBackLabel:"Back to reference {reference}"},"fr-FR":{confirmButtonText:"Soumettre",copyButtonText:"Copier",copiedButtonText:"Copié",sandboxLoadingText:"Chargement du contenu...",sandboxStyleLoadingText:"Génération des styles...",sandboxScriptLoadingText:"Génération du cache des scripts...",sandboxFullscreenButtonText:"Plein écran",sandboxExitFullscreenButtonText:"Quitter le plein écran",sendButtonLabel:"Envoyer",scrollToBottomLabel:"Faire défiler jusqu'en bas",mermaidLoadingText:"Chargement du diagramme Mermaid...",mermaidEmptyChartText:"Le diagramme est vide",mermaidErrorText:"Impossible d’afficher le diagramme Mermaid",footnoteLabel:"Notes de bas de page",footnoteBackLabel:"Retour à la référence {reference}"},"zh-CN":{confirmButtonText:"提交",copyButtonText:"复制",copiedButtonText:"已复制",sandboxLoadingText:"正在加载内容...",sandboxStyleLoadingText:"正在生成样式...",sandboxScriptLoadingText:"正在生成脚本缓存...",sandboxFullscreenButtonText:"全屏浏览",sandboxExitFullscreenButtonText:"退出全屏",sendButtonLabel:"发送",scrollToBottomLabel:"滚动到底部",mermaidLoadingText:"正在加载 Mermaid 图表...",mermaidEmptyChartText:"图表内容为空",mermaidErrorText:"无法显示 Mermaid 图表",footnoteLabel:"脚注",footnoteBackLabel:"返回正文引用 {reference}"},"ar-SA":{confirmButtonText:"إرسال",copyButtonText:"نسخ",copiedButtonText:"تم النسخ",sandboxLoadingText:"جارٍ تحميل المحتوى...",sandboxStyleLoadingText:"جارٍ إنشاء الأنماط...",sandboxScriptLoadingText:"جارٍ إنشاء ذاكرة التخزين المؤقت للبرامج النصية...",sandboxFullscreenButtonText:"ملء الشاشة",sandboxExitFullscreenButtonText:"الخروج من ملء الشاشة",sendButtonLabel:"إرسال",scrollToBottomLabel:"التمرير إلى الأسفل",mermaidLoadingText:"جارٍ تحميل مخطط Mermaid...",mermaidEmptyChartText:"محتوى المخطط فارغ",mermaidErrorText:"تعذّر عرض مخطط Mermaid",footnoteLabel:"الحواشي",footnoteBackLabel:"العودة إلى موضع الإحالة {reference}"},"th-TH":{confirmButtonText:"ส่งคำตอบ",copyButtonText:"คัดลอก",copiedButtonText:"คัดลอกแล้ว",sandboxLoadingText:"กำลังโหลดเนื้อหา...",sandboxStyleLoadingText:"กำลังสร้างสไตล์...",sandboxScriptLoadingText:"กำลังสร้างแคชสคริปต์...",sandboxFullscreenButtonText:"เต็มหน้าจอ",sandboxExitFullscreenButtonText:"ออกจากเต็มหน้าจอ",sendButtonLabel:"ส่ง",scrollToBottomLabel:"เลื่อนไปด้านล่าง",mermaidLoadingText:"กำลังโหลดแผนภาพ Mermaid...",mermaidEmptyChartText:"ไม่มีเนื้อหาในแผนภาพ",mermaidErrorText:"ไม่สามารถแสดงแผนภาพ Mermaid ได้",footnoteLabel:"เชิงอรรถ",footnoteBackLabel:"กลับไปยังจุดอ้างอิง {reference}"},"es-ES":{confirmButtonText:"Enviar",copyButtonText:"Copiar",copiedButtonText:"Copiado",sandboxLoadingText:"Cargando contenido...",sandboxStyleLoadingText:"Generando estilos...",sandboxScriptLoadingText:"Generando la caché de scripts...",sandboxFullscreenButtonText:"Pantalla completa",sandboxExitFullscreenButtonText:"Salir de pantalla completa",sendButtonLabel:"Enviar",scrollToBottomLabel:"Desplazarse hasta el final",mermaidLoadingText:"Cargando el diagrama Mermaid...",mermaidEmptyChartText:"El diagrama está vacío",mermaidErrorText:"No se puede mostrar el diagrama Mermaid",footnoteLabel:"Notas al pie",footnoteBackLabel:"Volver a la referencia {reference}"},"de-DE":{confirmButtonText:"Absenden",copyButtonText:"Kopieren",copiedButtonText:"Kopiert",sandboxLoadingText:"Inhalt wird geladen...",sandboxStyleLoadingText:"Formatvorlagen werden erstellt...",sandboxScriptLoadingText:"Skript-Cache wird erstellt...",sandboxFullscreenButtonText:"Vollbild",sandboxExitFullscreenButtonText:"Vollbild verlassen",sendButtonLabel:"Senden",scrollToBottomLabel:"Zum Ende scrollen",mermaidLoadingText:"Mermaid-Diagramm wird geladen...",mermaidEmptyChartText:"Das Diagramm ist leer",mermaidErrorText:"Das Mermaid-Diagramm kann nicht angezeigt werden",footnoteLabel:"Fußnoten",footnoteBackLabel:"Zurück zum Verweis {reference}"},"ja-JP":{confirmButtonText:"送信",copyButtonText:"コピー",copiedButtonText:"コピーしました",sandboxLoadingText:"コンテンツを読み込み中...",sandboxStyleLoadingText:"スタイルを生成中...",sandboxScriptLoadingText:"スクリプトのキャッシュを生成中...",sandboxFullscreenButtonText:"全画面表示",sandboxExitFullscreenButtonText:"全画面表示を終了",sendButtonLabel:"送信",scrollToBottomLabel:"一番下までスクロール",mermaidLoadingText:"Mermaid 図を読み込み中...",mermaidEmptyChartText:"図の内容がありません",mermaidErrorText:"Mermaid 図を表示できません",footnoteLabel:"脚注",footnoteBackLabel:"参照箇所 {reference} に戻る"},"ur-PK":{confirmButtonText:"جمع کرائیں",copyButtonText:"کاپی کریں",copiedButtonText:"کاپی کر لیا گیا",sandboxLoadingText:"مواد لوڈ ہو رہا ہے...",sandboxStyleLoadingText:"اسٹائل تیار کیے جا رہے ہیں...",sandboxScriptLoadingText:"اسکرپٹس کا کیش تیار کیا جا رہا ہے...",sandboxFullscreenButtonText:"پوری اسکرین",sandboxExitFullscreenButtonText:"پوری اسکرین سے باہر نکلیں",sendButtonLabel:"بھیجیں",scrollToBottomLabel:"نیچے تک اسکرول کریں",mermaidLoadingText:"Mermaid چارٹ لوڈ ہو رہا ہے...",mermaidEmptyChartText:"چارٹ کا مواد خالی ہے",mermaidErrorText:"Mermaid چارٹ دکھایا نہیں جا سکا",footnoteLabel:"حواشی",footnoteBackLabel:"حوالہ {reference} پر واپس جائیں"},"fil-PH":{confirmButtonText:"Isumite",copyButtonText:"Kopyahin",copiedButtonText:"Nakopya na",sandboxLoadingText:"Nilo-load ang nilalaman...",sandboxStyleLoadingText:"Binubuo ang mga istilo...",sandboxScriptLoadingText:"Binubuo ang cache ng mga script...",sandboxFullscreenButtonText:"Buong screen",sandboxExitFullscreenButtonText:"Lumabas sa buong screen",sendButtonLabel:"Ipadala",scrollToBottomLabel:"Mag-scroll hanggang sa ibaba",mermaidLoadingText:"Nilo-load ang diagram ng Mermaid...",mermaidEmptyChartText:"Walang laman ang diagram",mermaidErrorText:"Hindi maipakita ang diagram ng Mermaid",footnoteLabel:"Mga talababa",footnoteBackLabel:"Bumalik sa sanggunian {reference}"},"vi-VN":{confirmButtonText:"Gửi",copyButtonText:"Sao chép",copiedButtonText:"Đã sao chép",sandboxLoadingText:"Đang tải nội dung...",sandboxStyleLoadingText:"Đang tạo kiểu hiển thị...",sandboxScriptLoadingText:"Đang tạo bộ nhớ đệm cho tập lệnh...",sandboxFullscreenButtonText:"Toàn màn hình",sandboxExitFullscreenButtonText:"Thoát chế độ toàn màn hình",sendButtonLabel:"Gửi",scrollToBottomLabel:"Cuộn xuống cuối",mermaidLoadingText:"Đang tải sơ đồ Mermaid...",mermaidEmptyChartText:"Sơ đồ không có nội dung",mermaidErrorText:"Không thể hiển thị sơ đồ Mermaid",footnoteLabel:"Chú thích cuối trang",footnoteBackLabel:"Quay lại tham chiếu {reference}"}};exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"en-US":{confirmButtonText:"Submit",copyButtonText:"Copy",copiedButtonText:"Copied",sandboxLoadingText:"Loading content...",sandboxFullscreenButtonText:"Fullscreen",sandboxExitFullscreenButtonText:"Exit fullscreen",sendButtonLabel:"Send",scrollToBottomLabel:"Scroll to bottom",mermaidLoadingText:"Loading Mermaid chart...",mermaidEmptyChartText:"Empty chart content",mermaidErrorText:"Unable to display the Mermaid chart",footnoteLabel:"Footnotes",footnoteBackLabel:"Back to reference {reference}"},"fr-FR":{confirmButtonText:"Soumettre",copyButtonText:"Copier",copiedButtonText:"Copié",sandboxLoadingText:"Chargement du contenu...",sandboxFullscreenButtonText:"Plein écran",sandboxExitFullscreenButtonText:"Quitter le plein écran",sendButtonLabel:"Envoyer",scrollToBottomLabel:"Faire défiler jusqu'en bas",mermaidLoadingText:"Chargement du diagramme Mermaid...",mermaidEmptyChartText:"Le diagramme est vide",mermaidErrorText:"Impossible d’afficher le diagramme Mermaid",footnoteLabel:"Notes de bas de page",footnoteBackLabel:"Retour à la référence {reference}"},"zh-CN":{confirmButtonText:"提交",copyButtonText:"复制",copiedButtonText:"已复制",sandboxLoadingText:"正在加载内容...",sandboxFullscreenButtonText:"全屏浏览",sandboxExitFullscreenButtonText:"退出全屏",sendButtonLabel:"发送",scrollToBottomLabel:"滚动到底部",mermaidLoadingText:"正在加载 Mermaid 图表...",mermaidEmptyChartText:"图表内容为空",mermaidErrorText:"无法显示 Mermaid 图表",footnoteLabel:"脚注",footnoteBackLabel:"返回正文引用 {reference}"},"ar-SA":{confirmButtonText:"إرسال",copyButtonText:"نسخ",copiedButtonText:"تم النسخ",sandboxLoadingText:"جارٍ تحميل المحتوى...",sandboxFullscreenButtonText:"ملء الشاشة",sandboxExitFullscreenButtonText:"الخروج من ملء الشاشة",sendButtonLabel:"إرسال",scrollToBottomLabel:"التمرير إلى الأسفل",mermaidLoadingText:"جارٍ تحميل مخطط Mermaid...",mermaidEmptyChartText:"محتوى المخطط فارغ",mermaidErrorText:"تعذّر عرض مخطط Mermaid",footnoteLabel:"الحواشي",footnoteBackLabel:"العودة إلى موضع الإحالة {reference}"},"th-TH":{confirmButtonText:"ส่งคำตอบ",copyButtonText:"คัดลอก",copiedButtonText:"คัดลอกแล้ว",sandboxLoadingText:"กำลังโหลดเนื้อหา...",sandboxFullscreenButtonText:"เต็มหน้าจอ",sandboxExitFullscreenButtonText:"ออกจากเต็มหน้าจอ",sendButtonLabel:"ส่ง",scrollToBottomLabel:"เลื่อนไปด้านล่าง",mermaidLoadingText:"กำลังโหลดแผนภาพ Mermaid...",mermaidEmptyChartText:"ไม่มีเนื้อหาในแผนภาพ",mermaidErrorText:"ไม่สามารถแสดงแผนภาพ Mermaid ได้",footnoteLabel:"เชิงอรรถ",footnoteBackLabel:"กลับไปยังจุดอ้างอิง {reference}"},"es-ES":{confirmButtonText:"Enviar",copyButtonText:"Copiar",copiedButtonText:"Copiado",sandboxLoadingText:"Cargando contenido...",sandboxFullscreenButtonText:"Pantalla completa",sandboxExitFullscreenButtonText:"Salir de pantalla completa",sendButtonLabel:"Enviar",scrollToBottomLabel:"Desplazarse hasta el final",mermaidLoadingText:"Cargando el diagrama Mermaid...",mermaidEmptyChartText:"El diagrama está vacío",mermaidErrorText:"No se puede mostrar el diagrama Mermaid",footnoteLabel:"Notas al pie",footnoteBackLabel:"Volver a la referencia {reference}"},"de-DE":{confirmButtonText:"Absenden",copyButtonText:"Kopieren",copiedButtonText:"Kopiert",sandboxLoadingText:"Inhalt wird geladen...",sandboxFullscreenButtonText:"Vollbild",sandboxExitFullscreenButtonText:"Vollbild verlassen",sendButtonLabel:"Senden",scrollToBottomLabel:"Zum Ende scrollen",mermaidLoadingText:"Mermaid-Diagramm wird geladen...",mermaidEmptyChartText:"Das Diagramm ist leer",mermaidErrorText:"Das Mermaid-Diagramm kann nicht angezeigt werden",footnoteLabel:"Fußnoten",footnoteBackLabel:"Zurück zum Verweis {reference}"},"ja-JP":{confirmButtonText:"送信",copyButtonText:"コピー",copiedButtonText:"コピーしました",sandboxLoadingText:"コンテンツを読み込み中...",sandboxFullscreenButtonText:"全画面表示",sandboxExitFullscreenButtonText:"全画面表示を終了",sendButtonLabel:"送信",scrollToBottomLabel:"一番下までスクロール",mermaidLoadingText:"Mermaid 図を読み込み中...",mermaidEmptyChartText:"図の内容がありません",mermaidErrorText:"Mermaid 図を表示できません",footnoteLabel:"脚注",footnoteBackLabel:"参照箇所 {reference} に戻る"},"ur-PK":{confirmButtonText:"جمع کرائیں",copyButtonText:"کاپی کریں",copiedButtonText:"کاپی کر لیا گیا",sandboxLoadingText:"مواد لوڈ ہو رہا ہے...",sandboxFullscreenButtonText:"پوری اسکرین",sandboxExitFullscreenButtonText:"پوری اسکرین سے باہر نکلیں",sendButtonLabel:"بھیجیں",scrollToBottomLabel:"نیچے تک اسکرول کریں",mermaidLoadingText:"Mermaid چارٹ لوڈ ہو رہا ہے...",mermaidEmptyChartText:"چارٹ کا مواد خالی ہے",mermaidErrorText:"Mermaid چارٹ دکھایا نہیں جا سکا",footnoteLabel:"حواشی",footnoteBackLabel:"حوالہ {reference} پر واپس جائیں"},"fil-PH":{confirmButtonText:"Isumite",copyButtonText:"Kopyahin",copiedButtonText:"Nakopya na",sandboxLoadingText:"Nilo-load ang nilalaman...",sandboxFullscreenButtonText:"Buong screen",sandboxExitFullscreenButtonText:"Lumabas sa buong screen",sendButtonLabel:"Ipadala",scrollToBottomLabel:"Mag-scroll hanggang sa ibaba",mermaidLoadingText:"Nilo-load ang diagram ng Mermaid...",mermaidEmptyChartText:"Walang laman ang diagram",mermaidErrorText:"Hindi maipakita ang diagram ng Mermaid",footnoteLabel:"Mga talababa",footnoteBackLabel:"Bumalik sa sanggunian {reference}"},"vi-VN":{confirmButtonText:"Gửi",copyButtonText:"Sao chép",copiedButtonText:"Đã sao chép",sandboxLoadingText:"Đang tải nội dung...",sandboxFullscreenButtonText:"Toàn màn hình",sandboxExitFullscreenButtonText:"Thoát chế độ toàn màn hình",sendButtonLabel:"Gửi",scrollToBottomLabel:"Cuộn xuống cuối",mermaidLoadingText:"Đang tải sơ đồ Mermaid...",mermaidEmptyChartText:"Sơ đồ không có nội dung",mermaidErrorText:"Không thể hiển thị sơ đồ Mermaid",footnoteLabel:"Chú thích cuối trang",footnoteBackLabel:"Quay lại tham chiếu {reference}"}};exports.default=e;
2
2
  //# sourceMappingURL=contentRender.json.cjs.map
@@ -4,8 +4,6 @@ declare const _default: {
4
4
  "copyButtonText": "Copy",
5
5
  "copiedButtonText": "Copied",
6
6
  "sandboxLoadingText": "Loading content...",
7
- "sandboxStyleLoadingText": "Building styles...",
8
- "sandboxScriptLoadingText": "Building scripts cache...",
9
7
  "sandboxFullscreenButtonText": "Fullscreen",
10
8
  "sandboxExitFullscreenButtonText": "Exit fullscreen",
11
9
  "sendButtonLabel": "Send",
@@ -21,8 +19,6 @@ declare const _default: {
21
19
  "copyButtonText": "Copier",
22
20
  "copiedButtonText": "Copié",
23
21
  "sandboxLoadingText": "Chargement du contenu...",
24
- "sandboxStyleLoadingText": "Génération des styles...",
25
- "sandboxScriptLoadingText": "Génération du cache des scripts...",
26
22
  "sandboxFullscreenButtonText": "Plein écran",
27
23
  "sandboxExitFullscreenButtonText": "Quitter le plein écran",
28
24
  "sendButtonLabel": "Envoyer",
@@ -38,8 +34,6 @@ declare const _default: {
38
34
  "copyButtonText": "复制",
39
35
  "copiedButtonText": "已复制",
40
36
  "sandboxLoadingText": "正在加载内容...",
41
- "sandboxStyleLoadingText": "正在生成样式...",
42
- "sandboxScriptLoadingText": "正在生成脚本缓存...",
43
37
  "sandboxFullscreenButtonText": "全屏浏览",
44
38
  "sandboxExitFullscreenButtonText": "退出全屏",
45
39
  "sendButtonLabel": "发送",
@@ -55,8 +49,6 @@ declare const _default: {
55
49
  "copyButtonText": "نسخ",
56
50
  "copiedButtonText": "تم النسخ",
57
51
  "sandboxLoadingText": "جارٍ تحميل المحتوى...",
58
- "sandboxStyleLoadingText": "جارٍ إنشاء الأنماط...",
59
- "sandboxScriptLoadingText": "جارٍ إنشاء ذاكرة التخزين المؤقت للبرامج النصية...",
60
52
  "sandboxFullscreenButtonText": "ملء الشاشة",
61
53
  "sandboxExitFullscreenButtonText": "الخروج من ملء الشاشة",
62
54
  "sendButtonLabel": "إرسال",
@@ -72,8 +64,6 @@ declare const _default: {
72
64
  "copyButtonText": "คัดลอก",
73
65
  "copiedButtonText": "คัดลอกแล้ว",
74
66
  "sandboxLoadingText": "กำลังโหลดเนื้อหา...",
75
- "sandboxStyleLoadingText": "กำลังสร้างสไตล์...",
76
- "sandboxScriptLoadingText": "กำลังสร้างแคชสคริปต์...",
77
67
  "sandboxFullscreenButtonText": "เต็มหน้าจอ",
78
68
  "sandboxExitFullscreenButtonText": "ออกจากเต็มหน้าจอ",
79
69
  "sendButtonLabel": "ส่ง",
@@ -89,8 +79,6 @@ declare const _default: {
89
79
  "copyButtonText": "Copiar",
90
80
  "copiedButtonText": "Copiado",
91
81
  "sandboxLoadingText": "Cargando contenido...",
92
- "sandboxStyleLoadingText": "Generando estilos...",
93
- "sandboxScriptLoadingText": "Generando la caché de scripts...",
94
82
  "sandboxFullscreenButtonText": "Pantalla completa",
95
83
  "sandboxExitFullscreenButtonText": "Salir de pantalla completa",
96
84
  "sendButtonLabel": "Enviar",
@@ -106,8 +94,6 @@ declare const _default: {
106
94
  "copyButtonText": "Kopieren",
107
95
  "copiedButtonText": "Kopiert",
108
96
  "sandboxLoadingText": "Inhalt wird geladen...",
109
- "sandboxStyleLoadingText": "Formatvorlagen werden erstellt...",
110
- "sandboxScriptLoadingText": "Skript-Cache wird erstellt...",
111
97
  "sandboxFullscreenButtonText": "Vollbild",
112
98
  "sandboxExitFullscreenButtonText": "Vollbild verlassen",
113
99
  "sendButtonLabel": "Senden",
@@ -123,8 +109,6 @@ declare const _default: {
123
109
  "copyButtonText": "コピー",
124
110
  "copiedButtonText": "コピーしました",
125
111
  "sandboxLoadingText": "コンテンツを読み込み中...",
126
- "sandboxStyleLoadingText": "スタイルを生成中...",
127
- "sandboxScriptLoadingText": "スクリプトのキャッシュを生成中...",
128
112
  "sandboxFullscreenButtonText": "全画面表示",
129
113
  "sandboxExitFullscreenButtonText": "全画面表示を終了",
130
114
  "sendButtonLabel": "送信",
@@ -140,8 +124,6 @@ declare const _default: {
140
124
  "copyButtonText": "کاپی کریں",
141
125
  "copiedButtonText": "کاپی کر لیا گیا",
142
126
  "sandboxLoadingText": "مواد لوڈ ہو رہا ہے...",
143
- "sandboxStyleLoadingText": "اسٹائل تیار کیے جا رہے ہیں...",
144
- "sandboxScriptLoadingText": "اسکرپٹس کا کیش تیار کیا جا رہا ہے...",
145
127
  "sandboxFullscreenButtonText": "پوری اسکرین",
146
128
  "sandboxExitFullscreenButtonText": "پوری اسکرین سے باہر نکلیں",
147
129
  "sendButtonLabel": "بھیجیں",
@@ -157,8 +139,6 @@ declare const _default: {
157
139
  "copyButtonText": "Kopyahin",
158
140
  "copiedButtonText": "Nakopya na",
159
141
  "sandboxLoadingText": "Nilo-load ang nilalaman...",
160
- "sandboxStyleLoadingText": "Binubuo ang mga istilo...",
161
- "sandboxScriptLoadingText": "Binubuo ang cache ng mga script...",
162
142
  "sandboxFullscreenButtonText": "Buong screen",
163
143
  "sandboxExitFullscreenButtonText": "Lumabas sa buong screen",
164
144
  "sendButtonLabel": "Ipadala",
@@ -174,8 +154,6 @@ declare const _default: {
174
154
  "copyButtonText": "Sao chép",
175
155
  "copiedButtonText": "Đã sao chép",
176
156
  "sandboxLoadingText": "Đang tải nội dung...",
177
- "sandboxStyleLoadingText": "Đang tạo kiểu hiển thị...",
178
- "sandboxScriptLoadingText": "Đang tạo bộ nhớ đệm cho tập lệnh...",
179
157
  "sandboxFullscreenButtonText": "Toàn màn hình",
180
158
  "sandboxExitFullscreenButtonText": "Thoát chế độ toàn màn hình",
181
159
  "sendButtonLabel": "Gửi",