@flamingo-stack/openframe-frontend-core 0.0.674 → 0.0.675-2435.7306.1

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 (94) hide show
  1. package/dist/{chunk-RSOBME56.js → chunk-2GL6DFLV.js} +2 -2
  2. package/dist/{chunk-PP3N5MN4.cjs → chunk-42GR6UIH.cjs} +3 -3
  3. package/dist/{chunk-PP3N5MN4.cjs.map → chunk-42GR6UIH.cjs.map} +1 -1
  4. package/dist/{chunk-N6CI2E7D.cjs → chunk-5X4JS67G.cjs} +3 -3
  5. package/dist/{chunk-N6CI2E7D.cjs.map → chunk-5X4JS67G.cjs.map} +1 -1
  6. package/dist/{chunk-EGQOPBXC.cjs → chunk-BVYZHKF6.cjs} +3 -3
  7. package/dist/{chunk-EGQOPBXC.cjs.map → chunk-BVYZHKF6.cjs.map} +1 -1
  8. package/dist/{chunk-FUEAXTZE.cjs → chunk-C4YD5MZV.cjs} +4 -4
  9. package/dist/{chunk-FUEAXTZE.cjs.map → chunk-C4YD5MZV.cjs.map} +1 -1
  10. package/dist/{chunk-YVJDVVHY.js → chunk-CXE6WTBZ.js} +5 -2
  11. package/dist/{chunk-YVJDVVHY.js.map → chunk-CXE6WTBZ.js.map} +1 -1
  12. package/dist/{chunk-QZMKKQQN.cjs → chunk-D3LFYXUM.cjs} +13 -13
  13. package/dist/{chunk-QZMKKQQN.cjs.map → chunk-D3LFYXUM.cjs.map} +1 -1
  14. package/dist/{chunk-MRT6DZG5.cjs → chunk-GU5JW5MX.cjs} +36 -36
  15. package/dist/{chunk-MRT6DZG5.cjs.map → chunk-GU5JW5MX.cjs.map} +1 -1
  16. package/dist/{chunk-XBNO42PI.js → chunk-HDNMMUGV.js} +2 -2
  17. package/dist/{chunk-7F73YNDS.cjs → chunk-HQ2ZYL3V.cjs} +4 -4
  18. package/dist/{chunk-7F73YNDS.cjs.map → chunk-HQ2ZYL3V.cjs.map} +1 -1
  19. package/dist/{chunk-UIQQBZLU.cjs → chunk-I3QQALKQ.cjs} +33 -33
  20. package/dist/{chunk-UIQQBZLU.cjs.map → chunk-I3QQALKQ.cjs.map} +1 -1
  21. package/dist/{chunk-XYZQXHAX.js → chunk-J24SZNH4.js} +4 -4
  22. package/dist/{chunk-CHKIZRUP.cjs → chunk-JB4ZALJS.cjs} +18 -18
  23. package/dist/{chunk-CHKIZRUP.cjs.map → chunk-JB4ZALJS.cjs.map} +1 -1
  24. package/dist/{chunk-M76D6OJZ.js → chunk-KB7YLZAC.js} +5 -5
  25. package/dist/{chunk-OAQROGFN.cjs → chunk-KFWDLZGL.cjs} +51 -51
  26. package/dist/{chunk-OAQROGFN.cjs.map → chunk-KFWDLZGL.cjs.map} +1 -1
  27. package/dist/{chunk-GJTLUW2H.js → chunk-LD76LMKM.js} +2 -2
  28. package/dist/{chunk-UYPICURQ.js → chunk-LPEFFJXX.js} +2 -2
  29. package/dist/{chunk-TWQWCOJ7.cjs → chunk-N24SOKQI.cjs} +17 -17
  30. package/dist/{chunk-TWQWCOJ7.cjs.map → chunk-N24SOKQI.cjs.map} +1 -1
  31. package/dist/{chunk-PXWMRXVI.js → chunk-OS3NLEV5.js} +5 -5
  32. package/dist/{chunk-BQICLH4C.js → chunk-PARUDSVT.js} +4 -4
  33. package/dist/{chunk-QO4RASGC.js → chunk-PSF37OWZ.js} +2 -2
  34. package/dist/{chunk-TECYEWVQ.js → chunk-Q3MTPDK4.js} +2 -2
  35. package/dist/{chunk-MMOXFVQN.js → chunk-SYTU64CK.js} +2 -2
  36. package/dist/{chunk-G7HMYIDN.js → chunk-TS4HBJNA.js} +2 -2
  37. package/dist/{chunk-EJZV4QGU.cjs → chunk-VZMST7BD.cjs} +111 -108
  38. package/dist/chunk-VZMST7BD.cjs.map +1 -0
  39. package/dist/{chunk-HN7KNVKL.cjs → chunk-WYACK3N7.cjs} +3 -3
  40. package/dist/{chunk-HN7KNVKL.cjs.map → chunk-WYACK3N7.cjs.map} +1 -1
  41. package/dist/{chunk-L7PO6NSD.cjs → chunk-XJMADFIK.cjs} +10 -10
  42. package/dist/{chunk-L7PO6NSD.cjs.map → chunk-XJMADFIK.cjs.map} +1 -1
  43. package/dist/{chunk-NRHEKFPG.js → chunk-ZI3E5SSW.js} +2 -2
  44. package/dist/{chunk-4Q6P3VHS.cjs → chunk-ZYVMSJFU.cjs} +17 -17
  45. package/dist/{chunk-4Q6P3VHS.cjs.map → chunk-ZYVMSJFU.cjs.map} +1 -1
  46. package/dist/{chunk-EPKQTPNJ.js → chunk-ZZOZZJPK.js} +3 -3
  47. package/dist/components/case-studies/index.cjs +11 -11
  48. package/dist/components/case-studies/index.js +2 -2
  49. package/dist/components/contact/index.cjs +3 -3
  50. package/dist/components/contact/index.js +2 -2
  51. package/dist/components/docs/index.cjs +6 -6
  52. package/dist/components/docs/index.js +5 -5
  53. package/dist/components/embeds/index.cjs +3 -3
  54. package/dist/components/embeds/index.js +2 -2
  55. package/dist/components/faq/index.cjs +3 -3
  56. package/dist/components/faq/index.js +2 -2
  57. package/dist/components/features/index.cjs +2 -2
  58. package/dist/components/features/index.js +1 -1
  59. package/dist/components/features/walkthrough-video.d.ts +6 -0
  60. package/dist/components/features/walkthrough-video.d.ts.map +1 -1
  61. package/dist/components/help-center-pages/index.cjs +49 -49
  62. package/dist/components/help-center-pages/index.js +13 -13
  63. package/dist/components/index.cjs +31 -31
  64. package/dist/components/index.js +12 -12
  65. package/dist/components/meeting-scheduler/index.cjs +21 -21
  66. package/dist/components/meeting-scheduler/index.js +1 -1
  67. package/dist/components/navigation/index.cjs +5 -5
  68. package/dist/components/navigation/index.js +4 -4
  69. package/dist/components/onboarding-guides/index.cjs +5 -5
  70. package/dist/components/onboarding-guides/index.js +4 -4
  71. package/dist/components/tickets/index.cjs +6 -6
  72. package/dist/components/tickets/index.js +5 -5
  73. package/dist/components/ui/index.cjs +2 -2
  74. package/dist/components/ui/index.js +1 -1
  75. package/dist/index.cjs +6 -6
  76. package/dist/index.js +5 -5
  77. package/package.json +1 -1
  78. package/src/components/features/__tests__/walkthrough-video-autoplay-card.test.tsx +89 -0
  79. package/src/components/features/walkthrough-video.tsx +12 -1
  80. package/dist/chunk-EJZV4QGU.cjs.map +0 -1
  81. /package/dist/{chunk-RSOBME56.js.map → chunk-2GL6DFLV.js.map} +0 -0
  82. /package/dist/{chunk-XBNO42PI.js.map → chunk-HDNMMUGV.js.map} +0 -0
  83. /package/dist/{chunk-XYZQXHAX.js.map → chunk-J24SZNH4.js.map} +0 -0
  84. /package/dist/{chunk-M76D6OJZ.js.map → chunk-KB7YLZAC.js.map} +0 -0
  85. /package/dist/{chunk-GJTLUW2H.js.map → chunk-LD76LMKM.js.map} +0 -0
  86. /package/dist/{chunk-UYPICURQ.js.map → chunk-LPEFFJXX.js.map} +0 -0
  87. /package/dist/{chunk-PXWMRXVI.js.map → chunk-OS3NLEV5.js.map} +0 -0
  88. /package/dist/{chunk-BQICLH4C.js.map → chunk-PARUDSVT.js.map} +0 -0
  89. /package/dist/{chunk-QO4RASGC.js.map → chunk-PSF37OWZ.js.map} +0 -0
  90. /package/dist/{chunk-TECYEWVQ.js.map → chunk-Q3MTPDK4.js.map} +0 -0
  91. /package/dist/{chunk-MMOXFVQN.js.map → chunk-SYTU64CK.js.map} +0 -0
  92. /package/dist/{chunk-G7HMYIDN.js.map → chunk-TS4HBJNA.js.map} +0 -0
  93. /package/dist/{chunk-NRHEKFPG.js.map → chunk-ZI3E5SSW.js.map} +0 -0
  94. /package/dist/{chunk-EPKQTPNJ.js.map → chunk-ZZOZZJPK.js.map} +0 -0
@@ -0,0 +1,89 @@
1
+ /**
2
+ * `autoPlayCard` on the inline walkthrough card: the card mounts its player in
3
+ * resume mode from 0, muted and autoplaying, instead of waiting for a hover.
4
+ */
5
+ import { render, screen, waitFor } from '@testing-library/react';
6
+ import type { Ref } from 'react';
7
+ import { useImperativeHandle, useRef } from 'react';
8
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
9
+
10
+ import { InlineWalkthroughVideo } from '../walkthrough-video';
11
+
12
+ interface Construction {
13
+ role: string;
14
+ startTime: number | undefined;
15
+ autoPlay: boolean | undefined;
16
+ startMuted: boolean | undefined;
17
+ }
18
+
19
+ const constructions: Construction[] = [];
20
+
21
+ vi.mock('../video', () => {
22
+ const FakeVideo = (props: Record<string, unknown>) => {
23
+ const role =
24
+ props.layout === 'wide'
25
+ ? 'theater'
26
+ : props.firstFrameOnly
27
+ ? 'facade'
28
+ : props.startTime !== undefined
29
+ ? 'resume'
30
+ : 'preview';
31
+ const first = useRef(true);
32
+ if (first.current) {
33
+ first.current = false;
34
+ if (role !== 'facade') {
35
+ constructions.push({
36
+ role,
37
+ startTime: props.startTime as number | undefined,
38
+ autoPlay: props.autoPlay as boolean | undefined,
39
+ startMuted: props.startMuted as boolean | undefined,
40
+ });
41
+ }
42
+ }
43
+ useImperativeHandle(
44
+ props.playerHandleRef as Ref<unknown>,
45
+ () => ({
46
+ getCurrentTime: () => 0,
47
+ getDuration: () => 600,
48
+ getPaused: () => false,
49
+ getMuted: () => true,
50
+ play: () => Promise.resolve(),
51
+ pause: () => {},
52
+ setMuted: () => {},
53
+ }),
54
+ [],
55
+ );
56
+ return <div data-role={role} />;
57
+ };
58
+ return { Video: FakeVideo };
59
+ });
60
+
61
+ const FILE_VIDEO = { id: 'v1', mainVideoUrl: 'https://example.com/a.m3u8', posterUrl: null, title: 'Demo' };
62
+ const YOUTUBE_VIDEO = { id: 'v2', youtubeUrl: 'https://youtu.be/dQw4w9WgXcQ', posterUrl: null, title: 'Demo' };
63
+
64
+ describe('walkthrough-video: autoPlayCard', () => {
65
+ beforeEach(() => {
66
+ constructions.length = 0;
67
+ });
68
+
69
+ // The card appears after the mount gate (an effect), so every assertion waits
70
+ // for it: `findByRole` is what tells "not yet" apart from "never".
71
+ it('mounts the card player in resume mode: from 0, muted, autoplaying', async () => {
72
+ render(<InlineWalkthroughVideo video={FILE_VIDEO} autoPlayCard />);
73
+ await waitFor(() =>
74
+ expect(constructions).toEqual([{ role: 'resume', startTime: 0, autoPlay: true, startMuted: true }]),
75
+ );
76
+ });
77
+
78
+ it('without it the card waits for a hover', async () => {
79
+ render(<InlineWalkthroughVideo video={FILE_VIDEO} />);
80
+ await screen.findByRole('button', { name: /Play Demo Video/ });
81
+ expect(constructions.filter(c => c.role === 'resume')).toEqual([]);
82
+ });
83
+
84
+ it('a YouTube card never plays inline', async () => {
85
+ render(<InlineWalkthroughVideo video={YOUTUBE_VIDEO} autoPlayCard />);
86
+ await screen.findByRole('button', { name: /Play Demo Video/ });
87
+ expect(constructions.filter(c => c.role === 'resume')).toEqual([]);
88
+ });
89
+ });
@@ -129,6 +129,12 @@ interface WalkthroughVideoBaseProps {
129
129
  * SSR-safe: the server renders closed, and the theater lives in a portal,
130
130
  * so the hydrated (non-portal) markup is identical either way. */
131
131
  deepLinkParam?: string;
132
+ /** Start the card playing on mount, muted, with the unmute glyph up — the
133
+ * muted-autoplay pattern, for a page whose point IS the clip (an onboarding
134
+ * hero). The card behaves as after a muted theater close: the clip runs in
135
+ * the card, a click opens the theater from the current time. File videos
136
+ * only; a YouTube card never plays inline. */
137
+ autoPlayCard?: boolean;
132
138
  label?: string;
133
139
  className?: string;
134
140
  }
@@ -199,6 +205,7 @@ function WalkthroughVideo({
199
205
  defaultOpen,
200
206
  defaultOpenPaused,
201
207
  deepLinkParam = WALKTHROUGH_OPEN_QUERY_PARAM,
208
+ autoPlayCard = false,
202
209
  label = 'Play Demo Video',
203
210
  placement,
204
211
  // Keeps the FLOATING card off the critical path. The inline preset passes 0:
@@ -313,7 +320,11 @@ function WalkthroughVideo({
313
320
  const endedLatchRef = useRef(false);
314
321
 
315
322
  const [hovered, setHovered] = useState(false);
316
- const [handoff, setHandoff] = useState<Handoff | null>(null);
323
+ // `autoPlayCard` seeds the same state a muted theater close leaves behind, so
324
+ // the card starts in resume mode with nothing else to special-case.
325
+ const [handoff, setHandoff] = useState<Handoff | null>(() =>
326
+ autoPlayCard && !video?.youtubeUrl ? { time: 0, muted: true, playing: true } : null,
327
+ );
317
328
  const [suspended, setSuspended] = useState(false);
318
329
  const [theaterStart, setTheaterStart] = useState<{ time: number; muted: boolean }>({ time: 0, muted: false });
319
330
  const [footerObservation, setFooterObservation] = useState<{ key: string; hidden: boolean } | null>(null);