@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
@@ -1,95 +0,0 @@
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
- import { keyToString } from "../../lib/key-to-string/index.js";
15
- import { enableMapSet } from "../../../../../node_modules/.pnpm/immer@10.2.0/node_modules/immer/dist/immer.js";
16
- import { immer } from "../../../../../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";
17
- import { createStore } from "../../../../../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";
18
-
19
- //#region ../hotkey-manager/dist/stores/hotkey-store/index.js
20
- enableMapSet();
21
- const hotkeyStore = createStore()(immer((set, get) => ({
22
- allHotkeys: /* @__PURE__ */ new Map(),
23
- registeredKeyCombinations: /* @__PURE__ */ new Map(),
24
- activeKeyCombinations: /* @__PURE__ */ new Map(),
25
- hotkeyActivations: /* @__PURE__ */ new Map(),
26
- registerHotkey: (config) => set((state) => {
27
- if (state.allHotkeys.has(config.id)) throw new TypeError(`Hotkey with id ${config.id} has already been registered.`);
28
- state.allHotkeys.set(config.id, config);
29
- for (const key of config.key) {
30
- if (!config.ignoreConflicts && state.registeredKeyCombinations.has(key.id)) {
31
- const ids = state.registeredKeyCombinations.get(key.id);
32
- console.warn(`Hotkey with the combination ${keyToString(key)} already registered to ${ids.join(", ")}`);
33
- }
34
- state.registeredKeyCombinations.set(key.id, (state.registeredKeyCombinations.get(key.id) ?? []).concat(config.id));
35
- }
36
- }),
37
- unregisterHotkey: (id) => set((state) => {
38
- removeHotkeyFromRegisteredKeyCombinations(state, id);
39
- removeHotkeyFromActiveKeyCombinations(state, id);
40
- state.allHotkeys.delete(id);
41
- }),
42
- activateHotkey: (id, activationSymbol) => set((state) => {
43
- const config = state.allHotkeys.get(id);
44
- if (!config) return;
45
- for (const key of config.key) {
46
- const activated = state.activeKeyCombinations.get(key.id) ?? [];
47
- if (activated.includes(id)) continue;
48
- state.activeKeyCombinations.set(key.id, [...activated, id]);
49
- }
50
- const activations = state.hotkeyActivations.get(id) ?? [];
51
- if (activations.includes(activationSymbol)) return;
52
- state.hotkeyActivations.set(id, [...activations, activationSymbol]);
53
- }),
54
- deactivateHotkey: (id, registerSymbol) => set((state) => {
55
- const activations = state.hotkeyActivations.get(id) ?? [];
56
- if (!activations.includes(registerSymbol)) return;
57
- const newActivations = activations.filter((activation) => activation !== registerSymbol);
58
- if (newActivations.length > 0) {
59
- state.hotkeyActivations.set(id, newActivations);
60
- return;
61
- }
62
- state.hotkeyActivations.delete(id);
63
- removeHotkeyFromActiveKeyCombinations(state, id);
64
- }),
65
- forceDeactivateHotkey: (id) => set((state) => {
66
- state.hotkeyActivations.delete(id);
67
- removeHotkeyFromActiveKeyCombinations(state, id);
68
- }),
69
- getHotkeysForKeyCombination: (keyCombination) => {
70
- const state = get();
71
- const ids = state.activeKeyCombinations.get(keyCombination);
72
- if (!ids) return null;
73
- return ids.map((id) => state.allHotkeys.get(id)).filter(Boolean);
74
- }
75
- })));
76
- function removeHotkeyFromRegisteredKeyCombinations(state, id) {
77
- const config = state.allHotkeys.get(id);
78
- if (!config) return;
79
- for (const key of config.key) {
80
- const newRegistered = (state.registeredKeyCombinations.get(key.id) ?? []).filter((configId) => configId !== id);
81
- newRegistered.length === 0 ? state.registeredKeyCombinations.delete(key.id) : state.registeredKeyCombinations.set(key.id, newRegistered);
82
- }
83
- }
84
- function removeHotkeyFromActiveKeyCombinations(state, id) {
85
- const config = state.allHotkeys.get(id);
86
- if (!config) return;
87
- for (const key of config.key) {
88
- const newActive = (state.activeKeyCombinations.get(key.id) ?? []).filter((configId) => configId !== id);
89
- newActive.length === 0 ? state.activeKeyCombinations.delete(key.id) : state.activeKeyCombinations.set(key.id, newActive);
90
- }
91
- }
92
-
93
- //#endregion
94
- export { hotkeyStore };
95
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../../../hotkey-manager/dist/stores/hotkey-store/index.js"],"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\nimport { keyToString } from \"../../lib/key-to-string/index.js\";\nimport { enableMapSet } from \"immer\";\nimport { immer } from \"zustand/middleware/immer\";\nimport { createStore } from \"zustand/vanilla\";\n\n//#region src/stores/hotkey-store/index.ts\nenableMapSet();\nconst hotkeyStore = createStore()(immer((set, get) => ({\n\tallHotkeys: /* @__PURE__ */ new Map(),\n\tregisteredKeyCombinations: /* @__PURE__ */ new Map(),\n\tactiveKeyCombinations: /* @__PURE__ */ new Map(),\n\thotkeyActivations: /* @__PURE__ */ new Map(),\n\tregisterHotkey: (config) => set((state) => {\n\t\tif (state.allHotkeys.has(config.id)) throw new TypeError(`Hotkey with id ${config.id} has already been registered.`);\n\t\tstate.allHotkeys.set(config.id, config);\n\t\tfor (const key of config.key) {\n\t\t\tif (!config.ignoreConflicts && state.registeredKeyCombinations.has(key.id)) {\n\t\t\t\tconst ids = state.registeredKeyCombinations.get(key.id);\n\t\t\t\tconsole.warn(`Hotkey with the combination ${keyToString(key)} already registered to ${ids.join(\", \")}`);\n\t\t\t}\n\t\t\tstate.registeredKeyCombinations.set(key.id, (state.registeredKeyCombinations.get(key.id) ?? []).concat(config.id));\n\t\t}\n\t}),\n\tunregisterHotkey: (id) => set((state) => {\n\t\tremoveHotkeyFromRegisteredKeyCombinations(state, id);\n\t\tremoveHotkeyFromActiveKeyCombinations(state, id);\n\t\tstate.allHotkeys.delete(id);\n\t}),\n\tactivateHotkey: (id, activationSymbol) => set((state) => {\n\t\tconst config = state.allHotkeys.get(id);\n\t\tif (!config) return;\n\t\tfor (const key of config.key) {\n\t\t\tconst activated = state.activeKeyCombinations.get(key.id) ?? [];\n\t\t\tif (activated.includes(id)) continue;\n\t\t\tstate.activeKeyCombinations.set(key.id, [...activated, id]);\n\t\t}\n\t\tconst activations = state.hotkeyActivations.get(id) ?? [];\n\t\tif (activations.includes(activationSymbol)) return;\n\t\tstate.hotkeyActivations.set(id, [...activations, activationSymbol]);\n\t}),\n\tdeactivateHotkey: (id, registerSymbol) => set((state) => {\n\t\tconst activations = state.hotkeyActivations.get(id) ?? [];\n\t\tif (!activations.includes(registerSymbol)) return;\n\t\tconst newActivations = activations.filter((activation) => activation !== registerSymbol);\n\t\tif (newActivations.length > 0) {\n\t\t\tstate.hotkeyActivations.set(id, newActivations);\n\t\t\treturn;\n\t\t}\n\t\tstate.hotkeyActivations.delete(id);\n\t\tremoveHotkeyFromActiveKeyCombinations(state, id);\n\t}),\n\tforceDeactivateHotkey: (id) => set((state) => {\n\t\tstate.hotkeyActivations.delete(id);\n\t\tremoveHotkeyFromActiveKeyCombinations(state, id);\n\t}),\n\tgetHotkeysForKeyCombination: (keyCombination) => {\n\t\tconst state = get();\n\t\tconst ids = state.activeKeyCombinations.get(keyCombination);\n\t\tif (!ids) return null;\n\t\treturn ids.map((id) => state.allHotkeys.get(id)).filter(Boolean);\n\t}\n})));\nfunction removeHotkeyFromRegisteredKeyCombinations(state, id) {\n\tconst config = state.allHotkeys.get(id);\n\tif (!config) return;\n\tfor (const key of config.key) {\n\t\tconst newRegistered = (state.registeredKeyCombinations.get(key.id) ?? []).filter((configId) => configId !== id);\n\t\tnewRegistered.length === 0 ? state.registeredKeyCombinations.delete(key.id) : state.registeredKeyCombinations.set(key.id, newRegistered);\n\t}\n}\nfunction removeHotkeyFromActiveKeyCombinations(state, id) {\n\tconst config = state.allHotkeys.get(id);\n\tif (!config) return;\n\tfor (const key of config.key) {\n\t\tconst newActive = (state.activeKeyCombinations.get(key.id) ?? []).filter((configId) => configId !== id);\n\t\tnewActive.length === 0 ? state.activeKeyCombinations.delete(key.id) : state.activeKeyCombinations.set(key.id, newActive);\n\t}\n}\n\n//#endregion\nexport { hotkeyStore };\n//# sourceMappingURL=index.js.map"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,cAAc;AACd,MAAM,cAAc,aAAa,CAAC,OAAO,KAAK,SAAS;CACtD,4BAA4B,IAAI,KAAK;CACrC,2CAA2C,IAAI,KAAK;CACpD,uCAAuC,IAAI,KAAK;CAChD,mCAAmC,IAAI,KAAK;CAC5C,iBAAiB,WAAW,KAAK,UAAU;AAC1C,MAAI,MAAM,WAAW,IAAI,OAAO,GAAG,CAAE,OAAM,IAAI,UAAU,kBAAkB,OAAO,GAAG,+BAA+B;AACpH,QAAM,WAAW,IAAI,OAAO,IAAI,OAAO;AACvC,OAAK,MAAM,OAAO,OAAO,KAAK;AAC7B,OAAI,CAAC,OAAO,mBAAmB,MAAM,0BAA0B,IAAI,IAAI,GAAG,EAAE;IAC3E,MAAM,MAAM,MAAM,0BAA0B,IAAI,IAAI,GAAG;AACvD,YAAQ,KAAK,+BAA+B,YAAY,IAAI,CAAC,yBAAyB,IAAI,KAAK,KAAK,GAAG;;AAExG,SAAM,0BAA0B,IAAI,IAAI,KAAK,MAAM,0BAA0B,IAAI,IAAI,GAAG,IAAI,EAAE,EAAE,OAAO,OAAO,GAAG,CAAC;;GAElH;CACF,mBAAmB,OAAO,KAAK,UAAU;AACxC,4CAA0C,OAAO,GAAG;AACpD,wCAAsC,OAAO,GAAG;AAChD,QAAM,WAAW,OAAO,GAAG;GAC1B;CACF,iBAAiB,IAAI,qBAAqB,KAAK,UAAU;EACxD,MAAM,SAAS,MAAM,WAAW,IAAI,GAAG;AACvC,MAAI,CAAC,OAAQ;AACb,OAAK,MAAM,OAAO,OAAO,KAAK;GAC7B,MAAM,YAAY,MAAM,sBAAsB,IAAI,IAAI,GAAG,IAAI,EAAE;AAC/D,OAAI,UAAU,SAAS,GAAG,CAAE;AAC5B,SAAM,sBAAsB,IAAI,IAAI,IAAI,CAAC,GAAG,WAAW,GAAG,CAAC;;EAE5D,MAAM,cAAc,MAAM,kBAAkB,IAAI,GAAG,IAAI,EAAE;AACzD,MAAI,YAAY,SAAS,iBAAiB,CAAE;AAC5C,QAAM,kBAAkB,IAAI,IAAI,CAAC,GAAG,aAAa,iBAAiB,CAAC;GAClE;CACF,mBAAmB,IAAI,mBAAmB,KAAK,UAAU;EACxD,MAAM,cAAc,MAAM,kBAAkB,IAAI,GAAG,IAAI,EAAE;AACzD,MAAI,CAAC,YAAY,SAAS,eAAe,CAAE;EAC3C,MAAM,iBAAiB,YAAY,QAAQ,eAAe,eAAe,eAAe;AACxF,MAAI,eAAe,SAAS,GAAG;AAC9B,SAAM,kBAAkB,IAAI,IAAI,eAAe;AAC/C;;AAED,QAAM,kBAAkB,OAAO,GAAG;AAClC,wCAAsC,OAAO,GAAG;GAC/C;CACF,wBAAwB,OAAO,KAAK,UAAU;AAC7C,QAAM,kBAAkB,OAAO,GAAG;AAClC,wCAAsC,OAAO,GAAG;GAC/C;CACF,8BAA8B,mBAAmB;EAChD,MAAM,QAAQ,KAAK;EACnB,MAAM,MAAM,MAAM,sBAAsB,IAAI,eAAe;AAC3D,MAAI,CAAC,IAAK,QAAO;AACjB,SAAO,IAAI,KAAK,OAAO,MAAM,WAAW,IAAI,GAAG,CAAC,CAAC,OAAO,QAAQ;;CAEjE,EAAE,CAAC;AACJ,SAAS,0CAA0C,OAAO,IAAI;CAC7D,MAAM,SAAS,MAAM,WAAW,IAAI,GAAG;AACvC,KAAI,CAAC,OAAQ;AACb,MAAK,MAAM,OAAO,OAAO,KAAK;EAC7B,MAAM,iBAAiB,MAAM,0BAA0B,IAAI,IAAI,GAAG,IAAI,EAAE,EAAE,QAAQ,aAAa,aAAa,GAAG;AAC/G,gBAAc,WAAW,IAAI,MAAM,0BAA0B,OAAO,IAAI,GAAG,GAAG,MAAM,0BAA0B,IAAI,IAAI,IAAI,cAAc;;;AAG1I,SAAS,sCAAsC,OAAO,IAAI;CACzD,MAAM,SAAS,MAAM,WAAW,IAAI,GAAG;AACvC,KAAI,CAAC,OAAQ;AACb,MAAK,MAAM,OAAO,OAAO,KAAK;EAC7B,MAAM,aAAa,MAAM,sBAAsB,IAAI,IAAI,GAAG,IAAI,EAAE,EAAE,QAAQ,aAAa,aAAa,GAAG;AACvG,YAAU,WAAW,IAAI,MAAM,sBAAsB,OAAO,IAAI,GAAG,GAAG,MAAM,sBAAsB,IAAI,IAAI,IAAI,UAAU"}
@@ -1,11 +0,0 @@
1
- //#region src/viewport/constants.d.ts
2
- declare const UNIT_MAP: {
3
- readonly km: "kilometers";
4
- readonly m: "meters";
5
- readonly nm: "nauticalmiles";
6
- readonly mi: "miles";
7
- readonly ft: "feet";
8
- };
9
- //#endregion
10
- export { UNIT_MAP };
11
- //# sourceMappingURL=constants.d.ts.map
@@ -1,25 +0,0 @@
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
- //#region src/viewport/constants.ts
15
- const UNIT_MAP = {
16
- km: "kilometers",
17
- m: "meters",
18
- nm: "nauticalmiles",
19
- mi: "miles",
20
- ft: "feet"
21
- };
22
-
23
- //#endregion
24
- export { UNIT_MAP };
25
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","names":[],"sources":["../../src/viewport/constants.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport const UNIT_MAP = {\n km: 'kilometers',\n m: 'meters',\n nm: 'nauticalmiles',\n mi: 'miles',\n ft: 'feet',\n} as const;\n"],"mappings":";;;;;;;;;;;;;;AAYA,MAAa,WAAW;CACtB,IAAI;CACJ,GAAG;CACH,IAAI;CACJ,IAAI;CACJ,IAAI;CACL"}
@@ -1,100 +0,0 @@
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 { MapViewportPayload } from "../deckgl/base-map/types.js";
14
- import { useSyncExternalStore } from "react";
15
- import { UniqueId } from "@accelint/core";
16
-
17
- //#region src/viewport/use-viewport-state.d.ts
18
- type UseViewportStateProps = {
19
- instanceId: UniqueId;
20
- subscribe?: Parameters<typeof useSyncExternalStore<MapViewportPayload>>[0];
21
- getSnapshot?: Parameters<typeof useSyncExternalStore<MapViewportPayload>>[1];
22
- getServerSnapshot?: Parameters<typeof useSyncExternalStore<MapViewportPayload>>[2];
23
- };
24
- /**
25
- * Hook to subscribe to viewport state changes for a specific view.
26
- *
27
- * By default, subscribes to MapEvents.viewport events from the event bus and
28
- * automatically cleans up when all subscribers unmount. For advanced use cases,
29
- * custom subscribe/getSnapshot functions can be provided.
30
- *
31
- * A thin wrapper around [useSyncExternalStore](https://react.dev/reference/react/useSyncExternalStore).
32
- *
33
- * @param instanceId - Unique identifier for the viewport to track
34
- * @param subscribe - Optional custom subscription function
35
- * @param getSnapshot - Optional custom snapshot getter
36
- * @param getServerSnapshot - Optional server-side snapshot getter
37
- * @returns Current viewport state including bounds, latitude, longitude, zoom
38
- *
39
- * @example
40
- * ```tsx
41
- * function MapInfo({ instanceId }) {
42
- * const { bounds, latitude, longitude, zoom } = useViewportState({
43
- * instanceId
44
- * });
45
- *
46
- * return (
47
- * <div>
48
- * Lat: {latitude?.toFixed(2)}, Lon: {longitude?.toFixed(2)}, Zoom: {zoom}
49
- * </div>
50
- * );
51
- * }
52
- * ```
53
- *
54
- * @example
55
- * ```tsx
56
- * // With custom subscribe/getSnapshot for advanced use cases
57
- * function CustomMapInfo() {
58
- * const customSubscribe = (onStoreChange) => {
59
- * // Custom subscription logic
60
- * return () => { // cleanup }
61
- * }
62
- *
63
- * const customGetSnapshot = () => {
64
- * // Custom snapshot logic
65
- * return { latitude: 0, longitude: 0, zoom: 1 };
66
- * };
67
- *
68
- * const viewState = useViewportState({
69
- * instanceId: 'some-uuid',
70
- * subscribe: customSubscribe,
71
- * getSnapshot: customGetSnapshot,
72
- * });
73
- *
74
- * return <div>Custom viewport state</div>;
75
- * }
76
- * ```
77
- */
78
- declare function useViewportState({
79
- instanceId,
80
- subscribe,
81
- getSnapshot,
82
- getServerSnapshot
83
- }: UseViewportStateProps): MapViewportPayload;
84
- /**
85
- * Manually clear viewport state for a specific instanceId.
86
- * This is typically not needed as cleanup happens automatically when all subscribers unmount.
87
- * Use this only in advanced scenarios where manual cleanup is required.
88
- *
89
- * @param instanceId - The unique identifier for the viewport to clear
90
- *
91
- * @example
92
- * ```tsx
93
- * // Manual cleanup (rarely needed)
94
- * clearViewportState('my-map-instance');
95
- * ```
96
- */
97
- declare function clearViewportState(instanceId: UniqueId): void;
98
- //#endregion
99
- export { UseViewportStateProps, clearViewportState, useViewportState };
100
- //# sourceMappingURL=use-viewport-state.d.ts.map
@@ -1,222 +0,0 @@
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
- import { MapEvents } from "../deckgl/base-map/events.js";
15
- import { Broadcast } from "@accelint/bus";
16
- import { useSyncExternalStore } from "react";
17
-
18
- //#region src/viewport/use-viewport-state.ts
19
- const bus = Broadcast.getInstance();
20
- /**
21
- * Store for viewport state keyed by instanceId
22
- */
23
- const viewportStore = /* @__PURE__ */ new Map();
24
- /**
25
- * Track React component subscribers per instanceId (for fan-out notifications).
26
- * Each Set contains onStoreChange callbacks from useSyncExternalStore.
27
- */
28
- const componentSubscribers = /* @__PURE__ */ new Map();
29
- /**
30
- * Cache of bus unsubscribe functions (1 per instanceId).
31
- * This ensures we only have one bus listener per viewport, regardless of
32
- * how many React components subscribe to it.
33
- */
34
- const busUnsubscribers = /* @__PURE__ */ new Map();
35
- /**
36
- * Cache of subscription functions per instanceId to avoid recreating on every render
37
- */
38
- const subscriptionCache = /* @__PURE__ */ new Map();
39
- /**
40
- * Cache of snapshot functions per instanceId to maintain referential stability
41
- */
42
- const snapshotCache = /* @__PURE__ */ new Map();
43
- /**
44
- * Cache of fallback snapshots per instanceId to maintain referential stability.
45
- * This prevents unnecessary re-renders when no viewport data exists yet.
46
- */
47
- const fallbackCache = /* @__PURE__ */ new Map();
48
- /**
49
- * Ensures a single bus listener exists for the given instanceId.
50
- * All React subscribers will be notified via fan-out when the bus event fires.
51
- * This prevents creating N bus listeners for N React components.
52
- *
53
- * @param instanceId - The unique identifier for the viewport
54
- */
55
- function ensureBusListener(instanceId) {
56
- if (busUnsubscribers.has(instanceId)) return;
57
- const unsub = bus.on(MapEvents.viewport, ({ payload }) => {
58
- if (instanceId === payload.id) {
59
- viewportStore.set(instanceId, payload);
60
- const subscribers = componentSubscribers.get(instanceId);
61
- if (subscribers) for (const onStoreChange of subscribers) onStoreChange();
62
- }
63
- });
64
- busUnsubscribers.set(instanceId, unsub);
65
- }
66
- /**
67
- * Cleans up the bus listener if no React subscribers remain.
68
- *
69
- * @param instanceId - The unique identifier for the viewport
70
- */
71
- function cleanupBusListenerIfNeeded(instanceId) {
72
- const subscribers = componentSubscribers.get(instanceId);
73
- if (!subscribers || subscribers.size === 0) {
74
- const unsub = busUnsubscribers.get(instanceId);
75
- if (unsub) {
76
- unsub();
77
- busUnsubscribers.delete(instanceId);
78
- }
79
- viewportStore.delete(instanceId);
80
- componentSubscribers.delete(instanceId);
81
- subscriptionCache.delete(instanceId);
82
- snapshotCache.delete(instanceId);
83
- fallbackCache.delete(instanceId);
84
- }
85
- }
86
- /**
87
- * Creates or retrieves a cached subscription function for a given instanceId.
88
- * Uses a fan-out pattern: 1 bus listener -> N React subscribers.
89
- * Automatically cleans up viewport state when the last subscriber unsubscribes.
90
- *
91
- * @param instanceId - The unique identifier for the viewport
92
- * @returns A subscription function for useSyncExternalStore
93
- */
94
- function getOrCreateSubscription(instanceId) {
95
- const subscription = subscriptionCache.get(instanceId) ?? ((onStoreChange) => {
96
- ensureBusListener(instanceId);
97
- let subscriberSet = componentSubscribers.get(instanceId);
98
- if (!subscriberSet) {
99
- subscriberSet = /* @__PURE__ */ new Set();
100
- componentSubscribers.set(instanceId, subscriberSet);
101
- }
102
- subscriberSet.add(onStoreChange);
103
- return () => {
104
- const currentSubscriberSet = componentSubscribers.get(instanceId);
105
- if (currentSubscriberSet) currentSubscriberSet.delete(onStoreChange);
106
- cleanupBusListenerIfNeeded(instanceId);
107
- };
108
- });
109
- subscriptionCache.set(instanceId, subscription);
110
- return subscription;
111
- }
112
- /**
113
- * Creates or retrieves a cached snapshot function for a given instanceId.
114
- * The object returned gets equality checked, so it needs to be stable or React re-renders unnecessarily.
115
- *
116
- * @param instanceId - The unique identifier for the viewport
117
- * @returns A snapshot function for useSyncExternalStore
118
- */
119
- function getOrCreateSnapshot(instanceId) {
120
- const fallback = fallbackCache.get(instanceId) ?? (() => {
121
- const newFallback = {
122
- id: instanceId,
123
- bounds: void 0,
124
- latitude: NaN,
125
- longitude: NaN,
126
- zoom: NaN,
127
- width: 0,
128
- height: 0
129
- };
130
- fallbackCache.set(instanceId, newFallback);
131
- return newFallback;
132
- })();
133
- const snapshot = snapshotCache.get(instanceId) ?? (() => viewportStore.get(instanceId) ?? fallback);
134
- snapshotCache.set(instanceId, snapshot);
135
- return snapshot;
136
- }
137
- /**
138
- * Hook to subscribe to viewport state changes for a specific view.
139
- *
140
- * By default, subscribes to MapEvents.viewport events from the event bus and
141
- * automatically cleans up when all subscribers unmount. For advanced use cases,
142
- * custom subscribe/getSnapshot functions can be provided.
143
- *
144
- * A thin wrapper around [useSyncExternalStore](https://react.dev/reference/react/useSyncExternalStore).
145
- *
146
- * @param instanceId - Unique identifier for the viewport to track
147
- * @param subscribe - Optional custom subscription function
148
- * @param getSnapshot - Optional custom snapshot getter
149
- * @param getServerSnapshot - Optional server-side snapshot getter
150
- * @returns Current viewport state including bounds, latitude, longitude, zoom
151
- *
152
- * @example
153
- * ```tsx
154
- * function MapInfo({ instanceId }) {
155
- * const { bounds, latitude, longitude, zoom } = useViewportState({
156
- * instanceId
157
- * });
158
- *
159
- * return (
160
- * <div>
161
- * Lat: {latitude?.toFixed(2)}, Lon: {longitude?.toFixed(2)}, Zoom: {zoom}
162
- * </div>
163
- * );
164
- * }
165
- * ```
166
- *
167
- * @example
168
- * ```tsx
169
- * // With custom subscribe/getSnapshot for advanced use cases
170
- * function CustomMapInfo() {
171
- * const customSubscribe = (onStoreChange) => {
172
- * // Custom subscription logic
173
- * return () => { // cleanup }
174
- * }
175
- *
176
- * const customGetSnapshot = () => {
177
- * // Custom snapshot logic
178
- * return { latitude: 0, longitude: 0, zoom: 1 };
179
- * };
180
- *
181
- * const viewState = useViewportState({
182
- * instanceId: 'some-uuid',
183
- * subscribe: customSubscribe,
184
- * getSnapshot: customGetSnapshot,
185
- * });
186
- *
187
- * return <div>Custom viewport state</div>;
188
- * }
189
- * ```
190
- */
191
- function useViewportState({ instanceId, subscribe, getSnapshot, getServerSnapshot }) {
192
- return useSyncExternalStore(subscribe ?? getOrCreateSubscription(instanceId), getSnapshot ?? getOrCreateSnapshot(instanceId), getServerSnapshot);
193
- }
194
- /**
195
- * Manually clear viewport state for a specific instanceId.
196
- * This is typically not needed as cleanup happens automatically when all subscribers unmount.
197
- * Use this only in advanced scenarios where manual cleanup is required.
198
- *
199
- * @param instanceId - The unique identifier for the viewport to clear
200
- *
201
- * @example
202
- * ```tsx
203
- * // Manual cleanup (rarely needed)
204
- * clearViewportState('my-map-instance');
205
- * ```
206
- */
207
- function clearViewportState(instanceId) {
208
- const unsub = busUnsubscribers.get(instanceId);
209
- if (unsub) {
210
- unsub();
211
- busUnsubscribers.delete(instanceId);
212
- }
213
- viewportStore.delete(instanceId);
214
- componentSubscribers.delete(instanceId);
215
- subscriptionCache.delete(instanceId);
216
- snapshotCache.delete(instanceId);
217
- fallbackCache.delete(instanceId);
218
- }
219
-
220
- //#endregion
221
- export { clearViewportState, useViewportState };
222
- //# sourceMappingURL=use-viewport-state.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-viewport-state.js","names":["newFallback: MapViewportPayload"],"sources":["../../src/viewport/use-viewport-state.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\nimport { Broadcast } from '@accelint/bus';\nimport { useSyncExternalStore } from 'react';\nimport { MapEvents } from '../deckgl/base-map/events';\nimport type { UniqueId } from '@accelint/core';\nimport type {\n MapEventType,\n MapViewportPayload,\n} from '../deckgl/base-map/types';\n\nconst bus = Broadcast.getInstance<MapEventType>();\n\nexport type UseViewportStateProps = {\n instanceId: UniqueId;\n subscribe?: Parameters<typeof useSyncExternalStore<MapViewportPayload>>[0];\n getSnapshot?: Parameters<typeof useSyncExternalStore<MapViewportPayload>>[1];\n getServerSnapshot?: Parameters<\n typeof useSyncExternalStore<MapViewportPayload>\n >[2];\n};\n\n/**\n * Store for viewport state keyed by instanceId\n */\nconst viewportStore = new Map<UniqueId, MapViewportPayload>();\n\n/**\n * Track React component subscribers per instanceId (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 instanceId).\n * This ensures we only have one bus listener per viewport, 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 instanceId to avoid recreating on every render\n */\nconst subscriptionCache = new Map<UniqueId, Subscription>();\n\n/**\n * Cache of snapshot functions per instanceId to maintain referential stability\n */\nconst snapshotCache = new Map<UniqueId, () => MapViewportPayload>();\n\n/**\n * Cache of fallback snapshots per instanceId to maintain referential stability.\n * This prevents unnecessary re-renders when no viewport data exists yet.\n */\nconst fallbackCache = new Map<UniqueId, MapViewportPayload>();\n\n/**\n * Ensures a single bus listener exists for the given instanceId.\n * All React subscribers will be notified via fan-out when the bus event fires.\n * This prevents creating N bus listeners for N React components.\n *\n * @param instanceId - The unique identifier for the viewport\n */\nfunction ensureBusListener(instanceId: UniqueId): void {\n if (busUnsubscribers.has(instanceId)) {\n return; // Already listening\n }\n\n const unsub = bus.on(MapEvents.viewport, ({ payload }) => {\n if (instanceId === payload.id) {\n // Write to store once\n viewportStore.set(instanceId, payload);\n\n // Fan-out: notify all React subscribers\n const subscribers = componentSubscribers.get(instanceId);\n if (subscribers) {\n for (const onStoreChange of subscribers) {\n onStoreChange();\n }\n }\n }\n });\n\n busUnsubscribers.set(instanceId, unsub);\n}\n\n/**\n * Cleans up the bus listener if no React subscribers remain.\n *\n * @param instanceId - The unique identifier for the viewport\n */\nfunction cleanupBusListenerIfNeeded(instanceId: UniqueId): void {\n const subscribers = componentSubscribers.get(instanceId);\n\n if (!subscribers || subscribers.size === 0) {\n // No more React subscribers - clean up bus listener\n const unsub = busUnsubscribers.get(instanceId);\n if (unsub) {\n unsub();\n busUnsubscribers.delete(instanceId);\n }\n\n // Clean up all state\n viewportStore.delete(instanceId);\n componentSubscribers.delete(instanceId);\n subscriptionCache.delete(instanceId);\n snapshotCache.delete(instanceId);\n fallbackCache.delete(instanceId);\n }\n}\n\n/**\n * Creates or retrieves a cached subscription function for a given instanceId.\n * Uses a fan-out pattern: 1 bus listener -> N React subscribers.\n * Automatically cleans up viewport state when the last subscriber unsubscribes.\n *\n * @param instanceId - The unique identifier for the viewport\n * @returns A subscription function for useSyncExternalStore\n */\nfunction getOrCreateSubscription(\n instanceId: UniqueId,\n): (onStoreChange: () => void) => () => void {\n const subscription =\n subscriptionCache.get(instanceId) ??\n ((onStoreChange: () => void) => {\n // Ensure single bus listener exists for this instanceId\n ensureBusListener(instanceId);\n\n // Get or create the subscriber set for this map instance, then add this component's callback\n let subscriberSet = componentSubscribers.get(instanceId);\n if (!subscriberSet) {\n subscriberSet = new Set();\n componentSubscribers.set(instanceId, subscriberSet);\n }\n subscriberSet.add(onStoreChange);\n\n // Return cleanup function to remove this component's subscription\n return () => {\n const currentSubscriberSet = componentSubscribers.get(instanceId);\n if (currentSubscriberSet) {\n currentSubscriberSet.delete(onStoreChange);\n }\n\n // Clean up bus listener if this was the last React subscriber\n cleanupBusListenerIfNeeded(instanceId);\n };\n });\n\n subscriptionCache.set(instanceId, subscription);\n\n return subscription;\n}\n\n/**\n * Creates or retrieves a cached snapshot function for a given instanceId.\n * The object returned gets equality checked, so it needs to be stable or React re-renders unnecessarily.\n *\n * @param instanceId - The unique identifier for the viewport\n * @returns A snapshot function for useSyncExternalStore\n */\nfunction getOrCreateSnapshot(instanceId: UniqueId): () => MapViewportPayload {\n // Get or create stable fallback reference for this instanceId\n const fallback =\n fallbackCache.get(instanceId) ??\n (() => {\n const newFallback: MapViewportPayload = {\n id: instanceId,\n bounds: undefined,\n latitude: Number.NaN,\n longitude: Number.NaN,\n zoom: Number.NaN,\n width: 0,\n height: 0,\n };\n fallbackCache.set(instanceId, newFallback);\n return newFallback;\n })();\n\n const snapshot =\n snapshotCache.get(instanceId) ??\n (() => viewportStore.get(instanceId) ?? fallback);\n\n snapshotCache.set(instanceId, snapshot);\n\n return snapshot;\n}\n\n/**\n * Hook to subscribe to viewport state changes for a specific view.\n *\n * By default, subscribes to MapEvents.viewport events from the event bus and\n * automatically cleans up when all subscribers unmount. For advanced use cases,\n * custom subscribe/getSnapshot functions can be provided.\n *\n * A thin wrapper around [useSyncExternalStore](https://react.dev/reference/react/useSyncExternalStore).\n *\n * @param instanceId - Unique identifier for the viewport to track\n * @param subscribe - Optional custom subscription function\n * @param getSnapshot - Optional custom snapshot getter\n * @param getServerSnapshot - Optional server-side snapshot getter\n * @returns Current viewport state including bounds, latitude, longitude, zoom\n *\n * @example\n * ```tsx\n * function MapInfo({ instanceId }) {\n * const { bounds, latitude, longitude, zoom } = useViewportState({\n * instanceId\n * });\n *\n * return (\n * <div>\n * Lat: {latitude?.toFixed(2)}, Lon: {longitude?.toFixed(2)}, Zoom: {zoom}\n * </div>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // With custom subscribe/getSnapshot for advanced use cases\n * function CustomMapInfo() {\n * const customSubscribe = (onStoreChange) => {\n * // Custom subscription logic\n * return () => { // cleanup }\n * }\n *\n * const customGetSnapshot = () => {\n * // Custom snapshot logic\n * return { latitude: 0, longitude: 0, zoom: 1 };\n * };\n *\n * const viewState = useViewportState({\n * instanceId: 'some-uuid',\n * subscribe: customSubscribe,\n * getSnapshot: customGetSnapshot,\n * });\n *\n * return <div>Custom viewport state</div>;\n * }\n * ```\n */\nexport function useViewportState({\n instanceId,\n subscribe,\n getSnapshot,\n getServerSnapshot,\n}: UseViewportStateProps) {\n return useSyncExternalStore<MapViewportPayload>(\n subscribe ?? getOrCreateSubscription(instanceId),\n getSnapshot ?? getOrCreateSnapshot(instanceId),\n getServerSnapshot,\n );\n}\n\n/**\n * Manually clear viewport state for a specific instanceId.\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 instanceId - The unique identifier for the viewport to clear\n *\n * @example\n * ```tsx\n * // Manual cleanup (rarely needed)\n * clearViewportState('my-map-instance');\n * ```\n */\nexport function clearViewportState(instanceId: UniqueId): void {\n // Unsubscribe from bus if listening\n const unsub = busUnsubscribers.get(instanceId);\n if (unsub) {\n unsub();\n busUnsubscribers.delete(instanceId);\n }\n\n // Clear all state\n viewportStore.delete(instanceId);\n componentSubscribers.delete(instanceId);\n subscriptionCache.delete(instanceId);\n snapshotCache.delete(instanceId);\n fallbackCache.delete(instanceId);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,MAAM,MAAM,UAAU,aAA2B;;;;AAcjD,MAAM,gCAAgB,IAAI,KAAmC;;;;;AAM7D,MAAM,uCAAuB,IAAI,KAAgC;;;;;;AAOjE,MAAM,mCAAmB,IAAI,KAA2B;;;;AAMxD,MAAM,oCAAoB,IAAI,KAA6B;;;;AAK3D,MAAM,gCAAgB,IAAI,KAAyC;;;;;AAMnE,MAAM,gCAAgB,IAAI,KAAmC;;;;;;;;AAS7D,SAAS,kBAAkB,YAA4B;AACrD,KAAI,iBAAiB,IAAI,WAAW,CAClC;CAGF,MAAM,QAAQ,IAAI,GAAG,UAAU,WAAW,EAAE,cAAc;AACxD,MAAI,eAAe,QAAQ,IAAI;AAE7B,iBAAc,IAAI,YAAY,QAAQ;GAGtC,MAAM,cAAc,qBAAqB,IAAI,WAAW;AACxD,OAAI,YACF,MAAK,MAAM,iBAAiB,YAC1B,gBAAe;;GAIrB;AAEF,kBAAiB,IAAI,YAAY,MAAM;;;;;;;AAQzC,SAAS,2BAA2B,YAA4B;CAC9D,MAAM,cAAc,qBAAqB,IAAI,WAAW;AAExD,KAAI,CAAC,eAAe,YAAY,SAAS,GAAG;EAE1C,MAAM,QAAQ,iBAAiB,IAAI,WAAW;AAC9C,MAAI,OAAO;AACT,UAAO;AACP,oBAAiB,OAAO,WAAW;;AAIrC,gBAAc,OAAO,WAAW;AAChC,uBAAqB,OAAO,WAAW;AACvC,oBAAkB,OAAO,WAAW;AACpC,gBAAc,OAAO,WAAW;AAChC,gBAAc,OAAO,WAAW;;;;;;;;;;;AAYpC,SAAS,wBACP,YAC2C;CAC3C,MAAM,eACJ,kBAAkB,IAAI,WAAW,MAC/B,kBAA8B;AAE9B,oBAAkB,WAAW;EAG7B,IAAI,gBAAgB,qBAAqB,IAAI,WAAW;AACxD,MAAI,CAAC,eAAe;AAClB,mCAAgB,IAAI,KAAK;AACzB,wBAAqB,IAAI,YAAY,cAAc;;AAErD,gBAAc,IAAI,cAAc;AAGhC,eAAa;GACX,MAAM,uBAAuB,qBAAqB,IAAI,WAAW;AACjE,OAAI,qBACF,sBAAqB,OAAO,cAAc;AAI5C,8BAA2B,WAAW;;;AAI5C,mBAAkB,IAAI,YAAY,aAAa;AAE/C,QAAO;;;;;;;;;AAUT,SAAS,oBAAoB,YAAgD;CAE3E,MAAM,WACJ,cAAc,IAAI,WAAW,WACtB;EACL,MAAMA,cAAkC;GACtC,IAAI;GACJ,QAAQ;GACR,UAAU;GACV,WAAW;GACX,MAAM;GACN,OAAO;GACP,QAAQ;GACT;AACD,gBAAc,IAAI,YAAY,YAAY;AAC1C,SAAO;KACL;CAEN,MAAM,WACJ,cAAc,IAAI,WAAW,WACtB,cAAc,IAAI,WAAW,IAAI;AAE1C,eAAc,IAAI,YAAY,SAAS;AAEvC,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDT,SAAgB,iBAAiB,EAC/B,YACA,WACA,aACA,qBACwB;AACxB,QAAO,qBACL,aAAa,wBAAwB,WAAW,EAChD,eAAe,oBAAoB,WAAW,EAC9C,kBACD;;;;;;;;;;;;;;;AAgBH,SAAgB,mBAAmB,YAA4B;CAE7D,MAAM,QAAQ,iBAAiB,IAAI,WAAW;AAC9C,KAAI,OAAO;AACT,SAAO;AACP,mBAAiB,OAAO,WAAW;;AAIrC,eAAc,OAAO,WAAW;AAChC,sBAAqB,OAAO,WAAW;AACvC,mBAAkB,OAAO,WAAW;AACpC,eAAc,OAAO,WAAW;AAChC,eAAc,OAAO,WAAW"}