markdown-flow-ui 0.1.108-beta.2 → 0.1.108-beta.4
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.cjs4.js +1 -1
- package/dist/_virtual/index.cjs5.js +1 -1
- package/dist/_virtual/index.cjs6.js +1 -1
- package/dist/_virtual/index.cjs7.js +1 -1
- package/dist/_virtual/index.es4.js +4 -4
- package/dist/_virtual/index.es5.js +4 -4
- package/dist/_virtual/index.es6.js +2 -5
- package/dist/_virtual/index.es6.js.map +1 -1
- package/dist/_virtual/index.es7.js +5 -2
- package/dist/_virtual/index.es7.js.map +1 -1
- package/dist/assets/markdown-flow-ui.css +1 -1
- package/dist/components/Slide/MobilePlayerSettingsSheet.cjs.js +1 -1
- package/dist/components/Slide/MobilePlayerSettingsSheet.cjs.js.map +1 -1
- package/dist/components/Slide/MobilePlayerSettingsSheet.d.ts +5 -1
- package/dist/components/Slide/MobilePlayerSettingsSheet.es.js +69 -27
- package/dist/components/Slide/MobilePlayerSettingsSheet.es.js.map +1 -1
- package/dist/components/Slide/Player.cjs.js +1 -1
- package/dist/components/Slide/Player.cjs.js.map +1 -1
- package/dist/components/Slide/Player.d.ts +6 -1
- package/dist/components/Slide/Player.es.js +281 -249
- package/dist/components/Slide/Player.es.js.map +1 -1
- package/dist/components/Slide/Slide.cjs.js +1 -1
- package/dist/components/Slide/Slide.cjs.js.map +1 -1
- package/dist/components/Slide/Slide.es.js +410 -394
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/components/Slide/SubtitleOverlay.cjs.js +1 -1
- package/dist/components/Slide/SubtitleOverlay.cjs.js.map +1 -1
- package/dist/components/Slide/SubtitleOverlay.d.ts +2 -1
- package/dist/components/Slide/SubtitleOverlay.es.js +33 -32
- package/dist/components/Slide/SubtitleOverlay.es.js.map +1 -1
- package/dist/components/Slide/constants.cjs.js +1 -1
- package/dist/components/Slide/constants.cjs.js.map +1 -1
- package/dist/components/Slide/constants.d.ts +2 -0
- package/dist/components/Slide/constants.es.js +4 -2
- package/dist/components/Slide/constants.es.js.map +1 -1
- package/dist/components/ui/inputGroup/textarea.cjs.js +1 -1
- package/dist/components/ui/inputGroup/textarea.es.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/hast-util-to-jsx-runtime@2.3.6/node_modules/hast-util-to-jsx-runtime/lib/index.cjs.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/hast-util-to-jsx-runtime@2.3.6/node_modules/hast-util-to-jsx-runtime/lib/index.es.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions-off.cjs.js +7 -0
- package/dist/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions-off.cjs.js.map +1 -0
- package/dist/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions-off.es.js +20 -0
- package/dist/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions-off.es.js.map +1 -0
- package/dist/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions.cjs.js +7 -0
- package/dist/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions.cjs.js.map +1 -0
- package/dist/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions.es.js +16 -0
- package/dist/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions.es.js.map +1 -0
- package/dist/markdown-flow-ui/node_modules/.pnpm/rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.cjs.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.es.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/ResizableTextArea.cjs.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/ResizableTextArea.es.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/TextArea.cjs.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/TextArea.es.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/index.cjs.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/index.es.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.cjs.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.es.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.cjs.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.es.js +1 -1
- package/dist/markdown-flow-ui-lib.css +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../_virtual/jsx-runtime.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../_virtual/jsx-runtime.cjs.js"),u=require("../../markdown-flow-ui/node_modules/.pnpm/@radix-ui_react-dialog@1.1.15_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react_47bb8d90b09b6a0ef5443ddd7a1cb20c/node_modules/@radix-ui/react-dialog/dist/index.cjs.js"),r=require("../../lib/utils.cjs.js"),s=require("../ui/dialog.cjs.js"),m=require("../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/x.cjs.js"),p=({open:a,labels:t,isSubtitleEnabled:o,viewMode:n,container:l,onClose:x,onOpenChange:d,onSubtitleToggle:c,onViewModeChange:i})=>e.jsxRuntimeExports.jsx(s.Dialog,{open:a,onOpenChange:d,children:e.jsxRuntimeExports.jsxs(s.DialogPortal,{container:l,children:[e.jsxRuntimeExports.jsx(s.DialogOverlay,{className:"z-[60] bg-black/35"}),e.jsxRuntimeExports.jsxs(u.Content,{"aria-describedby":void 0,className:r.cn("fixed inset-x-0 bottom-0 z-[61] flex max-h-[min(360px,calc(100dvh-32px))] flex-col overflow-hidden rounded-t-[24px] border-t border-border bg-background shadow-[0_-12px_32px_rgba(28,44,64,0.16)] outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=open]:slide-in-from-bottom-full data-[state=closed]:slide-out-to-bottom-full"),children:[e.jsxRuntimeExports.jsxs("div",{className:"flex min-h-14 items-center justify-between border-b border-border px-4",children:[e.jsxRuntimeExports.jsx(s.DialogTitle,{className:"text-[15px] font-semibold leading-5 text-foreground",children:t.title}),e.jsxRuntimeExports.jsx("button",{"aria-label":"Close settings",className:"inline-flex h-8 w-8 items-center justify-center rounded-full border-none bg-transparent p-0 text-foreground/70 transition-colors hover:text-foreground",onClick:x,type:"button",children:e.jsxRuntimeExports.jsx(m.default,{className:"h-4 w-4"})})]}),e.jsxRuntimeExports.jsxs("div",{className:r.cn("relative flex min-h-[72px] items-center justify-between gap-6 px-4","after:pointer-events-none after:absolute after:bottom-0 after:left-4 after:right-4 after:border-b after:border-border after:content-['']"),children:[e.jsxRuntimeExports.jsx("span",{className:"shrink-0 text-[15px] font-semibold leading-5 text-foreground",children:t.subtitle}),e.jsxRuntimeExports.jsx("button",{"aria-label":t.subtitleToggle,"aria-pressed":o,className:"inline-flex h-6 w-6 shrink-0 items-center justify-center p-0",onClick:c,type:"button",children:e.jsxRuntimeExports.jsx("span",{className:r.cn("relative block h-4 w-6 rounded-full border-2 border-foreground transition-colors",o&&"border-primary"),children:e.jsxRuntimeExports.jsx("span",{className:r.cn("absolute left-[2px] top-1/2 block h-1.5 w-1.5 -translate-y-1/2 rounded-full bg-foreground transition-transform",o?"translate-x-[10px] bg-primary":"translate-x-0")})})})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex min-h-[72px] items-center gap-6 px-4",children:[e.jsxRuntimeExports.jsx("span",{className:"shrink-0 text-[15px] font-semibold leading-5 text-foreground",children:t.screen}),e.jsxRuntimeExports.jsxs("div",{"aria-label":"Screen mode",className:"flex items-center gap-8",role:"radiogroup",children:[e.jsxRuntimeExports.jsx("button",{"aria-checked":n==="nonFullscreen",className:r.cn("border-none bg-transparent p-0 text-[15px] leading-5 text-foreground/70 transition-colors",n==="nonFullscreen"&&"font-semibold text-primary"),onClick:()=>i("nonFullscreen"),role:"radio",type:"button",children:t.nonFullscreen}),e.jsxRuntimeExports.jsx("button",{"aria-checked":n==="fullscreen",className:r.cn("border-none bg-transparent p-0 text-[15px] leading-5 text-foreground/70 transition-colors",n==="fullscreen"&&"font-semibold text-primary"),onClick:()=>i("fullscreen"),role:"radio",type:"button",children:t.fullscreen})]})]})]})]})});exports.default=p;
|
|
2
2
|
//# sourceMappingURL=MobilePlayerSettingsSheet.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobilePlayerSettingsSheet.cjs.js","sources":["../../../src/components/Slide/MobilePlayerSettingsSheet.tsx"],"sourcesContent":["import * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Dialog, DialogOverlay, DialogPortal, DialogTitle } from \"../ui/dialog\";\nimport type { MobileViewMode } from \"./utils/mobileScreenMode\";\n\nexport type MobilePlayerSettingsSheetLabels = {\n title: string;\n screen: string;\n nonFullscreen: string;\n fullscreen: string;\n};\n\nexport type MobilePlayerSettingsSheetProps = {\n open: boolean;\n labels: MobilePlayerSettingsSheetLabels;\n viewMode: MobileViewMode;\n container?: HTMLElement | null;\n onClose: () => void;\n onOpenChange: (open: boolean) => void;\n onViewModeChange: (nextViewMode: MobileViewMode) => void;\n};\n\nconst MobilePlayerSettingsSheet = ({\n open,\n labels,\n viewMode,\n container,\n onClose,\n onOpenChange,\n onViewModeChange,\n}: MobilePlayerSettingsSheetProps) => {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogPortal container={container}>\n <DialogOverlay className=\"z-[60] bg-black/35\" />\n <DialogPrimitive.Content\n aria-describedby={undefined}\n className={cn(\n \"fixed inset-x-0 bottom-0 z-[61] flex max-h-[min(360px,calc(100dvh-32px))] flex-col overflow-hidden rounded-t-[24px] border-t border-border bg-background shadow-[0_-12px_32px_rgba(28,44,64,0.16)] outline-none\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out\",\n \"data-[state=open]:slide-in-from-bottom-full data-[state=closed]:slide-out-to-bottom-full\"\n )}\n >\n <div className=\"flex min-h-14 items-center justify-between border-b border-border px-
|
|
1
|
+
{"version":3,"file":"MobilePlayerSettingsSheet.cjs.js","sources":["../../../src/components/Slide/MobilePlayerSettingsSheet.tsx"],"sourcesContent":["import * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Dialog, DialogOverlay, DialogPortal, DialogTitle } from \"../ui/dialog\";\nimport type { MobileViewMode } from \"./utils/mobileScreenMode\";\n\nexport type MobilePlayerSettingsSheetLabels = {\n title: string;\n subtitle: string;\n subtitleToggle: string;\n screen: string;\n nonFullscreen: string;\n fullscreen: string;\n};\n\nexport type MobilePlayerSettingsSheetProps = {\n open: boolean;\n labels: MobilePlayerSettingsSheetLabels;\n isSubtitleEnabled: boolean;\n viewMode: MobileViewMode;\n container?: HTMLElement | null;\n onClose: () => void;\n onOpenChange: (open: boolean) => void;\n onSubtitleToggle: () => void;\n onViewModeChange: (nextViewMode: MobileViewMode) => void;\n};\n\nconst MobilePlayerSettingsSheet = ({\n open,\n labels,\n isSubtitleEnabled,\n viewMode,\n container,\n onClose,\n onOpenChange,\n onSubtitleToggle,\n onViewModeChange,\n}: MobilePlayerSettingsSheetProps) => {\n const insetDividerClassName =\n \"after:pointer-events-none after:absolute after:bottom-0 after:left-4 after:right-4 after:border-b after:border-border after:content-['']\";\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogPortal container={container}>\n <DialogOverlay className=\"z-[60] bg-black/35\" />\n <DialogPrimitive.Content\n aria-describedby={undefined}\n className={cn(\n \"fixed inset-x-0 bottom-0 z-[61] flex max-h-[min(360px,calc(100dvh-32px))] flex-col overflow-hidden rounded-t-[24px] border-t border-border bg-background shadow-[0_-12px_32px_rgba(28,44,64,0.16)] outline-none\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out\",\n \"data-[state=open]:slide-in-from-bottom-full data-[state=closed]:slide-out-to-bottom-full\"\n )}\n >\n <div className=\"flex min-h-14 items-center justify-between border-b border-border px-4\">\n <DialogTitle className=\"text-[15px] font-semibold leading-5 text-foreground\">\n {labels.title}\n </DialogTitle>\n <button\n aria-label=\"Close settings\"\n className=\"inline-flex h-8 w-8 items-center justify-center rounded-full border-none bg-transparent p-0 text-foreground/70 transition-colors hover:text-foreground\"\n onClick={onClose}\n type=\"button\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n\n <div\n className={cn(\n \"relative flex min-h-[72px] items-center justify-between gap-6 px-4\",\n insetDividerClassName\n )}\n >\n <span className=\"shrink-0 text-[15px] font-semibold leading-5 text-foreground\">\n {labels.subtitle}\n </span>\n\n <button\n aria-label={labels.subtitleToggle}\n aria-pressed={isSubtitleEnabled}\n className=\"inline-flex h-6 w-6 shrink-0 items-center justify-center p-0\"\n onClick={onSubtitleToggle}\n type=\"button\"\n >\n <span\n className={cn(\n \"relative block h-4 w-6 rounded-full border-2 border-foreground transition-colors\",\n isSubtitleEnabled && \"border-primary\"\n )}\n >\n <span\n className={cn(\n \"absolute left-[2px] top-1/2 block h-1.5 w-1.5 -translate-y-1/2 rounded-full bg-foreground transition-transform\",\n isSubtitleEnabled\n ? \"translate-x-[10px] bg-primary\"\n : \"translate-x-0\"\n )}\n />\n </span>\n </button>\n </div>\n\n <div className=\"flex min-h-[72px] items-center gap-6 px-4\">\n <span className=\"shrink-0 text-[15px] font-semibold leading-5 text-foreground\">\n {labels.screen}\n </span>\n <div\n aria-label=\"Screen mode\"\n className=\"flex items-center gap-8\"\n role=\"radiogroup\"\n >\n <button\n aria-checked={viewMode === \"nonFullscreen\"}\n className={cn(\n \"border-none bg-transparent p-0 text-[15px] leading-5 text-foreground/70 transition-colors\",\n viewMode === \"nonFullscreen\" && \"font-semibold text-primary\"\n )}\n onClick={() => onViewModeChange(\"nonFullscreen\")}\n role=\"radio\"\n type=\"button\"\n >\n {labels.nonFullscreen}\n </button>\n <button\n aria-checked={viewMode === \"fullscreen\"}\n className={cn(\n \"border-none bg-transparent p-0 text-[15px] leading-5 text-foreground/70 transition-colors\",\n viewMode === \"fullscreen\" && \"font-semibold text-primary\"\n )}\n onClick={() => onViewModeChange(\"fullscreen\")}\n role=\"radio\"\n type=\"button\"\n >\n {labels.fullscreen}\n </button>\n </div>\n </div>\n </DialogPrimitive.Content>\n </DialogPortal>\n </Dialog>\n );\n};\n\nexport default MobilePlayerSettingsSheet;\n"],"names":["MobilePlayerSettingsSheet","open","labels","isSubtitleEnabled","viewMode","container","onClose","onOpenChange","onSubtitleToggle","onViewModeChange","Dialog","jsxs","DialogPortal","jsx","DialogOverlay","DialogPrimitive.Content","cn","DialogTitle","X"],"mappings":"ulBA4BMA,EAA4B,CAAC,CACjC,KAAAC,EACA,OAAAC,EACA,kBAAAC,EACA,SAAAC,EACA,UAAAC,EACA,QAAAC,EACA,aAAAC,EACA,iBAAAC,EACA,iBAAAC,CACF,4BAKKC,EAAAA,OAAA,CAAO,KAAAT,EAAY,aAAAM,EAClB,SAAAI,EAAAA,kBAAAA,KAACC,EAAAA,cAAa,UAAAP,EACZ,SAAA,CAAAQ,EAAAA,kBAAAA,IAACC,EAAAA,cAAA,CAAc,UAAU,oBAAA,CAAqB,EAC9CH,EAAAA,kBAAAA,KAACI,EAAAA,QAAA,CACC,mBAAkB,OAClB,UAAWC,EAAAA,GACT,kNACA,+DACA,0FAAA,EAGF,SAAA,CAAAL,EAAAA,kBAAAA,KAAC,MAAA,CAAI,UAAU,yEACb,SAAA,CAAAE,EAAAA,kBAAAA,IAACI,EAAAA,YAAA,CAAY,UAAU,sDACpB,SAAAf,EAAO,MACV,EACAW,EAAAA,kBAAAA,IAAC,SAAA,CACC,aAAW,iBACX,UAAU,yJACV,QAASP,EACT,KAAK,SAEL,SAAAO,EAAAA,kBAAAA,IAACK,EAAAA,QAAA,CAAE,UAAU,SAAA,CAAU,CAAA,CAAA,CACzB,EACF,EAEAP,EAAAA,kBAAAA,KAAC,MAAA,CACC,UAAWK,EAAAA,GACT,qEA9BV,0IA+BU,EAGF,SAAA,CAAAH,EAAAA,kBAAAA,IAAC,OAAA,CAAK,UAAU,+DACb,SAAAX,EAAO,SACV,EAEAW,EAAAA,kBAAAA,IAAC,SAAA,CACC,aAAYX,EAAO,eACnB,eAAcC,EACd,UAAU,+DACV,QAASK,EACT,KAAK,SAEL,SAAAK,EAAAA,kBAAAA,IAAC,OAAA,CACC,UAAWG,EAAAA,GACT,mFACAb,GAAqB,gBAAA,EAGvB,SAAAU,EAAAA,kBAAAA,IAAC,OAAA,CACC,UAAWG,EAAAA,GACT,iHACAb,EACI,gCACA,eAAA,CACN,CAAA,CACF,CAAA,CACF,CAAA,CACF,CAAA,CAAA,EAGFQ,EAAAA,kBAAAA,KAAC,MAAA,CAAI,UAAU,4CACb,SAAA,CAAAE,EAAAA,kBAAAA,IAAC,OAAA,CAAK,UAAU,+DACb,SAAAX,EAAO,OACV,EACAS,EAAAA,kBAAAA,KAAC,MAAA,CACC,aAAW,cACX,UAAU,0BACV,KAAK,aAEL,SAAA,CAAAE,EAAAA,kBAAAA,IAAC,SAAA,CACC,eAAcT,IAAa,gBAC3B,UAAWY,EAAAA,GACT,4FACAZ,IAAa,iBAAmB,4BAAA,EAElC,QAAS,IAAMK,EAAiB,eAAe,EAC/C,KAAK,QACL,KAAK,SAEJ,SAAAP,EAAO,aAAA,CAAA,EAEVW,EAAAA,kBAAAA,IAAC,SAAA,CACC,eAAcT,IAAa,aAC3B,UAAWY,EAAAA,GACT,4FACAZ,IAAa,cAAgB,4BAAA,EAE/B,QAAS,IAAMK,EAAiB,YAAY,EAC5C,KAAK,QACL,KAAK,SAEJ,SAAAP,EAAO,UAAA,CAAA,CACV,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CACF"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { MobileViewMode } from './utils/mobileScreenMode';
|
|
2
2
|
export type MobilePlayerSettingsSheetLabels = {
|
|
3
3
|
title: string;
|
|
4
|
+
subtitle: string;
|
|
5
|
+
subtitleToggle: string;
|
|
4
6
|
screen: string;
|
|
5
7
|
nonFullscreen: string;
|
|
6
8
|
fullscreen: string;
|
|
@@ -8,11 +10,13 @@ export type MobilePlayerSettingsSheetLabels = {
|
|
|
8
10
|
export type MobilePlayerSettingsSheetProps = {
|
|
9
11
|
open: boolean;
|
|
10
12
|
labels: MobilePlayerSettingsSheetLabels;
|
|
13
|
+
isSubtitleEnabled: boolean;
|
|
11
14
|
viewMode: MobileViewMode;
|
|
12
15
|
container?: HTMLElement | null;
|
|
13
16
|
onClose: () => void;
|
|
14
17
|
onOpenChange: (open: boolean) => void;
|
|
18
|
+
onSubtitleToggle: () => void;
|
|
15
19
|
onViewModeChange: (nextViewMode: MobileViewMode) => void;
|
|
16
20
|
};
|
|
17
|
-
declare const MobilePlayerSettingsSheet: ({ open, labels, viewMode, container, onClose, onOpenChange, onViewModeChange, }: MobilePlayerSettingsSheetProps) => import("react").JSX.Element;
|
|
21
|
+
declare const MobilePlayerSettingsSheet: ({ open, labels, isSubtitleEnabled, viewMode, container, onClose, onOpenChange, onSubtitleToggle, onViewModeChange, }: MobilePlayerSettingsSheetProps) => import("react").JSX.Element;
|
|
18
22
|
export default MobilePlayerSettingsSheet;
|
|
@@ -1,42 +1,84 @@
|
|
|
1
1
|
import { j as e } from "../../_virtual/jsx-runtime.es.js";
|
|
2
|
-
import { Content as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Dialog as
|
|
2
|
+
import { Content as x } from "../../markdown-flow-ui/node_modules/.pnpm/@radix-ui_react-dialog@1.1.15_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react_47bb8d90b09b6a0ef5443ddd7a1cb20c/node_modules/@radix-ui/react-dialog/dist/index.es.js";
|
|
3
|
+
import { cn as r } from "../../lib/utils.es.js";
|
|
4
|
+
import { Dialog as m, DialogPortal as f, DialogOverlay as p, DialogTitle as b } from "../ui/dialog.es.js";
|
|
5
5
|
import u from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/x.es.js";
|
|
6
|
-
const
|
|
7
|
-
open:
|
|
6
|
+
const v = ({
|
|
7
|
+
open: a,
|
|
8
8
|
labels: t,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
isSubtitleEnabled: o,
|
|
10
|
+
viewMode: n,
|
|
11
|
+
container: l,
|
|
12
|
+
onClose: i,
|
|
13
|
+
onOpenChange: d,
|
|
14
|
+
onSubtitleToggle: c,
|
|
15
|
+
onViewModeChange: s
|
|
16
|
+
}) => /* @__PURE__ */ e.jsx(m, { open: a, onOpenChange: d, children: /* @__PURE__ */ e.jsxs(f, { container: l, children: [
|
|
17
|
+
/* @__PURE__ */ e.jsx(p, { className: "z-[60] bg-black/35" }),
|
|
16
18
|
/* @__PURE__ */ e.jsxs(
|
|
17
|
-
|
|
19
|
+
x,
|
|
18
20
|
{
|
|
19
21
|
"aria-describedby": void 0,
|
|
20
|
-
className:
|
|
22
|
+
className: r(
|
|
21
23
|
"fixed inset-x-0 bottom-0 z-[61] flex max-h-[min(360px,calc(100dvh-32px))] flex-col overflow-hidden rounded-t-[24px] border-t border-border bg-background shadow-[0_-12px_32px_rgba(28,44,64,0.16)] outline-none",
|
|
22
24
|
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
23
25
|
"data-[state=open]:slide-in-from-bottom-full data-[state=closed]:slide-out-to-bottom-full"
|
|
24
26
|
),
|
|
25
27
|
children: [
|
|
26
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex min-h-14 items-center justify-between border-b border-border px-
|
|
27
|
-
/* @__PURE__ */ e.jsx(
|
|
28
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex min-h-14 items-center justify-between border-b border-border px-4", children: [
|
|
29
|
+
/* @__PURE__ */ e.jsx(b, { className: "text-[15px] font-semibold leading-5 text-foreground", children: t.title }),
|
|
28
30
|
/* @__PURE__ */ e.jsx(
|
|
29
31
|
"button",
|
|
30
32
|
{
|
|
31
33
|
"aria-label": "Close settings",
|
|
32
34
|
className: "inline-flex h-8 w-8 items-center justify-center rounded-full border-none bg-transparent p-0 text-foreground/70 transition-colors hover:text-foreground",
|
|
33
|
-
onClick:
|
|
35
|
+
onClick: i,
|
|
34
36
|
type: "button",
|
|
35
37
|
children: /* @__PURE__ */ e.jsx(u, { className: "h-4 w-4" })
|
|
36
38
|
}
|
|
37
39
|
)
|
|
38
40
|
] }),
|
|
39
|
-
/* @__PURE__ */ e.jsxs(
|
|
41
|
+
/* @__PURE__ */ e.jsxs(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: r(
|
|
45
|
+
"relative flex min-h-[72px] items-center justify-between gap-6 px-4",
|
|
46
|
+
"after:pointer-events-none after:absolute after:bottom-0 after:left-4 after:right-4 after:border-b after:border-border after:content-['']"
|
|
47
|
+
),
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ e.jsx("span", { className: "shrink-0 text-[15px] font-semibold leading-5 text-foreground", children: t.subtitle }),
|
|
50
|
+
/* @__PURE__ */ e.jsx(
|
|
51
|
+
"button",
|
|
52
|
+
{
|
|
53
|
+
"aria-label": t.subtitleToggle,
|
|
54
|
+
"aria-pressed": o,
|
|
55
|
+
className: "inline-flex h-6 w-6 shrink-0 items-center justify-center p-0",
|
|
56
|
+
onClick: c,
|
|
57
|
+
type: "button",
|
|
58
|
+
children: /* @__PURE__ */ e.jsx(
|
|
59
|
+
"span",
|
|
60
|
+
{
|
|
61
|
+
className: r(
|
|
62
|
+
"relative block h-4 w-6 rounded-full border-2 border-foreground transition-colors",
|
|
63
|
+
o && "border-primary"
|
|
64
|
+
),
|
|
65
|
+
children: /* @__PURE__ */ e.jsx(
|
|
66
|
+
"span",
|
|
67
|
+
{
|
|
68
|
+
className: r(
|
|
69
|
+
"absolute left-[2px] top-1/2 block h-1.5 w-1.5 -translate-y-1/2 rounded-full bg-foreground transition-transform",
|
|
70
|
+
o ? "translate-x-[10px] bg-primary" : "translate-x-0"
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex min-h-[72px] items-center gap-6 px-4", children: [
|
|
40
82
|
/* @__PURE__ */ e.jsx("span", { className: "shrink-0 text-[15px] font-semibold leading-5 text-foreground", children: t.screen }),
|
|
41
83
|
/* @__PURE__ */ e.jsxs(
|
|
42
84
|
"div",
|
|
@@ -48,12 +90,12 @@ const N = ({
|
|
|
48
90
|
/* @__PURE__ */ e.jsx(
|
|
49
91
|
"button",
|
|
50
92
|
{
|
|
51
|
-
"aria-checked":
|
|
52
|
-
className:
|
|
93
|
+
"aria-checked": n === "nonFullscreen",
|
|
94
|
+
className: r(
|
|
53
95
|
"border-none bg-transparent p-0 text-[15px] leading-5 text-foreground/70 transition-colors",
|
|
54
|
-
|
|
96
|
+
n === "nonFullscreen" && "font-semibold text-primary"
|
|
55
97
|
),
|
|
56
|
-
onClick: () =>
|
|
98
|
+
onClick: () => s("nonFullscreen"),
|
|
57
99
|
role: "radio",
|
|
58
100
|
type: "button",
|
|
59
101
|
children: t.nonFullscreen
|
|
@@ -62,12 +104,12 @@ const N = ({
|
|
|
62
104
|
/* @__PURE__ */ e.jsx(
|
|
63
105
|
"button",
|
|
64
106
|
{
|
|
65
|
-
"aria-checked":
|
|
66
|
-
className:
|
|
107
|
+
"aria-checked": n === "fullscreen",
|
|
108
|
+
className: r(
|
|
67
109
|
"border-none bg-transparent p-0 text-[15px] leading-5 text-foreground/70 transition-colors",
|
|
68
|
-
|
|
110
|
+
n === "fullscreen" && "font-semibold text-primary"
|
|
69
111
|
),
|
|
70
|
-
onClick: () =>
|
|
112
|
+
onClick: () => s("fullscreen"),
|
|
71
113
|
role: "radio",
|
|
72
114
|
type: "button",
|
|
73
115
|
children: t.fullscreen
|
|
@@ -82,6 +124,6 @@ const N = ({
|
|
|
82
124
|
)
|
|
83
125
|
] }) });
|
|
84
126
|
export {
|
|
85
|
-
|
|
127
|
+
v as default
|
|
86
128
|
};
|
|
87
129
|
//# sourceMappingURL=MobilePlayerSettingsSheet.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobilePlayerSettingsSheet.es.js","sources":["../../../src/components/Slide/MobilePlayerSettingsSheet.tsx"],"sourcesContent":["import * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Dialog, DialogOverlay, DialogPortal, DialogTitle } from \"../ui/dialog\";\nimport type { MobileViewMode } from \"./utils/mobileScreenMode\";\n\nexport type MobilePlayerSettingsSheetLabels = {\n title: string;\n screen: string;\n nonFullscreen: string;\n fullscreen: string;\n};\n\nexport type MobilePlayerSettingsSheetProps = {\n open: boolean;\n labels: MobilePlayerSettingsSheetLabels;\n viewMode: MobileViewMode;\n container?: HTMLElement | null;\n onClose: () => void;\n onOpenChange: (open: boolean) => void;\n onViewModeChange: (nextViewMode: MobileViewMode) => void;\n};\n\nconst MobilePlayerSettingsSheet = ({\n open,\n labels,\n viewMode,\n container,\n onClose,\n onOpenChange,\n onViewModeChange,\n}: MobilePlayerSettingsSheetProps) => {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogPortal container={container}>\n <DialogOverlay className=\"z-[60] bg-black/35\" />\n <DialogPrimitive.Content\n aria-describedby={undefined}\n className={cn(\n \"fixed inset-x-0 bottom-0 z-[61] flex max-h-[min(360px,calc(100dvh-32px))] flex-col overflow-hidden rounded-t-[24px] border-t border-border bg-background shadow-[0_-12px_32px_rgba(28,44,64,0.16)] outline-none\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out\",\n \"data-[state=open]:slide-in-from-bottom-full data-[state=closed]:slide-out-to-bottom-full\"\n )}\n >\n <div className=\"flex min-h-14 items-center justify-between border-b border-border px-
|
|
1
|
+
{"version":3,"file":"MobilePlayerSettingsSheet.es.js","sources":["../../../src/components/Slide/MobilePlayerSettingsSheet.tsx"],"sourcesContent":["import * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Dialog, DialogOverlay, DialogPortal, DialogTitle } from \"../ui/dialog\";\nimport type { MobileViewMode } from \"./utils/mobileScreenMode\";\n\nexport type MobilePlayerSettingsSheetLabels = {\n title: string;\n subtitle: string;\n subtitleToggle: string;\n screen: string;\n nonFullscreen: string;\n fullscreen: string;\n};\n\nexport type MobilePlayerSettingsSheetProps = {\n open: boolean;\n labels: MobilePlayerSettingsSheetLabels;\n isSubtitleEnabled: boolean;\n viewMode: MobileViewMode;\n container?: HTMLElement | null;\n onClose: () => void;\n onOpenChange: (open: boolean) => void;\n onSubtitleToggle: () => void;\n onViewModeChange: (nextViewMode: MobileViewMode) => void;\n};\n\nconst MobilePlayerSettingsSheet = ({\n open,\n labels,\n isSubtitleEnabled,\n viewMode,\n container,\n onClose,\n onOpenChange,\n onSubtitleToggle,\n onViewModeChange,\n}: MobilePlayerSettingsSheetProps) => {\n const insetDividerClassName =\n \"after:pointer-events-none after:absolute after:bottom-0 after:left-4 after:right-4 after:border-b after:border-border after:content-['']\";\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogPortal container={container}>\n <DialogOverlay className=\"z-[60] bg-black/35\" />\n <DialogPrimitive.Content\n aria-describedby={undefined}\n className={cn(\n \"fixed inset-x-0 bottom-0 z-[61] flex max-h-[min(360px,calc(100dvh-32px))] flex-col overflow-hidden rounded-t-[24px] border-t border-border bg-background shadow-[0_-12px_32px_rgba(28,44,64,0.16)] outline-none\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out\",\n \"data-[state=open]:slide-in-from-bottom-full data-[state=closed]:slide-out-to-bottom-full\"\n )}\n >\n <div className=\"flex min-h-14 items-center justify-between border-b border-border px-4\">\n <DialogTitle className=\"text-[15px] font-semibold leading-5 text-foreground\">\n {labels.title}\n </DialogTitle>\n <button\n aria-label=\"Close settings\"\n className=\"inline-flex h-8 w-8 items-center justify-center rounded-full border-none bg-transparent p-0 text-foreground/70 transition-colors hover:text-foreground\"\n onClick={onClose}\n type=\"button\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n\n <div\n className={cn(\n \"relative flex min-h-[72px] items-center justify-between gap-6 px-4\",\n insetDividerClassName\n )}\n >\n <span className=\"shrink-0 text-[15px] font-semibold leading-5 text-foreground\">\n {labels.subtitle}\n </span>\n\n <button\n aria-label={labels.subtitleToggle}\n aria-pressed={isSubtitleEnabled}\n className=\"inline-flex h-6 w-6 shrink-0 items-center justify-center p-0\"\n onClick={onSubtitleToggle}\n type=\"button\"\n >\n <span\n className={cn(\n \"relative block h-4 w-6 rounded-full border-2 border-foreground transition-colors\",\n isSubtitleEnabled && \"border-primary\"\n )}\n >\n <span\n className={cn(\n \"absolute left-[2px] top-1/2 block h-1.5 w-1.5 -translate-y-1/2 rounded-full bg-foreground transition-transform\",\n isSubtitleEnabled\n ? \"translate-x-[10px] bg-primary\"\n : \"translate-x-0\"\n )}\n />\n </span>\n </button>\n </div>\n\n <div className=\"flex min-h-[72px] items-center gap-6 px-4\">\n <span className=\"shrink-0 text-[15px] font-semibold leading-5 text-foreground\">\n {labels.screen}\n </span>\n <div\n aria-label=\"Screen mode\"\n className=\"flex items-center gap-8\"\n role=\"radiogroup\"\n >\n <button\n aria-checked={viewMode === \"nonFullscreen\"}\n className={cn(\n \"border-none bg-transparent p-0 text-[15px] leading-5 text-foreground/70 transition-colors\",\n viewMode === \"nonFullscreen\" && \"font-semibold text-primary\"\n )}\n onClick={() => onViewModeChange(\"nonFullscreen\")}\n role=\"radio\"\n type=\"button\"\n >\n {labels.nonFullscreen}\n </button>\n <button\n aria-checked={viewMode === \"fullscreen\"}\n className={cn(\n \"border-none bg-transparent p-0 text-[15px] leading-5 text-foreground/70 transition-colors\",\n viewMode === \"fullscreen\" && \"font-semibold text-primary\"\n )}\n onClick={() => onViewModeChange(\"fullscreen\")}\n role=\"radio\"\n type=\"button\"\n >\n {labels.fullscreen}\n </button>\n </div>\n </div>\n </DialogPrimitive.Content>\n </DialogPortal>\n </Dialog>\n );\n};\n\nexport default MobilePlayerSettingsSheet;\n"],"names":["MobilePlayerSettingsSheet","open","labels","isSubtitleEnabled","viewMode","container","onClose","onOpenChange","onSubtitleToggle","onViewModeChange","Dialog","jsxs","DialogPortal","jsx","DialogOverlay","DialogPrimitive.Content","cn","DialogTitle","X"],"mappings":";;;;;AA4BA,MAAMA,IAA4B,CAAC;AAAA,EACjC,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,cAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AACF,4BAKKC,GAAA,EAAO,MAAAT,GAAY,cAAAM,GAClB,UAAAI,gBAAAA,EAAAA,KAACC,KAAa,WAAAP,GACZ,UAAA;AAAA,EAAAQ,gBAAAA,EAAAA,IAACC,GAAA,EAAc,WAAU,qBAAA,CAAqB;AAAA,EAC9CH,gBAAAA,EAAAA;AAAAA,IAACI;AAAAA,IAAA;AAAA,MACC,oBAAkB;AAAA,MAClB,WAAWC;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAGF,UAAA;AAAA,QAAAL,gBAAAA,EAAAA,KAAC,OAAA,EAAI,WAAU,0EACb,UAAA;AAAA,UAAAE,gBAAAA,EAAAA,IAACI,GAAA,EAAY,WAAU,uDACpB,UAAAf,EAAO,OACV;AAAA,UACAW,gBAAAA,EAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,cAAW;AAAA,cACX,WAAU;AAAA,cACV,SAASP;AAAA,cACT,MAAK;AAAA,cAEL,UAAAO,gBAAAA,EAAAA,IAACK,GAAA,EAAE,WAAU,UAAA,CAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACzB,GACF;AAAA,QAEAP,gBAAAA,EAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWK;AAAA,cACT;AAAA,cA9BV;AAAA,YA+BU;AAAA,YAGF,UAAA;AAAA,cAAAH,gBAAAA,EAAAA,IAAC,QAAA,EAAK,WAAU,gEACb,UAAAX,EAAO,UACV;AAAA,cAEAW,gBAAAA,EAAAA;AAAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,cAAYX,EAAO;AAAA,kBACnB,gBAAcC;AAAA,kBACd,WAAU;AAAA,kBACV,SAASK;AAAA,kBACT,MAAK;AAAA,kBAEL,UAAAK,gBAAAA,EAAAA;AAAAA,oBAAC;AAAA,oBAAA;AAAA,sBACC,WAAWG;AAAA,wBACT;AAAA,wBACAb,KAAqB;AAAA,sBAAA;AAAA,sBAGvB,UAAAU,gBAAAA,EAAAA;AAAAA,wBAAC;AAAA,wBAAA;AAAA,0BACC,WAAWG;AAAA,4BACT;AAAA,4BACAb,IACI,kCACA;AAAA,0BAAA;AAAA,wBACN;AAAA,sBAAA;AAAA,oBACF;AAAA,kBAAA;AAAA,gBACF;AAAA,cAAA;AAAA,YACF;AAAA,UAAA;AAAA,QAAA;AAAA,QAGFQ,gBAAAA,EAAAA,KAAC,OAAA,EAAI,WAAU,6CACb,UAAA;AAAA,UAAAE,gBAAAA,EAAAA,IAAC,QAAA,EAAK,WAAU,gEACb,UAAAX,EAAO,QACV;AAAA,UACAS,gBAAAA,EAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,cAAW;AAAA,cACX,WAAU;AAAA,cACV,MAAK;AAAA,cAEL,UAAA;AAAA,gBAAAE,gBAAAA,EAAAA;AAAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,gBAAcT,MAAa;AAAA,oBAC3B,WAAWY;AAAA,sBACT;AAAA,sBACAZ,MAAa,mBAAmB;AAAA,oBAAA;AAAA,oBAElC,SAAS,MAAMK,EAAiB,eAAe;AAAA,oBAC/C,MAAK;AAAA,oBACL,MAAK;AAAA,oBAEJ,UAAAP,EAAO;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAEVW,gBAAAA,EAAAA;AAAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,gBAAcT,MAAa;AAAA,oBAC3B,WAAWY;AAAA,sBACT;AAAA,sBACAZ,MAAa,gBAAgB;AAAA,oBAAA;AAAA,oBAE/B,SAAS,MAAMK,EAAiB,YAAY;AAAA,oBAC5C,MAAK;AAAA,oBACL,MAAK;AAAA,oBAEJ,UAAAP,EAAO;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACV;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AACF,EAAA,CACF,EAAA,CACF;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../_virtual/jsx-runtime.cjs.js"),r=require("react"),Re=require("../../lib/utils.cjs.js"),ze=require("./MobilePlayerSettingsSheet.cjs.js"),De=require("./constants.cjs.js"),Xe=require("./utils/mobileScreenMode.cjs.js"),Ye=require("./utils/playerCustomActions.cjs.js");;/* empty css */const Ge=require("../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.cjs.js"),Je=require("../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/volume-2.cjs.js"),Qe=require("../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-ccw.cjs.js"),Ie=require("../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-cw.cjs.js"),er=require("../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/scan-line.cjs.js"),rr=require("../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/maximize.cjs.js"),tr=require("../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/file-pen-line.cjs.js"),ge=new Map,Ee=w=>{if(typeof window>"u"||!w||ge.has(w))return;const N=window.document.createElement("audio");N.preload="auto",N.setAttribute("playsinline","true"),N.src=w,N.load(),ge.set(w,N)},nr=()=>t.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"34",height:"34",viewBox:"0 0 34 34",fill:"none",children:[t.jsxRuntimeExports.jsx("path",{d:"M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z",fill:"#0A0A0A"}),t.jsxRuntimeExports.jsx("path",{d:"M12 10H16V24H12V10ZM18 10H22V24H18V10Z",fill:"white"})]}),sr=()=>t.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"34",height:"34",viewBox:"0 0 34 34",fill:"none",children:[t.jsxRuntimeExports.jsx("path",{d:"M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z",fill:"#0A0A0A"}),t.jsxRuntimeExports.jsx("path",{d:"M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z",fill:"white"})]}),ur=({audioList:w=[],className:N,currentAudioIndex:d=-1,defaultPlaying:E=!0,isPlaybackPaused:v=!1,isAutoAdvanceEnabled:z=!0,useAutoAdvanceToggle:D=!1,onLoadingChange:Q,onPlaybackTimeChange:K,onPrev:_e,onNext:Se,onFullscreen:I,isFullscreen:ee=!1,mobileViewMode:ke=Xe.DEFAULT_MOBILE_VIEW_MODE,settingsPortalContainer:Ce,onMobileViewModeChange:re,onEnded:te,onAutoAdvanceToggle:we,onInteractionToggle:Me,hasInteraction:Ae=!1,isInteractionOpen:W=!1,prevDisabled:Ne=!1,nextDisabled:ve=!1,showControls:X=!0,customActions:ne,customActionContext:se,texts:ue,...Te})=>{const p=r.useRef(null),le=r.useRef(W),j=r.useRef(null),ce=r.useRef(null),b=r.useRef(0),c=r.useRef(null),O=r.useRef(void 0),_=r.useRef([]),V=r.useRef(!1),ae=r.useRef(!1),x=r.useRef(!1),T=r.useRef(null),R=r.useRef(!1),u=r.useRef(!1),m=r.useRef(null),g=r.useRef(!1),q=r.useRef(null),Y=r.useRef(0),M=r.useRef("unknown"),[G,a]=r.useState(E),[ie,U]=r.useState(!1),o=d>=0?w[d]:void 0,F=o?.audioUrl,qe=o?.element?.subtitle_cues??[],S=r.useMemo(()=>[...o?.audioSegments??[]].sort((e,n)=>e.segment_index-n.segment_index),[o?.audioSegments]),oe=r.useMemo(()=>Ye.toPlayerCustomActionList(ne,se),[se,ne]),fe=oe.length+5,Le=r.useMemo(()=>({"--slide-player-mobile-control-count":String(fe)}),[fe]),Z=r.useMemo(()=>({...De.DEFAULT_SLIDE_PLAYER_TEXTS,...ue}),[ue]),J=r.useMemo(()=>o?o.audioKey??`${String(o.sequenceNumber??"none")}:${String(o.audioUrl??"")}`:"none",[o]),Pe=D?z:G,Ue=D?z?"Pause autoplay":"Play autoplay":G?"Pause":"Play";r.useEffect(()=>{O.current=o},[o]),r.useEffect(()=>{X||U(!1)},[X]),r.useEffect(()=>{!le.current&&W&&U(!1),le.current=W},[W]),r.useEffect(()=>{_.current=S},[S]),r.useEffect(()=>{const e=o?.audioUrl,n=d>=0?w[d+1]?.audioUrl:void 0;Ee(e),Ee(n)},[w,o?.audioUrl,d]);const s=r.useCallback(e=>{ae.current!==e&&(ae.current=e,Q?.(e))},[Q]),de=r.useCallback(e=>e instanceof DOMException?e.name==="NotAllowedError"||e.name==="SecurityError":!1,[]),A=r.useCallback(()=>E&&!v&&!x.current&&M.current!=="blocked",[E,v]),me=r.useCallback(e=>e?e.startsWith("data:")?e:`data:audio/mpeg;base64,${e}`:"",[]),pe=r.useCallback(()=>{const e=c.current;return e==null||e<=0?0:_.current.slice(0,e).reduce((n,l)=>n+Math.max(Number(l.duration_ms??0),0),0)/1e3},[]),L=r.useCallback(e=>e<=0?0:_.current.slice(0,e).reduce((n,l)=>n+Math.max(Number(l.duration_ms??0),0),0),[]),xe=r.useCallback(()=>{const e=p.current;return e?T.current==="segment"?L(b.current)+Math.max(e.currentTime,0)*1e3:m.current!==null&&e.readyState===0?m.current*1e3:Math.max(e.currentTime,0)*1e3:c.current!=null?L(c.current):0},[L]),h=r.useCallback(e=>{const n=Math.max(e,0);Y.current!==n&&(Y.current=n,K?.(n))},[K]),i=r.useCallback(()=>{h(xe())},[xe,h]),f=r.useCallback(()=>{typeof window>"u"||q.current===null||(window.cancelAnimationFrame(q.current),q.current=null)},[]),he=r.useCallback(()=>{if(typeof window>"u"||q.current!==null)return;const e=()=>{i();const n=p.current;if(!n||n.paused||n.ended){q.current=null;return}q.current=window.requestAnimationFrame(e)};q.current=window.requestAnimationFrame(e)},[i]),B=r.useCallback(()=>{const e=p.current;e&&(f(),u.current=!1,x.current=!1,V.current=!1,T.current=null,m.current=null,R.current=!1,g.current=!1,e.pause(),e.removeAttribute("src"),e.load(),j.current=null,b.current=0,c.current=null,h(0),a(!1),s(!1))},[h,f,s]),y=r.useCallback(e=>{const n=p.current;if(!n)return!1;const l=n.play();return l&&typeof l.then=="function"&&l.then(()=>{M.current==="unknown"&&(M.current="auto"),u.current=!1,g.current=!1}).catch(P=>{M.current==="unknown"&&de(P)&&(M.current="blocked",u.current=!1,s(!1)),g.current=!1,a(!1)}),!0},[de,s]),k=r.useCallback((e,n)=>{const l=p.current,P=_.current[e];if(!l||!P)return!1;const C=me(P.audio_data);b.current=e,c.current=null,R.current=!1,g.current=!0,h(L(e));const H=A();u.current=H,s(!1);const He=j.current!==C;return T.current="segment",He&&(l.pause(),l.removeAttribute("src"),l.load(),j.current=C,l.src=C,l.load()),m.current=0,l.readyState>0&&(l.currentTime=0,m.current=null),H?y(`start-segment:${n}`):(u.current=!1,g.current=!1,l.pause(),a(!1),!0)},[A,me,L,h,y,s]),$=r.useCallback(e=>{f(),u.current=!1,R.current=!1,g.current=!1,i(),a(!1),s(!1),d>=0&&te?.(d)},[d,te,f,i,s]),ye=r.useCallback(()=>{const e=b.current+1,n=_.current,l=n[e],P=O.current,C=n.some(H=>H.is_final);if(l){k(e,"ended");return}if(P?.isAudioStreaming||!C){b.current=e,c.current=e,R.current=!0,u.current=E,h(L(e)),a(!1),s(!0);return}$("segments-completed")},[E,$,L,h,k,s]);r.useEffect(()=>{if(ce.current===J)return;ce.current=J,b.current=0,c.current=null,R.current=!1,x.current=!1,V.current=!1,u.current=!1,g.current=!1,T.current=null,j.current=null,f(),h(0),s(!1);const e=p.current;e&&(e.pause(),e.removeAttribute("src"),e.load(),a(!1))},[d,J,S.length,F,h,f,s]),r.useEffect(()=>{const e=p.current;if(e){if(v){V.current=!!(O.current&&!x.current&&(!e.paused||u.current||c.current!==null)),u.current=!1,s(!1),e.pause(),a(!1);return}if(!(!V.current||!O.current||x.current)){if(V.current=!1,c.current!==null){if(c.current<_.current.length){k(c.current,"external-resume");return}u.current=!0,s(!0);return}if(!j.current&&_.current.length>0){k(Math.min(b.current,_.current.length-1),"external-resume-init");return}e.paused&&(u.current=!0,y("external-resume"))}}},[v,k,y,s]),r.useEffect(()=>{const e=p.current;if(e){if(!o){B();return}if(v){u.current=!1,s(!1),e.pause(),a(!1);return}if(F){const n=j.current!==F,l=A();if(T.current==="segment"&&!!j.current&&c.current===null){if(!l){u.current=!1,e.pause(),a(!1);return}e.paused&&(u.current=!0,y("keep-segment-source"));return}if(n){const C=c.current!==null?pe():0;e.pause(),e.removeAttribute("src"),e.load(),j.current=F,T.current="url",e.src=F,e.load(),m.current=C,h(C*1e3),e.readyState>0&&(e.currentTime=C,m.current=null)}if(u.current=l,R.current=!1,g.current=!1,s(!1),!l){u.current=!1,e.pause(),a(!1);return}y(n?"sync-url-init":"sync-url");return}if(c.current!==null){if(c.current<S.length){if(x.current){a(!1),s(!1);return}k(c.current,"wait-resume");return}R.current=!0,u.current=A(),a(!1),s(A());return}if(!S.length){if(o.isAudioStreaming){c.current=b.current,R.current=!0,u.current=A(),a(!1),s(A());return}B();return}if(!j.current){k(Math.min(b.current,S.length-1),"effect-init");return}if(!E||x.current){u.current=!1,e.pause(),a(!1);return}e.paused&&(u.current=!0,y("sync-paused-retry"))}},[o,d,S,F,E,v,A,h,B,k,y,pe,s]),r.useEffect(()=>B,[B]),r.useEffect(()=>f,[f]);const Fe=r.useCallback(()=>{i(),he(),a(!0),s(!1)},[he,i,s]),We=r.useCallback(()=>{R.current||g.current||(f(),i(),a(!1))},[d,f,i]),Ve=r.useCallback(()=>{const e=p.current;e&&m.current!==null&&(e.currentTime=m.current,m.current=null),i(),!(!u.current||!E)&&y("canplay")},[d,E,i,y]),Be=r.useCallback(()=>{const e=p.current;e&&m.current!==null&&(e.currentTime=m.current,m.current=null),i()},[d,i]),Ke=r.useCallback(()=>{i()},[i]),be=r.useCallback(()=>{i()},[i]),Oe=r.useCallback(()=>{const e=T.current==="url"||_.current.length===0;if(f(),g.current=!1,e){$("url-ended");return}ye()},[$,ye,f]),Ze=r.useCallback(()=>{f(),i(),a(!1),s(!1)},[f,i,s]),$e=r.useCallback(e=>{re?.(e),U(!1)},[re]);return console.log("SubtitleOverlay",qe),r.useEffect(()=>{K?.(Y.current)},[K]),t.jsxRuntimeExports.jsxs("div",{className:Re.cn("slide-player",N),...Te,children:[t.jsxRuntimeExports.jsx("audio",{ref:p,preload:"auto",playsInline:!0,onLoadedMetadata:Be,onCanPlay:Ve,onPlay:Fe,onPause:We,onSeeking:be,onSeeked:be,onTimeUpdate:Ke,onEnded:Oe,onError:Ze}),X?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(ze.default,{container:Ce,labels:{fullscreen:Z.fullscreenLabel,nonFullscreen:Z.nonFullscreenLabel,screen:Z.screenLabel,title:Z.settingsTitle},onClose:()=>U(!1),onOpenChange:U,onViewModeChange:$e,open:ie,viewMode:ke}),t.jsxRuntimeExports.jsxs("div",{className:"slide-player__controls",style:Le,children:[t.jsxRuntimeExports.jsxs("div",{className:"slide-player__group",children:[t.jsxRuntimeExports.jsx("button",{"aria-expanded":ie,"aria-haspopup":"dialog","aria-label":"More options",className:"slide-player__action slide-player__action--mobile-more",onClick:()=>{U(e=>!e)},type:"button",children:t.jsxRuntimeExports.jsx(Ge.default,{className:"slide-player__icon",strokeWidth:2.25})}),t.jsxRuntimeExports.jsx("button",{"aria-label":"Volume",className:"hidden",type:"button",children:t.jsxRuntimeExports.jsx(Je.default,{className:"slide-player__icon",strokeWidth:2.25})}),t.jsxRuntimeExports.jsx("button",{"aria-label":"Rewind",className:"slide-player__action slide-player__action--prev",disabled:Ne,onClick:_e,type:"button",children:t.jsxRuntimeExports.jsx(Qe.default,{className:"slide-player__icon",strokeWidth:2.25})}),t.jsxRuntimeExports.jsx("button",{"aria-label":Ue,className:"slide-player__toggle slide-player__toggle--playback",onClick:()=>{if(D){we?.(!z);return}const e=p.current;if(!(v||!e||!o)){if(c.current!==null){if(G){u.current=!1,x.current=!0,c.current=null,R.current=!1,a(!1),s(!1),e.pause();return}M.current="manual",x.current=!1,u.current=!0,s(!0);return}if(!e.src&&S.length>0){M.current="manual",x.current=!1,k(Math.min(b.current,S.length-1),"toggle");return}if(e.paused){M.current="manual",x.current=!1,u.current=!0,y("toggle-resume");return}u.current=!1,x.current=!0,e.pause()}},type:"button",children:Pe?t.jsxRuntimeExports.jsx(nr,{}):t.jsxRuntimeExports.jsx(sr,{})}),t.jsxRuntimeExports.jsx("button",{"aria-label":"Forward",className:"slide-player__action slide-player__action--next",disabled:ve,onClick:Se,type:"button",children:t.jsxRuntimeExports.jsx(Ie.default,{className:"slide-player__icon",strokeWidth:2.25})}),I?t.jsxRuntimeExports.jsx("button",{"aria-label":ee?"Exit fullscreen":"Enter fullscreen",className:"slide-player__action slide-player__action--fullscreen",onClick:I,type:"button",children:ee?t.jsxRuntimeExports.jsx(er.default,{className:"slide-player__icon",strokeWidth:2.25}):t.jsxRuntimeExports.jsx(rr.default,{className:"slide-player__icon",strokeWidth:2.25})}):null]}),t.jsxRuntimeExports.jsx("div",{className:"slide-player__separator"}),t.jsxRuntimeExports.jsxs("div",{className:"slide-player__group",children:[oe.map((e,n)=>t.jsxRuntimeExports.jsx(r.Fragment,{children:e},`custom-action-${n}`)),t.jsxRuntimeExports.jsx("button",{"aria-label":"Notes",className:Re.cn("slide-player__action slide-player__action--notes",W&&"slide-player__action--active"),disabled:!Ae,onClick:Me,type:"button",children:t.jsxRuntimeExports.jsx(tr.default,{className:"slide-player__icon",strokeWidth:2.25})})]})]})]}):null]})},je=r.memo(ur);je.displayName="Player";exports.default=je;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../_virtual/jsx-runtime.cjs.js"),r=require("react"),_e=require("../../lib/utils.cjs.js"),Ye=require("./MobilePlayerSettingsSheet.cjs.js"),Ge=require("./constants.cjs.js"),Je=require("./utils/mobileScreenMode.cjs.js"),Qe=require("./utils/playerCustomActions.cjs.js");;/* empty css */const Ie=require("../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.cjs.js"),er=require("../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/volume-2.cjs.js"),rr=require("../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions.cjs.js"),tr=require("../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions-off.cjs.js"),nr=require("../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-ccw.cjs.js"),sr=require("../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-cw.cjs.js"),ur=require("../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/scan-line.cjs.js"),lr=require("../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/maximize.cjs.js"),ar=require("../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/file-pen-line.cjs.js"),je=new Map,ke=w=>{if(typeof window>"u"||!w||je.has(w))return;const N=window.document.createElement("audio");N.preload="auto",N.setAttribute("playsinline","true"),N.src=w,N.load(),je.set(w,N)},cr=()=>t.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"34",height:"34",viewBox:"0 0 34 34",fill:"none",children:[t.jsxRuntimeExports.jsx("path",{d:"M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z",fill:"#0A0A0A"}),t.jsxRuntimeExports.jsx("path",{d:"M12 10H16V24H12V10ZM18 10H22V24H18V10Z",fill:"white"})]}),ir=()=>t.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"34",height:"34",viewBox:"0 0 34 34",fill:"none",children:[t.jsxRuntimeExports.jsx("path",{d:"M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z",fill:"#0A0A0A"}),t.jsxRuntimeExports.jsx("path",{d:"M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z",fill:"white"})]}),or=({audioList:w=[],className:N,currentAudioIndex:d=-1,defaultPlaying:E=!0,isPlaybackPaused:T=!1,isAutoAdvanceEnabled:z=!0,useAutoAdvanceToggle:D=!1,onLoadingChange:I,onPlaybackStarted:ee,onPlaybackTimeChange:K,onSubtitleToggle:re,onPrev:Ce,onNext:we,onFullscreen:te,isFullscreen:ne=!1,mobileViewMode:Me=Je.DEFAULT_MOBILE_VIEW_MODE,settingsPortalContainer:Ae,onMobileViewModeChange:se,onEnded:ue,onAutoAdvanceToggle:Ne,onInteractionToggle:Te,hasInteraction:ve=!1,isInteractionOpen:V=!1,isSubtitleEnabled:X=!0,prevDisabled:Le=!1,nextDisabled:qe=!1,showControls:Y=!0,customActions:le,customActionContext:ae,texts:ce,...Ue})=>{const p=r.useRef(null),ie=r.useRef(V),_=r.useRef(null),oe=r.useRef(null),y=r.useRef(0),a=r.useRef(null),Z=r.useRef(void 0),j=r.useRef([]),B=r.useRef(!1),fe=r.useRef(!1),x=r.useRef(!1),v=r.useRef(null),g=r.useRef(!1),u=r.useRef(!1),m=r.useRef(null),R=r.useRef(!1),L=r.useRef(null),G=r.useRef(0),M=r.useRef("unknown"),[J,c]=r.useState(E),[de,F]=r.useState(!1),o=d>=0?w[d]:void 0,W=o?.audioUrl,Pe=o?.element?.subtitle_cues??[],k=r.useMemo(()=>[...o?.audioSegments??[]].sort((e,n)=>e.segment_index-n.segment_index),[o?.audioSegments]),me=r.useMemo(()=>Qe.toPlayerCustomActionList(le,ae),[ae,le]),pe=me.length+5,Fe=r.useMemo(()=>({"--slide-player-mobile-control-count":String(pe)}),[pe]),q=r.useMemo(()=>({...Ge.DEFAULT_SLIDE_PLAYER_TEXTS,...ce}),[ce]),Q=r.useMemo(()=>o?o.audioKey??`${String(o.sequenceNumber??"none")}:${String(o.audioUrl??"")}`:"none",[o]),We=D?z:J,Ve=D?z?"Pause autoplay":"Play autoplay":J?"Pause":"Play";r.useEffect(()=>{Z.current=o},[o]),r.useEffect(()=>{Y||F(!1)},[Y]),r.useEffect(()=>{!ie.current&&V&&F(!1),ie.current=V},[V]),r.useEffect(()=>{j.current=k},[k]),r.useEffect(()=>{const e=o?.audioUrl,n=d>=0?w[d+1]?.audioUrl:void 0;ke(e),ke(n)},[w,o?.audioUrl,d]);const s=r.useCallback(e=>{fe.current!==e&&(fe.current=e,I?.(e))},[I]),xe=r.useCallback(e=>e instanceof DOMException?e.name==="NotAllowedError"||e.name==="SecurityError":!1,[]),A=r.useCallback(()=>E&&!T&&!x.current&&M.current!=="blocked",[E,T]),be=r.useCallback(e=>e?e.startsWith("data:")?e:`data:audio/mpeg;base64,${e}`:"",[]),he=r.useCallback(()=>{const e=a.current;return e==null||e<=0?0:j.current.slice(0,e).reduce((n,l)=>n+Math.max(Number(l.duration_ms??0),0),0)/1e3},[]),U=r.useCallback(e=>e<=0?0:j.current.slice(0,e).reduce((n,l)=>n+Math.max(Number(l.duration_ms??0),0),0),[]),ye=r.useCallback(()=>{const e=p.current;return e?v.current==="segment"?U(y.current)+Math.max(e.currentTime,0)*1e3:m.current!==null&&e.readyState===0?m.current*1e3:Math.max(e.currentTime,0)*1e3:a.current!=null?U(a.current):0},[U]),b=r.useCallback(e=>{const n=Math.max(e,0);G.current!==n&&(G.current=n,K?.(n))},[K]),i=r.useCallback(()=>{b(ye())},[ye,b]),f=r.useCallback(()=>{typeof window>"u"||L.current===null||(window.cancelAnimationFrame(L.current),L.current=null)},[]),ge=r.useCallback(()=>{if(typeof window>"u"||L.current!==null)return;const e=()=>{i();const n=p.current;if(!n||n.paused||n.ended){L.current=null;return}L.current=window.requestAnimationFrame(e)};L.current=window.requestAnimationFrame(e)},[i]),O=r.useCallback(()=>{const e=p.current;e&&(f(),u.current=!1,x.current=!1,B.current=!1,v.current=null,m.current=null,g.current=!1,R.current=!1,e.pause(),e.removeAttribute("src"),e.load(),_.current=null,y.current=0,a.current=null,b(0),c(!1),s(!1))},[b,f,s]),h=r.useCallback(e=>{const n=p.current;if(!n)return!1;const l=n.play();return l&&typeof l.then=="function"&&l.then(()=>{M.current==="unknown"&&(M.current="auto"),u.current=!1,R.current=!1}).catch(P=>{M.current==="unknown"&&xe(P)&&(M.current="blocked",u.current=!1,s(!1)),R.current=!1,c(!1)}),!0},[xe,s]),S=r.useCallback((e,n)=>{const l=p.current,P=j.current[e];if(!l||!P)return!1;const C=be(P.audio_data);y.current=e,a.current=null,g.current=!1,R.current=!0,b(U(e));const H=A();u.current=H,s(!1);const Xe=_.current!==C;return v.current="segment",Xe&&(l.pause(),l.removeAttribute("src"),l.load(),_.current=C,l.src=C,l.load()),m.current=0,l.readyState>0&&(l.currentTime=0,m.current=null),H?h(`start-segment:${n}`):(u.current=!1,R.current=!1,l.pause(),c(!1),!0)},[A,be,U,b,h,s]),$=r.useCallback(e=>{f(),u.current=!1,g.current=!1,R.current=!1,i(),c(!1),s(!1),d>=0&&ue?.(d)},[d,ue,f,i,s]),Re=r.useCallback(()=>{const e=y.current+1,n=j.current,l=n[e],P=Z.current,C=n.some(H=>H.is_final);if(l){S(e,"ended");return}if(P?.isAudioStreaming||!C){y.current=e,a.current=e,g.current=!0,u.current=E,b(U(e)),c(!1),s(!0);return}$("segments-completed")},[E,$,U,b,S,s]);r.useEffect(()=>{if(oe.current===Q)return;oe.current=Q,y.current=0,a.current=null,g.current=!1,x.current=!1,B.current=!1,u.current=!1,R.current=!1,v.current=null,_.current=null,f(),b(0),s(!1);const e=p.current;e&&(e.pause(),e.removeAttribute("src"),e.load(),c(!1))},[d,Q,k.length,W,b,f,s]),r.useEffect(()=>{const e=p.current;if(e){if(T){B.current=!!(Z.current&&!x.current&&(!e.paused||u.current||a.current!==null)),u.current=!1,s(!1),e.pause(),c(!1);return}if(!(!B.current||!Z.current||x.current)){if(B.current=!1,a.current!==null){if(a.current<j.current.length){S(a.current,"external-resume");return}u.current=!0,s(!0);return}if(!_.current&&j.current.length>0){S(Math.min(y.current,j.current.length-1),"external-resume-init");return}e.paused&&(u.current=!0,h("external-resume"))}}},[T,S,h,s]),r.useEffect(()=>{const e=p.current;if(e){if(!o){O();return}if(T){u.current=!1,s(!1),e.pause(),c(!1);return}if(W){const n=_.current!==W,l=A();if(v.current==="segment"&&!!_.current&&a.current===null){if(!l){u.current=!1,e.pause(),c(!1);return}e.paused&&(u.current=!0,h("keep-segment-source"));return}if(n){const C=a.current!==null?he():0;e.pause(),e.removeAttribute("src"),e.load(),_.current=W,v.current="url",e.src=W,e.load(),m.current=C,b(C*1e3),e.readyState>0&&(e.currentTime=C,m.current=null)}if(u.current=l,g.current=!1,R.current=!1,s(!1),!l){u.current=!1,e.pause(),c(!1);return}h(n?"sync-url-init":"sync-url");return}if(a.current!==null){if(a.current<k.length){if(x.current){c(!1),s(!1);return}S(a.current,"wait-resume");return}g.current=!0,u.current=A(),c(!1),s(A());return}if(!k.length){if(o.isAudioStreaming){a.current=y.current,g.current=!0,u.current=A(),c(!1),s(A());return}O();return}if(!_.current){S(Math.min(y.current,k.length-1),"effect-init");return}if(!E||x.current){u.current=!1,e.pause(),c(!1);return}e.paused&&(u.current=!0,h("sync-paused-retry"))}},[o,d,k,W,E,T,A,b,O,S,h,he,s]),r.useEffect(()=>O,[O]),r.useEffect(()=>f,[f]);const Be=r.useCallback(()=>{i(),ge(),c(!0),s(!1),ee?.()},[ee,ge,i,s]),Oe=r.useCallback(()=>{g.current||R.current||(f(),i(),c(!1))},[d,f,i]),Ke=r.useCallback(()=>{const e=p.current;e&&m.current!==null&&(e.currentTime=m.current,m.current=null),i(),!(!u.current||!E)&&h("canplay")},[d,E,i,h]),Ze=r.useCallback(()=>{const e=p.current;e&&m.current!==null&&(e.currentTime=m.current,m.current=null),i()},[d,i]),$e=r.useCallback(()=>{i()},[i]),Ee=r.useCallback(()=>{i()},[i]),He=r.useCallback(()=>{const e=v.current==="url"||j.current.length===0;if(f(),R.current=!1,e){$("url-ended");return}Re()},[$,Re,f]),ze=r.useCallback(()=>{f(),i(),c(!1),s(!1)},[f,i,s]),De=r.useCallback(e=>{se?.(e),F(!1)},[se]);return console.log("SubtitleOverlay",Pe),r.useEffect(()=>{K?.(G.current)},[K]),t.jsxRuntimeExports.jsxs("div",{className:_e.cn("slide-player",N),...Ue,children:[t.jsxRuntimeExports.jsx("audio",{ref:p,preload:"auto",playsInline:!0,onLoadedMetadata:Ze,onCanPlay:Ke,onPlay:Be,onPause:Oe,onSeeking:Ee,onSeeked:Ee,onTimeUpdate:$e,onEnded:He,onError:ze}),Y?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Ye.default,{container:Ae,labels:{fullscreen:q.fullscreenLabel,nonFullscreen:q.nonFullscreenLabel,screen:q.screenLabel,subtitle:q.subtitleLabel,subtitleToggle:q.subtitleToggleAriaLabel,title:q.settingsTitle},isSubtitleEnabled:X,onClose:()=>F(!1),onOpenChange:F,onSubtitleToggle:re??(()=>{}),onViewModeChange:De,open:de,viewMode:Me}),t.jsxRuntimeExports.jsxs("div",{className:"slide-player__controls",style:Fe,children:[t.jsxRuntimeExports.jsxs("div",{className:"slide-player__group",children:[t.jsxRuntimeExports.jsx("button",{"aria-expanded":de,"aria-haspopup":"dialog","aria-label":"More options",className:"slide-player__action slide-player__action--mobile-more",onClick:()=>{F(e=>!e)},type:"button",children:t.jsxRuntimeExports.jsx(Ie.default,{className:"slide-player__icon",strokeWidth:2.25})}),t.jsxRuntimeExports.jsx("button",{"aria-label":"Volume",className:"hidden",type:"button",children:t.jsxRuntimeExports.jsx(er.default,{className:"slide-player__icon",strokeWidth:2.25})}),t.jsxRuntimeExports.jsx("button",{"aria-label":q.subtitleToggleAriaLabel,"aria-pressed":X,className:"slide-player__action slide-player__action--subtitle",onClick:re,type:"button",children:X?t.jsxRuntimeExports.jsx(rr.default,{className:"slide-player__icon",strokeWidth:2.25}):t.jsxRuntimeExports.jsx(tr.default,{className:"slide-player__icon",strokeWidth:2.25})}),t.jsxRuntimeExports.jsx("button",{"aria-label":"Rewind",className:"slide-player__action slide-player__action--prev",disabled:Le,onClick:Ce,type:"button",children:t.jsxRuntimeExports.jsx(nr.default,{className:"slide-player__icon",strokeWidth:2.25})}),t.jsxRuntimeExports.jsx("button",{"aria-label":Ve,className:"slide-player__toggle slide-player__toggle--playback",onClick:()=>{if(D){Ne?.(!z);return}const e=p.current;if(!(T||!e||!o)){if(a.current!==null){if(J){u.current=!1,x.current=!0,a.current=null,g.current=!1,c(!1),s(!1),e.pause();return}M.current="manual",x.current=!1,u.current=!0,s(!0);return}if(!e.src&&k.length>0){M.current="manual",x.current=!1,S(Math.min(y.current,k.length-1),"toggle");return}if(e.paused){M.current="manual",x.current=!1,u.current=!0,h("toggle-resume");return}u.current=!1,x.current=!0,e.pause()}},type:"button",children:We?t.jsxRuntimeExports.jsx(cr,{}):t.jsxRuntimeExports.jsx(ir,{})}),t.jsxRuntimeExports.jsx("button",{"aria-label":"Forward",className:"slide-player__action slide-player__action--next",disabled:qe,onClick:we,type:"button",children:t.jsxRuntimeExports.jsx(sr.default,{className:"slide-player__icon",strokeWidth:2.25})}),te?t.jsxRuntimeExports.jsx("button",{"aria-label":ne?"Exit fullscreen":"Enter fullscreen",className:"slide-player__action slide-player__action--fullscreen",onClick:te,type:"button",children:ne?t.jsxRuntimeExports.jsx(ur.default,{className:"slide-player__icon",strokeWidth:2.25}):t.jsxRuntimeExports.jsx(lr.default,{className:"slide-player__icon",strokeWidth:2.25})}):null]}),t.jsxRuntimeExports.jsx("div",{className:"slide-player__separator"}),t.jsxRuntimeExports.jsxs("div",{className:"slide-player__group",children:[me.map((e,n)=>t.jsxRuntimeExports.jsx(r.Fragment,{children:e},`custom-action-${n}`)),t.jsxRuntimeExports.jsx("button",{"aria-label":"Notes",className:_e.cn("slide-player__action slide-player__action--notes",V&&"slide-player__action--active"),disabled:!ve,onClick:Te,type:"button",children:t.jsxRuntimeExports.jsx(ar.default,{className:"slide-player__icon",strokeWidth:2.25})})]})]})]}):null]})},Se=r.memo(or);Se.displayName="Player";exports.default=Se;
|
|
2
2
|
//# sourceMappingURL=Player.cjs.js.map
|