markdown-flow-ui 0.2.1 → 0.2.3-dev.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.
- package/dist/assets/markdown-flow-ui.css +1 -1
- package/dist/components/ContentRender/IframeSandbox.cjs.js +7 -7
- package/dist/components/ContentRender/IframeSandbox.cjs.js.map +1 -1
- package/dist/components/ContentRender/IframeSandbox.es.js +283 -252
- package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -1
- package/dist/components/ContentRender/SandboxApp.cjs.js +2 -2
- package/dist/components/ContentRender/SandboxApp.cjs.js.map +1 -1
- package/dist/components/ContentRender/SandboxApp.es.js +106 -95
- package/dist/components/ContentRender/SandboxApp.es.js.map +1 -1
- package/dist/components/ContentRender/blackboard-vendor.cjs.js +1 -1
- package/dist/components/ContentRender/blackboard-vendor.cjs.js.map +1 -1
- package/dist/components/ContentRender/blackboard-vendor.d.ts +2 -0
- package/dist/components/ContentRender/blackboard-vendor.es.js +9 -12
- package/dist/components/ContentRender/blackboard-vendor.es.js.map +1 -1
- package/dist/components/ContentRender/utils/iframe-scaling.cjs.js +12 -9
- package/dist/components/ContentRender/utils/iframe-scaling.cjs.js.map +1 -1
- package/dist/components/ContentRender/utils/iframe-scaling.es.js +16 -12
- package/dist/components/ContentRender/utils/iframe-scaling.es.js.map +1 -1
- package/dist/components/ContentRender/utils/link-targets.cjs.js +2 -0
- package/dist/components/ContentRender/utils/link-targets.cjs.js.map +1 -0
- package/dist/components/ContentRender/utils/link-targets.d.ts +6 -0
- package/dist/components/ContentRender/utils/link-targets.es.js +26 -0
- package/dist/components/ContentRender/utils/link-targets.es.js.map +1 -0
- package/dist/components/ContentRender/utils/link-targets.test.d.ts +1 -0
- package/dist/components/ContentRender/utils/presentation-scaling.cjs.js +2 -0
- package/dist/components/ContentRender/utils/presentation-scaling.cjs.js.map +1 -0
- package/dist/components/ContentRender/utils/presentation-scaling.d.ts +34 -0
- package/dist/components/ContentRender/utils/presentation-scaling.es.js +67 -0
- package/dist/components/ContentRender/utils/presentation-scaling.es.js.map +1 -0
- package/dist/components/ContentRender/utils/presentation-scaling.test.d.ts +1 -0
- package/dist/components/ContentRender/utils/tailwind-runtime.cjs.js +2 -0
- package/dist/components/ContentRender/utils/tailwind-runtime.cjs.js.map +1 -0
- package/dist/components/ContentRender/utils/tailwind-runtime.d.ts +5 -0
- package/dist/components/ContentRender/utils/tailwind-runtime.es.js +11 -0
- package/dist/components/ContentRender/utils/tailwind-runtime.es.js.map +1 -0
- package/dist/components/ContentRender/utils/tailwind-runtime.test.d.ts +1 -0
- package/dist/components/Slide/MarkdownSlideScaling.cjs.js +2 -0
- package/dist/components/Slide/MarkdownSlideScaling.cjs.js.map +1 -0
- package/dist/components/Slide/MarkdownSlideScaling.d.ts +13 -0
- package/dist/components/Slide/MarkdownSlideScaling.es.js +109 -0
- package/dist/components/Slide/MarkdownSlideScaling.es.js.map +1 -0
- 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 +7 -0
- package/dist/components/Slide/Slide.es.js +803 -708
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/components/Slide/Slide.stories.d.ts +2473 -0
- package/dist/components/Slide/constants.cjs.js +2 -0
- package/dist/components/Slide/constants.cjs.js.map +1 -0
- package/dist/components/Slide/constants.d.ts +1 -0
- package/dist/components/Slide/constants.es.js +5 -0
- package/dist/components/Slide/constants.es.js.map +1 -0
- package/dist/components/Slide/utils/imageOnlyStepVisualReady.cjs.js +2 -0
- package/dist/components/Slide/utils/imageOnlyStepVisualReady.cjs.js.map +1 -0
- package/dist/components/Slide/utils/imageOnlyStepVisualReady.d.ts +13 -0
- package/dist/components/Slide/utils/imageOnlyStepVisualReady.es.js +12 -0
- package/dist/components/Slide/utils/imageOnlyStepVisualReady.es.js.map +1 -0
- package/dist/components/Slide/utils/interactionPlayback.cjs.js +1 -1
- package/dist/components/Slide/utils/interactionPlayback.cjs.js.map +1 -1
- package/dist/components/Slide/utils/interactionPlayback.d.ts +8 -0
- package/dist/components/Slide/utils/interactionPlayback.es.js +9 -2
- package/dist/components/Slide/utils/interactionPlayback.es.js.map +1 -1
- package/dist/components/Slide/utils/interactionResolution.cjs.js +2 -0
- package/dist/components/Slide/utils/interactionResolution.cjs.js.map +1 -0
- package/dist/components/Slide/utils/interactionResolution.d.ts +13 -0
- package/dist/components/Slide/utils/interactionResolution.es.js +33 -0
- package/dist/components/Slide/utils/interactionResolution.es.js.map +1 -0
- package/dist/components/Slide/utils/interactionResolution.test.d.ts +1 -0
- package/dist/components/Slide/utils/markdownScaling.cjs.js +2 -0
- package/dist/components/Slide/utils/markdownScaling.cjs.js.map +1 -0
- package/dist/components/Slide/utils/markdownScaling.d.ts +7 -0
- package/dist/components/Slide/utils/markdownScaling.es.js +12 -0
- package/dist/components/Slide/utils/markdownScaling.es.js.map +1 -0
- package/dist/components/Slide/utils/markdownScaling.test.d.ts +1 -0
- package/dist/components/Slide/utils/silentStepAutoAdvance.cjs.js +2 -0
- package/dist/components/Slide/utils/silentStepAutoAdvance.cjs.js.map +1 -0
- package/dist/components/Slide/utils/silentStepAutoAdvance.d.ts +14 -0
- package/dist/components/Slide/utils/silentStepAutoAdvance.es.js +37 -0
- package/dist/components/Slide/utils/silentStepAutoAdvance.es.js.map +1 -0
- package/dist/components/Slide/utils/silentStepAutoAdvance.test.d.ts +1 -0
- package/dist/markdown-flow-ui-lib.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.cjs.js","sources":["../../../src/components/Slide/constants.ts"],"sourcesContent":["export const DEFAULT_FULLSCREEN_HINT_DURATION_MS = 3000;\n\nexport const DEFAULT_IMAGE_ONLY_AUTO_ADVANCE_DELAY_MS = 5000;\n"],"names":["DEFAULT_IMAGE_ONLY_AUTO_ADVANCE_DELAY_MS"],"mappings":"gFAEO,MAAMA,EAA2C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.es.js","sources":["../../../src/components/Slide/constants.ts"],"sourcesContent":["export const DEFAULT_FULLSCREEN_HINT_DURATION_MS = 3000;\n\nexport const DEFAULT_IMAGE_ONLY_AUTO_ADVANCE_DELAY_MS = 5000;\n"],"names":["DEFAULT_IMAGE_ONLY_AUTO_ADVANCE_DELAY_MS"],"mappings":"AAEO,MAAMA,IAA2C;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=15e3,t=e=>{const a=e.contentDocument;return!a||a.readyState!=="complete"?!1:Array.from(a.images??[]).every(r=>r.complete)},n=e=>e.every(t);exports.DEFAULT_IMAGE_ONLY_VISUAL_READY_TIMEOUT_MS=m;exports.areImageOnlyStepIframeVisualsReady=n;exports.isImageOnlyStepIframeVisualReady=t;
|
|
2
|
+
//# sourceMappingURL=imageOnlyStepVisualReady.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imageOnlyStepVisualReady.cjs.js","sources":["../../../../src/components/Slide/utils/imageOnlyStepVisualReady.ts"],"sourcesContent":["export const DEFAULT_IMAGE_ONLY_VISUAL_READY_TIMEOUT_MS = 15000;\n\nexport interface ImageOnlyStepVisualReadyImageLike {\n complete: boolean;\n}\n\nexport interface ImageOnlyStepVisualReadyDocumentLike {\n readyState?: string;\n images?: ArrayLike<ImageOnlyStepVisualReadyImageLike>;\n}\n\nexport interface ImageOnlyStepVisualReadyIframeLike {\n contentDocument?: ImageOnlyStepVisualReadyDocumentLike | null;\n}\n\nexport const isImageOnlyStepIframeVisualReady = (\n iframe: ImageOnlyStepVisualReadyIframeLike\n) => {\n const iframeDocument = iframe.contentDocument;\n\n if (!iframeDocument || iframeDocument.readyState !== \"complete\") {\n return false;\n }\n\n return Array.from(iframeDocument.images ?? []).every(\n (image) => image.complete\n );\n};\n\nexport const areImageOnlyStepIframeVisualsReady = (\n iframes: ImageOnlyStepVisualReadyIframeLike[]\n) => iframes.every(isImageOnlyStepIframeVisualReady);\n"],"names":["DEFAULT_IMAGE_ONLY_VISUAL_READY_TIMEOUT_MS","isImageOnlyStepIframeVisualReady","iframe","iframeDocument","image","areImageOnlyStepIframeVisualsReady","iframes"],"mappings":"gFAAO,MAAMA,EAA6C,KAe7CC,EACXC,GACG,CACH,MAAMC,EAAiBD,EAAO,gBAE9B,MAAI,CAACC,GAAkBA,EAAe,aAAe,WAC5C,GAGF,MAAM,KAAKA,EAAe,QAAU,CAAA,CAAE,EAAE,MAC5CC,GAAUA,EAAM,QAAA,CAErB,EAEaC,EACXC,GACGA,EAAQ,MAAML,CAAgC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const DEFAULT_IMAGE_ONLY_VISUAL_READY_TIMEOUT_MS = 15000;
|
|
2
|
+
export interface ImageOnlyStepVisualReadyImageLike {
|
|
3
|
+
complete: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface ImageOnlyStepVisualReadyDocumentLike {
|
|
6
|
+
readyState?: string;
|
|
7
|
+
images?: ArrayLike<ImageOnlyStepVisualReadyImageLike>;
|
|
8
|
+
}
|
|
9
|
+
export interface ImageOnlyStepVisualReadyIframeLike {
|
|
10
|
+
contentDocument?: ImageOnlyStepVisualReadyDocumentLike | null;
|
|
11
|
+
}
|
|
12
|
+
export declare const isImageOnlyStepIframeVisualReady: (iframe: ImageOnlyStepVisualReadyIframeLike) => boolean;
|
|
13
|
+
export declare const areImageOnlyStepIframeVisualsReady: (iframes: ImageOnlyStepVisualReadyIframeLike[]) => boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const n = 15e3, r = (e) => {
|
|
2
|
+
const t = e.contentDocument;
|
|
3
|
+
return !t || t.readyState !== "complete" ? !1 : Array.from(t.images ?? []).every(
|
|
4
|
+
(a) => a.complete
|
|
5
|
+
);
|
|
6
|
+
}, m = (e) => e.every(r);
|
|
7
|
+
export {
|
|
8
|
+
n as DEFAULT_IMAGE_ONLY_VISUAL_READY_TIMEOUT_MS,
|
|
9
|
+
m as areImageOnlyStepIframeVisualsReady,
|
|
10
|
+
r as isImageOnlyStepIframeVisualReady
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=imageOnlyStepVisualReady.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imageOnlyStepVisualReady.es.js","sources":["../../../../src/components/Slide/utils/imageOnlyStepVisualReady.ts"],"sourcesContent":["export const DEFAULT_IMAGE_ONLY_VISUAL_READY_TIMEOUT_MS = 15000;\n\nexport interface ImageOnlyStepVisualReadyImageLike {\n complete: boolean;\n}\n\nexport interface ImageOnlyStepVisualReadyDocumentLike {\n readyState?: string;\n images?: ArrayLike<ImageOnlyStepVisualReadyImageLike>;\n}\n\nexport interface ImageOnlyStepVisualReadyIframeLike {\n contentDocument?: ImageOnlyStepVisualReadyDocumentLike | null;\n}\n\nexport const isImageOnlyStepIframeVisualReady = (\n iframe: ImageOnlyStepVisualReadyIframeLike\n) => {\n const iframeDocument = iframe.contentDocument;\n\n if (!iframeDocument || iframeDocument.readyState !== \"complete\") {\n return false;\n }\n\n return Array.from(iframeDocument.images ?? []).every(\n (image) => image.complete\n );\n};\n\nexport const areImageOnlyStepIframeVisualsReady = (\n iframes: ImageOnlyStepVisualReadyIframeLike[]\n) => iframes.every(isImageOnlyStepIframeVisualReady);\n"],"names":["DEFAULT_IMAGE_ONLY_VISUAL_READY_TIMEOUT_MS","isImageOnlyStepIframeVisualReady","iframe","iframeDocument","image","areImageOnlyStepIframeVisualsReady","iframes"],"mappings":"AAAO,MAAMA,IAA6C,MAe7CC,IAAmC,CAC9CC,MACG;AACH,QAAMC,IAAiBD,EAAO;AAE9B,SAAI,CAACC,KAAkBA,EAAe,eAAe,aAC5C,KAGF,MAAM,KAAKA,EAAe,UAAU,CAAA,CAAE,EAAE;AAAA,IAC7C,CAACC,MAAUA,EAAM;AAAA,EAAA;AAErB,GAEaC,IAAqC,CAChDC,MACGA,EAAQ,MAAML,CAAgC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=({hasInteraction:e,shouldBlockPlaybackForInteraction:r,shouldOpenInteractionOverlayAfterAudio:t,hasPlaybackContextChanged:n,hasResolvedCurrentInteraction:u,currentStepHasSpeakableElement:l})=>e?r||t||n?!0:u?!l:!1:!1,i=({hasActiveInteraction:e,isInteractionOverlayOpen:r,shouldBlockPlaybackForInteraction:t,playerControlsVisible:n,shouldMountPlayer:u})=>!(!e||!r||t&&u&&!n);exports.shouldPresentInteractionOverlay=a;exports.shouldRenderInteractionOverlay=i;
|
|
2
2
|
//# sourceMappingURL=interactionPlayback.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactionPlayback.cjs.js","sources":["../../../../src/components/Slide/utils/interactionPlayback.ts"],"sourcesContent":["interface ShouldPresentInteractionOverlayParams {\n hasInteraction: boolean;\n shouldBlockPlaybackForInteraction: boolean;\n shouldOpenInteractionOverlayAfterAudio: boolean;\n hasPlaybackContextChanged: boolean;\n hasResolvedCurrentInteraction: boolean;\n currentStepHasSpeakableElement: boolean;\n}\n\nexport const shouldPresentInteractionOverlay = ({\n hasInteraction,\n shouldBlockPlaybackForInteraction,\n shouldOpenInteractionOverlayAfterAudio,\n hasPlaybackContextChanged,\n hasResolvedCurrentInteraction,\n currentStepHasSpeakableElement,\n}: ShouldPresentInteractionOverlayParams) => {\n if (!hasInteraction) {\n return false;\n }\n\n if (shouldBlockPlaybackForInteraction) {\n return true;\n }\n\n if (shouldOpenInteractionOverlayAfterAudio) {\n return true;\n }\n\n // Re-open the interaction entry state whenever playback navigates into\n // the interaction step so the notes action stays highlighted for history\n // playback and manual prev/next navigation.\n if (hasPlaybackContextChanged) {\n return true;\n }\n\n if (!hasResolvedCurrentInteraction) {\n return false;\n }\n\n // Once a resolved interaction step starts receiving follow-up speech,\n // keep the overlay closed so the step can continue as normal playback.\n return !currentStepHasSpeakableElement;\n};\n"],"names":["shouldPresentInteractionOverlay","hasInteraction","shouldBlockPlaybackForInteraction","shouldOpenInteractionOverlayAfterAudio","hasPlaybackContextChanged","hasResolvedCurrentInteraction","currentStepHasSpeakableElement"],"mappings":"gFASO,MAAMA,EAAkC,CAAC,CAC9C,eAAAC,EACA,kCAAAC,EACA,uCAAAC,EACA,0BAAAC,EACA,8BAAAC,EACA,+BAAAC,CACF,IACOL,EAIDC,GAIAC,GAOAC,EACK,GAGJC,EAME,CAACC,EALC,GAnBA"}
|
|
1
|
+
{"version":3,"file":"interactionPlayback.cjs.js","sources":["../../../../src/components/Slide/utils/interactionPlayback.ts"],"sourcesContent":["interface ShouldPresentInteractionOverlayParams {\n hasInteraction: boolean;\n shouldBlockPlaybackForInteraction: boolean;\n shouldOpenInteractionOverlayAfterAudio: boolean;\n hasPlaybackContextChanged: boolean;\n hasResolvedCurrentInteraction: boolean;\n currentStepHasSpeakableElement: boolean;\n}\n\nexport const shouldPresentInteractionOverlay = ({\n hasInteraction,\n shouldBlockPlaybackForInteraction,\n shouldOpenInteractionOverlayAfterAudio,\n hasPlaybackContextChanged,\n hasResolvedCurrentInteraction,\n currentStepHasSpeakableElement,\n}: ShouldPresentInteractionOverlayParams) => {\n if (!hasInteraction) {\n return false;\n }\n\n if (shouldBlockPlaybackForInteraction) {\n return true;\n }\n\n if (shouldOpenInteractionOverlayAfterAudio) {\n return true;\n }\n\n // Re-open the interaction entry state whenever playback navigates into\n // the interaction step so the notes action stays highlighted for history\n // playback and manual prev/next navigation.\n if (hasPlaybackContextChanged) {\n return true;\n }\n\n if (!hasResolvedCurrentInteraction) {\n return false;\n }\n\n // Once a resolved interaction step starts receiving follow-up speech,\n // keep the overlay closed so the step can continue as normal playback.\n return !currentStepHasSpeakableElement;\n};\n\nexport interface ShouldRenderInteractionOverlayParams {\n hasActiveInteraction: boolean;\n isInteractionOverlayOpen: boolean;\n shouldBlockPlaybackForInteraction: boolean;\n playerControlsVisible: boolean;\n shouldMountPlayer: boolean;\n}\n\nexport const shouldRenderInteractionOverlay = ({\n hasActiveInteraction,\n isInteractionOverlayOpen,\n shouldBlockPlaybackForInteraction,\n playerControlsVisible,\n shouldMountPlayer,\n}: ShouldRenderInteractionOverlayParams) => {\n if (!hasActiveInteraction || !isInteractionOverlayOpen) {\n return false;\n }\n\n if (\n shouldBlockPlaybackForInteraction &&\n shouldMountPlayer &&\n !playerControlsVisible\n ) {\n return false;\n }\n\n return true;\n};\n"],"names":["shouldPresentInteractionOverlay","hasInteraction","shouldBlockPlaybackForInteraction","shouldOpenInteractionOverlayAfterAudio","hasPlaybackContextChanged","hasResolvedCurrentInteraction","currentStepHasSpeakableElement","shouldRenderInteractionOverlay","hasActiveInteraction","isInteractionOverlayOpen","playerControlsVisible","shouldMountPlayer"],"mappings":"gFASO,MAAMA,EAAkC,CAAC,CAC9C,eAAAC,EACA,kCAAAC,EACA,uCAAAC,EACA,0BAAAC,EACA,8BAAAC,EACA,+BAAAC,CACF,IACOL,EAIDC,GAIAC,GAOAC,EACK,GAGJC,EAME,CAACC,EALC,GAnBA,GAmCEC,EAAiC,CAAC,CAC7C,qBAAAC,EACA,yBAAAC,EACA,kCAAAP,EACA,sBAAAQ,EACA,kBAAAC,CACF,IACM,GAACH,GAAwB,CAACC,GAK5BP,GACAS,GACA,CAACD"}
|
|
@@ -7,4 +7,12 @@ interface ShouldPresentInteractionOverlayParams {
|
|
|
7
7
|
currentStepHasSpeakableElement: boolean;
|
|
8
8
|
}
|
|
9
9
|
export declare const shouldPresentInteractionOverlay: ({ hasInteraction, shouldBlockPlaybackForInteraction, shouldOpenInteractionOverlayAfterAudio, hasPlaybackContextChanged, hasResolvedCurrentInteraction, currentStepHasSpeakableElement, }: ShouldPresentInteractionOverlayParams) => boolean;
|
|
10
|
+
export interface ShouldRenderInteractionOverlayParams {
|
|
11
|
+
hasActiveInteraction: boolean;
|
|
12
|
+
isInteractionOverlayOpen: boolean;
|
|
13
|
+
shouldBlockPlaybackForInteraction: boolean;
|
|
14
|
+
playerControlsVisible: boolean;
|
|
15
|
+
shouldMountPlayer: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const shouldRenderInteractionOverlay: ({ hasActiveInteraction, isInteractionOverlayOpen, shouldBlockPlaybackForInteraction, playerControlsVisible, shouldMountPlayer, }: ShouldRenderInteractionOverlayParams) => boolean;
|
|
10
18
|
export {};
|
|
@@ -5,8 +5,15 @@ const i = ({
|
|
|
5
5
|
hasPlaybackContextChanged: n,
|
|
6
6
|
hasResolvedCurrentInteraction: u,
|
|
7
7
|
currentStepHasSpeakableElement: f
|
|
8
|
-
}) => r ? e || t || n ? !0 : u ? !f : !1 : !1
|
|
8
|
+
}) => r ? e || t || n ? !0 : u ? !f : !1 : !1, s = ({
|
|
9
|
+
hasActiveInteraction: r,
|
|
10
|
+
isInteractionOverlayOpen: e,
|
|
11
|
+
shouldBlockPlaybackForInteraction: t,
|
|
12
|
+
playerControlsVisible: n,
|
|
13
|
+
shouldMountPlayer: u
|
|
14
|
+
}) => !(!r || !e || t && u && !n);
|
|
9
15
|
export {
|
|
10
|
-
i as shouldPresentInteractionOverlay
|
|
16
|
+
i as shouldPresentInteractionOverlay,
|
|
17
|
+
s as shouldRenderInteractionOverlay
|
|
11
18
|
};
|
|
12
19
|
//# sourceMappingURL=interactionPlayback.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactionPlayback.es.js","sources":["../../../../src/components/Slide/utils/interactionPlayback.ts"],"sourcesContent":["interface ShouldPresentInteractionOverlayParams {\n hasInteraction: boolean;\n shouldBlockPlaybackForInteraction: boolean;\n shouldOpenInteractionOverlayAfterAudio: boolean;\n hasPlaybackContextChanged: boolean;\n hasResolvedCurrentInteraction: boolean;\n currentStepHasSpeakableElement: boolean;\n}\n\nexport const shouldPresentInteractionOverlay = ({\n hasInteraction,\n shouldBlockPlaybackForInteraction,\n shouldOpenInteractionOverlayAfterAudio,\n hasPlaybackContextChanged,\n hasResolvedCurrentInteraction,\n currentStepHasSpeakableElement,\n}: ShouldPresentInteractionOverlayParams) => {\n if (!hasInteraction) {\n return false;\n }\n\n if (shouldBlockPlaybackForInteraction) {\n return true;\n }\n\n if (shouldOpenInteractionOverlayAfterAudio) {\n return true;\n }\n\n // Re-open the interaction entry state whenever playback navigates into\n // the interaction step so the notes action stays highlighted for history\n // playback and manual prev/next navigation.\n if (hasPlaybackContextChanged) {\n return true;\n }\n\n if (!hasResolvedCurrentInteraction) {\n return false;\n }\n\n // Once a resolved interaction step starts receiving follow-up speech,\n // keep the overlay closed so the step can continue as normal playback.\n return !currentStepHasSpeakableElement;\n};\n"],"names":["shouldPresentInteractionOverlay","hasInteraction","shouldBlockPlaybackForInteraction","shouldOpenInteractionOverlayAfterAudio","hasPlaybackContextChanged","hasResolvedCurrentInteraction","currentStepHasSpeakableElement"],"mappings":"AASO,MAAMA,IAAkC,CAAC;AAAA,EAC9C,gBAAAC;AAAA,EACA,mCAAAC;AAAA,EACA,wCAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,+BAAAC;AAAA,EACA,gCAAAC;AACF,MACOL,IAIDC,KAIAC,KAOAC,IACK,KAGJC,IAME,CAACC,IALC,KAnBA;"}
|
|
1
|
+
{"version":3,"file":"interactionPlayback.es.js","sources":["../../../../src/components/Slide/utils/interactionPlayback.ts"],"sourcesContent":["interface ShouldPresentInteractionOverlayParams {\n hasInteraction: boolean;\n shouldBlockPlaybackForInteraction: boolean;\n shouldOpenInteractionOverlayAfterAudio: boolean;\n hasPlaybackContextChanged: boolean;\n hasResolvedCurrentInteraction: boolean;\n currentStepHasSpeakableElement: boolean;\n}\n\nexport const shouldPresentInteractionOverlay = ({\n hasInteraction,\n shouldBlockPlaybackForInteraction,\n shouldOpenInteractionOverlayAfterAudio,\n hasPlaybackContextChanged,\n hasResolvedCurrentInteraction,\n currentStepHasSpeakableElement,\n}: ShouldPresentInteractionOverlayParams) => {\n if (!hasInteraction) {\n return false;\n }\n\n if (shouldBlockPlaybackForInteraction) {\n return true;\n }\n\n if (shouldOpenInteractionOverlayAfterAudio) {\n return true;\n }\n\n // Re-open the interaction entry state whenever playback navigates into\n // the interaction step so the notes action stays highlighted for history\n // playback and manual prev/next navigation.\n if (hasPlaybackContextChanged) {\n return true;\n }\n\n if (!hasResolvedCurrentInteraction) {\n return false;\n }\n\n // Once a resolved interaction step starts receiving follow-up speech,\n // keep the overlay closed so the step can continue as normal playback.\n return !currentStepHasSpeakableElement;\n};\n\nexport interface ShouldRenderInteractionOverlayParams {\n hasActiveInteraction: boolean;\n isInteractionOverlayOpen: boolean;\n shouldBlockPlaybackForInteraction: boolean;\n playerControlsVisible: boolean;\n shouldMountPlayer: boolean;\n}\n\nexport const shouldRenderInteractionOverlay = ({\n hasActiveInteraction,\n isInteractionOverlayOpen,\n shouldBlockPlaybackForInteraction,\n playerControlsVisible,\n shouldMountPlayer,\n}: ShouldRenderInteractionOverlayParams) => {\n if (!hasActiveInteraction || !isInteractionOverlayOpen) {\n return false;\n }\n\n if (\n shouldBlockPlaybackForInteraction &&\n shouldMountPlayer &&\n !playerControlsVisible\n ) {\n return false;\n }\n\n return true;\n};\n"],"names":["shouldPresentInteractionOverlay","hasInteraction","shouldBlockPlaybackForInteraction","shouldOpenInteractionOverlayAfterAudio","hasPlaybackContextChanged","hasResolvedCurrentInteraction","currentStepHasSpeakableElement","shouldRenderInteractionOverlay","hasActiveInteraction","isInteractionOverlayOpen","playerControlsVisible","shouldMountPlayer"],"mappings":"AASO,MAAMA,IAAkC,CAAC;AAAA,EAC9C,gBAAAC;AAAA,EACA,mCAAAC;AAAA,EACA,wCAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,+BAAAC;AAAA,EACA,gCAAAC;AACF,MACOL,IAIDC,KAIAC,KAOAC,IACK,KAGJC,IAME,CAACC,IALC,KAnBA,IAmCEC,IAAiC,CAAC;AAAA,EAC7C,sBAAAC;AAAA,EACA,0BAAAC;AAAA,EACA,mCAAAP;AAAA,EACA,uBAAAQ;AAAA,EACA,mBAAAC;AACF,MACM,GAACH,KAAwB,CAACC,KAK5BP,KACAS,KACA,CAACD;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../../../lib/interaction-defaults.cjs.js"),i=(e,a={})=>{const{interactionDefaultValueOptions:s}=a;if(!e)return{interactionDefaults:{},interactionDefaultSelectedValues:void 0,hasResolvedInteractionInput:!1,isInteractionReadonly:!1,shouldAutoContinueInteraction:!1};const t=typeof e.content=="string"?e.content:void 0,o=!!e.user_input?.trim(),n=o?void 0:s;return{interactionDefaults:u.getInteractionDefaultValues(t,e.user_input,n),interactionDefaultSelectedValues:u.getInteractionDefaultSelectedValues(t,e.user_input,n),hasResolvedInteractionInput:o,isInteractionReadonly:!!e.readonly,shouldAutoContinueInteraction:!!e.readonly}};exports.resolveSlideInteractionState=i;
|
|
2
|
+
//# sourceMappingURL=interactionResolution.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactionResolution.cjs.js","sources":["../../../../src/components/Slide/utils/interactionResolution.ts"],"sourcesContent":["import {\n getInteractionDefaultSelectedValues,\n getInteractionDefaultValues,\n type InteractionDefaultValueOptions,\n} from \"../../../lib/interaction-defaults\";\nimport type { Element } from \"../types\";\n\ninterface ResolveSlideInteractionStateOptions {\n interactionDefaultValueOptions?: InteractionDefaultValueOptions;\n}\n\nexport const resolveSlideInteractionState = (\n activeInteractionElement?: Element,\n options: ResolveSlideInteractionStateOptions = {}\n) => {\n const { interactionDefaultValueOptions } = options;\n if (!activeInteractionElement) {\n return {\n interactionDefaults: {},\n interactionDefaultSelectedValues: undefined,\n hasResolvedInteractionInput: false,\n isInteractionReadonly: false,\n shouldAutoContinueInteraction: false,\n };\n }\n\n const interactionContent =\n typeof activeInteractionElement.content === \"string\"\n ? activeInteractionElement.content\n : undefined;\n const hasResolvedInteractionInput = Boolean(\n activeInteractionElement.user_input?.trim()\n );\n const effectiveDefaultValueOptions = hasResolvedInteractionInput\n ? undefined\n : interactionDefaultValueOptions;\n\n return {\n interactionDefaults: getInteractionDefaultValues(\n interactionContent,\n activeInteractionElement.user_input,\n effectiveDefaultValueOptions\n ),\n interactionDefaultSelectedValues: getInteractionDefaultSelectedValues(\n interactionContent,\n activeInteractionElement.user_input,\n effectiveDefaultValueOptions\n ),\n hasResolvedInteractionInput,\n isInteractionReadonly: Boolean(activeInteractionElement.readonly),\n // Keep auto-continue only for passive markers that are explicitly readonly.\n shouldAutoContinueInteraction: Boolean(activeInteractionElement.readonly),\n };\n};\n"],"names":["resolveSlideInteractionState","activeInteractionElement","options","interactionDefaultValueOptions","interactionContent","hasResolvedInteractionInput","effectiveDefaultValueOptions","getInteractionDefaultValues","getInteractionDefaultSelectedValues"],"mappings":"4IAWaA,EAA+B,CAC1CC,EACAC,EAA+C,KAC5C,CACH,KAAM,CAAE,+BAAAC,GAAmCD,EAC3C,GAAI,CAACD,EACH,MAAO,CACL,oBAAqB,CAAA,EACrB,iCAAkC,OAClC,4BAA6B,GAC7B,sBAAuB,GACvB,8BAA+B,EAAA,EAInC,MAAMG,EACJ,OAAOH,EAAyB,SAAY,SACxCA,EAAyB,QACzB,OACAI,EAA8B,EAClCJ,EAAyB,YAAY,KAAA,EAEjCK,EAA+BD,EACjC,OACAF,EAEJ,MAAO,CACL,oBAAqBI,EAAAA,4BACnBH,EACAH,EAAyB,WACzBK,CAAA,EAEF,iCAAkCE,EAAAA,oCAChCJ,EACAH,EAAyB,WACzBK,CAAA,EAEF,4BAAAD,EACA,sBAAuB,EAAQJ,EAAyB,SAExD,8BAA+B,EAAQA,EAAyB,QAAQ,CAE5E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InteractionDefaultValueOptions } from '../../../lib/interaction-defaults';
|
|
2
|
+
import { Element } from '../types';
|
|
3
|
+
interface ResolveSlideInteractionStateOptions {
|
|
4
|
+
interactionDefaultValueOptions?: InteractionDefaultValueOptions;
|
|
5
|
+
}
|
|
6
|
+
export declare const resolveSlideInteractionState: (activeInteractionElement?: Element, options?: ResolveSlideInteractionStateOptions) => {
|
|
7
|
+
interactionDefaults: import('..').InteractionDefaultValues;
|
|
8
|
+
interactionDefaultSelectedValues: string[] | undefined;
|
|
9
|
+
hasResolvedInteractionInput: boolean;
|
|
10
|
+
isInteractionReadonly: boolean;
|
|
11
|
+
shouldAutoContinueInteraction: boolean;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { getInteractionDefaultSelectedValues as a, getInteractionDefaultValues as l } from "../../../lib/interaction-defaults.es.js";
|
|
2
|
+
const r = (t, u = {}) => {
|
|
3
|
+
const { interactionDefaultValueOptions: s } = u;
|
|
4
|
+
if (!t)
|
|
5
|
+
return {
|
|
6
|
+
interactionDefaults: {},
|
|
7
|
+
interactionDefaultSelectedValues: void 0,
|
|
8
|
+
hasResolvedInteractionInput: !1,
|
|
9
|
+
isInteractionReadonly: !1,
|
|
10
|
+
shouldAutoContinueInteraction: !1
|
|
11
|
+
};
|
|
12
|
+
const e = typeof t.content == "string" ? t.content : void 0, o = !!t.user_input?.trim(), n = o ? void 0 : s;
|
|
13
|
+
return {
|
|
14
|
+
interactionDefaults: l(
|
|
15
|
+
e,
|
|
16
|
+
t.user_input,
|
|
17
|
+
n
|
|
18
|
+
),
|
|
19
|
+
interactionDefaultSelectedValues: a(
|
|
20
|
+
e,
|
|
21
|
+
t.user_input,
|
|
22
|
+
n
|
|
23
|
+
),
|
|
24
|
+
hasResolvedInteractionInput: o,
|
|
25
|
+
isInteractionReadonly: !!t.readonly,
|
|
26
|
+
// Keep auto-continue only for passive markers that are explicitly readonly.
|
|
27
|
+
shouldAutoContinueInteraction: !!t.readonly
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
r as resolveSlideInteractionState
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=interactionResolution.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactionResolution.es.js","sources":["../../../../src/components/Slide/utils/interactionResolution.ts"],"sourcesContent":["import {\n getInteractionDefaultSelectedValues,\n getInteractionDefaultValues,\n type InteractionDefaultValueOptions,\n} from \"../../../lib/interaction-defaults\";\nimport type { Element } from \"../types\";\n\ninterface ResolveSlideInteractionStateOptions {\n interactionDefaultValueOptions?: InteractionDefaultValueOptions;\n}\n\nexport const resolveSlideInteractionState = (\n activeInteractionElement?: Element,\n options: ResolveSlideInteractionStateOptions = {}\n) => {\n const { interactionDefaultValueOptions } = options;\n if (!activeInteractionElement) {\n return {\n interactionDefaults: {},\n interactionDefaultSelectedValues: undefined,\n hasResolvedInteractionInput: false,\n isInteractionReadonly: false,\n shouldAutoContinueInteraction: false,\n };\n }\n\n const interactionContent =\n typeof activeInteractionElement.content === \"string\"\n ? activeInteractionElement.content\n : undefined;\n const hasResolvedInteractionInput = Boolean(\n activeInteractionElement.user_input?.trim()\n );\n const effectiveDefaultValueOptions = hasResolvedInteractionInput\n ? undefined\n : interactionDefaultValueOptions;\n\n return {\n interactionDefaults: getInteractionDefaultValues(\n interactionContent,\n activeInteractionElement.user_input,\n effectiveDefaultValueOptions\n ),\n interactionDefaultSelectedValues: getInteractionDefaultSelectedValues(\n interactionContent,\n activeInteractionElement.user_input,\n effectiveDefaultValueOptions\n ),\n hasResolvedInteractionInput,\n isInteractionReadonly: Boolean(activeInteractionElement.readonly),\n // Keep auto-continue only for passive markers that are explicitly readonly.\n shouldAutoContinueInteraction: Boolean(activeInteractionElement.readonly),\n };\n};\n"],"names":["resolveSlideInteractionState","activeInteractionElement","options","interactionDefaultValueOptions","interactionContent","hasResolvedInteractionInput","effectiveDefaultValueOptions","getInteractionDefaultValues","getInteractionDefaultSelectedValues"],"mappings":";AAWO,MAAMA,IAA+B,CAC1CC,GACAC,IAA+C,OAC5C;AACH,QAAM,EAAE,gCAAAC,MAAmCD;AAC3C,MAAI,CAACD;AACH,WAAO;AAAA,MACL,qBAAqB,CAAA;AAAA,MACrB,kCAAkC;AAAA,MAClC,6BAA6B;AAAA,MAC7B,uBAAuB;AAAA,MACvB,+BAA+B;AAAA,IAAA;AAInC,QAAMG,IACJ,OAAOH,EAAyB,WAAY,WACxCA,EAAyB,UACzB,QACAI,IAA8B,EAClCJ,EAAyB,YAAY,KAAA,GAEjCK,IAA+BD,IACjC,SACAF;AAEJ,SAAO;AAAA,IACL,qBAAqBI;AAAA,MACnBH;AAAA,MACAH,EAAyB;AAAA,MACzBK;AAAA,IAAA;AAAA,IAEF,kCAAkCE;AAAA,MAChCJ;AAAA,MACAH,EAAyB;AAAA,MACzBK;AAAA,IAAA;AAAA,IAEF,6BAAAD;AAAA,IACA,uBAAuB,EAAQJ,EAAyB;AAAA;AAAA,IAExD,+BAA+B,EAAQA,EAAyB;AAAA,EAAQ;AAE5E;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=e=>e.type!=="html"&&e.type!=="slot",o=e=>{const t=e.filter(l=>l.is_renderable!==!1),n=t.filter(r).length;return n===0?"disabled":n===t.length?"fit":"base"};exports.resolveMarkdownScalingMode=o;
|
|
2
|
+
//# sourceMappingURL=markdownScaling.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdownScaling.cjs.js","sources":["../../../../src/components/Slide/utils/markdownScaling.ts"],"sourcesContent":["import type { Element } from \"../types\";\n\nconst isMarkdownRenderedElement = (element: Element) =>\n element.type !== \"html\" && element.type !== \"slot\";\n\nexport type MarkdownScalingMode = \"base\" | \"disabled\" | \"fit\";\n\n/**\n * Fully fits Markdown-only pages. Mixed pages still receive the viewport base\n * font-size while retaining their existing HTML/slot layout and scroll model.\n */\nexport const resolveMarkdownScalingMode = (\n elementList: Element[]\n): MarkdownScalingMode => {\n const visibleElements = elementList.filter(\n (element) => element.is_renderable !== false\n );\n const markdownElementCount = visibleElements.filter(\n isMarkdownRenderedElement\n ).length;\n\n if (markdownElementCount === 0) {\n return \"disabled\";\n }\n\n return markdownElementCount === visibleElements.length ? \"fit\" : \"base\";\n};\n"],"names":["isMarkdownRenderedElement","element","resolveMarkdownScalingMode","elementList","visibleElements","markdownElementCount"],"mappings":"gFAEA,MAAMA,EAA6BC,GACjCA,EAAQ,OAAS,QAAUA,EAAQ,OAAS,OAQjCC,EACXC,GACwB,CACxB,MAAMC,EAAkBD,EAAY,OACjCF,GAAYA,EAAQ,gBAAkB,EAAA,EAEnCI,EAAuBD,EAAgB,OAC3CJ,CAAA,EACA,OAEF,OAAIK,IAAyB,EACpB,WAGFA,IAAyBD,EAAgB,OAAS,MAAQ,MACnE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Element } from '../types';
|
|
2
|
+
export type MarkdownScalingMode = "base" | "disabled" | "fit";
|
|
3
|
+
/**
|
|
4
|
+
* Fully fits Markdown-only pages. Mixed pages still receive the viewport base
|
|
5
|
+
* font-size while retaining their existing HTML/slot layout and scroll model.
|
|
6
|
+
*/
|
|
7
|
+
export declare const resolveMarkdownScalingMode: (elementList: Element[]) => MarkdownScalingMode;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const r = (e) => e.type !== "html" && e.type !== "slot", s = (e) => {
|
|
2
|
+
const t = e.filter(
|
|
3
|
+
(l) => l.is_renderable !== !1
|
|
4
|
+
), n = t.filter(
|
|
5
|
+
r
|
|
6
|
+
).length;
|
|
7
|
+
return n === 0 ? "disabled" : n === t.length ? "fit" : "base";
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
s as resolveMarkdownScalingMode
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=markdownScaling.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdownScaling.es.js","sources":["../../../../src/components/Slide/utils/markdownScaling.ts"],"sourcesContent":["import type { Element } from \"../types\";\n\nconst isMarkdownRenderedElement = (element: Element) =>\n element.type !== \"html\" && element.type !== \"slot\";\n\nexport type MarkdownScalingMode = \"base\" | \"disabled\" | \"fit\";\n\n/**\n * Fully fits Markdown-only pages. Mixed pages still receive the viewport base\n * font-size while retaining their existing HTML/slot layout and scroll model.\n */\nexport const resolveMarkdownScalingMode = (\n elementList: Element[]\n): MarkdownScalingMode => {\n const visibleElements = elementList.filter(\n (element) => element.is_renderable !== false\n );\n const markdownElementCount = visibleElements.filter(\n isMarkdownRenderedElement\n ).length;\n\n if (markdownElementCount === 0) {\n return \"disabled\";\n }\n\n return markdownElementCount === visibleElements.length ? \"fit\" : \"base\";\n};\n"],"names":["isMarkdownRenderedElement","element","resolveMarkdownScalingMode","elementList","visibleElements","markdownElementCount"],"mappings":"AAEA,MAAMA,IAA4B,CAACC,MACjCA,EAAQ,SAAS,UAAUA,EAAQ,SAAS,QAQjCC,IAA6B,CACxCC,MACwB;AACxB,QAAMC,IAAkBD,EAAY;AAAA,IAClC,CAACF,MAAYA,EAAQ,kBAAkB;AAAA,EAAA,GAEnCI,IAAuBD,EAAgB;AAAA,IAC3CJ;AAAA,EAAA,EACA;AAEF,SAAIK,MAAyB,IACpB,aAGFA,MAAyBD,EAAgB,SAAS,QAAQ;AACnE;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../constants.cjs.js"),a=new Set(["img","md_img","svg"]),c=/<(img|svg)\b[^>]*>/i,i=/<!--[\s\S]*?-->/g,_=/<script\b[^>]*>[\s\S]*?<\/script>/gi,E=/<style\b[^>]*>[\s\S]*?<\/style>/gi,p=/<\/?\s*[a-zA-Z][a-zA-Z0-9:_-]*\b[^>]*>/g,A=/&(?:nbsp|ensp|emsp|thinsp|zwnj|zwj);/gi,T=/[\p{L}\p{N}]/u,S=e=>!!e&&!e?.is_marker&&e?.is_renderable!==!1,g=e=>T.test(e.replace(i," ").replace(_," ").replace(E," ").replace(p," ").replace(A," ").trim()),u=e=>e.type!=="html"||typeof e.content!="string"?!1:c.test(e.content)&&!g(e.content),r=({currentElementList:e,currentStepHasSpeakableElement:n,currentInteractionElement:o})=>{if(n||o)return!1;const s=e.filter(S);return s.length===0?!1:s.every(t=>a.has(t.type)||u(t))},M=({currentElementList:e,currentStepHasSpeakableElement:n,currentInteractionElement:o,markerAutoAdvanceDelay:s})=>{const t=r({currentElementList:e,currentStepHasSpeakableElement:n,currentInteractionElement:o});return{delayMs:t?l.DEFAULT_IMAGE_ONLY_AUTO_ADVANCE_DELAY_MS:s,usesImageOnlyDelay:t}};exports.resolveSilentStepAutoAdvanceBehavior=M;exports.shouldUseImageOnlySilentStepAutoAdvanceDelay=r;
|
|
2
|
+
//# sourceMappingURL=silentStepAutoAdvance.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"silentStepAutoAdvance.cjs.js","sources":["../../../../src/components/Slide/utils/silentStepAutoAdvance.ts"],"sourcesContent":["import type { Element } from \"../types\";\n\nimport { DEFAULT_IMAGE_ONLY_AUTO_ADVANCE_DELAY_MS } from \"../constants\";\n\nconst IMAGE_ONLY_ELEMENT_TYPES = new Set([\"img\", \"md_img\", \"svg\"]);\nconst COMPLETE_IMAGE_TAG_PATTERN = /<(img|svg)\\b[^>]*>/i;\nconst HTML_COMMENT_RE = /<!--[\\s\\S]*?-->/g;\nconst HTML_SCRIPT_RE = /<script\\b[^>]*>[\\s\\S]*?<\\/script>/gi;\nconst HTML_STYLE_RE = /<style\\b[^>]*>[\\s\\S]*?<\\/style>/gi;\nconst HTML_TAG_RE = /<\\/?\\s*[a-zA-Z][a-zA-Z0-9:_-]*\\b[^>]*>/g;\nconst HTML_SPACE_ENTITY_RE = /&(?:nbsp|ensp|emsp|thinsp|zwnj|zwj);/gi;\nconst MEANINGFUL_TEXT_RE = /[\\p{L}\\p{N}]/u;\n\nexport interface SilentStepAutoAdvanceDelayParams {\n currentElementList: Element[];\n currentStepHasSpeakableElement: boolean;\n currentInteractionElement?: Element;\n markerAutoAdvanceDelay: number;\n}\n\nexport interface SilentStepAutoAdvanceBehavior {\n delayMs: number;\n usesImageOnlyDelay: boolean;\n}\n\nconst isRenderableStepContentElement = (element?: Element) =>\n Boolean(element) && !element?.is_marker && element?.is_renderable !== false;\n\nconst hasMeaningfulHtmlText = (content: string) =>\n MEANINGFUL_TEXT_RE.test(\n content\n .replace(HTML_COMMENT_RE, \" \")\n .replace(HTML_SCRIPT_RE, \" \")\n .replace(HTML_STYLE_RE, \" \")\n .replace(HTML_TAG_RE, \" \")\n .replace(HTML_SPACE_ENTITY_RE, \" \")\n .trim()\n );\n\nconst isImageOnlyHtmlElement = (element: Element) => {\n if (element.type !== \"html\" || typeof element.content !== \"string\") {\n return false;\n }\n\n return (\n COMPLETE_IMAGE_TAG_PATTERN.test(element.content) &&\n !hasMeaningfulHtmlText(element.content)\n );\n};\n\nexport const shouldUseImageOnlySilentStepAutoAdvanceDelay = ({\n currentElementList,\n currentStepHasSpeakableElement,\n currentInteractionElement,\n}: Omit<SilentStepAutoAdvanceDelayParams, \"markerAutoAdvanceDelay\">) => {\n if (currentStepHasSpeakableElement || currentInteractionElement) {\n return false;\n }\n\n const stepContentElements = currentElementList.filter(\n isRenderableStepContentElement\n );\n\n if (stepContentElements.length === 0) {\n return false;\n }\n\n return stepContentElements.every(\n (element) =>\n IMAGE_ONLY_ELEMENT_TYPES.has(element.type) ||\n isImageOnlyHtmlElement(element)\n );\n};\n\nexport const resolveSilentStepAutoAdvanceDelay = ({\n currentElementList,\n currentStepHasSpeakableElement,\n currentInteractionElement,\n markerAutoAdvanceDelay,\n}: SilentStepAutoAdvanceDelayParams) =>\n resolveSilentStepAutoAdvanceBehavior({\n currentElementList,\n currentStepHasSpeakableElement,\n currentInteractionElement,\n markerAutoAdvanceDelay,\n }).delayMs;\n\nexport const resolveSilentStepAutoAdvanceBehavior = ({\n currentElementList,\n currentStepHasSpeakableElement,\n currentInteractionElement,\n markerAutoAdvanceDelay,\n}: SilentStepAutoAdvanceDelayParams): SilentStepAutoAdvanceBehavior => {\n const usesImageOnlyDelay = shouldUseImageOnlySilentStepAutoAdvanceDelay({\n currentElementList,\n currentStepHasSpeakableElement,\n currentInteractionElement,\n });\n\n return {\n delayMs: usesImageOnlyDelay\n ? DEFAULT_IMAGE_ONLY_AUTO_ADVANCE_DELAY_MS\n : markerAutoAdvanceDelay,\n usesImageOnlyDelay,\n };\n};\n"],"names":["IMAGE_ONLY_ELEMENT_TYPES","COMPLETE_IMAGE_TAG_PATTERN","HTML_COMMENT_RE","HTML_SCRIPT_RE","HTML_STYLE_RE","HTML_TAG_RE","HTML_SPACE_ENTITY_RE","MEANINGFUL_TEXT_RE","isRenderableStepContentElement","element","hasMeaningfulHtmlText","content","isImageOnlyHtmlElement","shouldUseImageOnlySilentStepAutoAdvanceDelay","currentElementList","currentStepHasSpeakableElement","currentInteractionElement","stepContentElements","resolveSilentStepAutoAdvanceBehavior","markerAutoAdvanceDelay","usesImageOnlyDelay","DEFAULT_IMAGE_ONLY_AUTO_ADVANCE_DELAY_MS"],"mappings":"uHAIMA,EAA2B,IAAI,IAAI,CAAC,MAAO,SAAU,KAAK,CAAC,EAC3DC,EAA6B,sBAC7BC,EAAkB,mBAClBC,EAAiB,sCACjBC,EAAgB,oCAChBC,EAAc,0CACdC,EAAuB,yCACvBC,EAAqB,gBAcrBC,EAAkCC,GACtC,EAAQA,GAAY,CAACA,GAAS,WAAaA,GAAS,gBAAkB,GAElEC,EAAyBC,GAC7BJ,EAAmB,KACjBI,EACG,QAAQT,EAAiB,GAAG,EAC5B,QAAQC,EAAgB,GAAG,EAC3B,QAAQC,EAAe,GAAG,EAC1B,QAAQC,EAAa,GAAG,EACxB,QAAQC,EAAsB,GAAG,EACjC,KAAA,CACL,EAEIM,EAA0BH,GAC1BA,EAAQ,OAAS,QAAU,OAAOA,EAAQ,SAAY,SACjD,GAIPR,EAA2B,KAAKQ,EAAQ,OAAO,GAC/C,CAACC,EAAsBD,EAAQ,OAAO,EAI7BI,EAA+C,CAAC,CAC3D,mBAAAC,EACA,+BAAAC,EACA,0BAAAC,CACF,IAAwE,CACtE,GAAID,GAAkCC,EACpC,MAAO,GAGT,MAAMC,EAAsBH,EAAmB,OAC7CN,CAAA,EAGF,OAAIS,EAAoB,SAAW,EAC1B,GAGFA,EAAoB,MACxBR,GACCT,EAAyB,IAAIS,EAAQ,IAAI,GACzCG,EAAuBH,CAAO,CAAA,CAEpC,EAeaS,EAAuC,CAAC,CACnD,mBAAAJ,EACA,+BAAAC,EACA,0BAAAC,EACA,uBAAAG,CACF,IAAuE,CACrE,MAAMC,EAAqBP,EAA6C,CACtE,mBAAAC,EACA,+BAAAC,EACA,0BAAAC,CAAA,CACD,EAED,MAAO,CACL,QAASI,EACLC,EAAAA,yCACAF,EACJ,mBAAAC,CAAA,CAEJ"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Element } from '../types';
|
|
2
|
+
export interface SilentStepAutoAdvanceDelayParams {
|
|
3
|
+
currentElementList: Element[];
|
|
4
|
+
currentStepHasSpeakableElement: boolean;
|
|
5
|
+
currentInteractionElement?: Element;
|
|
6
|
+
markerAutoAdvanceDelay: number;
|
|
7
|
+
}
|
|
8
|
+
export interface SilentStepAutoAdvanceBehavior {
|
|
9
|
+
delayMs: number;
|
|
10
|
+
usesImageOnlyDelay: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const shouldUseImageOnlySilentStepAutoAdvanceDelay: ({ currentElementList, currentStepHasSpeakableElement, currentInteractionElement, }: Omit<SilentStepAutoAdvanceDelayParams, "markerAutoAdvanceDelay">) => boolean;
|
|
13
|
+
export declare const resolveSilentStepAutoAdvanceDelay: ({ currentElementList, currentStepHasSpeakableElement, currentInteractionElement, markerAutoAdvanceDelay, }: SilentStepAutoAdvanceDelayParams) => number;
|
|
14
|
+
export declare const resolveSilentStepAutoAdvanceBehavior: ({ currentElementList, currentStepHasSpeakableElement, currentInteractionElement, markerAutoAdvanceDelay, }: SilentStepAutoAdvanceDelayParams) => SilentStepAutoAdvanceBehavior;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DEFAULT_IMAGE_ONLY_AUTO_ADVANCE_DELAY_MS as o } from "../constants.es.js";
|
|
2
|
+
const _ = /* @__PURE__ */ new Set(["img", "md_img", "svg"]), E = /<(img|svg)\b[^>]*>/i, a = /<!--[\s\S]*?-->/g, c = /<script\b[^>]*>[\s\S]*?<\/script>/gi, l = /<style\b[^>]*>[\s\S]*?<\/style>/gi, i = /<\/?\s*[a-zA-Z][a-zA-Z0-9:_-]*\b[^>]*>/g, p = /&(?:nbsp|ensp|emsp|thinsp|zwnj|zwj);/gi, T = /[\p{L}\p{N}]/u, A = (t) => !!t && !t?.is_marker && t?.is_renderable !== !1, g = (t) => T.test(
|
|
3
|
+
t.replace(a, " ").replace(c, " ").replace(l, " ").replace(i, " ").replace(p, " ").trim()
|
|
4
|
+
), M = (t) => t.type !== "html" || typeof t.content != "string" ? !1 : E.test(t.content) && !g(t.content), L = ({
|
|
5
|
+
currentElementList: t,
|
|
6
|
+
currentStepHasSpeakableElement: n,
|
|
7
|
+
currentInteractionElement: r
|
|
8
|
+
}) => {
|
|
9
|
+
if (n || r)
|
|
10
|
+
return !1;
|
|
11
|
+
const s = t.filter(
|
|
12
|
+
A
|
|
13
|
+
);
|
|
14
|
+
return s.length === 0 ? !1 : s.every(
|
|
15
|
+
(e) => _.has(e.type) || M(e)
|
|
16
|
+
);
|
|
17
|
+
}, m = ({
|
|
18
|
+
currentElementList: t,
|
|
19
|
+
currentStepHasSpeakableElement: n,
|
|
20
|
+
currentInteractionElement: r,
|
|
21
|
+
markerAutoAdvanceDelay: s
|
|
22
|
+
}) => {
|
|
23
|
+
const e = L({
|
|
24
|
+
currentElementList: t,
|
|
25
|
+
currentStepHasSpeakableElement: n,
|
|
26
|
+
currentInteractionElement: r
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
delayMs: e ? o : s,
|
|
30
|
+
usesImageOnlyDelay: e
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
m as resolveSilentStepAutoAdvanceBehavior,
|
|
35
|
+
L as shouldUseImageOnlySilentStepAutoAdvanceDelay
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=silentStepAutoAdvance.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"silentStepAutoAdvance.es.js","sources":["../../../../src/components/Slide/utils/silentStepAutoAdvance.ts"],"sourcesContent":["import type { Element } from \"../types\";\n\nimport { DEFAULT_IMAGE_ONLY_AUTO_ADVANCE_DELAY_MS } from \"../constants\";\n\nconst IMAGE_ONLY_ELEMENT_TYPES = new Set([\"img\", \"md_img\", \"svg\"]);\nconst COMPLETE_IMAGE_TAG_PATTERN = /<(img|svg)\\b[^>]*>/i;\nconst HTML_COMMENT_RE = /<!--[\\s\\S]*?-->/g;\nconst HTML_SCRIPT_RE = /<script\\b[^>]*>[\\s\\S]*?<\\/script>/gi;\nconst HTML_STYLE_RE = /<style\\b[^>]*>[\\s\\S]*?<\\/style>/gi;\nconst HTML_TAG_RE = /<\\/?\\s*[a-zA-Z][a-zA-Z0-9:_-]*\\b[^>]*>/g;\nconst HTML_SPACE_ENTITY_RE = /&(?:nbsp|ensp|emsp|thinsp|zwnj|zwj);/gi;\nconst MEANINGFUL_TEXT_RE = /[\\p{L}\\p{N}]/u;\n\nexport interface SilentStepAutoAdvanceDelayParams {\n currentElementList: Element[];\n currentStepHasSpeakableElement: boolean;\n currentInteractionElement?: Element;\n markerAutoAdvanceDelay: number;\n}\n\nexport interface SilentStepAutoAdvanceBehavior {\n delayMs: number;\n usesImageOnlyDelay: boolean;\n}\n\nconst isRenderableStepContentElement = (element?: Element) =>\n Boolean(element) && !element?.is_marker && element?.is_renderable !== false;\n\nconst hasMeaningfulHtmlText = (content: string) =>\n MEANINGFUL_TEXT_RE.test(\n content\n .replace(HTML_COMMENT_RE, \" \")\n .replace(HTML_SCRIPT_RE, \" \")\n .replace(HTML_STYLE_RE, \" \")\n .replace(HTML_TAG_RE, \" \")\n .replace(HTML_SPACE_ENTITY_RE, \" \")\n .trim()\n );\n\nconst isImageOnlyHtmlElement = (element: Element) => {\n if (element.type !== \"html\" || typeof element.content !== \"string\") {\n return false;\n }\n\n return (\n COMPLETE_IMAGE_TAG_PATTERN.test(element.content) &&\n !hasMeaningfulHtmlText(element.content)\n );\n};\n\nexport const shouldUseImageOnlySilentStepAutoAdvanceDelay = ({\n currentElementList,\n currentStepHasSpeakableElement,\n currentInteractionElement,\n}: Omit<SilentStepAutoAdvanceDelayParams, \"markerAutoAdvanceDelay\">) => {\n if (currentStepHasSpeakableElement || currentInteractionElement) {\n return false;\n }\n\n const stepContentElements = currentElementList.filter(\n isRenderableStepContentElement\n );\n\n if (stepContentElements.length === 0) {\n return false;\n }\n\n return stepContentElements.every(\n (element) =>\n IMAGE_ONLY_ELEMENT_TYPES.has(element.type) ||\n isImageOnlyHtmlElement(element)\n );\n};\n\nexport const resolveSilentStepAutoAdvanceDelay = ({\n currentElementList,\n currentStepHasSpeakableElement,\n currentInteractionElement,\n markerAutoAdvanceDelay,\n}: SilentStepAutoAdvanceDelayParams) =>\n resolveSilentStepAutoAdvanceBehavior({\n currentElementList,\n currentStepHasSpeakableElement,\n currentInteractionElement,\n markerAutoAdvanceDelay,\n }).delayMs;\n\nexport const resolveSilentStepAutoAdvanceBehavior = ({\n currentElementList,\n currentStepHasSpeakableElement,\n currentInteractionElement,\n markerAutoAdvanceDelay,\n}: SilentStepAutoAdvanceDelayParams): SilentStepAutoAdvanceBehavior => {\n const usesImageOnlyDelay = shouldUseImageOnlySilentStepAutoAdvanceDelay({\n currentElementList,\n currentStepHasSpeakableElement,\n currentInteractionElement,\n });\n\n return {\n delayMs: usesImageOnlyDelay\n ? DEFAULT_IMAGE_ONLY_AUTO_ADVANCE_DELAY_MS\n : markerAutoAdvanceDelay,\n usesImageOnlyDelay,\n };\n};\n"],"names":["IMAGE_ONLY_ELEMENT_TYPES","COMPLETE_IMAGE_TAG_PATTERN","HTML_COMMENT_RE","HTML_SCRIPT_RE","HTML_STYLE_RE","HTML_TAG_RE","HTML_SPACE_ENTITY_RE","MEANINGFUL_TEXT_RE","isRenderableStepContentElement","element","hasMeaningfulHtmlText","content","isImageOnlyHtmlElement","shouldUseImageOnlySilentStepAutoAdvanceDelay","currentElementList","currentStepHasSpeakableElement","currentInteractionElement","stepContentElements","resolveSilentStepAutoAdvanceBehavior","markerAutoAdvanceDelay","usesImageOnlyDelay","DEFAULT_IMAGE_ONLY_AUTO_ADVANCE_DELAY_MS"],"mappings":";AAIA,MAAMA,IAA2B,oBAAI,IAAI,CAAC,OAAO,UAAU,KAAK,CAAC,GAC3DC,IAA6B,uBAC7BC,IAAkB,oBAClBC,IAAiB,uCACjBC,IAAgB,qCAChBC,IAAc,2CACdC,IAAuB,0CACvBC,IAAqB,iBAcrBC,IAAiC,CAACC,MACtC,EAAQA,KAAY,CAACA,GAAS,aAAaA,GAAS,kBAAkB,IAElEC,IAAwB,CAACC,MAC7BJ,EAAmB;AAAA,EACjBI,EACG,QAAQT,GAAiB,GAAG,EAC5B,QAAQC,GAAgB,GAAG,EAC3B,QAAQC,GAAe,GAAG,EAC1B,QAAQC,GAAa,GAAG,EACxB,QAAQC,GAAsB,GAAG,EACjC,KAAA;AACL,GAEIM,IAAyB,CAACH,MAC1BA,EAAQ,SAAS,UAAU,OAAOA,EAAQ,WAAY,WACjD,KAIPR,EAA2B,KAAKQ,EAAQ,OAAO,KAC/C,CAACC,EAAsBD,EAAQ,OAAO,GAI7BI,IAA+C,CAAC;AAAA,EAC3D,oBAAAC;AAAA,EACA,gCAAAC;AAAA,EACA,2BAAAC;AACF,MAAwE;AACtE,MAAID,KAAkCC;AACpC,WAAO;AAGT,QAAMC,IAAsBH,EAAmB;AAAA,IAC7CN;AAAA,EAAA;AAGF,SAAIS,EAAoB,WAAW,IAC1B,KAGFA,EAAoB;AAAA,IACzB,CAACR,MACCT,EAAyB,IAAIS,EAAQ,IAAI,KACzCG,EAAuBH,CAAO;AAAA,EAAA;AAEpC,GAeaS,IAAuC,CAAC;AAAA,EACnD,oBAAAJ;AAAA,EACA,gCAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,wBAAAG;AACF,MAAuE;AACrE,QAAMC,IAAqBP,EAA6C;AAAA,IACtE,oBAAAC;AAAA,IACA,gCAAAC;AAAA,IACA,2BAAAC;AAAA,EAAA,CACD;AAED,SAAO;AAAA,IACL,SAASI,IACLC,IACAF;AAAA,IACJ,oBAAAC;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|