strata-react 1.0.15 → 1.0.20

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.
@@ -0,0 +1,318 @@
1
+ // src/lib/format.ts
2
+ var NBSP = "\xA0";
3
+ /** The placeholder printed for a value that is not known: an en dash. */
4
+ var MISSING = "–";
5
+ var BYTE_UNITS = [
6
+ "B",
7
+ "kB",
8
+ "MB",
9
+ "GB",
10
+ "TB",
11
+ "PB"
12
+ ];
13
+ var BYTE_SIZE = Object.fromEntries(BYTE_UNITS.map((u, i) => [u, 1e3 ** i]));
14
+ /** A Date from a Date, an ISO string or epoch milliseconds; throws a RangeError naming the input when it is not a date. */
15
+ function toDate(value) {
16
+ const date = value instanceof Date ? value : new Date(value);
17
+ if (Number.isNaN(date.getTime())) throw new RangeError(`Not a date: ${JSON.stringify(String(value))}`);
18
+ return date;
19
+ }
20
+ function callableDate(df, missing) {
21
+ const format = (value) => value == null ? missing : df.format(toDate(value));
22
+ return Object.assign(format, {
23
+ format,
24
+ formatToParts: (value) => df.formatToParts(toDate(value)),
25
+ formatRange: (start, end) => df.formatRange(toDate(start), toDate(end)),
26
+ resolvedOptions: () => df.resolvedOptions()
27
+ });
28
+ }
29
+ function callable(nf, missing) {
30
+ const format = (value) => value == null ? missing : nf.format(value);
31
+ return Object.assign(format, {
32
+ format,
33
+ formatToParts: (value) => nf.formatToParts(value),
34
+ resolvedOptions: () => nf.resolvedOptions()
35
+ });
36
+ }
37
+ var DAY = 864e5;
38
+ var AGO_STEPS = [
39
+ ["year", 365 * DAY],
40
+ ["month", 30 * DAY],
41
+ ["week", 7 * DAY],
42
+ ["day", DAY],
43
+ ["hour", 36e5],
44
+ ["minute", 6e4]
45
+ ];
46
+ /** Intl formatters for one locale (and optionally one time zone): integers, decimals, percent, dates, times, units with a non-breaking space, byte sizes, and counted nouns. */
47
+ function createFormat(locale, options = {}) {
48
+ const { timeZone, missing = "–" } = options;
49
+ const dates = (opts) => callableDate(new Intl.DateTimeFormat(locale, {
50
+ ...opts,
51
+ timeZone
52
+ }), missing);
53
+ const integer = callable(new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }), missing);
54
+ const decimal = callable(new Intl.NumberFormat(locale, { maximumFractionDigits: 1 }), missing);
55
+ const percent = callable(new Intl.NumberFormat(locale, {
56
+ style: "percent",
57
+ maximumFractionDigits: 0
58
+ }), missing);
59
+ const compact = callable(new Intl.NumberFormat(locale, {
60
+ notation: "compact",
61
+ maximumFractionDigits: 1
62
+ }), missing);
63
+ const relative = new Intl.RelativeTimeFormat(locale, { numeric: "auto" });
64
+ const plurals = new Intl.PluralRules(locale);
65
+ const clock = dates({
66
+ hour: "2-digit",
67
+ minute: "2-digit"
68
+ });
69
+ const day = dates({
70
+ weekday: "long",
71
+ day: "numeric",
72
+ month: "long"
73
+ });
74
+ const shortDay = dates({
75
+ weekday: "short",
76
+ hour: "2-digit",
77
+ minute: "2-digit"
78
+ });
79
+ const date = dates({ dateStyle: "medium" });
80
+ const dateTime = dates({
81
+ dateStyle: "medium",
82
+ timeStyle: "short"
83
+ });
84
+ const withUnit = (value, unit, fmt = integer) => `${fmt.format(value)} ${unit}`;
85
+ return {
86
+ locale,
87
+ /** The zone times are shown in, or `undefined` for the viewer's own. */
88
+ timeZone,
89
+ /** Whole numbers with grouping: `format.integer(1222)` is "1,222". */
90
+ integer,
91
+ /** One decimal place at most: `format.decimal(3.14)` is "3.1". */
92
+ decimal,
93
+ /** A ratio as a whole percent: `format.percent(0.42)` is "42%". */
94
+ percent,
95
+ /**
96
+ * A part's share of a whole, as `percent` but never misleading at the ends: a part above 0 that
97
+ * rounds to 0 is "<1%", and one short of the whole that rounds to 100 is ">99%".
98
+ * `format.share(2.4 / 512)` is "<1%".
99
+ */
100
+ share: (value) => {
101
+ if (value == null || Number.isNaN(value)) return missing;
102
+ if (value > 0 && value < .005) return `<${percent.format(.01)}`;
103
+ if (value >= .995 && value < 1) return `>${percent.format(.99)}`;
104
+ return percent.format(value);
105
+ },
106
+ /** A figure in short form for counts that run to thousands: `format.compact(1234)` is "1.2k" in en-GB, "1.2K" in en-US. */
107
+ compact,
108
+ /**
109
+ * How long ago (or how far ahead) a time is, in the largest unit it reaches:
110
+ * "3 weeks ago", "yesterday", "in 2 hours", "now" under a minute. Pass `now` in tests.
111
+ */
112
+ ago: (value, now = /* @__PURE__ */ new Date()) => {
113
+ if (value == null) return missing;
114
+ const diff = toDate(value).getTime() - toDate(now).getTime();
115
+ const span = Math.abs(diff);
116
+ for (const [unit, size] of AGO_STEPS) if (span >= size) return relative.format(Math.sign(diff) * Math.floor(span / size), unit);
117
+ return relative.format(0, "second");
118
+ },
119
+ /**
120
+ * A media running time from seconds, as a player shows it: "4:05", "1:02:09". Unknown
121
+ * (null, negative, not finite) prints the placeholder. Set it in `tabular-nums`.
122
+ */
123
+ runningTime: (seconds) => {
124
+ if (seconds == null || !Number.isFinite(seconds) || seconds < 0) return missing;
125
+ const s = Math.floor(seconds);
126
+ const two = (n) => String(n).padStart(2, "0");
127
+ const [h, m] = [Math.floor(s / 3600), Math.floor(s % 3600 / 60)];
128
+ return h > 0 ? `${h}:${two(m)}:${two(s % 60)}` : `${m}:${two(s % 60)}`;
129
+ },
130
+ /**
131
+ * A position in media as an editor shows it, to a chosen precision: "4:05" (seconds), "4:05.250"
132
+ * (`"ms"`), or "0:04:05:07" (`"frames"` at `fps`, the last part the frame). Hours appear only
133
+ * from one hour, except in frames. Frames are always four parts, hours included, as SMPTE
134
+ * timecode is (non-drop frame, with colons): a three-part "1:05:00" reads as one hour five, so
135
+ * a frame count must never be three. Editors write the same four parts (strata-react issue
136
+ * #122). Floors, never rounds up, so a time never reads ahead of the picture. Unknown (null,
137
+ * negative, not finite) prints the placeholder. Set it in `tabular-nums`.
138
+ */
139
+ timecode: (seconds, { precision = "seconds", fps = 30 } = {}) => {
140
+ if (seconds == null || !Number.isFinite(seconds) || seconds < 0) return missing;
141
+ const whole = Math.floor(seconds);
142
+ const two = (n) => String(n).padStart(2, "0");
143
+ const [h, m] = [Math.floor(whole / 3600), Math.floor(whole % 3600 / 60)];
144
+ const base = h > 0 ? `${h}:${two(m)}:${two(whole % 60)}` : `${m}:${two(whole % 60)}`;
145
+ if (precision === "ms") return `${base}.${String(Math.min(Math.floor((seconds - whole) * 1e3 + 1e-6), 999)).padStart(3, "0")}`;
146
+ if (precision === "frames") return `${h}:${two(m)}:${two(whole % 60)}:${two(Math.min(Math.floor((seconds - whole) * fps + 1e-6), Math.ceil(fps) - 1))}`;
147
+ return base;
148
+ },
149
+ /** What a missing value prints as: an en dash unless `createFormat`'s `missing` says otherwise. */
150
+ missing,
151
+ /** A time of day: `format.clock(at)` is "06:05". */
152
+ clock,
153
+ /** A day without its year, for this week's things: `format.day(at)` is "Sunday 8 November". */
154
+ day,
155
+ /** A weekday and time, for chart axes and recent rows: `format.shortDay(at)` is "Sun 06:05". */
156
+ shortDay,
157
+ /** A date with its year, for a record or a deadline: `format.date(at)` is "8 Nov 2026". */
158
+ date,
159
+ /** A date and time, for a log or history row: `format.dateTime(at)` is "8 Nov 2026, 06:05". */
160
+ dateTime,
161
+ /** A figure and its unit joined by a non-breaking space (`NBSP`), so they never wrap apart. */
162
+ withUnit,
163
+ /** A temperature in °C, joined by a non-breaking space. */
164
+ celsius: (value) => withUnit(value, "°C"),
165
+ /**
166
+ * A size in bytes in the largest decimal unit it reaches (kB, MB, GB, TB, as disks and
167
+ * networks are sold): one decimal below 10 ("5.2 GB"), whole above ("431 GB"). Pass `unit`
168
+ * to fix the unit, so figures compared side by side ("431 of 466 GB") share one.
169
+ */
170
+ bytes: (value, unit) => {
171
+ const chosen = unit ?? [...BYTE_UNITS].reverse().find((u) => Math.abs(value) >= BYTE_SIZE[u]) ?? "B";
172
+ const scaled = value / BYTE_SIZE[chosen];
173
+ return withUnit(scaled, chosen, Math.abs(scaled) < 10 && chosen !== "B" ? decimal : integer);
174
+ },
175
+ /**
176
+ * A distance in metres as a person says it: metres under a kilometre ("850 m"), then
177
+ * kilometres, one decimal below 100 ("12.4 km"), whole above; `"imperial"` is feet under a
178
+ * tenth of a mile ("320 ft"), then miles ("7.7 mi").
179
+ */
180
+ distance: (metres, system = "metric") => {
181
+ if (system === "imperial") {
182
+ const miles = metres / 1609.344;
183
+ return miles < .1 ? withUnit(metres * 3.28084, "ft") : withUnit(miles, "mi", miles < 100 ? decimal : integer);
184
+ }
185
+ return Math.abs(metres) < 1e3 ? withUnit(metres, "m") : withUnit(metres / 1e3, "km", Math.abs(metres) < 1e5 ? decimal : integer);
186
+ },
187
+ /** The unit `bytes` would choose for a value, to share it across a set of figures. */
188
+ byteUnit: (value) => [...BYTE_UNITS].reverse().find((u) => Math.abs(value) >= BYTE_SIZE[u]) ?? "B",
189
+ /**
190
+ * "1 piece", "6 pieces": the count and its noun, so copy never reads "1 pieces". They are
191
+ * joined by a non-breaking space (`NBSP`), not a plain one: in a test, match with the same
192
+ * call or a `\s` regex, not a typed "6 pieces" string in a role's `name`.
193
+ */
194
+ count: (value, one, many = `${one}s`, { compact: short = false } = {}) => value == null ? missing : `${(short ? compact : integer).format(value)} ${plurals.select(value) === "one" ? one : many}`
195
+ };
196
+ }
197
+ /** The en-GB formatters. */
198
+ var format = createFormat("en-GB");
199
+ // src/lib/geo.ts
200
+ var RAD = Math.PI / 180;
201
+ var EARTH_RADIUS_M = 6371e3;
202
+ /** Great-circle distance between two positions, in metres. */
203
+ function distance([lat1, lng1], [lat2, lng2]) {
204
+ const a = Math.sin((lat2 - lat1) * RAD / 2) ** 2 + Math.cos(lat1 * RAD) * Math.cos(lat2 * RAD) * Math.sin((lng2 - lng1) * RAD / 2) ** 2;
205
+ return 2 * EARTH_RADIUS_M * Math.asin(Math.sqrt(a));
206
+ }
207
+ /** The direction from `a` to `b` in degrees clockwise from north (0 to 360), for neighbouring points. */
208
+ function bearing([lat1, lng1], [lat2, lng2]) {
209
+ const dx = (lng2 - lng1) * Math.cos((lat1 + lat2) / 2 * Math.PI / 180);
210
+ const dy = lat2 - lat1;
211
+ return (Math.atan2(dx, dy) * 180 / Math.PI + 360) % 360;
212
+ }
213
+ /** The running distance along a route at each point, in metres, starting at 0. */
214
+ function cumulative(points) {
215
+ const out = points.length ? [0] : [];
216
+ for (let i = 1; i < points.length; i++) out.push(out[i - 1] + distance(points[i - 1], points[i]));
217
+ return out;
218
+ }
219
+ /** The length of a route in metres. */
220
+ function length(points) {
221
+ let total = 0;
222
+ for (let i = 1; i < points.length; i++) total += distance(points[i - 1], points[i]);
223
+ return total;
224
+ }
225
+ /** The south-west and north-east corners that hold every point, or null for none. */
226
+ function bounds(points) {
227
+ if (!points.length) return null;
228
+ let south = Infinity;
229
+ let north = -Infinity;
230
+ let west = Infinity;
231
+ let east = -Infinity;
232
+ for (const [lat, lng] of points) {
233
+ if (lat < south) south = lat;
234
+ if (lat > north) north = lat;
235
+ if (lng < west) west = lng;
236
+ if (lng > east) east = lng;
237
+ }
238
+ return [[south, west], [north, east]];
239
+ }
240
+ /** The position `metres` along a route (clamped to its ends), by linear interpolation, or null for no points. */
241
+ function pointAlong(points, metres, along = cumulative(points)) {
242
+ if (!points.length) return null;
243
+ const total = along[along.length - 1];
244
+ const d = Math.min(Math.max(metres, 0), total);
245
+ if (points.length === 1 || total === 0) return points[0];
246
+ let lo = 1;
247
+ let hi = points.length - 1;
248
+ while (lo < hi) {
249
+ const mid = lo + hi >> 1;
250
+ if (along[mid] < d) lo = mid + 1;
251
+ else hi = mid;
252
+ }
253
+ const [p, q] = [points[lo - 1], points[lo]];
254
+ const t = (d - along[lo - 1]) / (along[lo] - along[lo - 1] || 1);
255
+ return [p[0] + (q[0] - p[0]) * t, p[1] + (q[1] - p[1]) * t];
256
+ }
257
+ /**
258
+ * `count` positions evenly spaced by distance along a route (the ends skipped), each with the
259
+ * direction of travel there. The direction is smoothed: the bearing from a point a fraction
260
+ * (`window`) of the spacing before to one the same distance after, so GPS jitter and a tight bend
261
+ * do not turn a chevron sideways.
262
+ */
263
+ function arrows(points, count = 5, window = .4) {
264
+ if (points.length < 2 || count < 1) return [];
265
+ const along = cumulative(points);
266
+ const total = along[along.length - 1];
267
+ if (total === 0) return [];
268
+ const spacing = total / (count + 1);
269
+ const half = spacing * window;
270
+ return Array.from({ length: count }, (_, i) => {
271
+ const target = spacing * (i + 1);
272
+ const before = pointAlong(points, target - half, along);
273
+ const after = pointAlong(points, target + half, along);
274
+ return {
275
+ position: pointAlong(points, target, along),
276
+ bearing: bearing(before, after)
277
+ };
278
+ });
279
+ }
280
+ /** The first and last positions, and whether they are within `loopWithin` metres of each other (a loop), or null for no route. */
281
+ function ends(points, loopWithin = 50) {
282
+ if (!points.length) return null;
283
+ const start = points[0];
284
+ const finish = points[points.length - 1];
285
+ return {
286
+ start,
287
+ finish,
288
+ loop: distance(start, finish) <= loopWithin
289
+ };
290
+ }
291
+ /** The index of the point nearest `position`, for "where on the route is this?". */
292
+ function nearest(points, position) {
293
+ let best = -1;
294
+ let bestD = Infinity;
295
+ points.forEach((p, i) => {
296
+ const d = distance(p, position);
297
+ if (d < bestD) {
298
+ bestD = d;
299
+ best = i;
300
+ }
301
+ });
302
+ return best;
303
+ }
304
+ /** Route geometry helpers: `geo.distance`, `bearing`, `length`, `cumulative`, `bounds`, `pointAlong`, `arrows`, `ends`, `nearest`. */
305
+ var geo = {
306
+ distance,
307
+ bearing,
308
+ cumulative,
309
+ length,
310
+ bounds,
311
+ pointAlong,
312
+ arrows,
313
+ ends,
314
+ nearest
315
+ };
316
+ export { format as a, createFormat as i, MISSING as n, toDate as o, NBSP as r, geo as t };
317
+
318
+ //# sourceMappingURL=geo-C0jcFp4q.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geo-C0jcFp4q.js","names":[],"sources":["../src/lib/format.ts","../src/lib/geo.ts"],"sourcesContent":["// Every number and date on screen goes through Intl, once, here. Units are joined with a\n// non-breaking space so \"212 °C\" never wraps between figure and unit. A product that is not\n// en-GB calls createFormat with its locale once and exports the result from its own lib.\n//\n// The number formatters are callable (`format.integer(n)`) because that is the form people reach\n// for (strata-react issue #12), and they keep Intl's methods (`format.integer.format(n)`,\n// `formatToParts`, `resolvedOptions`) so existing calls and Intl knowledge still work.\n//\n// Dates follow the same shape. Every date formatter is callable with a Date, an ISO string or\n// epoch milliseconds (`format.dateTime(row.at)`), because rows arrive from an API as ISO strings\n// and an app that has to wrap each one in `new Date(...)` soon builds its own Intl.DateTimeFormat\n// beside it instead (strata-react issue #31, from the Bright Horizons History screen). An invalid\n// date throws a RangeError naming the input rather than printing \"Invalid Date\" into a row.\n// `date` and `dateTime` use Intl's medium/short styles, so the locale decides the order\n// (\"8 Nov 2026, 06:05\" in en-GB, \"Nov 8, 2026, 6:05 AM\" in en-US) and nobody hand-writes a\n// pattern. `timeZone` is optional: left out, times are the viewer's; a product that shows a place's\n// times (a kiln in one room, a shop's opening hours) passes that place's zone once.\n//\n// Tests: the non-breaking space is a real character in the DOM. Testing Library's text matchers\n// (`getByText`, `toHaveTextContent`) collapse whitespace and match \"6 pieces\", but accessible-name\n// matching (`getByRole(\"heading\", { name: \"6 pieces\" })`) compares the name exactly and does not.\n// Build the expected string with the same formatter (`{ name: format.count(6, \"piece\") }`), or\n// use a regex with `\\s` (`/6\\spieces/`), which matches U+00A0.\n//\n// A value that is not known (`null` or `undefined`: a count the source does not give, a date for\n// something never synced) prints as the placeholder, an en dash unless `createFormat`'s `missing`\n// says otherwise, from every number and date formatter (strata-react issue #47). Each screen used\n// to pick its own (\"–\", \"Never\", blank), so tables and cards disagreed. An invalid date still\n// throws: that is a bug, not a missing value.\n//\n// Three formatters came from the Tubes viewer, which wrote its own (strata-react issue #52): `ago`\n// (\"3 weeks ago\", from Intl.RelativeTimeFormat, with `now` passed in by tests), `compact` (\"1.2k\"\n// in en-GB, and `count`'s `{ compact: true }` for \"1.2k views\") and `runningTime` (\"4:05\", \"1:02:09\"), the\n// m:ss of a media player, which Intl.DurationFormat's long form is not. `share` is `percent` for a\n// part of a whole (strata-react issue #43): a part that is there never prints as \"0%\", nor a part\n// short of the whole as \"100%\".\n\nexport const NBSP = \" \";\n\n/** The placeholder printed for a value that is not known: an en dash. */\nexport const MISSING = \"–\";\n\n/** The decimal byte units `format.bytes` writes. */\nexport type ByteUnit = \"B\" | \"kB\" | \"MB\" | \"GB\" | \"TB\" | \"PB\";\nconst BYTE_UNITS: readonly ByteUnit[] = [\"B\", \"kB\", \"MB\", \"GB\", \"TB\", \"PB\"];\nconst BYTE_SIZE = Object.fromEntries(BYTE_UNITS.map((u, i) => [u, 1000 ** i])) as Record<ByteUnit, number>;\n\n/** An `Intl.NumberFormat` that can also be called directly: `f(n)` is `f.format(n)`. `null` or `undefined` prints the placeholder. */\nexport type NumberFormatter = ((value: number | bigint | Intl.StringNumericLiteral | null | undefined) => string) & {\n format: (value: number | bigint | Intl.StringNumericLiteral | null | undefined) => string;\n} & Pick<Intl.NumberFormat, \"formatToParts\" | \"resolvedOptions\">;\n\n/** What a date formatter accepts: a Date, an ISO 8601 string, or epoch milliseconds. */\nexport type DateInput = Date | string | number;\n\n/** An `Intl.DateTimeFormat` that can also be called directly, with a Date, an ISO string or epoch milliseconds. */\nexport type DateFormatter = ((value: DateInput | null | undefined) => string) & {\n format: (value: DateInput | null | undefined) => string;\n formatToParts: (value: DateInput) => Intl.DateTimeFormatPart[];\n formatRange: (start: DateInput, end: DateInput) => string;\n} & Pick<Intl.DateTimeFormat, \"resolvedOptions\">;\n\n/** Options shared by every date formatter one `createFormat` call makes. */\nexport interface FormatOptions {\n /** An IANA zone (\"Europe/London\", \"UTC\") to show times in. Left out, times are the viewer's own. */\n timeZone?: string;\n /** What a missing value (`null`, `undefined`) prints as. Default an en dash (`MISSING`). */\n missing?: string;\n}\n\n/** Options for `format.count`. */\nexport interface CountOptions {\n /** Write the figure compactly: \"1.2k views\". The noun still agrees with the exact count. */\n compact?: boolean;\n}\n\n/** A Date from a Date, an ISO string or epoch milliseconds; throws a RangeError naming the input when it is not a date. */\nexport function toDate(value: DateInput): Date {\n const date = value instanceof Date ? value : new Date(value);\n if (Number.isNaN(date.getTime())) throw new RangeError(`Not a date: ${JSON.stringify(String(value))}`);\n return date;\n}\n\nfunction callableDate(df: Intl.DateTimeFormat, missing: string): DateFormatter {\n const format = (value: DateInput | null | undefined) => (value == null ? missing : df.format(toDate(value)));\n return Object.assign(format, {\n format,\n formatToParts: (value: DateInput) => df.formatToParts(toDate(value)),\n formatRange: (start: DateInput, end: DateInput) => df.formatRange(toDate(start), toDate(end)),\n resolvedOptions: () => df.resolvedOptions(),\n });\n}\n\nfunction callable(nf: Intl.NumberFormat, missing: string): NumberFormatter {\n const format = (value: number | bigint | Intl.StringNumericLiteral | null | undefined) => (value == null ? missing : nf.format(value));\n return Object.assign(format, {\n format,\n formatToParts: (value: number | bigint) => nf.formatToParts(value),\n resolvedOptions: () => nf.resolvedOptions(),\n });\n}\n\n// Largest first: `ago` says a span in the largest unit it fills at least once, rounded down, so\n// 13 days is \"last week\" and 20 days \"2 weeks ago\", never \"3 weeks\" too early.\nconst DAY = 86_400_000;\nconst AGO_STEPS: readonly [Intl.RelativeTimeFormatUnit, number][] = [\n [\"year\", 365 * DAY],\n [\"month\", 30 * DAY],\n [\"week\", 7 * DAY],\n [\"day\", DAY],\n [\"hour\", 3_600_000],\n [\"minute\", 60_000],\n];\n\n/** Intl formatters for one locale (and optionally one time zone): integers, decimals, percent, dates, times, units with a non-breaking space, byte sizes, and counted nouns. */\nexport function createFormat(locale: string, options: FormatOptions = {}) {\n const { timeZone, missing = MISSING } = options;\n const dates = (opts: Intl.DateTimeFormatOptions) => callableDate(new Intl.DateTimeFormat(locale, { ...opts, timeZone }), missing);\n const integer = callable(new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }), missing);\n const decimal = callable(new Intl.NumberFormat(locale, { maximumFractionDigits: 1 }), missing);\n const percent = callable(new Intl.NumberFormat(locale, { style: \"percent\", maximumFractionDigits: 0 }), missing);\n const compact = callable(new Intl.NumberFormat(locale, { notation: \"compact\", maximumFractionDigits: 1 }), missing);\n const relative = new Intl.RelativeTimeFormat(locale, { numeric: \"auto\" });\n const plurals = new Intl.PluralRules(locale);\n const clock = dates({ hour: \"2-digit\", minute: \"2-digit\" });\n const day = dates({ weekday: \"long\", day: \"numeric\", month: \"long\" });\n const shortDay = dates({ weekday: \"short\", hour: \"2-digit\", minute: \"2-digit\" });\n const date = dates({ dateStyle: \"medium\" });\n const dateTime = dates({ dateStyle: \"medium\", timeStyle: \"short\" });\n const withUnit = (value: number, unit: string, fmt: Pick<Intl.NumberFormat, \"format\"> = integer) =>\n `${fmt.format(value)}${NBSP}${unit}`;\n return {\n locale,\n /** The zone times are shown in, or `undefined` for the viewer's own. */\n timeZone,\n /** Whole numbers with grouping: `format.integer(1222)` is \"1,222\". */\n integer,\n /** One decimal place at most: `format.decimal(3.14)` is \"3.1\". */\n decimal,\n /** A ratio as a whole percent: `format.percent(0.42)` is \"42%\". */\n percent,\n /**\n * A part's share of a whole, as `percent` but never misleading at the ends: a part above 0 that\n * rounds to 0 is \"<1%\", and one short of the whole that rounds to 100 is \">99%\".\n * `format.share(2.4 / 512)` is \"<1%\".\n */\n share: (value: number | null | undefined) => {\n if (value == null || Number.isNaN(value)) return missing;\n if (value > 0 && value < 0.005) return `<${percent.format(0.01)}`;\n if (value >= 0.995 && value < 1) return `>${percent.format(0.99)}`;\n return percent.format(value);\n },\n /** A figure in short form for counts that run to thousands: `format.compact(1234)` is \"1.2k\" in en-GB, \"1.2K\" in en-US. */\n compact,\n /**\n * How long ago (or how far ahead) a time is, in the largest unit it reaches:\n * \"3 weeks ago\", \"yesterday\", \"in 2 hours\", \"now\" under a minute. Pass `now` in tests.\n */\n ago: (value: DateInput | null | undefined, now: DateInput = new Date()) => {\n if (value == null) return missing;\n const diff = toDate(value).getTime() - toDate(now).getTime();\n const span = Math.abs(diff);\n for (const [unit, size] of AGO_STEPS) {\n if (span >= size) return relative.format(Math.sign(diff) * Math.floor(span / size), unit);\n }\n return relative.format(0, \"second\");\n },\n /**\n * A media running time from seconds, as a player shows it: \"4:05\", \"1:02:09\". Unknown\n * (null, negative, not finite) prints the placeholder. Set it in `tabular-nums`.\n */\n runningTime: (seconds: number | null | undefined) => {\n if (seconds == null || !Number.isFinite(seconds) || seconds < 0) return missing;\n const s = Math.floor(seconds);\n const two = (n: number) => String(n).padStart(2, \"0\");\n const [h, m] = [Math.floor(s / 3600), Math.floor((s % 3600) / 60)];\n return h > 0 ? `${h}:${two(m)}:${two(s % 60)}` : `${m}:${two(s % 60)}`;\n },\n /**\n * A position in media as an editor shows it, to a chosen precision: \"4:05\" (seconds), \"4:05.250\"\n * (`\"ms\"`), or \"0:04:05:07\" (`\"frames\"` at `fps`, the last part the frame). Hours appear only\n * from one hour, except in frames. Frames are always four parts, hours included, as SMPTE\n * timecode is (non-drop frame, with colons): a three-part \"1:05:00\" reads as one hour five, so\n * a frame count must never be three. Editors write the same four parts (strata-react issue\n * #122). Floors, never rounds up, so a time never reads ahead of the picture. Unknown (null,\n * negative, not finite) prints the placeholder. Set it in `tabular-nums`.\n */\n timecode: (seconds: number | null | undefined, { precision = \"seconds\", fps = 30 }: { precision?: \"seconds\" | \"ms\" | \"frames\"; fps?: number } = {}) => {\n if (seconds == null || !Number.isFinite(seconds) || seconds < 0) return missing;\n const whole = Math.floor(seconds);\n const two = (n: number) => String(n).padStart(2, \"0\");\n const [h, m] = [Math.floor(whole / 3600), Math.floor((whole % 3600) / 60)];\n const base = h > 0 ? `${h}:${two(m)}:${two(whole % 60)}` : `${m}:${two(whole % 60)}`;\n if (precision === \"ms\") return `${base}.${String(Math.min(Math.floor((seconds - whole) * 1000 + 1e-6), 999)).padStart(3, \"0\")}`;\n if (precision === \"frames\") return `${h}:${two(m)}:${two(whole % 60)}:${two(Math.min(Math.floor((seconds - whole) * fps + 1e-6), Math.ceil(fps) - 1))}`;\n return base;\n },\n /** What a missing value prints as: an en dash unless `createFormat`'s `missing` says otherwise. */\n missing,\n /** A time of day: `format.clock(at)` is \"06:05\". */\n clock,\n /** A day without its year, for this week's things: `format.day(at)` is \"Sunday 8 November\". */\n day,\n /** A weekday and time, for chart axes and recent rows: `format.shortDay(at)` is \"Sun 06:05\". */\n shortDay,\n /** A date with its year, for a record or a deadline: `format.date(at)` is \"8 Nov 2026\". */\n date,\n /** A date and time, for a log or history row: `format.dateTime(at)` is \"8 Nov 2026, 06:05\". */\n dateTime,\n /** A figure and its unit joined by a non-breaking space (`NBSP`), so they never wrap apart. */\n withUnit,\n /** A temperature in °C, joined by a non-breaking space. */\n celsius: (value: number) => withUnit(value, \"°C\"),\n /**\n * A size in bytes in the largest decimal unit it reaches (kB, MB, GB, TB, as disks and\n * networks are sold): one decimal below 10 (\"5.2 GB\"), whole above (\"431 GB\"). Pass `unit`\n * to fix the unit, so figures compared side by side (\"431 of 466 GB\") share one.\n */\n bytes: (value: number, unit?: ByteUnit) => {\n const chosen = unit ?? [...BYTE_UNITS].reverse().find((u) => Math.abs(value) >= BYTE_SIZE[u]) ?? \"B\";\n const scaled = value / BYTE_SIZE[chosen];\n return withUnit(scaled, chosen, Math.abs(scaled) < 10 && chosen !== \"B\" ? decimal : integer);\n },\n /**\n * A distance in metres as a person says it: metres under a kilometre (\"850 m\"), then\n * kilometres, one decimal below 100 (\"12.4 km\"), whole above; `\"imperial\"` is feet under a\n * tenth of a mile (\"320 ft\"), then miles (\"7.7 mi\").\n */\n distance: (metres: number, system: \"metric\" | \"imperial\" = \"metric\") => {\n if (system === \"imperial\") {\n const miles = metres / 1609.344;\n return miles < 0.1 ? withUnit(metres * 3.28084, \"ft\") : withUnit(miles, \"mi\", miles < 100 ? decimal : integer);\n }\n return Math.abs(metres) < 1000 ? withUnit(metres, \"m\") : withUnit(metres / 1000, \"km\", Math.abs(metres) < 100_000 ? decimal : integer);\n },\n /** The unit `bytes` would choose for a value, to share it across a set of figures. */\n byteUnit: (value: number): ByteUnit => [...BYTE_UNITS].reverse().find((u) => Math.abs(value) >= BYTE_SIZE[u]) ?? \"B\",\n /**\n * \"1 piece\", \"6 pieces\": the count and its noun, so copy never reads \"1 pieces\". They are\n * joined by a non-breaking space (`NBSP`), not a plain one: in a test, match with the same\n * call or a `\\s` regex, not a typed \"6 pieces\" string in a role's `name`.\n */\n count: (value: number | null | undefined, one: string, many = `${one}s`, { compact: short = false }: CountOptions = {}) =>\n value == null\n ? missing\n : `${(short ? compact : integer).format(value)}${NBSP}${plurals.select(value) === \"one\" ? one : many}`,\n };\n}\n\nexport type Format = ReturnType<typeof createFormat>;\n\n/** The en-GB formatters. */\nexport const format = createFormat(\"en-GB\");\n","// Geometry for routes on a map (strata-react issue #80; the helpers jonathanburnhams.com wrote by\n// hand for its activity maps). Pure functions on `[latitude, longitude]` pairs in degrees, no map\n// library, so they live in the main entry and an app can use them for a text alternative or a\n// profile without installing the map's peer.\n//\n// Distances are great-circle (haversine) on a 6,371 km sphere, which is within half a percent of\n// the true figure at any route length a person runs, rides or drives. Bearings use a flat\n// approximation between neighbouring points (the longitude scaled by the cosine of the mean\n// latitude), fine for the short hops a chevron or a heading needs and wrong for a leg of hundreds\n// of kilometres: `bearing` is for neighbouring points, not for a flight.\n\n/** A position: `[latitude, longitude]` in degrees. */\nexport type LatLng = readonly [lat: number, lng: number];\n\nconst RAD = Math.PI / 180;\nconst EARTH_RADIUS_M = 6_371_000;\n\n/** Great-circle distance between two positions, in metres. */\nexport function distance([lat1, lng1]: LatLng, [lat2, lng2]: LatLng): number {\n const a = Math.sin(((lat2 - lat1) * RAD) / 2) ** 2 + Math.cos(lat1 * RAD) * Math.cos(lat2 * RAD) * Math.sin(((lng2 - lng1) * RAD) / 2) ** 2;\n return 2 * EARTH_RADIUS_M * Math.asin(Math.sqrt(a));\n}\n\n/** The direction from `a` to `b` in degrees clockwise from north (0 to 360), for neighbouring points. */\nexport function bearing([lat1, lng1]: LatLng, [lat2, lng2]: LatLng): number {\n const dx = (lng2 - lng1) * Math.cos((((lat1 + lat2) / 2) * Math.PI) / 180);\n const dy = lat2 - lat1;\n return ((Math.atan2(dx, dy) * 180) / Math.PI + 360) % 360;\n}\n\n/** The running distance along a route at each point, in metres, starting at 0. */\nexport function cumulative(points: readonly LatLng[]): number[] {\n const out = points.length ? [0] : [];\n for (let i = 1; i < points.length; i++) out.push(out[i - 1] + distance(points[i - 1], points[i]));\n return out;\n}\n\n/** The length of a route in metres. */\nexport function length(points: readonly LatLng[]): number {\n let total = 0;\n for (let i = 1; i < points.length; i++) total += distance(points[i - 1], points[i]);\n return total;\n}\n\n/** The south-west and north-east corners that hold every point, or null for none. */\nexport function bounds(points: readonly LatLng[]): [LatLng, LatLng] | null {\n if (!points.length) return null;\n let south = Infinity;\n let north = -Infinity;\n let west = Infinity;\n let east = -Infinity;\n for (const [lat, lng] of points) {\n if (lat < south) south = lat;\n if (lat > north) north = lat;\n if (lng < west) west = lng;\n if (lng > east) east = lng;\n }\n return [\n [south, west],\n [north, east],\n ];\n}\n\n/** The position `metres` along a route (clamped to its ends), by linear interpolation, or null for no points. */\nexport function pointAlong(points: readonly LatLng[], metres: number, along: readonly number[] = cumulative(points)): LatLng | null {\n if (!points.length) return null;\n const total = along[along.length - 1];\n const d = Math.min(Math.max(metres, 0), total);\n if (points.length === 1 || total === 0) return points[0];\n let lo = 1;\n let hi = points.length - 1;\n while (lo < hi) {\n const mid = (lo + hi) >> 1;\n if (along[mid] < d) lo = mid + 1;\n else hi = mid;\n }\n const [p, q] = [points[lo - 1], points[lo]];\n const t = (d - along[lo - 1]) / (along[lo] - along[lo - 1] || 1);\n return [p[0] + (q[0] - p[0]) * t, p[1] + (q[1] - p[1]) * t];\n}\n\n/**\n * `count` positions evenly spaced by distance along a route (the ends skipped), each with the\n * direction of travel there. The direction is smoothed: the bearing from a point a fraction\n * (`window`) of the spacing before to one the same distance after, so GPS jitter and a tight bend\n * do not turn a chevron sideways.\n */\nexport function arrows(points: readonly LatLng[], count = 5, window = 0.4): { position: LatLng; bearing: number }[] {\n if (points.length < 2 || count < 1) return [];\n const along = cumulative(points);\n const total = along[along.length - 1];\n if (total === 0) return [];\n const spacing = total / (count + 1);\n const half = spacing * window;\n return Array.from({ length: count }, (_, i) => {\n const target = spacing * (i + 1);\n const before = pointAlong(points, target - half, along)!;\n const after = pointAlong(points, target + half, along)!;\n return { position: pointAlong(points, target, along)!, bearing: bearing(before, after) };\n });\n}\n\n/** The first and last positions, and whether they are within `loopWithin` metres of each other (a loop), or null for no route. */\nexport function ends(points: readonly LatLng[], loopWithin = 50): { start: LatLng; finish: LatLng; loop: boolean } | null {\n if (!points.length) return null;\n const start = points[0];\n const finish = points[points.length - 1];\n return { start, finish, loop: distance(start, finish) <= loopWithin };\n}\n\n/** The index of the point nearest `position`, for \"where on the route is this?\". */\nexport function nearest(points: readonly LatLng[], position: LatLng): number {\n let best = -1;\n let bestD = Infinity;\n points.forEach((p, i) => {\n const d = distance(p, position);\n if (d < bestD) {\n bestD = d;\n best = i;\n }\n });\n return best;\n}\n\n/** Route geometry helpers: `geo.distance`, `bearing`, `length`, `cumulative`, `bounds`, `pointAlong`, `arrows`, `ends`, `nearest`. */\nexport const geo = { distance, bearing, cumulative, length, bounds, pointAlong, arrows, ends, nearest };\n"],"mappings":";AAqCA,IAAa,OAAO;;AAGpB,IAAa,UAAU;AAIvB,IAAM,aAAkC;CAAC;CAAK;CAAM;CAAM;CAAM;CAAM;AAAI;AAC1E,IAAM,YAAY,OAAO,YAAY,WAAW,KAAK,GAAG,MAAM,CAAC,GAAG,OAAQ,CAAC,CAAC,CAAC;;AAgC7E,SAAgB,OAAO,OAAwB;CAC7C,MAAM,OAAO,iBAAiB,OAAO,QAAQ,IAAI,KAAK,KAAK;CAC3D,IAAI,OAAO,MAAM,KAAK,QAAQ,CAAC,GAAG,MAAM,IAAI,WAAW,eAAe,KAAK,UAAU,OAAO,KAAK,CAAC,GAAG;CACrG,OAAO;AACT;AAEA,SAAS,aAAa,IAAyB,SAAgC;CAC7E,MAAM,UAAU,UAAyC,SAAS,OAAO,UAAU,GAAG,OAAO,OAAO,KAAK,CAAC;CAC1G,OAAO,OAAO,OAAO,QAAQ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,aAAa,IAA6D;CACxH,IAAI,CAAC,OAAO,QAAQ,OAAO;CAC3B,MAAM,QAAQ,OAAO;CACrB,MAAM,SAAS,OAAO,OAAO,SAAS;CACtC,OAAO;EAAE;EAAO;EAAQ,MAAM,SAAS,OAAO,MAAM,KAAK;CAAW;AACtE;;AAGA,SAAgB,QAAQ,QAA2B,UAA0B;CAC3E,IAAI,OAAO;CACX,IAAI,QAAQ;CACZ,OAAO,SAAS,GAAG,MAAM;EACvB,MAAM,IAAI,SAAS,GAAG,QAAQ;EAC9B,IAAI,IAAI,OAAO;GACb,QAAQ;GACR,OAAO;EACT;CACF,CAAC;CACD,OAAO;AACT;;AAGA,IAAa,MAAM;CAAE;CAAU;CAAS;CAAY;CAAQ;CAAQ;CAAY;CAAQ;CAAM;AAAQ"}
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export { useInView, type InViewOptions } from './lib/in-view';
11
11
  export type { IconComponent } from './lib/icon';
12
12
  export { Button, IconButton, RowAction, buttonVariants, type ButtonProps, type IconButtonProps, type RowActionProps, } from './components/button';
13
13
  export { Menu, ContextMenu, CommandMenu, CommandLegend, useCommands, commandShortcut, labelOf, type Command, type MenuEntry, type MenuProps, type ContextMenuProps, type CommandMenuProps, type CommandsOptions, } from './components/commands';
14
+ export { geo, type LatLng } from './lib/geo';
14
15
  export { formatChord, matchesChord, parseChord, isReservedChord, detectPlatform, type Platform } from './lib/chords';
15
16
  export { Toolbar, ToolbarSeparator, type ToolbarProps } from './components/toolbar';
16
17
  export { Toggle, ToggleGroup, type ToggleProps, type ToggleGroupProps, type ToggleOption } from './components/toggle';
@@ -34,8 +35,9 @@ export { useClientWork, type ClientWork, type WorkContext, type WorkPhase } from
34
35
  export { JobStatus, type JobStatusProps, type JobFailure, type JobWords } from './components/job-status';
35
36
  export { Thumbnail, ThumbnailSkeleton, type ThumbnailProps, type AspectRatio } from './components/thumbnail';
36
37
  export { DataTable, TableSkeleton, parseSort, serialiseSort, type CellValue, type Column, type Sort, type DataTableProps, type RowSelection, type RowExpansion, } from './components/data-table';
38
+ export { MediaPlayer, useMediaElement, SPEECH_RATES, type MediaPlayerProps, type MediaElementState, type MediaProblem, type MediaSource, type MediaSession } from './components/media-player';
37
39
  export { Transport, TimeReadout, SeekBar, VolumeControl, RateChoice, MediaStage, StageGuides, transportShortcuts, type TransportProps, type SeekBarProps, type VolumeControlProps, type Precision } from './components/media';
38
- export { Timeline, TimelineZoomControls, useTimelineZoom, noOverlap, type TimelineProps, type TimelineItem, type TimelineLane, type TimelineMarker, type TimelineChange } from './components/timeline';
40
+ export { Timeline, TimelineZoomControls, useTimelineZoom, noOverlap, type TimelineProps, type TimelineItem, type TimelineLane, type TimelineMarker, type TimelineChange, type TimelineDrop } from './components/timeline';
39
41
  export { tickStep, ticksBetween, tickLabel } from './lib/timeline';
40
42
  export { SortableList, type SortableListProps, type DropTarget } from './components/sortable-list';
41
43
  export { FileButton, FileDropZone, FileOutcomes, MissingFile } from './components/file-intake';
@@ -66,5 +68,6 @@ export { FIT, MIN_SCALE, MAX_SCALE, clampViewport, zoomAt, actualPixelsScale, ty
66
68
  export { CompareGrid, type CompareGridProps } from './components/compare-grid';
67
69
  export { useDifference, type DifferenceState, type ReadPixels } from './components/difference';
68
70
  export { differences, readPixels, resample, MAX_SIDE, DEFAULT_TOLERANCE, type Difference, type Pixels } from './lib/image-diff';
71
+ export { Workspace, Split, Pane, useWorkspaceState, type WorkspaceState, type PaneProps } from './components/workspace';
69
72
  export { useHistory, useHistoryState, type History, type HistoryOptions, type HistoryStep, type HistoryStateOptions, type SetOptions, } from './components/history';
70
73
  export { useAutoSave, useLeaveGuard, SaveStatus, type AutoSave, type AutoSaveOptions, type SaveState } from './components/save';