markdown-flow-ui 0.1.125 → 0.1.126
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.cjs8.js +1 -1
- package/dist/_virtual/index.cjs9.js +1 -1
- package/dist/_virtual/index.es8.js +2 -2
- package/dist/_virtual/index.es9.js +2 -2
- 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 +2 -0
- package/dist/components/Slide/Player.es.js +112 -107
- 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 +167 -165
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/components/Slide/useWakePlayerFromIframe.cjs.js +1 -1
- package/dist/components/Slide/useWakePlayerFromIframe.cjs.js.map +1 -1
- package/dist/components/Slide/useWakePlayerFromIframe.d.ts +3 -1
- package/dist/components/Slide/useWakePlayerFromIframe.es.js +42 -39
- package/dist/components/Slide/useWakePlayerFromIframe.es.js.map +1 -1
- package/dist/components/Slide/utils/playerNavigationContext.cjs.js +2 -0
- package/dist/components/Slide/utils/playerNavigationContext.cjs.js.map +1 -0
- package/dist/components/Slide/utils/playerNavigationContext.d.ts +7 -0
- package/dist/components/Slide/utils/playerNavigationContext.es.js +9 -0
- package/dist/components/Slide/utils/playerNavigationContext.es.js.map +1 -0
- package/dist/components/Slide/utils/playerNavigationContext.test.d.ts +1 -0
- package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs.js +1 -1
- package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
- package/dist/node_modules/classnames/index.cjs.js +1 -1
- package/dist/node_modules/classnames/index.es.js +1 -1
- package/package.json +1 -1
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
import { j as n } from "../../_virtual/jsx-runtime.es.js";
|
|
2
|
-
import
|
|
2
|
+
import Rr, { memo as Er, useId as Cr, useContext as Nr, useRef as c, useState as nr, useMemo as G, useCallback as t, useEffect as m } from "react";
|
|
3
3
|
import { cn as ur } from "../../lib/utils.es.js";
|
|
4
|
-
import
|
|
5
|
-
import { DEFAULT_SLIDE_PLAYER_TEXTS as
|
|
6
|
-
import { DEFAULT_MOBILE_VIEW_MODE as
|
|
7
|
-
import { hasReachedAudioEnd as
|
|
4
|
+
import vr from "./MobilePlayerSettingsSheet.es.js";
|
|
5
|
+
import { DEFAULT_SLIDE_PLAYER_TEXTS as Tr } from "./constants.es.js";
|
|
6
|
+
import { DEFAULT_MOBILE_VIEW_MODE as Kr } from "./utils/mobileScreenMode.es.js";
|
|
7
|
+
import { hasReachedAudioEnd as Pr } from "./utils/audioCompletion.es.js";
|
|
8
8
|
import { PlayerKeyboardShortcutContext as Ur } from "./utils/playerKeyboardShortcutContext.es.js";
|
|
9
|
-
import { activatePlayerKeyboardShortcutOwner as Fr, registerPlayerKeyboardShortcutOwner as
|
|
10
|
-
import { resolveAudioPlaybackSourceType as
|
|
11
|
-
import { shouldKeepPlayingAfterNavigation as
|
|
12
|
-
import { toPlayerCustomActionList as
|
|
9
|
+
import { activatePlayerKeyboardShortcutOwner as Fr, registerPlayerKeyboardShortcutOwner as Wr, isActivePlayerKeyboardShortcutOwner as Or, getPlayerKeyboardShortcutAction as Br, shouldIgnorePlayerKeyboardShortcutEvent as Vr } from "./utils/playerKeyboardShortcuts.es.js";
|
|
10
|
+
import { resolveAudioPlaybackSourceType as Hr } from "./utils/playbackSource.es.js";
|
|
11
|
+
import { shouldKeepPlayingAfterNavigation as $r } from "./utils/playbackPreference.es.js";
|
|
12
|
+
import { toPlayerCustomActionList as Zr } from "./utils/playerCustomActions.es.js";
|
|
13
|
+
import { suppressPlayerControlsWakeAfterNavigation as ar } from "./utils/playerNavigationContext.es.js";
|
|
13
14
|
/* empty css */
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
const
|
|
24
|
-
if (typeof window > "u" || !k ||
|
|
15
|
+
import qr from "../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
|
|
16
|
+
import zr from "../../node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
|
|
17
|
+
import Yr from "../../node_modules/lucide-react/dist/esm/icons/captions.es.js";
|
|
18
|
+
import Dr from "../../node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
|
|
19
|
+
import Xr from "../../node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js";
|
|
20
|
+
import Gr from "../../node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js";
|
|
21
|
+
import Jr from "../../node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
|
|
22
|
+
import Qr from "../../node_modules/lucide-react/dist/esm/icons/maximize.es.js";
|
|
23
|
+
import Ir from "../../node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js";
|
|
24
|
+
const sr = /* @__PURE__ */ new Map(), lr = (k) => {
|
|
25
|
+
if (typeof window > "u" || !k || sr.has(k))
|
|
25
26
|
return;
|
|
26
27
|
const j = window.document.createElement("audio");
|
|
27
|
-
j.preload = "auto", j.setAttribute("playsinline", "true"), j.src = k, j.load(),
|
|
28
|
-
},
|
|
28
|
+
j.preload = "auto", j.setAttribute("playsinline", "true"), j.src = k, j.load(), sr.set(k, j);
|
|
29
|
+
}, et = () => /* @__PURE__ */ n.jsxs(
|
|
29
30
|
"svg",
|
|
30
31
|
{
|
|
31
32
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -44,7 +45,7 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
44
45
|
/* @__PURE__ */ n.jsx("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
|
|
45
46
|
]
|
|
46
47
|
}
|
|
47
|
-
),
|
|
48
|
+
), rt = () => /* @__PURE__ */ n.jsxs(
|
|
48
49
|
"svg",
|
|
49
50
|
{
|
|
50
51
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -70,7 +71,7 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
70
71
|
playback: "Space",
|
|
71
72
|
previous: "←",
|
|
72
73
|
subtitle: "C"
|
|
73
|
-
},
|
|
74
|
+
}, tt = (k, j) => k ? `${k} (${j})` : j, nt = ({
|
|
74
75
|
audioList: k = [],
|
|
75
76
|
className: j,
|
|
76
77
|
currentAudioIndex: h = -1,
|
|
@@ -87,8 +88,8 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
87
88
|
onNext: ae,
|
|
88
89
|
onFullscreen: I,
|
|
89
90
|
isFullscreen: Le = !1,
|
|
90
|
-
mobileViewMode:
|
|
91
|
-
settingsPortalContainer:
|
|
91
|
+
mobileViewMode: cr = Kr,
|
|
92
|
+
settingsPortalContainer: or,
|
|
92
93
|
onMobileViewModeChange: Ae,
|
|
93
94
|
onEnded: je,
|
|
94
95
|
onAutoAdvanceToggle: Re,
|
|
@@ -99,39 +100,39 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
99
100
|
prevDisabled: he = !1,
|
|
100
101
|
nextDisabled: ye = !1,
|
|
101
102
|
showControls: be = !0,
|
|
102
|
-
enableKeyboardShortcuts:
|
|
103
|
+
enableKeyboardShortcuts: ir = !0,
|
|
103
104
|
customActions: Ee,
|
|
104
105
|
customActionContext: Ce,
|
|
105
106
|
texts: Ne,
|
|
106
107
|
onFocusCapture: ve,
|
|
107
108
|
onPointerDown: Te,
|
|
108
|
-
...
|
|
109
|
+
...fr
|
|
109
110
|
}) => {
|
|
110
|
-
const
|
|
111
|
+
const dr = Cr(), Ke = Nr(Ur), y = c(null), Pe = c(ee), P = c(null), Ue = c(null), R = c(0), o = c(null), le = c(void 0), v = c([]), ce = c(
|
|
111
112
|
N ? O : g
|
|
112
|
-
), re = c(!1),
|
|
113
|
+
), re = c(!1), Fe = c(!1), b = c(!1), U = c(null), q = c(null), _ = c(!1), s = c(!1), S = c(null), E = c(!1), B = c(null), Se = c(0), F = c("unknown"), [oe, f] = nr(g), [We, z] = nr(!1), V = Ke?.ownerId ?? dr, T = ir && (Ke?.enabled ?? !0), d = h >= 0 ? k[h] : void 0, H = d?.audioUrl, M = G(
|
|
113
114
|
() => [...d?.audioSegments ?? []].sort(
|
|
114
115
|
(e, r) => e.segment_index - r.segment_index
|
|
115
116
|
),
|
|
116
117
|
[d?.audioSegments]
|
|
117
118
|
), Oe = G(
|
|
118
|
-
() =>
|
|
119
|
+
() => Zr(Ee, Ce),
|
|
119
120
|
[Ce, Ee]
|
|
120
|
-
), Be = Oe.length + 5,
|
|
121
|
+
), Be = Oe.length + 5, mr = G(
|
|
121
122
|
() => ({
|
|
122
123
|
"--slide-player-mobile-control-count": String(Be)
|
|
123
124
|
}),
|
|
124
125
|
[Be]
|
|
125
126
|
), l = G(
|
|
126
127
|
() => ({
|
|
127
|
-
...
|
|
128
|
+
...Tr,
|
|
128
129
|
...Ne
|
|
129
130
|
}),
|
|
130
131
|
[Ne]
|
|
131
|
-
), ge = G(() => d ? d.audioKey ?? `${String(d.sequenceNumber ?? "none")}:${String(d.audioUrl ?? "")}` : "none", [d]),
|
|
132
|
+
), ge = G(() => d ? d.audioKey ?? `${String(d.sequenceNumber ?? "none")}:${String(d.audioUrl ?? "")}` : "none", [d]), pr = N ? O : oe, Ve = N ? O ? l.pauseAutoplayLabel : l.playAutoplayLabel : oe ? l.pauseLabel : l.playLabel, He = Le ? l.exitFullscreenLabel : l.enterFullscreenLabel, Y = t(
|
|
132
133
|
(e, r, a) => ({
|
|
133
134
|
ariaKeyShortcuts: T ? a : void 0,
|
|
134
|
-
title: T ?
|
|
135
|
+
title: T ? tt(e, r) : e
|
|
135
136
|
}),
|
|
136
137
|
[T]
|
|
137
138
|
), $e = Y(
|
|
@@ -160,12 +161,12 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
160
161
|
"n"
|
|
161
162
|
), ie = t(() => {
|
|
162
163
|
T && Fr(V);
|
|
163
|
-
}, [V, T]),
|
|
164
|
+
}, [V, T]), hr = t(
|
|
164
165
|
(e) => {
|
|
165
166
|
ie(), Te?.(e);
|
|
166
167
|
},
|
|
167
168
|
[ie, Te]
|
|
168
|
-
),
|
|
169
|
+
), yr = t(
|
|
169
170
|
(e) => {
|
|
170
171
|
ie(), ve?.(e);
|
|
171
172
|
},
|
|
@@ -178,16 +179,16 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
178
179
|
}, [g, O, N]), m(() => {
|
|
179
180
|
be || z(!1);
|
|
180
181
|
}, [be]), m(() => {
|
|
181
|
-
!
|
|
182
|
+
!Pe.current && ee && z(!1), Pe.current = ee;
|
|
182
183
|
}, [ee]), m(() => {
|
|
183
184
|
v.current = M;
|
|
184
185
|
}, [M]), m(() => {
|
|
185
186
|
const e = d?.audioUrl, r = h >= 0 ? k[h + 1]?.audioUrl : void 0;
|
|
186
|
-
|
|
187
|
+
lr(e), lr(r);
|
|
187
188
|
}, [k, d?.audioUrl, h]);
|
|
188
189
|
const u = t(
|
|
189
190
|
(e, r = null) => {
|
|
190
|
-
|
|
191
|
+
Fe.current === e && (!e || r === null) || (Fe.current = e, xe?.({
|
|
191
192
|
loading: e,
|
|
192
193
|
reason: e ? r : null
|
|
193
194
|
}));
|
|
@@ -201,11 +202,11 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
201
202
|
), te = t(() => N ? {
|
|
202
203
|
shouldContinuePlayback: ce.current
|
|
203
204
|
} : {
|
|
204
|
-
shouldContinuePlayback:
|
|
205
|
+
shouldContinuePlayback: $r({
|
|
205
206
|
defaultPlaying: ce.current,
|
|
206
207
|
isPausedByUser: b.current
|
|
207
208
|
})
|
|
208
|
-
}, [N]), Xe = t((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), W = t(() => g && !K && !b.current &&
|
|
209
|
+
}, [N]), Xe = t((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), W = t(() => g && !K && !b.current && F.current !== "blocked", [g, K]), Ge = t((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), Je = t(() => {
|
|
209
210
|
const e = o.current;
|
|
210
211
|
return e == null || e <= 0 ? 0 : v.current.slice(0, e).reduce(
|
|
211
212
|
(r, a) => r + Math.max(Number(a.duration_ms ?? 0), 0),
|
|
@@ -216,7 +217,7 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
216
217
|
0
|
|
217
218
|
), []), Qe = t(() => {
|
|
218
219
|
const e = y.current;
|
|
219
|
-
return e ?
|
|
220
|
+
return e ? U.current === "segment" ? Z(R.current) + Math.max(e.currentTime, 0) * 1e3 : S.current !== null && e.readyState === 0 ? S.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : o.current != null ? Z(o.current) : 0;
|
|
220
221
|
}, [Z]), w = t(
|
|
221
222
|
(e) => {
|
|
222
223
|
const r = Math.max(e, 0);
|
|
@@ -242,7 +243,7 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
242
243
|
B.current = window.requestAnimationFrame(e);
|
|
243
244
|
}, [i]), D = t(() => {
|
|
244
245
|
const e = y.current;
|
|
245
|
-
e && (p(), s.current = !1, b.current = !1, re.current = !1,
|
|
246
|
+
e && (p(), s.current = !1, b.current = !1, re.current = !1, U.current = null, S.current = null, _.current = !1, E.current = !1, q.current = null, e.pause(), e.removeAttribute("src"), e.load(), P.current = null, R.current = 0, o.current = null, w(0), f(!1), u(!1));
|
|
246
247
|
}, [w, p, u]), L = t(
|
|
247
248
|
(e) => {
|
|
248
249
|
const r = y.current;
|
|
@@ -250,9 +251,9 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
250
251
|
return !1;
|
|
251
252
|
const a = r.play();
|
|
252
253
|
return a && typeof a.then == "function" && a.then(() => {
|
|
253
|
-
|
|
254
|
+
F.current === "unknown" && (F.current = "auto"), s.current = !1, E.current = !1;
|
|
254
255
|
}).catch((x) => {
|
|
255
|
-
|
|
256
|
+
F.current === "unknown" && Xe(x) && (F.current = "blocked", s.current = !1, u(!1)), E.current = !1, f(!1);
|
|
256
257
|
}), !0;
|
|
257
258
|
},
|
|
258
259
|
[Xe, u]
|
|
@@ -265,8 +266,8 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
265
266
|
R.current = e, o.current = null, _.current = !1, E.current = !0, q.current = "segment", w(Z(e));
|
|
266
267
|
const de = W();
|
|
267
268
|
s.current = de, u(!1);
|
|
268
|
-
const
|
|
269
|
-
return
|
|
269
|
+
const jr = P.current !== A;
|
|
270
|
+
return U.current = "segment", jr && (a.pause(), a.removeAttribute("src"), a.load(), P.current = A, a.src = A, a.load()), S.current = 0, a.readyState > 0 && (a.currentTime = 0, S.current = null), de ? L(`start-segment:${r}`) : (s.current = !1, E.current = !1, a.pause(), f(!1), !0);
|
|
270
271
|
},
|
|
271
272
|
[
|
|
272
273
|
W,
|
|
@@ -290,7 +291,7 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
290
291
|
), fe = t(
|
|
291
292
|
(e) => {
|
|
292
293
|
const r = y.current;
|
|
293
|
-
return !r ||
|
|
294
|
+
return !r || U.current !== "url" || !Pr({
|
|
294
295
|
currentTimeSeconds: Math.max(r.currentTime, 0),
|
|
295
296
|
durationSeconds: r.duration
|
|
296
297
|
}) ? !1 : (s.current = !1, r.pause(), X(e), !0);
|
|
@@ -316,9 +317,9 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
316
317
|
u
|
|
317
318
|
]);
|
|
318
319
|
m(() => {
|
|
319
|
-
if (
|
|
320
|
+
if (Ue.current === ge)
|
|
320
321
|
return;
|
|
321
|
-
|
|
322
|
+
Ue.current = ge, R.current = 0, o.current = null, _.current = !1, b.current = !1, re.current = !1, s.current = !1, E.current = !1, U.current = null, q.current = null, P.current = null, p(), w(0), u(!1);
|
|
322
323
|
const e = y.current;
|
|
323
324
|
e && (e.pause(), e.removeAttribute("src"), e.load(), f(!1));
|
|
324
325
|
}, [
|
|
@@ -345,7 +346,7 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
345
346
|
s.current = !0, u(!0, "waitingForMoreAudio");
|
|
346
347
|
return;
|
|
347
348
|
}
|
|
348
|
-
if (!
|
|
349
|
+
if (!P.current && v.current.length > 0) {
|
|
349
350
|
C(
|
|
350
351
|
Math.min(
|
|
351
352
|
R.current,
|
|
@@ -375,18 +376,18 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
375
376
|
s.current = !1, u(!1), e.pause(), f(!1);
|
|
376
377
|
return;
|
|
377
378
|
}
|
|
378
|
-
const r =
|
|
379
|
-
activeSourceType:
|
|
379
|
+
const r = Hr({
|
|
380
|
+
activeSourceType: U.current,
|
|
380
381
|
hasAudioUrl: !!H,
|
|
381
382
|
segmentCount: M.length,
|
|
382
383
|
preferredSourceType: q.current,
|
|
383
384
|
waitingSegmentIndex: o.current
|
|
384
385
|
});
|
|
385
386
|
if (r && q.current !== r && (q.current = r), r === "url" && H) {
|
|
386
|
-
const a =
|
|
387
|
+
const a = P.current !== H, x = W();
|
|
387
388
|
if (a) {
|
|
388
389
|
const A = o.current !== null ? Je() : 0;
|
|
389
|
-
e.pause(), e.removeAttribute("src"), e.load(),
|
|
390
|
+
e.pause(), e.removeAttribute("src"), e.load(), P.current = H, U.current = "url", e.src = H, e.load(), S.current = A, w(A * 1e3), e.readyState > 0 && (e.currentTime = A, S.current = null);
|
|
390
391
|
}
|
|
391
392
|
if (s.current = x, _.current = !1, E.current = !1, u(!1), !x) {
|
|
392
393
|
s.current = !1, e.pause(), f(!1);
|
|
@@ -415,7 +416,7 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
415
416
|
D();
|
|
416
417
|
return;
|
|
417
418
|
}
|
|
418
|
-
if (r === "segment" && !
|
|
419
|
+
if (r === "segment" && !P.current) {
|
|
419
420
|
C(
|
|
420
421
|
Math.min(
|
|
421
422
|
R.current,
|
|
@@ -449,16 +450,16 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
449
450
|
Je,
|
|
450
451
|
u
|
|
451
452
|
]), m(() => D, [D]), m(() => p, [p]);
|
|
452
|
-
const
|
|
453
|
+
const br = t(() => {
|
|
453
454
|
i(), Ie(), f(!0), u(!1), Me?.();
|
|
454
455
|
}, [
|
|
455
456
|
Me,
|
|
456
457
|
Ie,
|
|
457
458
|
i,
|
|
458
459
|
u
|
|
459
|
-
]),
|
|
460
|
+
]), Sr = t(() => {
|
|
460
461
|
_.current || E.current || (p(), i(), f(!1));
|
|
461
|
-
}, [h, p, i]),
|
|
462
|
+
}, [h, p, i]), gr = t(() => {
|
|
462
463
|
const e = y.current;
|
|
463
464
|
e && S.current !== null && (e.currentTime = S.current, S.current = null), i(), !fe("canplay-seek-finished") && (!s.current || !g || L("canplay"));
|
|
464
465
|
}, [
|
|
@@ -467,14 +468,14 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
467
468
|
fe,
|
|
468
469
|
i,
|
|
469
470
|
L
|
|
470
|
-
]),
|
|
471
|
+
]), _r = t(() => {
|
|
471
472
|
const e = y.current;
|
|
472
473
|
e && S.current !== null && (e.currentTime = S.current, S.current = null), i(), fe("metadata-seek-finished");
|
|
473
|
-
}, [h, fe, i]),
|
|
474
|
+
}, [h, fe, i]), wr = t(() => {
|
|
474
475
|
i();
|
|
475
|
-
}, [i]),
|
|
476
|
+
}, [i]), xr = t(() => {
|
|
476
477
|
_.current || u(!0, "loadingAudio");
|
|
477
|
-
}, [u]),
|
|
478
|
+
}, [u]), kr = t(() => {
|
|
478
479
|
if (_.current) {
|
|
479
480
|
u(!0, "waitingForMoreAudio");
|
|
480
481
|
return;
|
|
@@ -482,16 +483,16 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
482
483
|
u(!0, "loadingAudio");
|
|
483
484
|
}, [u]), rr = t(() => {
|
|
484
485
|
i();
|
|
485
|
-
}, [i]),
|
|
486
|
-
const e =
|
|
486
|
+
}, [i]), Mr = t(() => {
|
|
487
|
+
const e = U.current === "url" || v.current.length === 0;
|
|
487
488
|
if (p(), E.current = !1, e) {
|
|
488
489
|
X("url-ended");
|
|
489
490
|
return;
|
|
490
491
|
}
|
|
491
492
|
er();
|
|
492
|
-
}, [X, er, p]),
|
|
493
|
+
}, [X, er, p]), Lr = t(() => {
|
|
493
494
|
p(), i(), f(!1), u(!1);
|
|
494
|
-
}, [p, i, u]),
|
|
495
|
+
}, [p, i, u]), Ar = t(
|
|
495
496
|
(e) => {
|
|
496
497
|
Ae?.(e), z(!1);
|
|
497
498
|
},
|
|
@@ -502,13 +503,13 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
502
503
|
return $(r), Re?.(r), !0;
|
|
503
504
|
}
|
|
504
505
|
const e = y.current;
|
|
505
|
-
return K || !e || !d ? !1 : o.current !== null ? oe ? ($(!1), s.current = !1, b.current = !0, o.current = null, _.current = !1, f(!1), u(!1), e.pause(), !0) : ($(!0),
|
|
506
|
+
return K || !e || !d ? !1 : o.current !== null ? oe ? ($(!1), s.current = !1, b.current = !0, o.current = null, _.current = !1, f(!1), u(!1), e.pause(), !0) : ($(!0), F.current = "manual", b.current = !1, s.current = !0, u(!0, "waitingForMoreAudio"), !0) : !e.src && M.length > 0 ? ($(!0), F.current = "manual", b.current = !1, C(
|
|
506
507
|
Math.min(
|
|
507
508
|
R.current,
|
|
508
509
|
M.length - 1
|
|
509
510
|
),
|
|
510
511
|
"toggle"
|
|
511
|
-
), !0) : e.paused ? ($(!0),
|
|
512
|
+
), !0) : e.paused ? ($(!0), F.current = "manual", b.current = !1, s.current = !0, L("toggle-resume"), !0) : ($(!1), s.current = !1, b.current = !0, e.pause(), !0);
|
|
512
513
|
}, [
|
|
513
514
|
d,
|
|
514
515
|
M.length,
|
|
@@ -524,14 +525,18 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
524
525
|
]);
|
|
525
526
|
m(() => {
|
|
526
527
|
if (T)
|
|
527
|
-
return
|
|
528
|
+
return Wr(V);
|
|
528
529
|
}, [V, T]);
|
|
529
530
|
const we = G(
|
|
530
531
|
() => ({
|
|
531
532
|
fullscreen: () => I ? (I(), !0) : !1,
|
|
532
533
|
interaction: () => se ? (me && se(), !0) : !1,
|
|
533
|
-
next: () => ae ? (ye || ae(
|
|
534
|
-
|
|
534
|
+
next: () => ae ? (ye || ae(
|
|
535
|
+
ar(te())
|
|
536
|
+
), !0) : !1,
|
|
537
|
+
previous: () => ue ? (he || ue(
|
|
538
|
+
ar(te())
|
|
539
|
+
), !0) : !1,
|
|
535
540
|
subtitle: () => Q ? (Q(), !0) : !1,
|
|
536
541
|
togglePlayback: () => (_e(), !0)
|
|
537
542
|
}),
|
|
@@ -554,10 +559,10 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
554
559
|
if (!T || typeof document > "u")
|
|
555
560
|
return;
|
|
556
561
|
const e = (r) => {
|
|
557
|
-
if (!
|
|
562
|
+
if (!Or(V))
|
|
558
563
|
return;
|
|
559
|
-
const a =
|
|
560
|
-
if (!a ||
|
|
564
|
+
const a = Br(r);
|
|
565
|
+
if (!a || Vr(r, a))
|
|
561
566
|
return;
|
|
562
567
|
let x = !1;
|
|
563
568
|
const A = tr.current[a];
|
|
@@ -571,11 +576,11 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
571
576
|
}, [ne]), /* @__PURE__ */ n.jsxs(
|
|
572
577
|
"div",
|
|
573
578
|
{
|
|
574
|
-
...
|
|
579
|
+
...fr,
|
|
575
580
|
"data-slide-player-shortcut-owner": V,
|
|
576
581
|
className: ur("slide-player", j),
|
|
577
|
-
onFocusCapture:
|
|
578
|
-
onPointerDown:
|
|
582
|
+
onFocusCapture: yr,
|
|
583
|
+
onPointerDown: hr,
|
|
579
584
|
children: [
|
|
580
585
|
/* @__PURE__ */ n.jsx(
|
|
581
586
|
"audio",
|
|
@@ -583,24 +588,24 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
583
588
|
ref: y,
|
|
584
589
|
preload: "auto",
|
|
585
590
|
playsInline: !0,
|
|
586
|
-
onLoadStart:
|
|
587
|
-
onLoadedMetadata:
|
|
588
|
-
onCanPlay:
|
|
589
|
-
onPlay:
|
|
590
|
-
onPause:
|
|
591
|
-
onWaiting:
|
|
591
|
+
onLoadStart: xr,
|
|
592
|
+
onLoadedMetadata: _r,
|
|
593
|
+
onCanPlay: gr,
|
|
594
|
+
onPlay: br,
|
|
595
|
+
onPause: Sr,
|
|
596
|
+
onWaiting: kr,
|
|
592
597
|
onSeeking: rr,
|
|
593
598
|
onSeeked: rr,
|
|
594
|
-
onTimeUpdate:
|
|
595
|
-
onEnded:
|
|
596
|
-
onError:
|
|
599
|
+
onTimeUpdate: wr,
|
|
600
|
+
onEnded: Mr,
|
|
601
|
+
onError: Lr
|
|
597
602
|
}
|
|
598
603
|
),
|
|
599
604
|
be ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
600
605
|
/* @__PURE__ */ n.jsx(
|
|
601
|
-
|
|
606
|
+
vr,
|
|
602
607
|
{
|
|
603
|
-
container:
|
|
608
|
+
container: or,
|
|
604
609
|
labels: {
|
|
605
610
|
closeSettings: l.closeSettingsLabel,
|
|
606
611
|
fullscreen: l.fullscreenLabel,
|
|
@@ -616,12 +621,12 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
616
621
|
onOpenChange: z,
|
|
617
622
|
onSubtitleToggle: Q ?? (() => {
|
|
618
623
|
}),
|
|
619
|
-
onViewModeChange:
|
|
624
|
+
onViewModeChange: Ar,
|
|
620
625
|
open: We,
|
|
621
|
-
viewMode:
|
|
626
|
+
viewMode: cr
|
|
622
627
|
}
|
|
623
628
|
),
|
|
624
|
-
/* @__PURE__ */ n.jsxs("div", { className: "slide-player__controls", style:
|
|
629
|
+
/* @__PURE__ */ n.jsxs("div", { className: "slide-player__controls", style: mr, children: [
|
|
625
630
|
/* @__PURE__ */ n.jsxs("div", { className: "slide-player__group", children: [
|
|
626
631
|
/* @__PURE__ */ n.jsx(
|
|
627
632
|
"button",
|
|
@@ -635,7 +640,7 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
635
640
|
},
|
|
636
641
|
type: "button",
|
|
637
642
|
children: /* @__PURE__ */ n.jsx(
|
|
638
|
-
|
|
643
|
+
qr,
|
|
639
644
|
{
|
|
640
645
|
className: "slide-player__icon",
|
|
641
646
|
strokeWidth: 2.25
|
|
@@ -649,7 +654,7 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
649
654
|
"aria-label": l.volumeAriaLabel,
|
|
650
655
|
className: "hidden",
|
|
651
656
|
type: "button",
|
|
652
|
-
children: /* @__PURE__ */ n.jsx(
|
|
657
|
+
children: /* @__PURE__ */ n.jsx(zr, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
653
658
|
}
|
|
654
659
|
),
|
|
655
660
|
/* @__PURE__ */ n.jsx(
|
|
@@ -662,8 +667,8 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
662
667
|
onClick: Q,
|
|
663
668
|
title: $e.title,
|
|
664
669
|
type: "button",
|
|
665
|
-
children: pe ? /* @__PURE__ */ n.jsx(
|
|
666
|
-
|
|
670
|
+
children: pe ? /* @__PURE__ */ n.jsx(Yr, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ n.jsx(
|
|
671
|
+
Dr,
|
|
667
672
|
{
|
|
668
673
|
className: "slide-player__icon",
|
|
669
674
|
strokeWidth: 2.25
|
|
@@ -683,7 +688,7 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
683
688
|
},
|
|
684
689
|
title: Ze.title,
|
|
685
690
|
type: "button",
|
|
686
|
-
children: /* @__PURE__ */ n.jsx(
|
|
691
|
+
children: /* @__PURE__ */ n.jsx(Xr, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
687
692
|
}
|
|
688
693
|
),
|
|
689
694
|
/* @__PURE__ */ n.jsx(
|
|
@@ -697,7 +702,7 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
697
702
|
},
|
|
698
703
|
title: qe.title,
|
|
699
704
|
type: "button",
|
|
700
|
-
children:
|
|
705
|
+
children: pr ? /* @__PURE__ */ n.jsx(et, {}) : /* @__PURE__ */ n.jsx(rt, {})
|
|
701
706
|
}
|
|
702
707
|
),
|
|
703
708
|
/* @__PURE__ */ n.jsx(
|
|
@@ -712,7 +717,7 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
712
717
|
},
|
|
713
718
|
title: ze.title,
|
|
714
719
|
type: "button",
|
|
715
|
-
children: /* @__PURE__ */ n.jsx(
|
|
720
|
+
children: /* @__PURE__ */ n.jsx(Gr, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
716
721
|
}
|
|
717
722
|
),
|
|
718
723
|
I ? /* @__PURE__ */ n.jsx(
|
|
@@ -725,13 +730,13 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
725
730
|
title: Ye.title,
|
|
726
731
|
type: "button",
|
|
727
732
|
children: Le ? /* @__PURE__ */ n.jsx(
|
|
728
|
-
|
|
733
|
+
Jr,
|
|
729
734
|
{
|
|
730
735
|
className: "slide-player__icon",
|
|
731
736
|
strokeWidth: 2.25
|
|
732
737
|
}
|
|
733
738
|
) : /* @__PURE__ */ n.jsx(
|
|
734
|
-
|
|
739
|
+
Qr,
|
|
735
740
|
{
|
|
736
741
|
className: "slide-player__icon",
|
|
737
742
|
strokeWidth: 2.25
|
|
@@ -742,7 +747,7 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
742
747
|
] }),
|
|
743
748
|
/* @__PURE__ */ n.jsx("div", { className: "slide-player__separator" }),
|
|
744
749
|
/* @__PURE__ */ n.jsxs("div", { className: "slide-player__group", children: [
|
|
745
|
-
Oe.map((e, r) => /* @__PURE__ */ n.jsx(
|
|
750
|
+
Oe.map((e, r) => /* @__PURE__ */ n.jsx(Rr.Fragment, { children: e }, `custom-action-${r}`)),
|
|
746
751
|
/* @__PURE__ */ n.jsx(
|
|
747
752
|
"button",
|
|
748
753
|
{
|
|
@@ -757,7 +762,7 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
757
762
|
title: De.title,
|
|
758
763
|
type: "button",
|
|
759
764
|
children: /* @__PURE__ */ n.jsx(
|
|
760
|
-
|
|
765
|
+
Ir,
|
|
761
766
|
{
|
|
762
767
|
className: "slide-player__icon",
|
|
763
768
|
strokeWidth: 2.25
|
|
@@ -771,9 +776,9 @@ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
|
|
|
771
776
|
]
|
|
772
777
|
}
|
|
773
778
|
);
|
|
774
|
-
},
|
|
775
|
-
|
|
779
|
+
}, ut = Er(nt);
|
|
780
|
+
ut.displayName = "Player";
|
|
776
781
|
export {
|
|
777
|
-
|
|
782
|
+
ut as default
|
|
778
783
|
};
|
|
779
784
|
//# sourceMappingURL=Player.es.js.map
|