@accelint/map-toolkit 0.6.0 → 1.1.0

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 (207) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/catalog-info.yaml +7 -6
  3. package/dist/camera/events.js.map +1 -1
  4. package/dist/camera/index.d.ts +2 -2
  5. package/dist/camera/index.js +2 -2
  6. package/dist/camera/store.d.ts +120 -0
  7. package/dist/camera/store.js +279 -0
  8. package/dist/camera/store.js.map +1 -0
  9. package/dist/cursor-coordinates/index.d.ts +4 -2
  10. package/dist/cursor-coordinates/index.js +3 -2
  11. package/dist/cursor-coordinates/store.d.ts +48 -0
  12. package/dist/cursor-coordinates/store.js +92 -0
  13. package/dist/cursor-coordinates/store.js.map +1 -0
  14. package/dist/cursor-coordinates/types.d.ts +87 -0
  15. package/dist/cursor-coordinates/types.js +12 -0
  16. package/dist/cursor-coordinates/use-cursor-coordinates.d.ts +41 -37
  17. package/dist/cursor-coordinates/use-cursor-coordinates.js +131 -202
  18. package/dist/cursor-coordinates/use-cursor-coordinates.js.map +1 -1
  19. package/dist/deckgl/base-map/constants.d.ts +1 -6
  20. package/dist/deckgl/base-map/constants.js +1 -6
  21. package/dist/deckgl/base-map/constants.js.map +1 -1
  22. package/dist/deckgl/base-map/controls.js +2 -0
  23. package/dist/deckgl/base-map/controls.js.map +1 -1
  24. package/dist/deckgl/base-map/events.js.map +1 -1
  25. package/dist/deckgl/base-map/index.d.ts +2 -2
  26. package/dist/deckgl/base-map/index.js +10 -11
  27. package/dist/deckgl/base-map/index.js.map +1 -1
  28. package/dist/deckgl/base-map/provider.d.ts +2 -2
  29. package/dist/deckgl/base-map/provider.js +1 -1
  30. package/dist/deckgl/base-map/provider.js.map +1 -1
  31. package/dist/deckgl/index.d.ts +4 -4
  32. package/dist/deckgl/index.js +4 -4
  33. package/dist/deckgl/saved-viewports/index.js.map +1 -1
  34. package/dist/deckgl/saved-viewports/storage.js +10 -2
  35. package/dist/deckgl/saved-viewports/storage.js.map +1 -1
  36. package/dist/deckgl/shapes/display-shape-layer/constants.js +5 -8
  37. package/dist/deckgl/shapes/display-shape-layer/constants.js.map +1 -1
  38. package/dist/deckgl/shapes/display-shape-layer/fiber.js.map +1 -1
  39. package/dist/deckgl/shapes/display-shape-layer/index.d.ts +18 -14
  40. package/dist/deckgl/shapes/display-shape-layer/index.js +63 -30
  41. package/dist/deckgl/shapes/display-shape-layer/index.js.map +1 -1
  42. package/dist/deckgl/shapes/display-shape-layer/shape-label-layer.js +2 -16
  43. package/dist/deckgl/shapes/display-shape-layer/shape-label-layer.js.map +1 -1
  44. package/dist/deckgl/shapes/display-shape-layer/store.js +58 -272
  45. package/dist/deckgl/shapes/display-shape-layer/store.js.map +1 -1
  46. package/dist/deckgl/shapes/display-shape-layer/types.d.ts +22 -11
  47. package/dist/deckgl/shapes/display-shape-layer/{use-shape-selection.d.ts → use-select-shape.d.ts} +9 -9
  48. package/dist/deckgl/shapes/display-shape-layer/{use-shape-selection.js → use-select-shape.js} +12 -12
  49. package/dist/deckgl/shapes/display-shape-layer/use-select-shape.js.map +1 -0
  50. package/dist/deckgl/shapes/display-shape-layer/utils/display-style.js +5 -66
  51. package/dist/deckgl/shapes/display-shape-layer/utils/display-style.js.map +1 -1
  52. package/dist/deckgl/shapes/display-shape-layer/utils/labels.d.ts +2 -65
  53. package/dist/deckgl/shapes/display-shape-layer/utils/labels.js +3 -121
  54. package/dist/deckgl/shapes/display-shape-layer/utils/labels.js.map +1 -1
  55. package/dist/deckgl/shapes/draw-shape-layer/constants.js +46 -0
  56. package/dist/deckgl/shapes/draw-shape-layer/constants.js.map +1 -0
  57. package/dist/deckgl/shapes/draw-shape-layer/events.d.ts +92 -0
  58. package/dist/deckgl/shapes/draw-shape-layer/events.js +56 -0
  59. package/dist/deckgl/shapes/draw-shape-layer/events.js.map +1 -0
  60. package/dist/deckgl/shapes/draw-shape-layer/fiber.d.ts +11 -0
  61. package/dist/{maplibre/constants.js → deckgl/shapes/draw-shape-layer/fiber.js} +6 -12
  62. package/dist/deckgl/shapes/draw-shape-layer/fiber.js.map +1 -0
  63. package/dist/deckgl/shapes/draw-shape-layer/index.d.ts +53 -0
  64. package/dist/deckgl/shapes/draw-shape-layer/index.js +95 -0
  65. package/dist/deckgl/shapes/draw-shape-layer/index.js.map +1 -0
  66. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-circle-mode-with-tooltip.js +51 -0
  67. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-circle-mode-with-tooltip.js.map +1 -0
  68. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-ellipse-mode-with-tooltip.js +73 -0
  69. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-ellipse-mode-with-tooltip.js.map +1 -0
  70. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-line-string-mode-with-tooltip.js +87 -0
  71. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-line-string-mode-with-tooltip.js.map +1 -0
  72. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-polygon-mode-with-tooltip.js +88 -0
  73. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-polygon-mode-with-tooltip.js.map +1 -0
  74. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-rectangle-mode-with-tooltip.js +77 -0
  75. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-rectangle-mode-with-tooltip.js.map +1 -0
  76. package/dist/deckgl/shapes/draw-shape-layer/modes/index.js +64 -0
  77. package/dist/deckgl/shapes/draw-shape-layer/modes/index.js.map +1 -0
  78. package/dist/deckgl/shapes/draw-shape-layer/store.js +175 -0
  79. package/dist/deckgl/shapes/draw-shape-layer/store.js.map +1 -0
  80. package/dist/deckgl/shapes/draw-shape-layer/types.d.ts +86 -0
  81. package/dist/{viewport/constants.js → deckgl/shapes/draw-shape-layer/types.js} +1 -12
  82. package/dist/deckgl/shapes/draw-shape-layer/use-draw-shape.d.ts +82 -0
  83. package/dist/deckgl/shapes/draw-shape-layer/use-draw-shape.js +112 -0
  84. package/dist/deckgl/shapes/draw-shape-layer/use-draw-shape.js.map +1 -0
  85. package/dist/deckgl/shapes/draw-shape-layer/utils/feature-conversion.js +147 -0
  86. package/dist/deckgl/shapes/draw-shape-layer/utils/feature-conversion.js.map +1 -0
  87. package/dist/deckgl/shapes/edit-shape-layer/constants.js +41 -0
  88. package/dist/deckgl/shapes/edit-shape-layer/constants.js.map +1 -0
  89. package/dist/deckgl/shapes/edit-shape-layer/events.d.ts +92 -0
  90. package/dist/deckgl/shapes/edit-shape-layer/events.js +56 -0
  91. package/dist/deckgl/shapes/edit-shape-layer/events.js.map +1 -0
  92. package/dist/deckgl/shapes/edit-shape-layer/fiber.d.ts +13 -0
  93. package/dist/deckgl/shapes/edit-shape-layer/fiber.js +14 -0
  94. package/dist/deckgl/shapes/edit-shape-layer/index.d.ts +63 -0
  95. package/dist/deckgl/shapes/edit-shape-layer/index.js +162 -0
  96. package/dist/deckgl/shapes/edit-shape-layer/index.js.map +1 -0
  97. package/dist/deckgl/shapes/edit-shape-layer/modes/base-transform-mode.js +154 -0
  98. package/dist/deckgl/shapes/edit-shape-layer/modes/base-transform-mode.js.map +1 -0
  99. package/dist/deckgl/shapes/edit-shape-layer/modes/bounding-transform-mode.js +147 -0
  100. package/dist/deckgl/shapes/edit-shape-layer/modes/bounding-transform-mode.js.map +1 -0
  101. package/dist/deckgl/shapes/edit-shape-layer/modes/circle-transform-mode.js +87 -0
  102. package/dist/deckgl/shapes/edit-shape-layer/modes/circle-transform-mode.js.map +1 -0
  103. package/dist/deckgl/shapes/edit-shape-layer/modes/index.js +61 -0
  104. package/dist/deckgl/shapes/edit-shape-layer/modes/index.js.map +1 -0
  105. package/dist/deckgl/shapes/edit-shape-layer/modes/rotate-mode-with-snap.js +109 -0
  106. package/dist/deckgl/shapes/edit-shape-layer/modes/rotate-mode-with-snap.js.map +1 -0
  107. package/dist/deckgl/shapes/edit-shape-layer/modes/scale-mode-with-free-transform.js +289 -0
  108. package/dist/deckgl/shapes/edit-shape-layer/modes/scale-mode-with-free-transform.js.map +1 -0
  109. package/dist/deckgl/shapes/edit-shape-layer/modes/vertex-transform-mode.js +121 -0
  110. package/dist/deckgl/shapes/edit-shape-layer/modes/vertex-transform-mode.js.map +1 -0
  111. package/dist/deckgl/shapes/edit-shape-layer/store.js +194 -0
  112. package/dist/deckgl/shapes/edit-shape-layer/store.js.map +1 -0
  113. package/dist/deckgl/shapes/edit-shape-layer/types.d.ts +93 -0
  114. package/dist/deckgl/shapes/edit-shape-layer/types.js +14 -0
  115. package/dist/deckgl/shapes/edit-shape-layer/use-edit-shape.d.ts +82 -0
  116. package/dist/deckgl/shapes/edit-shape-layer/use-edit-shape.js +114 -0
  117. package/dist/deckgl/shapes/edit-shape-layer/use-edit-shape.js.map +1 -0
  118. package/dist/deckgl/shapes/index.d.ts +15 -6
  119. package/dist/deckgl/shapes/index.js +12 -5
  120. package/dist/deckgl/shapes/shared/constants.d.ts +27 -32
  121. package/dist/deckgl/shapes/shared/constants.js +189 -25
  122. package/dist/deckgl/shapes/shared/constants.js.map +1 -1
  123. package/dist/deckgl/shapes/shared/events.d.ts +1 -20
  124. package/dist/deckgl/shapes/shared/events.js +1 -31
  125. package/dist/deckgl/shapes/shared/events.js.map +1 -1
  126. package/dist/deckgl/shapes/shared/hooks/use-shift-zoom-disable.js +84 -0
  127. package/dist/deckgl/shapes/shared/hooks/use-shift-zoom-disable.js.map +1 -0
  128. package/dist/deckgl/shapes/shared/types.d.ts +187 -28
  129. package/dist/deckgl/shapes/shared/types.js +55 -1
  130. package/dist/deckgl/shapes/shared/types.js.map +1 -1
  131. package/dist/deckgl/shapes/shared/utils/geometry-measurements.js +128 -0
  132. package/dist/deckgl/shapes/shared/utils/geometry-measurements.js.map +1 -0
  133. package/dist/deckgl/shapes/shared/utils/layer-config.js +50 -0
  134. package/dist/deckgl/shapes/shared/utils/layer-config.js.map +1 -0
  135. package/dist/deckgl/shapes/shared/utils/mode-utils.js +113 -0
  136. package/dist/deckgl/shapes/shared/utils/mode-utils.js.map +1 -0
  137. package/dist/deckgl/shapes/shared/utils/pick-filtering.js +57 -0
  138. package/dist/deckgl/shapes/shared/utils/pick-filtering.js.map +1 -0
  139. package/dist/deckgl/shapes/shared/utils/style-utils.d.ts +64 -0
  140. package/dist/deckgl/shapes/shared/utils/style-utils.js +101 -0
  141. package/dist/deckgl/shapes/shared/utils/style-utils.js.map +1 -0
  142. package/dist/deckgl/symbol-layer/fiber.js.map +1 -1
  143. package/dist/deckgl/symbol-layer/index.js.map +1 -1
  144. package/dist/deckgl/text-layer/character-sets.js.map +1 -1
  145. package/dist/deckgl/text-layer/default-settings.js +4 -24
  146. package/dist/deckgl/text-layer/default-settings.js.map +1 -1
  147. package/dist/deckgl/text-layer/fiber.js.map +1 -1
  148. package/dist/deckgl/text-layer/index.js.map +1 -1
  149. package/dist/deckgl/text-settings.d.ts +77 -0
  150. package/dist/deckgl/text-settings.js +83 -0
  151. package/dist/deckgl/text-settings.js.map +1 -0
  152. package/dist/map-cursor/events.js.map +1 -1
  153. package/dist/map-cursor/index.d.ts +2 -2
  154. package/dist/map-cursor/index.js +2 -2
  155. package/dist/map-cursor/store.d.ts +32 -61
  156. package/dist/map-cursor/store.js +165 -294
  157. package/dist/map-cursor/store.js.map +1 -1
  158. package/dist/map-cursor/use-map-cursor.d.ts +5 -2
  159. package/dist/map-cursor/use-map-cursor.js +33 -15
  160. package/dist/map-cursor/use-map-cursor.js.map +1 -1
  161. package/dist/map-mode/events.js.map +1 -1
  162. package/dist/map-mode/index.d.ts +2 -2
  163. package/dist/map-mode/index.js +2 -2
  164. package/dist/map-mode/store.d.ts +36 -37
  165. package/dist/map-mode/store.js +131 -237
  166. package/dist/map-mode/store.js.map +1 -1
  167. package/dist/map-mode/use-map-mode.js +6 -5
  168. package/dist/map-mode/use-map-mode.js.map +1 -1
  169. package/dist/maplibre/hooks/use-maplibre.js.map +1 -1
  170. package/dist/maplibre/index.d.ts +2 -2
  171. package/dist/maplibre/index.js +2 -2
  172. package/dist/shared/constants.d.ts +19 -0
  173. package/dist/shared/constants.js +33 -0
  174. package/dist/shared/constants.js.map +1 -0
  175. package/dist/shared/create-map-store.d.ts +202 -0
  176. package/dist/shared/create-map-store.js +223 -0
  177. package/dist/shared/create-map-store.js.map +1 -0
  178. package/dist/shared/units.d.ts +39 -0
  179. package/dist/shared/units.js +49 -0
  180. package/dist/shared/units.js.map +1 -0
  181. package/dist/viewport/index.d.ts +3 -3
  182. package/dist/viewport/index.js +3 -3
  183. package/dist/viewport/store.d.ts +69 -0
  184. package/dist/viewport/store.js +125 -0
  185. package/dist/viewport/store.js.map +1 -0
  186. package/dist/viewport/types.d.ts +2 -2
  187. package/dist/viewport/utils.js +2 -2
  188. package/dist/viewport/utils.js.map +1 -1
  189. package/dist/viewport/viewport-size.d.ts +2 -2
  190. package/dist/viewport/viewport-size.js +2 -2
  191. package/dist/viewport/viewport-size.js.map +1 -1
  192. package/package.json +39 -19
  193. package/dist/camera/use-camera-state.d.ts +0 -153
  194. package/dist/camera/use-camera-state.js +0 -418
  195. package/dist/camera/use-camera-state.js.map +0 -1
  196. package/dist/deckgl/shapes/display-shape-layer/constants.d.ts +0 -44
  197. package/dist/deckgl/shapes/display-shape-layer/shape-label-layer.d.ts +0 -66
  198. package/dist/deckgl/shapes/display-shape-layer/store.d.ts +0 -87
  199. package/dist/deckgl/shapes/display-shape-layer/use-shape-selection.js.map +0 -1
  200. package/dist/deckgl/shapes/display-shape-layer/utils/display-style.d.ts +0 -61
  201. package/dist/maplibre/constants.d.ts +0 -13
  202. package/dist/maplibre/constants.js.map +0 -1
  203. package/dist/viewport/constants.d.ts +0 -11
  204. package/dist/viewport/constants.js.map +0 -1
  205. package/dist/viewport/use-viewport-state.d.ts +0 -100
  206. package/dist/viewport/use-viewport-state.js +0 -222
  207. package/dist/viewport/use-viewport-state.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","names":["DEFAULT_DRAWING_STATE: DrawingState"],"sources":["../../../../src/deckgl/shapes/draw-shape-layer/store.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\n/**\n * Draw Shape Store\n *\n * Manages drawing state for shape creation.\n *\n * @example\n * ```tsx\n * import { drawStore } from '@accelint/map-toolkit/deckgl/shapes';\n *\n * function DrawControls({ mapId }) {\n * const { state, draw, cancel } = drawStore.use(mapId);\n *\n * return (\n * <div>\n * <p>Drawing: {state.activeShapeType ?? 'none'}</p>\n * <button onClick={() => draw('Polygon')}>Draw Polygon</button>\n * <button onClick={cancel}>Cancel</button>\n * </div>\n * );\n * }\n * ```\n */\n\nimport { Broadcast } from '@accelint/bus';\nimport { MapModeEvents } from '@/map-mode/events';\nimport { createMapStore } from '@/shared/create-map-store';\nimport {\n releaseModeAndCursor,\n requestModeAndCursor,\n} from '../shared/utils/mode-utils';\nimport {\n DRAW_CURSOR_MAP,\n DRAW_SHAPE_LAYER_ID,\n DRAW_SHAPE_MODE,\n} from './constants';\nimport { DrawShapeEvents } from './events';\nimport { convertFeatureToShape } from './utils/feature-conversion';\nimport type { UniqueId } from '@accelint/core';\nimport type { Feature } from 'geojson';\nimport type { MapModeEventType } from '@/map-mode/types';\nimport type { Shape, ShapeFeatureType } from '../shared/types';\nimport type { DrawShapeEvent, ShapeDrawnEvent } from './events';\nimport type { DrawFunction, DrawingState, DrawShapeOptions } from './types';\n\n/**\n * Typed event bus instances\n */\nconst drawShapeBus = Broadcast.getInstance<DrawShapeEvent>();\nconst mapModeBus = Broadcast.getInstance<MapModeEventType>();\n\n/**\n * Default drawing state\n */\nconst DEFAULT_DRAWING_STATE: DrawingState = {\n activeShapeType: null,\n tentativeFeature: null,\n styleDefaults: null,\n circleDefaults: null,\n};\n\n/**\n * Actions for draw shape store\n */\ntype DrawShapeActions = {\n /** Start drawing a shape of the specified type */\n draw: DrawFunction;\n /** Cancel the current drawing operation */\n cancel: () => void;\n};\n\n/**\n * Start drawing a shape\n */\nfunction startDrawing(\n mapId: UniqueId,\n state: DrawingState,\n shapeType: ShapeFeatureType,\n options: DrawShapeOptions | undefined,\n notify: () => void,\n setState: (updates: Partial<DrawingState>) => void,\n): void {\n // Already drawing - cancel first\n if (state.activeShapeType) {\n cancelDrawingInternal(mapId, state, notify, setState);\n }\n\n // Update state with new object reference\n setState({\n activeShapeType: shapeType,\n tentativeFeature: null,\n styleDefaults: options?.styleDefaults ?? null,\n circleDefaults: options?.circleDefaults ?? null,\n });\n\n // Request map mode and cursor using shared utilities\n const cursor = DRAW_CURSOR_MAP[shapeType];\n requestModeAndCursor(mapId, DRAW_SHAPE_MODE, cursor, DRAW_SHAPE_LAYER_ID);\n\n // Emit drawing started event\n drawShapeBus.emit(DrawShapeEvents.drawing, {\n shapeType,\n mapId,\n });\n\n notify();\n}\n\n/**\n * Complete drawing and create a shape\n */\nfunction completeDrawingInternal(\n mapId: UniqueId,\n state: DrawingState,\n feature: Feature,\n notify: () => void,\n setState: (updates: Partial<DrawingState>) => void,\n): Shape {\n if (!state.activeShapeType) {\n throw new Error('Cannot complete drawing - not currently drawing');\n }\n\n const shapeType = state.activeShapeType;\n const styleDefaults = state.styleDefaults;\n\n // Convert feature to Shape\n const shape = convertFeatureToShape(feature, shapeType, styleDefaults);\n\n // Reset state with new object reference\n setState({\n activeShapeType: null,\n tentativeFeature: null,\n styleDefaults: null,\n circleDefaults: null,\n });\n\n // Release mode and cursor using shared utilities\n releaseModeAndCursor(mapId, DRAW_SHAPE_LAYER_ID);\n\n // Emit shape drawn event\n drawShapeBus.emit(DrawShapeEvents.drawn, {\n shape,\n mapId,\n } as unknown as ShapeDrawnEvent['payload']);\n\n notify();\n\n return shape;\n}\n\n/**\n * Cancel the current drawing operation\n */\nfunction cancelDrawingInternal(\n mapId: UniqueId,\n state: DrawingState,\n notify: () => void,\n setState: (updates: Partial<DrawingState>) => void,\n): void {\n if (!state.activeShapeType) {\n return; // Nothing to cancel\n }\n\n const shapeType = state.activeShapeType;\n\n // Reset state with new object reference\n setState({\n activeShapeType: null,\n tentativeFeature: null,\n styleDefaults: null,\n circleDefaults: null,\n });\n\n // Release mode and cursor using shared utilities\n releaseModeAndCursor(mapId, DRAW_SHAPE_LAYER_ID);\n\n // Emit canceled event\n drawShapeBus.emit(DrawShapeEvents.canceled, {\n shapeType,\n mapId,\n });\n\n notify();\n}\n\n/**\n * Draw shape store\n */\nexport const drawStore = createMapStore<DrawingState, DrawShapeActions>({\n defaultState: { ...DEFAULT_DRAWING_STATE },\n\n actions: (mapId, { get, set, notify }) => ({\n draw: (shapeType: ShapeFeatureType, options?: DrawShapeOptions) => {\n startDrawing(mapId, get(), shapeType, options, notify, set);\n },\n\n cancel: () => {\n cancelDrawingInternal(mapId, get(), notify, set);\n },\n }),\n\n bus: (mapId, { get }) => {\n // Listen for mode authorization requests - REJECT when drawing (protected mode)\n const unsubAuth = mapModeBus.on(\n MapModeEvents.changeAuthorization,\n (event) => {\n const { authId, id } = event.payload;\n\n // Filter: only handle if targeted at this map\n if (id !== mapId) {\n return;\n }\n\n // If we're actively drawing, reject the mode change request\n if (get().activeShapeType) {\n mapModeBus.emit(MapModeEvents.changeDecision, {\n authId,\n approved: false,\n owner: DRAW_SHAPE_LAYER_ID,\n reason: 'Drawing in progress - cancel drawing first',\n id: mapId,\n });\n }\n },\n );\n\n return () => {\n unsubAuth();\n };\n },\n\n onCleanup: (mapId, state) => {\n // Cancel any active drawing before cleanup\n if (state.activeShapeType) {\n // Release mode and cursor using shared utilities\n releaseModeAndCursor(mapId, DRAW_SHAPE_LAYER_ID);\n\n // Emit canceled event\n drawShapeBus.emit(DrawShapeEvents.canceled, {\n shapeType: state.activeShapeType,\n mapId,\n });\n }\n },\n});\n\n// =============================================================================\n// Convenience exports\n// =============================================================================\n\n/**\n * Get the current drawing state for a mapId\n * Returns null if no store instance exists\n */\nexport function getDrawingState(mapId: UniqueId): DrawingState | null {\n if (!drawStore.exists(mapId)) {\n return null;\n }\n return drawStore.get(mapId);\n}\n\n/**\n * Hook for drawing state\n */\nexport function useDrawingState(\n mapId: UniqueId,\n): { state: DrawingState } & DrawShapeActions {\n return drawStore.use(mapId);\n}\n\n/**\n * Manually clear drawing state for a specific mapId.\n */\nexport function clearDrawingState(mapId: UniqueId): void {\n drawStore.clear(mapId);\n}\n\n/**\n * Complete drawing with a feature (called by the layer component)\n */\nexport function completeDrawingFromLayer(\n mapId: UniqueId,\n feature: Feature,\n): Shape {\n const state = drawStore.get(mapId);\n return completeDrawingInternal(\n mapId,\n state,\n feature,\n () => {\n /* notify handled by set */\n },\n (updates) => drawStore.set(mapId, updates),\n );\n}\n\n/**\n * Cancel drawing (called by the layer component)\n */\nexport function cancelDrawingFromLayer(mapId: UniqueId): void {\n drawStore.actions(mapId).cancel();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,MAAM,eAAe,UAAU,aAA6B;AAC5D,MAAM,aAAa,UAAU,aAA+B;;;;AAK5D,MAAMA,wBAAsC;CAC1C,iBAAiB;CACjB,kBAAkB;CAClB,eAAe;CACf,gBAAgB;CACjB;;;;AAeD,SAAS,aACP,OACA,OACA,WACA,SACA,QACA,UACM;AAEN,KAAI,MAAM,gBACR,uBAAsB,OAAO,OAAO,QAAQ,SAAS;AAIvD,UAAS;EACP,iBAAiB;EACjB,kBAAkB;EAClB,eAAe,SAAS,iBAAiB;EACzC,gBAAgB,SAAS,kBAAkB;EAC5C,CAAC;CAGF,MAAM,SAAS,gBAAgB;AAC/B,sBAAqB,OAAO,iBAAiB,QAAQ,oBAAoB;AAGzE,cAAa,KAAK,gBAAgB,SAAS;EACzC;EACA;EACD,CAAC;AAEF,SAAQ;;;;;AAMV,SAAS,wBACP,OACA,OACA,SACA,QACA,UACO;AACP,KAAI,CAAC,MAAM,gBACT,OAAM,IAAI,MAAM,kDAAkD;CAGpE,MAAM,YAAY,MAAM;CACxB,MAAM,gBAAgB,MAAM;CAG5B,MAAM,QAAQ,sBAAsB,SAAS,WAAW,cAAc;AAGtE,UAAS;EACP,iBAAiB;EACjB,kBAAkB;EAClB,eAAe;EACf,gBAAgB;EACjB,CAAC;AAGF,sBAAqB,OAAO,oBAAoB;AAGhD,cAAa,KAAK,gBAAgB,OAAO;EACvC;EACA;EACD,CAA0C;AAE3C,SAAQ;AAER,QAAO;;;;;AAMT,SAAS,sBACP,OACA,OACA,QACA,UACM;AACN,KAAI,CAAC,MAAM,gBACT;CAGF,MAAM,YAAY,MAAM;AAGxB,UAAS;EACP,iBAAiB;EACjB,kBAAkB;EAClB,eAAe;EACf,gBAAgB;EACjB,CAAC;AAGF,sBAAqB,OAAO,oBAAoB;AAGhD,cAAa,KAAK,gBAAgB,UAAU;EAC1C;EACA;EACD,CAAC;AAEF,SAAQ;;;;;AAMV,MAAa,YAAY,eAA+C;CACtE,cAAc,EAAE,GAAG,uBAAuB;CAE1C,UAAU,OAAO,EAAE,KAAK,KAAK,cAAc;EACzC,OAAO,WAA6B,YAA+B;AACjE,gBAAa,OAAO,KAAK,EAAE,WAAW,SAAS,QAAQ,IAAI;;EAG7D,cAAc;AACZ,yBAAsB,OAAO,KAAK,EAAE,QAAQ,IAAI;;EAEnD;CAED,MAAM,OAAO,EAAE,UAAU;EAEvB,MAAM,YAAY,WAAW,GAC3B,cAAc,sBACb,UAAU;GACT,MAAM,EAAE,QAAQ,OAAO,MAAM;AAG7B,OAAI,OAAO,MACT;AAIF,OAAI,KAAK,CAAC,gBACR,YAAW,KAAK,cAAc,gBAAgB;IAC5C;IACA,UAAU;IACV,OAAO;IACP,QAAQ;IACR,IAAI;IACL,CAAC;IAGP;AAED,eAAa;AACX,cAAW;;;CAIf,YAAY,OAAO,UAAU;AAE3B,MAAI,MAAM,iBAAiB;AAEzB,wBAAqB,OAAO,oBAAoB;AAGhD,gBAAa,KAAK,gBAAgB,UAAU;IAC1C,WAAW,MAAM;IACjB;IACD,CAAC;;;CAGP,CAAC;;;;AAoCF,SAAgB,yBACd,OACA,SACO;AAEP,QAAO,wBACL,OAFY,UAAU,IAAI,MAAM,EAIhC,eACM,KAGL,YAAY,UAAU,IAAI,OAAO,QAAQ,CAC3C;;;;;AAMH,SAAgB,uBAAuB,OAAuB;AAC5D,WAAU,QAAQ,MAAM,CAAC,QAAQ"}
@@ -0,0 +1,86 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { DistanceUnitAbbreviation } from "../../../shared/units.js";
14
+ import { CircleProperties, Shape, ShapeFeatureType, StyleProperties } from "../shared/types.js";
15
+ import { UniqueId } from "@accelint/core";
16
+ import { Feature } from "geojson";
17
+
18
+ //#region src/deckgl/shapes/draw-shape-layer/types.d.ts
19
+ /**
20
+ * State for the drawing store
21
+ */
22
+ type DrawingState = {
23
+ /** Current shape type being drawn, null when not drawing */
24
+ activeShapeType: ShapeFeatureType | null;
25
+ /** Tentative feature being drawn (updates in real-time) */
26
+ tentativeFeature: Feature | null;
27
+ /** Default style properties to apply to drawn shapes */
28
+ styleDefaults: Partial<StyleProperties> | null;
29
+ /** Default circle properties (for Circle shapes) */
30
+ circleDefaults: Partial<CircleProperties> | null;
31
+ };
32
+ /**
33
+ * Options for starting a drawing operation
34
+ */
35
+ type DrawShapeOptions = {
36
+ /** Default style properties for the drawn shape */
37
+ styleDefaults?: Partial<StyleProperties>;
38
+ /** Circle-specific defaults (only used for Circle shapes) */
39
+ circleDefaults?: Partial<CircleProperties>;
40
+ };
41
+ /**
42
+ * Options for the useDrawShape hook
43
+ */
44
+ type UseDrawShapeOptions = {
45
+ /** Callback when a shape is successfully drawn */
46
+ onCreate?: (shape: Shape) => void;
47
+ /** Callback when drawing is canceled */
48
+ onCancel?: (shapeType: ShapeFeatureType) => void;
49
+ };
50
+ /**
51
+ * Return type for the useDrawShape hook
52
+ */
53
+ type UseDrawShapeReturn = {
54
+ /** Current drawing state (null when not drawing) */
55
+ drawingState: DrawingState | null;
56
+ /** Start drawing a shape type with optional defaults */
57
+ draw: (shapeType: ShapeFeatureType, options?: DrawShapeOptions) => void;
58
+ /** Cancel the current drawing operation */
59
+ cancel: () => void;
60
+ /** Whether currently in drawing mode */
61
+ isDrawing: boolean;
62
+ /** The shape type currently being drawn (null if not drawing) */
63
+ activeShapeType: ShapeFeatureType | null;
64
+ };
65
+ /**
66
+ * Props for the DrawShapeLayer component
67
+ */
68
+ type DrawShapeLayerProps = {
69
+ /** Layer ID (defaults to 'draw-shape-layer') */
70
+ id?: string;
71
+ /**
72
+ * Map instance ID for multi-map isolation.
73
+ * Optional when used inside a MapProvider (uses context).
74
+ * Required when used outside a MapProvider.
75
+ */
76
+ mapId?: UniqueId;
77
+ /** Distance unit for tooltip measurements (defaults to 'km') */
78
+ unit?: DistanceUnitAbbreviation;
79
+ };
80
+ /**
81
+ * Function type for the draw action
82
+ */
83
+ type DrawFunction = (shapeType: ShapeFeatureType, options?: DrawShapeOptions) => void;
84
+ //#endregion
85
+ export { DrawFunction, DrawShapeLayerProps, DrawShapeOptions, DrawingState, UseDrawShapeOptions, UseDrawShapeReturn };
86
+ //# sourceMappingURL=types.d.ts.map
@@ -11,15 +11,4 @@
11
11
  */
12
12
 
13
13
 
14
- //#region src/viewport/constants.ts
15
- const UNIT_MAP = {
16
- km: "kilometers",
17
- m: "meters",
18
- nm: "nauticalmiles",
19
- mi: "miles",
20
- ft: "feet"
21
- };
22
-
23
- //#endregion
24
- export { UNIT_MAP };
25
- //# sourceMappingURL=constants.js.map
14
+ 'use client';
@@ -0,0 +1,82 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { UseDrawShapeOptions, UseDrawShapeReturn } from "./types.js";
14
+ import { UniqueId } from "@accelint/core";
15
+
16
+ //#region src/deckgl/shapes/draw-shape-layer/use-draw-shape.d.ts
17
+
18
+ /**
19
+ * Hook to access the shape drawing state and actions.
20
+ *
21
+ * This hook uses `useSyncExternalStore` to subscribe to drawing state changes,
22
+ * providing concurrent-safe state updates. Uses a fan-out pattern where
23
+ * a single bus listener per map instance notifies N React component subscribers.
24
+ *
25
+ * @param mapId - Optional map instance ID. If not provided, will use the ID from `MapContext`.
26
+ * @param options - Optional callbacks for onCreate and onCancel events
27
+ * @returns Drawing state, draw function, cancel function, and convenience flags
28
+ * @throws Error if no `mapId` is provided and hook is used outside of `MapProvider`
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * // Inside MapProvider (within BaseMap children) - uses context
33
+ * function DrawingToolbar() {
34
+ * const { draw, cancel, isDrawing, activeShapeType } = useDrawShape(undefined, {
35
+ * onCreate: (shape) => {
36
+ * console.log('Shape created:', shape);
37
+ * setShapes(prev => [...prev, shape]);
38
+ * },
39
+ * onCancel: (shapeType) => {
40
+ * console.log('Drawing canceled:', shapeType);
41
+ * },
42
+ * });
43
+ *
44
+ * return (
45
+ * <div>
46
+ * <button onClick={() => draw(ShapeFeatureType.Polygon)}>
47
+ * Draw Polygon
48
+ * </button>
49
+ * <button onClick={() => draw(ShapeFeatureType.Circle)}>
50
+ * Draw Circle
51
+ * </button>
52
+ * {isDrawing && (
53
+ * <button onClick={cancel}>
54
+ * Cancel ({activeShapeType})
55
+ * </button>
56
+ * )}
57
+ * </div>
58
+ * );
59
+ * }
60
+ * ```
61
+ *
62
+ * @example
63
+ * ```tsx
64
+ * // Outside MapProvider - pass mapId directly
65
+ * function ExternalDrawingControl({ mapId }: { mapId: UniqueId }) {
66
+ * const { draw, isDrawing } = useDrawShape(mapId);
67
+ *
68
+ * return (
69
+ * <button
70
+ * onClick={() => draw(ShapeFeatureType.Point)}
71
+ * disabled={isDrawing}
72
+ * >
73
+ * Add Point
74
+ * </button>
75
+ * );
76
+ * }
77
+ * ```
78
+ */
79
+ declare function useDrawShape(mapId?: UniqueId, options?: UseDrawShapeOptions): UseDrawShapeReturn;
80
+ //#endregion
81
+ export { useDrawShape };
82
+ //# sourceMappingURL=use-draw-shape.d.ts.map
@@ -0,0 +1,112 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ 'use client';
15
+
16
+ import { MapContext } from "../../base-map/provider.js";
17
+ import { DrawShapeEvents } from "./events.js";
18
+ import { drawStore } from "./store.js";
19
+ import { useContext, useMemo } from "react";
20
+ import { useBus } from "@accelint/bus/react";
21
+
22
+ //#region src/deckgl/shapes/draw-shape-layer/use-draw-shape.ts
23
+ /**
24
+ * Hook to access the shape drawing state and actions.
25
+ *
26
+ * This hook uses `useSyncExternalStore` to subscribe to drawing state changes,
27
+ * providing concurrent-safe state updates. Uses a fan-out pattern where
28
+ * a single bus listener per map instance notifies N React component subscribers.
29
+ *
30
+ * @param mapId - Optional map instance ID. If not provided, will use the ID from `MapContext`.
31
+ * @param options - Optional callbacks for onCreate and onCancel events
32
+ * @returns Drawing state, draw function, cancel function, and convenience flags
33
+ * @throws Error if no `mapId` is provided and hook is used outside of `MapProvider`
34
+ *
35
+ * @example
36
+ * ```tsx
37
+ * // Inside MapProvider (within BaseMap children) - uses context
38
+ * function DrawingToolbar() {
39
+ * const { draw, cancel, isDrawing, activeShapeType } = useDrawShape(undefined, {
40
+ * onCreate: (shape) => {
41
+ * console.log('Shape created:', shape);
42
+ * setShapes(prev => [...prev, shape]);
43
+ * },
44
+ * onCancel: (shapeType) => {
45
+ * console.log('Drawing canceled:', shapeType);
46
+ * },
47
+ * });
48
+ *
49
+ * return (
50
+ * <div>
51
+ * <button onClick={() => draw(ShapeFeatureType.Polygon)}>
52
+ * Draw Polygon
53
+ * </button>
54
+ * <button onClick={() => draw(ShapeFeatureType.Circle)}>
55
+ * Draw Circle
56
+ * </button>
57
+ * {isDrawing && (
58
+ * <button onClick={cancel}>
59
+ * Cancel ({activeShapeType})
60
+ * </button>
61
+ * )}
62
+ * </div>
63
+ * );
64
+ * }
65
+ * ```
66
+ *
67
+ * @example
68
+ * ```tsx
69
+ * // Outside MapProvider - pass mapId directly
70
+ * function ExternalDrawingControl({ mapId }: { mapId: UniqueId }) {
71
+ * const { draw, isDrawing } = useDrawShape(mapId);
72
+ *
73
+ * return (
74
+ * <button
75
+ * onClick={() => draw(ShapeFeatureType.Point)}
76
+ * disabled={isDrawing}
77
+ * >
78
+ * Add Point
79
+ * </button>
80
+ * );
81
+ * }
82
+ * ```
83
+ */
84
+ function useDrawShape(mapId, options) {
85
+ const contextId = useContext(MapContext);
86
+ const actualId = mapId ?? contextId;
87
+ if (!actualId) throw new Error("useDrawShape requires either a mapId parameter or to be used within a MapProvider");
88
+ const { onCreate, onCancel } = options ?? {};
89
+ const { state: drawingState, draw, cancel } = drawStore.use(actualId);
90
+ const { useOn: useOn$1 } = useBus();
91
+ useOn$1(DrawShapeEvents.drawn, (event) => {
92
+ if (event.payload.mapId === actualId && onCreate) onCreate(event.payload.shape);
93
+ });
94
+ useOn$1(DrawShapeEvents.canceled, (event) => {
95
+ if (event.payload.mapId === actualId && onCancel) onCancel(event.payload.shapeType);
96
+ });
97
+ return useMemo(() => ({
98
+ drawingState,
99
+ draw,
100
+ cancel,
101
+ isDrawing: !!drawingState?.activeShapeType,
102
+ activeShapeType: drawingState?.activeShapeType ?? null
103
+ }), [
104
+ drawingState,
105
+ draw,
106
+ cancel
107
+ ]);
108
+ }
109
+
110
+ //#endregion
111
+ export { useDrawShape };
112
+ //# sourceMappingURL=use-draw-shape.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-draw-shape.js","names":[],"sources":["../../../../src/deckgl/shapes/draw-shape-layer/use-draw-shape.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport 'client-only';\nimport { useBus } from '@accelint/bus/react';\nimport { useContext, useMemo } from 'react';\nimport { MapContext } from '../../base-map/provider';\nimport { DrawShapeEvents } from './events';\nimport { drawStore } from './store';\nimport type { UniqueId } from '@accelint/core';\nimport type { DrawShapeEvent } from './events';\nimport type { UseDrawShapeOptions, UseDrawShapeReturn } from './types';\n\n/**\n * Hook to access the shape drawing state and actions.\n *\n * This hook uses `useSyncExternalStore` to subscribe to drawing state changes,\n * providing concurrent-safe state updates. Uses a fan-out pattern where\n * a single bus listener per map instance notifies N React component subscribers.\n *\n * @param mapId - Optional map instance ID. If not provided, will use the ID from `MapContext`.\n * @param options - Optional callbacks for onCreate and onCancel events\n * @returns Drawing state, draw function, cancel function, and convenience flags\n * @throws Error if no `mapId` is provided and hook is used outside of `MapProvider`\n *\n * @example\n * ```tsx\n * // Inside MapProvider (within BaseMap children) - uses context\n * function DrawingToolbar() {\n * const { draw, cancel, isDrawing, activeShapeType } = useDrawShape(undefined, {\n * onCreate: (shape) => {\n * console.log('Shape created:', shape);\n * setShapes(prev => [...prev, shape]);\n * },\n * onCancel: (shapeType) => {\n * console.log('Drawing canceled:', shapeType);\n * },\n * });\n *\n * return (\n * <div>\n * <button onClick={() => draw(ShapeFeatureType.Polygon)}>\n * Draw Polygon\n * </button>\n * <button onClick={() => draw(ShapeFeatureType.Circle)}>\n * Draw Circle\n * </button>\n * {isDrawing && (\n * <button onClick={cancel}>\n * Cancel ({activeShapeType})\n * </button>\n * )}\n * </div>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // Outside MapProvider - pass mapId directly\n * function ExternalDrawingControl({ mapId }: { mapId: UniqueId }) {\n * const { draw, isDrawing } = useDrawShape(mapId);\n *\n * return (\n * <button\n * onClick={() => draw(ShapeFeatureType.Point)}\n * disabled={isDrawing}\n * >\n * Add Point\n * </button>\n * );\n * }\n * ```\n */\nexport function useDrawShape(\n mapId?: UniqueId,\n options?: UseDrawShapeOptions,\n): UseDrawShapeReturn {\n const contextId = useContext(MapContext);\n const actualId = mapId ?? contextId;\n\n if (!actualId) {\n throw new Error(\n 'useDrawShape requires either a mapId parameter or to be used within a MapProvider',\n );\n }\n\n const { onCreate, onCancel } = options ?? {};\n\n // Use the v2 store API directly\n const { state: drawingState, draw, cancel } = drawStore.use(actualId);\n\n // Listen for completion/cancellation events to trigger callbacks\n // useOn handles cleanup automatically and uses useEffectEvent for stable callbacks\n const { useOn } = useBus<DrawShapeEvent>();\n\n useOn(DrawShapeEvents.drawn, (event) => {\n if (event.payload.mapId === actualId && onCreate) {\n onCreate(event.payload.shape);\n }\n });\n\n useOn(DrawShapeEvents.canceled, (event) => {\n if (event.payload.mapId === actualId && onCancel) {\n onCancel(event.payload.shapeType);\n }\n });\n\n // Memoize the return value to prevent unnecessary re-renders\n return useMemo(\n () => ({\n drawingState,\n draw,\n cancel,\n isDrawing: !!drawingState?.activeShapeType,\n activeShapeType: drawingState?.activeShapeType ?? null,\n }),\n [drawingState, draw, cancel],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA,SAAgB,aACd,OACA,SACoB;CACpB,MAAM,YAAY,WAAW,WAAW;CACxC,MAAM,WAAW,SAAS;AAE1B,KAAI,CAAC,SACH,OAAM,IAAI,MACR,oFACD;CAGH,MAAM,EAAE,UAAU,aAAa,WAAW,EAAE;CAG5C,MAAM,EAAE,OAAO,cAAc,MAAM,WAAW,UAAU,IAAI,SAAS;CAIrE,MAAM,EAAE,mBAAU,QAAwB;AAE1C,SAAM,gBAAgB,QAAQ,UAAU;AACtC,MAAI,MAAM,QAAQ,UAAU,YAAY,SACtC,UAAS,MAAM,QAAQ,MAAM;GAE/B;AAEF,SAAM,gBAAgB,WAAW,UAAU;AACzC,MAAI,MAAM,QAAQ,UAAU,YAAY,SACtC,UAAS,MAAM,QAAQ,UAAU;GAEnC;AAGF,QAAO,eACE;EACL;EACA;EACA;EACA,WAAW,CAAC,CAAC,cAAc;EAC3B,iBAAiB,cAAc,mBAAmB;EACnD,GACD;EAAC;EAAc;EAAM;EAAO,CAC7B"}
@@ -0,0 +1,147 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ 'use client';
15
+
16
+ import { DEFAULT_STYLE_PROPERTIES } from "../../shared/constants.js";
17
+ import { ShapeFeatureType } from "../../shared/types.js";
18
+ import { DEFAULT_DISTANCE_UNITS } from "../../../../shared/units.js";
19
+ import { getLogger } from "@accelint/logger";
20
+ import { uuid } from "@accelint/core";
21
+ import { centroid, distance } from "@turf/turf";
22
+
23
+ //#region src/deckgl/shapes/draw-shape-layer/utils/feature-conversion.ts
24
+ const logger = getLogger({
25
+ enabled: process.env.NODE_ENV !== "production",
26
+ level: "warn",
27
+ prefix: "[FeatureConversion]",
28
+ pretty: true
29
+ });
30
+ /**
31
+ * Generate a default name for a shape based on its type
32
+ */
33
+ function generateShapeName(shape) {
34
+ return `New ${shape} (${(/* @__PURE__ */ new Date()).toLocaleTimeString()})`;
35
+ }
36
+ /**
37
+ * Compute circle properties from a polygon geometry (circle approximation)
38
+ *
39
+ * The EditableGeoJsonLayer creates circles as polygon approximations.
40
+ * This function extracts the center and radius from that polygon.
41
+ */
42
+ function computeCircleProperties(geometry) {
43
+ const coordinates = geometry.coordinates[0];
44
+ if (!coordinates || coordinates.length < 3) {
45
+ logger.warn("Cannot compute circle properties: polygon has insufficient coordinates");
46
+ return;
47
+ }
48
+ const center = centroid({
49
+ type: "Polygon",
50
+ coordinates: geometry.coordinates
51
+ }).geometry.coordinates;
52
+ if (!(Number.isFinite(center[0]) && Number.isFinite(center[1]))) {
53
+ logger.warn("Cannot compute circle properties: invalid center coordinates");
54
+ return;
55
+ }
56
+ const firstPoint = coordinates[0];
57
+ if (!(firstPoint && Number.isFinite(firstPoint[0]) && Number.isFinite(firstPoint[1]))) {
58
+ logger.warn("Cannot compute circle properties: invalid edge point coordinates");
59
+ return;
60
+ }
61
+ const radius = distance(center, firstPoint, { units: DEFAULT_DISTANCE_UNITS });
62
+ if (!Number.isFinite(radius) || radius <= 0) {
63
+ logger.warn("Cannot compute circle properties: invalid radius computed");
64
+ return;
65
+ }
66
+ return {
67
+ center,
68
+ radius: {
69
+ value: radius,
70
+ units: DEFAULT_DISTANCE_UNITS
71
+ }
72
+ };
73
+ }
74
+ /**
75
+ * Compute ellipse properties from a feature's editProperties
76
+ *
77
+ * The DrawEllipseUsingThreePointsMode attaches ellipse metadata to the feature's
78
+ * properties.editProperties. This function extracts and normalizes that data.
79
+ */
80
+ function computeEllipseProperties(feature) {
81
+ const editProps = feature.properties?.editProperties;
82
+ if (!editProps || editProps.shape !== "Ellipse") {
83
+ logger.warn("Cannot compute ellipse properties: feature missing editProperties or not an ellipse");
84
+ return;
85
+ }
86
+ return {
87
+ center: editProps.center,
88
+ xSemiAxis: {
89
+ value: editProps.xSemiAxis.value,
90
+ units: DEFAULT_DISTANCE_UNITS
91
+ },
92
+ ySemiAxis: {
93
+ value: editProps.ySemiAxis.value,
94
+ units: DEFAULT_DISTANCE_UNITS
95
+ },
96
+ angle: editProps.angle
97
+ };
98
+ }
99
+ /**
100
+ * Convert a raw GeoJSON Feature from EditableGeoJsonLayer to a Shape
101
+ *
102
+ * The returned Shape includes:
103
+ * - Auto-generated UUID
104
+ * - Auto-generated name with timestamp (e.g., "New Polygon (2:30:45 PM)")
105
+ * - Merged style properties (defaults + overrides)
106
+ * - Circle/ellipse properties computed from geometry if applicable
107
+ * - `lastUpdated` timestamp
108
+ * - `locked: false` (newly created shapes are always unlocked)
109
+ *
110
+ * @param feature - The raw GeoJSON feature from the editable layer
111
+ * @param shape - The type of shape being created
112
+ * @param styleDefaults - Optional style overrides
113
+ * @returns A complete Shape ready for use
114
+ */
115
+ function convertFeatureToShape(feature, shape, styleDefaults) {
116
+ const id = uuid();
117
+ const name = generateShapeName(shape);
118
+ const styleProperties = {
119
+ ...DEFAULT_STYLE_PROPERTIES,
120
+ ...styleDefaults ?? {}
121
+ };
122
+ let circleProperties;
123
+ if (shape === ShapeFeatureType.Circle && feature.geometry.type === "Polygon") circleProperties = computeCircleProperties(feature.geometry);
124
+ let ellipseProperties;
125
+ if (shape === ShapeFeatureType.Ellipse && feature.geometry.type === "Polygon") ellipseProperties = computeEllipseProperties(feature);
126
+ return {
127
+ id,
128
+ name,
129
+ shape,
130
+ feature: {
131
+ type: "Feature",
132
+ geometry: feature.geometry,
133
+ properties: {
134
+ styleProperties,
135
+ circleProperties,
136
+ ellipseProperties,
137
+ shapeId: id
138
+ }
139
+ },
140
+ lastUpdated: Date.now(),
141
+ locked: false
142
+ };
143
+ }
144
+
145
+ //#endregion
146
+ export { convertFeatureToShape };
147
+ //# sourceMappingURL=feature-conversion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature-conversion.js","names":["styleProperties: StyleProperties","circleProperties: CircleProperties | undefined","ShapeFeatureTypeEnum","ellipseProperties: EllipseProperties | undefined"],"sources":["../../../../../src/deckgl/shapes/draw-shape-layer/utils/feature-conversion.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport { uuid } from '@accelint/core';\nimport { getLogger } from '@accelint/logger';\nimport { centroid, distance } from '@turf/turf';\nimport { DEFAULT_DISTANCE_UNITS } from '@/shared/units';\nimport { DEFAULT_STYLE_PROPERTIES } from '../../shared/constants';\nimport {\n type CircleProperties,\n type EllipseProperties,\n type Shape,\n type ShapeFeature,\n type ShapeFeatureType,\n ShapeFeatureType as ShapeFeatureTypeEnum,\n type StyleProperties,\n} from '../../shared/types';\nimport type { Feature, Polygon, Position } from 'geojson';\n\nconst logger = getLogger({\n enabled: process.env.NODE_ENV !== 'production',\n level: 'warn',\n prefix: '[FeatureConversion]',\n pretty: true,\n});\n\n/**\n * Generate a default name for a shape based on its type\n */\nfunction generateShapeName(shape: ShapeFeatureType): string {\n const timestamp = new Date().toLocaleTimeString();\n return `New ${shape} (${timestamp})`;\n}\n\n/**\n * Compute circle properties from a polygon geometry (circle approximation)\n *\n * The EditableGeoJsonLayer creates circles as polygon approximations.\n * This function extracts the center and radius from that polygon.\n */\nfunction computeCircleProperties(\n geometry: Polygon,\n): CircleProperties | undefined {\n const coordinates = geometry.coordinates[0];\n if (!coordinates || coordinates.length < 3) {\n logger.warn(\n 'Cannot compute circle properties: polygon has insufficient coordinates',\n );\n return undefined;\n }\n\n // Calculate center using turf centroid\n const centerFeature = centroid({\n type: 'Polygon',\n coordinates: geometry.coordinates,\n });\n const center = centerFeature.geometry.coordinates as [number, number];\n\n // Validate center coordinates are valid numbers\n const isCenterValid =\n Number.isFinite(center[0]) && Number.isFinite(center[1]);\n if (!isCenterValid) {\n logger.warn('Cannot compute circle properties: invalid center coordinates');\n return undefined;\n }\n\n // Calculate radius as distance from center to first point\n const firstPoint = coordinates[0] as Position;\n\n // Validate first point coordinates\n const isFirstPointValid =\n firstPoint &&\n Number.isFinite(firstPoint[0]) &&\n Number.isFinite(firstPoint[1]);\n if (!isFirstPointValid) {\n logger.warn(\n 'Cannot compute circle properties: invalid edge point coordinates',\n );\n return undefined;\n }\n\n const radius = distance(center, firstPoint, {\n units: DEFAULT_DISTANCE_UNITS,\n });\n\n // Validate computed radius\n if (!Number.isFinite(radius) || radius <= 0) {\n logger.warn('Cannot compute circle properties: invalid radius computed');\n return undefined;\n }\n\n return {\n center,\n radius: {\n value: radius,\n units: DEFAULT_DISTANCE_UNITS,\n },\n };\n}\n\n/**\n * Edit properties attached by DrawEllipseUsingThreePointsMode\n */\ninterface EllipseEditProperties {\n shape: 'Ellipse';\n xSemiAxis: { value: number; unit: string };\n ySemiAxis: { value: number; unit: string };\n angle: number;\n center: [number, number];\n}\n\n/**\n * Compute ellipse properties from a feature's editProperties\n *\n * The DrawEllipseUsingThreePointsMode attaches ellipse metadata to the feature's\n * properties.editProperties. This function extracts and normalizes that data.\n */\nfunction computeEllipseProperties(\n feature: Feature,\n): EllipseProperties | undefined {\n const editProps = (\n feature.properties as { editProperties?: EllipseEditProperties } | null\n )?.editProperties;\n\n if (!editProps || editProps.shape !== 'Ellipse') {\n logger.warn(\n 'Cannot compute ellipse properties: feature missing editProperties or not an ellipse',\n );\n return undefined;\n }\n\n return {\n center: editProps.center,\n xSemiAxis: {\n value: editProps.xSemiAxis.value,\n units: DEFAULT_DISTANCE_UNITS,\n },\n ySemiAxis: {\n value: editProps.ySemiAxis.value,\n units: DEFAULT_DISTANCE_UNITS,\n },\n angle: editProps.angle,\n };\n}\n\n/**\n * Convert a raw GeoJSON Feature from EditableGeoJsonLayer to a Shape\n *\n * The returned Shape includes:\n * - Auto-generated UUID\n * - Auto-generated name with timestamp (e.g., \"New Polygon (2:30:45 PM)\")\n * - Merged style properties (defaults + overrides)\n * - Circle/ellipse properties computed from geometry if applicable\n * - `lastUpdated` timestamp\n * - `locked: false` (newly created shapes are always unlocked)\n *\n * @param feature - The raw GeoJSON feature from the editable layer\n * @param shape - The type of shape being created\n * @param styleDefaults - Optional style overrides\n * @returns A complete Shape ready for use\n */\nexport function convertFeatureToShape(\n feature: Feature,\n shape: ShapeFeatureType,\n styleDefaults?: Partial<StyleProperties> | null,\n): Shape {\n const id = uuid();\n const name = generateShapeName(shape);\n\n // Merge default styles with any provided defaults\n const styleProperties: StyleProperties = {\n ...DEFAULT_STYLE_PROPERTIES,\n ...(styleDefaults ?? {}),\n };\n\n // Compute circle properties if this is a circle\n let circleProperties: CircleProperties | undefined;\n if (\n shape === ShapeFeatureTypeEnum.Circle &&\n feature.geometry.type === 'Polygon'\n ) {\n circleProperties = computeCircleProperties(feature.geometry);\n }\n\n // Compute ellipse properties if this is an ellipse\n let ellipseProperties: EllipseProperties | undefined;\n if (\n shape === ShapeFeatureTypeEnum.Ellipse &&\n feature.geometry.type === 'Polygon'\n ) {\n ellipseProperties = computeEllipseProperties(feature);\n }\n\n // Create the styled feature\n const styledFeature: ShapeFeature = {\n type: 'Feature',\n geometry: feature.geometry,\n properties: {\n styleProperties,\n circleProperties,\n ellipseProperties,\n shapeId: id,\n },\n };\n\n // Type assertion needed because TypeScript can't narrow the return type\n // based on the runtime shape value. The constructed object satisfies\n // the Shape union at runtime based on which shape was passed in.\n return {\n id,\n name,\n shape,\n feature: styledFeature,\n lastUpdated: Date.now(),\n locked: false,\n } as Shape;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAM,SAAS,UAAU;CACvB,SAAS,QAAQ,IAAI,aAAa;CAClC,OAAO;CACP,QAAQ;CACR,QAAQ;CACT,CAAC;;;;AAKF,SAAS,kBAAkB,OAAiC;AAE1D,QAAO,OAAO,MAAM,qBADF,IAAI,MAAM,EAAC,oBAAoB,CACf;;;;;;;;AASpC,SAAS,wBACP,UAC8B;CAC9B,MAAM,cAAc,SAAS,YAAY;AACzC,KAAI,CAAC,eAAe,YAAY,SAAS,GAAG;AAC1C,SAAO,KACL,yEACD;AACD;;CAQF,MAAM,SAJgB,SAAS;EAC7B,MAAM;EACN,aAAa,SAAS;EACvB,CAAC,CAC2B,SAAS;AAKtC,KAAI,EADF,OAAO,SAAS,OAAO,GAAG,IAAI,OAAO,SAAS,OAAO,GAAG,GACtC;AAClB,SAAO,KAAK,+DAA+D;AAC3E;;CAIF,MAAM,aAAa,YAAY;AAO/B,KAAI,EAHF,cACA,OAAO,SAAS,WAAW,GAAG,IAC9B,OAAO,SAAS,WAAW,GAAG,GACR;AACtB,SAAO,KACL,mEACD;AACD;;CAGF,MAAM,SAAS,SAAS,QAAQ,YAAY,EAC1C,OAAO,wBACR,CAAC;AAGF,KAAI,CAAC,OAAO,SAAS,OAAO,IAAI,UAAU,GAAG;AAC3C,SAAO,KAAK,4DAA4D;AACxE;;AAGF,QAAO;EACL;EACA,QAAQ;GACN,OAAO;GACP,OAAO;GACR;EACF;;;;;;;;AAoBH,SAAS,yBACP,SAC+B;CAC/B,MAAM,YACJ,QAAQ,YACP;AAEH,KAAI,CAAC,aAAa,UAAU,UAAU,WAAW;AAC/C,SAAO,KACL,sFACD;AACD;;AAGF,QAAO;EACL,QAAQ,UAAU;EAClB,WAAW;GACT,OAAO,UAAU,UAAU;GAC3B,OAAO;GACR;EACD,WAAW;GACT,OAAO,UAAU,UAAU;GAC3B,OAAO;GACR;EACD,OAAO,UAAU;EAClB;;;;;;;;;;;;;;;;;;AAmBH,SAAgB,sBACd,SACA,OACA,eACO;CACP,MAAM,KAAK,MAAM;CACjB,MAAM,OAAO,kBAAkB,MAAM;CAGrC,MAAMA,kBAAmC;EACvC,GAAG;EACH,GAAI,iBAAiB,EAAE;EACxB;CAGD,IAAIC;AACJ,KACE,UAAUC,iBAAqB,UAC/B,QAAQ,SAAS,SAAS,UAE1B,oBAAmB,wBAAwB,QAAQ,SAAS;CAI9D,IAAIC;AACJ,KACE,UAAUD,iBAAqB,WAC/B,QAAQ,SAAS,SAAS,UAE1B,qBAAoB,yBAAyB,QAAQ;AAkBvD,QAAO;EACL;EACA;EACA;EACA,SAlBkC;GAClC,MAAM;GACN,UAAU,QAAQ;GAClB,YAAY;IACV;IACA;IACA;IACA,SAAS;IACV;GACF;EAUC,aAAa,KAAK,KAAK;EACvB,QAAQ;EACT"}
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ 'use client';
15
+
16
+ import { COMPLETION_EDIT_TYPES, CONTINUOUS_EDIT_TYPES } from "../shared/constants.js";
17
+
18
+ //#region src/deckgl/shapes/edit-shape-layer/constants.ts
19
+ /**
20
+ * Mode name for the map-mode integration
21
+ */
22
+ const EDIT_SHAPE_MODE = "edit-shape";
23
+ /**
24
+ * Identifier for the edit shape layer.
25
+ * Used as the owner for map-mode/cursor and as the default layer ID.
26
+ */
27
+ const EDIT_SHAPE_LAYER_ID = "edit-shape-layer";
28
+ /**
29
+ * Cursor mapping for each edit mode
30
+ */
31
+ const EDIT_CURSOR_MAP = {
32
+ view: "default",
33
+ "bounding-transform": "crosshair",
34
+ "vertex-transform": "crosshair",
35
+ "circle-transform": "crosshair",
36
+ translate: "crosshair"
37
+ };
38
+
39
+ //#endregion
40
+ export { EDIT_CURSOR_MAP, EDIT_SHAPE_LAYER_ID, EDIT_SHAPE_MODE };
41
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","names":["EDIT_CURSOR_MAP: Record<EditMode, CSSCursorType>"],"sources":["../../../../src/deckgl/shapes/edit-shape-layer/constants.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport type { CSSCursorType } from '@/map-cursor/types';\nimport type { EditMode } from './types';\n\n// Re-export edit event type sets from shared constants\nexport {\n COMPLETION_EDIT_TYPES,\n CONTINUOUS_EDIT_TYPES,\n} from '../shared/constants';\n\n/**\n * Mode name for the map-mode integration\n */\nexport const EDIT_SHAPE_MODE = 'edit-shape';\n\n/**\n * Identifier for the edit shape layer.\n * Used as the owner for map-mode/cursor and as the default layer ID.\n */\nexport const EDIT_SHAPE_LAYER_ID = 'edit-shape-layer';\n\n/**\n * Cursor mapping for each edit mode\n */\nexport const EDIT_CURSOR_MAP: Record<EditMode, CSSCursorType> = {\n view: 'default',\n 'bounding-transform': 'crosshair',\n 'vertex-transform': 'crosshair',\n 'circle-transform': 'crosshair',\n translate: 'crosshair',\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,kBAAkB;;;;;AAM/B,MAAa,sBAAsB;;;;AAKnC,MAAaA,kBAAmD;CAC9D,MAAM;CACN,sBAAsB;CACtB,oBAAoB;CACpB,oBAAoB;CACpB,WAAW;CACZ"}
@@ -0,0 +1,92 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { Shape } from "../shared/types.js";
14
+ import { UniqueId } from "@accelint/core";
15
+
16
+ //#region src/deckgl/shapes/edit-shape-layer/events.d.ts
17
+ /**
18
+ * Edit shape lifecycle events
19
+ */
20
+ declare const EditShapeEvents: {
21
+ /** Editing has started for a shape */
22
+ readonly editing: "shapes:editing";
23
+ /** Shape has been successfully updated */
24
+ readonly updated: "shapes:updated";
25
+ /** Editing was canceled */
26
+ readonly canceled: "shapes:edit-canceled";
27
+ };
28
+ type EditShapeEventType = (typeof EditShapeEvents)[keyof typeof EditShapeEvents];
29
+ /**
30
+ * Payload for shapes:editing event.
31
+ */
32
+ type ShapeEditingPayload = {
33
+ /** The shape being edited */
34
+ shape: Shape;
35
+ /** Map instance ID for multi-map event isolation */
36
+ mapId: UniqueId;
37
+ };
38
+ /**
39
+ * Event payload for shapes:editing
40
+ * Emitted when editing starts
41
+ */
42
+ type ShapeEditingEvent = {
43
+ type: 'shapes:editing';
44
+ payload: ShapeEditingPayload;
45
+ source: UniqueId;
46
+ target?: UniqueId;
47
+ };
48
+ /**
49
+ * Payload for shapes:updated event.
50
+ */
51
+ type ShapeUpdatedPayload = {
52
+ /** The updated shape with new geometry */
53
+ shape: Shape;
54
+ /** Map instance ID for multi-map event isolation */
55
+ mapId: UniqueId;
56
+ };
57
+ /**
58
+ * Event payload for shapes:updated
59
+ * Emitted when shape edits are saved
60
+ */
61
+ type ShapeUpdatedEvent = {
62
+ type: 'shapes:updated';
63
+ payload: ShapeUpdatedPayload;
64
+ source: UniqueId;
65
+ target?: UniqueId;
66
+ };
67
+ /**
68
+ * Payload for shapes:edit-canceled event.
69
+ */
70
+ type ShapeEditCanceledPayload = {
71
+ /** The shape that was being edited (original, unchanged) */
72
+ shape: Shape;
73
+ /** Map instance ID for multi-map event isolation */
74
+ mapId: UniqueId;
75
+ };
76
+ /**
77
+ * Event payload for shapes:edit-canceled
78
+ * Emitted when editing is canceled
79
+ */
80
+ type ShapeEditCanceledEvent = {
81
+ type: 'shapes:edit-canceled';
82
+ payload: ShapeEditCanceledPayload;
83
+ source: UniqueId;
84
+ target?: UniqueId;
85
+ };
86
+ /**
87
+ * Union of all edit shape event types
88
+ */
89
+ type EditShapeEvent = ShapeEditingEvent | ShapeUpdatedEvent | ShapeEditCanceledEvent;
90
+ //#endregion
91
+ export { EditShapeEvent, EditShapeEventType, EditShapeEvents, ShapeEditCanceledEvent, ShapeEditCanceledPayload, ShapeEditingEvent, ShapeEditingPayload, ShapeUpdatedEvent, ShapeUpdatedPayload };
92
+ //# sourceMappingURL=events.d.ts.map