strata-react 1.0.31 → 1.0.33
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 +2 -2
- package/UPGRADING.md +1 -0
- package/dist/components/compare-parts.d.ts +2 -0
- package/dist/components/compare-video-grid.d.ts +48 -0
- package/dist/components/compare-video.d.ts +2 -5
- package/dist/components/cursor.d.ts +44 -0
- package/dist/components/line-chart.d.ts +92 -3
- package/dist/components/media.d.ts +6 -1
- package/dist/components/video-clock.d.ts +60 -0
- package/dist/{geo-C0jcFp4q.js → cursor-DplHNzj3.js} +173 -3
- package/dist/cursor-DplHNzj3.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1056 -424
- package/dist/index.js.map +1 -1
- package/dist/lib/geo.d.ts +17 -1
- package/dist/map/fan.d.ts +15 -0
- package/dist/map/index.d.ts +3 -1
- package/dist/map/markers.d.ts +60 -0
- package/dist/map/route-map.d.ts +74 -3
- package/dist/map.js +712 -54
- package/dist/map.js.map +1 -1
- package/dist/{run-CKlcLpdN.js → run-BqZGKhW9.js} +10 -1
- package/dist/run-BqZGKhW9.js.map +1 -0
- package/dist/visual-cli.js +1 -1
- package/dist/visual.js +1 -1
- package/package.json +1 -1
- package/dist/geo-C0jcFp4q.js.map +0 -1
- package/dist/run-CKlcLpdN.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor-DplHNzj3.js","names":[],"sources":["../src/lib/format.ts","../src/lib/geo.ts","../src/components/cursor.tsx"],"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/** The part of a route between two distances along it (metres, clamped, either order): the cut ends and every point between. Empty for no route. */\nexport function slice(points: readonly LatLng[], from: number, to: number, along: readonly number[] = cumulative(points)): LatLng[] {\n if (!points.length) return [];\n const [a, b] = from <= to ? [from, to] : [to, from];\n const start = pointAlong(points, a, along)!;\n const end = pointAlong(points, b, along)!;\n const lo = Math.max(a, 0);\n const hi = Math.min(b, along[along.length - 1]);\n const inside = points.filter((_, i) => along[i] > lo && along[i] < hi);\n return [start, ...inside, end];\n}\n\n/**\n * The nearest point on a route to `position`, not only its vertices: where it lies, how far along the\n * route that is, and how far `position` is from the route. The inverse of `pointAlong` (a cursor on a\n * map is a distance on a chart). Each leg is flattened around its own latitude, which is exact enough\n * for any leg a recording has; `index` is the leg's first point. Null for fewer than one point.\n */\nexport function snap(points: readonly LatLng[], position: LatLng, along: readonly number[] = cumulative(points)): { position: LatLng; metres: number; offset: number; index: number } | null {\n if (!points.length) return null;\n if (points.length === 1) return { position: points[0], metres: 0, offset: distance(points[0], position), index: 0 };\n let best: { position: LatLng; metres: number; offset: number; index: number } | null = null;\n for (let i = 1; i < points.length; i++) {\n const [p, q] = [points[i - 1], points[i]];\n const k = Math.cos((((p[0] + q[0]) / 2) * Math.PI) / 180);\n const [dx, dy] = [(q[1] - p[1]) * k, q[0] - p[0]];\n const len2 = dx * dx + dy * dy;\n const t = len2 === 0 ? 0 : Math.min(1, Math.max(0, (((position[1] - p[1]) * k) * dx + (position[0] - p[0]) * dy) / len2));\n const at: LatLng = [p[0] + (q[0] - p[0]) * t, p[1] + (q[1] - p[1]) * t];\n const offset = distance(at, position);\n if (!best || offset < best.offset) best = { position: at, metres: along[i - 1] + (along[i] - along[i - 1]) * t, offset, index: i - 1 };\n }\n return best;\n}\n\n/** Route geometry helpers: `geo.distance`, `bearing`, `length`, `cumulative`, `bounds`, `pointAlong`, `snap` (its inverse), `slice`, `arrows`, `ends`, `nearest`. */\nexport const geo = { distance, bearing, cumulative, length, bounds, pointAlong, snap, slice, arrows, ends, nearest };\n","import * as React from \"react\";\n\n// A shared cursor: one position that a map, several charts and a seek bar all show at once (strata-react\n// issue #184, from strata-360, where the cursor on the elevation and pace charts is the marker on the\n// route). Each of those components already draws one position well; what an app lacked was the wiring.\n//\n// One position in a canonical unit the app chooses (metres along a route, or seconds), and every member\n// says how its own x maps to it (`CursorMapping`; the identity when they already agree). The rules:\n//\n// - **A writer never reacts to its own writes.** Every member has a `source` id, and a position whose\n// source is its own is not drawn back at it (a chart's own pointer already draws its own rule).\n// - **Two owners, and the pointer wins.** Playback sets the cursor (sixty times a second); a pointer or\n// key over any member sets it too, and holds it until it leaves, and then playback's position is\n// still there. Stored as two entries, not one value, so \"pointer left\" has something to fall back to.\n// - **It is not announced as it moves.** The scope has one polite live region, written at most once a\n// second and only for a pointer or key (never playback): sixty announcements a second are worse than\n// silence (§3.22).\n// - **A store, not state in the scope.** Members subscribe to it; the scope's children do not render\n// when the cursor moves, only the members that read it.\n//\n// Checked: React Aria has no shared-pointer part; `useSyncExternalStore` is React's own.\n\n/** Who set the cursor: a pointer or key over a member, or playback (a player's clock). */\nexport type CursorOwner = \"pointer\" | \"playback\";\n\n/** How a member's own x relates to the scope's unit. Both default to the identity. */\nexport type CursorMapping = {\n /** From this member's x to the scope's unit (a chart in seconds in a scope in metres: look it up in the series). */\n toCursor?: (x: number) => number;\n /** From the scope's unit to this member's x. */\n fromCursor?: (at: number) => number;\n};\n\ntype Entry = { at: number; source: string };\ntype Snapshot = {\n /** The position now: the pointer's while there is one, else playback's; null when neither is set. */\n at: number | null;\n /** Who wrote `at`; a member ignores a position it wrote. */\n source: string | null;\n owner: CursorOwner | null;\n};\n\nconst EMPTY: Snapshot = { at: null, source: null, owner: null };\n\nclass CursorStore {\n private pointer: Entry | null = null;\n private playback: Entry | null = null;\n private listeners = new Set<() => void>();\n snapshot: Snapshot = EMPTY;\n subscribe = (fn: () => void) => {\n this.listeners.add(fn);\n return () => void this.listeners.delete(fn);\n };\n private publish() {\n const e = this.pointer ?? this.playback;\n const owner: CursorOwner | null = this.pointer ? \"pointer\" : this.playback ? \"playback\" : null;\n if (e?.at === this.snapshot.at && e?.source === this.snapshot.source && owner === this.snapshot.owner) return;\n this.snapshot = e ? { at: e.at, source: e.source, owner } : EMPTY;\n for (const l of this.listeners) l();\n }\n /** A pointer or key over a member. `null` means it left: it clears only if the pointer was this member's, so a stale leave cannot remove another member's position. */\n setPointer(at: number | null, source: string) {\n if (at === null) {\n if (this.pointer?.source !== source) return;\n this.pointer = null;\n } else this.pointer = { at, source };\n this.publish();\n }\n setPlayback(at: number | null, source: string) {\n this.playback = at === null ? null : { at, source };\n this.publish();\n }\n}\n\nconst Scope = React.createContext<CursorStore | null>(null);\n\nexport type CursorScopeProps = {\n children: React.ReactNode;\n /** Words for the position in the scope's unit (\"12.4 km along\", \"1:23\"), for the polite announcement. Without it nothing is announced. */\n format?: (at: number) => string;\n /** Milliseconds between announcements. Default 1000. */\n announceEvery?: number;\n};\n\n/** Holds one cursor position for the charts, map and seek bar inside it, with a throttled polite announcement of where a pointer or key has put it. */\nexport function CursorScope({ children, format, announceEvery = 1000 }: CursorScopeProps) {\n const store = React.useRef<CursorStore | null>(null);\n store.current ??= new CursorStore();\n return (\n <Scope.Provider value={store.current}>\n {children}\n {format && <CursorAnnouncer store={store.current} format={format} every={announceEvery} />}\n </Scope.Provider>\n );\n}\n\n/** The live region: the latest pointer position, at most once per `every` ms (a throttle, so a pointer that never rests is still announced). */\nfunction CursorAnnouncer({ store, format, every }: { store: CursorStore; format: (at: number) => string; every: number }) {\n const snap = React.useSyncExternalStore(store.subscribe, () => store.snapshot, () => EMPTY);\n const [text, setText] = React.useState(\"\");\n const latest = React.useRef({ snap, format });\n latest.current = { snap, format };\n const last = React.useRef(0);\n const timer = React.useRef<number | undefined>(undefined);\n React.useEffect(() => {\n // Playback moves the cursor every frame and is never spoken; a pointer leaving says nothing.\n if (snap.owner !== \"pointer\" || snap.at === null) return;\n const speak = () => {\n timer.current = undefined;\n last.current = Date.now();\n const { snap: s, format: f } = latest.current;\n if (s.owner === \"pointer\" && s.at !== null) setText(f(s.at));\n };\n const wait = last.current + every - Date.now();\n if (wait <= 0) speak();\n else timer.current ??= window.setTimeout(speak, wait);\n }, [snap, every]);\n React.useEffect(() => () => window.clearTimeout(timer.current), []);\n return (\n <p role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n {text}\n </p>\n );\n}\n\n/** What a member reads and writes. */\nexport type SharedCursor = Snapshot & {\n /** This member's own id: positions it writes are not drawn back at it. */\n source: string;\n /** The position another member (or playback) put there, in the scope's unit; null when none or when this member wrote it. */\n other: number | null;\n /** The pointer or keyboard is at `at` over this member (the scope's unit). `null`: it left. */\n setPointer: (at: number | null) => void;\n /** Playback is at `at` (the scope's unit). Call it from the player's clock; `null` when it stops. */\n setPlayback: (at: number | null) => void;\n};\n\n/**\n * Join the nearest `CursorScope` as one member. Returns null outside a scope, so a component can take a\n * `cursor` prop and do nothing when the app has not set one up. `source` is this member's id; the\n * default is a unique one.\n */\nexport function useSharedCursor(source?: string): SharedCursor | null {\n const store = React.useContext(Scope);\n const own = React.useId();\n const id = source ?? own;\n const subscribe = React.useCallback((fn: () => void) => (store ? store.subscribe(fn) : () => {}), [store]);\n const snap = React.useSyncExternalStore(subscribe, () => store?.snapshot ?? EMPTY, () => EMPTY);\n const setPointer = React.useCallback((at: number | null) => store?.setPointer(at, id), [store, id]);\n const setPlayback = React.useCallback((at: number | null) => store?.setPlayback(at, id), [store, id]);\n return React.useMemo(\n () => (store ? { ...snap, source: id, other: snap.at !== null && snap.source !== id ? snap.at : null, setPointer, setPlayback } : null),\n [store, snap, id, setPointer, setPlayback],\n );\n}\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;EAC3B;EACA,gBAAgB,UAAqB,GAAG,cAAc,OAAO,KAAK,CAAC;EACnE,cAAc,OAAkB,QAAmB,GAAG,YAAY,OAAO,KAAK,GAAG,OAAO,GAAG,CAAC;EAC5F,uBAAuB,GAAG,gBAAgB;CAC5C,CAAC;AACH;AAEA,SAAS,SAAS,IAAuB,SAAkC;CACzE,MAAM,UAAU,UAA2E,SAAS,OAAO,UAAU,GAAG,OAAO,KAAK;CACpI,OAAO,OAAO,OAAO,QAAQ;EAC3B;EACA,gBAAgB,UAA2B,GAAG,cAAc,KAAK;EACjE,uBAAuB,GAAG,gBAAgB;CAC5C,CAAC;AACH;AAIA,IAAM,MAAM;AACZ,IAAM,YAA8D;CAClE,CAAC,QAAQ,MA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,UAAA;CACA,CAAA;AAEP;;;;;;AAmBA,SAAgB,gBAAgB,QAAsC;CACpE,MAAM,QAAQ,MAAM,WAAW,KAAK;CACpC,MAAM,MAAM,MAAM,MAAM;CACxB,MAAM,KAAK,UAAU;CACrB,MAAM,YAAY,MAAM,aAAa,OAAoB,QAAQ,MAAM,UAAU,EAAE,UAAU,CAAC,GAAI,CAAC,KAAK,CAAC;CACzG,MAAM,OAAO,MAAM,qBAAqB,iBAAiB,OAAO,YAAY,aAAa,KAAK;CAC9F,MAAM,aAAa,MAAM,aAAa,OAAsB,OAAO,WAAW,IAAI,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;CAClG,MAAM,cAAc,MAAM,aAAa,OAAsB,OAAO,YAAY,IAAI,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;CACpG,OAAO,MAAM,cACJ,QAAQ;EAAE,GAAG;EAAM,QAAQ;EAAI,OAAO,KAAK,OAAO,QAAQ,KAAK,WAAW,KAAK,KAAK,KAAK;EAAM;EAAY;CAAY,IAAI,MAClI;EAAC;EAAO;EAAM;EAAI;EAAY;CAAW,CAC3C;AACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -48,7 +48,8 @@ export { BulkBar, useSelection, type InitialSelection } from './components/selec
|
|
|
48
48
|
export { SelectableGrid, type SelectableGridProps, type TileAspect, type TileSize, } from './components/selectable-grid';
|
|
49
49
|
export { VirtualList } from './components/virtual-list';
|
|
50
50
|
export { InfiniteList, LoadMore, type InfiniteListProps, type LoadMoreProps } from './components/infinite-list';
|
|
51
|
-
export { LineChart, type LineChartProps, type Point } from './components/line-chart';
|
|
51
|
+
export { LineChart, LineChartGroup, logScale, valueAt, type ChartMark, type ChartSpan, type GroupedChart, type LineChartGroupProps, type LineChartProps, type Point, type SpanTone, type YScale } from './components/line-chart';
|
|
52
|
+
export { CursorScope, useSharedCursor, type CursorMapping, type CursorOwner, type CursorScopeProps, type SharedCursor } from './components/cursor';
|
|
52
53
|
export { PageHeader } from './components/page-header';
|
|
53
54
|
export { UndoBar, useUndoable, type PendingRemoval, type FailedRemoval, type Undoable, type UndoableOptions, } from './components/undo';
|
|
54
55
|
export { Done } from './components/done';
|
|
@@ -67,6 +68,7 @@ export { FullscreenFrame, canFullscreen, type FullscreenFrameProps } from './com
|
|
|
67
68
|
export { FIT, MIN_SCALE, MAX_SCALE, clampViewport, zoomAt, actualPixelsScale, regionShares, boxViewport, type Viewport, type Region, type ShareBox } from './lib/viewport';
|
|
68
69
|
export { PairVote, PairJudge, type PairVoteProps, type PairJudgeProps, type PairVoteSlot, type PairVoteWords, type PairAnswer, type Pair } from './components/pair-vote';
|
|
69
70
|
export { CompareAudio, type CompareAudioProps } from './components/compare-audio';
|
|
71
|
+
export { CompareVideoGrid, type CompareVideoGridProps } from './components/compare-video-grid';
|
|
70
72
|
export { CompareVideo, type CompareVideoProps, type VideoMode, type VideoLoop } from './components/compare-video';
|
|
71
73
|
export { CompareText, type CompareTextProps } from './components/compare-text';
|
|
72
74
|
export { diffWords, type TextDifference, type TextSegment } from './lib/text-diff';
|