markdown-flow-ui 0.2.22-dev.1 → 0.2.22
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/_virtual/index.es8.js +2 -2
- package/dist/_virtual/index.es9.js +2 -2
- package/dist/_virtual/index8.cjs +1 -1
- package/dist/_virtual/index9.cjs +1 -1
- package/dist/assets/markdown-flow-ui.css +1 -1
- package/dist/components/Slide/Player.cjs +1 -1
- package/dist/components/Slide/Player.cjs.map +1 -1
- package/dist/components/Slide/Player.d.ts +1 -3
- package/dist/components/Slide/Player.es.js +488 -457
- package/dist/components/Slide/Player.es.js.map +1 -1
- package/dist/components/Slide/Slide.cjs +1 -1
- package/dist/components/Slide/Slide.cjs.map +1 -1
- package/dist/components/Slide/Slide.es.js +660 -664
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/components/Slide/SubtitleOverlay.cjs +1 -1
- package/dist/components/Slide/SubtitleOverlay.cjs.map +1 -1
- package/dist/components/Slide/SubtitleOverlay.d.ts +1 -2
- package/dist/components/Slide/SubtitleOverlay.es.js +18 -20
- package/dist/components/Slide/SubtitleOverlay.es.js.map +1 -1
- package/dist/components/Slide/slideI18n.cjs.map +1 -1
- package/dist/components/Slide/slideI18n.d.ts +0 -1
- package/dist/components/Slide/slideI18n.es.js.map +1 -1
- package/dist/components/Slide/utils/interactionPlayback.cjs +1 -1
- package/dist/components/Slide/utils/interactionPlayback.cjs.map +1 -1
- package/dist/components/Slide/utils/interactionPlayback.d.ts +1 -2
- package/dist/components/Slide/utils/interactionPlayback.es.js +7 -8
- package/dist/components/Slide/utils/interactionPlayback.es.js.map +1 -1
- package/dist/components/Slide/utils/playerCustomActions.cjs +1 -1
- package/dist/components/Slide/utils/playerCustomActions.cjs.map +1 -1
- package/dist/components/Slide/utils/playerCustomActions.d.ts +1 -1
- package/dist/components/Slide/utils/playerCustomActions.es.js +14 -18
- package/dist/components/Slide/utils/playerCustomActions.es.js.map +1 -1
- package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs +1 -1
- package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs.map +1 -1
- package/dist/components/Slide/utils/playerKeyboardShortcuts.d.ts +1 -1
- package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js +2 -0
- package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js.map +1 -1
- package/dist/components/Slide/utils/playerVisibility.cjs +1 -1
- package/dist/components/Slide/utils/playerVisibility.cjs.map +1 -1
- package/dist/components/Slide/utils/playerVisibility.d.ts +10 -0
- package/dist/components/Slide/utils/playerVisibility.es.js +14 -6
- package/dist/components/Slide/utils/playerVisibility.es.js.map +1 -1
- package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs +1 -1
- package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
- package/dist/node_modules/classnames/index.cjs +1 -1
- package/dist/node_modules/classnames/index.es.js +1 -1
- package/dist/node_modules/cose-base/cose-base.cjs +1 -1
- package/dist/node_modules/cose-base/cose-base.cjs.map +1 -1
- package/dist/node_modules/cose-base/cose-base.es.js +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs.map +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.es.js +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs.map +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.es.js +1 -1
- package/dist/node_modules/layout-base/layout-base.cjs +1 -1
- package/dist/node_modules/layout-base/layout-base.cjs.map +1 -1
- package/dist/node_modules/layout-base/layout-base.es.js +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.cjs +7 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js +29 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),s=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),s=require("react"),y=require("../../lib/utils.cjs"),f=require("./utils/subtitleCue.cjs"),S=require("./utils/playbackTimeStore.cjs");;/* empty css */const x=({className:c,extraBottomOffset:n=0,hasPlayerGap:b=!1,isEnabled:e=!0,onVisibilityChange:i,playbackTimeStore:m,style:d,subtitleCues:r=[],...v})=>{const u=S.usePlaybackTimeStore(m),t=s.useMemo(()=>f.getVisibleSubtitleText(r,u),[u,r]),a=!!t;return s.useEffect(()=>{i?.(e&&a)},[a,e,i]),!e||!t?null:l.jsx("div",{"aria-live":"off",className:y.cn("slide-subtitle-overlay",b&&"slide-subtitle-overlay--with-player-gap",c),style:{...d,"--slide-subtitle-extra-offset":`${Math.max(n,0)}px`},...v,children:l.jsx("div",{className:"slide-subtitle-overlay__surface",children:l.jsx("p",{className:"slide-subtitle-overlay__text",children:t})})})},o=s.memo(x);o.displayName="SubtitleOverlay";exports.default=o;
|
|
2
2
|
//# sourceMappingURL=SubtitleOverlay.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubtitleOverlay.cjs","sources":["../../../src/components/Slide/SubtitleOverlay.tsx"],"sourcesContent":["import React, { memo, useEffect, useMemo } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { getVisibleSubtitleText } from \"./utils/subtitleCue\";\nimport { usePlaybackTimeStore } from \"./utils/playbackTimeStore\";\nimport type { PlaybackTimeStore } from \"./utils/playbackTimeStore\";\nimport type { ElementSubtitleCue } from \"./types\";\nimport \"./subtitle-overlay.css\";\n\nexport interface SubtitleOverlayProps\n extends Omit<React.ComponentProps<\"div\">, \"children\"> {\n extraBottomOffset?: number;\n hasPlayerGap?: boolean;\n isEnabled?: boolean;\n
|
|
1
|
+
{"version":3,"file":"SubtitleOverlay.cjs","sources":["../../../src/components/Slide/SubtitleOverlay.tsx"],"sourcesContent":["import React, { memo, useEffect, useMemo } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { getVisibleSubtitleText } from \"./utils/subtitleCue\";\nimport { usePlaybackTimeStore } from \"./utils/playbackTimeStore\";\nimport type { PlaybackTimeStore } from \"./utils/playbackTimeStore\";\nimport type { ElementSubtitleCue } from \"./types\";\nimport \"./subtitle-overlay.css\";\n\nexport interface SubtitleOverlayProps\n extends Omit<React.ComponentProps<\"div\">, \"children\"> {\n extraBottomOffset?: number;\n hasPlayerGap?: boolean;\n isEnabled?: boolean;\n onVisibilityChange?: (visible: boolean) => void;\n playbackTimeStore: PlaybackTimeStore;\n subtitleCues?: ElementSubtitleCue[];\n}\n\nconst SubtitleOverlay = ({\n className,\n extraBottomOffset = 0,\n hasPlayerGap = false,\n isEnabled = true,\n onVisibilityChange,\n playbackTimeStore,\n style,\n subtitleCues = [],\n ...props\n}: SubtitleOverlayProps) => {\n const currentTimeMs = usePlaybackTimeStore(playbackTimeStore);\n const visibleSubtitleText = useMemo(\n () => getVisibleSubtitleText(subtitleCues, currentTimeMs),\n [currentTimeMs, subtitleCues]\n );\n const hasVisibleSubtitle = Boolean(visibleSubtitleText);\n\n useEffect(() => {\n onVisibilityChange?.(isEnabled && hasVisibleSubtitle);\n }, [hasVisibleSubtitle, isEnabled, onVisibilityChange]);\n\n if (!isEnabled || !visibleSubtitleText) {\n return null;\n }\n\n return (\n <div\n aria-live=\"off\"\n className={cn(\n \"slide-subtitle-overlay\",\n hasPlayerGap && \"slide-subtitle-overlay--with-player-gap\",\n className\n )}\n style={\n {\n ...style,\n \"--slide-subtitle-extra-offset\": `${Math.max(extraBottomOffset, 0)}px`,\n } as React.CSSProperties\n }\n {...props}\n >\n <div className=\"slide-subtitle-overlay__surface\">\n <p className=\"slide-subtitle-overlay__text\">{visibleSubtitleText}</p>\n </div>\n </div>\n );\n};\n\nconst MemoizedSubtitleOverlay = memo(SubtitleOverlay);\n\nMemoizedSubtitleOverlay.displayName = \"SubtitleOverlay\";\n\nexport default MemoizedSubtitleOverlay;\n"],"names":["SubtitleOverlay","className","extraBottomOffset","hasPlayerGap","isEnabled","onVisibilityChange","playbackTimeStore","style","subtitleCues","props","currentTimeMs","usePlaybackTimeStore","visibleSubtitleText","useMemo","getVisibleSubtitleText","hasVisibleSubtitle","useEffect","jsx","cn","MemoizedSubtitleOverlay","memo"],"mappings":"2TAmBA,MAAMA,EAAkB,CAAC,CACvB,UAAAC,EACA,kBAAAC,EAAoB,EACpB,aAAAC,EAAe,GACf,UAAAC,EAAY,GACZ,mBAAAC,EAAA,kBACAC,EACA,MAAAC,EACA,aAAAC,EAAe,CAAA,EACf,GAAGC,CACL,IAA4B,CAC1B,MAAMC,EAAgBC,EAAAA,qBAAqBL,CAAiB,EACtDM,EAAsBC,EAAAA,QAC1B,IAAMC,EAAAA,uBAAuBN,EAAcE,CAAa,EACxD,CAACA,EAAeF,CAAY,CAAA,EAExBO,EAAqB,EAAQH,EAMnC,OAJAI,EAAAA,UAAU,IAAM,CACdX,IAAqBD,GAAaW,CAAkB,CACtD,EAAG,CAACA,EAAoBX,EAAWC,CAAkB,CAAC,EAElD,CAACD,GAAa,CAACQ,EACV,KAIPK,EAAAA,IAAC,MAAA,CACC,YAAU,MACV,UAAWC,EAAAA,GACT,yBACAf,GAAgB,0CAChBF,CAAA,EAEF,MACE,CACE,GAAGM,EACH,gCAAiC,GAAG,KAAK,IAAIL,EAAmB,CAAC,CAAC,IAAA,EAGrE,GAAGO,EAEJ,SAAAQ,EAAAA,IAAC,OAAI,UAAU,kCACb,eAAC,IAAA,CAAE,UAAU,+BAAgC,SAAAL,CAAA,CAAoB,CAAA,CACnE,CAAA,CAAA,CAGN,EAEMO,EAA0BC,EAAAA,KAAKpB,CAAe,EAEpDmB,EAAwB,YAAc"}
|
|
@@ -5,10 +5,9 @@ export interface SubtitleOverlayProps extends Omit<React.ComponentProps<"div">,
|
|
|
5
5
|
extraBottomOffset?: number;
|
|
6
6
|
hasPlayerGap?: boolean;
|
|
7
7
|
isEnabled?: boolean;
|
|
8
|
-
isPlayerHidden?: boolean;
|
|
9
8
|
onVisibilityChange?: (visible: boolean) => void;
|
|
10
9
|
playbackTimeStore: PlaybackTimeStore;
|
|
11
10
|
subtitleCues?: ElementSubtitleCue[];
|
|
12
11
|
}
|
|
13
|
-
declare const MemoizedSubtitleOverlay: React.MemoExoticComponent<({ className, extraBottomOffset, hasPlayerGap, isEnabled,
|
|
12
|
+
declare const MemoizedSubtitleOverlay: React.MemoExoticComponent<({ className, extraBottomOffset, hasPlayerGap, isEnabled, onVisibilityChange, playbackTimeStore, style, subtitleCues, ...props }: SubtitleOverlayProps) => React.JSX.Element | null>;
|
|
14
13
|
export default MemoizedSubtitleOverlay;
|
|
@@ -1,48 +1,46 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { memo as b, useMemo as
|
|
2
|
+
import { memo as b, useMemo as d, useEffect as v } from "react";
|
|
3
3
|
import { cn as n } from "../../lib/utils.es.js";
|
|
4
|
-
import { getVisibleSubtitleText as
|
|
5
|
-
import { usePlaybackTimeStore as
|
|
4
|
+
import { getVisibleSubtitleText as y } from "./utils/subtitleCue.es.js";
|
|
5
|
+
import { usePlaybackTimeStore as x } from "./utils/playbackTimeStore.es.js";
|
|
6
6
|
/* empty css */
|
|
7
|
-
const
|
|
8
|
-
className:
|
|
7
|
+
const S = ({
|
|
8
|
+
className: a,
|
|
9
9
|
extraBottomOffset: m = 0,
|
|
10
10
|
hasPlayerGap: u = !1,
|
|
11
11
|
isEnabled: e = !0,
|
|
12
|
-
isPlayerHidden: c = !1,
|
|
13
12
|
onVisibilityChange: i,
|
|
14
|
-
playbackTimeStore:
|
|
15
|
-
style:
|
|
13
|
+
playbackTimeStore: c,
|
|
14
|
+
style: f,
|
|
16
15
|
subtitleCues: r = [],
|
|
17
16
|
...p
|
|
18
17
|
}) => {
|
|
19
|
-
const s =
|
|
20
|
-
() =>
|
|
18
|
+
const s = x(c), t = d(
|
|
19
|
+
() => y(r, s),
|
|
21
20
|
[s, r]
|
|
22
|
-
),
|
|
23
|
-
return
|
|
24
|
-
i?.(e &&
|
|
25
|
-
}, [
|
|
21
|
+
), o = !!t;
|
|
22
|
+
return v(() => {
|
|
23
|
+
i?.(e && o);
|
|
24
|
+
}, [o, e, i]), !e || !t ? null : /* @__PURE__ */ l(
|
|
26
25
|
"div",
|
|
27
26
|
{
|
|
28
27
|
"aria-live": "off",
|
|
29
28
|
className: n(
|
|
30
29
|
"slide-subtitle-overlay",
|
|
31
30
|
u && "slide-subtitle-overlay--with-player-gap",
|
|
32
|
-
|
|
33
|
-
o
|
|
31
|
+
a
|
|
34
32
|
),
|
|
35
33
|
style: {
|
|
36
|
-
...
|
|
34
|
+
...f,
|
|
37
35
|
"--slide-subtitle-extra-offset": `${Math.max(m, 0)}px`
|
|
38
36
|
},
|
|
39
37
|
...p,
|
|
40
38
|
children: /* @__PURE__ */ l("div", { className: "slide-subtitle-overlay__surface", children: /* @__PURE__ */ l("p", { className: "slide-subtitle-overlay__text", children: t }) })
|
|
41
39
|
}
|
|
42
40
|
);
|
|
43
|
-
},
|
|
44
|
-
|
|
41
|
+
}, h = b(S);
|
|
42
|
+
h.displayName = "SubtitleOverlay";
|
|
45
43
|
export {
|
|
46
|
-
|
|
44
|
+
h as default
|
|
47
45
|
};
|
|
48
46
|
//# sourceMappingURL=SubtitleOverlay.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubtitleOverlay.es.js","sources":["../../../src/components/Slide/SubtitleOverlay.tsx"],"sourcesContent":["import React, { memo, useEffect, useMemo } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { getVisibleSubtitleText } from \"./utils/subtitleCue\";\nimport { usePlaybackTimeStore } from \"./utils/playbackTimeStore\";\nimport type { PlaybackTimeStore } from \"./utils/playbackTimeStore\";\nimport type { ElementSubtitleCue } from \"./types\";\nimport \"./subtitle-overlay.css\";\n\nexport interface SubtitleOverlayProps\n extends Omit<React.ComponentProps<\"div\">, \"children\"> {\n extraBottomOffset?: number;\n hasPlayerGap?: boolean;\n isEnabled?: boolean;\n
|
|
1
|
+
{"version":3,"file":"SubtitleOverlay.es.js","sources":["../../../src/components/Slide/SubtitleOverlay.tsx"],"sourcesContent":["import React, { memo, useEffect, useMemo } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { getVisibleSubtitleText } from \"./utils/subtitleCue\";\nimport { usePlaybackTimeStore } from \"./utils/playbackTimeStore\";\nimport type { PlaybackTimeStore } from \"./utils/playbackTimeStore\";\nimport type { ElementSubtitleCue } from \"./types\";\nimport \"./subtitle-overlay.css\";\n\nexport interface SubtitleOverlayProps\n extends Omit<React.ComponentProps<\"div\">, \"children\"> {\n extraBottomOffset?: number;\n hasPlayerGap?: boolean;\n isEnabled?: boolean;\n onVisibilityChange?: (visible: boolean) => void;\n playbackTimeStore: PlaybackTimeStore;\n subtitleCues?: ElementSubtitleCue[];\n}\n\nconst SubtitleOverlay = ({\n className,\n extraBottomOffset = 0,\n hasPlayerGap = false,\n isEnabled = true,\n onVisibilityChange,\n playbackTimeStore,\n style,\n subtitleCues = [],\n ...props\n}: SubtitleOverlayProps) => {\n const currentTimeMs = usePlaybackTimeStore(playbackTimeStore);\n const visibleSubtitleText = useMemo(\n () => getVisibleSubtitleText(subtitleCues, currentTimeMs),\n [currentTimeMs, subtitleCues]\n );\n const hasVisibleSubtitle = Boolean(visibleSubtitleText);\n\n useEffect(() => {\n onVisibilityChange?.(isEnabled && hasVisibleSubtitle);\n }, [hasVisibleSubtitle, isEnabled, onVisibilityChange]);\n\n if (!isEnabled || !visibleSubtitleText) {\n return null;\n }\n\n return (\n <div\n aria-live=\"off\"\n className={cn(\n \"slide-subtitle-overlay\",\n hasPlayerGap && \"slide-subtitle-overlay--with-player-gap\",\n className\n )}\n style={\n {\n ...style,\n \"--slide-subtitle-extra-offset\": `${Math.max(extraBottomOffset, 0)}px`,\n } as React.CSSProperties\n }\n {...props}\n >\n <div className=\"slide-subtitle-overlay__surface\">\n <p className=\"slide-subtitle-overlay__text\">{visibleSubtitleText}</p>\n </div>\n </div>\n );\n};\n\nconst MemoizedSubtitleOverlay = memo(SubtitleOverlay);\n\nMemoizedSubtitleOverlay.displayName = \"SubtitleOverlay\";\n\nexport default MemoizedSubtitleOverlay;\n"],"names":["SubtitleOverlay","className","extraBottomOffset","hasPlayerGap","isEnabled","onVisibilityChange","playbackTimeStore","style","subtitleCues","props","currentTimeMs","usePlaybackTimeStore","visibleSubtitleText","useMemo","getVisibleSubtitleText","hasVisibleSubtitle","useEffect","jsx","cn","MemoizedSubtitleOverlay","memo"],"mappings":";;;;;;AAmBA,MAAMA,IAAkB,CAAC;AAAA,EACvB,WAAAC;AAAA,EACA,mBAAAC,IAAoB;AAAA,EACpB,cAAAC,IAAe;AAAA,EACf,WAAAC,IAAY;AAAA,EACZ,oBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC,IAAe,CAAA;AAAA,EACf,GAAGC;AACL,MAA4B;AAC1B,QAAMC,IAAgBC,EAAqBL,CAAiB,GACtDM,IAAsBC;AAAA,IAC1B,MAAMC,EAAuBN,GAAcE,CAAa;AAAA,IACxD,CAACA,GAAeF,CAAY;AAAA,EAAA,GAExBO,IAAqB,EAAQH;AAMnC,SAJAI,EAAU,MAAM;AACd,IAAAX,IAAqBD,KAAaW,CAAkB;AAAA,EACtD,GAAG,CAACA,GAAoBX,GAAWC,CAAkB,CAAC,GAElD,CAACD,KAAa,CAACQ,IACV,OAIP,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAf,KAAgB;AAAA,QAChBF;AAAA,MAAA;AAAA,MAEF,OACE;AAAA,QACE,GAAGM;AAAA,QACH,iCAAiC,GAAG,KAAK,IAAIL,GAAmB,CAAC,CAAC;AAAA,MAAA;AAAA,MAGrE,GAAGO;AAAA,MAEJ,UAAA,gBAAAQ,EAAC,SAAI,WAAU,mCACb,4BAAC,KAAA,EAAE,WAAU,gCAAgC,UAAAL,EAAA,CAAoB,EAAA,CACnE;AAAA,IAAA;AAAA,EAAA;AAGN,GAEMO,IAA0BC,EAAKpB,CAAe;AAEpDmB,EAAwB,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slideI18n.cjs","sources":["../../../src/components/Slide/slideI18n.ts"],"sourcesContent":["import {\n normalizeMarkdownFlowLocale,\n type MarkdownFlowLocale,\n} from \"../../lib/locale\";\nimport localeTexts from \"./locales/slide.json\";\n\nexport interface SlidePlayerLocaleTexts {\n closeSettingsLabel: string;\n enterFullscreenLabel: string;\n exitFullscreenLabel: string;\n moreOptionsAriaLabel: string;\n nextLabel: string;\n nextSubtitleLabel: string;\n
|
|
1
|
+
{"version":3,"file":"slideI18n.cjs","sources":["../../../src/components/Slide/slideI18n.ts"],"sourcesContent":["import {\n normalizeMarkdownFlowLocale,\n type MarkdownFlowLocale,\n} from \"../../lib/locale\";\nimport localeTexts from \"./locales/slide.json\";\n\nexport interface SlidePlayerLocaleTexts {\n closeSettingsLabel: string;\n enterFullscreenLabel: string;\n exitFullscreenLabel: string;\n moreOptionsAriaLabel: string;\n nextLabel: string;\n nextSubtitleLabel: string;\n notesLabel: string;\n pauseAutoplayLabel: string;\n pauseLabel: string;\n playAutoplayLabel: string;\n playLabel: string;\n /** Display name of the spacebar in playback hints; does not change the key binding. */\n playbackShortcutLabel: string;\n previousLabel: string;\n previousSubtitleLabel: string;\n screenModeLabel: string;\n settingsTitle: string;\n subtitleLabel: string;\n subtitleToggleAriaLabel: string;\n volumeAriaLabel: string;\n screenLabel: string;\n nonFullscreenLabel: string;\n fullscreenLabel: string;\n fullscreenHintText: string;\n}\n\nexport interface SlideInteractionLocaleTexts {\n title: string;\n confirmButtonText: string;\n copyButtonText: string;\n copiedButtonText: string;\n dragHandleAriaLabel: string;\n}\n\nexport type SlideBufferingReason =\n | \"waitingForAudio\"\n | import(\"./Player\").SlidePlayerLoadingReason;\n\nexport interface SlideLocaleTexts {\n bufferingText: Record<SlideBufferingReason, string>;\n fullscreenBackAriaLabel: string;\n interactionTexts: SlideInteractionLocaleTexts;\n playerTexts: SlidePlayerLocaleTexts;\n}\n\nexport const SLIDE_LOCALE_TEXTS: Record<MarkdownFlowLocale, SlideLocaleTexts> =\n localeTexts;\n\nexport const DEFAULT_SLIDE_PLAYER_TEXTS: SlidePlayerLocaleTexts =\n SLIDE_LOCALE_TEXTS[\"en-US\"].playerTexts;\n\nexport const DEFAULT_SLIDE_INTERACTION_TEXTS: SlideInteractionLocaleTexts =\n SLIDE_LOCALE_TEXTS[\"en-US\"].interactionTexts;\n\nexport const DEFAULT_SLIDE_BUFFERING_TEXTS: Record<\n SlideBufferingReason,\n string\n> = SLIDE_LOCALE_TEXTS[\"en-US\"].bufferingText;\n\nexport const getSlideLocaleTexts = (locale?: string | null): SlideLocaleTexts =>\n SLIDE_LOCALE_TEXTS[normalizeMarkdownFlowLocale(locale)];\n\nexport const getSlidePlayerTexts = (\n locale?: string | null\n): SlidePlayerLocaleTexts => getSlideLocaleTexts(locale).playerTexts;\n"],"names":["SLIDE_LOCALE_TEXTS","localeTexts","DEFAULT_SLIDE_BUFFERING_TEXTS","getSlideLocaleTexts","locale","normalizeMarkdownFlowLocale","getSlidePlayerTexts"],"mappings":"8JAoDaA,EACXC,EAAAA,QAGAD,EAAmB,OAAO,EAAE,YAG5BA,EAAmB,OAAO,EAAE,iBAEvB,MAAME,EAGTF,EAAmB,OAAO,EAAE,cAEnBG,EAAuBC,GAClCJ,EAAmBK,EAAAA,4BAA4BD,CAAM,CAAC,EAE3CE,EACXF,GAC2BD,EAAoBC,CAAM,EAAE"}
|
|
@@ -6,7 +6,6 @@ export interface SlidePlayerLocaleTexts {
|
|
|
6
6
|
moreOptionsAriaLabel: string;
|
|
7
7
|
nextLabel: string;
|
|
8
8
|
nextSubtitleLabel: string;
|
|
9
|
-
/** @deprecated The player no longer renders a manual interaction action. */
|
|
10
9
|
notesLabel: string;
|
|
11
10
|
pauseAutoplayLabel: string;
|
|
12
11
|
pauseLabel: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slideI18n.es.js","sources":["../../../src/components/Slide/slideI18n.ts"],"sourcesContent":["import {\n normalizeMarkdownFlowLocale,\n type MarkdownFlowLocale,\n} from \"../../lib/locale\";\nimport localeTexts from \"./locales/slide.json\";\n\nexport interface SlidePlayerLocaleTexts {\n closeSettingsLabel: string;\n enterFullscreenLabel: string;\n exitFullscreenLabel: string;\n moreOptionsAriaLabel: string;\n nextLabel: string;\n nextSubtitleLabel: string;\n
|
|
1
|
+
{"version":3,"file":"slideI18n.es.js","sources":["../../../src/components/Slide/slideI18n.ts"],"sourcesContent":["import {\n normalizeMarkdownFlowLocale,\n type MarkdownFlowLocale,\n} from \"../../lib/locale\";\nimport localeTexts from \"./locales/slide.json\";\n\nexport interface SlidePlayerLocaleTexts {\n closeSettingsLabel: string;\n enterFullscreenLabel: string;\n exitFullscreenLabel: string;\n moreOptionsAriaLabel: string;\n nextLabel: string;\n nextSubtitleLabel: string;\n notesLabel: string;\n pauseAutoplayLabel: string;\n pauseLabel: string;\n playAutoplayLabel: string;\n playLabel: string;\n /** Display name of the spacebar in playback hints; does not change the key binding. */\n playbackShortcutLabel: string;\n previousLabel: string;\n previousSubtitleLabel: string;\n screenModeLabel: string;\n settingsTitle: string;\n subtitleLabel: string;\n subtitleToggleAriaLabel: string;\n volumeAriaLabel: string;\n screenLabel: string;\n nonFullscreenLabel: string;\n fullscreenLabel: string;\n fullscreenHintText: string;\n}\n\nexport interface SlideInteractionLocaleTexts {\n title: string;\n confirmButtonText: string;\n copyButtonText: string;\n copiedButtonText: string;\n dragHandleAriaLabel: string;\n}\n\nexport type SlideBufferingReason =\n | \"waitingForAudio\"\n | import(\"./Player\").SlidePlayerLoadingReason;\n\nexport interface SlideLocaleTexts {\n bufferingText: Record<SlideBufferingReason, string>;\n fullscreenBackAriaLabel: string;\n interactionTexts: SlideInteractionLocaleTexts;\n playerTexts: SlidePlayerLocaleTexts;\n}\n\nexport const SLIDE_LOCALE_TEXTS: Record<MarkdownFlowLocale, SlideLocaleTexts> =\n localeTexts;\n\nexport const DEFAULT_SLIDE_PLAYER_TEXTS: SlidePlayerLocaleTexts =\n SLIDE_LOCALE_TEXTS[\"en-US\"].playerTexts;\n\nexport const DEFAULT_SLIDE_INTERACTION_TEXTS: SlideInteractionLocaleTexts =\n SLIDE_LOCALE_TEXTS[\"en-US\"].interactionTexts;\n\nexport const DEFAULT_SLIDE_BUFFERING_TEXTS: Record<\n SlideBufferingReason,\n string\n> = SLIDE_LOCALE_TEXTS[\"en-US\"].bufferingText;\n\nexport const getSlideLocaleTexts = (locale?: string | null): SlideLocaleTexts =>\n SLIDE_LOCALE_TEXTS[normalizeMarkdownFlowLocale(locale)];\n\nexport const getSlidePlayerTexts = (\n locale?: string | null\n): SlidePlayerLocaleTexts => getSlideLocaleTexts(locale).playerTexts;\n"],"names":["SLIDE_LOCALE_TEXTS","localeTexts","DEFAULT_SLIDE_BUFFERING_TEXTS","getSlideLocaleTexts","locale","normalizeMarkdownFlowLocale","getSlidePlayerTexts"],"mappings":";;AAoDO,MAAMA,IACXC;AAGAD,EAAmB,OAAO,EAAE;AAG5BA,EAAmB,OAAO,EAAE;AAEvB,MAAME,IAGTF,EAAmB,OAAO,EAAE,eAEnBG,IAAsB,CAACC,MAClCJ,EAAmBK,EAA4BD,CAAM,CAAC,GAE3CE,IAAsB,CACjCF,MAC2BD,EAAoBC,CAAM,EAAE;"}
|
|
@@ -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 u=({hasInteraction:r,shouldBlockPlaybackForInteraction:e,shouldOpenInteractionOverlayAfterAudio:t,hasPlaybackContextChanged:a,hasResolvedCurrentInteraction:l,currentStepHasSpeakableElement:i})=>r?e||t||a?!0:l?!i:!1:!1,c=({hasActiveInteraction:r,isInteractionOverlayOpen:e})=>!(!r||!e),n=(r,e,t)=>Math.min(Math.max(r,e),t),o=(r,e)=>({x:n(r.x,e.minX,e.maxX),y:n(r.y,e.minY,e.maxY)});exports.clampInteractionOverlayDragOffset=o;exports.shouldPresentInteractionOverlay=u;exports.shouldRenderInteractionOverlay=c;
|
|
2
2
|
//# sourceMappingURL=interactionPlayback.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactionPlayback.cjs","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
|
|
1
|
+
{"version":3,"file":"interactionPlayback.cjs","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}\n\nexport const shouldRenderInteractionOverlay = ({\n hasActiveInteraction,\n isInteractionOverlayOpen,\n}: ShouldRenderInteractionOverlayParams) => {\n if (!hasActiveInteraction || !isInteractionOverlayOpen) {\n return false;\n }\n\n return true;\n};\n\nexport interface InteractionOverlayDragOffset {\n x: number;\n y: number;\n}\n\nexport interface InteractionOverlayDragBounds {\n minX: number;\n maxX: number;\n minY: number;\n maxY: number;\n}\n\nconst clampNumber = (value: number, min: number, max: number) =>\n Math.min(Math.max(value, min), max);\n\nexport const clampInteractionOverlayDragOffset = (\n offset: InteractionOverlayDragOffset,\n bounds: InteractionOverlayDragBounds\n): InteractionOverlayDragOffset => ({\n x: clampNumber(offset.x, bounds.minX, bounds.maxX),\n y: clampNumber(offset.y, bounds.minY, bounds.maxY),\n});\n"],"names":["shouldPresentInteractionOverlay","hasInteraction","shouldBlockPlaybackForInteraction","shouldOpenInteractionOverlayAfterAudio","hasPlaybackContextChanged","hasResolvedCurrentInteraction","currentStepHasSpeakableElement","shouldRenderInteractionOverlay","hasActiveInteraction","isInteractionOverlayOpen","clampNumber","value","min","max","clampInteractionOverlayDragOffset","offset","bounds"],"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,GAgCEC,EAAiC,CAAC,CAC7C,qBAAAC,EACA,yBAAAC,CACF,IACM,GAACD,GAAwB,CAACC,GAmB1BC,EAAc,CAACC,EAAeC,EAAaC,IAC/C,KAAK,IAAI,KAAK,IAAIF,EAAOC,CAAG,EAAGC,CAAG,EAEvBC,EAAoC,CAC/CC,EACAC,KACkC,CAClC,EAAGN,EAAYK,EAAO,EAAGC,EAAO,KAAMA,EAAO,IAAI,EACjD,EAAGN,EAAYK,EAAO,EAAGC,EAAO,KAAMA,EAAO,IAAI,CACnD"}
|
|
@@ -5,9 +5,8 @@ interface ShouldPresentInteractionOverlayParams {
|
|
|
5
5
|
hasPlaybackContextChanged: boolean;
|
|
6
6
|
hasResolvedCurrentInteraction: boolean;
|
|
7
7
|
currentStepHasSpeakableElement: boolean;
|
|
8
|
-
isPlayerCustomActionActive: boolean;
|
|
9
8
|
}
|
|
10
|
-
export declare const shouldPresentInteractionOverlay: ({ hasInteraction, shouldBlockPlaybackForInteraction, shouldOpenInteractionOverlayAfterAudio, hasPlaybackContextChanged, hasResolvedCurrentInteraction, currentStepHasSpeakableElement,
|
|
9
|
+
export declare const shouldPresentInteractionOverlay: ({ hasInteraction, shouldBlockPlaybackForInteraction, shouldOpenInteractionOverlayAfterAudio, hasPlaybackContextChanged, hasResolvedCurrentInteraction, currentStepHasSpeakableElement, }: ShouldPresentInteractionOverlayParams) => boolean;
|
|
11
10
|
export interface ShouldRenderInteractionOverlayParams {
|
|
12
11
|
hasActiveInteraction: boolean;
|
|
13
12
|
isInteractionOverlayOpen: boolean;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
const
|
|
1
|
+
const l = ({
|
|
2
2
|
hasInteraction: e,
|
|
3
3
|
shouldBlockPlaybackForInteraction: r,
|
|
4
4
|
shouldOpenInteractionOverlayAfterAudio: t,
|
|
5
5
|
hasPlaybackContextChanged: a,
|
|
6
6
|
hasResolvedCurrentInteraction: i,
|
|
7
|
-
currentStepHasSpeakableElement: u
|
|
8
|
-
|
|
9
|
-
}) => !e || l ? !1 : r || t || a ? !0 : i ? !u : !1, f = ({
|
|
7
|
+
currentStepHasSpeakableElement: u
|
|
8
|
+
}) => e ? r || t || a ? !0 : i ? !u : !1 : !1, c = ({
|
|
10
9
|
hasActiveInteraction: e,
|
|
11
10
|
isInteractionOverlayOpen: r
|
|
12
|
-
}) => !(!e || !r), n = (e, r, t) => Math.min(Math.max(e, r), t),
|
|
11
|
+
}) => !(!e || !r), n = (e, r, t) => Math.min(Math.max(e, r), t), f = (e, r) => ({
|
|
13
12
|
x: n(e.x, r.minX, r.maxX),
|
|
14
13
|
y: n(e.y, r.minY, r.maxY)
|
|
15
14
|
});
|
|
16
15
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
f as clampInteractionOverlayDragOffset,
|
|
17
|
+
l as shouldPresentInteractionOverlay,
|
|
18
|
+
c as shouldRenderInteractionOverlay
|
|
20
19
|
};
|
|
21
20
|
//# 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
|
|
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}\n\nexport const shouldRenderInteractionOverlay = ({\n hasActiveInteraction,\n isInteractionOverlayOpen,\n}: ShouldRenderInteractionOverlayParams) => {\n if (!hasActiveInteraction || !isInteractionOverlayOpen) {\n return false;\n }\n\n return true;\n};\n\nexport interface InteractionOverlayDragOffset {\n x: number;\n y: number;\n}\n\nexport interface InteractionOverlayDragBounds {\n minX: number;\n maxX: number;\n minY: number;\n maxY: number;\n}\n\nconst clampNumber = (value: number, min: number, max: number) =>\n Math.min(Math.max(value, min), max);\n\nexport const clampInteractionOverlayDragOffset = (\n offset: InteractionOverlayDragOffset,\n bounds: InteractionOverlayDragBounds\n): InteractionOverlayDragOffset => ({\n x: clampNumber(offset.x, bounds.minX, bounds.maxX),\n y: clampNumber(offset.y, bounds.minY, bounds.maxY),\n});\n"],"names":["shouldPresentInteractionOverlay","hasInteraction","shouldBlockPlaybackForInteraction","shouldOpenInteractionOverlayAfterAudio","hasPlaybackContextChanged","hasResolvedCurrentInteraction","currentStepHasSpeakableElement","shouldRenderInteractionOverlay","hasActiveInteraction","isInteractionOverlayOpen","clampNumber","value","min","max","clampInteractionOverlayDragOffset","offset","bounds"],"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,IAgCEC,IAAiC,CAAC;AAAA,EAC7C,sBAAAC;AAAA,EACA,0BAAAC;AACF,MACM,GAACD,KAAwB,CAACC,IAmB1BC,IAAc,CAACC,GAAeC,GAAaC,MAC/C,KAAK,IAAI,KAAK,IAAIF,GAAOC,CAAG,GAAGC,CAAG,GAEvBC,IAAoC,CAC/CC,GACAC,OACkC;AAAA,EAClC,GAAGN,EAAYK,EAAO,GAAGC,EAAO,MAAMA,EAAO,IAAI;AAAA,EACjD,GAAGN,EAAYK,EAAO,GAAGC,EAAO,MAAMA,EAAO,IAAI;AACnD;"}
|
|
@@ -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 m=require("react"),r=()=>{},A={currentElement:void 0,currentIndex:-1,currentStepElement:void 0,isActive:!1,setActive:r,toggleActive:r},C=(e,t=A)=>typeof e=="function"?e(t):e,y=({currentAudioIndex:e,currentAudioSequenceIndexes:t,audioList:o,currentStepElement:l,currentInteractionElement:s})=>{const u=e>=0?o[e]?.element:void 0,n=t[0],i=typeof n=="number"?o[n]?.element:void 0;return u??i??s??l},c=(e,t)=>m.Children.toArray(C(e,t)),a=(e,t)=>c(e,t).length;exports.getPlayerCustomActionCount=a;exports.resolvePlayerCustomActionElement=y;exports.toPlayerCustomActionList=c;
|
|
2
2
|
//# sourceMappingURL=playerCustomActions.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerCustomActions.cjs","sources":["../../../../src/components/Slide/utils/playerCustomActions.ts"],"sourcesContent":["import React from \"react\";\nimport type {\n Element,\n SlidePlayerCustomActionContext,\n SlidePlayerCustomActions,\n} from \"../types\";\nimport type { SlideAudioItem } from \"../useSlide\";\n\nconst noop = () => {};\n\nconst DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT: SlidePlayerCustomActionContext = {\n currentElement: undefined,\n currentIndex: -1,\n currentStepElement: undefined,\n isActive: false,\n setActive: noop,\n toggleActive: noop,\n};\n\nconst resolvePlayerCustomActions = (\n customActions?: SlidePlayerCustomActions,\n context: SlidePlayerCustomActionContext = DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT\n) =>\n typeof customActions === \"function\" ? customActions(context) : customActions;\n\
|
|
1
|
+
{"version":3,"file":"playerCustomActions.cjs","sources":["../../../../src/components/Slide/utils/playerCustomActions.ts"],"sourcesContent":["import React from \"react\";\nimport type {\n Element,\n SlidePlayerCustomActionContext,\n SlidePlayerCustomActions,\n} from \"../types\";\nimport type { SlideAudioItem } from \"../useSlide\";\n\nconst noop = () => {};\n\nconst DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT: SlidePlayerCustomActionContext = {\n currentElement: undefined,\n currentIndex: -1,\n currentStepElement: undefined,\n isActive: false,\n setActive: noop,\n toggleActive: noop,\n};\n\nconst resolvePlayerCustomActions = (\n customActions?: SlidePlayerCustomActions,\n context: SlidePlayerCustomActionContext = DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT\n) =>\n typeof customActions === \"function\" ? customActions(context) : customActions;\n\ntype ResolvePlayerCustomActionElementParams = {\n currentAudioIndex: number;\n currentAudioSequenceIndexes: number[];\n audioList: SlideAudioItem[];\n currentStepElement?: Element;\n currentInteractionElement?: Element;\n};\n\nexport const resolvePlayerCustomActionElement = ({\n currentAudioIndex,\n currentAudioSequenceIndexes,\n audioList,\n currentStepElement,\n currentInteractionElement,\n}: ResolvePlayerCustomActionElementParams) => {\n const currentAudioElement =\n currentAudioIndex >= 0 ? audioList[currentAudioIndex]?.element : undefined;\n const currentSequenceAudioIndex = currentAudioSequenceIndexes[0];\n const currentSequenceAudioElement =\n typeof currentSequenceAudioIndex === \"number\"\n ? audioList[currentSequenceAudioIndex]?.element\n : undefined;\n\n return (\n currentAudioElement ??\n currentSequenceAudioElement ??\n currentInteractionElement ??\n currentStepElement\n );\n};\n\nexport const toPlayerCustomActionList = (\n customActions?: SlidePlayerCustomActions,\n context?: SlidePlayerCustomActionContext\n) => React.Children.toArray(resolvePlayerCustomActions(customActions, context));\n\nexport const getPlayerCustomActionCount = (\n customActions?: SlidePlayerCustomActions,\n context?: SlidePlayerCustomActionContext\n) => toPlayerCustomActionList(customActions, context).length;\n"],"names":["noop","DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT","resolvePlayerCustomActions","customActions","context","resolvePlayerCustomActionElement","currentAudioIndex","currentAudioSequenceIndexes","audioList","currentStepElement","currentInteractionElement","currentAudioElement","currentSequenceAudioIndex","currentSequenceAudioElement","toPlayerCustomActionList","React","getPlayerCustomActionCount"],"mappings":"yGAQMA,EAAO,IAAM,CAAC,EAEdC,EAAuE,CAC3E,eAAgB,OAChB,aAAc,GACd,mBAAoB,OACpB,SAAU,GACV,UAAWD,EACX,aAAcA,CAChB,EAEME,EAA6B,CACjCC,EACAC,EAA0CH,IAE1C,OAAOE,GAAkB,WAAaA,EAAcC,CAAO,EAAID,EAUpDE,EAAmC,CAAC,CAC/C,kBAAAC,EACA,4BAAAC,EACA,UAAAC,EACA,mBAAAC,EACA,0BAAAC,CACF,IAA8C,CAC5C,MAAMC,EACJL,GAAqB,EAAIE,EAAUF,CAAiB,GAAG,QAAU,OAC7DM,EAA4BL,EAA4B,CAAC,EACzDM,EACJ,OAAOD,GAA8B,SACjCJ,EAAUI,CAAyB,GAAG,QACtC,OAEN,OACED,GACAE,GACAH,GACAD,CAEJ,EAEaK,EAA2B,CACtCX,EACAC,IACGW,EAAM,SAAS,QAAQb,EAA2BC,EAAeC,CAAO,CAAC,EAEjEY,EAA6B,CACxCb,EACAC,IACGU,EAAyBX,EAAeC,CAAO,EAAE"}
|
|
@@ -9,6 +9,6 @@ type ResolvePlayerCustomActionElementParams = {
|
|
|
9
9
|
currentInteractionElement?: Element;
|
|
10
10
|
};
|
|
11
11
|
export declare const resolvePlayerCustomActionElement: ({ currentAudioIndex, currentAudioSequenceIndexes, audioList, currentStepElement, currentInteractionElement, }: ResolvePlayerCustomActionElementParams) => Element | undefined;
|
|
12
|
-
export declare const toPlayerCustomActionList: (customActions?: SlidePlayerCustomActions, context?: SlidePlayerCustomActionContext) => React.ReactNode[];
|
|
12
|
+
export declare const toPlayerCustomActionList: (customActions?: SlidePlayerCustomActions, context?: SlidePlayerCustomActionContext) => (string | number | bigint | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined>)[];
|
|
13
13
|
export declare const getPlayerCustomActionCount: (customActions?: SlidePlayerCustomActions, context?: SlidePlayerCustomActionContext) => number;
|
|
14
14
|
export {};
|
|
@@ -1,29 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import i from "react";
|
|
2
|
+
const r = () => {
|
|
3
3
|
}, m = {
|
|
4
4
|
currentElement: void 0,
|
|
5
5
|
currentIndex: -1,
|
|
6
6
|
currentStepElement: void 0,
|
|
7
7
|
isActive: !1,
|
|
8
|
-
setActive:
|
|
9
|
-
toggleActive:
|
|
10
|
-
},
|
|
11
|
-
t.props.children
|
|
12
|
-
) : t), v = ({
|
|
8
|
+
setActive: r,
|
|
9
|
+
toggleActive: r
|
|
10
|
+
}, A = (e, t = m) => typeof e == "function" ? e(t) : e, d = ({
|
|
13
11
|
currentAudioIndex: e,
|
|
14
12
|
currentAudioSequenceIndexes: t,
|
|
15
|
-
audioList:
|
|
16
|
-
currentStepElement:
|
|
17
|
-
currentInteractionElement:
|
|
13
|
+
audioList: n,
|
|
14
|
+
currentStepElement: c,
|
|
15
|
+
currentInteractionElement: l
|
|
18
16
|
}) => {
|
|
19
|
-
const
|
|
20
|
-
return
|
|
21
|
-
},
|
|
22
|
-
d(e, t)
|
|
23
|
-
), y = (e, t) => p(e, t).length;
|
|
17
|
+
const s = e >= 0 ? n[e]?.element : void 0, o = t[0], u = typeof o == "number" ? n[o]?.element : void 0;
|
|
18
|
+
return s ?? u ?? l ?? c;
|
|
19
|
+
}, v = (e, t) => i.Children.toArray(A(e, t)), E = (e, t) => v(e, t).length;
|
|
24
20
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
E as getPlayerCustomActionCount,
|
|
22
|
+
d as resolvePlayerCustomActionElement,
|
|
23
|
+
v as toPlayerCustomActionList
|
|
28
24
|
};
|
|
29
25
|
//# sourceMappingURL=playerCustomActions.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerCustomActions.es.js","sources":["../../../../src/components/Slide/utils/playerCustomActions.ts"],"sourcesContent":["import React from \"react\";\nimport type {\n Element,\n SlidePlayerCustomActionContext,\n SlidePlayerCustomActions,\n} from \"../types\";\nimport type { SlideAudioItem } from \"../useSlide\";\n\nconst noop = () => {};\n\nconst DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT: SlidePlayerCustomActionContext = {\n currentElement: undefined,\n currentIndex: -1,\n currentStepElement: undefined,\n isActive: false,\n setActive: noop,\n toggleActive: noop,\n};\n\nconst resolvePlayerCustomActions = (\n customActions?: SlidePlayerCustomActions,\n context: SlidePlayerCustomActionContext = DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT\n) =>\n typeof customActions === \"function\" ? customActions(context) : customActions;\n\
|
|
1
|
+
{"version":3,"file":"playerCustomActions.es.js","sources":["../../../../src/components/Slide/utils/playerCustomActions.ts"],"sourcesContent":["import React from \"react\";\nimport type {\n Element,\n SlidePlayerCustomActionContext,\n SlidePlayerCustomActions,\n} from \"../types\";\nimport type { SlideAudioItem } from \"../useSlide\";\n\nconst noop = () => {};\n\nconst DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT: SlidePlayerCustomActionContext = {\n currentElement: undefined,\n currentIndex: -1,\n currentStepElement: undefined,\n isActive: false,\n setActive: noop,\n toggleActive: noop,\n};\n\nconst resolvePlayerCustomActions = (\n customActions?: SlidePlayerCustomActions,\n context: SlidePlayerCustomActionContext = DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT\n) =>\n typeof customActions === \"function\" ? customActions(context) : customActions;\n\ntype ResolvePlayerCustomActionElementParams = {\n currentAudioIndex: number;\n currentAudioSequenceIndexes: number[];\n audioList: SlideAudioItem[];\n currentStepElement?: Element;\n currentInteractionElement?: Element;\n};\n\nexport const resolvePlayerCustomActionElement = ({\n currentAudioIndex,\n currentAudioSequenceIndexes,\n audioList,\n currentStepElement,\n currentInteractionElement,\n}: ResolvePlayerCustomActionElementParams) => {\n const currentAudioElement =\n currentAudioIndex >= 0 ? audioList[currentAudioIndex]?.element : undefined;\n const currentSequenceAudioIndex = currentAudioSequenceIndexes[0];\n const currentSequenceAudioElement =\n typeof currentSequenceAudioIndex === \"number\"\n ? audioList[currentSequenceAudioIndex]?.element\n : undefined;\n\n return (\n currentAudioElement ??\n currentSequenceAudioElement ??\n currentInteractionElement ??\n currentStepElement\n );\n};\n\nexport const toPlayerCustomActionList = (\n customActions?: SlidePlayerCustomActions,\n context?: SlidePlayerCustomActionContext\n) => React.Children.toArray(resolvePlayerCustomActions(customActions, context));\n\nexport const getPlayerCustomActionCount = (\n customActions?: SlidePlayerCustomActions,\n context?: SlidePlayerCustomActionContext\n) => toPlayerCustomActionList(customActions, context).length;\n"],"names":["noop","DEFAULT_PLAYER_CUSTOM_ACTION_CONTEXT","resolvePlayerCustomActions","customActions","context","resolvePlayerCustomActionElement","currentAudioIndex","currentAudioSequenceIndexes","audioList","currentStepElement","currentInteractionElement","currentAudioElement","currentSequenceAudioIndex","currentSequenceAudioElement","toPlayerCustomActionList","React","getPlayerCustomActionCount"],"mappings":";AAQA,MAAMA,IAAO,MAAM;AAAC,GAEdC,IAAuE;AAAA,EAC3E,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,UAAU;AAAA,EACV,WAAWD;AAAA,EACX,cAAcA;AAChB,GAEME,IAA6B,CACjCC,GACAC,IAA0CH,MAE1C,OAAOE,KAAkB,aAAaA,EAAcC,CAAO,IAAID,GAUpDE,IAAmC,CAAC;AAAA,EAC/C,mBAAAC;AAAA,EACA,6BAAAC;AAAA,EACA,WAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,2BAAAC;AACF,MAA8C;AAC5C,QAAMC,IACJL,KAAqB,IAAIE,EAAUF,CAAiB,GAAG,UAAU,QAC7DM,IAA4BL,EAA4B,CAAC,GACzDM,IACJ,OAAOD,KAA8B,WACjCJ,EAAUI,CAAyB,GAAG,UACtC;AAEN,SACED,KACAE,KACAH,KACAD;AAEJ,GAEaK,IAA2B,CACtCX,GACAC,MACGW,EAAM,SAAS,QAAQb,EAA2BC,GAAeC,CAAO,CAAC,GAEjEY,IAA6B,CACxCb,GACAC,MACGU,EAAyBX,GAAeC,CAAO,EAAE;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s='input, textarea, select, [contenteditable]:not([contenteditable="false"]), [role="textbox"], [role="slider"], [role="listbox"], [role="combobox"], [role="tablist"], [role="menu"], [role="tree"], [role="grid"], [data-player-keyboard-shortcuts-ignore="true"]',i="button, [role='button']",o=new Set;let a=null;const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s='input, textarea, select, [contenteditable]:not([contenteditable="false"]), [role="textbox"], [role="slider"], [role="listbox"], [role="combobox"], [role="tablist"], [role="menu"], [role="tree"], [role="grid"], [data-player-keyboard-shortcuts-ignore="true"]',i="button, [role='button']",o=new Set;let a=null;const l=e=>{if(!e||typeof e!="object")return null;const t=e;return t.nodeType===3?t.parentElement??null:t},y=(e,t="ltr")=>{if(e.altKey||e.ctrlKey||e.metaKey)return null;const r=e.key.toLowerCase();if(e.shiftKey)switch(r){case"arrowleft":return"previousSubtitle";case"arrowright":return"nextSubtitle";default:return null}if(e.code==="Space"||r===" "||r==="spacebar")return"togglePlayback";switch(r){case"arrowleft":return t==="rtl"?"next":"previous";case"arrowright":return t==="rtl"?"previous":"next";case"f":return"fullscreen";case"c":return"subtitle";case"n":return"interaction";default:return null}},u=e=>{const t=l(e);if(!t)return!1;const r=t.tagName?.toLowerCase();if(r==="input"||r==="textarea"||r==="select"||t.isContentEditable)return!0;const n=t.getAttribute?.("contenteditable");return n!=null?n.toLowerCase()!=="false":!!t.closest?.(s)},c=e=>{const t=l(e);return t?t.tagName?.toLowerCase()==="button"?!0:!!t.closest?.(i):!1},d=(e,t)=>e.defaultPrevented||!t||u(e.target)?!0:t==="togglePlayback"&&c(e.target),b=e=>(o.add(e),(!a||!o.has(a))&&(a=e),()=>{o.delete(e),a===e&&(a=o.values().next().value??null)}),f=e=>{if(o.size===0){a=e;return}o.has(e)&&(a=e)},g=e=>a===e;exports.activatePlayerKeyboardShortcutOwner=f;exports.getPlayerKeyboardShortcutAction=y;exports.isActivePlayerKeyboardShortcutOwner=g;exports.isPlayerKeyboardShortcutEditableTarget=u;exports.isPlayerKeyboardShortcutNativeSpaceTarget=c;exports.registerPlayerKeyboardShortcutOwner=b;exports.shouldIgnorePlayerKeyboardShortcutEvent=d;
|
|
2
2
|
//# sourceMappingURL=playerKeyboardShortcuts.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerKeyboardShortcuts.cjs","sources":["../../../../src/components/Slide/utils/playerKeyboardShortcuts.ts"],"sourcesContent":["export type PlayerKeyboardShortcutAction =\n | \"togglePlayback\"\n | \"previous\"\n | \"next\"\n | \"previousSubtitle\"\n | \"nextSubtitle\"\n | \"fullscreen\"\n | \"subtitle\";\n\nexport interface PlayerKeyboardShortcutEventLike {\n altKey?: boolean;\n code?: string;\n ctrlKey?: boolean;\n defaultPrevented?: boolean;\n key: string;\n metaKey?: boolean;\n shiftKey?: boolean;\n target?: EventTarget | null;\n}\n\ntype KeyboardShortcutTarget = EventTarget & {\n closest?: (selectors: string) => unknown;\n getAttribute?: (qualifiedName: string) => string | null;\n isContentEditable?: boolean;\n nodeType?: number;\n parentElement?: Element | null;\n tagName?: string;\n};\n\nconst EDITABLE_SELECTOR =\n 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"]), [role=\"textbox\"], [role=\"slider\"], [role=\"listbox\"], [role=\"combobox\"], [role=\"tablist\"], [role=\"menu\"], [role=\"tree\"], [role=\"grid\"], [data-player-keyboard-shortcuts-ignore=\"true\"]';\n\nconst NATIVE_SPACE_TARGET_SELECTOR = \"button, [role='button']\";\n\nconst playerKeyboardShortcutOwners = new Set<string>();\nlet activePlayerKeyboardShortcutOwnerId: string | null = null;\n\nconst getTargetCandidate = (\n target: EventTarget | null | undefined\n): KeyboardShortcutTarget | null => {\n if (!target || typeof target !== \"object\") {\n return null;\n }\n\n const candidate = target as KeyboardShortcutTarget;\n\n if (candidate.nodeType === 3) {\n return (candidate.parentElement as KeyboardShortcutTarget | null) ?? null;\n }\n\n return candidate;\n};\n\nexport const getPlayerKeyboardShortcutAction = (\n event: PlayerKeyboardShortcutEventLike,\n direction: \"ltr\" | \"rtl\" = \"ltr\"\n): PlayerKeyboardShortcutAction | null => {\n if (event.altKey || event.ctrlKey || event.metaKey) {\n return null;\n }\n\n const normalizedKey = event.key.toLowerCase();\n\n if (event.shiftKey) {\n switch (normalizedKey) {\n case \"arrowleft\":\n return \"previousSubtitle\";\n case \"arrowright\":\n return \"nextSubtitle\";\n default:\n return null;\n }\n }\n\n if (\n event.code === \"Space\" ||\n normalizedKey === \" \" ||\n normalizedKey === \"spacebar\"\n ) {\n return \"togglePlayback\";\n }\n\n switch (normalizedKey) {\n case \"arrowleft\":\n return direction === \"rtl\" ? \"next\" : \"previous\";\n case \"arrowright\":\n return direction === \"rtl\" ? \"previous\" : \"next\";\n case \"f\":\n return \"fullscreen\";\n case \"c\":\n return \"subtitle\";\n default:\n return null;\n }\n};\n\nexport const isPlayerKeyboardShortcutEditableTarget = (\n target: EventTarget | null | undefined\n) => {\n const candidate = getTargetCandidate(target);\n\n if (!candidate) {\n return false;\n }\n\n const tagName = candidate.tagName?.toLowerCase();\n\n if (tagName === \"input\" || tagName === \"textarea\" || tagName === \"select\") {\n return true;\n }\n\n if (candidate.isContentEditable) {\n return true;\n }\n\n const contentEditable = candidate.getAttribute?.(\"contenteditable\");\n\n if (contentEditable !== undefined && contentEditable !== null) {\n return contentEditable.toLowerCase() !== \"false\";\n }\n\n return Boolean(candidate.closest?.(EDITABLE_SELECTOR));\n};\n\nexport const isPlayerKeyboardShortcutNativeSpaceTarget = (\n target: EventTarget | null | undefined\n) => {\n const candidate = getTargetCandidate(target);\n\n if (!candidate) {\n return false;\n }\n\n const tagName = candidate.tagName?.toLowerCase();\n\n if (tagName === \"button\") {\n return true;\n }\n\n return Boolean(candidate.closest?.(NATIVE_SPACE_TARGET_SELECTOR));\n};\n\nexport const shouldIgnorePlayerKeyboardShortcutEvent = (\n event: PlayerKeyboardShortcutEventLike,\n action: PlayerKeyboardShortcutAction | null\n) => {\n if (event.defaultPrevented || !action) {\n return true;\n }\n\n if (isPlayerKeyboardShortcutEditableTarget(event.target)) {\n return true;\n }\n\n return (\n action === \"togglePlayback\" &&\n isPlayerKeyboardShortcutNativeSpaceTarget(event.target)\n );\n};\n\nexport const registerPlayerKeyboardShortcutOwner = (ownerId: string) => {\n playerKeyboardShortcutOwners.add(ownerId);\n\n if (\n !activePlayerKeyboardShortcutOwnerId ||\n !playerKeyboardShortcutOwners.has(activePlayerKeyboardShortcutOwnerId)\n ) {\n activePlayerKeyboardShortcutOwnerId = ownerId;\n }\n\n return () => {\n playerKeyboardShortcutOwners.delete(ownerId);\n\n if (activePlayerKeyboardShortcutOwnerId !== ownerId) {\n return;\n }\n\n activePlayerKeyboardShortcutOwnerId =\n playerKeyboardShortcutOwners.values().next().value ?? null;\n };\n};\n\nexport const activatePlayerKeyboardShortcutOwner = (ownerId: string) => {\n if (playerKeyboardShortcutOwners.size === 0) {\n activePlayerKeyboardShortcutOwnerId = ownerId;\n return;\n }\n\n if (playerKeyboardShortcutOwners.has(ownerId)) {\n activePlayerKeyboardShortcutOwnerId = ownerId;\n }\n};\n\nexport const isActivePlayerKeyboardShortcutOwner = (ownerId: string) =>\n activePlayerKeyboardShortcutOwnerId === ownerId;\n\nexport const resetPlayerKeyboardShortcutOwnersForTest = () => {\n playerKeyboardShortcutOwners.clear();\n activePlayerKeyboardShortcutOwnerId = null;\n};\n"],"names":["EDITABLE_SELECTOR","NATIVE_SPACE_TARGET_SELECTOR","playerKeyboardShortcutOwners","activePlayerKeyboardShortcutOwnerId","getTargetCandidate","target","candidate","getPlayerKeyboardShortcutAction","event","direction","normalizedKey","isPlayerKeyboardShortcutEditableTarget","tagName","contentEditable","isPlayerKeyboardShortcutNativeSpaceTarget","shouldIgnorePlayerKeyboardShortcutEvent","action","registerPlayerKeyboardShortcutOwner","ownerId","activatePlayerKeyboardShortcutOwner","isActivePlayerKeyboardShortcutOwner"],"mappings":"
|
|
1
|
+
{"version":3,"file":"playerKeyboardShortcuts.cjs","sources":["../../../../src/components/Slide/utils/playerKeyboardShortcuts.ts"],"sourcesContent":["export type PlayerKeyboardShortcutAction =\n | \"togglePlayback\"\n | \"previous\"\n | \"next\"\n | \"previousSubtitle\"\n | \"nextSubtitle\"\n | \"fullscreen\"\n | \"subtitle\"\n | \"interaction\";\n\nexport interface PlayerKeyboardShortcutEventLike {\n altKey?: boolean;\n code?: string;\n ctrlKey?: boolean;\n defaultPrevented?: boolean;\n key: string;\n metaKey?: boolean;\n shiftKey?: boolean;\n target?: EventTarget | null;\n}\n\ntype KeyboardShortcutTarget = EventTarget & {\n closest?: (selectors: string) => unknown;\n getAttribute?: (qualifiedName: string) => string | null;\n isContentEditable?: boolean;\n nodeType?: number;\n parentElement?: Element | null;\n tagName?: string;\n};\n\nconst EDITABLE_SELECTOR =\n 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"]), [role=\"textbox\"], [role=\"slider\"], [role=\"listbox\"], [role=\"combobox\"], [role=\"tablist\"], [role=\"menu\"], [role=\"tree\"], [role=\"grid\"], [data-player-keyboard-shortcuts-ignore=\"true\"]';\n\nconst NATIVE_SPACE_TARGET_SELECTOR = \"button, [role='button']\";\n\nconst playerKeyboardShortcutOwners = new Set<string>();\nlet activePlayerKeyboardShortcutOwnerId: string | null = null;\n\nconst getTargetCandidate = (\n target: EventTarget | null | undefined\n): KeyboardShortcutTarget | null => {\n if (!target || typeof target !== \"object\") {\n return null;\n }\n\n const candidate = target as KeyboardShortcutTarget;\n\n if (candidate.nodeType === 3) {\n return (candidate.parentElement as KeyboardShortcutTarget | null) ?? null;\n }\n\n return candidate;\n};\n\nexport const getPlayerKeyboardShortcutAction = (\n event: PlayerKeyboardShortcutEventLike,\n direction: \"ltr\" | \"rtl\" = \"ltr\"\n): PlayerKeyboardShortcutAction | null => {\n if (event.altKey || event.ctrlKey || event.metaKey) {\n return null;\n }\n\n const normalizedKey = event.key.toLowerCase();\n\n if (event.shiftKey) {\n switch (normalizedKey) {\n case \"arrowleft\":\n return \"previousSubtitle\";\n case \"arrowright\":\n return \"nextSubtitle\";\n default:\n return null;\n }\n }\n\n if (\n event.code === \"Space\" ||\n normalizedKey === \" \" ||\n normalizedKey === \"spacebar\"\n ) {\n return \"togglePlayback\";\n }\n\n switch (normalizedKey) {\n case \"arrowleft\":\n return direction === \"rtl\" ? \"next\" : \"previous\";\n case \"arrowright\":\n return direction === \"rtl\" ? \"previous\" : \"next\";\n case \"f\":\n return \"fullscreen\";\n case \"c\":\n return \"subtitle\";\n case \"n\":\n return \"interaction\";\n default:\n return null;\n }\n};\n\nexport const isPlayerKeyboardShortcutEditableTarget = (\n target: EventTarget | null | undefined\n) => {\n const candidate = getTargetCandidate(target);\n\n if (!candidate) {\n return false;\n }\n\n const tagName = candidate.tagName?.toLowerCase();\n\n if (tagName === \"input\" || tagName === \"textarea\" || tagName === \"select\") {\n return true;\n }\n\n if (candidate.isContentEditable) {\n return true;\n }\n\n const contentEditable = candidate.getAttribute?.(\"contenteditable\");\n\n if (contentEditable !== undefined && contentEditable !== null) {\n return contentEditable.toLowerCase() !== \"false\";\n }\n\n return Boolean(candidate.closest?.(EDITABLE_SELECTOR));\n};\n\nexport const isPlayerKeyboardShortcutNativeSpaceTarget = (\n target: EventTarget | null | undefined\n) => {\n const candidate = getTargetCandidate(target);\n\n if (!candidate) {\n return false;\n }\n\n const tagName = candidate.tagName?.toLowerCase();\n\n if (tagName === \"button\") {\n return true;\n }\n\n return Boolean(candidate.closest?.(NATIVE_SPACE_TARGET_SELECTOR));\n};\n\nexport const shouldIgnorePlayerKeyboardShortcutEvent = (\n event: PlayerKeyboardShortcutEventLike,\n action: PlayerKeyboardShortcutAction | null\n) => {\n if (event.defaultPrevented || !action) {\n return true;\n }\n\n if (isPlayerKeyboardShortcutEditableTarget(event.target)) {\n return true;\n }\n\n return (\n action === \"togglePlayback\" &&\n isPlayerKeyboardShortcutNativeSpaceTarget(event.target)\n );\n};\n\nexport const registerPlayerKeyboardShortcutOwner = (ownerId: string) => {\n playerKeyboardShortcutOwners.add(ownerId);\n\n if (\n !activePlayerKeyboardShortcutOwnerId ||\n !playerKeyboardShortcutOwners.has(activePlayerKeyboardShortcutOwnerId)\n ) {\n activePlayerKeyboardShortcutOwnerId = ownerId;\n }\n\n return () => {\n playerKeyboardShortcutOwners.delete(ownerId);\n\n if (activePlayerKeyboardShortcutOwnerId !== ownerId) {\n return;\n }\n\n activePlayerKeyboardShortcutOwnerId =\n playerKeyboardShortcutOwners.values().next().value ?? null;\n };\n};\n\nexport const activatePlayerKeyboardShortcutOwner = (ownerId: string) => {\n if (playerKeyboardShortcutOwners.size === 0) {\n activePlayerKeyboardShortcutOwnerId = ownerId;\n return;\n }\n\n if (playerKeyboardShortcutOwners.has(ownerId)) {\n activePlayerKeyboardShortcutOwnerId = ownerId;\n }\n};\n\nexport const isActivePlayerKeyboardShortcutOwner = (ownerId: string) =>\n activePlayerKeyboardShortcutOwnerId === ownerId;\n\nexport const resetPlayerKeyboardShortcutOwnersForTest = () => {\n playerKeyboardShortcutOwners.clear();\n activePlayerKeyboardShortcutOwnerId = null;\n};\n"],"names":["EDITABLE_SELECTOR","NATIVE_SPACE_TARGET_SELECTOR","playerKeyboardShortcutOwners","activePlayerKeyboardShortcutOwnerId","getTargetCandidate","target","candidate","getPlayerKeyboardShortcutAction","event","direction","normalizedKey","isPlayerKeyboardShortcutEditableTarget","tagName","contentEditable","isPlayerKeyboardShortcutNativeSpaceTarget","shouldIgnorePlayerKeyboardShortcutEvent","action","registerPlayerKeyboardShortcutOwner","ownerId","activatePlayerKeyboardShortcutOwner","isActivePlayerKeyboardShortcutOwner"],"mappings":"gFA8BA,MAAMA,EACJ,mQAEIC,EAA+B,0BAE/BC,MAAmC,IACzC,IAAIC,EAAqD,KAEzD,MAAMC,EACJC,GACkC,CAClC,GAAI,CAACA,GAAU,OAAOA,GAAW,SAC/B,OAAO,KAGT,MAAMC,EAAYD,EAElB,OAAIC,EAAU,WAAa,EACjBA,EAAU,eAAmD,KAGhEA,CACT,EAEaC,EAAkC,CAC7CC,EACAC,EAA2B,QACa,CACxC,GAAID,EAAM,QAAUA,EAAM,SAAWA,EAAM,QACzC,OAAO,KAGT,MAAME,EAAgBF,EAAM,IAAI,YAAA,EAEhC,GAAIA,EAAM,SACR,OAAQE,EAAA,CACN,IAAK,YACH,MAAO,mBACT,IAAK,aACH,MAAO,eACT,QACE,OAAO,IAAA,CAIb,GACEF,EAAM,OAAS,SACfE,IAAkB,KAClBA,IAAkB,WAElB,MAAO,iBAGT,OAAQA,EAAA,CACN,IAAK,YACH,OAAOD,IAAc,MAAQ,OAAS,WACxC,IAAK,aACH,OAAOA,IAAc,MAAQ,WAAa,OAC5C,IAAK,IACH,MAAO,aACT,IAAK,IACH,MAAO,WACT,IAAK,IACH,MAAO,cACT,QACE,OAAO,IAAA,CAEb,EAEaE,EACXN,GACG,CACH,MAAMC,EAAYF,EAAmBC,CAAM,EAE3C,GAAI,CAACC,EACH,MAAO,GAGT,MAAMM,EAAUN,EAAU,SAAS,YAAA,EAMnC,GAJIM,IAAY,SAAWA,IAAY,YAAcA,IAAY,UAI7DN,EAAU,kBACZ,MAAO,GAGT,MAAMO,EAAkBP,EAAU,eAAe,iBAAiB,EAElE,OAAqCO,GAAoB,KAChDA,EAAgB,gBAAkB,QAGpC,EAAQP,EAAU,UAAUN,CAAiB,CACtD,EAEac,EACXT,GACG,CACH,MAAMC,EAAYF,EAAmBC,CAAM,EAE3C,OAAKC,EAIWA,EAAU,SAAS,YAAA,IAEnB,SACP,GAGF,EAAQA,EAAU,UAAUL,CAA4B,EATtD,EAUX,EAEac,EAA0C,CACrDP,EACAQ,IAEIR,EAAM,kBAAoB,CAACQ,GAI3BL,EAAuCH,EAAM,MAAM,EAC9C,GAIPQ,IAAW,kBACXF,EAA0CN,EAAM,MAAM,EAI7CS,EAAuCC,IAClDhB,EAA6B,IAAIgB,CAAO,GAGtC,CAACf,GACD,CAACD,EAA6B,IAAIC,CAAmC,KAErEA,EAAsCe,GAGjC,IAAM,CACXhB,EAA6B,OAAOgB,CAAO,EAEvCf,IAAwCe,IAI5Cf,EACED,EAA6B,OAAA,EAAS,KAAA,EAAO,OAAS,KAC1D,GAGWiB,EAAuCD,GAAoB,CACtE,GAAIhB,EAA6B,OAAS,EAAG,CAC3CC,EAAsCe,EACtC,MACF,CAEIhB,EAA6B,IAAIgB,CAAO,IAC1Cf,EAAsCe,EAE1C,EAEaE,EAAuCF,GAClDf,IAAwCe"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type PlayerKeyboardShortcutAction = "togglePlayback" | "previous" | "next" | "previousSubtitle" | "nextSubtitle" | "fullscreen" | "subtitle";
|
|
1
|
+
export type PlayerKeyboardShortcutAction = "togglePlayback" | "previous" | "next" | "previousSubtitle" | "nextSubtitle" | "fullscreen" | "subtitle" | "interaction";
|
|
2
2
|
export interface PlayerKeyboardShortcutEventLike {
|
|
3
3
|
altKey?: boolean;
|
|
4
4
|
code?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerKeyboardShortcuts.es.js","sources":["../../../../src/components/Slide/utils/playerKeyboardShortcuts.ts"],"sourcesContent":["export type PlayerKeyboardShortcutAction =\n | \"togglePlayback\"\n | \"previous\"\n | \"next\"\n | \"previousSubtitle\"\n | \"nextSubtitle\"\n | \"fullscreen\"\n | \"subtitle\";\n\nexport interface PlayerKeyboardShortcutEventLike {\n altKey?: boolean;\n code?: string;\n ctrlKey?: boolean;\n defaultPrevented?: boolean;\n key: string;\n metaKey?: boolean;\n shiftKey?: boolean;\n target?: EventTarget | null;\n}\n\ntype KeyboardShortcutTarget = EventTarget & {\n closest?: (selectors: string) => unknown;\n getAttribute?: (qualifiedName: string) => string | null;\n isContentEditable?: boolean;\n nodeType?: number;\n parentElement?: Element | null;\n tagName?: string;\n};\n\nconst EDITABLE_SELECTOR =\n 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"]), [role=\"textbox\"], [role=\"slider\"], [role=\"listbox\"], [role=\"combobox\"], [role=\"tablist\"], [role=\"menu\"], [role=\"tree\"], [role=\"grid\"], [data-player-keyboard-shortcuts-ignore=\"true\"]';\n\nconst NATIVE_SPACE_TARGET_SELECTOR = \"button, [role='button']\";\n\nconst playerKeyboardShortcutOwners = new Set<string>();\nlet activePlayerKeyboardShortcutOwnerId: string | null = null;\n\nconst getTargetCandidate = (\n target: EventTarget | null | undefined\n): KeyboardShortcutTarget | null => {\n if (!target || typeof target !== \"object\") {\n return null;\n }\n\n const candidate = target as KeyboardShortcutTarget;\n\n if (candidate.nodeType === 3) {\n return (candidate.parentElement as KeyboardShortcutTarget | null) ?? null;\n }\n\n return candidate;\n};\n\nexport const getPlayerKeyboardShortcutAction = (\n event: PlayerKeyboardShortcutEventLike,\n direction: \"ltr\" | \"rtl\" = \"ltr\"\n): PlayerKeyboardShortcutAction | null => {\n if (event.altKey || event.ctrlKey || event.metaKey) {\n return null;\n }\n\n const normalizedKey = event.key.toLowerCase();\n\n if (event.shiftKey) {\n switch (normalizedKey) {\n case \"arrowleft\":\n return \"previousSubtitle\";\n case \"arrowright\":\n return \"nextSubtitle\";\n default:\n return null;\n }\n }\n\n if (\n event.code === \"Space\" ||\n normalizedKey === \" \" ||\n normalizedKey === \"spacebar\"\n ) {\n return \"togglePlayback\";\n }\n\n switch (normalizedKey) {\n case \"arrowleft\":\n return direction === \"rtl\" ? \"next\" : \"previous\";\n case \"arrowright\":\n return direction === \"rtl\" ? \"previous\" : \"next\";\n case \"f\":\n return \"fullscreen\";\n case \"c\":\n return \"subtitle\";\n default:\n return null;\n }\n};\n\nexport const isPlayerKeyboardShortcutEditableTarget = (\n target: EventTarget | null | undefined\n) => {\n const candidate = getTargetCandidate(target);\n\n if (!candidate) {\n return false;\n }\n\n const tagName = candidate.tagName?.toLowerCase();\n\n if (tagName === \"input\" || tagName === \"textarea\" || tagName === \"select\") {\n return true;\n }\n\n if (candidate.isContentEditable) {\n return true;\n }\n\n const contentEditable = candidate.getAttribute?.(\"contenteditable\");\n\n if (contentEditable !== undefined && contentEditable !== null) {\n return contentEditable.toLowerCase() !== \"false\";\n }\n\n return Boolean(candidate.closest?.(EDITABLE_SELECTOR));\n};\n\nexport const isPlayerKeyboardShortcutNativeSpaceTarget = (\n target: EventTarget | null | undefined\n) => {\n const candidate = getTargetCandidate(target);\n\n if (!candidate) {\n return false;\n }\n\n const tagName = candidate.tagName?.toLowerCase();\n\n if (tagName === \"button\") {\n return true;\n }\n\n return Boolean(candidate.closest?.(NATIVE_SPACE_TARGET_SELECTOR));\n};\n\nexport const shouldIgnorePlayerKeyboardShortcutEvent = (\n event: PlayerKeyboardShortcutEventLike,\n action: PlayerKeyboardShortcutAction | null\n) => {\n if (event.defaultPrevented || !action) {\n return true;\n }\n\n if (isPlayerKeyboardShortcutEditableTarget(event.target)) {\n return true;\n }\n\n return (\n action === \"togglePlayback\" &&\n isPlayerKeyboardShortcutNativeSpaceTarget(event.target)\n );\n};\n\nexport const registerPlayerKeyboardShortcutOwner = (ownerId: string) => {\n playerKeyboardShortcutOwners.add(ownerId);\n\n if (\n !activePlayerKeyboardShortcutOwnerId ||\n !playerKeyboardShortcutOwners.has(activePlayerKeyboardShortcutOwnerId)\n ) {\n activePlayerKeyboardShortcutOwnerId = ownerId;\n }\n\n return () => {\n playerKeyboardShortcutOwners.delete(ownerId);\n\n if (activePlayerKeyboardShortcutOwnerId !== ownerId) {\n return;\n }\n\n activePlayerKeyboardShortcutOwnerId =\n playerKeyboardShortcutOwners.values().next().value ?? null;\n };\n};\n\nexport const activatePlayerKeyboardShortcutOwner = (ownerId: string) => {\n if (playerKeyboardShortcutOwners.size === 0) {\n activePlayerKeyboardShortcutOwnerId = ownerId;\n return;\n }\n\n if (playerKeyboardShortcutOwners.has(ownerId)) {\n activePlayerKeyboardShortcutOwnerId = ownerId;\n }\n};\n\nexport const isActivePlayerKeyboardShortcutOwner = (ownerId: string) =>\n activePlayerKeyboardShortcutOwnerId === ownerId;\n\nexport const resetPlayerKeyboardShortcutOwnersForTest = () => {\n playerKeyboardShortcutOwners.clear();\n activePlayerKeyboardShortcutOwnerId = null;\n};\n"],"names":["EDITABLE_SELECTOR","NATIVE_SPACE_TARGET_SELECTOR","playerKeyboardShortcutOwners","activePlayerKeyboardShortcutOwnerId","getTargetCandidate","target","candidate","getPlayerKeyboardShortcutAction","event","direction","normalizedKey","isPlayerKeyboardShortcutEditableTarget","tagName","contentEditable","isPlayerKeyboardShortcutNativeSpaceTarget","shouldIgnorePlayerKeyboardShortcutEvent","action","registerPlayerKeyboardShortcutOwner","ownerId","activatePlayerKeyboardShortcutOwner","isActivePlayerKeyboardShortcutOwner"],"mappings":"
|
|
1
|
+
{"version":3,"file":"playerKeyboardShortcuts.es.js","sources":["../../../../src/components/Slide/utils/playerKeyboardShortcuts.ts"],"sourcesContent":["export type PlayerKeyboardShortcutAction =\n | \"togglePlayback\"\n | \"previous\"\n | \"next\"\n | \"previousSubtitle\"\n | \"nextSubtitle\"\n | \"fullscreen\"\n | \"subtitle\"\n | \"interaction\";\n\nexport interface PlayerKeyboardShortcutEventLike {\n altKey?: boolean;\n code?: string;\n ctrlKey?: boolean;\n defaultPrevented?: boolean;\n key: string;\n metaKey?: boolean;\n shiftKey?: boolean;\n target?: EventTarget | null;\n}\n\ntype KeyboardShortcutTarget = EventTarget & {\n closest?: (selectors: string) => unknown;\n getAttribute?: (qualifiedName: string) => string | null;\n isContentEditable?: boolean;\n nodeType?: number;\n parentElement?: Element | null;\n tagName?: string;\n};\n\nconst EDITABLE_SELECTOR =\n 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"]), [role=\"textbox\"], [role=\"slider\"], [role=\"listbox\"], [role=\"combobox\"], [role=\"tablist\"], [role=\"menu\"], [role=\"tree\"], [role=\"grid\"], [data-player-keyboard-shortcuts-ignore=\"true\"]';\n\nconst NATIVE_SPACE_TARGET_SELECTOR = \"button, [role='button']\";\n\nconst playerKeyboardShortcutOwners = new Set<string>();\nlet activePlayerKeyboardShortcutOwnerId: string | null = null;\n\nconst getTargetCandidate = (\n target: EventTarget | null | undefined\n): KeyboardShortcutTarget | null => {\n if (!target || typeof target !== \"object\") {\n return null;\n }\n\n const candidate = target as KeyboardShortcutTarget;\n\n if (candidate.nodeType === 3) {\n return (candidate.parentElement as KeyboardShortcutTarget | null) ?? null;\n }\n\n return candidate;\n};\n\nexport const getPlayerKeyboardShortcutAction = (\n event: PlayerKeyboardShortcutEventLike,\n direction: \"ltr\" | \"rtl\" = \"ltr\"\n): PlayerKeyboardShortcutAction | null => {\n if (event.altKey || event.ctrlKey || event.metaKey) {\n return null;\n }\n\n const normalizedKey = event.key.toLowerCase();\n\n if (event.shiftKey) {\n switch (normalizedKey) {\n case \"arrowleft\":\n return \"previousSubtitle\";\n case \"arrowright\":\n return \"nextSubtitle\";\n default:\n return null;\n }\n }\n\n if (\n event.code === \"Space\" ||\n normalizedKey === \" \" ||\n normalizedKey === \"spacebar\"\n ) {\n return \"togglePlayback\";\n }\n\n switch (normalizedKey) {\n case \"arrowleft\":\n return direction === \"rtl\" ? \"next\" : \"previous\";\n case \"arrowright\":\n return direction === \"rtl\" ? \"previous\" : \"next\";\n case \"f\":\n return \"fullscreen\";\n case \"c\":\n return \"subtitle\";\n case \"n\":\n return \"interaction\";\n default:\n return null;\n }\n};\n\nexport const isPlayerKeyboardShortcutEditableTarget = (\n target: EventTarget | null | undefined\n) => {\n const candidate = getTargetCandidate(target);\n\n if (!candidate) {\n return false;\n }\n\n const tagName = candidate.tagName?.toLowerCase();\n\n if (tagName === \"input\" || tagName === \"textarea\" || tagName === \"select\") {\n return true;\n }\n\n if (candidate.isContentEditable) {\n return true;\n }\n\n const contentEditable = candidate.getAttribute?.(\"contenteditable\");\n\n if (contentEditable !== undefined && contentEditable !== null) {\n return contentEditable.toLowerCase() !== \"false\";\n }\n\n return Boolean(candidate.closest?.(EDITABLE_SELECTOR));\n};\n\nexport const isPlayerKeyboardShortcutNativeSpaceTarget = (\n target: EventTarget | null | undefined\n) => {\n const candidate = getTargetCandidate(target);\n\n if (!candidate) {\n return false;\n }\n\n const tagName = candidate.tagName?.toLowerCase();\n\n if (tagName === \"button\") {\n return true;\n }\n\n return Boolean(candidate.closest?.(NATIVE_SPACE_TARGET_SELECTOR));\n};\n\nexport const shouldIgnorePlayerKeyboardShortcutEvent = (\n event: PlayerKeyboardShortcutEventLike,\n action: PlayerKeyboardShortcutAction | null\n) => {\n if (event.defaultPrevented || !action) {\n return true;\n }\n\n if (isPlayerKeyboardShortcutEditableTarget(event.target)) {\n return true;\n }\n\n return (\n action === \"togglePlayback\" &&\n isPlayerKeyboardShortcutNativeSpaceTarget(event.target)\n );\n};\n\nexport const registerPlayerKeyboardShortcutOwner = (ownerId: string) => {\n playerKeyboardShortcutOwners.add(ownerId);\n\n if (\n !activePlayerKeyboardShortcutOwnerId ||\n !playerKeyboardShortcutOwners.has(activePlayerKeyboardShortcutOwnerId)\n ) {\n activePlayerKeyboardShortcutOwnerId = ownerId;\n }\n\n return () => {\n playerKeyboardShortcutOwners.delete(ownerId);\n\n if (activePlayerKeyboardShortcutOwnerId !== ownerId) {\n return;\n }\n\n activePlayerKeyboardShortcutOwnerId =\n playerKeyboardShortcutOwners.values().next().value ?? null;\n };\n};\n\nexport const activatePlayerKeyboardShortcutOwner = (ownerId: string) => {\n if (playerKeyboardShortcutOwners.size === 0) {\n activePlayerKeyboardShortcutOwnerId = ownerId;\n return;\n }\n\n if (playerKeyboardShortcutOwners.has(ownerId)) {\n activePlayerKeyboardShortcutOwnerId = ownerId;\n }\n};\n\nexport const isActivePlayerKeyboardShortcutOwner = (ownerId: string) =>\n activePlayerKeyboardShortcutOwnerId === ownerId;\n\nexport const resetPlayerKeyboardShortcutOwnersForTest = () => {\n playerKeyboardShortcutOwners.clear();\n activePlayerKeyboardShortcutOwnerId = null;\n};\n"],"names":["EDITABLE_SELECTOR","NATIVE_SPACE_TARGET_SELECTOR","playerKeyboardShortcutOwners","activePlayerKeyboardShortcutOwnerId","getTargetCandidate","target","candidate","getPlayerKeyboardShortcutAction","event","direction","normalizedKey","isPlayerKeyboardShortcutEditableTarget","tagName","contentEditable","isPlayerKeyboardShortcutNativeSpaceTarget","shouldIgnorePlayerKeyboardShortcutEvent","action","registerPlayerKeyboardShortcutOwner","ownerId","activatePlayerKeyboardShortcutOwner","isActivePlayerKeyboardShortcutOwner"],"mappings":"AA8BA,MAAMA,IACJ,oQAEIC,IAA+B,2BAE/BC,wBAAmC,IAAA;AACzC,IAAIC,IAAqD;AAEzD,MAAMC,IAAqB,CACzBC,MACkC;AAClC,MAAI,CAACA,KAAU,OAAOA,KAAW;AAC/B,WAAO;AAGT,QAAMC,IAAYD;AAElB,SAAIC,EAAU,aAAa,IACjBA,EAAU,iBAAmD,OAGhEA;AACT,GAEaC,IAAkC,CAC7CC,GACAC,IAA2B,UACa;AACxC,MAAID,EAAM,UAAUA,EAAM,WAAWA,EAAM;AACzC,WAAO;AAGT,QAAME,IAAgBF,EAAM,IAAI,YAAA;AAEhC,MAAIA,EAAM;AACR,YAAQE,GAAA;AAAA,MACN,KAAK;AACH,eAAO;AAAA,MACT,KAAK;AACH,eAAO;AAAA,MACT;AACE,eAAO;AAAA,IAAA;AAIb,MACEF,EAAM,SAAS,WACfE,MAAkB,OAClBA,MAAkB;AAElB,WAAO;AAGT,UAAQA,GAAA;AAAA,IACN,KAAK;AACH,aAAOD,MAAc,QAAQ,SAAS;AAAA,IACxC,KAAK;AACH,aAAOA,MAAc,QAAQ,aAAa;AAAA,IAC5C,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EAAA;AAEb,GAEaE,IAAyC,CACpDN,MACG;AACH,QAAMC,IAAYF,EAAmBC,CAAM;AAE3C,MAAI,CAACC;AACH,WAAO;AAGT,QAAMM,IAAUN,EAAU,SAAS,YAAA;AAMnC,MAJIM,MAAY,WAAWA,MAAY,cAAcA,MAAY,YAI7DN,EAAU;AACZ,WAAO;AAGT,QAAMO,IAAkBP,EAAU,eAAe,iBAAiB;AAElE,SAAqCO,KAAoB,OAChDA,EAAgB,kBAAkB,UAGpC,EAAQP,EAAU,UAAUN,CAAiB;AACtD,GAEac,IAA4C,CACvDT,MACG;AACH,QAAMC,IAAYF,EAAmBC,CAAM;AAE3C,SAAKC,IAIWA,EAAU,SAAS,YAAA,MAEnB,WACP,KAGF,EAAQA,EAAU,UAAUL,CAA4B,IATtD;AAUX,GAEac,IAA0C,CACrDP,GACAQ,MAEIR,EAAM,oBAAoB,CAACQ,KAI3BL,EAAuCH,EAAM,MAAM,IAC9C,KAIPQ,MAAW,oBACXF,EAA0CN,EAAM,MAAM,GAI7CS,IAAsC,CAACC,OAClDhB,EAA6B,IAAIgB,CAAO,IAGtC,CAACf,KACD,CAACD,EAA6B,IAAIC,CAAmC,OAErEA,IAAsCe,IAGjC,MAAM;AAGX,EAFAhB,EAA6B,OAAOgB,CAAO,GAEvCf,MAAwCe,MAI5Cf,IACED,EAA6B,OAAA,EAAS,KAAA,EAAO,SAAS;AAC1D,IAGWiB,IAAsC,CAACD,MAAoB;AACtE,MAAIhB,EAA6B,SAAS,GAAG;AAC3C,IAAAC,IAAsCe;AACtC;AAAA,EACF;AAEA,EAAIhB,EAA6B,IAAIgB,CAAO,MAC1Cf,IAAsCe;AAE1C,GAEaE,IAAsC,CAACF,MAClDf,MAAwCe;"}
|
|
@@ -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 t=({playerEnabled:l,playerControlsVisibility:e})=>({playerEnabled:l??!0,playerControlsVisibility:e??"auto"}),r=({isAutoVisible:l,playerControlsVisibility:e,shouldMountPlayer:i})=>({controlsVisible:i&&e!=="hidden"&&(e==="visible"||l),layoutReserved:i});exports.resolveSlidePlayerLayoutState=r;exports.resolveSlidePlayerVisibility=t;
|
|
2
2
|
//# sourceMappingURL=playerVisibility.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerVisibility.cjs","sources":["../../../../src/components/Slide/utils/playerVisibility.ts"],"sourcesContent":["export type SlidePlayerControlsVisibility = \"auto\" | \"visible\" | \"hidden\";\n\nexport interface ResolveSlidePlayerVisibilityOptions {\n playerEnabled?: boolean;\n playerControlsVisibility?: SlidePlayerControlsVisibility;\n}\n\nexport interface ResolvedSlidePlayerVisibility {\n playerEnabled: boolean;\n playerControlsVisibility: SlidePlayerControlsVisibility;\n}\n\nexport const resolveSlidePlayerVisibility = ({\n playerEnabled,\n playerControlsVisibility,\n}: ResolveSlidePlayerVisibilityOptions): ResolvedSlidePlayerVisibility => ({\n playerEnabled: playerEnabled ?? true,\n playerControlsVisibility: playerControlsVisibility ?? \"auto\",\n});\n"],"names":["resolveSlidePlayerVisibility","playerEnabled","playerControlsVisibility"],"mappings":"
|
|
1
|
+
{"version":3,"file":"playerVisibility.cjs","sources":["../../../../src/components/Slide/utils/playerVisibility.ts"],"sourcesContent":["export type SlidePlayerControlsVisibility = \"auto\" | \"visible\" | \"hidden\";\n\nexport interface ResolveSlidePlayerVisibilityOptions {\n playerEnabled?: boolean;\n playerControlsVisibility?: SlidePlayerControlsVisibility;\n}\n\nexport interface ResolvedSlidePlayerVisibility {\n playerEnabled: boolean;\n playerControlsVisibility: SlidePlayerControlsVisibility;\n}\n\nexport interface ResolveSlidePlayerLayoutStateOptions {\n isAutoVisible: boolean;\n playerControlsVisibility: SlidePlayerControlsVisibility;\n shouldMountPlayer: boolean;\n}\n\nexport interface ResolvedSlidePlayerLayoutState {\n controlsVisible: boolean;\n layoutReserved: boolean;\n}\n\nexport const resolveSlidePlayerVisibility = ({\n playerEnabled,\n playerControlsVisibility,\n}: ResolveSlidePlayerVisibilityOptions): ResolvedSlidePlayerVisibility => ({\n playerEnabled: playerEnabled ?? true,\n playerControlsVisibility: playerControlsVisibility ?? \"auto\",\n});\n\nexport const resolveSlidePlayerLayoutState = ({\n isAutoVisible,\n playerControlsVisibility,\n shouldMountPlayer,\n}: ResolveSlidePlayerLayoutStateOptions): ResolvedSlidePlayerLayoutState => ({\n controlsVisible:\n shouldMountPlayer &&\n playerControlsVisibility !== \"hidden\" &&\n (playerControlsVisibility === \"visible\" || isAutoVisible),\n layoutReserved: shouldMountPlayer,\n});\n"],"names":["resolveSlidePlayerVisibility","playerEnabled","playerControlsVisibility","resolveSlidePlayerLayoutState","isAutoVisible","shouldMountPlayer"],"mappings":"gFAuBO,MAAMA,EAA+B,CAAC,CAC3C,cAAAC,EACA,yBAAAC,CACF,KAA2E,CACzE,cAAeD,GAAiB,GAChC,yBAA0BC,GAA4B,MACxD,GAEaC,EAAgC,CAAC,CAC5C,cAAAC,EACA,yBAAAF,EACA,kBAAAG,CACF,KAA6E,CAC3E,gBACEA,GACAH,IAA6B,WAC5BA,IAA6B,WAAaE,GAC7C,eAAgBC,CAClB"}
|
|
@@ -7,4 +7,14 @@ export interface ResolvedSlidePlayerVisibility {
|
|
|
7
7
|
playerEnabled: boolean;
|
|
8
8
|
playerControlsVisibility: SlidePlayerControlsVisibility;
|
|
9
9
|
}
|
|
10
|
+
export interface ResolveSlidePlayerLayoutStateOptions {
|
|
11
|
+
isAutoVisible: boolean;
|
|
12
|
+
playerControlsVisibility: SlidePlayerControlsVisibility;
|
|
13
|
+
shouldMountPlayer: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ResolvedSlidePlayerLayoutState {
|
|
16
|
+
controlsVisible: boolean;
|
|
17
|
+
layoutReserved: boolean;
|
|
18
|
+
}
|
|
10
19
|
export declare const resolveSlidePlayerVisibility: ({ playerEnabled, playerControlsVisibility, }: ResolveSlidePlayerVisibilityOptions) => ResolvedSlidePlayerVisibility;
|
|
20
|
+
export declare const resolveSlidePlayerLayoutState: ({ isAutoVisible, playerControlsVisibility, shouldMountPlayer, }: ResolveSlidePlayerLayoutStateOptions) => ResolvedSlidePlayerLayoutState;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
const
|
|
2
|
-
playerEnabled:
|
|
3
|
-
playerControlsVisibility:
|
|
1
|
+
const t = ({
|
|
2
|
+
playerEnabled: i,
|
|
3
|
+
playerControlsVisibility: e
|
|
4
4
|
}) => ({
|
|
5
|
-
playerEnabled:
|
|
6
|
-
playerControlsVisibility:
|
|
5
|
+
playerEnabled: i ?? !0,
|
|
6
|
+
playerControlsVisibility: e ?? "auto"
|
|
7
|
+
}), o = ({
|
|
8
|
+
isAutoVisible: i,
|
|
9
|
+
playerControlsVisibility: e,
|
|
10
|
+
shouldMountPlayer: l
|
|
11
|
+
}) => ({
|
|
12
|
+
controlsVisible: l && e !== "hidden" && (e === "visible" || i),
|
|
13
|
+
layoutReserved: l
|
|
7
14
|
});
|
|
8
15
|
export {
|
|
9
|
-
|
|
16
|
+
o as resolveSlidePlayerLayoutState,
|
|
17
|
+
t as resolveSlidePlayerVisibility
|
|
10
18
|
};
|
|
11
19
|
//# sourceMappingURL=playerVisibility.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerVisibility.es.js","sources":["../../../../src/components/Slide/utils/playerVisibility.ts"],"sourcesContent":["export type SlidePlayerControlsVisibility = \"auto\" | \"visible\" | \"hidden\";\n\nexport interface ResolveSlidePlayerVisibilityOptions {\n playerEnabled?: boolean;\n playerControlsVisibility?: SlidePlayerControlsVisibility;\n}\n\nexport interface ResolvedSlidePlayerVisibility {\n playerEnabled: boolean;\n playerControlsVisibility: SlidePlayerControlsVisibility;\n}\n\nexport const resolveSlidePlayerVisibility = ({\n playerEnabled,\n playerControlsVisibility,\n}: ResolveSlidePlayerVisibilityOptions): ResolvedSlidePlayerVisibility => ({\n playerEnabled: playerEnabled ?? true,\n playerControlsVisibility: playerControlsVisibility ?? \"auto\",\n});\n"],"names":["resolveSlidePlayerVisibility","playerEnabled","playerControlsVisibility"],"mappings":"
|
|
1
|
+
{"version":3,"file":"playerVisibility.es.js","sources":["../../../../src/components/Slide/utils/playerVisibility.ts"],"sourcesContent":["export type SlidePlayerControlsVisibility = \"auto\" | \"visible\" | \"hidden\";\n\nexport interface ResolveSlidePlayerVisibilityOptions {\n playerEnabled?: boolean;\n playerControlsVisibility?: SlidePlayerControlsVisibility;\n}\n\nexport interface ResolvedSlidePlayerVisibility {\n playerEnabled: boolean;\n playerControlsVisibility: SlidePlayerControlsVisibility;\n}\n\nexport interface ResolveSlidePlayerLayoutStateOptions {\n isAutoVisible: boolean;\n playerControlsVisibility: SlidePlayerControlsVisibility;\n shouldMountPlayer: boolean;\n}\n\nexport interface ResolvedSlidePlayerLayoutState {\n controlsVisible: boolean;\n layoutReserved: boolean;\n}\n\nexport const resolveSlidePlayerVisibility = ({\n playerEnabled,\n playerControlsVisibility,\n}: ResolveSlidePlayerVisibilityOptions): ResolvedSlidePlayerVisibility => ({\n playerEnabled: playerEnabled ?? true,\n playerControlsVisibility: playerControlsVisibility ?? \"auto\",\n});\n\nexport const resolveSlidePlayerLayoutState = ({\n isAutoVisible,\n playerControlsVisibility,\n shouldMountPlayer,\n}: ResolveSlidePlayerLayoutStateOptions): ResolvedSlidePlayerLayoutState => ({\n controlsVisible:\n shouldMountPlayer &&\n playerControlsVisibility !== \"hidden\" &&\n (playerControlsVisibility === \"visible\" || isAutoVisible),\n layoutReserved: shouldMountPlayer,\n});\n"],"names":["resolveSlidePlayerVisibility","playerEnabled","playerControlsVisibility","resolveSlidePlayerLayoutState","isAutoVisible","shouldMountPlayer"],"mappings":"AAuBO,MAAMA,IAA+B,CAAC;AAAA,EAC3C,eAAAC;AAAA,EACA,0BAAAC;AACF,OAA2E;AAAA,EACzE,eAAeD,KAAiB;AAAA,EAChC,0BAA0BC,KAA4B;AACxD,IAEaC,IAAgC,CAAC;AAAA,EAC5C,eAAAC;AAAA,EACA,0BAAAF;AAAA,EACA,mBAAAG;AACF,OAA6E;AAAA,EAC3E,iBACEA,KACAH,MAA6B,aAC5BA,MAA6B,aAAaE;AAAA,EAC7C,gBAAgBC;AAClB;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../../_virtual/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../../_virtual/index8.cjs"),v=require("./constants.cjs");var d;function x(){if(d)return c.__exports;d=1,Object.defineProperty(c.__exports,"__esModule",{value:!0}),c.__exports.sanitizeUrl=void 0;var e=v.__require();function m(r){return e.relativeFirstCharacters.indexOf(r[0])>-1}function p(r){var i=r.replace(e.ctrlCharactersRegex,"");return i.replace(e.htmlEntitiesRegex,function(t,a){return String.fromCharCode(a)})}function R(r){return URL.canParse(r)}function l(r){try{return decodeURIComponent(r)}catch{return r}}function f(r){if(!r)return e.BLANK_URL;var i,t=l(r.trim());do t=p(t).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),t=l(t),i=t.match(e.ctrlCharactersRegex)||t.match(e.htmlEntitiesRegex)||t.match(e.htmlCtrlEntityRegex)||t.match(e.whitespaceEscapeCharsRegex);while(i&&i.length>0);var a=t;if(!a)return e.BLANK_URL;if(m(a))return a;var u=a.trimStart(),h=u.match(e.urlSchemeRegex);if(!h)return a;var n=h[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(n))return e.BLANK_URL;var s=u.replace(/\\/g,"/");if(n==="mailto:"||n.includes("://"))return s;if(n==="http:"||n==="https:"){if(!R(s))return e.BLANK_URL;var o=new URL(s);return o.protocol=o.protocol.toLowerCase(),o.hostname=o.hostname.toLowerCase(),o.toString()}return s}return c.__exports.sanitizeUrl=f,c.__exports}exports.__require=x;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|