@accelint/map-toolkit 0.5.0 → 1.0.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 (273) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/catalog-info.yaml +6 -3
  3. package/dist/camera/index.d.ts +2 -2
  4. package/dist/camera/index.js +2 -2
  5. package/dist/camera/store.d.ts +120 -0
  6. package/dist/camera/store.js +279 -0
  7. package/dist/camera/store.js.map +1 -0
  8. package/dist/deckgl/base-map/constants.d.ts +9 -7
  9. package/dist/deckgl/base-map/constants.js +9 -7
  10. package/dist/deckgl/base-map/constants.js.map +1 -1
  11. package/dist/deckgl/base-map/controls.js +2 -0
  12. package/dist/deckgl/base-map/controls.js.map +1 -1
  13. package/dist/deckgl/base-map/index.d.ts +2 -0
  14. package/dist/deckgl/base-map/index.js +14 -16
  15. package/dist/deckgl/base-map/index.js.map +1 -1
  16. package/dist/deckgl/base-map/provider.js +1 -1
  17. package/dist/deckgl/base-map/types.d.ts +6 -1
  18. package/dist/deckgl/index.d.ts +8 -2
  19. package/dist/deckgl/index.js +6 -2
  20. package/dist/deckgl/saved-viewports/index.d.ts +1 -1
  21. package/dist/deckgl/saved-viewports/index.js +1 -2
  22. package/dist/deckgl/saved-viewports/index.js.map +1 -1
  23. package/dist/deckgl/saved-viewports/storage.js +10 -2
  24. package/dist/deckgl/saved-viewports/storage.js.map +1 -1
  25. package/dist/deckgl/shapes/display-shape-layer/constants.js +58 -0
  26. package/dist/deckgl/shapes/display-shape-layer/constants.js.map +1 -0
  27. package/dist/{node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/assert.js → deckgl/shapes/display-shape-layer/fiber.d.ts} +11 -7
  28. package/dist/{packages/hotkey-manager/dist/lib/is-client/index.js → deckgl/shapes/display-shape-layer/fiber.js} +6 -7
  29. package/dist/deckgl/shapes/display-shape-layer/fiber.js.map +1 -0
  30. package/dist/deckgl/shapes/display-shape-layer/index.d.ts +210 -0
  31. package/dist/deckgl/shapes/display-shape-layer/index.js +449 -0
  32. package/dist/deckgl/shapes/display-shape-layer/index.js.map +1 -0
  33. package/dist/deckgl/shapes/display-shape-layer/shape-label-layer.js +102 -0
  34. package/dist/deckgl/shapes/display-shape-layer/shape-label-layer.js.map +1 -0
  35. package/dist/deckgl/shapes/display-shape-layer/store.js +102 -0
  36. package/dist/deckgl/shapes/display-shape-layer/store.js.map +1 -0
  37. package/dist/deckgl/shapes/display-shape-layer/types.d.ts +126 -0
  38. package/dist/{node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/layer.js → deckgl/shapes/display-shape-layer/types.js} +0 -3
  39. package/dist/deckgl/shapes/display-shape-layer/use-select-shape.d.ts +89 -0
  40. package/dist/deckgl/shapes/display-shape-layer/use-select-shape.js +88 -0
  41. package/dist/deckgl/shapes/display-shape-layer/use-select-shape.js.map +1 -0
  42. package/dist/deckgl/shapes/display-shape-layer/utils/display-style.js +50 -0
  43. package/dist/deckgl/shapes/display-shape-layer/utils/display-style.js.map +1 -0
  44. package/dist/deckgl/shapes/display-shape-layer/utils/labels.d.ts +133 -0
  45. package/dist/deckgl/shapes/display-shape-layer/utils/labels.js +250 -0
  46. package/dist/deckgl/shapes/display-shape-layer/utils/labels.js.map +1 -0
  47. package/dist/deckgl/shapes/draw-shape-layer/constants.js +46 -0
  48. package/dist/deckgl/shapes/draw-shape-layer/constants.js.map +1 -0
  49. package/dist/deckgl/shapes/draw-shape-layer/events.d.ts +92 -0
  50. package/dist/deckgl/shapes/draw-shape-layer/events.js +56 -0
  51. package/dist/deckgl/shapes/draw-shape-layer/events.js.map +1 -0
  52. package/dist/deckgl/shapes/draw-shape-layer/fiber.d.ts +11 -0
  53. package/dist/{node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/get-bounds.js → deckgl/shapes/draw-shape-layer/fiber.js} +5 -4
  54. package/dist/deckgl/shapes/draw-shape-layer/fiber.js.map +1 -0
  55. package/dist/deckgl/shapes/draw-shape-layer/index.d.ts +53 -0
  56. package/dist/deckgl/shapes/draw-shape-layer/index.js +95 -0
  57. package/dist/deckgl/shapes/draw-shape-layer/index.js.map +1 -0
  58. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-circle-mode-with-tooltip.js +51 -0
  59. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-circle-mode-with-tooltip.js.map +1 -0
  60. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-ellipse-mode-with-tooltip.js +73 -0
  61. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-ellipse-mode-with-tooltip.js.map +1 -0
  62. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-line-string-mode-with-tooltip.js +87 -0
  63. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-line-string-mode-with-tooltip.js.map +1 -0
  64. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-polygon-mode-with-tooltip.js +88 -0
  65. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-polygon-mode-with-tooltip.js.map +1 -0
  66. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-rectangle-mode-with-tooltip.js +77 -0
  67. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-rectangle-mode-with-tooltip.js.map +1 -0
  68. package/dist/deckgl/shapes/draw-shape-layer/modes/index.js +64 -0
  69. package/dist/deckgl/shapes/draw-shape-layer/modes/index.js.map +1 -0
  70. package/dist/deckgl/shapes/draw-shape-layer/store.js +175 -0
  71. package/dist/deckgl/shapes/draw-shape-layer/store.js.map +1 -0
  72. package/dist/deckgl/shapes/draw-shape-layer/types.d.ts +86 -0
  73. package/dist/{node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/fly-to-viewport.js → deckgl/shapes/draw-shape-layer/types.js} +1 -1
  74. package/dist/deckgl/shapes/draw-shape-layer/use-draw-shape.d.ts +82 -0
  75. package/dist/deckgl/shapes/draw-shape-layer/use-draw-shape.js +112 -0
  76. package/dist/deckgl/shapes/draw-shape-layer/use-draw-shape.js.map +1 -0
  77. package/dist/deckgl/shapes/draw-shape-layer/utils/feature-conversion.js +147 -0
  78. package/dist/deckgl/shapes/draw-shape-layer/utils/feature-conversion.js.map +1 -0
  79. package/dist/deckgl/shapes/edit-shape-layer/constants.js +41 -0
  80. package/dist/deckgl/shapes/edit-shape-layer/constants.js.map +1 -0
  81. package/dist/deckgl/shapes/edit-shape-layer/events.d.ts +92 -0
  82. package/dist/deckgl/shapes/edit-shape-layer/events.js +56 -0
  83. package/dist/deckgl/shapes/edit-shape-layer/events.js.map +1 -0
  84. package/dist/deckgl/shapes/edit-shape-layer/fiber.d.ts +13 -0
  85. package/dist/{node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/web-mercator-viewport.js → deckgl/shapes/edit-shape-layer/fiber.js} +1 -3
  86. package/dist/deckgl/shapes/edit-shape-layer/index.d.ts +63 -0
  87. package/dist/deckgl/shapes/edit-shape-layer/index.js +162 -0
  88. package/dist/deckgl/shapes/edit-shape-layer/index.js.map +1 -0
  89. package/dist/deckgl/shapes/edit-shape-layer/modes/base-transform-mode.js +154 -0
  90. package/dist/deckgl/shapes/edit-shape-layer/modes/base-transform-mode.js.map +1 -0
  91. package/dist/deckgl/shapes/edit-shape-layer/modes/bounding-transform-mode.js +147 -0
  92. package/dist/deckgl/shapes/edit-shape-layer/modes/bounding-transform-mode.js.map +1 -0
  93. package/dist/deckgl/shapes/edit-shape-layer/modes/circle-transform-mode.js +87 -0
  94. package/dist/deckgl/shapes/edit-shape-layer/modes/circle-transform-mode.js.map +1 -0
  95. package/dist/deckgl/shapes/edit-shape-layer/modes/index.js +61 -0
  96. package/dist/deckgl/shapes/edit-shape-layer/modes/index.js.map +1 -0
  97. package/dist/deckgl/shapes/edit-shape-layer/modes/rotate-mode-with-snap.js +109 -0
  98. package/dist/deckgl/shapes/edit-shape-layer/modes/rotate-mode-with-snap.js.map +1 -0
  99. package/dist/deckgl/shapes/edit-shape-layer/modes/scale-mode-with-free-transform.js +289 -0
  100. package/dist/deckgl/shapes/edit-shape-layer/modes/scale-mode-with-free-transform.js.map +1 -0
  101. package/dist/deckgl/shapes/edit-shape-layer/modes/vertex-transform-mode.js +121 -0
  102. package/dist/deckgl/shapes/edit-shape-layer/modes/vertex-transform-mode.js.map +1 -0
  103. package/dist/deckgl/shapes/edit-shape-layer/store.js +194 -0
  104. package/dist/deckgl/shapes/edit-shape-layer/store.js.map +1 -0
  105. package/dist/deckgl/shapes/edit-shape-layer/types.d.ts +93 -0
  106. package/dist/{node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/normalize-viewport-props.js → deckgl/shapes/edit-shape-layer/types.js} +1 -1
  107. package/dist/deckgl/shapes/edit-shape-layer/use-edit-shape.d.ts +82 -0
  108. package/dist/deckgl/shapes/edit-shape-layer/use-edit-shape.js +114 -0
  109. package/dist/deckgl/shapes/edit-shape-layer/use-edit-shape.js.map +1 -0
  110. package/dist/deckgl/shapes/index.d.ts +29 -0
  111. package/dist/deckgl/shapes/index.js +27 -0
  112. package/dist/deckgl/shapes/shared/constants.d.ts +73 -0
  113. package/dist/deckgl/shapes/shared/constants.js +273 -0
  114. package/dist/deckgl/shapes/shared/constants.js.map +1 -0
  115. package/dist/deckgl/shapes/shared/events.d.ts +54 -0
  116. package/dist/{packages/hotkey-manager/dist/lib/is-mac/index.js → deckgl/shapes/shared/events.js} +10 -6
  117. package/dist/deckgl/shapes/shared/events.js.map +1 -0
  118. package/dist/deckgl/shapes/shared/hooks/use-shift-zoom-disable.js +84 -0
  119. package/dist/deckgl/shapes/shared/hooks/use-shift-zoom-disable.js.map +1 -0
  120. package/dist/deckgl/shapes/shared/types.d.ts +317 -0
  121. package/dist/deckgl/shapes/shared/types.js +83 -0
  122. package/dist/deckgl/shapes/shared/types.js.map +1 -0
  123. package/dist/deckgl/shapes/shared/utils/geometry-measurements.js +128 -0
  124. package/dist/deckgl/shapes/shared/utils/geometry-measurements.js.map +1 -0
  125. package/dist/deckgl/shapes/shared/utils/layer-config.js +50 -0
  126. package/dist/deckgl/shapes/shared/utils/layer-config.js.map +1 -0
  127. package/dist/deckgl/shapes/shared/utils/mode-utils.js +113 -0
  128. package/dist/deckgl/shapes/shared/utils/mode-utils.js.map +1 -0
  129. package/dist/deckgl/shapes/shared/utils/pick-filtering.js +57 -0
  130. package/dist/deckgl/shapes/shared/utils/pick-filtering.js.map +1 -0
  131. package/dist/deckgl/shapes/shared/utils/style-utils.d.ts +64 -0
  132. package/dist/deckgl/shapes/shared/utils/style-utils.js +101 -0
  133. package/dist/deckgl/shapes/shared/utils/style-utils.js.map +1 -0
  134. package/dist/deckgl/symbol-layer/index.d.ts +1 -1
  135. package/dist/deckgl/text-layer/default-settings.js +4 -24
  136. package/dist/deckgl/text-layer/default-settings.js.map +1 -1
  137. package/dist/deckgl/text-settings.d.ts +77 -0
  138. package/dist/deckgl/text-settings.js +83 -0
  139. package/dist/deckgl/text-settings.js.map +1 -0
  140. package/dist/map-cursor/index.d.ts +2 -2
  141. package/dist/map-cursor/index.js +2 -2
  142. package/dist/map-cursor/store.d.ts +32 -61
  143. package/dist/map-cursor/store.js +165 -294
  144. package/dist/map-cursor/store.js.map +1 -1
  145. package/dist/map-cursor/use-map-cursor.d.ts +5 -2
  146. package/dist/map-cursor/use-map-cursor.js +33 -15
  147. package/dist/map-cursor/use-map-cursor.js.map +1 -1
  148. package/dist/map-mode/index.d.ts +2 -2
  149. package/dist/map-mode/index.js +2 -2
  150. package/dist/map-mode/store.d.ts +36 -37
  151. package/dist/map-mode/store.js +131 -237
  152. package/dist/map-mode/store.js.map +1 -1
  153. package/dist/map-mode/use-map-mode.js +6 -5
  154. package/dist/map-mode/use-map-mode.js.map +1 -1
  155. package/dist/maplibre/index.d.ts +2 -2
  156. package/dist/maplibre/index.js +2 -2
  157. package/dist/shared/constants.d.ts +19 -0
  158. package/dist/{maplibre → shared}/constants.js +9 -3
  159. package/dist/shared/constants.js.map +1 -0
  160. package/dist/shared/create-map-store.d.ts +202 -0
  161. package/dist/shared/create-map-store.js +223 -0
  162. package/dist/shared/create-map-store.js.map +1 -0
  163. package/dist/shared/units.d.ts +39 -0
  164. package/dist/shared/units.js +49 -0
  165. package/dist/shared/units.js.map +1 -0
  166. package/dist/viewport/index.d.ts +3 -3
  167. package/dist/viewport/index.js +3 -3
  168. package/dist/viewport/store.d.ts +69 -0
  169. package/dist/viewport/store.js +125 -0
  170. package/dist/viewport/store.js.map +1 -0
  171. package/dist/viewport/types.d.ts +2 -2
  172. package/dist/viewport/utils.js +2 -2
  173. package/dist/viewport/utils.js.map +1 -1
  174. package/dist/viewport/viewport-size.js +2 -2
  175. package/dist/viewport/viewport-size.js.map +1 -1
  176. package/package.json +60 -26
  177. package/dist/_virtual/rolldown_runtime.js +0 -22
  178. package/dist/camera/use-camera-state.d.ts +0 -153
  179. package/dist/camera/use-camera-state.js +0 -419
  180. package/dist/camera/use-camera-state.js.map +0 -1
  181. package/dist/decorators/deckgl.d.ts +0 -19
  182. package/dist/decorators/deckgl.js +0 -32
  183. package/dist/decorators/deckgl.js.map +0 -1
  184. package/dist/maplibre/constants.d.ts +0 -13
  185. package/dist/maplibre/constants.js.map +0 -1
  186. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/assert.js.map +0 -1
  187. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/fit-bounds.js +0 -63
  188. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/fit-bounds.js.map +0 -1
  189. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/get-bounds.js.map +0 -1
  190. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/index.js +0 -19
  191. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/math-utils.js +0 -25
  192. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/math-utils.js.map +0 -1
  193. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/web-mercator-utils.js +0 -59
  194. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/web-mercator-utils.js.map +0 -1
  195. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/attribution-control.js +0 -29
  196. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/attribution-control.js.map +0 -1
  197. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/fullscreen-control.js +0 -29
  198. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/fullscreen-control.js.map +0 -1
  199. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/geolocate-control.js +0 -54
  200. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/geolocate-control.js.map +0 -1
  201. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/logo-control.js +0 -29
  202. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/logo-control.js.map +0 -1
  203. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/map.js +0 -91
  204. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/map.js.map +0 -1
  205. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/marker.js +0 -88
  206. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/marker.js.map +0 -1
  207. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/navigation-control.js +0 -29
  208. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/navigation-control.js.map +0 -1
  209. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/popup.js +0 -69
  210. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/popup.js.map +0 -1
  211. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/scale-control.js +0 -35
  212. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/scale-control.js.map +0 -1
  213. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/source.js +0 -15
  214. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/terrain-control.js +0 -29
  215. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/terrain-control.js.map +0 -1
  216. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/use-control.js +0 -40
  217. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/use-control.js.map +0 -1
  218. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/use-map.js +0 -23
  219. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/use-map.js.map +0 -1
  220. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/index.js +0 -27
  221. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/maplibre/create-ref.js +0 -57
  222. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/maplibre/create-ref.js.map +0 -1
  223. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/maplibre/maplibre.js +0 -343
  224. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/maplibre/maplibre.js.map +0 -1
  225. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/apply-react-style.js +0 -28
  226. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/apply-react-style.js.map +0 -1
  227. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/compare-class-names.js +0 -31
  228. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/compare-class-names.js.map +0 -1
  229. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/deep-equal.js +0 -57
  230. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/deep-equal.js.map +0 -1
  231. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/set-globals.js +0 -30
  232. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/set-globals.js.map +0 -1
  233. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/style-utils.js +0 -53
  234. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/style-utils.js.map +0 -1
  235. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/transform.js +0 -52
  236. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/transform.js.map +0 -1
  237. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/use-isomorphic-layout-effect.js +0 -22
  238. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/use-isomorphic-layout-effect.js.map +0 -1
  239. package/dist/node_modules/.pnpm/immer@10.2.0/node_modules/immer/dist/immer.js +0 -812
  240. package/dist/node_modules/.pnpm/immer@10.2.0/node_modules/immer/dist/immer.js.map +0 -1
  241. package/dist/node_modules/.pnpm/radashi@12.7.1/node_modules/radashi/dist/radashi.js +0 -35
  242. package/dist/node_modules/.pnpm/radashi@12.7.1/node_modules/radashi/dist/radashi.js.map +0 -1
  243. package/dist/node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.development.js +0 -195
  244. package/dist/node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.development.js.map +0 -1
  245. package/dist/node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js +0 -76
  246. package/dist/node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js.map +0 -1
  247. package/dist/node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js +0 -39
  248. package/dist/node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js.map +0 -1
  249. package/dist/node_modules/.pnpm/react-map-gl@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/react-map-gl/dist/maplibre.js +0 -16
  250. package/dist/node_modules/.pnpm/zustand@5.0.9_@types_react@19.2.7_immer@10.2.0_react@19.2.3_use-sync-external-store@1.6.0_react@19.2.3_/node_modules/zustand/esm/middleware/immer.js +0 -27
  251. package/dist/node_modules/.pnpm/zustand@5.0.9_@types_react@19.2.7_immer@10.2.0_react@19.2.3_use-sync-external-store@1.6.0_react@19.2.3_/node_modules/zustand/esm/middleware/immer.js.map +0 -1
  252. package/dist/node_modules/.pnpm/zustand@5.0.9_@types_react@19.2.7_immer@10.2.0_react@19.2.3_use-sync-external-store@1.6.0_react@19.2.3_/node_modules/zustand/esm/vanilla.js +0 -45
  253. package/dist/node_modules/.pnpm/zustand@5.0.9_@types_react@19.2.7_immer@10.2.0_react@19.2.3_use-sync-external-store@1.6.0_react@19.2.3_/node_modules/zustand/esm/vanilla.js.map +0 -1
  254. package/dist/packages/hotkey-manager/dist/actions/register-hotkey/index.js +0 -78
  255. package/dist/packages/hotkey-manager/dist/actions/register-hotkey/index.js.map +0 -1
  256. package/dist/packages/hotkey-manager/dist/constants.js +0 -47
  257. package/dist/packages/hotkey-manager/dist/constants.js.map +0 -1
  258. package/dist/packages/hotkey-manager/dist/enums/keycode.js +0 -130
  259. package/dist/packages/hotkey-manager/dist/enums/keycode.js.map +0 -1
  260. package/dist/packages/hotkey-manager/dist/lib/is-client/index.js.map +0 -1
  261. package/dist/packages/hotkey-manager/dist/lib/is-mac/index.js.map +0 -1
  262. package/dist/packages/hotkey-manager/dist/lib/key-to-id/index.js +0 -39
  263. package/dist/packages/hotkey-manager/dist/lib/key-to-id/index.js.map +0 -1
  264. package/dist/packages/hotkey-manager/dist/lib/key-to-string/index.js +0 -27
  265. package/dist/packages/hotkey-manager/dist/lib/key-to-string/index.js.map +0 -1
  266. package/dist/packages/hotkey-manager/dist/stores/hotkey-store/index.js +0 -95
  267. package/dist/packages/hotkey-manager/dist/stores/hotkey-store/index.js.map +0 -1
  268. package/dist/viewport/constants.d.ts +0 -11
  269. package/dist/viewport/constants.js +0 -25
  270. package/dist/viewport/constants.js.map +0 -1
  271. package/dist/viewport/use-viewport-state.d.ts +0 -100
  272. package/dist/viewport/use-viewport-state.js +0 -222
  273. package/dist/viewport/use-viewport-state.js.map +0 -1
@@ -0,0 +1,50 @@
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_COLORS, HIGHLIGHT_WIDTH_INCREASE, HOVER_WIDTH_INCREASE } from "../../shared/constants.js";
17
+ import { getLineWidth, normalizeColor } from "../../shared/utils/style-utils.js";
18
+
19
+ //#region src/deckgl/shapes/display-shape-layer/utils/display-style.ts
20
+ /**
21
+ * Get hover-enhanced border/outline width
22
+ */
23
+ function getHoverLineWidth(feature, isHovered) {
24
+ const baseWidth = getLineWidth(feature);
25
+ return isHovered ? baseWidth + HOVER_WIDTH_INCREASE : baseWidth;
26
+ }
27
+ /**
28
+ * Get selection highlight color
29
+ * Returns the default highlight color or allows custom opacity override
30
+ */
31
+ function getHighlightColor(opacity) {
32
+ const rgba = normalizeColor(DEFAULT_COLORS.highlight);
33
+ if (opacity !== void 0) return [
34
+ rgba[0],
35
+ rgba[1],
36
+ rgba[2],
37
+ Math.round(opacity * 255)
38
+ ];
39
+ return rgba;
40
+ }
41
+ /**
42
+ * Get highlight border/outline width (base width + increase)
43
+ */
44
+ function getHighlightLineWidth(feature) {
45
+ return getLineWidth(feature) + HIGHLIGHT_WIDTH_INCREASE;
46
+ }
47
+
48
+ //#endregion
49
+ export { getHighlightColor, getHighlightLineWidth, getHoverLineWidth };
50
+ //# sourceMappingURL=display-style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"display-style.js","names":[],"sources":["../../../../../src/deckgl/shapes/display-shape-layer/utils/display-style.ts"],"sourcesContent":["/*\n * Copyright 2025 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 {\n DEFAULT_COLORS,\n HIGHLIGHT_WIDTH_INCREASE,\n HOVER_WIDTH_INCREASE,\n} from '../../shared/constants';\nimport { getLineWidth, normalizeColor } from '../../shared/utils/style-utils';\nimport type { StyledFeature } from '../../shared/types';\n\n/**\n * Get hover-enhanced border/outline width\n */\nexport function getHoverLineWidth(\n feature: StyledFeature,\n isHovered: boolean,\n): number {\n const baseWidth = getLineWidth(feature);\n return isHovered ? baseWidth + HOVER_WIDTH_INCREASE : baseWidth;\n}\n\n/**\n * Get selection highlight color\n * Returns the default highlight color or allows custom opacity override\n */\nexport function getHighlightColor(\n opacity?: number,\n): [number, number, number, number] {\n const rgba = normalizeColor(DEFAULT_COLORS.highlight);\n\n if (opacity !== undefined) {\n return [rgba[0], rgba[1], rgba[2], Math.round(opacity * 255)];\n }\n\n return rgba;\n}\n\n/**\n * Get highlight border/outline width (base width + increase)\n */\nexport function getHighlightLineWidth(feature: StyledFeature): number {\n const baseWidth = getLineWidth(feature);\n return baseWidth + HIGHLIGHT_WIDTH_INCREASE;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB,kBACd,SACA,WACQ;CACR,MAAM,YAAY,aAAa,QAAQ;AACvC,QAAO,YAAY,YAAY,uBAAuB;;;;;;AAOxD,SAAgB,kBACd,SACkC;CAClC,MAAM,OAAO,eAAe,eAAe,UAAU;AAErD,KAAI,YAAY,OACd,QAAO;EAAC,KAAK;EAAI,KAAK;EAAI,KAAK;EAAI,KAAK,MAAM,UAAU,IAAI;EAAC;AAG/D,QAAO;;;;;AAMT,SAAgB,sBAAsB,SAAgC;AAEpE,QADkB,aAAa,QAAQ,GACpB"}
@@ -0,0 +1,133 @@
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 "../../shared/types.js";
14
+
15
+ //#region src/deckgl/shapes/display-shape-layer/utils/labels.d.ts
16
+ /**
17
+ * Label positioning information including coordinates and screen-space offsets
18
+ */
19
+ interface LabelPosition2d {
20
+ /** Geographic coordinates [longitude, latitude] */
21
+ coordinates: [number, number];
22
+ /** Horizontal text anchor point */
23
+ textAnchor: 'start' | 'middle' | 'end';
24
+ /** Vertical text alignment */
25
+ alignmentBaseline: 'top' | 'center' | 'bottom';
26
+ /** Pixel offset from coordinates [x, y] */
27
+ pixelOffset: [number, number];
28
+ }
29
+ /**
30
+ * Vertical label position relative to anchor point
31
+ */
32
+ type LabelVerticalPosition = 'top' | 'middle' | 'bottom';
33
+ /**
34
+ * Horizontal label position relative to anchor point
35
+ */
36
+ type LabelHorizontalPosition = 'left' | 'center' | 'right';
37
+ /**
38
+ * Cardinal direction anchor for positioning labels on geometry edges
39
+ * Uses edge positions relative to the geometry's bounding box
40
+ * Works for LineString, Polygon, and Circle geometries
41
+ * - 'center': centroid/midpoint of the geometry
42
+ * - 'top'/'right'/'bottom'/'left': edge positions
43
+ */
44
+ type CardinalLabelCoordinateAnchor = 'center' | 'top' | 'right' | 'bottom' | 'left';
45
+ /**
46
+ * Global label positioning options for DisplayShapeLayer
47
+ *
48
+ * ## Priority System
49
+ * Label positioning follows a three-tier priority system:
50
+ * 1. **Per-shape properties** in `styleProperties` (highest priority)
51
+ * 2. **Global options** via this interface
52
+ * 3. **Default values** (geometry-specific fallbacks)
53
+ *
54
+ * ## Label Appearance
55
+ *
56
+ * Labels use a clean text-only style:
57
+ * - **Text**: White uppercase, bold Roboto Mono, 10px
58
+ * - **Outline**: Black 2px outline for contrast
59
+ * - **No background or border**
60
+ *
61
+ * Text height ≈ 10px
62
+ *
63
+ * ## Positioning Concepts
64
+ *
65
+ * ### Coordinate Anchor
66
+ * Determines *where* on the geometry to place the label:
67
+ * - **Point**: Label is always at the point coordinate
68
+ * - **LineString/Polygon**: 'start', 'middle', or 'end' along the geometry
69
+ * - **Circle**: 'top', 'right', 'bottom', or 'left' on the perimeter
70
+ *
71
+ * ### Vertical/Horizontal Anchor
72
+ * Determines how the label aligns *relative to* the anchor point:
73
+ * - **Vertical**: 'top' (label text below point), 'middle' (centered), 'bottom' (label text above point)
74
+ * - **Horizontal**: 'left' (label text right of point), 'center' (centered), 'right' (label text left of point)
75
+ *
76
+ * ### Pixel Offset
77
+ * Fine-tune label position with [x, y] pixel offsets:
78
+ * - Positive x moves right, negative moves left
79
+ * - Positive y moves down, negative moves up
80
+ *
81
+ * @example Position circle labels at the top with 5px clearance
82
+ * ```tsx
83
+ * const labelOptions: LabelPositionOptions = {
84
+ * circleLabelCoordinateAnchor: 'top',
85
+ * circleLabelVerticalAnchor: 'bottom', // Label above the top point
86
+ * circleLabelOffset: [0, -15], // -(10px text height + 5px clearance)
87
+ * };
88
+ * ```
89
+ *
90
+ * @example Position line labels at middle with offset to the right
91
+ * ```tsx
92
+ * const labelOptions: LabelPositionOptions = {
93
+ * lineStringLabelCoordinateAnchor: 'middle',
94
+ * lineStringLabelHorizontalAnchor: 'left',
95
+ * lineStringLabelOffset: [10, 0], // 10px to the right
96
+ * };
97
+ * ```
98
+ */
99
+ interface LabelPositionOptions {
100
+ /** Vertical anchor for Point labels @default 'top' */
101
+ pointLabelVerticalAnchor?: LabelVerticalPosition;
102
+ /** Horizontal anchor for Point labels @default 'center' */
103
+ pointLabelHorizontalAnchor?: LabelHorizontalPosition;
104
+ /** Pixel offset for Point labels [x, y] @default [0, 10] */
105
+ pointLabelOffset?: [number, number];
106
+ /** Position on LineString edge (top/right/bottom/left) @default 'bottom' */
107
+ lineStringLabelCoordinateAnchor?: CardinalLabelCoordinateAnchor;
108
+ /** Vertical anchor for LineString labels @default 'top' */
109
+ lineStringLabelVerticalAnchor?: LabelVerticalPosition;
110
+ /** Horizontal anchor for LineString labels @default 'center' */
111
+ lineStringLabelHorizontalAnchor?: LabelHorizontalPosition;
112
+ /** Pixel offset for LineString labels [x, y] @default [0, 10] */
113
+ lineStringLabelOffset?: [number, number];
114
+ /** Position on Polygon edge (top/right/bottom/left) @default 'bottom' */
115
+ polygonLabelCoordinateAnchor?: CardinalLabelCoordinateAnchor;
116
+ /** Vertical anchor for Polygon labels @default 'top' */
117
+ polygonLabelVerticalAnchor?: LabelVerticalPosition;
118
+ /** Horizontal anchor for Polygon labels @default 'center' */
119
+ polygonLabelHorizontalAnchor?: LabelHorizontalPosition;
120
+ /** Pixel offset for Polygon labels [x, y] @default [0, 10] */
121
+ polygonLabelOffset?: [number, number];
122
+ /** Position on Circle perimeter (top/right/bottom/left) @default 'bottom' */
123
+ circleLabelCoordinateAnchor?: CardinalLabelCoordinateAnchor;
124
+ /** Vertical anchor for Circle labels @default 'top' */
125
+ circleLabelVerticalAnchor?: LabelVerticalPosition;
126
+ /** Horizontal anchor for Circle labels @default 'center' */
127
+ circleLabelHorizontalAnchor?: LabelHorizontalPosition;
128
+ /** Pixel offset for Circle labels [x, y] @default [0, 10] */
129
+ circleLabelOffset?: [number, number];
130
+ }
131
+ //#endregion
132
+ export { CardinalLabelCoordinateAnchor, LabelHorizontalPosition, LabelPosition2d, LabelPositionOptions, LabelVerticalPosition };
133
+ //# sourceMappingURL=labels.d.ts.map
@@ -0,0 +1,250 @@
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 { isCircleShape } from "../../shared/types.js";
17
+
18
+ //#region src/deckgl/shapes/display-shape-layer/utils/labels.ts
19
+ /**
20
+ * Label positioning utilities for shapes
21
+ *
22
+ * This module provides utilities for positioning labels on shapes and calculating
23
+ * points along line segments. Use these to customize label placement in your shape data.
24
+ *
25
+ * ## Label Styling
26
+ *
27
+ * Labels use a text-only style for legibility across different map backgrounds:
28
+ * - **Text**: White uppercase with bold Roboto Mono font at 10px
29
+ * - **Outline**: Black 2px outline around text for contrast
30
+ * - **No background or border**: Clean text-only appearance
31
+ *
32
+ * ### Calculating Offsets
33
+ *
34
+ * When positioning labels, the text height is approximately 10px.
35
+ * For example, to position a label exactly 5px above a point:
36
+ * - Label height ≈ text height (10px)
37
+ * - Offset needed: [0, -(10 + 5)] = [0, -15]
38
+ *
39
+ * @example Position label at the middle of a LineString
40
+ * ```typescript
41
+ * import { getLineStringMidpoint } from '@accelint/map-toolkit/deckgl/shapes/display-shape-layer/utils/labels';
42
+ *
43
+ * // Calculate midpoint for custom positioning
44
+ * const coordinates = [[-122.4, 37.8], [-122.3, 37.9], [-122.2, 38.0]];
45
+ * const midpoint = getLineStringMidpoint(coordinates);
46
+ *
47
+ * // Use in shape data with custom label properties
48
+ * const shape = {
49
+ * feature: {
50
+ * properties: {
51
+ * styleProperties: {
52
+ * labelVerticalAnchor: 'top',
53
+ * labelHorizontalAnchor: 'center',
54
+ * labelOffset: [0, -10], // Small offset above the line
55
+ * }
56
+ * }
57
+ * }
58
+ * };
59
+ * ```
60
+ */
61
+ /**
62
+ * Convert vertical/horizontal position to deck.gl textAnchor and alignmentBaseline
63
+ */
64
+ function convertPositionToAnchors(vertical, horizontal) {
65
+ return {
66
+ textAnchor: {
67
+ left: "start",
68
+ center: "middle",
69
+ right: "end"
70
+ }[horizontal],
71
+ alignmentBaseline: {
72
+ top: "top",
73
+ middle: "center",
74
+ bottom: "bottom"
75
+ }[vertical]
76
+ };
77
+ }
78
+ /**
79
+ * Helper to resolve label properties with priority: shape > options > default
80
+ */
81
+ function resolveLabelProperties(shapeOffset, shapeVertical, shapeHorizontal, defaultOffset, defaultVertical, defaultHorizontal, optionsOffset, optionsVertical, optionsHorizontal) {
82
+ return {
83
+ pixelOffset: shapeOffset ?? optionsOffset ?? defaultOffset,
84
+ ...convertPositionToAnchors(shapeVertical ?? optionsVertical ?? defaultVertical, shapeHorizontal ?? optionsHorizontal ?? defaultHorizontal)
85
+ };
86
+ }
87
+ /**
88
+ * Get position for Point geometry
89
+ */
90
+ function getPointPosition(geometry, shapeOffset, shapeVertical, shapeHorizontal, options) {
91
+ const resolved = resolveLabelProperties(shapeOffset, shapeVertical, shapeHorizontal, [0, 10], "top", "center", options?.pointLabelOffset, options?.pointLabelVerticalAnchor, options?.pointLabelHorizontalAnchor);
92
+ return {
93
+ coordinates: [geometry.coordinates[0] ?? 0, geometry.coordinates[1] ?? 0],
94
+ ...resolved
95
+ };
96
+ }
97
+ /**
98
+ * Get position for LineString geometry
99
+ * Uses cardinal direction positioning to find the edge point
100
+ */
101
+ function getLineStringPosition(geometry, shapeOffset, shapeVertical, shapeHorizontal, shapeCoordinateAnchor, options) {
102
+ const defaultOffset = [0, 10];
103
+ const defaultVertical = "top";
104
+ const defaultHorizontal = "center";
105
+ const defaultCoordinateAnchor = "bottom";
106
+ const resolved = resolveLabelProperties(shapeOffset, shapeVertical, shapeHorizontal, defaultOffset, defaultVertical, defaultHorizontal, options?.lineStringLabelOffset, options?.lineStringLabelVerticalAnchor, options?.lineStringLabelHorizontalAnchor);
107
+ const coordinateAnchor = shapeCoordinateAnchor ?? options?.lineStringLabelCoordinateAnchor ?? defaultCoordinateAnchor;
108
+ const coordinates = findEdgePoint(geometry.coordinates, coordinateAnchor);
109
+ if (!coordinates) return null;
110
+ return {
111
+ coordinates,
112
+ ...resolved
113
+ };
114
+ }
115
+ /**
116
+ * Get vertex coordinate from ring
117
+ */
118
+ function getVertexCoordinate(vertex) {
119
+ if (!vertex || vertex[0] === void 0 || vertex[1] === void 0) return null;
120
+ return [vertex[0], vertex[1]];
121
+ }
122
+ /**
123
+ * Check if a vertex should replace the current target based on edge position
124
+ */
125
+ function shouldUpdateEdgeVertex(vertexValue, targetValue, position) {
126
+ return position === "top" || position === "right" ? vertexValue > targetValue : vertexValue < targetValue;
127
+ }
128
+ /**
129
+ * Get the coordinate index based on edge position (0 for x/longitude, 1 for y/latitude)
130
+ */
131
+ function getCoordinateIndexForEdgePosition(position) {
132
+ return position === "top" || position === "bottom" ? 1 : 0;
133
+ }
134
+ /**
135
+ * Calculate the centroid (center point) of a set of coordinates
136
+ * For polygons, this calculates the geometric center
137
+ * For lines, this calculates the midpoint of the bounding box
138
+ * Returns null if no valid coordinates exist
139
+ */
140
+ function calculateCentroid(coordinates) {
141
+ if (coordinates.length === 0) return null;
142
+ let sumX = 0;
143
+ let sumY = 0;
144
+ let count = 0;
145
+ for (const coord of coordinates) if (coord && coord[0] !== void 0 && coord[1] !== void 0) {
146
+ sumX += coord[0];
147
+ sumY += coord[1];
148
+ count++;
149
+ }
150
+ if (count === 0) return null;
151
+ return [sumX / count, sumY / count];
152
+ }
153
+ /**
154
+ * Find the point on a geometry's perimeter at the specified edge position
155
+ * @param coordinates - Array of coordinates (ring or line)
156
+ * @param position - Edge position (center/top/right/bottom/left) relative to bounding box
157
+ * @returns Coordinate at the specified edge position, or null if no valid coordinates
158
+ */
159
+ function findEdgePoint(coordinates, position) {
160
+ if (!coordinates || coordinates.length === 0) return null;
161
+ if (position === "center") return calculateCentroid(coordinates);
162
+ let targetVertex = coordinates[0];
163
+ const coordinateIndex = getCoordinateIndexForEdgePosition(position);
164
+ for (const vertex of coordinates) {
165
+ if (!vertex) continue;
166
+ if (!targetVertex) continue;
167
+ const vertexValue = vertex[coordinateIndex];
168
+ const targetValue = targetVertex[coordinateIndex];
169
+ if (vertexValue === void 0 || targetValue === void 0) continue;
170
+ if (shouldUpdateEdgeVertex(vertexValue, targetValue, position)) targetVertex = vertex;
171
+ }
172
+ return getVertexCoordinate(targetVertex);
173
+ }
174
+ /**
175
+ * Get position for Circle geometry (special case of Polygon)
176
+ */
177
+ function getCirclePosition(ring, shapeOffset, shapeVertical, shapeHorizontal, shapeCoordinateAnchor, options) {
178
+ const defaultOffset = [0, 10];
179
+ const defaultVertical = "top";
180
+ const defaultHorizontal = "center";
181
+ const defaultCoordinateAnchor = "bottom";
182
+ const resolved = resolveLabelProperties(shapeOffset, shapeVertical, shapeHorizontal, defaultOffset, defaultVertical, defaultHorizontal, options?.circleLabelOffset, options?.circleLabelVerticalAnchor, options?.circleLabelHorizontalAnchor);
183
+ const coordinates = findEdgePoint(ring, shapeCoordinateAnchor ?? options?.circleLabelCoordinateAnchor ?? defaultCoordinateAnchor);
184
+ if (!coordinates) return null;
185
+ return {
186
+ coordinates,
187
+ ...resolved
188
+ };
189
+ }
190
+ /**
191
+ * Get position for Polygon geometry
192
+ * Uses cardinal direction positioning to find the edge point
193
+ */
194
+ function getPolygonPosition(geometry, shape, shapeOffset, shapeVertical, shapeHorizontal, shapeCoordinateAnchor, options) {
195
+ const ring = geometry.coordinates[0];
196
+ if (isCircleShape(shape)) return getCirclePosition(ring, shapeOffset, shapeVertical, shapeHorizontal, shapeCoordinateAnchor, options);
197
+ const defaultOffset = [0, 10];
198
+ const defaultVertical = "top";
199
+ const defaultHorizontal = "center";
200
+ const defaultCoordinateAnchor = "bottom";
201
+ const resolved = resolveLabelProperties(shapeOffset, shapeVertical, shapeHorizontal, defaultOffset, defaultVertical, defaultHorizontal, options?.polygonLabelOffset, options?.polygonLabelVerticalAnchor, options?.polygonLabelHorizontalAnchor);
202
+ const coordinates = findEdgePoint(ring, shapeCoordinateAnchor ?? options?.polygonLabelCoordinateAnchor ?? defaultCoordinateAnchor);
203
+ if (!coordinates) return null;
204
+ return {
205
+ coordinates,
206
+ ...resolved
207
+ };
208
+ }
209
+ /**
210
+ * Get 2D position for label based on geometry type
211
+ * Uses pixel-based offsets for consistent positioning at all zoom levels
212
+ *
213
+ * Priority for positioning:
214
+ * 1. Per-shape properties in styleProperties (highest)
215
+ * 2. Global labelOptions from layer props
216
+ * 3. Default values (fallback)
217
+ *
218
+ * Returns null if no valid coordinates can be determined
219
+ */
220
+ function getLabelPosition2d(shape, options) {
221
+ const { geometry } = shape.feature;
222
+ const styleProps = shape.feature.properties?.styleProperties;
223
+ const shapeOffset = styleProps?.labelOffset;
224
+ const shapeVertical = styleProps?.labelVerticalAnchor;
225
+ const shapeHorizontal = styleProps?.labelHorizontalAnchor;
226
+ const shapeCoordinateAnchor = styleProps?.labelCoordinateAnchor;
227
+ switch (geometry.type) {
228
+ case "Point": return getPointPosition(geometry, shapeOffset, shapeVertical, shapeHorizontal, options);
229
+ case "LineString": return getLineStringPosition(geometry, shapeOffset, shapeVertical, shapeHorizontal, shapeCoordinateAnchor, options);
230
+ case "Polygon": return getPolygonPosition(geometry, shape, shapeOffset, shapeVertical, shapeHorizontal, shapeCoordinateAnchor, options);
231
+ default: return null;
232
+ }
233
+ }
234
+ /**
235
+ * Get label text for a shape
236
+ *
237
+ * Returns the display label for the shape on the map in uppercase.
238
+ * - `label`: Optional short display name shown on the map (e.g., "NYC")
239
+ * - `name`: Full shape name used internally (e.g., "New York City Office")
240
+ *
241
+ * If `label` is not provided, falls back to using `name`.
242
+ * Text is automatically converted to uppercase for display.
243
+ */
244
+ function getLabelText(shape) {
245
+ return (shape.label || shape.name).toUpperCase();
246
+ }
247
+
248
+ //#endregion
249
+ export { getLabelPosition2d, getLabelText };
250
+ //# sourceMappingURL=labels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"labels.js","names":["defaultOffset: [number, number]","defaultVertical: LabelVerticalPosition","defaultHorizontal: LabelHorizontalPosition","defaultCoordinateAnchor: CardinalLabelCoordinateAnchor"],"sources":["../../../../../src/deckgl/shapes/display-shape-layer/utils/labels.ts"],"sourcesContent":["/*\n * Copyright 2025 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/**\n * Label positioning utilities for shapes\n *\n * This module provides utilities for positioning labels on shapes and calculating\n * points along line segments. Use these to customize label placement in your shape data.\n *\n * ## Label Styling\n *\n * Labels use a text-only style for legibility across different map backgrounds:\n * - **Text**: White uppercase with bold Roboto Mono font at 10px\n * - **Outline**: Black 2px outline around text for contrast\n * - **No background or border**: Clean text-only appearance\n *\n * ### Calculating Offsets\n *\n * When positioning labels, the text height is approximately 10px.\n * For example, to position a label exactly 5px above a point:\n * - Label height ≈ text height (10px)\n * - Offset needed: [0, -(10 + 5)] = [0, -15]\n *\n * @example Position label at the middle of a LineString\n * ```typescript\n * import { getLineStringMidpoint } from '@accelint/map-toolkit/deckgl/shapes/display-shape-layer/utils/labels';\n *\n * // Calculate midpoint for custom positioning\n * const coordinates = [[-122.4, 37.8], [-122.3, 37.9], [-122.2, 38.0]];\n * const midpoint = getLineStringMidpoint(coordinates);\n *\n * // Use in shape data with custom label properties\n * const shape = {\n * feature: {\n * properties: {\n * styleProperties: {\n * labelVerticalAnchor: 'top',\n * labelHorizontalAnchor: 'center',\n * labelOffset: [0, -10], // Small offset above the line\n * }\n * }\n * }\n * };\n * ```\n */\n\n'use client';\n\nimport type { LineString, Point, Polygon } from 'geojson';\nimport { isCircleShape } from '../../shared/types';\nimport type { Shape } from '../../shared/types';\n\n/**\n * Label positioning information including coordinates and screen-space offsets\n */\nexport interface LabelPosition2d {\n /** Geographic coordinates [longitude, latitude] */\n coordinates: [number, number];\n /** Horizontal text anchor point */\n textAnchor: 'start' | 'middle' | 'end';\n /** Vertical text alignment */\n alignmentBaseline: 'top' | 'center' | 'bottom';\n /** Pixel offset from coordinates [x, y] */\n pixelOffset: [number, number];\n}\n\n/**\n * Calculate a point along a line segment\n * @param start - Start coordinate [lon, lat]\n * @param end - End coordinate [lon, lat]\n * @param ratio - Position along segment (0 = start, 0.5 = middle, 1 = end)\n * @returns Interpolated coordinate [lon, lat]\n *\n * @example\n * // Get a point 25% along a line segment\n * const start: [number, number] = [-122.4, 37.8];\n * const end: [number, number] = [-122.3, 37.9];\n * const point = interpolatePoint(start, end, 0.25);\n */\nexport function interpolatePoint(\n start: [number, number],\n end: [number, number],\n ratio: number,\n): [number, number] {\n const clampedRatio = Math.max(0, Math.min(1, ratio));\n return [\n start[0] + (end[0] - start[0]) * clampedRatio,\n start[1] + (end[1] - start[1]) * clampedRatio,\n ];\n}\n\n/**\n * Calculate segment lengths for a line\n */\nfunction calculateSegmentLengths(coordinates: [number, number][]): {\n lengths: number[];\n total: number;\n} {\n let total = 0;\n const lengths: number[] = [];\n\n for (let i = 0; i < coordinates.length - 1; i++) {\n const start = coordinates[i];\n const end = coordinates[i + 1];\n if (start && end) {\n const length = Math.sqrt(\n (end[0] - start[0]) ** 2 + (end[1] - start[1]) ** 2,\n );\n lengths.push(length);\n total += length;\n }\n }\n\n return { lengths, total };\n}\n\n/**\n * Find point at specific distance along line\n */\nfunction findPointAtDistance(\n coordinates: [number, number][],\n segmentLengths: number[],\n targetDistance: number,\n): [number, number] {\n let accumulatedLength = 0;\n\n for (let i = 0; i < segmentLengths.length; i++) {\n const segmentLength = segmentLengths[i];\n if (!segmentLength) {\n continue;\n }\n\n if (accumulatedLength + segmentLength >= targetDistance) {\n const start = coordinates[i];\n const end = coordinates[i + 1];\n if (start && end) {\n const ratio = (targetDistance - accumulatedLength) / segmentLength;\n return interpolatePoint(start, end, ratio);\n }\n }\n accumulatedLength += segmentLength;\n }\n\n return coordinates[coordinates.length - 1] ?? [0, 0];\n}\n\n/**\n * Get the midpoint of a LineString\n * @param coordinates - LineString coordinates array\n * @returns Midpoint coordinate [lon, lat]\n */\nexport function getLineStringMidpoint(\n coordinates: [number, number][],\n): [number, number] {\n if (coordinates.length === 0) {\n return [0, 0];\n }\n if (coordinates.length === 1) {\n return coordinates[0] ?? [0, 0];\n }\n\n const { lengths, total } = calculateSegmentLengths(coordinates);\n const halfLength = total / 2;\n\n return findPointAtDistance(coordinates, lengths, halfLength);\n}\n\n/**\n * Get the end point of a LineString\n * @param coordinates - LineString coordinates array\n * @returns End coordinate [lon, lat]\n */\nexport function getLineStringEndpoint(\n coordinates: [number, number][],\n): [number, number] {\n if (coordinates.length === 0) {\n return [0, 0];\n }\n return coordinates[coordinates.length - 1] ?? [0, 0];\n}\n\n/**\n * Get the midpoint of a Polygon's outer ring\n * @param coordinates - Polygon coordinates array (rings)\n * @returns Midpoint of outer ring [lon, lat]\n */\nexport function getPolygonMidpoint(\n coordinates: [number, number][][],\n): [number, number] {\n const outerRing = coordinates[0];\n if (!outerRing || outerRing.length === 0) {\n return [0, 0];\n }\n // Use the outer ring (first ring)\n return getLineStringMidpoint(outerRing);\n}\n\n/**\n * Vertical label position relative to anchor point\n */\nexport type LabelVerticalPosition = 'top' | 'middle' | 'bottom';\n\n/**\n * Horizontal label position relative to anchor point\n */\nexport type LabelHorizontalPosition = 'left' | 'center' | 'right';\n\n/**\n * Cardinal direction anchor for positioning labels on geometry edges\n * Uses edge positions relative to the geometry's bounding box\n * Works for LineString, Polygon, and Circle geometries\n * - 'center': centroid/midpoint of the geometry\n * - 'top'/'right'/'bottom'/'left': edge positions\n */\nexport type CardinalLabelCoordinateAnchor =\n | 'center'\n | 'top'\n | 'right'\n | 'bottom'\n | 'left';\n\n/**\n * Global label positioning options for DisplayShapeLayer\n *\n * ## Priority System\n * Label positioning follows a three-tier priority system:\n * 1. **Per-shape properties** in `styleProperties` (highest priority)\n * 2. **Global options** via this interface\n * 3. **Default values** (geometry-specific fallbacks)\n *\n * ## Label Appearance\n *\n * Labels use a clean text-only style:\n * - **Text**: White uppercase, bold Roboto Mono, 10px\n * - **Outline**: Black 2px outline for contrast\n * - **No background or border**\n *\n * Text height ≈ 10px\n *\n * ## Positioning Concepts\n *\n * ### Coordinate Anchor\n * Determines *where* on the geometry to place the label:\n * - **Point**: Label is always at the point coordinate\n * - **LineString/Polygon**: 'start', 'middle', or 'end' along the geometry\n * - **Circle**: 'top', 'right', 'bottom', or 'left' on the perimeter\n *\n * ### Vertical/Horizontal Anchor\n * Determines how the label aligns *relative to* the anchor point:\n * - **Vertical**: 'top' (label text below point), 'middle' (centered), 'bottom' (label text above point)\n * - **Horizontal**: 'left' (label text right of point), 'center' (centered), 'right' (label text left of point)\n *\n * ### Pixel Offset\n * Fine-tune label position with [x, y] pixel offsets:\n * - Positive x moves right, negative moves left\n * - Positive y moves down, negative moves up\n *\n * @example Position circle labels at the top with 5px clearance\n * ```tsx\n * const labelOptions: LabelPositionOptions = {\n * circleLabelCoordinateAnchor: 'top',\n * circleLabelVerticalAnchor: 'bottom', // Label above the top point\n * circleLabelOffset: [0, -15], // -(10px text height + 5px clearance)\n * };\n * ```\n *\n * @example Position line labels at middle with offset to the right\n * ```tsx\n * const labelOptions: LabelPositionOptions = {\n * lineStringLabelCoordinateAnchor: 'middle',\n * lineStringLabelHorizontalAnchor: 'left',\n * lineStringLabelOffset: [10, 0], // 10px to the right\n * };\n * ```\n */\nexport interface LabelPositionOptions {\n // Point geometry options\n /** Vertical anchor for Point labels @default 'top' */\n pointLabelVerticalAnchor?: LabelVerticalPosition;\n /** Horizontal anchor for Point labels @default 'center' */\n pointLabelHorizontalAnchor?: LabelHorizontalPosition;\n /** Pixel offset for Point labels [x, y] @default [0, 10] */\n pointLabelOffset?: [number, number];\n\n // LineString geometry options\n /** Position on LineString edge (top/right/bottom/left) @default 'bottom' */\n lineStringLabelCoordinateAnchor?: CardinalLabelCoordinateAnchor;\n /** Vertical anchor for LineString labels @default 'top' */\n lineStringLabelVerticalAnchor?: LabelVerticalPosition;\n /** Horizontal anchor for LineString labels @default 'center' */\n lineStringLabelHorizontalAnchor?: LabelHorizontalPosition;\n /** Pixel offset for LineString labels [x, y] @default [0, 10] */\n lineStringLabelOffset?: [number, number];\n\n // Polygon geometry options\n /** Position on Polygon edge (top/right/bottom/left) @default 'bottom' */\n polygonLabelCoordinateAnchor?: CardinalLabelCoordinateAnchor;\n /** Vertical anchor for Polygon labels @default 'top' */\n polygonLabelVerticalAnchor?: LabelVerticalPosition;\n /** Horizontal anchor for Polygon labels @default 'center' */\n polygonLabelHorizontalAnchor?: LabelHorizontalPosition;\n /** Pixel offset for Polygon labels [x, y] @default [0, 10] */\n polygonLabelOffset?: [number, number];\n\n // Circle geometry options\n /** Position on Circle perimeter (top/right/bottom/left) @default 'bottom' */\n circleLabelCoordinateAnchor?: CardinalLabelCoordinateAnchor;\n /** Vertical anchor for Circle labels @default 'top' */\n circleLabelVerticalAnchor?: LabelVerticalPosition;\n /** Horizontal anchor for Circle labels @default 'center' */\n circleLabelHorizontalAnchor?: LabelHorizontalPosition;\n /** Pixel offset for Circle labels [x, y] @default [0, 10] */\n circleLabelOffset?: [number, number];\n}\n\n/**\n * Convert vertical/horizontal position to deck.gl textAnchor and alignmentBaseline\n */\nfunction convertPositionToAnchors(\n vertical: LabelVerticalPosition,\n horizontal: LabelHorizontalPosition,\n): {\n textAnchor: 'start' | 'middle' | 'end';\n alignmentBaseline: 'top' | 'center' | 'bottom';\n} {\n // Map horizontal to textAnchor\n const textAnchorMap: Record<\n LabelHorizontalPosition,\n 'start' | 'middle' | 'end'\n > = {\n left: 'start',\n center: 'middle',\n right: 'end',\n };\n\n // Map vertical to alignmentBaseline\n const alignmentBaselineMap: Record<\n LabelVerticalPosition,\n 'top' | 'center' | 'bottom'\n > = {\n top: 'top',\n middle: 'center',\n bottom: 'bottom',\n };\n\n return {\n textAnchor: textAnchorMap[horizontal],\n alignmentBaseline: alignmentBaselineMap[vertical],\n };\n}\n\n/**\n * Helper to resolve label properties with priority: shape > options > default\n */\nfunction resolveLabelProperties(\n shapeOffset: [number, number] | undefined,\n shapeVertical: string | undefined,\n shapeHorizontal: string | undefined,\n defaultOffset: [number, number],\n defaultVertical: LabelVerticalPosition,\n defaultHorizontal: LabelHorizontalPosition,\n optionsOffset?: [number, number],\n optionsVertical?: LabelVerticalPosition,\n optionsHorizontal?: LabelHorizontalPosition,\n) {\n const vertical = (shapeVertical ??\n optionsVertical ??\n defaultVertical) as LabelVerticalPosition;\n const horizontal = (shapeHorizontal ??\n optionsHorizontal ??\n defaultHorizontal) as LabelHorizontalPosition;\n const pixelOffset = shapeOffset ?? optionsOffset ?? defaultOffset;\n\n const anchors = convertPositionToAnchors(vertical, horizontal);\n\n return {\n pixelOffset,\n ...anchors,\n };\n}\n\n/**\n * Get position for Point geometry\n */\nfunction getPointPosition(\n geometry: Point,\n shapeOffset: [number, number] | undefined,\n shapeVertical: string | undefined,\n shapeHorizontal: string | undefined,\n options?: LabelPositionOptions,\n): LabelPosition2d {\n const defaultOffset: [number, number] = [0, 10];\n const defaultVertical: LabelVerticalPosition = 'top';\n const defaultHorizontal: LabelHorizontalPosition = 'center';\n\n const resolved = resolveLabelProperties(\n shapeOffset,\n shapeVertical,\n shapeHorizontal,\n defaultOffset,\n defaultVertical,\n defaultHorizontal,\n options?.pointLabelOffset,\n options?.pointLabelVerticalAnchor,\n options?.pointLabelHorizontalAnchor,\n );\n\n return {\n coordinates: [\n geometry.coordinates[0] ?? 0,\n geometry.coordinates[1] ?? 0,\n ] as [number, number],\n ...resolved,\n };\n}\n\n/**\n * Get position for LineString geometry\n * Uses cardinal direction positioning to find the edge point\n */\nfunction getLineStringPosition(\n geometry: LineString,\n shapeOffset: [number, number] | undefined,\n shapeVertical: string | undefined,\n shapeHorizontal: string | undefined,\n shapeCoordinateAnchor: string | undefined,\n options?: LabelPositionOptions,\n): LabelPosition2d | null {\n const defaultOffset: [number, number] = [0, 10];\n const defaultVertical: LabelVerticalPosition = 'top';\n const defaultHorizontal: LabelHorizontalPosition = 'center';\n const defaultCoordinateAnchor: CardinalLabelCoordinateAnchor = 'bottom';\n\n const resolved = resolveLabelProperties(\n shapeOffset,\n shapeVertical,\n shapeHorizontal,\n defaultOffset,\n defaultVertical,\n defaultHorizontal,\n options?.lineStringLabelOffset,\n options?.lineStringLabelVerticalAnchor,\n options?.lineStringLabelHorizontalAnchor,\n );\n\n // Determine coordinate anchor (priority: shape > options > default)\n const coordinateAnchor = (shapeCoordinateAnchor ??\n options?.lineStringLabelCoordinateAnchor ??\n defaultCoordinateAnchor) as CardinalLabelCoordinateAnchor;\n\n // Calculate position based on cardinal direction\n const coordinates = findEdgePoint(\n geometry.coordinates as number[][],\n coordinateAnchor,\n );\n\n if (!coordinates) {\n return null;\n }\n\n return {\n coordinates,\n ...resolved,\n };\n}\n\n/**\n * Get vertex coordinate from ring\n */\nfunction getVertexCoordinate(\n vertex: number[] | undefined,\n): [number, number] | null {\n if (!vertex || vertex[0] === undefined || vertex[1] === undefined) {\n return null;\n }\n return [vertex[0], vertex[1]];\n}\n\n/**\n * Check if a vertex should replace the current target based on edge position\n */\nfunction shouldUpdateEdgeVertex(\n vertexValue: number,\n targetValue: number,\n position: CardinalLabelCoordinateAnchor,\n): boolean {\n // For top and right, find maximum value\n // For bottom and left, find minimum value\n return position === 'top' || position === 'right'\n ? vertexValue > targetValue\n : vertexValue < targetValue;\n}\n\n/**\n * Get the coordinate index based on edge position (0 for x/longitude, 1 for y/latitude)\n */\nfunction getCoordinateIndexForEdgePosition(\n position: CardinalLabelCoordinateAnchor,\n): number {\n return position === 'top' || position === 'bottom' ? 1 : 0;\n}\n\n/**\n * Calculate the centroid (center point) of a set of coordinates\n * For polygons, this calculates the geometric center\n * For lines, this calculates the midpoint of the bounding box\n * Returns null if no valid coordinates exist\n */\nfunction calculateCentroid(coordinates: number[][]): [number, number] | null {\n if (coordinates.length === 0) {\n return null;\n }\n\n let sumX = 0;\n let sumY = 0;\n let count = 0;\n\n for (const coord of coordinates) {\n if (coord && coord[0] !== undefined && coord[1] !== undefined) {\n sumX += coord[0];\n sumY += coord[1];\n count++;\n }\n }\n\n if (count === 0) {\n return null;\n }\n\n return [sumX / count, sumY / count];\n}\n\n/**\n * Find the point on a geometry's perimeter at the specified edge position\n * @param coordinates - Array of coordinates (ring or line)\n * @param position - Edge position (center/top/right/bottom/left) relative to bounding box\n * @returns Coordinate at the specified edge position, or null if no valid coordinates\n */\nfunction findEdgePoint(\n coordinates: number[][] | undefined,\n position: CardinalLabelCoordinateAnchor,\n): [number, number] | null {\n if (!coordinates || coordinates.length === 0) {\n return null;\n }\n\n // Handle center positioning\n if (position === 'center') {\n return calculateCentroid(coordinates);\n }\n\n // Find the vertex with max/min latitude or longitude\n let targetVertex = coordinates[0];\n const coordinateIndex = getCoordinateIndexForEdgePosition(position);\n\n for (const vertex of coordinates) {\n if (!vertex) {\n continue;\n }\n if (!targetVertex) {\n continue;\n }\n\n const vertexValue = vertex[coordinateIndex];\n const targetValue = targetVertex[coordinateIndex];\n\n if (vertexValue === undefined || targetValue === undefined) {\n continue;\n }\n\n if (shouldUpdateEdgeVertex(vertexValue, targetValue, position)) {\n targetVertex = vertex;\n }\n }\n\n return getVertexCoordinate(targetVertex);\n}\n\n/**\n * Get position for Circle geometry (special case of Polygon)\n */\nfunction getCirclePosition(\n ring: number[][] | undefined,\n shapeOffset: [number, number] | undefined,\n shapeVertical: string | undefined,\n shapeHorizontal: string | undefined,\n shapeCoordinateAnchor: string | undefined,\n options?: LabelPositionOptions,\n): LabelPosition2d | null {\n const defaultOffset: [number, number] = [0, 10];\n const defaultVertical: LabelVerticalPosition = 'top';\n const defaultHorizontal: LabelHorizontalPosition = 'center';\n const defaultCoordinateAnchor: CardinalLabelCoordinateAnchor = 'bottom';\n\n const resolved = resolveLabelProperties(\n shapeOffset,\n shapeVertical,\n shapeHorizontal,\n defaultOffset,\n defaultVertical,\n defaultHorizontal,\n options?.circleLabelOffset,\n options?.circleLabelVerticalAnchor,\n options?.circleLabelHorizontalAnchor,\n );\n\n // Determine coordinate anchor (priority: shape > options > default)\n const coordinateAnchor = (shapeCoordinateAnchor ??\n options?.circleLabelCoordinateAnchor ??\n defaultCoordinateAnchor) as CardinalLabelCoordinateAnchor;\n\n // Calculate position based on coordinate anchor\n const coordinates = findEdgePoint(ring, coordinateAnchor);\n\n if (!coordinates) {\n return null;\n }\n\n return {\n coordinates,\n ...resolved,\n };\n}\n\n/**\n * Get position for Polygon geometry\n * Uses cardinal direction positioning to find the edge point\n */\nfunction getPolygonPosition(\n geometry: Polygon,\n shape: Shape,\n shapeOffset: [number, number] | undefined,\n shapeVertical: string | undefined,\n shapeHorizontal: string | undefined,\n shapeCoordinateAnchor: string | undefined,\n options?: LabelPositionOptions,\n): LabelPosition2d | null {\n const ring = geometry.coordinates[0];\n\n // Circle shapes use circle-specific options\n if (isCircleShape(shape)) {\n return getCirclePosition(\n ring,\n shapeOffset,\n shapeVertical,\n shapeHorizontal,\n shapeCoordinateAnchor,\n options,\n );\n }\n\n // Regular polygons use cardinal direction positioning\n const defaultOffset: [number, number] = [0, 10];\n const defaultVertical: LabelVerticalPosition = 'top';\n const defaultHorizontal: LabelHorizontalPosition = 'center';\n const defaultCoordinateAnchor: CardinalLabelCoordinateAnchor = 'bottom';\n\n const resolved = resolveLabelProperties(\n shapeOffset,\n shapeVertical,\n shapeHorizontal,\n defaultOffset,\n defaultVertical,\n defaultHorizontal,\n options?.polygonLabelOffset,\n options?.polygonLabelVerticalAnchor,\n options?.polygonLabelHorizontalAnchor,\n );\n\n // Determine coordinate anchor (priority: shape > options > default)\n const coordinateAnchor = (shapeCoordinateAnchor ??\n options?.polygonLabelCoordinateAnchor ??\n defaultCoordinateAnchor) as CardinalLabelCoordinateAnchor;\n\n // Calculate position based on cardinal direction\n const coordinates = findEdgePoint(ring, coordinateAnchor);\n\n if (!coordinates) {\n return null;\n }\n\n return {\n coordinates,\n ...resolved,\n };\n}\n\n/**\n * Get 2D position for label based on geometry type\n * Uses pixel-based offsets for consistent positioning at all zoom levels\n *\n * Priority for positioning:\n * 1. Per-shape properties in styleProperties (highest)\n * 2. Global labelOptions from layer props\n * 3. Default values (fallback)\n *\n * Returns null if no valid coordinates can be determined\n */\nexport function getLabelPosition2d(\n shape: Shape,\n options?: LabelPositionOptions,\n): LabelPosition2d | null {\n const { geometry } = shape.feature;\n const styleProps = shape.feature.properties?.styleProperties;\n\n // Check if shape has custom label properties\n const shapeOffset = styleProps?.labelOffset as [number, number] | undefined;\n const shapeVertical = styleProps?.labelVerticalAnchor;\n const shapeHorizontal = styleProps?.labelHorizontalAnchor;\n const shapeCoordinateAnchor = styleProps?.labelCoordinateAnchor;\n\n switch (geometry.type) {\n case 'Point':\n return getPointPosition(\n geometry,\n shapeOffset,\n shapeVertical,\n shapeHorizontal,\n options,\n );\n\n case 'LineString':\n return getLineStringPosition(\n geometry,\n shapeOffset,\n shapeVertical,\n shapeHorizontal,\n shapeCoordinateAnchor,\n options,\n );\n\n case 'Polygon':\n return getPolygonPosition(\n geometry,\n shape,\n shapeOffset,\n shapeVertical,\n shapeHorizontal,\n shapeCoordinateAnchor,\n options,\n );\n\n default:\n // Unknown geometry type - return null\n return null;\n }\n}\n\n/**\n * Get label text for a shape\n *\n * Returns the display label for the shape on the map in uppercase.\n * - `label`: Optional short display name shown on the map (e.g., \"NYC\")\n * - `name`: Full shape name used internally (e.g., \"New York City Office\")\n *\n * If `label` is not provided, falls back to using `name`.\n * Text is automatically converted to uppercase for display.\n */\nexport function getLabelText(shape: Shape): string {\n return (shape.label || shape.name).toUpperCase();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuUA,SAAS,yBACP,UACA,YAIA;AAqBA,QAAO;EACL,YAjBE;GACF,MAAM;GACN,QAAQ;GACR,OAAO;GACR,CAa2B;EAC1B,mBARE;GACF,KAAK;GACL,QAAQ;GACR,QAAQ;GACT,CAIyC;EACzC;;;;;AAMH,SAAS,uBACP,aACA,eACA,iBACA,eACA,iBACA,mBACA,eACA,iBACA,mBACA;AAWA,QAAO;EACL,aALkB,eAAe,iBAAiB;EAMlD,GAJc,yBARE,iBAChB,mBACA,iBACkB,mBAClB,qBACA,kBAG4D;EAK7D;;;;;AAMH,SAAS,iBACP,UACA,aACA,eACA,iBACA,SACiB;CAKjB,MAAM,WAAW,uBACf,aACA,eACA,iBAPsC,CAAC,GAAG,GAAG,EACA,OACI,UASjD,SAAS,kBACT,SAAS,0BACT,SAAS,2BACV;AAED,QAAO;EACL,aAAa,CACX,SAAS,YAAY,MAAM,GAC3B,SAAS,YAAY,MAAM,EAC5B;EACD,GAAG;EACJ;;;;;;AAOH,SAAS,sBACP,UACA,aACA,eACA,iBACA,uBACA,SACwB;CACxB,MAAMA,gBAAkC,CAAC,GAAG,GAAG;CAC/C,MAAMC,kBAAyC;CAC/C,MAAMC,oBAA6C;CACnD,MAAMC,0BAAyD;CAE/D,MAAM,WAAW,uBACf,aACA,eACA,iBACA,eACA,iBACA,mBACA,SAAS,uBACT,SAAS,+BACT,SAAS,gCACV;CAGD,MAAM,mBAAoB,yBACxB,SAAS,mCACT;CAGF,MAAM,cAAc,cAClB,SAAS,aACT,iBACD;AAED,KAAI,CAAC,YACH,QAAO;AAGT,QAAO;EACL;EACA,GAAG;EACJ;;;;;AAMH,SAAS,oBACP,QACyB;AACzB,KAAI,CAAC,UAAU,OAAO,OAAO,UAAa,OAAO,OAAO,OACtD,QAAO;AAET,QAAO,CAAC,OAAO,IAAI,OAAO,GAAG;;;;;AAM/B,SAAS,uBACP,aACA,aACA,UACS;AAGT,QAAO,aAAa,SAAS,aAAa,UACtC,cAAc,cACd,cAAc;;;;;AAMpB,SAAS,kCACP,UACQ;AACR,QAAO,aAAa,SAAS,aAAa,WAAW,IAAI;;;;;;;;AAS3D,SAAS,kBAAkB,aAAkD;AAC3E,KAAI,YAAY,WAAW,EACzB,QAAO;CAGT,IAAI,OAAO;CACX,IAAI,OAAO;CACX,IAAI,QAAQ;AAEZ,MAAK,MAAM,SAAS,YAClB,KAAI,SAAS,MAAM,OAAO,UAAa,MAAM,OAAO,QAAW;AAC7D,UAAQ,MAAM;AACd,UAAQ,MAAM;AACd;;AAIJ,KAAI,UAAU,EACZ,QAAO;AAGT,QAAO,CAAC,OAAO,OAAO,OAAO,MAAM;;;;;;;;AASrC,SAAS,cACP,aACA,UACyB;AACzB,KAAI,CAAC,eAAe,YAAY,WAAW,EACzC,QAAO;AAIT,KAAI,aAAa,SACf,QAAO,kBAAkB,YAAY;CAIvC,IAAI,eAAe,YAAY;CAC/B,MAAM,kBAAkB,kCAAkC,SAAS;AAEnE,MAAK,MAAM,UAAU,aAAa;AAChC,MAAI,CAAC,OACH;AAEF,MAAI,CAAC,aACH;EAGF,MAAM,cAAc,OAAO;EAC3B,MAAM,cAAc,aAAa;AAEjC,MAAI,gBAAgB,UAAa,gBAAgB,OAC/C;AAGF,MAAI,uBAAuB,aAAa,aAAa,SAAS,CAC5D,gBAAe;;AAInB,QAAO,oBAAoB,aAAa;;;;;AAM1C,SAAS,kBACP,MACA,aACA,eACA,iBACA,uBACA,SACwB;CACxB,MAAMH,gBAAkC,CAAC,GAAG,GAAG;CAC/C,MAAMC,kBAAyC;CAC/C,MAAMC,oBAA6C;CACnD,MAAMC,0BAAyD;CAE/D,MAAM,WAAW,uBACf,aACA,eACA,iBACA,eACA,iBACA,mBACA,SAAS,mBACT,SAAS,2BACT,SAAS,4BACV;CAQD,MAAM,cAAc,cAAc,MALR,yBACxB,SAAS,+BACT,wBAGuD;AAEzD,KAAI,CAAC,YACH,QAAO;AAGT,QAAO;EACL;EACA,GAAG;EACJ;;;;;;AAOH,SAAS,mBACP,UACA,OACA,aACA,eACA,iBACA,uBACA,SACwB;CACxB,MAAM,OAAO,SAAS,YAAY;AAGlC,KAAI,cAAc,MAAM,CACtB,QAAO,kBACL,MACA,aACA,eACA,iBACA,uBACA,QACD;CAIH,MAAMH,gBAAkC,CAAC,GAAG,GAAG;CAC/C,MAAMC,kBAAyC;CAC/C,MAAMC,oBAA6C;CACnD,MAAMC,0BAAyD;CAE/D,MAAM,WAAW,uBACf,aACA,eACA,iBACA,eACA,iBACA,mBACA,SAAS,oBACT,SAAS,4BACT,SAAS,6BACV;CAQD,MAAM,cAAc,cAAc,MALR,yBACxB,SAAS,gCACT,wBAGuD;AAEzD,KAAI,CAAC,YACH,QAAO;AAGT,QAAO;EACL;EACA,GAAG;EACJ;;;;;;;;;;;;;AAcH,SAAgB,mBACd,OACA,SACwB;CACxB,MAAM,EAAE,aAAa,MAAM;CAC3B,MAAM,aAAa,MAAM,QAAQ,YAAY;CAG7C,MAAM,cAAc,YAAY;CAChC,MAAM,gBAAgB,YAAY;CAClC,MAAM,kBAAkB,YAAY;CACpC,MAAM,wBAAwB,YAAY;AAE1C,SAAQ,SAAS,MAAjB;EACE,KAAK,QACH,QAAO,iBACL,UACA,aACA,eACA,iBACA,QACD;EAEH,KAAK,aACH,QAAO,sBACL,UACA,aACA,eACA,iBACA,uBACA,QACD;EAEH,KAAK,UACH,QAAO,mBACL,UACA,OACA,aACA,eACA,iBACA,uBACA,QACD;EAEH,QAEE,QAAO;;;;;;;;;;;;;AAcb,SAAgB,aAAa,OAAsB;AACjD,SAAQ,MAAM,SAAS,MAAM,MAAM,aAAa"}
@@ -0,0 +1,46 @@
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 { ShapeFeatureType } from "../shared/types.js";
17
+
18
+ //#region src/deckgl/shapes/draw-shape-layer/constants.ts
19
+ /**
20
+ * Mode name for the map-mode integration
21
+ */
22
+ const DRAW_SHAPE_MODE = "draw-shape";
23
+ /**
24
+ * Identifier for the draw shape layer.
25
+ * Used as the owner for map-mode/cursor and as the default layer ID.
26
+ */
27
+ const DRAW_SHAPE_LAYER_ID = "draw-shape-layer";
28
+ /**
29
+ * Cursor type to use when drawing shapes
30
+ */
31
+ const DRAW_CURSOR = "crosshair";
32
+ /**
33
+ * Cursor mapping for each shape type (all use crosshair)
34
+ */
35
+ const DRAW_CURSOR_MAP = {
36
+ [ShapeFeatureType.Point]: DRAW_CURSOR,
37
+ [ShapeFeatureType.LineString]: DRAW_CURSOR,
38
+ [ShapeFeatureType.Polygon]: DRAW_CURSOR,
39
+ [ShapeFeatureType.Rectangle]: DRAW_CURSOR,
40
+ [ShapeFeatureType.Circle]: DRAW_CURSOR,
41
+ [ShapeFeatureType.Ellipse]: DRAW_CURSOR
42
+ };
43
+
44
+ //#endregion
45
+ export { DRAW_CURSOR_MAP, DRAW_SHAPE_LAYER_ID, DRAW_SHAPE_MODE };
46
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","names":["DRAW_CURSOR: CSSCursorType","DRAW_CURSOR_MAP: Record<ShapeFeatureType, CSSCursorType>"],"sources":["../../../../src/deckgl/shapes/draw-shape-layer/constants.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { ShapeFeatureType } from '../shared/types';\nimport type { CSSCursorType } from '@/map-cursor/types';\n\n/**\n * Mode name for the map-mode integration\n */\nexport const DRAW_SHAPE_MODE = 'draw-shape';\n\n/**\n * Identifier for the draw shape layer.\n * Used as the owner for map-mode/cursor and as the default layer ID.\n */\nexport const DRAW_SHAPE_LAYER_ID = 'draw-shape-layer';\n\n/**\n * Cursor type to use when drawing shapes\n */\nexport const DRAW_CURSOR: CSSCursorType = 'crosshair';\n\n/**\n * Cursor mapping for each shape type (all use crosshair)\n */\nexport const DRAW_CURSOR_MAP: Record<ShapeFeatureType, CSSCursorType> = {\n [ShapeFeatureType.Point]: DRAW_CURSOR,\n [ShapeFeatureType.LineString]: DRAW_CURSOR,\n [ShapeFeatureType.Polygon]: DRAW_CURSOR,\n [ShapeFeatureType.Rectangle]: DRAW_CURSOR,\n [ShapeFeatureType.Circle]: DRAW_CURSOR,\n [ShapeFeatureType.Ellipse]: DRAW_CURSOR,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoBA,MAAa,kBAAkB;;;;;AAM/B,MAAa,sBAAsB;;;;AAKnC,MAAaA,cAA6B;;;;AAK1C,MAAaC,kBAA2D;EACrE,iBAAiB,QAAQ;EACzB,iBAAiB,aAAa;EAC9B,iBAAiB,UAAU;EAC3B,iBAAiB,YAAY;EAC7B,iBAAiB,SAAS;EAC1B,iBAAiB,UAAU;CAC7B"}
@@ -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, ShapeFeatureType } from "../shared/types.js";
14
+ import { UniqueId } from "@accelint/core";
15
+
16
+ //#region src/deckgl/shapes/draw-shape-layer/events.d.ts
17
+ /**
18
+ * Drawing lifecycle events
19
+ */
20
+ declare const DrawShapeEvents: {
21
+ /** Drawing has started for a shape type */
22
+ readonly drawing: "shapes:drawing";
23
+ /** Shape has been successfully drawn/created */
24
+ readonly drawn: "shapes:drawn";
25
+ /** Drawing was canceled */
26
+ readonly canceled: "shapes:draw-canceled";
27
+ };
28
+ type DrawShapeEventType = (typeof DrawShapeEvents)[keyof typeof DrawShapeEvents];
29
+ /**
30
+ * Payload for shapes:drawing event.
31
+ */
32
+ type ShapeDrawingPayload = {
33
+ /** The shape type being drawn */
34
+ shapeType: ShapeFeatureType;
35
+ /** Map instance ID for multi-map event isolation */
36
+ mapId: UniqueId;
37
+ };
38
+ /**
39
+ * Event payload for shapes:drawing
40
+ * Emitted when drawing starts
41
+ */
42
+ type ShapeDrawingEvent = {
43
+ type: 'shapes:drawing';
44
+ payload: ShapeDrawingPayload;
45
+ source: UniqueId;
46
+ target?: UniqueId;
47
+ };
48
+ /**
49
+ * Payload for shapes:drawn event.
50
+ */
51
+ type ShapeDrawnPayload = {
52
+ /** The completed shape */
53
+ shape: Shape;
54
+ /** Map instance ID for multi-map event isolation */
55
+ mapId: UniqueId;
56
+ };
57
+ /**
58
+ * Event payload for shapes:drawn
59
+ * Emitted when a shape is successfully created
60
+ */
61
+ type ShapeDrawnEvent = {
62
+ type: 'shapes:drawn';
63
+ payload: ShapeDrawnPayload;
64
+ source: UniqueId;
65
+ target?: UniqueId;
66
+ };
67
+ /**
68
+ * Payload for shapes:draw-canceled event.
69
+ */
70
+ type ShapeDrawCanceledPayload = {
71
+ /** The shape type that was being drawn */
72
+ shapeType: ShapeFeatureType;
73
+ /** Map instance ID for multi-map event isolation */
74
+ mapId: UniqueId;
75
+ };
76
+ /**
77
+ * Event payload for shapes:draw-canceled
78
+ * Emitted when drawing is canceled
79
+ */
80
+ type ShapeDrawCanceledEvent = {
81
+ type: 'shapes:draw-canceled';
82
+ payload: ShapeDrawCanceledPayload;
83
+ source: UniqueId;
84
+ target?: UniqueId;
85
+ };
86
+ /**
87
+ * Union of all draw shape event types
88
+ */
89
+ type DrawShapeEvent = ShapeDrawingEvent | ShapeDrawnEvent | ShapeDrawCanceledEvent;
90
+ //#endregion
91
+ export { DrawShapeEvent, DrawShapeEventType, DrawShapeEvents, ShapeDrawCanceledEvent, ShapeDrawCanceledPayload, ShapeDrawingEvent, ShapeDrawingPayload, ShapeDrawnEvent, ShapeDrawnPayload };
92
+ //# sourceMappingURL=events.d.ts.map