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