markdown-flow-ui 0.1.100-beta.4 → 0.1.100-beta.40
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/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/_virtual/index.cjs3.js +1 -1
- package/dist/_virtual/index.cjs4.js +1 -1
- 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/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 +184 -160
- package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
- package/dist/components/ContentRender/IframeSandbox.cjs.js +5 -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 +307 -210
- 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 +4 -0
- package/dist/components/ContentRender/SandboxApp.es.js +87 -80
- package/dist/components/ContentRender/SandboxApp.es.js.map +1 -1
- package/dist/components/ContentRender/index.cjs.js +1 -1
- package/dist/components/ContentRender/index.es.js +5 -6
- 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 +68 -64
- package/dist/components/ContentRender/plugins/CustomVariable.es.js.map +1 -1
- 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 +21 -18
- package/dist/components/MarkdownFlow/MarkdownFlow.es.js.map +1 -1
- package/dist/components/Slide/Player.cjs.js +1 -1
- package/dist/components/Slide/Player.cjs.js.map +1 -1
- package/dist/components/Slide/Player.d.ts +3 -2
- package/dist/components/Slide/Player.es.js +228 -170
- package/dist/components/Slide/Player.es.js.map +1 -1
- package/dist/components/Slide/Slide.cjs.js +1 -1
- package/dist/components/Slide/Slide.cjs.js.map +1 -1
- package/dist/components/Slide/Slide.d.ts +10 -0
- package/dist/components/Slide/Slide.es.js +422 -270
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/components/Slide/Slide.stories.d.ts +27 -1
- package/dist/components/Slide/index.d.ts +3 -3
- package/dist/components/Slide/types.d.ts +5 -6
- package/dist/components/Slide/useSlide.cjs.js +1 -1
- package/dist/components/Slide/useSlide.cjs.js.map +1 -1
- package/dist/components/Slide/useSlide.d.ts +4 -1
- package/dist/components/Slide/useSlide.es.js +125 -83
- package/dist/components/Slide/useSlide.es.js.map +1 -1
- 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/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 +4 -2
- 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 +24 -22
- package/dist/lib/interaction-defaults.cjs.js +2 -0
- package/dist/lib/interaction-defaults.cjs.js.map +1 -0
- package/dist/lib/interaction-defaults.es.js +106 -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 +5 -3
- package/dist/renderer.es.js +18 -16
- package/package.json +17 -2
- package/dist/components/Slide/interaction-defaults.cjs.js +0 -2
- package/dist/components/Slide/interaction-defaults.cjs.js.map +0 -1
- package/dist/components/Slide/interaction-defaults.es.js +0 -85
- package/dist/components/Slide/interaction-defaults.es.js.map +0 -1
- package/dist/lib/browserUserActivation.cjs.js +0 -2
- package/dist/lib/browserUserActivation.cjs.js.map +0 -1
- package/dist/lib/browserUserActivation.es.js +0 -13
- package/dist/lib/browserUserActivation.es.js.map +0 -1
- /package/dist/{components/Slide → lib}/interaction-defaults.d.ts +0 -0
|
@@ -1,33 +1,42 @@
|
|
|
1
1
|
import { j as n } from "../../_virtual/jsx-runtime.es.js";
|
|
2
|
-
import { memo as
|
|
3
|
-
import {
|
|
4
|
-
import { cn as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
2
|
+
import { memo as lt, useRef as _, useMemo as c, useState as P, useCallback as i, useEffect as m } from "react";
|
|
3
|
+
import { isSandboxInteractionMessage as st } from "../../lib/sandboxInteraction.es.js";
|
|
4
|
+
import { cn as Q } from "../../lib/utils.es.js";
|
|
5
|
+
import it from "../ContentRender/ContentRender.es.js";
|
|
6
|
+
import Ne from "../ContentRender/IframeSandbox.es.js";
|
|
7
7
|
import "../ui/inputGroup/input-group.es.js";
|
|
8
|
-
import { getInteractionDefaultValues as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
8
|
+
import { getInteractionDefaultValues as ut, getInteractionDefaultSelectedValues as at } from "../../lib/interaction-defaults.es.js";
|
|
9
|
+
import ct from "./Player.es.js";
|
|
10
|
+
import dt from "./useSlide.es.js";
|
|
11
|
+
import ft from "./useWakePlayerFromIframe.es.js";
|
|
12
|
+
import { getPlayerCustomActionCount as mt } from "./utils/playerCustomActions.es.js";
|
|
11
13
|
/* empty css */
|
|
12
|
-
|
|
14
|
+
import pt from "../../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/loader-circle.es.js";
|
|
15
|
+
const ht = 1e3, Be = lt(
|
|
13
16
|
({
|
|
14
|
-
content:
|
|
15
|
-
title:
|
|
16
|
-
defaultButtonText:
|
|
17
|
-
defaultInputText:
|
|
18
|
-
defaultSelectedValues:
|
|
19
|
-
|
|
17
|
+
content: R,
|
|
18
|
+
title: j,
|
|
19
|
+
defaultButtonText: h,
|
|
20
|
+
defaultInputText: z,
|
|
21
|
+
defaultSelectedValues: I,
|
|
22
|
+
confirmButtonText: se,
|
|
23
|
+
copyButtonText: ie,
|
|
24
|
+
copiedButtonText: N,
|
|
25
|
+
onSend: D,
|
|
20
26
|
readonly: B = !1
|
|
21
27
|
}) => /* @__PURE__ */ n.jsxs("div", { className: "slide-player__interaction-card", children: [
|
|
22
|
-
/* @__PURE__ */ n.jsx("div", { className: "slide-player__interaction-header", children: /* @__PURE__ */ n.jsx("p", { className: "slide-player__interaction-title", children:
|
|
28
|
+
/* @__PURE__ */ n.jsx("div", { className: "slide-player__interaction-header", children: /* @__PURE__ */ n.jsx("p", { className: "slide-player__interaction-title", children: j }) }),
|
|
23
29
|
/* @__PURE__ */ n.jsx("div", { className: "slide-player__interaction-body", children: /* @__PURE__ */ n.jsx(
|
|
24
|
-
|
|
30
|
+
it,
|
|
25
31
|
{
|
|
26
|
-
content:
|
|
27
|
-
defaultButtonText:
|
|
28
|
-
defaultInputText:
|
|
29
|
-
defaultSelectedValues:
|
|
30
|
-
|
|
32
|
+
content: R,
|
|
33
|
+
defaultButtonText: h,
|
|
34
|
+
defaultInputText: z,
|
|
35
|
+
defaultSelectedValues: I,
|
|
36
|
+
confirmButtonText: se,
|
|
37
|
+
copyButtonText: ie,
|
|
38
|
+
copiedButtonText: N,
|
|
39
|
+
onSend: D,
|
|
31
40
|
readonly: B,
|
|
32
41
|
enableTypewriter: !1,
|
|
33
42
|
sandboxMode: "content"
|
|
@@ -36,164 +45,273 @@ const Ge = 1e3, pe = Le(
|
|
|
36
45
|
/* @__PURE__ */ n.jsx("div", { className: "slide-player__interaction-arrow" })
|
|
37
46
|
] })
|
|
38
47
|
);
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
Be.displayName = "InteractionOverlayCard";
|
|
49
|
+
const gt = (R, j) => R.length === j.length && R.every((h, z) => {
|
|
50
|
+
const I = j[z];
|
|
51
|
+
return h.sequence_number === I?.sequence_number && h.type === I?.type && h.content === I?.content;
|
|
52
|
+
}), Bt = ({
|
|
53
|
+
elementList: R = [],
|
|
54
|
+
showPlayer: j = !0,
|
|
55
|
+
playerAlwaysVisible: h = !1,
|
|
56
|
+
playerClassName: z,
|
|
57
|
+
playerCustomActions: I,
|
|
58
|
+
bufferingText: se = "Buffering...",
|
|
59
|
+
interactionTitle: ie,
|
|
60
|
+
interactionTexts: N,
|
|
61
|
+
playerAutoHideDelay: D = 3e3,
|
|
62
|
+
interactionDefaultValueOptions: B,
|
|
63
|
+
onSend: fe,
|
|
64
|
+
onPlayerVisibilityChange: ue,
|
|
65
|
+
onStepChange: me,
|
|
66
|
+
className: Fe,
|
|
67
|
+
onPointerDown: pe,
|
|
68
|
+
...Ke
|
|
53
69
|
}) => {
|
|
54
|
-
const
|
|
55
|
-
currentElementList:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
70
|
+
const ae = _(null), ce = _(null), he = _(null), V = _(null), W = _(null), G = _(null), ge = _([]), X = _(!1), F = _(null), {
|
|
71
|
+
currentElementList: b,
|
|
72
|
+
stepElementLists: xe,
|
|
73
|
+
slideElementList: K,
|
|
74
|
+
currentIndex: d,
|
|
75
|
+
audioList: y,
|
|
76
|
+
currentAudioSequenceIndexes: ye,
|
|
77
|
+
currentStepHasSpeakableElement: A,
|
|
78
|
+
currentInteractionElement: u,
|
|
79
|
+
canGoPrev: ke,
|
|
80
|
+
canGoNext: E,
|
|
81
|
+
handlePrev: Se,
|
|
82
|
+
handleNext: T
|
|
83
|
+
} = dt(R), ve = c(() => {
|
|
84
|
+
if (!(d < 0))
|
|
85
|
+
return K[d];
|
|
86
|
+
}, [d, K]), qe = K.filter(
|
|
87
|
+
(e) => e.is_renderable !== !1
|
|
88
|
+
).length === 1, S = j && (K.length > 0 || y.length > 0 || !!u), g = c(
|
|
89
|
+
() => ye.map((e) => y[e]?.audioKey).filter((e) => !!e),
|
|
90
|
+
[y, ye]
|
|
91
|
+
), [Ie, Z] = P(!0), [ee, Y] = P(!1), [v, k] = P(null), [Le, p] = P(!1), [q, be] = P(!1), [l, te] = P(), [ne, J] = P(!1), L = S && (h || Ie), we = c(
|
|
92
|
+
() => mt(I),
|
|
93
|
+
[I]
|
|
94
|
+
), Me = c(
|
|
95
|
+
() => ({
|
|
96
|
+
"--slide-player-custom-action-count": String(we)
|
|
97
|
+
}),
|
|
98
|
+
[we]
|
|
99
|
+
), { mountedStepStates: Oe, currentMountedStateIndex: He } = c(() => {
|
|
100
|
+
const e = [], t = /* @__PURE__ */ new Map();
|
|
101
|
+
return xe.forEach((s, a) => {
|
|
102
|
+
const r = e.findIndex(
|
|
103
|
+
(o) => gt(
|
|
104
|
+
o.elementList,
|
|
105
|
+
s
|
|
106
|
+
)
|
|
107
|
+
);
|
|
108
|
+
if (r >= 0) {
|
|
109
|
+
e[r]?.sourceStepIndexes.push(a), t.set(a, r);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
e.push({
|
|
113
|
+
elementList: s,
|
|
114
|
+
sourceStepIndexes: [a]
|
|
115
|
+
}), t.set(a, e.length - 1);
|
|
116
|
+
}), {
|
|
117
|
+
mountedStepStates: e,
|
|
118
|
+
currentMountedStateIndex: d >= 0 ? t.get(d) ?? -1 : -1
|
|
119
|
+
};
|
|
120
|
+
}, [d, xe]), _e = c(() => String(d), [d]), de = c(() => v ? y.findIndex(
|
|
121
|
+
(e) => (e.audioKey ?? "") === v
|
|
122
|
+
) : -1, [y, v]), re = c(
|
|
123
|
+
() => g[0] ?? "none",
|
|
124
|
+
[g]
|
|
125
|
+
), Ae = c(() => u ? `${u.sequence_number ?? "none"}:${String(
|
|
126
|
+
u.content ?? ""
|
|
127
|
+
)}` : "none", [u]), $e = c(
|
|
128
|
+
() => [_e, Ae].join("|"),
|
|
129
|
+
[Ae, _e]
|
|
130
|
+
), M = !!c(() => !re || re === "none" ? "" : y.find(
|
|
131
|
+
(t) => t.audioKey === re
|
|
132
|
+
)?.audioUrl?.trim() ?? "", [y, re]), C = i(() => {
|
|
133
|
+
V.current !== null && (window.clearTimeout(V.current), V.current = null);
|
|
134
|
+
}, []), w = i(() => {
|
|
135
|
+
G.current !== null && (window.clearTimeout(G.current), G.current = null);
|
|
136
|
+
}, []), O = i(() => {
|
|
137
|
+
W.current !== null && (window.clearTimeout(W.current), W.current = null);
|
|
138
|
+
}, []), H = i(() => {
|
|
139
|
+
O(), w(), k(null), p(!1), be(!1), te(void 0), J(!1);
|
|
140
|
+
}, [O, w]), $ = i(() => {
|
|
141
|
+
const e = g[0];
|
|
142
|
+
return e ? (k(e), !0) : !1;
|
|
143
|
+
}, [g]), oe = i(() => {
|
|
144
|
+
w(), J(!1), !$() && E && T();
|
|
83
145
|
}, [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
]),
|
|
89
|
-
(e =
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
},
|
|
146
|
+
E,
|
|
147
|
+
w,
|
|
148
|
+
T,
|
|
149
|
+
$
|
|
150
|
+
]), f = i(
|
|
151
|
+
(e = ee) => {
|
|
152
|
+
S && (Z(!0), C(), !(h || !e || D <= 0) && (V.current = window.setTimeout(() => {
|
|
153
|
+
Z(!1), V.current = null;
|
|
154
|
+
}, D)));
|
|
93
155
|
},
|
|
94
156
|
[
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
157
|
+
C,
|
|
158
|
+
ee,
|
|
159
|
+
h,
|
|
160
|
+
D,
|
|
161
|
+
S
|
|
100
162
|
]
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
|
|
163
|
+
), Ue = !!(u?.readonly || u?.user_input?.trim()), U = !!u && !Ue;
|
|
164
|
+
m(() => () => {
|
|
165
|
+
O(), C(), w();
|
|
104
166
|
}, [
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
]),
|
|
109
|
-
|
|
110
|
-
}), [
|
|
111
|
-
|
|
112
|
-
}, [
|
|
113
|
-
if (!
|
|
114
|
-
|
|
167
|
+
O,
|
|
168
|
+
w,
|
|
169
|
+
C
|
|
170
|
+
]), m(() => (ue?.(L), () => {
|
|
171
|
+
ue?.(!1);
|
|
172
|
+
}), [ue, L]), m(() => {
|
|
173
|
+
me?.(ve, d);
|
|
174
|
+
}, [d, ve, me]), m(() => {
|
|
175
|
+
if (!S) {
|
|
176
|
+
C(), Z(!1);
|
|
115
177
|
return;
|
|
116
178
|
}
|
|
117
|
-
if (
|
|
118
|
-
|
|
179
|
+
if (h) {
|
|
180
|
+
C(), Z(!0);
|
|
119
181
|
return;
|
|
120
182
|
}
|
|
121
|
-
|
|
183
|
+
ee || f(!0);
|
|
122
184
|
}, [
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
]),
|
|
129
|
-
if (
|
|
130
|
-
|
|
131
|
-
|
|
185
|
+
C,
|
|
186
|
+
ee,
|
|
187
|
+
h,
|
|
188
|
+
S,
|
|
189
|
+
f
|
|
190
|
+
]), m(() => {
|
|
191
|
+
if (typeof window > "u")
|
|
192
|
+
return;
|
|
193
|
+
const e = (t) => {
|
|
194
|
+
t.origin === window.location.origin && st(t.data) && S && (Y(!0), f(!0));
|
|
195
|
+
};
|
|
196
|
+
return window.addEventListener("message", e), () => {
|
|
197
|
+
window.removeEventListener("message", e);
|
|
198
|
+
};
|
|
199
|
+
}, [S, f]), ft({
|
|
200
|
+
sectionRef: ae,
|
|
201
|
+
enabled: S,
|
|
202
|
+
onWake: () => {
|
|
203
|
+
Y(!0), f(!0);
|
|
204
|
+
}
|
|
205
|
+
}), m(() => {
|
|
206
|
+
const e = F.current === d && !!u;
|
|
207
|
+
if (H(), !(b.length === 0 && !u)) {
|
|
208
|
+
if (U || e) {
|
|
209
|
+
te(u), J(!0), F.current = null;
|
|
132
210
|
return;
|
|
133
211
|
}
|
|
134
|
-
if (
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
212
|
+
if (u && (te(u), J(!1), F.current = null), !$()) {
|
|
213
|
+
if (A) {
|
|
214
|
+
p(!0);
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
if (E)
|
|
218
|
+
return W.current = window.setTimeout(() => {
|
|
219
|
+
W.current = null, T();
|
|
220
|
+
}, ht), () => {
|
|
221
|
+
O();
|
|
222
|
+
};
|
|
223
|
+
}
|
|
140
224
|
}
|
|
225
|
+
}, [
|
|
226
|
+
E,
|
|
227
|
+
O,
|
|
228
|
+
b.length,
|
|
229
|
+
u,
|
|
230
|
+
$e,
|
|
231
|
+
A,
|
|
232
|
+
T,
|
|
233
|
+
U,
|
|
234
|
+
H,
|
|
235
|
+
$
|
|
236
|
+
]), m(() => {
|
|
237
|
+
if (!A || U) {
|
|
238
|
+
p(!1);
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
if (q) {
|
|
242
|
+
p(!1);
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
g.length === 0 && p(!0);
|
|
246
|
+
}, [
|
|
247
|
+
g.length,
|
|
248
|
+
A,
|
|
249
|
+
q,
|
|
250
|
+
U
|
|
251
|
+
]), m(() => {
|
|
252
|
+
v || g.length === 0 || !A || U || q || $();
|
|
141
253
|
}, [
|
|
142
254
|
v,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
255
|
+
g,
|
|
256
|
+
A,
|
|
257
|
+
q,
|
|
258
|
+
U,
|
|
259
|
+
$
|
|
260
|
+
]), m(() => {
|
|
261
|
+
!v || de >= 0 || k(null);
|
|
262
|
+
}, [de, v]), m(() => {
|
|
263
|
+
M && p(!1);
|
|
264
|
+
}, [M]);
|
|
265
|
+
const Te = c(() => l ? ut(
|
|
266
|
+
typeof l.content == "string" ? l.content : void 0,
|
|
267
|
+
l.user_input,
|
|
268
|
+
B
|
|
269
|
+
) : {}, [l, B]), ze = c(() => {
|
|
270
|
+
if (l)
|
|
271
|
+
return at(
|
|
272
|
+
typeof l.content == "string" ? l.content : void 0,
|
|
273
|
+
l.user_input,
|
|
274
|
+
B
|
|
158
275
|
);
|
|
159
|
-
}, [
|
|
276
|
+
}, [l, B]), Ee = !!l?.user_input?.trim(), Ce = !!l?.readonly || Ee, Pe = Ce || Ee, De = i(
|
|
160
277
|
(e) => {
|
|
161
|
-
const
|
|
278
|
+
const s = [
|
|
162
279
|
...e.selectedValues ?? [],
|
|
163
280
|
e.inputText?.trim() ?? "",
|
|
164
281
|
e.buttonText?.trim() ?? ""
|
|
165
282
|
].filter(Boolean).join(", ");
|
|
166
|
-
|
|
167
|
-
...
|
|
168
|
-
user_input:
|
|
169
|
-
}),
|
|
283
|
+
te((a) => !a || !s ? a : {
|
|
284
|
+
...a,
|
|
285
|
+
user_input: s
|
|
286
|
+
}), fe?.(e, l), oe();
|
|
170
287
|
},
|
|
171
|
-
[
|
|
288
|
+
[l, oe, fe]
|
|
172
289
|
);
|
|
173
|
-
|
|
174
|
-
if (
|
|
175
|
-
return
|
|
176
|
-
|
|
290
|
+
m(() => {
|
|
291
|
+
if (w(), !(!ne || !Pe))
|
|
292
|
+
return G.current = window.setTimeout(() => {
|
|
293
|
+
G.current = null, oe();
|
|
177
294
|
}, 2e3), () => {
|
|
178
|
-
|
|
295
|
+
w();
|
|
179
296
|
};
|
|
180
297
|
}, [
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
298
|
+
w,
|
|
299
|
+
oe,
|
|
300
|
+
ne,
|
|
301
|
+
Pe
|
|
185
302
|
]);
|
|
186
|
-
const
|
|
187
|
-
|
|
303
|
+
const Ve = (e, t = {}) => e ? e.type === "slot" ? /* @__PURE__ */ n.jsx(n.Fragment, { children: e.content }) : e.type === "html" ? /* @__PURE__ */ n.jsx(
|
|
304
|
+
Ne,
|
|
188
305
|
{
|
|
189
306
|
className: "content-render-iframe",
|
|
190
307
|
hideFullScreen: !0,
|
|
191
308
|
mode: "blackboard",
|
|
309
|
+
replaceRootScreenHeightWithFull: t.replaceRootScreenHeightWithFull,
|
|
192
310
|
type: "sandbox",
|
|
193
311
|
content: e.content
|
|
194
312
|
}
|
|
195
313
|
) : /* @__PURE__ */ n.jsx(
|
|
196
|
-
|
|
314
|
+
Ne,
|
|
197
315
|
{
|
|
198
316
|
className: "content-render-iframe",
|
|
199
317
|
hideFullScreen: !0,
|
|
@@ -201,34 +319,36 @@ const lt = ({
|
|
|
201
319
|
type: "markdown",
|
|
202
320
|
content: e.content
|
|
203
321
|
}
|
|
204
|
-
) : null,
|
|
322
|
+
) : null, We = (e = [], t = !1) => {
|
|
205
323
|
if (e.length === 0)
|
|
206
324
|
return null;
|
|
207
|
-
const
|
|
208
|
-
(r) => r.
|
|
209
|
-
).length,
|
|
210
|
-
(r,
|
|
325
|
+
const s = e.filter(
|
|
326
|
+
(r) => r.is_renderable !== !1
|
|
327
|
+
).length, a = e.reduce(
|
|
328
|
+
(r, o, x) => o.is_renderable !== !1 ? x : r,
|
|
211
329
|
-1
|
|
212
330
|
);
|
|
213
|
-
return /* @__PURE__ */ n.jsx("div", { className: "slide-stage__content flex w-full flex-col gap-4", children: e.map((r,
|
|
214
|
-
const
|
|
331
|
+
return /* @__PURE__ */ n.jsx("div", { className: "slide-stage__content flex w-full flex-col gap-4", children: e.map((r, o) => {
|
|
332
|
+
const x = r.type === "html" && r.is_renderable === !1;
|
|
215
333
|
return /* @__PURE__ */ n.jsx(
|
|
216
334
|
"div",
|
|
217
335
|
{
|
|
218
|
-
ref:
|
|
219
|
-
"aria-hidden":
|
|
220
|
-
className:
|
|
336
|
+
ref: t && o === a ? he : null,
|
|
337
|
+
"aria-hidden": x || void 0,
|
|
338
|
+
className: Q(
|
|
221
339
|
"w-full shrink-0",
|
|
222
|
-
|
|
223
|
-
|
|
340
|
+
s === 1 && r.is_renderable !== !1 && "slide-element--single",
|
|
341
|
+
x ? "pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0" : r.is_renderable === !1 && "hidden"
|
|
224
342
|
),
|
|
225
|
-
children:
|
|
343
|
+
children: Ve(r, {
|
|
344
|
+
replaceRootScreenHeightWithFull: s === 1 && r.type === "html" && r.is_renderable !== !1
|
|
345
|
+
})
|
|
226
346
|
},
|
|
227
|
-
r.
|
|
347
|
+
r.sequence_number ?? `${r.type}-${o}`
|
|
228
348
|
);
|
|
229
349
|
}) });
|
|
230
|
-
},
|
|
231
|
-
const e =
|
|
350
|
+
}, Ge = () => {
|
|
351
|
+
const e = ae.current;
|
|
232
352
|
if (e) {
|
|
233
353
|
if (document.fullscreenElement) {
|
|
234
354
|
document.exitFullscreen().catch(() => {
|
|
@@ -238,168 +358,200 @@ const lt = ({
|
|
|
238
358
|
e.requestFullscreen?.().catch(() => {
|
|
239
359
|
});
|
|
240
360
|
}
|
|
241
|
-
},
|
|
242
|
-
const e =
|
|
361
|
+
}, Re = i(() => {
|
|
362
|
+
const e = ce.current;
|
|
243
363
|
e && e.scrollTo({
|
|
244
364
|
top: e.scrollHeight,
|
|
245
365
|
behavior: "smooth"
|
|
246
366
|
});
|
|
247
|
-
}, []),
|
|
248
|
-
|
|
249
|
-
}, [
|
|
250
|
-
|
|
251
|
-
}, [
|
|
367
|
+
}, []), Ye = i(() => {
|
|
368
|
+
X.current = !0, F.current = null, Y(!0), p(!1), f(!0), H(), Se();
|
|
369
|
+
}, [Se, H, f]), Je = i(() => {
|
|
370
|
+
X.current = !0, F.current = null, Y(!0), p(!1), f(!0), H(), T();
|
|
371
|
+
}, [T, H, f]), Qe = i(
|
|
372
|
+
(e) => {
|
|
373
|
+
if (M) {
|
|
374
|
+
p(!1);
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
if (!A || q) {
|
|
378
|
+
p(!1);
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
p(e);
|
|
382
|
+
},
|
|
383
|
+
[
|
|
384
|
+
A,
|
|
385
|
+
q,
|
|
386
|
+
M
|
|
387
|
+
]
|
|
388
|
+
), Xe = i(
|
|
252
389
|
(e) => {
|
|
253
|
-
|
|
390
|
+
const t = y[e]?.audioKey;
|
|
391
|
+
if (!t || !v || t !== v)
|
|
254
392
|
return;
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
|
|
393
|
+
const s = g.findIndex(
|
|
394
|
+
(o) => o === t
|
|
395
|
+
);
|
|
396
|
+
if (s < 0) {
|
|
397
|
+
k(null);
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
const a = s + 1, r = g[a];
|
|
401
|
+
if (r) {
|
|
402
|
+
k(r);
|
|
258
403
|
return;
|
|
259
404
|
}
|
|
260
|
-
|
|
405
|
+
if (k(null), be(!0), p(!1), E) {
|
|
406
|
+
const o = d + 1, x = K[o];
|
|
407
|
+
M && x?.type === "interaction" && (F.current = o), T();
|
|
408
|
+
}
|
|
261
409
|
},
|
|
262
410
|
[
|
|
411
|
+
y,
|
|
412
|
+
E,
|
|
413
|
+
d,
|
|
263
414
|
v,
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
415
|
+
g,
|
|
416
|
+
T,
|
|
417
|
+
M,
|
|
418
|
+
K
|
|
267
419
|
]
|
|
268
|
-
),
|
|
269
|
-
|
|
270
|
-
}, [
|
|
420
|
+
), Ze = i(() => {
|
|
421
|
+
l && J((e) => !e);
|
|
422
|
+
}, [l]), je = i(
|
|
271
423
|
(e) => {
|
|
272
|
-
e.stopPropagation(),
|
|
424
|
+
e.stopPropagation(), L && f(!0);
|
|
273
425
|
},
|
|
274
|
-
[
|
|
275
|
-
),
|
|
426
|
+
[Ie, f]
|
|
427
|
+
), et = i(
|
|
276
428
|
(e) => {
|
|
277
|
-
|
|
429
|
+
pe?.(e), Y(!0), f(!0);
|
|
278
430
|
},
|
|
279
|
-
[
|
|
280
|
-
),
|
|
281
|
-
() =>
|
|
282
|
-
(e,
|
|
431
|
+
[pe, f]
|
|
432
|
+
), tt = !!l && ne, le = c(
|
|
433
|
+
() => b.map(
|
|
434
|
+
(e, t) => `${e.sequence_number ?? `${e.type}-${t}`}:${String(e.is_new ?? "")}`
|
|
283
435
|
),
|
|
284
|
-
[
|
|
285
|
-
)
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
(
|
|
289
|
-
) ? o : [...o, { ...e, is_show: !1 }];
|
|
290
|
-
}, [o, x, j]);
|
|
291
|
-
return h(() => {
|
|
292
|
-
const e = se.current, r = (e.length > 0 && e.length < K.length && e.every((l, U) => l === K[U]) ? o.slice(e.length) : []).some(
|
|
293
|
-
(l) => l.operation === "append"
|
|
436
|
+
[b]
|
|
437
|
+
);
|
|
438
|
+
return m(() => {
|
|
439
|
+
const e = ge.current, a = (e.length > 0 && e.length < le.length && e.every((o, x) => o === le[x]) ? b.slice(e.length) : []).some(
|
|
440
|
+
(o) => o.is_new === !1
|
|
294
441
|
);
|
|
295
|
-
if (
|
|
442
|
+
if (ge.current = le, !a)
|
|
296
443
|
return;
|
|
297
|
-
const
|
|
298
|
-
const
|
|
299
|
-
if (!
|
|
444
|
+
const r = window.requestAnimationFrame(() => {
|
|
445
|
+
const o = ce.current, x = he.current;
|
|
446
|
+
if (!o || !x)
|
|
300
447
|
return;
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
top: Math.max(
|
|
448
|
+
const nt = o.getBoundingClientRect(), rt = x.getBoundingClientRect(), ot = o.scrollTop + (rt.top - nt.top);
|
|
449
|
+
o.scrollTo({
|
|
450
|
+
top: Math.max(ot, 0),
|
|
304
451
|
behavior: "smooth"
|
|
305
452
|
});
|
|
306
453
|
});
|
|
307
454
|
return () => {
|
|
308
|
-
window.cancelAnimationFrame(
|
|
455
|
+
window.cancelAnimationFrame(r);
|
|
309
456
|
};
|
|
310
|
-
}, [
|
|
311
|
-
if (!
|
|
457
|
+
}, [b, le]), m(() => {
|
|
458
|
+
if (!X.current || (X.current = !1, b.length === 0))
|
|
312
459
|
return;
|
|
313
460
|
const e = window.requestAnimationFrame(() => {
|
|
314
|
-
|
|
461
|
+
Re();
|
|
315
462
|
});
|
|
316
463
|
return () => {
|
|
317
464
|
window.cancelAnimationFrame(e);
|
|
318
465
|
};
|
|
319
|
-
}, [
|
|
320
|
-
"currentElement",
|
|
321
|
-
o.at(-1),
|
|
322
|
-
o,
|
|
323
|
-
a,
|
|
324
|
-
X,
|
|
325
|
-
w,
|
|
326
|
-
I,
|
|
327
|
-
t,
|
|
328
|
-
R
|
|
329
|
-
), /* @__PURE__ */ n.jsxs(
|
|
466
|
+
}, [b, Re]), /* @__PURE__ */ n.jsxs(
|
|
330
467
|
"section",
|
|
331
468
|
{
|
|
332
|
-
ref:
|
|
333
|
-
className:
|
|
334
|
-
onPointerDown:
|
|
335
|
-
...
|
|
469
|
+
ref: ae,
|
|
470
|
+
className: Q("relative h-full w-full", Fe),
|
|
471
|
+
onPointerDown: et,
|
|
472
|
+
...Ke,
|
|
336
473
|
children: [
|
|
337
|
-
/* @__PURE__ */ n.
|
|
474
|
+
/* @__PURE__ */ n.jsx(
|
|
338
475
|
"div",
|
|
339
476
|
{
|
|
340
|
-
className:
|
|
477
|
+
className: Q(
|
|
341
478
|
"h-full min-h-0 w-full",
|
|
342
|
-
|
|
479
|
+
qe ? "slide-content--single" : "grid gap-4"
|
|
343
480
|
),
|
|
344
|
-
children:
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
"
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
481
|
+
children: b.length > 0 ? /* @__PURE__ */ n.jsx("div", { className: "slide-stage", children: /* @__PURE__ */ n.jsx("div", { ref: ce, className: "slide-stage__layer w-full", children: Oe.map(
|
|
482
|
+
(e, t) => {
|
|
483
|
+
const s = t === He;
|
|
484
|
+
return /* @__PURE__ */ n.jsx(
|
|
485
|
+
"div",
|
|
486
|
+
{
|
|
487
|
+
"aria-hidden": !s || void 0,
|
|
488
|
+
className: "w-full h-full",
|
|
489
|
+
style: { display: s ? void 0 : "none" },
|
|
490
|
+
children: We(
|
|
491
|
+
e.elementList,
|
|
492
|
+
s
|
|
493
|
+
)
|
|
494
|
+
},
|
|
495
|
+
e.sourceStepIndexes[0] ?? t
|
|
496
|
+
);
|
|
497
|
+
}
|
|
498
|
+
) }) }) : null
|
|
356
499
|
}
|
|
357
500
|
),
|
|
358
|
-
|
|
501
|
+
Le ? /* @__PURE__ */ n.jsxs("div", { className: "pointer-events-none absolute left-1/2 top-1/2 z-[3] flex size-28 -translate-x-1/2 -translate-y-1/2 flex-col items-center justify-center gap-2 rounded-2xl bg-foreground/65 px-3 py-4 text-center text-xs leading-4 font-medium text-background shadow-lg backdrop-blur-sm", children: [
|
|
502
|
+
/* @__PURE__ */ n.jsx(pt, { className: "size-5 animate-spin text-background" }),
|
|
503
|
+
/* @__PURE__ */ n.jsx("span", { children: se })
|
|
504
|
+
] }) : null,
|
|
505
|
+
tt ? /* @__PURE__ */ n.jsx(
|
|
359
506
|
"div",
|
|
360
507
|
{
|
|
361
|
-
className:
|
|
508
|
+
className: Q(
|
|
362
509
|
"slide-interaction-overlay",
|
|
363
|
-
|
|
510
|
+
L && S ? "slide-interaction-overlay--with-player" : "slide-interaction-overlay--standalone"
|
|
364
511
|
),
|
|
365
|
-
onClick:
|
|
366
|
-
onPointerDown:
|
|
512
|
+
onClick: je,
|
|
513
|
+
onPointerDown: je,
|
|
514
|
+
style: Me,
|
|
367
515
|
children: /* @__PURE__ */ n.jsx(
|
|
368
|
-
|
|
516
|
+
Be,
|
|
369
517
|
{
|
|
370
|
-
content: String(
|
|
371
|
-
defaultButtonText:
|
|
372
|
-
defaultInputText:
|
|
373
|
-
defaultSelectedValues:
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
518
|
+
content: String(l?.content ?? ""),
|
|
519
|
+
defaultButtonText: Te.buttonText ?? "",
|
|
520
|
+
defaultInputText: Te.inputText ?? "",
|
|
521
|
+
defaultSelectedValues: ze,
|
|
522
|
+
confirmButtonText: N?.confirmButtonText,
|
|
523
|
+
copyButtonText: N?.copyButtonText,
|
|
524
|
+
copiedButtonText: N?.copiedButtonText,
|
|
525
|
+
onSend: De,
|
|
526
|
+
readonly: Ce,
|
|
527
|
+
title: N?.title ?? ie ?? "Submit the content below to continue."
|
|
377
528
|
}
|
|
378
529
|
)
|
|
379
530
|
}
|
|
380
531
|
) : null,
|
|
381
|
-
|
|
382
|
-
|
|
532
|
+
S ? /* @__PURE__ */ n.jsx(
|
|
533
|
+
ct,
|
|
383
534
|
{
|
|
384
|
-
audioList:
|
|
385
|
-
className:
|
|
535
|
+
audioList: y,
|
|
536
|
+
className: Q(
|
|
386
537
|
"absolute left-1/2 bottom-6 z-[2] -translate-x-1/2",
|
|
387
|
-
|
|
388
|
-
!
|
|
538
|
+
z,
|
|
539
|
+
!L && "pointer-events-none opacity-0"
|
|
389
540
|
),
|
|
390
|
-
currentAudioIndex:
|
|
391
|
-
defaultPlaying:
|
|
392
|
-
hasInteraction: !!
|
|
393
|
-
isInteractionOpen:
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
onNext:
|
|
400
|
-
onPrev:
|
|
401
|
-
prevDisabled: !
|
|
402
|
-
showControls:
|
|
541
|
+
currentAudioIndex: de,
|
|
542
|
+
defaultPlaying: !0,
|
|
543
|
+
hasInteraction: !!l,
|
|
544
|
+
isInteractionOpen: ne,
|
|
545
|
+
onLoadingChange: Qe,
|
|
546
|
+
nextDisabled: !E,
|
|
547
|
+
onEnded: Xe,
|
|
548
|
+
onFullscreen: Ge,
|
|
549
|
+
onInteractionToggle: Ze,
|
|
550
|
+
onNext: Je,
|
|
551
|
+
onPrev: Ye,
|
|
552
|
+
prevDisabled: !ke,
|
|
553
|
+
showControls: L,
|
|
554
|
+
customActions: I
|
|
403
555
|
}
|
|
404
556
|
) : null
|
|
405
557
|
]
|
|
@@ -407,6 +559,6 @@ const lt = ({
|
|
|
407
559
|
);
|
|
408
560
|
};
|
|
409
561
|
export {
|
|
410
|
-
|
|
562
|
+
Bt as default
|
|
411
563
|
};
|
|
412
564
|
//# sourceMappingURL=Slide.es.js.map
|