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