strata-react 2.1.11 → 2.1.13
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/{field-BY42OY3g.js → field-S12YUQxn.js} +18 -1
- package/dist/field-S12YUQxn.js.map +1 -0
- package/dist/index.d.ts +138 -44
- package/dist/index.js +269 -18
- package/dist/index.js.map +1 -1
- package/dist/map.js +2 -2
- package/dist/{microphone-Db5o3SHZ.js → microphone-Bt02Ky5u.js} +2 -2
- package/dist/{microphone-Db5o3SHZ.js.map → microphone-Bt02Ky5u.js.map} +1 -1
- package/dist/panorama.js +1 -1
- package/dist/testing.js +2 -2
- package/dist/{theme-5Mb1ydlA.js → theme-kCizTI4-.js} +2 -2
- package/dist/{theme-5Mb1ydlA.js.map → theme-kCizTI4-.js.map} +1 -1
- package/dist/{value-controls-i1aGyO_3.js → value-controls-04bfBLdb.js} +2 -2
- package/dist/{value-controls-i1aGyO_3.js.map → value-controls-04bfBLdb.js.map} +1 -1
- package/package.json +1 -1
- package/dist/field-BY42OY3g.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { i as typeSteps, n as KeyText, r as cn, t as Tooltip } from "./tooltip-BosfsWYh.js";
|
|
2
|
-
import { a as Textarea, c as useSearchParam, d as createFormat, f as format, i as NativeSelect, l as MISSING, n as Field, o as useFieldControl, p as toDate, r as Input, s as controlHeight, t as ChoiceGroup, u as NBSP } from "./field-
|
|
2
|
+
import { a as Textarea, c as useSearchParam, d as createFormat, f as format, i as NativeSelect, l as MISSING, n as Field, o as useFieldControl, p as toDate, r as Input, s as controlHeight, t as ChoiceGroup, u as NBSP } from "./field-S12YUQxn.js";
|
|
3
3
|
import { a as isDev, i as buttonVariants, n as IconButton, o as useInView, r as RowAction, t as Button } from "./button-CjnotDTb.js";
|
|
4
4
|
import { t as followAim } from "./follow-CXQsL86O.js";
|
|
5
5
|
import { n as useViewPointers, r as useWheelZoom, t as useSettledStatus } from "./viewer-input-3Qa-o35k.js";
|
|
6
|
-
import { A as StrataQueryProvider, C as toast, D as LoadError, E as EmptyState, F as useLoad, I as usePoll, L as overlaySurface, M as fetchJson, N as staleOf, O as Skeleton, P as toLoad, S as StrataToastRegion, T as DataView$1, _ as clampViewport, a as useMicrophone, b as viewportTransform, d as zoomToBox, f as FIT, g as boxViewport, h as actualPixelsScale, i as explainMicrophoneError, j as createQueryClient, k as StaleNotice, l as readingOrder, m as MIN_SCALE, n as MicrophoneError, o as Thumbnail, p as MAX_SCALE, r as browserMicrophone, s as ThumbnailSkeleton, t as MicrophoneContext, u as regionStyle, v as frameBoxToShares, w as toastTimeout, x as zoomAt, y as regionShares } from "./microphone-
|
|
7
|
-
import { a as AsyncButton, c as ToolbarSeparator, d as keyName, f as useHotkeys, i as Slider, l as KeysLegend, n as NumberField, o as useAsyncAction, r as RangeSlider, s as Toolbar, t as ColorField, u as isTypingTarget } from "./value-controls-
|
|
6
|
+
import { A as StrataQueryProvider, C as toast, D as LoadError, E as EmptyState, F as useLoad, I as usePoll, L as overlaySurface, M as fetchJson, N as staleOf, O as Skeleton, P as toLoad, S as StrataToastRegion, T as DataView$1, _ as clampViewport, a as useMicrophone, b as viewportTransform, d as zoomToBox, f as FIT, g as boxViewport, h as actualPixelsScale, i as explainMicrophoneError, j as createQueryClient, k as StaleNotice, l as readingOrder, m as MIN_SCALE, n as MicrophoneError, o as Thumbnail, p as MAX_SCALE, r as browserMicrophone, s as ThumbnailSkeleton, t as MicrophoneContext, u as regionStyle, v as frameBoxToShares, w as toastTimeout, x as zoomAt, y as regionShares } from "./microphone-Bt02Ky5u.js";
|
|
7
|
+
import { a as AsyncButton, c as ToolbarSeparator, d as keyName, f as useHotkeys, i as Slider, l as KeysLegend, n as NumberField, o as useAsyncAction, r as RangeSlider, s as Toolbar, t as ColorField, u as isTypingTarget } from "./value-controls-04bfBLdb.js";
|
|
8
8
|
import { n as useSharedCursor, r as geo, t as CursorScope } from "./cursor-Cwyvgwsw.js";
|
|
9
9
|
import { a as fieldErrorsOf, i as errorPayload, n as describeActionError, o as readErrorBody, r as describeHttpError, t as HttpError } from "./errors-CmuwcWlb.js";
|
|
10
|
-
import { a as PaletteChoice, c as paletteScript, d as usePalette, f as useSystemColorScheme, i as PALETTE_STORAGE_KEY, l as palettes, n as ColorSchemeChoice, o as ThemeProvider, p as Density, r as DEFAULT_PALETTE, s as colorSchemeScript, t as COLOR_SCHEME_STORAGE_KEY, u as useColorScheme } from "./theme-
|
|
10
|
+
import { a as PaletteChoice, c as paletteScript, d as usePalette, f as useSystemColorScheme, i as PALETTE_STORAGE_KEY, l as palettes, n as ColorSchemeChoice, o as ThemeProvider, p as Density, r as DEFAULT_PALETTE, s as colorSchemeScript, t as COLOR_SCHEME_STORAGE_KEY, u as useColorScheme } from "./theme-kCizTI4-.js";
|
|
11
11
|
import * as React from "react";
|
|
12
12
|
import { Autocomplete, Button as Button$1, Cell, Checkbox as Checkbox$1, Collection, Column, Dialog as Dialog$1, DialogTrigger, Disclosure as Disclosure$1, DisclosurePanel, DropIndicator, DropZone, FileTrigger, GridLayout, GridList, GridListItem, Header, Heading, Input as Input$1, Keyboard, Link, ListBox, ListBoxItem, ListLayout, ListStateContext, Menu as Menu$1, MenuItem, MenuSection, MenuTrigger, Modal, ModalOverlay, Popover as Popover$1, RouterProvider, Row, SearchField, Select, SelectValue, Separator, Slider as Slider$1, SliderThumb, SliderTrack, SubmenuTrigger, Switch as Switch$1, Tab, TabList, TabPanel, Table, TableBody, TableHeader, TableLayout, Tabs as Tabs$1, Text, ToggleButton, ToggleButtonGroup, Tree as Tree$1, TreeItem, TreeItemContent, Virtualizer, useDragAndDrop, useFilter } from "react-aria-components";
|
|
13
13
|
import { ArrowDown, ArrowUp, ArrowUpDown, ArrowUpRight, Ban, Brush, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronsUp, CircleAlert, CircleCheck, CircleDashed, Clock, CloudOff, Columns2, Ellipsis, Eraser, Eye, EyeOff, FastForward, FileQuestion, Flag, Folder, FolderOpen, FolderX, GripVertical, Hand, Highlighter, ImageOff, Info, KeyRound, LayoutGrid, List, Loader, LoaderCircle, Lock, Maximize, Maximize2, Minimize, Minus, MousePointer2, Paintbrush, PanelBottomClose, PanelBottomOpen, PanelLeftClose, PanelLeftOpen, PanelRightClose, PanelRightOpen, PanelTopClose, PanelTopOpen, Pause, PenLine, Pencil, Play, Redo2, Rewind, RotateCcw, RotateCw, Scan, Search, Send, SkipBack, SkipForward, SlidersHorizontal, Square, StepBack, StepForward, Trash2, TriangleAlert, Undo2, Upload, Volume2, VolumeX, X, ZoomIn, ZoomOut } from "lucide-react";
|
|
@@ -2858,9 +2858,9 @@ function useChoices({ initial = [], implies, format: fmt = format } = {}) {
|
|
|
2858
2858
|
};
|
|
2859
2859
|
}
|
|
2860
2860
|
/** The bar for a selection: a polite live count ("2 bookings selected"), the bulk actions, and Clear selection. Renders only the live region while nothing is chosen. */
|
|
2861
|
-
function BulkBar({ count, noun, onClear, children, format: format$
|
|
2861
|
+
function BulkBar({ count, noun, onClear, children, format: format$2 = format, className }) {
|
|
2862
2862
|
const [one, many] = typeof noun === "string" ? [noun, `${noun}s`] : noun;
|
|
2863
|
-
const label = `${format$
|
|
2863
|
+
const label = `${format$2.count(count, one, many)} selected`;
|
|
2864
2864
|
return /* @__PURE__ */ jsxs("div", {
|
|
2865
2865
|
className: cn(count > 0 && "flex flex-wrap items-center gap-x-4 gap-y-2 rounded-surface bg-surface-sunken py-1.5 pr-1.5 pl-3", className),
|
|
2866
2866
|
children: [/* @__PURE__ */ jsx("p", {
|
|
@@ -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);
|
|
@@ -10440,6 +10440,102 @@ function Console({ label, lines, onCommand, complete, historyKey, height = 320,
|
|
|
10440
10440
|
});
|
|
10441
10441
|
}
|
|
10442
10442
|
|
|
10443
|
+
// src/components/event-log.tsx
|
|
10444
|
+
function formatPayload(payload) {
|
|
10445
|
+
if (typeof payload === "string") return payload;
|
|
10446
|
+
return JSON.stringify(payload, null, 2);
|
|
10447
|
+
}
|
|
10448
|
+
function EventBody({ payload, detail }) {
|
|
10449
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
10450
|
+
className: "grid min-w-0 gap-2",
|
|
10451
|
+
children: [payload !== void 0 && /* @__PURE__ */ jsx("pre", {
|
|
10452
|
+
className: "overflow-x-auto rounded-control bg-muted p-2 font-mono type-body-sm text-foreground",
|
|
10453
|
+
children: formatPayload(payload)
|
|
10454
|
+
}), detail]
|
|
10455
|
+
});
|
|
10456
|
+
}
|
|
10457
|
+
function EventImages({ images }) {
|
|
10458
|
+
if (images.length === 0) return null;
|
|
10459
|
+
return /* @__PURE__ */ jsx("div", {
|
|
10460
|
+
className: "flex flex-wrap gap-3",
|
|
10461
|
+
children: images.map((img) => {
|
|
10462
|
+
const thumb = /* @__PURE__ */ jsx(Thumbnail, {
|
|
10463
|
+
src: img.src,
|
|
10464
|
+
alt: img.alt,
|
|
10465
|
+
aspect: img.aspect ?? "4/3",
|
|
10466
|
+
fit: "contain",
|
|
10467
|
+
missing: img.missing ?? "Image unavailable",
|
|
10468
|
+
className: "w-36 rounded-control border border-border bg-surface-sunken"
|
|
10469
|
+
});
|
|
10470
|
+
return img.href ? /* @__PURE__ */ jsx("a", {
|
|
10471
|
+
href: img.href,
|
|
10472
|
+
target: "_blank",
|
|
10473
|
+
rel: "noreferrer",
|
|
10474
|
+
className: "block rounded-control focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",
|
|
10475
|
+
children: thumb
|
|
10476
|
+
}, `${img.src}-${img.alt}`) : /* @__PURE__ */ jsx("div", { children: thumb }, `${img.src}-${img.alt}`);
|
|
10477
|
+
})
|
|
10478
|
+
});
|
|
10479
|
+
}
|
|
10480
|
+
/** Ordered, structured event ledger for run histories, agent traces, and audit logs. */
|
|
10481
|
+
function EventLog({ entries, label = "Events", format: format$1 = format, collapsible = false, expanded, empty, className }) {
|
|
10482
|
+
if (entries.length === 0) return empty ? /* @__PURE__ */ jsx(Fragment, { children: empty }) : null;
|
|
10483
|
+
return /* @__PURE__ */ jsx("ol", {
|
|
10484
|
+
"aria-label": label,
|
|
10485
|
+
className: cn("grid min-w-0", className),
|
|
10486
|
+
children: entries.map((entry) => {
|
|
10487
|
+
const key = String(entry.id);
|
|
10488
|
+
const hasBody = entry.payload !== void 0 || entry.detail !== void 0;
|
|
10489
|
+
const header = /* @__PURE__ */ jsxs("div", {
|
|
10490
|
+
className: "flex flex-wrap items-baseline gap-x-3 gap-y-1 type-body-sm",
|
|
10491
|
+
children: [
|
|
10492
|
+
entry.seq !== void 0 && /* @__PURE__ */ jsxs("span", {
|
|
10493
|
+
className: "font-mono text-muted-foreground tabular-nums",
|
|
10494
|
+
children: ["#", entry.seq]
|
|
10495
|
+
}),
|
|
10496
|
+
/* @__PURE__ */ jsx("span", {
|
|
10497
|
+
className: "font-mono font-medium text-foreground",
|
|
10498
|
+
children: entry.kind
|
|
10499
|
+
}),
|
|
10500
|
+
entry.status && /* @__PURE__ */ jsx(Status, {
|
|
10501
|
+
tone: entry.tone ?? "neutral",
|
|
10502
|
+
children: entry.status
|
|
10503
|
+
}),
|
|
10504
|
+
entry.summary && /* @__PURE__ */ jsx("span", {
|
|
10505
|
+
className: "text-muted-foreground",
|
|
10506
|
+
children: entry.summary
|
|
10507
|
+
}),
|
|
10508
|
+
entry.at != null && /* @__PURE__ */ jsx("time", {
|
|
10509
|
+
className: "text-muted-foreground tabular-nums",
|
|
10510
|
+
children: format$1.dateTime(entry.at)
|
|
10511
|
+
})
|
|
10512
|
+
]
|
|
10513
|
+
});
|
|
10514
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
10515
|
+
className: "grid min-w-0 gap-2 border-b border-border py-3 last:border-b-0",
|
|
10516
|
+
children: [collapsible && hasBody ? expanded ? /* @__PURE__ */ jsx(Disclosure, {
|
|
10517
|
+
summary: header,
|
|
10518
|
+
open: expanded.isOpen(key),
|
|
10519
|
+
onOpenChange: (open) => expanded.setOpen(key, open),
|
|
10520
|
+
children: /* @__PURE__ */ jsx(EventBody, {
|
|
10521
|
+
payload: entry.payload,
|
|
10522
|
+
detail: entry.detail
|
|
10523
|
+
})
|
|
10524
|
+
}) : /* @__PURE__ */ jsx(Disclosure, {
|
|
10525
|
+
summary: header,
|
|
10526
|
+
children: /* @__PURE__ */ jsx(EventBody, {
|
|
10527
|
+
payload: entry.payload,
|
|
10528
|
+
detail: entry.detail
|
|
10529
|
+
})
|
|
10530
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [header, hasBody && /* @__PURE__ */ jsx(EventBody, {
|
|
10531
|
+
payload: entry.payload,
|
|
10532
|
+
detail: entry.detail
|
|
10533
|
+
})] }), entry.images && entry.images.length > 0 && /* @__PURE__ */ jsx(EventImages, { images: entry.images })]
|
|
10534
|
+
}, key);
|
|
10535
|
+
})
|
|
10536
|
+
});
|
|
10537
|
+
}
|
|
10538
|
+
|
|
10443
10539
|
// src/components/shortcut-editor.tsx
|
|
10444
10540
|
const idOf = (s) => s.id ?? s.label;
|
|
10445
10541
|
const MODIFIER_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -12949,7 +13045,7 @@ function useBeckon(on, open, ms) {
|
|
|
12949
13045
|
} : null;
|
|
12950
13046
|
}
|
|
12951
13047
|
const TILE = "min(var(--type-picture-size, 4.5rem), 75cqi)";
|
|
12952
|
-
const WORD$1 = /^\p{L}[\p{L}\p{M}' -]*$/u;
|
|
13048
|
+
const WORD$1 = /^\p{L}[\p{L}\p{M}'’ -]*$/u;
|
|
12953
13049
|
const WORD_SHARE = 140;
|
|
12954
13050
|
const letters = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
12955
13051
|
/** 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 +22783,7 @@ function settleCut(wanted, grid, room) {
|
|
|
22687
22783
|
|
|
22688
22784
|
// src/components/sequence-timeline.tsx
|
|
22689
22785
|
const seconds = (n) => `${tidy(Math.round(n * 10) / 10)} s`;
|
|
22690
|
-
const at = (t) => tickLabel(t, .1);
|
|
22786
|
+
const at$1 = (t) => tickLabel(t, .1);
|
|
22691
22787
|
/** 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
22788
|
function SequenceTimeline({ label, items, zoom, onCutChange, room, minLength = .1, grid, step = .1, selected = [], onSelectRange, renderItem, height = "5rem", className }) {
|
|
22693
22789
|
const start = items[0]?.start ?? 0;
|
|
@@ -22731,7 +22827,7 @@ function SequenceTimeline({ label, items, zoom, onCutChange, room, minLength = .
|
|
|
22731
22827
|
start: time
|
|
22732
22828
|
}
|
|
22733
22829
|
});
|
|
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)}.`;
|
|
22830
|
+
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
22831
|
const timeAt = (clientX) => {
|
|
22736
22832
|
const box = track.current?.getBoundingClientRect();
|
|
22737
22833
|
if (!box || !box.width) return start;
|
|
@@ -22751,7 +22847,7 @@ function SequenceTimeline({ label, items, zoom, onCutChange, room, minLength = .
|
|
|
22751
22847
|
const { time, limit } = clampToRoom(tidy(target), r);
|
|
22752
22848
|
if (Math.abs(time - now) < 1e-9) {
|
|
22753
22849
|
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}` : ""}`);
|
|
22850
|
+
setSaid(`Cut ${i + 1} stays at ${at$1(now)}.${why ? ` ${why}` : ""}`);
|
|
22755
22851
|
return;
|
|
22756
22852
|
}
|
|
22757
22853
|
onCutChange(i, time, change(i, time));
|
|
@@ -22772,7 +22868,7 @@ function SequenceTimeline({ label, items, zoom, onCutChange, room, minLength = .
|
|
|
22772
22868
|
setDrag({
|
|
22773
22869
|
index: drag.index,
|
|
22774
22870
|
time,
|
|
22775
|
-
refused: limit ? `Cut ${drag.index + 1} stops at ${at(limit.at)}.${limit.reason ? ` ${limit.reason}` : ""}` : null
|
|
22871
|
+
refused: limit ? `Cut ${drag.index + 1} stops at ${at$1(limit.at)}.${limit.reason ? ` ${limit.reason}` : ""}` : null
|
|
22776
22872
|
});
|
|
22777
22873
|
};
|
|
22778
22874
|
const release = () => {
|
|
@@ -22832,7 +22928,7 @@ function SequenceTimeline({ label, items, zoom, onCutChange, room, minLength = .
|
|
|
22832
22928
|
return /* @__PURE__ */ jsx("button", {
|
|
22833
22929
|
type: "button",
|
|
22834
22930
|
"aria-pressed": on,
|
|
22835
|
-
"aria-label": `${it.label}, ${at(it.start)} to ${at(it.end)}`,
|
|
22931
|
+
"aria-label": `${it.label}, ${at$1(it.start)} to ${at$1(it.end)}`,
|
|
22836
22932
|
onClick: (e) => choose(e, it.id),
|
|
22837
22933
|
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
22934
|
style: {
|
|
@@ -22858,7 +22954,7 @@ function SequenceTimeline({ label, items, zoom, onCutChange, room, minLength = .
|
|
|
22858
22954
|
"aria-valuemin": r.min,
|
|
22859
22955
|
"aria-valuemax": r.max,
|
|
22860
22956
|
"aria-valuenow": now,
|
|
22861
|
-
"aria-valuetext": at(now),
|
|
22957
|
+
"aria-valuetext": at$1(now),
|
|
22862
22958
|
"data-cut": i,
|
|
22863
22959
|
onKeyDown: (e) => keys(e, i),
|
|
22864
22960
|
onPointerDown: (e) => begin(e, i),
|
|
@@ -23540,5 +23636,160 @@ function FolderPicker({ label, useFolders: useListing, value, onChange, onChoose
|
|
|
23540
23636
|
});
|
|
23541
23637
|
}
|
|
23542
23638
|
|
|
23543
|
-
|
|
23639
|
+
// src/components/clock-face.tsx
|
|
23640
|
+
const WORDS = [
|
|
23641
|
+
"twelve",
|
|
23642
|
+
"one",
|
|
23643
|
+
"two",
|
|
23644
|
+
"three",
|
|
23645
|
+
"four",
|
|
23646
|
+
"five",
|
|
23647
|
+
"six",
|
|
23648
|
+
"seven",
|
|
23649
|
+
"eight",
|
|
23650
|
+
"nine",
|
|
23651
|
+
"ten",
|
|
23652
|
+
"eleven"
|
|
23653
|
+
];
|
|
23654
|
+
const MINUTE_WORDS = {
|
|
23655
|
+
5: "five",
|
|
23656
|
+
10: "ten",
|
|
23657
|
+
20: "twenty",
|
|
23658
|
+
25: "twenty-five"
|
|
23659
|
+
};
|
|
23660
|
+
const NUMBER_WORDS = [
|
|
23661
|
+
"",
|
|
23662
|
+
"one",
|
|
23663
|
+
"two",
|
|
23664
|
+
"three",
|
|
23665
|
+
"four",
|
|
23666
|
+
"five",
|
|
23667
|
+
"six",
|
|
23668
|
+
"seven",
|
|
23669
|
+
"eight",
|
|
23670
|
+
"nine",
|
|
23671
|
+
"ten",
|
|
23672
|
+
"eleven",
|
|
23673
|
+
"twelve",
|
|
23674
|
+
"thirteen",
|
|
23675
|
+
"fourteen",
|
|
23676
|
+
"fifteen",
|
|
23677
|
+
"sixteen",
|
|
23678
|
+
"seventeen",
|
|
23679
|
+
"eighteen",
|
|
23680
|
+
"nineteen",
|
|
23681
|
+
"twenty"
|
|
23682
|
+
];
|
|
23683
|
+
/** "one" to "twenty-nine", for the minutes said as a number ("seven minutes past three"). */
|
|
23684
|
+
function minuteWord(n) {
|
|
23685
|
+
if (n <= 20) return NUMBER_WORDS[n] ?? String(n);
|
|
23686
|
+
return `twenty-${NUMBER_WORDS[n - 20]}`;
|
|
23687
|
+
}
|
|
23688
|
+
/**
|
|
23689
|
+
* A time as it is said in UK English on a 12-hour clock: "three o'clock", "half past three", "quarter to four",
|
|
23690
|
+
* "twenty-five past three", "seven minutes to four". The words a clock round speaks and a `ClockFace` is named by.
|
|
23691
|
+
*/
|
|
23692
|
+
function clockWords(hours, minutes) {
|
|
23693
|
+
const m = (Math.round(minutes) % 60 + 60) % 60;
|
|
23694
|
+
const hour = (n) => WORDS[(n % 12 + 12) % 12];
|
|
23695
|
+
if (m === 0) return `${hour(hours)} o’clock`;
|
|
23696
|
+
if (m === 30) return `half past ${hour(hours)}`;
|
|
23697
|
+
const past = m < 30;
|
|
23698
|
+
const n = past ? m : 60 - m;
|
|
23699
|
+
const amount = n === 15 ? "quarter" : MINUTE_WORDS[n] ?? `${minuteWord(n)} minute${n === 1 ? "" : "s"}`;
|
|
23700
|
+
return past ? `${amount} past ${hour(hours)}` : `${amount} to ${hour(hours + 1)}`;
|
|
23701
|
+
}
|
|
23702
|
+
const C = 100;
|
|
23703
|
+
/** A point `r` from the centre at `deg` clockwise from 12. */
|
|
23704
|
+
function at(deg, r) {
|
|
23705
|
+
const a = (deg - 90) * Math.PI / 180;
|
|
23706
|
+
return {
|
|
23707
|
+
x: C + r * Math.cos(a),
|
|
23708
|
+
y: C + r * Math.sin(a)
|
|
23709
|
+
};
|
|
23710
|
+
}
|
|
23711
|
+
/** An analogue clock showing one time, its hands telling hours from minutes by length, width and colour. */
|
|
23712
|
+
function ClockFace({ hours, minutes, label, numbers = "all", minuteMarks = true, className }) {
|
|
23713
|
+
const m = (minutes % 60 + 60) % 60;
|
|
23714
|
+
const hourAngle = (hours % 12 + 12) % 12 * 30 + m / 2;
|
|
23715
|
+
const minuteAngle = m * 6;
|
|
23716
|
+
const shown = (n) => numbers === "all" || numbers === "quarters" && n % 3 === 0;
|
|
23717
|
+
const marks = Array.from({ length: minuteMarks ? 60 : 12 }, (_, i) => minuteMarks ? i : i * 5);
|
|
23718
|
+
const hand = (deg, length) => {
|
|
23719
|
+
const tip = at(deg, length);
|
|
23720
|
+
const tail = at(deg + 180, 10);
|
|
23721
|
+
return {
|
|
23722
|
+
x1: tail.x,
|
|
23723
|
+
y1: tail.y,
|
|
23724
|
+
x2: tip.x,
|
|
23725
|
+
y2: tip.y
|
|
23726
|
+
};
|
|
23727
|
+
};
|
|
23728
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
23729
|
+
viewBox: "0 0 200 200",
|
|
23730
|
+
role: "img",
|
|
23731
|
+
"aria-label": label ?? clockWords(hours, minutes),
|
|
23732
|
+
className: cn("block aspect-square w-48", className),
|
|
23733
|
+
children: [
|
|
23734
|
+
/* @__PURE__ */ jsx("circle", {
|
|
23735
|
+
cx: C,
|
|
23736
|
+
cy: C,
|
|
23737
|
+
r: 94,
|
|
23738
|
+
strokeWidth: 6,
|
|
23739
|
+
className: "fill-card stroke-border"
|
|
23740
|
+
}),
|
|
23741
|
+
marks.map((i) => {
|
|
23742
|
+
const hourMark = i % 5 === 0;
|
|
23743
|
+
const outer = at(i * 6, 89);
|
|
23744
|
+
const inner = at(i * 6, hourMark ? 82 : 86);
|
|
23745
|
+
return /* @__PURE__ */ jsx("line", {
|
|
23746
|
+
"data-mark": hourMark ? "hour" : "minute",
|
|
23747
|
+
x1: outer.x,
|
|
23748
|
+
y1: outer.y,
|
|
23749
|
+
x2: inner.x,
|
|
23750
|
+
y2: inner.y,
|
|
23751
|
+
strokeWidth: hourMark ? 3.5 : 1.5,
|
|
23752
|
+
strokeLinecap: "round",
|
|
23753
|
+
className: hourMark ? "stroke-foreground" : "stroke-muted-foreground"
|
|
23754
|
+
}, i);
|
|
23755
|
+
}),
|
|
23756
|
+
Array.from({ length: 12 }, (_, i) => i + 1).filter(shown).map((n) => {
|
|
23757
|
+
const p = at(n * 30, 70);
|
|
23758
|
+
return /* @__PURE__ */ jsx("text", {
|
|
23759
|
+
x: p.x,
|
|
23760
|
+
y: p.y,
|
|
23761
|
+
textAnchor: "middle",
|
|
23762
|
+
dominantBaseline: "central",
|
|
23763
|
+
fontSize: 20,
|
|
23764
|
+
className: "fill-foreground font-semibold tabular-nums",
|
|
23765
|
+
children: n
|
|
23766
|
+
}, n);
|
|
23767
|
+
}),
|
|
23768
|
+
/* @__PURE__ */ jsx("line", {
|
|
23769
|
+
"data-hand": "hour",
|
|
23770
|
+
"data-angle": hourAngle,
|
|
23771
|
+
...hand(hourAngle, 38),
|
|
23772
|
+
strokeWidth: 9,
|
|
23773
|
+
strokeLinecap: "round",
|
|
23774
|
+
className: "stroke-foreground"
|
|
23775
|
+
}),
|
|
23776
|
+
/* @__PURE__ */ jsx("line", {
|
|
23777
|
+
"data-hand": "minute",
|
|
23778
|
+
"data-angle": minuteAngle,
|
|
23779
|
+
...hand(minuteAngle, 58),
|
|
23780
|
+
strokeWidth: 5,
|
|
23781
|
+
strokeLinecap: "round",
|
|
23782
|
+
className: "stroke-primary"
|
|
23783
|
+
}),
|
|
23784
|
+
/* @__PURE__ */ jsx("circle", {
|
|
23785
|
+
cx: C,
|
|
23786
|
+
cy: C,
|
|
23787
|
+
r: 7,
|
|
23788
|
+
className: "fill-foreground"
|
|
23789
|
+
})
|
|
23790
|
+
]
|
|
23791
|
+
});
|
|
23792
|
+
}
|
|
23793
|
+
|
|
23794
|
+
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, EventLog, 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
23795
|
//# sourceMappingURL=index.js.map
|