@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,210 @@
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 { ShapeId } from "../shared/types.js";
14
+ import { DisplayShapeLayerProps } from "./types.js";
15
+ import * as _deck_gl_core0 from "@deck.gl/core";
16
+ import { CompositeLayer, Layer, PickingInfo } from "@deck.gl/core";
17
+
18
+ //#region src/deckgl/shapes/display-shape-layer/index.d.ts
19
+ /**
20
+ * State type for DisplayShapeLayer
21
+ */
22
+ type DisplayShapeLayerState = {
23
+ /** Index of currently hovered shape, undefined when not hovering */
24
+ hoverIndex?: number;
25
+ /** ID of the last hovered shape for event deduplication */
26
+ lastHoveredId?: ShapeId | null;
27
+ /** Allow additional properties from base layer state */
28
+ [key: string]: unknown;
29
+ };
30
+ /**
31
+ * DisplayShapeLayer - Read-only shapes visualization layer
32
+ *
33
+ * A composite deck.gl layer for displaying geographic shapes with interactive features.
34
+ * Ideal for rendering shapes from external APIs or displaying read-only geographic data.
35
+ *
36
+ * ## Features
37
+ * - **Multiple geometry types**: Point, LineString, Polygon, and Circle
38
+ * - **Icon support**: Custom icons for Point geometries via icon atlases
39
+ * - **Interactive selection**: Click handling with dotted border and optional highlight
40
+ * - **Hover effects**: Border/outline width increases on hover for better UX
41
+ * - **Customizable labels**: Flexible label positioning with per-shape or global options
42
+ * - **Style properties**: Full control over colors, border/outline patterns, and opacity
43
+ * - **Event bus integration**: Automatically emits shape events via @accelint/bus
44
+ * - **Multi-map support**: Events include map instance ID for isolation
45
+ *
46
+ * ## Selection Visual Feedback
47
+ * When a shape is selected via `selectedShapeId`:
48
+ * - The shape's border/outline pattern changes to dotted
49
+ * - An optional highlight renders underneath (controlled by `showHighlight` prop)
50
+ *
51
+ * ## Layer Structure
52
+ * Renders up to four sublayers (in order, bottom to top):
53
+ * 1. **Highlight layer**: Selection highlight effect for non-icon-Point shapes (if showHighlight=true)
54
+ * 2. **Coffin corners layer**: Selection/hover feedback for Point shapes with icons
55
+ * 3. **Main GeoJsonLayer**: Shape geometries with styling and interaction
56
+ * 4. **Label layer**: Text labels (if showLabels enabled)
57
+ *
58
+ * ## Icon Atlas Constraint
59
+ * When using icons for Point geometries, all shapes in a single layer must share the
60
+ * same icon atlas. The layer uses the first atlas found across all features. If you
61
+ * need icons from different atlases, use separate DisplayShapeLayer instances.
62
+ *
63
+ * ## Event Bus Integration
64
+ * Automatically emits shape events that can be consumed anywhere in your app:
65
+ * - `shapes:selected` - Emitted when a shape is clicked (includes mapId)
66
+ * - `shapes:hovered` - Emitted when the hovered shape changes (deduplicated, includes mapId)
67
+ *
68
+ * For selection with auto-deselection, use the companion `useSelectShape` hook which handles
69
+ * all the event wiring automatically. See the example below.
70
+ *
71
+ * @example Basic usage with useSelectShape hook (recommended)
72
+ * ```tsx
73
+ * import '@accelint/map-toolkit/deckgl/shapes/display-shape-layer/fiber';
74
+ * import { useSelectShape } from '@accelint/map-toolkit/deckgl/shapes';
75
+ * import { uuid } from '@accelint/core';
76
+ *
77
+ * const MAP_ID = uuid();
78
+ *
79
+ * function MapWithShapes() {
80
+ * const { selectedId } = useSelectShape(MAP_ID);
81
+ *
82
+ * return (
83
+ * <BaseMap id={MAP_ID}>
84
+ * <displayShapeLayer
85
+ * id="my-shapes"
86
+ * mapId={MAP_ID}
87
+ * data={shapes}
88
+ * selectedShapeId={selectedId}
89
+ * showLabels="always"
90
+ * pickable={true}
91
+ * />
92
+ * </BaseMap>
93
+ * );
94
+ * }
95
+ * ```
96
+ *
97
+ * @example With custom label positioning
98
+ * ```tsx
99
+ * <displayShapeLayer
100
+ * id="my-shapes"
101
+ * data={shapes}
102
+ * showLabels="always"
103
+ * labelOptions={{
104
+ * // Position circle labels at the top
105
+ * circleLabelCoordinateAnchor: 'top',
106
+ * circleLabelVerticalAnchor: 'bottom',
107
+ * circleLabelOffset: [0, -10],
108
+ * // Position line labels at the middle
109
+ * lineStringLabelCoordinateAnchor: 'middle',
110
+ * }}
111
+ * />
112
+ * ```
113
+ */
114
+ declare class DisplayShapeLayer extends CompositeLayer<DisplayShapeLayerProps> {
115
+ state: DisplayShapeLayerState;
116
+ /** Cache for transformed features to avoid recreating objects on every render */
117
+ private featuresCache;
118
+ static layerName: string;
119
+ static defaultProps: {
120
+ pickable: boolean;
121
+ showLabels: "always";
122
+ showHighlight: boolean;
123
+ applyBaseOpacity: boolean;
124
+ highlightColor: _deck_gl_core0.Color;
125
+ };
126
+ /**
127
+ * Clean up state and caches when layer is destroyed
128
+ */
129
+ finalizeState(): void;
130
+ /**
131
+ * Override getPickingInfo to handle events from sublayers
132
+ * This is the correct pattern for CompositeLayer event handling
133
+ */
134
+ getPickingInfo({
135
+ info,
136
+ mode,
137
+ sourceLayer
138
+ }: {
139
+ info: PickingInfo;
140
+ mode?: string;
141
+ sourceLayer?: any;
142
+ }): {
143
+ color: Uint8Array | null;
144
+ layer: Layer | null;
145
+ sourceLayer?: Layer | null;
146
+ viewport?: _deck_gl_core0.Viewport;
147
+ index: number;
148
+ picked: boolean;
149
+ object?: any;
150
+ x: number;
151
+ y: number;
152
+ pixel?: [number, number];
153
+ coordinate?: number[];
154
+ devicePixel?: [number, number];
155
+ pixelRatio: number;
156
+ };
157
+ /**
158
+ * Convert shapes to GeoJSON features with shapeId in properties.
159
+ * Uses caching to avoid recreating objects on every render cycle.
160
+ */
161
+ private getFeaturesWithId;
162
+ /**
163
+ * Look up a shape by ID from the data prop.
164
+ * Used by event handlers to get full shape without storing in feature properties.
165
+ */
166
+ private getShapeById;
167
+ /**
168
+ * Handle shape click
169
+ */
170
+ private handleShapeClick;
171
+ /**
172
+ * Handle shape hover
173
+ */
174
+ private handleShapeHover;
175
+ /**
176
+ * Render highlight sublayer (underneath main layer)
177
+ * Note: Points with icons use coffin corners instead of highlight layer
178
+ */
179
+ private renderHighlightLayer;
180
+ /**
181
+ * Render coffin corners layer for Point geometries that have icons on hover/select
182
+ * Coffin corners provide visual feedback for points instead of highlight layer
183
+ */
184
+ private renderCoffinCornersLayer;
185
+ /**
186
+ * Extract icon configuration from features in a single pass.
187
+ * Returns the first icon's atlas and mapping (all shapes share the same atlas).
188
+ * Uses early return for O(1) best case when first feature has icons.
189
+ */
190
+ private getIconConfig;
191
+ /**
192
+ * Render main shapes layer
193
+ */
194
+ private renderMainLayer;
195
+ /**
196
+ * Render labels layer
197
+ * Supports three modes:
198
+ * - 'always': Show labels for all shapes
199
+ * - 'hover': Show label only for the currently hovered shape
200
+ * - 'never': No labels
201
+ */
202
+ private renderLabelsLayer;
203
+ /**
204
+ * Render all sublayers
205
+ */
206
+ renderLayers(): Layer[];
207
+ }
208
+ //#endregion
209
+ export { DisplayShapeLayer };
210
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,449 @@
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 { DASH_ARRAYS, SHAPE_LAYER_IDS } from "../shared/constants.js";
17
+ import { ShapeEvents } from "../shared/events.js";
18
+ import { getDashArray, getFillColor, getLineColor } from "../shared/utils/style-utils.js";
19
+ import { COFFIN_CORNERS, DEFAULT_DISPLAY_PROPS, MAP_INTERACTION } from "./constants.js";
20
+ import { createShapeLabelLayer } from "./shape-label-layer.js";
21
+ import { getHighlightColor, getHighlightLineWidth, getHoverLineWidth } from "./utils/display-style.js";
22
+ import { Broadcast } from "@accelint/bus";
23
+ import { getLogger } from "@accelint/logger";
24
+ import { CompositeLayer } from "@deck.gl/core";
25
+ import { PathStyleExtension } from "@deck.gl/extensions";
26
+ import { GeoJsonLayer, IconLayer } from "@deck.gl/layers";
27
+
28
+ //#region src/deckgl/shapes/display-shape-layer/index.ts
29
+ const logger = getLogger({
30
+ enabled: process.env.NODE_ENV !== "production",
31
+ level: "warn",
32
+ prefix: "[DisplayShapeLayer]",
33
+ pretty: true
34
+ });
35
+ /**
36
+ * Typed event bus instance for shape events.
37
+ * Provides type-safe event emission for shape interactions.
38
+ */
39
+ const shapeBus = Broadcast.getInstance();
40
+ /**
41
+ * DisplayShapeLayer - Read-only shapes visualization layer
42
+ *
43
+ * A composite deck.gl layer for displaying geographic shapes with interactive features.
44
+ * Ideal for rendering shapes from external APIs or displaying read-only geographic data.
45
+ *
46
+ * ## Features
47
+ * - **Multiple geometry types**: Point, LineString, Polygon, and Circle
48
+ * - **Icon support**: Custom icons for Point geometries via icon atlases
49
+ * - **Interactive selection**: Click handling with dotted border and optional highlight
50
+ * - **Hover effects**: Border/outline width increases on hover for better UX
51
+ * - **Customizable labels**: Flexible label positioning with per-shape or global options
52
+ * - **Style properties**: Full control over colors, border/outline patterns, and opacity
53
+ * - **Event bus integration**: Automatically emits shape events via @accelint/bus
54
+ * - **Multi-map support**: Events include map instance ID for isolation
55
+ *
56
+ * ## Selection Visual Feedback
57
+ * When a shape is selected via `selectedShapeId`:
58
+ * - The shape's border/outline pattern changes to dotted
59
+ * - An optional highlight renders underneath (controlled by `showHighlight` prop)
60
+ *
61
+ * ## Layer Structure
62
+ * Renders up to four sublayers (in order, bottom to top):
63
+ * 1. **Highlight layer**: Selection highlight effect for non-icon-Point shapes (if showHighlight=true)
64
+ * 2. **Coffin corners layer**: Selection/hover feedback for Point shapes with icons
65
+ * 3. **Main GeoJsonLayer**: Shape geometries with styling and interaction
66
+ * 4. **Label layer**: Text labels (if showLabels enabled)
67
+ *
68
+ * ## Icon Atlas Constraint
69
+ * When using icons for Point geometries, all shapes in a single layer must share the
70
+ * same icon atlas. The layer uses the first atlas found across all features. If you
71
+ * need icons from different atlases, use separate DisplayShapeLayer instances.
72
+ *
73
+ * ## Event Bus Integration
74
+ * Automatically emits shape events that can be consumed anywhere in your app:
75
+ * - `shapes:selected` - Emitted when a shape is clicked (includes mapId)
76
+ * - `shapes:hovered` - Emitted when the hovered shape changes (deduplicated, includes mapId)
77
+ *
78
+ * For selection with auto-deselection, use the companion `useSelectShape` hook which handles
79
+ * all the event wiring automatically. See the example below.
80
+ *
81
+ * @example Basic usage with useSelectShape hook (recommended)
82
+ * ```tsx
83
+ * import '@accelint/map-toolkit/deckgl/shapes/display-shape-layer/fiber';
84
+ * import { useSelectShape } from '@accelint/map-toolkit/deckgl/shapes';
85
+ * import { uuid } from '@accelint/core';
86
+ *
87
+ * const MAP_ID = uuid();
88
+ *
89
+ * function MapWithShapes() {
90
+ * const { selectedId } = useSelectShape(MAP_ID);
91
+ *
92
+ * return (
93
+ * <BaseMap id={MAP_ID}>
94
+ * <displayShapeLayer
95
+ * id="my-shapes"
96
+ * mapId={MAP_ID}
97
+ * data={shapes}
98
+ * selectedShapeId={selectedId}
99
+ * showLabels="always"
100
+ * pickable={true}
101
+ * />
102
+ * </BaseMap>
103
+ * );
104
+ * }
105
+ * ```
106
+ *
107
+ * @example With custom label positioning
108
+ * ```tsx
109
+ * <displayShapeLayer
110
+ * id="my-shapes"
111
+ * data={shapes}
112
+ * showLabels="always"
113
+ * labelOptions={{
114
+ * // Position circle labels at the top
115
+ * circleLabelCoordinateAnchor: 'top',
116
+ * circleLabelVerticalAnchor: 'bottom',
117
+ * circleLabelOffset: [0, -10],
118
+ * // Position line labels at the middle
119
+ * lineStringLabelCoordinateAnchor: 'middle',
120
+ * }}
121
+ * />
122
+ * ```
123
+ */
124
+ var DisplayShapeLayer = class extends CompositeLayer {
125
+ /** Cache for transformed features to avoid recreating objects on every render */
126
+ featuresCache = null;
127
+ static layerName = "DisplayShapeLayer";
128
+ static defaultProps = { ...DEFAULT_DISPLAY_PROPS };
129
+ /**
130
+ * Clean up state and caches when layer is destroyed
131
+ */
132
+ finalizeState() {
133
+ if (this.state?.hoverIndex !== void 0) this.setState({
134
+ hoverIndex: void 0,
135
+ lastHoveredId: void 0
136
+ });
137
+ this.featuresCache = null;
138
+ }
139
+ /**
140
+ * Override getPickingInfo to handle events from sublayers
141
+ * This is the correct pattern for CompositeLayer event handling
142
+ */
143
+ getPickingInfo({ info, mode, sourceLayer }) {
144
+ if (sourceLayer?.id === `${this.props.id}-${SHAPE_LAYER_IDS.DISPLAY}`) {
145
+ if (mode === "query") this.handleShapeClick(info);
146
+ if (mode === "hover" || !mode) {
147
+ if (info.index !== void 0 && info.index !== this.state?.hoverIndex) this.setState({ hoverIndex: info.index });
148
+ else if (info.index === void 0 && this.state?.hoverIndex !== void 0) this.setState({ hoverIndex: void 0 });
149
+ this.handleShapeHover(info);
150
+ }
151
+ }
152
+ return info;
153
+ }
154
+ /**
155
+ * Convert shapes to GeoJSON features with shapeId in properties.
156
+ * Uses caching to avoid recreating objects on every render cycle.
157
+ */
158
+ getFeaturesWithId() {
159
+ const { data } = this.props;
160
+ if (this.featuresCache?.data === data) return this.featuresCache.features;
161
+ const features = [];
162
+ const shapeIdToIndex = /* @__PURE__ */ new Map();
163
+ for (const [i, shape] of data.entries()) {
164
+ features.push({
165
+ ...shape.feature,
166
+ properties: {
167
+ ...shape.feature.properties,
168
+ shapeId: shape.id
169
+ }
170
+ });
171
+ shapeIdToIndex.set(shape.id, i);
172
+ }
173
+ this.featuresCache = {
174
+ data,
175
+ features,
176
+ shapeIdToIndex
177
+ };
178
+ return features;
179
+ }
180
+ /**
181
+ * Look up a shape by ID from the data prop.
182
+ * Used by event handlers to get full shape without storing in feature properties.
183
+ */
184
+ getShapeById(shapeId) {
185
+ return this.props.data.find((shape) => shape.id === shapeId);
186
+ }
187
+ /**
188
+ * Handle shape click
189
+ */
190
+ handleShapeClick = (info) => {
191
+ const { onShapeClick, mapId } = this.props;
192
+ if (!info.object) return;
193
+ const shapeId = info.object.properties?.shapeId;
194
+ if (!shapeId) return;
195
+ const shape = this.getShapeById(shapeId);
196
+ if (!shape) return;
197
+ shapeBus.emit(ShapeEvents.selected, {
198
+ shapeId: shape.id,
199
+ mapId
200
+ });
201
+ if (onShapeClick) onShapeClick(shape);
202
+ };
203
+ /**
204
+ * Handle shape hover
205
+ */
206
+ handleShapeHover = (info) => {
207
+ const { onShapeHover, mapId } = this.props;
208
+ const shapeId = info.object?.properties?.shapeId ?? null;
209
+ const shape = shapeId ? this.getShapeById(shapeId) ?? null : null;
210
+ if (shapeId !== this.state?.lastHoveredId) {
211
+ this.setState({ lastHoveredId: shapeId });
212
+ shapeBus.emit(ShapeEvents.hovered, {
213
+ shapeId,
214
+ mapId
215
+ });
216
+ }
217
+ if (onShapeHover) onShapeHover(shape);
218
+ };
219
+ /**
220
+ * Render highlight sublayer (underneath main layer)
221
+ * Note: Points with icons use coffin corners instead of highlight layer
222
+ */
223
+ renderHighlightLayer(features) {
224
+ const { selectedShapeId, showHighlight, highlightColor } = this.props;
225
+ if (!selectedShapeId || showHighlight === false) return null;
226
+ const selectedFeature = features.find((f) => f.properties?.shapeId === selectedShapeId);
227
+ if (!selectedFeature) return null;
228
+ if (selectedFeature.geometry.type === "Point") {
229
+ if (!!selectedFeature.properties?.styleProperties?.icon) return null;
230
+ }
231
+ return new GeoJsonLayer({
232
+ id: `${this.props.id}-${SHAPE_LAYER_IDS.DISPLAY_HIGHLIGHT}`,
233
+ data: [selectedFeature],
234
+ filled: true,
235
+ stroked: true,
236
+ lineWidthUnits: "pixels",
237
+ lineWidthMinPixels: MAP_INTERACTION.LINE_WIDTH_MIN_PIXELS,
238
+ getFillColor: () => [
239
+ 0,
240
+ 0,
241
+ 0,
242
+ 0
243
+ ],
244
+ getLineColor: () => highlightColor || getHighlightColor(),
245
+ getLineWidth: getHighlightLineWidth,
246
+ pickable: false,
247
+ updateTriggers: {
248
+ getLineColor: [highlightColor],
249
+ getLineWidth: [selectedShapeId, features]
250
+ }
251
+ });
252
+ }
253
+ /**
254
+ * Render coffin corners layer for Point geometries that have icons on hover/select
255
+ * Coffin corners provide visual feedback for points instead of highlight layer
256
+ */
257
+ renderCoffinCornersLayer(features) {
258
+ const { selectedShapeId } = this.props;
259
+ const hoverIndex = this.state?.hoverIndex;
260
+ const shapeIdToIndex = this.featuresCache?.shapeIdToIndex;
261
+ if (!shapeIdToIndex) return null;
262
+ const pointFeatures = features.filter((f) => {
263
+ if (f.geometry.type !== "Point") return false;
264
+ if (!!!f.properties?.styleProperties?.icon) return false;
265
+ const shapeId = f.properties?.shapeId;
266
+ const isSelected = shapeId === selectedShapeId;
267
+ const featureIndex = shapeId ? shapeIdToIndex.get(shapeId) : void 0;
268
+ return isSelected || hoverIndex !== void 0 && featureIndex === hoverIndex;
269
+ });
270
+ if (pointFeatures.length === 0) return null;
271
+ const firstPointIcon = pointFeatures[0]?.properties?.styleProperties?.icon;
272
+ const iconAtlas = firstPointIcon?.atlas;
273
+ const iconMapping = firstPointIcon?.mapping;
274
+ if (!(iconAtlas && iconMapping)) {
275
+ logger.warn("Point shape has icon style but missing iconAtlas or iconMapping - coffin corners will not render");
276
+ return null;
277
+ }
278
+ const extendedMapping = {
279
+ ...iconMapping,
280
+ [COFFIN_CORNERS.HOVER_ICON]: {
281
+ x: 0,
282
+ y: 0,
283
+ width: 76,
284
+ height: 76,
285
+ mask: false
286
+ },
287
+ [COFFIN_CORNERS.SELECTED_ICON]: {
288
+ x: 76,
289
+ y: 0,
290
+ width: 76,
291
+ height: 76,
292
+ mask: false
293
+ },
294
+ [COFFIN_CORNERS.SELECTED_HOVER_ICON]: {
295
+ x: 152,
296
+ y: 0,
297
+ width: 76,
298
+ height: 76,
299
+ mask: false
300
+ }
301
+ };
302
+ return new IconLayer({
303
+ id: `${this.props.id}-${SHAPE_LAYER_IDS.DISPLAY}-coffin-corners`,
304
+ data: pointFeatures,
305
+ iconAtlas,
306
+ iconMapping: extendedMapping,
307
+ getIcon: (d) => {
308
+ const shapeId = d.properties?.shapeId;
309
+ const isSelected = shapeId === selectedShapeId;
310
+ const featureIndex = shapeId ? shapeIdToIndex.get(shapeId) : void 0;
311
+ if (isSelected && hoverIndex !== void 0 && featureIndex === hoverIndex) return COFFIN_CORNERS.SELECTED_HOVER_ICON;
312
+ if (isSelected) return COFFIN_CORNERS.SELECTED_ICON;
313
+ return COFFIN_CORNERS.HOVER_ICON;
314
+ },
315
+ getSize: COFFIN_CORNERS.SIZE,
316
+ getPosition: (d) => {
317
+ return d.geometry.type === "Point" ? d.geometry.coordinates : [0, 0];
318
+ },
319
+ getPixelOffset: (d) => {
320
+ return [-1, -(d.properties?.styleProperties?.icon?.size ?? MAP_INTERACTION.ICON_SIZE) / 2];
321
+ },
322
+ billboard: false,
323
+ pickable: false,
324
+ updateTriggers: {
325
+ getIcon: [selectedShapeId, this.state?.hoverIndex],
326
+ data: [
327
+ features,
328
+ selectedShapeId,
329
+ this.state?.hoverIndex
330
+ ]
331
+ }
332
+ });
333
+ }
334
+ /**
335
+ * Extract icon configuration from features in a single pass.
336
+ * Returns the first icon's atlas and mapping (all shapes share the same atlas).
337
+ * Uses early return for O(1) best case when first feature has icons.
338
+ */
339
+ getIconConfig(features) {
340
+ for (const f of features) {
341
+ const icon = f.properties?.styleProperties?.icon;
342
+ if (icon) return {
343
+ hasIcons: true,
344
+ atlas: icon.atlas,
345
+ mapping: icon.mapping
346
+ };
347
+ }
348
+ return { hasIcons: false };
349
+ }
350
+ /**
351
+ * Render main shapes layer
352
+ */
353
+ renderMainLayer(features) {
354
+ const { pickable, applyBaseOpacity, selectedShapeId } = this.props;
355
+ const { hasIcons, atlas: iconAtlas, mapping: iconMapping } = this.getIconConfig(features);
356
+ return new GeoJsonLayer({
357
+ id: `${this.props.id}-${SHAPE_LAYER_IDS.DISPLAY}`,
358
+ data: features,
359
+ filled: true,
360
+ stroked: true,
361
+ getFillColor: (d) => getFillColor(d, applyBaseOpacity),
362
+ getLineColor,
363
+ getLineWidth: (d, info) => {
364
+ return getHoverLineWidth(d, info?.index === this.state?.hoverIndex);
365
+ },
366
+ lineWidthUnits: "pixels",
367
+ lineWidthMinPixels: MAP_INTERACTION.LINE_WIDTH_MIN_PIXELS,
368
+ lineWidthMaxPixels: 20,
369
+ pointType: hasIcons ? "icon" : "circle",
370
+ getPointRadius: (d) => {
371
+ return d.properties?.styleProperties?.icon?.size ?? 2;
372
+ },
373
+ pointRadiusUnits: "pixels",
374
+ ...hasIcons && iconAtlas ? { iconAtlas } : {},
375
+ ...hasIcons && iconMapping ? { iconMapping } : {},
376
+ ...hasIcons ? {
377
+ getIcon: (d) => d.properties?.styleProperties?.icon?.name ?? "marker",
378
+ getIconSize: (d) => {
379
+ return d.properties?.styleProperties?.icon?.size ?? MAP_INTERACTION.ICON_SIZE;
380
+ },
381
+ getIconColor: getLineColor,
382
+ getIconPixelOffset: (d) => {
383
+ return [-1, -(d.properties?.styleProperties?.icon?.size ?? MAP_INTERACTION.ICON_SIZE) / 2];
384
+ },
385
+ iconBillboard: false
386
+ } : {},
387
+ extensions: [new PathStyleExtension({ dash: true })],
388
+ getDashArray: (d) => {
389
+ if (d.properties?.shapeId === selectedShapeId) return DASH_ARRAYS.dotted;
390
+ return getDashArray(d);
391
+ },
392
+ pickable,
393
+ autoHighlight: false,
394
+ updateTriggers: {
395
+ getFillColor: [features, applyBaseOpacity],
396
+ getLineColor: [features],
397
+ getLineWidth: [features, this.state?.hoverIndex],
398
+ getDashArray: [features, selectedShapeId],
399
+ getPointRadius: [features],
400
+ ...hasIcons ? {
401
+ getIcon: [features],
402
+ getIconSize: [features],
403
+ getIconColor: [features],
404
+ getIconPixelOffset: [features]
405
+ } : {}
406
+ }
407
+ });
408
+ }
409
+ /**
410
+ * Render labels layer
411
+ * Supports three modes:
412
+ * - 'always': Show labels for all shapes
413
+ * - 'hover': Show label only for the currently hovered shape
414
+ * - 'never': No labels
415
+ */
416
+ renderLabelsLayer() {
417
+ const { showLabels, data, labelOptions } = this.props;
418
+ if (showLabels === "never") return null;
419
+ let labelData = data;
420
+ if (showLabels === "hover") {
421
+ const hoverIndex = this.state?.hoverIndex;
422
+ if (hoverIndex === void 0) return null;
423
+ const hoveredShape = data[hoverIndex];
424
+ labelData = hoveredShape ? [hoveredShape] : [];
425
+ }
426
+ if (labelData.length === 0) return null;
427
+ return createShapeLabelLayer({
428
+ id: `${this.props.id}-${SHAPE_LAYER_IDS.DISPLAY_LABELS}`,
429
+ data: labelData,
430
+ labelOptions
431
+ });
432
+ }
433
+ /**
434
+ * Render all sublayers
435
+ */
436
+ renderLayers() {
437
+ const features = this.getFeaturesWithId();
438
+ return [
439
+ this.renderHighlightLayer(features),
440
+ this.renderCoffinCornersLayer(features),
441
+ this.renderMainLayer(features),
442
+ this.renderLabelsLayer()
443
+ ].filter(Boolean);
444
+ }
445
+ };
446
+
447
+ //#endregion
448
+ export { DisplayShapeLayer };
449
+ //# sourceMappingURL=index.js.map