strata-react 2.1.11 → 2.1.12
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/README.md +1 -0
- package/dist/index.d.ts +25 -1
- package/dist/index.js +167 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -249,6 +249,7 @@ thousands of lines. Such an app imports the same stylesheet **without the reset*
|
|
|
249
249
|
| Timeline | `Timeline`, `useTimelineZoom`, `TimelineZoomControls`, `noOverlap` | Items with a start and a length in lanes on a zoomable time axis, for media edits, bookings, rotas and plans. The timeline draws and the app decides: every move, trim, lane change, selection and current-time change is reported (`onItemChange`, `onSelect`, `onPositionChange`) and the app applies it; `validate` refuses a change with a reason shown in words while it is made. One tab stop for the items; arrows move between them, Ctrl+arrows nudge and change lane, Alt+arrows trim, the current time is its own slider, `+` `-` `0` zoom, and each change is announced ("run-02.mp4 moved to 0:13"). The ruler picks steps people write on a scale so labels never collide. Lanes take drops from outside (`dropTypes`, `onDrop` with the lane and snapped time, `validateDrop`, and React Aria's keyboard drag landing at the current time), `laneRows` makes them taller, `kindColours` fixes each kind's stripe, and the header column fits its content. Only items near the view are rendered |
|
|
250
250
|
| Answering by tap | `ChoiceGrid`, `ChoiceGridSkeleton`, `ChoiceState`; the `type-picture` step | One question, large picture tiles, one right answer, for someone who may not read yet (a child's learning game). Each tile is `open`, `wrong` (greyed, never red), `right` or `answer` (shown after the tries ran out), always with its word; a choice with no answer key ("Which one next?", a rating) uses `picked` (primary border, neutral word, `marks={{ picked }}`), which closes the grid so a slow request cannot be tapped twice; the app owns the answer key. Answered tiles cannot be pressed again and the grid closes once the answer shows. React Aria's `GridList`: arrows across and down, Enter answers. Tiles at least 120px (`md`) or 160px (`lg`); `stretch` shares the row out so a few tiles fill a wide screen; `beckon` pulses the open tiles one at a time in a random order until the grid closes. For a learner who cannot read a tile's word: `renderCaption` (a fitted line under the picture, "12 December"), `onHover` (say a tile when a mouse or pen comes over it) and `reading` (the tile being read aloud, lit; `useReadAloud` reads the tiles once in turn after the prompt, and stops for good at the learner's first tap) |
|
|
251
251
|
| Answering by placing | `PlaceBoard`, `PlaceState` | An answer that is an arrangement (give a number, put in order, match pairs, sort), for someone who may not read yet. Two taps: pick a piece up (`aria-pressed`, "Picked up", a blue info ring), put it in a place ("Put apple in the basket"; every place that takes it gets the same ring); tap it again to put it down, or tap its gap in the pile ("Put … back"). Or drag it there by pointer (from the press, no long press). With one place a tap moves at once, in or out (a big X on hover). `limit` caps a place: a piece put in a full one sends the one there back ("in place of 4"). The pile keeps a slot per piece and each place room for all it can hold (a lone place takes the row), so nothing moves during a round (the held word sits over its piece's foot; the Check keeps its room once locked). Same presses by touch, mouse, keyboard and screen reader; places are disabled until a piece is held, so Tab walks the pieces, then the places; focus follows a moved piece. The app owns `placement`, applies `onMove` and checks (`check` draws its big Check, `Button size="lg"` with a tick either side; `check.untilPlaced` greys it out until the pile is empty, for a round with a set number of answers); `placeState` marks a place `right` or `wrong` (neutral, never red) with its word, `locked` ends the round. Pieces 96px or more in the pile, 72px once placed; `beckon` pulses the pile's pieces one at a time while none is held; `stretch` shares the pile's and places' rows out; a picture never outgrows its tile. `renderCaption`, `onHover`, `onHoverPlace` and `reading` as on `ChoiceGrid` |
|
|
252
|
+
| Telling the time | `ClockFace`, `clockWords` | An analogue clock showing one time, as a picture named with the time in words (`label` to name it otherwise when the time is the answer). The hour hand is short, thick and in the ink colour, the minute hand long and in the primary colour, and the hour hand moves part way to the next number as the minutes pass. `numbers` draws all twelve, the `quarters` or `none`, and `minuteMarks` the sixty small marks; it fills its width. `clockWords(h, m)` says a time as UK English does: "three o’clock", "half past three", "quarter to four", "twenty-five past ten", "seven minutes to four" |
|
|
252
253
|
| Seeing for a moment | `Glimpse`, `useCountdown` | Something shown briefly and then hidden ("How many did you see?"). A 3-2-1 (`count`) before every look, then the content for `ms` with a bar under it that empties as the time goes (`drain`), then hidden with its room kept, so nothing under it moves. Changing `again` shows it again, count and timer included (after a wrong answer); `peeks` offers that many looks again on a "Look again" button in the empty box, gone once used. `onLook` reports each look and why (`first`, `again`, `peek`). `useCountdown(running, seconds, onDone, run, { hold })` is the whole-second count on its own (an auto Next); `hold: useSpeaking()` makes the end wait, on 1, until the words have been said too (given up after `holdAtMost`, 10 s) |
|
|
253
254
|
| Sortable list | `SortableList` | Reorder a list and move items between lists, by pointer and by keyboard. React Aria's `GridList` with `useDragAndDrop` (no `@dnd-kit`): a grip per row is the drag handle, so clicking a row selects it and its own actions still work; Enter on the grip picks up, arrows and Tab choose a position or list, Enter drops, Escape cancels, with React Aria's screen-reader announcements. Items carry a kind (`getKind`); a list takes the kinds in `accepts` and says why it refuses another (`refuses`, shown with an icon while that kind is dragged over it). The list never changes the data: `onReorder` and `onInsert` report the move and the app applies it, undoably |
|
|
254
255
|
| Drag source | `DragSource` | A row that is dragged onto a drop target elsewhere (a `Timeline` lane), by pointer or from the keyboard. React Aria's `useDrag` with a drag button: a grip named "Drag <label>" picks it up with Enter, Tab moves between targets that take its types, Enter drops, Escape cancels, with React Aria's announcements; the pointer can pick up the whole row and the row's own buttons still work. `items` returns the drag's data (`DragData`, a type to a value), read by the target |
|
package/dist/index.d.ts
CHANGED
|
@@ -5895,5 +5895,29 @@ export declare function rangeBetween(ids: readonly string[], a: string | null, b
|
|
|
5895
5895
|
export declare function countMarks(marks: Readonly<Record<string, string | undefined>>, ids?: readonly string[]): Record<string, number>;
|
|
5896
5896
|
/** The id `by` places from `from` in `ids`, held to the ends; the first (or last) when `from` is not set. */
|
|
5897
5897
|
export declare function stepId(ids: readonly string[], from: string | null, by: number): string | null;
|
|
5898
|
-
|
|
5898
|
+
/** How many numbers a `ClockFace` draws: all twelve, only 12, 3, 6 and 9, or none. */
|
|
5899
|
+
type ClockNumbers = "all" | "quarters" | "none";
|
|
5900
|
+
/** Props of `ClockFace`. */
|
|
5901
|
+
type ClockFaceProps = {
|
|
5902
|
+
/** The hour, 0 to 23 (a 12-hour face: 15 and 3 look the same). */
|
|
5903
|
+
hours: number;
|
|
5904
|
+
/** The minutes, 0 to 59. */
|
|
5905
|
+
minutes: number;
|
|
5906
|
+
/** The clock's accessible name; the time in words (`clockWords`) by default. Pass your own when the time is the answer. */
|
|
5907
|
+
label?: string;
|
|
5908
|
+
/** Which numbers are drawn; all by default. */
|
|
5909
|
+
numbers?: ClockNumbers;
|
|
5910
|
+
/** Draw the sixty minute marks as well as the twelve hour marks; on by default. */
|
|
5911
|
+
minuteMarks?: boolean;
|
|
5912
|
+
/** Layout only, such as a width: the clock fills its width and is square. */
|
|
5913
|
+
className?: string;
|
|
5914
|
+
};
|
|
5915
|
+
/**
|
|
5916
|
+
* A time as it is said in UK English on a 12-hour clock: "three o'clock", "half past three", "quarter to four",
|
|
5917
|
+
* "twenty-five past three", "seven minutes to four". The words a clock round speaks and a `ClockFace` is named by.
|
|
5918
|
+
*/
|
|
5919
|
+
export declare function clockWords(hours: number, minutes: number): string;
|
|
5920
|
+
/** An analogue clock showing one time, its hands telling hours from minutes by length, width and colour. */
|
|
5921
|
+
export declare function ClockFace({ hours, minutes, label, numbers, minuteMarks, className }: ClockFaceProps): import("react").JSX.Element;
|
|
5922
|
+
export { type ActiveItem, type AlertDialogProps, type AlertProps, type Api, type ApiOptions, type ApiPage, type AspectRatio, type AsyncAction, type AsyncActionOptions, AsyncButton, type AsyncLabels, type AudioMedia, type AutoRecorder, type AutoRecorderState, type AutoSave, type AutoSaveOptions, type AutoTake, type BinaryByteUnit, type BookPage, type BookUrl, type BookViewerProps, type BoxListProps, type BoxOverlayProps, type BoxSource, type BoxTone, type BoxedPictureProps, type BoxesState, type Brush, type BrushControl, type BrushKind, Button, type ButtonLinkProps, type ButtonProps, type ByteHighlight, type ByteRange, type ByteUnit, type ByteViewProps, type BytesOptions, COLOR_SCHEME_STORAGE_KEY, type Candidate, type CellValue, type ChartMark, type ChartSpan, type CheckboxGesture, type CheckboxProps, type Choice, type ChoiceCounts, type ChoiceGridProps, type ChoiceGroupProps, type ChoiceMarks, type ChoiceSize, type ChoiceState, type Choices, type ClientWork, type Clips, type ClipsContext, type ClipsProviderProps, type ClockFaceProps, type ClockNumbers, type ColorFieldProps, type ColorScheme, ColorSchemeChoice, type ColorSchemeLabels, type ColorSchemePreference, type ColorSchemeState, type Column, type Command, type CommandMenuProps, type CommandsOptions, type CompareAudioProps, type CompareGridProps, type CompareMode, type CompareProps, type CompareTextProps, type CompareVideoGridProps, type CompareVideoProps, type ComposerProps, type CompositionBarProps, type CompositionPart, type ConcealedProps, type ConsoleLevel, type ConsoleLine, type ConsoleProps, type ContextMenuProps, type ControlSize, type ConversationImage, type ConversationProps, type ConversationTurn, type CountOptions, type CountdownOptions, type CursorMapping, type CursorOwner, CursorScope, type CursorScopeProps, type CutChange, type CutLimit, type CutRoom, DEFAULT_PALETTE, type DataTableProps, type DateFormatter, type DateInput, type DecodedAudio, type Delivery, Density, type DensityName, type DensityProps, type DescribeError, type DialogProps, type Difference, type DifferenceState, type DisclosureOpenProps, type DisclosureProps, type DragData, type DragSourceProps, type DrawTool, type Drawing, type Box as DrawingBox, type DrawingLayerProps, type DrawingOp, type DrawingOptions, type DrawingState, type DrawingToolbarProps, type DropTarget, type Easing, type EditClip, type EditListOptions, type EditListPlayerProps, type EditListSlot, type EditListState, type EditTimes, type EditableRegion, type EntityMatch, type EntityMatcher, type ErrorBody, type Expanded, type ExpandedOptions, type FailedRemoval, type FetchJsonInit, type FetchJsonOptions, type FieldErrors, type FieldProps, type FileIntake, type FileIntakeOptions, type FileOutcome, type FilmFrame, type FilmStripProps, type Folder, type FolderListing, type FolderPickerProps, type Format, type FormatOptions, type FullscreenFrameProps, type GlimpseLook, type GlimpseProps, type GlimpseWhy, type Grid, type GroupMember, type GroupedChart, type Handle, type History, type HistoryOptions, type HistoryStateOptions, type HistoryStep, type HotkeysOptions, IconButton, type IconButtonProps, type IconComponent, type ImageMedia, type Implies, type InViewOptions, type InfiniteListProps, type InfiniteLoad, type InfiniteLoadOptions, type InitialSelection, type InkColours, type InkMatch, type InkMatchState, type InputLevelProps, type InspectorProps, type InspectorSectionProps, type Job, type JobAction, type JobActionOptions, type JobFailure, type JobOptions, type JobProgress, type JobRow, type JobStatusProps, type JobWords, type JobsTableProps, type KeyCheck, KeysLegend, type LatLng, type LightboxItem, type LightboxProps, type LightboxUrl, LineChart, LineChartGroup, type LineChartGroupProps, type LineChartProps, type LinkCardProps, type ListeningLevelProps, type Load, type LoadFailure, type LoadMoreProps, type Loudness, type MarkKind, type MarkPattern, type MarkTone, type MarkableTextProps, type MediaContentsItem, type MediaContentsProps, type MediaElementOptions, type MediaElementState, type MediaHeading, type MediaMark, MediaPlayer, type MediaPlayerProps, type MediaProblem, type MediaProgress, type MediaSession, type MediaSource, type MediaSpanData, type MediaSpansState, MediaStage, type MediaStat, type MediaStats, type MediaWindow, type MenuEntry, type MenuProps, type MeterProps, type MeterThreshold, type MetricProps, type Microphone, MicrophoneContext, MicrophoneError, type MicrophoneStream, type More, type NativeSelectProps, type NavItem, type Nib, type NumberFieldProps, type NumberFormatter, type Outbox, type OutboxItem, type OutboxOptions, type OutboxRefusal, type OutboxRequest, type OutboxSnapshot, type OutboxStatusProps, PALETTE_STORAGE_KEY, type PageNames, type Pair, type PairAnswer, type PairJudgeProps, type PairVoteProps, type PairVoteSlot, type PairVoteWords, PaletteChoice, type PaletteOption, type PaletteState, type PaneProps, type PeakPair, type PendingRemoval, type Phase, type PictureBox, type PictureRegion, type PixelImageProps, type Pixels, type PlaceBoardProps, type PlaceState, type Platform, type PlayWindowButtonProps, PlayerNotice, type PlayerWarning, type PlayerWarningEvent, type Point, type Poll, type PopoverProps, type Precision, type Property, type PropertyListProps, type PropertyRowProps, type RangeProps, type RangeSliderProps, RateChoice, type ReadAlongPart, type ReadAlongProps, type ReadAloud, type ReadAloudOptions, type ReadPixels, type Rebinding, type Recorder, type RecorderState, type Recording, type Rect, type RectLimits, type Region, type RegionEditorProps, type RegionTone, type Reserve, type ReserveOptions, type ResumeWords, type Revealed, type Block as RichBlock, type Inline as RichInline, type RichTextProps, RowAction, type RowActionProps, type RowExpansion, type RowSelection, SPEECH_RATES, type SaveState, type SayAgainProps, type SayOnShowOptions, type SayPictureProps, type Saying, type ScheduleRow, type ScheduleTableProps, type SearchParam, type SearchParamOptions, type SecretFieldProps, type SecretTestResult, SeekBar, type SeekBarProps, type SeekBarSpan, type Segment, type Segmenter, type SegmenterOptions, type SelectableGridProps, type SequenceItem, type SequenceTimelineProps, type SetOptions, type ShareBox, type SharedCursor, type Shortcut, type ShortcutOverrides, type SkipAction, type SkipLevel, type SkipSteps, type SliderProps, type Sort, type SortableListProps, type SourceAttacher, SpanActions, type SpanActionsNotice, type SpanBehaviour, type SpanKind, type SpanOutcome, SpanStrip, type SpanTone, type SpanWords, type SpeakOptions, type Speech, type SpeechLevel, type SpeechPart, StageGuides, type StageState, type StageWords, type Stale, type StrataToastRegionProps, type StreamAttachment, type StreamContext, type StreamStats, type Stroke, type StrokeChange, type StrokeNoteWords, type StrokePoint, type StrokeShape, type SwitchProps, type SystemFact, type SystemFolder, type SystemInfoLike, type SystemPanelProps, type SystemService, type TabItem, type TakeLevelProps, type TextDifference, type TextLinkProps, type TextMedia, type TextSegment, ThemeProvider, type ThumbnailProps, type TileAspect, type TileGridProps, type TileSize, TimeReadout, type TimelineChange, type TimelineClock, type TimelineClockOptions, type TimelineDrop, type TimelineItem, type TimelineLane, type TimelineMarker, type TimelinePlayerProps, type TimelineProps, type ToastContentProps, type ToggleGroupProps, type ToggleOption, type ToggleProps, type Tone, type ToolChoice, type ToolbarProps, type TooltipProps, type TranscriptGroup, type TranscriptPhrase, type TranscriptPhraseState, type TranscriptSeek, type TranscriptViewProps, type TranscriptWord, Transport, type TransportProps, type TreeNodeState, type TreeProps, type TypedApi, type Undoable, type UndoableOptions, type UseAutoRecorderOptions, type UseRecorderOptions, type UseSpeechOptions, type VideoLoop, type VideoMedia, type VideoMode, type ViewGroup, type ViewGroupRows, type ViewOptionsConfig, type ViewOptionsProps, type ViewOptionsState, type ViewPointerOptions, type ViewSort, type Viewport, type ViewportFrameProps, type ViewportState, VolumeControl, type VolumeControlProps, type WaveformMark, type WaveformMarkKind, type WaveformPeaks, type WaveformProps, type WaveformSpan, type WaveformTone, type WorkContext, type WorkPhase, type WorkflowRunLike, type WorkflowRunOptions, type WorkflowStage, type WorkflowStepsProps, type WorkflowSummaryData, type WorkflowSummaryProps, type WorkflowSummaryState, type WorkflowSummaryWords, type WorkspaceBarProps, type WorkspaceState, type YScale, browserMicrophone, buttonVariants, colorSchemeScript, explainMicrophoneError, format$1 as format, geo, isTypingTarget, keyName, logScale, marksFor, mediaStatRows, paletteScript, palettes, readPixels$1 as readPixels, skipAction, transportShortcuts, useAsyncAction, useAttachedSource, useColorScheme, useHotkeys, useMediaElement, useMediaSpans, useMediaStats, useMicrophone, usePalette, usePlayerWarnings, useSharedCursor, useSystemColorScheme, valueAt };
|
|
5899
5923
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -4480,7 +4480,7 @@ function PlayWindowButton({ media, window: w, label, size = "sm", className }) {
|
|
|
4480
4480
|
|
|
4481
4481
|
// src/components/media-spans.tsx
|
|
4482
4482
|
const lower = (label) => label.charAt(0).toLowerCase() + label.slice(1);
|
|
4483
|
-
const WORDS$
|
|
4483
|
+
const WORDS$2 = {
|
|
4484
4484
|
skip: (l) => `Skip ${lower(l)}`,
|
|
4485
4485
|
skipped: (l) => `Skipped ${lower(l)}`,
|
|
4486
4486
|
mute: (l) => `Mute ${lower(l)}`,
|
|
@@ -4492,7 +4492,7 @@ const NOTICE_MS$1 = 6e3;
|
|
|
4492
4492
|
/** Draws the spans' ranges and acts on them as playback reaches them. See the file comment for the rules. */
|
|
4493
4493
|
function useMediaSpans({ spans, kinds = {}, words, onSpan, time, playing, duration, limit = Infinity, seek, volume, setVolume }) {
|
|
4494
4494
|
const w = {
|
|
4495
|
-
...WORDS$
|
|
4495
|
+
...WORDS$2,
|
|
4496
4496
|
...words
|
|
4497
4497
|
};
|
|
4498
4498
|
const list = React.useMemo(() => {
|
|
@@ -7387,7 +7387,7 @@ const MARK_LINE = {
|
|
|
7387
7387
|
dash: "4 3"
|
|
7388
7388
|
}
|
|
7389
7389
|
};
|
|
7390
|
-
const WORDS = {
|
|
7390
|
+
const WORDS$1 = {
|
|
7391
7391
|
running: "Reading the waveform",
|
|
7392
7392
|
finished: "Waveform ready",
|
|
7393
7393
|
failed: "Could not read the waveform"
|
|
@@ -7405,7 +7405,7 @@ async function defaultDecode(data) {
|
|
|
7405
7405
|
const clamp$3 = (v, lo, hi) => Math.min(Math.max(v, lo), hi);
|
|
7406
7406
|
const clock = (t) => format.runningTime(t);
|
|
7407
7407
|
/** An audio waveform with marks, spans and a playhead: one slider you click, drag or key to seek, zoom, and a range to select. */
|
|
7408
|
-
function Waveform({ label, peaks, source, duration: given, time, onSeek, marks = [], spans = [], underlay, range: controlledRange, onRangeChange, step = 5, bigStep = 30, defaultView, buckets = 2e3, normalise = false, decode = defaultDecode, words = WORDS, disabled, className }) {
|
|
7408
|
+
function Waveform({ label, peaks, source, duration: given, time, onSeek, marks = [], spans = [], underlay, range: controlledRange, onRangeChange, step = 5, bigStep = 30, defaultView, buckets = 2e3, normalise = false, decode = defaultDecode, words = WORDS$1, disabled, className }) {
|
|
7409
7409
|
const work = useClientWork(async ({ signal, progress }) => {
|
|
7410
7410
|
const data = typeof source === "string" ? await (await fetch(source, { signal })).arrayBuffer() : await source.arrayBuffer();
|
|
7411
7411
|
progress(0, buckets + 2);
|
|
@@ -12949,7 +12949,7 @@ function useBeckon(on, open, ms) {
|
|
|
12949
12949
|
} : null;
|
|
12950
12950
|
}
|
|
12951
12951
|
const TILE = "min(var(--type-picture-size, 4.5rem), 75cqi)";
|
|
12952
|
-
const WORD$1 = /^\p{L}[\p{L}\p{M}' -]*$/u;
|
|
12952
|
+
const WORD$1 = /^\p{L}[\p{L}\p{M}'’ -]*$/u;
|
|
12953
12953
|
const WORD_SHARE = 140;
|
|
12954
12954
|
const letters = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
12955
12955
|
/** A tile's picture: the `type-picture` step, but never more than 75% of the tile it sits in (the tile is a size
|
|
@@ -22687,7 +22687,7 @@ function settleCut(wanted, grid, room) {
|
|
|
22687
22687
|
|
|
22688
22688
|
// src/components/sequence-timeline.tsx
|
|
22689
22689
|
const seconds = (n) => `${tidy(Math.round(n * 10) / 10)} s`;
|
|
22690
|
-
const at = (t) => tickLabel(t, .1);
|
|
22690
|
+
const at$1 = (t) => tickLabel(t, .1);
|
|
22691
22691
|
/** A gapless strip of windows whose cuts are dragged or stepped, snapping to a beat grid inside the room the app gives; each cut is a slider that announces both windows' new lengths; Shift+click chooses a run. */
|
|
22692
22692
|
function SequenceTimeline({ label, items, zoom, onCutChange, room, minLength = .1, grid, step = .1, selected = [], onSelectRange, renderItem, height = "5rem", className }) {
|
|
22693
22693
|
const start = items[0]?.start ?? 0;
|
|
@@ -22731,7 +22731,7 @@ function SequenceTimeline({ label, items, zoom, onCutChange, room, minLength = .
|
|
|
22731
22731
|
start: time
|
|
22732
22732
|
}
|
|
22733
22733
|
});
|
|
22734
|
-
const words = (i, time) => `Cut ${i + 1} moved to ${at(time)}. Window ${i + 1} is ${seconds(time - items[i].start)}, window ${i + 2} is ${seconds(items[i + 1].end - time)}.`;
|
|
22734
|
+
const words = (i, time) => `Cut ${i + 1} moved to ${at$1(time)}. Window ${i + 1} is ${seconds(time - items[i].start)}, window ${i + 2} is ${seconds(items[i + 1].end - time)}.`;
|
|
22735
22735
|
const timeAt = (clientX) => {
|
|
22736
22736
|
const box = track.current?.getBoundingClientRect();
|
|
22737
22737
|
if (!box || !box.width) return start;
|
|
@@ -22751,7 +22751,7 @@ function SequenceTimeline({ label, items, zoom, onCutChange, room, minLength = .
|
|
|
22751
22751
|
const { time, limit } = clampToRoom(tidy(target), r);
|
|
22752
22752
|
if (Math.abs(time - now) < 1e-9) {
|
|
22753
22753
|
const why = limit?.reason ?? (e.key === "End" || e.key === "ArrowRight" ? r.maxReason : r.minReason);
|
|
22754
|
-
setSaid(`Cut ${i + 1} stays at ${at(now)}.${why ? ` ${why}` : ""}`);
|
|
22754
|
+
setSaid(`Cut ${i + 1} stays at ${at$1(now)}.${why ? ` ${why}` : ""}`);
|
|
22755
22755
|
return;
|
|
22756
22756
|
}
|
|
22757
22757
|
onCutChange(i, time, change(i, time));
|
|
@@ -22772,7 +22772,7 @@ function SequenceTimeline({ label, items, zoom, onCutChange, room, minLength = .
|
|
|
22772
22772
|
setDrag({
|
|
22773
22773
|
index: drag.index,
|
|
22774
22774
|
time,
|
|
22775
|
-
refused: limit ? `Cut ${drag.index + 1} stops at ${at(limit.at)}.${limit.reason ? ` ${limit.reason}` : ""}` : null
|
|
22775
|
+
refused: limit ? `Cut ${drag.index + 1} stops at ${at$1(limit.at)}.${limit.reason ? ` ${limit.reason}` : ""}` : null
|
|
22776
22776
|
});
|
|
22777
22777
|
};
|
|
22778
22778
|
const release = () => {
|
|
@@ -22832,7 +22832,7 @@ function SequenceTimeline({ label, items, zoom, onCutChange, room, minLength = .
|
|
|
22832
22832
|
return /* @__PURE__ */ jsx("button", {
|
|
22833
22833
|
type: "button",
|
|
22834
22834
|
"aria-pressed": on,
|
|
22835
|
-
"aria-label": `${it.label}, ${at(it.start)} to ${at(it.end)}`,
|
|
22835
|
+
"aria-label": `${it.label}, ${at$1(it.start)} to ${at$1(it.end)}`,
|
|
22836
22836
|
onClick: (e) => choose(e, it.id),
|
|
22837
22837
|
className: cn("absolute inset-y-0 min-w-0 cursor-pointer overflow-hidden rounded-control border px-1.5 text-left transition-state", on ? "border-primary bg-primary/10" : "border-border bg-muted hover:bg-muted/70"),
|
|
22838
22838
|
style: {
|
|
@@ -22858,7 +22858,7 @@ function SequenceTimeline({ label, items, zoom, onCutChange, room, minLength = .
|
|
|
22858
22858
|
"aria-valuemin": r.min,
|
|
22859
22859
|
"aria-valuemax": r.max,
|
|
22860
22860
|
"aria-valuenow": now,
|
|
22861
|
-
"aria-valuetext": at(now),
|
|
22861
|
+
"aria-valuetext": at$1(now),
|
|
22862
22862
|
"data-cut": i,
|
|
22863
22863
|
onKeyDown: (e) => keys(e, i),
|
|
22864
22864
|
onPointerDown: (e) => begin(e, i),
|
|
@@ -23540,5 +23540,160 @@ function FolderPicker({ label, useFolders: useListing, value, onChange, onChoose
|
|
|
23540
23540
|
});
|
|
23541
23541
|
}
|
|
23542
23542
|
|
|
23543
|
-
|
|
23543
|
+
// src/components/clock-face.tsx
|
|
23544
|
+
const WORDS = [
|
|
23545
|
+
"twelve",
|
|
23546
|
+
"one",
|
|
23547
|
+
"two",
|
|
23548
|
+
"three",
|
|
23549
|
+
"four",
|
|
23550
|
+
"five",
|
|
23551
|
+
"six",
|
|
23552
|
+
"seven",
|
|
23553
|
+
"eight",
|
|
23554
|
+
"nine",
|
|
23555
|
+
"ten",
|
|
23556
|
+
"eleven"
|
|
23557
|
+
];
|
|
23558
|
+
const MINUTE_WORDS = {
|
|
23559
|
+
5: "five",
|
|
23560
|
+
10: "ten",
|
|
23561
|
+
20: "twenty",
|
|
23562
|
+
25: "twenty-five"
|
|
23563
|
+
};
|
|
23564
|
+
const NUMBER_WORDS = [
|
|
23565
|
+
"",
|
|
23566
|
+
"one",
|
|
23567
|
+
"two",
|
|
23568
|
+
"three",
|
|
23569
|
+
"four",
|
|
23570
|
+
"five",
|
|
23571
|
+
"six",
|
|
23572
|
+
"seven",
|
|
23573
|
+
"eight",
|
|
23574
|
+
"nine",
|
|
23575
|
+
"ten",
|
|
23576
|
+
"eleven",
|
|
23577
|
+
"twelve",
|
|
23578
|
+
"thirteen",
|
|
23579
|
+
"fourteen",
|
|
23580
|
+
"fifteen",
|
|
23581
|
+
"sixteen",
|
|
23582
|
+
"seventeen",
|
|
23583
|
+
"eighteen",
|
|
23584
|
+
"nineteen",
|
|
23585
|
+
"twenty"
|
|
23586
|
+
];
|
|
23587
|
+
/** "one" to "twenty-nine", for the minutes said as a number ("seven minutes past three"). */
|
|
23588
|
+
function minuteWord(n) {
|
|
23589
|
+
if (n <= 20) return NUMBER_WORDS[n] ?? String(n);
|
|
23590
|
+
return `twenty-${NUMBER_WORDS[n - 20]}`;
|
|
23591
|
+
}
|
|
23592
|
+
/**
|
|
23593
|
+
* A time as it is said in UK English on a 12-hour clock: "three o'clock", "half past three", "quarter to four",
|
|
23594
|
+
* "twenty-five past three", "seven minutes to four". The words a clock round speaks and a `ClockFace` is named by.
|
|
23595
|
+
*/
|
|
23596
|
+
function clockWords(hours, minutes) {
|
|
23597
|
+
const m = (Math.round(minutes) % 60 + 60) % 60;
|
|
23598
|
+
const hour = (n) => WORDS[(n % 12 + 12) % 12];
|
|
23599
|
+
if (m === 0) return `${hour(hours)} o’clock`;
|
|
23600
|
+
if (m === 30) return `half past ${hour(hours)}`;
|
|
23601
|
+
const past = m < 30;
|
|
23602
|
+
const n = past ? m : 60 - m;
|
|
23603
|
+
const amount = n === 15 ? "quarter" : MINUTE_WORDS[n] ?? `${minuteWord(n)} minute${n === 1 ? "" : "s"}`;
|
|
23604
|
+
return past ? `${amount} past ${hour(hours)}` : `${amount} to ${hour(hours + 1)}`;
|
|
23605
|
+
}
|
|
23606
|
+
const C = 100;
|
|
23607
|
+
/** A point `r` from the centre at `deg` clockwise from 12. */
|
|
23608
|
+
function at(deg, r) {
|
|
23609
|
+
const a = (deg - 90) * Math.PI / 180;
|
|
23610
|
+
return {
|
|
23611
|
+
x: C + r * Math.cos(a),
|
|
23612
|
+
y: C + r * Math.sin(a)
|
|
23613
|
+
};
|
|
23614
|
+
}
|
|
23615
|
+
/** An analogue clock showing one time, its hands telling hours from minutes by length, width and colour. */
|
|
23616
|
+
function ClockFace({ hours, minutes, label, numbers = "all", minuteMarks = true, className }) {
|
|
23617
|
+
const m = (minutes % 60 + 60) % 60;
|
|
23618
|
+
const hourAngle = (hours % 12 + 12) % 12 * 30 + m / 2;
|
|
23619
|
+
const minuteAngle = m * 6;
|
|
23620
|
+
const shown = (n) => numbers === "all" || numbers === "quarters" && n % 3 === 0;
|
|
23621
|
+
const marks = Array.from({ length: minuteMarks ? 60 : 12 }, (_, i) => minuteMarks ? i : i * 5);
|
|
23622
|
+
const hand = (deg, length) => {
|
|
23623
|
+
const tip = at(deg, length);
|
|
23624
|
+
const tail = at(deg + 180, 10);
|
|
23625
|
+
return {
|
|
23626
|
+
x1: tail.x,
|
|
23627
|
+
y1: tail.y,
|
|
23628
|
+
x2: tip.x,
|
|
23629
|
+
y2: tip.y
|
|
23630
|
+
};
|
|
23631
|
+
};
|
|
23632
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
23633
|
+
viewBox: "0 0 200 200",
|
|
23634
|
+
role: "img",
|
|
23635
|
+
"aria-label": label ?? clockWords(hours, minutes),
|
|
23636
|
+
className: cn("block aspect-square w-48", className),
|
|
23637
|
+
children: [
|
|
23638
|
+
/* @__PURE__ */ jsx("circle", {
|
|
23639
|
+
cx: C,
|
|
23640
|
+
cy: C,
|
|
23641
|
+
r: 94,
|
|
23642
|
+
strokeWidth: 6,
|
|
23643
|
+
className: "fill-card stroke-border"
|
|
23644
|
+
}),
|
|
23645
|
+
marks.map((i) => {
|
|
23646
|
+
const hourMark = i % 5 === 0;
|
|
23647
|
+
const outer = at(i * 6, 89);
|
|
23648
|
+
const inner = at(i * 6, hourMark ? 82 : 86);
|
|
23649
|
+
return /* @__PURE__ */ jsx("line", {
|
|
23650
|
+
"data-mark": hourMark ? "hour" : "minute",
|
|
23651
|
+
x1: outer.x,
|
|
23652
|
+
y1: outer.y,
|
|
23653
|
+
x2: inner.x,
|
|
23654
|
+
y2: inner.y,
|
|
23655
|
+
strokeWidth: hourMark ? 3.5 : 1.5,
|
|
23656
|
+
strokeLinecap: "round",
|
|
23657
|
+
className: hourMark ? "stroke-foreground" : "stroke-muted-foreground"
|
|
23658
|
+
}, i);
|
|
23659
|
+
}),
|
|
23660
|
+
Array.from({ length: 12 }, (_, i) => i + 1).filter(shown).map((n) => {
|
|
23661
|
+
const p = at(n * 30, 70);
|
|
23662
|
+
return /* @__PURE__ */ jsx("text", {
|
|
23663
|
+
x: p.x,
|
|
23664
|
+
y: p.y,
|
|
23665
|
+
textAnchor: "middle",
|
|
23666
|
+
dominantBaseline: "central",
|
|
23667
|
+
fontSize: 20,
|
|
23668
|
+
className: "fill-foreground font-semibold tabular-nums",
|
|
23669
|
+
children: n
|
|
23670
|
+
}, n);
|
|
23671
|
+
}),
|
|
23672
|
+
/* @__PURE__ */ jsx("line", {
|
|
23673
|
+
"data-hand": "hour",
|
|
23674
|
+
"data-angle": hourAngle,
|
|
23675
|
+
...hand(hourAngle, 38),
|
|
23676
|
+
strokeWidth: 9,
|
|
23677
|
+
strokeLinecap: "round",
|
|
23678
|
+
className: "stroke-foreground"
|
|
23679
|
+
}),
|
|
23680
|
+
/* @__PURE__ */ jsx("line", {
|
|
23681
|
+
"data-hand": "minute",
|
|
23682
|
+
"data-angle": minuteAngle,
|
|
23683
|
+
...hand(minuteAngle, 58),
|
|
23684
|
+
strokeWidth: 5,
|
|
23685
|
+
strokeLinecap: "round",
|
|
23686
|
+
className: "stroke-primary"
|
|
23687
|
+
}),
|
|
23688
|
+
/* @__PURE__ */ jsx("circle", {
|
|
23689
|
+
cx: C,
|
|
23690
|
+
cy: C,
|
|
23691
|
+
r: 7,
|
|
23692
|
+
className: "fill-foreground"
|
|
23693
|
+
})
|
|
23694
|
+
]
|
|
23695
|
+
});
|
|
23696
|
+
}
|
|
23697
|
+
|
|
23698
|
+
export { ActiveList, Alert, AlertDialog, AppShell, AsyncButton, BRUSHES, BookViewer, BoxList, BoxOverlay, BoxedPicture, Breadcrumb, BulkBar, Button, ButtonLink, ByteView, COLOR_SCHEME_STORAGE_KEY, Checkbox, ChoiceGrid, ChoiceGridSkeleton, ChoiceGroup, ClipsProvider, ClockFace, ColorField, ColorSchemeChoice, CommandLegend, CommandMenu, Compare, CompareAudio, CompareGrid, CompareText, CompareVideo, CompareVideoGrid, Composer, CompositionBar, Concealed, Console, ContextMenu, Conversation, CursorScope, DEFAULT_PALETTE, DEFAULT_TOLERANCE, DataTable, DataView$1 as DataView, Density, Dialog, Disclosure, Done, DragSource, DrawingLayer, DrawingToolbar, EditListPlayer, EmptyState, FIT, Field, FileButton, FileDropOverlay, FileDropZone, FileOutcomes, FilmStrip, FolderPicker, FullscreenFrame, Glimpse, HttpError, INK_COLOURS, IconButton, InfiniteList, Input, InputLevel, Inspector, InspectorSection, JobStatus, JobsTable, KeysLegend, LEVEL_FLOOR_DB, Lightbox, LineChart, LineChartGroup, LinkCard, LinkCardList, ListeningLevel, LoadError, LoadMore, MAX_SCALE, MAX_SIDE, MIN_SCALE, MISSING, Mark, MarkSummary, MarkableText, MediaContents, MediaGroup, MediaPlayer, MediaStage, Menu, Meter, Metric, MetricStrip, MicrophoneContext, MicrophoneError, MissingFile, NBSP, NativeSelect, NumberField, OutboxStatus, PALETTE_STORAGE_KEY, PageHeader, PairJudge, PairVote, PaletteChoice, Pane, PauseButton, PixelImage, PlaceBoard, PlayWindowButton, PlayerNotice, Popover, PropertyList, PropertyRow, RangeSlider, RateChoice, ReadAlong, RegionEditor, RichText, RowAction, SPEECH_RATES, STRATA_DRAG_TYPE, SaveStatus, SayAgain, SayPicture, ScheduleTable, SecretField, SeekBar, SelectableGrid, SelectableGridSkeleton, SequenceTimeline, ShortcutEditor, SideNav, Skeleton, Slider, SortableList, SpanActions, SpanStrip, Split, StageGuides, StaleNotice, Status, StrataQueryProvider, StrataToastRegion, Switch, SystemPanel, TableSkeleton, Tabs, TakeLevel, TextLink, Textarea, ThemeProvider, Thumbnail, ThumbnailSkeleton, TileGrid, TileGridSkeleton, TimeReadout, Timeline, TimelinePlayer, TimelineZoomControls, Toggle, ToggleGroup, Toolbar, ToolbarSeparator, Tooltip, TranscriptView, Transport, Tree, UndoBar, ViewOptions, ViewportFrame, VirtualList, VolumeControl, Waveform, WorkflowSteps, WorkflowSummary, Workspace, WorkspaceBar, actualPixelsScale, ancestorsOf, apiPage, appBase, applyOp, boxViewport, browserMicrophone, buttonVariants, canFullscreen, canPlayClips, canSay, canSpeak, checkKey, clampToRoom, clampViewport, clipsQueryKey, clockWords, cn, colorSchemeScript, commandShortcut, continues, countMarks, createApi, createFormat, createOutbox, createQueryClient, createReserve, createSegmenter, createTypedApi, crossedThreshold, currentItem, currentOf, curvePoints, describeActionError, describeHttpError, describeRegion, describeWorkflowSummary, detectPlatform, diffWords, differences, diskThresholds, drawRect, drawingToSvg, ease, editTimeOf, editTimes, emptyDrawing, encodeWav, errorPayload, explainMicrophoneError, feedbackMarker, fetchJson, fieldErrorsOf, filterMarkup, findPage, fitPoints, fitRect, followAim, format, formatChord, frameAt, gainToVolume, geo, gridPoints, gutterOf, hitsStroke, inkMatch, inputLevelThresholds, invertOp, isDoubtful, isRefusal, isReservedChord, isSpeaking, isTaskRunning, isTypingTarget, isWorkflowRunning, jobProgressText, joinMediaGroup, joinRects, joinSamples, keyName, labelOf, lerpRect, locateInEdit, logScale, loudnessOf, marksFor, matchEntities, matchGains, matchesAccept, matchesChord, measureLoudness, mediaStatRows, moveGutter, movePoints, moveRect, newStrokeId, nextBreak, noOverlap, normaliseAngle, pageName, paletteScript, palettes, parentOf, parseChord, parseInline, parseRichText, parseSort, peakDb, peakGain, peaksFromAudio, phraseAt, phraseDoubtful, phraseOfWordId, pickEvenly, pickVoice, pixelZoom, plainText, pointsBox, rangeBetween, readErrorBody, readPixels, readingOrder, regionShares, regionStyle, replay, resample, resamplePeaks, rescaleDrawing, resizeRect, rgbaToBlob, rmsDb, safeHref, sayPosition, serialiseSort, settleCut, simplifyPoints, skipAction, smoothPath, snapToGrid, sortRows, speak, speechLevel, splitRect, staleOf, stepId, stepOnGrid, stopSpeaking, strokeAt, strokeBox, strokeShape, summariseWorkflow, textOf, tickLabel, tickStep, ticksBetween, toDate, toLoad, toPeakPair, toast, toastTimeout, transportShortcuts, turnRect, turnedSize, typeSteps, useActiveItem, useAsyncAction, useAttachedSource, useAutoRecorder, useAutoSave, useBookUrl, useBoxes, useChoices, useClientWork, useClips, useColorScheme, useCommands, useCountdown, useDifference, useDrawing, useEditList, useExpanded, useFileIntake, useHistory, useHistoryState, useHotkeys, useInView, useInfiniteLoad, useInkMatch, useJob, useJobAction, useLeaveGuard, useLightboxUrl, useLoad, useMediaElement, useMediaSpans, useMediaStats, useMicrophone, useObjectUrl, useOutbox, useOutboxStarted, usePalette, usePlayerWarnings, usePoll, useReadAloud, useRebindableShortcuts, useRecorder, useReserve, useRevealed, useSayOnShow, useSearchParam, useSelection, useSettledStatus, useSharedCursor, useSpeaking, useSpeech, useSystemColorScheme, useSystemInfo, useTimeline, useTimelineZoom, useUndoable, useViewOptions, useViewPointers, useViewport, useWheelZoom, useWorkflowRun, useWorkspaceState, valueAt, viewOf, viewsOf, widthsOf, withBase, wordAt, wordId, zoomAt, zoomToBox };
|
|
23544
23699
|
//# sourceMappingURL=index.js.map
|