@accelint/map-toolkit 1.5.0 → 3.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 (224) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/README.md +8 -1
  3. package/catalog-info.yaml +9 -6
  4. package/dist/camera/events.js +1 -1
  5. package/dist/camera/index.d.ts +1 -1
  6. package/dist/camera/index.js +1 -1
  7. package/dist/camera/store.d.ts +1 -1
  8. package/dist/camera/store.js +3 -5
  9. package/dist/camera/store.js.map +1 -1
  10. package/dist/camera/types.d.ts +1 -1
  11. package/dist/camera/types.js +1 -1
  12. package/dist/cursor-coordinates/constants.js +1 -1
  13. package/dist/cursor-coordinates/index.d.ts +1 -1
  14. package/dist/cursor-coordinates/index.js +1 -1
  15. package/dist/cursor-coordinates/store.d.ts +1 -1
  16. package/dist/cursor-coordinates/store.js +1 -1
  17. package/dist/cursor-coordinates/types.d.ts +1 -1
  18. package/dist/cursor-coordinates/types.js +1 -1
  19. package/dist/cursor-coordinates/use-cursor-coordinates.d.ts +1 -1
  20. package/dist/cursor-coordinates/use-cursor-coordinates.js +4 -9
  21. package/dist/cursor-coordinates/use-cursor-coordinates.js.map +1 -1
  22. package/dist/deckgl/base-map/constants.js +1 -1
  23. package/dist/deckgl/base-map/controls.d.ts +1 -1
  24. package/dist/deckgl/base-map/controls.js +1 -1
  25. package/dist/deckgl/base-map/events.js +1 -1
  26. package/dist/deckgl/base-map/index.d.ts +3 -3
  27. package/dist/deckgl/base-map/index.js +1 -1
  28. package/dist/deckgl/base-map/provider.d.ts +1 -1
  29. package/dist/deckgl/base-map/provider.js +1 -1
  30. package/dist/deckgl/base-map/types.d.ts +1 -1
  31. package/dist/deckgl/base-map/types.js +1 -1
  32. package/dist/deckgl/extensions/coffin-corner/coffin-corner-extension.d.ts +144 -0
  33. package/dist/deckgl/extensions/coffin-corner/coffin-corner-extension.js +535 -0
  34. package/dist/deckgl/extensions/coffin-corner/coffin-corner-extension.js.map +1 -0
  35. package/dist/deckgl/extensions/coffin-corner/index.d.ts +17 -0
  36. package/dist/deckgl/extensions/coffin-corner/index.js +19 -0
  37. package/dist/deckgl/extensions/coffin-corner/store.d.ts +96 -0
  38. package/dist/deckgl/extensions/coffin-corner/store.js +173 -0
  39. package/dist/deckgl/extensions/coffin-corner/store.js.map +1 -0
  40. package/dist/deckgl/extensions/coffin-corner/types.d.ts +76 -0
  41. package/dist/deckgl/extensions/coffin-corner/types.js +27 -0
  42. package/dist/deckgl/extensions/coffin-corner/types.js.map +1 -0
  43. package/dist/deckgl/extensions/coffin-corner/use-coffin-corner.d.ts +81 -0
  44. package/dist/deckgl/extensions/coffin-corner/use-coffin-corner.js +75 -0
  45. package/dist/deckgl/extensions/coffin-corner/use-coffin-corner.js.map +1 -0
  46. package/dist/deckgl/extensions/index.d.ts +15 -0
  47. package/dist/deckgl/extensions/index.js +16 -0
  48. package/dist/deckgl/index.d.ts +9 -4
  49. package/dist/deckgl/index.js +6 -2
  50. package/dist/deckgl/saved-viewports/index.d.ts +1 -1
  51. package/dist/deckgl/saved-viewports/index.js +1 -1
  52. package/dist/deckgl/saved-viewports/storage.d.ts +1 -1
  53. package/dist/deckgl/saved-viewports/storage.js +5 -10
  54. package/dist/deckgl/saved-viewports/storage.js.map +1 -1
  55. package/dist/deckgl/shapes/display-shape-layer/constants.js +70 -26
  56. package/dist/deckgl/shapes/display-shape-layer/constants.js.map +1 -1
  57. package/dist/deckgl/shapes/display-shape-layer/fiber.d.ts +1 -1
  58. package/dist/deckgl/shapes/display-shape-layer/fiber.js +1 -1
  59. package/dist/deckgl/shapes/display-shape-layer/index.d.ts +93 -38
  60. package/dist/deckgl/shapes/display-shape-layer/index.js +433 -187
  61. package/dist/deckgl/shapes/display-shape-layer/index.js.map +1 -1
  62. package/dist/deckgl/shapes/display-shape-layer/shape-label-layer.js +1 -1
  63. package/dist/deckgl/shapes/display-shape-layer/store.js +1 -1
  64. package/dist/deckgl/shapes/display-shape-layer/types.d.ts +116 -19
  65. package/dist/deckgl/shapes/display-shape-layer/types.js +1 -1
  66. package/dist/deckgl/shapes/display-shape-layer/use-select-shape.d.ts +1 -1
  67. package/dist/deckgl/shapes/display-shape-layer/use-select-shape.js +1 -1
  68. package/dist/deckgl/shapes/display-shape-layer/utils/display-style.js +66 -36
  69. package/dist/deckgl/shapes/display-shape-layer/utils/display-style.js.map +1 -1
  70. package/dist/deckgl/shapes/display-shape-layer/utils/elevation.js +407 -0
  71. package/dist/deckgl/shapes/display-shape-layer/utils/elevation.js.map +1 -0
  72. package/dist/deckgl/shapes/display-shape-layer/utils/icon-config.js +106 -0
  73. package/dist/deckgl/shapes/display-shape-layer/utils/icon-config.js.map +1 -0
  74. package/dist/deckgl/shapes/display-shape-layer/utils/labels.d.ts +1 -1
  75. package/dist/deckgl/shapes/display-shape-layer/utils/labels.js +28 -39
  76. package/dist/deckgl/shapes/display-shape-layer/utils/labels.js.map +1 -1
  77. package/dist/deckgl/shapes/display-shape-layer/utils/radius-label.js +53 -0
  78. package/dist/deckgl/shapes/display-shape-layer/utils/radius-label.js.map +1 -0
  79. package/dist/deckgl/shapes/draw-shape-layer/constants.js +1 -1
  80. package/dist/deckgl/shapes/draw-shape-layer/events.d.ts +1 -1
  81. package/dist/deckgl/shapes/draw-shape-layer/events.js +1 -1
  82. package/dist/deckgl/shapes/draw-shape-layer/fiber.js +1 -1
  83. package/dist/deckgl/shapes/draw-shape-layer/index.d.ts +8 -4
  84. package/dist/deckgl/shapes/draw-shape-layer/index.js +11 -17
  85. package/dist/deckgl/shapes/draw-shape-layer/index.js.map +1 -1
  86. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-circle-mode-with-tooltip.js +6 -5
  87. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-circle-mode-with-tooltip.js.map +1 -1
  88. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-ellipse-mode-with-tooltip.js +4 -3
  89. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-ellipse-mode-with-tooltip.js.map +1 -1
  90. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-line-string-mode-with-tooltip.js +6 -20
  91. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-line-string-mode-with-tooltip.js.map +1 -1
  92. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-polygon-mode-with-tooltip.js +6 -33
  93. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-polygon-mode-with-tooltip.js.map +1 -1
  94. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-rectangle-mode-with-tooltip.js +16 -12
  95. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-rectangle-mode-with-tooltip.js.map +1 -1
  96. package/dist/deckgl/shapes/draw-shape-layer/modes/index.js +2 -32
  97. package/dist/deckgl/shapes/draw-shape-layer/modes/index.js.map +1 -1
  98. package/dist/deckgl/shapes/draw-shape-layer/store.js +1 -1
  99. package/dist/deckgl/shapes/draw-shape-layer/types.d.ts +3 -3
  100. package/dist/deckgl/shapes/draw-shape-layer/types.js +1 -1
  101. package/dist/deckgl/shapes/draw-shape-layer/use-draw-shape.d.ts +1 -1
  102. package/dist/deckgl/shapes/draw-shape-layer/use-draw-shape.js +1 -1
  103. package/dist/deckgl/shapes/draw-shape-layer/utils/feature-conversion.js +3 -8
  104. package/dist/deckgl/shapes/draw-shape-layer/utils/feature-conversion.js.map +1 -1
  105. package/dist/deckgl/shapes/edit-shape-layer/constants.js +17 -2
  106. package/dist/deckgl/shapes/edit-shape-layer/constants.js.map +1 -1
  107. package/dist/deckgl/shapes/edit-shape-layer/events.d.ts +1 -1
  108. package/dist/deckgl/shapes/edit-shape-layer/events.js +1 -1
  109. package/dist/deckgl/shapes/edit-shape-layer/fiber.d.ts +1 -1
  110. package/dist/deckgl/shapes/edit-shape-layer/fiber.js +1 -1
  111. package/dist/deckgl/shapes/edit-shape-layer/index.d.ts +12 -6
  112. package/dist/deckgl/shapes/edit-shape-layer/index.js +72 -27
  113. package/dist/deckgl/shapes/edit-shape-layer/index.js.map +1 -1
  114. package/dist/deckgl/shapes/edit-shape-layer/modes/base-transform-mode.js +4 -1
  115. package/dist/deckgl/shapes/edit-shape-layer/modes/base-transform-mode.js.map +1 -1
  116. package/dist/deckgl/shapes/edit-shape-layer/modes/bounding-transform-mode.js +4 -3
  117. package/dist/deckgl/shapes/edit-shape-layer/modes/bounding-transform-mode.js.map +1 -1
  118. package/dist/deckgl/shapes/edit-shape-layer/modes/circle-transform-mode.js +5 -3
  119. package/dist/deckgl/shapes/edit-shape-layer/modes/circle-transform-mode.js.map +1 -1
  120. package/dist/deckgl/shapes/edit-shape-layer/modes/index.js +1 -1
  121. package/dist/deckgl/shapes/edit-shape-layer/modes/point-translate-mode.js +1 -1
  122. package/dist/deckgl/shapes/edit-shape-layer/modes/point-translate-mode.js.map +1 -1
  123. package/dist/deckgl/shapes/edit-shape-layer/modes/rotate-mode-with-snap.js +1 -1
  124. package/dist/deckgl/shapes/edit-shape-layer/modes/rotate-mode-with-snap.js.map +1 -1
  125. package/dist/deckgl/shapes/edit-shape-layer/modes/scale-mode-with-free-transform.js +1 -1
  126. package/dist/deckgl/shapes/edit-shape-layer/modes/scale-mode-with-free-transform.js.map +1 -1
  127. package/dist/deckgl/shapes/edit-shape-layer/modes/vertex-transform-mode.js +1 -1
  128. package/dist/deckgl/shapes/edit-shape-layer/modes/vertex-transform-mode.js.map +1 -1
  129. package/dist/deckgl/shapes/edit-shape-layer/store.js +83 -14
  130. package/dist/deckgl/shapes/edit-shape-layer/store.js.map +1 -1
  131. package/dist/deckgl/shapes/edit-shape-layer/types.d.ts +18 -4
  132. package/dist/deckgl/shapes/edit-shape-layer/types.js +1 -1
  133. package/dist/deckgl/shapes/edit-shape-layer/use-edit-shape.d.ts +2 -2
  134. package/dist/deckgl/shapes/edit-shape-layer/use-edit-shape.js +8 -4
  135. package/dist/deckgl/shapes/edit-shape-layer/use-edit-shape.js.map +1 -1
  136. package/dist/deckgl/shapes/index.d.ts +5 -4
  137. package/dist/deckgl/shapes/index.js +3 -2
  138. package/dist/deckgl/shapes/shared/constants.d.ts +4 -3
  139. package/dist/deckgl/shapes/shared/constants.js +51 -11
  140. package/dist/deckgl/shapes/shared/constants.js.map +1 -1
  141. package/dist/deckgl/shapes/shared/events.d.ts +5 -1
  142. package/dist/deckgl/shapes/shared/events.js +1 -1
  143. package/dist/deckgl/shapes/shared/events.js.map +1 -1
  144. package/dist/deckgl/shapes/shared/hooks/use-shift-zoom-disable.js +19 -16
  145. package/dist/deckgl/shapes/shared/hooks/use-shift-zoom-disable.js.map +1 -1
  146. package/dist/deckgl/shapes/shared/types.d.ts +182 -54
  147. package/dist/deckgl/shapes/shared/types.js +155 -2
  148. package/dist/deckgl/shapes/shared/types.js.map +1 -1
  149. package/dist/deckgl/shapes/shared/utils/duplicate-shape.d.ts +56 -0
  150. package/dist/deckgl/shapes/shared/utils/duplicate-shape.js +131 -0
  151. package/dist/deckgl/shapes/shared/utils/duplicate-shape.js.map +1 -0
  152. package/dist/deckgl/shapes/shared/utils/geometry-measurements.js +29 -24
  153. package/dist/deckgl/shapes/shared/utils/geometry-measurements.js.map +1 -1
  154. package/dist/deckgl/shapes/shared/utils/layer-config.js +15 -9
  155. package/dist/deckgl/shapes/shared/utils/layer-config.js.map +1 -1
  156. package/dist/deckgl/shapes/shared/utils/mode-utils.js +50 -20
  157. package/dist/deckgl/shapes/shared/utils/mode-utils.js.map +1 -1
  158. package/dist/deckgl/shapes/shared/utils/pick-filtering.js +22 -15
  159. package/dist/deckgl/shapes/shared/utils/pick-filtering.js.map +1 -1
  160. package/dist/deckgl/shapes/shared/utils/style-utils.d.ts +38 -14
  161. package/dist/deckgl/shapes/shared/utils/style-utils.js +43 -32
  162. package/dist/deckgl/shapes/shared/utils/style-utils.js.map +1 -1
  163. package/dist/deckgl/symbol-layer/fiber.d.ts +4 -2
  164. package/dist/deckgl/symbol-layer/fiber.js +1 -1
  165. package/dist/deckgl/symbol-layer/fiber.js.map +1 -1
  166. package/dist/deckgl/symbol-layer/index.d.ts +1 -1
  167. package/dist/deckgl/symbol-layer/index.js +1 -1
  168. package/dist/deckgl/text-layer/character-sets.js +1 -1
  169. package/dist/deckgl/text-layer/default-settings.d.ts +1 -1
  170. package/dist/deckgl/text-layer/default-settings.js +1 -1
  171. package/dist/deckgl/text-layer/fiber.d.ts +1 -1
  172. package/dist/deckgl/text-layer/fiber.js +1 -1
  173. package/dist/deckgl/text-layer/index.d.ts +1 -1
  174. package/dist/deckgl/text-layer/index.js +1 -1
  175. package/dist/deckgl/text-settings.d.ts +3 -3
  176. package/dist/deckgl/text-settings.js +1 -1
  177. package/dist/map-cursor/events.js +1 -1
  178. package/dist/map-cursor/index.d.ts +1 -1
  179. package/dist/map-cursor/index.js +1 -1
  180. package/dist/map-cursor/store.d.ts +1 -1
  181. package/dist/map-cursor/store.js +1 -1
  182. package/dist/map-cursor/types.d.ts +1 -1
  183. package/dist/map-cursor/types.js +1 -1
  184. package/dist/map-cursor/use-map-cursor.d.ts +1 -1
  185. package/dist/map-cursor/use-map-cursor.js +1 -1
  186. package/dist/map-mode/events.js +1 -1
  187. package/dist/map-mode/index.d.ts +1 -1
  188. package/dist/map-mode/index.js +1 -1
  189. package/dist/map-mode/store.d.ts +1 -1
  190. package/dist/map-mode/store.js +3 -8
  191. package/dist/map-mode/store.js.map +1 -1
  192. package/dist/map-mode/types.d.ts +1 -1
  193. package/dist/map-mode/types.js +1 -1
  194. package/dist/map-mode/use-map-mode.d.ts +1 -1
  195. package/dist/map-mode/use-map-mode.js +1 -1
  196. package/dist/maplibre/hooks/use-maplibre.d.ts +1 -1
  197. package/dist/maplibre/hooks/use-maplibre.js +1 -1
  198. package/dist/maplibre/index.d.ts +1 -1
  199. package/dist/maplibre/index.js +1 -1
  200. package/dist/shared/cleanup.d.ts +1 -1
  201. package/dist/shared/cleanup.js +1 -1
  202. package/dist/shared/constants.js +1 -1
  203. package/dist/shared/create-map-store.d.ts +1 -1
  204. package/dist/shared/create-map-store.js +1 -1
  205. package/dist/shared/logger.js +31 -0
  206. package/dist/shared/logger.js.map +1 -0
  207. package/dist/shared/units.d.ts +15 -56
  208. package/dist/shared/units.js +2 -53
  209. package/dist/shared/units.js.map +1 -1
  210. package/dist/viewport/index.d.ts +3 -4
  211. package/dist/viewport/index.js +2 -3
  212. package/dist/viewport/store.d.ts +1 -1
  213. package/dist/viewport/store.js +1 -1
  214. package/dist/viewport/types.d.ts +9 -5
  215. package/dist/viewport/types.js +1 -1
  216. package/dist/viewport/utils.d.ts +4 -4
  217. package/dist/viewport/utils.js +17 -9
  218. package/dist/viewport/utils.js.map +1 -1
  219. package/dist/viewport/viewport-size.d.ts +7 -6
  220. package/dist/viewport/viewport-size.js +3 -3
  221. package/dist/viewport/viewport-size.js.map +1 -1
  222. package/package.json +29 -20
  223. package/dist/hotkey-manager/dist/react/use-hotkey.js +0 -39
  224. package/dist/hotkey-manager/dist/react/use-hotkey.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -11,12 +11,14 @@
11
11
  */
12
12
 
13
13
 
14
- 'use client';
15
-
16
- import { DEFAULT_DISTANCE_UNITS, getDistanceUnitFromAbbreviation } from "../../../../shared/units.js";
14
+ import { DEFAULT_DISTANCE_UNITS } from "../../../../shared/units.js";
17
15
  import { DEFAULT_EDIT_HANDLE_COLOR, EDITABLE_LAYER_SUBLAYER_PROPS } from "../constants.js";
16
+ import { DISTANCE_UNIT_BY_SYMBOL } from "@accelint/constants/units";
18
17
 
19
18
  //#region src/deckgl/shapes/shared/utils/layer-config.ts
19
+ let cachedSymbol;
20
+ let cachedProps;
21
+ let hasCache = false;
20
22
  /**
21
23
  * Returns default props for EditableGeoJsonLayer configuration.
22
24
  *
@@ -25,8 +27,8 @@ import { DEFAULT_EDIT_HANDLE_COLOR, EDITABLE_LAYER_SUBLAYER_PROPS } from "../con
25
27
  * - Mode configuration with distance units
26
28
  * - Sublayer props for tooltips and handles
27
29
  *
28
- * @param unitAbbrev - Optional unit abbreviation (e.g., 'km', 'mi'). Defaults to DEFAULT_DISTANCE_UNITS.
29
- * @returns Default props to spread onto EditableGeoJsonLayer
30
+ * @param unitSymbol - Optional unit symbol (e.g., 'km', 'mi'). Defaults to DEFAULT_DISTANCE_UNITS.
31
+ * @returns Default props to spread onto EditableGeoJsonLayer.
30
32
  *
31
33
  * @example
32
34
  * ```tsx
@@ -36,13 +38,17 @@ import { DEFAULT_EDIT_HANDLE_COLOR, EDITABLE_LAYER_SUBLAYER_PROPS } from "../con
36
38
  * />
37
39
  * ```
38
40
  */
39
- function getDefaultEditableLayerProps(unitAbbrev) {
40
- return {
41
+ function getDefaultEditableLayerProps(unitSymbol) {
42
+ if (hasCache && cachedSymbol === unitSymbol && cachedProps) return cachedProps;
43
+ hasCache = true;
44
+ cachedSymbol = unitSymbol;
45
+ cachedProps = {
41
46
  getEditHandlePointColor: DEFAULT_EDIT_HANDLE_COLOR,
42
47
  getEditHandlePointOutlineColor: DEFAULT_EDIT_HANDLE_COLOR,
43
- modeConfig: { distanceUnits: unitAbbrev ? getDistanceUnitFromAbbreviation(unitAbbrev) ?? DEFAULT_DISTANCE_UNITS : DEFAULT_DISTANCE_UNITS },
48
+ modeConfig: { distanceUnits: unitSymbol ? DISTANCE_UNIT_BY_SYMBOL[unitSymbol] ?? DEFAULT_DISTANCE_UNITS : DEFAULT_DISTANCE_UNITS },
44
49
  _subLayerProps: EDITABLE_LAYER_SUBLAYER_PROPS
45
50
  };
51
+ return cachedProps;
46
52
  }
47
53
 
48
54
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"layer-config.js","names":[],"sources":["../../../../../src/deckgl/shapes/shared/utils/layer-config.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport {\n DEFAULT_DISTANCE_UNITS,\n getDistanceUnitFromAbbreviation,\n} from '@/shared/units';\nimport {\n DEFAULT_EDIT_HANDLE_COLOR,\n EDITABLE_LAYER_SUBLAYER_PROPS,\n} from '../constants';\nimport type { Color } from '@deck.gl/core';\nimport type { DistanceUnit } from '@/shared/units';\n\n/**\n * Props returned by getDefaultEditableLayerProps.\n * These are common configuration props shared between DrawShapeLayer and EditShapeLayer.\n */\nexport interface EditableLayerDefaultProps {\n /** Edit handle point color */\n getEditHandlePointColor: Color;\n /** Edit handle point outline color */\n getEditHandlePointOutlineColor: Color;\n /** Mode configuration with distance units */\n modeConfig: {\n distanceUnits: DistanceUnit;\n };\n /** Sublayer props for tooltips and edit handles */\n _subLayerProps: typeof EDITABLE_LAYER_SUBLAYER_PROPS;\n}\n\n/**\n * Returns default props for EditableGeoJsonLayer configuration.\n *\n * This consolidates the common configuration shared between DrawShapeLayer and EditShapeLayer:\n * - Edit handle colors\n * - Mode configuration with distance units\n * - Sublayer props for tooltips and handles\n *\n * @param unitAbbrev - Optional unit abbreviation (e.g., 'km', 'mi'). Defaults to DEFAULT_DISTANCE_UNITS.\n * @returns Default props to spread onto EditableGeoJsonLayer\n *\n * @example\n * ```tsx\n * <editableGeoJsonLayer\n * {...getDefaultEditableLayerProps(unit)}\n * // other props\n * />\n * ```\n */\nexport function getDefaultEditableLayerProps(\n unitAbbrev?: string,\n): EditableLayerDefaultProps {\n return {\n getEditHandlePointColor: DEFAULT_EDIT_HANDLE_COLOR,\n getEditHandlePointOutlineColor: DEFAULT_EDIT_HANDLE_COLOR,\n modeConfig: {\n distanceUnits: unitAbbrev\n ? (getDistanceUnitFromAbbreviation(unitAbbrev) ??\n DEFAULT_DISTANCE_UNITS)\n : DEFAULT_DISTANCE_UNITS,\n },\n // biome-ignore lint/style/useNamingConvention: deck.gl API convention\n _subLayerProps: EDITABLE_LAYER_SUBLAYER_PROPS,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,SAAgB,6BACd,YAC2B;AAC3B,QAAO;EACL,yBAAyB;EACzB,gCAAgC;EAChC,YAAY,EACV,eAAe,aACV,gCAAgC,WAAW,IAC5C,yBACA,wBACL;EAED,gBAAgB;EACjB"}
1
+ {"version":3,"file":"layer-config.js","names":["cachedSymbol: DistanceUnitSymbol | undefined","cachedProps: EditableLayerDefaultProps | undefined"],"sources":["../../../../../src/deckgl/shapes/shared/utils/layer-config.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { DISTANCE_UNIT_BY_SYMBOL } from '@accelint/constants/units';\nimport { DEFAULT_DISTANCE_UNITS } from '@/shared/units';\nimport {\n DEFAULT_EDIT_HANDLE_COLOR,\n EDITABLE_LAYER_SUBLAYER_PROPS,\n} from '../constants';\nimport type {\n DistanceUnit,\n DistanceUnitSymbol,\n} from '@accelint/constants/units';\nimport type { Color } from '@deck.gl/core';\n\n/**\n * Props returned by getDefaultEditableLayerProps.\n * These are common configuration props shared between DrawShapeLayer and EditShapeLayer.\n */\nexport type EditableLayerDefaultProps = {\n /** Edit handle point color. */\n getEditHandlePointColor: Color;\n /** Edit handle point outline color. */\n getEditHandlePointOutlineColor: Color;\n /** Mode configuration with distance units. */\n modeConfig: {\n distanceUnits: DistanceUnit;\n };\n /** Sublayer props for tooltips and edit handles. */\n _subLayerProps: typeof EDITABLE_LAYER_SUBLAYER_PROPS;\n};\n\nlet cachedSymbol: DistanceUnitSymbol | undefined;\nlet cachedProps: EditableLayerDefaultProps | undefined;\nlet hasCache = false;\n\n/**\n * Returns default props for EditableGeoJsonLayer configuration.\n *\n * This consolidates the common configuration shared between DrawShapeLayer and EditShapeLayer:\n * - Edit handle colors\n * - Mode configuration with distance units\n * - Sublayer props for tooltips and handles\n *\n * @param unitSymbol - Optional unit symbol (e.g., 'km', 'mi'). Defaults to DEFAULT_DISTANCE_UNITS.\n * @returns Default props to spread onto EditableGeoJsonLayer.\n *\n * @example\n * ```tsx\n * <editableGeoJsonLayer\n * {...getDefaultEditableLayerProps(unit)}\n * // other props\n * />\n * ```\n */\nexport function getDefaultEditableLayerProps(\n unitSymbol?: DistanceUnitSymbol,\n): EditableLayerDefaultProps {\n if (hasCache && cachedSymbol === unitSymbol && cachedProps) {\n return cachedProps;\n }\n\n hasCache = true;\n cachedSymbol = unitSymbol;\n cachedProps = {\n getEditHandlePointColor: DEFAULT_EDIT_HANDLE_COLOR,\n getEditHandlePointOutlineColor: DEFAULT_EDIT_HANDLE_COLOR,\n modeConfig: {\n distanceUnits: unitSymbol\n ? (DISTANCE_UNIT_BY_SYMBOL[unitSymbol] ?? DEFAULT_DISTANCE_UNITS)\n : DEFAULT_DISTANCE_UNITS,\n },\n // biome-ignore lint/style/useNamingConvention: deck.gl API convention\n _subLayerProps: EDITABLE_LAYER_SUBLAYER_PROPS,\n };\n\n return cachedProps;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyCA,IAAIA;AACJ,IAAIC;AACJ,IAAI,WAAW;;;;;;;;;;;;;;;;;;;;AAqBf,SAAgB,6BACd,YAC2B;AAC3B,KAAI,YAAY,iBAAiB,cAAc,YAC7C,QAAO;AAGT,YAAW;AACX,gBAAe;AACf,eAAc;EACZ,yBAAyB;EACzB,gCAAgC;EAChC,YAAY,EACV,eAAe,aACV,wBAAwB,eAAe,yBACxC,wBACL;EAED,gBAAgB;EACjB;AAED,QAAO"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -11,8 +11,6 @@
11
11
  */
12
12
 
13
13
 
14
- 'use client';
15
-
16
14
  import { MapModeEvents } from "../../../../map-mode/events.js";
17
15
  import { MapCursorEvents } from "../../../../map-cursor/events.js";
18
16
  import { cursorStore } from "../../../../map-cursor/store.js";
@@ -24,15 +22,22 @@ import { Broadcast } from "@accelint/bus";
24
22
  */
25
23
  const mapModeBus = Broadcast.getInstance();
26
24
  const mapCursorBus = Broadcast.getInstance();
25
+ /** The idle mode name used when releasing ownership. */
26
+ const DEFAULT_MODE = "default";
27
27
  /**
28
28
  * Request a map mode change.
29
29
  *
30
30
  * Emits a mode change request through the event bus. The mode store will
31
31
  * handle authorization and apply the change if approved.
32
32
  *
33
- * @param mapId - The map instance ID
34
- * @param desiredMode - The mode to switch to
35
- * @param owner - The identifier of the component requesting the change
33
+ * @param mapId - The map instance ID.
34
+ * @param desiredMode - The mode to switch to.
35
+ * @param owner - The identifier of the component requesting the change.
36
+ *
37
+ * @example
38
+ * ```typescript
39
+ * requestModeChange(mapId, 'draw', 'draw-shape-layer');
40
+ * ```
36
41
  */
37
42
  function requestModeChange(mapId, desiredMode, owner) {
38
43
  mapModeBus.emit(MapModeEvents.changeRequest, {
@@ -46,20 +51,30 @@ function requestModeChange(mapId, desiredMode, owner) {
46
51
  *
47
52
  * Convenience function to request a mode change back to 'default'.
48
53
  *
49
- * @param mapId - The map instance ID
50
- * @param owner - The identifier of the component releasing the mode
54
+ * @param mapId - The map instance ID.
55
+ * @param owner - The identifier of the component releasing the mode.
56
+ *
57
+ * @example
58
+ * ```typescript
59
+ * releaseMode(mapId, 'draw-shape-layer');
60
+ * ```
51
61
  */
52
62
  function releaseMode(mapId, owner) {
53
- requestModeChange(mapId, "default", owner);
63
+ requestModeChange(mapId, DEFAULT_MODE, owner);
54
64
  }
55
65
  /**
56
66
  * Request a cursor change.
57
67
  *
58
68
  * Emits a cursor change request through the event bus.
59
69
  *
60
- * @param mapId - The map instance ID
61
- * @param cursor - The CSS cursor type to set
62
- * @param owner - The identifier of the component requesting the change
70
+ * @param mapId - The map instance ID.
71
+ * @param cursor - The CSS cursor type to set.
72
+ * @param owner - The identifier of the component requesting the change.
73
+ *
74
+ * @example
75
+ * ```typescript
76
+ * requestCursorChange(mapId, 'crosshair', 'draw-shape-layer');
77
+ * ```
63
78
  */
64
79
  function requestCursorChange(mapId, cursor, owner) {
65
80
  mapCursorBus.emit(MapCursorEvents.changeRequest, {
@@ -73,8 +88,13 @@ function requestCursorChange(mapId, cursor, owner) {
73
88
  *
74
89
  * Uses the cursor store's clear function to release the cursor.
75
90
  *
76
- * @param mapId - The map instance ID
77
- * @param owner - The identifier of the component releasing the cursor
91
+ * @param mapId - The map instance ID.
92
+ * @param owner - The identifier of the component releasing the cursor.
93
+ *
94
+ * @example
95
+ * ```typescript
96
+ * releaseCursor(mapId, 'draw-shape-layer');
97
+ * ```
78
98
  */
79
99
  function releaseCursor(mapId, owner) {
80
100
  cursorStore.actions(mapId).clearCursor(owner);
@@ -86,10 +106,15 @@ function releaseCursor(mapId, owner) {
86
106
  * requires authorization. When the mode change is approved, the cursor
87
107
  * will be automatically applied via getEffectiveCursor.
88
108
  *
89
- * @param mapId - The map instance ID
90
- * @param desiredMode - The mode to switch to
91
- * @param cursor - The CSS cursor type to set
92
- * @param owner - The identifier of the component requesting the changes
109
+ * @param mapId - The map instance ID.
110
+ * @param desiredMode - The mode to switch to.
111
+ * @param cursor - The CSS cursor type to set.
112
+ * @param owner - The identifier of the component requesting the changes.
113
+ *
114
+ * @example
115
+ * ```typescript
116
+ * requestModeAndCursor(mapId, 'draw', 'crosshair', 'draw-shape-layer');
117
+ * ```
93
118
  */
94
119
  function requestModeAndCursor(mapId, desiredMode, cursor, owner) {
95
120
  requestModeChange(mapId, desiredMode, owner);
@@ -100,8 +125,13 @@ function requestModeAndCursor(mapId, desiredMode, cursor, owner) {
100
125
  *
101
126
  * Common pattern when ending an operation.
102
127
  *
103
- * @param mapId - The map instance ID
104
- * @param owner - The identifier of the component releasing mode and cursor
128
+ * @param mapId - The map instance ID.
129
+ * @param owner - The identifier of the component releasing mode and cursor.
130
+ *
131
+ * @example
132
+ * ```typescript
133
+ * releaseModeAndCursor(mapId, 'draw-shape-layer');
134
+ * ```
105
135
  */
106
136
  function releaseModeAndCursor(mapId, owner) {
107
137
  releaseMode(mapId, owner);
@@ -1 +1 @@
1
- {"version":3,"file":"mode-utils.js","names":[],"sources":["../../../../../src/deckgl/shapes/shared/utils/mode-utils.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport { Broadcast } from '@accelint/bus';\nimport { MapCursorEvents } from '@/map-cursor/events';\nimport { cursorStore } from '@/map-cursor/store';\nimport { MapModeEvents } from '@/map-mode/events';\nimport type { UniqueId } from '@accelint/core';\nimport type { CSSCursorType, MapCursorEventType } from '@/map-cursor/types';\nimport type { MapModeEventType } from '@/map-mode/types';\n\n/**\n * Typed event bus instances for mode and cursor communication.\n */\nconst mapModeBus = Broadcast.getInstance<MapModeEventType>();\nconst mapCursorBus = Broadcast.getInstance<MapCursorEventType>();\n\n/**\n * Request a map mode change.\n *\n * Emits a mode change request through the event bus. The mode store will\n * handle authorization and apply the change if approved.\n *\n * @param mapId - The map instance ID\n * @param desiredMode - The mode to switch to\n * @param owner - The identifier of the component requesting the change\n */\nexport function requestModeChange(\n mapId: UniqueId,\n desiredMode: string,\n owner: string,\n): void {\n mapModeBus.emit(MapModeEvents.changeRequest, {\n desiredMode,\n owner,\n id: mapId,\n });\n}\n\n/**\n * Release mode back to default.\n *\n * Convenience function to request a mode change back to 'default'.\n *\n * @param mapId - The map instance ID\n * @param owner - The identifier of the component releasing the mode\n */\nexport function releaseMode(mapId: UniqueId, owner: string): void {\n requestModeChange(mapId, 'default', owner);\n}\n\n/**\n * Request a cursor change.\n *\n * Emits a cursor change request through the event bus.\n *\n * @param mapId - The map instance ID\n * @param cursor - The CSS cursor type to set\n * @param owner - The identifier of the component requesting the change\n */\nexport function requestCursorChange(\n mapId: UniqueId,\n cursor: CSSCursorType,\n owner: string,\n): void {\n mapCursorBus.emit(MapCursorEvents.changeRequest, {\n cursor,\n owner,\n id: mapId,\n });\n}\n\n/**\n * Release cursor back to default.\n *\n * Uses the cursor store's clear function to release the cursor.\n *\n * @param mapId - The map instance ID\n * @param owner - The identifier of the component releasing the cursor\n */\nexport function releaseCursor(mapId: UniqueId, owner: string): void {\n cursorStore.actions(mapId).clearCursor(owner);\n}\n\n/**\n * Request both mode and cursor changes together.\n *\n * The cursor is stored for registered mode owners even if the mode change\n * requires authorization. When the mode change is approved, the cursor\n * will be automatically applied via getEffectiveCursor.\n *\n * @param mapId - The map instance ID\n * @param desiredMode - The mode to switch to\n * @param cursor - The CSS cursor type to set\n * @param owner - The identifier of the component requesting the changes\n */\nexport function requestModeAndCursor(\n mapId: UniqueId,\n desiredMode: string,\n cursor: CSSCursorType,\n owner: string,\n): void {\n requestModeChange(mapId, desiredMode, owner);\n requestCursorChange(mapId, cursor, owner);\n}\n\n/**\n * Release both mode and cursor back to defaults.\n *\n * Common pattern when ending an operation.\n *\n * @param mapId - The map instance ID\n * @param owner - The identifier of the component releasing mode and cursor\n */\nexport function releaseModeAndCursor(mapId: UniqueId, owner: string): void {\n releaseMode(mapId, owner);\n releaseCursor(mapId, owner);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,aAAa,UAAU,aAA+B;AAC5D,MAAM,eAAe,UAAU,aAAiC;;;;;;;;;;;AAYhE,SAAgB,kBACd,OACA,aACA,OACM;AACN,YAAW,KAAK,cAAc,eAAe;EAC3C;EACA;EACA,IAAI;EACL,CAAC;;;;;;;;;;AAWJ,SAAgB,YAAY,OAAiB,OAAqB;AAChE,mBAAkB,OAAO,WAAW,MAAM;;;;;;;;;;;AAY5C,SAAgB,oBACd,OACA,QACA,OACM;AACN,cAAa,KAAK,gBAAgB,eAAe;EAC/C;EACA;EACA,IAAI;EACL,CAAC;;;;;;;;;;AAWJ,SAAgB,cAAc,OAAiB,OAAqB;AAClE,aAAY,QAAQ,MAAM,CAAC,YAAY,MAAM;;;;;;;;;;;;;;AAe/C,SAAgB,qBACd,OACA,aACA,QACA,OACM;AACN,mBAAkB,OAAO,aAAa,MAAM;AAC5C,qBAAoB,OAAO,QAAQ,MAAM;;;;;;;;;;AAW3C,SAAgB,qBAAqB,OAAiB,OAAqB;AACzE,aAAY,OAAO,MAAM;AACzB,eAAc,OAAO,MAAM"}
1
+ {"version":3,"file":"mode-utils.js","names":[],"sources":["../../../../../src/deckgl/shapes/shared/utils/mode-utils.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { Broadcast } from '@accelint/bus';\nimport { MapCursorEvents } from '@/map-cursor/events';\nimport { cursorStore } from '@/map-cursor/store';\nimport { MapModeEvents } from '@/map-mode/events';\nimport type { UniqueId } from '@accelint/core';\nimport type { CSSCursorType, MapCursorEventType } from '@/map-cursor/types';\nimport type { MapModeEventType } from '@/map-mode/types';\n\n/**\n * Typed event bus instances for mode and cursor communication.\n */\nconst mapModeBus = Broadcast.getInstance<MapModeEventType>();\nconst mapCursorBus = Broadcast.getInstance<MapCursorEventType>();\n\n/** The idle mode name used when releasing ownership. */\nconst DEFAULT_MODE = 'default';\n\n/**\n * Request a map mode change.\n *\n * Emits a mode change request through the event bus. The mode store will\n * handle authorization and apply the change if approved.\n *\n * @param mapId - The map instance ID.\n * @param desiredMode - The mode to switch to.\n * @param owner - The identifier of the component requesting the change.\n *\n * @example\n * ```typescript\n * requestModeChange(mapId, 'draw', 'draw-shape-layer');\n * ```\n */\nexport function requestModeChange(\n mapId: UniqueId,\n desiredMode: string,\n owner: string,\n): void {\n mapModeBus.emit(MapModeEvents.changeRequest, {\n desiredMode,\n owner,\n id: mapId,\n });\n}\n\n/**\n * Release mode back to default.\n *\n * Convenience function to request a mode change back to 'default'.\n *\n * @param mapId - The map instance ID.\n * @param owner - The identifier of the component releasing the mode.\n *\n * @example\n * ```typescript\n * releaseMode(mapId, 'draw-shape-layer');\n * ```\n */\nexport function releaseMode(mapId: UniqueId, owner: string): void {\n requestModeChange(mapId, DEFAULT_MODE, owner);\n}\n\n/**\n * Request a cursor change.\n *\n * Emits a cursor change request through the event bus.\n *\n * @param mapId - The map instance ID.\n * @param cursor - The CSS cursor type to set.\n * @param owner - The identifier of the component requesting the change.\n *\n * @example\n * ```typescript\n * requestCursorChange(mapId, 'crosshair', 'draw-shape-layer');\n * ```\n */\nexport function requestCursorChange(\n mapId: UniqueId,\n cursor: CSSCursorType,\n owner: string,\n): void {\n mapCursorBus.emit(MapCursorEvents.changeRequest, {\n cursor,\n owner,\n id: mapId,\n });\n}\n\n/**\n * Release cursor back to default.\n *\n * Uses the cursor store's clear function to release the cursor.\n *\n * @param mapId - The map instance ID.\n * @param owner - The identifier of the component releasing the cursor.\n *\n * @example\n * ```typescript\n * releaseCursor(mapId, 'draw-shape-layer');\n * ```\n */\nexport function releaseCursor(mapId: UniqueId, owner: string): void {\n cursorStore.actions(mapId).clearCursor(owner);\n}\n\n/**\n * Request both mode and cursor changes together.\n *\n * The cursor is stored for registered mode owners even if the mode change\n * requires authorization. When the mode change is approved, the cursor\n * will be automatically applied via getEffectiveCursor.\n *\n * @param mapId - The map instance ID.\n * @param desiredMode - The mode to switch to.\n * @param cursor - The CSS cursor type to set.\n * @param owner - The identifier of the component requesting the changes.\n *\n * @example\n * ```typescript\n * requestModeAndCursor(mapId, 'draw', 'crosshair', 'draw-shape-layer');\n * ```\n */\nexport function requestModeAndCursor(\n mapId: UniqueId,\n desiredMode: string,\n cursor: CSSCursorType,\n owner: string,\n): void {\n requestModeChange(mapId, desiredMode, owner);\n requestCursorChange(mapId, cursor, owner);\n}\n\n/**\n * Release both mode and cursor back to defaults.\n *\n * Common pattern when ending an operation.\n *\n * @param mapId - The map instance ID.\n * @param owner - The identifier of the component releasing mode and cursor.\n *\n * @example\n * ```typescript\n * releaseModeAndCursor(mapId, 'draw-shape-layer');\n * ```\n */\nexport function releaseModeAndCursor(mapId: UniqueId, owner: string): void {\n releaseMode(mapId, owner);\n releaseCursor(mapId, owner);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAM,aAAa,UAAU,aAA+B;AAC5D,MAAM,eAAe,UAAU,aAAiC;;AAGhE,MAAM,eAAe;;;;;;;;;;;;;;;;AAiBrB,SAAgB,kBACd,OACA,aACA,OACM;AACN,YAAW,KAAK,cAAc,eAAe;EAC3C;EACA;EACA,IAAI;EACL,CAAC;;;;;;;;;;;;;;;AAgBJ,SAAgB,YAAY,OAAiB,OAAqB;AAChE,mBAAkB,OAAO,cAAc,MAAM;;;;;;;;;;;;;;;;AAiB/C,SAAgB,oBACd,OACA,QACA,OACM;AACN,cAAa,KAAK,gBAAgB,eAAe;EAC/C;EACA;EACA,IAAI;EACL,CAAC;;;;;;;;;;;;;;;AAgBJ,SAAgB,cAAc,OAAiB,OAAqB;AAClE,aAAY,QAAQ,MAAM,CAAC,YAAY,MAAM;;;;;;;;;;;;;;;;;;;AAoB/C,SAAgB,qBACd,OACA,aACA,QACA,OACM;AACN,mBAAkB,OAAO,aAAa,MAAM;AAC5C,qBAAoB,OAAO,QAAQ,MAAM;;;;;;;;;;;;;;;AAgB3C,SAAgB,qBAAqB,OAAiB,OAAqB;AACzE,aAAY,OAAO,MAAM;AACzB,eAAc,OAAO,MAAM"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -11,8 +11,6 @@
11
11
  */
12
12
 
13
13
 
14
- 'use client';
15
-
16
14
  //#region src/deckgl/shapes/shared/utils/pick-filtering.ts
17
15
  /**
18
16
  * Filters picks to only include valid geometry elements.
@@ -21,11 +19,12 @@
21
19
  * when modes try to access pick.object.geometry.type. Only picks that are
22
20
  * either guide features (pick.isGuide) or have valid geometry are included.
23
21
  *
24
- * Uses a single-pass algorithm for efficiency - filters and tracks changes
25
- * in one loop iteration.
22
+ * On the common path where all picks are valid, returns the original array
23
+ * with zero allocations.
26
24
  *
27
- * @param picks - The picks array from a pointer event
28
- * @returns Object containing filtered picks and whether filtering occurred
25
+ * @template T - The pick type, constrained to PickLike.
26
+ * @param picks - The picks array from a pointer event.
27
+ * @returns Object containing filtered picks and whether filtering occurred.
29
28
  *
30
29
  * @example
31
30
  * ```typescript
@@ -39,16 +38,24 @@
39
38
  * ```
40
39
  */
41
40
  function filterGeometryAwarePicks(picks) {
42
- const filteredPicks = [];
43
- let didFilter = false;
44
- for (const pick of picks) {
45
- const pickObj = pick;
46
- if (pickObj.isGuide || pickObj.object?.geometry?.type !== void 0) filteredPicks.push(pick);
47
- else didFilter = true;
41
+ const len = picks.length;
42
+ for (let i = 0; i < len; i++) {
43
+ const pick = picks[i];
44
+ if (!pick?.isGuide && pick?.object?.geometry?.type === void 0) {
45
+ const filteredPicks = picks.slice(0, i);
46
+ for (let j = i + 1; j < len; j++) {
47
+ const p = picks[j];
48
+ if (p?.isGuide || p?.object?.geometry?.type !== void 0) filteredPicks.push(p);
49
+ }
50
+ return {
51
+ filteredPicks,
52
+ didFilter: true
53
+ };
54
+ }
48
55
  }
49
56
  return {
50
- filteredPicks,
51
- didFilter
57
+ filteredPicks: picks,
58
+ didFilter: false
52
59
  };
53
60
  }
54
61
 
@@ -1 +1 @@
1
- {"version":3,"file":"pick-filtering.js","names":["filteredPicks: T[]"],"sources":["../../../../../src/deckgl/shapes/shared/utils/pick-filtering.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\n/**\n * Result of filtering picks for geometry-aware processing.\n * Generic to support both deck.gl/core PickingInfo and editable-layers Pick types.\n */\nexport interface FilteredPicksResult<T> {\n /** The filtered picks array (only valid geometry picks) */\n filteredPicks: T[];\n /** Whether any picks were removed during filtering */\n didFilter: boolean;\n}\n\n/**\n * Filters picks to only include valid geometry elements.\n *\n * This prevents TypeError from sublayer elements that don't have geometry\n * when modes try to access pick.object.geometry.type. Only picks that are\n * either guide features (pick.isGuide) or have valid geometry are included.\n *\n * Uses a single-pass algorithm for efficiency - filters and tracks changes\n * in one loop iteration.\n *\n * @param picks - The picks array from a pointer event\n * @returns Object containing filtered picks and whether filtering occurred\n *\n * @example\n * ```typescript\n * const picks = props.lastPointerMoveEvent?.picks;\n * if (picks && picks.length > 0) {\n * const { filteredPicks, didFilter } = filterGeometryAwarePicks(picks);\n * if (didFilter) {\n * // Use filteredPicks in modified props\n * }\n * }\n * ```\n */\nexport function filterGeometryAwarePicks<T>(\n picks: T[],\n): FilteredPicksResult<T> {\n const filteredPicks: T[] = [];\n let didFilter = false;\n\n for (const pick of picks) {\n // Keep picks that are guides or have valid geometry\n // biome-ignore lint/suspicious/noExplicitAny: deck.gl picks have dynamic object structure\n const pickObj = pick as any;\n if (pickObj.isGuide || pickObj.object?.geometry?.type !== undefined) {\n filteredPicks.push(pick);\n } else {\n didFilter = true;\n }\n }\n\n return { filteredPicks, didFilter };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,SAAgB,yBACd,OACwB;CACxB,MAAMA,gBAAqB,EAAE;CAC7B,IAAI,YAAY;AAEhB,MAAK,MAAM,QAAQ,OAAO;EAGxB,MAAM,UAAU;AAChB,MAAI,QAAQ,WAAW,QAAQ,QAAQ,UAAU,SAAS,OACxD,eAAc,KAAK,KAAK;MAExB,aAAY;;AAIhB,QAAO;EAAE;EAAe;EAAW"}
1
+ {"version":3,"file":"pick-filtering.js","names":["filteredPicks: T[]"],"sources":["../../../../../src/deckgl/shapes/shared/utils/pick-filtering.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/**\n * Minimal shape required for pick filtering.\n * Satisfied by both deck.gl/core PickingInfo and editable-layers Pick types.\n */\ntype PickLike = {\n isGuide?: boolean;\n object?: {\n geometry?: {\n type?: string;\n };\n };\n};\n\n/**\n * Result of filtering picks for geometry-aware processing.\n * Generic to support both deck.gl/core PickingInfo and editable-layers Pick types.\n *\n * @template T - The pick type, must satisfy PickLike shape.\n */\nexport type FilteredPicksResult<T> = {\n /** The filtered picks array (only valid geometry picks). */\n filteredPicks: T[];\n /** Whether any picks were removed during filtering. */\n didFilter: boolean;\n};\n\n/**\n * Filters picks to only include valid geometry elements.\n *\n * This prevents TypeError from sublayer elements that don't have geometry\n * when modes try to access pick.object.geometry.type. Only picks that are\n * either guide features (pick.isGuide) or have valid geometry are included.\n *\n * On the common path where all picks are valid, returns the original array\n * with zero allocations.\n *\n * @template T - The pick type, constrained to PickLike.\n * @param picks - The picks array from a pointer event.\n * @returns Object containing filtered picks and whether filtering occurred.\n *\n * @example\n * ```typescript\n * const picks = props.lastPointerMoveEvent?.picks;\n * if (picks && picks.length > 0) {\n * const { filteredPicks, didFilter } = filterGeometryAwarePicks(picks);\n * if (didFilter) {\n * // Use filteredPicks in modified props\n * }\n * }\n * ```\n */\nexport function filterGeometryAwarePicks<T extends PickLike>(\n picks: T[],\n): FilteredPicksResult<T> {\n const len = picks.length;\n\n for (let i = 0; i < len; i++) {\n const pick = picks[i];\n if (!pick?.isGuide && pick?.object?.geometry?.type === undefined) {\n // Found a pick that needs filtering build filtered array from here\n const filteredPicks: T[] = picks.slice(0, i);\n for (let j = i + 1; j < len; j++) {\n const p = picks[j];\n if (p?.isGuide || p?.object?.geometry?.type !== undefined) {\n filteredPicks.push(p);\n }\n }\n return { filteredPicks, didFilter: true };\n }\n }\n\n return { filteredPicks: picks, didFilter: false };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DA,SAAgB,yBACd,OACwB;CACxB,MAAM,MAAM,MAAM;AAElB,MAAK,IAAI,IAAI,GAAG,IAAI,KAAK,KAAK;EAC5B,MAAM,OAAO,MAAM;AACnB,MAAI,CAAC,MAAM,WAAW,MAAM,QAAQ,UAAU,SAAS,QAAW;GAEhE,MAAMA,gBAAqB,MAAM,MAAM,GAAG,EAAE;AAC5C,QAAK,IAAI,IAAI,IAAI,GAAG,IAAI,KAAK,KAAK;IAChC,MAAM,IAAI,MAAM;AAChB,QAAI,GAAG,WAAW,GAAG,QAAQ,UAAU,SAAS,OAC9C,eAAc,KAAK,EAAE;;AAGzB,UAAO;IAAE;IAAe,WAAW;IAAM;;;AAI7C,QAAO;EAAE,eAAe;EAAO,WAAW;EAAO"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -18,19 +18,29 @@ import { Color } from "@deck.gl/core";
18
18
  * Normalize a Color to a 4-element RGBA array.
19
19
  * Handles RGB arrays (adds alpha 255), RGBA arrays, and typed arrays.
20
20
  *
21
- * @param color - The color to normalize
22
- * @returns 4-element RGBA array [r, g, b, a]
21
+ * @param color - The color to normalize.
22
+ * @returns 4-element RGBA array [r, g, b, a].
23
+ * @example
24
+ * ```typescript
25
+ * normalizeColor([255, 128, 0]); // → [255, 128, 0, 255]
26
+ * normalizeColor([255, 128, 0, 200]); // → [255, 128, 0, 200]
27
+ * ```
23
28
  */
24
29
  declare function normalizeColor(color: Color): [number, number, number, number];
25
30
  /**
26
31
  * Get fill color for a feature.
27
32
  * Colors are passed through as-is unless applyBaseOpacity is true.
28
33
  *
29
- * @param feature - The styled feature
30
- * @param applyBaseOpacity - When true, multiplies alpha by BASE_FILL_OPACITY (0.2)
31
- * @returns RGBA color array
34
+ * @param feature - The styled feature.
35
+ * @param applyBaseOpacity - When true, multiplies alpha by BASE_FILL_OPACITY (0.2).
36
+ * @returns RGBA color array.
37
+ * @example
38
+ * ```typescript
39
+ * getFillColor(feature); // → [255, 255, 255, 255] (full opacity)
40
+ * getFillColor(feature, true); // → [255, 255, 255, 51] (255 × 0.2)
41
+ * ```
32
42
  */
33
- declare function getFillColor(feature: StyledFeature, applyBaseOpacity?: boolean): Color;
43
+ declare function getFillColor(feature: StyledFeature, applyBaseOpacity?: boolean): [number, number, number, number];
34
44
  /**
35
45
  * Get border/outline color for a feature.
36
46
  * Outlines are always rendered at their literal alpha value.
@@ -38,25 +48,39 @@ declare function getFillColor(feature: StyledFeature, applyBaseOpacity?: boolean
38
48
  * Named to match deck.gl's `getLineColor` accessor convention.
39
49
  * Reads from `lineColor` in the feature's style properties.
40
50
  *
41
- * @param feature - The styled feature
42
- * @returns RGBA color array
51
+ * @param feature - The styled feature.
52
+ * @returns RGBA color array.
53
+ * @example
54
+ * ```typescript
55
+ * getLineColor(feature); // → [136, 138, 143, 255] (default line color)
56
+ * ```
43
57
  */
44
- declare function getLineColor(feature: StyledFeature): Color;
58
+ declare function getLineColor(feature: StyledFeature): [number, number, number, number];
45
59
  /**
46
60
  * Get border/outline width for a feature.
47
61
  *
48
62
  * Named to match deck.gl's `getLineWidth` accessor convention.
49
63
  * Reads from `lineWidth` in the feature's style properties.
50
64
  *
51
- * @param feature - The styled feature
52
- * @returns Border/outline width in pixels
65
+ * @param feature - The styled feature.
66
+ * @returns Border/outline width in pixels.
67
+ * @example
68
+ * ```typescript
69
+ * getLineWidth(feature); // → 2 (default width)
70
+ * ```
53
71
  */
54
72
  declare function getLineWidth(feature: StyledFeature): number;
55
73
  /**
56
74
  * Get dash array for border/outline pattern.
57
75
  *
58
- * @param feature - The styled feature
59
- * @returns Dash array [dash, gap] or null for solid outlines
76
+ * @param feature - The styled feature.
77
+ * @returns Dash array [dash, gap] or null for solid outlines.
78
+ * @example
79
+ * ```typescript
80
+ * getDashArray(solidFeature); // → null
81
+ * getDashArray(dashedFeature); // → [8, 4]
82
+ * getDashArray(dottedFeature); // → [2, 4]
83
+ * ```
60
84
  */
61
85
  declare function getDashArray(feature: StyledFeature): [number, number] | null;
62
86
  //#endregion
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -11,8 +11,6 @@
11
11
  */
12
12
 
13
13
 
14
- 'use client';
15
-
16
14
  import { BASE_FILL_OPACITY, DASH_ARRAYS, DEFAULT_COLORS, DEFAULT_LINE_WIDTH } from "../constants.js";
17
15
 
18
16
  //#region src/deckgl/shapes/shared/utils/style-utils.ts
@@ -20,45 +18,44 @@ import { BASE_FILL_OPACITY, DASH_ARRAYS, DEFAULT_COLORS, DEFAULT_LINE_WIDTH } fr
20
18
  * Normalize a Color to a 4-element RGBA array.
21
19
  * Handles RGB arrays (adds alpha 255), RGBA arrays, and typed arrays.
22
20
  *
23
- * @param color - The color to normalize
24
- * @returns 4-element RGBA array [r, g, b, a]
21
+ * @param color - The color to normalize.
22
+ * @returns 4-element RGBA array [r, g, b, a].
23
+ * @example
24
+ * ```typescript
25
+ * normalizeColor([255, 128, 0]); // → [255, 128, 0, 255]
26
+ * normalizeColor([255, 128, 0, 200]); // → [255, 128, 0, 200]
27
+ * ```
25
28
  */
26
29
  function normalizeColor(color) {
27
- if (color instanceof Uint8Array || color instanceof Uint8ClampedArray) return [
30
+ if (color instanceof Uint8Array || color instanceof Uint8ClampedArray || Array.isArray(color) && color.length >= 3) return [
28
31
  color[0] ?? 0,
29
32
  color[1] ?? 0,
30
33
  color[2] ?? 0,
31
34
  color[3] ?? 255
32
35
  ];
33
- if (!Array.isArray(color) || color.length < 3) return [
36
+ return [
34
37
  0,
35
38
  0,
36
39
  0,
37
40
  255
38
41
  ];
39
- return [
40
- color[0] ?? 0,
41
- color[1] ?? 0,
42
- color[2] ?? 0,
43
- color[3] ?? 255
44
- ];
45
42
  }
46
43
  /**
47
44
  * Get fill color for a feature.
48
45
  * Colors are passed through as-is unless applyBaseOpacity is true.
49
46
  *
50
- * @param feature - The styled feature
51
- * @param applyBaseOpacity - When true, multiplies alpha by BASE_FILL_OPACITY (0.2)
52
- * @returns RGBA color array
47
+ * @param feature - The styled feature.
48
+ * @param applyBaseOpacity - When true, multiplies alpha by BASE_FILL_OPACITY (0.2).
49
+ * @returns RGBA color array.
50
+ * @example
51
+ * ```typescript
52
+ * getFillColor(feature); // → [255, 255, 255, 255] (full opacity)
53
+ * getFillColor(feature, true); // → [255, 255, 255, 51] (255 × 0.2)
54
+ * ```
53
55
  */
54
56
  function getFillColor(feature, applyBaseOpacity = false) {
55
- const rgba = normalizeColor((feature.properties?.styleProperties)?.fillColor ?? DEFAULT_COLORS.fill);
56
- if (applyBaseOpacity) return [
57
- rgba[0],
58
- rgba[1],
59
- rgba[2],
60
- Math.round(rgba[3] * BASE_FILL_OPACITY)
61
- ];
57
+ const rgba = normalizeColor(feature.properties.styleProperties?.fillColor ?? DEFAULT_COLORS.fill);
58
+ if (applyBaseOpacity) rgba[3] = Math.round(rgba[3] * BASE_FILL_OPACITY);
62
59
  return rgba;
63
60
  }
64
61
  /**
@@ -68,11 +65,15 @@ function getFillColor(feature, applyBaseOpacity = false) {
68
65
  * Named to match deck.gl's `getLineColor` accessor convention.
69
66
  * Reads from `lineColor` in the feature's style properties.
70
67
  *
71
- * @param feature - The styled feature
72
- * @returns RGBA color array
68
+ * @param feature - The styled feature.
69
+ * @returns RGBA color array.
70
+ * @example
71
+ * ```typescript
72
+ * getLineColor(feature); // → [136, 138, 143, 255] (default line color)
73
+ * ```
73
74
  */
74
75
  function getLineColor(feature) {
75
- return normalizeColor((feature.properties?.styleProperties)?.lineColor ?? DEFAULT_COLORS.line);
76
+ return normalizeColor(feature.properties.styleProperties?.lineColor ?? DEFAULT_COLORS.line);
76
77
  }
77
78
  /**
78
79
  * Get border/outline width for a feature.
@@ -80,20 +81,30 @@ function getLineColor(feature) {
80
81
  * Named to match deck.gl's `getLineWidth` accessor convention.
81
82
  * Reads from `lineWidth` in the feature's style properties.
82
83
  *
83
- * @param feature - The styled feature
84
- * @returns Border/outline width in pixels
84
+ * @param feature - The styled feature.
85
+ * @returns Border/outline width in pixels.
86
+ * @example
87
+ * ```typescript
88
+ * getLineWidth(feature); // → 2 (default width)
89
+ * ```
85
90
  */
86
91
  function getLineWidth(feature) {
87
- return (feature.properties?.styleProperties)?.lineWidth ?? DEFAULT_LINE_WIDTH;
92
+ return feature.properties.styleProperties?.lineWidth ?? DEFAULT_LINE_WIDTH;
88
93
  }
89
94
  /**
90
95
  * Get dash array for border/outline pattern.
91
96
  *
92
- * @param feature - The styled feature
93
- * @returns Dash array [dash, gap] or null for solid outlines
97
+ * @param feature - The styled feature.
98
+ * @returns Dash array [dash, gap] or null for solid outlines.
99
+ * @example
100
+ * ```typescript
101
+ * getDashArray(solidFeature); // → null
102
+ * getDashArray(dashedFeature); // → [8, 4]
103
+ * getDashArray(dottedFeature); // → [2, 4]
104
+ * ```
94
105
  */
95
106
  function getDashArray(feature) {
96
- return DASH_ARRAYS[(feature.properties?.styleProperties)?.linePattern ?? "solid"] || null;
107
+ return DASH_ARRAYS[feature.properties.styleProperties?.linePattern ?? "solid"] ?? null;
97
108
  }
98
109
 
99
110
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"style-utils.js","names":[],"sources":["../../../../../src/deckgl/shapes/shared/utils/style-utils.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport {\n BASE_FILL_OPACITY,\n DASH_ARRAYS,\n DEFAULT_COLORS,\n DEFAULT_LINE_WIDTH,\n} from '../constants';\nimport type { Color } from '@deck.gl/core';\nimport type { StyledFeature } from '../types';\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 *\n * @param color - The color to normalize\n * @returns 4-element RGBA array [r, g, b, a]\n */\nexport function 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 // Validate array has at least 3 elements for RGB\n if (!Array.isArray(color) || color.length < 3) {\n return [0, 0, 0, 255]; // Fallback to opaque black\n }\n return [color[0] ?? 0, color[1] ?? 0, color[2] ?? 0, color[3] ?? 255];\n}\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.2)\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 border/outline color for a feature.\n * Outlines are always rendered at their literal alpha value.\n *\n * Named to match deck.gl's `getLineColor` accessor convention.\n * Reads from `lineColor` in the feature's style properties.\n *\n * @param feature - The styled feature\n * @returns RGBA color array\n */\nexport function getLineColor(feature: StyledFeature): Color {\n const styleProps = feature.properties?.styleProperties;\n const color = styleProps?.lineColor ?? DEFAULT_COLORS.line;\n\n return normalizeColor(color);\n}\n\n/**\n * Get border/outline width for a feature.\n *\n * Named to match deck.gl's `getLineWidth` accessor convention.\n * Reads from `lineWidth` in the feature's style properties.\n *\n * @param feature - The styled feature\n * @returns Border/outline width in pixels\n */\nexport function getLineWidth(feature: StyledFeature): number {\n const styleProps = feature.properties?.styleProperties;\n return styleProps?.lineWidth ?? DEFAULT_LINE_WIDTH;\n}\n\n/**\n * Get dash array for border/outline pattern.\n *\n * @param feature - The styled feature\n * @returns Dash array [dash, gap] or null for solid outlines\n */\nexport function getDashArray(feature: StyledFeature): [number, number] | null {\n const styleProps = feature.properties?.styleProperties;\n const pattern = styleProps?.linePattern ?? 'solid';\n\n return DASH_ARRAYS[pattern] || null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,SAAgB,eAAe,OAAgD;AAC7E,KAAI,iBAAiB,cAAc,iBAAiB,kBAClD,QAAO;EAAC,MAAM,MAAM;EAAG,MAAM,MAAM;EAAG,MAAM,MAAM;EAAG,MAAM,MAAM;EAAI;AAKvE,KAAI,CAAC,MAAM,QAAQ,MAAM,IAAI,MAAM,SAAS,EAC1C,QAAO;EAAC;EAAG;EAAG;EAAG;EAAI;AAEvB,QAAO;EAAC,MAAM,MAAM;EAAG,MAAM,MAAM;EAAG,MAAM,MAAM;EAAG,MAAM,MAAM;EAAI;;;;;;;;;;AAWvE,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;;;;;;;;;;;;AAaT,SAAgB,aAAa,SAA+B;AAI1D,QAAO,gBAHY,QAAQ,YAAY,kBACb,aAAa,eAAe,KAE1B;;;;;;;;;;;AAY9B,SAAgB,aAAa,SAAgC;AAE3D,SADmB,QAAQ,YAAY,kBACpB,aAAa;;;;;;;;AASlC,SAAgB,aAAa,SAAiD;AAI5E,QAAO,aAHY,QAAQ,YAAY,kBACX,eAAe,YAEZ"}
1
+ {"version":3,"file":"style-utils.js","names":[],"sources":["../../../../../src/deckgl/shapes/shared/utils/style-utils.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n BASE_FILL_OPACITY,\n DASH_ARRAYS,\n DEFAULT_COLORS,\n DEFAULT_LINE_WIDTH,\n} from '../constants';\nimport type { Color } from '@deck.gl/core';\nimport type { StyledFeature } from '../types';\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 *\n * @param color - The color to normalize.\n * @returns 4-element RGBA array [r, g, b, a].\n * @example\n * ```typescript\n * normalizeColor([255, 128, 0]); // → [255, 128, 0, 255]\n * normalizeColor([255, 128, 0, 200]); // → [255, 128, 0, 200]\n * ```\n */\nexport function normalizeColor(color: Color): [number, number, number, number] {\n if (\n color instanceof Uint8Array ||\n color instanceof Uint8ClampedArray ||\n (Array.isArray(color) && color.length >= 3)\n ) {\n return [color[0] ?? 0, color[1] ?? 0, color[2] ?? 0, color[3] ?? 255];\n }\n\n return [0, 0, 0, 255]; // Fallback to opaque black for malformed input\n}\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.2).\n * @returns RGBA color array.\n * @example\n * ```typescript\n * getFillColor(feature); // → [255, 255, 255, 255] (full opacity)\n * getFillColor(feature, true); // → [255, 255, 255, 51] (255 × 0.2)\n * ```\n */\nexport function getFillColor(\n feature: StyledFeature,\n applyBaseOpacity = false,\n): [number, number, number, number] {\n const color =\n feature.properties.styleProperties?.fillColor ?? DEFAULT_COLORS.fill;\n\n const rgba = normalizeColor(color);\n\n if (applyBaseOpacity) {\n rgba[3] = Math.round(rgba[3] * BASE_FILL_OPACITY);\n }\n\n return rgba;\n}\n\n/**\n * Get border/outline color for a feature.\n * Outlines are always rendered at their literal alpha value.\n *\n * Named to match deck.gl's `getLineColor` accessor convention.\n * Reads from `lineColor` in the feature's style properties.\n *\n * @param feature - The styled feature.\n * @returns RGBA color array.\n * @example\n * ```typescript\n * getLineColor(feature); // → [136, 138, 143, 255] (default line color)\n * ```\n */\nexport function getLineColor(\n feature: StyledFeature,\n): [number, number, number, number] {\n const color =\n feature.properties.styleProperties?.lineColor ?? DEFAULT_COLORS.line;\n\n return normalizeColor(color);\n}\n\n/**\n * Get border/outline width for a feature.\n *\n * Named to match deck.gl's `getLineWidth` accessor convention.\n * Reads from `lineWidth` in the feature's style properties.\n *\n * @param feature - The styled feature.\n * @returns Border/outline width in pixels.\n * @example\n * ```typescript\n * getLineWidth(feature); // → 2 (default width)\n * ```\n */\nexport function getLineWidth(feature: StyledFeature): number {\n return feature.properties.styleProperties?.lineWidth ?? DEFAULT_LINE_WIDTH;\n}\n\n/**\n * Get dash array for border/outline pattern.\n *\n * @param feature - The styled feature.\n * @returns Dash array [dash, gap] or null for solid outlines.\n * @example\n * ```typescript\n * getDashArray(solidFeature); // → null\n * getDashArray(dashedFeature); // → [8, 4]\n * getDashArray(dottedFeature); // → [2, 4]\n * ```\n */\nexport function getDashArray(feature: StyledFeature): [number, number] | null {\n const pattern = feature.properties.styleProperties?.linePattern ?? 'solid';\n\n return DASH_ARRAYS[pattern] ?? null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,SAAgB,eAAe,OAAgD;AAC7E,KACE,iBAAiB,cACjB,iBAAiB,qBAChB,MAAM,QAAQ,MAAM,IAAI,MAAM,UAAU,EAEzC,QAAO;EAAC,MAAM,MAAM;EAAG,MAAM,MAAM;EAAG,MAAM,MAAM;EAAG,MAAM,MAAM;EAAI;AAGvE,QAAO;EAAC;EAAG;EAAG;EAAG;EAAI;;;;;;;;;;;;;;;AAgBvB,SAAgB,aACd,SACA,mBAAmB,OACe;CAIlC,MAAM,OAAO,eAFX,QAAQ,WAAW,iBAAiB,aAAa,eAAe,KAEhC;AAElC,KAAI,iBACF,MAAK,KAAK,KAAK,MAAM,KAAK,KAAK,kBAAkB;AAGnD,QAAO;;;;;;;;;;;;;;;;AAiBT,SAAgB,aACd,SACkC;AAIlC,QAAO,eAFL,QAAQ,WAAW,iBAAiB,aAAa,eAAe,KAEtC;;;;;;;;;;;;;;;AAgB9B,SAAgB,aAAa,SAAgC;AAC3D,QAAO,QAAQ,WAAW,iBAAiB,aAAa;;;;;;;;;;;;;;AAe1D,SAAgB,aAAa,SAAiD;AAG5E,QAAO,YAFS,QAAQ,WAAW,iBAAiB,eAAe,YAEpC"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -10,6 +10,8 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
+ import { CoffinCornerExtensionProps } from "../extensions/coffin-corner/types.js";
14
+ import "../extensions/index.js";
13
15
  import { SymbolLayerProps } from "./index.js";
14
16
 
15
17
  //#region src/deckgl/symbol-layer/fiber.d.ts
@@ -35,7 +37,7 @@ declare global {
35
37
  * />
36
38
  * ```
37
39
  */
38
- symbolLayer: SymbolLayerProps;
40
+ symbolLayer: CoffinCornerExtensionProps<SymbolLayerProps>;
39
41
  }
40
42
  }
41
43
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1 +1 @@
1
- {"version":3,"file":"fiber.js","names":[],"sources":["../../../src/deckgl/symbol-layer/fiber.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { extend } from '@deckgl-fiber-renderer/dom';\nimport { SymbolLayer, type SymbolLayerProps } from './index';\n\nextend({ SymbolLayer });\n\ndeclare global {\n namespace React {\n // biome-ignore lint/style/useNamingConvention: Built-in React namespace.\n namespace JSX {\n interface IntrinsicElements {\n /**\n * A Deck.gl Fiber layer for rendering MIL-STD-2525 and APP-6 military symbols.\n *\n * Automatically generates symbol icons from SIDC codes with support for\n * multiple symbology standards and customizable rendering options.\n *\n * @example\n * ```tsx\n * <symbolLayer\n * id=\"military-units\"\n * data={units}\n * getSidc={d => d.sidc}\n * getPosition={d => d.position}\n * getSize={32}\n * defaultSymbolOptions={{ colorMode: 'Dark' }}\n * />\n * ```\n */\n symbolLayer: SymbolLayerProps;\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAeA,OAAO,EAAE,aAAa,CAAC"}
1
+ {"version":3,"file":"fiber.js","names":[],"sources":["../../../src/deckgl/symbol-layer/fiber.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { extend } from '@deckgl-fiber-renderer/dom';\nimport { SymbolLayer, type SymbolLayerProps } from './index';\nimport type { CoffinCornerExtensionProps } from '../extensions';\n\nextend({ SymbolLayer });\n\ndeclare global {\n namespace React {\n // biome-ignore lint/style/useNamingConvention: Built-in React namespace.\n namespace JSX {\n interface IntrinsicElements {\n /**\n * A Deck.gl Fiber layer for rendering MIL-STD-2525 and APP-6 military symbols.\n *\n * Automatically generates symbol icons from SIDC codes with support for\n * multiple symbology standards and customizable rendering options.\n *\n * @example\n * ```tsx\n * <symbolLayer\n * id=\"military-units\"\n * data={units}\n * getSidc={d => d.sidc}\n * getPosition={d => d.position}\n * getSize={32}\n * defaultSymbolOptions={{ colorMode: 'Dark' }}\n * />\n * ```\n */\n symbolLayer: CoffinCornerExtensionProps<SymbolLayerProps>;\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,OAAO,EAAE,aAAa,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0