@element-editor/ui 0.0.0-stage → 0.2.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 (244) hide show
  1. package/AGENTS.md +65 -0
  2. package/LICENSE +21 -0
  3. package/README.md +46 -2
  4. package/dist/BooleanOperations-BRO7NHUY.js +111 -0
  5. package/dist/BooleanOperations-C2uOHRu3.cjs +1 -0
  6. package/dist/DataTable-B-2VjBEz.cjs +2 -0
  7. package/dist/DataTable-CS-3dIqY.js +510 -0
  8. package/dist/DataTablePanel-58LwzXQR.cjs +1 -0
  9. package/dist/DataTablePanel-DDFUmMaM.js +208 -0
  10. package/dist/EditToolbarBtn-Ch9HCLHq.cjs +3 -0
  11. package/dist/EditToolbarBtn-SR4xHd8G.js +378 -0
  12. package/dist/FeatureEditModal-Cc8N6vei.cjs +1 -0
  13. package/dist/FeatureEditModal-Dr10p3nE.js +77 -0
  14. package/dist/FeatureList-Bo9w9nre.js +520 -0
  15. package/dist/FeatureList-VRYesXCq.cjs +1 -0
  16. package/dist/FeatureRowContextMenu-CtBqdC1j.cjs +1 -0
  17. package/dist/FeatureRowContextMenu-DCUIiDwc.js +130 -0
  18. package/dist/GeoJSONModal-BV9Tamf4.js +886 -0
  19. package/dist/GeoJSONModal-Dd-nBufy.cjs +9 -0
  20. package/dist/SchemaEditor-B4L17K1e.cjs +1 -0
  21. package/dist/SchemaEditor-ryoTgaLb.js +293 -0
  22. package/dist/SchemaModal-DvMbWskS.js +95 -0
  23. package/dist/SchemaModal-gAuDkd-L.cjs +1 -0
  24. package/dist/SettingsModal-BScVTjpn.js +237 -0
  25. package/dist/SettingsModal-CqaSFxxR.cjs +1 -0
  26. package/dist/ShortcutsModal-D1Y2bGT8.cjs +1 -0
  27. package/dist/ShortcutsModal-ozuS2Ysb.js +299 -0
  28. package/dist/components/ActiveDrawingToolbar.d.cts +1 -0
  29. package/dist/components/ActiveDrawingToolbar.d.ts +1 -0
  30. package/dist/components/BasemapPicker.d.cts +26 -0
  31. package/dist/components/BasemapPicker.d.ts +26 -0
  32. package/dist/components/BooleanOperations.d.cts +1 -0
  33. package/dist/components/BooleanOperations.d.ts +1 -0
  34. package/dist/components/BufferPanel.d.cts +1 -0
  35. package/dist/components/BufferPanel.d.ts +1 -0
  36. package/dist/components/DataTable.d.cts +9 -0
  37. package/dist/components/DataTable.d.ts +9 -0
  38. package/dist/components/DataTablePanel.d.cts +10 -0
  39. package/dist/components/DataTablePanel.d.ts +10 -0
  40. package/dist/components/EditingToolbar.d.cts +1 -0
  41. package/dist/components/EditingToolbar.d.ts +1 -0
  42. package/dist/components/ElementEditorErrorBoundary.d.cts +28 -0
  43. package/dist/components/ElementEditorErrorBoundary.d.ts +28 -0
  44. package/dist/components/ElementEditorUIProvider.d.cts +50 -0
  45. package/dist/components/ElementEditorUIProvider.d.ts +50 -0
  46. package/dist/components/FeatureMapContextMenu.d.cts +23 -0
  47. package/dist/components/FeatureMapContextMenu.d.ts +23 -0
  48. package/dist/components/FitBoundsButton.d.cts +6 -0
  49. package/dist/components/FitBoundsButton.d.ts +6 -0
  50. package/dist/components/FloatingToolbar.d.cts +3 -0
  51. package/dist/components/FloatingToolbar.d.ts +3 -0
  52. package/dist/components/LocateButton.d.cts +11 -0
  53. package/dist/components/LocateButton.d.ts +11 -0
  54. package/dist/components/ReadonlyBanner.d.cts +1 -0
  55. package/dist/components/ReadonlyBanner.d.ts +1 -0
  56. package/dist/components/ShortcutsModal.d.cts +1 -0
  57. package/dist/components/ShortcutsModal.d.ts +1 -0
  58. package/dist/components/SimplifyPanel.d.cts +1 -0
  59. package/dist/components/SimplifyPanel.d.ts +1 -0
  60. package/dist/components/SmoothPanel.d.cts +1 -0
  61. package/dist/components/SmoothPanel.d.ts +1 -0
  62. package/dist/components/UndoRedoToolbar.d.cts +20 -0
  63. package/dist/components/UndoRedoToolbar.d.ts +20 -0
  64. package/dist/components/VertexSelectionBar.d.cts +12 -0
  65. package/dist/components/VertexSelectionBar.d.ts +12 -0
  66. package/dist/components/ZoomIndicator.d.cts +15 -0
  67. package/dist/components/ZoomIndicator.d.ts +15 -0
  68. package/dist/components/dialogs/DynamicFieldRenderer.d.cts +11 -0
  69. package/dist/components/dialogs/DynamicFieldRenderer.d.ts +11 -0
  70. package/dist/components/dialogs/SettingsModal.d.cts +1 -0
  71. package/dist/components/dialogs/SettingsModal.d.ts +1 -0
  72. package/dist/components/lazyParts.d.cts +12 -0
  73. package/dist/components/lazyParts.d.ts +12 -0
  74. package/dist/components/sidebar/FeatureEditModal.d.cts +6 -0
  75. package/dist/components/sidebar/FeatureEditModal.d.ts +6 -0
  76. package/dist/components/sidebar/FeatureList.d.cts +4 -0
  77. package/dist/components/sidebar/FeatureList.d.ts +4 -0
  78. package/dist/components/sidebar/FeatureRow.d.cts +38 -0
  79. package/dist/components/sidebar/FeatureRow.d.ts +38 -0
  80. package/dist/components/sidebar/FeatureRowContextMenu.d.cts +12 -0
  81. package/dist/components/sidebar/FeatureRowContextMenu.d.ts +12 -0
  82. package/dist/components/sidebar/FeatureSidePanel.d.cts +8 -0
  83. package/dist/components/sidebar/FeatureSidePanel.d.ts +8 -0
  84. package/dist/components/sidebar/GeoJSONModal.d.cts +5 -0
  85. package/dist/components/sidebar/GeoJSONModal.d.ts +5 -0
  86. package/dist/components/sidebar/GroupRow.d.cts +21 -0
  87. package/dist/components/sidebar/GroupRow.d.ts +21 -0
  88. package/dist/components/sidebar/HideLayersToggle.d.cts +2 -0
  89. package/dist/components/sidebar/HideLayersToggle.d.ts +2 -0
  90. package/dist/components/sidebar/LayersPanel.d.cts +5 -0
  91. package/dist/components/sidebar/LayersPanel.d.ts +5 -0
  92. package/dist/components/sidebar/PartSubRow.d.cts +9 -0
  93. package/dist/components/sidebar/PartSubRow.d.ts +9 -0
  94. package/dist/components/sidebar/SchemaEditor.d.cts +4 -0
  95. package/dist/components/sidebar/SchemaEditor.d.ts +4 -0
  96. package/dist/components/sidebar/SchemaModal.d.cts +5 -0
  97. package/dist/components/sidebar/SchemaModal.d.ts +5 -0
  98. package/dist/components/sidebar/codeDock.d.cts +21 -0
  99. package/dist/components/sidebar/codeDock.d.ts +21 -0
  100. package/dist/components/ui/Button.d.cts +9 -0
  101. package/dist/components/ui/Button.d.ts +9 -0
  102. package/dist/components/ui/CloseButton.d.cts +6 -0
  103. package/dist/components/ui/CloseButton.d.ts +6 -0
  104. package/dist/components/ui/ContextMenu.d.cts +28 -0
  105. package/dist/components/ui/ContextMenu.d.ts +28 -0
  106. package/dist/components/ui/EditToolbarBtn.d.cts +13 -0
  107. package/dist/components/ui/EditToolbarBtn.d.ts +13 -0
  108. package/dist/components/ui/ElementToaster.d.cts +3 -0
  109. package/dist/components/ui/ElementToaster.d.ts +3 -0
  110. package/dist/components/ui/GeometryTypeIcon.d.cts +7 -0
  111. package/dist/components/ui/GeometryTypeIcon.d.ts +7 -0
  112. package/dist/components/ui/IconButton.d.cts +28 -0
  113. package/dist/components/ui/IconButton.d.ts +28 -0
  114. package/dist/components/ui/Input.d.cts +14 -0
  115. package/dist/components/ui/Input.d.ts +14 -0
  116. package/dist/components/ui/JsonCode.d.cts +4 -0
  117. package/dist/components/ui/JsonCode.d.ts +4 -0
  118. package/dist/components/ui/Kbd.d.cts +16 -0
  119. package/dist/components/ui/Kbd.d.ts +16 -0
  120. package/dist/components/ui/NoFeaturesEmptyState.d.cts +1 -0
  121. package/dist/components/ui/NoFeaturesEmptyState.d.ts +1 -0
  122. package/dist/components/ui/SearchDropdown.d.cts +28 -0
  123. package/dist/components/ui/SearchDropdown.d.ts +28 -0
  124. package/dist/components/ui/ToolButton.d.cts +19 -0
  125. package/dist/components/ui/ToolButton.d.ts +19 -0
  126. package/dist/components/ui/Tooltip.d.cts +12 -0
  127. package/dist/components/ui/Tooltip.d.ts +12 -0
  128. package/dist/components/ui/panelHeader.d.cts +2 -0
  129. package/dist/components/ui/panelHeader.d.ts +2 -0
  130. package/dist/components/ui/resizeEdge.d.cts +4 -0
  131. package/dist/components/ui/resizeEdge.d.ts +4 -0
  132. package/dist/contexts/ElementEditorConfigContext.d.cts +351 -0
  133. package/dist/contexts/ElementEditorConfigContext.d.ts +351 -0
  134. package/dist/contexts/EventContext.d.cts +69 -0
  135. package/dist/contexts/EventContext.d.ts +69 -0
  136. package/dist/contexts/MapControllerContext.d.cts +24 -0
  137. package/dist/contexts/MapControllerContext.d.ts +24 -0
  138. package/dist/contexts/ShortcutConfigContext.d.cts +16 -0
  139. package/dist/contexts/ShortcutConfigContext.d.ts +16 -0
  140. package/dist/contexts/ThemeContext.d.cts +12 -0
  141. package/dist/contexts/ThemeContext.d.ts +12 -0
  142. package/dist/element-editor-ui.cjs +1 -0
  143. package/dist/element-editor-ui.es.js +102 -0
  144. package/dist/geometryWorker-CCwg4tNC.cjs +1 -0
  145. package/dist/geometryWorker-DgQCFSmD.js +25 -0
  146. package/dist/hooks/dragShield.d.cts +7 -0
  147. package/dist/hooks/dragShield.d.ts +7 -0
  148. package/dist/hooks/themeInputs.d.cts +14 -0
  149. package/dist/hooks/themeInputs.d.ts +14 -0
  150. package/dist/hooks/useAccentPalette.d.cts +15 -0
  151. package/dist/hooks/useAccentPalette.d.ts +15 -0
  152. package/dist/hooks/useAccentStyle.d.cts +39 -0
  153. package/dist/hooks/useAccentStyle.d.ts +39 -0
  154. package/dist/hooks/useAdapterControls.d.cts +280 -0
  155. package/dist/hooks/useAdapterControls.d.ts +280 -0
  156. package/dist/hooks/useBalancedWrap.d.cts +8 -0
  157. package/dist/hooks/useBalancedWrap.d.ts +8 -0
  158. package/dist/hooks/useContextMenu.d.cts +11 -0
  159. package/dist/hooks/useContextMenu.d.ts +11 -0
  160. package/dist/hooks/useDataChangeSubscription.d.cts +9 -0
  161. package/dist/hooks/useDataChangeSubscription.d.ts +9 -0
  162. package/dist/hooks/useDragWindow.d.cts +9 -0
  163. package/dist/hooks/useDragWindow.d.ts +9 -0
  164. package/dist/hooks/useFocusTrap.d.cts +7 -0
  165. package/dist/hooks/useFocusTrap.d.ts +7 -0
  166. package/dist/hooks/useGeoJSONDrop.d.cts +40 -0
  167. package/dist/hooks/useGeoJSONDrop.d.ts +40 -0
  168. package/dist/hooks/useGeoJSONExport.d.cts +69 -0
  169. package/dist/hooks/useGeoJSONExport.d.ts +69 -0
  170. package/dist/hooks/useGeoJSONFileImport.d.cts +24 -0
  171. package/dist/hooks/useGeoJSONFileImport.d.ts +24 -0
  172. package/dist/hooks/useInlineRename.d.cts +26 -0
  173. package/dist/hooks/useInlineRename.d.ts +26 -0
  174. package/dist/hooks/useJumpToFeature.d.cts +3 -0
  175. package/dist/hooks/useJumpToFeature.d.ts +3 -0
  176. package/dist/hooks/useKeyboardShortcuts.d.cts +9 -0
  177. package/dist/hooks/useKeyboardShortcuts.d.ts +9 -0
  178. package/dist/hooks/useNominatim.d.cts +24 -0
  179. package/dist/hooks/useNominatim.d.ts +24 -0
  180. package/dist/hooks/usePanelOffset.d.cts +14 -0
  181. package/dist/hooks/usePanelOffset.d.ts +14 -0
  182. package/dist/hooks/useResizablePanel.d.cts +4 -0
  183. package/dist/hooks/useResizablePanel.d.ts +4 -0
  184. package/dist/hooks/useRootTokens.d.cts +27 -0
  185. package/dist/hooks/useRootTokens.d.ts +27 -0
  186. package/dist/hooks/useSearchState.d.cts +23 -0
  187. package/dist/hooks/useSearchState.d.ts +23 -0
  188. package/dist/hooks/useServiceAttribution.d.cts +13 -0
  189. package/dist/hooks/useServiceAttribution.d.ts +13 -0
  190. package/dist/hooks/useWindowEscape.d.cts +25 -0
  191. package/dist/hooks/useWindowEscape.d.ts +25 -0
  192. package/dist/hooks/useWindowFocus.d.cts +4 -0
  193. package/dist/hooks/useWindowFocus.d.ts +4 -0
  194. package/dist/hooks/useWorkerGeometryPreview.d.cts +22 -0
  195. package/dist/hooks/useWorkerGeometryPreview.d.ts +22 -0
  196. package/dist/index-CILw1Du5.js +3165 -0
  197. package/dist/index-DG4wEjGj.cjs +1 -0
  198. package/dist/index.d.cts +89 -0
  199. package/dist/index.d.ts +89 -0
  200. package/dist/internal.cjs +1 -0
  201. package/dist/internal.d.cts +16 -0
  202. package/dist/internal.d.ts +16 -0
  203. package/dist/internal.es.js +42 -0
  204. package/dist/primitives.cjs +1 -0
  205. package/dist/primitives.d.cts +19 -0
  206. package/dist/primitives.d.ts +19 -0
  207. package/dist/primitives.es.js +17 -0
  208. package/dist/store/StoreContext.d.cts +17 -0
  209. package/dist/store/StoreContext.d.ts +17 -0
  210. package/dist/types/events.d.cts +95 -0
  211. package/dist/types/events.d.ts +95 -0
  212. package/dist/useAccentStyle-CPo2XqAn.js +412 -0
  213. package/dist/useAccentStyle-hsGvyHZc.cjs +1 -0
  214. package/dist/useAdapterControls-BBObhzVX.cjs +1 -0
  215. package/dist/useAdapterControls-DVjkwRZ_.js +691 -0
  216. package/dist/useContextMenu-DJ2Cti85.js +10 -0
  217. package/dist/useContextMenu-DbxMvb1s.cjs +1 -0
  218. package/dist/useFocusTrap-BBjPCfDR.cjs +1 -0
  219. package/dist/useFocusTrap-CKxKT8De.js +25 -0
  220. package/dist/useJumpToFeature-Bdz2hqOC.js +16 -0
  221. package/dist/useJumpToFeature-LwjxGzfy.cjs +1 -0
  222. package/dist/useWindowFocus-DuQVjnHE.js +80 -0
  223. package/dist/useWindowFocus-EemgNOuz.cjs +1 -0
  224. package/dist/utils/booleanValue.d.cts +4 -0
  225. package/dist/utils/booleanValue.d.ts +4 -0
  226. package/dist/utils/clipboardError.d.cts +3 -0
  227. package/dist/utils/clipboardError.d.ts +3 -0
  228. package/dist/utils/download.d.cts +42 -0
  229. package/dist/utils/download.d.ts +42 -0
  230. package/dist/utils/geojsonDocument.d.cts +168 -0
  231. package/dist/utils/geojsonDocument.d.ts +168 -0
  232. package/dist/utils/geometryWorkerClient.d.cts +6 -0
  233. package/dist/utils/geometryWorkerClient.d.ts +6 -0
  234. package/dist/utils/layerOrder.d.cts +9 -0
  235. package/dist/utils/layerOrder.d.ts +9 -0
  236. package/dist/utils/lazyWithPreload.d.cts +24 -0
  237. package/dist/utils/lazyWithPreload.d.ts +24 -0
  238. package/dist/utils/lineSmooth.d.cts +7 -0
  239. package/dist/utils/lineSmooth.d.ts +7 -0
  240. package/dist/utils/platform.d.cts +2 -0
  241. package/dist/utils/platform.d.ts +2 -0
  242. package/dist/workers/geometryWorker.d.cts +1 -0
  243. package/dist/workers/geometryWorker.d.ts +1 -0
  244. package/package.json +133 -3
@@ -0,0 +1,351 @@
1
+ import { ReactNode } from 'react';
2
+ import { NetworkConfig } from '@element-editor/core';
3
+ export type DrawTool = 'polygon' | 'rectangle' | 'circle' | 'line' | 'point' | 'freehand' | 'route' | 'picker' | 'measure' | 'search';
4
+ /** The editing mode each tool turns on (`'search'` is a box, not a mode). The tools that add a feature are all but `measure`. */
5
+ export declare const TOOL_MODES: {
6
+ readonly point: "place-point";
7
+ readonly line: "draw-line";
8
+ readonly polygon: "draw-polygon";
9
+ readonly route: "draw-route";
10
+ readonly circle: "draw-circle";
11
+ readonly rectangle: "draw-rect";
12
+ readonly freehand: "draw-freehand";
13
+ readonly picker: "pick-shape";
14
+ readonly measure: "measure";
15
+ };
16
+ /**
17
+ * Where a control can go (`config.ui.layout`): eight places on the map (four
18
+ * corners, four edge centers) and the two ends of the status bar under it.
19
+ */
20
+ export type LayoutSlot = MapSlot | StatusSlot;
21
+ /** The eight places on the map. */
22
+ export type MapSlot = 'topLeft' | 'topCenter' | 'topRight' | 'leftCenter' | 'rightCenter' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
23
+ /** The two ends of the status bar under the map. */
24
+ export type StatusSlot = 'statusLeft' | 'statusRight';
25
+ /** Every placeable built-in control. */
26
+ export type LayoutControl = 'toolbar' | 'undo' | 'redo' | 'fitBounds' | 'locate' | 'zoomIndicator' | 'table' | 'schema' | 'geojson' | 'settings' | 'keyboard' | 'applyChanges' | 'attribution' | 'basemap';
27
+ type MapControl = Exclude<LayoutControl, 'attribution'>;
28
+ type StatusControl = Exclude<LayoutControl, 'toolbar' | 'applyChanges'>;
29
+ /** Controls drawn as one joined pill on the map. No toolbar or basemap picker inside. */
30
+ export type MapGroup = {
31
+ group: ReadonlyArray<Exclude<MapControl, 'toolbar' | 'basemap'> | 'separator'>;
32
+ };
33
+ /** Controls drawn as a tight cluster in the status bar. */
34
+ export type StatusGroup = {
35
+ group: ReadonlyArray<Exclude<StatusControl, 'basemap'> | 'separator'>;
36
+ };
37
+ /** A map slot entry. No bare `'separator'` (nothing to draw it on over the tiles): put it in a group. */
38
+ export type MapEntry = MapControl | MapGroup;
39
+ export type StatusEntry = StatusControl | 'separator' | StatusGroup;
40
+ export type MapSlotConfig = readonly MapEntry[] | {
41
+ items: readonly MapEntry[];
42
+ direction?: 'horizontal' | 'vertical';
43
+ };
44
+ /** Status slots are always horizontal. */
45
+ export type StatusSlotConfig = readonly StatusEntry[];
46
+ export type LayoutGroup = MapGroup | StatusGroup;
47
+ export type LayoutEntry = MapEntry | StatusEntry;
48
+ export type LayoutSlotConfig = MapSlotConfig | StatusSlotConfig;
49
+ /** Where every built-in control goes (`config.ui.layout`). Each slot only takes the entries it can show. */
50
+ export type LayoutConfig = {
51
+ [S in MapSlot]?: MapSlotConfig;
52
+ } & {
53
+ [S in StatusSlot]?: StatusSlotConfig;
54
+ };
55
+ /** A slot after resolution: duplicates and invalid entries removed, groups normalised. */
56
+ export type ResolvedLayout = Record<LayoutSlot, {
57
+ items: LayoutEntry[];
58
+ direction: 'horizontal' | 'vertical';
59
+ }>;
60
+ /** Slot order. A control listed twice stays at its first place in this order. */
61
+ export declare const LAYOUT_SLOTS: readonly LayoutSlot[];
62
+ /**
63
+ * Layout used when `ui.layout` isn't set.
64
+ * Deep-frozen (shared by every editor on the page). To change it, use {@link withLayout}.
65
+ */
66
+ export declare const DEFAULT_LAYOUT: LayoutConfig;
67
+ /**
68
+ * Drop separators that would show nothing useful: at the start or end of a
69
+ * section and right after another separator. Call it after hidden buttons
70
+ * are removed, so a separator next to a hidden button disappears too.
71
+ */
72
+ export declare function collapseSeparators<T>(entries: readonly (T | 'separator')[]): (T | 'separator')[];
73
+ /**
74
+ * Whether a placed control renders at all, given the visibility flags.
75
+ * `<ElementEditor>` uses it both to render a control and to decide whether a
76
+ * slot, group or the status bar has anything left to show, so they can't drift.
77
+ */
78
+ export declare function isControlVisible(id: LayoutControl, ui: ResolvedConfig['ui'], ctx: {
79
+ readonly: boolean;
80
+ canSubmit: boolean;
81
+ hasBasemaps: boolean;
82
+ }): boolean;
83
+ /**
84
+ * A slot's entries with hidden controls removed, then empty groups and
85
+ * dangling separators (also inside groups) dropped.
86
+ */
87
+ export declare function visibleLayoutEntries(entries: readonly LayoutEntry[], isVisible: (id: LayoutControl) => boolean): LayoutEntry[];
88
+ /** A raster tile basemap (XYZ). Engine-neutral, so the Leaflet drop-in needs no MapLibre types. */
89
+ export interface RasterBasemap {
90
+ id?: string;
91
+ label?: string;
92
+ thumbnail?: string;
93
+ url: string;
94
+ attribution: string;
95
+ maxZoom?: number;
96
+ }
97
+ /**
98
+ * Where the floating toolbar is anchored inside the map container
99
+ * (`ResolvedConfig.toolbar.position`, derived from the toolbar's layout slot).
100
+ *
101
+ * Eight positions — the four corners, the four edge-centers:
102
+ *
103
+ * top-left top-center top-right
104
+ * left-center · right-center
105
+ * bottom-left bottom-center bottom-right
106
+ */
107
+ export type ToolbarPosition = 'top-left' | 'top-center' | 'top-right' | 'left-center' | 'right-center' | 'bottom-left' | 'bottom-center' | 'bottom-right';
108
+ export interface ElementEditorConfig {
109
+ /** Color theme. Default: 'system' (follows OS preference). */
110
+ mode?: 'light' | 'dark' | 'system';
111
+ /**
112
+ * Brand accent: any CSS colour (`'#ea580c'`, `'rebeccapurple'`, `'oklch(…)'`).
113
+ * The whole primary 50…950 scale (buttons, active tools, selection, checkboxes,
114
+ * links) is derived from it in CSS. Applied as `--elm-accent` on the editor
115
+ * root and on Element's portals; updates live. Default: undefined (blue).
116
+ * `<ElementEditor accentColor>` wins over this.
117
+ */
118
+ accentColor?: string;
119
+ /**
120
+ * Default colour of every feature (polygon outline + fill, line, point): any
121
+ * CSS colour. Opacity and weight keep their defaults. `getFeatureStyle` (per
122
+ * field) and the selected / hovered looks win over it. Updates live.
123
+ * `<ElementEditor featureColor>` wins over this. Default: undefined (slate `#475569`).
124
+ */
125
+ featureColor?: string;
126
+ /** Which drawing tools are available. Default: 'all'. */
127
+ tools?: DrawTool[] | 'all';
128
+ /**
129
+ * Namespace for everything this editor remembers in localStorage (theme,
130
+ * settings, units, shortcuts, window positions/sizes, panel widths, map view,
131
+ * basemap pick, last schema): `elm_theme` becomes `elm_<persistKey>_theme`.
132
+ * Give each editor on an origin its own key so they don't overwrite each other.
133
+ * Default: undefined (the shared `elm_*` keys).
134
+ */
135
+ persistKey?: string;
136
+ /** `false`: read and write nothing in localStorage (every reload starts from config). Default: true. */
137
+ persist?: boolean;
138
+ /**
139
+ * Every third-party server this editor talks to: basemap tiles, glyphs, sprite and elevation,
140
+ * the Picker's Overpass lookups, the Route tool's routing, the search box's geocoder, plus a
141
+ * `fetch` for Element's own requests. Per editor. `false` on a service hides what needs it.
142
+ * Map tiles are read when a basemap loads (changes apply on the next basemap switch). Headers
143
+ * for map resources: the MapLibre drop-in's `mapOptions.transformRequest`.
144
+ * See the "Third-party services and self-hosting" guide.
145
+ *
146
+ * @example network: { routing: { apiKey: ORS_KEY }, nominatim: { url: 'https://geo.example.com/search' } }
147
+ */
148
+ network?: NetworkConfig;
149
+ /** UI element visibility. All default to true. */
150
+ ui?: {
151
+ /** Drawing action hints in the active toolbar (e.g. "Click and drag to size"). Default: true */
152
+ hints?: boolean;
153
+ /** Data table panel (spreadsheet view of all features). Default: true */
154
+ dataTable?: boolean;
155
+ /** Layers/features list panel. Default: true */
156
+ layerList?: boolean;
157
+ /** Schema editor button. Default: true */
158
+ schemaEditor?: boolean;
159
+ /** GeoJSON editor button. Default: true */
160
+ geojsonEditor?: boolean;
161
+ /**
162
+ * Open the GeoJSON inspector when the editor mounts (initial state only;
163
+ * the user's toggles win afterwards), in the user's last Dock/Undock mode,
164
+ * docked beside the map by default. `'docked'` behaves like `true` (the
165
+ * dock is the default now). Ignored when
166
+ * `geojsonEditor` is false. With an adapter it sets `codeModalOpen`; render
167
+ * `GeoJSONModal` from it. Default: false
168
+ */
169
+ geojsonEditorOpen?: boolean | 'docked';
170
+ /** Editor settings button. Default: true */
171
+ settings?: boolean;
172
+ /** "Fit all features" zoom button. Default: true */
173
+ zoomToAll?: boolean;
174
+ /** Click-to-edit zoom level indicator. Default: true */
175
+ zoomIndicator?: boolean;
176
+ /** "Fly to my location" geolocation button. Default: true */
177
+ locateButton?: boolean;
178
+ /**
179
+ * Where every built-in control goes: a map of slots to ordered entries.
180
+ * Map slots: `topLeft`, `topCenter`, `topRight`, `leftCenter`,
181
+ * `rightCenter`, `bottomLeft`, `bottomCenter`, `bottomRight`; status bar
182
+ * (under the map): `statusLeft`, `statusRight`.
183
+ *
184
+ * An entry is a control id, `'separator'`, or `{ group: [...] }` (one
185
+ * joined pill). A slot is an array, or `{ items, direction }` to pick a
186
+ * direction (map slots; default vertical for `leftCenter`/`rightCenter`,
187
+ * horizontal elsewhere). The first item sits at the slot's edge.
188
+ *
189
+ * Controls not listed are hidden, except `'attribution'`, which stays on
190
+ * the map unless placed in a status slot. A control listed twice stays at
191
+ * its first place. The visibility flags (`zoomToAll`, `dataTable`, …) still
192
+ * apply on top.
193
+ *
194
+ * `'separator'` (a thin divider) only goes inside a group or in a status
195
+ * slot; directly in a map slot there's no surface to draw it on.
196
+ *
197
+ * To move, add or hide a few controls and keep the rest of the default,
198
+ * use {@link withLayout}: `layout: withLayout({ move: { table: 'topRight' } })`.
199
+ * Default: {@link DEFAULT_LAYOUT}.
200
+ *
201
+ * @example layout: { topCenter: ['toolbar'], bottomLeft: ['fitBounds', { group: ['table', 'separator', 'schema'] }], statusRight: ['attribution'] }
202
+ */
203
+ layout?: LayoutConfig;
204
+ /**
205
+ * Keyboard shortcuts control.
206
+ * Pass `false` to disable shortcuts entirely.
207
+ * Pass `{ enabled, show, mapZoom }` for fine-grained control.
208
+ * Default: `{ enabled: true, show: true, mapZoom: false }`.
209
+ *
210
+ * `mapZoom`: when true, intercepts Cmd/Ctrl + (`+`/`=`) and Cmd/Ctrl + (`-`)
211
+ * to zoom the map (only while the cursor is over the editor and no input
212
+ * is focused). Defaults to false because hijacking the browser's
213
+ * page-zoom shortcut is a behavior change consumers should opt into.
214
+ */
215
+ keyboardShortcuts?: boolean | {
216
+ enabled?: boolean;
217
+ show?: boolean;
218
+ mapZoom?: boolean;
219
+ };
220
+ };
221
+ /** Floating toolbar layout. Its place is the `'toolbar'` entry in `ui.layout`. */
222
+ toolbar?: {
223
+ /**
224
+ * How tool buttons are laid out inside the toolbar.
225
+ * 'vertical' hides the search bar and stacks tools top-to-bottom.
226
+ * Default: 'horizontal'.
227
+ */
228
+ direction?: 'horizontal' | 'vertical';
229
+ };
230
+ /** Measurement and number display settings. */
231
+ units?: {
232
+ /** Length unit. 'auto' picks metric/imperial from the browser locale. Default: 'auto' */
233
+ length?: 'metric' | 'imperial' | 'auto';
234
+ /** Area unit. 'auto' picks metric/imperial from the browser locale. Default: 'auto' */
235
+ area?: 'metric' | 'imperial' | 'auto';
236
+ /** Number display style. 'human' = "1.2 km", 'raw' = "1234.56 m". Default: 'human' */
237
+ display?: 'human' | 'raw';
238
+ /** Decimal places in 'raw' display mode. Default: 2 */
239
+ precision?: number;
240
+ };
241
+ }
242
+ export interface ResolvedConfig {
243
+ mode: 'light' | 'dark' | 'system';
244
+ /** Storage scope; pass the resolved config itself to the core storage helpers. */
245
+ persistKey: string | undefined;
246
+ persist: boolean;
247
+ /** `config.network` as given (`{}` when absent); `fetch` is a stable wrapper around the latest one. */
248
+ network: NetworkConfig;
249
+ accentColor: string | undefined;
250
+ featureColor: string | undefined;
251
+ tools: DrawTool[] | 'all';
252
+ ui: {
253
+ hints: boolean;
254
+ dataTable: boolean;
255
+ layerList: boolean;
256
+ schemaEditor: boolean;
257
+ geojsonEditor: boolean;
258
+ /** Already false when `geojsonEditor` is false. */
259
+ geojsonEditorOpen: boolean | 'docked';
260
+ settings: boolean;
261
+ zoomToAll: boolean;
262
+ zoomIndicator: boolean;
263
+ locateButton: boolean;
264
+ keyboardShortcuts: {
265
+ enabled: boolean;
266
+ show: boolean;
267
+ mapZoom: boolean;
268
+ };
269
+ /** Every slot, resolved from `ui.layout` (or `DEFAULT_LAYOUT`). Rendering reads only this. */
270
+ layout: ResolvedLayout;
271
+ };
272
+ toolbar: {
273
+ /** The toolbar's slot as a position (tooltip/popup sides, standalone placement). */
274
+ position: ToolbarPosition;
275
+ direction: 'horizontal' | 'vertical';
276
+ };
277
+ units: {
278
+ length: 'metric' | 'imperial' | 'auto';
279
+ area: 'metric' | 'imperial' | 'auto';
280
+ display: 'human' | 'raw';
281
+ precision: number;
282
+ };
283
+ }
284
+ /**
285
+ * Normalise a `ui.layout` map: every slot present, groups as `{ group }`,
286
+ * invalid entries and repeats dropped (first place wins, in `LAYOUT_SLOTS`
287
+ * order then array order) with a dev-only warning, dangling separators gone.
288
+ */
289
+ export declare function resolveLayout(layout: LayoutConfig): ResolvedLayout;
290
+ /** The slots a control may go to (`'attribution'` only in the status bar, `'toolbar'` / `'applyChanges'` only on the map). */
291
+ export type SlotFor<C extends LayoutControl> = C extends 'attribution' ? StatusSlot : C extends 'toolbar' | 'applyChanges' ? MapSlot : LayoutSlot;
292
+ /** Changes to a layout for {@link withLayout}. */
293
+ export interface LayoutPatch {
294
+ /**
295
+ * Put a control in a slot, wherever it was before (or add it if it wasn't
296
+ * placed). It goes at the end of the slot (farthest from the slot's edge),
297
+ * or first with `{ slot, at: 'start' }`. A control moved out of a group
298
+ * leaves the rest of the group in place.
299
+ */
300
+ move?: {
301
+ [C in LayoutControl]?: SlotFor<C> | {
302
+ slot: SlotFor<C>;
303
+ at?: 'start' | 'end';
304
+ };
305
+ };
306
+ /** Take controls off the layout (the feature itself stays; use the `ui` flags to turn it off). Wins over `move`. */
307
+ hide?: readonly LayoutControl[];
308
+ }
309
+ /**
310
+ * A copy of `base` (default {@link DEFAULT_LAYOUT}) with a few controls moved,
311
+ * added or hidden, so you don't have to relist every other control:
312
+ *
313
+ * @example layout: withLayout({ move: { table: 'topRight', attribution: 'statusRight' }, hide: ['keyboard'] })
314
+ */
315
+ export declare function withLayout(patch: LayoutPatch, base?: LayoutConfig): LayoutConfig;
316
+ /**
317
+ * Dev-only check that a layout doesn't leave something unreachable by surprise:
318
+ * the drawing toolbar, the "Apply changes" button with `onSubmit`, undo/redo
319
+ * with keyboard shortcuts off. Looks at placement only, so turning a control
320
+ * off with its `ui` flag never counts. Returns one message per gap.
321
+ */
322
+ export declare function layoutGaps(layout: ResolvedLayout, ctx: {
323
+ readonly: boolean;
324
+ canSubmit: boolean;
325
+ tools: readonly string[] | null;
326
+ shortcuts: boolean;
327
+ }): string[];
328
+ export declare function resolveConfig(config?: ElementEditorConfig): ResolvedConfig;
329
+ /** Runtime user override for units. Persists to localStorage so the choice
330
+ * sticks across reloads. Any provided field overrides the consumer-supplied
331
+ * `config.units.*`; missing fields fall through to the consumer config. */
332
+ export type UnitsOverride = Partial<{
333
+ length: 'metric' | 'imperial' | 'auto';
334
+ area: 'metric' | 'imperial' | 'auto';
335
+ display: 'human' | 'raw';
336
+ precision: number;
337
+ }>;
338
+ interface UnitsContextValue {
339
+ override: UnitsOverride;
340
+ setUnits: (next: UnitsOverride | ((prev: UnitsOverride) => UnitsOverride)) => void;
341
+ resetUnits: () => void;
342
+ }
343
+ export declare function ElementEditorConfigProvider({ config, children, }: {
344
+ config?: ElementEditorConfig;
345
+ children: ReactNode;
346
+ }): import("react/jsx-runtime").JSX.Element;
347
+ export declare function useElementEditorConfig(): ResolvedConfig;
348
+ /** Read/write the user's persisted units override. Use this from settings UIs;
349
+ * consumers reading current values should prefer `useElementEditorConfig().units`. */
350
+ export declare function useUnitsOverride(): UnitsContextValue;
351
+ export {};
@@ -0,0 +1,69 @@
1
+ import { ReactNode } from 'react';
2
+ import { ElementEditorError } from '@element-editor/core';
3
+ import { ElementEditorEvent, ElementEditorErrorHandler } from '../types/events.cjs';
4
+ /**
5
+ * A `ElementEditorEvent`, optionally carrying a secondary line for the default
6
+ * toast. `onEvent` receives the same object (the extra field is ignored by
7
+ * hosts typed against `ElementEditorEvent`). An `error` also takes what only
8
+ * `onError` sees: `cause`, `featureId`, a prebuilt `error`, and `quiet`
9
+ * (`onError` only — no toast, no `onEvent` event).
10
+ */
11
+ export type EmittedEvent = (Exclude<ElementEditorEvent, {
12
+ type: 'error';
13
+ }> & {
14
+ description?: string;
15
+ }) | (Extract<ElementEditorEvent, {
16
+ type: 'error';
17
+ }> & {
18
+ cause?: unknown;
19
+ featureId?: string;
20
+ quiet?: boolean;
21
+ error?: ElementEditorError;
22
+ });
23
+ type EmitFn = (event: EmittedEvent) => void;
24
+ interface EventContextValue {
25
+ emit: EmitFn;
26
+ /** True when the host app provided an `onEvent` handler (library is silent). */
27
+ managed: boolean;
28
+ /** Sonner toaster id for this instance's own `<Toaster>`; undefined when toasts go to the host's toaster. */
29
+ toasterId: string | undefined;
30
+ }
31
+ export declare const EventContext: import('react').Context<EventContextValue | null>;
32
+ /**
33
+ * @internal Bridge so `uiStore` errors reach `emit` when `GeoStoreProvider`
34
+ * wraps `EventProvider` (the store can't see a context below it). The store
35
+ * provides the registrar; the EventProvider beneath registers its emit.
36
+ */
37
+ export declare const StoreErrorSinkContext: import('react').Context<((sink: StoreErrorSink | null) => void) | null>;
38
+ type StoreErrorSink = (error: ElementEditorError, opts?: {
39
+ quiet?: boolean;
40
+ }) => void;
41
+ export declare function EventProvider({ onEvent, onError, toaster, children, }: {
42
+ onEvent?: (e: ElementEditorEvent) => void;
43
+ /** Called first for every runtime failure; see {@link ElementEditorErrorHandler} for the return value. Latest value is used. */
44
+ onError?: ElementEditorErrorHandler;
45
+ /**
46
+ * Render this instance's own `<Toaster>` and tag every default toast with its
47
+ * id, so two editors on one page (or a host `<Toaster>`) never show the same
48
+ * toast twice. Ignored when `onEvent` is set. Default false: toasts go to
49
+ * whatever untagged `<Toaster>` the host renders.
50
+ */
51
+ toaster?: boolean;
52
+ children: ReactNode;
53
+ }): import("react/jsx-runtime").JSX.Element;
54
+ /** Returns a stable `emit` function for firing `ElementEditorEvent`s. */
55
+ export declare function useEmit(): EmitFn;
56
+ /**
57
+ * Returns `true` when the host app supplied an `onEvent` handler.
58
+ * Use this to skip loading-spinner toasts that have no `ElementEditorEvent` equivalent.
59
+ */
60
+ export declare function useIsManaged(): boolean;
61
+ /**
62
+ * Sonner `toasterId` for direct `toast.loading(...)` calls that have no
63
+ * `ElementEditorEvent` equivalent — pass it as `{ toasterId }` so the toast lands
64
+ * in this instance's `<Toaster>`. Undefined means "the host's toaster".
65
+ */
66
+ export declare function useToasterId(): string | undefined;
67
+ /** `emit` of the enclosing EventProvider, or undefined outside one (e.g. a BYO-map `BasemapControl`). */
68
+ export declare function useOptionalEmit(): EmitFn | undefined;
69
+ export {};
@@ -0,0 +1,69 @@
1
+ import { ReactNode } from 'react';
2
+ import { ElementEditorError } from '@element-editor/core';
3
+ import { ElementEditorEvent, ElementEditorErrorHandler } from '../types/events.js';
4
+ /**
5
+ * A `ElementEditorEvent`, optionally carrying a secondary line for the default
6
+ * toast. `onEvent` receives the same object (the extra field is ignored by
7
+ * hosts typed against `ElementEditorEvent`). An `error` also takes what only
8
+ * `onError` sees: `cause`, `featureId`, a prebuilt `error`, and `quiet`
9
+ * (`onError` only — no toast, no `onEvent` event).
10
+ */
11
+ export type EmittedEvent = (Exclude<ElementEditorEvent, {
12
+ type: 'error';
13
+ }> & {
14
+ description?: string;
15
+ }) | (Extract<ElementEditorEvent, {
16
+ type: 'error';
17
+ }> & {
18
+ cause?: unknown;
19
+ featureId?: string;
20
+ quiet?: boolean;
21
+ error?: ElementEditorError;
22
+ });
23
+ type EmitFn = (event: EmittedEvent) => void;
24
+ interface EventContextValue {
25
+ emit: EmitFn;
26
+ /** True when the host app provided an `onEvent` handler (library is silent). */
27
+ managed: boolean;
28
+ /** Sonner toaster id for this instance's own `<Toaster>`; undefined when toasts go to the host's toaster. */
29
+ toasterId: string | undefined;
30
+ }
31
+ export declare const EventContext: import('react').Context<EventContextValue | null>;
32
+ /**
33
+ * @internal Bridge so `uiStore` errors reach `emit` when `GeoStoreProvider`
34
+ * wraps `EventProvider` (the store can't see a context below it). The store
35
+ * provides the registrar; the EventProvider beneath registers its emit.
36
+ */
37
+ export declare const StoreErrorSinkContext: import('react').Context<((sink: StoreErrorSink | null) => void) | null>;
38
+ type StoreErrorSink = (error: ElementEditorError, opts?: {
39
+ quiet?: boolean;
40
+ }) => void;
41
+ export declare function EventProvider({ onEvent, onError, toaster, children, }: {
42
+ onEvent?: (e: ElementEditorEvent) => void;
43
+ /** Called first for every runtime failure; see {@link ElementEditorErrorHandler} for the return value. Latest value is used. */
44
+ onError?: ElementEditorErrorHandler;
45
+ /**
46
+ * Render this instance's own `<Toaster>` and tag every default toast with its
47
+ * id, so two editors on one page (or a host `<Toaster>`) never show the same
48
+ * toast twice. Ignored when `onEvent` is set. Default false: toasts go to
49
+ * whatever untagged `<Toaster>` the host renders.
50
+ */
51
+ toaster?: boolean;
52
+ children: ReactNode;
53
+ }): import("react/jsx-runtime").JSX.Element;
54
+ /** Returns a stable `emit` function for firing `ElementEditorEvent`s. */
55
+ export declare function useEmit(): EmitFn;
56
+ /**
57
+ * Returns `true` when the host app supplied an `onEvent` handler.
58
+ * Use this to skip loading-spinner toasts that have no `ElementEditorEvent` equivalent.
59
+ */
60
+ export declare function useIsManaged(): boolean;
61
+ /**
62
+ * Sonner `toasterId` for direct `toast.loading(...)` calls that have no
63
+ * `ElementEditorEvent` equivalent — pass it as `{ toasterId }` so the toast lands
64
+ * in this instance's `<Toaster>`. Undefined means "the host's toaster".
65
+ */
66
+ export declare function useToasterId(): string | undefined;
67
+ /** `emit` of the enclosing EventProvider, or undefined outside one (e.g. a BYO-map `BasemapControl`). */
68
+ export declare function useOptionalEmit(): EmitFn | undefined;
69
+ export {};
@@ -0,0 +1,24 @@
1
+ export interface MapController {
2
+ /** Internal contract: `[lat, lng]` (Leaflet order). The public `ref.flyTo` takes `{ center: [lng, lat] }` and converts. */
3
+ flyTo: ((latlng: [number, number], zoom: number) => void) | null;
4
+ /** `[lat, lng]`, like `flyTo`. */
5
+ panTo: ((latlng: [number, number]) => void) | null;
6
+ fitBounds: ((target: [number, number][] | [number, number, number, number]) => void) | null;
7
+ getCenter: (() => [number, number]) | null;
8
+ /** Synchronous zoom — no animation, no flyTo. Use for keyboard-driven zoom where
9
+ * multiple rapid presses must each take effect. Returns the actual zoom applied
10
+ * (clamped to the map's min/max). */
11
+ setZoom: ((zoom: number) => number) | null;
12
+ /** Min/max zoom of the underlying map. Useful for clamping/UI hints. */
13
+ getZoomBounds: (() => {
14
+ min: number;
15
+ max: number;
16
+ }) | null;
17
+ /** The engine's map instance (`maplibregl.Map` / `L.Map`), for the public `ref.getMap()`. */
18
+ getMap?: () => unknown;
19
+ }
20
+ export declare function MapControllerProvider({ children }: {
21
+ children: React.ReactNode;
22
+ }): import("react/jsx-runtime").JSX.Element;
23
+ export declare function useMapController(): MapController;
24
+ export declare function useSetMapController(): (c: MapController) => void;
@@ -0,0 +1,24 @@
1
+ export interface MapController {
2
+ /** Internal contract: `[lat, lng]` (Leaflet order). The public `ref.flyTo` takes `{ center: [lng, lat] }` and converts. */
3
+ flyTo: ((latlng: [number, number], zoom: number) => void) | null;
4
+ /** `[lat, lng]`, like `flyTo`. */
5
+ panTo: ((latlng: [number, number]) => void) | null;
6
+ fitBounds: ((target: [number, number][] | [number, number, number, number]) => void) | null;
7
+ getCenter: (() => [number, number]) | null;
8
+ /** Synchronous zoom — no animation, no flyTo. Use for keyboard-driven zoom where
9
+ * multiple rapid presses must each take effect. Returns the actual zoom applied
10
+ * (clamped to the map's min/max). */
11
+ setZoom: ((zoom: number) => number) | null;
12
+ /** Min/max zoom of the underlying map. Useful for clamping/UI hints. */
13
+ getZoomBounds: (() => {
14
+ min: number;
15
+ max: number;
16
+ }) | null;
17
+ /** The engine's map instance (`maplibregl.Map` / `L.Map`), for the public `ref.getMap()`. */
18
+ getMap?: () => unknown;
19
+ }
20
+ export declare function MapControllerProvider({ children }: {
21
+ children: React.ReactNode;
22
+ }): import("react/jsx-runtime").JSX.Element;
23
+ export declare function useMapController(): MapController;
24
+ export declare function useSetMapController(): (c: MapController) => void;
@@ -0,0 +1,16 @@
1
+ import { ReactNode } from 'react';
2
+ import { ShortcutId } from '@element-editor/core';
3
+ interface ShortcutConfigCtx {
4
+ custom: Partial<Record<ShortcutId, string>>;
5
+ getKey: (id: ShortcutId) => string;
6
+ setKey: (id: ShortcutId, key: string) => ShortcutId | null;
7
+ resetKey: (id: ShortcutId) => void;
8
+ resetAll: () => void;
9
+ }
10
+ export declare function ShortcutConfigProvider({ children }: {
11
+ children: ReactNode;
12
+ }): import("react/jsx-runtime").JSX.Element;
13
+ /** @internal This editor's bindings, or null outside a `ShortcutConfigProvider`. */
14
+ export declare function useOptionalShortcutConfig(): ShortcutConfigCtx | null;
15
+ export declare function useShortcutConfig(): ShortcutConfigCtx;
16
+ export {};
@@ -0,0 +1,16 @@
1
+ import { ReactNode } from 'react';
2
+ import { ShortcutId } from '@element-editor/core';
3
+ interface ShortcutConfigCtx {
4
+ custom: Partial<Record<ShortcutId, string>>;
5
+ getKey: (id: ShortcutId) => string;
6
+ setKey: (id: ShortcutId, key: string) => ShortcutId | null;
7
+ resetKey: (id: ShortcutId) => void;
8
+ resetAll: () => void;
9
+ }
10
+ export declare function ShortcutConfigProvider({ children }: {
11
+ children: ReactNode;
12
+ }): import("react/jsx-runtime").JSX.Element;
13
+ /** @internal This editor's bindings, or null outside a `ShortcutConfigProvider`. */
14
+ export declare function useOptionalShortcutConfig(): ShortcutConfigCtx | null;
15
+ export declare function useShortcutConfig(): ShortcutConfigCtx;
16
+ export {};
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ export type ResolvedTheme = 'light' | 'dark';
3
+ export declare const ThemeContext: import('react').Context<ResolvedTheme>;
4
+ export declare const useTheme: () => ResolvedTheme;
5
+ export declare function ThemeReportingProvider({ children }: {
6
+ children: ReactNode;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ /**
9
+ * Read `data-elm-theme` from the element's themed root and keep the provider in
10
+ * sync, along with the design tokens the host set on that root (for portals).
11
+ */
12
+ export declare function useReportThemeFromRoot(el: HTMLElement | null): void;
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ export type ResolvedTheme = 'light' | 'dark';
3
+ export declare const ThemeContext: import('react').Context<ResolvedTheme>;
4
+ export declare const useTheme: () => ResolvedTheme;
5
+ export declare function ThemeReportingProvider({ children }: {
6
+ children: ReactNode;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ /**
9
+ * Read `data-elm-theme` from the element's themed root and keep the provider in
10
+ * sync, along with the design tokens the host set on that root (for portals).
11
+ */
12
+ export declare function useReportThemeFromRoot(el: HTMLElement | null): void;
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DG4wEjGj.cjs"),o=require("./useAdapterControls-BBObhzVX.cjs"),r=require("./useAccentStyle-hsGvyHZc.cjs"),n=require("@element-editor/core"),t=require("./EditToolbarBtn-Ch9HCLHq.cjs");exports.ActiveDrawingToolbar=e.ActiveDrawingToolbar;exports.BasemapPicker=e.BasemapPicker;exports.BooleanOperations=e.BooleanOperations;exports.BufferPanel=e.BufferPanel;exports.ControlGroup=e.ControlGroup;exports.DataTable=e.DataTable;exports.DataTablePanel=e.DataTablePanel;exports.EditingToolbar=e.EditingToolbar;exports.ElementEditorErrorBoundary=e.ElementEditorErrorBoundary;exports.ElementEditorUIProvider=e.ElementEditorUIProvider;exports.FeatureEditModal=e.FeatureEditModal;exports.FeatureList=e.FeatureList;exports.FeatureMapContextMenu=e.FeatureMapContextMenu;exports.FeatureRow=e.FeatureRow;exports.FeatureSidePanel=e.FeatureSidePanel;exports.FitBoundsButton=e.FitBoundsButton;exports.FloatingToolbar=e.FloatingToolbar;exports.GeoJSONDockPlaceholder=e.GeoJSONDockPlaceholder;exports.GeoJSONModal=e.GeoJSONModal;exports.GroupRow=e.GroupRow;exports.IconButton=e.IconButton;exports.LayersPanel=e.LayersPanel;exports.LocateButton=e.LocateButton;exports.PartSubRow=e.PartSubRow;exports.ReadonlyBanner=e.ReadonlyBanner;exports.RedoButton=e.RedoButton;exports.SchemaEditor=e.SchemaEditor;exports.SchemaModal=e.SchemaModal;exports.SettingsModal=e.SettingsModal;exports.ShortcutConfigProvider=e.ShortcutConfigProvider;exports.ShortcutsModal=e.ShortcutsModal;exports.SimplifyPanel=e.SimplifyPanel;exports.SmoothPanel=e.SmoothPanel;exports.UndoButton=e.UndoButton;exports.UndoRedoToolbar=e.UndoRedoToolbar;exports.VertexSelectionBar=e.VertexSelectionBar;exports.ZoomIndicator=e.ZoomIndicator;exports.disposeGeometryWorker=e.disposeGeometryWorker;exports.featureLabel=e.featureLabel;exports.preloadEditorPanelsWhenIdle=e.preloadEditorPanelsWhenIdle;exports.runGeometryWorkerOperation=e.runGeometryWorkerOperation;exports.useAccentPalette=e.useAccentPalette;exports.useDataChangeSubscription=e.useDataChangeSubscription;exports.useGeoJSONDrop=e.useGeoJSONDrop;exports.useGeoJSONExport=e.useGeoJSONExport;exports.useIsEventForEditor=e.useIsEventForEditor;exports.useKeyboardShortcuts=e.useKeyboardShortcuts;exports.useShortcutConfig=e.useShortcutConfig;exports.ElementToaster=o.ElementToaster;exports.EventProvider=o.EventProvider;exports.GeoStoreProvider=o.GeoStoreProvider;exports.MapControllerProvider=o.MapControllerProvider;exports.StoreContext=o.StoreContext;exports.ThemeContext=o.ThemeContext;exports.ThemeReportingProvider=o.ThemeReportingProvider;exports.saveGeoJSONFile=o.saveGeoJSONFile;exports.triggerGeoJSONDownload=o.triggerGeoJSONDownload;exports.useAdapterControls=o.useAdapterControls;exports.useDataStore=o.useDataStore;exports.useEmit=o.useEmit;exports.useGeoStore=o.useGeoStore;exports.useIsManaged=o.useIsManaged;exports.useMapController=o.useMapController;exports.useNominatim=o.useNominatim;exports.useReportThemeFromRoot=o.useReportThemeFromRoot;exports.useSetMapController=o.useSetMapController;exports.useTheme=o.useTheme;exports.useToasterId=o.useToasterId;exports.useUIStore=o.useUIStore;exports.DEFAULT_LAYOUT=r.DEFAULT_LAYOUT;exports.ElementEditorConfigProvider=r.ElementEditorConfigProvider;exports.accentStyle=r.accentStyle;exports.resolveConfig=r.resolveConfig;exports.useAccentStyle=r.useAccentStyle;exports.useApplyAccentToRoot=r.useApplyAccentToRoot;exports.useElementEditorConfig=r.useElementEditorConfig;exports.useUnitsOverride=r.useUnitsOverride;exports.withLayout=r.withLayout;Object.defineProperty(exports,"ElementEditorError",{enumerable:!0,get:()=>n.ElementEditorError});exports.Button=t.Button;exports.CONTEXT_MENU_MARKER_ATTR=t.CONTEXT_MENU_MARKER_ATTR;exports.ContextMenu=t.ContextMenu;exports.EditToolbarBtn=t.EditToolbarBtn;exports.Input=t.Input;exports.Kbd=t.Kbd;exports.KbdDark=t.KbdDark;exports.KbdInvert=t.KbdInvert;exports.SearchDropdown=t.SearchDropdown;exports.SelectInput=t.SelectInput;exports.Textarea=t.Textarea;exports.ToolButton=t.ToolButton;exports.ToolbarDivider=t.ToolbarDivider;exports.Tooltip=t.Tooltip;exports.isContextMenuOpen=t.isContextMenuOpen;