strata-react 1.3.25 → 1.3.27

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.
Files changed (256) hide show
  1. package/README.md +1 -0
  2. package/UPGRADING.md +4 -0
  3. package/dist/{api-types/cli.d.ts → api-types-cli.d.ts} +1 -0
  4. package/dist/api-types-cli.js +4 -3
  5. package/dist/api-types-cli.js.map +1 -1
  6. package/dist/{api-types/generate.d.ts → api-types.d.ts} +3 -3
  7. package/dist/api-types.js +3 -1
  8. package/dist/{button-KGJI6jQr.js → button-CYXjU-fs.js} +8 -5
  9. package/dist/button-CYXjU-fs.js.map +1 -0
  10. package/dist/{cursor-DDGBPiTJ.js → cursor-Cwyvgwsw.js} +9 -7
  11. package/dist/cursor-Cwyvgwsw.js.map +1 -0
  12. package/dist/{errors-BUvY1Z4d.js → errors-CmuwcWlb.js} +6 -6
  13. package/dist/{errors-BUvY1Z4d.js.map → errors-CmuwcWlb.js.map} +1 -1
  14. package/dist/{field-BjeE_FeB.js → field-DBCsFIng.js} +27 -23
  15. package/dist/field-DBCsFIng.js.map +1 -0
  16. package/dist/{follow-BTPs49FP.js → follow-CXQsL86O.js} +2 -2
  17. package/dist/follow-CXQsL86O.js.map +1 -0
  18. package/dist/{generate-CjTHKJ39.js → generate-BkWhh4k4.js} +8 -6
  19. package/dist/generate-BkWhh4k4.js.map +1 -0
  20. package/dist/{lib/geo.d.ts → geo-DfKa9JtK.d.ts} +35 -33
  21. package/dist/{hls/index.d.ts → hls.d.ts} +13 -12
  22. package/dist/hls.js +5 -4
  23. package/dist/hls.js.map +1 -1
  24. package/dist/index.d.ts +5401 -142
  25. package/dist/index.js +1072 -227
  26. package/dist/index.js.map +1 -1
  27. package/dist/map.d.ts +184 -0
  28. package/dist/map.js +21 -17
  29. package/dist/map.js.map +1 -1
  30. package/dist/media-player-BETa3P7K.d.ts +758 -0
  31. package/dist/{microphone-Bo3WaXgD.js → microphone-76skMt6i.js} +41 -30
  32. package/dist/microphone-76skMt6i.js.map +1 -0
  33. package/dist/microphone-DDOnQHxf.d.ts +237 -0
  34. package/dist/{migrate/cli.d.ts → migrate-cli.d.ts} +1 -0
  35. package/dist/migrate-cli.js +8 -6
  36. package/dist/migrate-cli.js.map +1 -1
  37. package/dist/panorama.d.ts +102 -0
  38. package/dist/panorama.js +18 -15
  39. package/dist/panorama.js.map +1 -1
  40. package/dist/{run-BT2WKzMz.js → run-D_Ic1jE7.js} +23 -16
  41. package/dist/run-D_Ic1jE7.js.map +1 -0
  42. package/dist/scene.d.ts +147 -0
  43. package/dist/scene.js +15 -13
  44. package/dist/scene.js.map +1 -1
  45. package/dist/testing.d.ts +468 -0
  46. package/dist/testing.js +11 -3
  47. package/dist/testing.js.map +1 -1
  48. package/dist/{theme-CxYZkUNk.js → theme-1oOSMj_D.js} +19 -17
  49. package/dist/theme-1oOSMj_D.js.map +1 -0
  50. package/dist/{tooltip-DhqrDtyu.js → tooltip-BosfsWYh.js} +9 -6
  51. package/dist/tooltip-BosfsWYh.js.map +1 -0
  52. package/dist/types-B3TsF0Ey.d.ts +241 -0
  53. package/dist/{value-controls-Dm_EYfZW.js → value-controls-5u7sD_wG.js} +22 -17
  54. package/dist/value-controls-5u7sD_wG.js.map +1 -0
  55. package/dist/{viewer-input-CHU0Hx4A.js → viewer-input-3Qa-o35k.js} +3 -2
  56. package/dist/{viewer-input-CHU0Hx4A.js.map → viewer-input-3Qa-o35k.js.map} +1 -1
  57. package/dist/{visual/cli.d.ts → visual-cli.d.ts} +2 -1
  58. package/dist/visual-cli.js +5 -4
  59. package/dist/visual-cli.js.map +1 -1
  60. package/dist/visual.d.ts +105 -0
  61. package/dist/visual.js +4 -3
  62. package/dist/visual.js.map +1 -1
  63. package/package.json +24 -19
  64. package/dist/api-types/index.d.ts +0 -1
  65. package/dist/button-KGJI6jQr.js.map +0 -1
  66. package/dist/components/active-list.d.ts +0 -46
  67. package/dist/components/alert.d.ts +0 -17
  68. package/dist/components/app-shell.d.ts +0 -32
  69. package/dist/components/async-button.d.ts +0 -48
  70. package/dist/components/auto-recorder.d.ts +0 -67
  71. package/dist/components/book-viewer.d.ts +0 -50
  72. package/dist/components/box-overlay.d.ts +0 -44
  73. package/dist/components/boxed-picture.d.ts +0 -34
  74. package/dist/components/button.d.ts +0 -45
  75. package/dist/components/byte-view.d.ts +0 -32
  76. package/dist/components/checkbox.d.ts +0 -39
  77. package/dist/components/choice-grid.d.ts +0 -42
  78. package/dist/components/commands.d.ts +0 -104
  79. package/dist/components/compare-audio.d.ts +0 -30
  80. package/dist/components/compare-grid.d.ts +0 -24
  81. package/dist/components/compare-parts.d.ts +0 -90
  82. package/dist/components/compare-regions.d.ts +0 -37
  83. package/dist/components/compare-text.d.ts +0 -32
  84. package/dist/components/compare-video-grid.d.ts +0 -52
  85. package/dist/components/compare-video.d.ts +0 -61
  86. package/dist/components/compare.d.ts +0 -90
  87. package/dist/components/composition.d.ts +0 -44
  88. package/dist/components/console.d.ts +0 -34
  89. package/dist/components/conversation.d.ts +0 -83
  90. package/dist/components/cursor.d.ts +0 -44
  91. package/dist/components/data-table.d.ts +0 -89
  92. package/dist/components/data-view.d.ts +0 -66
  93. package/dist/components/density.d.ts +0 -16
  94. package/dist/components/dialog.d.ts +0 -45
  95. package/dist/components/difference.d.ts +0 -19
  96. package/dist/components/disclosure.d.ts +0 -49
  97. package/dist/components/done.d.ts +0 -14
  98. package/dist/components/drag-source.d.ts +0 -29
  99. package/dist/components/field.d.ts +0 -79
  100. package/dist/components/file-intake.d.ts +0 -60
  101. package/dist/components/film-strip.d.ts +0 -35
  102. package/dist/components/folder-picker.d.ts +0 -59
  103. package/dist/components/fullscreen-frame.d.ts +0 -18
  104. package/dist/components/history.d.ts +0 -61
  105. package/dist/components/hotkeys.d.ts +0 -44
  106. package/dist/components/infinite-list.d.ts +0 -77
  107. package/dist/components/inspector.d.ts +0 -66
  108. package/dist/components/job-action.d.ts +0 -30
  109. package/dist/components/job-status.d.ts +0 -55
  110. package/dist/components/jobs-table.d.ts +0 -35
  111. package/dist/components/key-glyphs.d.ts +0 -5
  112. package/dist/components/key-owner.d.ts +0 -11
  113. package/dist/components/lightbox.d.ts +0 -61
  114. package/dist/components/line-chart.d.ts +0 -169
  115. package/dist/components/link-card.d.ts +0 -32
  116. package/dist/components/link.d.ts +0 -54
  117. package/dist/components/markable-text.d.ts +0 -60
  118. package/dist/components/media-contents.d.ts +0 -28
  119. package/dist/components/media-group.d.ts +0 -32
  120. package/dist/components/media-player.d.ts +0 -251
  121. package/dist/components/media-progress.d.ts +0 -17
  122. package/dist/components/media-skip.d.ts +0 -31
  123. package/dist/components/media-spans.d.ts +0 -93
  124. package/dist/components/media.d.ts +0 -133
  125. package/dist/components/meter.d.ts +0 -32
  126. package/dist/components/metric.d.ts +0 -17
  127. package/dist/components/outbox-status.d.ts +0 -10
  128. package/dist/components/page-header.d.ts +0 -14
  129. package/dist/components/pair-vote.d.ts +0 -70
  130. package/dist/components/pause-button.d.ts +0 -7
  131. package/dist/components/pixel-image.d.ts +0 -29
  132. package/dist/components/place-board.d.ts +0 -39
  133. package/dist/components/player-warning.d.ts +0 -24
  134. package/dist/components/popover.d.ts +0 -20
  135. package/dist/components/recorder.d.ts +0 -73
  136. package/dist/components/region-editor.d.ts +0 -67
  137. package/dist/components/save.d.ts +0 -46
  138. package/dist/components/say-again.d.ts +0 -13
  139. package/dist/components/schedule-table.d.ts +0 -24
  140. package/dist/components/secret-field.d.ts +0 -34
  141. package/dist/components/selectable-grid.d.ts +0 -57
  142. package/dist/components/selection.d.ts +0 -104
  143. package/dist/components/sequence-timeline.d.ts +0 -50
  144. package/dist/components/shortcut-editor.d.ts +0 -44
  145. package/dist/components/sortable-list.d.ts +0 -39
  146. package/dist/components/status.d.ts +0 -9
  147. package/dist/components/switch.d.ts +0 -15
  148. package/dist/components/system-panel.d.ts +0 -58
  149. package/dist/components/tabs.d.ts +0 -16
  150. package/dist/components/theme.d.ts +0 -106
  151. package/dist/components/thumbnail.d.ts +0 -50
  152. package/dist/components/tile-grid.d.ts +0 -67
  153. package/dist/components/timeline-player.d.ts +0 -18
  154. package/dist/components/timeline.d.ts +0 -115
  155. package/dist/components/toast.d.ts +0 -36
  156. package/dist/components/toggle.d.ts +0 -51
  157. package/dist/components/toolbar.d.ts +0 -15
  158. package/dist/components/tooltip.d.ts +0 -19
  159. package/dist/components/transcript-view.d.ts +0 -63
  160. package/dist/components/tree.d.ts +0 -74
  161. package/dist/components/undo.d.ts +0 -63
  162. package/dist/components/use-timeline.d.ts +0 -44
  163. package/dist/components/value-controls.d.ts +0 -91
  164. package/dist/components/video-clock.d.ts +0 -68
  165. package/dist/components/view-options.d.ts +0 -105
  166. package/dist/components/viewport.d.ts +0 -85
  167. package/dist/components/virtual-list.d.ts +0 -19
  168. package/dist/components/waveform.d.ts +0 -71
  169. package/dist/components/workflow-steps.d.ts +0 -71
  170. package/dist/components/workspace.d.ts +0 -83
  171. package/dist/cursor-DDGBPiTJ.js.map +0 -1
  172. package/dist/field-BjeE_FeB.js.map +0 -1
  173. package/dist/follow-BTPs49FP.js.map +0 -1
  174. package/dist/generate-CjTHKJ39.js.map +0 -1
  175. package/dist/lib/base.d.ts +0 -10
  176. package/dist/lib/book.d.ts +0 -25
  177. package/dist/lib/boxes.d.ts +0 -55
  178. package/dist/lib/breakpoint.d.ts +0 -4
  179. package/dist/lib/choice.d.ts +0 -29
  180. package/dist/lib/chords.d.ts +0 -20
  181. package/dist/lib/client-work.d.ts +0 -24
  182. package/dist/lib/control.d.ts +0 -4
  183. package/dist/lib/dev.d.ts +0 -2
  184. package/dist/lib/errors.d.ts +0 -43
  185. package/dist/lib/file-intake.d.ts +0 -60
  186. package/dist/lib/follow.d.ts +0 -18
  187. package/dist/lib/format.d.ts +0 -243
  188. package/dist/lib/grouped-grid-layout.d.ts +0 -44
  189. package/dist/lib/icon.d.ts +0 -6
  190. package/dist/lib/image-diff.d.ts +0 -30
  191. package/dist/lib/in-view.d.ts +0 -21
  192. package/dist/lib/loudness.d.ts +0 -18
  193. package/dist/lib/marks.d.ts +0 -6
  194. package/dist/lib/microphone.d.ts +0 -24
  195. package/dist/lib/number-input.d.ts +0 -4
  196. package/dist/lib/object-url.d.ts +0 -2
  197. package/dist/lib/overlay.d.ts +0 -1
  198. package/dist/lib/recording.d.ts +0 -16
  199. package/dist/lib/region.d.ts +0 -64
  200. package/dist/lib/rich-text.d.ts +0 -44
  201. package/dist/lib/search-param.d.ts +0 -16
  202. package/dist/lib/segmenter.d.ts +0 -40
  203. package/dist/lib/sequence.d.ts +0 -34
  204. package/dist/lib/speech.d.ts +0 -53
  205. package/dist/lib/text-diff.d.ts +0 -16
  206. package/dist/lib/timeline.d.ts +0 -14
  207. package/dist/lib/transcript.d.ts +0 -53
  208. package/dist/lib/utils.d.ts +0 -4
  209. package/dist/lib/viewer-input.d.ts +0 -29
  210. package/dist/lib/viewport.d.ts +0 -55
  211. package/dist/lib/waveform.d.ts +0 -46
  212. package/dist/map/fan.d.ts +0 -15
  213. package/dist/map/index.d.ts +0 -3
  214. package/dist/map/map-styles.d.ts +0 -2
  215. package/dist/map/markers.d.ts +0 -60
  216. package/dist/map/route-map.d.ts +0 -146
  217. package/dist/microphone-Bo3WaXgD.js.map +0 -1
  218. package/dist/migrate/stock-classes.d.ts +0 -11
  219. package/dist/panorama/gl.d.ts +0 -16
  220. package/dist/panorama/index.d.ts +0 -2
  221. package/dist/panorama/panorama-viewer.d.ts +0 -56
  222. package/dist/panorama/projection.d.ts +0 -45
  223. package/dist/query/api.d.ts +0 -23
  224. package/dist/query/clips.d.ts +0 -48
  225. package/dist/query/index.d.ts +0 -55
  226. package/dist/query/infinite.d.ts +0 -60
  227. package/dist/query/job.d.ts +0 -26
  228. package/dist/query/outbox.d.ts +0 -85
  229. package/dist/query/poll.d.ts +0 -24
  230. package/dist/query/reserve.d.ts +0 -33
  231. package/dist/query/typed-api.d.ts +0 -84
  232. package/dist/query/workflow.d.ts +0 -17
  233. package/dist/run-BT2WKzMz.js.map +0 -1
  234. package/dist/scene/camera.d.ts +0 -99
  235. package/dist/scene/index.d.ts +0 -2
  236. package/dist/scene/scene-viewport.d.ts +0 -48
  237. package/dist/testing/buttons.d.ts +0 -7
  238. package/dist/testing/index.d.ts +0 -161
  239. package/dist/testing/intersection-observer.d.ts +0 -34
  240. package/dist/testing/layout.d.ts +0 -13
  241. package/dist/testing/microphone.d.ts +0 -35
  242. package/dist/testing/setup.d.ts +0 -14
  243. package/dist/testing/speech.d.ts +0 -38
  244. package/dist/testing/storage.d.ts +0 -7
  245. package/dist/theme-CxYZkUNk.js.map +0 -1
  246. package/dist/tooltip-DhqrDtyu.js.map +0 -1
  247. package/dist/value-controls-Dm_EYfZW.js.map +0 -1
  248. package/dist/visual/capture.d.ts +0 -37
  249. package/dist/visual/compare.d.ts +0 -46
  250. package/dist/visual/drop.d.ts +0 -19
  251. package/dist/visual/fonts.d.ts +0 -18
  252. package/dist/visual/index.d.ts +0 -19
  253. package/dist/visual/run.d.ts +0 -22
  254. package/dist/visual/serve.d.ts +0 -13
  255. package/dist/visual/targets.d.ts +0 -17
  256. package/dist/visual/types.d.ts +0 -188
@@ -1,16 +0,0 @@
1
- /** The quietest level a speech meter draws, in dBFS: below it is silence for speech. */
2
- export declare const LEVEL_FLOOR_DB = -60;
3
- /** Joins chunks of samples into one buffer, in order. */
4
- export declare function joinSamples(chunks: readonly Float32Array[]): Float32Array;
5
- /** A mono 16-bit PCM WAV of `samples` (-1 to 1; beyond full scale is clipped). */
6
- export declare function encodeWav(samples: Float32Array, sampleRate: number): Blob;
7
- /** The highest sample in dBFS, never below `LEVEL_FLOOR_DB` (silence reads as the floor, not minus infinity). */
8
- export declare function peakDb(samples: Float32Array): number;
9
- /** How a take's level reads for speech, in words a speaker can act on. */
10
- export type SpeechLevel = {
11
- tone: "success" | "warning" | "danger";
12
- word: string;
13
- advice: string;
14
- };
15
- /** Judges a take by its peak (dBFS). */
16
- export declare function speechLevel(peak: number): SpeechLevel;
@@ -1,64 +0,0 @@
1
- /** A rectangle in the picture's coordinates: top-left corner and size. */
2
- export type Rect = {
3
- x: number;
4
- y: number;
5
- w: number;
6
- h: number;
7
- };
8
- /** Which edge or corner is held: compass points. */
9
- export type Handle = "n" | "s" | "e" | "w" | "ne" | "nw" | "se" | "sw";
10
- /** Limits on a rectangle. `aspect` is width over height; `min` is the smallest size; `bounds` is where it may be. */
11
- export type RectLimits = {
12
- bounds: Rect;
13
- min?: {
14
- w: number;
15
- h: number;
16
- };
17
- aspect?: number;
18
- };
19
- export declare const HANDLES: readonly Handle[];
20
- /** Moves a rectangle by (dx, dy), stopping at the bounds (it keeps its size). */
21
- export declare function moveRect(r: Rect, dx: number, dy: number, bounds: Rect): Rect;
22
- /** Puts a rectangle inside the bounds and at least `min` size, keeping its aspect if one is set (shrinking it to fit). */
23
- export declare function fitRect(r: Rect, { bounds, min, aspect }: RectLimits): Rect;
24
- /**
25
- * Drags `handle` of `r` by (dx, dy). The opposite edge or corner stays where it is. Without an
26
- * aspect each edge stops at the bounds and at `min` from the edge opposite; with one the rectangle
27
- * keeps its shape: a corner follows the larger of the two movements, an edge changes its own
28
- * dimension and the other grows or shrinks about the middle. The result is always inside the bounds.
29
- */
30
- export declare function resizeRect(r: Rect, handle: Handle, dx: number, dy: number, { bounds, min, aspect }: RectLimits): Rect;
31
- /** A rectangle drawn by dragging from one corner point to another, ordered and fitted to the limits. */
32
- export declare function drawRect(start: {
33
- x: number;
34
- y: number;
35
- }, b: {
36
- x: number;
37
- y: number;
38
- }, limits: RectLimits): Rect;
39
- /** How a move between two rectangles is eased. */
40
- export type Easing = "linear" | "ease-in-out";
41
- /** The eased share of the way at time `t` (0 to 1). */
42
- export declare function ease(t: number, easing?: Easing): number;
43
- /** The rectangle part-way from `a` to `b` at time `t` (0 to 1), eased. Corner and size move together. */
44
- export declare function lerpRect(a: Rect, b: Rect, t: number, easing?: Easing): Rect;
45
- /** True when two rectangles are the same to the unit's thousandth. */
46
- export declare const sameRect: (a: Rect, b: Rect) => boolean;
47
- /** The canvas a picture of `size` needs once turned by `angle` degrees: the bounding box of the turned picture. Zero degrees is the picture's own size. */
48
- export declare function turnedSize(size: readonly [number, number], angle: number): [number, number];
49
- /**
50
- * Where a window goes when the picture under it is turned from `from` to `to` degrees. The window's
51
- * centre turns with the picture about the canvas centre, its size stays, and it is held inside the
52
- * new canvas (shrunk if it no longer fits). `size` is the picture's own, unturned size.
53
- */
54
- export declare function turnRect(rect: Rect, size: readonly [number, number], from: number, to: number): Rect;
55
- /** An angle in degrees brought into -180 to 180 and rounded to a tenth, the step the turn control works in. */
56
- export declare function normaliseAngle(angle: number): number;
57
- /** One window cut into a left and a right half at `at` (0 to 1 across it, default the middle). */
58
- export declare function splitRect(r: Rect, at?: number): [Rect, Rect];
59
- /** The one window that holds both (their union): a spread made one page again. */
60
- export declare function joinRects(a: Rect, b: Rect): Rect;
61
- /** The x of the gutter between two windows: halfway between the left one's right edge and the right one's left edge. */
62
- export declare const gutterOf: (left: Rect, right: Rect) => number;
63
- /** Moves the gutter by `dx`: the left window's right edge and the right window's left edge both move, so they resize together and the gap between them is kept. Neither shrinks below `min` wide, and neither leaves the bounds. */
64
- export declare function moveGutter(left: Rect, right: Rect, dx: number, { bounds, min }: RectLimits): [Rect, Rect];
@@ -1,44 +0,0 @@
1
- /** One id found in a text: `[start, end)` into the text and the id to open. */
2
- export type EntityMatch = {
3
- start: number;
4
- end: number;
5
- id: string;
6
- };
7
- /** A way to find entities in a run of text: a list of known ids, or a function that reports matches. */
8
- export type EntityMatcher = readonly string[] | ((text: string) => readonly EntityMatch[]);
9
- export type Inline = {
10
- type: "text";
11
- text: string;
12
- } | {
13
- type: "bold";
14
- children: Inline[];
15
- } | {
16
- type: "code";
17
- text: string;
18
- } | {
19
- type: "link";
20
- href: string;
21
- children: Inline[];
22
- } | {
23
- type: "entity";
24
- id: string;
25
- text: string;
26
- };
27
- export type Block = {
28
- type: "paragraph";
29
- children: Inline[];
30
- } | {
31
- type: "list";
32
- ordered: boolean;
33
- items: Inline[][];
34
- };
35
- /** Finds ids in `text`, longest first, never inside a longer word. Overlaps go to the earlier, longer match. */
36
- export declare function matchEntities(text: string, matcher: EntityMatcher | undefined): EntityMatch[];
37
- /** A link is safe when its scheme is http, https or mailto. */
38
- export declare function safeHref(href: string): string | null;
39
- /** Parses one line's inline marks. Unclosed marks stay as the text they were typed as. */
40
- export declare function parseInline(text: string, matcher?: EntityMatcher): Inline[];
41
- /** Parses blocks: blank-line separated paragraphs, and runs of `- ` or `1. ` lines as lists. */
42
- export declare function parseRichText(text: string, matcher?: EntityMatcher): Block[];
43
- /** The plain words of a text with the marks removed: what a live region announces. */
44
- export declare function plainText(text: string): string;
@@ -1,16 +0,0 @@
1
- /** Options of `useSearchParam`. */
2
- export type SearchParamOptions<T extends string> = {
3
- /** Read when the param is missing or invalid; setting it removes the param. */
4
- default: T;
5
- /** Says whether a raw value is allowed: a type guard (`isMode`), or a function that returns the typed value or `undefined`. */
6
- parse?: (raw: string) => T | boolean | undefined;
7
- /** Replace the history entry instead of adding one. Default `true`, since most params are filters. */
8
- replace?: boolean;
9
- };
10
- /** What `useSearchParam` returns: the value, and a setter that takes the next value or `null` for the default. */
11
- export type SearchParam<T extends string> = readonly [T, (next: T | null) => void];
12
- /**
13
- * One value held in a URL search parameter (React Router): `const [mode, setMode] = useSearchParam("mode", { default: "all", parse: isMode })`.
14
- * Reads and validates it, drops the param when set to the default or `null`, keeps the others, and replaces the history entry by default.
15
- */
16
- export declare function useSearchParam<T extends string = string>(key: string, { default: fallback, parse, replace }: SearchParamOptions<T>): SearchParam<T>;
@@ -1,40 +0,0 @@
1
- /** How the segmenter tells speech from the room. Every field has a default. */
2
- export type SegmenterOptions = {
3
- /** dB above the room's quiet that starts a take. Default 12. */
4
- onsetDb?: number;
5
- /** The least a frame must reach to count as speech, in dBFS RMS, however quiet the room. Default -55. */
6
- floorDb?: number;
7
- /** Quiet that ends a take, in seconds. Default 1. */
8
- silenceSeconds?: number;
9
- /** Kept before the first and after the last speech, in seconds. Default 0.3. */
10
- padSeconds?: number;
11
- /** Takes with less speech than this are dropped, in seconds. Default 0.3. */
12
- minSpeechSeconds?: number;
13
- /** The longest take: it is cut there. Default none. */
14
- maxSeconds?: number;
15
- };
16
- /** One take cut from the stream. */
17
- export type Segment = {
18
- samples: Float32Array;
19
- /** True when the take reached `maxSeconds` and was cut there, mid-speech. */
20
- cut: boolean;
21
- };
22
- /** A running segmenter: give it every chunk, in order; it hands back each take as it ends. */
23
- export type Segmenter = {
24
- /** Reads a chunk; returns the takes that ended inside it (usually none, at most a few). */
25
- push: (chunk: Float32Array) => Segment[];
26
- /** Ends the take being heard now, if it has enough speech (when listening stops or pauses). */
27
- flush: () => Segment | null;
28
- /** Drops the take being heard now, keeping what was learnt about the room. */
29
- reset: () => void;
30
- /** The room's quiet, in dBFS RMS, or null before the first frame. */
31
- readonly noise: number | null;
32
- /** True while a take is being heard. */
33
- readonly speaking: boolean;
34
- /** Seconds of the take being heard so far (from its first kept sample), 0 when none. */
35
- readonly seconds: number;
36
- };
37
- /** The RMS of `frame` in dBFS, `SILENT_DB` for zeros. */
38
- export declare function rmsDb(frame: Float32Array): number;
39
- /** A segmenter for a stream at `sampleRate`. */
40
- export declare function createSegmenter(sampleRate: number, { onsetDb, floorDb, silenceSeconds, padSeconds, minSpeechSeconds, maxSeconds }?: SegmenterOptions): Segmenter;
@@ -1,34 +0,0 @@
1
- /** A grid: a step in seconds (a beat every 0.5 s from 0) or the exact times of the beats. */
2
- export type Grid = number | readonly number[];
3
- /** The grid point nearest to `time`, or `time` itself when there is no grid. */
4
- export declare function snapToGrid(time: number, grid: Grid | undefined): number;
5
- /** The next grid point after `time` in a direction (`1` later, `-1` earlier); `fallback` is the step when there is no grid. A point `time` is already on is stepped past. */
6
- export declare function stepOnGrid(time: number, dir: 1 | -1, grid: Grid | undefined, fallback: number): number;
7
- /** Grid points inside `[from, to]`, for drawing on a ruler. At most `limit`, so a fine grid on a long axis stays cheap. */
8
- export declare function gridPoints(grid: Grid | undefined, from: number, to: number, limit?: number): number[];
9
- /** What limited a cut: which side, and the reason the app gave. */
10
- export type CutLimit = {
11
- side: "min" | "max";
12
- at: number;
13
- reason?: string;
14
- };
15
- /** Puts `time` inside the room, and says which end held it (with the app's reason) when one did. */
16
- export declare function clampToRoom(time: number, room: {
17
- min: number;
18
- max: number;
19
- minReason?: string;
20
- maxReason?: string;
21
- }): {
22
- time: number;
23
- limit: CutLimit | null;
24
- };
25
- /** Where a dragged cut lands: held by the room (saying which end, if the pointer is beyond it), otherwise snapped to the grid, and never to a grid point outside the room. */
26
- export declare function settleCut(wanted: number, grid: Grid | undefined, room: {
27
- min: number;
28
- max: number;
29
- minReason?: string;
30
- maxReason?: string;
31
- }): {
32
- time: number;
33
- limit: CutLimit | null;
34
- };
@@ -1,53 +0,0 @@
1
- /** How a prompt is said. */
2
- export type SpeakOptions = {
3
- /** BCP 47 language of the text ("en-GB", "sv"). Picks the voice; when omitted the browser's default voice is used. */
4
- lang?: string;
5
- /** The browser voice's speed, 1 normal. Default 0.9. A recording plays at its own pace. */
6
- rate?: number;
7
- /** Called when it has been said (every recording played, or the browser finished), or was stopped. */
8
- onEnd?: () => void;
9
- };
10
- /** One piece of a prompt: its words, and the recording of them when there is one (a URL, already through `withBase`). */
11
- export type SpeechPart = {
12
- text: string;
13
- clip?: string | null;
14
- };
15
- /** What is said: a sentence for the browser's voice, or parts that play their recordings. */
16
- export type Saying = string | readonly SpeechPart[];
17
- /** The words of what is said, as one sentence: what the browser's voice says when a recording is missing, and the button's name. */
18
- export declare function textOf(saying: Saying): string;
19
- /** Whether this browser can play a recording. */
20
- export declare function canPlayClips(): boolean;
21
- /** Whether `saying` can be said here: every part recorded and audio plays, or the browser has speech and there are words. */
22
- export declare function canSay(saying: Saying): boolean;
23
- /** Whether this browser can say text aloud. */
24
- export declare function canSpeak(): boolean;
25
- /** The voice that fits a language: exact match, else the same base language, else none (the browser then uses its default for `lang`). */
26
- export declare function pickVoice(voices: readonly SpeechSynthesisVoice[], lang: string | undefined): SpeechSynthesisVoice | undefined;
27
- /**
28
- * Says it aloud now, cancelling what is still being said. A sentence goes to the browser's voice; parts play their recordings in order when
29
- * every part has one, else their words go to the browser's voice. Does nothing where neither can. Returns whether it started.
30
- */
31
- export declare function speak(saying: Saying, options?: SpeakOptions): boolean;
32
- /** Stops whatever is being said or played. */
33
- export declare function stopSpeaking(): void;
34
- /** Options for `useSpeech`. */
35
- export type UseSpeechOptions = Pick<SpeakOptions, "lang" | "rate"> & {
36
- /** The person has turned speech off: `say` does nothing. Keep the choice where the app keeps its settings. */
37
- muted?: boolean;
38
- };
39
- /** What `useSpeech` returns. */
40
- export type Speech = {
41
- /** The browser can speak and the person has not muted it: show the control only then (for recorded parts, `canSay(parts) && !muted`). */
42
- supported: boolean;
43
- /** True while something is being said. */
44
- speaking: boolean;
45
- /** Says a sentence, or plays recorded parts, now (cancelling what is being said). Returns whether it started. */
46
- say: (saying: Saying) => boolean;
47
- stop: () => void;
48
- };
49
- /**
50
- * Speech for a screen: `const { say, supported } = useSpeech({ lang })`. Waits for voices that load late (`voiceschanged`), cancels on unmount so a
51
- * prompt does not keep talking after its screen is gone, and does nothing where there is no speech or the person muted it.
52
- */
53
- export declare function useSpeech({ lang, rate, muted }?: UseSpeechOptions): Speech;
@@ -1,16 +0,0 @@
1
- /** A run of one text: its words and spaces as written, and whether the words are not in the other text. */
2
- export type TextSegment = {
3
- text: string;
4
- changed: boolean;
5
- };
6
- /** The two texts cut into segments, and how many words differ on each side. */
7
- export type TextDifference = {
8
- a: TextSegment[];
9
- b: TextSegment[];
10
- changedA: number;
11
- changedB: number;
12
- };
13
- /** The most words in A times the most in B that are compared; a bigger pair is not. */
14
- export declare const MAX_CELLS = 2500000;
15
- /** Marks the words that differ between two texts, or returns null when the pair is too long to compare. */
16
- export declare function diffWords(a: string, b: string): TextDifference | null;
@@ -1,14 +0,0 @@
1
- /** The smallest step whose ticks are at least `minGapPx` apart at this zoom, so labels thin out instead of colliding. */
2
- export declare function tickStep(pxPerUnit: number, minGapPx?: number): number;
3
- /** Tick times from `from` to `to` inclusive, on multiples of `step`. */
4
- export declare function ticksBetween(from: number, to: number, step: number): number[];
5
- /** A tick's label: m:ss, h:mm:ss, with tenths or hundredths when the step is under a second. */
6
- export declare function tickLabel(time: number, step: number): string;
7
- export declare function clamp(value: number, min: number, max: number): number;
8
- /** The point to snap `time` to: the nearest of `points` within `thresholdPx` at this zoom, or `null`. */
9
- export declare function snapTo(time: number, points: readonly number[], pxPerUnit: number, thresholdPx?: number): {
10
- time: number;
11
- point: number;
12
- } | null;
13
- /** Round away float noise from adding steps (0.1 + 0.2). */
14
- export declare const tidy: (n: number) => number;
@@ -1,53 +0,0 @@
1
- /** One word, with when it starts and ends (seconds). */
2
- export type TranscriptWord = {
3
- text: string;
4
- start: number;
5
- end: number;
6
- /** How sure the recogniser was, 0 to 1. Below the view's `doubtfulBelow` (default 0.6) the word is doubtful. */
7
- confidence?: number;
8
- /** The recogniser's own verdict, when it gives one instead of a number. Wins over `confidence`. */
9
- doubtful?: boolean;
10
- /** The word was corrected by a person: what the recogniser heard (shown on hover) and who changed it. Drawn as a dotted underline in the primary colour, and said to a screen reader. */
11
- correction?: {
12
- original: string;
13
- by?: string;
14
- };
15
- };
16
- /** The id of a word for marking (`TranscriptView`'s `marking`, `Mark`): its phrase and its place in it. */
17
- export declare const wordId: (phraseId: string, index: number) => string;
18
- /** The phrase an id made by `wordId` belongs to. */
19
- export declare const phraseOfWordId: (id: string) => string;
20
- /** A mark an app puts on a phrase ("Not sung", "Not a lyric"): a word, always, and the tone it is drawn in. */
21
- export type TranscriptPhraseState = {
22
- id: string;
23
- label: string;
24
- tone: "neutral" | "info" | "success" | "warning" | "danger";
25
- };
26
- /** A phrase: timed words, who said it, and its other texts (a translation) by mode. */
27
- export type TranscriptPhrase = {
28
- id: string;
29
- start: number;
30
- end: number;
31
- words: readonly TranscriptWord[];
32
- speaker?: string;
33
- /** Other texts for the phrase by mode name: `{ translated: "…" }`. */
34
- alt?: Readonly<Record<string, string>>;
35
- /** The mark the person (or the app) put on it. */
36
- state?: TranscriptPhraseState;
37
- };
38
- /** Whether a word is doubtful: the recogniser said so, or its confidence is under `below`. */
39
- export declare function isDoubtful(word: Pick<TranscriptWord, "confidence" | "doubtful">, below?: number): boolean;
40
- /** Whether any word of a phrase is doubtful. */
41
- export declare function phraseDoubtful(phrase: Pick<TranscriptPhrase, "words">, below?: number): boolean;
42
- /** Phrases that belong together (a clip), with a heading. */
43
- export type TranscriptGroup = {
44
- id: string;
45
- title: string; /** Defaults to the first phrase's start. */
46
- start?: number; /** Defaults to the last phrase's end. */
47
- end?: number;
48
- phrases: readonly TranscriptPhrase[];
49
- };
50
- /** The phrase being heard at `time`, as an index into `phrases` (sorted by start), or -1. A phrase is heard from its `start` up to, not including, its `end`. */
51
- export declare function phraseAt(phrases: readonly Pick<TranscriptPhrase, "start" | "end">[], time: number): number;
52
- /** The word being heard within a phrase at `time`: the last word that has started, until the phrase ends. -1 before the first word. */
53
- export declare function wordAt(phrase: Pick<TranscriptPhrase, "words" | "end">, time: number): number;
@@ -1,4 +0,0 @@
1
- import { ClassValue } from 'clsx';
2
- export declare const typeSteps: readonly ["caption", "label", "body-sm", "body", "heading", "title", "figure", "display", "picture"];
3
- /** clsx + tailwind-merge, taught that `type-*` utilities are font sizes and `rounded-control`, `-surface`, `-overlay`, `-pill` are radii. */
4
- export declare function cn(...inputs: ClassValue[]): string;
@@ -1,29 +0,0 @@
1
- import * as React from "react";
2
- export type ViewPointerOptions = {
3
- /** One pointer moved while down: the change since its last event, and the event (for Shift and the buttons). Called once the drag is past `threshold`. */
4
- onDrag: (dx: number, dy: number, event: React.PointerEvent<HTMLElement>) => void;
5
- /** Two pointers: the earlier distance over the new one, so more than 1 is fingers coming together. Called with the event. */
6
- onPinch?: (ratio: number, event: React.PointerEvent<HTMLElement>) => void;
7
- /** A press that did not drag, or pinch, ended. */
8
- onTap?: (event: React.PointerEvent<HTMLElement>) => void;
9
- /** Called first on a press that is taken (a scene cancels its Reset animation here). */
10
- onDown?: (event: React.PointerEvent<HTMLElement>) => void;
11
- /** A press to leave alone (a button in the viewer, a secondary mouse button). Default: none. */
12
- ignore?: (event: React.PointerEvent<HTMLElement>) => boolean;
13
- /** Pixels a press must move before it is a drag. Default 4; 0 drags at once. */
14
- threshold?: number;
15
- };
16
- /** The pointer handlers of a viewer: spread them on the focusable box. Handlers are read fresh each event, so they may close over state. */
17
- export declare function useViewPointers(options: ViewPointerOptions): {
18
- onPointerDown: (e: React.PointerEvent<HTMLElement>) => void;
19
- onPointerMove: (e: React.PointerEvent<HTMLElement>) => void;
20
- onPointerUp: (e: React.PointerEvent<HTMLElement>) => void;
21
- onPointerCancel: (e: React.PointerEvent<HTMLElement>) => void;
22
- };
23
- /** A wheel that zooms a viewer: `onZoom` gets a factor (above 1 is out). `when` says which wheels count; the rest scroll the page. */
24
- export declare function useWheelZoom(ref: React.RefObject<HTMLElement | null>, onZoom: (factor: number, event: WheelEvent) => void, { when, enabled }?: {
25
- when?: (event: WheelEvent) => boolean;
26
- enabled?: boolean;
27
- }): void;
28
- /** The words for a view, once it has been still for `ms`: "" until then and on first render, so a screen reader hears where it ended up, not every frame. */
29
- export declare function useSettledStatus(words: string, ms?: number): string;
@@ -1,55 +0,0 @@
1
- /** Zoom and pan of a picture inside its frame. `scale` 1 is the picture fitted; `x` and `y` are pixels from the centre. */
2
- export type Viewport = {
3
- scale: number;
4
- x: number;
5
- y: number;
6
- };
7
- /** The picture fitted in its frame, not panned. */
8
- export declare const FIT: Viewport;
9
- /** The least zoom: the whole picture fitted. */
10
- export declare const MIN_SCALE = 1;
11
- /** The most zoom, 32 times the fit. */
12
- export declare const MAX_SCALE = 32;
13
- /** Keeps the picture from being dragged out of its frame: at most half the extra width or height past each edge. */
14
- export declare function clampViewport(v: Viewport, frame: {
15
- width: number;
16
- height: number;
17
- }): Viewport;
18
- /** A new scale with the point under `at` (pixels from the frame's centre) staying under it. */
19
- export declare function zoomAt(v: Viewport, nextScale: number, at: {
20
- x: number;
21
- y: number;
22
- }, frame: {
23
- width: number;
24
- height: number;
25
- }): Viewport;
26
- /** The scale at which the picture's own pixels are drawn one to one: its natural width over the width it is fitted at. */
27
- export declare function actualPixelsScale(naturalWidth: number, fittedWidth: number): number;
28
- /** The CSS transform for a viewport. */
29
- export declare function viewportTransform(v: Viewport): string;
30
- /** A box in a picture, as shares (0 to 1) of its width and height from the top left: `[x, y, width, height]`. */
31
- export type ShareBox = readonly [number, number, number, number];
32
- /** A named box in the source's coordinates: `of` is the reference size in pixels, and without it the box is already shares. */
33
- export type Region = {
34
- id: string;
35
- label: string;
36
- box: readonly [number, number, number, number];
37
- of?: readonly [number, number];
38
- };
39
- /** A region as shares of the frame, so it lands on the same part of every candidate whatever its pixel size. */
40
- export declare function regionShares(region: Region): ShareBox;
41
- /** The viewport that fills the frame with a box (as much of it as fits, centred): the scale that fits the box, the offset that puts its centre at the frame's centre. */
42
- export declare function boxViewport(box: ShareBox, frame: {
43
- width: number;
44
- height: number;
45
- }): Viewport;
46
- /** A rectangle drawn on the frame (pixels from its top left) as shares of the picture under the viewport now. */
47
- export declare function frameBoxToShares(rect: {
48
- x0: number;
49
- y0: number;
50
- x1: number;
51
- y1: number;
52
- }, v: Viewport, frame: {
53
- width: number;
54
- height: number;
55
- }): ShareBox;
@@ -1,46 +0,0 @@
1
- /** Peaks as an app has them: a magnitude per slice (0 to 1), or the lowest and highest sample per slice (-1 to 1). */
2
- export type WaveformPeaks = ArrayLike<number> | {
3
- min: ArrayLike<number>;
4
- max: ArrayLike<number>;
5
- };
6
- /** Peaks as the lowest and highest sample of each slice. */
7
- export type PeakPair = {
8
- min: Float32Array;
9
- max: Float32Array;
10
- };
11
- /** Makes the lowest and highest sample of each slice from either form. A magnitude `m` is the pair `-m` to `m`. */
12
- export declare function toPeakPair(peaks: WaveformPeaks): PeakPair;
13
- /** The lowest and highest of `pair` over the fraction `from` to `to` of its length (0 to 1). A slice narrower than one entry takes the entry it falls in, so zooming past the data never leaves a gap. */
14
- export declare function peaksBetween(pair: PeakPair, from: number, to: number): [number, number];
15
- /** Resamples peaks to `buckets` entries: each is the lowest and highest of the entries it covers. Any length in, any length out. */
16
- export declare function resamplePeaks(peaks: WaveformPeaks, buckets: number): PeakPair;
17
- /**
18
- * How much to scale peaks so the loud parts fill the height: one over the `percentile` of the slices'
19
- * largest magnitudes, at most `maxGain` and never below 1. A percentile rather than the loudest slice,
20
- * so one thump or click on a quiet recording (a dropped camcorder, a tape splice) does not keep the rest
21
- * flat; a ceiling, so a recording that is only hiss is not drawn as if it were speech.
22
- */
23
- export declare function peakGain(pair: PeakPair, { percentile, maxGain }?: {
24
- percentile?: number;
25
- maxGain?: number;
26
- }): number;
27
- /** What a decoded file looks like to this code: the shape of the browser's `AudioBuffer`. */
28
- export type DecodedAudio = {
29
- duration: number;
30
- numberOfChannels: number;
31
- length: number;
32
- getChannelData: (channel: number) => ArrayLike<number>;
33
- };
34
- /**
35
- * Reduces decoded audio to `buckets` peaks over all channels, in chunks, calling `progress` with
36
- * the buckets done and awaiting between chunks so the page stays responsive and `signal` can stop it.
37
- */
38
- export declare function peaksFromAudio(audio: DecodedAudio, buckets: number, options?: {
39
- signal?: AbortSignal;
40
- progress?: (done: number, total: number) => void;
41
- chunk?: number;
42
- }): Promise<PeakPair>;
43
- /** The time at the pointer, given the visible range and the width. */
44
- export declare const timeAt: (px: number, width: number, from: number, to: number) => number;
45
- /** Keeps a visible range of `span` seconds inside `0` to `duration`. */
46
- export declare function clampView(from: number, span: number, duration: number): [number, number];
package/dist/map/fan.d.ts DELETED
@@ -1,15 +0,0 @@
1
- /** A marker's true place in world pixels. */
2
- export type FanInput = {
3
- id: string;
4
- x: number;
5
- y: number;
6
- };
7
- /** Where it is drawn; `fanned` is true when that is not its true place (draw a leader line back). */
8
- export type FanOutput = {
9
- id: string;
10
- x: number;
11
- y: number;
12
- fanned: boolean;
13
- };
14
- /** Move apart markers closer than `gap` pixels. Output is in input order. */
15
- export declare function fanOut(items: readonly FanInput[], gap?: number): FanOutput[];
@@ -1,3 +0,0 @@
1
- export { RouteMap, type MapPosition, type MapRoute, type MapView, type PickNearest, type RouteMapProps, type TileSource } from './route-map';
2
- export { type MapMarker, type MarkerKeyWords } from './markers';
3
- export { fanOut, type FanInput, type FanOutput } from './fan';
@@ -1,2 +0,0 @@
1
- /** Puts Leaflet's stylesheet and the token overrides in the document head, once. */
2
- export declare function installMapStyles(): void;
@@ -1,60 +0,0 @@
1
- import { default as L } from 'leaflet';
2
- import { LatLng } from '../lib/geo';
3
- import * as React from "react";
4
- /** The words the key uses for each marker state. */
5
- export type MarkerKeyWords = {
6
- marker?: string;
7
- selected?: string;
8
- highlighted?: string;
9
- };
10
- /** An item on the map: a place, or a stretch of a route (drawn heavier, the marker at its middle). */
11
- export type MapMarker = {
12
- /** Stable between renders. */
13
- id: string;
14
- /** A place, or a stretch of a route between two distances along it (metres). */
15
- at: LatLng | {
16
- routeId: string;
17
- from: number;
18
- to: number;
19
- };
20
- /** Its name: the button's accessible name and the card's default words. */
21
- label: string;
22
- selected?: boolean;
23
- /** Marked by the app (a diamond): the newest draft's choice, a flagged item. */
24
- highlighted?: boolean;
25
- /** Any CSS colour, normally a role; overrides the state's. */
26
- colour?: string;
27
- };
28
- /** A marker with where it really is and where it is drawn. */
29
- export type Placed = {
30
- marker: MapMarker;
31
- at: LatLng;
32
- shown: LatLng;
33
- fanned: boolean;
34
- };
35
- /** The running distance at each point of a route, kept per route array so a long route is walked once. */
36
- export declare function alongOf(points: readonly LatLng[]): number[];
37
- /** Where a marker really is: its place, or the middle of its stretch. Null when its route is not on the map. */
38
- export declare function markerPlace(m: MapMarker, routes: readonly {
39
- id: string;
40
- points: readonly LatLng[];
41
- }[]): LatLng | null;
42
- /** The markers near the view, with the overlapping ones fanned apart for this zoom. */
43
- export declare function placeMarkers(map: L.Map, markers: readonly MapMarker[], routes: readonly {
44
- id: string;
45
- points: readonly LatLng[];
46
- }[]): Placed[];
47
- type LayerProps = {
48
- map: L.Map;
49
- placed: readonly Placed[];
50
- onSelect?: (id: string) => void;
51
- card?: (m: MapMarker) => React.ReactNode;
52
- };
53
- /** The pins for the markers near the view, as one roving group: one tab stop, arrows between them. */
54
- export declare function MarkerLayer({ map, placed, onSelect, card }: LayerProps): React.JSX.Element;
55
- /** The key to the marker states that are on the map, each with its shape and its words. */
56
- export declare function MarkerKey({ markers, words }: {
57
- markers: readonly MapMarker[];
58
- words?: MarkerKeyWords;
59
- }): React.JSX.Element | null;
60
- export {};