markdown-flow-ui 0.1.114 → 0.1.115-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index.cjs10.js +1 -1
- package/dist/_virtual/index.cjs7.js +1 -1
- package/dist/_virtual/index.cjs8.js +1 -1
- package/dist/_virtual/index.cjs9.js +1 -1
- package/dist/_virtual/index.es10.js +2 -2
- package/dist/_virtual/index.es7.js +2 -3
- package/dist/_virtual/index.es7.js.map +1 -1
- package/dist/_virtual/index.es8.js +3 -2
- package/dist/_virtual/index.es8.js.map +1 -1
- package/dist/_virtual/index.es9.js +2 -2
- package/dist/assets/markdown-flow-ui.css +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 +5 -1
- package/dist/components/Slide/Player.es.js +230 -217
- 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.d.ts +4 -2
- package/dist/components/Slide/Slide.es.js +453 -456
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/components/Slide/Slide.stories.d.ts +1 -0
- package/dist/components/Slide/constants.cjs.js +1 -1
- package/dist/components/Slide/constants.cjs.js.map +1 -1
- package/dist/components/Slide/constants.es.js +2 -3
- package/dist/components/Slide/constants.es.js.map +1 -1
- package/dist/components/Slide/useSlide.cjs.js +1 -1
- package/dist/components/Slide/useSlide.cjs.js.map +1 -1
- package/dist/components/Slide/useSlide.d.ts +5 -0
- package/dist/components/Slide/useSlide.es.js +84 -77
- package/dist/components/Slide/useSlide.es.js.map +1 -1
- package/dist/components/Slide/useSlide.test.d.ts +1 -0
- package/dist/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.cjs.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.cjs.js.map +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.cjs.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-YG6GDRKO.cjs.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-YG6GDRKO.es.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-S3R3BYOJ.cjs.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-S3R3BYOJ.es.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.cjs.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.es.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-LVOFAZNH.cjs.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-LVOFAZNH.es.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.cjs.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.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-lib.css +1 -1
- package/package.json +1 -1
- package/dist/components/Slide/SlideFullscreenHint.cjs.js +0 -2
- package/dist/components/Slide/SlideFullscreenHint.cjs.js.map +0 -1
- package/dist/components/Slide/SlideFullscreenHint.es.js +0 -42
- package/dist/components/Slide/SlideFullscreenHint.es.js.map +0 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { j as r } from "../../_virtual/jsx-runtime.es.js";
|
|
2
|
-
import
|
|
3
|
-
import { cn as
|
|
4
|
-
import
|
|
5
|
-
import { DEFAULT_SLIDE_PLAYER_TEXTS as
|
|
6
|
-
import { DEFAULT_MOBILE_VIEW_MODE as
|
|
7
|
-
import { toPlayerCustomActionList as
|
|
2
|
+
import Ie, { memo as er, useRef as c, useState as je, useMemo as O, useEffect as x, useCallback as u } from "react";
|
|
3
|
+
import { cn as ke } from "../../lib/utils.es.js";
|
|
4
|
+
import rr from "./MobilePlayerSettingsSheet.es.js";
|
|
5
|
+
import { DEFAULT_SLIDE_PLAYER_TEXTS as tr } from "./constants.es.js";
|
|
6
|
+
import { DEFAULT_MOBILE_VIEW_MODE as nr } from "./utils/mobileScreenMode.es.js";
|
|
7
|
+
import { toPlayerCustomActionList as ur } from "./utils/playerCustomActions.es.js";
|
|
8
8
|
/* empty css */
|
|
9
|
-
import
|
|
9
|
+
import lr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
|
|
10
10
|
import sr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
11
|
+
import ar from "../../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";
|
|
12
|
+
import cr from "../../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";
|
|
13
|
+
import ir from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js";
|
|
14
|
+
import or from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js";
|
|
15
|
+
import fr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
|
|
16
|
+
import dr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/maximize.es.js";
|
|
17
|
+
import mr from "../../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.es.js";
|
|
18
18
|
const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
19
19
|
if (typeof window > "u" || !R || Ee.has(R))
|
|
20
20
|
return;
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
},
|
|
21
|
+
const L = window.document.createElement("audio");
|
|
22
|
+
L.preload = "auto", L.setAttribute("playsinline", "true"), L.src = R, L.load(), Ee.set(R, L);
|
|
23
|
+
}, pr = () => /* @__PURE__ */ r.jsxs(
|
|
24
24
|
"svg",
|
|
25
25
|
{
|
|
26
26
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -39,7 +39,7 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
39
39
|
/* @__PURE__ */ r.jsx("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
|
|
40
40
|
]
|
|
41
41
|
}
|
|
42
|
-
),
|
|
42
|
+
), hr = () => /* @__PURE__ */ r.jsxs(
|
|
43
43
|
"svg",
|
|
44
44
|
{
|
|
45
45
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -58,272 +58,275 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
58
58
|
/* @__PURE__ */ r.jsx("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
|
|
59
59
|
]
|
|
60
60
|
}
|
|
61
|
-
),
|
|
61
|
+
), gr = ({
|
|
62
62
|
audioList: R = [],
|
|
63
|
-
className:
|
|
63
|
+
className: L,
|
|
64
64
|
currentAudioIndex: m = -1,
|
|
65
|
-
defaultPlaying:
|
|
66
|
-
isPlaybackPaused:
|
|
65
|
+
defaultPlaying: A = !0,
|
|
66
|
+
isPlaybackPaused: v = !1,
|
|
67
67
|
isAutoAdvanceEnabled: Y = !0,
|
|
68
68
|
useAutoAdvanceToggle: G = !1,
|
|
69
69
|
onLoadingChange: te,
|
|
70
70
|
onPlaybackStarted: ne,
|
|
71
71
|
onPlaybackTimeChange: q,
|
|
72
|
-
onSubtitleToggle:
|
|
72
|
+
onSubtitleToggle: ue,
|
|
73
73
|
onPrev: Re,
|
|
74
74
|
onNext: Te,
|
|
75
75
|
onFullscreen: le,
|
|
76
|
-
isFullscreen:
|
|
77
|
-
mobileViewMode: Ce =
|
|
78
|
-
settingsPortalContainer:
|
|
76
|
+
isFullscreen: se = !1,
|
|
77
|
+
mobileViewMode: Ce = nr,
|
|
78
|
+
settingsPortalContainer: Le,
|
|
79
79
|
onMobileViewModeChange: ae,
|
|
80
80
|
onEnded: ce,
|
|
81
|
-
onAutoAdvanceToggle:
|
|
82
|
-
onInteractionToggle:
|
|
83
|
-
hasInteraction:
|
|
81
|
+
onAutoAdvanceToggle: ve,
|
|
82
|
+
onInteractionToggle: Fe,
|
|
83
|
+
hasInteraction: Ue = !1,
|
|
84
84
|
isInteractionOpen: Z = !1,
|
|
85
85
|
isSubtitleEnabled: J = !0,
|
|
86
|
-
prevDisabled:
|
|
87
|
-
nextDisabled:
|
|
86
|
+
prevDisabled: We = !1,
|
|
87
|
+
nextDisabled: Pe = !1,
|
|
88
88
|
showControls: Q = !0,
|
|
89
89
|
customActions: ie,
|
|
90
90
|
customActionContext: oe,
|
|
91
91
|
texts: fe,
|
|
92
92
|
...Ve
|
|
93
93
|
}) => {
|
|
94
|
-
const h = c(null), de = c(Z), M = c(null), me = c(null),
|
|
94
|
+
const h = c(null), de = c(Z), M = c(null), me = c(null), S = c(0), a = c(null), z = c(void 0), j = c([]), $ = c(!1), pe = c(!1), g = c(!1), F = c(null), y = c(!1), l = c(!1), p = c(null), w = c(!1), U = c(null), I = c(0), T = c("unknown"), [ee, i] = je(A), [he, B] = je(!1), f = m >= 0 ? R[m] : void 0, K = f?.audioUrl, k = O(
|
|
95
95
|
() => [...f?.audioSegments ?? []].sort(
|
|
96
|
-
(e,
|
|
96
|
+
(e, n) => e.segment_index - n.segment_index
|
|
97
97
|
),
|
|
98
98
|
[f?.audioSegments]
|
|
99
|
-
),
|
|
100
|
-
() =>
|
|
99
|
+
), ge = O(
|
|
100
|
+
() => ur(ie, oe),
|
|
101
101
|
[oe, ie]
|
|
102
|
-
),
|
|
102
|
+
), ye = ge.length + 5, Be = O(
|
|
103
103
|
() => ({
|
|
104
|
-
"--slide-player-mobile-control-count": String(
|
|
104
|
+
"--slide-player-mobile-control-count": String(ye)
|
|
105
105
|
}),
|
|
106
|
-
[
|
|
107
|
-
),
|
|
106
|
+
[ye]
|
|
107
|
+
), W = O(
|
|
108
108
|
() => ({
|
|
109
|
-
...
|
|
109
|
+
...tr,
|
|
110
110
|
...fe
|
|
111
111
|
}),
|
|
112
112
|
[fe]
|
|
113
113
|
), re = O(() => f ? f.audioKey ?? `${String(f.sequenceNumber ?? "none")}:${String(f.audioUrl ?? "")}` : "none", [f]), Ke = G ? Y : ee, Ze = G ? Y ? "Pause autoplay" : "Play autoplay" : ee ? "Pause" : "Play";
|
|
114
|
-
|
|
114
|
+
x(() => {
|
|
115
115
|
z.current = f;
|
|
116
|
-
}, [f]),
|
|
116
|
+
}, [f]), x(() => {
|
|
117
117
|
Q || B(!1);
|
|
118
|
-
}, [Q]),
|
|
118
|
+
}, [Q]), x(() => {
|
|
119
119
|
!de.current && Z && B(!1), de.current = Z;
|
|
120
|
-
}, [Z]),
|
|
121
|
-
|
|
122
|
-
}, [
|
|
123
|
-
const e = f?.audioUrl,
|
|
124
|
-
Ne(e), Ne(
|
|
120
|
+
}, [Z]), x(() => {
|
|
121
|
+
j.current = k;
|
|
122
|
+
}, [k]), x(() => {
|
|
123
|
+
const e = f?.audioUrl, n = m >= 0 ? R[m + 1]?.audioUrl : void 0;
|
|
124
|
+
Ne(e), Ne(n);
|
|
125
125
|
}, [R, f?.audioUrl, m]);
|
|
126
|
-
const
|
|
127
|
-
(e) => {
|
|
128
|
-
pe.current
|
|
126
|
+
const t = u(
|
|
127
|
+
(e, n = null) => {
|
|
128
|
+
pe.current === e && (!e || n === null) || (pe.current = e, te?.({
|
|
129
|
+
loading: e,
|
|
130
|
+
reason: e ? n : null
|
|
131
|
+
}));
|
|
129
132
|
},
|
|
130
133
|
[te]
|
|
131
|
-
), _e =
|
|
134
|
+
), _e = u((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), C = u(() => A && !v && !g.current && T.current !== "blocked", [A, v]), be = u((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), xe = u(() => {
|
|
132
135
|
const e = a.current;
|
|
133
|
-
return e == null || e <= 0 ? 0 :
|
|
134
|
-
(
|
|
136
|
+
return e == null || e <= 0 ? 0 : j.current.slice(0, e).reduce(
|
|
137
|
+
(n, s) => n + Math.max(Number(s.duration_ms ?? 0), 0),
|
|
135
138
|
0
|
|
136
139
|
) / 1e3;
|
|
137
|
-
}, []),
|
|
138
|
-
(
|
|
140
|
+
}, []), P = u((e) => e <= 0 ? 0 : j.current.slice(0, e).reduce(
|
|
141
|
+
(n, s) => n + Math.max(Number(s.duration_ms ?? 0), 0),
|
|
139
142
|
0
|
|
140
|
-
), []), Se =
|
|
143
|
+
), []), Se = u(() => {
|
|
141
144
|
const e = h.current;
|
|
142
|
-
return e ?
|
|
143
|
-
}, [
|
|
145
|
+
return e ? F.current === "segment" ? P(S.current) + Math.max(e.currentTime, 0) * 1e3 : p.current !== null && e.readyState === 0 ? p.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : a.current != null ? P(a.current) : 0;
|
|
146
|
+
}, [P]), _ = u(
|
|
144
147
|
(e) => {
|
|
145
|
-
const
|
|
146
|
-
I.current !==
|
|
148
|
+
const n = Math.max(e, 0);
|
|
149
|
+
I.current !== n && (I.current = n, q?.(n));
|
|
147
150
|
},
|
|
148
151
|
[q]
|
|
149
|
-
), o =
|
|
150
|
-
|
|
151
|
-
}, [Se,
|
|
152
|
-
typeof window > "u" ||
|
|
153
|
-
}, []), we =
|
|
154
|
-
if (typeof window > "u" ||
|
|
152
|
+
), o = u(() => {
|
|
153
|
+
_(Se());
|
|
154
|
+
}, [Se, _]), d = u(() => {
|
|
155
|
+
typeof window > "u" || U.current === null || (window.cancelAnimationFrame(U.current), U.current = null);
|
|
156
|
+
}, []), we = u(() => {
|
|
157
|
+
if (typeof window > "u" || U.current !== null)
|
|
155
158
|
return;
|
|
156
159
|
const e = () => {
|
|
157
160
|
o();
|
|
158
|
-
const
|
|
159
|
-
if (!
|
|
160
|
-
|
|
161
|
+
const n = h.current;
|
|
162
|
+
if (!n || n.paused || n.ended) {
|
|
163
|
+
U.current = null;
|
|
161
164
|
return;
|
|
162
165
|
}
|
|
163
|
-
|
|
166
|
+
U.current = window.requestAnimationFrame(e);
|
|
164
167
|
};
|
|
165
|
-
|
|
166
|
-
}, [o]), H =
|
|
168
|
+
U.current = window.requestAnimationFrame(e);
|
|
169
|
+
}, [o]), H = u(() => {
|
|
167
170
|
const e = h.current;
|
|
168
|
-
e && (d(),
|
|
169
|
-
}, [
|
|
171
|
+
e && (d(), l.current = !1, g.current = !1, $.current = !1, F.current = null, p.current = null, y.current = !1, w.current = !1, e.pause(), e.removeAttribute("src"), e.load(), M.current = null, S.current = 0, a.current = null, _(0), i(!1), t(!1));
|
|
172
|
+
}, [_, d, t]), b = u(
|
|
170
173
|
(e) => {
|
|
171
|
-
const
|
|
172
|
-
if (!
|
|
174
|
+
const n = h.current;
|
|
175
|
+
if (!n)
|
|
173
176
|
return !1;
|
|
174
|
-
const
|
|
175
|
-
return
|
|
176
|
-
T.current === "unknown" && (T.current = "auto"),
|
|
177
|
+
const s = n.play();
|
|
178
|
+
return s && typeof s.then == "function" && s.then(() => {
|
|
179
|
+
T.current === "unknown" && (T.current = "auto"), l.current = !1, w.current = !1;
|
|
177
180
|
}).catch((V) => {
|
|
178
|
-
T.current === "unknown" && _e(V) && (T.current = "blocked",
|
|
181
|
+
T.current === "unknown" && _e(V) && (T.current = "blocked", l.current = !1, t(!1)), w.current = !1, i(!1);
|
|
179
182
|
}), !0;
|
|
180
183
|
},
|
|
181
|
-
[_e,
|
|
182
|
-
), E =
|
|
183
|
-
(e,
|
|
184
|
-
const
|
|
185
|
-
if (!
|
|
184
|
+
[_e, t]
|
|
185
|
+
), E = u(
|
|
186
|
+
(e, n) => {
|
|
187
|
+
const s = h.current, V = j.current[e];
|
|
188
|
+
if (!s || !V)
|
|
186
189
|
return !1;
|
|
187
190
|
const N = be(V.audio_data);
|
|
188
|
-
|
|
191
|
+
S.current = e, a.current = null, y.current = !1, w.current = !0, _(P(e));
|
|
189
192
|
const X = C();
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
return
|
|
193
|
+
l.current = X, t(!1);
|
|
194
|
+
const Qe = M.current !== N;
|
|
195
|
+
return F.current = "segment", Qe && (s.pause(), s.removeAttribute("src"), s.load(), M.current = N, s.src = N, s.load()), p.current = 0, s.readyState > 0 && (s.currentTime = 0, p.current = null), X ? b(`start-segment:${n}`) : (l.current = !1, w.current = !1, s.pause(), i(!1), !0);
|
|
193
196
|
},
|
|
194
197
|
[
|
|
195
198
|
C,
|
|
196
199
|
be,
|
|
197
|
-
|
|
198
|
-
g,
|
|
200
|
+
P,
|
|
199
201
|
_,
|
|
200
|
-
|
|
202
|
+
b,
|
|
203
|
+
t
|
|
201
204
|
]
|
|
202
|
-
), D =
|
|
205
|
+
), D = u(
|
|
203
206
|
(e) => {
|
|
204
|
-
d(),
|
|
207
|
+
d(), l.current = !1, y.current = !1, w.current = !1, o(), i(!1), t(!1), m >= 0 && ce?.(m);
|
|
205
208
|
},
|
|
206
209
|
[
|
|
207
210
|
m,
|
|
208
211
|
ce,
|
|
209
212
|
d,
|
|
210
213
|
o,
|
|
211
|
-
|
|
214
|
+
t
|
|
212
215
|
]
|
|
213
|
-
),
|
|
214
|
-
const e =
|
|
215
|
-
if (
|
|
216
|
+
), Ae = u(() => {
|
|
217
|
+
const e = S.current + 1, n = j.current, s = n[e], V = z.current, N = n.some((X) => X.is_final);
|
|
218
|
+
if (s) {
|
|
216
219
|
E(e, "ended");
|
|
217
220
|
return;
|
|
218
221
|
}
|
|
219
222
|
if (V?.isAudioStreaming || !N) {
|
|
220
|
-
|
|
223
|
+
S.current = e, a.current = e, y.current = !0, l.current = A, _(P(e)), i(!1), t(!0, "waitingForMoreAudio");
|
|
221
224
|
return;
|
|
222
225
|
}
|
|
223
226
|
D("segments-completed");
|
|
224
227
|
}, [
|
|
225
|
-
|
|
228
|
+
A,
|
|
226
229
|
D,
|
|
227
|
-
|
|
228
|
-
|
|
230
|
+
P,
|
|
231
|
+
_,
|
|
229
232
|
E,
|
|
230
|
-
|
|
233
|
+
t
|
|
231
234
|
]);
|
|
232
|
-
|
|
235
|
+
x(() => {
|
|
233
236
|
if (me.current === re)
|
|
234
237
|
return;
|
|
235
|
-
me.current = re,
|
|
238
|
+
me.current = re, S.current = 0, a.current = null, y.current = !1, g.current = !1, $.current = !1, l.current = !1, w.current = !1, F.current = null, M.current = null, d(), _(0), t(!1);
|
|
236
239
|
const e = h.current;
|
|
237
240
|
e && (e.pause(), e.removeAttribute("src"), e.load(), i(!1));
|
|
238
241
|
}, [
|
|
239
242
|
m,
|
|
240
243
|
re,
|
|
241
|
-
|
|
244
|
+
k.length,
|
|
242
245
|
K,
|
|
243
|
-
|
|
246
|
+
_,
|
|
244
247
|
d,
|
|
245
|
-
|
|
246
|
-
]),
|
|
248
|
+
t
|
|
249
|
+
]), x(() => {
|
|
247
250
|
const e = h.current;
|
|
248
251
|
if (e) {
|
|
249
|
-
if (
|
|
250
|
-
$.current = !!(z.current && !
|
|
252
|
+
if (v) {
|
|
253
|
+
$.current = !!(z.current && !g.current && (!e.paused || l.current || a.current !== null)), l.current = !1, t(!1), e.pause(), i(!1);
|
|
251
254
|
return;
|
|
252
255
|
}
|
|
253
|
-
if (!(!$.current || !z.current ||
|
|
256
|
+
if (!(!$.current || !z.current || g.current)) {
|
|
254
257
|
if ($.current = !1, a.current !== null) {
|
|
255
|
-
if (a.current <
|
|
258
|
+
if (a.current < j.current.length) {
|
|
256
259
|
E(a.current, "external-resume");
|
|
257
260
|
return;
|
|
258
261
|
}
|
|
259
|
-
|
|
262
|
+
l.current = !0, t(!0, "waitingForMoreAudio");
|
|
260
263
|
return;
|
|
261
264
|
}
|
|
262
|
-
if (!M.current &&
|
|
265
|
+
if (!M.current && j.current.length > 0) {
|
|
263
266
|
E(
|
|
264
267
|
Math.min(
|
|
265
|
-
|
|
266
|
-
|
|
268
|
+
S.current,
|
|
269
|
+
j.current.length - 1
|
|
267
270
|
),
|
|
268
271
|
"external-resume-init"
|
|
269
272
|
);
|
|
270
273
|
return;
|
|
271
274
|
}
|
|
272
|
-
e.paused && (
|
|
275
|
+
e.paused && (l.current = !0, b("external-resume"));
|
|
273
276
|
}
|
|
274
277
|
}
|
|
275
278
|
}, [
|
|
276
|
-
|
|
279
|
+
v,
|
|
277
280
|
E,
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
]),
|
|
281
|
+
b,
|
|
282
|
+
t
|
|
283
|
+
]), x(() => {
|
|
281
284
|
const e = h.current;
|
|
282
285
|
if (e) {
|
|
283
286
|
if (!f) {
|
|
284
287
|
H();
|
|
285
288
|
return;
|
|
286
289
|
}
|
|
287
|
-
if (
|
|
288
|
-
|
|
290
|
+
if (v) {
|
|
291
|
+
l.current = !1, t(!1), e.pause(), i(!1);
|
|
289
292
|
return;
|
|
290
293
|
}
|
|
291
294
|
if (K) {
|
|
292
|
-
const
|
|
293
|
-
if (
|
|
294
|
-
if (!
|
|
295
|
-
|
|
295
|
+
const n = M.current !== K, s = C();
|
|
296
|
+
if (F.current === "segment" && !!M.current && a.current === null) {
|
|
297
|
+
if (!s) {
|
|
298
|
+
l.current = !1, e.pause(), i(!1);
|
|
296
299
|
return;
|
|
297
300
|
}
|
|
298
|
-
e.paused && (
|
|
301
|
+
e.paused && (l.current = !0, b("keep-segment-source"));
|
|
299
302
|
return;
|
|
300
303
|
}
|
|
301
|
-
if (
|
|
304
|
+
if (n) {
|
|
302
305
|
const N = a.current !== null ? xe() : 0;
|
|
303
|
-
e.pause(), e.removeAttribute("src"), e.load(), M.current = K,
|
|
306
|
+
e.pause(), e.removeAttribute("src"), e.load(), M.current = K, F.current = "url", e.src = K, e.load(), p.current = N, _(N * 1e3), e.readyState > 0 && (e.currentTime = N, p.current = null);
|
|
304
307
|
}
|
|
305
|
-
if (
|
|
306
|
-
|
|
308
|
+
if (l.current = s, y.current = !1, w.current = !1, t(!1), !s) {
|
|
309
|
+
l.current = !1, e.pause(), i(!1);
|
|
307
310
|
return;
|
|
308
311
|
}
|
|
309
|
-
|
|
312
|
+
b(n ? "sync-url-init" : "sync-url");
|
|
310
313
|
return;
|
|
311
314
|
}
|
|
312
315
|
if (a.current !== null) {
|
|
313
|
-
if (a.current <
|
|
314
|
-
if (
|
|
315
|
-
i(!1),
|
|
316
|
+
if (a.current < k.length) {
|
|
317
|
+
if (g.current) {
|
|
318
|
+
i(!1), t(!1);
|
|
316
319
|
return;
|
|
317
320
|
}
|
|
318
321
|
E(a.current, "wait-resume");
|
|
319
322
|
return;
|
|
320
323
|
}
|
|
321
|
-
|
|
324
|
+
y.current = !0, l.current = C(), i(!1), t(C());
|
|
322
325
|
return;
|
|
323
326
|
}
|
|
324
|
-
if (!
|
|
327
|
+
if (!k.length) {
|
|
325
328
|
if (f.isAudioStreaming) {
|
|
326
|
-
a.current =
|
|
329
|
+
a.current = S.current, y.current = !0, l.current = C(), i(!1), t(C());
|
|
327
330
|
return;
|
|
328
331
|
}
|
|
329
332
|
H();
|
|
@@ -332,112 +335,122 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
332
335
|
if (!M.current) {
|
|
333
336
|
E(
|
|
334
337
|
Math.min(
|
|
335
|
-
|
|
336
|
-
|
|
338
|
+
S.current,
|
|
339
|
+
k.length - 1
|
|
337
340
|
),
|
|
338
341
|
"effect-init"
|
|
339
342
|
);
|
|
340
343
|
return;
|
|
341
344
|
}
|
|
342
|
-
if (!
|
|
343
|
-
|
|
345
|
+
if (!A || g.current) {
|
|
346
|
+
l.current = !1, e.pause(), i(!1);
|
|
344
347
|
return;
|
|
345
348
|
}
|
|
346
|
-
e.paused && (
|
|
349
|
+
e.paused && (l.current = !0, b("sync-paused-retry"));
|
|
347
350
|
}
|
|
348
351
|
}, [
|
|
349
352
|
f,
|
|
350
353
|
m,
|
|
351
|
-
|
|
354
|
+
k,
|
|
352
355
|
K,
|
|
353
|
-
|
|
354
|
-
|
|
356
|
+
A,
|
|
357
|
+
v,
|
|
355
358
|
C,
|
|
356
|
-
|
|
359
|
+
_,
|
|
357
360
|
H,
|
|
358
361
|
E,
|
|
359
|
-
|
|
362
|
+
b,
|
|
360
363
|
xe,
|
|
361
|
-
|
|
362
|
-
]),
|
|
363
|
-
const $e =
|
|
364
|
-
o(), we(), i(!0),
|
|
364
|
+
t
|
|
365
|
+
]), x(() => H, [H]), x(() => d, [d]);
|
|
366
|
+
const $e = u(() => {
|
|
367
|
+
o(), we(), i(!0), t(!1), ne?.();
|
|
365
368
|
}, [
|
|
366
369
|
ne,
|
|
367
370
|
we,
|
|
368
371
|
o,
|
|
369
|
-
|
|
370
|
-
]), He =
|
|
371
|
-
|
|
372
|
-
}, [m, d, o]), Oe =
|
|
372
|
+
t
|
|
373
|
+
]), He = u(() => {
|
|
374
|
+
y.current || w.current || (d(), o(), i(!1));
|
|
375
|
+
}, [m, d, o]), Oe = u(() => {
|
|
373
376
|
const e = h.current;
|
|
374
|
-
e && p.current !== null && (e.currentTime = p.current, p.current = null), o(), !(!
|
|
377
|
+
e && p.current !== null && (e.currentTime = p.current, p.current = null), o(), !(!l.current || !A) && b("canplay");
|
|
375
378
|
}, [
|
|
376
379
|
m,
|
|
377
|
-
|
|
380
|
+
A,
|
|
378
381
|
o,
|
|
379
|
-
|
|
380
|
-
]), qe =
|
|
382
|
+
b
|
|
383
|
+
]), qe = u(() => {
|
|
381
384
|
const e = h.current;
|
|
382
385
|
e && p.current !== null && (e.currentTime = p.current, p.current = null), o();
|
|
383
|
-
}, [m, o]), ze =
|
|
386
|
+
}, [m, o]), ze = u(() => {
|
|
384
387
|
o();
|
|
385
|
-
}, [o]),
|
|
388
|
+
}, [o]), De = u(() => {
|
|
389
|
+
y.current || t(!0, "loadingAudio");
|
|
390
|
+
}, [t]), Xe = u(() => {
|
|
391
|
+
if (y.current) {
|
|
392
|
+
t(!0, "waitingForMoreAudio");
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
t(!0, "loadingAudio");
|
|
396
|
+
}, [t]), Me = u(() => {
|
|
386
397
|
o();
|
|
387
|
-
}, [o]),
|
|
388
|
-
const e =
|
|
398
|
+
}, [o]), Ye = u(() => {
|
|
399
|
+
const e = F.current === "url" || j.current.length === 0;
|
|
389
400
|
if (d(), w.current = !1, e) {
|
|
390
401
|
D("url-ended");
|
|
391
402
|
return;
|
|
392
403
|
}
|
|
393
|
-
|
|
394
|
-
}, [D,
|
|
395
|
-
d(), o(), i(!1),
|
|
396
|
-
}, [d, o,
|
|
404
|
+
Ae();
|
|
405
|
+
}, [D, Ae, d]), Ge = u(() => {
|
|
406
|
+
d(), o(), i(!1), t(!1);
|
|
407
|
+
}, [d, o, t]), Je = u(
|
|
397
408
|
(e) => {
|
|
398
409
|
ae?.(e), B(!1);
|
|
399
410
|
},
|
|
400
411
|
[ae]
|
|
401
412
|
);
|
|
402
|
-
return
|
|
413
|
+
return x(() => {
|
|
403
414
|
q?.(I.current);
|
|
404
|
-
}, [q]), /* @__PURE__ */ r.jsxs("div", { className:
|
|
415
|
+
}, [q]), /* @__PURE__ */ r.jsxs("div", { className: ke("slide-player", L), ...Ve, children: [
|
|
405
416
|
/* @__PURE__ */ r.jsx(
|
|
406
417
|
"audio",
|
|
407
418
|
{
|
|
408
419
|
ref: h,
|
|
409
420
|
preload: "auto",
|
|
410
421
|
playsInline: !0,
|
|
422
|
+
onLoadStart: De,
|
|
411
423
|
onLoadedMetadata: qe,
|
|
412
424
|
onCanPlay: Oe,
|
|
413
425
|
onPlay: $e,
|
|
414
426
|
onPause: He,
|
|
427
|
+
onWaiting: Xe,
|
|
415
428
|
onSeeking: Me,
|
|
416
429
|
onSeeked: Me,
|
|
417
430
|
onTimeUpdate: ze,
|
|
418
|
-
onEnded:
|
|
419
|
-
onError:
|
|
431
|
+
onEnded: Ye,
|
|
432
|
+
onError: Ge
|
|
420
433
|
}
|
|
421
434
|
),
|
|
422
435
|
Q ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
423
436
|
/* @__PURE__ */ r.jsx(
|
|
424
|
-
|
|
437
|
+
rr,
|
|
425
438
|
{
|
|
426
|
-
container:
|
|
439
|
+
container: Le,
|
|
427
440
|
labels: {
|
|
428
|
-
fullscreen:
|
|
429
|
-
nonFullscreen:
|
|
430
|
-
screen:
|
|
431
|
-
subtitle:
|
|
432
|
-
subtitleToggle:
|
|
433
|
-
title:
|
|
441
|
+
fullscreen: W.fullscreenLabel,
|
|
442
|
+
nonFullscreen: W.nonFullscreenLabel,
|
|
443
|
+
screen: W.screenLabel,
|
|
444
|
+
subtitle: W.subtitleLabel,
|
|
445
|
+
subtitleToggle: W.subtitleToggleAriaLabel,
|
|
446
|
+
title: W.settingsTitle
|
|
434
447
|
},
|
|
435
448
|
isSubtitleEnabled: J,
|
|
436
449
|
onClose: () => B(!1),
|
|
437
450
|
onOpenChange: B,
|
|
438
|
-
onSubtitleToggle:
|
|
451
|
+
onSubtitleToggle: ue ?? (() => {
|
|
439
452
|
}),
|
|
440
|
-
onViewModeChange:
|
|
453
|
+
onViewModeChange: Je,
|
|
441
454
|
open: he,
|
|
442
455
|
viewMode: Ce
|
|
443
456
|
}
|
|
@@ -456,7 +469,7 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
456
469
|
},
|
|
457
470
|
type: "button",
|
|
458
471
|
children: /* @__PURE__ */ r.jsx(
|
|
459
|
-
|
|
472
|
+
lr,
|
|
460
473
|
{
|
|
461
474
|
className: "slide-player__icon",
|
|
462
475
|
strokeWidth: 2.25
|
|
@@ -468,13 +481,13 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
468
481
|
/* @__PURE__ */ r.jsx(
|
|
469
482
|
"button",
|
|
470
483
|
{
|
|
471
|
-
"aria-label":
|
|
484
|
+
"aria-label": W.subtitleToggleAriaLabel,
|
|
472
485
|
"aria-pressed": J,
|
|
473
486
|
className: "slide-player__action slide-player__action--subtitle",
|
|
474
|
-
onClick:
|
|
487
|
+
onClick: ue,
|
|
475
488
|
type: "button",
|
|
476
|
-
children: J ? /* @__PURE__ */ r.jsx(
|
|
477
|
-
|
|
489
|
+
children: J ? /* @__PURE__ */ r.jsx(ar, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ r.jsx(
|
|
490
|
+
cr,
|
|
478
491
|
{
|
|
479
492
|
className: "slide-player__icon",
|
|
480
493
|
strokeWidth: 2.25
|
|
@@ -487,10 +500,10 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
487
500
|
{
|
|
488
501
|
"aria-label": "Rewind",
|
|
489
502
|
className: "slide-player__action slide-player__action--prev",
|
|
490
|
-
disabled:
|
|
503
|
+
disabled: We,
|
|
491
504
|
onClick: Re,
|
|
492
505
|
type: "button",
|
|
493
|
-
children: /* @__PURE__ */ r.jsx(
|
|
506
|
+
children: /* @__PURE__ */ r.jsx(ir, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
494
507
|
}
|
|
495
508
|
),
|
|
496
509
|
/* @__PURE__ */ r.jsx(
|
|
@@ -500,38 +513,38 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
500
513
|
className: "slide-player__toggle slide-player__toggle--playback",
|
|
501
514
|
onClick: () => {
|
|
502
515
|
if (G) {
|
|
503
|
-
|
|
516
|
+
ve?.(!Y);
|
|
504
517
|
return;
|
|
505
518
|
}
|
|
506
519
|
const e = h.current;
|
|
507
|
-
if (!(
|
|
520
|
+
if (!(v || !e || !f)) {
|
|
508
521
|
if (a.current !== null) {
|
|
509
522
|
if (ee) {
|
|
510
|
-
|
|
523
|
+
l.current = !1, g.current = !0, a.current = null, y.current = !1, i(!1), t(!1), e.pause();
|
|
511
524
|
return;
|
|
512
525
|
}
|
|
513
|
-
T.current = "manual",
|
|
526
|
+
T.current = "manual", g.current = !1, l.current = !0, t(!0, "waitingForMoreAudio");
|
|
514
527
|
return;
|
|
515
528
|
}
|
|
516
|
-
if (!e.src &&
|
|
517
|
-
T.current = "manual",
|
|
529
|
+
if (!e.src && k.length > 0) {
|
|
530
|
+
T.current = "manual", g.current = !1, E(
|
|
518
531
|
Math.min(
|
|
519
|
-
|
|
520
|
-
|
|
532
|
+
S.current,
|
|
533
|
+
k.length - 1
|
|
521
534
|
),
|
|
522
535
|
"toggle"
|
|
523
536
|
);
|
|
524
537
|
return;
|
|
525
538
|
}
|
|
526
539
|
if (e.paused) {
|
|
527
|
-
T.current = "manual",
|
|
540
|
+
T.current = "manual", g.current = !1, l.current = !0, b("toggle-resume");
|
|
528
541
|
return;
|
|
529
542
|
}
|
|
530
|
-
|
|
543
|
+
l.current = !1, g.current = !0, e.pause();
|
|
531
544
|
}
|
|
532
545
|
},
|
|
533
546
|
type: "button",
|
|
534
|
-
children: Ke ? /* @__PURE__ */ r.jsx(
|
|
547
|
+
children: Ke ? /* @__PURE__ */ r.jsx(pr, {}) : /* @__PURE__ */ r.jsx(hr, {})
|
|
535
548
|
}
|
|
536
549
|
),
|
|
537
550
|
/* @__PURE__ */ r.jsx(
|
|
@@ -539,27 +552,27 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
539
552
|
{
|
|
540
553
|
"aria-label": "Forward",
|
|
541
554
|
className: "slide-player__action slide-player__action--next",
|
|
542
|
-
disabled:
|
|
555
|
+
disabled: Pe,
|
|
543
556
|
onClick: Te,
|
|
544
557
|
type: "button",
|
|
545
|
-
children: /* @__PURE__ */ r.jsx(
|
|
558
|
+
children: /* @__PURE__ */ r.jsx(or, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
546
559
|
}
|
|
547
560
|
),
|
|
548
561
|
le ? /* @__PURE__ */ r.jsx(
|
|
549
562
|
"button",
|
|
550
563
|
{
|
|
551
|
-
"aria-label":
|
|
564
|
+
"aria-label": se ? "Exit fullscreen" : "Enter fullscreen",
|
|
552
565
|
className: "slide-player__action slide-player__action--fullscreen",
|
|
553
566
|
onClick: le,
|
|
554
567
|
type: "button",
|
|
555
|
-
children:
|
|
556
|
-
|
|
568
|
+
children: se ? /* @__PURE__ */ r.jsx(
|
|
569
|
+
fr,
|
|
557
570
|
{
|
|
558
571
|
className: "slide-player__icon",
|
|
559
572
|
strokeWidth: 2.25
|
|
560
573
|
}
|
|
561
574
|
) : /* @__PURE__ */ r.jsx(
|
|
562
|
-
|
|
575
|
+
dr,
|
|
563
576
|
{
|
|
564
577
|
className: "slide-player__icon",
|
|
565
578
|
strokeWidth: 2.25
|
|
@@ -570,20 +583,20 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
570
583
|
] }),
|
|
571
584
|
/* @__PURE__ */ r.jsx("div", { className: "slide-player__separator" }),
|
|
572
585
|
/* @__PURE__ */ r.jsxs("div", { className: "slide-player__group", children: [
|
|
573
|
-
|
|
586
|
+
ge.map((e, n) => /* @__PURE__ */ r.jsx(Ie.Fragment, { children: e }, `custom-action-${n}`)),
|
|
574
587
|
/* @__PURE__ */ r.jsx(
|
|
575
588
|
"button",
|
|
576
589
|
{
|
|
577
590
|
"aria-label": "Notes",
|
|
578
|
-
className:
|
|
591
|
+
className: ke(
|
|
579
592
|
"slide-player__action slide-player__action--notes",
|
|
580
593
|
Z && "slide-player__action--active"
|
|
581
594
|
),
|
|
582
|
-
disabled: !
|
|
583
|
-
onClick:
|
|
595
|
+
disabled: !Ue,
|
|
596
|
+
onClick: Fe,
|
|
584
597
|
type: "button",
|
|
585
598
|
children: /* @__PURE__ */ r.jsx(
|
|
586
|
-
|
|
599
|
+
mr,
|
|
587
600
|
{
|
|
588
601
|
className: "slide-player__icon",
|
|
589
602
|
strokeWidth: 2.25
|
|
@@ -595,9 +608,9 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
595
608
|
] })
|
|
596
609
|
] }) : null
|
|
597
610
|
] });
|
|
598
|
-
},
|
|
599
|
-
|
|
611
|
+
}, yr = er(gr);
|
|
612
|
+
yr.displayName = "Player";
|
|
600
613
|
export {
|
|
601
|
-
|
|
614
|
+
yr as default
|
|
602
615
|
};
|
|
603
616
|
//# sourceMappingURL=Player.es.js.map
|