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.
- 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
- 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
- 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
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js +1 -1
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.es.js +1 -1
- package/dist/_virtual/index.cjs10.js +1 -1
- package/dist/_virtual/index.cjs4.js +1 -1
- package/dist/_virtual/index.cjs5.js +1 -1
- package/dist/_virtual/index.cjs6.js +1 -1
- package/dist/_virtual/index.cjs9.js +1 -1
- package/dist/_virtual/index.es10.js +2 -2
- package/dist/_virtual/index.es4.js +4 -4
- package/dist/_virtual/index.es5.js +4 -4
- package/dist/_virtual/index.es6.js +5 -5
- package/dist/_virtual/index.es9.js +2 -2
- package/dist/components/ContentRender/ContentRender.cjs.js +2 -2
- package/dist/components/ContentRender/ContentRender.cjs.js.map +1 -1
- package/dist/components/ContentRender/ContentRender.es.js +38 -42
- package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
- package/dist/components/ContentRender/IframeSandbox.cjs.js +2 -2
- package/dist/components/ContentRender/IframeSandbox.cjs.js.map +1 -1
- package/dist/components/ContentRender/IframeSandbox.es.js +124 -138
- package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -1
- package/dist/components/Slide/index.cjs.js +2 -0
- package/dist/components/Slide/index.cjs.js.map +1 -0
- package/dist/components/Slide/index.es.js +12 -0
- package/dist/components/Slide/index.es.js.map +1 -0
- package/dist/components/ui/inputGroup/textarea.cjs.js +1 -1
- package/dist/components/ui/inputGroup/textarea.es.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +13 -24
- package/dist/index.es.js.map +1 -1
- package/dist/renderer.cjs.js +1 -1
- package/dist/renderer.d.ts +2 -3
- package/dist/renderer.es.js +14 -25
- package/dist/renderer.es.js.map +1 -1
- package/dist/slide.cjs.js +2 -0
- package/dist/slide.cjs.js.map +1 -0
- package/dist/slide.d.ts +2 -0
- package/dist/slide.es.js +18 -0
- package/dist/slide.es.js.map +1 -0
- package/package.json +9 -1
|
@@ -1,34 +1,20 @@
|
|
|
1
1
|
import { j as A } from "../../_virtual/jsx-runtime.es.js";
|
|
2
|
-
import
|
|
3
|
-
import { createRoot as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { SANDBOX_INTERACTION_MESSAGE_TYPE as At, SANDBOX_INTERACTION_MESSAGE_SOURCE as
|
|
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),
|
|
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),
|
|
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
|
|
31
|
-
return
|
|
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
|
|
42
|
-
(
|
|
27
|
+
const o = t.find(
|
|
28
|
+
(a) => /^(h|min-h)-\[[0-9.]+(vh|dvh|svh|lvh)\]$/i.test(a)
|
|
43
29
|
);
|
|
44
|
-
if (!
|
|
45
|
-
const c =
|
|
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
|
-
},
|
|
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] || "",
|
|
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],
|
|
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:
|
|
61
|
-
hasFullViewportHeight:
|
|
46
|
+
viewportHeightCss: $,
|
|
47
|
+
hasFullViewportHeight: It($)
|
|
62
48
|
};
|
|
63
49
|
}, Bt = (n) => n.split(/\s+/).filter(Boolean).map((t) => {
|
|
64
|
-
const
|
|
65
|
-
return
|
|
66
|
-
}).join(" "),
|
|
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
|
-
(
|
|
69
|
-
const m =
|
|
54
|
+
(o, c, a = "") => {
|
|
55
|
+
const m = a.match(/\bclass\s*=\s*(["'])([^"']*)\1/i);
|
|
70
56
|
if (!m)
|
|
71
|
-
return
|
|
57
|
+
return o;
|
|
72
58
|
const b = Bt(m[2]);
|
|
73
|
-
return b === m[2] ?
|
|
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
|
-
),
|
|
64
|
+
), Gt = ({
|
|
79
65
|
content: n,
|
|
80
66
|
type: t,
|
|
81
|
-
className:
|
|
67
|
+
className: o,
|
|
82
68
|
styleLoadingText: c,
|
|
83
|
-
scriptLoadingText:
|
|
69
|
+
scriptLoadingText: a,
|
|
84
70
|
fullScreenButtonText: m,
|
|
85
71
|
hideFullScreen: b = !1,
|
|
86
72
|
mode: h = "content",
|
|
87
|
-
replaceRootScreenHeightWithFull:
|
|
73
|
+
replaceRootScreenHeightWithFull: $ = !1
|
|
88
74
|
}) => {
|
|
89
|
-
const et =
|
|
90
|
-
}), [mt, ft] =
|
|
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 =
|
|
94
|
-
() =>
|
|
95
|
-
|
|
96
|
-
|
|
79
|
+
), s = I.useMemo(
|
|
80
|
+
() => Dt(
|
|
81
|
+
D,
|
|
82
|
+
T
|
|
97
83
|
),
|
|
98
|
-
[
|
|
99
|
-
), ot =
|
|
100
|
-
() =>
|
|
101
|
-
[
|
|
102
|
-
), st =
|
|
103
|
-
() =>
|
|
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
|
-
|
|
92
|
+
T
|
|
107
93
|
]
|
|
108
|
-
), [
|
|
94
|
+
), [O, it] = P(
|
|
109
95
|
s
|
|
110
|
-
), lt =
|
|
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 <
|
|
100
|
+
e - nt.current < _t || (nt.current = e, window.postMessage(
|
|
115
101
|
{
|
|
116
|
-
source:
|
|
102
|
+
source: St,
|
|
117
103
|
type: At,
|
|
118
|
-
eventType:
|
|
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
|
-
|
|
111
|
+
V.current !== null && (window.cancelAnimationFrame(V.current), V.current = null);
|
|
126
112
|
};
|
|
127
|
-
|
|
113
|
+
R(
|
|
128
114
|
() => () => {
|
|
129
115
|
X(), vt();
|
|
130
116
|
},
|
|
131
117
|
[]
|
|
132
|
-
),
|
|
133
|
-
const
|
|
118
|
+
), R(() => {
|
|
119
|
+
const r = lt.current;
|
|
134
120
|
lt.current = s;
|
|
135
|
-
const e = !!
|
|
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 =
|
|
147
|
-
if (!
|
|
132
|
+
const z = I.useMemo(() => {
|
|
133
|
+
if (!S)
|
|
148
134
|
return null;
|
|
149
|
-
const
|
|
150
|
-
if (!
|
|
151
|
-
const e =
|
|
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] || "",
|
|
154
|
-
if (
|
|
155
|
-
const g =
|
|
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
|
|
144
|
+
const _ = d.match(/\bstyle\s*=\s*["']([^"']+)["']/i)?.[1]?.match(
|
|
159
145
|
/\bheight\s*:\s*([^;]+)/i
|
|
160
146
|
)?.[1];
|
|
161
|
-
if (
|
|
162
|
-
const g =
|
|
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
|
-
}, [
|
|
168
|
-
|
|
153
|
+
}, [O, S]);
|
|
154
|
+
R(() => {
|
|
169
155
|
ct.current = z;
|
|
170
156
|
}, [z]);
|
|
171
|
-
const
|
|
172
|
-
|
|
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
|
|
178
|
-
!(
|
|
179
|
-
}, [h, s]),
|
|
180
|
-
const
|
|
181
|
-
if (!
|
|
182
|
-
const e =
|
|
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 =
|
|
201
|
-
d && (e.addEventListener("pointerdown",
|
|
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 =
|
|
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
|
-
},
|
|
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
|
-
(
|
|
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
|
-
},
|
|
226
|
-
if (!
|
|
227
|
-
const i =
|
|
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],
|
|
240
|
-
if (
|
|
241
|
-
return Math.ceil(
|
|
242
|
-
const ht =
|
|
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 (!
|
|
249
|
-
const i = e.body.getBoundingClientRect(), p = e.documentElement?.getBoundingClientRect(), l = i.height, v = p?.height || 0, H = Math.max(l, v), x =
|
|
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
|
-
(
|
|
240
|
+
(E) => E === f ? E : f
|
|
255
241
|
);
|
|
256
|
-
},
|
|
242
|
+
}, j = () => {
|
|
257
243
|
requestAnimationFrame(() => {
|
|
258
244
|
k || J();
|
|
259
245
|
});
|
|
260
246
|
};
|
|
261
|
-
G.current =
|
|
247
|
+
G.current = j, J(), j(), wt && Ft().then((i) => {
|
|
262
248
|
k || (i(e), requestAnimationFrame(() => {
|
|
263
|
-
k ||
|
|
249
|
+
k || j();
|
|
264
250
|
}));
|
|
265
251
|
}).catch(() => {
|
|
266
|
-
k ||
|
|
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",
|
|
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
|
-
}, []),
|
|
276
|
-
const
|
|
261
|
+
}, []), R(() => {
|
|
262
|
+
const r = () => {
|
|
277
263
|
bt(!!document.fullscreenElement);
|
|
278
264
|
};
|
|
279
|
-
return document.addEventListener("fullscreenchange",
|
|
265
|
+
return document.addEventListener("fullscreenchange", r), () => document.removeEventListener("fullscreenchange", r);
|
|
280
266
|
}, []);
|
|
281
267
|
const Ht = () => {
|
|
282
|
-
const
|
|
283
|
-
if (
|
|
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
|
-
|
|
275
|
+
r.requestFullscreen && r.requestFullscreen().catch(() => {
|
|
290
276
|
});
|
|
291
277
|
}
|
|
292
278
|
};
|
|
293
|
-
|
|
294
|
-
const
|
|
295
|
-
|
|
279
|
+
R(() => {
|
|
280
|
+
const r = q.current;
|
|
281
|
+
r && (r.render(
|
|
296
282
|
/* @__PURE__ */ A.jsx(
|
|
297
|
-
|
|
283
|
+
yt,
|
|
298
284
|
{
|
|
299
|
-
html:
|
|
285
|
+
html: O,
|
|
300
286
|
styleLoadingText: c,
|
|
301
|
-
scriptLoadingText:
|
|
287
|
+
scriptLoadingText: a,
|
|
302
288
|
resetToken: rt,
|
|
303
|
-
hasRootVhHeight:
|
|
289
|
+
hasRootVhHeight: ut,
|
|
304
290
|
mode: h,
|
|
305
291
|
stretchRootHeight: st
|
|
306
292
|
}
|
|
307
293
|
)
|
|
308
|
-
),
|
|
309
|
-
G.current?.(),
|
|
294
|
+
), V.current = window.requestAnimationFrame(() => {
|
|
295
|
+
G.current?.(), V.current = null;
|
|
310
296
|
}));
|
|
311
297
|
}, [
|
|
312
|
-
|
|
298
|
+
O,
|
|
313
299
|
c,
|
|
314
|
-
|
|
300
|
+
a,
|
|
315
301
|
rt,
|
|
316
302
|
h
|
|
317
303
|
]);
|
|
318
304
|
const xt = [
|
|
319
305
|
"w-full relative content-render-iframe-sandbox",
|
|
320
|
-
|
|
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":
|
|
312
|
+
"data-root-vh": ut ? "true" : "false",
|
|
327
313
|
className: xt,
|
|
328
|
-
style:
|
|
329
|
-
height:
|
|
330
|
-
minHeight:
|
|
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: () =>
|
|
346
|
-
onPointerDown: () =>
|
|
347
|
-
onTouchStart: () =>
|
|
348
|
-
children: /* @__PURE__ */ A.jsx(
|
|
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:
|
|
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: [
|
|
343
|
+
className: [o, "w-full h-full mx-auto my-auto block"].filter(Boolean).join(" "),
|
|
358
344
|
style: {
|
|
359
|
-
height:
|
|
360
|
-
minHeight:
|
|
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
|
-
|
|
357
|
+
Gt as default
|
|
372
358
|
};
|
|
373
359
|
//# sourceMappingURL=IframeSandbox.es.js.map
|