markdown-flow-ui 0.1.100-beta.44 → 0.1.100-beta.45

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 (54) hide show
  1. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.cjs.js +1 -1
  2. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.cjs.js.map +1 -1
  3. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
  4. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.cjs.js +1 -1
  5. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js +1 -1
  6. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/hast-util-to-jsx-runtime@2.3.6/node_modules/hast-util-to-jsx-runtime/lib/index.cjs.js +1 -1
  7. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/hast-util-to-jsx-runtime@2.3.6/node_modules/hast-util-to-jsx-runtime/lib/index.es.js +1 -1
  8. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.cjs.js +1 -1
  9. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.es.js +1 -1
  10. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/ResizableTextArea.cjs.js +1 -1
  11. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/ResizableTextArea.es.js +1 -1
  12. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/TextArea.cjs.js +1 -1
  13. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/TextArea.es.js +1 -1
  14. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/index.cjs.js +1 -1
  15. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/index.es.js +1 -1
  16. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.cjs.js +1 -1
  17. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.es.js +1 -1
  18. package/dist/_virtual/index.cjs10.js +1 -1
  19. package/dist/_virtual/index.cjs4.js +1 -1
  20. package/dist/_virtual/index.cjs5.js +1 -1
  21. package/dist/_virtual/index.cjs6.js +1 -1
  22. package/dist/_virtual/index.cjs9.js +1 -1
  23. package/dist/_virtual/index.es10.js +2 -2
  24. package/dist/_virtual/index.es4.js +4 -4
  25. package/dist/_virtual/index.es5.js +4 -4
  26. package/dist/_virtual/index.es6.js +5 -5
  27. package/dist/_virtual/index.es9.js +2 -2
  28. package/dist/components/ContentRender/ContentRender.cjs.js +2 -2
  29. package/dist/components/ContentRender/ContentRender.cjs.js.map +1 -1
  30. package/dist/components/ContentRender/ContentRender.es.js +38 -42
  31. package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
  32. package/dist/components/ContentRender/IframeSandbox.cjs.js +2 -2
  33. package/dist/components/ContentRender/IframeSandbox.cjs.js.map +1 -1
  34. package/dist/components/ContentRender/IframeSandbox.es.js +124 -138
  35. package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -1
  36. package/dist/components/Slide/index.cjs.js +2 -0
  37. package/dist/components/Slide/index.cjs.js.map +1 -0
  38. package/dist/components/Slide/index.es.js +12 -0
  39. package/dist/components/Slide/index.es.js.map +1 -0
  40. package/dist/components/ui/inputGroup/textarea.cjs.js +1 -1
  41. package/dist/components/ui/inputGroup/textarea.es.js +1 -1
  42. package/dist/index.cjs.js +1 -1
  43. package/dist/index.es.js +13 -24
  44. package/dist/index.es.js.map +1 -1
  45. package/dist/renderer.cjs.js +1 -1
  46. package/dist/renderer.d.ts +2 -3
  47. package/dist/renderer.es.js +14 -25
  48. package/dist/renderer.es.js.map +1 -1
  49. package/dist/slide.cjs.js +2 -0
  50. package/dist/slide.cjs.js.map +1 -0
  51. package/dist/slide.d.ts +2 -0
  52. package/dist/slide.es.js +18 -0
  53. package/dist/slide.es.js.map +1 -0
  54. package/package.json +9 -1
@@ -1,34 +1,20 @@
1
1
  import { j as A } from "../../_virtual/jsx-runtime.es.js";
2
- import D, { useRef as a, useState as j, useCallback as Rt, useEffect as E } from "react";
3
- import { createRoot as Ct } from "react-dom/client";
4
- import Mt from "./SandboxApp.es.js";
5
- import Tt from "./ContentRender.es.js";
6
- import { SANDBOX_INTERACTION_MESSAGE_TYPE as At, SANDBOX_INTERACTION_MESSAGE_SOURCE as yt } from "../../lib/sandboxInteraction.es.js";
2
+ import I, { useRef as u, useState as P, useCallback as Ct, useEffect as R } from "react";
3
+ import { createRoot as Tt } from "react-dom/client";
4
+ import yt from "./SandboxApp.es.js";
5
+ import Mt from "./ContentRender.es.js";
6
+ import { SANDBOX_INTERACTION_MESSAGE_TYPE as At, SANDBOX_INTERACTION_MESSAGE_SOURCE as St } from "../../lib/sandboxInteraction.es.js";
7
7
  let Q = null;
8
8
  const Ft = () => (Q || (Q = import("./blackboard-vendor.es.js").then(
9
9
  (n) => n.injectBlackboardLibraries
10
- )), Q), It = () => {
11
- const n = performance.now(), t = (/* @__PURE__ */ new Date()).toISOString();
12
- return console.log("[IframeSandbox][SandboxLoad] start", { startedAt: t }), Ft().then((r) => (console.log("[IframeSandbox][SandboxLoad] done", {
13
- startedAt: t,
14
- endedAt: (/* @__PURE__ */ new Date()).toISOString(),
15
- durationMs: Number((performance.now() - n).toFixed(2))
16
- }), r)).catch((r) => {
17
- throw console.error("[IframeSandbox][SandboxLoad] failed", {
18
- startedAt: t,
19
- endedAt: (/* @__PURE__ */ new Date()).toISOString(),
20
- durationMs: Number((performance.now() - n).toFixed(2)),
21
- error: r
22
- }), r;
23
- });
24
- }, Vt = /<img\b[^>]*>/i, Nt = 180, kt = 240, Dt = {
10
+ )), Q), Vt = /<img\b[^>]*>/i, Nt = 180, _t = 240, kt = {
25
11
  viewportHeightCss: null,
26
12
  hasFullViewportHeight: !1
27
- }, dt = (n) => n.split(/\s+/).filter(Boolean).map((t) => t.split(":").pop() || t), P = (n) => {
13
+ }, dt = (n) => n.split(/\s+/).filter(Boolean).map((t) => t.split(":").pop() || t), L = (n) => {
28
14
  const t = n.trim().toLowerCase();
29
15
  if (!t) return null;
30
- const r = t.match(/^([0-9.]+)(vh|dvh|svh|lvh)$/i);
31
- return r ? `${r[1]}${r[2].toLowerCase()}` : null;
16
+ const o = t.match(/^([0-9.]+)(vh|dvh|svh|lvh)$/i);
17
+ return o ? `${o[1]}${o[2].toLowerCase()}` : null;
32
18
  }, tt = (n) => {
33
19
  if (!n.trim()) return null;
34
20
  const t = dt(n);
@@ -38,101 +24,101 @@ const Ft = () => (Q || (Q = import("./blackboard-vendor.es.js").then(
38
24
  return "100svh";
39
25
  if (t.includes("h-lvh") || t.includes("min-h-lvh"))
40
26
  return "100lvh";
41
- const r = t.find(
42
- (u) => /^(h|min-h)-\[[0-9.]+(vh|dvh|svh|lvh)\]$/i.test(u)
27
+ const o = t.find(
28
+ (a) => /^(h|min-h)-\[[0-9.]+(vh|dvh|svh|lvh)\]$/i.test(a)
43
29
  );
44
- if (!r) return null;
45
- const c = r.match(
30
+ if (!o) return null;
31
+ const c = o.match(
46
32
  /^(h|min-h)-\[([0-9.]+)(vh|dvh|svh|lvh)\]$/i
47
33
  );
48
34
  return c ? `${c[2]}${c[3].toLowerCase()}` : null;
49
- }, Ot = (n) => n === "100vh" || n === "100dvh" || n === "100svh" || n === "100lvh", _t = (n) => {
35
+ }, It = (n) => n === "100vh" || n === "100dvh" || n === "100svh" || n === "100lvh", $t = (n) => {
50
36
  const t = n.trim();
51
37
  if (!t)
52
38
  return {
53
39
  viewportHeightCss: null,
54
40
  hasFullViewportHeight: !1
55
41
  };
56
- const c = t.match(/^<([a-zA-Z][\w:-]*)(\s[^>]*?)?>/)?.[2] || "", u = c.match(/\bheight\s*=\s*["']([^"']+)["']/i)?.[1], b = c.match(/\bstyle\s*=\s*["']([^"']+)["']/i)?.[1]?.match(
42
+ const c = t.match(/^<([a-zA-Z][\w:-]*)(\s[^>]*?)?>/)?.[2] || "", a = c.match(/\bheight\s*=\s*["']([^"']+)["']/i)?.[1], b = c.match(/\bstyle\s*=\s*["']([^"']+)["']/i)?.[1]?.match(
57
43
  /\bheight\s*:\s*([^;]+)/i
58
- )?.[1], h = c.match(/\bclass\s*=\s*["']([^"']+)["']/i)?.[1], O = (u ? P(u) : null) || (b ? P(b) : null) || (h ? tt(h) : null);
44
+ )?.[1], h = c.match(/\bclass\s*=\s*["']([^"']+)["']/i)?.[1], $ = (a ? L(a) : null) || (b ? L(b) : null) || (h ? tt(h) : null);
59
45
  return {
60
- viewportHeightCss: O,
61
- hasFullViewportHeight: Ot(O)
46
+ viewportHeightCss: $,
47
+ hasFullViewportHeight: It($)
62
48
  };
63
49
  }, Bt = (n) => n.split(/\s+/).filter(Boolean).map((t) => {
64
- const r = t.split(":");
65
- return r[r.length - 1] !== "h-screen" && r[r.length - 1] !== "min-h-screen" ? t : (r[r.length - 1] = "h-full", r.join(":"));
66
- }).join(" "), $t = (n, t) => !t || !n.trim() ? n : n.replace(
50
+ const o = t.split(":");
51
+ return o[o.length - 1] !== "h-screen" && o[o.length - 1] !== "min-h-screen" ? t : (o[o.length - 1] = "h-full", o.join(":"));
52
+ }).join(" "), Dt = (n, t) => !t || !n.trim() ? n : n.replace(
67
53
  /^(\s*<[a-zA-Z][\w:-]*)(\s[^>]*?)?>/,
68
- (r, c, u = "") => {
69
- const m = u.match(/\bclass\s*=\s*(["'])([^"']*)\1/i);
54
+ (o, c, a = "") => {
55
+ const m = a.match(/\bclass\s*=\s*(["'])([^"']*)\1/i);
70
56
  if (!m)
71
- return r;
57
+ return o;
72
58
  const b = Bt(m[2]);
73
- return b === m[2] ? r : `${c}${u.replace(
59
+ return b === m[2] ? o : `${c}${a.replace(
74
60
  m[0],
75
61
  `class=${m[1]}${b}${m[1]}`
76
62
  )}>`;
77
63
  }
78
- ), Wt = ({
64
+ ), Gt = ({
79
65
  content: n,
80
66
  type: t,
81
- className: r,
67
+ className: o,
82
68
  styleLoadingText: c,
83
- scriptLoadingText: u,
69
+ scriptLoadingText: a,
84
70
  fullScreenButtonText: m,
85
71
  hideFullScreen: b = !1,
86
72
  mode: h = "content",
87
- replaceRootScreenHeightWithFull: O = !1
73
+ replaceRootScreenHeightWithFull: $ = !1
88
74
  }) => {
89
- const et = a(null), R = a(null), q = a(null), G = a(() => {
90
- }), [mt, ft] = j(480), nt = a(0), [rt, gt] = j(0), [pt, bt] = j(!1), wt = t === "sandbox", _ = h === "blackboard", y = _ && t === "sandbox", C = y && O, W = a(""), B = D.useMemo(
75
+ const et = u(null), C = u(null), q = u(null), G = u(() => {
76
+ }), [mt, ft] = P(480), nt = u(0), [rt, gt] = P(0), [pt, bt] = P(!1), wt = t === "sandbox", B = h === "blackboard", S = B && t === "sandbox", T = S && $, W = u(""), D = I.useMemo(
91
77
  () => t === "sandbox" ? n : "",
92
78
  [n, t]
93
- ), s = D.useMemo(
94
- () => $t(
95
- B,
96
- C
79
+ ), s = I.useMemo(
80
+ () => Dt(
81
+ D,
82
+ T
97
83
  ),
98
- [B, C]
99
- ), ot = D.useMemo(
100
- () => C ? _t(B) : Dt,
101
- [B, C]
102
- ), st = D.useMemo(
103
- () => C && ot.hasFullViewportHeight,
84
+ [D, T]
85
+ ), ot = I.useMemo(
86
+ () => T ? $t(D) : kt,
87
+ [D, T]
88
+ ), st = I.useMemo(
89
+ () => T && ot.hasFullViewportHeight,
104
90
  [
105
91
  ot.hasFullViewportHeight,
106
- C
92
+ T
107
93
  ]
108
- ), [$, it] = j(
94
+ ), [O, it] = P(
109
95
  s
110
- ), lt = a(s), U = a(s), F = a(null), I = a(null), ct = a(null), M = Rt((o) => {
96
+ ), lt = u(s), U = u(s), F = u(null), V = u(null), ct = u(null), y = Ct((r) => {
111
97
  if (typeof window > "u")
112
98
  return;
113
99
  const e = Date.now();
114
- e - nt.current < kt || (nt.current = e, window.postMessage(
100
+ e - nt.current < _t || (nt.current = e, window.postMessage(
115
101
  {
116
- source: yt,
102
+ source: St,
117
103
  type: At,
118
- eventType: o
104
+ eventType: r
119
105
  },
120
106
  window.location.origin
121
107
  ));
122
108
  }, []), X = () => {
123
109
  F.current !== null && (window.clearTimeout(F.current), F.current = null);
124
110
  }, vt = () => {
125
- I.current !== null && (window.cancelAnimationFrame(I.current), I.current = null);
111
+ V.current !== null && (window.cancelAnimationFrame(V.current), V.current = null);
126
112
  };
127
- E(
113
+ R(
128
114
  () => () => {
129
115
  X(), vt();
130
116
  },
131
117
  []
132
- ), E(() => {
133
- const o = lt.current;
118
+ ), R(() => {
119
+ const r = lt.current;
134
120
  lt.current = s;
135
- const e = !!o && s.length > o.length && s.startsWith(o), d = Vt.test(
121
+ const e = !!r && s.length > r.length && s.startsWith(r), d = Vt.test(
136
122
  s
137
123
  );
138
124
  if (!(e && d)) {
@@ -143,43 +129,43 @@ const Ft = () => (Q || (Q = import("./blackboard-vendor.es.js").then(
143
129
  it(U.current), F.current = null;
144
130
  }, Nt);
145
131
  }, [s]);
146
- const z = D.useMemo(() => {
147
- if (!y)
132
+ const z = I.useMemo(() => {
133
+ if (!S)
148
134
  return null;
149
- const o = $.trim();
150
- if (!o) return null;
151
- const e = o.match(/^<([a-zA-Z][\w:-]*)(\s[^>]*?)?>/);
135
+ const r = O.trim();
136
+ if (!r) return null;
137
+ const e = r.match(/^<([a-zA-Z][\w:-]*)(\s[^>]*?)?>/);
152
138
  if (!e) return null;
153
- const d = e[2] || "", T = d.match(/\bheight\s*=\s*["']([^"']+)["']/i);
154
- if (T) {
155
- const g = P(T[1]);
139
+ const d = e[2] || "", M = d.match(/\bheight\s*=\s*["']([^"']+)["']/i);
140
+ if (M) {
141
+ const g = L(M[1]);
156
142
  if (g) return g;
157
143
  }
158
- const N = d.match(/\bstyle\s*=\s*["']([^"']+)["']/i)?.[1]?.match(
144
+ const _ = d.match(/\bstyle\s*=\s*["']([^"']+)["']/i)?.[1]?.match(
159
145
  /\bheight\s*:\s*([^;]+)/i
160
146
  )?.[1];
161
- if (N) {
162
- const g = P(N);
147
+ if (_) {
148
+ const g = L(_);
163
149
  if (g) return g;
164
150
  }
165
151
  const w = d.match(/\bclass\s*=\s*["']([^"']+)["']/i)?.[1];
166
152
  return w ? tt(w) : null;
167
- }, [$, y]);
168
- E(() => {
153
+ }, [O, S]);
154
+ R(() => {
169
155
  ct.current = z;
170
156
  }, [z]);
171
- const at = !!z, V = _ && t === "sandbox" ? st ? "100%" : z ?? `${mt}px` : void 0;
172
- E(() => {
157
+ const ut = !!z, N = B && t === "sandbox" ? st ? "100%" : z ?? `${mt}px` : void 0;
158
+ R(() => {
173
159
  if (h !== "blackboard") {
174
160
  W.current = s;
175
161
  return;
176
162
  }
177
- const o = W.current;
178
- !(o && s.startsWith(o)) && o && gt((d) => d + 1), W.current = s;
179
- }, [h, s]), E(() => {
180
- const o = R.current;
181
- if (!o) return;
182
- const e = o.contentDocument;
163
+ const r = W.current;
164
+ !(r && s.startsWith(r)) && r && gt((d) => d + 1), W.current = s;
165
+ }, [h, s]), R(() => {
166
+ const r = C.current;
167
+ if (!r) return;
168
+ const e = r.contentDocument;
183
169
  if (!e) return;
184
170
  e.open(), e.write(`<!DOCTYPE html>
185
171
  <html${h === "blackboard" ? ' style="height: 100%;"' : ""}>
@@ -197,11 +183,11 @@ const Ft = () => (Q || (Q = import("./blackboard-vendor.es.js").then(
197
183
  <div id="root"></div>
198
184
  </body>
199
185
  </html>`), e.close(), e.documentElement.setAttribute("data-theme", "light"), e.documentElement.style.colorScheme = "light", e.body?.style.setProperty("color-scheme", "light");
200
- const d = _ && t === "sandbox", T = () => M("pointerdown"), Y = () => M("mousedown"), N = () => M("touchstart");
201
- d && (e.addEventListener("pointerdown", T, !0), e.addEventListener("mousedown", Y, !0), e.addEventListener("touchstart", N, !0));
186
+ const d = B && t === "sandbox", M = () => y("pointerdown"), Y = () => y("mousedown"), _ = () => y("touchstart");
187
+ d && (e.addEventListener("pointerdown", M, !0), e.addEventListener("mousedown", Y, !0), e.addEventListener("touchstart", _, !0));
202
188
  const w = e.getElementById("root");
203
189
  if (!w) return;
204
- const g = Ct(w);
190
+ const g = Tt(w);
205
191
  q.current = g;
206
192
  let k = !1;
207
193
  const Z = (i, p) => {
@@ -209,22 +195,22 @@ const Ft = () => (Q || (Q = import("./blackboard-vendor.es.js").then(
209
195
  if (!l) return null;
210
196
  const v = Number.parseFloat(l);
211
197
  return Number.isNaN(v) ? null : /(dvh|svh|lvh|vh)$/i.test(l) ? v / 100 * p : l.endsWith("px") || /^[0-9.]+$/.test(l) ? v : null;
212
- }, St = (i, p) => {
198
+ }, Et = (i, p) => {
213
199
  if (!i.trim()) return null;
214
200
  const l = tt(i);
215
201
  if (l)
216
202
  return Z(l, p);
217
203
  const H = dt(i).find(
218
- (S) => /^h-\[[0-9.]+px\]$/i.test(S)
204
+ (E) => /^h-\[[0-9.]+px\]$/i.test(E)
219
205
  );
220
206
  if (!H) return null;
221
207
  const x = H.match(/^h-\[([0-9.]+)px\]$/i);
222
208
  if (!x) return null;
223
209
  const f = Number.parseFloat(x[1]);
224
210
  return Number.isNaN(f) ? null : f;
225
- }, Et = () => {
226
- if (!y || !R.current || !e.body) return null;
227
- const i = R.current.ownerDocument?.documentElement?.clientHeight || window.innerHeight, p = ct.current, l = p ? Z(
211
+ }, Rt = () => {
212
+ if (!S || !C.current || !e.body) return null;
213
+ const i = C.current.ownerDocument?.documentElement?.clientHeight || window.innerHeight, p = ct.current, l = p ? Z(
228
214
  p,
229
215
  i
230
216
  ) : null;
@@ -236,98 +222,98 @@ const Ft = () => (Q || (Q = import("./blackboard-vendor.es.js").then(
236
222
  if (!H) return null;
237
223
  const x = Array.from(H.children);
238
224
  if (x.length !== 1) return null;
239
- const f = x[0], S = f.style.height || f.getAttribute("height"), ut = S ? Z(S, i) : null;
240
- if (ut !== null)
241
- return Math.ceil(ut);
242
- const ht = St(
225
+ const f = x[0], E = f.style.height || f.getAttribute("height"), at = E ? Z(E, i) : null;
226
+ if (at !== null)
227
+ return Math.ceil(at);
228
+ const ht = Et(
243
229
  f.getAttribute("class") || "",
244
230
  i
245
231
  );
246
232
  return ht !== null ? Math.ceil(ht) : null;
247
233
  }, J = () => {
248
- if (!y || !R.current || !e.body) return;
249
- const i = e.body.getBoundingClientRect(), p = e.documentElement?.getBoundingClientRect(), l = i.height, v = p?.height || 0, H = Math.max(l, v), x = Et(), f = Math.max(
234
+ if (!S || !C.current || !e.body) return;
235
+ const i = e.body.getBoundingClientRect(), p = e.documentElement?.getBoundingClientRect(), l = i.height, v = p?.height || 0, H = Math.max(l, v), x = Rt(), f = Math.max(
250
236
  200,
251
237
  x ?? Math.ceil(H)
252
238
  );
253
239
  ft(
254
- (S) => S === f ? S : f
240
+ (E) => E === f ? E : f
255
241
  );
256
- }, L = () => {
242
+ }, j = () => {
257
243
  requestAnimationFrame(() => {
258
244
  k || J();
259
245
  });
260
246
  };
261
- G.current = L, J(), L(), wt && It().then((i) => {
247
+ G.current = j, J(), j(), wt && Ft().then((i) => {
262
248
  k || (i(e), requestAnimationFrame(() => {
263
- k || L();
249
+ k || j();
264
250
  }));
265
251
  }).catch(() => {
266
- k || L();
252
+ k || j();
267
253
  });
268
254
  const K = new ResizeObserver(() => J());
269
255
  return K.observe(e.body), w && K.observe(w), () => {
270
- k = !0, K.disconnect(), d && (e.removeEventListener("pointerdown", T, !0), e.removeEventListener("mousedown", Y, !0), e.removeEventListener("touchstart", N, !0)), setTimeout(() => {
256
+ k = !0, K.disconnect(), d && (e.removeEventListener("pointerdown", M, !0), e.removeEventListener("mousedown", Y, !0), e.removeEventListener("touchstart", _, !0)), setTimeout(() => {
271
257
  g.unmount(), q.current = null, G.current = () => {
272
258
  };
273
259
  }, 0);
274
260
  };
275
- }, []), E(() => {
276
- const o = () => {
261
+ }, []), R(() => {
262
+ const r = () => {
277
263
  bt(!!document.fullscreenElement);
278
264
  };
279
- return document.addEventListener("fullscreenchange", o), () => document.removeEventListener("fullscreenchange", o);
265
+ return document.addEventListener("fullscreenchange", r), () => document.removeEventListener("fullscreenchange", r);
280
266
  }, []);
281
267
  const Ht = () => {
282
- const o = et.current || R.current;
283
- if (o) {
268
+ const r = et.current || C.current;
269
+ if (r) {
284
270
  if (document.fullscreenElement) {
285
271
  document.exitFullscreen().catch(() => {
286
272
  });
287
273
  return;
288
274
  }
289
- o.requestFullscreen && o.requestFullscreen().catch(() => {
275
+ r.requestFullscreen && r.requestFullscreen().catch(() => {
290
276
  });
291
277
  }
292
278
  };
293
- E(() => {
294
- const o = q.current;
295
- o && (o.render(
279
+ R(() => {
280
+ const r = q.current;
281
+ r && (r.render(
296
282
  /* @__PURE__ */ A.jsx(
297
- Mt,
283
+ yt,
298
284
  {
299
- html: $,
285
+ html: O,
300
286
  styleLoadingText: c,
301
- scriptLoadingText: u,
287
+ scriptLoadingText: a,
302
288
  resetToken: rt,
303
- hasRootVhHeight: at,
289
+ hasRootVhHeight: ut,
304
290
  mode: h,
305
291
  stretchRootHeight: st
306
292
  }
307
293
  )
308
- ), I.current = window.requestAnimationFrame(() => {
309
- G.current?.(), I.current = null;
294
+ ), V.current = window.requestAnimationFrame(() => {
295
+ G.current?.(), V.current = null;
310
296
  }));
311
297
  }, [
312
- $,
298
+ O,
313
299
  c,
314
- u,
300
+ a,
315
301
  rt,
316
302
  h
317
303
  ]);
318
304
  const xt = [
319
305
  "w-full relative content-render-iframe-sandbox",
320
- _ ? "h-full overflow-auto flex flex-col" : "aspect-[16/9] overflow-hidden flex items-center justify-center"
306
+ B ? "h-full overflow-auto flex flex-col" : "aspect-[16/9] overflow-hidden flex items-center justify-center"
321
307
  ].filter(Boolean).join(" ");
322
308
  return /* @__PURE__ */ A.jsxs(
323
309
  "div",
324
310
  {
325
311
  ref: et,
326
- "data-root-vh": at ? "true" : "false",
312
+ "data-root-vh": ut ? "true" : "false",
327
313
  className: xt,
328
- style: V ? {
329
- height: V,
330
- minHeight: V
314
+ style: N ? {
315
+ height: N,
316
+ minHeight: N
331
317
  } : void 0,
332
318
  children: [
333
319
  !b && /* @__PURE__ */ A.jsx(
@@ -342,22 +328,22 @@ const Ft = () => (Q || (Q = import("./blackboard-vendor.es.js").then(
342
328
  h === "blackboard" && t === "markdown" ? /* @__PURE__ */ A.jsx(
343
329
  "div",
344
330
  {
345
- onMouseDown: () => M("mousedown"),
346
- onPointerDown: () => M("pointerdown"),
347
- onTouchStart: () => M("touchstart"),
348
- children: /* @__PURE__ */ A.jsx(Tt, { content: n })
331
+ onMouseDown: () => y("mousedown"),
332
+ onPointerDown: () => y("pointerdown"),
333
+ onTouchStart: () => y("touchstart"),
334
+ children: /* @__PURE__ */ A.jsx(Mt, { content: n })
349
335
  }
350
336
  ) : /* @__PURE__ */ A.jsx(
351
337
  "iframe",
352
338
  {
353
- ref: R,
339
+ ref: C,
354
340
  sandbox: "allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox",
355
341
  allow: "fullscreen",
356
342
  allowFullScreen: !0,
357
- className: [r, "w-full h-full mx-auto my-auto block"].filter(Boolean).join(" "),
343
+ className: [o, "w-full h-full mx-auto my-auto block"].filter(Boolean).join(" "),
358
344
  style: {
359
- height: V ?? "100%",
360
- minHeight: V,
345
+ height: N ?? "100%",
346
+ minHeight: N,
361
347
  margin: "auto",
362
348
  visibility: "visible"
363
349
  }
@@ -368,6 +354,6 @@ const Ft = () => (Q || (Q = import("./blackboard-vendor.es.js").then(
368
354
  );
369
355
  };
370
356
  export {
371
- Wt as default
357
+ Gt as default
372
358
  };
373
359
  //# sourceMappingURL=IframeSandbox.es.js.map