strata-react 1.1.2 → 1.1.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/UPGRADING.md +6 -0
- package/dist/components/media-player.d.ts +6 -1
- package/dist/components/player-warning.d.ts +24 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +211 -103
- package/dist/index.js.map +1 -1
- package/dist/strata.css +15 -0
- package/dist/strata.migrate.css +15 -0
- package/package.json +1 -1
package/UPGRADING.md
CHANGED
|
@@ -11,6 +11,12 @@ time. While the version is 0.x, any release may break.
|
|
|
11
11
|
|
|
12
12
|
Every PR that changes what an app sees adds a line here (see `CLAUDE.md`, "Changelog").
|
|
13
13
|
|
|
14
|
+
## 2026-11-19
|
|
15
|
+
- In fullscreen, `MediaPlayer` grows the video into the controls’ space while they are hidden.
|
|
16
|
+
|
|
17
|
+
## 2026-11-18
|
|
18
|
+
- `MediaPlayer` hides the custom controls after three idle seconds during full-screen playback. Moving the mouse or using the keyboard reveals them.
|
|
19
|
+
|
|
14
20
|
## 2026-11-15
|
|
15
21
|
|
|
16
22
|
- `MediaPlayer` (video, Strata's controls) now has a Full screen button after the volume and an `f` key (where the browser has the Fullscreen API); pass `fullscreen={false}` to remove them. The player is wrapped in `FullscreenFrame`, so a test that counts buttons or a baseline of a video player changes.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PlayerWarningEvent } from './player-warning';
|
|
1
2
|
import { MediaSpanData, SpanKind, SpanOutcome, SpanWords } from './media-spans';
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
/** Why a player is not playing, for the app to word. */
|
|
@@ -171,6 +172,10 @@ export type MediaPlayerProps = {
|
|
|
171
172
|
mediaRef?: React.Ref<MediaElementState>;
|
|
172
173
|
/** Drawn over the picture only (never the controls) in a box that fills it; the app's classes choose the corner (`absolute bottom-3 right-3`). Anything interactive in it is clickable and focusable. A video's box keeps its shape before the metadata loads, so the overlay has a stable place. */
|
|
173
174
|
overlay?: (media: MediaElementState) => React.ReactNode;
|
|
175
|
+
/** Content below the controls for playback-related messages and actions. Hides with the controls during idle fullscreen playback. */
|
|
176
|
+
status?: React.ReactNode;
|
|
177
|
+
/** A transient warning from `usePlayerWarnings`, shown independently of the controls. */
|
|
178
|
+
warning?: PlayerWarningEvent;
|
|
174
179
|
/** The picture's shape before its metadata loads (and after, when given): a width over a height, or "16/9". Default "16/9" until the video says its own. */
|
|
175
180
|
aspect?: number | `${number}/${number}`;
|
|
176
181
|
/** A video has a Full screen button (and the `f` key) beside the speed and volume. Default true; `false` for a picture that must stay in its place. Only where the browser has the Fullscreen API (the window-filling fallback would mount the video again and lose its place). Not drawn with the browser's own controls (`controls="native"`, or `"auto"` on a touch device), which have their own. */
|
|
@@ -184,4 +189,4 @@ export declare const SPEECH_RATES: readonly number[];
|
|
|
184
189
|
* a touch device), with the failure to load shown and retried. For an editor or a replay, use the
|
|
185
190
|
* parts and `useMediaElement` directly.
|
|
186
191
|
*/
|
|
187
|
-
export declare function MediaPlayer({ label, kind, src, sources, index: controlledIndex, onIndexChange, autoAdvance, controls, autoPlay, poster, session, rates, shortcuts, attach, growing, window: bound, loop, showFull, group, onTimeUpdate, onWindowEnd, onEnded, onTimeChange, spans, spanKinds, onSpan, spanWords, mediaRef, overlay, aspect, fullscreen, className, }: MediaPlayerProps): React.JSX.Element;
|
|
192
|
+
export declare function MediaPlayer({ label, kind, src, sources, index: controlledIndex, onIndexChange, autoAdvance, controls, autoPlay, poster, session, rates, shortcuts, attach, growing, window: bound, loop, showFull, group, onTimeUpdate, onWindowEnd, onEnded, onTimeChange, spans, spanKinds, onSpan, spanWords, mediaRef, overlay, status, warning, aspect, fullscreen, className, }: MediaPlayerProps): React.JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** A brief, non-blocking playback warning. Important playback failures use the player's error state. */
|
|
3
|
+
export type PlayerWarning = {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
/** Milliseconds on screen. Defaults to the shared toast reading time. */
|
|
7
|
+
timeout?: number;
|
|
8
|
+
action?: {
|
|
9
|
+
label: string;
|
|
10
|
+
onPress: () => void;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
/** The current warning event, including its identity so repeated warnings start a fresh timer. */
|
|
14
|
+
export type PlayerWarningEvent = PlayerWarning & {
|
|
15
|
+
key: number;
|
|
16
|
+
};
|
|
17
|
+
/** Creates a warning channel for one player. Pass `warning` to MediaPlayer and call `warn` when a warning occurs. */
|
|
18
|
+
export declare function usePlayerWarnings(): {
|
|
19
|
+
warning: PlayerWarningEvent | undefined;
|
|
20
|
+
warn: (message: PlayerWarning) => void;
|
|
21
|
+
};
|
|
22
|
+
export declare function PlayerWarningToast({ warning }: {
|
|
23
|
+
warning: PlayerWarning;
|
|
24
|
+
}): React.JSX.Element | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export { DataView, EmptyState, LoadError, Skeleton, StaleNotice, type Load, type
|
|
|
31
31
|
export { NumberField, Slider, ColorField, type NumberFieldProps, type SliderProps, type ColorFieldProps, type RangeProps } from './components/value-controls';
|
|
32
32
|
export { SecretField, type SecretFieldProps, type SecretTestResult } from './components/secret-field';
|
|
33
33
|
export { Alert, type AlertProps } from './components/alert';
|
|
34
|
+
export { usePlayerWarnings, type PlayerWarning, type PlayerWarningEvent } from './components/player-warning';
|
|
34
35
|
export { toast, toastTimeout, StrataToastRegion, type ToastContentProps, type StrataToastRegionProps } from './components/toast';
|
|
35
36
|
export { useClientWork, type ClientWork, type WorkContext, type WorkPhase } from './lib/client-work';
|
|
36
37
|
export { JobStatus, jobProgressText, type JobStatusProps, type JobFailure, type JobProgress, type JobWords } from './components/job-status';
|
package/dist/index.js
CHANGED
|
@@ -1459,6 +1459,81 @@ function Alert({ tone, title, children, action, announce = false, className }) {
|
|
|
1459
1459
|
]
|
|
1460
1460
|
});
|
|
1461
1461
|
}
|
|
1462
|
+
// src/components/player-warning.tsx
|
|
1463
|
+
/** Creates a warning channel for one player. Pass `warning` to MediaPlayer and call `warn` when a warning occurs. */
|
|
1464
|
+
function usePlayerWarnings() {
|
|
1465
|
+
const [warning, setWarning] = React.useState();
|
|
1466
|
+
const next = React.useRef(0);
|
|
1467
|
+
return {
|
|
1468
|
+
warning,
|
|
1469
|
+
warn: React.useCallback((message) => setWarning({
|
|
1470
|
+
...message,
|
|
1471
|
+
key: ++next.current
|
|
1472
|
+
}), [])
|
|
1473
|
+
};
|
|
1474
|
+
}
|
|
1475
|
+
function PlayerWarningToast({ warning }) {
|
|
1476
|
+
const [phase, setPhase] = React.useState("visible");
|
|
1477
|
+
const titleId = React.useId();
|
|
1478
|
+
const delay = toastTimeout(warning);
|
|
1479
|
+
const dismiss = () => setPhase("leaving");
|
|
1480
|
+
React.useEffect(() => {
|
|
1481
|
+
if (phase !== "visible") return;
|
|
1482
|
+
const id = setTimeout(() => setPhase("leaving"), delay);
|
|
1483
|
+
return () => clearTimeout(id);
|
|
1484
|
+
}, [delay, phase]);
|
|
1485
|
+
React.useEffect(() => {
|
|
1486
|
+
if (phase !== "leaving") return;
|
|
1487
|
+
const id = setTimeout(() => setPhase("gone"), 250);
|
|
1488
|
+
return () => clearTimeout(id);
|
|
1489
|
+
}, [phase]);
|
|
1490
|
+
if (phase === "gone") return null;
|
|
1491
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1492
|
+
className: cn("player-warning pointer-events-auto flex w-full max-w-sm items-start gap-3 p-3", overlaySurface),
|
|
1493
|
+
role: "group",
|
|
1494
|
+
"aria-labelledby": titleId,
|
|
1495
|
+
"data-leaving": phase === "leaving" || void 0,
|
|
1496
|
+
inert: phase === "leaving",
|
|
1497
|
+
onAnimationEnd: (event) => {
|
|
1498
|
+
if (event.target === event.currentTarget && phase === "leaving" && event.animationName === "strata-player-warning-out") setPhase("gone");
|
|
1499
|
+
},
|
|
1500
|
+
children: [
|
|
1501
|
+
/* @__PURE__ */ jsx(TriangleAlert, {
|
|
1502
|
+
"aria-hidden": true,
|
|
1503
|
+
className: "mt-0.5 size-4 shrink-0 text-warning"
|
|
1504
|
+
}),
|
|
1505
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1506
|
+
className: "grid min-w-0 flex-1 justify-items-start gap-2",
|
|
1507
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1508
|
+
role: "status",
|
|
1509
|
+
className: "grid min-w-0 gap-0.5",
|
|
1510
|
+
children: [/* @__PURE__ */ jsx("strong", {
|
|
1511
|
+
id: titleId,
|
|
1512
|
+
className: "type-label",
|
|
1513
|
+
children: warning.title
|
|
1514
|
+
}), warning.description && /* @__PURE__ */ jsx("span", {
|
|
1515
|
+
className: "type-body-sm text-muted-foreground",
|
|
1516
|
+
children: warning.description
|
|
1517
|
+
})]
|
|
1518
|
+
}), warning.action && /* @__PURE__ */ jsx(Button, {
|
|
1519
|
+
size: "sm",
|
|
1520
|
+
onPress: () => {
|
|
1521
|
+
warning.action?.onPress();
|
|
1522
|
+
dismiss();
|
|
1523
|
+
},
|
|
1524
|
+
children: warning.action.label
|
|
1525
|
+
})]
|
|
1526
|
+
}),
|
|
1527
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
1528
|
+
size: "sm",
|
|
1529
|
+
variant: "ghost",
|
|
1530
|
+
icon: X,
|
|
1531
|
+
label: "Dismiss playback warning",
|
|
1532
|
+
onPress: dismiss
|
|
1533
|
+
})
|
|
1534
|
+
]
|
|
1535
|
+
});
|
|
1536
|
+
}
|
|
1462
1537
|
// src/lib/client-work.ts
|
|
1463
1538
|
/** Runs browser-side work with progress, cancel and a clear end state, ready for `JobStatus`. */
|
|
1464
1539
|
function useClientWork(run) {
|
|
@@ -3660,7 +3735,7 @@ function useCoarsePointer() {
|
|
|
3660
3735
|
* a touch device), with the failure to load shown and retried. For an editor or a replay, use the
|
|
3661
3736
|
* parts and `useMediaElement` directly.
|
|
3662
3737
|
*/
|
|
3663
|
-
function MediaPlayer({ label, kind = "audio", src, sources, index: controlledIndex, onIndexChange, autoAdvance = true, controls = "auto", autoPlay, poster, session, rates, shortcuts = true, attach, growing, window: bound, loop, showFull, group, onTimeUpdate, onWindowEnd, onEnded, onTimeChange, spans, spanKinds, onSpan, spanWords, mediaRef, overlay, aspect, fullscreen = true, className }) {
|
|
3738
|
+
function MediaPlayer({ label, kind = "audio", src, sources, index: controlledIndex, onIndexChange, autoAdvance = true, controls = "auto", autoPlay, poster, session, rates, shortcuts = true, attach, growing, window: bound, loop, showFull, group, onTimeUpdate, onWindowEnd, onEnded, onTimeChange, spans, spanKinds, onSpan, spanWords, mediaRef, overlay, status, warning, aspect, fullscreen = true, className }) {
|
|
3664
3739
|
const list = React.useMemo(() => sources ?? (src ? [{
|
|
3665
3740
|
src,
|
|
3666
3741
|
title: label
|
|
@@ -3812,6 +3887,19 @@ function MediaPlayer({ label, kind = "audio", src, sources, index: controlledInd
|
|
|
3812
3887
|
const [fullApi, setFullApi] = React.useState(false);
|
|
3813
3888
|
React.useEffect(() => setFullApi(canFullscreen()), []);
|
|
3814
3889
|
const canFull = fullscreen && fullApi && kind === "video" && !native;
|
|
3890
|
+
const autoHideControls = full && canFull && media.playing;
|
|
3891
|
+
const [controlsIdle, setControlsIdle] = React.useState(false);
|
|
3892
|
+
const idleTimer = React.useRef(void 0);
|
|
3893
|
+
const wakeControls = React.useCallback(() => {
|
|
3894
|
+
clearTimeout(idleTimer.current);
|
|
3895
|
+
setControlsIdle(false);
|
|
3896
|
+
if (autoHideControls) idleTimer.current = setTimeout(() => setControlsIdle(true), 3e3);
|
|
3897
|
+
}, [autoHideControls]);
|
|
3898
|
+
React.useEffect(() => {
|
|
3899
|
+
wakeControls();
|
|
3900
|
+
return () => clearTimeout(idleTimer.current);
|
|
3901
|
+
}, [wakeControls]);
|
|
3902
|
+
const hideControls = autoHideControls && controlsIdle;
|
|
3815
3903
|
const stage = React.useRef(null);
|
|
3816
3904
|
const latest = React.useRef(media);
|
|
3817
3905
|
latest.current = media;
|
|
@@ -3888,7 +3976,14 @@ function MediaPlayer({ label, kind = "audio", src, sources, index: controlledInd
|
|
|
3888
3976
|
shortcuts,
|
|
3889
3977
|
native
|
|
3890
3978
|
]);
|
|
3891
|
-
|
|
3979
|
+
const activeKeys = autoHideControls ? keys.map((shortcut) => ({
|
|
3980
|
+
...shortcut,
|
|
3981
|
+
run: () => {
|
|
3982
|
+
wakeControls();
|
|
3983
|
+
shortcut.run();
|
|
3984
|
+
}
|
|
3985
|
+
})) : keys;
|
|
3986
|
+
useHotkeys(activeKeys, { enabled: shortcuts && !native && (page.count <= 1 || page.active === id) });
|
|
3892
3987
|
React.useEffect(() => {
|
|
3893
3988
|
if (!session || typeof navigator === "undefined" || !("mediaSession" in navigator) || typeof MediaMetadata === "undefined") return;
|
|
3894
3989
|
const s = navigator.mediaSession;
|
|
@@ -3969,6 +4064,10 @@ function MediaPlayer({ label, kind = "audio", src, sources, index: controlledInd
|
|
|
3969
4064
|
...common,
|
|
3970
4065
|
className: native ? "w-full" : "hidden"
|
|
3971
4066
|
});
|
|
4067
|
+
const warningToast = warning && /* @__PURE__ */ jsx("div", {
|
|
4068
|
+
className: "pointer-events-none absolute inset-x-3 top-3 z-10 grid justify-items-end",
|
|
4069
|
+
children: /* @__PURE__ */ jsx(PlayerWarningToast, { warning }, warning.key)
|
|
4070
|
+
});
|
|
3972
4071
|
const what = kind === "video" ? "this video" : "this recording";
|
|
3973
4072
|
return /* @__PURE__ */ jsx(FullscreenFrame, {
|
|
3974
4073
|
label,
|
|
@@ -3980,10 +4079,13 @@ function MediaPlayer({ label, kind = "audio", src, sources, index: controlledInd
|
|
|
3980
4079
|
role: "group",
|
|
3981
4080
|
"aria-label": label,
|
|
3982
4081
|
onFocusCapture: () => keyPlayers.use(id),
|
|
4082
|
+
onMouseMoveCapture: autoHideControls ? wakeControls : void 0,
|
|
4083
|
+
onKeyDownCapture: autoHideControls ? wakeControls : void 0,
|
|
3983
4084
|
onPointerDownCapture: () => keyPlayers.use(id),
|
|
3984
|
-
className: cn("grid w-full gap-2", full && "flex h-full min-h-0 flex-col"),
|
|
4085
|
+
className: cn("relative grid w-full gap-2", full && "flex h-full min-h-0 flex-col"),
|
|
3985
4086
|
children: [
|
|
3986
4087
|
element,
|
|
4088
|
+
warningToast,
|
|
3987
4089
|
kind === "audio" && hasSpans && /* @__PURE__ */ jsx(SpanActions, {
|
|
3988
4090
|
state: spanState,
|
|
3989
4091
|
className: "flex flex-wrap items-center gap-2"
|
|
@@ -4006,114 +4108,120 @@ function MediaPlayer({ label, kind = "audio", src, sources, index: controlledInd
|
|
|
4006
4108
|
className: "type-body-sm text-muted-foreground",
|
|
4007
4109
|
children: media.error.message
|
|
4008
4110
|
}),
|
|
4009
|
-
growing && /* @__PURE__ */ jsxs("div", {
|
|
4010
|
-
className: "
|
|
4111
|
+
(growing || bound || !native || status) && /* @__PURE__ */ jsxs("div", {
|
|
4112
|
+
className: cn("grid gap-2", hideControls && "pointer-events-none absolute inset-x-0 bottom-0 opacity-0 has-[:focus-visible]:pointer-events-auto has-[:focus-visible]:static has-[:focus-visible]:opacity-100"),
|
|
4011
4113
|
children: [
|
|
4012
|
-
/* @__PURE__ */
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4114
|
+
growing && /* @__PURE__ */ jsxs("div", {
|
|
4115
|
+
className: "flex flex-wrap items-center gap-x-3 gap-y-1",
|
|
4116
|
+
children: [
|
|
4117
|
+
/* @__PURE__ */ jsx(Status, {
|
|
4118
|
+
tone: "info",
|
|
4119
|
+
icon: LoaderCircle,
|
|
4120
|
+
children: "Still being made"
|
|
4121
|
+
}),
|
|
4122
|
+
growing.status && /* @__PURE__ */ jsx("span", {
|
|
4123
|
+
className: "type-body-sm text-muted-foreground",
|
|
4124
|
+
children: growing.status
|
|
4125
|
+
}),
|
|
4126
|
+
/* @__PURE__ */ jsx("span", {
|
|
4127
|
+
role: "status",
|
|
4128
|
+
className: "type-body-sm text-muted-foreground",
|
|
4129
|
+
children: media.waitingForMore ? "Waiting for more to be made. It will carry on by itself." : ""
|
|
4130
|
+
})
|
|
4131
|
+
]
|
|
4020
4132
|
}),
|
|
4021
|
-
/* @__PURE__ */
|
|
4133
|
+
bound && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("p", {
|
|
4134
|
+
className: "type-caption text-muted-foreground tabular-nums",
|
|
4135
|
+
children: [
|
|
4136
|
+
format.runningTime(bound.start),
|
|
4137
|
+
" to ",
|
|
4138
|
+
format.runningTime(bound.end),
|
|
4139
|
+
loop ? ", looping" : ""
|
|
4140
|
+
]
|
|
4141
|
+
}), /* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx("span", {
|
|
4022
4142
|
role: "status",
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
time: bound.start,
|
|
4052
|
-
label: "Window starts"
|
|
4053
|
-
}, {
|
|
4054
|
-
time: bound.end,
|
|
4055
|
-
label: "Window ends"
|
|
4056
|
-
}] : offsets ? list.map((s, i) => ({
|
|
4057
|
-
time: offsets[i],
|
|
4058
|
-
label: s.title
|
|
4059
|
-
})).slice(1) : [],
|
|
4060
|
-
step: JUMP,
|
|
4061
|
-
bigStep: 60,
|
|
4062
|
-
label: `Seek in ${label}`
|
|
4063
|
-
}), /* @__PURE__ */ jsx(TimeReadout, {
|
|
4064
|
-
time,
|
|
4065
|
-
duration
|
|
4066
|
-
})]
|
|
4067
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
4068
|
-
className: "flex flex-wrap items-center gap-x-4 gap-y-2",
|
|
4069
|
-
children: [
|
|
4070
|
-
/* @__PURE__ */ jsxs(Transport, {
|
|
4071
|
-
playing: media.playing,
|
|
4072
|
-
onPlayPause: media.toggle,
|
|
4073
|
-
children: [list.length > 1 && /* @__PURE__ */ jsx(IconButton, {
|
|
4074
|
-
icon: SkipBack,
|
|
4075
|
-
label: "Previous chapter",
|
|
4076
|
-
disabled: index === 0,
|
|
4077
|
-
onClick: () => step(-1)
|
|
4078
|
-
}), list.length > 1 && /* @__PURE__ */ jsx(IconButton, {
|
|
4079
|
-
icon: SkipForward,
|
|
4080
|
-
label: "Next chapter",
|
|
4081
|
-
disabled: index === list.length - 1,
|
|
4082
|
-
onClick: () => step(1)
|
|
4143
|
+
children: media.playing ? `Playing ${format.runningTime(bound.start)} to ${format.runningTime(bound.end)}` : ""
|
|
4144
|
+
}) })] }),
|
|
4145
|
+
!native && /* @__PURE__ */ jsxs("div", {
|
|
4146
|
+
className: "grid gap-2",
|
|
4147
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
4148
|
+
className: "flex min-w-0 items-center gap-3",
|
|
4149
|
+
children: [/* @__PURE__ */ jsx(SeekBar, {
|
|
4150
|
+
time,
|
|
4151
|
+
duration,
|
|
4152
|
+
onSeek: seek,
|
|
4153
|
+
buffered: growing ? media.ready : offsets ? void 0 : media.buffered,
|
|
4154
|
+
spans: spanState.bars,
|
|
4155
|
+
marks: bound && showFull ? [{
|
|
4156
|
+
time: bound.start,
|
|
4157
|
+
label: "Window starts"
|
|
4158
|
+
}, {
|
|
4159
|
+
time: bound.end,
|
|
4160
|
+
label: "Window ends"
|
|
4161
|
+
}] : offsets ? list.map((s, i) => ({
|
|
4162
|
+
time: offsets[i],
|
|
4163
|
+
label: s.title
|
|
4164
|
+
})).slice(1) : [],
|
|
4165
|
+
step: JUMP,
|
|
4166
|
+
bigStep: 60,
|
|
4167
|
+
label: `Seek in ${label}`
|
|
4168
|
+
}), /* @__PURE__ */ jsx(TimeReadout, {
|
|
4169
|
+
time,
|
|
4170
|
+
duration
|
|
4083
4171
|
})]
|
|
4084
|
-
}),
|
|
4085
|
-
|
|
4086
|
-
className: "type-body-sm text-muted-foreground",
|
|
4087
|
-
children: [
|
|
4088
|
-
current?.title,
|
|
4089
|
-
" (",
|
|
4090
|
-
index + 1,
|
|
4091
|
-
" of ",
|
|
4092
|
-
list.length,
|
|
4093
|
-
")"
|
|
4094
|
-
]
|
|
4095
|
-
}),
|
|
4096
|
-
/* @__PURE__ */ jsxs("span", {
|
|
4097
|
-
className: "ml-auto flex min-w-0 flex-wrap items-center justify-end gap-x-3 gap-y-2",
|
|
4172
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
4173
|
+
className: "flex flex-wrap items-center gap-x-4 gap-y-2",
|
|
4098
4174
|
children: [
|
|
4099
|
-
/* @__PURE__ */
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4175
|
+
/* @__PURE__ */ jsxs(Transport, {
|
|
4176
|
+
playing: media.playing,
|
|
4177
|
+
onPlayPause: media.toggle,
|
|
4178
|
+
children: [list.length > 1 && /* @__PURE__ */ jsx(IconButton, {
|
|
4179
|
+
icon: SkipBack,
|
|
4180
|
+
label: "Previous chapter",
|
|
4181
|
+
disabled: index === 0,
|
|
4182
|
+
onClick: () => step(-1)
|
|
4183
|
+
}), list.length > 1 && /* @__PURE__ */ jsx(IconButton, {
|
|
4184
|
+
icon: SkipForward,
|
|
4185
|
+
label: "Next chapter",
|
|
4186
|
+
disabled: index === list.length - 1,
|
|
4187
|
+
onClick: () => step(1)
|
|
4188
|
+
})]
|
|
4103
4189
|
}),
|
|
4104
|
-
/* @__PURE__ */
|
|
4105
|
-
|
|
4106
|
-
|
|
4190
|
+
list.length > 1 && /* @__PURE__ */ jsxs("span", {
|
|
4191
|
+
className: "type-body-sm text-muted-foreground",
|
|
4192
|
+
children: [
|
|
4193
|
+
current?.title,
|
|
4194
|
+
" (",
|
|
4195
|
+
index + 1,
|
|
4196
|
+
" of ",
|
|
4197
|
+
list.length,
|
|
4198
|
+
")"
|
|
4199
|
+
]
|
|
4107
4200
|
}),
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4201
|
+
/* @__PURE__ */ jsxs("span", {
|
|
4202
|
+
className: "ml-auto flex min-w-0 flex-wrap items-center justify-end gap-x-3 gap-y-2",
|
|
4203
|
+
children: [
|
|
4204
|
+
/* @__PURE__ */ jsx(RateChoice, {
|
|
4205
|
+
rate: media.rate,
|
|
4206
|
+
onRateChange: media.setRate,
|
|
4207
|
+
rates
|
|
4208
|
+
}),
|
|
4209
|
+
/* @__PURE__ */ jsx(VolumeControl, {
|
|
4210
|
+
volume: media.volume,
|
|
4211
|
+
onVolumeChange: media.setVolume
|
|
4212
|
+
}),
|
|
4213
|
+
canFull && /* @__PURE__ */ jsx(IconButton, {
|
|
4214
|
+
icon: full ? Minimize : Maximize,
|
|
4215
|
+
label: full ? "Leave full screen" : "Full screen",
|
|
4216
|
+
onPress: () => setFull(!full)
|
|
4217
|
+
})
|
|
4218
|
+
]
|
|
4112
4219
|
})
|
|
4113
4220
|
]
|
|
4114
|
-
})
|
|
4115
|
-
|
|
4116
|
-
|
|
4221
|
+
})]
|
|
4222
|
+
}),
|
|
4223
|
+
status
|
|
4224
|
+
]
|
|
4117
4225
|
})
|
|
4118
4226
|
]
|
|
4119
4227
|
})
|
|
@@ -16239,6 +16347,6 @@ function FolderPicker({ label, useFolders: useListing, value, onChange, onChoose
|
|
|
16239
16347
|
]
|
|
16240
16348
|
});
|
|
16241
16349
|
}
|
|
16242
|
-
export { ActiveList, Alert, AlertDialog, AppShell, AsyncButton, BookViewer, BoxList, BoxOverlay, Breadcrumb, BulkBar, Button, COLOR_SCHEME_STORAGE_KEY, Checkbox, ChoiceGroup, ColorField, ColorSchemeChoice, CommandLegend, CommandMenu, Compare, CompareAudio, CompareGrid, CompareText, CompareVideo, CompareVideoGrid, Composer, CompositionBar, ContextMenu, Conversation, CursorScope, DEFAULT_TOLERANCE, DataTable, DataView, Density, Dialog, Disclosure, Done, EmptyState, FIT, Field, FileButton, FileDropZone, FileOutcomes, FolderPicker, FullscreenFrame, HttpError, IconButton, InfiniteList, Input, Inspector, InspectorSection, JobStatus, KeysLegend, Lightbox, LineChart, LineChartGroup, LinkCard, LinkCardList, LoadError, LoadMore, MAX_SCALE, MAX_SIDE, MIN_SCALE, MISSING, Mark, MarkSummary, MarkableText, MediaGroup, MediaPlayer, MediaStage, Menu, Meter, Metric, MetricStrip, MissingFile, NBSP, NativeSelect, NumberField, PageHeader, PairJudge, PairVote, Pane, PlayWindowButton, Popover, PropertyList, PropertyRow, RateChoice, RegionEditor, RichText, RowAction, SPEECH_RATES, SaveStatus, SecretField, SeekBar, SelectableGrid, SelectableGridSkeleton, SequenceTimeline, SideNav, Skeleton, Slider, SortableList, SpanActions, Split, StageGuides, StaleNotice, Status, StrataQueryProvider, StrataToastRegion, Switch, TableSkeleton, Tabs, Textarea, ThemeProvider, Thumbnail, ThumbnailSkeleton, TileGrid, TileGridSkeleton, TimeReadout, Timeline, TimelineZoomControls, Toggle, ToggleGroup, Toolbar, ToolbarSeparator, Tooltip, TranscriptView, Transport, Tree, UndoBar, ViewOptions, ViewportFrame, VirtualList, VolumeControl, Waveform, Workspace, actualPixelsScale, ancestorsOf, apiPage, boxViewport, buttonVariants, canFullscreen, clampToRoom, clampViewport, cn, colorSchemeScript, commandShortcut, countMarks, createFormat, createQueryClient, crossedThreshold, describeActionError, describeHttpError, describeRegion, detectPlatform, diffWords, differences, drawRect, ease, errorPayload, fetchJson, fieldErrorsOf, findPage, fitRect, format, formatChord, gainToVolume, geo, gridPoints, gutterOf, isDoubtful, isReservedChord, isTaskRunning, isTypingTarget, jobProgressText, joinMediaGroup, joinRects, labelOf, lerpRect, logScale, loudnessOf, matchEntities, matchGains, matchesAccept, matchesChord, measureLoudness, moveGutter, moveRect, noOverlap, normaliseAngle, pageName, parentOf, parseChord, parseInline, parseRichText, parseSort, peaksFromAudio, phraseAt, phraseDoubtful, phraseOfWordId, plainText, rangeBetween, readErrorBody, readPixels, readingOrder, regionShares, resample, resamplePeaks, resizeRect, safeHref, sayPosition, serialiseSort, settleCut, snapToGrid, sortRows, splitRect, staleOf, stepId, stepOnGrid, tickLabel, tickStep, ticksBetween, toDate, toLoad, toPeakPair, toast, toastTimeout, transportShortcuts, turnRect, turnedSize, typeSteps, useActiveItem, useAsyncAction, useAttachedSource, useAutoSave, useBookUrl, useBoxes, useChoices, useClientWork, useColorScheme, useCommands, useDifference, useExpanded, useFileIntake, useHistory, useHistoryState, useHotkeys, useInView, useInfiniteLoad, useJob, useJobAction, useLeaveGuard, useLightboxUrl, useLoad, useMediaElement, useMediaSpans, useSelection, useSharedCursor, useSystemColorScheme, useTimelineZoom, useUndoable, useViewOptions, useViewport, useWorkspaceState, valueAt, viewOf, viewsOf, wordAt, wordId, zoomAt, zoomToBox };
|
|
16350
|
+
export { ActiveList, Alert, AlertDialog, AppShell, AsyncButton, BookViewer, BoxList, BoxOverlay, Breadcrumb, BulkBar, Button, COLOR_SCHEME_STORAGE_KEY, Checkbox, ChoiceGroup, ColorField, ColorSchemeChoice, CommandLegend, CommandMenu, Compare, CompareAudio, CompareGrid, CompareText, CompareVideo, CompareVideoGrid, Composer, CompositionBar, ContextMenu, Conversation, CursorScope, DEFAULT_TOLERANCE, DataTable, DataView, Density, Dialog, Disclosure, Done, EmptyState, FIT, Field, FileButton, FileDropZone, FileOutcomes, FolderPicker, FullscreenFrame, HttpError, IconButton, InfiniteList, Input, Inspector, InspectorSection, JobStatus, KeysLegend, Lightbox, LineChart, LineChartGroup, LinkCard, LinkCardList, LoadError, LoadMore, MAX_SCALE, MAX_SIDE, MIN_SCALE, MISSING, Mark, MarkSummary, MarkableText, MediaGroup, MediaPlayer, MediaStage, Menu, Meter, Metric, MetricStrip, MissingFile, NBSP, NativeSelect, NumberField, PageHeader, PairJudge, PairVote, Pane, PlayWindowButton, Popover, PropertyList, PropertyRow, RateChoice, RegionEditor, RichText, RowAction, SPEECH_RATES, SaveStatus, SecretField, SeekBar, SelectableGrid, SelectableGridSkeleton, SequenceTimeline, SideNav, Skeleton, Slider, SortableList, SpanActions, Split, StageGuides, StaleNotice, Status, StrataQueryProvider, StrataToastRegion, Switch, TableSkeleton, Tabs, Textarea, ThemeProvider, Thumbnail, ThumbnailSkeleton, TileGrid, TileGridSkeleton, TimeReadout, Timeline, TimelineZoomControls, Toggle, ToggleGroup, Toolbar, ToolbarSeparator, Tooltip, TranscriptView, Transport, Tree, UndoBar, ViewOptions, ViewportFrame, VirtualList, VolumeControl, Waveform, Workspace, actualPixelsScale, ancestorsOf, apiPage, boxViewport, buttonVariants, canFullscreen, clampToRoom, clampViewport, cn, colorSchemeScript, commandShortcut, countMarks, createFormat, createQueryClient, crossedThreshold, describeActionError, describeHttpError, describeRegion, detectPlatform, diffWords, differences, drawRect, ease, errorPayload, fetchJson, fieldErrorsOf, findPage, fitRect, format, formatChord, gainToVolume, geo, gridPoints, gutterOf, isDoubtful, isReservedChord, isTaskRunning, isTypingTarget, jobProgressText, joinMediaGroup, joinRects, labelOf, lerpRect, logScale, loudnessOf, matchEntities, matchGains, matchesAccept, matchesChord, measureLoudness, moveGutter, moveRect, noOverlap, normaliseAngle, pageName, parentOf, parseChord, parseInline, parseRichText, parseSort, peaksFromAudio, phraseAt, phraseDoubtful, phraseOfWordId, plainText, rangeBetween, readErrorBody, readPixels, readingOrder, regionShares, resample, resamplePeaks, resizeRect, safeHref, sayPosition, serialiseSort, settleCut, snapToGrid, sortRows, splitRect, staleOf, stepId, stepOnGrid, tickLabel, tickStep, ticksBetween, toDate, toLoad, toPeakPair, toast, toastTimeout, transportShortcuts, turnRect, turnedSize, typeSteps, useActiveItem, useAsyncAction, useAttachedSource, useAutoSave, useBookUrl, useBoxes, useChoices, useClientWork, useColorScheme, useCommands, useDifference, useExpanded, useFileIntake, useHistory, useHistoryState, useHotkeys, useInView, useInfiniteLoad, useJob, useJobAction, useLeaveGuard, useLightboxUrl, useLoad, useMediaElement, useMediaSpans, usePlayerWarnings, useSelection, useSharedCursor, useSystemColorScheme, useTimelineZoom, useUndoable, useViewOptions, useViewport, useWorkspaceState, valueAt, viewOf, viewsOf, wordAt, wordId, zoomAt, zoomToBox };
|
|
16243
16351
|
|
|
16244
16352
|
//# sourceMappingURL=index.js.map
|