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.
Files changed (49) hide show
  1. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/hast-util-to-jsx-runtime@2.3.6/node_modules/hast-util-to-jsx-runtime/lib/index.cjs.js +1 -1
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.cjs.js +1 -1
  12. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.es.js +1 -1
  13. package/dist/_virtual/index.cjs4.js +1 -1
  14. package/dist/_virtual/index.cjs5.js +1 -1
  15. package/dist/_virtual/index.cjs6.js +1 -1
  16. package/dist/_virtual/index.es4.js +4 -4
  17. package/dist/_virtual/index.es5.js +4 -4
  18. package/dist/_virtual/index.es6.js +5 -5
  19. package/dist/assets/markdown-flow-ui.css +1 -1
  20. package/dist/components/ContentRender/IframeSandbox.cjs.js +4 -4
  21. package/dist/components/ContentRender/IframeSandbox.cjs.js.map +1 -1
  22. package/dist/components/ContentRender/IframeSandbox.d.ts +1 -0
  23. package/dist/components/ContentRender/IframeSandbox.es.js +237 -199
  24. package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -1
  25. package/dist/components/ContentRender/SandboxApp.cjs.js +2 -2
  26. package/dist/components/ContentRender/SandboxApp.cjs.js.map +1 -1
  27. package/dist/components/ContentRender/SandboxApp.d.ts +1 -0
  28. package/dist/components/ContentRender/SandboxApp.es.js +70 -66
  29. package/dist/components/ContentRender/SandboxApp.es.js.map +1 -1
  30. package/dist/components/Slide/Player.cjs.js +1 -1
  31. package/dist/components/Slide/Player.cjs.js.map +1 -1
  32. package/dist/components/Slide/Player.d.ts +1 -0
  33. package/dist/components/Slide/Player.es.js +157 -151
  34. package/dist/components/Slide/Player.es.js.map +1 -1
  35. package/dist/components/Slide/Slide.cjs.js +1 -1
  36. package/dist/components/Slide/Slide.cjs.js.map +1 -1
  37. package/dist/components/Slide/Slide.d.ts +1 -0
  38. package/dist/components/Slide/Slide.es.js +325 -266
  39. package/dist/components/Slide/Slide.es.js.map +1 -1
  40. package/dist/components/Slide/Slide.stories.d.ts +2 -0
  41. package/dist/components/Slide/useSlide.cjs.js +1 -1
  42. package/dist/components/Slide/useSlide.cjs.js.map +1 -1
  43. package/dist/components/Slide/useSlide.d.ts +1 -0
  44. package/dist/components/Slide/useSlide.es.js +109 -87
  45. package/dist/components/Slide/useSlide.es.js.map +1 -1
  46. package/dist/components/ui/inputGroup/textarea.cjs.js +1 -1
  47. package/dist/components/ui/inputGroup/textarea.es.js +1 -1
  48. package/dist/markdown-flow-ui-lib.css +1 -1
  49. 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 Ve, useRef as v, useMemo as O, useState as y, useCallback as i, useEffect as h } from "react";
3
- import { hasBrowserUserActivation as ze } from "../../lib/browserUserActivation.es.js";
4
- import { isSandboxInteractionMessage as Ge } from "../../lib/sandboxInteraction.es.js";
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 We from "../ContentRender/ContentRender.es.js";
7
- import ye from "../ContentRender/IframeSandbox.es.js";
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 Ye, getInteractionDefaultSelectedValues as Je } from "../../lib/interaction-defaults.es.js";
10
- import Qe from "./Player.es.js";
11
- import Xe from "./useSlide.es.js";
12
- import Ze from "./useWakePlayerFromIframe.es.js";
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
- const et = 1e3, we = Ve(
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: b,
17
- title: _,
17
+ content: A,
18
+ title: E,
18
19
  defaultButtonText: u,
19
- defaultInputText: j,
20
- defaultSelectedValues: w,
21
- confirmButtonText: T,
22
- copyButtonText: R,
23
- copiedButtonText: P,
24
- onSend: D,
25
- readonly: B = !1
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
- We,
30
+ ot,
30
31
  {
31
- content: b,
32
+ content: A,
32
33
  defaultButtonText: u,
33
- defaultInputText: j,
34
- defaultSelectedValues: w,
35
- confirmButtonText: T,
36
- copyButtonText: R,
37
- copiedButtonText: P,
38
- onSend: D,
39
- readonly: B,
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
- we.displayName = "InteractionOverlayCard";
48
- const tt = (b, _) => b.length === _.length && b.every((u, j) => {
49
- const w = _[j];
50
- return u.sequence_number === w?.sequence_number && u.type === w?.type && u.content === w?.content;
51
- }), xt = ({
52
- elementList: b = [],
53
- showPlayer: _ = !0,
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: j,
56
- interactionTitle: w,
57
- interactionTexts: T,
58
- playerAutoHideDelay: R = 3e3,
59
- interactionDefaultValueOptions: P,
60
- onSend: D,
61
- onPlayerVisibilityChange: B,
62
- onStepChange: oe,
63
- className: Ie,
64
- onPointerDown: se,
65
- ...Se
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 ee = v(null), te = v(null), le = v(null), C = v(null), q = v(null), F = v(null), ie = v([]), H = v(!1), {
68
- currentElementList: f,
69
- stepElementLists: ae,
70
- slideElementList: K,
71
- currentIndex: x,
72
- audioList: ce,
73
- currentAudioSequenceIndexes: k,
74
- currentInteractionElement: M,
75
- canGoPrev: be,
76
- canGoNext: I,
77
- handlePrev: ue,
78
- handleNext: g
79
- } = Xe(b), de = O(() => {
80
- if (!(x < 0))
81
- return K[x];
82
- }, [x, K]), _e = K.filter(
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, d = _ && (K.length > 0 || ce.length > 0 || !!M), [fe, U] = y(!0), [V, L] = y(!1), [Te, ne] = y(!1), [Pe] = y(() => ze()), Ee = Pe || Te, [Ae, z] = y(-1), [G, W] = y(-1), [n, re] = y(), [Y, J] = y(!1), E = d && (u || fe), S = i(() => {
85
- C.current !== null && (window.clearTimeout(C.current), C.current = null);
86
- }, []), m = i(() => {
87
- F.current !== null && (window.clearTimeout(F.current), F.current = null);
88
- }, []), A = i(() => {
89
- q.current !== null && (window.clearTimeout(q.current), q.current = null);
90
- }, []), N = i(() => {
91
- A(), m(), z(-1), W(-1), re(void 0), J(!1);
92
- }, [A, m]), Q = i(() => {
93
- const e = k[0];
94
- return typeof e != "number" ? !1 : (W(0), z(e), !0);
95
- }, [k]), X = i(() => {
96
- m(), J(!1), !Q() && I && g();
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
- I,
99
- m,
100
- g,
101
- Q
102
- ]), a = i(
103
- (e = V) => {
104
- d && (U(!0), S(), !(u || !e || R <= 0) && (C.current = window.setTimeout(() => {
105
- U(!1), C.current = null;
106
- }, R)));
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
- S,
110
- V,
149
+ P,
150
+ W,
111
151
  u,
112
- R,
113
- d
152
+ F,
153
+ f
114
154
  ]
115
155
  );
116
156
  h(() => () => {
117
- A(), S(), m();
157
+ B(), P(), y();
118
158
  }, [
119
- A,
120
- m,
121
- S
122
- ]), h(() => (B?.(E), () => {
123
- B?.(!1);
124
- }), [B, E]), h(() => {
125
- oe?.(de, x);
126
- }, [x, de, oe]), h(() => {
127
- if (!d) {
128
- S(), U(!1);
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
- S(), U(!0);
172
+ P(), V(!0);
133
173
  return;
134
174
  }
135
- V || a(!0);
175
+ W || a(!0);
136
176
  }, [
137
- S,
138
- V,
177
+ P,
178
+ W,
139
179
  u,
140
- d,
180
+ f,
141
181
  a
142
182
  ]), h(() => {
143
183
  if (typeof window > "u")
144
184
  return;
145
- const e = (r) => {
146
- r.origin === window.location.origin && Ge(r.data) && d && (L(!0), a(!0));
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
- }, [d, a]), Ze({
152
- sectionRef: ee,
153
- enabled: d,
191
+ }, [f, a]), ct({
192
+ sectionRef: oe,
193
+ enabled: f,
154
194
  onWake: () => {
155
- L(!0), a(!0);
195
+ O(!0), a(!0);
156
196
  }
157
197
  }), h(() => {
158
- if (N(), !(f.length === 0 && !M)) {
159
- if (M) {
160
- re(M), J(!0);
198
+ if (k(), !(x.length === 0 && !d)) {
199
+ if (d) {
200
+ ie(d), X(!0);
161
201
  return;
162
202
  }
163
- if (!Q() && I)
164
- return q.current = window.setTimeout(() => {
165
- q.current = null, g();
166
- }, et), () => {
167
- A();
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
- I,
172
- A,
173
- f,
174
- M,
175
- g,
217
+ T,
218
+ B,
219
+ x.length,
220
+ d,
221
+ He,
176
222
  N,
177
- Q
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 me = O(() => n ? Ye(
180
- typeof n.content == "string" ? n.content : void 0,
181
- n.user_input,
182
- P
183
- ) : {}, [n, P]), Ne = O(() => {
184
- if (n)
185
- return Je(
186
- typeof n.content == "string" ? n.content : void 0,
187
- n.user_input,
188
- P
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
- }, [n, P]), pe = !!n?.user_input?.trim(), he = !!n?.readonly || pe, xe = he || pe, je = i(
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
- re((c) => !c || !s ? c : {
260
+ ie((c) => !c || !s ? c : {
198
261
  ...c,
199
262
  user_input: s
200
- }), D?.(e, n), X();
263
+ }), K?.(e, r), ee();
201
264
  },
202
- [n, X, D]
265
+ [r, ee, K]
203
266
  );
204
267
  h(() => {
205
- if (m(), !(!Y || !xe))
206
- return F.current = window.setTimeout(() => {
207
- F.current = null, X();
268
+ if (y(), !(!Q || !Te))
269
+ return H.current = window.setTimeout(() => {
270
+ H.current = null, ee();
208
271
  }, 2e3), () => {
209
- m();
272
+ y();
210
273
  };
211
274
  }, [
212
- m,
213
- X,
214
- Y,
215
- xe
275
+ y,
276
+ ee,
277
+ Q,
278
+ Te
216
279
  ]);
217
- const Re = (e) => e ? e.type === "slot" ? /* @__PURE__ */ t.jsx(t.Fragment, { children: e.content }) : e.type === "html" ? /* @__PURE__ */ t.jsx(
218
- ye,
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
- ye,
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, Be = (e = [], r = !1) => {
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, l, p) => l.is_renderable !== !1 ? p : 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, l) => {
245
- const p = o.type === "html" && o.is_renderable === !1;
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: r && l === c ? le : null,
250
- "aria-hidden": p || void 0,
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
- p ? "pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0" : o.is_renderable === !1 && "hidden"
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: Re(o)
320
+ children: Ke(o, {
321
+ replaceRootScreenHeightWithFull: s === 1 && o.type === "html" && o.is_renderable !== !1
322
+ })
257
323
  },
258
- o.sequence_number ?? `${o.type}-${l}`
324
+ o.sequence_number ?? `${o.type}-${i}`
259
325
  );
260
326
  }) });
261
- }, { mountedStepStates: Ce, currentMountedStateIndex: qe } = O(() => {
262
- const e = [], r = /* @__PURE__ */ new Map();
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
- }, ge = i(() => {
294
- const e = te.current;
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
- }, []), ke = i(() => {
300
- H.current = !0, L(!0), ne(!0), a(!0), N(), ue();
301
- }, [ue, N, a]), Me = i(() => {
302
- H.current = !0, L(!0), ne(!0), a(!0), N(), g();
303
- }, [g, N, a]), Le = i(
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 || k[G] !== e)
359
+ if (G < 0 || g[G] !== e)
306
360
  return;
307
- const r = G + 1, s = k[r];
361
+ const n = G + 1, s = g[n];
308
362
  if (typeof s == "number") {
309
- W(r), z(s);
363
+ Y(n), U(s);
310
364
  return;
311
365
  }
312
- z(-1), W(-1), I && g();
366
+ U(-1), Y(-1), ve(!0), m(!1), T && b();
313
367
  },
314
368
  [
315
- I,
316
- k,
369
+ T,
370
+ g,
317
371
  G,
318
- g
372
+ b
319
373
  ]
320
- ), Oe = i(() => {
321
- n && J((e) => !e);
322
- }, [n]), ve = i(
374
+ ), Ye = l(() => {
375
+ r && X((e) => !e);
376
+ }, [r]), Ae = l(
323
377
  (e) => {
324
- e.stopPropagation(), E && a(!0);
378
+ e.stopPropagation(), C && a(!0);
325
379
  },
326
- [fe, a]
327
- ), $e = i(
380
+ [ge, a]
381
+ ), Je = l(
328
382
  (e) => {
329
- se?.(e), L(!0), a(!0);
383
+ ue?.(e), O(!0), a(!0);
330
384
  },
331
- [se, a]
332
- ), De = !!n && Y, Z = O(
333
- () => f.map(
334
- (e, r) => `${e.sequence_number ?? `${e.type}-${r}`}:${String(e.is_new ?? "")}`
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
- [f]
390
+ [x]
337
391
  );
338
392
  return h(() => {
339
- const e = ie.current, c = (e.length > 0 && e.length < Z.length && e.every((l, p) => l === Z[p]) ? f.slice(e.length) : []).some(
340
- (l) => l.is_new === !1
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 (ie.current = Z, !c)
396
+ if (fe.current = te, !c)
343
397
  return;
344
398
  const o = window.requestAnimationFrame(() => {
345
- const l = te.current, p = le.current;
346
- if (!l || !p)
399
+ const i = se.current, v = de.current;
400
+ if (!i || !v)
347
401
  return;
348
- const He = l.getBoundingClientRect(), Ke = p.getBoundingClientRect(), Ue = l.scrollTop + (Ke.top - He.top);
349
- l.scrollTo({
350
- top: Math.max(Ue, 0),
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
- }, [f, Z]), h(() => {
358
- if (!H.current || (H.current = !1, f.length === 0))
411
+ }, [x, te]), h(() => {
412
+ if (!z.current || (z.current = !1, x.length === 0))
359
413
  return;
360
414
  const e = window.requestAnimationFrame(() => {
361
- ge();
415
+ Pe();
362
416
  });
363
417
  return () => {
364
418
  window.cancelAnimationFrame(e);
365
419
  };
366
- }, [f, ge]), /* @__PURE__ */ t.jsxs(
420
+ }, [x, Pe]), /* @__PURE__ */ t.jsxs(
367
421
  "section",
368
422
  {
369
- ref: ee,
370
- className: $("relative h-full w-full", Ie),
371
- onPointerDown: $e,
372
- ...Se,
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
- _e ? "slide-content--single" : "grid gap-4"
433
+ Be ? "slide-content--single" : "grid gap-4"
380
434
  ),
381
- children: f.length > 0 ? /* @__PURE__ */ t.jsx("div", { className: "slide-stage", children: /* @__PURE__ */ t.jsx("div", { ref: te, className: "slide-stage__layer w-full", children: Ce.map(
382
- (e, r) => {
383
- const s = r === qe;
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: Be(
444
+ children: ze(
391
445
  e.elementList,
392
446
  s
393
447
  )
394
448
  },
395
- e.sourceStepIndexes[0] ?? r
449
+ e.sourceStepIndexes[0] ?? n
396
450
  );
397
451
  }
398
452
  ) }) }) : null
399
453
  }
400
454
  ),
401
- De ? /* @__PURE__ */ t.jsx(
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
- E && d ? "slide-interaction-overlay--with-player" : "slide-interaction-overlay--standalone"
464
+ C && f ? "slide-interaction-overlay--with-player" : "slide-interaction-overlay--standalone"
407
465
  ),
408
- onClick: ve,
409
- onPointerDown: ve,
466
+ onClick: Ae,
467
+ onPointerDown: Ae,
410
468
  children: /* @__PURE__ */ t.jsx(
411
- we,
469
+ je,
412
470
  {
413
- content: String(n?.content ?? ""),
414
- defaultButtonText: me.buttonText ?? "",
415
- defaultInputText: me.inputText ?? "",
416
- defaultSelectedValues: Ne,
417
- confirmButtonText: T?.confirmButtonText,
418
- copyButtonText: T?.copyButtonText,
419
- copiedButtonText: T?.copiedButtonText,
420
- onSend: je,
421
- readonly: he,
422
- title: T?.title ?? w ?? "Submit the content below to continue."
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
- d ? /* @__PURE__ */ t.jsx(
428
- Qe,
485
+ f ? /* @__PURE__ */ t.jsx(
486
+ it,
429
487
  {
430
- audioList: ce,
488
+ audioList: pe,
431
489
  className: $(
432
490
  "absolute left-1/2 bottom-6 z-[2] -translate-x-1/2",
433
- j,
434
- !E && "pointer-events-none opacity-0"
491
+ q,
492
+ !C && "pointer-events-none opacity-0"
435
493
  ),
436
- currentAudioIndex: Ae,
437
- defaultPlaying: Ee,
438
- hasInteraction: !!n,
439
- isInteractionOpen: Y,
440
- nextDisabled: !I,
441
- onEnded: Le,
442
- onFullscreen: Fe,
443
- onInteractionToggle: Oe,
444
- onPlayRequest: () => ne(!0),
445
- onNext: Me,
446
- onPrev: ke,
447
- prevDisabled: !be,
448
- showControls: E
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
- xt as default
515
+ Et as default
457
516
  };
458
517
  //# sourceMappingURL=Slide.es.js.map