@accelint/map-toolkit 0.5.0 → 0.6.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 (145) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/catalog-info.yaml +5 -3
  3. package/dist/camera/use-camera-state.js +1 -2
  4. package/dist/camera/use-camera-state.js.map +1 -1
  5. package/dist/deckgl/base-map/constants.d.ts +9 -2
  6. package/dist/deckgl/base-map/constants.js +9 -2
  7. package/dist/deckgl/base-map/constants.js.map +1 -1
  8. package/dist/deckgl/base-map/index.d.ts +4 -2
  9. package/dist/deckgl/base-map/index.js +5 -6
  10. package/dist/deckgl/base-map/index.js.map +1 -1
  11. package/dist/deckgl/base-map/types.d.ts +6 -1
  12. package/dist/deckgl/index.d.ts +8 -2
  13. package/dist/deckgl/index.js +6 -2
  14. package/dist/deckgl/saved-viewports/index.d.ts +1 -1
  15. package/dist/deckgl/saved-viewports/index.js +1 -2
  16. package/dist/deckgl/saved-viewports/index.js.map +1 -1
  17. package/dist/deckgl/shapes/display-shape-layer/constants.d.ts +44 -0
  18. package/dist/deckgl/shapes/display-shape-layer/constants.js +61 -0
  19. package/dist/deckgl/shapes/display-shape-layer/constants.js.map +1 -0
  20. 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
  21. package/dist/{packages/hotkey-manager/dist/lib/is-client/index.js → deckgl/shapes/display-shape-layer/fiber.js} +6 -7
  22. package/dist/deckgl/shapes/display-shape-layer/fiber.js.map +1 -0
  23. package/dist/deckgl/shapes/display-shape-layer/index.d.ts +206 -0
  24. package/dist/deckgl/shapes/display-shape-layer/index.js +416 -0
  25. package/dist/deckgl/shapes/display-shape-layer/index.js.map +1 -0
  26. package/dist/deckgl/shapes/display-shape-layer/shape-label-layer.d.ts +66 -0
  27. package/dist/deckgl/shapes/display-shape-layer/shape-label-layer.js +116 -0
  28. package/dist/deckgl/shapes/display-shape-layer/shape-label-layer.js.map +1 -0
  29. package/dist/deckgl/shapes/display-shape-layer/store.d.ts +87 -0
  30. package/dist/deckgl/shapes/display-shape-layer/store.js +316 -0
  31. package/dist/deckgl/shapes/display-shape-layer/store.js.map +1 -0
  32. package/dist/deckgl/shapes/display-shape-layer/types.d.ts +115 -0
  33. 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/display-shape-layer/types.js} +0 -2
  34. package/dist/deckgl/shapes/display-shape-layer/use-shape-selection.d.ts +89 -0
  35. package/dist/deckgl/shapes/display-shape-layer/use-shape-selection.js +88 -0
  36. package/dist/deckgl/shapes/display-shape-layer/use-shape-selection.js.map +1 -0
  37. package/dist/deckgl/shapes/display-shape-layer/utils/display-style.d.ts +61 -0
  38. package/dist/deckgl/shapes/display-shape-layer/utils/display-style.js +111 -0
  39. package/dist/deckgl/shapes/display-shape-layer/utils/display-style.js.map +1 -0
  40. package/dist/deckgl/shapes/display-shape-layer/utils/labels.d.ts +196 -0
  41. package/dist/deckgl/shapes/display-shape-layer/utils/labels.js +368 -0
  42. package/dist/deckgl/shapes/display-shape-layer/utils/labels.js.map +1 -0
  43. package/dist/deckgl/shapes/index.d.ts +20 -0
  44. package/dist/{node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/math-utils.js → deckgl/shapes/index.js} +6 -11
  45. package/dist/deckgl/shapes/shared/constants.d.ts +78 -0
  46. package/dist/deckgl/shapes/shared/constants.js +109 -0
  47. package/dist/deckgl/shapes/shared/constants.js.map +1 -0
  48. package/dist/deckgl/shapes/shared/events.d.ts +73 -0
  49. package/dist/deckgl/shapes/shared/events.js +58 -0
  50. package/dist/deckgl/shapes/shared/events.js.map +1 -0
  51. package/dist/deckgl/shapes/shared/types.d.ts +158 -0
  52. package/dist/{node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/get-bounds.js → deckgl/shapes/shared/types.js} +13 -4
  53. package/dist/deckgl/shapes/shared/types.js.map +1 -0
  54. package/dist/deckgl/symbol-layer/index.d.ts +1 -1
  55. package/dist/viewport/viewport-size.d.ts +2 -2
  56. package/package.json +36 -20
  57. package/dist/_virtual/rolldown_runtime.js +0 -22
  58. package/dist/decorators/deckgl.d.ts +0 -19
  59. package/dist/decorators/deckgl.js +0 -32
  60. package/dist/decorators/deckgl.js.map +0 -1
  61. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/assert.js.map +0 -1
  62. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/fit-bounds.js +0 -63
  63. 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
  64. 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
  65. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/index.js +0 -19
  66. 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
  67. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/normalize-viewport-props.js +0 -14
  68. 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
  69. 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
  70. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/web-mercator-viewport.js +0 -16
  71. 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
  72. 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
  73. 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
  74. 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
  75. 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
  76. 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
  77. 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 +0 -15
  78. 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
  79. 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
  80. 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
  81. 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
  82. 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
  83. 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
  84. 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
  85. 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
  86. 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
  87. 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
  88. 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
  89. 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
  90. 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
  91. 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
  92. 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
  93. 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
  94. 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
  95. 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
  96. 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
  97. 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
  98. 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
  99. 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
  100. 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
  101. 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
  102. 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
  103. 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
  104. 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
  105. 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
  106. 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
  107. 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
  108. 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
  109. 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
  110. 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
  111. 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
  112. 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
  113. 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
  114. 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
  115. 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
  116. package/dist/node_modules/.pnpm/immer@10.2.0/node_modules/immer/dist/immer.js +0 -812
  117. package/dist/node_modules/.pnpm/immer@10.2.0/node_modules/immer/dist/immer.js.map +0 -1
  118. package/dist/node_modules/.pnpm/radashi@12.7.1/node_modules/radashi/dist/radashi.js +0 -35
  119. package/dist/node_modules/.pnpm/radashi@12.7.1/node_modules/radashi/dist/radashi.js.map +0 -1
  120. 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
  121. 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
  122. 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
  123. 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
  124. package/dist/node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js +0 -39
  125. package/dist/node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js.map +0 -1
  126. 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
  127. 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
  128. 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
  129. 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
  130. 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
  131. package/dist/packages/hotkey-manager/dist/actions/register-hotkey/index.js +0 -78
  132. package/dist/packages/hotkey-manager/dist/actions/register-hotkey/index.js.map +0 -1
  133. package/dist/packages/hotkey-manager/dist/constants.js +0 -47
  134. package/dist/packages/hotkey-manager/dist/constants.js.map +0 -1
  135. package/dist/packages/hotkey-manager/dist/enums/keycode.js +0 -130
  136. package/dist/packages/hotkey-manager/dist/enums/keycode.js.map +0 -1
  137. package/dist/packages/hotkey-manager/dist/lib/is-client/index.js.map +0 -1
  138. package/dist/packages/hotkey-manager/dist/lib/is-mac/index.js +0 -24
  139. package/dist/packages/hotkey-manager/dist/lib/is-mac/index.js.map +0 -1
  140. package/dist/packages/hotkey-manager/dist/lib/key-to-id/index.js +0 -39
  141. package/dist/packages/hotkey-manager/dist/lib/key-to-id/index.js.map +0 -1
  142. package/dist/packages/hotkey-manager/dist/lib/key-to-string/index.js +0 -27
  143. package/dist/packages/hotkey-manager/dist/lib/key-to-string/index.js.map +0 -1
  144. package/dist/packages/hotkey-manager/dist/stores/hotkey-store/index.js +0 -95
  145. package/dist/packages/hotkey-manager/dist/stores/hotkey-store/index.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","names":[],"sources":["../../../../src/deckgl/shapes/display-shape-layer/store.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 * Shape Selection Store\n *\n * This module provides a store pattern for managing shape selection state,\n * designed to work with React's `useSyncExternalStore` hook.\n *\n * ## Architecture\n *\n * The store uses a fan-out pattern similar to `map-cursor/store.ts` and `map-mode/store.ts`:\n * - **1 bus listener per mapId** - Regardless of how many React components subscribe\n * - **N React subscribers** - Each component gets notified via `useSyncExternalStore`\n * - **Automatic cleanup** - Bus listeners are removed when the last subscriber unmounts\n *\n * ## Why This Pattern?\n *\n * Without this pattern, using `useOn` directly in each React component would\n * create N bus listeners for N components subscribing to the same events.\n * The fan-out pattern ensures exactly 1 bus listener per mapId, regardless\n * of how many React components need the state. This also provides proper\n * cleanup semantics that prevent listener accumulation during HMR.\n *\n * ## Usage\n *\n * This module is internal to `useShapeSelection`. Use the hook instead:\n *\n * ```tsx\n * import { useShapeSelection } from '@accelint/map-toolkit/deckgl/shapes';\n *\n * const { selectedId, setSelectedId, clearSelection } = useShapeSelection(mapId);\n * ```\n *\n * @module\n */\n\nimport { Broadcast } from '@accelint/bus';\nimport { MapEvents } from '../../base-map/events';\nimport { type ShapeEvent, ShapeEvents } from '../shared/events';\nimport type { UniqueId } from '@accelint/core';\nimport type { MapClickEvent, MapEventType } from '../../base-map/types';\nimport type { ShapeId } from '../shared/types';\n\n/**\n * Typed event bus instances for shape and map events\n */\nconst shapeBus = Broadcast.getInstance<ShapeEvent>();\nconst mapBus = Broadcast.getInstance<MapEventType>();\n\n/**\n * Type representing the state for a single shape selection instance\n */\ntype ShapeSelectionState = {\n /** Currently selected shape ID, or undefined if nothing selected */\n selectedId: ShapeId | undefined;\n};\n\n/**\n * Store for shape selection state keyed by mapId\n */\nconst selectionStore = new Map<UniqueId, ShapeSelectionState>();\n\n/**\n * Track React component subscribers per mapId (for fan-out notifications).\n * Each Set contains onStoreChange callbacks from useSyncExternalStore.\n */\nconst componentSubscribers = new Map<UniqueId, Set<() => void>>();\n\n/**\n * Cache of bus unsubscribe functions (1 per mapId).\n * This ensures we only have one bus listener per map instance, regardless of\n * how many React components subscribe to it.\n */\nconst busUnsubscribers = new Map<UniqueId, () => void>();\n\ntype Subscription = (onStoreChange: () => void) => () => void;\n/**\n * Cache of subscription functions per mapId to avoid recreating on every render\n */\nconst subscriptionCache = new Map<UniqueId, Subscription>();\n\n/**\n * Cache of snapshot functions per mapId to maintain referential stability\n */\nconst snapshotCache = new Map<UniqueId, () => ShapeId | undefined>();\n\n/**\n * Cache of server snapshot functions per mapId to maintain referential stability.\n * Server snapshots always return undefined since selection state is client-only.\n */\nconst serverSnapshotCache = new Map<UniqueId, () => ShapeId | undefined>();\n\n/**\n * Cache of setSelectedId functions per mapId to maintain referential stability\n */\nconst setSelectedIdCache = new Map<\n UniqueId,\n (id: ShapeId | undefined) => void\n>();\n\n/**\n * Cache of clearSelection functions per mapId to maintain referential stability\n */\nconst clearSelectionCache = new Map<UniqueId, () => void>();\n\n/**\n * All state caches that need cleanup when an instance is removed\n */\nconst stateCaches = [\n selectionStore,\n componentSubscribers,\n subscriptionCache,\n snapshotCache,\n serverSnapshotCache,\n setSelectedIdCache,\n clearSelectionCache,\n] as const;\n\n/**\n * Clear all cached state for a given mapId\n */\nfunction clearAllCaches(mapId: UniqueId): void {\n for (const cache of stateCaches) {\n cache.delete(mapId);\n }\n}\n\n/**\n * Get or create selection state for a given mapId\n */\nfunction getOrCreateState(mapId: UniqueId): ShapeSelectionState {\n if (!selectionStore.has(mapId)) {\n selectionStore.set(mapId, {\n selectedId: undefined,\n });\n }\n // biome-ignore lint/style/noNonNullAssertion: State guaranteed to exist after has() check above\n return selectionStore.get(mapId)!;\n}\n\n/**\n * Get current selection snapshot for a given map instance (for useSyncExternalStore)\n */\nfunction getSnapshot(mapId: UniqueId): ShapeId | undefined {\n const state = selectionStore.get(mapId);\n return state?.selectedId;\n}\n\n/**\n * Notify all React subscribers for a given mapId\n */\nfunction notifySubscribers(mapId: UniqueId): void {\n const subscribers = componentSubscribers.get(mapId);\n if (subscribers) {\n for (const onStoreChange of subscribers) {\n onStoreChange();\n }\n }\n}\n\n/**\n * Ensures a single bus listener exists for the given mapId.\n * All React subscribers will be notified via fan-out when the bus events fire.\n * This prevents creating N bus listeners for N React components.\n *\n * @param mapId - The unique identifier for the map instance\n */\nfunction ensureBusListener(mapId: UniqueId): void {\n if (busUnsubscribers.has(mapId)) {\n return; // Already listening\n }\n\n const state = getOrCreateState(mapId);\n\n // Listen for shape selection events\n const unsubSelected = shapeBus.on(ShapeEvents.selected, (event) => {\n if (event.payload.mapId !== mapId) {\n return;\n }\n const previousId = state.selectedId;\n state.selectedId = event.payload.shapeId;\n if (previousId !== state.selectedId) {\n notifySubscribers(mapId);\n }\n });\n\n // Listen for shape deselection events\n const unsubDeselected = shapeBus.on(ShapeEvents.deselected, (event) => {\n if (event.payload.mapId !== mapId) {\n return;\n }\n const previousId = state.selectedId;\n state.selectedId = undefined;\n if (previousId !== state.selectedId) {\n notifySubscribers(mapId);\n }\n });\n\n // Listen for map clicks to detect clicks on empty space\n const unsubClick = mapBus.on(MapEvents.click, (event: MapClickEvent) => {\n // Only emit deselect if we have a selection and clicked on empty space\n // index is -1 when nothing is picked\n if (\n state.selectedId &&\n event.payload.id === mapId &&\n event.payload.info.index === -1\n ) {\n // Emit deselection event - this will be caught by our deselected listener above\n shapeBus.emit(ShapeEvents.deselected, { mapId });\n }\n });\n\n // Store composite cleanup function\n busUnsubscribers.set(mapId, () => {\n unsubSelected();\n unsubDeselected();\n unsubClick();\n });\n}\n\n/**\n * Cleans up the bus listener if no React subscribers remain.\n *\n * @param mapId - The unique identifier for the map instance\n */\nfunction cleanupBusListenerIfNeeded(mapId: UniqueId): void {\n const subscribers = componentSubscribers.get(mapId);\n\n if (!subscribers || subscribers.size === 0) {\n // No more React subscribers - clean up bus listener\n const unsub = busUnsubscribers.get(mapId);\n if (unsub) {\n unsub();\n busUnsubscribers.delete(mapId);\n }\n\n // Clean up all state\n clearAllCaches(mapId);\n }\n}\n\n/**\n * Creates or retrieves a cached subscription function for a given mapId.\n * Uses a fan-out pattern: 1 bus listener -> N React subscribers.\n * Automatically cleans up selection state when the last subscriber unsubscribes.\n *\n * @param mapId - The unique identifier for the map instance\n * @returns A subscription function for useSyncExternalStore\n */\nexport function getOrCreateSubscription(\n mapId: UniqueId,\n): (onStoreChange: () => void) => () => void {\n let subscription = subscriptionCache.get(mapId);\n if (!subscription) {\n subscription = (onStoreChange: () => void) => {\n // Ensure state exists\n getOrCreateState(mapId);\n\n // Ensure single bus listener exists for this mapId\n ensureBusListener(mapId);\n\n // Get or create the subscriber set for this map instance, then add this component's callback\n let subscriberSet = componentSubscribers.get(mapId);\n if (!subscriberSet) {\n subscriberSet = new Set();\n componentSubscribers.set(mapId, subscriberSet);\n }\n subscriberSet.add(onStoreChange);\n\n // Return cleanup function to remove this component's subscription\n return () => {\n const currentSubscriberSet = componentSubscribers.get(mapId);\n if (currentSubscriberSet) {\n currentSubscriberSet.delete(onStoreChange);\n }\n\n // Clean up bus listener if this was the last React subscriber\n cleanupBusListenerIfNeeded(mapId);\n };\n };\n\n subscriptionCache.set(mapId, subscription);\n }\n\n return subscription;\n}\n\n/**\n * Creates or retrieves a cached snapshot function for a given mapId.\n * The selection ID returned gets equality checked, so it needs to be stable or React re-renders unnecessarily.\n *\n * @param mapId - The unique identifier for the map instance\n * @returns A snapshot function for useSyncExternalStore\n */\nexport function getOrCreateSnapshot(\n mapId: UniqueId,\n): () => ShapeId | undefined {\n let snapshot = snapshotCache.get(mapId);\n if (!snapshot) {\n snapshot = () => getSnapshot(mapId);\n snapshotCache.set(mapId, snapshot);\n }\n\n return snapshot;\n}\n\n/**\n * Creates or retrieves a cached server snapshot function for a given mapId.\n * Server snapshots always return undefined since selection state is client-only.\n * Required for SSR/RSC compatibility with useSyncExternalStore.\n *\n * @param mapId - The unique identifier for the map instance\n * @returns A server snapshot function for useSyncExternalStore\n */\nexport function getOrCreateServerSnapshot(\n mapId: UniqueId,\n): () => ShapeId | undefined {\n let serverSnapshot = serverSnapshotCache.get(mapId);\n if (!serverSnapshot) {\n serverSnapshot = () => undefined;\n serverSnapshotCache.set(mapId, serverSnapshot);\n }\n\n return serverSnapshot;\n}\n\n/**\n * Creates or retrieves a cached setSelectedId function for a given mapId.\n * This maintains referential stability for the function reference.\n *\n * @param mapId - The unique identifier for the map instance\n * @returns A setSelectedId function for this instance\n */\nexport function getOrCreateSetSelectedId(\n mapId: UniqueId,\n): (id: ShapeId | undefined) => void {\n let setSelectedId = setSelectedIdCache.get(mapId);\n if (!setSelectedId) {\n setSelectedId = (id: ShapeId | undefined) => {\n const state = getOrCreateState(mapId);\n const previousId = state.selectedId;\n\n if (id === undefined && previousId !== undefined) {\n // Emit deselection event\n shapeBus.emit(ShapeEvents.deselected, { mapId });\n } else if (id !== undefined && previousId !== id) {\n // Emit selection event\n shapeBus.emit(ShapeEvents.selected, { shapeId: id, mapId });\n }\n };\n\n setSelectedIdCache.set(mapId, setSelectedId);\n }\n\n return setSelectedId;\n}\n\n/**\n * Creates or retrieves a cached clearSelection function for a given mapId.\n * This maintains referential stability for the function reference.\n *\n * Note: This always emits a deselected event, even if nothing is currently selected.\n * This matches the original behavior and allows consumers to use clearSelection\n * as a \"force deselect\" without needing to check selection state first.\n *\n * @param mapId - The unique identifier for the map instance\n * @returns A clearSelection function for this instance\n */\nexport function getOrCreateClearSelection(mapId: UniqueId): () => void {\n let clearSelection = clearSelectionCache.get(mapId);\n if (!clearSelection) {\n clearSelection = () => {\n shapeBus.emit(ShapeEvents.deselected, { mapId });\n };\n\n clearSelectionCache.set(mapId, clearSelection);\n }\n\n return clearSelection;\n}\n\n/**\n * Get the current selected shape ID for a given map instance (direct access, not reactive).\n * @internal - For internal map-toolkit use only\n *\n * @param mapId - The unique identifier for the map instance\n * @returns The currently selected shape ID, or undefined\n */\nexport function getSelectedShapeId(mapId: UniqueId): ShapeId | undefined {\n return getSnapshot(mapId);\n}\n\n/**\n * Manually clear all selection state for a specific mapId.\n * This is typically not needed as cleanup happens automatically when all subscribers unmount.\n * Use this only in advanced scenarios where manual cleanup is required.\n *\n * @param mapId - The unique identifier for the map instance to clear\n *\n * @example\n * ```tsx\n * // Manual cleanup (rarely needed)\n * clearSelectionState('my-map-instance');\n * ```\n */\nexport function clearSelectionState(mapId: UniqueId): void {\n // Unsubscribe from bus if listening\n const unsub = busUnsubscribers.get(mapId);\n if (unsub) {\n unsub();\n busUnsubscribers.delete(mapId);\n }\n\n // Clear all state\n clearAllCaches(mapId);\n}\n"],"mappings":"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"}
@@ -0,0 +1,115 @@
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 { EditableShape, ShapeId, StyledFeature as StyledFeature$1 } from "../shared/types.js";
14
+ import { LabelPositionOptions } from "./utils/labels.js";
15
+ import { UniqueId } from "@accelint/core";
16
+ import { CompositeLayerProps } from "@deck.gl/core";
17
+
18
+ //#region src/deckgl/shapes/display-shape-layer/types.d.ts
19
+ /**
20
+ * Re-export StyledFeature from shared types
21
+ */
22
+ type StyledFeature = StyledFeature$1;
23
+ /**
24
+ * Re-export StyledFeatureProperties from shared types
25
+ */
26
+ type StyledFeatureProperties = StyledFeature$1['properties'];
27
+ /**
28
+ * Props for DisplayShapeLayer
29
+ *
30
+ * @example Basic usage
31
+ * ```tsx
32
+ * const props: DisplayShapeLayerProps = {
33
+ * id: 'my-shapes',
34
+ * data: myShapes,
35
+ * pickable: true,
36
+ * showLabels: true,
37
+ * };
38
+ * ```
39
+ */
40
+ interface DisplayShapeLayerProps extends CompositeLayerProps {
41
+ /** Unique layer ID - required for deck.gl layer management */
42
+ id: string;
43
+ /**
44
+ * Map instance ID for event bus isolation in multi-map scenarios.
45
+ * Shape events will include this ID in their payload,
46
+ * allowing listeners to filter events by map instance.
47
+ */
48
+ mapId: UniqueId;
49
+ /**
50
+ * Array of shapes to display
51
+ * Each shape must have a GeoJSON feature with styleProperties
52
+ */
53
+ data: EditableShape[];
54
+ /**
55
+ * Currently selected shape ID (for highlighting)
56
+ * When set, renders a highlight layer around the selected shape
57
+ */
58
+ selectedShapeId?: ShapeId;
59
+ /**
60
+ * Callback when a shape is clicked
61
+ * Also triggers a shapes:selected event on the event bus
62
+ * @param shape - The clicked shape with full properties
63
+ */
64
+ onShapeClick?: (shape: EditableShape) => void;
65
+ /**
66
+ * Callback when a shape is hovered
67
+ * Called with null when hover ends
68
+ * @param shape - The hovered shape, or null when hover ends
69
+ */
70
+ onShapeHover?: (shape: EditableShape | null) => void;
71
+ /**
72
+ * Whether to show labels on shapes
73
+ * Labels use the shape's `label` property, or `name` if label is not set
74
+ * @default true
75
+ */
76
+ showLabels?: boolean;
77
+ /**
78
+ * Global label positioning options
79
+ * Can be overridden per-shape via styleProperties
80
+ * Priority: per-shape properties > labelOptions > defaults
81
+ * @see LabelPositionOptions for available options
82
+ */
83
+ labelOptions?: LabelPositionOptions;
84
+ /**
85
+ * Whether to show the highlight layer around selected shapes
86
+ * When false, no highlight effect is rendered even when a shape is selected
87
+ * @default false
88
+ */
89
+ showHighlight?: boolean;
90
+ /**
91
+ * Custom highlight color for selected shapes [r, g, b, a]
92
+ * Each channel is 0-255
93
+ * @default [40, 245, 190, 100] - Turquoise at ~39% opacity
94
+ * @example Custom red highlight
95
+ * ```tsx
96
+ * highlightColor={[255, 0, 0, 128]} // Red at 50% opacity
97
+ * ```
98
+ */
99
+ highlightColor?: [number, number, number, number];
100
+ /**
101
+ * When true (default), applies 60% opacity multiplier to fill colors for standard semi-transparent look.
102
+ * This is a convenience prop for achieving the standard map shape appearance.
103
+ * When false, colors are rendered exactly as specified in styleProperties.
104
+ * @default true
105
+ * @example Standard semi-transparent fills
106
+ * ```tsx
107
+ * <DisplayShapeLayer data={shapes} applyBaseOpacity />
108
+ * // Shape with fillColor [98, 166, 255, 255] renders at alpha 153
109
+ * ```
110
+ */
111
+ applyBaseOpacity?: boolean;
112
+ }
113
+ //#endregion
114
+ export { DisplayShapeLayerProps, StyledFeature, StyledFeatureProperties };
115
+ //# sourceMappingURL=types.d.ts.map
@@ -10,5 +10,3 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
-
14
- import "./web-mercator-utils.js";
@@ -0,0 +1,89 @@
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 { UniqueId } from "@accelint/core";
15
+
16
+ //#region src/deckgl/shapes/display-shape-layer/use-shape-selection.d.ts
17
+ /**
18
+ * Return type for useShapeSelection hook
19
+ */
20
+ interface UseShapeSelectionReturn {
21
+ /** Currently selected shape ID, or undefined if nothing selected */
22
+ selectedId: ShapeId | undefined;
23
+ /** Manually set the selected shape ID (useful for programmatic selection) */
24
+ setSelectedId: (id: ShapeId | undefined) => void;
25
+ /** Manually clear the selection */
26
+ clearSelection: () => void;
27
+ }
28
+ /**
29
+ * Hook to manage shape selection state with automatic deselection
30
+ *
31
+ * This hook encapsulates the common pattern of:
32
+ * 1. Listening to `shapes:selected` events and updating state
33
+ * 2. Listening to `shapes:deselected` events and clearing state
34
+ * 3. Listening to map clicks on empty space and emitting `shapes:deselected`
35
+ *
36
+ * Uses a store pattern with `useSyncExternalStore` for proper listener cleanup
37
+ * during HMR (Hot Module Replacement) in development. The store ensures only
38
+ * one bus listener exists per map instance, regardless of how many React
39
+ * components subscribe.
40
+ *
41
+ * @param mapId - The map instance ID for event filtering
42
+ * @returns Selection state and control functions
43
+ *
44
+ * @example Basic usage
45
+ * ```tsx
46
+ * import { useShapeSelection } from '@accelint/map-toolkit/deckgl/shapes';
47
+ *
48
+ * function MapWithShapes() {
49
+ * const { selectedId } = useShapeSelection(MAP_ID);
50
+ *
51
+ * return (
52
+ * <BaseMap id={MAP_ID}>
53
+ * <displayShapeLayer
54
+ * id="shapes"
55
+ * mapId={MAP_ID}
56
+ * data={shapes}
57
+ * selectedShapeId={selectedId}
58
+ * />
59
+ * </BaseMap>
60
+ * );
61
+ * }
62
+ * ```
63
+ *
64
+ * @example With programmatic selection control
65
+ * ```tsx
66
+ * function MapWithShapes() {
67
+ * const { selectedId, setSelectedId, clearSelection } = useShapeSelection(MAP_ID);
68
+ *
69
+ * return (
70
+ * <>
71
+ * <button onClick={() => setSelectedId(shapes[0].id)}>Select First Shape</button>
72
+ * <button onClick={clearSelection}>Clear Selection</button>
73
+ * <BaseMap id={MAP_ID}>
74
+ * <displayShapeLayer
75
+ * id="shapes"
76
+ * mapId={MAP_ID}
77
+ * data={shapes}
78
+ * selectedShapeId={selectedId}
79
+ * />
80
+ * </BaseMap>
81
+ * </>
82
+ * );
83
+ * }
84
+ * ```
85
+ */
86
+ declare function useShapeSelection(mapId: UniqueId): UseShapeSelectionReturn;
87
+ //#endregion
88
+ export { UseShapeSelectionReturn, useShapeSelection };
89
+ //# sourceMappingURL=use-shape-selection.d.ts.map
@@ -0,0 +1,88 @@
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 { getOrCreateClearSelection, getOrCreateServerSnapshot, getOrCreateSetSelectedId, getOrCreateSnapshot, getOrCreateSubscription } from "./store.js";
17
+ import { useSyncExternalStore } from "react";
18
+
19
+ //#region src/deckgl/shapes/display-shape-layer/use-shape-selection.ts
20
+ /**
21
+ * Hook to manage shape selection state with automatic deselection
22
+ *
23
+ * This hook encapsulates the common pattern of:
24
+ * 1. Listening to `shapes:selected` events and updating state
25
+ * 2. Listening to `shapes:deselected` events and clearing state
26
+ * 3. Listening to map clicks on empty space and emitting `shapes:deselected`
27
+ *
28
+ * Uses a store pattern with `useSyncExternalStore` for proper listener cleanup
29
+ * during HMR (Hot Module Replacement) in development. The store ensures only
30
+ * one bus listener exists per map instance, regardless of how many React
31
+ * components subscribe.
32
+ *
33
+ * @param mapId - The map instance ID for event filtering
34
+ * @returns Selection state and control functions
35
+ *
36
+ * @example Basic usage
37
+ * ```tsx
38
+ * import { useShapeSelection } from '@accelint/map-toolkit/deckgl/shapes';
39
+ *
40
+ * function MapWithShapes() {
41
+ * const { selectedId } = useShapeSelection(MAP_ID);
42
+ *
43
+ * return (
44
+ * <BaseMap id={MAP_ID}>
45
+ * <displayShapeLayer
46
+ * id="shapes"
47
+ * mapId={MAP_ID}
48
+ * data={shapes}
49
+ * selectedShapeId={selectedId}
50
+ * />
51
+ * </BaseMap>
52
+ * );
53
+ * }
54
+ * ```
55
+ *
56
+ * @example With programmatic selection control
57
+ * ```tsx
58
+ * function MapWithShapes() {
59
+ * const { selectedId, setSelectedId, clearSelection } = useShapeSelection(MAP_ID);
60
+ *
61
+ * return (
62
+ * <>
63
+ * <button onClick={() => setSelectedId(shapes[0].id)}>Select First Shape</button>
64
+ * <button onClick={clearSelection}>Clear Selection</button>
65
+ * <BaseMap id={MAP_ID}>
66
+ * <displayShapeLayer
67
+ * id="shapes"
68
+ * mapId={MAP_ID}
69
+ * data={shapes}
70
+ * selectedShapeId={selectedId}
71
+ * />
72
+ * </BaseMap>
73
+ * </>
74
+ * );
75
+ * }
76
+ * ```
77
+ */
78
+ function useShapeSelection(mapId) {
79
+ return {
80
+ selectedId: useSyncExternalStore(getOrCreateSubscription(mapId), getOrCreateSnapshot(mapId), getOrCreateServerSnapshot(mapId)),
81
+ setSelectedId: getOrCreateSetSelectedId(mapId),
82
+ clearSelection: getOrCreateClearSelection(mapId)
83
+ };
84
+ }
85
+
86
+ //#endregion
87
+ export { useShapeSelection };
88
+ //# sourceMappingURL=use-shape-selection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-shape-selection.js","names":[],"sources":["../../../../src/deckgl/shapes/display-shape-layer/use-shape-selection.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 { useSyncExternalStore } from 'react';\nimport {\n getOrCreateClearSelection,\n getOrCreateServerSnapshot,\n getOrCreateSetSelectedId,\n getOrCreateSnapshot,\n getOrCreateSubscription,\n} from './store';\nimport type { UniqueId } from '@accelint/core';\nimport type { ShapeId } from '../shared/types';\n\n/**\n * Return type for useShapeSelection hook\n */\nexport interface UseShapeSelectionReturn {\n /** Currently selected shape ID, or undefined if nothing selected */\n selectedId: ShapeId | undefined;\n /** Manually set the selected shape ID (useful for programmatic selection) */\n setSelectedId: (id: ShapeId | undefined) => void;\n /** Manually clear the selection */\n clearSelection: () => void;\n}\n\n/**\n * Hook to manage shape selection state with automatic deselection\n *\n * This hook encapsulates the common pattern of:\n * 1. Listening to `shapes:selected` events and updating state\n * 2. Listening to `shapes:deselected` events and clearing state\n * 3. Listening to map clicks on empty space and emitting `shapes:deselected`\n *\n * Uses a store pattern with `useSyncExternalStore` for proper listener cleanup\n * during HMR (Hot Module Replacement) in development. The store ensures only\n * one bus listener exists per map instance, regardless of how many React\n * components subscribe.\n *\n * @param mapId - The map instance ID for event filtering\n * @returns Selection state and control functions\n *\n * @example Basic usage\n * ```tsx\n * import { useShapeSelection } from '@accelint/map-toolkit/deckgl/shapes';\n *\n * function MapWithShapes() {\n * const { selectedId } = useShapeSelection(MAP_ID);\n *\n * return (\n * <BaseMap id={MAP_ID}>\n * <displayShapeLayer\n * id=\"shapes\"\n * mapId={MAP_ID}\n * data={shapes}\n * selectedShapeId={selectedId}\n * />\n * </BaseMap>\n * );\n * }\n * ```\n *\n * @example With programmatic selection control\n * ```tsx\n * function MapWithShapes() {\n * const { selectedId, setSelectedId, clearSelection } = useShapeSelection(MAP_ID);\n *\n * return (\n * <>\n * <button onClick={() => setSelectedId(shapes[0].id)}>Select First Shape</button>\n * <button onClick={clearSelection}>Clear Selection</button>\n * <BaseMap id={MAP_ID}>\n * <displayShapeLayer\n * id=\"shapes\"\n * mapId={MAP_ID}\n * data={shapes}\n * selectedShapeId={selectedId}\n * />\n * </BaseMap>\n * </>\n * );\n * }\n * ```\n */\nexport function useShapeSelection(mapId: UniqueId): UseShapeSelectionReturn {\n // Get cached functions for this mapId (maintains referential stability)\n const subscribe = getOrCreateSubscription(mapId);\n const getSnapshot = getOrCreateSnapshot(mapId);\n const getServerSnapshot = getOrCreateServerSnapshot(mapId);\n\n // Subscribe to store changes using React's built-in external store hook\n const selectedId = useSyncExternalStore(\n subscribe,\n getSnapshot,\n getServerSnapshot,\n );\n\n // Get cached action functions (maintains referential stability)\n const setSelectedId = getOrCreateSetSelectedId(mapId);\n const clearSelection = getOrCreateClearSelection(mapId);\n\n return {\n selectedId,\n setSelectedId,\n clearSelection,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+FA,SAAgB,kBAAkB,OAA0C;AAiB1E,QAAO;EACL,YAXiB,qBALD,wBAAwB,MAAM,EAC5B,oBAAoB,MAAM,EACpB,0BAA0B,MAAM,CAOzD;EAQC,eALoB,yBAAyB,MAAM;EAMnD,gBALqB,0BAA0B,MAAM;EAMtD"}
@@ -0,0 +1,61 @@
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 { StyledFeature } from "../../shared/types.js";
14
+ import { Color } from "@deck.gl/core";
15
+
16
+ //#region src/deckgl/shapes/display-shape-layer/utils/display-style.d.ts
17
+ /**
18
+ * Get fill color for a feature
19
+ * Colors are passed through as-is unless applyBaseOpacity is true
20
+ *
21
+ * @param feature - The styled feature
22
+ * @param applyBaseOpacity - When true, multiplies alpha by BASE_FILL_OPACITY (0.6)
23
+ * @returns RGBA color array
24
+ */
25
+ declare function getFillColor(feature: StyledFeature, applyBaseOpacity?: boolean): Color;
26
+ /**
27
+ * Get stroke color for a feature
28
+ * Strokes are always rendered at their literal alpha value
29
+ *
30
+ * @param feature - The styled feature
31
+ * @returns RGBA color array
32
+ */
33
+ declare function getStrokeColor(feature: StyledFeature): Color;
34
+ /**
35
+ * Get line width for a feature
36
+ */
37
+ declare function getLineWidth(feature: StyledFeature): number;
38
+ /**
39
+ * Alias for getLineWidth (for compatibility)
40
+ */
41
+ declare const getStrokeWidth: typeof getLineWidth;
42
+ /**
43
+ * Get dash array for stroke pattern
44
+ */
45
+ declare function getDashArray(feature: StyledFeature): [number, number] | null;
46
+ /**
47
+ * Get hover-enhanced line width
48
+ */
49
+ declare function getHoverLineWidth(feature: StyledFeature, isHovered: boolean): number;
50
+ /**
51
+ * Get selection highlight color
52
+ * Returns the default highlight color or allows custom opacity override
53
+ */
54
+ declare function getHighlightColor(opacity?: number): [number, number, number, number];
55
+ /**
56
+ * Get highlight line width (base width + increase)
57
+ */
58
+ declare function getHighlightLineWidth(feature: StyledFeature): number;
59
+ //#endregion
60
+ export { getDashArray, getFillColor, getHighlightColor, getHighlightLineWidth, getHoverLineWidth, getLineWidth, getStrokeColor, getStrokeWidth };
61
+ //# sourceMappingURL=display-style.d.ts.map
@@ -0,0 +1,111 @@
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 { BASE_FILL_OPACITY, DASH_ARRAYS, DEFAULT_COLORS, DEFAULT_STROKE_WIDTH, HIGHLIGHT_WIDTH_INCREASE, HOVER_WIDTH_INCREASE } from "../../shared/constants.js";
17
+
18
+ //#region src/deckgl/shapes/display-shape-layer/utils/display-style.ts
19
+ /**
20
+ * Get fill color for a feature
21
+ * Colors are passed through as-is unless applyBaseOpacity is true
22
+ *
23
+ * @param feature - The styled feature
24
+ * @param applyBaseOpacity - When true, multiplies alpha by BASE_FILL_OPACITY (0.6)
25
+ * @returns RGBA color array
26
+ */
27
+ function getFillColor(feature, applyBaseOpacity = false) {
28
+ const rgba = normalizeColor((feature.properties?.styleProperties)?.fillColor ?? DEFAULT_COLORS.fill);
29
+ if (applyBaseOpacity) return [
30
+ rgba[0],
31
+ rgba[1],
32
+ rgba[2],
33
+ Math.round(rgba[3] * BASE_FILL_OPACITY)
34
+ ];
35
+ return rgba;
36
+ }
37
+ /**
38
+ * Get stroke color for a feature
39
+ * Strokes are always rendered at their literal alpha value
40
+ *
41
+ * @param feature - The styled feature
42
+ * @returns RGBA color array
43
+ */
44
+ function getStrokeColor(feature) {
45
+ return normalizeColor((feature.properties?.styleProperties)?.strokeColor ?? DEFAULT_COLORS.stroke);
46
+ }
47
+ /**
48
+ * Normalize a Color to a 4-element RGBA array
49
+ * Handles RGB arrays (adds alpha 255), RGBA arrays, and typed arrays
50
+ */
51
+ function normalizeColor(color) {
52
+ if (color instanceof Uint8Array || color instanceof Uint8ClampedArray) return [
53
+ color[0] ?? 0,
54
+ color[1] ?? 0,
55
+ color[2] ?? 0,
56
+ color[3] ?? 255
57
+ ];
58
+ return [
59
+ color[0],
60
+ color[1],
61
+ color[2],
62
+ color[3] ?? 255
63
+ ];
64
+ }
65
+ /**
66
+ * Get line width for a feature
67
+ */
68
+ function getLineWidth(feature) {
69
+ return (feature.properties?.styleProperties)?.strokeWidth ?? DEFAULT_STROKE_WIDTH;
70
+ }
71
+ /**
72
+ * Alias for getLineWidth (for compatibility)
73
+ */
74
+ const getStrokeWidth = getLineWidth;
75
+ /**
76
+ * Get dash array for stroke pattern
77
+ */
78
+ function getDashArray(feature) {
79
+ return DASH_ARRAYS[(feature.properties?.styleProperties)?.strokePattern ?? "solid"] || null;
80
+ }
81
+ /**
82
+ * Get hover-enhanced line width
83
+ */
84
+ function getHoverLineWidth(feature, isHovered) {
85
+ const baseWidth = getLineWidth(feature);
86
+ return isHovered ? baseWidth + HOVER_WIDTH_INCREASE : baseWidth;
87
+ }
88
+ /**
89
+ * Get selection highlight color
90
+ * Returns the default highlight color or allows custom opacity override
91
+ */
92
+ function getHighlightColor(opacity) {
93
+ const rgba = normalizeColor(DEFAULT_COLORS.highlight);
94
+ if (opacity !== void 0) return [
95
+ rgba[0],
96
+ rgba[1],
97
+ rgba[2],
98
+ Math.round(opacity * 255)
99
+ ];
100
+ return rgba;
101
+ }
102
+ /**
103
+ * Get highlight line width (base width + increase)
104
+ */
105
+ function getHighlightLineWidth(feature) {
106
+ return getLineWidth(feature) + HIGHLIGHT_WIDTH_INCREASE;
107
+ }
108
+
109
+ //#endregion
110
+ export { getDashArray, getFillColor, getHighlightColor, getHighlightLineWidth, getHoverLineWidth, getLineWidth, getStrokeColor, getStrokeWidth };
111
+ //# 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 BASE_FILL_OPACITY,\n DASH_ARRAYS,\n DEFAULT_COLORS,\n DEFAULT_STROKE_WIDTH,\n HIGHLIGHT_WIDTH_INCREASE,\n HOVER_WIDTH_INCREASE,\n} from '../../shared/constants';\nimport type { Color } from '@deck.gl/core';\nimport type { StyledFeature } from '../../shared/types';\n\n/**\n * Get fill color for a feature\n * Colors are passed through as-is unless applyBaseOpacity is true\n *\n * @param feature - The styled feature\n * @param applyBaseOpacity - When true, multiplies alpha by BASE_FILL_OPACITY (0.6)\n * @returns RGBA color array\n */\nexport function getFillColor(\n feature: StyledFeature,\n applyBaseOpacity = false,\n): Color {\n const styleProps = feature.properties?.styleProperties;\n const color = styleProps?.fillColor ?? DEFAULT_COLORS.fill;\n\n // Normalize to 4-element array\n const rgba = normalizeColor(color);\n\n if (applyBaseOpacity) {\n // Apply base opacity multiplier to alpha channel\n return [rgba[0], rgba[1], rgba[2], Math.round(rgba[3] * BASE_FILL_OPACITY)];\n }\n\n return rgba;\n}\n\n/**\n * Get stroke color for a feature\n * Strokes are always rendered at their literal alpha value\n *\n * @param feature - The styled feature\n * @returns RGBA color array\n */\nexport function getStrokeColor(feature: StyledFeature): Color {\n const styleProps = feature.properties?.styleProperties;\n const color = styleProps?.strokeColor ?? DEFAULT_COLORS.stroke;\n\n return normalizeColor(color);\n}\n\n/**\n * Normalize a Color to a 4-element RGBA array\n * Handles RGB arrays (adds alpha 255), RGBA arrays, and typed arrays\n */\nfunction normalizeColor(color: Color): [number, number, number, number] {\n if (color instanceof Uint8Array || color instanceof Uint8ClampedArray) {\n return [color[0] ?? 0, color[1] ?? 0, color[2] ?? 0, color[3] ?? 255];\n }\n\n // Handle RGB (3-element) or RGBA (4-element) arrays\n return [color[0], color[1], color[2], color[3] ?? 255];\n}\n\n/**\n * Get line width for a feature\n */\nexport function getLineWidth(feature: StyledFeature): number {\n const styleProps = feature.properties?.styleProperties;\n return styleProps?.strokeWidth ?? DEFAULT_STROKE_WIDTH;\n}\n\n/**\n * Alias for getLineWidth (for compatibility)\n */\nexport const getStrokeWidth = getLineWidth;\n\n/**\n * Get dash array for stroke pattern\n */\nexport function getDashArray(feature: StyledFeature): [number, number] | null {\n const styleProps = feature.properties?.styleProperties;\n const pattern = styleProps?.strokePattern ?? 'solid';\n\n return DASH_ARRAYS[pattern] || null;\n}\n\n/**\n * Get hover-enhanced line 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 line 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":";;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,SAAgB,aACd,SACA,mBAAmB,OACZ;CAKP,MAAM,OAAO,gBAJM,QAAQ,YAAY,kBACb,aAAa,eAAe,KAGpB;AAElC,KAAI,iBAEF,QAAO;EAAC,KAAK;EAAI,KAAK;EAAI,KAAK;EAAI,KAAK,MAAM,KAAK,KAAK,kBAAkB;EAAC;AAG7E,QAAO;;;;;;;;;AAUT,SAAgB,eAAe,SAA+B;AAI5D,QAAO,gBAHY,QAAQ,YAAY,kBACb,eAAe,eAAe,OAE5B;;;;;;AAO9B,SAAS,eAAe,OAAgD;AACtE,KAAI,iBAAiB,cAAc,iBAAiB,kBAClD,QAAO;EAAC,MAAM,MAAM;EAAG,MAAM,MAAM;EAAG,MAAM,MAAM;EAAG,MAAM,MAAM;EAAI;AAIvE,QAAO;EAAC,MAAM;EAAI,MAAM;EAAI,MAAM;EAAI,MAAM,MAAM;EAAI;;;;;AAMxD,SAAgB,aAAa,SAAgC;AAE3D,SADmB,QAAQ,YAAY,kBACpB,eAAe;;;;;AAMpC,MAAa,iBAAiB;;;;AAK9B,SAAgB,aAAa,SAAiD;AAI5E,QAAO,aAHY,QAAQ,YAAY,kBACX,iBAAiB,YAEd;;;;;AAMjC,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"}