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
package/dist/map.d.ts ADDED
@@ -0,0 +1,184 @@
1
+ import { t as LatLng } from "./geo-DfKa9JtK.js";
2
+ import * as React from "react";
3
+ import L from "leaflet";
4
+ /** The words the key uses for each marker state. */
5
+ 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
+ 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 source of map tiles: a URL template the app's provider documents, and the attribution it requires. */
29
+ type TileSource = {
30
+ /** `https://tiles.example.com/{z}/{x}/{y}.png`; `{s}` and `{r}` work as in Leaflet. */
31
+ url: string;
32
+ /** What the provider requires shown (HTML allowed: "© OpenStreetMap contributors"). */
33
+ attribution: string;
34
+ subdomains?: string;
35
+ minZoom?: number;
36
+ maxZoom?: number;
37
+ };
38
+ /** One route on the map. */
39
+ type MapRoute = {
40
+ id: string;
41
+ /** Its name, in the text alternative and on hover ("Wednesday run"). */
42
+ label: string;
43
+ points: readonly LatLng[];
44
+ /** Any CSS colour, normally a role (`var(--chart-2)`). Default: the chart palette in order. */
45
+ colour?: string;
46
+ /** Line width in pixels. Default 4. */
47
+ weight?: number;
48
+ /** One value per point, coloured by `colourScale` (speed, elevation, heart rate). */
49
+ values?: readonly number[];
50
+ /** Direction chevrons along the line: true for five, or a count. Default on for a single route. */
51
+ arrows?: boolean | number;
52
+ /** Start and finish marks. Default on for a single route. */
53
+ ends?: boolean;
54
+ };
55
+ /** One moving position, for a map with more than one (two runners on the same loop). */
56
+ type MapPosition = {
57
+ /** Stable between renders: the marker is kept by it and moved, never recreated. */
58
+ id: string;
59
+ /** Where it is now; null hides it. */
60
+ at: LatLng | null;
61
+ /** What it is called in the text alternative ("Runner A"). */
62
+ label: string;
63
+ /** The route it travels. Its marker takes that route's colour and the text alternative says how far along it is. */
64
+ routeId?: string;
65
+ /** Any CSS colour, normally a role. Overrides the route's. Default: the route's colour, else the theme's primary. */
66
+ colour?: string;
67
+ };
68
+ /** The view the map settled on. */
69
+ type MapView = {
70
+ bounds: [LatLng, LatLng];
71
+ zoom: number;
72
+ center: LatLng;
73
+ };
74
+ /** The route nearest a picked place. */
75
+ type PickNearest = {
76
+ routeId: string;
77
+ /** The leg of the route (its first point's index) the place is nearest. */
78
+ index: number;
79
+ /** How far the place is from the route, in metres. */
80
+ distanceM: number;
81
+ /** How far along the route the nearest point is, in metres. */
82
+ alongM: number;
83
+ /** The nearest point on the route. */
84
+ position: LatLng;
85
+ };
86
+ type RouteMapProps = {
87
+ /** Names the map ("Route of Wednesday's run"). */
88
+ label: string;
89
+ /** Keep this array stable between renders (state or `useMemo`): the routes are redrawn when it changes, which a moving position must not cause. */
90
+ routes: readonly MapRoute[];
91
+ tiles: {
92
+ light: TileSource;
93
+ dark?: TileSource;
94
+ };
95
+ /** Where the moving thing is now. Moved without redrawing any route; null for none. */
96
+ position?: LatLng | null;
97
+ /** What the position is called in the text alternative. Default "Current position". */
98
+ positionLabel?: string;
99
+ /** More moving positions, each in its route's colour and named in the text alternative. Moved without redrawing any route; `position` may be used beside them. */
100
+ positions?: readonly MapPosition[];
101
+ /** Which position `follow` tracks: a `positions` id. Default `position`, else the first of `positions` that is shown. */
102
+ followId?: string;
103
+ /** `true` pans only when the position leaves the inner 80% of the view; `"centre"` keeps it exactly in the centre on every update, with no animation (a frame is deterministic), at `zoom` when that is set, else the zoom the map has. */
104
+ follow?: boolean | "centre";
105
+ /** The zoom level, any number (12, 14.5): it may change every frame without redrawing routes. Unset, the map fits its routes and the person zooms. */
106
+ zoom?: number;
107
+ /** Items on the map: places, or stretches of a route. Keep the array stable between renders. */
108
+ markers?: readonly MapMarker[];
109
+ /** A marker was pressed (click, Enter or Space). */
110
+ onMarkerSelect?: (id: string) => void;
111
+ /** The words shown beside a marker on hover and focus (as `Tooltip`; not interactive). Default its label. */
112
+ renderMarkerCard?: (marker: MapMarker) => React.ReactNode;
113
+ /** The words of the marker key; `false` leaves the key out. */
114
+ markerKey?: MarkerKeyWords | false;
115
+ /** Join the nearest `CursorScope`: a pointer near a route puts its distance along it in every member, and another member's distance shows as a ring on the route. `{ routeId }` picks the route (default the first). */
116
+ cursor?: boolean | {
117
+ routeId?: string;
118
+ };
119
+ /** The view settled after the person moved or zoomed it: bounds, zoom and centre. Not called for moves the app caused through props. */
120
+ onViewChange?: (view: MapView) => void;
121
+ /** Milliseconds the view must be still before `onViewChange`. Default 250. */
122
+ settle?: number;
123
+ /** Also call `onViewChange` for moves the app caused through props (the first fit, `zoom`, `view`, `follow`). */
124
+ reportAppMoves?: boolean;
125
+ /** A view to show: centre and zoom, as a saved view or the app's own. The person can still move away from it; set it again to go back. Wins over fitting the routes. */
126
+ view?: {
127
+ center: LatLng;
128
+ zoom: number;
129
+ };
130
+ /** Choose a place on the map. While set, a click or Enter picks and route lines do not take clicks. */
131
+ picking?: boolean;
132
+ /** A place was chosen, with the nearest route to it when there is one. */
133
+ onPick?: (at: LatLng, info: {
134
+ nearest: PickNearest | null;
135
+ }) => void;
136
+ /** Escape was pressed while picking: the app turns `picking` off. */
137
+ onPickCancel?: () => void;
138
+ /** The banner for pick mode ("Click the map to set the point; Escape cancels"), shown top centre. */
139
+ pickBanner?: React.ReactNode;
140
+ /** The route drawn heavier, with the others lighter. */
141
+ selectedId?: string | null;
142
+ /** A route line was pressed. Give the app's own list of routes the same action for the keyboard. */
143
+ onSelect?: (id: string) => void;
144
+ /** Step colours for routes that have `values`: a step starts at `at` and runs to the next. */
145
+ colourScale?: readonly {
146
+ at: number;
147
+ colour: string;
148
+ }[];
149
+ /** What the colours mean, written in the key ("Speed"). */
150
+ colourScaleLabel?: string;
151
+ /** Writes a value in the key and the text alternative ("12 km/h"). Default the plain number. */
152
+ formatValue?: (value: number) => string;
153
+ /** Replaces the generated text alternative. */
154
+ summary?: string;
155
+ /** Units for lengths in the generated text. Default metric. */
156
+ units?: "metric" | "imperial";
157
+ /** Wheel zoom. Off by default so the page still scrolls past the map. */
158
+ scrollZoom?: boolean;
159
+ /** An app control or figure in the top end corner (Leaflet leaves it free). */
160
+ topEnd?: React.ReactNode;
161
+ /** An app legend or figure in the bottom start corner, below the colour key when there is one. */
162
+ bottomStart?: React.ReactNode;
163
+ /** Layout only. The map is 16:9 and at least 16rem tall unless a height is given. */
164
+ className?: string;
165
+ };
166
+ /** A map of one or more routes with a position that moves along them, on tiles the app supplies, themed from its roles. Leaflet, behind `strata-react/map`. */
167
+ export declare function RouteMap({ label, routes, tiles, position, positionLabel, positions, followId, follow, zoom, markers, onMarkerSelect, renderMarkerCard, markerKey, cursor: cursorProp, onViewChange, settle, reportAppMoves, view, picking, onPick, onPickCancel, pickBanner, selectedId, onSelect, colourScale, colourScaleLabel, formatValue, summary, units, scrollZoom, topEnd, bottomStart, className }: RouteMapProps): React.JSX.Element;
168
+ /** A marker's true place in world pixels. */
169
+ type FanInput = {
170
+ id: string;
171
+ x: number;
172
+ y: number;
173
+ };
174
+ /** Where it is drawn; `fanned` is true when that is not its true place (draw a leader line back). */
175
+ type FanOutput = {
176
+ id: string;
177
+ x: number;
178
+ y: number;
179
+ fanned: boolean;
180
+ };
181
+ /** Move apart markers closer than `gap` pixels. Output is in input order. */
182
+ export declare function fanOut(items: readonly FanInput[], gap?: number): FanOutput[];
183
+ export type { FanInput, FanOutput, MapMarker, MapPosition, MapRoute, MapView, MarkerKeyWords, PickNearest, RouteMapProps, TileSource };
184
+ //# sourceMappingURL=map.d.ts.map
package/dist/map.js CHANGED
@@ -1,15 +1,16 @@
1
- import { u as useColorScheme } from "./theme-CxYZkUNk.js";
2
- import { r as cn, t as Tooltip$1 } from "./tooltip-DhqrDtyu.js";
3
- import { f as format } from "./field-BjeE_FeB.js";
4
- import { n as useSharedCursor, r as geo } from "./cursor-DDGBPiTJ.js";
1
+ import { u as useColorScheme } from "./theme-1oOSMj_D.js";
2
+ import { r as cn, t as Tooltip$1 } from "./tooltip-BosfsWYh.js";
3
+ import { f as format } from "./field-DBCsFIng.js";
4
+ import { n as useSharedCursor, r as geo } from "./cursor-Cwyvgwsw.js";
5
5
  import * as React from "react";
6
6
  import { Button } from "react-aria-components";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  import L from "leaflet";
9
9
  import leafletCss from "leaflet/dist/leaflet.css?inline";
10
10
  import { createPortal } from "react-dom";
11
+
11
12
  // src/map/map-styles.ts
12
- var strata = `
13
+ const strata = `
13
14
  .strata-map .leaflet-container { background: var(--surface-sunken); color: var(--foreground); font: inherit; }
14
15
  .strata-map .leaflet-container:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
15
16
  .strata-map .leaflet-bar { border: 1px solid var(--border); border-radius: var(--radius-control, 4px); box-shadow: none; overflow: hidden; }
@@ -28,7 +29,7 @@ var strata = `
28
29
  .strata-map .strata-map-reset { display: grid; place-items: center; }
29
30
  .strata-map .strata-map-picking, .strata-map .strata-map-picking .leaflet-interactive { cursor: crosshair; }
30
31
  `;
31
- var installed = false;
32
+ let installed = false;
32
33
  /** Puts Leaflet's stylesheet and the token overrides in the document head, once. */
33
34
  function installMapStyles() {
34
35
  if (installed || typeof document === "undefined") return;
@@ -38,6 +39,7 @@ function installMapStyles() {
38
39
  el.textContent = leafletCss + strata;
39
40
  document.head.appendChild(el);
40
41
  }
42
+
41
43
  // src/map/fan.ts
42
44
  /** Move apart markers closer than `gap` pixels. Output is in input order. */
43
45
  function fanOut(items, gap = 26) {
@@ -94,8 +96,9 @@ function fanOut(items, gap = 26) {
94
96
  }
95
97
  return out;
96
98
  }
99
+
97
100
  // src/map/markers.tsx
98
- var alongCache = /* @__PURE__ */ new WeakMap();
101
+ const alongCache = /* @__PURE__ */ new WeakMap();
99
102
  /** The running distance at each point of a route, kept per route array so a long route is walked once. */
100
103
  function alongOf(points) {
101
104
  let a = alongCache.get(points);
@@ -139,7 +142,7 @@ function placeMarkers(map, markers, routes) {
139
142
  };
140
143
  });
141
144
  }
142
- var state = (m) => m.highlighted ? "highlighted" : m.selected ? "selected" : "marker";
145
+ const state = (m) => m.highlighted ? "highlighted" : m.selected ? "selected" : "marker";
143
146
  /** One marker: a Leaflet marker holding a node that React fills with a labelled button. */
144
147
  function Pin({ map, placed, active, onActivate, onMove, register, onSelect, card }) {
145
148
  const { marker, shown } = placed;
@@ -264,6 +267,7 @@ function MarkerKey({ markers, words }) {
264
267
  })
265
268
  });
266
269
  }
270
+
267
271
  // src/map/route-map.tsx
268
272
  /** The smallest and largest value, without spreading the array (a long recording passes the engine's argument limit). */
269
273
  function extent(values) {
@@ -275,8 +279,8 @@ function extent(values) {
275
279
  }
276
280
  return [lo, hi];
277
281
  }
278
- var tuple = (p) => [p[0], p[1]];
279
- var plain = (v) => String(v);
282
+ const tuple = (p) => [p[0], p[1]];
283
+ const plain = (v) => String(v);
280
284
  /** `value`, sampled once a second (a throttle, not a debounce: a value that changes every frame still comes through): for text a screen reader may read, which must not change sixty times a second. */
281
285
  function useSlow(value, ms = 1e3) {
282
286
  const [slow, setSlow] = React.useState(value);
@@ -289,7 +293,7 @@ function useSlow(value, ms = 1e3) {
289
293
  return slow;
290
294
  }
291
295
  /** How many moves of the map the component itself is making right now (see `onViewChange`). */
292
- var quiet = /* @__PURE__ */ new WeakMap();
296
+ const quiet = /* @__PURE__ */ new WeakMap();
293
297
  /** Run a move the component makes itself, so `onViewChange` does not report it. Leaflet's events are synchronous with animation off. */
294
298
  function silently(map, fn) {
295
299
  quiet.set(map, (quiet.get(map) ?? 0) + 1);
@@ -314,8 +318,8 @@ function nearestRoute(routes, at) {
314
318
  }
315
319
  return best;
316
320
  }
317
- var RESET_ICON = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M2 6V2h4M10 2h4v4M14 10v4h-4M6 14H2v-4\"/></svg>";
318
- var CROSS_ICON = "<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" aria-hidden=\"true\" fill=\"none\" stroke-linecap=\"round\"><path d=\"M16 4v24M4 16h24\" stroke=\"var(--background)\" stroke-width=\"5\"/><path d=\"M16 4v24M4 16h24\" stroke=\"var(--foreground)\" stroke-width=\"2\"/></svg>";
321
+ const RESET_ICON = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M2 6V2h4M10 2h4v4M14 10v4h-4M6 14H2v-4\"/></svg>";
322
+ const CROSS_ICON = "<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" aria-hidden=\"true\" fill=\"none\" stroke-linecap=\"round\"><path d=\"M16 4v24M4 16h24\" stroke=\"var(--background)\" stroke-width=\"5\"/><path d=\"M16 4v24M4 16h24\" stroke=\"var(--foreground)\" stroke-width=\"2\"/></svg>";
319
323
  /** Leaflet's control group gets a reset: fit the routes again. A link with a button role, as Leaflet's own zoom buttons are. */
320
324
  function resetControl(onReset) {
321
325
  const control = new L.Control({ position: "topleft" });
@@ -354,8 +358,8 @@ function showRoutes(map, routes, zoom) {
354
358
  });
355
359
  return true;
356
360
  }
357
- var SINGLE = "\0position";
358
- var PALETTE = [
361
+ const SINGLE = "\0position";
362
+ const PALETTE = [
359
363
  1,
360
364
  2,
361
365
  3,
@@ -406,7 +410,7 @@ function stepRuns(points, values, stepOf) {
406
410
  }
407
411
  return runs;
408
412
  }
409
- var arrowHtml = (bearing, colour, halo) => `<svg width="26" height="26" viewBox="0 0 26 26" aria-hidden="true" style="transform: rotate(${bearing.toFixed(0)}deg)"><path d="M6 17 L13 9 L20 17" fill="none" stroke="${halo}" stroke-width="7" stroke-linecap="round" stroke-linejoin="round"/><path d="M6 17 L13 9 L20 17" fill="none" stroke="${colour}" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`;
413
+ const arrowHtml = (bearing, colour, halo) => `<svg width="26" height="26" viewBox="0 0 26 26" aria-hidden="true" style="transform: rotate(${bearing.toFixed(0)}deg)"><path d="M6 17 L13 9 L20 17" fill="none" stroke="${halo}" stroke-width="7" stroke-linecap="round" stroke-linejoin="round"/><path d="M6 17 L13 9 L20 17" fill="none" stroke="${colour}" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`;
410
414
  /** @internal Exported for its test, not part of the package's API. */
411
415
  function coveringTiles(url, options) {
412
416
  return new (L.TileLayer.extend({ _getTiledPixelBounds(centre) {
@@ -1062,6 +1066,6 @@ function ColourKey({ stops, label, formatValue }) {
1062
1066
  })]
1063
1067
  });
1064
1068
  }
1065
- export { RouteMap, fanOut };
1066
1069
 
1070
+ export { RouteMap, fanOut };
1067
1071
  //# sourceMappingURL=map.js.map