markdown-flow-ui 0.1.118 → 0.1.119

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 (38) hide show
  1. package/dist/_virtual/index.cjs10.js +1 -1
  2. package/dist/_virtual/index.cjs11.js +1 -1
  3. package/dist/_virtual/index.cjs7.js +1 -1
  4. package/dist/_virtual/index.cjs9.js +1 -1
  5. package/dist/_virtual/index.es10.js +3 -2
  6. package/dist/_virtual/index.es10.js.map +1 -1
  7. package/dist/_virtual/index.es11.js +2 -3
  8. package/dist/_virtual/index.es11.js.map +1 -1
  9. package/dist/_virtual/index.es7.js +2 -3
  10. package/dist/_virtual/index.es7.js.map +1 -1
  11. package/dist/_virtual/index.es9.js +3 -2
  12. package/dist/_virtual/index.es9.js.map +1 -1
  13. package/dist/components/ContentRender/IframeSandbox.cjs.js +6 -6
  14. package/dist/components/ContentRender/IframeSandbox.cjs.js.map +1 -1
  15. package/dist/components/ContentRender/IframeSandbox.es.js +200 -200
  16. package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -1
  17. package/dist/components/ContentRender/SandboxApp.cjs.js +12 -7
  18. package/dist/components/ContentRender/SandboxApp.cjs.js.map +1 -1
  19. package/dist/components/ContentRender/SandboxApp.es.js +58 -53
  20. package/dist/components/ContentRender/SandboxApp.es.js.map +1 -1
  21. package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs.js +1 -1
  22. package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs.js.map +1 -1
  23. package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
  24. package/dist/node_modules/classnames/index.cjs.js +1 -1
  25. package/dist/node_modules/classnames/index.es.js +1 -1
  26. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAMF2YG6.cjs.js +1 -1
  27. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAMF2YG6.es.js +1 -1
  28. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-OMD6QJNC.cjs.js +1 -1
  29. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-OMD6QJNC.es.js +1 -1
  30. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-U37J5Y7L.cjs.js +1 -1
  31. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-U37J5Y7L.es.js +1 -1
  32. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-WV7ZQ7D5.cjs.js +1 -1
  33. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-WV7ZQ7D5.es.js +1 -1
  34. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-4MX5Z3NR.cjs.js +1 -1
  35. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-4MX5Z3NR.es.js +1 -1
  36. package/dist/node_modules/rc-util/es/ref.cjs.js +1 -1
  37. package/dist/node_modules/rc-util/es/ref.es.js +1 -1
  38. package/package.json +1 -1
@@ -1,128 +1,128 @@
1
- import { j as C } from "../../_virtual/jsx-runtime.es.js";
2
- import j, { useRef as i, useState as M, useCallback as We, useEffect as H, useMemo as De } from "react";
3
- import { createRoot as Pe } from "react-dom/client";
4
- import $e from "./SandboxApp.es.js";
5
- import ze from "./ContentRender.es.js";
6
- import { inspectViewportHeightFromHtmlRootString as ye, EMPTY_ROOT_HEIGHT_META as qe, parseExplicitHeight as Ce, inspectViewportHeightFromNodeChain as Ge, resolveExplicitHeightFromNodeChain as Le } from "./utils/iframe-viewport-height.es.js";
7
- import { SANDBOX_INTERACTION_MESSAGE_TYPE as Ue, SANDBOX_INTERACTION_MESSAGE_SOURCE as Ye } from "../../lib/sandboxInteraction.es.js";
8
- import { injectScalingSystem as Xe } from "./utils/iframe-scaling.es.js";
9
- let oe = null;
10
- const Ze = () => (oe || (oe = import("./blackboard-vendor.es.js").then(
1
+ import { j as y } from "../../_virtual/jsx-runtime.es.js";
2
+ import j, { useRef as i, useState as C, useCallback as De, useEffect as p, useMemo as Pe } from "react";
3
+ import { createRoot as $e } from "react-dom/client";
4
+ import ze from "./SandboxApp.es.js";
5
+ import qe from "./ContentRender.es.js";
6
+ import { inspectViewportHeightFromHtmlRootString as Ce, EMPTY_ROOT_HEIGHT_META as Ge, parseExplicitHeight as Me, inspectViewportHeightFromNodeChain as Le, resolveExplicitHeightFromNodeChain as Ue } from "./utils/iframe-viewport-height.es.js";
7
+ import { SANDBOX_INTERACTION_MESSAGE_TYPE as Ye, SANDBOX_INTERACTION_MESSAGE_SOURCE as Xe } from "../../lib/sandboxInteraction.es.js";
8
+ import { injectScalingSystem as Ze } from "./utils/iframe-scaling.es.js";
9
+ let ie = null;
10
+ const Je = () => (ie || (ie = import("./blackboard-vendor.es.js").then(
11
11
  (c) => c.injectBlackboardLibraries
12
- )), oe), Je = /<img\b[^>]*>/i, Ke = 180, Qe = 240, et = (c) => c.split(/\s+/).filter(Boolean).map((o) => {
12
+ )), ie), Ke = /<img\b[^>]*>/i, Qe = 180, et = 240, tt = (c) => c.split(/\s+/).filter(Boolean).map((o) => {
13
13
  const s = o.split(":");
14
14
  return s[s.length - 1] !== "h-screen" && s[s.length - 1] !== "min-h-screen" ? o : (s[s.length - 1] = "h-full", s.join(":"));
15
- }).join(" "), tt = (c, o) => !o || !c.trim() ? c : c.replace(
15
+ }).join(" "), nt = (c, o) => !o || !c.trim() ? c : c.replace(
16
16
  /^(\s*<[a-zA-Z][\w:-]*)(\s[^>]*?)?>/,
17
- (s, B, T = "") => {
18
- const d = T.match(/\bclass\s*=\s*(["'])([^"']*)\1/i);
19
- if (!d)
17
+ (s, B, M = "") => {
18
+ const m = M.match(/\bclass\s*=\s*(["'])([^"']*)\1/i);
19
+ if (!m)
20
20
  return s;
21
- const W = et(d[2]);
22
- return W === d[2] ? s : `${B}${T.replace(
23
- d[0],
24
- `class=${d[1]}${W}${d[1]}`
21
+ const W = tt(m[2]);
22
+ return W === m[2] ? s : `${B}${M.replace(
23
+ m[0],
24
+ `class=${m[1]}${W}${m[1]}`
25
25
  )}>`;
26
26
  }
27
- ), ut = ({
27
+ ), ht = ({
28
28
  content: c,
29
29
  type: o,
30
30
  className: s,
31
31
  styleLoadingText: B,
32
- scriptLoadingText: T,
33
- fullScreenButtonText: d,
32
+ scriptLoadingText: M,
33
+ fullScreenButtonText: m,
34
34
  hideFullScreen: W = !1,
35
- mode: l = "content",
36
- replaceRootScreenHeightWithFull: Me = !1,
37
- enableScaling: Te = !1,
38
- disableLoadingOverlay: ie = !1
35
+ mode: a = "content",
36
+ replaceRootScreenHeightWithFull: Te = !1,
37
+ enableScaling: Ae = !1,
38
+ disableLoadingOverlay: se = !1
39
39
  }) => {
40
- const D = i(null), m = i(null), U = i(null), A = i(() => {
41
- }), [Ae, _e] = M(480), [se, ke] = M(0), [Y, ce] = M(0), X = i(!1), Z = i(!1), le = i(0), [ae, Fe] = M(0), [J, Ie] = M(!1), Ne = o === "sandbox", f = l === "blackboard", w = Te && f && o === "sandbox", _ = f && o === "sandbox", R = _ && Me, K = i(""), P = j.useMemo(
40
+ const D = i(null), f = i(null), Y = i(null), T = i(() => {
41
+ }), [ke, _e] = C(480), [ce, Fe] = C(0), [X, le] = C(0), Z = i(!1), J = i(!1), ae = i(0), [ue, Ie] = C(0), [K, Ne] = C(!1), Oe = o === "sandbox", g = a === "blackboard", H = Ae && g && o === "sandbox", A = g && o === "sandbox", R = A && Te, Q = i(""), P = j.useMemo(
42
42
  () => o === "sandbox" ? c : "",
43
43
  [c, o]
44
44
  ), n = j.useMemo(
45
- () => tt(
45
+ () => nt(
46
46
  P,
47
47
  R
48
48
  ),
49
49
  [P, R]
50
- ), ue = j.useMemo(
51
- () => R ? ye(P) : qe,
52
- [P, R]
53
50
  ), he = j.useMemo(
54
- () => R && ue.hasFullViewportHeight,
51
+ () => R ? Ce(P) : Ge,
52
+ [P, R]
53
+ ), de = j.useMemo(
54
+ () => R && he.hasFullViewportHeight,
55
55
  [
56
- ue.hasFullViewportHeight,
56
+ he.hasFullViewportHeight,
57
57
  R
58
58
  ]
59
- ), [$, de] = M(
59
+ ), [$, me] = C(
60
60
  n
61
- ), me = i(n), Q = i(n), k = i(null), F = i(null), fe = i(null), ge = We((t) => {
61
+ ), fe = i(n), ee = i(n), k = i(null), _ = i(null), ge = i(null), be = De((t) => {
62
62
  if (typeof window > "u")
63
63
  return;
64
64
  const e = Date.now();
65
- e - le.current < Qe || (le.current = e, window.postMessage(
65
+ e - ae.current < et || (ae.current = e, window.postMessage(
66
66
  {
67
- source: Ye,
68
- type: Ue,
67
+ source: Xe,
68
+ type: Ye,
69
69
  eventType: t
70
70
  },
71
71
  window.location.origin
72
72
  ));
73
- }, []), ee = () => {
73
+ }, []), te = () => {
74
74
  k.current !== null && (window.clearTimeout(k.current), k.current = null);
75
- }, Oe = () => {
76
- F.current !== null && (window.cancelAnimationFrame(F.current), F.current = null);
75
+ }, Ve = () => {
76
+ _.current !== null && (window.cancelAnimationFrame(_.current), _.current = null);
77
77
  };
78
- H(
78
+ p(
79
79
  () => () => {
80
- ee(), Oe();
80
+ te(), Ve();
81
81
  },
82
82
  []
83
- ), H(() => {
84
- const t = me.current;
85
- me.current = n;
86
- const e = !!t && n.length > t.length && n.startsWith(t), a = Je.test(
83
+ ), p(() => {
84
+ const t = fe.current;
85
+ fe.current = n;
86
+ const e = !!t && n.length > t.length && n.startsWith(t), u = Ke.test(
87
87
  n
88
88
  );
89
- if (!(e && a)) {
90
- ee(), Q.current = n, de(n);
89
+ if (!(e && u)) {
90
+ te(), ee.current = n, me(n);
91
91
  return;
92
92
  }
93
- Q.current = n, ee(), k.current = window.setTimeout(() => {
94
- de(Q.current), k.current = null;
95
- }, Ke);
93
+ ee.current = n, te(), k.current = window.setTimeout(() => {
94
+ me(ee.current), k.current = null;
95
+ }, Qe);
96
96
  }, [n]);
97
- const z = j.useMemo(() => _ ? ye($).viewportHeightCss : null, [$, _]);
98
- H(() => {
99
- fe.current = z;
97
+ const z = j.useMemo(() => A ? Ce($).viewportHeightCss : null, [$, A]);
98
+ p(() => {
99
+ ge.current = z;
100
100
  }, [z]);
101
- const be = !!z, I = f && o === "sandbox" ? w || he ? "100%" : z ?? `${Ae}px` : void 0;
102
- H(() => {
103
- if (l !== "blackboard") {
104
- K.current = n;
101
+ const pe = !!z, F = g && o === "sandbox" ? H || de ? "100%" : z ?? `${ke}px` : void 0;
102
+ p(() => {
103
+ if (a !== "blackboard") {
104
+ Q.current = n;
105
105
  return;
106
106
  }
107
- const t = K.current;
108
- !(t && n.startsWith(t)) && t && Fe((a) => a + 1), K.current = n;
109
- }, [l, n]), H(() => {
110
- const t = m.current;
107
+ const t = Q.current;
108
+ !(t && n.startsWith(t)) && t && Ie((u) => u + 1), Q.current = n;
109
+ }, [a, n]), p(() => {
110
+ const t = f.current;
111
111
  if (!t) return;
112
112
  const e = t.contentDocument;
113
113
  if (!e) return;
114
114
  e.open(), e.write(`<!DOCTYPE html>
115
- <html${l === "blackboard" ? ' style="height: 100%;"' : ""}>
115
+ <html${a === "blackboard" ? ' style="height: 100%;"' : ""}>
116
116
  <head>
117
117
  <meta charset="utf-8" />
118
118
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
119
119
  <style>
120
120
  :root { color-scheme: light; }
121
121
  html, body, #root { width: 100%; }
122
- ${l === "blackboard" ? "html, body, #root { height: 100%; }" : ""}
123
- html, body { margin: 0; padding: 0; overflow: ${w ? "hidden auto" : l === "blackboard" ? "auto" : "hidden"}; }
122
+ ${a === "blackboard" ? "html, body, #root { height: 100%; }" : ""}
123
+ html, body { margin: 0; padding: 0; overflow: ${H ? "hidden auto" : a === "blackboard" ? "auto" : "hidden"}; }
124
124
  *, *::before, *::after { box-sizing: border-box; }
125
- ${l !== "blackboard" ? `
125
+ ${a !== "blackboard" ? `
126
126
  .h-screen { height: auto !important; }
127
127
  .min-h-screen { min-height: auto !important; }
128
128
  .h-dvh, .h-svh, .h-lvh { height: auto !important; }
@@ -134,24 +134,24 @@ const Ze = () => (oe || (oe = import("./blackboard-vendor.es.js").then(
134
134
  <div id="root"></div>
135
135
  </body>
136
136
  </html>`), e.close(), e.documentElement.setAttribute("data-theme", "light"), e.documentElement.style.colorScheme = "light", e.body?.style.setProperty("color-scheme", "light");
137
- const a = f && o === "sandbox", q = () => ge("click");
138
- a && e.addEventListener("click", q, !0);
139
- const N = e.getElementById("root");
140
- if (!N) return;
141
- const He = Pe(N);
142
- U.current = He;
143
- let O = !1;
144
- const we = (r) => ({
137
+ const u = g && o === "sandbox", q = () => be("click");
138
+ u && e.addEventListener("click", q, !0);
139
+ const I = e.getElementById("root");
140
+ if (!I) return;
141
+ const we = $e(I);
142
+ Y.current = we;
143
+ let N = !1;
144
+ const xe = (r) => ({
145
145
  heightAttrValue: r.getAttribute("height"),
146
146
  styleAttrValue: r.getAttribute("style"),
147
147
  classAttrValue: r.getAttribute("class")
148
- }), xe = (r) => {
149
- const x = Array.from(r.children);
150
- return x.length === 1 ? x[0] : null;
151
- }, Be = () => {
152
- if (!_ || !m.current || !e.body) return null;
153
- const r = m.current.ownerDocument?.documentElement?.clientHeight || window.innerHeight, x = fe.current, G = x ? Ce(
154
- x,
148
+ }), ve = (r) => {
149
+ const w = Array.from(r.children);
150
+ return w.length === 1 ? w[0] : null;
151
+ }, We = () => {
152
+ if (!A || !f.current || !e.body) return null;
153
+ const r = f.current.ownerDocument?.documentElement?.clientHeight || window.innerHeight, w = ge.current, G = w ? Me(
154
+ w,
155
155
  r
156
156
  ) : null;
157
157
  if (G !== null)
@@ -160,142 +160,142 @@ const Ze = () => (oe || (oe = import("./blackboard-vendor.es.js").then(
160
160
  ".sandbox-wrapper"
161
161
  )?.firstElementChild;
162
162
  if (!h) return null;
163
- const g = Array.from(h.children), v = g.length === 1 ? g[0] : null, u = Ge(
164
- v,
163
+ const d = Array.from(h.children), x = d.length === 1 ? d[0] : null, L = Le(
164
+ x,
165
165
  {
166
- getNode: we,
167
- getSingleChild: xe
166
+ getNode: xe,
167
+ getSingleChild: ve
168
168
  }
169
169
  ).viewportHeightCss;
170
- if (u) {
171
- const b = Ce(
172
- u,
170
+ if (L) {
171
+ const O = Me(
172
+ L,
173
173
  r
174
174
  );
175
- if (b !== null)
176
- return Math.ceil(b);
175
+ if (O !== null)
176
+ return Math.ceil(O);
177
177
  }
178
- const V = Le(
179
- v,
178
+ const l = Ue(
179
+ x,
180
180
  r,
181
181
  {
182
- getNode: we,
183
- getSingleChild: xe
182
+ getNode: xe,
183
+ getSingleChild: ve
184
184
  }
185
185
  );
186
- return V !== null ? Math.ceil(V) : null;
187
- }, te = () => {
188
- if (!m.current || !e.body) return;
189
- if (!f) {
190
- if (X.current) {
191
- Z.current = !0;
186
+ return l !== null ? Math.ceil(l) : null;
187
+ }, ne = () => {
188
+ if (!f.current || !e.body) return;
189
+ if (!g) {
190
+ if (Z.current) {
191
+ J.current = !0;
192
192
  return;
193
193
  }
194
- X.current = !0;
195
- const h = m.current, g = D.current?.clientWidth || 0, v = h.style.height;
196
- if (g > 0) {
197
- const re = Math.round(g * 9 / 16);
198
- h.style.height = re + "px", e.body.offsetHeight;
199
- let u = e.body.scrollHeight;
200
- const V = e.defaultView;
201
- if (V) {
202
- const b = (p) => {
203
- let y = 0;
204
- const Re = (E) => {
205
- if (E !== p && E.scrollHeight > E.clientHeight + 1) {
206
- const L = V.getComputedStyle(E).overflowY;
207
- if (L === "auto" || L === "scroll") {
208
- const Se = E.getBoundingClientRect();
209
- Se.top >= 0 && (y = Math.max(
210
- y,
211
- Math.ceil(Se.top + E.scrollHeight)
194
+ Z.current = !0;
195
+ const h = f.current, d = D.current?.clientWidth || 0, x = h.style.height;
196
+ if (d > 0) {
197
+ const oe = Math.round(d * 9 / 16), L = Math.max(8192, d * 20);
198
+ h.style.height = oe + "px", e.body.offsetHeight;
199
+ let l = e.body.scrollHeight;
200
+ const O = e.defaultView;
201
+ if (O) {
202
+ const V = (b) => {
203
+ let v = 0;
204
+ const Se = (E) => {
205
+ if (E !== b && E.scrollHeight > E.clientHeight + 1) {
206
+ const U = O.getComputedStyle(E).overflowY;
207
+ if (U === "auto" || U === "scroll") {
208
+ const ye = E.getBoundingClientRect();
209
+ ye.top >= 0 && (v = Math.max(
210
+ v,
211
+ Math.ceil(ye.top + E.scrollHeight)
212
212
  ));
213
213
  }
214
214
  }
215
- for (const L of E.children) Re(L);
215
+ for (const U of E.children) Se(U);
216
216
  };
217
- return Re(p), y;
217
+ return Se(b), v;
218
218
  };
219
- u = Math.max(u, b(e.body));
220
- for (let p = 0; p < 8 && u > re; p++) {
221
- h.style.height = u + "px", e.body.offsetHeight;
222
- const y = Math.max(
219
+ l = Math.max(l, V(e.body));
220
+ for (let b = 0; b < 8 && l > oe; b++) {
221
+ h.style.height = l + "px", e.body.offsetHeight;
222
+ const v = Math.max(
223
223
  e.body.scrollHeight,
224
- b(e.body)
224
+ V(e.body)
225
225
  );
226
- if (y <= u + 1) break;
227
- u = y;
226
+ if (v <= l + 1 || v >= l * 1.5) break;
227
+ l = v;
228
228
  }
229
229
  }
230
- h.style.height = v, ke((b) => {
231
- const p = Math.max(200, Math.ceil(u));
232
- return b === p ? b : p;
230
+ h.style.height = x, Fe((V) => {
231
+ const b = Math.min(L, Math.max(200, Math.ceil(l)));
232
+ return V === b ? V : b;
233
233
  });
234
234
  }
235
235
  setTimeout(() => {
236
- X.current = !1, Z.current && (Z.current = !1, S());
236
+ Z.current = !1, J.current && (J.current = !1, S());
237
237
  }, 50);
238
238
  return;
239
239
  }
240
- if (w) return;
241
- const r = e.body.scrollHeight, x = e.documentElement?.scrollHeight || 0, G = N?.scrollHeight || 0, Ee = Math.max(r, x, G);
242
- if (_) {
243
- const h = Be(), g = Math.max(
240
+ if (H) return;
241
+ const r = e.body.scrollHeight, w = e.documentElement?.scrollHeight || 0, G = I?.scrollHeight || 0, Re = Math.max(r, w, G);
242
+ if (A) {
243
+ const h = We(), d = Math.max(
244
244
  200,
245
- h ?? Math.ceil(Ee)
245
+ h ?? Math.ceil(Re)
246
246
  );
247
247
  _e(
248
- (v) => v === g ? v : g
248
+ (x) => x === d ? x : d
249
249
  );
250
250
  }
251
251
  }, S = () => {
252
252
  requestAnimationFrame(() => {
253
- O || te();
253
+ N || ne();
254
254
  });
255
255
  };
256
- A.current = S, te(), S(), Ne && Ze().then((r) => {
257
- O || (r(e), w && Xe(e), requestAnimationFrame(() => {
258
- O || S();
256
+ T.current = S, ne(), S(), Oe && Je().then((r) => {
257
+ N || (r(e), H && Ze(e), requestAnimationFrame(() => {
258
+ N || S();
259
259
  }));
260
260
  }).catch(() => {
261
- O || S();
261
+ N || S();
262
262
  });
263
- const ne = new ResizeObserver(() => te());
264
- ne.observe(e.body), N && ne.observe(N);
265
- const ve = new MutationObserver(() => {
263
+ const re = new ResizeObserver(() => ne());
264
+ re.observe(e.body), I && re.observe(I);
265
+ const Ee = new MutationObserver(() => {
266
266
  S();
267
267
  });
268
- return ve.observe(e.body, {
268
+ return Ee.observe(e.body, {
269
269
  childList: !0,
270
270
  subtree: !0,
271
271
  attributes: !0,
272
272
  attributeFilter: ["style", "class"]
273
273
  }), () => {
274
- O = !0, ne.disconnect(), ve.disconnect(), w && t.contentWindow?.__mdf_cleanupScaling?.(), a && e.removeEventListener("click", q, !0), setTimeout(() => {
275
- He.unmount(), U.current = null, A.current = () => {
274
+ N = !0, re.disconnect(), Ee.disconnect(), H && t.contentWindow?.__mdf_cleanupScaling?.(), u && e.removeEventListener("click", q, !0), setTimeout(() => {
275
+ we.unmount(), Y.current = null, T.current = () => {
276
276
  };
277
277
  }, 0);
278
278
  };
279
- }, []), H(() => {
279
+ }, []), p(() => {
280
280
  const t = () => {
281
- Ie(!!document.fullscreenElement);
281
+ Ne(!!document.fullscreenElement);
282
282
  };
283
283
  return document.addEventListener("fullscreenchange", t), () => document.removeEventListener("fullscreenchange", t);
284
- }, []), H(() => {
284
+ }, []), p(() => {
285
285
  const t = D.current;
286
286
  if (!t) return;
287
- const e = new ResizeObserver((a) => {
288
- ce(a[0]?.contentRect.width ?? t.clientWidth);
287
+ const e = new ResizeObserver((u) => {
288
+ le(u[0]?.contentRect.width ?? t.clientWidth);
289
289
  });
290
- return e.observe(t), ce(t.clientWidth), () => e.disconnect();
290
+ return e.observe(t), le(t.clientWidth), () => e.disconnect();
291
291
  }, []);
292
- const pe = De(() => {
293
- if (f || Y === 0 || J)
292
+ const He = Pe(() => {
293
+ if (g || X === 0 || K)
294
294
  return;
295
- const t = Math.round(Y * 9 / 16);
296
- return { height: Math.max(t, se) };
297
- }, [f, Y, se, J]), Ve = () => {
298
- const t = D.current || m.current;
295
+ const t = Math.round(X * 9 / 16);
296
+ return { height: Math.max(t, ce) };
297
+ }, [g, X, ce, K]), je = () => {
298
+ const t = D.current || f.current;
299
299
  if (t) {
300
300
  if (document.fullscreenElement) {
301
301
  document.exitFullscreen().catch(() => {
@@ -306,79 +306,79 @@ const Ze = () => (oe || (oe = import("./blackboard-vendor.es.js").then(
306
306
  });
307
307
  }
308
308
  };
309
- H(() => {
310
- const t = U.current;
309
+ p(() => {
310
+ const t = Y.current;
311
311
  if (!t) return;
312
312
  t.render(
313
- /* @__PURE__ */ C.jsx(
314
- $e,
313
+ /* @__PURE__ */ y.jsx(
314
+ ze,
315
315
  {
316
316
  html: $,
317
317
  styleLoadingText: B,
318
- scriptLoadingText: T,
319
- disableLoadingOverlay: ie,
320
- resetToken: ae,
321
- hasRootVhHeight: be,
322
- mode: l,
323
- stretchRootHeight: he,
324
- enableScaling: w
318
+ scriptLoadingText: M,
319
+ disableLoadingOverlay: se,
320
+ resetToken: ue,
321
+ hasRootVhHeight: pe,
322
+ mode: a,
323
+ stretchRootHeight: de,
324
+ enableScaling: H
325
325
  }
326
326
  )
327
- ), F.current = window.requestAnimationFrame(() => {
328
- A.current?.(), w && m.current?.contentWindow?.__mdf_triggerFitContent?.(), F.current = null;
327
+ ), _.current = window.requestAnimationFrame(() => {
328
+ T.current?.(), H && f.current?.contentWindow?.__mdf_triggerFitContent?.(), _.current = null;
329
329
  });
330
- const e = setTimeout(() => A.current?.(), 100), a = setTimeout(() => A.current?.(), 500);
330
+ const e = setTimeout(() => T.current?.(), 100), u = setTimeout(() => T.current?.(), 500);
331
331
  return () => {
332
- clearTimeout(e), clearTimeout(a);
332
+ clearTimeout(e), clearTimeout(u);
333
333
  };
334
334
  }, [
335
335
  $,
336
336
  B,
337
- T,
338
- ae,
339
- l
337
+ M,
338
+ ue,
339
+ a
340
340
  ]);
341
- const je = [
341
+ const Be = [
342
342
  "w-full relative content-render-iframe-sandbox",
343
- f ? "h-full overflow-auto flex flex-col" : pe ? "overflow-hidden flex items-center justify-center" : "aspect-[16/9] overflow-hidden flex items-center justify-center"
343
+ g ? "h-full overflow-auto flex flex-col" : He ? "overflow-hidden flex items-center justify-center" : "aspect-[16/9] overflow-hidden flex items-center justify-center"
344
344
  ].filter(Boolean).join(" ");
345
- return /* @__PURE__ */ C.jsxs(
345
+ return /* @__PURE__ */ y.jsxs(
346
346
  "div",
347
347
  {
348
348
  ref: D,
349
- "data-root-vh": be ? "true" : "false",
350
- className: je,
351
- style: I ? {
352
- height: I,
353
- minHeight: I
354
- } : pe,
349
+ "data-root-vh": pe ? "true" : "false",
350
+ className: Be,
351
+ style: F ? {
352
+ height: F,
353
+ minHeight: F
354
+ } : He,
355
355
  children: [
356
- !W && /* @__PURE__ */ C.jsx(
356
+ !W && /* @__PURE__ */ y.jsx(
357
357
  "button",
358
358
  {
359
359
  type: "button",
360
- onClick: Ve,
360
+ onClick: je,
361
361
  className: "absolute top-2 right-2 z-50 p-1.5 bg-black/75 text-white rounded-md cursor-pointer",
362
- children: J ? "退出全屏" : d || "全屏浏览"
362
+ children: K ? "退出全屏" : m || "全屏浏览"
363
363
  }
364
364
  ),
365
- l === "blackboard" && o === "markdown" ? /* @__PURE__ */ C.jsx("div", { onClick: () => ge("click"), children: /* @__PURE__ */ C.jsx(
366
- ze,
365
+ a === "blackboard" && o === "markdown" ? /* @__PURE__ */ y.jsx("div", { onClick: () => be("click"), children: /* @__PURE__ */ y.jsx(
366
+ qe,
367
367
  {
368
368
  content: c,
369
- disableSandboxLoadingOverlay: ie
369
+ disableSandboxLoadingOverlay: se
370
370
  }
371
- ) }) : /* @__PURE__ */ C.jsx(
371
+ ) }) : /* @__PURE__ */ y.jsx(
372
372
  "iframe",
373
373
  {
374
- ref: m,
374
+ ref: f,
375
375
  sandbox: "allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox",
376
376
  allow: "fullscreen",
377
377
  allowFullScreen: !0,
378
378
  className: [s, "w-full h-full mx-auto my-auto block"].filter(Boolean).join(" "),
379
379
  style: {
380
- height: I ?? "100%",
381
- minHeight: I,
380
+ height: F ?? "100%",
381
+ minHeight: F,
382
382
  margin: "auto"
383
383
  }
384
384
  }
@@ -388,6 +388,6 @@ const Ze = () => (oe || (oe = import("./blackboard-vendor.es.js").then(
388
388
  );
389
389
  };
390
390
  export {
391
- ut as default
391
+ ht as default
392
392
  };
393
393
  //# sourceMappingURL=IframeSandbox.es.js.map