markdown-flow-ui 0.1.100 → 0.1.101
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/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/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.cjs.js +7 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.cjs.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js +17 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/file-pen-line.cjs.js +7 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/file-pen-line.cjs.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js +29 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/maximize.cjs.js +7 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/maximize.cjs.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/maximize.es.js +18 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/maximize.es.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-ccw.cjs.js +7 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-ccw.cjs.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js +16 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-cw.cjs.js +7 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-cw.cjs.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js +16 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/volume-2.cjs.js +7 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/volume-2.cjs.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/volume-2.es.js +23 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/volume-2.es.js.map +1 -0
- 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/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-custom-variable.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-custom-variable.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-interaction.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-interaction.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.cjs.js +1 -1
- package/dist/_virtual/index.cjs3.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.es.js +1 -0
- package/dist/_virtual/index.es3.js +4 -5
- package/dist/_virtual/index.es3.js.map +1 -1
- package/dist/_virtual/index.es4.js +5 -4
- package/dist/_virtual/index.es4.js.map +1 -1
- package/dist/_virtual/index.es5.js +4 -4
- package/dist/_virtual/index.es6.js +5 -5
- package/dist/assets/markdown-flow-ui.css +1 -1
- package/dist/components/ContentRender/ContentRender.cjs.js +2 -2
- package/dist/components/ContentRender/ContentRender.cjs.js.map +1 -1
- package/dist/components/ContentRender/ContentRender.d.ts +13 -10
- package/dist/components/ContentRender/ContentRender.es.js +172 -155
- package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
- package/dist/components/ContentRender/ContentRender.stories.d.ts +1 -0
- package/dist/components/ContentRender/IframeSandbox.cjs.js +4 -4
- package/dist/components/ContentRender/IframeSandbox.cjs.js.map +1 -1
- package/dist/components/ContentRender/IframeSandbox.d.ts +1 -0
- package/dist/components/ContentRender/IframeSandbox.es.js +214 -192
- package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -1
- package/dist/components/ContentRender/SandboxApp.cjs.js +3 -3
- package/dist/components/ContentRender/SandboxApp.cjs.js.map +1 -1
- package/dist/components/ContentRender/SandboxApp.d.ts +1 -0
- package/dist/components/ContentRender/SandboxApp.es.js +90 -90
- package/dist/components/ContentRender/SandboxApp.es.js.map +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.cjs.js +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.cjs.js.map +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.es.js +94 -86
- package/dist/components/ContentRender/plugins/CustomVariable.es.js.map +1 -1
- package/dist/components/ContentRender/utils/iframe-viewport-height.cjs.js +2 -0
- package/dist/components/ContentRender/utils/iframe-viewport-height.cjs.js.map +1 -0
- package/dist/components/ContentRender/utils/iframe-viewport-height.d.ts +24 -0
- package/dist/components/ContentRender/utils/iframe-viewport-height.es.js +127 -0
- package/dist/components/ContentRender/utils/iframe-viewport-height.es.js.map +1 -0
- package/dist/components/ContentRender/utils/iframe-viewport-height.test.d.ts +1 -0
- package/dist/components/MarkdownFlow/MarkdownFlow.cjs.js +1 -1
- package/dist/components/MarkdownFlow/MarkdownFlow.cjs.js.map +1 -1
- package/dist/components/MarkdownFlow/MarkdownFlow.d.ts +3 -0
- package/dist/components/MarkdownFlow/MarkdownFlow.es.js +19 -16
- package/dist/components/MarkdownFlow/MarkdownFlow.es.js.map +1 -1
- package/dist/components/Slide/Player.cjs.js +2 -0
- package/dist/components/Slide/Player.cjs.js.map +1 -0
- package/dist/components/Slide/Player.d.ts +21 -0
- package/dist/components/Slide/Player.es.js +386 -0
- package/dist/components/Slide/Player.es.js.map +1 -0
- package/dist/components/Slide/Slide.cjs.js +2 -0
- package/dist/components/Slide/Slide.cjs.js.map +1 -0
- package/dist/components/Slide/Slide.d.ts +27 -0
- package/dist/components/Slide/Slide.es.js +583 -0
- package/dist/components/Slide/Slide.es.js.map +1 -0
- package/dist/components/Slide/Slide.stories.d.ts +79 -0
- package/dist/components/Slide/diff-utils.cjs.js +5 -0
- package/dist/components/Slide/diff-utils.cjs.js.map +1 -0
- package/dist/components/Slide/diff-utils.d.ts +18 -0
- package/dist/components/Slide/diff-utils.es.js +113 -0
- package/dist/components/Slide/diff-utils.es.js.map +1 -0
- package/dist/components/Slide/index.cjs.js +2 -0
- package/dist/components/Slide/index.cjs.js.map +1 -0
- package/dist/components/Slide/index.d.ts +12 -0
- package/dist/components/Slide/index.es.js +12 -0
- package/dist/components/Slide/index.es.js.map +1 -0
- package/dist/components/Slide/types.d.ts +24 -0
- package/dist/components/Slide/useSlide.cjs.js +2 -0
- package/dist/components/Slide/useSlide.cjs.js.map +1 -0
- package/dist/components/Slide/useSlide.d.ts +24 -0
- package/dist/components/Slide/useSlide.es.js +144 -0
- package/dist/components/Slide/useSlide.es.js.map +1 -0
- package/dist/components/Slide/useWakePlayerFromIframe.cjs.js +2 -0
- package/dist/components/Slide/useWakePlayerFromIframe.cjs.js.map +1 -0
- package/dist/components/Slide/useWakePlayerFromIframe.d.ts +7 -0
- package/dist/components/Slide/useWakePlayerFromIframe.es.js +89 -0
- package/dist/components/Slide/useWakePlayerFromIframe.es.js.map +1 -0
- package/dist/components/Slide/utils/interactionPlayback.cjs.js +2 -0
- package/dist/components/Slide/utils/interactionPlayback.cjs.js.map +1 -0
- package/dist/components/Slide/utils/interactionPlayback.d.ts +9 -0
- package/dist/components/Slide/utils/interactionPlayback.es.js +11 -0
- package/dist/components/Slide/utils/interactionPlayback.es.js.map +1 -0
- package/dist/components/Slide/utils/interactionPlayback.test.d.ts +1 -0
- package/dist/components/Slide/utils/listenModeElementList.d.ts +81 -0
- package/dist/components/Slide/utils/listenModeElementList.test.d.ts +1 -0
- package/dist/components/Slide/utils/playbackSequence.cjs.js +2 -0
- package/dist/components/Slide/utils/playbackSequence.cjs.js.map +1 -0
- package/dist/components/Slide/utils/playbackSequence.d.ts +11 -0
- package/dist/components/Slide/utils/playbackSequence.es.js +16 -0
- package/dist/components/Slide/utils/playbackSequence.es.js.map +1 -0
- package/dist/components/Slide/utils/playbackSequence.test.d.ts +1 -0
- package/dist/components/Slide/utils/playerCustomActions.cjs.js +2 -0
- package/dist/components/Slide/utils/playerCustomActions.cjs.js.map +1 -0
- package/dist/components/Slide/utils/playerCustomActions.d.ts +3 -0
- package/dist/components/Slide/utils/playerCustomActions.es.js +7 -0
- package/dist/components/Slide/utils/playerCustomActions.es.js.map +1 -0
- package/dist/components/index.d.ts +7 -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 -10
- package/dist/index.es.js.map +1 -1
- package/dist/lib/browserUserActivation.d.ts +5 -0
- package/dist/lib/interaction-defaults.cjs.js +2 -0
- package/dist/lib/interaction-defaults.cjs.js.map +1 -0
- package/dist/lib/interaction-defaults.d.ts +23 -0
- package/dist/lib/interaction-defaults.es.js +145 -0
- package/dist/lib/interaction-defaults.es.js.map +1 -0
- package/dist/lib/sandboxInteraction.cjs.js +2 -0
- package/dist/lib/sandboxInteraction.cjs.js.map +1 -0
- package/dist/lib/sandboxInteraction.d.ts +8 -0
- package/dist/lib/sandboxInteraction.es.js +12 -0
- package/dist/lib/sandboxInteraction.es.js.map +1 -0
- package/dist/markdown-flow-ui-lib.css +1 -1
- package/dist/renderer.cjs.js +1 -1
- package/dist/renderer.d.ts +3 -1
- package/dist/renderer.es.js +9 -6
- 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 +25 -2
|
@@ -1,115 +1,120 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import { createRoot as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, Mt = ({
|
|
1
|
+
import { j as p } from "../../_virtual/jsx-runtime.es.js";
|
|
2
|
+
import C, { useRef as l, useState as O, useCallback as Ce, useEffect as d } from "react";
|
|
3
|
+
import { createRoot as Se } from "react-dom/client";
|
|
4
|
+
import Ae from "./SandboxApp.es.js";
|
|
5
|
+
import Me from "./ContentRender.es.js";
|
|
6
|
+
import { inspectViewportHeightFromHtmlRootString as de, EMPTY_ROOT_HEIGHT_META as Te, parseExplicitHeight as he, inspectViewportHeightFromNodeChain as ye, resolveExplicitHeightFromNodeChain as Ie } from "./utils/iframe-viewport-height.es.js";
|
|
7
|
+
import { SANDBOX_INTERACTION_MESSAGE_TYPE as Ne, SANDBOX_INTERACTION_MESSAGE_SOURCE as _e } from "../../lib/sandboxInteraction.es.js";
|
|
8
|
+
let U = null;
|
|
9
|
+
const Fe = () => (U || (U = import("./blackboard-vendor.es.js").then(
|
|
10
|
+
(s) => s.injectBlackboardLibraries
|
|
11
|
+
)), U), Ve = /<img\b[^>]*>/i, De = 180, Oe = 240, Be = (s) => s.split(/\s+/).filter(Boolean).map((o) => {
|
|
12
|
+
const i = o.split(":");
|
|
13
|
+
return i[i.length - 1] !== "h-screen" && i[i.length - 1] !== "min-h-screen" ? o : (i[i.length - 1] = "h-full", i.join(":"));
|
|
14
|
+
}).join(" "), je = (s, o) => !o || !s.trim() ? s : s.replace(
|
|
15
|
+
/^(\s*<[a-zA-Z][\w:-]*)(\s[^>]*?)?>/,
|
|
16
|
+
(i, S, b = "") => {
|
|
17
|
+
const c = b.match(/\bclass\s*=\s*(["'])([^"']*)\1/i);
|
|
18
|
+
if (!c)
|
|
19
|
+
return i;
|
|
20
|
+
const A = Be(c[2]);
|
|
21
|
+
return A === c[2] ? i : `${S}${b.replace(
|
|
22
|
+
c[0],
|
|
23
|
+
`class=${c[1]}${A}${c[1]}`
|
|
24
|
+
)}>`;
|
|
25
|
+
}
|
|
26
|
+
), Ue = ({
|
|
28
27
|
content: s,
|
|
29
|
-
type:
|
|
30
|
-
className:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
type: o,
|
|
29
|
+
className: i,
|
|
30
|
+
styleLoadingText: S,
|
|
31
|
+
scriptLoadingText: b,
|
|
32
|
+
fullScreenButtonText: c,
|
|
33
|
+
hideFullScreen: A = !1,
|
|
34
|
+
mode: u = "content",
|
|
35
|
+
replaceRootScreenHeightWithFull: me = !1
|
|
37
36
|
}) => {
|
|
38
|
-
const
|
|
39
|
-
}),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
const W = l(null), h = l(null), B = l(null), j = l(() => {
|
|
38
|
+
}), [fe, ge] = O(480), X = l(0), [Y, pe] = O(0), [be, we] = O(!1), He = o === "sandbox", M = u === "blackboard", w = M && o === "sandbox", m = w && me, k = l(""), T = C.useMemo(
|
|
39
|
+
() => o === "sandbox" ? s : "",
|
|
40
|
+
[s, o]
|
|
41
|
+
), n = C.useMemo(
|
|
42
|
+
() => je(
|
|
43
|
+
T,
|
|
44
|
+
m
|
|
45
|
+
),
|
|
46
|
+
[T, m]
|
|
47
|
+
), Z = C.useMemo(
|
|
48
|
+
() => m ? de(T) : Te,
|
|
49
|
+
[T, m]
|
|
50
|
+
), J = C.useMemo(
|
|
51
|
+
() => m && Z.hasFullViewportHeight,
|
|
52
|
+
[
|
|
53
|
+
Z.hasFullViewportHeight,
|
|
54
|
+
m
|
|
55
|
+
]
|
|
56
|
+
), [y, K] = O(
|
|
57
|
+
n
|
|
58
|
+
), Q = l(n), P = l(n), H = l(null), E = l(null), ee = l(null), f = Ce((t) => {
|
|
44
59
|
if (typeof window > "u")
|
|
45
60
|
return;
|
|
46
|
-
const
|
|
47
|
-
|
|
61
|
+
const e = Date.now();
|
|
62
|
+
e - X.current < Oe || (X.current = e, window.postMessage(
|
|
48
63
|
{
|
|
49
|
-
source:
|
|
50
|
-
type:
|
|
51
|
-
eventType:
|
|
64
|
+
source: _e,
|
|
65
|
+
type: Ne,
|
|
66
|
+
eventType: t
|
|
52
67
|
},
|
|
53
68
|
window.location.origin
|
|
54
69
|
));
|
|
55
|
-
}, []),
|
|
70
|
+
}, []), L = () => {
|
|
56
71
|
H.current !== null && (window.clearTimeout(H.current), H.current = null);
|
|
72
|
+
}, Ee = () => {
|
|
73
|
+
E.current !== null && (window.cancelAnimationFrame(E.current), E.current = null);
|
|
57
74
|
};
|
|
58
|
-
|
|
75
|
+
d(
|
|
59
76
|
() => () => {
|
|
60
|
-
|
|
77
|
+
L(), Ee();
|
|
61
78
|
},
|
|
62
79
|
[]
|
|
63
|
-
),
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
80
|
+
), d(() => {
|
|
81
|
+
const t = Q.current;
|
|
82
|
+
Q.current = n;
|
|
83
|
+
const e = !!t && n.length > t.length && n.startsWith(t), g = Ve.test(
|
|
84
|
+
n
|
|
85
|
+
);
|
|
86
|
+
if (!(e && g)) {
|
|
87
|
+
L(), P.current = n, K(n);
|
|
69
88
|
return;
|
|
70
89
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
},
|
|
90
|
+
P.current = n, L(), H.current = window.setTimeout(() => {
|
|
91
|
+
K(P.current), H.current = null;
|
|
92
|
+
}, De);
|
|
74
93
|
}, [n]);
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
if (m) return m;
|
|
84
|
-
}
|
|
85
|
-
const y = i.match(/\bstyle\s*=\s*["']([^"']+)["']/i)?.[1]?.match(
|
|
86
|
-
/\bheight\s*:\s*([^;]+)/i
|
|
87
|
-
)?.[1];
|
|
88
|
-
if (y) {
|
|
89
|
-
const m = Q(y);
|
|
90
|
-
if (m) return m;
|
|
91
|
-
}
|
|
92
|
-
const p = i.match(/\bclass\s*=\s*["']([^"']+)["']/i)?.[1];
|
|
93
|
-
return p ? tt(p) : null;
|
|
94
|
-
}, [A]);
|
|
95
|
-
R(() => {
|
|
96
|
-
if (h !== "blackboard") {
|
|
97
|
-
O.current = n;
|
|
94
|
+
const I = C.useMemo(() => w ? de(y).viewportHeightCss : null, [y, w]);
|
|
95
|
+
d(() => {
|
|
96
|
+
ee.current = I;
|
|
97
|
+
}, [I]);
|
|
98
|
+
const te = !!I, x = M && o === "sandbox" ? J ? "100%" : I ?? `${fe}px` : void 0;
|
|
99
|
+
d(() => {
|
|
100
|
+
if (u !== "blackboard") {
|
|
101
|
+
k.current = n;
|
|
98
102
|
return;
|
|
99
103
|
}
|
|
100
|
-
const
|
|
101
|
-
!(
|
|
102
|
-
}, [
|
|
103
|
-
const
|
|
104
|
-
if (!e) return;
|
|
105
|
-
const t = e.contentDocument;
|
|
104
|
+
const t = k.current;
|
|
105
|
+
!(t && n.startsWith(t)) && t && pe((g) => g + 1), k.current = n;
|
|
106
|
+
}, [u, n]), d(() => {
|
|
107
|
+
const t = h.current;
|
|
106
108
|
if (!t) return;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
const e = t.contentDocument;
|
|
110
|
+
if (!e) return;
|
|
111
|
+
e.open(), e.write(`<!DOCTYPE html>
|
|
112
|
+
<html${u === "blackboard" ? ' style="height: 100%;"' : ""}>
|
|
109
113
|
<head>
|
|
110
114
|
<meta charset="utf-8" />
|
|
111
115
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
112
116
|
<style>
|
|
117
|
+
:root { color-scheme: light; }
|
|
113
118
|
html, body, #root { width: 100%; height: 100%; }
|
|
114
119
|
html, body { margin: 0; padding: 0; overflow: auto; }
|
|
115
120
|
*, *::before, *::after { box-sizing: border-box; }
|
|
@@ -118,156 +123,173 @@ const pt = () => import("./blackboard-vendor.es.js").then((s) => s.injectBlackbo
|
|
|
118
123
|
<body>
|
|
119
124
|
<div id="root"></div>
|
|
120
125
|
</body>
|
|
121
|
-
</html>`),
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
if (!
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
let
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
);
|
|
142
|
-
if (
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
const w = Number.parseFloat(g[1]);
|
|
146
|
-
return Number.isNaN(w) ? null : w;
|
|
147
|
-
}, ut = () => {
|
|
148
|
-
if (!x.current || !t.body) return null;
|
|
149
|
-
const f = t.body.querySelector(
|
|
126
|
+
</html>`), e.close(), e.documentElement.setAttribute("data-theme", "light"), e.documentElement.style.colorScheme = "light", e.body?.style.setProperty("color-scheme", "light");
|
|
127
|
+
const g = M && o === "sandbox", $ = () => f("pointerdown"), ne = () => f("mousedown"), re = () => f("touchstart");
|
|
128
|
+
g && (e.addEventListener("pointerdown", $, !0), e.addEventListener("mousedown", ne, !0), e.addEventListener("touchstart", re, !0));
|
|
129
|
+
const N = e.getElementById("root");
|
|
130
|
+
if (!N) return;
|
|
131
|
+
const oe = Se(N);
|
|
132
|
+
B.current = oe;
|
|
133
|
+
let R = !1;
|
|
134
|
+
const ie = (r) => ({
|
|
135
|
+
heightAttrValue: r.getAttribute("height"),
|
|
136
|
+
styleAttrValue: r.getAttribute("style"),
|
|
137
|
+
classAttrValue: r.getAttribute("class")
|
|
138
|
+
}), se = (r) => {
|
|
139
|
+
const a = Array.from(r.children);
|
|
140
|
+
return a.length === 1 ? a[0] : null;
|
|
141
|
+
}, ve = () => {
|
|
142
|
+
if (!w || !h.current || !e.body) return null;
|
|
143
|
+
const r = h.current.ownerDocument?.documentElement?.clientHeight || window.innerHeight, a = ee.current, F = a ? he(
|
|
144
|
+
a,
|
|
145
|
+
r
|
|
146
|
+
) : null;
|
|
147
|
+
if (F !== null)
|
|
148
|
+
return Math.ceil(F);
|
|
149
|
+
const V = e.body.querySelector(
|
|
150
150
|
".sandbox-wrapper"
|
|
151
151
|
)?.firstElementChild;
|
|
152
|
-
if (!
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
152
|
+
if (!V) return null;
|
|
153
|
+
const D = Array.from(V.children), v = D.length === 1 ? D[0] : null, ce = ye(
|
|
154
|
+
v,
|
|
155
|
+
{
|
|
156
|
+
getNode: ie,
|
|
157
|
+
getSingleChild: se
|
|
158
|
+
}
|
|
159
|
+
).viewportHeightCss;
|
|
160
|
+
if (ce) {
|
|
161
|
+
const ae = he(
|
|
162
|
+
ce,
|
|
163
|
+
r
|
|
164
|
+
);
|
|
165
|
+
if (ae !== null)
|
|
166
|
+
return Math.ceil(ae);
|
|
167
|
+
}
|
|
168
|
+
const ue = Ie(
|
|
169
|
+
v,
|
|
170
|
+
r,
|
|
171
|
+
{
|
|
172
|
+
getNode: ie,
|
|
173
|
+
getSingleChild: se
|
|
174
|
+
}
|
|
161
175
|
);
|
|
162
|
-
return
|
|
163
|
-
},
|
|
164
|
-
if (!
|
|
165
|
-
const
|
|
176
|
+
return ue !== null ? Math.ceil(ue) : null;
|
|
177
|
+
}, q = () => {
|
|
178
|
+
if (!w || !h.current || !e.body) return;
|
|
179
|
+
const r = e.body.getBoundingClientRect(), a = e.documentElement?.getBoundingClientRect(), F = r.height, le = a?.height || 0, V = Math.max(F, le), D = ve(), v = Math.max(
|
|
166
180
|
200,
|
|
167
|
-
|
|
181
|
+
D ?? Math.ceil(V)
|
|
182
|
+
);
|
|
183
|
+
ge(
|
|
184
|
+
(G) => G === v ? G : v
|
|
168
185
|
);
|
|
169
|
-
|
|
170
|
-
}, S = () => {
|
|
186
|
+
}, _ = () => {
|
|
171
187
|
requestAnimationFrame(() => {
|
|
172
|
-
|
|
188
|
+
R || q();
|
|
173
189
|
});
|
|
174
190
|
};
|
|
175
|
-
|
|
176
|
-
|
|
191
|
+
j.current = _, q(), _(), He && Fe().then((r) => {
|
|
192
|
+
R || (r(e), requestAnimationFrame(() => {
|
|
193
|
+
R || _();
|
|
194
|
+
}));
|
|
177
195
|
}).catch(() => {
|
|
178
|
-
|
|
196
|
+
R || _();
|
|
179
197
|
});
|
|
180
|
-
const
|
|
181
|
-
return
|
|
182
|
-
|
|
183
|
-
|
|
198
|
+
const z = new ResizeObserver(() => q());
|
|
199
|
+
return z.observe(e.body), N && z.observe(N), () => {
|
|
200
|
+
R = !0, z.disconnect(), g && (e.removeEventListener("pointerdown", $, !0), e.removeEventListener("mousedown", ne, !0), e.removeEventListener("touchstart", re, !0)), setTimeout(() => {
|
|
201
|
+
oe.unmount(), B.current = null, j.current = () => {
|
|
184
202
|
};
|
|
185
203
|
}, 0);
|
|
186
204
|
};
|
|
187
|
-
}, []),
|
|
188
|
-
const
|
|
189
|
-
|
|
205
|
+
}, []), d(() => {
|
|
206
|
+
const t = () => {
|
|
207
|
+
we(!!document.fullscreenElement);
|
|
190
208
|
};
|
|
191
|
-
return document.addEventListener("fullscreenchange",
|
|
209
|
+
return document.addEventListener("fullscreenchange", t), () => document.removeEventListener("fullscreenchange", t);
|
|
192
210
|
}, []);
|
|
193
|
-
const
|
|
194
|
-
const
|
|
195
|
-
if (
|
|
211
|
+
const xe = () => {
|
|
212
|
+
const t = W.current || h.current;
|
|
213
|
+
if (t) {
|
|
196
214
|
if (document.fullscreenElement) {
|
|
197
215
|
document.exitFullscreen().catch(() => {
|
|
198
216
|
});
|
|
199
217
|
return;
|
|
200
218
|
}
|
|
201
|
-
|
|
219
|
+
t.requestFullscreen && t.requestFullscreen().catch(() => {
|
|
202
220
|
});
|
|
203
221
|
}
|
|
204
222
|
};
|
|
205
|
-
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
|
|
223
|
+
d(() => {
|
|
224
|
+
const t = B.current;
|
|
225
|
+
t && (t.render(
|
|
226
|
+
/* @__PURE__ */ p.jsx(
|
|
227
|
+
Ae,
|
|
210
228
|
{
|
|
211
|
-
html:
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
hasRootVhHeight: Z,
|
|
219
|
-
mode: h
|
|
229
|
+
html: y,
|
|
230
|
+
styleLoadingText: S,
|
|
231
|
+
scriptLoadingText: b,
|
|
232
|
+
resetToken: Y,
|
|
233
|
+
hasRootVhHeight: te,
|
|
234
|
+
mode: u,
|
|
235
|
+
stretchRootHeight: J
|
|
220
236
|
}
|
|
221
237
|
)
|
|
222
|
-
), requestAnimationFrame(() =>
|
|
238
|
+
), E.current = window.requestAnimationFrame(() => {
|
|
239
|
+
j.current?.(), E.current = null;
|
|
240
|
+
}));
|
|
223
241
|
}, [
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
U,
|
|
230
|
-
h
|
|
242
|
+
y,
|
|
243
|
+
S,
|
|
244
|
+
b,
|
|
245
|
+
Y,
|
|
246
|
+
u
|
|
231
247
|
]);
|
|
232
|
-
const
|
|
248
|
+
const Re = [
|
|
233
249
|
"w-full relative content-render-iframe-sandbox",
|
|
234
|
-
|
|
250
|
+
M ? "h-full overflow-auto flex flex-col" : "aspect-[16/9] overflow-hidden flex items-center justify-center"
|
|
235
251
|
].filter(Boolean).join(" ");
|
|
236
|
-
return /* @__PURE__ */
|
|
252
|
+
return /* @__PURE__ */ p.jsxs(
|
|
237
253
|
"div",
|
|
238
254
|
{
|
|
239
|
-
ref:
|
|
240
|
-
"data-root-vh":
|
|
241
|
-
className:
|
|
255
|
+
ref: W,
|
|
256
|
+
"data-root-vh": te ? "true" : "false",
|
|
257
|
+
className: Re,
|
|
258
|
+
style: x ? {
|
|
259
|
+
height: x,
|
|
260
|
+
minHeight: x
|
|
261
|
+
} : void 0,
|
|
242
262
|
children: [
|
|
243
|
-
!
|
|
263
|
+
!A && /* @__PURE__ */ p.jsx(
|
|
244
264
|
"button",
|
|
245
265
|
{
|
|
246
266
|
type: "button",
|
|
247
|
-
onClick:
|
|
267
|
+
onClick: xe,
|
|
248
268
|
className: "absolute top-2 right-2 z-50 p-1.5 bg-black/75 text-white rounded-md cursor-pointer",
|
|
249
|
-
children:
|
|
269
|
+
children: be ? "退出全屏" : c || "全屏浏览"
|
|
250
270
|
}
|
|
251
271
|
),
|
|
252
|
-
|
|
272
|
+
u === "blackboard" && o === "markdown" ? /* @__PURE__ */ p.jsx(
|
|
253
273
|
"div",
|
|
254
274
|
{
|
|
255
|
-
onMouseDown: () =>
|
|
256
|
-
onPointerDown: () =>
|
|
257
|
-
onTouchStart: () =>
|
|
258
|
-
children: /* @__PURE__ */
|
|
275
|
+
onMouseDown: () => f("mousedown"),
|
|
276
|
+
onPointerDown: () => f("pointerdown"),
|
|
277
|
+
onTouchStart: () => f("touchstart"),
|
|
278
|
+
children: /* @__PURE__ */ p.jsx(Me, { content: s })
|
|
259
279
|
}
|
|
260
|
-
) : /* @__PURE__ */
|
|
280
|
+
) : /* @__PURE__ */ p.jsx(
|
|
261
281
|
"iframe",
|
|
262
282
|
{
|
|
263
|
-
ref:
|
|
283
|
+
ref: h,
|
|
264
284
|
sandbox: "allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox",
|
|
265
285
|
allow: "fullscreen",
|
|
266
286
|
allowFullScreen: !0,
|
|
267
|
-
className: [
|
|
287
|
+
className: [i, "w-full h-full mx-auto my-auto block"].filter(Boolean).join(" "),
|
|
268
288
|
style: {
|
|
269
|
-
height: "100%",
|
|
270
|
-
|
|
289
|
+
height: x ?? "100%",
|
|
290
|
+
minHeight: x,
|
|
291
|
+
margin: "auto",
|
|
292
|
+
visibility: "visible"
|
|
271
293
|
}
|
|
272
294
|
}
|
|
273
295
|
)
|
|
@@ -276,6 +298,6 @@ const pt = () => import("./blackboard-vendor.es.js").then((s) => s.injectBlackbo
|
|
|
276
298
|
);
|
|
277
299
|
};
|
|
278
300
|
export {
|
|
279
|
-
|
|
301
|
+
Ue as default
|
|
280
302
|
};
|
|
281
303
|
//# sourceMappingURL=IframeSandbox.es.js.map
|