strata-react 1.3.25 → 1.3.26

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 (255) hide show
  1. package/UPGRADING.md +4 -0
  2. package/dist/{api-types/cli.d.ts → api-types-cli.d.ts} +1 -0
  3. package/dist/api-types-cli.js +4 -3
  4. package/dist/api-types-cli.js.map +1 -1
  5. package/dist/{api-types/generate.d.ts → api-types.d.ts} +3 -3
  6. package/dist/api-types.js +3 -1
  7. package/dist/{button-KGJI6jQr.js → button-CYXjU-fs.js} +8 -5
  8. package/dist/button-CYXjU-fs.js.map +1 -0
  9. package/dist/{cursor-DDGBPiTJ.js → cursor-Cwyvgwsw.js} +9 -7
  10. package/dist/cursor-Cwyvgwsw.js.map +1 -0
  11. package/dist/{errors-BUvY1Z4d.js → errors-CmuwcWlb.js} +6 -6
  12. package/dist/{errors-BUvY1Z4d.js.map → errors-CmuwcWlb.js.map} +1 -1
  13. package/dist/{field-BjeE_FeB.js → field-DBCsFIng.js} +27 -23
  14. package/dist/field-DBCsFIng.js.map +1 -0
  15. package/dist/{follow-BTPs49FP.js → follow-CXQsL86O.js} +2 -2
  16. package/dist/follow-CXQsL86O.js.map +1 -0
  17. package/dist/{generate-CjTHKJ39.js → generate-BkWhh4k4.js} +8 -6
  18. package/dist/generate-BkWhh4k4.js.map +1 -0
  19. package/dist/{lib/geo.d.ts → geo-DfKa9JtK.d.ts} +35 -33
  20. package/dist/{hls/index.d.ts → hls.d.ts} +13 -12
  21. package/dist/hls.js +5 -4
  22. package/dist/hls.js.map +1 -1
  23. package/dist/index.d.ts +5300 -142
  24. package/dist/index.js +363 -226
  25. package/dist/index.js.map +1 -1
  26. package/dist/map.d.ts +184 -0
  27. package/dist/map.js +21 -17
  28. package/dist/map.js.map +1 -1
  29. package/dist/media-player-BETa3P7K.d.ts +758 -0
  30. package/dist/{microphone-Bo3WaXgD.js → microphone-76skMt6i.js} +41 -30
  31. package/dist/microphone-76skMt6i.js.map +1 -0
  32. package/dist/microphone-DDOnQHxf.d.ts +237 -0
  33. package/dist/{migrate/cli.d.ts → migrate-cli.d.ts} +1 -0
  34. package/dist/migrate-cli.js +8 -6
  35. package/dist/migrate-cli.js.map +1 -1
  36. package/dist/panorama.d.ts +102 -0
  37. package/dist/panorama.js +18 -15
  38. package/dist/panorama.js.map +1 -1
  39. package/dist/{run-BT2WKzMz.js → run-D_Ic1jE7.js} +23 -16
  40. package/dist/run-D_Ic1jE7.js.map +1 -0
  41. package/dist/scene.d.ts +147 -0
  42. package/dist/scene.js +15 -13
  43. package/dist/scene.js.map +1 -1
  44. package/dist/testing.d.ts +468 -0
  45. package/dist/testing.js +11 -3
  46. package/dist/testing.js.map +1 -1
  47. package/dist/{theme-CxYZkUNk.js → theme-1oOSMj_D.js} +19 -17
  48. package/dist/theme-1oOSMj_D.js.map +1 -0
  49. package/dist/{tooltip-DhqrDtyu.js → tooltip-BosfsWYh.js} +9 -6
  50. package/dist/tooltip-BosfsWYh.js.map +1 -0
  51. package/dist/types-B3TsF0Ey.d.ts +241 -0
  52. package/dist/{value-controls-Dm_EYfZW.js → value-controls-5u7sD_wG.js} +22 -17
  53. package/dist/value-controls-5u7sD_wG.js.map +1 -0
  54. package/dist/{viewer-input-CHU0Hx4A.js → viewer-input-3Qa-o35k.js} +3 -2
  55. package/dist/{viewer-input-CHU0Hx4A.js.map → viewer-input-3Qa-o35k.js.map} +1 -1
  56. package/dist/{visual/cli.d.ts → visual-cli.d.ts} +2 -1
  57. package/dist/visual-cli.js +5 -4
  58. package/dist/visual-cli.js.map +1 -1
  59. package/dist/visual.d.ts +105 -0
  60. package/dist/visual.js +4 -3
  61. package/dist/visual.js.map +1 -1
  62. package/package.json +24 -19
  63. package/dist/api-types/index.d.ts +0 -1
  64. package/dist/button-KGJI6jQr.js.map +0 -1
  65. package/dist/components/active-list.d.ts +0 -46
  66. package/dist/components/alert.d.ts +0 -17
  67. package/dist/components/app-shell.d.ts +0 -32
  68. package/dist/components/async-button.d.ts +0 -48
  69. package/dist/components/auto-recorder.d.ts +0 -67
  70. package/dist/components/book-viewer.d.ts +0 -50
  71. package/dist/components/box-overlay.d.ts +0 -44
  72. package/dist/components/boxed-picture.d.ts +0 -34
  73. package/dist/components/button.d.ts +0 -45
  74. package/dist/components/byte-view.d.ts +0 -32
  75. package/dist/components/checkbox.d.ts +0 -39
  76. package/dist/components/choice-grid.d.ts +0 -42
  77. package/dist/components/commands.d.ts +0 -104
  78. package/dist/components/compare-audio.d.ts +0 -30
  79. package/dist/components/compare-grid.d.ts +0 -24
  80. package/dist/components/compare-parts.d.ts +0 -90
  81. package/dist/components/compare-regions.d.ts +0 -37
  82. package/dist/components/compare-text.d.ts +0 -32
  83. package/dist/components/compare-video-grid.d.ts +0 -52
  84. package/dist/components/compare-video.d.ts +0 -61
  85. package/dist/components/compare.d.ts +0 -90
  86. package/dist/components/composition.d.ts +0 -44
  87. package/dist/components/console.d.ts +0 -34
  88. package/dist/components/conversation.d.ts +0 -83
  89. package/dist/components/cursor.d.ts +0 -44
  90. package/dist/components/data-table.d.ts +0 -89
  91. package/dist/components/data-view.d.ts +0 -66
  92. package/dist/components/density.d.ts +0 -16
  93. package/dist/components/dialog.d.ts +0 -45
  94. package/dist/components/difference.d.ts +0 -19
  95. package/dist/components/disclosure.d.ts +0 -49
  96. package/dist/components/done.d.ts +0 -14
  97. package/dist/components/drag-source.d.ts +0 -29
  98. package/dist/components/field.d.ts +0 -79
  99. package/dist/components/file-intake.d.ts +0 -60
  100. package/dist/components/film-strip.d.ts +0 -35
  101. package/dist/components/folder-picker.d.ts +0 -59
  102. package/dist/components/fullscreen-frame.d.ts +0 -18
  103. package/dist/components/history.d.ts +0 -61
  104. package/dist/components/hotkeys.d.ts +0 -44
  105. package/dist/components/infinite-list.d.ts +0 -77
  106. package/dist/components/inspector.d.ts +0 -66
  107. package/dist/components/job-action.d.ts +0 -30
  108. package/dist/components/job-status.d.ts +0 -55
  109. package/dist/components/jobs-table.d.ts +0 -35
  110. package/dist/components/key-glyphs.d.ts +0 -5
  111. package/dist/components/key-owner.d.ts +0 -11
  112. package/dist/components/lightbox.d.ts +0 -61
  113. package/dist/components/line-chart.d.ts +0 -169
  114. package/dist/components/link-card.d.ts +0 -32
  115. package/dist/components/link.d.ts +0 -54
  116. package/dist/components/markable-text.d.ts +0 -60
  117. package/dist/components/media-contents.d.ts +0 -28
  118. package/dist/components/media-group.d.ts +0 -32
  119. package/dist/components/media-player.d.ts +0 -251
  120. package/dist/components/media-progress.d.ts +0 -17
  121. package/dist/components/media-skip.d.ts +0 -31
  122. package/dist/components/media-spans.d.ts +0 -93
  123. package/dist/components/media.d.ts +0 -133
  124. package/dist/components/meter.d.ts +0 -32
  125. package/dist/components/metric.d.ts +0 -17
  126. package/dist/components/outbox-status.d.ts +0 -10
  127. package/dist/components/page-header.d.ts +0 -14
  128. package/dist/components/pair-vote.d.ts +0 -70
  129. package/dist/components/pause-button.d.ts +0 -7
  130. package/dist/components/pixel-image.d.ts +0 -29
  131. package/dist/components/place-board.d.ts +0 -39
  132. package/dist/components/player-warning.d.ts +0 -24
  133. package/dist/components/popover.d.ts +0 -20
  134. package/dist/components/recorder.d.ts +0 -73
  135. package/dist/components/region-editor.d.ts +0 -67
  136. package/dist/components/save.d.ts +0 -46
  137. package/dist/components/say-again.d.ts +0 -13
  138. package/dist/components/schedule-table.d.ts +0 -24
  139. package/dist/components/secret-field.d.ts +0 -34
  140. package/dist/components/selectable-grid.d.ts +0 -57
  141. package/dist/components/selection.d.ts +0 -104
  142. package/dist/components/sequence-timeline.d.ts +0 -50
  143. package/dist/components/shortcut-editor.d.ts +0 -44
  144. package/dist/components/sortable-list.d.ts +0 -39
  145. package/dist/components/status.d.ts +0 -9
  146. package/dist/components/switch.d.ts +0 -15
  147. package/dist/components/system-panel.d.ts +0 -58
  148. package/dist/components/tabs.d.ts +0 -16
  149. package/dist/components/theme.d.ts +0 -106
  150. package/dist/components/thumbnail.d.ts +0 -50
  151. package/dist/components/tile-grid.d.ts +0 -67
  152. package/dist/components/timeline-player.d.ts +0 -18
  153. package/dist/components/timeline.d.ts +0 -115
  154. package/dist/components/toast.d.ts +0 -36
  155. package/dist/components/toggle.d.ts +0 -51
  156. package/dist/components/toolbar.d.ts +0 -15
  157. package/dist/components/tooltip.d.ts +0 -19
  158. package/dist/components/transcript-view.d.ts +0 -63
  159. package/dist/components/tree.d.ts +0 -74
  160. package/dist/components/undo.d.ts +0 -63
  161. package/dist/components/use-timeline.d.ts +0 -44
  162. package/dist/components/value-controls.d.ts +0 -91
  163. package/dist/components/video-clock.d.ts +0 -68
  164. package/dist/components/view-options.d.ts +0 -105
  165. package/dist/components/viewport.d.ts +0 -85
  166. package/dist/components/virtual-list.d.ts +0 -19
  167. package/dist/components/waveform.d.ts +0 -71
  168. package/dist/components/workflow-steps.d.ts +0 -71
  169. package/dist/components/workspace.d.ts +0 -83
  170. package/dist/cursor-DDGBPiTJ.js.map +0 -1
  171. package/dist/field-BjeE_FeB.js.map +0 -1
  172. package/dist/follow-BTPs49FP.js.map +0 -1
  173. package/dist/generate-CjTHKJ39.js.map +0 -1
  174. package/dist/lib/base.d.ts +0 -10
  175. package/dist/lib/book.d.ts +0 -25
  176. package/dist/lib/boxes.d.ts +0 -55
  177. package/dist/lib/breakpoint.d.ts +0 -4
  178. package/dist/lib/choice.d.ts +0 -29
  179. package/dist/lib/chords.d.ts +0 -20
  180. package/dist/lib/client-work.d.ts +0 -24
  181. package/dist/lib/control.d.ts +0 -4
  182. package/dist/lib/dev.d.ts +0 -2
  183. package/dist/lib/errors.d.ts +0 -43
  184. package/dist/lib/file-intake.d.ts +0 -60
  185. package/dist/lib/follow.d.ts +0 -18
  186. package/dist/lib/format.d.ts +0 -243
  187. package/dist/lib/grouped-grid-layout.d.ts +0 -44
  188. package/dist/lib/icon.d.ts +0 -6
  189. package/dist/lib/image-diff.d.ts +0 -30
  190. package/dist/lib/in-view.d.ts +0 -21
  191. package/dist/lib/loudness.d.ts +0 -18
  192. package/dist/lib/marks.d.ts +0 -6
  193. package/dist/lib/microphone.d.ts +0 -24
  194. package/dist/lib/number-input.d.ts +0 -4
  195. package/dist/lib/object-url.d.ts +0 -2
  196. package/dist/lib/overlay.d.ts +0 -1
  197. package/dist/lib/recording.d.ts +0 -16
  198. package/dist/lib/region.d.ts +0 -64
  199. package/dist/lib/rich-text.d.ts +0 -44
  200. package/dist/lib/search-param.d.ts +0 -16
  201. package/dist/lib/segmenter.d.ts +0 -40
  202. package/dist/lib/sequence.d.ts +0 -34
  203. package/dist/lib/speech.d.ts +0 -53
  204. package/dist/lib/text-diff.d.ts +0 -16
  205. package/dist/lib/timeline.d.ts +0 -14
  206. package/dist/lib/transcript.d.ts +0 -53
  207. package/dist/lib/utils.d.ts +0 -4
  208. package/dist/lib/viewer-input.d.ts +0 -29
  209. package/dist/lib/viewport.d.ts +0 -55
  210. package/dist/lib/waveform.d.ts +0 -46
  211. package/dist/map/fan.d.ts +0 -15
  212. package/dist/map/index.d.ts +0 -3
  213. package/dist/map/map-styles.d.ts +0 -2
  214. package/dist/map/markers.d.ts +0 -60
  215. package/dist/map/route-map.d.ts +0 -146
  216. package/dist/microphone-Bo3WaXgD.js.map +0 -1
  217. package/dist/migrate/stock-classes.d.ts +0 -11
  218. package/dist/panorama/gl.d.ts +0 -16
  219. package/dist/panorama/index.d.ts +0 -2
  220. package/dist/panorama/panorama-viewer.d.ts +0 -56
  221. package/dist/panorama/projection.d.ts +0 -45
  222. package/dist/query/api.d.ts +0 -23
  223. package/dist/query/clips.d.ts +0 -48
  224. package/dist/query/index.d.ts +0 -55
  225. package/dist/query/infinite.d.ts +0 -60
  226. package/dist/query/job.d.ts +0 -26
  227. package/dist/query/outbox.d.ts +0 -85
  228. package/dist/query/poll.d.ts +0 -24
  229. package/dist/query/reserve.d.ts +0 -33
  230. package/dist/query/typed-api.d.ts +0 -84
  231. package/dist/query/workflow.d.ts +0 -17
  232. package/dist/run-BT2WKzMz.js.map +0 -1
  233. package/dist/scene/camera.d.ts +0 -99
  234. package/dist/scene/index.d.ts +0 -2
  235. package/dist/scene/scene-viewport.d.ts +0 -48
  236. package/dist/testing/buttons.d.ts +0 -7
  237. package/dist/testing/index.d.ts +0 -161
  238. package/dist/testing/intersection-observer.d.ts +0 -34
  239. package/dist/testing/layout.d.ts +0 -13
  240. package/dist/testing/microphone.d.ts +0 -35
  241. package/dist/testing/setup.d.ts +0 -14
  242. package/dist/testing/speech.d.ts +0 -38
  243. package/dist/testing/storage.d.ts +0 -7
  244. package/dist/theme-CxYZkUNk.js.map +0 -1
  245. package/dist/tooltip-DhqrDtyu.js.map +0 -1
  246. package/dist/value-controls-Dm_EYfZW.js.map +0 -1
  247. package/dist/visual/capture.d.ts +0 -37
  248. package/dist/visual/compare.d.ts +0 -46
  249. package/dist/visual/drop.d.ts +0 -19
  250. package/dist/visual/fonts.d.ts +0 -18
  251. package/dist/visual/index.d.ts +0 -19
  252. package/dist/visual/run.d.ts +0 -22
  253. package/dist/visual/serve.d.ts +0 -13
  254. package/dist/visual/targets.d.ts +0 -17
  255. package/dist/visual/types.d.ts +0 -188
@@ -0,0 +1,468 @@
1
+ import { P as Phase, f as ColorSchemePreference, t as Microphone } from "./microphone-DDOnQHxf.js";
2
+ import * as React from "react";
3
+ import { RouteObject, To } from "react-router";
4
+ import { QueryClient } from "@tanstack/react-query";
5
+ import { RenderOptions } from "@testing-library/react";
6
+ import { ARIARole } from "aria-query";
7
+ /**
8
+ * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */
13
+ declare type Colors = {
14
+ comment: {
15
+ close: string;
16
+ open: string;
17
+ };
18
+ content: {
19
+ close: string;
20
+ open: string;
21
+ };
22
+ prop: {
23
+ close: string;
24
+ open: string;
25
+ };
26
+ tag: {
27
+ close: string;
28
+ open: string;
29
+ };
30
+ value: {
31
+ close: string;
32
+ open: string;
33
+ };
34
+ };
35
+ declare type Indent = (arg0: string) => string;
36
+ declare type Refs = Array<unknown>;
37
+ declare type Print = (arg0: unknown) => string;
38
+ declare type ThemeReceived = {
39
+ comment?: string;
40
+ content?: string;
41
+ prop?: string;
42
+ tag?: string;
43
+ value?: string;
44
+ };
45
+ declare type CompareKeys = ((a: string, b: string) => number) | undefined;
46
+ interface PrettyFormatOptions {
47
+ callToJSON?: boolean;
48
+ compareKeys?: CompareKeys;
49
+ escapeRegex?: boolean;
50
+ escapeString?: boolean;
51
+ highlight?: boolean;
52
+ indent?: number;
53
+ maxDepth?: number;
54
+ min?: boolean;
55
+ plugins?: Plugins;
56
+ printBasicPrototype?: boolean;
57
+ printFunctionName?: boolean;
58
+ theme?: ThemeReceived;
59
+ }
60
+ declare type OptionsReceived = PrettyFormatOptions;
61
+ declare type Config = {
62
+ callToJSON: boolean;
63
+ compareKeys: CompareKeys;
64
+ colors: Colors;
65
+ escapeRegex: boolean;
66
+ escapeString: boolean;
67
+ indent: string;
68
+ maxDepth: number;
69
+ min: boolean;
70
+ plugins: Plugins;
71
+ printBasicPrototype: boolean;
72
+ printFunctionName: boolean;
73
+ spacingInner: string;
74
+ spacingOuter: string;
75
+ };
76
+ declare type Printer = (val: unknown, config: Config, indentation: string, depth: number, refs: Refs, hasCalledToJSON?: boolean) => string;
77
+ declare type Test = (arg0: any) => boolean;
78
+ declare type NewPlugin = {
79
+ serialize: (val: any, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer) => string;
80
+ test: Test;
81
+ };
82
+ declare type PluginOptions = {
83
+ edgeSpacing: string;
84
+ min: boolean;
85
+ spacing: string;
86
+ };
87
+ declare type OldPlugin = {
88
+ print: (val: unknown, print: Print, indent: Indent, options: PluginOptions, colors: Colors) => string;
89
+ test: Test;
90
+ };
91
+ declare type Plugin = NewPlugin | OldPlugin;
92
+ declare type Plugins = Array<Plugin>;
93
+ type MatcherFunction = (content: string, element: Element | null) => boolean;
94
+ type Matcher = MatcherFunction | RegExp | number | string;
95
+ // Get autocomplete for ARIARole union types, while still supporting another string
96
+ // Ref: https://github.com/microsoft/TypeScript/issues/29729#issuecomment-567871939
97
+ type ByRoleMatcher = ARIARole | (string & {});
98
+ type NormalizerFn = (text: string) => string;
99
+ interface MatcherOptions {
100
+ exact?: boolean;
101
+ /** Use normalizer with getDefaultNormalizer instead */
102
+ trim?: boolean;
103
+ /** Use normalizer with getDefaultNormalizer instead */
104
+ collapseWhitespace?: boolean;
105
+ normalizer?: NormalizerFn;
106
+ /** suppress suggestions for a specific query */
107
+ suggest?: boolean;
108
+ }
109
+ interface waitForOptions {
110
+ container?: HTMLElement;
111
+ timeout?: number;
112
+ interval?: number;
113
+ onTimeout?: (error: Error) => Error;
114
+ mutationObserverOptions?: MutationObserverInit;
115
+ }
116
+ interface SelectorMatcherOptions extends MatcherOptions {
117
+ selector?: string;
118
+ ignore?: boolean | string;
119
+ }
120
+ interface ByRoleOptions {
121
+ /** suppress suggestions for a specific query */
122
+ suggest?: boolean;
123
+ /**
124
+ * If true includes elements in the query set that are usually excluded from
125
+ * the accessibility tree. `role="none"` or `role="presentation"` are included
126
+ * in either case.
127
+ */
128
+ hidden?: boolean;
129
+ /**
130
+ * If true only includes elements in the query set that are marked as
131
+ * selected in the accessibility tree, i.e., `aria-selected="true"`
132
+ */
133
+ selected?: boolean;
134
+ /**
135
+ * If true only includes elements in the query set that are marked as
136
+ * busy in the accessibility tree, i.e., `aria-busy="true"`
137
+ */
138
+ busy?: boolean;
139
+ /**
140
+ * If true only includes elements in the query set that are marked as
141
+ * checked in the accessibility tree, i.e., `aria-checked="true"`
142
+ */
143
+ checked?: boolean;
144
+ /**
145
+ * If true only includes elements in the query set that are marked as
146
+ * pressed in the accessibility tree, i.e., `aria-pressed="true"`
147
+ */
148
+ pressed?: boolean;
149
+ /**
150
+ * Filters elements by their `aria-current` state. `true` and `false` match `aria-current="true"` and `aria-current="false"` (as well as a missing `aria-current` attribute) respectively.
151
+ */
152
+ current?: boolean | string;
153
+ /**
154
+ * If true only includes elements in the query set that are marked as
155
+ * expanded in the accessibility tree, i.e., `aria-expanded="true"`
156
+ */
157
+ expanded?: boolean;
158
+ /**
159
+ * Includes elements with the `"heading"` role matching the indicated level,
160
+ * either by the semantic HTML heading elements `<h1>-<h6>` or matching
161
+ * the `aria-level` attribute.
162
+ */
163
+ level?: number;
164
+ value?: {
165
+ now?: number;
166
+ min?: number;
167
+ max?: number;
168
+ text?: Matcher;
169
+ };
170
+ /**
171
+ * Includes every role used in the `role` attribute
172
+ * For example *ByRole('progressbar', {queryFallbacks: true})` will find <div role="meter progressbar">`.
173
+ */
174
+ queryFallbacks?: boolean;
175
+ /**
176
+ * Only considers elements with the specified accessible name.
177
+ */
178
+ name?: RegExp | string | ((accessibleName: string, element: Element) => boolean);
179
+ /**
180
+ * Only considers elements with the specified accessible description.
181
+ */
182
+ description?: RegExp | string | ((accessibleDescription: string, element: Element) => boolean);
183
+ }
184
+ /** The box every element reports while the shims are installed. */
185
+ interface LayoutBox {
186
+ width: number;
187
+ height: number;
188
+ }
189
+ /**
190
+ * Give jsdom a fixed box for every element (`getBoundingClientRect`, `offset*`, `client*`) and a
191
+ * ResizeObserver that reports it on observe, so measuring components render, and an in-memory `localStorage` and `sessionStorage` where the runtime's throw (Node 25+). Defaults to 640×280.
192
+ * Call once in a Vitest setup file (or let `setupStrataTests` do it); does nothing, and returns a no-op, where there is no DOM (a node-environment test); returns a function that puts the originals back.
193
+ */
194
+ export declare function installLayoutShims({ width, height }?: Partial<LayoutBox>): () => void;
195
+ /** The options of `setupStrataTests`. */
196
+ type StrataTestSetup = {
197
+ /** The runner's `afterEach` (`import { afterEach } from "vitest"`). */
198
+ afterEach: (hook: () => void | Promise<void>) => void;
199
+ /** The box every element reports (`installLayoutShims`); `false` to skip the shims. */
200
+ layout?: Partial<LayoutBox> | false;
201
+ };
202
+ /**
203
+ * One call in a Vitest setup file: installs the layout shims (a no-op without a DOM), and after each
204
+ * test unmounts what it rendered, clears the toast queue and forgets loaded thumbnails. Returns a
205
+ * function that puts the layout back. Add jest-dom and MSW's `server` lifecycle beside it.
206
+ */
207
+ export declare function setupStrataTests({ afterEach, layout }: StrataTestSetup): () => void;
208
+ /** An in-memory `Storage`, with the platform's behaviour (values are strings, `key` and `length` work). */
209
+ export declare function memoryStorage(): Storage;
210
+ /**
211
+ * Replaces `localStorage` and `sessionStorage` with in-memory ones where the runtime's are missing or throw (Node 25+ under jsdom), and empties them after each test when the test runner has a global `afterEach`.
212
+ * Does nothing where storage works. Returns a function that puts the originals back. Called by `installLayoutShims`.
213
+ */
214
+ export declare function installStorageShim(): () => void;
215
+ /** One thing said aloud. */
216
+ type Spoken = {
217
+ text: string;
218
+ lang: string;
219
+ rate: number;
220
+ voice: string | null;
221
+ cancelled: boolean;
222
+ /** The recording that was played, or null when the browser's voice said it. */
223
+ clip: string | null;
224
+ };
225
+ /** The recording stand-in `installFakeSpeech` puts on `window`. */
226
+ type FakeSpeech = {
227
+ /** Everything said so far, in order; an utterance cut off by a later one has `cancelled: true`. */
228
+ said: Spoken[];
229
+ /** The texts said so far that were not cancelled. */
230
+ texts(): string[];
231
+ /** The clips played so far, in order (cut-off ones included). */
232
+ clips(): string[];
233
+ /** Ends the utterance or clip being said, as the browser does when it has finished. */
234
+ finish(): void;
235
+ /** Makes the clip playing now fail (a missing file, a refused autoplay): the rest of the prompt goes to the browser's voice. */
236
+ failClip(): void;
237
+ /** Makes these voices the device's, and fires `voiceschanged` (the late arrival some browsers have). */
238
+ setVoices(voices: {
239
+ name: string;
240
+ lang: string;
241
+ }[]): void;
242
+ /** Puts the browser's own back (or none). */
243
+ uninstall(): void;
244
+ };
245
+ /**
246
+ * Installs a recording `speechSynthesis` and `SpeechSynthesisUtterance` on `window` and returns what was said.
247
+ * `uninstall()` after each test. `const speech = installFakeSpeech(); … expect(speech.texts()).toEqual(["Which one is the cat?"])`.
248
+ */
249
+ export declare function installFakeSpeech(voices?: {
250
+ name: string;
251
+ lang: string;
252
+ }[]): FakeSpeech;
253
+ /** `fakeMicrophone`'s options. */
254
+ type FakeMicrophoneOptions = {
255
+ /** Peak of the tone, 0 to 1. Default 0.3 (about -10 dBFS, a good level for speech). */
256
+ amplitude?: number;
257
+ /** Refuse to open with this sentence, as a `MicrophoneError` (what a screen shows). */
258
+ refuse?: string;
259
+ /** Throw something that is not a `MicrophoneError` (an audio graph that failed). */
260
+ crash?: boolean;
261
+ /** What the browser calls the device. Default "Fake USB microphone". */
262
+ device?: string | null;
263
+ /** Open but never send a sample: a take held in its first moment, for a screenshot. */
264
+ silent?: boolean;
265
+ /** Samples a second. Default 16 000. */
266
+ sampleRate?: number;
267
+ /** How many times faster than real time the samples arrive. Default 10. */
268
+ speed?: number;
269
+ /** Stretches of tone at their own `amplitude` (0 for quiet), played in order instead of one steady tone. */
270
+ script?: readonly FakeSpeechStretch[];
271
+ /** Play `script` again from the start when it ends, instead of falling quiet. */
272
+ loop?: boolean;
273
+ };
274
+ /** One stretch of a fake microphone's `script`: so many seconds at a peak (0 is quiet). */
275
+ type FakeSpeechStretch = {
276
+ seconds: number;
277
+ amplitude: number;
278
+ };
279
+ /** A script of `takes` stretches of speech, each `speak` seconds after `gap` seconds of quiet, at `amplitude`. */
280
+ export declare function speechScript(takes: number, { speak, gap, amplitude }?: {
281
+ speak?: number;
282
+ gap?: number;
283
+ amplitude?: number;
284
+ }): FakeSpeechStretch[];
285
+ /** A microphone that sends a tone (or refuses), for tests and stories; hardware is never touched. */
286
+ export declare function fakeMicrophone({ amplitude, refuse, crash, device, silent, sampleRate, speed, script, loop }?: FakeMicrophoneOptions): Microphone;
287
+ /** The filled (`variant="default"`) buttons and links in `container` (default the whole document) that are in view. */
288
+ export declare function filledButtons(container?: ParentNode): HTMLElement[];
289
+ /** Throws unless `container` (default the whole document) has exactly one filled button in view; the message names the ones found. */
290
+ export declare function expectOneFilledButton(container?: ParentNode): HTMLElement;
291
+ /** The phase an `AsyncButton` is in (`idle`, `pending`, `done`, `error`), from the button or any element inside it. */
292
+ export declare function asyncButtonPhase(el: Element): Phase;
293
+ /** One stand-in observer: its callback, options and the elements it currently watches. */
294
+ interface FakeObserver {
295
+ readonly callback: IntersectionObserverCallback;
296
+ readonly options: IntersectionObserverInit;
297
+ readonly targets: ReadonlySet<Element>;
298
+ }
299
+ /** The controls `installFakeIntersectionObserver` returns. */
300
+ interface FakeIntersectionObserverControls {
301
+ /** Every observer created since install, including disconnected ones (their target sets are empty). */
302
+ readonly observers: readonly FakeObserver[];
303
+ /** Report `el` to every observer watching it: in view by default, or out of view with `false`. Returns how many observers were told. */
304
+ intersect(el: Element, isIntersecting?: boolean): number;
305
+ /** Report every watched element as in view, as if the person scrolled to the end of the list. Returns how many elements were reported. */
306
+ scrollToEnd(): number;
307
+ /** Put back whatever `IntersectionObserver` was there before install. */
308
+ uninstall(): void;
309
+ }
310
+ /**
311
+ * Replace `globalThis.IntersectionObserver` with a stand-in the test fires by hand. Call it in
312
+ * `beforeEach` and call `uninstall()` in `afterEach`.
313
+ *
314
+ * @example
315
+ * let io: FakeIntersectionObserverControls;
316
+ * beforeEach(() => { io = installFakeIntersectionObserver(); });
317
+ * afterEach(() => io.uninstall());
318
+ *
319
+ * it("loads the next page at the end of the list", async () => {
320
+ * renderWithStrata(<Pieces />);
321
+ * await screen.findByRole("list", { name: "Pieces" });
322
+ * io.scrollToEnd();
323
+ * expect(await screen.findByText("Celadon bowl")).toBeInTheDocument();
324
+ * });
325
+ */
326
+ export declare function installFakeIntersectionObserver(): FakeIntersectionObserverControls;
327
+ /** A query client for tests: no retries, and nothing goes stale or is collected mid-test. */
328
+ export declare function createTestQueryClient(): QueryClient;
329
+ /** The options `renderWithStrata` and `renderRoutes` share, beside Testing Library's own. */
330
+ export type StrataRenderOptions = Omit<RenderOptions, "wrapper"> & {
331
+ /** The URL the test starts at, with its search and hash (`/bookings?sort=pieces.desc`). Defaults to `/`. */
332
+ route?: string;
333
+ /** The query client; a fresh `createTestQueryClient()` when left out. */
334
+ client?: QueryClient;
335
+ /** The colour scheme to render; `light` when left out. */
336
+ colorScheme?: ColorSchemePreference;
337
+ /** Render the one `StrataToastRegion`, so `toast.show(...)` has somewhere to appear and a test can find it. Default true; pass `false` when the app's own route tree renders the region (a root layout route), or a test would see every toast twice. The queue is cleared at the start of each render, so a toast never carries into the next test. */
338
+ toasts?: boolean;
339
+ /** The microphone a recording screen gets from `useMicrophone()`, such as `fakeMicrophone()`; the browser's when left out (which jsdom cannot open). */
340
+ microphone?: Microphone;
341
+ /** The mount point of an app served behind a proxy (`"/_home/"`): a `<base href>` is in the document while the render lasts and removed when it unmounts, so `withBase`, `createApi` and `useSystemInfo` read what they read in production and in `strata-visual`. None when left out. */
342
+ base?: string;
343
+ };
344
+ /** Testing Library's `render` inside `StrataQueryProvider` and a `MemoryRouter` at `route`. */
345
+ export declare function renderWithStrata(ui: React.ReactElement, { route, client, colorScheme, toasts, microphone, base, ...options }?: StrataRenderOptions): {
346
+ container: HTMLElement;
347
+ baseElement: HTMLElement;
348
+ debug: (baseElement?: import("react-dom/client").Container | (Element | Document) | Array<import("react-dom/client").Container | (Element | Document)> | undefined, maxLength?: number | undefined, options?: OptionsReceived | undefined) => void;
349
+ rerender: (ui: React.ReactNode) => void;
350
+ unmount: () => void;
351
+ asFragment: () => DocumentFragment;
352
+ getByLabelText: (id: Matcher, options?: SelectorMatcherOptions | undefined) => HTMLElement;
353
+ getAllByLabelText: (id: Matcher, options?: SelectorMatcherOptions | undefined) => HTMLElement[];
354
+ queryByLabelText: (id: Matcher, options?: SelectorMatcherOptions | undefined) => HTMLElement | null;
355
+ queryAllByLabelText: (id: Matcher, options?: SelectorMatcherOptions | undefined) => HTMLElement[];
356
+ findByLabelText: (id: Matcher, options?: SelectorMatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement>;
357
+ findAllByLabelText: (id: Matcher, options?: SelectorMatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement[]>;
358
+ getByPlaceholderText: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement;
359
+ getAllByPlaceholderText: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
360
+ queryByPlaceholderText: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement | null;
361
+ queryAllByPlaceholderText: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
362
+ findByPlaceholderText: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement>;
363
+ findAllByPlaceholderText: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement[]>;
364
+ getByText: (id: Matcher, options?: SelectorMatcherOptions | undefined) => HTMLElement;
365
+ getAllByText: (id: Matcher, options?: SelectorMatcherOptions | undefined) => HTMLElement[];
366
+ queryByText: (id: Matcher, options?: SelectorMatcherOptions | undefined) => HTMLElement | null;
367
+ queryAllByText: (id: Matcher, options?: SelectorMatcherOptions | undefined) => HTMLElement[];
368
+ findByText: (id: Matcher, options?: SelectorMatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement>;
369
+ findAllByText: (id: Matcher, options?: SelectorMatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement[]>;
370
+ getByAltText: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement;
371
+ getAllByAltText: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
372
+ queryByAltText: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement | null;
373
+ queryAllByAltText: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
374
+ findByAltText: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement>;
375
+ findAllByAltText: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement[]>;
376
+ getByTitle: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement;
377
+ getAllByTitle: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
378
+ queryByTitle: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement | null;
379
+ queryAllByTitle: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
380
+ findByTitle: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement>;
381
+ findAllByTitle: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement[]>;
382
+ getByDisplayValue: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement;
383
+ getAllByDisplayValue: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
384
+ queryByDisplayValue: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement | null;
385
+ queryAllByDisplayValue: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
386
+ findByDisplayValue: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement>;
387
+ findAllByDisplayValue: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement[]>;
388
+ getByRole: (role: ByRoleMatcher, options?: ByRoleOptions | undefined) => HTMLElement;
389
+ getAllByRole: (role: ByRoleMatcher, options?: ByRoleOptions | undefined) => HTMLElement[];
390
+ queryByRole: (role: ByRoleMatcher, options?: ByRoleOptions | undefined) => HTMLElement | null;
391
+ queryAllByRole: (role: ByRoleMatcher, options?: ByRoleOptions | undefined) => HTMLElement[];
392
+ findByRole: (role: ByRoleMatcher, options?: ByRoleOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement>;
393
+ findAllByRole: (role: ByRoleMatcher, options?: ByRoleOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement[]>;
394
+ getByTestId: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement;
395
+ getAllByTestId: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
396
+ queryByTestId: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement | null;
397
+ queryAllByTestId: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
398
+ findByTestId: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement>;
399
+ findAllByTestId: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement[]>;
400
+ client: QueryClient;
401
+ };
402
+ /** `renderRoutes`'s options: `renderWithStrata`'s, plus the app's `basename`. */
403
+ export type RenderRoutesOptions = StrataRenderOptions & {
404
+ /** The base path the app is served under, as passed to `createBrowserRouter`. */
405
+ basename?: string;
406
+ };
407
+ /** Testing Library's `render` of an app's route tree in a memory data router at `route`, with Strata's providers. */
408
+ export declare function renderRoutes(routes: RouteObject[], { route, basename, client, colorScheme, toasts, microphone, base, ...options }?: RenderRoutesOptions): {
409
+ container: HTMLElement;
410
+ baseElement: HTMLElement;
411
+ debug: (baseElement?: import("react-dom/client").Container | (Element | Document) | Array<import("react-dom/client").Container | (Element | Document)> | undefined, maxLength?: number | undefined, options?: OptionsReceived | undefined) => void;
412
+ rerender: (ui: React.ReactNode) => void;
413
+ unmount: () => void;
414
+ asFragment: () => DocumentFragment;
415
+ getByLabelText: (id: Matcher, options?: SelectorMatcherOptions | undefined) => HTMLElement;
416
+ getAllByLabelText: (id: Matcher, options?: SelectorMatcherOptions | undefined) => HTMLElement[];
417
+ queryByLabelText: (id: Matcher, options?: SelectorMatcherOptions | undefined) => HTMLElement | null;
418
+ queryAllByLabelText: (id: Matcher, options?: SelectorMatcherOptions | undefined) => HTMLElement[];
419
+ findByLabelText: (id: Matcher, options?: SelectorMatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement>;
420
+ findAllByLabelText: (id: Matcher, options?: SelectorMatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement[]>;
421
+ getByPlaceholderText: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement;
422
+ getAllByPlaceholderText: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
423
+ queryByPlaceholderText: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement | null;
424
+ queryAllByPlaceholderText: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
425
+ findByPlaceholderText: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement>;
426
+ findAllByPlaceholderText: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement[]>;
427
+ getByText: (id: Matcher, options?: SelectorMatcherOptions | undefined) => HTMLElement;
428
+ getAllByText: (id: Matcher, options?: SelectorMatcherOptions | undefined) => HTMLElement[];
429
+ queryByText: (id: Matcher, options?: SelectorMatcherOptions | undefined) => HTMLElement | null;
430
+ queryAllByText: (id: Matcher, options?: SelectorMatcherOptions | undefined) => HTMLElement[];
431
+ findByText: (id: Matcher, options?: SelectorMatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement>;
432
+ findAllByText: (id: Matcher, options?: SelectorMatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement[]>;
433
+ getByAltText: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement;
434
+ getAllByAltText: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
435
+ queryByAltText: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement | null;
436
+ queryAllByAltText: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
437
+ findByAltText: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement>;
438
+ findAllByAltText: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement[]>;
439
+ getByTitle: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement;
440
+ getAllByTitle: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
441
+ queryByTitle: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement | null;
442
+ queryAllByTitle: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
443
+ findByTitle: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement>;
444
+ findAllByTitle: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement[]>;
445
+ getByDisplayValue: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement;
446
+ getAllByDisplayValue: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
447
+ queryByDisplayValue: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement | null;
448
+ queryAllByDisplayValue: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
449
+ findByDisplayValue: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement>;
450
+ findAllByDisplayValue: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement[]>;
451
+ getByRole: (role: ByRoleMatcher, options?: ByRoleOptions | undefined) => HTMLElement;
452
+ getAllByRole: (role: ByRoleMatcher, options?: ByRoleOptions | undefined) => HTMLElement[];
453
+ queryByRole: (role: ByRoleMatcher, options?: ByRoleOptions | undefined) => HTMLElement | null;
454
+ queryAllByRole: (role: ByRoleMatcher, options?: ByRoleOptions | undefined) => HTMLElement[];
455
+ findByRole: (role: ByRoleMatcher, options?: ByRoleOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement>;
456
+ findAllByRole: (role: ByRoleMatcher, options?: ByRoleOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement[]>;
457
+ getByTestId: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement;
458
+ getAllByTestId: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
459
+ queryByTestId: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement | null;
460
+ queryAllByTestId: (id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[];
461
+ findByTestId: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement>;
462
+ findAllByTestId: (id: Matcher, options?: MatcherOptions | undefined, waitForElementOptions?: waitForOptions | undefined) => Promise<HTMLElement[]>;
463
+ client: QueryClient;
464
+ router: import("react-router").DataRouter;
465
+ navigate: (to: To | number) => Promise<void>;
466
+ };
467
+ export type { FakeIntersectionObserverControls, FakeMicrophoneOptions, FakeObserver, FakeSpeech, FakeSpeechStretch, LayoutBox, Spoken, StrataTestSetup };
468
+ //# sourceMappingURL=testing.d.ts.map
package/dist/testing.js CHANGED
@@ -1,9 +1,10 @@
1
- import { A as StrataQueryProvider, C as toast, S as StrataToastRegion, c as forgetLoadedThumbnails, j as createQueryClient, n as MicrophoneError, t as MicrophoneContext } from "./microphone-Bo3WaXgD.js";
2
- import { o as ThemeProvider } from "./theme-CxYZkUNk.js";
1
+ import { A as StrataQueryProvider, C as toast, S as StrataToastRegion, c as forgetLoadedThumbnails, j as createQueryClient, n as MicrophoneError, t as MicrophoneContext } from "./microphone-76skMt6i.js";
2
+ import { o as ThemeProvider } from "./theme-1oOSMj_D.js";
3
3
  import * as React from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { MemoryRouter, RouterProvider, createMemoryRouter } from "react-router";
6
6
  import { act, cleanup, render } from "@testing-library/react";
7
+
7
8
  // src/testing/storage.ts
8
9
  /** An in-memory `Storage`, with the platform's behaviour (values are strings, `key` and `length` work). */
9
10
  function memoryStorage() {
@@ -54,6 +55,7 @@ function installStorageShim() {
54
55
  for (const undo of restore.reverse()) undo();
55
56
  };
56
57
  }
58
+
57
59
  // src/testing/layout.ts
58
60
  /** A DOMRect-shaped object, for stand-ins that report geometry. */
59
61
  function box(x, y, width, height) {
@@ -126,6 +128,7 @@ function installLayoutShims({ width = 640, height = 280 } = {}) {
126
128
  for (const undo of restore.reverse()) undo();
127
129
  };
128
130
  }
131
+
129
132
  // src/testing/setup.ts
130
133
  /**
131
134
  * One call in a Vitest setup file: installs the layout shims (a no-op without a DOM), and after each
@@ -141,6 +144,7 @@ function setupStrataTests({ afterEach, layout = {} }) {
141
144
  });
142
145
  return restore;
143
146
  }
147
+
144
148
  // src/testing/speech.ts
145
149
  /**
146
150
  * Installs a recording `speechSynthesis` and `SpeechSynthesisUtterance` on `window` and returns what was said.
@@ -280,6 +284,7 @@ function installFakeSpeech(voices = []) {
280
284
  }
281
285
  };
282
286
  }
287
+
283
288
  // src/testing/microphone.ts
284
289
  /** A script of `takes` stretches of speech, each `speak` seconds after `gap` seconds of quiet, at `amplitude`. */
285
290
  function speechScript(takes, { speak = 1.5, gap = 1.5, amplitude = .3 } = {}) {
@@ -319,6 +324,7 @@ function fakeMicrophone({ amplitude = .3, refuse, crash, device = "Fake USB micr
319
324
  });
320
325
  } };
321
326
  }
327
+
322
328
  // src/testing/buttons.ts
323
329
  /** Whether an element is out of the view: hidden, inert or aria-hidden, itself or by an ancestor. */
324
330
  function outOfView(el) {
@@ -348,6 +354,7 @@ function asyncButtonPhase(el) {
348
354
  if (phase === "idle" || phase === "pending" || phase === "done" || phase === "error") return phase;
349
355
  throw new Error(`Not an AsyncButton: ${el.outerHTML.slice(0, 120)}`);
350
356
  }
357
+
351
358
  // src/testing/intersection-observer.ts
352
359
  function entryFor(target, isIntersecting) {
353
360
  const rect = target.getBoundingClientRect();
@@ -438,6 +445,7 @@ function installFakeIntersectionObserver() {
438
445
  }
439
446
  };
440
447
  }
448
+
441
449
  // src/testing/index.tsx
442
450
  /**
443
451
  * Test helpers: render a component, or a whole route tree, inside a router and a query client, as
@@ -534,6 +542,6 @@ function renderRoutes(routes, { route, basename, client = createTestQueryClient(
534
542
  ...result
535
543
  };
536
544
  }
537
- export { asyncButtonPhase, createTestQueryClient, expectOneFilledButton, fakeMicrophone, filledButtons, installFakeIntersectionObserver, installFakeSpeech, installLayoutShims, installStorageShim, memoryStorage, renderRoutes, renderWithStrata, setupStrataTests, speechScript };
538
545
 
546
+ export { asyncButtonPhase, createTestQueryClient, expectOneFilledButton, fakeMicrophone, filledButtons, installFakeIntersectionObserver, installFakeSpeech, installLayoutShims, installStorageShim, memoryStorage, renderRoutes, renderWithStrata, setupStrataTests, speechScript };
539
547
  //# sourceMappingURL=testing.js.map