markdown-flow-ui 0.1.100-beta.4 → 0.1.100-beta.40
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/Documents/ai-shifu/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/Documents/ai-shifu/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/Documents/ai-shifu/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/Documents/ai-shifu/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/Documents/ai-shifu/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/Documents/ai-shifu/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/Documents/ai-shifu/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/Documents/ai-shifu/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/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-custom-variable.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-custom-variable.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-interaction.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-interaction.es.js +1 -1
- package/dist/_virtual/index.cjs3.js +1 -1
- package/dist/_virtual/index.cjs4.js +1 -1
- package/dist/_virtual/index.es3.js +4 -5
- package/dist/_virtual/index.es3.js.map +1 -1
- package/dist/_virtual/index.es4.js +5 -4
- package/dist/_virtual/index.es4.js.map +1 -1
- package/dist/assets/markdown-flow-ui.css +1 -1
- package/dist/components/ContentRender/ContentRender.cjs.js +2 -2
- package/dist/components/ContentRender/ContentRender.cjs.js.map +1 -1
- package/dist/components/ContentRender/ContentRender.d.ts +13 -10
- package/dist/components/ContentRender/ContentRender.es.js +184 -160
- package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
- package/dist/components/ContentRender/IframeSandbox.cjs.js +5 -4
- package/dist/components/ContentRender/IframeSandbox.cjs.js.map +1 -1
- package/dist/components/ContentRender/IframeSandbox.d.ts +1 -0
- package/dist/components/ContentRender/IframeSandbox.es.js +307 -210
- package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -1
- package/dist/components/ContentRender/SandboxApp.cjs.js +3 -3
- package/dist/components/ContentRender/SandboxApp.cjs.js.map +1 -1
- package/dist/components/ContentRender/SandboxApp.d.ts +4 -0
- package/dist/components/ContentRender/SandboxApp.es.js +87 -80
- package/dist/components/ContentRender/SandboxApp.es.js.map +1 -1
- package/dist/components/ContentRender/index.cjs.js +1 -1
- package/dist/components/ContentRender/index.es.js +5 -6
- package/dist/components/ContentRender/plugins/CustomVariable.cjs.js +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.cjs.js.map +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.es.js +68 -64
- package/dist/components/ContentRender/plugins/CustomVariable.es.js.map +1 -1
- package/dist/components/MarkdownFlow/MarkdownFlow.cjs.js +1 -1
- package/dist/components/MarkdownFlow/MarkdownFlow.cjs.js.map +1 -1
- package/dist/components/MarkdownFlow/MarkdownFlow.d.ts +3 -0
- package/dist/components/MarkdownFlow/MarkdownFlow.es.js +21 -18
- package/dist/components/MarkdownFlow/MarkdownFlow.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 +3 -2
- package/dist/components/Slide/Player.es.js +228 -170
- 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 +10 -0
- package/dist/components/Slide/Slide.es.js +422 -270
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/components/Slide/Slide.stories.d.ts +27 -1
- package/dist/components/Slide/index.d.ts +3 -3
- package/dist/components/Slide/types.d.ts +5 -6
- 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 +4 -1
- package/dist/components/Slide/useSlide.es.js +125 -83
- package/dist/components/Slide/useSlide.es.js.map +1 -1
- package/dist/components/Slide/useWakePlayerFromIframe.cjs.js +2 -0
- package/dist/components/Slide/useWakePlayerFromIframe.cjs.js.map +1 -0
- package/dist/components/Slide/useWakePlayerFromIframe.d.ts +7 -0
- package/dist/components/Slide/useWakePlayerFromIframe.es.js +89 -0
- package/dist/components/Slide/useWakePlayerFromIframe.es.js.map +1 -0
- package/dist/components/Slide/utils/playerCustomActions.cjs.js +2 -0
- package/dist/components/Slide/utils/playerCustomActions.cjs.js.map +1 -0
- package/dist/components/Slide/utils/playerCustomActions.d.ts +3 -0
- package/dist/components/Slide/utils/playerCustomActions.es.js +7 -0
- package/dist/components/Slide/utils/playerCustomActions.es.js.map +1 -0
- package/dist/components/index.d.ts +4 -2
- package/dist/components/ui/inputGroup/textarea.cjs.js +1 -1
- package/dist/components/ui/inputGroup/textarea.es.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +24 -22
- package/dist/lib/interaction-defaults.cjs.js +2 -0
- package/dist/lib/interaction-defaults.cjs.js.map +1 -0
- package/dist/lib/interaction-defaults.es.js +106 -0
- package/dist/lib/interaction-defaults.es.js.map +1 -0
- package/dist/lib/sandboxInteraction.cjs.js +2 -0
- package/dist/lib/sandboxInteraction.cjs.js.map +1 -0
- package/dist/lib/sandboxInteraction.d.ts +8 -0
- package/dist/lib/sandboxInteraction.es.js +12 -0
- package/dist/lib/sandboxInteraction.es.js.map +1 -0
- package/dist/markdown-flow-ui-lib.css +1 -1
- package/dist/renderer.cjs.js +1 -1
- package/dist/renderer.d.ts +5 -3
- package/dist/renderer.es.js +18 -16
- package/package.json +17 -2
- package/dist/components/Slide/interaction-defaults.cjs.js +0 -2
- package/dist/components/Slide/interaction-defaults.cjs.js.map +0 -1
- package/dist/components/Slide/interaction-defaults.es.js +0 -85
- package/dist/components/Slide/interaction-defaults.es.js.map +0 -1
- package/dist/lib/browserUserActivation.cjs.js +0 -2
- package/dist/lib/browserUserActivation.cjs.js.map +0 -1
- package/dist/lib/browserUserActivation.es.js +0 -13
- package/dist/lib/browserUserActivation.es.js.map +0 -1
- /package/dist/{components/Slide → lib}/interaction-defaults.d.ts +0 -0
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { j as r } from "../../_virtual/jsx-runtime.es.js";
|
|
2
|
-
import { useRef as o, useState as
|
|
3
|
-
import { cn as
|
|
2
|
+
import be, { useRef as o, useState as Se, useMemo as T, useEffect as M, useCallback as a } from "react";
|
|
3
|
+
import { cn as Y } from "../../lib/utils.es.js";
|
|
4
|
+
import { toPlayerCustomActionList as _e } from "./utils/playerCustomActions.es.js";
|
|
4
5
|
/* empty css */
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
const
|
|
6
|
+
import xe from "../../Documents/ai-shifu/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";
|
|
7
|
+
import we from "../../Documents/ai-shifu/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";
|
|
8
|
+
import je from "../../Documents/ai-shifu/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";
|
|
9
|
+
import Ae from "../../Documents/ai-shifu/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";
|
|
10
|
+
import ke from "../../Documents/ai-shifu/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";
|
|
11
|
+
import Ne from "../../Documents/ai-shifu/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";
|
|
12
|
+
const D = /* @__PURE__ */ new Map(), I = (_) => {
|
|
13
|
+
if (typeof window > "u" || !_ || D.has(_))
|
|
14
|
+
return;
|
|
15
|
+
const N = window.document.createElement("audio");
|
|
16
|
+
N.preload = "auto", N.setAttribute("playsinline", "true"), N.src = _, N.load(), D.set(_, N);
|
|
17
|
+
}, Re = () => /* @__PURE__ */ r.jsxs(
|
|
12
18
|
"svg",
|
|
13
19
|
{
|
|
14
20
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -27,7 +33,7 @@ const oe = () => /* @__PURE__ */ r.jsxs(
|
|
|
27
33
|
/* @__PURE__ */ r.jsx("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
|
|
28
34
|
]
|
|
29
35
|
}
|
|
30
|
-
),
|
|
36
|
+
), ve = () => /* @__PURE__ */ r.jsxs(
|
|
31
37
|
"svg",
|
|
32
38
|
{
|
|
33
39
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -46,240 +52,289 @@ const oe = () => /* @__PURE__ */ r.jsxs(
|
|
|
46
52
|
/* @__PURE__ */ r.jsx("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
|
|
47
53
|
]
|
|
48
54
|
}
|
|
49
|
-
),
|
|
50
|
-
audioList:
|
|
51
|
-
className:
|
|
52
|
-
currentAudioIndex:
|
|
53
|
-
defaultPlaying:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
onInteractionToggle:
|
|
60
|
-
hasInteraction:
|
|
61
|
-
isInteractionOpen:
|
|
62
|
-
prevDisabled:
|
|
63
|
-
nextDisabled:
|
|
64
|
-
showControls:
|
|
65
|
-
|
|
55
|
+
), Ke = ({
|
|
56
|
+
audioList: _ = [],
|
|
57
|
+
className: N,
|
|
58
|
+
currentAudioIndex: i = -1,
|
|
59
|
+
defaultPlaying: g = !0,
|
|
60
|
+
onLoadingChange: B,
|
|
61
|
+
onPrev: ee,
|
|
62
|
+
onNext: re,
|
|
63
|
+
onFullscreen: te,
|
|
64
|
+
onEnded: K,
|
|
65
|
+
onInteractionToggle: ne,
|
|
66
|
+
hasInteraction: se = !1,
|
|
67
|
+
isInteractionOpen: ue = !1,
|
|
68
|
+
prevDisabled: le = !1,
|
|
69
|
+
nextDisabled: ce = !1,
|
|
70
|
+
showControls: ae = !0,
|
|
71
|
+
customActions: Z,
|
|
72
|
+
...oe
|
|
66
73
|
}) => {
|
|
67
|
-
const
|
|
68
|
-
() => [...
|
|
74
|
+
const y = o(null), x = o(null), $ = o(null), w = o(0), f = o(null), H = o(void 0), P = o([]), q = o(!1), m = o(!1), v = o(null), p = o(!1), n = o(!1), d = o(null), h = o(!1), j = o("unknown"), [F, l] = Se(g), c = i >= 0 ? _[i] : void 0, C = c?.audioUrl, b = T(
|
|
75
|
+
() => [...c?.audioSegments ?? []].sort(
|
|
69
76
|
(e, u) => e.segment_index - u.segment_index
|
|
70
77
|
),
|
|
71
|
-
[
|
|
72
|
-
),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
[c?.audioSegments]
|
|
79
|
+
), z = T(
|
|
80
|
+
() => _e(Z),
|
|
81
|
+
[Z]
|
|
82
|
+
), O = z.length + 4, ie = T(
|
|
83
|
+
() => ({
|
|
84
|
+
"--slide-player-mobile-control-count": String(O)
|
|
85
|
+
}),
|
|
86
|
+
[O]
|
|
87
|
+
), L = T(() => c ? c.audioKey ?? `${String(c.sequenceNumber ?? "none")}:${String(c.audioUrl ?? "")}` : "none", [c]);
|
|
88
|
+
M(() => {
|
|
89
|
+
H.current = c;
|
|
90
|
+
}, [c]), M(() => {
|
|
91
|
+
P.current = b;
|
|
92
|
+
}, [b]), M(() => {
|
|
93
|
+
const e = c?.audioUrl, u = i >= 0 ? _[i + 1]?.audioUrl : void 0;
|
|
94
|
+
I(e), I(u);
|
|
95
|
+
}, [_, c?.audioUrl, i]);
|
|
96
|
+
const t = a(
|
|
82
97
|
(e) => {
|
|
83
|
-
|
|
98
|
+
q.current !== e && (q.current = e, B?.(e));
|
|
99
|
+
},
|
|
100
|
+
[B]
|
|
101
|
+
), G = a((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), A = a(() => g && !m.current && j.current !== "blocked", [g]), J = a((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), Q = a(() => {
|
|
102
|
+
const e = f.current;
|
|
103
|
+
return e == null || e <= 0 ? 0 : P.current.slice(0, e).reduce(
|
|
104
|
+
(u, s) => u + Math.max(Number(s.duration_ms ?? 0), 0),
|
|
105
|
+
0
|
|
106
|
+
) / 1e3;
|
|
107
|
+
}, []), U = a(() => {
|
|
108
|
+
const e = y.current;
|
|
109
|
+
e && (n.current = !1, m.current = !1, v.current = null, d.current = null, p.current = !1, h.current = !1, e.pause(), e.removeAttribute("src"), e.load(), x.current = null, w.current = 0, f.current = null, l(!1), t(!1));
|
|
110
|
+
}, [t]), S = a(
|
|
111
|
+
(e) => {
|
|
112
|
+
const u = y.current;
|
|
84
113
|
if (!u)
|
|
85
114
|
return !1;
|
|
86
|
-
const
|
|
87
|
-
return
|
|
88
|
-
n.current = !1, h.current = !1;
|
|
89
|
-
}).catch((
|
|
90
|
-
l(!1);
|
|
115
|
+
const s = u.play();
|
|
116
|
+
return s && typeof s.then == "function" && s.then(() => {
|
|
117
|
+
j.current === "unknown" && (j.current = "auto"), n.current = !1, h.current = !1;
|
|
118
|
+
}).catch((R) => {
|
|
119
|
+
j.current === "unknown" && G(R) && (j.current = "blocked", n.current = !1, t(!1)), h.current = !1, l(!1);
|
|
91
120
|
}), !0;
|
|
92
121
|
},
|
|
93
|
-
[t]
|
|
94
|
-
),
|
|
122
|
+
[G, t]
|
|
123
|
+
), E = a(
|
|
95
124
|
(e, u) => {
|
|
96
|
-
const
|
|
97
|
-
if (!
|
|
125
|
+
const s = y.current, R = P.current[e];
|
|
126
|
+
if (!s || !R)
|
|
98
127
|
return !1;
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
|
|
128
|
+
const k = J(R.audio_data);
|
|
129
|
+
w.current = e, f.current = null, p.current = !1, h.current = !0;
|
|
130
|
+
const W = A();
|
|
131
|
+
n.current = W, t(!1);
|
|
132
|
+
const ye = x.current !== k;
|
|
133
|
+
return v.current = "segment", ye && (s.pause(), s.removeAttribute("src"), s.load(), x.current = k, s.src = k, s.load()), d.current = 0, s.readyState > 0 && (s.currentTime = 0, d.current = null), W ? S(`start-segment:${u}`) : (n.current = !1, h.current = !1, s.pause(), l(!1), !0);
|
|
134
|
+
},
|
|
135
|
+
[
|
|
136
|
+
A,
|
|
137
|
+
J,
|
|
138
|
+
S,
|
|
139
|
+
t
|
|
140
|
+
]
|
|
141
|
+
), V = a(
|
|
142
|
+
(e) => {
|
|
143
|
+
n.current = !1, p.current = !1, h.current = !1, l(!1), t(!1), i >= 0 && K?.(i);
|
|
103
144
|
},
|
|
104
|
-
[
|
|
105
|
-
),
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
if (c) {
|
|
110
|
-
x(e, "ended");
|
|
145
|
+
[i, K, t]
|
|
146
|
+
), X = a(() => {
|
|
147
|
+
const e = w.current + 1, u = P.current, s = u[e], R = H.current, k = u.some((W) => W.is_final);
|
|
148
|
+
if (s) {
|
|
149
|
+
E(e, "ended");
|
|
111
150
|
return;
|
|
112
151
|
}
|
|
113
|
-
if (
|
|
114
|
-
|
|
152
|
+
if (R?.isAudioStreaming || !k) {
|
|
153
|
+
w.current = e, f.current = e, p.current = !0, n.current = g, l(!1), t(!0);
|
|
115
154
|
return;
|
|
116
155
|
}
|
|
117
|
-
|
|
118
|
-
}, [
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
E,
|
|
122
|
-
x
|
|
123
|
-
]);
|
|
124
|
-
v(() => {
|
|
125
|
-
if (F.current === V)
|
|
156
|
+
V("segments-completed");
|
|
157
|
+
}, [g, V, E, t]);
|
|
158
|
+
M(() => {
|
|
159
|
+
if ($.current === L)
|
|
126
160
|
return;
|
|
127
|
-
|
|
128
|
-
const e =
|
|
161
|
+
$.current = L, w.current = 0, f.current = null, p.current = !1, m.current = !1, n.current = !1, h.current = !1, v.current = null, x.current = null, t(!1);
|
|
162
|
+
const e = y.current;
|
|
129
163
|
e && (e.pause(), e.removeAttribute("src"), e.load(), l(!1));
|
|
130
164
|
}, [
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
165
|
+
i,
|
|
166
|
+
L,
|
|
167
|
+
b.length,
|
|
168
|
+
C,
|
|
169
|
+
t
|
|
170
|
+
]), M(() => {
|
|
171
|
+
const e = y.current;
|
|
137
172
|
if (e) {
|
|
138
|
-
if (!
|
|
139
|
-
|
|
173
|
+
if (!c) {
|
|
174
|
+
U();
|
|
140
175
|
return;
|
|
141
176
|
}
|
|
142
|
-
if (
|
|
143
|
-
const u =
|
|
144
|
-
if (
|
|
177
|
+
if (C) {
|
|
178
|
+
const u = x.current !== C, s = A();
|
|
179
|
+
if (v.current === "segment" && !!x.current && f.current === null) {
|
|
180
|
+
if (!s) {
|
|
181
|
+
n.current = !1, e.pause(), l(!1);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
e.paused && (n.current = !0, S("keep-segment-source"));
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (u) {
|
|
188
|
+
const k = f.current !== null ? Q() : 0;
|
|
189
|
+
e.pause(), e.removeAttribute("src"), e.load(), x.current = C, v.current = "url", e.src = C, e.load(), d.current = k, e.readyState > 0 && (e.currentTime = k, d.current = null);
|
|
190
|
+
}
|
|
191
|
+
if (n.current = s, p.current = !1, h.current = !1, t(!1), !s) {
|
|
145
192
|
n.current = !1, e.pause(), l(!1);
|
|
146
193
|
return;
|
|
147
194
|
}
|
|
148
|
-
u
|
|
195
|
+
S(u ? "sync-url-init" : "sync-url");
|
|
149
196
|
return;
|
|
150
197
|
}
|
|
151
198
|
if (f.current !== null) {
|
|
152
|
-
if (f.current <
|
|
153
|
-
|
|
199
|
+
if (f.current < b.length) {
|
|
200
|
+
if (m.current) {
|
|
201
|
+
l(!1), t(!1);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
E(f.current, "wait-resume");
|
|
154
205
|
return;
|
|
155
206
|
}
|
|
156
|
-
|
|
207
|
+
p.current = !0, n.current = A(), l(!1), t(A());
|
|
157
208
|
return;
|
|
158
209
|
}
|
|
159
|
-
if (!
|
|
160
|
-
if (
|
|
161
|
-
f.current =
|
|
210
|
+
if (!b.length) {
|
|
211
|
+
if (c.isAudioStreaming) {
|
|
212
|
+
f.current = w.current, p.current = !0, n.current = A(), l(!1), t(A());
|
|
162
213
|
return;
|
|
163
214
|
}
|
|
164
|
-
|
|
215
|
+
U();
|
|
165
216
|
return;
|
|
166
217
|
}
|
|
167
|
-
if (!
|
|
168
|
-
|
|
218
|
+
if (!x.current) {
|
|
219
|
+
E(
|
|
169
220
|
Math.min(
|
|
170
|
-
|
|
171
|
-
|
|
221
|
+
w.current,
|
|
222
|
+
b.length - 1
|
|
172
223
|
),
|
|
173
224
|
"effect-init"
|
|
174
225
|
);
|
|
175
226
|
return;
|
|
176
227
|
}
|
|
177
|
-
if (!
|
|
228
|
+
if (!g || m.current) {
|
|
178
229
|
n.current = !1, e.pause(), l(!1);
|
|
179
230
|
return;
|
|
180
231
|
}
|
|
181
|
-
e.paused && (n.current = !0,
|
|
232
|
+
e.paused && (n.current = !0, S("sync-paused-retry"));
|
|
182
233
|
}
|
|
183
234
|
}, [
|
|
184
|
-
|
|
185
|
-
|
|
235
|
+
c,
|
|
236
|
+
i,
|
|
237
|
+
b,
|
|
238
|
+
C,
|
|
186
239
|
g,
|
|
187
|
-
|
|
188
|
-
|
|
240
|
+
A,
|
|
241
|
+
U,
|
|
242
|
+
E,
|
|
189
243
|
S,
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
]),
|
|
193
|
-
const
|
|
194
|
-
l(!0);
|
|
195
|
-
}, [t]),
|
|
196
|
-
|
|
197
|
-
}, [
|
|
198
|
-
const e =
|
|
199
|
-
e &&
|
|
200
|
-
}, [
|
|
201
|
-
const e =
|
|
202
|
-
e &&
|
|
203
|
-
}, [
|
|
204
|
-
|
|
205
|
-
|
|
244
|
+
Q,
|
|
245
|
+
t
|
|
246
|
+
]), M(() => U, [U]);
|
|
247
|
+
const fe = a(() => {
|
|
248
|
+
l(!0), t(!1);
|
|
249
|
+
}, [t]), de = a(() => {
|
|
250
|
+
p.current || h.current || l(!1);
|
|
251
|
+
}, [i]), me = a(() => {
|
|
252
|
+
const e = y.current;
|
|
253
|
+
e && d.current !== null && (e.currentTime = d.current, d.current = null), !(!n.current || !g) && S("canplay");
|
|
254
|
+
}, [i, g, S]), pe = a(() => {
|
|
255
|
+
const e = y.current;
|
|
256
|
+
e && d.current !== null && (e.currentTime = d.current, d.current = null);
|
|
257
|
+
}, [i]), he = a(() => {
|
|
258
|
+
const e = v.current === "url" || P.current.length === 0;
|
|
259
|
+
if (h.current = !1, e) {
|
|
260
|
+
V("url-ended");
|
|
206
261
|
return;
|
|
207
262
|
}
|
|
208
|
-
|
|
209
|
-
}, [
|
|
210
|
-
l(!1);
|
|
263
|
+
X();
|
|
264
|
+
}, [V, X]), ge = a(() => {
|
|
265
|
+
l(!1), t(!1);
|
|
211
266
|
}, [t]);
|
|
212
|
-
return /* @__PURE__ */ r.jsxs("div", { className:
|
|
267
|
+
return /* @__PURE__ */ r.jsxs("div", { className: Y("slide-player", N), ...oe, children: [
|
|
213
268
|
/* @__PURE__ */ r.jsx(
|
|
214
269
|
"audio",
|
|
215
270
|
{
|
|
216
|
-
ref:
|
|
217
|
-
preload: "
|
|
271
|
+
ref: y,
|
|
272
|
+
preload: "auto",
|
|
218
273
|
playsInline: !0,
|
|
219
|
-
onLoadedMetadata:
|
|
220
|
-
onCanPlay:
|
|
221
|
-
onPlay:
|
|
222
|
-
onPause:
|
|
223
|
-
onEnded:
|
|
224
|
-
onError:
|
|
274
|
+
onLoadedMetadata: pe,
|
|
275
|
+
onCanPlay: me,
|
|
276
|
+
onPlay: fe,
|
|
277
|
+
onPause: de,
|
|
278
|
+
onEnded: he,
|
|
279
|
+
onError: ge
|
|
225
280
|
}
|
|
226
281
|
),
|
|
227
|
-
|
|
282
|
+
ae ? /* @__PURE__ */ r.jsxs("div", { className: "slide-player__controls", style: ie, children: [
|
|
228
283
|
/* @__PURE__ */ r.jsxs("div", { className: "slide-player__group", children: [
|
|
229
284
|
/* @__PURE__ */ r.jsx("button", { "aria-label": "More options", className: "hidden", type: "button", children: /* @__PURE__ */ r.jsx(
|
|
230
|
-
|
|
285
|
+
xe,
|
|
231
286
|
{
|
|
232
287
|
className: "slide-player__icon",
|
|
233
288
|
strokeWidth: 2.25
|
|
234
289
|
}
|
|
235
290
|
) }),
|
|
236
|
-
/* @__PURE__ */ r.jsx("button", { "aria-label": "Volume", className: "hidden", type: "button", children: /* @__PURE__ */ r.jsx(
|
|
291
|
+
/* @__PURE__ */ r.jsx("button", { "aria-label": "Volume", className: "hidden", type: "button", children: /* @__PURE__ */ r.jsx(we, { className: "slide-player__icon", strokeWidth: 2.25 }) }),
|
|
237
292
|
/* @__PURE__ */ r.jsx(
|
|
238
293
|
"button",
|
|
239
294
|
{
|
|
240
295
|
"aria-label": "Rewind",
|
|
241
296
|
className: "slide-player__action",
|
|
242
|
-
disabled:
|
|
243
|
-
onClick:
|
|
297
|
+
disabled: le,
|
|
298
|
+
onClick: ee,
|
|
244
299
|
type: "button",
|
|
245
|
-
children: /* @__PURE__ */ r.jsx(
|
|
300
|
+
children: /* @__PURE__ */ r.jsx(je, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
246
301
|
}
|
|
247
302
|
),
|
|
248
303
|
/* @__PURE__ */ r.jsx(
|
|
249
304
|
"button",
|
|
250
305
|
{
|
|
251
|
-
"aria-label":
|
|
306
|
+
"aria-label": F ? "Pause" : "Play",
|
|
252
307
|
className: "slide-player__toggle",
|
|
253
308
|
onClick: () => {
|
|
254
|
-
const e =
|
|
255
|
-
if (!(!e || !
|
|
309
|
+
const e = y.current;
|
|
310
|
+
if (!(!e || !c)) {
|
|
256
311
|
if (f.current !== null) {
|
|
257
|
-
if (
|
|
258
|
-
n.current = !1, f.current = null,
|
|
312
|
+
if (F) {
|
|
313
|
+
n.current = !1, m.current = !0, f.current = null, p.current = !1, l(!1), t(!1), e.pause();
|
|
259
314
|
return;
|
|
260
315
|
}
|
|
261
|
-
|
|
316
|
+
j.current = "manual", m.current = !1, n.current = !0, t(!0);
|
|
262
317
|
return;
|
|
263
318
|
}
|
|
264
|
-
if (!e.src &&
|
|
265
|
-
|
|
319
|
+
if (!e.src && b.length > 0) {
|
|
320
|
+
j.current = "manual", m.current = !1, E(
|
|
266
321
|
Math.min(
|
|
267
|
-
|
|
268
|
-
|
|
322
|
+
w.current,
|
|
323
|
+
b.length - 1
|
|
269
324
|
),
|
|
270
325
|
"toggle"
|
|
271
326
|
);
|
|
272
327
|
return;
|
|
273
328
|
}
|
|
274
329
|
if (e.paused) {
|
|
275
|
-
|
|
330
|
+
j.current = "manual", m.current = !1, n.current = !0, S("toggle-resume");
|
|
276
331
|
return;
|
|
277
332
|
}
|
|
278
|
-
n.current = !1, e.pause();
|
|
333
|
+
n.current = !1, m.current = !0, e.pause();
|
|
279
334
|
}
|
|
280
335
|
},
|
|
281
336
|
type: "button",
|
|
282
|
-
children:
|
|
337
|
+
children: F ? /* @__PURE__ */ r.jsx(Re, {}) : /* @__PURE__ */ r.jsx(ve, {})
|
|
283
338
|
}
|
|
284
339
|
),
|
|
285
340
|
/* @__PURE__ */ r.jsx(
|
|
@@ -287,10 +342,10 @@ const oe = () => /* @__PURE__ */ r.jsxs(
|
|
|
287
342
|
{
|
|
288
343
|
"aria-label": "Forward",
|
|
289
344
|
className: "slide-player__action",
|
|
290
|
-
disabled:
|
|
291
|
-
onClick:
|
|
345
|
+
disabled: ce,
|
|
346
|
+
onClick: re,
|
|
292
347
|
type: "button",
|
|
293
|
-
children: /* @__PURE__ */ r.jsx(
|
|
348
|
+
children: /* @__PURE__ */ r.jsx(Ae, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
294
349
|
}
|
|
295
350
|
),
|
|
296
351
|
/* @__PURE__ */ r.jsx(
|
|
@@ -298,31 +353,34 @@ const oe = () => /* @__PURE__ */ r.jsxs(
|
|
|
298
353
|
{
|
|
299
354
|
"aria-label": "Fullscreen",
|
|
300
355
|
className: "hidden",
|
|
301
|
-
onClick:
|
|
356
|
+
onClick: te,
|
|
302
357
|
type: "button",
|
|
303
|
-
children: /* @__PURE__ */ r.jsx(
|
|
358
|
+
children: /* @__PURE__ */ r.jsx(ke, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
304
359
|
}
|
|
305
360
|
)
|
|
306
361
|
] }),
|
|
307
362
|
/* @__PURE__ */ r.jsx("div", { className: "slide-player__separator" }),
|
|
308
|
-
/* @__PURE__ */ r.
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
"
|
|
312
|
-
|
|
313
|
-
"
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
363
|
+
/* @__PURE__ */ r.jsxs("div", { className: "slide-player__group", children: [
|
|
364
|
+
z.map((e, u) => /* @__PURE__ */ r.jsx(be.Fragment, { children: e }, `custom-action-${u}`)),
|
|
365
|
+
/* @__PURE__ */ r.jsx(
|
|
366
|
+
"button",
|
|
367
|
+
{
|
|
368
|
+
"aria-label": "Notes",
|
|
369
|
+
className: Y(
|
|
370
|
+
"slide-player__action",
|
|
371
|
+
ue && "slide-player__action--active"
|
|
372
|
+
),
|
|
373
|
+
disabled: !se,
|
|
374
|
+
onClick: ne,
|
|
375
|
+
type: "button",
|
|
376
|
+
children: /* @__PURE__ */ r.jsx(Ne, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
377
|
+
}
|
|
378
|
+
)
|
|
379
|
+
] })
|
|
322
380
|
] }) : null
|
|
323
381
|
] });
|
|
324
382
|
};
|
|
325
383
|
export {
|
|
326
|
-
|
|
384
|
+
Ke as default
|
|
327
385
|
};
|
|
328
386
|
//# sourceMappingURL=Player.es.js.map
|