markdown-flow-ui 0.1.120 → 0.1.121-beta.0

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 (39) hide show
  1. package/dist/_virtual/index.cjs7.js +1 -1
  2. package/dist/_virtual/index.cjs8.js +1 -1
  3. package/dist/_virtual/index.es7.js +2 -2
  4. package/dist/_virtual/index.es8.js +2 -2
  5. package/dist/assets/markdown-flow-ui.css +1 -1
  6. package/dist/components/ContentRender/ContentRender.cjs.js +2 -2
  7. package/dist/components/ContentRender/ContentRender.cjs.js.map +1 -1
  8. package/dist/components/ContentRender/ContentRender.d.ts +10 -1
  9. package/dist/components/ContentRender/ContentRender.es.js +221 -175
  10. package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
  11. package/dist/components/ContentRender/ContentRender.stories.d.ts +1 -3
  12. package/dist/components/ContentRender/index.d.ts +1 -2
  13. package/dist/components/MarkdownFlow/MarkdownFlow.cjs.js +1 -1
  14. package/dist/components/MarkdownFlow/MarkdownFlow.cjs.js.map +1 -1
  15. package/dist/components/MarkdownFlow/MarkdownFlow.d.ts +0 -3
  16. package/dist/components/MarkdownFlow/MarkdownFlow.es.js +21 -29
  17. package/dist/components/MarkdownFlow/MarkdownFlow.es.js.map +1 -1
  18. package/dist/components/Slide/Slide.cjs.js +1 -1
  19. package/dist/components/Slide/Slide.cjs.js.map +1 -1
  20. package/dist/components/Slide/Slide.es.js +50 -51
  21. package/dist/components/Slide/Slide.es.js.map +1 -1
  22. package/dist/components/Slide/utils/runStreamFixture.d.ts +2 -0
  23. package/dist/lib/interaction-defaults.cjs.js +1 -1
  24. package/dist/lib/interaction-defaults.cjs.js.map +1 -1
  25. package/dist/lib/interaction-defaults.es.js +128 -81
  26. package/dist/lib/interaction-defaults.es.js.map +1 -1
  27. package/dist/lib/interaction-defaults.test.d.ts +1 -0
  28. package/dist/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.cjs.js +1 -1
  29. package/dist/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js +1 -1
  30. package/dist/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.cjs.js +1 -1
  31. package/dist/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.es.js +1 -1
  32. package/dist/markdown-flow-ui-lib.css +1 -1
  33. package/package.json +2 -3
  34. package/dist/components/ContentRender/useTypewriter.d.ts +0 -19
  35. package/dist/components/ContentRender/useTypewriterStateMachine.cjs.js +0 -2
  36. package/dist/components/ContentRender/useTypewriterStateMachine.cjs.js.map +0 -1
  37. package/dist/components/ContentRender/useTypewriterStateMachine.d.ts +0 -19
  38. package/dist/components/ContentRender/useTypewriterStateMachine.es.js +0 -180
  39. package/dist/components/ContentRender/useTypewriterStateMachine.es.js.map +0 -1
@@ -51,7 +51,6 @@ const Nn = 2e3, On = 300, jn = 160, Ln = 16, Ve = "waitingForAudio", _t = {
51
51
  copiedButtonText: Ie,
52
52
  onSend: _e,
53
53
  readonly: D,
54
- enableTypewriter: !1,
55
54
  sandboxMode: "content"
56
55
  }
57
56
  ) })
@@ -98,7 +97,7 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
98
97
  audioList: h,
99
98
  currentAudioSequenceIndexes: pe,
100
99
  currentStepHasSpeakableElement: b,
101
- currentInteractionElement: u,
100
+ currentInteractionElement: a,
102
101
  canGoPrev: Mt,
103
102
  canGoNext: x,
104
103
  handlePrev: Ze,
@@ -108,7 +107,7 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
108
107
  return N[d];
109
108
  }, [d, N]), Ft = N.filter(
110
109
  (e) => e.is_renderable !== !1
111
- ).length === 1, E = w && (N.length > 0 || h.length > 0 || !!u), P = c(
110
+ ).length === 1, E = w && (N.length > 0 || h.length > 0 || !!a), P = c(
112
111
  () => pe.map((e) => h[e]?.audioKey).filter((e) => !!e),
113
112
  [h, pe]
114
113
  ), [et, he] = m(!0), [ve, se] = m(!1), [ie, tt] = m(!0), [v, U] = m(null), [kt, g] = m(!1), [Bt, Ce] = m(Ve), [M, nt] = m(!1), [Nt, Pe] = m(!1), [rt, Ot] = m(!0), [Me, Fe] = m(!1), [o, ke] = m(), [ge, ye] = m(!1), [
@@ -140,11 +139,11 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
140
139
  Ne(!0), Be(e);
141
140
  },
142
141
  []
143
- ), at = r(() => {
142
+ ), ut = r(() => {
144
143
  Ne(!1), Be(we);
145
144
  }, []), Ht = r(() => {
146
- at(), _?.onBack?.();
147
- }, [_, at]), ut = r((e) => {
145
+ ut(), _?.onBack?.();
146
+ }, [_, ut]), at = r((e) => {
148
147
  Fe(e);
149
148
  }, []), dt = r(() => {
150
149
  Fe((e) => !e);
@@ -152,8 +151,8 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
152
151
  const e = [], t = /* @__PURE__ */ new Map();
153
152
  return Qe.forEach((l, f) => {
154
153
  const i = e.findIndex(
155
- (a) => Dn(
156
- a.elementList,
154
+ (u) => Dn(
155
+ u.elementList,
157
156
  l
158
157
  )
159
158
  );
@@ -189,7 +188,7 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
189
188
  currentIndex: d,
190
189
  currentStepElement: oe,
191
190
  isActive: Me,
192
- setActive: ut,
191
+ setActive: at,
193
192
  toggleActive: dt
194
193
  }),
195
194
  [
@@ -200,7 +199,7 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
200
199
  d,
201
200
  oe,
202
201
  Me,
203
- ut,
202
+ at,
204
203
  dt
205
204
  ]
206
205
  ), Le = c(
@@ -217,9 +216,9 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
217
216
  )
218
217
  }),
219
218
  [Le]
220
- ), mt = P.length > 0, pt = c(() => u ? `${u.sequence_number ?? "none"}:${String(
221
- u.content ?? ""
222
- )}` : "none", [u]), ce = c(
219
+ ), mt = P.length > 0, pt = c(() => a ? `${a.sequence_number ?? "none"}:${String(
220
+ a.content ?? ""
221
+ )}` : "none", [a]), ce = c(
223
222
  () => [ft, pt].join("|"),
224
223
  [pt, ft]
225
224
  ), Jt = c(
@@ -231,17 +230,17 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
231
230
  [y, Oe?.audioKey, ce]
232
231
  ), ht = !!c(() => !be || be === "none" ? "" : h.find(
233
232
  (t) => t.audioKey === be
234
- )?.audioUrl?.trim() ?? "", [h, be]), L = Z && !!V && Me, ae = c(
233
+ )?.audioUrl?.trim() ?? "", [h, be]), L = Z && !!V && Me, ue = c(
235
234
  () => kn({
236
235
  canGoNext: x,
237
236
  currentAudioIndex: y,
238
237
  currentStepHasSpeakableElement: b,
239
- hasInteraction: !!u
238
+ hasInteraction: !!a
240
239
  }),
241
240
  [
242
241
  x,
243
242
  y,
244
- u,
243
+ a,
245
244
  b
246
245
  ]
247
246
  ), K = r(() => {
@@ -298,7 +297,7 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
298
297
  Ee,
299
298
  E
300
299
  ]
301
- ), ue = !!(u?.readonly || u?.user_input?.trim()), X = !!u && !ue;
300
+ ), ae = !!(a?.readonly || a?.user_input?.trim()), X = !!a && !ae;
302
301
  s(() => {
303
302
  tt(!0), Z && Fe(!1);
304
303
  }, [d, Z]), s(() => () => {
@@ -337,11 +336,11 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
337
336
  nextCanGoNext: x,
338
337
  currentAudioKey: v,
339
338
  hasCompletedCurrentStepAudio: M,
340
- hasResolvedCurrentInteraction: ue,
339
+ hasResolvedCurrentInteraction: ae,
341
340
  currentStepHasSpeakableElement: b,
342
- currentInteractionElement: u,
341
+ currentInteractionElement: a,
343
342
  isAutoAdvanceEnabled: ie,
344
- shouldUseSilentStepAutoAdvanceToggle: ae
343
+ shouldUseSilentStepAutoAdvanceToggle: ue
345
344
  }
346
345
  );
347
346
  Je.current = {
@@ -353,13 +352,13 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
353
352
  x,
354
353
  v,
355
354
  d,
356
- u,
355
+ a,
357
356
  b,
358
357
  C,
359
358
  M,
360
- ue,
361
- ie,
362
359
  ae,
360
+ ie,
361
+ ue,
363
362
  N.length
364
363
  ]), s(() => {
365
364
  if (!E) {
@@ -400,17 +399,17 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
400
399
  hasCompletedCurrentStepAudio: M
401
400
  });
402
401
  Xe.current = ce;
403
- const l = q.current === d && !!u, f = Tn({
404
- hasInteraction: !!u,
402
+ const l = q.current === d && !!a, f = Tn({
403
+ hasInteraction: !!a,
405
404
  shouldBlockPlaybackForInteraction: X,
406
405
  shouldOpenInteractionOverlayAfterAudio: l,
407
406
  hasPlaybackContextChanged: e,
408
- hasResolvedCurrentInteraction: ue,
407
+ hasResolvedCurrentInteraction: ae,
409
408
  currentStepHasSpeakableElement: b
410
409
  });
411
- if (e && $(), !(B.length === 0 && !u) && !L) {
412
- if (u && ke(u), f) {
413
- vt(u);
410
+ if (e && $(), !(B.length === 0 && !a) && !L) {
411
+ if (a && ke(a), f) {
412
+ vt(a);
414
413
  return;
415
414
  }
416
415
  if (k(), q.current = null, !!t && !Y()) {
@@ -422,7 +421,7 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
422
421
  g(!0);
423
422
  return;
424
423
  }
425
- if (x && !(ae && !ie))
424
+ if (x && !(ue && !ie))
426
425
  return te.current = window.setTimeout(() => {
427
426
  te.current = null, C();
428
427
  }, De), () => {
@@ -434,7 +433,7 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
434
433
  x,
435
434
  W,
436
435
  B.length,
437
- u,
436
+ a,
438
437
  v,
439
438
  ce,
440
439
  b,
@@ -443,14 +442,14 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
443
442
  M,
444
443
  R,
445
444
  ie,
446
- ue,
445
+ ae,
447
446
  X,
448
447
  k,
449
448
  $,
450
449
  vt,
451
450
  Y,
452
451
  L,
453
- ae
452
+ ue
454
453
  ]), s(() => {
455
454
  if (R || L || !b || X) {
456
455
  g(!1);
@@ -593,15 +592,15 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
593
592
  const l = e.filter(
594
593
  (i) => i.is_renderable !== !1
595
594
  ).length, f = e.reduce(
596
- (i, a, T) => a.is_renderable !== !1 ? T : i,
595
+ (i, u, T) => u.is_renderable !== !1 ? T : i,
597
596
  -1
598
597
  );
599
- return /* @__PURE__ */ n.jsx("div", { className: "slide-stage__content flex w-full flex-col gap-4", children: e.map((i, a) => {
598
+ return /* @__PURE__ */ n.jsx("div", { className: "slide-stage__content flex w-full flex-col gap-4", children: e.map((i, u) => {
600
599
  const T = i.type === "html" && i.is_renderable === !1;
601
600
  return /* @__PURE__ */ n.jsx(
602
601
  "div",
603
602
  {
604
- ref: t && a === f ? We : null,
603
+ ref: t && u === f ? We : null,
605
604
  "aria-hidden": T || void 0,
606
605
  className: J(
607
606
  "w-full shrink-0",
@@ -612,7 +611,7 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
612
611
  replaceRootScreenHeightWithFull: l === 1 && i.type === "html" && i.is_renderable !== !1
613
612
  })
614
613
  },
615
- i.sequence_number ?? `${i.type}-${a}`
614
+ i.sequence_number ?? `${i.type}-${u}`
616
615
  );
617
616
  }) });
618
617
  }, nn = r(() => {
@@ -666,7 +665,7 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
666
665
  if (!t || !v || t !== v)
667
666
  return;
668
667
  const l = P.findIndex(
669
- (a) => a === t
668
+ (u) => u === t
670
669
  );
671
670
  if (l < 0) {
672
671
  U(null);
@@ -678,8 +677,8 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
678
677
  return;
679
678
  }
680
679
  if (U(null), nt(!0), g(!1), x) {
681
- const a = d + 1, T = N[a];
682
- ht && T?.type === "interaction" && (q.current = a), C();
680
+ const u = d + 1, T = N[u];
681
+ ht && T?.type === "interaction" && (q.current = u), C();
683
682
  return;
684
683
  }
685
684
  },
@@ -700,12 +699,12 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
700
699
  e.stopPropagation(), F && A(!0);
701
700
  },
702
701
  [et, A]
703
- ), an = r(
702
+ ), un = r(
704
703
  (e) => {
705
704
  Ge?.(e);
706
705
  },
707
706
  [Ge]
708
- ), un = r(() => {
707
+ ), an = r(() => {
709
708
  se(!0), A(!0);
710
709
  }, [A]), xe = c(
711
710
  () => B.map(
@@ -714,17 +713,17 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
714
713
  [B]
715
714
  );
716
715
  return s(() => {
717
- const e = Ye.current, f = (e.length > 0 && e.length < xe.length && e.every((a, T) => a === xe[T]) ? B.slice(e.length) : []).some(
718
- (a) => a.is_new === !1
716
+ const e = Ye.current, f = (e.length > 0 && e.length < xe.length && e.every((u, T) => u === xe[T]) ? B.slice(e.length) : []).some(
717
+ (u) => u.is_new === !1
719
718
  );
720
719
  if (Ye.current = xe, !f)
721
720
  return;
722
721
  const i = window.requestAnimationFrame(() => {
723
- const a = Re.current, T = We.current;
724
- if (!a || !T)
722
+ const u = Re.current, T = We.current;
723
+ if (!u || !T)
725
724
  return;
726
- const dn = a.getBoundingClientRect(), fn = T.getBoundingClientRect(), mn = a.scrollTop + (fn.top - dn.top);
727
- a.scrollTo({
725
+ const dn = u.getBoundingClientRect(), fn = T.getBoundingClientRect(), mn = u.scrollTop + (fn.top - dn.top);
726
+ u.scrollTo({
728
727
  top: Math.max(mn, 0),
729
728
  behavior: "smooth"
730
729
  });
@@ -753,8 +752,8 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
753
752
  lt && "slide--mobile-landscape-native",
754
753
  Ct
755
754
  ),
756
- onClick: un,
757
- onPointerDown: an,
755
+ onClick: an,
756
+ onPointerDown: un,
758
757
  ...Pt,
759
758
  children: [
760
759
  zt ? /* @__PURE__ */ n.jsx(
@@ -911,7 +910,7 @@ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
911
910
  texts: Tt,
912
911
  customActionContext: je,
913
912
  customActions: V,
914
- useAutoAdvanceToggle: ae
913
+ useAutoAdvanceToggle: ue
915
914
  }
916
915
  ) : null
917
916
  ]