@mapcairn/map 0.0.0-stage → 0.1.0-rc.1

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 (315) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +167 -2
  3. package/dist/chrome/Attribution/Attribution.js +304 -0
  4. package/dist/chrome/Attribution/Attribution.js.map +1 -0
  5. package/dist/chrome/Attribution/Attribution.styles.js +10 -0
  6. package/dist/chrome/Attribution/Attribution.styles.js.map +1 -0
  7. package/dist/chrome/Attribution/AttributionSkeleton.js +29 -0
  8. package/dist/chrome/Attribution/AttributionSkeleton.js.map +1 -0
  9. package/dist/chrome/ChromeSkeleton/ChromeSkeleton.js +83 -0
  10. package/dist/chrome/ChromeSkeleton/ChromeSkeleton.js.map +1 -0
  11. package/dist/chrome/EndStack/EndStack.js +157 -0
  12. package/dist/chrome/EndStack/EndStack.js.map +1 -0
  13. package/dist/chrome/EndStack/EndStack.styles.js +12 -0
  14. package/dist/chrome/EndStack/EndStack.styles.js.map +1 -0
  15. package/dist/chrome/EndStack/EndStackSkeleton.js +78 -0
  16. package/dist/chrome/EndStack/EndStackSkeleton.js.map +1 -0
  17. package/dist/chrome/EndStack/endStackHeight.js +22 -0
  18. package/dist/chrome/EndStack/endStackHeight.js.map +1 -0
  19. package/dist/chrome/MapChrome/MapChrome.js +488 -0
  20. package/dist/chrome/MapChrome/MapChrome.js.map +1 -0
  21. package/dist/chrome/MapChrome/MapChrome.styles.js +15 -0
  22. package/dist/chrome/MapChrome/MapChrome.styles.js.map +1 -0
  23. package/dist/chrome/MapChrome/chromeSurface.js +18 -0
  24. package/dist/chrome/MapChrome/chromeSurface.js.map +1 -0
  25. package/dist/chrome/MapChrome/chromeVars.js +71 -0
  26. package/dist/chrome/MapChrome/chromeVars.js.map +1 -0
  27. package/dist/chrome/MapChrome/mapKeyPlacement.js +41 -0
  28. package/dist/chrome/MapChrome/mapKeyPlacement.js.map +1 -0
  29. package/dist/chrome/MapChrome/sharesWidth.js +13 -0
  30. package/dist/chrome/MapChrome/sharesWidth.js.map +1 -0
  31. package/dist/chrome/MapReadout/MapReadout.js +199 -0
  32. package/dist/chrome/MapReadout/MapReadout.js.map +1 -0
  33. package/dist/chrome/MapReadout/MapReadout.styles.js +14 -0
  34. package/dist/chrome/MapReadout/MapReadout.styles.js.map +1 -0
  35. package/dist/chrome/Sheet/Sheet.js +412 -0
  36. package/dist/chrome/Sheet/Sheet.js.map +1 -0
  37. package/dist/chrome/Sheet/Sheet.styles.js +14 -0
  38. package/dist/chrome/Sheet/Sheet.styles.js.map +1 -0
  39. package/dist/chrome/focusRegistry.js +76 -0
  40. package/dist/chrome/focusRegistry.js.map +1 -0
  41. package/dist/chrome/layoutContext.js +30 -0
  42. package/dist/chrome/layoutContext.js.map +1 -0
  43. package/dist/chrome/useScrollEdges.js +53 -0
  44. package/dist/chrome/useScrollEdges.js.map +1 -0
  45. package/dist/host/MapContext.js +16 -0
  46. package/dist/host/MapContext.js.map +1 -0
  47. package/dist/host/MapView.js +189 -0
  48. package/dist/host/MapView.js.map +1 -0
  49. package/dist/host/MapView.styles.js +16 -0
  50. package/dist/host/MapView.styles.js.map +1 -0
  51. package/dist/host/overlays/AccuracyCircle.js +36 -0
  52. package/dist/host/overlays/AccuracyCircle.js.map +1 -0
  53. package/dist/host/overlays/CentreCrosshair.js +40 -0
  54. package/dist/host/overlays/CentreCrosshair.js.map +1 -0
  55. package/dist/host/overlays/DrawOverlay.js +221 -0
  56. package/dist/host/overlays/DrawOverlay.js.map +1 -0
  57. package/dist/host/overlays/MapOverlayLayer.js +27 -0
  58. package/dist/host/overlays/MapOverlayLayer.js.map +1 -0
  59. package/dist/host/overlays/MeasureOverlay.js +87 -0
  60. package/dist/host/overlays/MeasureOverlay.js.map +1 -0
  61. package/dist/host/overlays/PinMarker.js +40 -0
  62. package/dist/host/overlays/PinMarker.js.map +1 -0
  63. package/dist/host/overlays/geometry.js +41 -0
  64. package/dist/host/overlays/geometry.js.map +1 -0
  65. package/dist/host/overlays/overlays.styles.js +27 -0
  66. package/dist/host/overlays/overlays.styles.js.map +1 -0
  67. package/dist/host/pointerTargets.js +22 -0
  68. package/dist/host/pointerTargets.js.map +1 -0
  69. package/dist/host/useLongPress.js +102 -0
  70. package/dist/host/useLongPress.js.map +1 -0
  71. package/dist/host/useMapEngine.js +352 -0
  72. package/dist/host/useMapEngine.js.map +1 -0
  73. package/dist/host/usePointerPosition.js +60 -0
  74. package/dist/host/usePointerPosition.js.map +1 -0
  75. package/dist/index.d.ts +3845 -0
  76. package/dist/index.js +89 -0
  77. package/dist/layers/CatalogueStatus.js +138 -0
  78. package/dist/layers/CatalogueStatus.js.map +1 -0
  79. package/dist/layers/DateTimeControl.js +101 -0
  80. package/dist/layers/DateTimeControl.js.map +1 -0
  81. package/dist/layers/FeatureCard.js +147 -0
  82. package/dist/layers/FeatureCard.js.map +1 -0
  83. package/dist/layers/FeatureChoices.js +101 -0
  84. package/dist/layers/FeatureChoices.js.map +1 -0
  85. package/dist/layers/FeatureGlyph.js +56 -0
  86. package/dist/layers/FeatureGlyph.js.map +1 -0
  87. package/dist/layers/IdentifyStatus.js +36 -0
  88. package/dist/layers/IdentifyStatus.js.map +1 -0
  89. package/dist/layers/LayerItem.js +321 -0
  90. package/dist/layers/LayerItem.js.map +1 -0
  91. package/dist/layers/LayerKey.js +36 -0
  92. package/dist/layers/LayerKey.js.map +1 -0
  93. package/dist/layers/Layers.styles.js +50 -0
  94. package/dist/layers/Layers.styles.js.map +1 -0
  95. package/dist/layers/LayersSection.js +267 -0
  96. package/dist/layers/LayersSection.js.map +1 -0
  97. package/dist/layers/MapDataLayers.js +261 -0
  98. package/dist/layers/MapDataLayers.js.map +1 -0
  99. package/dist/layers/MapKey.js +131 -0
  100. package/dist/layers/MapKey.js.map +1 -0
  101. package/dist/layers/MapKey.styles.js +16 -0
  102. package/dist/layers/MapKey.styles.js.map +1 -0
  103. package/dist/layers/MarkerGlyph.js +84 -0
  104. package/dist/layers/MarkerGlyph.js.map +1 -0
  105. package/dist/layers/SelectionProvider.js +27 -0
  106. package/dist/layers/SelectionProvider.js.map +1 -0
  107. package/dist/layers/ShapeGlyph.js +122 -0
  108. package/dist/layers/ShapeGlyph.js.map +1 -0
  109. package/dist/layers/TurnOffActions.js +147 -0
  110. package/dist/layers/TurnOffActions.js.map +1 -0
  111. package/dist/layers/answersTap.js +16 -0
  112. package/dist/layers/answersTap.js.map +1 -0
  113. package/dist/layers/catalogueNotice.js +65 -0
  114. package/dist/layers/catalogueNotice.js.map +1 -0
  115. package/dist/layers/catalogueReconcile.js +55 -0
  116. package/dist/layers/catalogueReconcile.js.map +1 -0
  117. package/dist/layers/catalogueView.js +32 -0
  118. package/dist/layers/catalogueView.js.map +1 -0
  119. package/dist/layers/featureTitle.js +14 -0
  120. package/dist/layers/featureTitle.js.map +1 -0
  121. package/dist/layers/identifyFeedback.js +30 -0
  122. package/dist/layers/identifyFeedback.js.map +1 -0
  123. package/dist/layers/identifyRun.js +148 -0
  124. package/dist/layers/identifyRun.js.map +1 -0
  125. package/dist/layers/layerStatus.js +13 -0
  126. package/dist/layers/layerStatus.js.map +1 -0
  127. package/dist/layers/loadOutcome.js +107 -0
  128. package/dist/layers/loadOutcome.js.map +1 -0
  129. package/dist/layers/loadReport.js +33 -0
  130. package/dist/layers/loadReport.js.map +1 -0
  131. package/dist/layers/loadRequests.js +73 -0
  132. package/dist/layers/loadRequests.js.map +1 -0
  133. package/dist/layers/mapFeatures.js +307 -0
  134. package/dist/layers/mapFeatures.js.map +1 -0
  135. package/dist/layers/mapKeyBlocks.js +24 -0
  136. package/dist/layers/mapKeyBlocks.js.map +1 -0
  137. package/dist/layers/reveal.js +119 -0
  138. package/dist/layers/reveal.js.map +1 -0
  139. package/dist/layers/selectionMessages.js +53 -0
  140. package/dist/layers/selectionMessages.js.map +1 -0
  141. package/dist/layers/selectionResolve.js +111 -0
  142. package/dist/layers/selectionResolve.js.map +1 -0
  143. package/dist/layers/useDataLayers.js +940 -0
  144. package/dist/layers/useDataLayers.js.map +1 -0
  145. package/dist/layers/useFeatureSelection.js +179 -0
  146. package/dist/layers/useFeatureSelection.js.map +1 -0
  147. package/dist/layers/useScrolls.js +37 -0
  148. package/dist/layers/useScrolls.js.map +1 -0
  149. package/dist/panels/BasemapPicker/BasemapPicker.js +169 -0
  150. package/dist/panels/BasemapPicker/BasemapPicker.js.map +1 -0
  151. package/dist/panels/BasemapPicker/BasemapPicker.styles.js +42 -0
  152. package/dist/panels/BasemapPicker/BasemapPicker.styles.js.map +1 -0
  153. package/dist/panels/ExportSection/ExportSection.js +91 -0
  154. package/dist/panels/ExportSection/ExportSection.js.map +1 -0
  155. package/dist/panels/HelpSection/HelpSection.js +163 -0
  156. package/dist/panels/HelpSection/HelpSection.js.map +1 -0
  157. package/dist/panels/HelpSection/HelpSection.styles.js +9 -0
  158. package/dist/panels/HelpSection/HelpSection.styles.js.map +1 -0
  159. package/dist/panels/PinSection/PinSection.js +39 -0
  160. package/dist/panels/PinSection/PinSection.js.map +1 -0
  161. package/dist/panels/Section/Section.js +43 -0
  162. package/dist/panels/Section/Section.js.map +1 -0
  163. package/dist/panels/Section/Section.styles.js +13 -0
  164. package/dist/panels/Section/Section.styles.js.map +1 -0
  165. package/dist/panels/SettingsSection/LanguageField.js +126 -0
  166. package/dist/panels/SettingsSection/LanguageField.js.map +1 -0
  167. package/dist/panels/SettingsSection/SettingsSection.js +175 -0
  168. package/dist/panels/SettingsSection/SettingsSection.js.map +1 -0
  169. package/dist/panels/SettingsSection/SettingsSection.styles.js +9 -0
  170. package/dist/panels/SettingsSection/SettingsSection.styles.js.map +1 -0
  171. package/dist/panels/ShapesSection/ShapesSection.js +229 -0
  172. package/dist/panels/ShapesSection/ShapesSection.js.map +1 -0
  173. package/dist/panels/ShapesSection/ShapesSection.styles.js +7 -0
  174. package/dist/panels/ShapesSection/ShapesSection.styles.js.map +1 -0
  175. package/dist/panels/SheetContent/SheetContent.js +92 -0
  176. package/dist/panels/SheetContent/SheetContent.js.map +1 -0
  177. package/dist/panels/SheetContent/SheetContent.styles.js +6 -0
  178. package/dist/panels/SheetContent/SheetContent.styles.js.map +1 -0
  179. package/dist/services/ServicesProvider.js +42 -0
  180. package/dist/services/ServicesProvider.js.map +1 -0
  181. package/dist/services/activeMessages.js +140 -0
  182. package/dist/services/activeMessages.js.map +1 -0
  183. package/dist/services/basemapAvailability.js +78 -0
  184. package/dist/services/basemapAvailability.js.map +1 -0
  185. package/dist/services/englishMessages.js +10 -0
  186. package/dist/services/englishMessages.js.map +1 -0
  187. package/dist/services/hooks.js +214 -0
  188. package/dist/services/hooks.js.map +1 -0
  189. package/dist/styles.css +2866 -0
  190. package/dist/styles.css.d.ts +1 -0
  191. package/dist/tools/Directions/Directions.styles.js +25 -0
  192. package/dist/tools/Directions/Directions.styles.js.map +1 -0
  193. package/dist/tools/Directions/DirectionsOverlay.js +46 -0
  194. package/dist/tools/Directions/DirectionsOverlay.js.map +1 -0
  195. package/dist/tools/Directions/DirectionsPanel.js +428 -0
  196. package/dist/tools/Directions/DirectionsPanel.js.map +1 -0
  197. package/dist/tools/Directions/MapDirections.js +84 -0
  198. package/dist/tools/Directions/MapDirections.js.map +1 -0
  199. package/dist/tools/Directions/useDirections.js +226 -0
  200. package/dist/tools/Directions/useDirections.js.map +1 -0
  201. package/dist/tools/Directions/useFreeCentre.js +30 -0
  202. package/dist/tools/Directions/useFreeCentre.js.map +1 -0
  203. package/dist/tools/DrawToolbar/DrawMapBindings.js +34 -0
  204. package/dist/tools/DrawToolbar/DrawMapBindings.js.map +1 -0
  205. package/dist/tools/DrawToolbar/DrawToolbar.js +296 -0
  206. package/dist/tools/DrawToolbar/DrawToolbar.js.map +1 -0
  207. package/dist/tools/DrawToolbar/DrawToolbar.styles.js +21 -0
  208. package/dist/tools/DrawToolbar/DrawToolbar.styles.js.map +1 -0
  209. package/dist/tools/DrawToolbar/imageDrawing.js +24 -0
  210. package/dist/tools/DrawToolbar/imageDrawing.js.map +1 -0
  211. package/dist/tools/DrawToolbar/useDraw.js +543 -0
  212. package/dist/tools/DrawToolbar/useDraw.js.map +1 -0
  213. package/dist/tools/MeasureToolbar/MeasureToolbar.js +116 -0
  214. package/dist/tools/MeasureToolbar/MeasureToolbar.js.map +1 -0
  215. package/dist/tools/MeasureToolbar/MeasureToolbar.styles.js +12 -0
  216. package/dist/tools/MeasureToolbar/MeasureToolbar.styles.js.map +1 -0
  217. package/dist/tools/MeasureToolbar/useMeasure.js +75 -0
  218. package/dist/tools/MeasureToolbar/useMeasure.js.map +1 -0
  219. package/dist/tools/PinCard/PinCard.js +174 -0
  220. package/dist/tools/PinCard/PinCard.js.map +1 -0
  221. package/dist/tools/PinCard/PinCard.styles.js +16 -0
  222. package/dist/tools/PinCard/PinCard.styles.js.map +1 -0
  223. package/dist/tools/PinCard/useReverseAddress.js +77 -0
  224. package/dist/tools/PinCard/useReverseAddress.js.map +1 -0
  225. package/dist/tools/SearchPill/SearchPill.js +292 -0
  226. package/dist/tools/SearchPill/SearchPill.js.map +1 -0
  227. package/dist/tools/SearchPill/SearchPill.styles.js +16 -0
  228. package/dist/tools/SearchPill/SearchPill.styles.js.map +1 -0
  229. package/dist/tools/SearchPill/SearchPillSkeleton.js +41 -0
  230. package/dist/tools/SearchPill/SearchPillSkeleton.js.map +1 -0
  231. package/dist/tools/SearchPill/useSearch.js +143 -0
  232. package/dist/tools/SearchPill/useSearch.js.map +1 -0
  233. package/dist/tools/SearchPill/useSuggestions.js +105 -0
  234. package/dist/tools/SearchPill/useSuggestions.js.map +1 -0
  235. package/dist/tools/Tour/TourCard.js +156 -0
  236. package/dist/tools/Tour/TourCard.js.map +1 -0
  237. package/dist/tools/Tour/TourCard.styles.js +10 -0
  238. package/dist/tools/Tour/TourCard.styles.js.map +1 -0
  239. package/dist/tools/Tour/useTour.js +110 -0
  240. package/dist/tools/Tour/useTour.js.map +1 -0
  241. package/dist/tools/locate/useLocate.js +94 -0
  242. package/dist/tools/locate/useLocate.js.map +1 -0
  243. package/dist/ui/Button/Button.js +36 -0
  244. package/dist/ui/Button/Button.js.map +1 -0
  245. package/dist/ui/Button/Button.styles.js +17 -0
  246. package/dist/ui/Button/Button.styles.js.map +1 -0
  247. package/dist/ui/Chip/Chip.js +37 -0
  248. package/dist/ui/Chip/Chip.js.map +1 -0
  249. package/dist/ui/Chip/Chip.styles.js +29 -0
  250. package/dist/ui/Chip/Chip.styles.js.map +1 -0
  251. package/dist/ui/ControlGroup/ControlGroup.js +23 -0
  252. package/dist/ui/ControlGroup/ControlGroup.js.map +1 -0
  253. package/dist/ui/ControlGroup/ControlGroup.styles.js +6 -0
  254. package/dist/ui/ControlGroup/ControlGroup.styles.js.map +1 -0
  255. package/dist/ui/EmptyState/EmptyState.js +37 -0
  256. package/dist/ui/EmptyState/EmptyState.js.map +1 -0
  257. package/dist/ui/EmptyState/EmptyState.styles.js +10 -0
  258. package/dist/ui/EmptyState/EmptyState.styles.js.map +1 -0
  259. package/dist/ui/Icon/Icon.js +28 -0
  260. package/dist/ui/Icon/Icon.js.map +1 -0
  261. package/dist/ui/Icon/Icon.styles.js +8 -0
  262. package/dist/ui/Icon/Icon.styles.js.map +1 -0
  263. package/dist/ui/IconButton/IconButton.js +47 -0
  264. package/dist/ui/IconButton/IconButton.js.map +1 -0
  265. package/dist/ui/IconButton/IconButton.styles.js +27 -0
  266. package/dist/ui/IconButton/IconButton.styles.js.map +1 -0
  267. package/dist/ui/Isolate/Isolate.js +26 -0
  268. package/dist/ui/Isolate/Isolate.js.map +1 -0
  269. package/dist/ui/Isolate/fillSlots.js +27 -0
  270. package/dist/ui/Isolate/fillSlots.js.map +1 -0
  271. package/dist/ui/ListRow/ListRow.js +59 -0
  272. package/dist/ui/ListRow/ListRow.js.map +1 -0
  273. package/dist/ui/ListRow/ListRow.styles.js +30 -0
  274. package/dist/ui/ListRow/ListRow.styles.js.map +1 -0
  275. package/dist/ui/LiveRegion/LiveRegion.js +88 -0
  276. package/dist/ui/LiveRegion/LiveRegion.js.map +1 -0
  277. package/dist/ui/LiveRegion/announcer.js +114 -0
  278. package/dist/ui/LiveRegion/announcer.js.map +1 -0
  279. package/dist/ui/SegmentedControl/SegmentedControl.js +55 -0
  280. package/dist/ui/SegmentedControl/SegmentedControl.js.map +1 -0
  281. package/dist/ui/SegmentedControl/SegmentedControl.styles.js +9 -0
  282. package/dist/ui/SegmentedControl/SegmentedControl.styles.js.map +1 -0
  283. package/dist/ui/SkipLink/SkipLink.js +35 -0
  284. package/dist/ui/SkipLink/SkipLink.js.map +1 -0
  285. package/dist/ui/SkipLink/SkipLink.styles.js +6 -0
  286. package/dist/ui/SkipLink/SkipLink.styles.js.map +1 -0
  287. package/dist/ui/Slider/Slider.js +68 -0
  288. package/dist/ui/Slider/Slider.js.map +1 -0
  289. package/dist/ui/Slider/Slider.styles.js +13 -0
  290. package/dist/ui/Slider/Slider.styles.js.map +1 -0
  291. package/dist/ui/StatusMessage/StatusMessage.js +124 -0
  292. package/dist/ui/StatusMessage/StatusMessage.js.map +1 -0
  293. package/dist/ui/StatusMessage/StatusMessage.styles.js +28 -0
  294. package/dist/ui/StatusMessage/StatusMessage.styles.js.map +1 -0
  295. package/dist/ui/StatusMessage/StatusMessageFocus.js +30 -0
  296. package/dist/ui/StatusMessage/StatusMessageFocus.js.map +1 -0
  297. package/dist/ui/Surface/Surface.js +22 -0
  298. package/dist/ui/Surface/Surface.js.map +1 -0
  299. package/dist/ui/Surface/Surface.styles.js +27 -0
  300. package/dist/ui/Surface/Surface.styles.js.map +1 -0
  301. package/dist/ui/Switch/Switch.js +58 -0
  302. package/dist/ui/Switch/Switch.js.map +1 -0
  303. package/dist/ui/Switch/Switch.styles.js +13 -0
  304. package/dist/ui/Switch/Switch.styles.js.map +1 -0
  305. package/dist/ui/Tooltip/Tooltip.js +66 -0
  306. package/dist/ui/Tooltip/Tooltip.js.map +1 -0
  307. package/dist/ui/Tooltip/Tooltip.styles.js +6 -0
  308. package/dist/ui/Tooltip/Tooltip.styles.js.map +1 -0
  309. package/dist/ui/Tooltip/inheritColours.js +27 -0
  310. package/dist/ui/Tooltip/inheritColours.js.map +1 -0
  311. package/dist/ui/VisuallyHidden/VisuallyHidden.js +16 -0
  312. package/dist/ui/VisuallyHidden/VisuallyHidden.js.map +1 -0
  313. package/dist/ui/VisuallyHidden/VisuallyHidden.styles.js +6 -0
  314. package/dist/ui/VisuallyHidden/VisuallyHidden.styles.js.map +1 -0
  315. package/package.json +82 -4
@@ -0,0 +1,83 @@
1
+ import { SearchPillSkeleton } from "../../tools/SearchPill/SearchPillSkeleton.js";
2
+ import { AttributionSkeleton } from "../Attribution/AttributionSkeleton.js";
3
+ import { EndStackSkeleton } from "../EndStack/EndStackSkeleton.js";
4
+ import { bottomEnd, endStack, skeletonRoot, topStart } from "../MapChrome/MapChrome.styles.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ // src/chrome/ChromeSkeleton/ChromeSkeleton.tsx
7
+ /**
8
+ * The skeleton's words from `catalogue`, by the keys the live search pill,
9
+ * end stack and credits button use, so the skeleton and the controls that
10
+ * replace it say the same. A host calls it with its default-language
11
+ * catalogue, on the server and in the browser alike, because the skeleton
12
+ * uses no hook and no provider.
13
+ */
14
+ function chromeSkeletonCopy({ t }) {
15
+ return {
16
+ search: {
17
+ placeholder: t("tools.search.places", {}),
18
+ searchLabel: t("tools.search.label", {})
19
+ },
20
+ endStack: {
21
+ controls: t("chrome.endStack.controls", {}),
22
+ mapOptions: t("chrome.endStack.mapOptions", {}),
23
+ measure: t("chrome.endStack.measure", {}),
24
+ directions: t("chrome.endStack.directions", {}),
25
+ draw: t("chrome.endStack.draw", {}),
26
+ locate: t("chrome.endStack.locate", {}),
27
+ settings: t("chrome.endStack.settings", {}),
28
+ zoomControls: t("chrome.endStack.zoomControls", {}),
29
+ zoomIn: t("chrome.endStack.zoomIn", {}),
30
+ zoomOut: t("chrome.endStack.zoomOut", {})
31
+ },
32
+ credits: t("chrome.attribution.label", {})
33
+ };
34
+ }
35
+ /**
36
+ * The server-rendered stand-in for `MapChrome`: the search pill, the map
37
+ * controls, the zoom group on a device with a fine pointer and the credits
38
+ * button, each in the slot and grid the live chrome uses, so the live chrome
39
+ * replaces it in the same boxes. Render it over the map's background colour,
40
+ * as the first paint before the map app mounts.
41
+ *
42
+ * @remarks It is decorative: `aria-hidden` and `inert`, so nobody can focus a
43
+ * control that does nothing yet. It reuses the {@link MapChrome} grid,
44
+ * padding and slot classes, and the real controls' own classes. The layout
45
+ * (bottom sheet or side panel) follows a media query built from the
46
+ * constants `chooseLayout` uses, because the server cannot measure the
47
+ * container. It writes no `style` attribute (production CSP is
48
+ * `style-src 'self'`), uses no hooks and needs no provider (its words arrive
49
+ * as `copy`), and is the same
50
+ * in light and dark themes because it uses only theme tokens.
51
+ */
52
+ function ChromeSkeleton({ copy, directions = false, draw = false }) {
53
+ return /* @__PURE__ */ jsxs("div", {
54
+ className: skeletonRoot,
55
+ "data-testid": "chrome-skeleton",
56
+ "aria-hidden": "true",
57
+ inert: true,
58
+ children: [
59
+ /* @__PURE__ */ jsx("div", {
60
+ className: topStart,
61
+ "data-skeleton-slot": "top-start",
62
+ children: /* @__PURE__ */ jsx(SearchPillSkeleton, { copy: copy.search })
63
+ }),
64
+ /* @__PURE__ */ jsx("div", {
65
+ className: endStack,
66
+ "data-skeleton-slot": "end-stack",
67
+ children: /* @__PURE__ */ jsx(EndStackSkeleton, {
68
+ copy: copy.endStack,
69
+ directions,
70
+ draw
71
+ })
72
+ }),
73
+ /* @__PURE__ */ jsx("div", {
74
+ className: bottomEnd,
75
+ "data-skeleton-slot": "bottom-end",
76
+ children: /* @__PURE__ */ jsx(AttributionSkeleton, { label: copy.credits })
77
+ })
78
+ ]
79
+ });
80
+ }
81
+ export { ChromeSkeleton, chromeSkeletonCopy };
82
+
83
+ //# sourceMappingURL=ChromeSkeleton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChromeSkeleton.js","names":["styles.skeletonRoot","styles.topStart","styles.endStack","styles.bottomEnd"],"sources":["../../../src/chrome/ChromeSkeleton/ChromeSkeleton.tsx"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright MapCairn contributors\nimport type { MessageCatalogue } from \"@mapcairn/core\";\nimport {\n SearchPillSkeleton,\n type SearchPillSkeletonCopy,\n} from \"../../tools/SearchPill/SearchPillSkeleton\";\nimport { AttributionSkeleton } from \"../Attribution/AttributionSkeleton\";\nimport {\n EndStackSkeleton,\n type EndStackSkeletonCopy,\n} from \"../EndStack/EndStackSkeleton\";\nimport * as styles from \"../MapChrome/MapChrome.css\";\n\n/** The words of every control {@link ChromeSkeleton} draws, in the host's default language. */\nexport interface ChromeSkeletonCopy {\n readonly search: SearchPillSkeletonCopy;\n readonly endStack: EndStackSkeletonCopy;\n /** The credits button's name. */\n readonly credits: string;\n}\n\n/**\n * The skeleton's words from `catalogue`, by the keys the live search pill,\n * end stack and credits button use, so the skeleton and the controls that\n * replace it say the same. A host calls it with its default-language\n * catalogue, on the server and in the browser alike, because the skeleton\n * uses no hook and no provider.\n */\nexport function chromeSkeletonCopy({\n t,\n}: MessageCatalogue): ChromeSkeletonCopy {\n return {\n search: {\n placeholder: t(\"tools.search.places\", {}),\n searchLabel: t(\"tools.search.label\", {}),\n },\n endStack: {\n controls: t(\"chrome.endStack.controls\", {}),\n mapOptions: t(\"chrome.endStack.mapOptions\", {}),\n measure: t(\"chrome.endStack.measure\", {}),\n directions: t(\"chrome.endStack.directions\", {}),\n draw: t(\"chrome.endStack.draw\", {}),\n locate: t(\"chrome.endStack.locate\", {}),\n settings: t(\"chrome.endStack.settings\", {}),\n zoomControls: t(\"chrome.endStack.zoomControls\", {}),\n zoomIn: t(\"chrome.endStack.zoomIn\", {}),\n zoomOut: t(\"chrome.endStack.zoomOut\", {}),\n },\n credits: t(\"chrome.attribution.label\", {}),\n };\n}\n\n/** Props for {@link ChromeSkeleton}. */\nexport interface ChromeSkeletonProps {\n /** The words of every control, from {@link chromeSkeletonCopy}. */\n readonly copy: ChromeSkeletonCopy;\n /**\n * Draws the Directions button, which the live chrome shows when the host\n * offers directions, so the controls are in their final places on first paint.\n */\n readonly directions?: boolean;\n /** Show the Draw shapes button, so the skeleton matches a host whose live chrome offers drawing. */\n readonly draw?: boolean;\n}\n\n/**\n * The server-rendered stand-in for `MapChrome`: the search pill, the map\n * controls, the zoom group on a device with a fine pointer and the credits\n * button, each in the slot and grid the live chrome uses, so the live chrome\n * replaces it in the same boxes. Render it over the map's background colour,\n * as the first paint before the map app mounts.\n *\n * @remarks It is decorative: `aria-hidden` and `inert`, so nobody can focus a\n * control that does nothing yet. It reuses the {@link MapChrome} grid,\n * padding and slot classes, and the real controls' own classes. The layout\n * (bottom sheet or side panel) follows a media query built from the\n * constants `chooseLayout` uses, because the server cannot measure the\n * container. It writes no `style` attribute (production CSP is\n * `style-src 'self'`), uses no hooks and needs no provider (its words arrive\n * as `copy`), and is the same\n * in light and dark themes because it uses only theme tokens.\n */\nexport function ChromeSkeleton({\n copy,\n directions = false,\n draw = false,\n}: ChromeSkeletonProps) {\n return (\n <div\n className={styles.skeletonRoot}\n data-testid=\"chrome-skeleton\"\n aria-hidden=\"true\"\n inert\n >\n <div className={styles.topStart} data-skeleton-slot=\"top-start\">\n <SearchPillSkeleton copy={copy.search} />\n </div>\n <div className={styles.endStack} data-skeleton-slot=\"end-stack\">\n <EndStackSkeleton\n copy={copy.endStack}\n directions={directions}\n draw={draw}\n />\n </div>\n <div className={styles.bottomEnd} data-skeleton-slot=\"bottom-end\">\n <AttributionSkeleton label={copy.credits} />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA6BA,SAAgB,mBAAmB,EACjC,KACuC;CACvC,OAAO;EACL,QAAQ;GACN,aAAa,EAAE,uBAAuB,CAAC,CAAC;GACxC,aAAa,EAAE,sBAAsB,CAAC,CAAC;EACzC;EACA,UAAU;GACR,UAAU,EAAE,4BAA4B,CAAC,CAAC;GAC1C,YAAY,EAAE,8BAA8B,CAAC,CAAC;GAC9C,SAAS,EAAE,2BAA2B,CAAC,CAAC;GACxC,YAAY,EAAE,8BAA8B,CAAC,CAAC;GAC9C,MAAM,EAAE,wBAAwB,CAAC,CAAC;GAClC,QAAQ,EAAE,0BAA0B,CAAC,CAAC;GACtC,UAAU,EAAE,4BAA4B,CAAC,CAAC;GAC1C,cAAc,EAAE,gCAAgC,CAAC,CAAC;GAClD,QAAQ,EAAE,0BAA0B,CAAC,CAAC;GACtC,SAAS,EAAE,2BAA2B,CAAC,CAAC;EAC1C;EACA,SAAS,EAAE,4BAA4B,CAAC,CAAC;CAC3C;AACF;;;;;;;;;;;;;;;;;;AAgCA,SAAgB,eAAe,EAC7B,MACA,aAAa,OACb,OAAO,SACe;CACtB,OACE,qBAAC,OAAD;EACE,WAAWA;EACX,eAAY;EACZ,eAAY;EACZ,OAAA;EAJF,UAAA;GAME,oBAAC,OAAD;IAAK,WAAWC;IAAiB,sBAAmB;IAClD,UAAA,oBAAC,oBAAD,EAAoB,MAAM,KAAK,OAAS,CAAA;GACrC,CAAA;GACL,oBAAC,OAAD;IAAK,WAAWC;IAAiB,sBAAmB;IAClD,UAAA,oBAAC,kBAAD;KACE,MAAM,KAAK;KACC;KACN;IACP,CAAA;GACE,CAAA;GACL,oBAAC,OAAD;IAAK,WAAWC;IAAkB,sBAAmB;IACnD,UAAA,oBAAC,qBAAD,EAAqB,OAAO,KAAK,QAAU,CAAA;GACxC,CAAA;EACF;;AAET"}
@@ -0,0 +1,157 @@
1
+ import { useMessages, usePreferences, useSettings } from "../../services/hooks.js";
2
+ import { ControlGroup } from "../../ui/ControlGroup/ControlGroup.js";
3
+ import { IconButton } from "../../ui/IconButton/IconButton.js";
4
+ import { Surface } from "../../ui/Surface/Surface.js";
5
+ import { useFocusTarget } from "../focusRegistry.js";
6
+ import { useChromeSurface } from "../MapChrome/chromeSurface.js";
7
+ import { useScrollEdges } from "../useScrollEdges.js";
8
+ import { compass, compassSurface, group, stack } from "./EndStack.styles.js";
9
+ import { endStackMinHeightForZoom } from "./endStackHeight.js";
10
+ import { shouldShowZoomButtons } from "@mapcairn/core";
11
+ import { Layers, LocateFixed, Minus, Navigation2, Pentagon, Plus, Route, Ruler, Settings } from "lucide-react";
12
+ import { useCallback, useEffect, useRef } from "react";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ // src/chrome/EndStack/EndStack.tsx
15
+ /**
16
+ * The end-stack slot content, a landmark named "Map tools" holding, top to
17
+ * bottom: the compass (only while the map is rotated and the engine can
18
+ * rotate), the "Map controls" group (Map options, Measure, Directions and Draw
19
+ * shapes when the host offers them, Locate me, Settings) and the "Zoom
20
+ * controls" group. The zoom group is never placed anywhere else.
21
+ *
22
+ * @remarks The zoom group follows `shouldShowZoomButtons`: the user's
23
+ * setting wins; otherwise it shows for a fine pointer unless the height
24
+ * `MapChrome` measured for the stack is too short. At a zoom limit the
25
+ * button is `aria-disabled` but stays focusable. Map options, Measure,
26
+ * Directions, Draw shapes and Settings register as focus targets, so
27
+ * closing their surfaces returns focus to them. The stack does not read the
28
+ * map; the app passes its state in.
29
+ */
30
+ function EndStack({ bearing, onResetBearing, mapOptionsOpen, mapOptionsControls, onMapOptions, settingsOpen, settingsControls, onSettings, measuring, onMeasure, directions, drawing = false, onDraw, locating, onLocate, canZoomIn, canZoomOut, onZoomIn, onZoomOut }) {
31
+ const rootRef = useRef(null);
32
+ const registerMapOptions = useFocusTarget("map-options");
33
+ const registerSettings = useFocusTarget("settings");
34
+ const registerMeasure = useFocusTarget("measure");
35
+ const registerDirections = useFocusTarget("directions");
36
+ const registerDraw = useFocusTarget("draw");
37
+ const { settings } = useSettings();
38
+ const { t } = useMessages();
39
+ const { finePointer } = usePreferences();
40
+ const { endStackMaxHeight } = useChromeSurface();
41
+ const showCompass = bearing !== 0;
42
+ const zoom = shouldShowZoomButtons({
43
+ setting: settings.zoomButtons,
44
+ finePointer,
45
+ availableHeight: endStackMaxHeight ?? Number.POSITIVE_INFINITY,
46
+ minHeightForZoom: endStackMinHeightForZoom(showCompass, directions !== void 0, onDraw !== void 0)
47
+ });
48
+ const setRoot = useCallback((root) => {
49
+ rootRef.current = root;
50
+ const find = (target) => root ? root.querySelector(`[data-focus-target="${target}"]`) : null;
51
+ registerMapOptions(find("map-options"));
52
+ registerMeasure(find("measure"));
53
+ registerDirections(find("directions"));
54
+ registerDraw(find("draw"));
55
+ registerSettings(find("settings"));
56
+ }, [
57
+ registerMapOptions,
58
+ registerMeasure,
59
+ registerDirections,
60
+ registerDraw,
61
+ registerSettings
62
+ ]);
63
+ useEffect(() => {
64
+ rootRef.current?.style.setProperty("--chrome-bearing", `${bearing}deg`);
65
+ }, [bearing]);
66
+ useScrollEdges(rootRef);
67
+ return /* @__PURE__ */ jsxs("section", {
68
+ ref: setRoot,
69
+ "aria-label": t("chrome.endStack.label", {}),
70
+ "data-testid": "end-stack",
71
+ "data-zoom-yielded": zoom.yieldedToHeight ? "true" : "false",
72
+ className: stack,
73
+ children: [
74
+ showCompass ? /* @__PURE__ */ jsx(Surface, {
75
+ radius: "control",
76
+ "data-chrome": "end-stack-compass",
77
+ className: compassSurface,
78
+ children: /* @__PURE__ */ jsx(IconButton, {
79
+ label: t("chrome.endStack.resetBearing", {}),
80
+ icon: Navigation2,
81
+ className: compass,
82
+ onClick: onResetBearing
83
+ })
84
+ }) : null,
85
+ /* @__PURE__ */ jsxs(ControlGroup, {
86
+ label: t("chrome.endStack.controls", {}),
87
+ "data-chrome": "end-stack-controls",
88
+ className: group,
89
+ children: [
90
+ /* @__PURE__ */ jsx(IconButton, {
91
+ label: t("chrome.endStack.mapOptions", {}),
92
+ icon: Layers,
93
+ expanded: mapOptionsOpen,
94
+ controls: mapOptionsControls,
95
+ "data-focus-target": "map-options",
96
+ onClick: onMapOptions
97
+ }),
98
+ /* @__PURE__ */ jsx(IconButton, {
99
+ label: t("chrome.endStack.measure", {}),
100
+ icon: Ruler,
101
+ pressed: measuring,
102
+ "data-focus-target": "measure",
103
+ onClick: onMeasure
104
+ }),
105
+ directions ? /* @__PURE__ */ jsx(IconButton, {
106
+ label: t("chrome.endStack.directions", {}),
107
+ icon: Route,
108
+ pressed: directions.active,
109
+ controls: directions.controls,
110
+ "data-focus-target": "directions",
111
+ onClick: directions.onToggle
112
+ }) : null,
113
+ onDraw ? /* @__PURE__ */ jsx(IconButton, {
114
+ label: t("chrome.endStack.draw", {}),
115
+ icon: Pentagon,
116
+ pressed: drawing,
117
+ "data-focus-target": "draw",
118
+ onClick: onDraw
119
+ }) : null,
120
+ /* @__PURE__ */ jsx(IconButton, {
121
+ label: t("chrome.endStack.locate", {}),
122
+ icon: LocateFixed,
123
+ busy: locating,
124
+ onClick: onLocate
125
+ }),
126
+ /* @__PURE__ */ jsx(IconButton, {
127
+ label: t("chrome.endStack.settings", {}),
128
+ icon: Settings,
129
+ expanded: settingsOpen,
130
+ controls: settingsControls,
131
+ "data-focus-target": "settings",
132
+ onClick: onSettings
133
+ })
134
+ ]
135
+ }),
136
+ zoom.show ? /* @__PURE__ */ jsxs(ControlGroup, {
137
+ label: t("chrome.endStack.zoomControls", {}),
138
+ "data-chrome": "end-stack-zoom",
139
+ className: group,
140
+ children: [/* @__PURE__ */ jsx(IconButton, {
141
+ label: t("chrome.endStack.zoomIn", {}),
142
+ icon: Plus,
143
+ disabled: !canZoomIn,
144
+ onClick: onZoomIn
145
+ }), /* @__PURE__ */ jsx(IconButton, {
146
+ label: t("chrome.endStack.zoomOut", {}),
147
+ icon: Minus,
148
+ disabled: !canZoomOut,
149
+ onClick: onZoomOut
150
+ })]
151
+ }) : null
152
+ ]
153
+ });
154
+ }
155
+ export { EndStack };
156
+
157
+ //# sourceMappingURL=EndStack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EndStack.js","names":["styles.stack","styles.compassSurface","styles.compass","styles.group"],"sources":["../../../src/chrome/EndStack/EndStack.tsx"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright MapCairn contributors\nimport { shouldShowZoomButtons } from \"@mapcairn/core\";\nimport {\n Layers,\n LocateFixed,\n Minus,\n Navigation2,\n Pentagon,\n Plus,\n Route,\n Ruler,\n Settings,\n} from \"lucide-react\";\nimport { useCallback, useEffect, useRef } from \"react\";\nimport { useMessages, usePreferences, useSettings } from \"../../services\";\nimport { ControlGroup, IconButton, Surface } from \"../../ui\";\nimport { useFocusTarget } from \"../focusRegistry\";\nimport { useChromeSurface } from \"../MapChrome/chromeSurface\";\nimport { useScrollEdges } from \"../useScrollEdges\";\nimport * as styles from \"./EndStack.css\";\nimport { endStackMinHeightForZoom } from \"./endStackHeight\";\n\n/** The Directions button, shown only when the host offers directions. */\nexport interface EndStackDirections {\n /** The directions panel is open. */\n readonly active: boolean;\n /** The id of the sheet or panel that Directions opens. */\n readonly controls: string;\n readonly onToggle: () => void;\n}\n\n/** Props for {@link EndStack}. The app passes map state from `useMap()`. */\nexport interface EndStackProps {\n /** Map bearing in degrees clockwise from north. */\n readonly bearing: number;\n readonly onResetBearing: () => void;\n /**\n * The sheet or panel that Map options opens is the open surface. False\n * while Settings is open, and while a pin card or Directions is shown in the\n * sheet.\n */\n readonly mapOptionsOpen: boolean;\n /** The id of the sheet or panel that Map options opens. */\n readonly mapOptionsControls: string;\n readonly onMapOptions: () => void;\n /** The settings sheet or panel (Settings and Help) is open. */\n readonly settingsOpen: boolean;\n /** The id of the sheet or panel that Settings opens. */\n readonly settingsControls: string;\n readonly onSettings: () => void;\n /** Measuring is on. */\n readonly measuring: boolean;\n readonly onMeasure: () => void;\n /**\n * The Directions button, between Measure and Locate me. Leave it out and\n * the button is not shown, for a host with no routing service.\n */\n readonly directions?: EndStackDirections;\n /**\n * Draw is on. With `onDraw`, the stack shows a Draw shapes button between\n * Measure and Locate me; without it the button is left out.\n */\n readonly drawing?: boolean;\n readonly onDraw?: () => void;\n /** A location request is in progress. Presses are ignored meanwhile. */\n readonly locating: boolean;\n readonly onLocate: () => void;\n readonly canZoomIn: boolean;\n readonly canZoomOut: boolean;\n readonly onZoomIn: () => void;\n readonly onZoomOut: () => void;\n}\n\n/**\n * The end-stack slot content, a landmark named \"Map tools\" holding, top to\n * bottom: the compass (only while the map is rotated and the engine can\n * rotate), the \"Map controls\" group (Map options, Measure, Directions and Draw\n * shapes when the host offers them, Locate me, Settings) and the \"Zoom\n * controls\" group. The zoom group is never placed anywhere else.\n *\n * @remarks The zoom group follows `shouldShowZoomButtons`: the user's\n * setting wins; otherwise it shows for a fine pointer unless the height\n * `MapChrome` measured for the stack is too short. At a zoom limit the\n * button is `aria-disabled` but stays focusable. Map options, Measure,\n * Directions, Draw shapes and Settings register as focus targets, so\n * closing their surfaces returns focus to them. The stack does not read the\n * map; the app passes its state in.\n */\nexport function EndStack({\n bearing,\n onResetBearing,\n mapOptionsOpen,\n mapOptionsControls,\n onMapOptions,\n settingsOpen,\n settingsControls,\n onSettings,\n measuring,\n onMeasure,\n directions,\n drawing = false,\n onDraw,\n locating,\n onLocate,\n canZoomIn,\n canZoomOut,\n onZoomIn,\n onZoomOut,\n}: EndStackProps) {\n const rootRef = useRef<HTMLElement>(null);\n const registerMapOptions = useFocusTarget(\"map-options\");\n const registerSettings = useFocusTarget(\"settings\");\n const registerMeasure = useFocusTarget(\"measure\");\n const registerDirections = useFocusTarget(\"directions\");\n const registerDraw = useFocusTarget(\"draw\");\n const { settings } = useSettings();\n const { t } = useMessages();\n const { finePointer } = usePreferences();\n const { endStackMaxHeight } = useChromeSurface();\n\n const showCompass = bearing !== 0;\n const zoom = shouldShowZoomButtons({\n setting: settings.zoomButtons,\n finePointer,\n availableHeight: endStackMaxHeight ?? Number.POSITIVE_INFINITY,\n minHeightForZoom: endStackMinHeightForZoom(\n showCompass,\n directions !== undefined,\n onDraw !== undefined,\n ),\n });\n\n // IconButton takes no ref, so the buttons are found through the stack.\n const setRoot = useCallback(\n (root: HTMLElement | null) => {\n rootRef.current = root;\n const find = (target: string) =>\n root\n ? root.querySelector<HTMLElement>(`[data-focus-target=\"${target}\"]`)\n : null;\n registerMapOptions(find(\"map-options\"));\n registerMeasure(find(\"measure\"));\n registerDirections(find(\"directions\"));\n registerDraw(find(\"draw\"));\n registerSettings(find(\"settings\"));\n },\n [\n registerMapOptions,\n registerMeasure,\n registerDirections,\n registerDraw,\n registerSettings,\n ],\n );\n\n useEffect(() => {\n rootRef.current?.style.setProperty(\"--chrome-bearing\", `${bearing}deg`);\n }, [bearing]);\n useScrollEdges(rootRef);\n\n return (\n <section\n ref={setRoot}\n aria-label={t(\"chrome.endStack.label\", {})}\n data-testid=\"end-stack\"\n data-zoom-yielded={zoom.yieldedToHeight ? \"true\" : \"false\"}\n className={styles.stack}\n >\n {showCompass ? (\n <Surface\n radius=\"control\"\n data-chrome=\"end-stack-compass\"\n className={styles.compassSurface}\n >\n <IconButton\n label={t(\"chrome.endStack.resetBearing\", {})}\n icon={Navigation2}\n className={styles.compass}\n onClick={onResetBearing}\n />\n </Surface>\n ) : null}\n <ControlGroup\n label={t(\"chrome.endStack.controls\", {})}\n data-chrome=\"end-stack-controls\"\n className={styles.group}\n >\n <IconButton\n label={t(\"chrome.endStack.mapOptions\", {})}\n icon={Layers}\n expanded={mapOptionsOpen}\n controls={mapOptionsControls}\n data-focus-target=\"map-options\"\n onClick={onMapOptions}\n />\n <IconButton\n label={t(\"chrome.endStack.measure\", {})}\n icon={Ruler}\n pressed={measuring}\n data-focus-target=\"measure\"\n onClick={onMeasure}\n />\n {directions ? (\n <IconButton\n label={t(\"chrome.endStack.directions\", {})}\n icon={Route}\n pressed={directions.active}\n controls={directions.controls}\n data-focus-target=\"directions\"\n onClick={directions.onToggle}\n />\n ) : null}\n {onDraw ? (\n <IconButton\n label={t(\"chrome.endStack.draw\", {})}\n icon={Pentagon}\n pressed={drawing}\n data-focus-target=\"draw\"\n onClick={onDraw}\n />\n ) : null}\n <IconButton\n label={t(\"chrome.endStack.locate\", {})}\n icon={LocateFixed}\n busy={locating}\n onClick={onLocate}\n />\n <IconButton\n label={t(\"chrome.endStack.settings\", {})}\n icon={Settings}\n expanded={settingsOpen}\n controls={settingsControls}\n data-focus-target=\"settings\"\n onClick={onSettings}\n />\n </ControlGroup>\n {zoom.show ? (\n <ControlGroup\n label={t(\"chrome.endStack.zoomControls\", {})}\n data-chrome=\"end-stack-zoom\"\n className={styles.group}\n >\n <IconButton\n label={t(\"chrome.endStack.zoomIn\", {})}\n icon={Plus}\n disabled={!canZoomIn}\n onClick={onZoomIn}\n />\n <IconButton\n label={t(\"chrome.endStack.zoomOut\", {})}\n icon={Minus}\n disabled={!canZoomOut}\n onClick={onZoomOut}\n />\n </ControlGroup>\n ) : null}\n </section>\n );\n}\n"],"mappings":"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"}
@@ -0,0 +1,12 @@
1
+ /* empty css */
2
+ /* empty css */
3
+ // src/chrome/EndStack/EndStack.css.ts
4
+ var stack = "_1gge8f60 _1c0yelp0";
5
+ var skeletonStack = "_1gge8f61 _1gge8f60 _1c0yelp0";
6
+ var compassSurface = "_1gge8f62";
7
+ var compass = "_1gge8f63";
8
+ var group = "_1gge8f64";
9
+ var skeletonZoom = "_1gge8f65";
10
+ export { compass, compassSurface, group, skeletonStack, skeletonZoom, stack };
11
+
12
+ //# sourceMappingURL=EndStack.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EndStack.styles.js","names":[],"sources":[],"mappings":""}
@@ -0,0 +1,78 @@
1
+ import { ControlGroup } from "../../ui/ControlGroup/ControlGroup.js";
2
+ import { IconButton } from "../../ui/IconButton/IconButton.js";
3
+ import { group, skeletonStack, skeletonZoom } from "./EndStack.styles.js";
4
+ import { Layers, LocateFixed, Minus, Pentagon, Plus, Route, Ruler, Settings } from "lucide-react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ // src/chrome/EndStack/EndStackSkeleton.tsx
7
+ /**
8
+ * The end stack as a decorative stand-in for the server-rendered
9
+ * `ChromeSkeleton`: the same column, groups and buttons as {@link EndStack},
10
+ * with the Map options, Measure, Locate me and Settings group (and Directions
11
+ * and Draw shapes when the host sets them) and, on a device with a fine
12
+ * pointer, the zoom group. No compass, because the map starts facing north.
13
+ *
14
+ * @remarks Only ever rendered inside an `aria-hidden`, `inert` container. It
15
+ * uses no hooks and needs no provider: the names arrive as `copy`.
16
+ */
17
+ function EndStackSkeleton({ copy, directions = false, draw = false }) {
18
+ return /* @__PURE__ */ jsxs("div", {
19
+ className: skeletonStack,
20
+ "data-skeleton": "end-stack",
21
+ children: [/* @__PURE__ */ jsxs(ControlGroup, {
22
+ label: copy.controls,
23
+ className: group,
24
+ "data-skeleton": "controls",
25
+ children: [
26
+ /* @__PURE__ */ jsx(IconButton, {
27
+ label: copy.mapOptions,
28
+ icon: Layers,
29
+ tabIndex: -1
30
+ }),
31
+ /* @__PURE__ */ jsx(IconButton, {
32
+ label: copy.measure,
33
+ icon: Ruler,
34
+ tabIndex: -1
35
+ }),
36
+ directions ? /* @__PURE__ */ jsx(IconButton, {
37
+ label: copy.directions,
38
+ icon: Route,
39
+ tabIndex: -1
40
+ }) : null,
41
+ draw ? /* @__PURE__ */ jsx(IconButton, {
42
+ label: copy.draw,
43
+ icon: Pentagon,
44
+ tabIndex: -1
45
+ }) : null,
46
+ /* @__PURE__ */ jsx(IconButton, {
47
+ label: copy.locate,
48
+ icon: LocateFixed,
49
+ tabIndex: -1
50
+ }),
51
+ /* @__PURE__ */ jsx(IconButton, {
52
+ label: copy.settings,
53
+ icon: Settings,
54
+ tabIndex: -1
55
+ })
56
+ ]
57
+ }), /* @__PURE__ */ jsx("div", {
58
+ className: skeletonZoom,
59
+ children: /* @__PURE__ */ jsxs(ControlGroup, {
60
+ label: copy.zoomControls,
61
+ className: group,
62
+ "data-skeleton": "zoom",
63
+ children: [/* @__PURE__ */ jsx(IconButton, {
64
+ label: copy.zoomIn,
65
+ icon: Plus,
66
+ tabIndex: -1
67
+ }), /* @__PURE__ */ jsx(IconButton, {
68
+ label: copy.zoomOut,
69
+ icon: Minus,
70
+ tabIndex: -1
71
+ })]
72
+ })
73
+ })]
74
+ });
75
+ }
76
+ export { EndStackSkeleton };
77
+
78
+ //# sourceMappingURL=EndStackSkeleton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EndStackSkeleton.js","names":["styles.skeletonStack","styles.group","styles.skeletonZoom"],"sources":["../../../src/chrome/EndStack/EndStackSkeleton.tsx"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright MapCairn contributors\nimport {\n Layers,\n LocateFixed,\n Minus,\n Pentagon,\n Plus,\n Route,\n Ruler,\n Settings,\n} from \"lucide-react\";\nimport { ControlGroup, IconButton } from \"../../ui\";\nimport * as styles from \"./EndStack.css\";\n\n/** The names of the controls {@link EndStackSkeleton} draws, in the host's default language. */\nexport interface EndStackSkeletonCopy {\n readonly controls: string;\n readonly mapOptions: string;\n readonly measure: string;\n readonly directions: string;\n readonly draw: string;\n readonly locate: string;\n readonly settings: string;\n readonly zoomControls: string;\n readonly zoomIn: string;\n readonly zoomOut: string;\n}\n\n/** Props for {@link EndStackSkeleton}. */\nexport interface EndStackSkeletonProps {\n readonly copy: EndStackSkeletonCopy;\n /** Shows the Directions button, as the live stack does when the host offers directions. */\n readonly directions?: boolean;\n /** Show the Draw shapes button, as the live stack does when its host offers drawing. */\n readonly draw?: boolean;\n}\n\n/**\n * The end stack as a decorative stand-in for the server-rendered\n * `ChromeSkeleton`: the same column, groups and buttons as {@link EndStack},\n * with the Map options, Measure, Locate me and Settings group (and Directions\n * and Draw shapes when the host sets them) and, on a device with a fine\n * pointer, the zoom group. No compass, because the map starts facing north.\n *\n * @remarks Only ever rendered inside an `aria-hidden`, `inert` container. It\n * uses no hooks and needs no provider: the names arrive as `copy`.\n */\nexport function EndStackSkeleton({\n copy,\n directions = false,\n draw = false,\n}: EndStackSkeletonProps) {\n return (\n <div className={styles.skeletonStack} data-skeleton=\"end-stack\">\n <ControlGroup\n label={copy.controls}\n className={styles.group}\n data-skeleton=\"controls\"\n >\n <IconButton label={copy.mapOptions} icon={Layers} tabIndex={-1} />\n <IconButton label={copy.measure} icon={Ruler} tabIndex={-1} />\n {directions ? (\n <IconButton label={copy.directions} icon={Route} tabIndex={-1} />\n ) : null}\n {draw ? (\n <IconButton label={copy.draw} icon={Pentagon} tabIndex={-1} />\n ) : null}\n <IconButton label={copy.locate} icon={LocateFixed} tabIndex={-1} />\n <IconButton label={copy.settings} icon={Settings} tabIndex={-1} />\n </ControlGroup>\n <div className={styles.skeletonZoom}>\n <ControlGroup\n label={copy.zoomControls}\n className={styles.group}\n data-skeleton=\"zoom\"\n >\n <IconButton label={copy.zoomIn} icon={Plus} tabIndex={-1} />\n <IconButton label={copy.zoomOut} icon={Minus} tabIndex={-1} />\n </ControlGroup>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgDA,SAAgB,iBAAiB,EAC/B,MACA,aAAa,OACb,OAAO,SACiB;CACxB,OACE,qBAAC,OAAD;EAAK,WAAWA;EAAsB,iBAAc;EAApD,UAAA,CACE,qBAAC,cAAD;GACE,OAAO,KAAK;GACZ,WAAWC;GACX,iBAAc;GAHhB,UAAA;IAKE,oBAAC,YAAD;KAAY,OAAO,KAAK;KAAY,MAAM;KAAQ,UAAU;IAAK,CAAA;IACjE,oBAAC,YAAD;KAAY,OAAO,KAAK;KAAS,MAAM;KAAO,UAAU;IAAK,CAAA;IAC5D,aACC,oBAAC,YAAD;KAAY,OAAO,KAAK;KAAY,MAAM;KAAO,UAAU;IAAK,CAAA,IAC9D;IACH,OACC,oBAAC,YAAD;KAAY,OAAO,KAAK;KAAM,MAAM;KAAU,UAAU;IAAK,CAAA,IAC3D;IACJ,oBAAC,YAAD;KAAY,OAAO,KAAK;KAAQ,MAAM;KAAa,UAAU;IAAK,CAAA;IAClE,oBAAC,YAAD;KAAY,OAAO,KAAK;KAAU,MAAM;KAAU,UAAU;IAAK,CAAA;GACrD;EACd,CAAA,GAAA,oBAAC,OAAD;GAAK,WAAWC;GACd,UAAA,qBAAC,cAAD;IACE,OAAO,KAAK;IACZ,WAAWD;IACX,iBAAc;IAHhB,UAAA,CAKE,oBAAC,YAAD;KAAY,OAAO,KAAK;KAAQ,MAAM;KAAM,UAAU;IAAK,CAAA,GAC3D,oBAAC,YAAD;KAAY,OAAO,KAAK;KAAS,MAAM;KAAO,UAAU;IAAK,CAAA,CACjD;;EACX,CAAA,CACF;;AAET"}
@@ -0,0 +1,22 @@
1
+ // src/chrome/EndStack/endStackHeight.ts
2
+ /** Height of one control, in CSS pixels (the 48 px `size.control` token). */
3
+ var CONTROL_PX = 48;
4
+ /**
5
+ * The height the end stack needs to show the zoom group under the main
6
+ * group: four main controls (Map options, Measure, Locate me and Settings),
7
+ * two zoom controls, the gap between the groups and eight hairlines (the
8
+ * dividers between neighbours and the groups' borders), plus the compass and
9
+ * its gap while it shows, and one more control and hairline while the
10
+ * Directions or Draw shapes button shows. Below this, and only when the user
11
+ * has not chosen to show zoom buttons, the zoom group yields.
12
+ *
13
+ * @remarks The stack's own padding is not counted. It lives in its own file,
14
+ * with no styles, so that the browser tests can read it too.
15
+ */
16
+ function endStackMinHeightForZoom(compassShown, directionsShown = false, drawShown = false) {
17
+ const groups = 308 + ((directionsShown ? 1 : 0) + (drawShown ? 1 : 0)) * 49;
18
+ return compassShown ? groups + CONTROL_PX + 12 : groups;
19
+ }
20
+ export { endStackMinHeightForZoom };
21
+
22
+ //# sourceMappingURL=endStackHeight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endStackHeight.js","names":[],"sources":["../../../src/chrome/EndStack/endStackHeight.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-only\n// Copyright MapCairn contributors\nimport { CHROME_GAP_PX } from \"../chromeSpacing\";\n\n/** Height of one control, in CSS pixels (the 48 px `size.control` token). */\nconst CONTROL_PX = 48;\n/** One hairline between grouped buttons, plus the surface border. */\nconst HAIRLINE_PX = 1;\n\n/**\n * The height the end stack needs to show the zoom group under the main\n * group: four main controls (Map options, Measure, Locate me and Settings),\n * two zoom controls, the gap between the groups and eight hairlines (the\n * dividers between neighbours and the groups' borders), plus the compass and\n * its gap while it shows, and one more control and hairline while the\n * Directions or Draw shapes button shows. Below this, and only when the user\n * has not chosen to show zoom buttons, the zoom group yields.\n *\n * @remarks The stack's own padding is not counted. It lives in its own file,\n * with no styles, so that the browser tests can read it too.\n */\nexport function endStackMinHeightForZoom(\n compassShown: boolean,\n directionsShown = false,\n drawShown = false,\n): number {\n const extra =\n ((directionsShown ? 1 : 0) + (drawShown ? 1 : 0)) *\n (CONTROL_PX + HAIRLINE_PX);\n const groups = 6 * CONTROL_PX + CHROME_GAP_PX + 8 * HAIRLINE_PX + extra;\n return compassShown ? groups + CONTROL_PX + CHROME_GAP_PX : groups;\n}\n"],"mappings":";;AAKA,IAAM,aAAa;;;;;;;;;;;;;AAgBnB,SAAgB,yBACd,cACA,kBAAkB,OAClB,YAAY,OACJ;CAIR,MAAM,SAAS,QAFX,kBAAkB,IAAI,MAAM,YAAY,IAAI,MAC7C;CAEH,OAAO,eAAe,SAAS,aAAA,KAA6B;AAC9D"}