@flamingo-stack/openframe-frontend-core 0.0.734 → 0.0.736
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/build/export-map.json +1 -1
- package/dist/{chunk-XKB7YGQM.cjs → chunk-77SD7RXY.cjs} +18 -6
- package/dist/{chunk-FA5SMA7L.cjs → chunk-7V2KP2TB.cjs} +4 -4
- package/dist/{chunk-KSXZABGH.cjs → chunk-BDF3FNOC.cjs} +38 -38
- package/dist/{chunk-3NANWZO3.cjs → chunk-BL5GOCHP.cjs} +14 -14
- package/dist/{chunk-DHIISS4W.cjs → chunk-EJOXXJJB.cjs} +62 -10
- package/dist/{chunk-TLQQP2EL.cjs → chunk-EX2GYIGW.cjs} +6 -6
- package/dist/{chunk-JRC3KXKV.cjs → chunk-FTGVG6FW.cjs} +30 -30
- package/dist/{chunk-4Q34V7MD.cjs → chunk-JGGSRCRD.cjs} +18 -18
- package/dist/{chunk-73ZW3265.cjs → chunk-JM54CNZZ.cjs} +85 -85
- package/dist/{chunk-HBUUCLQM.cjs → chunk-L535OD7V.cjs} +2 -2
- package/dist/{chunk-AOTOOGNX.cjs → chunk-LIH5OQLY.cjs} +3 -3
- package/dist/{chunk-OXJ57643.cjs → chunk-MGW5DO6P.cjs} +76 -17
- package/dist/{chunk-R65UD6BH.cjs → chunk-NONQUGRP.cjs} +14 -14
- package/dist/{chunk-4V672TEI.cjs → chunk-OJUMVOMP.cjs} +408 -355
- package/dist/{chunk-HAWQA5FI.cjs → chunk-OV6BGMEL.cjs} +151 -184
- package/dist/{chunk-5OGT7H2S.cjs → chunk-P6Z3EBPJ.cjs} +15 -15
- package/dist/{chunk-5DDFSGCE.cjs → chunk-SZFA2LQR.cjs} +33 -33
- package/dist/{chunk-EMBH2EJO.cjs → chunk-T27CVQBO.cjs} +65 -65
- package/dist/{chunk-CMUEFHM3.cjs → chunk-UBQSOB3X.cjs} +4 -4
- package/dist/{chunk-L7WJBJU7.cjs → chunk-URX2YTCL.cjs} +72 -72
- package/dist/{chunk-BP6R5WDW.cjs → chunk-VA7OMDZO.cjs} +41 -23
- package/dist/{chunk-D34BLEIR.cjs → chunk-VRNNIV5Y.cjs} +2 -2
- package/dist/{chunk-2OHBH6PS.cjs → chunk-XLSVQJBA.cjs} +44 -44
- package/dist/{chunk-OV7QQHLG.cjs → chunk-ZEX5WU35.cjs} +17 -17
- package/dist/{cloud-tenants-HU7YZD33.cjs → cloud-tenants-M55HMW6F.cjs} +8 -8
- package/dist/components/case-studies/index.cjs +20 -20
- package/dist/components/chat/entity-cards/program-card.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/program-card.js +6 -6
- package/dist/components/chat/index.cjs +9 -9
- package/dist/components/contact/index.cjs +9 -9
- package/dist/components/docs/index.cjs +12 -12
- package/dist/components/embeds/index.cjs +9 -9
- package/dist/components/faq/index.cjs +9 -9
- package/dist/components/features/cards-strip.d.ts.map +1 -1
- package/dist/components/features/cards-strip.js +6 -2
- package/dist/components/features/index.cjs +8 -8
- package/dist/components/features/video-bites-strip.d.ts +6 -1
- package/dist/components/features/video-bites-strip.d.ts.map +1 -1
- package/dist/components/features/video-bites-strip.js +15 -3
- package/dist/components/help-center-pages/index.cjs +109 -109
- package/dist/components/index.cjs +68 -62
- package/dist/components/meeting-scheduler/index.cjs +35 -35
- package/dist/components/navigation/index.cjs +11 -11
- package/dist/components/onboarding-guides/index.cjs +11 -11
- package/dist/components/pagination.d.ts +9 -1
- package/dist/components/pagination.d.ts.map +1 -1
- package/dist/components/pagination.js +72 -17
- package/dist/components/product-demo/index.cjs +6 -6
- package/dist/components/related-content/index.cjs +5 -5
- package/dist/components/tickets/index.cjs +13 -13
- package/dist/components/ui/fade-preview.d.ts +5 -1
- package/dist/components/ui/fade-preview.d.ts.map +1 -1
- package/dist/components/ui/fade-preview.js +18 -1
- package/dist/components/ui/index.cjs +18 -12
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +1 -0
- package/dist/components/ui/layout-hold.d.ts +31 -0
- package/dist/components/ui/layout-hold.d.ts.map +1 -0
- package/dist/components/ui/layout-hold.js +25 -0
- package/dist/components/ui/snap-carousel.d.ts.map +1 -1
- package/dist/components/ui/snap-carousel.js +28 -15
- package/dist/components/unified-pagination.d.ts.map +1 -1
- package/dist/components/unified-pagination.js +16 -4
- package/dist/{devices-CKLN7BHY.cjs → devices-WWJZFG6E.cjs} +9 -9
- package/dist/{embeddable-chat-FTAX4SVV.cjs → embeddable-chat-76IJ6TQZ.cjs} +72 -72
- package/dist/hooks/index.cjs +4 -2
- package/dist/hooks/ui/index.d.ts +1 -0
- package/dist/hooks/ui/index.d.ts.map +1 -1
- package/dist/hooks/ui/index.js +1 -0
- package/dist/hooks/ui/use-resumable-timeout.d.ts +22 -0
- package/dist/hooks/ui/use-resumable-timeout.d.ts.map +1 -0
- package/dist/hooks/ui/use-resumable-timeout.js +26 -0
- package/dist/hooks/use-scenario-player.d.ts +4 -3
- package/dist/hooks/use-scenario-player.d.ts.map +1 -1
- package/dist/hooks/use-scenario-player.js +17 -23
- package/dist/index.cjs +24 -16
- package/dist/{knowledge-NRLHSCC5.cjs → knowledge-F4YFQT3G.cjs} +9 -9
- package/dist/{logs-BR6SLYAF.cjs → logs-GAYEGEZM.cjs} +16 -16
- package/dist/{policies-MQRXBYG2.cjs → policies-ZOVJCJWX.cjs} +12 -12
- package/dist/{software-update-RUGIQP7N.cjs → software-update-H4YE5GMJ.cjs} +11 -11
- package/package.json +1 -1
- package/src/components/chat/entity-cards/program-card.tsx +9 -8
- package/src/components/features/cards-strip.tsx +11 -2
- package/src/components/features/video-bites-strip.tsx +22 -3
- package/src/components/pagination.tsx +117 -21
- package/src/components/ui/fade-preview.tsx +30 -1
- package/src/components/ui/index.ts +1 -0
- package/src/components/ui/layout-hold.tsx +55 -0
- package/src/components/ui/snap-carousel.tsx +36 -20
- package/src/components/unified-pagination.tsx +23 -7
- package/src/hooks/ui/index.ts +1 -0
- package/src/hooks/ui/use-resumable-timeout.ts +55 -0
- package/src/hooks/use-scenario-player.ts +28 -32
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface UseResumableTimeoutOptions {
|
|
2
|
+
/** The wait counts down only while this is true. */
|
|
3
|
+
running: boolean;
|
|
4
|
+
/** How long the whole wait is. */
|
|
5
|
+
durationMs: number;
|
|
6
|
+
/** A new value starts the wait over from nothing (the slide changed). */
|
|
7
|
+
resetKey: string | number;
|
|
8
|
+
/** Called once the whole wait has been run. */
|
|
9
|
+
onElapsed: () => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A wait that PAUSES instead of starting over: `durationMs` of time spent
|
|
13
|
+
* `running`, however many times it is interrupted. A carousel that scrolls off
|
|
14
|
+
* screen half-way through a slide comes back with half a slide left, not a
|
|
15
|
+
* whole one, and the bar that shows the wait picks up where it stopped.
|
|
16
|
+
*
|
|
17
|
+
* Returns how much of the wait had been run at the last stop (0 after a
|
|
18
|
+
* reset), which is what a progress bar draws while it is not running and
|
|
19
|
+
* where it resumes from.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useResumableTimeout({ running, durationMs, resetKey, onElapsed }: UseResumableTimeoutOptions): number;
|
|
22
|
+
//# sourceMappingURL=use-resumable-timeout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-resumable-timeout.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/use-resumable-timeout.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,0BAA0B;IACzC,oDAAoD;IACpD,OAAO,EAAE,OAAO,CAAC;IACjB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,+CAA+C;IAC/C,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,0BAA0B,GAAG,MAAM,CA6BpH"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
function useResumableTimeout({ running, durationMs, resetKey, onElapsed }) {
|
|
4
|
+
const banked = useRef({ key: resetKey, ms: 0 });
|
|
5
|
+
const [shown, setShown] = useState({ key: resetKey, ms: 0 });
|
|
6
|
+
const onElapsedRef = useRef(onElapsed);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
onElapsedRef.current = onElapsed;
|
|
9
|
+
}, [onElapsed]);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (banked.current.key !== resetKey) banked.current = { key: resetKey, ms: 0 };
|
|
12
|
+
if (!running) return void 0;
|
|
13
|
+
const startedAt = Date.now();
|
|
14
|
+
const timer = setTimeout(() => onElapsedRef.current(), Math.max(0, durationMs - banked.current.ms));
|
|
15
|
+
return () => {
|
|
16
|
+
clearTimeout(timer);
|
|
17
|
+
const ms = Math.min(durationMs, banked.current.ms + (Date.now() - startedAt));
|
|
18
|
+
banked.current = { key: resetKey, ms };
|
|
19
|
+
setShown({ key: resetKey, ms });
|
|
20
|
+
};
|
|
21
|
+
}, [running, durationMs, resetKey]);
|
|
22
|
+
return shown.key === resetKey ? shown.ms : 0;
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
useResumableTimeout
|
|
26
|
+
};
|
|
@@ -64,9 +64,10 @@ export interface UseScenarioPlayerResult {
|
|
|
64
64
|
* not held by the visitor, motion allowed. Under reduced motion it parks on the last step
|
|
65
65
|
* of the current scenario, and every scenario can still be read by choosing it.
|
|
66
66
|
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
67
|
+
* A step is `stepMs` of time spent playing: an interruption pauses it and it
|
|
68
|
+
* resumes with what was left (`useResumableTimeout`, the one clock every timed
|
|
69
|
+
* thing here runs on). At the top of a scenario whose first step is the empty
|
|
70
|
+
* stage, that step is left within `START_MS`.
|
|
70
71
|
*
|
|
71
72
|
* A visitor's own choice (`go`, `setStep`) moves the clock there and lets go of
|
|
72
73
|
* any hold; the rotation carries on from that point.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-scenario-player.d.ts","sourceRoot":"","sources":["../../src/hooks/use-scenario-player.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,iBAAiB,EAAe,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"use-scenario-player.d.ts","sourceRoot":"","sources":["../../src/hooks/use-scenario-player.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,iBAAiB,EAAe,MAAM,mBAAmB,CAAC;AAWxE,MAAM,WAAW,wBAAwB;IACvC,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IAClD,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4BAA4B;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAuB;IACtC,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,sFAAsF;IACtF,IAAI,EAAE,OAAO,CAAC;IACd,mFAAmF;IACnF,SAAS,EAAE,iBAAiB,CAAC;IAC7B,kFAAkF;IAClF,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,kDAAkD;IAClD,EAAE,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,qEAAqE;IACrE,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,aAAa,EACb,QAAQ,EAAE,cAAc,EACxB,MAAM,EACN,MAAM,EACN,OAAc,EACd,eAAmB,EACnB,UAAkB,EAClB,cAAqB,GACtB,EAAE,wBAAwB,GAAG,uBAAuB,CA0DpD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useCallback,
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
3
|
import { useAutoplay } from "./ui/use-autoplay.js";
|
|
4
|
+
import { useResumableTimeout } from "./ui/use-resumable-timeout.js";
|
|
4
5
|
const START_MS = 300;
|
|
5
6
|
function useScenarioPlayer({
|
|
6
7
|
scenarioCount,
|
|
@@ -21,28 +22,21 @@ function useScenarioPlayer({
|
|
|
21
22
|
const playing = auto.playing && scenarioCount > 0;
|
|
22
23
|
const [started, setStarted] = useState(false);
|
|
23
24
|
if (playing && !started) setStarted(true);
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
setRawStep((current) => Math.min(current, lastStep) + 1);
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
atEnd ? holdMs : quickStart ? Math.min(START_MS, stepMs) : stepMs
|
|
43
|
-
);
|
|
44
|
-
return () => clearTimeout(timer);
|
|
45
|
-
}, [playing, rawStep, lastStep, stepMs, holdMs, scenario, scenarioCount, emptyFirstStep]);
|
|
25
|
+
const atEnd = rawStep >= lastStep;
|
|
26
|
+
const leavesAtOnce = emptyFirstStep && rawStep === 0 && !atEnd;
|
|
27
|
+
useResumableTimeout({
|
|
28
|
+
running: playing,
|
|
29
|
+
durationMs: atEnd ? holdMs : leavesAtOnce ? Math.min(START_MS, stepMs) : stepMs,
|
|
30
|
+
resetKey: `${scenario}:${Math.min(rawStep, lastStep)}`,
|
|
31
|
+
onElapsed: () => {
|
|
32
|
+
if (atEnd) {
|
|
33
|
+
setScenario((current) => (current + 1) % scenarioCount);
|
|
34
|
+
setRawStep(0);
|
|
35
|
+
} else {
|
|
36
|
+
setRawStep((current) => Math.min(current, lastStep) + 1);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
46
40
|
const setStep = useCallback(
|
|
47
41
|
(next) => {
|
|
48
42
|
setRawStep(Math.max(0, Math.min(lastStep, next)));
|