@accelint/map-toolkit 1.0.0 → 1.2.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 (84) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/catalog-info.yaml +4 -4
  3. package/dist/camera/events.js.map +1 -1
  4. package/dist/camera/store.js.map +1 -1
  5. package/dist/cursor-coordinates/index.d.ts +4 -2
  6. package/dist/cursor-coordinates/index.js +3 -2
  7. package/dist/cursor-coordinates/store.d.ts +48 -0
  8. package/dist/cursor-coordinates/store.js +92 -0
  9. package/dist/cursor-coordinates/store.js.map +1 -0
  10. package/dist/cursor-coordinates/types.d.ts +87 -0
  11. package/dist/cursor-coordinates/types.js +12 -0
  12. package/dist/cursor-coordinates/use-cursor-coordinates.d.ts +41 -37
  13. package/dist/cursor-coordinates/use-cursor-coordinates.js +131 -202
  14. package/dist/cursor-coordinates/use-cursor-coordinates.js.map +1 -1
  15. package/dist/deckgl/base-map/controls.d.ts +1 -1
  16. package/dist/deckgl/base-map/controls.js.map +1 -1
  17. package/dist/deckgl/base-map/events.js.map +1 -1
  18. package/dist/deckgl/base-map/index.d.ts +2 -2
  19. package/dist/deckgl/base-map/index.js +3 -3
  20. package/dist/deckgl/base-map/provider.d.ts +2 -2
  21. package/dist/deckgl/base-map/provider.js.map +1 -1
  22. package/dist/deckgl/index.js +1 -1
  23. package/dist/deckgl/saved-viewports/index.js.map +1 -1
  24. package/dist/deckgl/saved-viewports/storage.js.map +1 -1
  25. package/dist/deckgl/shapes/display-shape-layer/constants.js.map +1 -1
  26. package/dist/deckgl/shapes/display-shape-layer/fiber.js.map +1 -1
  27. package/dist/deckgl/shapes/display-shape-layer/index.js.map +1 -1
  28. package/dist/deckgl/shapes/display-shape-layer/shape-label-layer.js.map +1 -1
  29. package/dist/deckgl/shapes/display-shape-layer/store.js.map +1 -1
  30. package/dist/deckgl/shapes/display-shape-layer/use-select-shape.js.map +1 -1
  31. package/dist/deckgl/shapes/display-shape-layer/utils/display-style.js.map +1 -1
  32. package/dist/deckgl/shapes/display-shape-layer/utils/labels.js.map +1 -1
  33. package/dist/deckgl/shapes/draw-shape-layer/constants.js.map +1 -1
  34. package/dist/deckgl/shapes/draw-shape-layer/events.js.map +1 -1
  35. package/dist/deckgl/shapes/draw-shape-layer/fiber.js.map +1 -1
  36. package/dist/deckgl/shapes/draw-shape-layer/index.js.map +1 -1
  37. package/dist/deckgl/shapes/draw-shape-layer/modes/draw-ellipse-mode-with-tooltip.js.map +1 -1
  38. package/dist/deckgl/shapes/draw-shape-layer/modes/index.js.map +1 -1
  39. package/dist/deckgl/shapes/draw-shape-layer/store.js.map +1 -1
  40. package/dist/deckgl/shapes/draw-shape-layer/use-draw-shape.js.map +1 -1
  41. package/dist/deckgl/shapes/draw-shape-layer/utils/feature-conversion.js.map +1 -1
  42. package/dist/deckgl/shapes/edit-shape-layer/constants.js.map +1 -1
  43. package/dist/deckgl/shapes/edit-shape-layer/events.js.map +1 -1
  44. package/dist/deckgl/shapes/edit-shape-layer/index.js.map +1 -1
  45. package/dist/deckgl/shapes/edit-shape-layer/modes/base-transform-mode.js.map +1 -1
  46. package/dist/deckgl/shapes/edit-shape-layer/modes/bounding-transform-mode.js.map +1 -1
  47. package/dist/deckgl/shapes/edit-shape-layer/modes/circle-transform-mode.js.map +1 -1
  48. package/dist/deckgl/shapes/edit-shape-layer/modes/index.js.map +1 -1
  49. package/dist/deckgl/shapes/edit-shape-layer/modes/rotate-mode-with-snap.js.map +1 -1
  50. package/dist/deckgl/shapes/edit-shape-layer/modes/scale-mode-with-free-transform.js.map +1 -1
  51. package/dist/deckgl/shapes/edit-shape-layer/modes/vertex-transform-mode.js.map +1 -1
  52. package/dist/deckgl/shapes/edit-shape-layer/store.js.map +1 -1
  53. package/dist/deckgl/shapes/edit-shape-layer/use-edit-shape.js.map +1 -1
  54. package/dist/deckgl/shapes/index.d.ts +1 -1
  55. package/dist/deckgl/shapes/shared/constants.js.map +1 -1
  56. package/dist/deckgl/shapes/shared/events.js.map +1 -1
  57. package/dist/deckgl/shapes/shared/hooks/use-shift-zoom-disable.js.map +1 -1
  58. package/dist/deckgl/shapes/shared/types.js.map +1 -1
  59. package/dist/deckgl/shapes/shared/utils/geometry-measurements.js.map +1 -1
  60. package/dist/deckgl/shapes/shared/utils/layer-config.js.map +1 -1
  61. package/dist/deckgl/shapes/shared/utils/mode-utils.js.map +1 -1
  62. package/dist/deckgl/shapes/shared/utils/pick-filtering.js.map +1 -1
  63. package/dist/deckgl/shapes/shared/utils/style-utils.js.map +1 -1
  64. package/dist/deckgl/symbol-layer/fiber.js.map +1 -1
  65. package/dist/deckgl/symbol-layer/index.js.map +1 -1
  66. package/dist/deckgl/text-layer/character-sets.js.map +1 -1
  67. package/dist/deckgl/text-layer/default-settings.js.map +1 -1
  68. package/dist/deckgl/text-layer/fiber.js.map +1 -1
  69. package/dist/deckgl/text-layer/index.js.map +1 -1
  70. package/dist/deckgl/text-settings.js.map +1 -1
  71. package/dist/map-cursor/events.js.map +1 -1
  72. package/dist/map-cursor/store.js.map +1 -1
  73. package/dist/map-cursor/use-map-cursor.js.map +1 -1
  74. package/dist/map-mode/events.js.map +1 -1
  75. package/dist/map-mode/store.js.map +1 -1
  76. package/dist/map-mode/use-map-mode.js.map +1 -1
  77. package/dist/maplibre/hooks/use-maplibre.js.map +1 -1
  78. package/dist/shared/constants.js.map +1 -1
  79. package/dist/shared/create-map-store.js.map +1 -1
  80. package/dist/shared/units.js.map +1 -1
  81. package/dist/viewport/store.js.map +1 -1
  82. package/dist/viewport/utils.js.map +1 -1
  83. package/dist/viewport/viewport-size.js.map +1 -1
  84. package/package.json +12 -10
@@ -1 +1 @@
1
- {"version":3,"file":"store.js","names":["DEFAULT_EDITING_STATE: EditingState"],"sources":["../../../../src/deckgl/shapes/edit-shape-layer/store.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\n/**\n * Edit Shape Store\n *\n * Manages editing state for shape modification.\n *\n * @example\n * ```tsx\n * import { editStore } from '@accelint/map-toolkit/deckgl/shapes';\n *\n * function EditControls({ mapId }) {\n * const { state, edit, save, cancel } = editStore.use(mapId);\n *\n * return (\n * <div>\n * <p>Editing: {state.editingShape?.name ?? 'none'}</p>\n * <button onClick={save}>Save</button>\n * <button onClick={cancel}>Cancel</button>\n * </div>\n * );\n * }\n * ```\n */\n\nimport { Broadcast } from '@accelint/bus';\nimport { getLogger } from '@accelint/logger';\nimport { createMapStore } from '@/shared/create-map-store';\nimport { MapEvents } from '../../base-map/events';\nimport {\n isCircleShape,\n isEllipseShape,\n isPointShape,\n isRectangleShape,\n} from '../shared/types';\nimport {\n releaseModeAndCursor,\n requestCursorChange,\n requestModeChange,\n} from '../shared/utils/mode-utils';\nimport {\n EDIT_CURSOR_MAP,\n EDIT_SHAPE_LAYER_ID,\n EDIT_SHAPE_MODE,\n} from './constants';\nimport { EditShapeEvents } from './events';\nimport type { UniqueId } from '@accelint/core';\nimport type { Feature } from 'geojson';\nimport type { MapEventType } from '../../base-map/types';\nimport type { Shape } from '../shared/types';\nimport type {\n EditShapeEvent,\n ShapeEditCanceledEvent,\n ShapeEditingEvent,\n ShapeUpdatedEvent,\n} from './events';\nimport type {\n EditFunction,\n EditingState,\n EditMode,\n EditShapeOptions,\n} from './types';\n\nconst logger = getLogger({\n enabled:\n process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test',\n level: 'warn',\n prefix: '[EditShapeLayer]',\n pretty: true,\n});\n\n/**\n * Typed event bus instances\n */\nconst editShapeBus = Broadcast.getInstance<EditShapeEvent>();\nconst mapEventBus = Broadcast.getInstance<MapEventType>();\n\n/**\n * Default editing state\n */\nconst DEFAULT_EDITING_STATE: EditingState = {\n editingShape: null,\n editMode: 'view',\n featureBeingEdited: null,\n};\n\n/**\n * Actions for edit shape store\n */\ntype EditShapeActions = {\n /** Start editing a shape */\n edit: EditFunction;\n /** Save the current edits */\n save: () => void;\n /** Cancel editing */\n cancel: () => void;\n};\n\n/**\n * Determine the appropriate edit mode for a shape type\n */\nfunction getEditModeForShape(shape: Shape): EditMode {\n if (isPointShape(shape)) {\n return 'translate';\n }\n if (isCircleShape(shape)) {\n return 'circle-transform';\n }\n if (isEllipseShape(shape) || isRectangleShape(shape)) {\n return 'bounding-transform';\n }\n return 'vertex-transform';\n}\n\n/**\n * Start editing a shape\n */\nfunction startEditing(\n mapId: UniqueId,\n state: EditingState,\n shape: Shape,\n options: EditShapeOptions | undefined,\n notify: () => void,\n setState: (updates: Partial<EditingState>) => void,\n): void {\n // Prevent editing locked shapes\n if (shape.locked) {\n logger.warn(`Cannot edit locked shape: \"${shape.name}\"`);\n return;\n }\n\n // Already editing - cancel first\n if (state.editingShape) {\n cancelEditingInternal(mapId, state, notify, setState);\n }\n\n // Determine edit mode (can be overridden via options)\n const editMode = options?.mode ?? getEditModeForShape(shape);\n\n // Update state with new object reference\n setState({\n editingShape: shape,\n editMode,\n featureBeingEdited: shape.feature,\n });\n\n // Request map mode and cursor\n requestModeChange(mapId, EDIT_SHAPE_MODE, EDIT_SHAPE_LAYER_ID);\n const cursor = EDIT_CURSOR_MAP[editMode];\n requestCursorChange(mapId, cursor, EDIT_SHAPE_LAYER_ID);\n\n // Disable map panning during editing\n mapEventBus.emit(MapEvents.disablePan, { id: mapId });\n\n // Emit editing started event\n editShapeBus.emit(EditShapeEvents.editing, {\n shape,\n mapId,\n } as unknown as ShapeEditingEvent['payload']);\n\n notify();\n}\n\n/**\n * Save editing and create updated shape\n */\nfunction saveEditingInternal(\n mapId: UniqueId,\n state: EditingState,\n notify: () => void,\n setState: (updates: Partial<EditingState>) => void,\n): Shape | null {\n if (!(state.editingShape && state.featureBeingEdited)) {\n return null;\n }\n\n const originalShape = state.editingShape;\n const updatedFeature = state.featureBeingEdited;\n\n // Create updated shape with new geometry\n const updatedShape = {\n ...originalShape,\n feature: {\n ...updatedFeature,\n properties: {\n ...originalShape.feature.properties,\n ...updatedFeature.properties,\n },\n },\n lastUpdated: Date.now(),\n } as Shape;\n\n // Reset state\n setState({\n editingShape: null,\n editMode: 'view',\n featureBeingEdited: null,\n });\n\n // Return to default mode and cursor\n releaseModeAndCursor(mapId, EDIT_SHAPE_LAYER_ID);\n\n // Re-enable map panning\n mapEventBus.emit(MapEvents.enablePan, { id: mapId });\n\n // Emit shape updated event\n editShapeBus.emit(EditShapeEvents.updated, {\n shape: updatedShape,\n mapId,\n } as unknown as ShapeUpdatedEvent['payload']);\n\n notify();\n\n return updatedShape;\n}\n\n/**\n * Cancel the current editing operation\n */\nfunction cancelEditingInternal(\n mapId: UniqueId,\n state: EditingState,\n notify: () => void,\n setState: (updates: Partial<EditingState>) => void,\n): void {\n if (!state.editingShape) {\n return; // Nothing to cancel\n }\n\n const originalShape = state.editingShape;\n\n // Reset state\n setState({\n editingShape: null,\n editMode: 'view',\n featureBeingEdited: null,\n });\n\n // Return to default mode and cursor\n releaseModeAndCursor(mapId, EDIT_SHAPE_LAYER_ID);\n\n // Re-enable map panning\n mapEventBus.emit(MapEvents.enablePan, { id: mapId });\n\n // Emit canceled event\n editShapeBus.emit(EditShapeEvents.canceled, {\n shape: originalShape,\n mapId,\n } as unknown as ShapeEditCanceledEvent['payload']);\n\n notify();\n}\n\n/**\n * Edit shape store\n */\nexport const editStore = createMapStore<EditingState, EditShapeActions>({\n defaultState: { ...DEFAULT_EDITING_STATE },\n\n actions: (mapId, { get, set, notify }) => ({\n edit: (shape: Shape, options?: EditShapeOptions) => {\n startEditing(mapId, get(), shape, options, notify, set);\n },\n\n save: () => {\n saveEditingInternal(mapId, get(), notify, set);\n },\n\n cancel: () => {\n cancelEditingInternal(mapId, get(), notify, set);\n },\n }),\n\n // Note: EditShapeLayer is \"neutral\" regarding mode change authorization.\n // It doesn't auto-cancel or reject mode changes - those decisions are\n // left to UI components that can prompt the user.\n\n onCleanup: (mapId, state) => {\n // Cancel any active editing before cleanup\n if (state.editingShape) {\n // Return to default mode and cursor\n releaseModeAndCursor(mapId, EDIT_SHAPE_LAYER_ID);\n\n // Re-enable map panning\n mapEventBus.emit(MapEvents.enablePan, { id: mapId });\n\n // Emit canceled event\n editShapeBus.emit(EditShapeEvents.canceled, {\n shape: state.editingShape,\n mapId,\n } as unknown as ShapeEditCanceledEvent['payload']);\n }\n },\n});\n\n// =============================================================================\n// Convenience exports\n// =============================================================================\n\n/**\n * Get the current editing state for a mapId\n * Returns null if no store instance exists\n */\nexport function getEditingState(mapId: UniqueId): EditingState | null {\n if (!editStore.exists(mapId)) {\n return null;\n }\n return editStore.get(mapId);\n}\n\n/**\n * Hook for editing state\n */\nexport function useEditingState(\n mapId: UniqueId,\n): { state: EditingState } & EditShapeActions {\n return editStore.use(mapId);\n}\n\n/**\n * Manually clear editing state for a specific mapId.\n */\nexport function clearEditingState(mapId: UniqueId): void {\n editStore.clear(mapId);\n}\n\n/**\n * Update feature from the layer component (called during drag operations)\n */\nexport function updateFeatureFromLayer(\n mapId: UniqueId,\n feature: Feature,\n): void {\n editStore.set(mapId, { featureBeingEdited: feature });\n}\n\n/**\n * Cancel editing (called by the layer component on ESC)\n */\nexport function cancelEditingFromLayer(mapId: UniqueId): void {\n editStore.actions(mapId).cancel();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,MAAM,SAAS,UAAU;CACvB,SACE,QAAQ,IAAI,aAAa,gBAAgB,QAAQ,IAAI,aAAa;CACpE,OAAO;CACP,QAAQ;CACR,QAAQ;CACT,CAAC;;;;AAKF,MAAM,eAAe,UAAU,aAA6B;AAC5D,MAAM,cAAc,UAAU,aAA2B;;;;AAKzD,MAAMA,wBAAsC;CAC1C,cAAc;CACd,UAAU;CACV,oBAAoB;CACrB;;;;AAiBD,SAAS,oBAAoB,OAAwB;AACnD,KAAI,aAAa,MAAM,CACrB,QAAO;AAET,KAAI,cAAc,MAAM,CACtB,QAAO;AAET,KAAI,eAAe,MAAM,IAAI,iBAAiB,MAAM,CAClD,QAAO;AAET,QAAO;;;;;AAMT,SAAS,aACP,OACA,OACA,OACA,SACA,QACA,UACM;AAEN,KAAI,MAAM,QAAQ;AAChB,SAAO,KAAK,8BAA8B,MAAM,KAAK,GAAG;AACxD;;AAIF,KAAI,MAAM,aACR,uBAAsB,OAAO,OAAO,QAAQ,SAAS;CAIvD,MAAM,WAAW,SAAS,QAAQ,oBAAoB,MAAM;AAG5D,UAAS;EACP,cAAc;EACd;EACA,oBAAoB,MAAM;EAC3B,CAAC;AAGF,mBAAkB,OAAO,iBAAiB,oBAAoB;CAC9D,MAAM,SAAS,gBAAgB;AAC/B,qBAAoB,OAAO,QAAQ,oBAAoB;AAGvD,aAAY,KAAK,UAAU,YAAY,EAAE,IAAI,OAAO,CAAC;AAGrD,cAAa,KAAK,gBAAgB,SAAS;EACzC;EACA;EACD,CAA4C;AAE7C,SAAQ;;;;;AAMV,SAAS,oBACP,OACA,OACA,QACA,UACc;AACd,KAAI,EAAE,MAAM,gBAAgB,MAAM,oBAChC,QAAO;CAGT,MAAM,gBAAgB,MAAM;CAC5B,MAAM,iBAAiB,MAAM;CAG7B,MAAM,eAAe;EACnB,GAAG;EACH,SAAS;GACP,GAAG;GACH,YAAY;IACV,GAAG,cAAc,QAAQ;IACzB,GAAG,eAAe;IACnB;GACF;EACD,aAAa,KAAK,KAAK;EACxB;AAGD,UAAS;EACP,cAAc;EACd,UAAU;EACV,oBAAoB;EACrB,CAAC;AAGF,sBAAqB,OAAO,oBAAoB;AAGhD,aAAY,KAAK,UAAU,WAAW,EAAE,IAAI,OAAO,CAAC;AAGpD,cAAa,KAAK,gBAAgB,SAAS;EACzC,OAAO;EACP;EACD,CAA4C;AAE7C,SAAQ;AAER,QAAO;;;;;AAMT,SAAS,sBACP,OACA,OACA,QACA,UACM;AACN,KAAI,CAAC,MAAM,aACT;CAGF,MAAM,gBAAgB,MAAM;AAG5B,UAAS;EACP,cAAc;EACd,UAAU;EACV,oBAAoB;EACrB,CAAC;AAGF,sBAAqB,OAAO,oBAAoB;AAGhD,aAAY,KAAK,UAAU,WAAW,EAAE,IAAI,OAAO,CAAC;AAGpD,cAAa,KAAK,gBAAgB,UAAU;EAC1C,OAAO;EACP;EACD,CAAiD;AAElD,SAAQ;;;;;AAMV,MAAa,YAAY,eAA+C;CACtE,cAAc,EAAE,GAAG,uBAAuB;CAE1C,UAAU,OAAO,EAAE,KAAK,KAAK,cAAc;EACzC,OAAO,OAAc,YAA+B;AAClD,gBAAa,OAAO,KAAK,EAAE,OAAO,SAAS,QAAQ,IAAI;;EAGzD,YAAY;AACV,uBAAoB,OAAO,KAAK,EAAE,QAAQ,IAAI;;EAGhD,cAAc;AACZ,yBAAsB,OAAO,KAAK,EAAE,QAAQ,IAAI;;EAEnD;CAMD,YAAY,OAAO,UAAU;AAE3B,MAAI,MAAM,cAAc;AAEtB,wBAAqB,OAAO,oBAAoB;AAGhD,eAAY,KAAK,UAAU,WAAW,EAAE,IAAI,OAAO,CAAC;AAGpD,gBAAa,KAAK,gBAAgB,UAAU;IAC1C,OAAO,MAAM;IACb;IACD,CAAiD;;;CAGvD,CAAC;;;;AAoCF,SAAgB,uBACd,OACA,SACM;AACN,WAAU,IAAI,OAAO,EAAE,oBAAoB,SAAS,CAAC;;;;;AAMvD,SAAgB,uBAAuB,OAAuB;AAC5D,WAAU,QAAQ,MAAM,CAAC,QAAQ"}
1
+ {"version":3,"file":"store.js","names":["DEFAULT_EDITING_STATE: EditingState"],"sources":["../../../../src/deckgl/shapes/edit-shape-layer/store.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 * Edit Shape Store\n *\n * Manages editing state for shape modification.\n *\n * @example\n * ```tsx\n * import { editStore } from '@accelint/map-toolkit/deckgl/shapes';\n *\n * function EditControls({ mapId }) {\n * const { state, edit, save, cancel } = editStore.use(mapId);\n *\n * return (\n * <div>\n * <p>Editing: {state.editingShape?.name ?? 'none'}</p>\n * <button onClick={save}>Save</button>\n * <button onClick={cancel}>Cancel</button>\n * </div>\n * );\n * }\n * ```\n */\n\nimport { Broadcast } from '@accelint/bus';\nimport { getLogger } from '@accelint/logger';\nimport { createMapStore } from '@/shared/create-map-store';\nimport { MapEvents } from '../../base-map/events';\nimport {\n isCircleShape,\n isEllipseShape,\n isPointShape,\n isRectangleShape,\n} from '../shared/types';\nimport {\n releaseModeAndCursor,\n requestCursorChange,\n requestModeChange,\n} from '../shared/utils/mode-utils';\nimport {\n EDIT_CURSOR_MAP,\n EDIT_SHAPE_LAYER_ID,\n EDIT_SHAPE_MODE,\n} from './constants';\nimport { EditShapeEvents } from './events';\nimport type { UniqueId } from '@accelint/core';\nimport type { Feature } from 'geojson';\nimport type { MapEventType } from '../../base-map/types';\nimport type { Shape } from '../shared/types';\nimport type {\n EditShapeEvent,\n ShapeEditCanceledEvent,\n ShapeEditingEvent,\n ShapeUpdatedEvent,\n} from './events';\nimport type {\n EditFunction,\n EditingState,\n EditMode,\n EditShapeOptions,\n} from './types';\n\nconst logger = getLogger({\n enabled:\n process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test',\n level: 'warn',\n prefix: '[EditShapeLayer]',\n pretty: true,\n});\n\n/**\n * Typed event bus instances\n */\nconst editShapeBus = Broadcast.getInstance<EditShapeEvent>();\nconst mapEventBus = Broadcast.getInstance<MapEventType>();\n\n/**\n * Default editing state\n */\nconst DEFAULT_EDITING_STATE: EditingState = {\n editingShape: null,\n editMode: 'view',\n featureBeingEdited: null,\n};\n\n/**\n * Actions for edit shape store\n */\ntype EditShapeActions = {\n /** Start editing a shape */\n edit: EditFunction;\n /** Save the current edits */\n save: () => void;\n /** Cancel editing */\n cancel: () => void;\n};\n\n/**\n * Determine the appropriate edit mode for a shape type\n */\nfunction getEditModeForShape(shape: Shape): EditMode {\n if (isPointShape(shape)) {\n return 'translate';\n }\n if (isCircleShape(shape)) {\n return 'circle-transform';\n }\n if (isEllipseShape(shape) || isRectangleShape(shape)) {\n return 'bounding-transform';\n }\n return 'vertex-transform';\n}\n\n/**\n * Start editing a shape\n */\nfunction startEditing(\n mapId: UniqueId,\n state: EditingState,\n shape: Shape,\n options: EditShapeOptions | undefined,\n notify: () => void,\n setState: (updates: Partial<EditingState>) => void,\n): void {\n // Prevent editing locked shapes\n if (shape.locked) {\n logger.warn(`Cannot edit locked shape: \"${shape.name}\"`);\n return;\n }\n\n // Already editing - cancel first\n if (state.editingShape) {\n cancelEditingInternal(mapId, state, notify, setState);\n }\n\n // Determine edit mode (can be overridden via options)\n const editMode = options?.mode ?? getEditModeForShape(shape);\n\n // Update state with new object reference\n setState({\n editingShape: shape,\n editMode,\n featureBeingEdited: shape.feature,\n });\n\n // Request map mode and cursor\n requestModeChange(mapId, EDIT_SHAPE_MODE, EDIT_SHAPE_LAYER_ID);\n const cursor = EDIT_CURSOR_MAP[editMode];\n requestCursorChange(mapId, cursor, EDIT_SHAPE_LAYER_ID);\n\n // Disable map panning during editing\n mapEventBus.emit(MapEvents.disablePan, { id: mapId });\n\n // Emit editing started event\n editShapeBus.emit(EditShapeEvents.editing, {\n shape,\n mapId,\n } as unknown as ShapeEditingEvent['payload']);\n\n notify();\n}\n\n/**\n * Save editing and create updated shape\n */\nfunction saveEditingInternal(\n mapId: UniqueId,\n state: EditingState,\n notify: () => void,\n setState: (updates: Partial<EditingState>) => void,\n): Shape | null {\n if (!(state.editingShape && state.featureBeingEdited)) {\n return null;\n }\n\n const originalShape = state.editingShape;\n const updatedFeature = state.featureBeingEdited;\n\n // Create updated shape with new geometry\n const updatedShape = {\n ...originalShape,\n feature: {\n ...updatedFeature,\n properties: {\n ...originalShape.feature.properties,\n ...updatedFeature.properties,\n },\n },\n lastUpdated: Date.now(),\n } as Shape;\n\n // Reset state\n setState({\n editingShape: null,\n editMode: 'view',\n featureBeingEdited: null,\n });\n\n // Return to default mode and cursor\n releaseModeAndCursor(mapId, EDIT_SHAPE_LAYER_ID);\n\n // Re-enable map panning\n mapEventBus.emit(MapEvents.enablePan, { id: mapId });\n\n // Emit shape updated event\n editShapeBus.emit(EditShapeEvents.updated, {\n shape: updatedShape,\n mapId,\n } as unknown as ShapeUpdatedEvent['payload']);\n\n notify();\n\n return updatedShape;\n}\n\n/**\n * Cancel the current editing operation\n */\nfunction cancelEditingInternal(\n mapId: UniqueId,\n state: EditingState,\n notify: () => void,\n setState: (updates: Partial<EditingState>) => void,\n): void {\n if (!state.editingShape) {\n return; // Nothing to cancel\n }\n\n const originalShape = state.editingShape;\n\n // Reset state\n setState({\n editingShape: null,\n editMode: 'view',\n featureBeingEdited: null,\n });\n\n // Return to default mode and cursor\n releaseModeAndCursor(mapId, EDIT_SHAPE_LAYER_ID);\n\n // Re-enable map panning\n mapEventBus.emit(MapEvents.enablePan, { id: mapId });\n\n // Emit canceled event\n editShapeBus.emit(EditShapeEvents.canceled, {\n shape: originalShape,\n mapId,\n } as unknown as ShapeEditCanceledEvent['payload']);\n\n notify();\n}\n\n/**\n * Edit shape store\n */\nexport const editStore = createMapStore<EditingState, EditShapeActions>({\n defaultState: { ...DEFAULT_EDITING_STATE },\n\n actions: (mapId, { get, set, notify }) => ({\n edit: (shape: Shape, options?: EditShapeOptions) => {\n startEditing(mapId, get(), shape, options, notify, set);\n },\n\n save: () => {\n saveEditingInternal(mapId, get(), notify, set);\n },\n\n cancel: () => {\n cancelEditingInternal(mapId, get(), notify, set);\n },\n }),\n\n // Note: EditShapeLayer is \"neutral\" regarding mode change authorization.\n // It doesn't auto-cancel or reject mode changes - those decisions are\n // left to UI components that can prompt the user.\n\n onCleanup: (mapId, state) => {\n // Cancel any active editing before cleanup\n if (state.editingShape) {\n // Return to default mode and cursor\n releaseModeAndCursor(mapId, EDIT_SHAPE_LAYER_ID);\n\n // Re-enable map panning\n mapEventBus.emit(MapEvents.enablePan, { id: mapId });\n\n // Emit canceled event\n editShapeBus.emit(EditShapeEvents.canceled, {\n shape: state.editingShape,\n mapId,\n } as unknown as ShapeEditCanceledEvent['payload']);\n }\n },\n});\n\n// =============================================================================\n// Convenience exports\n// =============================================================================\n\n/**\n * Get the current editing state for a mapId\n * Returns null if no store instance exists\n */\nexport function getEditingState(mapId: UniqueId): EditingState | null {\n if (!editStore.exists(mapId)) {\n return null;\n }\n return editStore.get(mapId);\n}\n\n/**\n * Hook for editing state\n */\nexport function useEditingState(\n mapId: UniqueId,\n): { state: EditingState } & EditShapeActions {\n return editStore.use(mapId);\n}\n\n/**\n * Manually clear editing state for a specific mapId.\n */\nexport function clearEditingState(mapId: UniqueId): void {\n editStore.clear(mapId);\n}\n\n/**\n * Update feature from the layer component (called during drag operations)\n */\nexport function updateFeatureFromLayer(\n mapId: UniqueId,\n feature: Feature,\n): void {\n editStore.set(mapId, { featureBeingEdited: feature });\n}\n\n/**\n * Cancel editing (called by the layer component on ESC)\n */\nexport function cancelEditingFromLayer(mapId: UniqueId): void {\n editStore.actions(mapId).cancel();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,MAAM,SAAS,UAAU;CACvB,SACE,QAAQ,IAAI,aAAa,gBAAgB,QAAQ,IAAI,aAAa;CACpE,OAAO;CACP,QAAQ;CACR,QAAQ;CACT,CAAC;;;;AAKF,MAAM,eAAe,UAAU,aAA6B;AAC5D,MAAM,cAAc,UAAU,aAA2B;;;;AAKzD,MAAMA,wBAAsC;CAC1C,cAAc;CACd,UAAU;CACV,oBAAoB;CACrB;;;;AAiBD,SAAS,oBAAoB,OAAwB;AACnD,KAAI,aAAa,MAAM,CACrB,QAAO;AAET,KAAI,cAAc,MAAM,CACtB,QAAO;AAET,KAAI,eAAe,MAAM,IAAI,iBAAiB,MAAM,CAClD,QAAO;AAET,QAAO;;;;;AAMT,SAAS,aACP,OACA,OACA,OACA,SACA,QACA,UACM;AAEN,KAAI,MAAM,QAAQ;AAChB,SAAO,KAAK,8BAA8B,MAAM,KAAK,GAAG;AACxD;;AAIF,KAAI,MAAM,aACR,uBAAsB,OAAO,OAAO,QAAQ,SAAS;CAIvD,MAAM,WAAW,SAAS,QAAQ,oBAAoB,MAAM;AAG5D,UAAS;EACP,cAAc;EACd;EACA,oBAAoB,MAAM;EAC3B,CAAC;AAGF,mBAAkB,OAAO,iBAAiB,oBAAoB;CAC9D,MAAM,SAAS,gBAAgB;AAC/B,qBAAoB,OAAO,QAAQ,oBAAoB;AAGvD,aAAY,KAAK,UAAU,YAAY,EAAE,IAAI,OAAO,CAAC;AAGrD,cAAa,KAAK,gBAAgB,SAAS;EACzC;EACA;EACD,CAA4C;AAE7C,SAAQ;;;;;AAMV,SAAS,oBACP,OACA,OACA,QACA,UACc;AACd,KAAI,EAAE,MAAM,gBAAgB,MAAM,oBAChC,QAAO;CAGT,MAAM,gBAAgB,MAAM;CAC5B,MAAM,iBAAiB,MAAM;CAG7B,MAAM,eAAe;EACnB,GAAG;EACH,SAAS;GACP,GAAG;GACH,YAAY;IACV,GAAG,cAAc,QAAQ;IACzB,GAAG,eAAe;IACnB;GACF;EACD,aAAa,KAAK,KAAK;EACxB;AAGD,UAAS;EACP,cAAc;EACd,UAAU;EACV,oBAAoB;EACrB,CAAC;AAGF,sBAAqB,OAAO,oBAAoB;AAGhD,aAAY,KAAK,UAAU,WAAW,EAAE,IAAI,OAAO,CAAC;AAGpD,cAAa,KAAK,gBAAgB,SAAS;EACzC,OAAO;EACP;EACD,CAA4C;AAE7C,SAAQ;AAER,QAAO;;;;;AAMT,SAAS,sBACP,OACA,OACA,QACA,UACM;AACN,KAAI,CAAC,MAAM,aACT;CAGF,MAAM,gBAAgB,MAAM;AAG5B,UAAS;EACP,cAAc;EACd,UAAU;EACV,oBAAoB;EACrB,CAAC;AAGF,sBAAqB,OAAO,oBAAoB;AAGhD,aAAY,KAAK,UAAU,WAAW,EAAE,IAAI,OAAO,CAAC;AAGpD,cAAa,KAAK,gBAAgB,UAAU;EAC1C,OAAO;EACP;EACD,CAAiD;AAElD,SAAQ;;;;;AAMV,MAAa,YAAY,eAA+C;CACtE,cAAc,EAAE,GAAG,uBAAuB;CAE1C,UAAU,OAAO,EAAE,KAAK,KAAK,cAAc;EACzC,OAAO,OAAc,YAA+B;AAClD,gBAAa,OAAO,KAAK,EAAE,OAAO,SAAS,QAAQ,IAAI;;EAGzD,YAAY;AACV,uBAAoB,OAAO,KAAK,EAAE,QAAQ,IAAI;;EAGhD,cAAc;AACZ,yBAAsB,OAAO,KAAK,EAAE,QAAQ,IAAI;;EAEnD;CAMD,YAAY,OAAO,UAAU;AAE3B,MAAI,MAAM,cAAc;AAEtB,wBAAqB,OAAO,oBAAoB;AAGhD,eAAY,KAAK,UAAU,WAAW,EAAE,IAAI,OAAO,CAAC;AAGpD,gBAAa,KAAK,gBAAgB,UAAU;IAC1C,OAAO,MAAM;IACb;IACD,CAAiD;;;CAGvD,CAAC;;;;AAoCF,SAAgB,uBACd,OACA,SACM;AACN,WAAU,IAAI,OAAO,EAAE,oBAAoB,SAAS,CAAC;;;;;AAMvD,SAAgB,uBAAuB,OAAuB;AAC5D,WAAU,QAAQ,MAAM,CAAC,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-edit-shape.js","names":[],"sources":["../../../../src/deckgl/shapes/edit-shape-layer/use-edit-shape.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport 'client-only';\nimport { useBus } from '@accelint/bus/react';\nimport { useContext, useMemo } from 'react';\nimport { MapContext } from '../../base-map/provider';\nimport { EditShapeEvents } from './events';\nimport { editStore } from './store';\nimport type { UniqueId } from '@accelint/core';\nimport type { EditShapeEvent } from './events';\nimport type { UseEditShapeOptions, UseEditShapeReturn } from './types';\n\n/**\n * Hook to access the shape editing state and actions.\n *\n * This hook uses `useSyncExternalStore` to subscribe to editing state changes,\n * providing concurrent-safe state updates. Uses a fan-out pattern where\n * a single bus listener per map instance notifies N React component subscribers.\n *\n * @param mapId - Optional map instance ID. If not provided, will use the ID from `MapContext`.\n * @param options - Optional callbacks for onUpdate and onCancel events\n * @returns Editing state, edit/save/cancel functions, and convenience flags\n * @throws Error if no `mapId` is provided and hook is used outside of `MapProvider`\n *\n * @example\n * ```tsx\n * // Inside MapProvider (within BaseMap children) - uses context\n * function ShapeEditor() {\n * const { edit, save, cancel, isEditing, editingShape } = useEditShape(undefined, {\n * onUpdate: (shape) => {\n * console.log('Shape updated:', shape);\n * setShapes(prev => prev.map(s => s.id === shape.id ? shape : s));\n * },\n * onCancel: (shape) => {\n * console.log('Editing canceled:', shape.name);\n * },\n * });\n *\n * return (\n * <div>\n * {selectedShape && !isEditing && (\n * <button onClick={() => edit(selectedShape)}>\n * Edit Shape\n * </button>\n * )}\n * {isEditing && (\n * <>\n * <button onClick={save}>Save</button>\n * <button onClick={cancel}>Cancel</button>\n * </>\n * )}\n * </div>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // Outside MapProvider - pass mapId directly\n * function ExternalEditControl({ mapId, shape }: { mapId: UniqueId; shape: Shape }) {\n * const { edit, isEditing } = useEditShape(mapId);\n *\n * return (\n * <button\n * onClick={() => edit(shape)}\n * disabled={isEditing}\n * >\n * Edit\n * </button>\n * );\n * }\n * ```\n */\nexport function useEditShape(\n mapId?: UniqueId,\n options?: UseEditShapeOptions,\n): UseEditShapeReturn {\n const contextId = useContext(MapContext);\n const actualId = mapId ?? contextId;\n\n if (!actualId) {\n throw new Error(\n 'useEditShape requires either a mapId parameter or to be used within a MapProvider',\n );\n }\n\n const { onUpdate, onCancel } = options ?? {};\n\n // Use the v2 store API directly\n const { state: editingState, edit, save, cancel } = editStore.use(actualId);\n\n // Listen for completion/cancellation events to trigger callbacks\n // useOn handles cleanup automatically and uses useEffectEvent for stable callbacks\n const { useOn } = useBus<EditShapeEvent>();\n\n useOn(EditShapeEvents.updated, (event) => {\n if (event.payload.mapId === actualId && onUpdate) {\n onUpdate(event.payload.shape);\n }\n });\n\n useOn(EditShapeEvents.canceled, (event) => {\n if (event.payload.mapId === actualId && onCancel) {\n onCancel(event.payload.shape);\n }\n });\n\n // Memoize the return value to prevent unnecessary re-renders\n return useMemo(\n () => ({\n editingState,\n edit,\n save,\n cancel,\n isEditing: !!editingState?.editingShape,\n editingShape: editingState?.editingShape ?? null,\n }),\n [editingState, edit, save, cancel],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA,SAAgB,aACd,OACA,SACoB;CACpB,MAAM,YAAY,WAAW,WAAW;CACxC,MAAM,WAAW,SAAS;AAE1B,KAAI,CAAC,SACH,OAAM,IAAI,MACR,oFACD;CAGH,MAAM,EAAE,UAAU,aAAa,WAAW,EAAE;CAG5C,MAAM,EAAE,OAAO,cAAc,MAAM,MAAM,WAAW,UAAU,IAAI,SAAS;CAI3E,MAAM,EAAE,mBAAU,QAAwB;AAE1C,SAAM,gBAAgB,UAAU,UAAU;AACxC,MAAI,MAAM,QAAQ,UAAU,YAAY,SACtC,UAAS,MAAM,QAAQ,MAAM;GAE/B;AAEF,SAAM,gBAAgB,WAAW,UAAU;AACzC,MAAI,MAAM,QAAQ,UAAU,YAAY,SACtC,UAAS,MAAM,QAAQ,MAAM;GAE/B;AAGF,QAAO,eACE;EACL;EACA;EACA;EACA;EACA,WAAW,CAAC,CAAC,cAAc;EAC3B,cAAc,cAAc,gBAAgB;EAC7C,GACD;EAAC;EAAc;EAAM;EAAM;EAAO,CACnC"}
1
+ {"version":3,"file":"use-edit-shape.js","names":[],"sources":["../../../../src/deckgl/shapes/edit-shape-layer/use-edit-shape.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 'client-only';\nimport { useBus } from '@accelint/bus/react';\nimport { useContext, useMemo } from 'react';\nimport { MapContext } from '../../base-map/provider';\nimport { EditShapeEvents } from './events';\nimport { editStore } from './store';\nimport type { UniqueId } from '@accelint/core';\nimport type { EditShapeEvent } from './events';\nimport type { UseEditShapeOptions, UseEditShapeReturn } from './types';\n\n/**\n * Hook to access the shape editing state and actions.\n *\n * This hook uses `useSyncExternalStore` to subscribe to editing state changes,\n * providing concurrent-safe state updates. Uses a fan-out pattern where\n * a single bus listener per map instance notifies N React component subscribers.\n *\n * @param mapId - Optional map instance ID. If not provided, will use the ID from `MapContext`.\n * @param options - Optional callbacks for onUpdate and onCancel events\n * @returns Editing state, edit/save/cancel functions, and convenience flags\n * @throws Error if no `mapId` is provided and hook is used outside of `MapProvider`\n *\n * @example\n * ```tsx\n * // Inside MapProvider (within BaseMap children) - uses context\n * function ShapeEditor() {\n * const { edit, save, cancel, isEditing, editingShape } = useEditShape(undefined, {\n * onUpdate: (shape) => {\n * console.log('Shape updated:', shape);\n * setShapes(prev => prev.map(s => s.id === shape.id ? shape : s));\n * },\n * onCancel: (shape) => {\n * console.log('Editing canceled:', shape.name);\n * },\n * });\n *\n * return (\n * <div>\n * {selectedShape && !isEditing && (\n * <button onClick={() => edit(selectedShape)}>\n * Edit Shape\n * </button>\n * )}\n * {isEditing && (\n * <>\n * <button onClick={save}>Save</button>\n * <button onClick={cancel}>Cancel</button>\n * </>\n * )}\n * </div>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // Outside MapProvider - pass mapId directly\n * function ExternalEditControl({ mapId, shape }: { mapId: UniqueId; shape: Shape }) {\n * const { edit, isEditing } = useEditShape(mapId);\n *\n * return (\n * <button\n * onClick={() => edit(shape)}\n * disabled={isEditing}\n * >\n * Edit\n * </button>\n * );\n * }\n * ```\n */\nexport function useEditShape(\n mapId?: UniqueId,\n options?: UseEditShapeOptions,\n): UseEditShapeReturn {\n const contextId = useContext(MapContext);\n const actualId = mapId ?? contextId;\n\n if (!actualId) {\n throw new Error(\n 'useEditShape requires either a mapId parameter or to be used within a MapProvider',\n );\n }\n\n const { onUpdate, onCancel } = options ?? {};\n\n // Use the v2 store API directly\n const { state: editingState, edit, save, cancel } = editStore.use(actualId);\n\n // Listen for completion/cancellation events to trigger callbacks\n // useOn handles cleanup automatically and uses useEffectEvent for stable callbacks\n const { useOn } = useBus<EditShapeEvent>();\n\n useOn(EditShapeEvents.updated, (event) => {\n if (event.payload.mapId === actualId && onUpdate) {\n onUpdate(event.payload.shape);\n }\n });\n\n useOn(EditShapeEvents.canceled, (event) => {\n if (event.payload.mapId === actualId && onCancel) {\n onCancel(event.payload.shape);\n }\n });\n\n // Memoize the return value to prevent unnecessary re-renders\n return useMemo(\n () => ({\n editingState,\n edit,\n save,\n cancel,\n isEditing: !!editingState?.editingShape,\n editingShape: editingState?.editingShape ?? null,\n }),\n [editingState, edit, save, cancel],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA,SAAgB,aACd,OACA,SACoB;CACpB,MAAM,YAAY,WAAW,WAAW;CACxC,MAAM,WAAW,SAAS;AAE1B,KAAI,CAAC,SACH,OAAM,IAAI,MACR,oFACD;CAGH,MAAM,EAAE,UAAU,aAAa,WAAW,EAAE;CAG5C,MAAM,EAAE,OAAO,cAAc,MAAM,MAAM,WAAW,UAAU,IAAI,SAAS;CAI3E,MAAM,EAAE,mBAAU,QAAwB;AAE1C,SAAM,gBAAgB,UAAU,UAAU;AACxC,MAAI,MAAM,QAAQ,UAAU,YAAY,SACtC,UAAS,MAAM,QAAQ,MAAM;GAE/B;AAEF,SAAM,gBAAgB,WAAW,UAAU;AACzC,MAAI,MAAM,QAAQ,UAAU,YAAY,SACtC,UAAS,MAAM,QAAQ,MAAM;GAE/B;AAGF,QAAO,eACE;EACL;EACA;EACA;EACA;EACA,WAAW,CAAC,CAAC,cAAc;EAC3B,cAAc,cAAc,gBAAgB;EAC7C,GACD;EAAC;EAAc;EAAM;EAAM;EAAO,CACnC"}
@@ -24,6 +24,6 @@ import { EditMode, EditShapeLayerProps, EditShapeOptions, EditingState, UseEditS
24
24
  import { EditShapeLayer } from "./edit-shape-layer/index.js";
25
25
  import { useEditShape } from "./edit-shape-layer/use-edit-shape.js";
26
26
  import { BASE_FILL_OPACITY, DASH_ARRAYS, DEFAULT_COLORS, DEFAULT_EDIT_HANDLE_COLOR, DEFAULT_EDIT_HANDLE_OUTLINE_COLOR, DEFAULT_STYLE_PROPERTIES, LINE_PATTERNS, LINE_WIDTHS, SHAPE_LAYER_IDS } from "./shared/constants.js";
27
- import { getDashArray, getFillColor, getLineColor, getLineWidth, normalizeColor } from "./shared/utils/style-utils.js";
28
27
  import { ShapeEventType, ShapeEvents } from "./shared/events.js";
28
+ import { getDashArray, getFillColor, getLineColor, getLineWidth, normalizeColor } from "./shared/utils/style-utils.js";
29
29
  export { BASE_FILL_OPACITY, type CardinalLabelCoordinateAnchor, type CircleFeatureProperties, type CircleProperties, type CircleRadius, type CircleShape, DASH_ARRAYS, DEFAULT_COLORS, DEFAULT_EDIT_HANDLE_COLOR, DEFAULT_EDIT_HANDLE_OUTLINE_COLOR, DEFAULT_STYLE_PROPERTIES, DisplayShapeLayer, type DisplayShapeLayerProps, type DrawShapeEvent, type DrawShapeEventType, DrawShapeEvents, DrawShapeLayer, type DrawShapeLayerProps, type DrawShapeOptions, type DrawingState, type EditMode, type EditShapeEvent, type EditShapeEventType, EditShapeEvents, EditShapeLayer, type EditShapeLayerProps, type EditShapeOptions, type EditingState, type EllipseFeatureProperties, type EllipseProperties, type EllipseShape, LINE_PATTERNS, LINE_WIDTHS, type LabelHorizontalPosition, type LabelPosition2d, type LabelPositionOptions, type LabelVerticalPosition, type LineStringShape, type PointShape, type PolygonShape, type RectangleShape, SHAPE_LAYER_IDS, type Shape, type ShapeDrawCanceledEvent, type ShapeDrawingEvent, type ShapeDrawnEvent, type ShapeEditCanceledEvent, type ShapeEditingEvent, type ShapeEventType, ShapeEvents, type ShapeFeature, type ShapeFeatureProperties, ShapeFeatureType, type ShapeFeatureTypeValues, type ShapeId, type ShapeUpdatedEvent, type ShowLabelsMode, type StyleProperties, type StyledFeature, type StyledFeatureProperties, type Subscription, type UseDrawShapeOptions, type UseDrawShapeReturn, type UseEditShapeOptions, type UseEditShapeReturn, type UseSelectShapeReturn, getDashArray, getFillColor, getLineColor, getLineWidth, isCircleShape, isEllipseShape, isLineStringShape, isPointShape, isPolygonShape, isRectangleShape, normalizeColor, useDrawShape, useEditShape, useSelectShape };
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":["DEFAULT_STYLE_PROPERTIES: StyleProperties","DASH_ARRAYS: Record<\n 'solid' | 'dashed' | 'dotted',\n [number, number] | null\n>","DEFAULT_EDIT_HANDLE_COLOR: Color","DEFAULT_EDIT_HANDLE_OUTLINE_COLOR: Color","EMPTY_FEATURE_COLLECTION: import('geojson').FeatureCollection","TOOLTIP_CHARACTER_SET: string[]"],"sources":["../../../../src/deckgl/shapes/shared/constants.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport { DEFAULT_TEXT_STYLE } from '../../text-settings';\nimport type { Color } from '@deck.gl/core';\nimport type { StyleProperties } from './types';\n\n/**\n * Layer IDs for shape layers\n */\nexport const SHAPE_LAYER_IDS = {\n DISPLAY: 'DISPLAY_SHAPES',\n DISPLAY_HIGHLIGHT: 'DISPLAY_SHAPES::Highlight',\n DISPLAY_LABELS: 'DISPLAY_SHAPES::Labels',\n} as const;\n\n/**\n * Base fill opacity multiplier for standard semi-transparent look.\n * Multiplies alpha by 0.2 (reduces to 20% of original opacity).\n */\nexport const BASE_FILL_OPACITY = 0.2;\n\n/**\n * Default border/outline width in pixels when not specified in styleProperties\n */\nexport const DEFAULT_LINE_WIDTH = 2;\n\n/**\n * Additional pixels added to border/outline width on hover\n */\nexport const HOVER_WIDTH_INCREASE = 2;\n\n/**\n * Additional pixels added to border/outline width for selection highlight\n */\nexport const HIGHLIGHT_WIDTH_INCREASE = 5;\n\n/**\n * Fixed opacity for label background (0-255)\n */\nexport const LABEL_BACKGROUND_OPACITY = 200;\n\n/**\n * Fixed opacity for label border (0-255)\n */\nexport const LABEL_BORDER_OPACITY = 255;\n\n/**\n * Default colors as RGBA arrays for DeckGL layers.\n *\n * These are the canonical color values used throughout the shapes system.\n * All other color constants should derive from these to maintain consistency.\n */\nexport const DEFAULT_COLORS = {\n /** Default fill color (white at full alpha) */\n fill: [255, 255, 255, 255] as Color,\n /** Default border/outline color (outline-interactive-hover: #888a8f) */\n line: [136, 138, 143, 255] as Color,\n /** Highlight/selection color (turquoise at ~39% alpha) */\n highlight: [40, 245, 190, 100] as Color,\n} as const;\n\n/**\n * Tentative (during-drawing) colors.\n *\n * These colors are used for the shape preview while drawing.\n * Fill is semi-transparent (8% opacity) to not obscure underlying features.\n * Border/outline uses the same color as saved shapes for consistency.\n */\nexport const DEFAULT_TENTATIVE_COLORS = {\n /** Tentative fill color (white at 8% opacity: 0.08 * 255 ≈ 20) */\n fill: [255, 255, 255, 20] as Color,\n /** Tentative border/outline color (same as saved shapes for consistency) */\n line: DEFAULT_COLORS.line,\n} as const;\n\n/**\n * Default style properties for saved shapes.\n *\n * These are applied when a shape is completed/saved.\n * Can be overridden via styleDefaults in draw options.\n */\nexport const DEFAULT_STYLE_PROPERTIES: StyleProperties = {\n fillColor: DEFAULT_COLORS.fill,\n lineColor: DEFAULT_COLORS.line,\n lineWidth: 2,\n linePattern: 'solid',\n};\n\n/**\n * Border/outline width options (in pixels)\n */\nexport const LINE_WIDTHS = [1, 2, 4, 8] as const;\n\n/**\n * Border/outline pattern options\n */\nexport const LINE_PATTERNS = ['solid', 'dashed', 'dotted'] as const;\n\n/**\n * Dash array patterns for border/outline rendering\n */\nexport const DASH_ARRAYS: Record<\n 'solid' | 'dashed' | 'dotted',\n [number, number] | null\n> = {\n solid: null,\n dashed: [8, 4],\n dotted: [2, 4],\n};\n\n/**\n * Default tentative fill color (white at 8% opacity - rgba(255, 255, 255, 0.08))\n * Used when drawing new shapes before they're completed.\n * 0.08 * 255 ≈ 20\n */\nexport const DEFAULT_TENTATIVE_FILL_COLOR: Color = [255, 255, 255, 20];\n\n/**\n * Default tentative border/outline color (outline-interactive-hover: #888a8f)\n * Used when drawing new shapes before they're completed.\n */\nexport const DEFAULT_TENTATIVE_LINE_COLOR: Color = [136, 138, 143, 255];\n\n/**\n * Default edit handle color (white) - used by both draw and edit layers\n */\nexport const DEFAULT_EDIT_HANDLE_COLOR: Color = [255, 255, 255, 255];\n\n/**\n * Edit handle outline color (dark for contrast)\n */\nexport const DEFAULT_EDIT_HANDLE_OUTLINE_COLOR: Color = [0, 0, 0, 200];\n\n/**\n * Empty feature collection for initializing editable layers\n */\nexport const EMPTY_FEATURE_COLLECTION: import('geojson').FeatureCollection = {\n type: 'FeatureCollection',\n features: [],\n};\n\n/**\n * Custom character set for deck.gl TextLayer used by tooltip rendering.\n *\n * deck.gl's TextLayer uses SDF (Signed Distance Field) font rendering which\n * by default only supports basic ASCII characters (32-128). Special characters\n * like degree symbol (°) and superscript 2 (²) must be explicitly included\n * for tooltip text like \"100.5 km²\" to render correctly.\n */\nexport const TOOLTIP_CHARACTER_SET: string[] = ['°', '²'];\n\n// Add standard ASCII characters (space through tilde + DEL)\nfor (let i = 32; i <= 128; i++) {\n TOOLTIP_CHARACTER_SET.push(String.fromCharCode(i));\n}\n\n/**\n * Sublayer props for tooltip text rendering.\n * Used by both draw-shape-layer and edit-shape-layer for area/distance tooltips.\n */\nexport const TOOLTIP_SUBLAYER_PROPS = {\n tooltips: {\n ...DEFAULT_TEXT_STYLE,\n fontFamily: 'Roboto MonoVariable, monospace',\n characterSet: TOOLTIP_CHARACTER_SET,\n getTextAnchor: 'start',\n getAlignmentBaseline: 'bottom',\n getPixelOffset: [8, 0],\n },\n};\n\n/**\n * Shared edit handle sublayer props for EditableGeoJsonLayer.\n * Used by both draw-shape-layer and edit-shape-layer.\n */\nexport const EDIT_HANDLE_SUBLAYER_PROPS = {\n editHandlePointOutline: {\n getFillColor: DEFAULT_EDIT_HANDLE_COLOR,\n getRadius: 6,\n },\n editHandlePoint: {\n getFillColor: DEFAULT_EDIT_HANDLE_COLOR,\n getRadius: 4,\n },\n};\n\n/**\n * Combined sublayer props for EditableGeoJsonLayer with tooltips and edit handles.\n * Used by both draw-shape-layer and edit-shape-layer.\n */\nexport const EDITABLE_LAYER_SUBLAYER_PROPS = {\n ...TOOLTIP_SUBLAYER_PROPS,\n ...EDIT_HANDLE_SUBLAYER_PROPS,\n};\n\n/**\n * Format a distance value for tooltip display.\n * Used by draw and edit mode tooltips for consistent formatting.\n *\n * @param value - The distance value to format\n * @returns The formatted string with 2 decimal places\n */\nexport function formatDistance(value: number): string {\n return value.toFixed(2);\n}\n\n// =============================================================================\n// Tooltip Text Formatters\n// =============================================================================\n// These functions generate consistent tooltip text for both draw and edit modes.\n\n/**\n * Format circle tooltip text showing diameter and area.\n *\n * @param diameter - Circle diameter in the specified units\n * @param area - Circle area in the specified units squared\n * @param unitAbbrev - Unit abbreviation (e.g., 'km', 'mi')\n * @returns Formatted tooltip text: \"d: {diameter} {unit}\\n{area} {unit}²\"\n */\nexport function formatCircleTooltip(\n diameter: number,\n area: number,\n unitAbbrev: string,\n): string {\n return `d: ${formatDistance(diameter)} ${unitAbbrev}\\n${formatDistance(area)} ${unitAbbrev}²`;\n}\n\n/**\n * Format rectangle tooltip text showing dimensions and area.\n *\n * @param width - Rectangle width in the specified units\n * @param height - Rectangle height in the specified units\n * @param area - Rectangle area in the specified units squared\n * @param unitAbbrev - Unit abbreviation (e.g., 'km', 'mi')\n * @returns Formatted tooltip text: \"{width} {unit} x {height} {unit}\\n{area} {unit}²\"\n */\nexport function formatRectangleTooltip(\n width: number,\n height: number,\n area: number,\n unitAbbrev: string,\n): string {\n return `${formatDistance(width)} ${unitAbbrev} x ${formatDistance(height)} ${unitAbbrev}\\n${formatDistance(area)} ${unitAbbrev}²`;\n}\n\n/**\n * Format ellipse tooltip text showing axes and area.\n *\n * @param majorAxis - Ellipse major axis (full length) in the specified units\n * @param minorAxis - Ellipse minor axis (full length) in the specified units\n * @param area - Ellipse area in the specified units squared\n * @param unitAbbrev - Unit abbreviation (e.g., 'km', 'mi')\n * @returns Formatted tooltip text: \"{major} {unit} x {minor} {unit}\\n{area} {unit}²\"\n */\nexport function formatEllipseTooltip(\n majorAxis: number,\n minorAxis: number,\n area: number,\n unitAbbrev: string,\n): string {\n return `${formatDistance(majorAxis)} ${unitAbbrev} x ${formatDistance(minorAxis)} ${unitAbbrev}\\n${formatDistance(area)} ${unitAbbrev}²`;\n}\n\n/**\n * Format simple distance tooltip text.\n *\n * @param distance - Distance value in the specified units\n * @param unitAbbrev - Unit abbreviation (e.g., 'km', 'mi')\n * @returns Formatted tooltip text: \"{distance} {unit}\"\n */\nexport function formatDistanceTooltip(\n distance: number,\n unitAbbrev: string,\n): string {\n return `${formatDistance(distance)} ${unitAbbrev}`;\n}\n\n// =============================================================================\n// Edit Event Type Classification\n// =============================================================================\n\n/**\n * Continuous edit event types that fire during dragging.\n * These are emitted repeatedly while the user drags during an edit operation.\n */\nexport const CONTINUOUS_EDIT_TYPES = new Set([\n 'movePosition',\n 'unionGeometry',\n 'scaling',\n 'rotating',\n 'translating',\n]);\n\n/**\n * Completion edit event types that fire when dragging ends.\n * These are emitted once when the user finishes an edit action.\n */\nexport const COMPLETION_EDIT_TYPES = new Set([\n 'finishMovePosition',\n 'addPosition',\n 'removePosition',\n 'scaled',\n 'rotated',\n 'translated',\n]);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,kBAAkB;CAC7B,SAAS;CACT,mBAAmB;CACnB,gBAAgB;CACjB;;;;;AAMD,MAAa,oBAAoB;;;;AAKjC,MAAa,qBAAqB;;;;AAKlC,MAAa,uBAAuB;;;;AAKpC,MAAa,2BAA2B;;;;;;;AAkBxC,MAAa,iBAAiB;CAE5B,MAAM;EAAC;EAAK;EAAK;EAAK;EAAI;CAE1B,MAAM;EAAC;EAAK;EAAK;EAAK;EAAI;CAE1B,WAAW;EAAC;EAAI;EAAK;EAAK;EAAI;CAC/B;;;;;;;;AASD,MAAa,2BAA2B;CAEtC,MAAM;EAAC;EAAK;EAAK;EAAK;EAAG;CAEzB,MAAM,eAAe;CACtB;;;;;;;AAQD,MAAaA,2BAA4C;CACvD,WAAW,eAAe;CAC1B,WAAW,eAAe;CAC1B,WAAW;CACX,aAAa;CACd;;;;AAKD,MAAa,cAAc;CAAC;CAAG;CAAG;CAAG;CAAE;;;;AAKvC,MAAa,gBAAgB;CAAC;CAAS;CAAU;CAAS;;;;AAK1D,MAAaC,cAGT;CACF,OAAO;CACP,QAAQ,CAAC,GAAG,EAAE;CACd,QAAQ,CAAC,GAAG,EAAE;CACf;;;;AAkBD,MAAaC,4BAAmC;CAAC;CAAK;CAAK;CAAK;CAAI;;;;AAKpE,MAAaC,oCAA2C;CAAC;CAAG;CAAG;CAAG;CAAI;;;;AAKtE,MAAaC,2BAAgE;CAC3E,MAAM;CACN,UAAU,EAAE;CACb;;;;;;;;;AAUD,MAAaC,wBAAkC,CAAC,KAAK,IAAI;AAGzD,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,IACzB,uBAAsB,KAAK,OAAO,aAAa,EAAE,CAAC;;;;;AAOpD,MAAa,yBAAyB,EACpC,UAAU;CACR,GAAG;CACH,YAAY;CACZ,cAAc;CACd,eAAe;CACf,sBAAsB;CACtB,gBAAgB,CAAC,GAAG,EAAE;CACvB,EACF;;;;;AAMD,MAAa,6BAA6B;CACxC,wBAAwB;EACtB,cAAc;EACd,WAAW;EACZ;CACD,iBAAiB;EACf,cAAc;EACd,WAAW;EACZ;CACF;;;;;AAMD,MAAa,gCAAgC;CAC3C,GAAG;CACH,GAAG;CACJ;;;;;;;;AASD,SAAgB,eAAe,OAAuB;AACpD,QAAO,MAAM,QAAQ,EAAE;;;;;;;;;;AAgBzB,SAAgB,oBACd,UACA,MACA,YACQ;AACR,QAAO,MAAM,eAAe,SAAS,CAAC,GAAG,WAAW,IAAI,eAAe,KAAK,CAAC,GAAG,WAAW;;;;;;;;;;;AAY7F,SAAgB,uBACd,OACA,QACA,MACA,YACQ;AACR,QAAO,GAAG,eAAe,MAAM,CAAC,GAAG,WAAW,KAAK,eAAe,OAAO,CAAC,GAAG,WAAW,IAAI,eAAe,KAAK,CAAC,GAAG,WAAW;;;;;;;;;;;AAYjI,SAAgB,qBACd,WACA,WACA,MACA,YACQ;AACR,QAAO,GAAG,eAAe,UAAU,CAAC,GAAG,WAAW,KAAK,eAAe,UAAU,CAAC,GAAG,WAAW,IAAI,eAAe,KAAK,CAAC,GAAG,WAAW;;;;;;;;;AAUxI,SAAgB,sBACd,UACA,YACQ;AACR,QAAO,GAAG,eAAe,SAAS,CAAC,GAAG;;;;;;AAWxC,MAAa,wBAAwB,IAAI,IAAI;CAC3C;CACA;CACA;CACA;CACA;CACD,CAAC;;;;;AAMF,MAAa,wBAAwB,IAAI,IAAI;CAC3C;CACA;CACA;CACA;CACA;CACA;CACD,CAAC"}
1
+ {"version":3,"file":"constants.js","names":["DEFAULT_STYLE_PROPERTIES: StyleProperties","DASH_ARRAYS: Record<\n 'solid' | 'dashed' | 'dotted',\n [number, number] | null\n>","DEFAULT_EDIT_HANDLE_COLOR: Color","DEFAULT_EDIT_HANDLE_OUTLINE_COLOR: Color","EMPTY_FEATURE_COLLECTION: import('geojson').FeatureCollection","TOOLTIP_CHARACTER_SET: string[]"],"sources":["../../../../src/deckgl/shapes/shared/constants.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 { DEFAULT_TEXT_STYLE } from '../../text-settings';\nimport type { Color } from '@deck.gl/core';\nimport type { StyleProperties } from './types';\n\n/**\n * Layer IDs for shape layers\n */\nexport const SHAPE_LAYER_IDS = {\n DISPLAY: 'DISPLAY_SHAPES',\n DISPLAY_HIGHLIGHT: 'DISPLAY_SHAPES::Highlight',\n DISPLAY_LABELS: 'DISPLAY_SHAPES::Labels',\n} as const;\n\n/**\n * Base fill opacity multiplier for standard semi-transparent look.\n * Multiplies alpha by 0.2 (reduces to 20% of original opacity).\n */\nexport const BASE_FILL_OPACITY = 0.2;\n\n/**\n * Default border/outline width in pixels when not specified in styleProperties\n */\nexport const DEFAULT_LINE_WIDTH = 2;\n\n/**\n * Additional pixels added to border/outline width on hover\n */\nexport const HOVER_WIDTH_INCREASE = 2;\n\n/**\n * Additional pixels added to border/outline width for selection highlight\n */\nexport const HIGHLIGHT_WIDTH_INCREASE = 5;\n\n/**\n * Fixed opacity for label background (0-255)\n */\nexport const LABEL_BACKGROUND_OPACITY = 200;\n\n/**\n * Fixed opacity for label border (0-255)\n */\nexport const LABEL_BORDER_OPACITY = 255;\n\n/**\n * Default colors as RGBA arrays for DeckGL layers.\n *\n * These are the canonical color values used throughout the shapes system.\n * All other color constants should derive from these to maintain consistency.\n */\nexport const DEFAULT_COLORS = {\n /** Default fill color (white at full alpha) */\n fill: [255, 255, 255, 255] as Color,\n /** Default border/outline color (outline-interactive-hover: #888a8f) */\n line: [136, 138, 143, 255] as Color,\n /** Highlight/selection color (turquoise at ~39% alpha) */\n highlight: [40, 245, 190, 100] as Color,\n} as const;\n\n/**\n * Tentative (during-drawing) colors.\n *\n * These colors are used for the shape preview while drawing.\n * Fill is semi-transparent (8% opacity) to not obscure underlying features.\n * Border/outline uses the same color as saved shapes for consistency.\n */\nexport const DEFAULT_TENTATIVE_COLORS = {\n /** Tentative fill color (white at 8% opacity: 0.08 * 255 ≈ 20) */\n fill: [255, 255, 255, 20] as Color,\n /** Tentative border/outline color (same as saved shapes for consistency) */\n line: DEFAULT_COLORS.line,\n} as const;\n\n/**\n * Default style properties for saved shapes.\n *\n * These are applied when a shape is completed/saved.\n * Can be overridden via styleDefaults in draw options.\n */\nexport const DEFAULT_STYLE_PROPERTIES: StyleProperties = {\n fillColor: DEFAULT_COLORS.fill,\n lineColor: DEFAULT_COLORS.line,\n lineWidth: 2,\n linePattern: 'solid',\n};\n\n/**\n * Border/outline width options (in pixels)\n */\nexport const LINE_WIDTHS = [1, 2, 4, 8] as const;\n\n/**\n * Border/outline pattern options\n */\nexport const LINE_PATTERNS = ['solid', 'dashed', 'dotted'] as const;\n\n/**\n * Dash array patterns for border/outline rendering\n */\nexport const DASH_ARRAYS: Record<\n 'solid' | 'dashed' | 'dotted',\n [number, number] | null\n> = {\n solid: null,\n dashed: [8, 4],\n dotted: [2, 4],\n};\n\n/**\n * Default tentative fill color (white at 8% opacity - rgba(255, 255, 255, 0.08))\n * Used when drawing new shapes before they're completed.\n * 0.08 * 255 ≈ 20\n */\nexport const DEFAULT_TENTATIVE_FILL_COLOR: Color = [255, 255, 255, 20];\n\n/**\n * Default tentative border/outline color (outline-interactive-hover: #888a8f)\n * Used when drawing new shapes before they're completed.\n */\nexport const DEFAULT_TENTATIVE_LINE_COLOR: Color = [136, 138, 143, 255];\n\n/**\n * Default edit handle color (white) - used by both draw and edit layers\n */\nexport const DEFAULT_EDIT_HANDLE_COLOR: Color = [255, 255, 255, 255];\n\n/**\n * Edit handle outline color (dark for contrast)\n */\nexport const DEFAULT_EDIT_HANDLE_OUTLINE_COLOR: Color = [0, 0, 0, 200];\n\n/**\n * Empty feature collection for initializing editable layers\n */\nexport const EMPTY_FEATURE_COLLECTION: import('geojson').FeatureCollection = {\n type: 'FeatureCollection',\n features: [],\n};\n\n/**\n * Custom character set for deck.gl TextLayer used by tooltip rendering.\n *\n * deck.gl's TextLayer uses SDF (Signed Distance Field) font rendering which\n * by default only supports basic ASCII characters (32-128). Special characters\n * like degree symbol (°) and superscript 2 (²) must be explicitly included\n * for tooltip text like \"100.5 km²\" to render correctly.\n */\nexport const TOOLTIP_CHARACTER_SET: string[] = ['°', '²'];\n\n// Add standard ASCII characters (space through tilde + DEL)\nfor (let i = 32; i <= 128; i++) {\n TOOLTIP_CHARACTER_SET.push(String.fromCharCode(i));\n}\n\n/**\n * Sublayer props for tooltip text rendering.\n * Used by both draw-shape-layer and edit-shape-layer for area/distance tooltips.\n */\nexport const TOOLTIP_SUBLAYER_PROPS = {\n tooltips: {\n ...DEFAULT_TEXT_STYLE,\n fontFamily: 'Roboto MonoVariable, monospace',\n characterSet: TOOLTIP_CHARACTER_SET,\n getTextAnchor: 'start',\n getAlignmentBaseline: 'bottom',\n getPixelOffset: [8, 0],\n },\n};\n\n/**\n * Shared edit handle sublayer props for EditableGeoJsonLayer.\n * Used by both draw-shape-layer and edit-shape-layer.\n */\nexport const EDIT_HANDLE_SUBLAYER_PROPS = {\n editHandlePointOutline: {\n getFillColor: DEFAULT_EDIT_HANDLE_COLOR,\n getRadius: 6,\n },\n editHandlePoint: {\n getFillColor: DEFAULT_EDIT_HANDLE_COLOR,\n getRadius: 4,\n },\n};\n\n/**\n * Combined sublayer props for EditableGeoJsonLayer with tooltips and edit handles.\n * Used by both draw-shape-layer and edit-shape-layer.\n */\nexport const EDITABLE_LAYER_SUBLAYER_PROPS = {\n ...TOOLTIP_SUBLAYER_PROPS,\n ...EDIT_HANDLE_SUBLAYER_PROPS,\n};\n\n/**\n * Format a distance value for tooltip display.\n * Used by draw and edit mode tooltips for consistent formatting.\n *\n * @param value - The distance value to format\n * @returns The formatted string with 2 decimal places\n */\nexport function formatDistance(value: number): string {\n return value.toFixed(2);\n}\n\n// =============================================================================\n// Tooltip Text Formatters\n// =============================================================================\n// These functions generate consistent tooltip text for both draw and edit modes.\n\n/**\n * Format circle tooltip text showing diameter and area.\n *\n * @param diameter - Circle diameter in the specified units\n * @param area - Circle area in the specified units squared\n * @param unitAbbrev - Unit abbreviation (e.g., 'km', 'mi')\n * @returns Formatted tooltip text: \"d: {diameter} {unit}\\n{area} {unit}²\"\n */\nexport function formatCircleTooltip(\n diameter: number,\n area: number,\n unitAbbrev: string,\n): string {\n return `d: ${formatDistance(diameter)} ${unitAbbrev}\\n${formatDistance(area)} ${unitAbbrev}²`;\n}\n\n/**\n * Format rectangle tooltip text showing dimensions and area.\n *\n * @param width - Rectangle width in the specified units\n * @param height - Rectangle height in the specified units\n * @param area - Rectangle area in the specified units squared\n * @param unitAbbrev - Unit abbreviation (e.g., 'km', 'mi')\n * @returns Formatted tooltip text: \"{width} {unit} x {height} {unit}\\n{area} {unit}²\"\n */\nexport function formatRectangleTooltip(\n width: number,\n height: number,\n area: number,\n unitAbbrev: string,\n): string {\n return `${formatDistance(width)} ${unitAbbrev} x ${formatDistance(height)} ${unitAbbrev}\\n${formatDistance(area)} ${unitAbbrev}²`;\n}\n\n/**\n * Format ellipse tooltip text showing axes and area.\n *\n * @param majorAxis - Ellipse major axis (full length) in the specified units\n * @param minorAxis - Ellipse minor axis (full length) in the specified units\n * @param area - Ellipse area in the specified units squared\n * @param unitAbbrev - Unit abbreviation (e.g., 'km', 'mi')\n * @returns Formatted tooltip text: \"{major} {unit} x {minor} {unit}\\n{area} {unit}²\"\n */\nexport function formatEllipseTooltip(\n majorAxis: number,\n minorAxis: number,\n area: number,\n unitAbbrev: string,\n): string {\n return `${formatDistance(majorAxis)} ${unitAbbrev} x ${formatDistance(minorAxis)} ${unitAbbrev}\\n${formatDistance(area)} ${unitAbbrev}²`;\n}\n\n/**\n * Format simple distance tooltip text.\n *\n * @param distance - Distance value in the specified units\n * @param unitAbbrev - Unit abbreviation (e.g., 'km', 'mi')\n * @returns Formatted tooltip text: \"{distance} {unit}\"\n */\nexport function formatDistanceTooltip(\n distance: number,\n unitAbbrev: string,\n): string {\n return `${formatDistance(distance)} ${unitAbbrev}`;\n}\n\n// =============================================================================\n// Edit Event Type Classification\n// =============================================================================\n\n/**\n * Continuous edit event types that fire during dragging.\n * These are emitted repeatedly while the user drags during an edit operation.\n */\nexport const CONTINUOUS_EDIT_TYPES = new Set([\n 'movePosition',\n 'unionGeometry',\n 'scaling',\n 'rotating',\n 'translating',\n]);\n\n/**\n * Completion edit event types that fire when dragging ends.\n * These are emitted once when the user finishes an edit action.\n */\nexport const COMPLETION_EDIT_TYPES = new Set([\n 'finishMovePosition',\n 'addPosition',\n 'removePosition',\n 'scaled',\n 'rotated',\n 'translated',\n]);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,kBAAkB;CAC7B,SAAS;CACT,mBAAmB;CACnB,gBAAgB;CACjB;;;;;AAMD,MAAa,oBAAoB;;;;AAKjC,MAAa,qBAAqB;;;;AAKlC,MAAa,uBAAuB;;;;AAKpC,MAAa,2BAA2B;;;;;;;AAkBxC,MAAa,iBAAiB;CAE5B,MAAM;EAAC;EAAK;EAAK;EAAK;EAAI;CAE1B,MAAM;EAAC;EAAK;EAAK;EAAK;EAAI;CAE1B,WAAW;EAAC;EAAI;EAAK;EAAK;EAAI;CAC/B;;;;;;;;AASD,MAAa,2BAA2B;CAEtC,MAAM;EAAC;EAAK;EAAK;EAAK;EAAG;CAEzB,MAAM,eAAe;CACtB;;;;;;;AAQD,MAAaA,2BAA4C;CACvD,WAAW,eAAe;CAC1B,WAAW,eAAe;CAC1B,WAAW;CACX,aAAa;CACd;;;;AAKD,MAAa,cAAc;CAAC;CAAG;CAAG;CAAG;CAAE;;;;AAKvC,MAAa,gBAAgB;CAAC;CAAS;CAAU;CAAS;;;;AAK1D,MAAaC,cAGT;CACF,OAAO;CACP,QAAQ,CAAC,GAAG,EAAE;CACd,QAAQ,CAAC,GAAG,EAAE;CACf;;;;AAkBD,MAAaC,4BAAmC;CAAC;CAAK;CAAK;CAAK;CAAI;;;;AAKpE,MAAaC,oCAA2C;CAAC;CAAG;CAAG;CAAG;CAAI;;;;AAKtE,MAAaC,2BAAgE;CAC3E,MAAM;CACN,UAAU,EAAE;CACb;;;;;;;;;AAUD,MAAaC,wBAAkC,CAAC,KAAK,IAAI;AAGzD,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,IACzB,uBAAsB,KAAK,OAAO,aAAa,EAAE,CAAC;;;;;AAOpD,MAAa,yBAAyB,EACpC,UAAU;CACR,GAAG;CACH,YAAY;CACZ,cAAc;CACd,eAAe;CACf,sBAAsB;CACtB,gBAAgB,CAAC,GAAG,EAAE;CACvB,EACF;;;;;AAMD,MAAa,6BAA6B;CACxC,wBAAwB;EACtB,cAAc;EACd,WAAW;EACZ;CACD,iBAAiB;EACf,cAAc;EACd,WAAW;EACZ;CACF;;;;;AAMD,MAAa,gCAAgC;CAC3C,GAAG;CACH,GAAG;CACJ;;;;;;;;AASD,SAAgB,eAAe,OAAuB;AACpD,QAAO,MAAM,QAAQ,EAAE;;;;;;;;;;AAgBzB,SAAgB,oBACd,UACA,MACA,YACQ;AACR,QAAO,MAAM,eAAe,SAAS,CAAC,GAAG,WAAW,IAAI,eAAe,KAAK,CAAC,GAAG,WAAW;;;;;;;;;;;AAY7F,SAAgB,uBACd,OACA,QACA,MACA,YACQ;AACR,QAAO,GAAG,eAAe,MAAM,CAAC,GAAG,WAAW,KAAK,eAAe,OAAO,CAAC,GAAG,WAAW,IAAI,eAAe,KAAK,CAAC,GAAG,WAAW;;;;;;;;;;;AAYjI,SAAgB,qBACd,WACA,WACA,MACA,YACQ;AACR,QAAO,GAAG,eAAe,UAAU,CAAC,GAAG,WAAW,KAAK,eAAe,UAAU,CAAC,GAAG,WAAW,IAAI,eAAe,KAAK,CAAC,GAAG,WAAW;;;;;;;;;AAUxI,SAAgB,sBACd,UACA,YACQ;AACR,QAAO,GAAG,eAAe,SAAS,CAAC,GAAG;;;;;;AAWxC,MAAa,wBAAwB,IAAI,IAAI;CAC3C;CACA;CACA;CACA;CACA;CACD,CAAC;;;;;AAMF,MAAa,wBAAwB,IAAI,IAAI;CAC3C;CACA;CACA;CACA;CACA;CACA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","names":[],"sources":["../../../../src/deckgl/shapes/shared/events.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport type { Payload } from '@accelint/bus';\nimport type { UniqueId } from '@accelint/core';\nimport type { ShapeId } from './types';\n\n/**\n * Shape interaction events for DisplayShapeLayer\n */\nexport const ShapeEvents = {\n /** Shape selected */\n selected: 'shapes:selected',\n /** Selection cleared */\n deselected: 'shapes:deselected',\n /** Shape hovered (for cursor changes) */\n hovered: 'shapes:hovered',\n} as const;\n\nexport type ShapeEventType = (typeof ShapeEvents)[keyof typeof ShapeEvents];\n\n/**\n * Event payload types (all payloads are serializable)\n */\n\nexport type ShapeSelectedEvent = Payload<\n 'shapes:selected',\n {\n shapeId: ShapeId;\n /** Map instance ID for multi-map event isolation */\n mapId: UniqueId;\n }\n>;\n\nexport type ShapeDeselectedEvent = Payload<\n 'shapes:deselected',\n {\n /** Map instance ID for multi-map event isolation */\n mapId: UniqueId;\n }\n>;\n\nexport type ShapeHoveredEvent = Payload<\n 'shapes:hovered',\n {\n /** Shape ID being hovered, or null when hover ends */\n shapeId: ShapeId | null;\n /** Map instance ID for multi-map event isolation */\n mapId: UniqueId;\n }\n>;\n\n/**\n * Union of all shape event types\n */\nexport type ShapeEvent =\n | ShapeSelectedEvent\n | ShapeDeselectedEvent\n | ShapeHoveredEvent;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,MAAa,cAAc;CAEzB,UAAU;CAEV,YAAY;CAEZ,SAAS;CACV"}
1
+ {"version":3,"file":"events.js","names":[],"sources":["../../../../src/deckgl/shapes/shared/events.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 type { Payload } from '@accelint/bus';\nimport type { UniqueId } from '@accelint/core';\nimport type { ShapeId } from './types';\n\n/**\n * Shape interaction events for DisplayShapeLayer\n */\nexport const ShapeEvents = {\n /** Shape selected */\n selected: 'shapes:selected',\n /** Selection cleared */\n deselected: 'shapes:deselected',\n /** Shape hovered (for cursor changes) */\n hovered: 'shapes:hovered',\n} as const;\n\nexport type ShapeEventType = (typeof ShapeEvents)[keyof typeof ShapeEvents];\n\n/**\n * Event payload types (all payloads are serializable)\n */\n\nexport type ShapeSelectedEvent = Payload<\n 'shapes:selected',\n {\n shapeId: ShapeId;\n /** Map instance ID for multi-map event isolation */\n mapId: UniqueId;\n }\n>;\n\nexport type ShapeDeselectedEvent = Payload<\n 'shapes:deselected',\n {\n /** Map instance ID for multi-map event isolation */\n mapId: UniqueId;\n }\n>;\n\nexport type ShapeHoveredEvent = Payload<\n 'shapes:hovered',\n {\n /** Shape ID being hovered, or null when hover ends */\n shapeId: ShapeId | null;\n /** Map instance ID for multi-map event isolation */\n mapId: UniqueId;\n }\n>;\n\n/**\n * Union of all shape event types\n */\nexport type ShapeEvent =\n | ShapeSelectedEvent\n | ShapeDeselectedEvent\n | ShapeHoveredEvent;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,MAAa,cAAc;CAEzB,UAAU;CAEV,YAAY;CAEZ,SAAS;CACV"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-shift-zoom-disable.js","names":[],"sources":["../../../../../src/deckgl/shapes/shared/hooks/use-shift-zoom-disable.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport { useEmit } from '@accelint/bus/react';\nimport { useEffect, useRef } from 'react';\nimport { MapEvents } from '@/deckgl/base-map/events';\nimport type { UniqueId } from '@accelint/core';\nimport type {\n MapDisableZoomEvent,\n MapEnableZoomEvent,\n} from '@/deckgl/base-map/types';\n\n/**\n * Hook to disable map zoom while Shift key is held during shape operations.\n *\n * This prevents MapLibre's boxZoom (Shift+drag) from interfering with\n * Shift modifier constraints like:\n * - Shift for uniform scaling during edit\n * - Shift for rotation snap during edit\n * - Shift for square constraint during rectangle drawing\n *\n * @param mapId - The map instance ID\n * @param isActive - Whether the hook should be active (e.g., when editing/drawing)\n */\nexport function useShiftZoomDisable(mapId: UniqueId, isActive: boolean): void {\n const emitDisableZoom = useEmit<MapDisableZoomEvent>(MapEvents.disableZoom);\n const emitEnableZoom = useEmit<MapEnableZoomEvent>(MapEvents.enableZoom);\n const isZoomDisabledRef = useRef(false);\n\n useEffect(() => {\n if (!isActive) {\n return;\n }\n\n const disableZoom = () => {\n if (!isZoomDisabledRef.current) {\n isZoomDisabledRef.current = true;\n emitDisableZoom({ id: mapId });\n }\n };\n\n const enableZoom = () => {\n if (isZoomDisabledRef.current) {\n isZoomDisabledRef.current = false;\n emitEnableZoom({ id: mapId });\n }\n };\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Shift') {\n disableZoom();\n }\n };\n\n const handleKeyUp = (event: KeyboardEvent) => {\n if (event.key === 'Shift') {\n enableZoom();\n }\n };\n\n // Also catch Shift state on mousedown to handle edge cases where\n // keydown might have been missed (e.g., focus issues)\n const handleMouseDown = (event: MouseEvent) => {\n if (event.shiftKey) {\n disableZoom();\n }\n };\n\n // Re-enable zoom if the window loses focus while Shift is held\n const handleBlur = () => {\n enableZoom();\n };\n\n document.addEventListener('keydown', handleKeyDown);\n document.addEventListener('keyup', handleKeyUp);\n document.addEventListener('mousedown', handleMouseDown, { capture: true });\n window.addEventListener('blur', handleBlur);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n document.removeEventListener('keyup', handleKeyUp);\n document.removeEventListener('mousedown', handleMouseDown, {\n capture: true,\n });\n window.removeEventListener('blur', handleBlur);\n\n // Ensure zoom is re-enabled when unmounting\n enableZoom();\n };\n }, [isActive, mapId, emitDisableZoom, emitEnableZoom]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,SAAgB,oBAAoB,OAAiB,UAAyB;CAC5E,MAAM,kBAAkB,QAA6B,UAAU,YAAY;CAC3E,MAAM,iBAAiB,QAA4B,UAAU,WAAW;CACxE,MAAM,oBAAoB,OAAO,MAAM;AAEvC,iBAAgB;AACd,MAAI,CAAC,SACH;EAGF,MAAM,oBAAoB;AACxB,OAAI,CAAC,kBAAkB,SAAS;AAC9B,sBAAkB,UAAU;AAC5B,oBAAgB,EAAE,IAAI,OAAO,CAAC;;;EAIlC,MAAM,mBAAmB;AACvB,OAAI,kBAAkB,SAAS;AAC7B,sBAAkB,UAAU;AAC5B,mBAAe,EAAE,IAAI,OAAO,CAAC;;;EAIjC,MAAM,iBAAiB,UAAyB;AAC9C,OAAI,MAAM,QAAQ,QAChB,cAAa;;EAIjB,MAAM,eAAe,UAAyB;AAC5C,OAAI,MAAM,QAAQ,QAChB,aAAY;;EAMhB,MAAM,mBAAmB,UAAsB;AAC7C,OAAI,MAAM,SACR,cAAa;;EAKjB,MAAM,mBAAmB;AACvB,eAAY;;AAGd,WAAS,iBAAiB,WAAW,cAAc;AACnD,WAAS,iBAAiB,SAAS,YAAY;AAC/C,WAAS,iBAAiB,aAAa,iBAAiB,EAAE,SAAS,MAAM,CAAC;AAC1E,SAAO,iBAAiB,QAAQ,WAAW;AAE3C,eAAa;AACX,YAAS,oBAAoB,WAAW,cAAc;AACtD,YAAS,oBAAoB,SAAS,YAAY;AAClD,YAAS,oBAAoB,aAAa,iBAAiB,EACzD,SAAS,MACV,CAAC;AACF,UAAO,oBAAoB,QAAQ,WAAW;AAG9C,eAAY;;IAEb;EAAC;EAAU;EAAO;EAAiB;EAAe,CAAC"}
1
+ {"version":3,"file":"use-shift-zoom-disable.js","names":[],"sources":["../../../../../src/deckgl/shapes/shared/hooks/use-shift-zoom-disable.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 { useEmit } from '@accelint/bus/react';\nimport { useEffect, useRef } from 'react';\nimport { MapEvents } from '@/deckgl/base-map/events';\nimport type { UniqueId } from '@accelint/core';\nimport type {\n MapDisableZoomEvent,\n MapEnableZoomEvent,\n} from '@/deckgl/base-map/types';\n\n/**\n * Hook to disable map zoom while Shift key is held during shape operations.\n *\n * This prevents MapLibre's boxZoom (Shift+drag) from interfering with\n * Shift modifier constraints like:\n * - Shift for uniform scaling during edit\n * - Shift for rotation snap during edit\n * - Shift for square constraint during rectangle drawing\n *\n * @param mapId - The map instance ID\n * @param isActive - Whether the hook should be active (e.g., when editing/drawing)\n */\nexport function useShiftZoomDisable(mapId: UniqueId, isActive: boolean): void {\n const emitDisableZoom = useEmit<MapDisableZoomEvent>(MapEvents.disableZoom);\n const emitEnableZoom = useEmit<MapEnableZoomEvent>(MapEvents.enableZoom);\n const isZoomDisabledRef = useRef(false);\n\n useEffect(() => {\n if (!isActive) {\n return;\n }\n\n const disableZoom = () => {\n if (!isZoomDisabledRef.current) {\n isZoomDisabledRef.current = true;\n emitDisableZoom({ id: mapId });\n }\n };\n\n const enableZoom = () => {\n if (isZoomDisabledRef.current) {\n isZoomDisabledRef.current = false;\n emitEnableZoom({ id: mapId });\n }\n };\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Shift') {\n disableZoom();\n }\n };\n\n const handleKeyUp = (event: KeyboardEvent) => {\n if (event.key === 'Shift') {\n enableZoom();\n }\n };\n\n // Also catch Shift state on mousedown to handle edge cases where\n // keydown might have been missed (e.g., focus issues)\n const handleMouseDown = (event: MouseEvent) => {\n if (event.shiftKey) {\n disableZoom();\n }\n };\n\n // Re-enable zoom if the window loses focus while Shift is held\n const handleBlur = () => {\n enableZoom();\n };\n\n document.addEventListener('keydown', handleKeyDown);\n document.addEventListener('keyup', handleKeyUp);\n document.addEventListener('mousedown', handleMouseDown, { capture: true });\n window.addEventListener('blur', handleBlur);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n document.removeEventListener('keyup', handleKeyUp);\n document.removeEventListener('mousedown', handleMouseDown, {\n capture: true,\n });\n window.removeEventListener('blur', handleBlur);\n\n // Ensure zoom is re-enabled when unmounting\n enableZoom();\n };\n }, [isActive, mapId, emitDisableZoom, emitEnableZoom]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,SAAgB,oBAAoB,OAAiB,UAAyB;CAC5E,MAAM,kBAAkB,QAA6B,UAAU,YAAY;CAC3E,MAAM,iBAAiB,QAA4B,UAAU,WAAW;CACxE,MAAM,oBAAoB,OAAO,MAAM;AAEvC,iBAAgB;AACd,MAAI,CAAC,SACH;EAGF,MAAM,oBAAoB;AACxB,OAAI,CAAC,kBAAkB,SAAS;AAC9B,sBAAkB,UAAU;AAC5B,oBAAgB,EAAE,IAAI,OAAO,CAAC;;;EAIlC,MAAM,mBAAmB;AACvB,OAAI,kBAAkB,SAAS;AAC7B,sBAAkB,UAAU;AAC5B,mBAAe,EAAE,IAAI,OAAO,CAAC;;;EAIjC,MAAM,iBAAiB,UAAyB;AAC9C,OAAI,MAAM,QAAQ,QAChB,cAAa;;EAIjB,MAAM,eAAe,UAAyB;AAC5C,OAAI,MAAM,QAAQ,QAChB,aAAY;;EAMhB,MAAM,mBAAmB,UAAsB;AAC7C,OAAI,MAAM,SACR,cAAa;;EAKjB,MAAM,mBAAmB;AACvB,eAAY;;AAGd,WAAS,iBAAiB,WAAW,cAAc;AACnD,WAAS,iBAAiB,SAAS,YAAY;AAC/C,WAAS,iBAAiB,aAAa,iBAAiB,EAAE,SAAS,MAAM,CAAC;AAC1E,SAAO,iBAAiB,QAAQ,WAAW;AAE3C,eAAa;AACX,YAAS,oBAAoB,WAAW,cAAc;AACtD,YAAS,oBAAoB,SAAS,YAAY;AAClD,YAAS,oBAAoB,aAAa,iBAAiB,EACzD,SAAS,MACV,CAAC;AACF,UAAO,oBAAoB,QAAQ,WAAW;AAG9C,eAAY;;IAEb;EAAC;EAAU;EAAO;EAAiB;EAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../src/deckgl/shapes/shared/types.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport type { UniqueId } from '@accelint/core';\nimport type { Color } from '@deck.gl/core';\nimport type { Feature, LineString, Point, Polygon } from 'geojson';\nimport type { DistanceUnit } from '@/shared/units';\n\n/**\n * Supported shape types\n */\nexport const ShapeFeatureType = {\n Circle: 'Circle',\n Ellipse: 'Ellipse',\n Polygon: 'Polygon',\n Rectangle: 'Rectangle',\n LineString: 'LineString',\n Point: 'Point',\n} as const;\n\nexport type ShapeFeatureType =\n (typeof ShapeFeatureType)[keyof typeof ShapeFeatureType];\n\n/**\n * Shape ID type - uses UniqueId from core\n */\nexport type ShapeId = UniqueId;\n\n/**\n * Border/outline width options (in pixels).\n * Controls the width of shape outlines.\n */\nexport type LineWidth = 1 | 2 | 4 | 8;\n\n/**\n * Border/outline pattern options.\n * Controls how shape outlines are rendered.\n */\nexport type LinePattern = 'solid' | 'dashed' | 'dotted';\n\n/**\n * Style properties for rendering shapes\n */\nexport interface StyleProperties {\n /** Fill color as RGBA array [r, g, b, a] where each value is 0-255 */\n fillColor: Color;\n /** Border/outline color as RGBA array [r, g, b, a] where each value is 0-255 */\n lineColor: Color;\n /** Border/outline width in pixels */\n lineWidth: LineWidth;\n /** Border/outline pattern (solid, dashed, or dotted) */\n linePattern: LinePattern;\n /** Optional icon properties for Point geometries */\n icon?: {\n /** Icon atlas URL or data */\n atlas?: string;\n /** Icon mapping (name to position in atlas) */\n mapping?: Record<\n string,\n { x: number; y: number; width: number; height: number; mask?: boolean }\n >;\n /** Icon name to use from mapping */\n name?: string;\n /** Icon size in pixels */\n size?: number;\n };\n /** Optional custom label pixel offset [x, y] */\n labelOffset?: [number, number];\n /** Optional custom label vertical anchor */\n labelVerticalAnchor?: 'top' | 'middle' | 'bottom';\n /** Optional custom label horizontal anchor */\n labelHorizontalAnchor?: 'left' | 'center' | 'right';\n /** Optional custom label coordinate anchor (position along geometry) */\n labelCoordinateAnchor?:\n | 'center'\n | 'start'\n | 'middle'\n | 'end'\n | 'top'\n | 'right'\n | 'bottom'\n | 'left';\n}\n\n/**\n * Circle-specific properties for precise rendering\n * Stored alongside the polygon approximation\n */\nexport interface CircleProperties {\n /** Center point as [longitude, latitude] */\n center: [number, number];\n /** Radius with value and units */\n radius: {\n /** Radius value */\n value: number;\n /** Units for the radius measurement */\n units: DistanceUnit;\n };\n}\n\n/**\n * Ellipse-specific properties for precise rendering\n * Stored alongside the polygon approximation\n */\nexport interface EllipseProperties {\n /** Center point as [longitude, latitude] */\n center: [number, number];\n /** X semi-axis (horizontal radius) with value and units */\n xSemiAxis: {\n /** X semi-axis value */\n value: number;\n /** Units for the measurement */\n units: DistanceUnit;\n };\n /** Y semi-axis (vertical radius) with value and units */\n ySemiAxis: {\n /** Y semi-axis value */\n value: number;\n /** Units for the measurement */\n units: DistanceUnit;\n };\n /** Rotation angle in degrees */\n angle: number;\n}\n\n/**\n * Custom geometry types supported\n */\nexport type CustomGeometry = Point | LineString | Polygon;\n\n/**\n * Properties for styled features.\n *\n * Note: circleProperties and ellipseProperties are optional at the type level\n * but are guaranteed to be present for their respective shape types.\n * Use the type guards (isCircleShape, isEllipseShape) for type narrowing.\n */\nexport interface StyledFeatureProperties {\n /** Style properties for rendering */\n styleProperties: StyleProperties;\n /** Shape ID for correlation */\n shapeId?: ShapeId;\n /** Circle properties (present for Circle shapes) */\n circleProperties?: CircleProperties;\n /** Ellipse properties (present for Ellipse shapes) */\n ellipseProperties?: EllipseProperties;\n}\n\n/**\n * Feature properties for Circle shapes (circleProperties required).\n * Used by CircleShape for better type narrowing.\n */\nexport interface CircleFeatureProperties extends StyledFeatureProperties {\n /** Circle properties (required for Circle shapes) */\n circleProperties: CircleProperties;\n}\n\n/**\n * Feature properties for Ellipse shapes (ellipseProperties required).\n * Used by EllipseShape for better type narrowing.\n */\nexport interface EllipseFeatureProperties extends StyledFeatureProperties {\n /** Ellipse properties (required for Ellipse shapes) */\n ellipseProperties: EllipseProperties;\n}\n\n/**\n * GeoJSON Feature with style properties\n */\nexport interface StyledFeature extends Feature {\n properties: StyledFeatureProperties;\n}\n\n/**\n * Base shape properties shared by all shapes\n */\ninterface BaseShape {\n /** Unique identifier */\n id: ShapeId;\n /** Full shape name used internally and in UI */\n name: string;\n /**\n * Optional short display label shown on the map\n * If not provided, the `name` property will be used instead\n * Useful for showing abbreviated text on the map (e.g., \"NYC\" vs \"New York City Office\")\n */\n label?: string;\n /** GeoJSON feature with geometry and style properties */\n feature: ShapeFeature;\n /** UTC timestamp (only set when saved) */\n lastUpdated?: number;\n /**\n * Whether the shape is locked for editing\n * Locked shapes cannot be modified due to data restrictions or user preference\n */\n locked?: boolean;\n}\n\n/**\n * Circle shape with required circleProperties\n */\nexport interface CircleShape extends BaseShape {\n shape: typeof ShapeFeatureType.Circle;\n feature: StyledFeature & { properties: CircleFeatureProperties };\n}\n\n/**\n * Ellipse shape with required ellipseProperties\n */\nexport interface EllipseShape extends BaseShape {\n shape: typeof ShapeFeatureType.Ellipse;\n feature: StyledFeature & { properties: EllipseFeatureProperties };\n}\n\n/**\n * Polygon shape\n */\nexport interface PolygonShape extends BaseShape {\n shape: typeof ShapeFeatureType.Polygon;\n feature: StyledFeature;\n}\n\n/**\n * Rectangle shape\n */\nexport interface RectangleShape extends BaseShape {\n shape: typeof ShapeFeatureType.Rectangle;\n feature: StyledFeature;\n}\n\n/**\n * LineString shape\n */\nexport interface LineStringShape extends BaseShape {\n shape: typeof ShapeFeatureType.LineString;\n feature: StyledFeature;\n}\n\n/**\n * Point shape\n */\nexport interface PointShape extends BaseShape {\n shape: typeof ShapeFeatureType.Point;\n feature: StyledFeature;\n}\n\n/**\n * Discriminated union of all shape types.\n *\n * Use this for type narrowing based on shape:\n * @example\n * ```ts\n * function handleShape(shape: Shape) {\n * if (shape.shape === 'Circle') {\n * // TypeScript knows shape.feature.properties.circleProperties exists\n * const { center, radius } = shape.feature.properties.circleProperties;\n * }\n * }\n * ```\n */\nexport type Shape =\n | CircleShape\n | EllipseShape\n | PolygonShape\n | RectangleShape\n | LineStringShape\n | PointShape;\n\n/**\n * Alias for ShapeFeatureType values\n */\nexport type ShapeFeatureTypeValues = ShapeFeatureType;\n\n/**\n * Alias for StyledFeature (shape feature)\n */\nexport type ShapeFeature = StyledFeature;\n\n/**\n * Alias for StyledFeature properties\n */\nexport type ShapeFeatureProperties = StyledFeature['properties'];\n\n/**\n * Circle radius type\n */\nexport type CircleRadius = CircleProperties['radius'];\n\n/**\n * Coordinate as [longitude, latitude]\n */\nexport type Coordinate = [number, number];\n\n/**\n * Function type for subscription (useSyncExternalStore pattern).\n * Used by draw-shape-layer and edit-shape-layer stores.\n */\nexport type Subscription = (onStoreChange: () => void) => () => void;\n\n// =============================================================================\n// Type Guards\n// =============================================================================\n\n/**\n * Type guard for Circle shapes.\n *\n * @example\n * ```ts\n * if (isCircleShape(shape)) {\n * // shape.feature.properties.circleProperties is available\n * const { center, radius } = shape.feature.properties.circleProperties;\n * }\n * ```\n */\nexport function isCircleShape(shape: Shape): shape is CircleShape {\n return shape.shape === ShapeFeatureType.Circle;\n}\n\n/**\n * Type guard for Ellipse shapes.\n *\n * @example\n * ```ts\n * if (isEllipseShape(shape)) {\n * // shape.feature.properties.ellipseProperties is available\n * const { center, xSemiAxis, ySemiAxis } = shape.feature.properties.ellipseProperties;\n * }\n * ```\n */\nexport function isEllipseShape(shape: Shape): shape is EllipseShape {\n return shape.shape === ShapeFeatureType.Ellipse;\n}\n\n/**\n * Type guard for Polygon shapes.\n */\nexport function isPolygonShape(shape: Shape): shape is PolygonShape {\n return shape.shape === ShapeFeatureType.Polygon;\n}\n\n/**\n * Type guard for Rectangle shapes.\n */\nexport function isRectangleShape(shape: Shape): shape is RectangleShape {\n return shape.shape === ShapeFeatureType.Rectangle;\n}\n\n/**\n * Type guard for LineString shapes.\n */\nexport function isLineStringShape(shape: Shape): shape is LineStringShape {\n return shape.shape === ShapeFeatureType.LineString;\n}\n\n/**\n * Type guard for Point shapes.\n */\nexport function isPointShape(shape: Shape): shape is PointShape {\n return shape.shape === ShapeFeatureType.Point;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsBA,MAAa,mBAAmB;CAC9B,QAAQ;CACR,SAAS;CACT,SAAS;CACT,WAAW;CACX,YAAY;CACZ,OAAO;CACR;;;;;;;;;;;;AAwSD,SAAgB,cAAc,OAAoC;AAChE,QAAO,MAAM,UAAU,iBAAiB;;;;;;;;;;;;;AAc1C,SAAgB,eAAe,OAAqC;AAClE,QAAO,MAAM,UAAU,iBAAiB;;;;;AAM1C,SAAgB,eAAe,OAAqC;AAClE,QAAO,MAAM,UAAU,iBAAiB;;;;;AAM1C,SAAgB,iBAAiB,OAAuC;AACtE,QAAO,MAAM,UAAU,iBAAiB;;;;;AAM1C,SAAgB,kBAAkB,OAAwC;AACxE,QAAO,MAAM,UAAU,iBAAiB;;;;;AAM1C,SAAgB,aAAa,OAAmC;AAC9D,QAAO,MAAM,UAAU,iBAAiB"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/deckgl/shapes/shared/types.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 type { UniqueId } from '@accelint/core';\nimport type { Color } from '@deck.gl/core';\nimport type { Feature, LineString, Point, Polygon } from 'geojson';\nimport type { DistanceUnit } from '@/shared/units';\n\n/**\n * Supported shape types\n */\nexport const ShapeFeatureType = {\n Circle: 'Circle',\n Ellipse: 'Ellipse',\n Polygon: 'Polygon',\n Rectangle: 'Rectangle',\n LineString: 'LineString',\n Point: 'Point',\n} as const;\n\nexport type ShapeFeatureType =\n (typeof ShapeFeatureType)[keyof typeof ShapeFeatureType];\n\n/**\n * Shape ID type - uses UniqueId from core\n */\nexport type ShapeId = UniqueId;\n\n/**\n * Border/outline width options (in pixels).\n * Controls the width of shape outlines.\n */\nexport type LineWidth = 1 | 2 | 4 | 8;\n\n/**\n * Border/outline pattern options.\n * Controls how shape outlines are rendered.\n */\nexport type LinePattern = 'solid' | 'dashed' | 'dotted';\n\n/**\n * Style properties for rendering shapes\n */\nexport interface StyleProperties {\n /** Fill color as RGBA array [r, g, b, a] where each value is 0-255 */\n fillColor: Color;\n /** Border/outline color as RGBA array [r, g, b, a] where each value is 0-255 */\n lineColor: Color;\n /** Border/outline width in pixels */\n lineWidth: LineWidth;\n /** Border/outline pattern (solid, dashed, or dotted) */\n linePattern: LinePattern;\n /** Optional icon properties for Point geometries */\n icon?: {\n /** Icon atlas URL or data */\n atlas?: string;\n /** Icon mapping (name to position in atlas) */\n mapping?: Record<\n string,\n { x: number; y: number; width: number; height: number; mask?: boolean }\n >;\n /** Icon name to use from mapping */\n name?: string;\n /** Icon size in pixels */\n size?: number;\n };\n /** Optional custom label pixel offset [x, y] */\n labelOffset?: [number, number];\n /** Optional custom label vertical anchor */\n labelVerticalAnchor?: 'top' | 'middle' | 'bottom';\n /** Optional custom label horizontal anchor */\n labelHorizontalAnchor?: 'left' | 'center' | 'right';\n /** Optional custom label coordinate anchor (position along geometry) */\n labelCoordinateAnchor?:\n | 'center'\n | 'start'\n | 'middle'\n | 'end'\n | 'top'\n | 'right'\n | 'bottom'\n | 'left';\n}\n\n/**\n * Circle-specific properties for precise rendering\n * Stored alongside the polygon approximation\n */\nexport interface CircleProperties {\n /** Center point as [longitude, latitude] */\n center: [number, number];\n /** Radius with value and units */\n radius: {\n /** Radius value */\n value: number;\n /** Units for the radius measurement */\n units: DistanceUnit;\n };\n}\n\n/**\n * Ellipse-specific properties for precise rendering\n * Stored alongside the polygon approximation\n */\nexport interface EllipseProperties {\n /** Center point as [longitude, latitude] */\n center: [number, number];\n /** X semi-axis (horizontal radius) with value and units */\n xSemiAxis: {\n /** X semi-axis value */\n value: number;\n /** Units for the measurement */\n units: DistanceUnit;\n };\n /** Y semi-axis (vertical radius) with value and units */\n ySemiAxis: {\n /** Y semi-axis value */\n value: number;\n /** Units for the measurement */\n units: DistanceUnit;\n };\n /** Rotation angle in degrees */\n angle: number;\n}\n\n/**\n * Custom geometry types supported\n */\nexport type CustomGeometry = Point | LineString | Polygon;\n\n/**\n * Properties for styled features.\n *\n * Note: circleProperties and ellipseProperties are optional at the type level\n * but are guaranteed to be present for their respective shape types.\n * Use the type guards (isCircleShape, isEllipseShape) for type narrowing.\n */\nexport interface StyledFeatureProperties {\n /** Style properties for rendering */\n styleProperties: StyleProperties;\n /** Shape ID for correlation */\n shapeId?: ShapeId;\n /** Circle properties (present for Circle shapes) */\n circleProperties?: CircleProperties;\n /** Ellipse properties (present for Ellipse shapes) */\n ellipseProperties?: EllipseProperties;\n}\n\n/**\n * Feature properties for Circle shapes (circleProperties required).\n * Used by CircleShape for better type narrowing.\n */\nexport interface CircleFeatureProperties extends StyledFeatureProperties {\n /** Circle properties (required for Circle shapes) */\n circleProperties: CircleProperties;\n}\n\n/**\n * Feature properties for Ellipse shapes (ellipseProperties required).\n * Used by EllipseShape for better type narrowing.\n */\nexport interface EllipseFeatureProperties extends StyledFeatureProperties {\n /** Ellipse properties (required for Ellipse shapes) */\n ellipseProperties: EllipseProperties;\n}\n\n/**\n * GeoJSON Feature with style properties\n */\nexport interface StyledFeature extends Feature {\n properties: StyledFeatureProperties;\n}\n\n/**\n * Base shape properties shared by all shapes\n */\ninterface BaseShape {\n /** Unique identifier */\n id: ShapeId;\n /** Full shape name used internally and in UI */\n name: string;\n /**\n * Optional short display label shown on the map\n * If not provided, the `name` property will be used instead\n * Useful for showing abbreviated text on the map (e.g., \"NYC\" vs \"New York City Office\")\n */\n label?: string;\n /** GeoJSON feature with geometry and style properties */\n feature: ShapeFeature;\n /** UTC timestamp (only set when saved) */\n lastUpdated?: number;\n /**\n * Whether the shape is locked for editing\n * Locked shapes cannot be modified due to data restrictions or user preference\n */\n locked?: boolean;\n}\n\n/**\n * Circle shape with required circleProperties\n */\nexport interface CircleShape extends BaseShape {\n shape: typeof ShapeFeatureType.Circle;\n feature: StyledFeature & { properties: CircleFeatureProperties };\n}\n\n/**\n * Ellipse shape with required ellipseProperties\n */\nexport interface EllipseShape extends BaseShape {\n shape: typeof ShapeFeatureType.Ellipse;\n feature: StyledFeature & { properties: EllipseFeatureProperties };\n}\n\n/**\n * Polygon shape\n */\nexport interface PolygonShape extends BaseShape {\n shape: typeof ShapeFeatureType.Polygon;\n feature: StyledFeature;\n}\n\n/**\n * Rectangle shape\n */\nexport interface RectangleShape extends BaseShape {\n shape: typeof ShapeFeatureType.Rectangle;\n feature: StyledFeature;\n}\n\n/**\n * LineString shape\n */\nexport interface LineStringShape extends BaseShape {\n shape: typeof ShapeFeatureType.LineString;\n feature: StyledFeature;\n}\n\n/**\n * Point shape\n */\nexport interface PointShape extends BaseShape {\n shape: typeof ShapeFeatureType.Point;\n feature: StyledFeature;\n}\n\n/**\n * Discriminated union of all shape types.\n *\n * Use this for type narrowing based on shape:\n * @example\n * ```ts\n * function handleShape(shape: Shape) {\n * if (shape.shape === 'Circle') {\n * // TypeScript knows shape.feature.properties.circleProperties exists\n * const { center, radius } = shape.feature.properties.circleProperties;\n * }\n * }\n * ```\n */\nexport type Shape =\n | CircleShape\n | EllipseShape\n | PolygonShape\n | RectangleShape\n | LineStringShape\n | PointShape;\n\n/**\n * Alias for ShapeFeatureType values\n */\nexport type ShapeFeatureTypeValues = ShapeFeatureType;\n\n/**\n * Alias for StyledFeature (shape feature)\n */\nexport type ShapeFeature = StyledFeature;\n\n/**\n * Alias for StyledFeature properties\n */\nexport type ShapeFeatureProperties = StyledFeature['properties'];\n\n/**\n * Circle radius type\n */\nexport type CircleRadius = CircleProperties['radius'];\n\n/**\n * Coordinate as [longitude, latitude]\n */\nexport type Coordinate = [number, number];\n\n/**\n * Function type for subscription (useSyncExternalStore pattern).\n * Used by draw-shape-layer and edit-shape-layer stores.\n */\nexport type Subscription = (onStoreChange: () => void) => () => void;\n\n// =============================================================================\n// Type Guards\n// =============================================================================\n\n/**\n * Type guard for Circle shapes.\n *\n * @example\n * ```ts\n * if (isCircleShape(shape)) {\n * // shape.feature.properties.circleProperties is available\n * const { center, radius } = shape.feature.properties.circleProperties;\n * }\n * ```\n */\nexport function isCircleShape(shape: Shape): shape is CircleShape {\n return shape.shape === ShapeFeatureType.Circle;\n}\n\n/**\n * Type guard for Ellipse shapes.\n *\n * @example\n * ```ts\n * if (isEllipseShape(shape)) {\n * // shape.feature.properties.ellipseProperties is available\n * const { center, xSemiAxis, ySemiAxis } = shape.feature.properties.ellipseProperties;\n * }\n * ```\n */\nexport function isEllipseShape(shape: Shape): shape is EllipseShape {\n return shape.shape === ShapeFeatureType.Ellipse;\n}\n\n/**\n * Type guard for Polygon shapes.\n */\nexport function isPolygonShape(shape: Shape): shape is PolygonShape {\n return shape.shape === ShapeFeatureType.Polygon;\n}\n\n/**\n * Type guard for Rectangle shapes.\n */\nexport function isRectangleShape(shape: Shape): shape is RectangleShape {\n return shape.shape === ShapeFeatureType.Rectangle;\n}\n\n/**\n * Type guard for LineString shapes.\n */\nexport function isLineStringShape(shape: Shape): shape is LineStringShape {\n return shape.shape === ShapeFeatureType.LineString;\n}\n\n/**\n * Type guard for Point shapes.\n */\nexport function isPointShape(shape: Shape): shape is PointShape {\n return shape.shape === ShapeFeatureType.Point;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsBA,MAAa,mBAAmB;CAC9B,QAAQ;CACR,SAAS;CACT,SAAS;CACT,WAAW;CACX,YAAY;CACZ,OAAO;CACR;;;;;;;;;;;;AAwSD,SAAgB,cAAc,OAAoC;AAChE,QAAO,MAAM,UAAU,iBAAiB;;;;;;;;;;;;;AAc1C,SAAgB,eAAe,OAAqC;AAClE,QAAO,MAAM,UAAU,iBAAiB;;;;;AAM1C,SAAgB,eAAe,OAAqC;AAClE,QAAO,MAAM,UAAU,iBAAiB;;;;;AAM1C,SAAgB,iBAAiB,OAAuC;AACtE,QAAO,MAAM,UAAU,iBAAiB;;;;;AAM1C,SAAgB,kBAAkB,OAAwC;AACxE,QAAO,MAAM,UAAU,iBAAiB;;;;;AAM1C,SAAgB,aAAa,OAAmC;AAC9D,QAAO,MAAM,UAAU,iBAAiB"}
@@ -1 +1 @@
1
- {"version":3,"file":"geometry-measurements.js","names":[],"sources":["../../../../../src/deckgl/shapes/shared/utils/geometry-measurements.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport { distance, point } from '@turf/turf';\nimport type { DistanceUnit } from '@/shared/units';\n\n/**\n * Circle measurement result containing radius, diameter, and area.\n */\nexport interface CircleMeasurements {\n /** Radius in the specified units */\n radius: number;\n /** Diameter (radius * 2) in the specified units */\n diameter: number;\n /** Area (π * radius²) in the specified units squared */\n area: number;\n}\n\n/**\n * Ellipse measurement result containing semi-axes and area.\n */\nexport interface EllipseMeasurements {\n /** X semi-axis (horizontal radius) in the specified units */\n xSemiAxis: number;\n /** Y semi-axis (vertical radius) in the specified units */\n ySemiAxis: number;\n /** Major axis (full length of longer axis) in the specified units */\n majorAxis: number;\n /** Minor axis (full length of shorter axis) in the specified units */\n minorAxis: number;\n /** Area (π * xSemiAxis * ySemiAxis) in the specified units squared */\n area: number;\n}\n\n/**\n * Rectangle measurement result containing width, height, and area.\n */\nexport interface RectangleMeasurements {\n /** Width in the specified units */\n width: number;\n /** Height in the specified units */\n height: number;\n /** Area (width * height) in the specified units squared */\n area: number;\n}\n\n/**\n * Compute circle measurements from center and edge point.\n *\n * @param center - Center point as [longitude, latitude]\n * @param edgePoint - Point on the circle's edge as [longitude, latitude]\n * @param units - Distance units for the measurements\n * @returns Circle measurements including radius, diameter, and area\n *\n * @example\n * ```ts\n * const { radius, diameter, area } = computeCircleMeasurements(\n * [-122.4, 37.8],\n * [-122.3, 37.8],\n * 'kilometers'\n * );\n * ```\n */\nexport function computeCircleMeasurements(\n center: [number, number],\n edgePoint: [number, number],\n units: DistanceUnit,\n): CircleMeasurements {\n const radius = distance(center, edgePoint, { units });\n const diameter = radius * 2;\n const area = Math.PI * radius ** 2;\n\n return { radius, diameter, area };\n}\n\n/**\n * Compute ellipse measurements from center and semi-axis lengths.\n *\n * @param xSemiAxis - X semi-axis (horizontal radius) in the specified units\n * @param ySemiAxis - Y semi-axis (vertical radius) in the specified units\n * @returns Ellipse measurements including axes and area\n *\n * @example\n * ```ts\n * const { majorAxis, minorAxis, area } = computeEllipseMeasurementsFromAxes(100, 50);\n * ```\n */\nexport function computeEllipseMeasurementsFromAxes(\n xSemiAxis: number,\n ySemiAxis: number,\n): EllipseMeasurements {\n const majorAxis = Math.max(xSemiAxis, ySemiAxis) * 2;\n const minorAxis = Math.min(xSemiAxis, ySemiAxis) * 2;\n const area = Math.PI * xSemiAxis * ySemiAxis;\n\n return { xSemiAxis, ySemiAxis, majorAxis, minorAxis, area };\n}\n\n/**\n * Compute rectangle measurements from adjacent corner points.\n *\n * Uses geodesic distance calculations for accurate measurements on Earth's surface.\n * Corners should be provided in order: corner0 -> corner1 -> corner2 where:\n * - corner0 to corner1 defines one edge (width)\n * - corner1 to corner2 defines the adjacent edge (height)\n *\n * @param corner0 - First corner as [longitude, latitude]\n * @param corner1 - Adjacent corner as [longitude, latitude]\n * @param corner2 - Corner adjacent to corner1 as [longitude, latitude]\n * @param units - Distance units for the measurements\n * @returns Rectangle measurements including width, height, and area\n *\n * @example\n * ```ts\n * const coords = polygon.geometry.coordinates[0];\n * const { width, height, area } = computeRectangleMeasurementsFromCorners(\n * coords[0] as [number, number],\n * coords[1] as [number, number],\n * coords[2] as [number, number],\n * 'kilometers'\n * );\n * ```\n */\nexport function computeRectangleMeasurementsFromCorners(\n corner0: [number, number],\n corner1: [number, number],\n corner2: [number, number],\n units: DistanceUnit,\n): RectangleMeasurements {\n const width = distance(point(corner0), point(corner1), { units });\n const height = distance(point(corner1), point(corner2), { units });\n const area = width * height;\n\n return { width, height, area };\n}\n\n/**\n * Compute ellipse measurements from polygon coordinates.\n *\n * For an ellipse approximated as a polygon, calculates the major and minor axes\n * by measuring distances between opposite points on the perimeter.\n *\n * @param coordinates - Polygon ring coordinates as [[lon, lat], ...]\n * @param units - Distance units for the measurements\n * @returns Ellipse measurements including axes and area\n *\n * @example\n * ```ts\n * const coords = polygon.geometry.coordinates[0];\n * const { majorAxis, minorAxis, area } = computeEllipseMeasurementsFromPolygon(\n * coords as [number, number][],\n * 'kilometers'\n * );\n * ```\n */\nexport function computeEllipseMeasurementsFromPolygon(\n coordinates: [number, number][],\n units: DistanceUnit,\n): { majorAxis: number; minorAxis: number; area: number } {\n // Remove the closing point if it duplicates the first\n const points =\n coordinates[0]?.[0] === coordinates[coordinates.length - 1]?.[0] &&\n coordinates[0]?.[1] === coordinates[coordinates.length - 1]?.[1]\n ? coordinates.slice(0, -1)\n : coordinates;\n\n if (points.length < 4) {\n return { majorAxis: 0, minorAxis: 0, area: 0 };\n }\n\n // For an ellipse polygon, opposite points are at index i and i + n/2\n const halfLen = Math.floor(points.length / 2);\n let maxDist = 0;\n let minDist = Number.POSITIVE_INFINITY;\n\n // Sample several diameter measurements\n for (let i = 0; i < halfLen; i++) {\n const p1 = points[i];\n const p2 = points[i + halfLen];\n if (!(p1 && p2)) {\n continue;\n }\n\n const dist = distance(\n [p1[0] as number, p1[1] as number],\n [p2[0] as number, p2[1] as number],\n { units },\n );\n\n if (dist > maxDist) {\n maxDist = dist;\n }\n if (dist < minDist) {\n minDist = dist;\n }\n }\n\n const majorAxis = maxDist;\n const minorAxis = minDist === Number.POSITIVE_INFINITY ? maxDist : minDist;\n\n // Ellipse area = π × a × b (where a and b are semi-axes)\n const semiMajor = majorAxis / 2;\n const semiMinor = minorAxis / 2;\n const ellipseArea = Math.PI * semiMajor * semiMinor;\n\n return { majorAxis, minorAxis, area: ellipseArea };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,SAAgB,0BACd,QACA,WACA,OACoB;CACpB,MAAM,SAAS,SAAS,QAAQ,WAAW,EAAE,OAAO,CAAC;AAIrD,QAAO;EAAE;EAAQ,UAHA,SAAS;EAGC,MAFd,KAAK,KAAK,UAAU;EAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDnC,SAAgB,wCACd,SACA,SACA,SACA,OACuB;CACvB,MAAM,QAAQ,SAAS,MAAM,QAAQ,EAAE,MAAM,QAAQ,EAAE,EAAE,OAAO,CAAC;CACjE,MAAM,SAAS,SAAS,MAAM,QAAQ,EAAE,MAAM,QAAQ,EAAE,EAAE,OAAO,CAAC;AAGlE,QAAO;EAAE;EAAO;EAAQ,MAFX,QAAQ;EAES;;;;;;;;;;;;;;;;;;;;;AAsBhC,SAAgB,sCACd,aACA,OACwD;CAExD,MAAM,SACJ,YAAY,KAAK,OAAO,YAAY,YAAY,SAAS,KAAK,MAC9D,YAAY,KAAK,OAAO,YAAY,YAAY,SAAS,KAAK,KAC1D,YAAY,MAAM,GAAG,GAAG,GACxB;AAEN,KAAI,OAAO,SAAS,EAClB,QAAO;EAAE,WAAW;EAAG,WAAW;EAAG,MAAM;EAAG;CAIhD,MAAM,UAAU,KAAK,MAAM,OAAO,SAAS,EAAE;CAC7C,IAAI,UAAU;CACd,IAAI,UAAU,OAAO;AAGrB,MAAK,IAAI,IAAI,GAAG,IAAI,SAAS,KAAK;EAChC,MAAM,KAAK,OAAO;EAClB,MAAM,KAAK,OAAO,IAAI;AACtB,MAAI,EAAE,MAAM,IACV;EAGF,MAAM,OAAO,SACX,CAAC,GAAG,IAAc,GAAG,GAAa,EAClC,CAAC,GAAG,IAAc,GAAG,GAAa,EAClC,EAAE,OAAO,CACV;AAED,MAAI,OAAO,QACT,WAAU;AAEZ,MAAI,OAAO,QACT,WAAU;;CAId,MAAM,YAAY;CAClB,MAAM,YAAY,YAAY,OAAO,oBAAoB,UAAU;CAGnE,MAAM,YAAY,YAAY;CAC9B,MAAM,YAAY,YAAY;AAG9B,QAAO;EAAE;EAAW;EAAW,MAFX,KAAK,KAAK,YAAY;EAEQ"}
1
+ {"version":3,"file":"geometry-measurements.js","names":[],"sources":["../../../../../src/deckgl/shapes/shared/utils/geometry-measurements.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 { distance, point } from '@turf/turf';\nimport type { DistanceUnit } from '@/shared/units';\n\n/**\n * Circle measurement result containing radius, diameter, and area.\n */\nexport interface CircleMeasurements {\n /** Radius in the specified units */\n radius: number;\n /** Diameter (radius * 2) in the specified units */\n diameter: number;\n /** Area (π * radius²) in the specified units squared */\n area: number;\n}\n\n/**\n * Ellipse measurement result containing semi-axes and area.\n */\nexport interface EllipseMeasurements {\n /** X semi-axis (horizontal radius) in the specified units */\n xSemiAxis: number;\n /** Y semi-axis (vertical radius) in the specified units */\n ySemiAxis: number;\n /** Major axis (full length of longer axis) in the specified units */\n majorAxis: number;\n /** Minor axis (full length of shorter axis) in the specified units */\n minorAxis: number;\n /** Area (π * xSemiAxis * ySemiAxis) in the specified units squared */\n area: number;\n}\n\n/**\n * Rectangle measurement result containing width, height, and area.\n */\nexport interface RectangleMeasurements {\n /** Width in the specified units */\n width: number;\n /** Height in the specified units */\n height: number;\n /** Area (width * height) in the specified units squared */\n area: number;\n}\n\n/**\n * Compute circle measurements from center and edge point.\n *\n * @param center - Center point as [longitude, latitude]\n * @param edgePoint - Point on the circle's edge as [longitude, latitude]\n * @param units - Distance units for the measurements\n * @returns Circle measurements including radius, diameter, and area\n *\n * @example\n * ```ts\n * const { radius, diameter, area } = computeCircleMeasurements(\n * [-122.4, 37.8],\n * [-122.3, 37.8],\n * 'kilometers'\n * );\n * ```\n */\nexport function computeCircleMeasurements(\n center: [number, number],\n edgePoint: [number, number],\n units: DistanceUnit,\n): CircleMeasurements {\n const radius = distance(center, edgePoint, { units });\n const diameter = radius * 2;\n const area = Math.PI * radius ** 2;\n\n return { radius, diameter, area };\n}\n\n/**\n * Compute ellipse measurements from center and semi-axis lengths.\n *\n * @param xSemiAxis - X semi-axis (horizontal radius) in the specified units\n * @param ySemiAxis - Y semi-axis (vertical radius) in the specified units\n * @returns Ellipse measurements including axes and area\n *\n * @example\n * ```ts\n * const { majorAxis, minorAxis, area } = computeEllipseMeasurementsFromAxes(100, 50);\n * ```\n */\nexport function computeEllipseMeasurementsFromAxes(\n xSemiAxis: number,\n ySemiAxis: number,\n): EllipseMeasurements {\n const majorAxis = Math.max(xSemiAxis, ySemiAxis) * 2;\n const minorAxis = Math.min(xSemiAxis, ySemiAxis) * 2;\n const area = Math.PI * xSemiAxis * ySemiAxis;\n\n return { xSemiAxis, ySemiAxis, majorAxis, minorAxis, area };\n}\n\n/**\n * Compute rectangle measurements from adjacent corner points.\n *\n * Uses geodesic distance calculations for accurate measurements on Earth's surface.\n * Corners should be provided in order: corner0 -> corner1 -> corner2 where:\n * - corner0 to corner1 defines one edge (width)\n * - corner1 to corner2 defines the adjacent edge (height)\n *\n * @param corner0 - First corner as [longitude, latitude]\n * @param corner1 - Adjacent corner as [longitude, latitude]\n * @param corner2 - Corner adjacent to corner1 as [longitude, latitude]\n * @param units - Distance units for the measurements\n * @returns Rectangle measurements including width, height, and area\n *\n * @example\n * ```ts\n * const coords = polygon.geometry.coordinates[0];\n * const { width, height, area } = computeRectangleMeasurementsFromCorners(\n * coords[0] as [number, number],\n * coords[1] as [number, number],\n * coords[2] as [number, number],\n * 'kilometers'\n * );\n * ```\n */\nexport function computeRectangleMeasurementsFromCorners(\n corner0: [number, number],\n corner1: [number, number],\n corner2: [number, number],\n units: DistanceUnit,\n): RectangleMeasurements {\n const width = distance(point(corner0), point(corner1), { units });\n const height = distance(point(corner1), point(corner2), { units });\n const area = width * height;\n\n return { width, height, area };\n}\n\n/**\n * Compute ellipse measurements from polygon coordinates.\n *\n * For an ellipse approximated as a polygon, calculates the major and minor axes\n * by measuring distances between opposite points on the perimeter.\n *\n * @param coordinates - Polygon ring coordinates as [[lon, lat], ...]\n * @param units - Distance units for the measurements\n * @returns Ellipse measurements including axes and area\n *\n * @example\n * ```ts\n * const coords = polygon.geometry.coordinates[0];\n * const { majorAxis, minorAxis, area } = computeEllipseMeasurementsFromPolygon(\n * coords as [number, number][],\n * 'kilometers'\n * );\n * ```\n */\nexport function computeEllipseMeasurementsFromPolygon(\n coordinates: [number, number][],\n units: DistanceUnit,\n): { majorAxis: number; minorAxis: number; area: number } {\n // Remove the closing point if it duplicates the first\n const points =\n coordinates[0]?.[0] === coordinates[coordinates.length - 1]?.[0] &&\n coordinates[0]?.[1] === coordinates[coordinates.length - 1]?.[1]\n ? coordinates.slice(0, -1)\n : coordinates;\n\n if (points.length < 4) {\n return { majorAxis: 0, minorAxis: 0, area: 0 };\n }\n\n // For an ellipse polygon, opposite points are at index i and i + n/2\n const halfLen = Math.floor(points.length / 2);\n let maxDist = 0;\n let minDist = Number.POSITIVE_INFINITY;\n\n // Sample several diameter measurements\n for (let i = 0; i < halfLen; i++) {\n const p1 = points[i];\n const p2 = points[i + halfLen];\n if (!(p1 && p2)) {\n continue;\n }\n\n const dist = distance(\n [p1[0] as number, p1[1] as number],\n [p2[0] as number, p2[1] as number],\n { units },\n );\n\n if (dist > maxDist) {\n maxDist = dist;\n }\n if (dist < minDist) {\n minDist = dist;\n }\n }\n\n const majorAxis = maxDist;\n const minorAxis = minDist === Number.POSITIVE_INFINITY ? maxDist : minDist;\n\n // Ellipse area = π × a × b (where a and b are semi-axes)\n const semiMajor = majorAxis / 2;\n const semiMinor = minorAxis / 2;\n const ellipseArea = Math.PI * semiMajor * semiMinor;\n\n return { majorAxis, minorAxis, area: ellipseArea };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,SAAgB,0BACd,QACA,WACA,OACoB;CACpB,MAAM,SAAS,SAAS,QAAQ,WAAW,EAAE,OAAO,CAAC;AAIrD,QAAO;EAAE;EAAQ,UAHA,SAAS;EAGC,MAFd,KAAK,KAAK,UAAU;EAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDnC,SAAgB,wCACd,SACA,SACA,SACA,OACuB;CACvB,MAAM,QAAQ,SAAS,MAAM,QAAQ,EAAE,MAAM,QAAQ,EAAE,EAAE,OAAO,CAAC;CACjE,MAAM,SAAS,SAAS,MAAM,QAAQ,EAAE,MAAM,QAAQ,EAAE,EAAE,OAAO,CAAC;AAGlE,QAAO;EAAE;EAAO;EAAQ,MAFX,QAAQ;EAES;;;;;;;;;;;;;;;;;;;;;AAsBhC,SAAgB,sCACd,aACA,OACwD;CAExD,MAAM,SACJ,YAAY,KAAK,OAAO,YAAY,YAAY,SAAS,KAAK,MAC9D,YAAY,KAAK,OAAO,YAAY,YAAY,SAAS,KAAK,KAC1D,YAAY,MAAM,GAAG,GAAG,GACxB;AAEN,KAAI,OAAO,SAAS,EAClB,QAAO;EAAE,WAAW;EAAG,WAAW;EAAG,MAAM;EAAG;CAIhD,MAAM,UAAU,KAAK,MAAM,OAAO,SAAS,EAAE;CAC7C,IAAI,UAAU;CACd,IAAI,UAAU,OAAO;AAGrB,MAAK,IAAI,IAAI,GAAG,IAAI,SAAS,KAAK;EAChC,MAAM,KAAK,OAAO;EAClB,MAAM,KAAK,OAAO,IAAI;AACtB,MAAI,EAAE,MAAM,IACV;EAGF,MAAM,OAAO,SACX,CAAC,GAAG,IAAc,GAAG,GAAa,EAClC,CAAC,GAAG,IAAc,GAAG,GAAa,EAClC,EAAE,OAAO,CACV;AAED,MAAI,OAAO,QACT,WAAU;AAEZ,MAAI,OAAO,QACT,WAAU;;CAId,MAAM,YAAY;CAClB,MAAM,YAAY,YAAY,OAAO,oBAAoB,UAAU;CAGnE,MAAM,YAAY,YAAY;CAC9B,MAAM,YAAY,YAAY;AAG9B,QAAO;EAAE;EAAW;EAAW,MAFX,KAAK,KAAK,YAAY;EAEQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"layer-config.js","names":[],"sources":["../../../../../src/deckgl/shapes/shared/utils/layer-config.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport {\n DEFAULT_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":[],"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 +1 @@
1
- {"version":3,"file":"mode-utils.js","names":[],"sources":["../../../../../src/deckgl/shapes/shared/utils/mode-utils.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport { 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\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 +1 @@
1
- {"version":3,"file":"pick-filtering.js","names":["filteredPicks: T[]"],"sources":["../../../../../src/deckgl/shapes/shared/utils/pick-filtering.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\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 * ```ts\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'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 * ```ts\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 +1 @@
1
- {"version":3,"file":"style-utils.js","names":[],"sources":["../../../../../src/deckgl/shapes/shared/utils/style-utils.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport {\n BASE_FILL_OPACITY,\n DASH_ARRAYS,\n DEFAULT_COLORS,\n DEFAULT_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\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 +1 @@
1
- {"version":3,"file":"fiber.js","names":[],"sources":["../../../src/deckgl/symbol-layer/fiber.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 { 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 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';\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 symbolLayer: SymbolLayerProps;\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAeA,OAAO,EAAE,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["defaultProps: DefaultProps<SymbolLayerProps>"],"sources":["../../../src/deckgl/symbol-layer/index.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 { IconLayer, type IconLayerProps } from '@deck.gl/layers';\nimport ms, { type SymbolOptions } from 'milsymbol';\nimport type {\n AccessorContext,\n AccessorFunction,\n DefaultProps,\n} from '@deck.gl/core';\n\nconst MilSymbol = ms.Symbol;\n\ntype _SymbolLayerProps<TData = unknown> = {\n /**\n * An accessor function that returns the SIDC for a given data point.\n */\n getSidc?: AccessorFunction<TData, string | number | bigint>;\n /**\n * An accessor function that returns symbol options for a given data point.\n */\n getSymbolOptions?: AccessorFunction<TData, SymbolOptions | null>;\n /**\n * Default symbol options to use when rendering symbols.\n */\n defaultSymbolOptions?: SymbolOptions;\n};\n\nexport type SymbolLayerProps<TData = unknown> = _SymbolLayerProps<TData> &\n Omit<\n IconLayerProps<TData>,\n 'getIcon' | 'getColor' | 'iconAtlas' | 'iconMapping'\n >;\n\nconst defaultProps: DefaultProps<SymbolLayerProps> = {\n // biome-ignore lint/suspicious/noExplicitAny: We don't know what the data type is.\n getSidc: { type: 'accessor', value: (x: any) => x.sidc },\n getSymbolOptions: { type: 'accessor', value: () => null },\n getSize: { type: 'accessor', value: 32 },\n defaultSymbolOptions: { type: 'object', value: {} },\n};\n\n/**\n * Provides a layer for rendering MIL-STD-2525 and APP-6 symbols.\n */\nexport class SymbolLayer<\n TData = unknown,\n // biome-ignore lint/complexity/noBannedTypes: Follows DeckGL format.\n TExtraProps extends {} = {},\n> extends IconLayer<TData, TExtraProps & Required<_SymbolLayerProps<TData>>> {\n static override defaultProps = defaultProps;\n static override layerName = 'SymbolLayer';\n\n /**\n * The default symbol options to use when rendering symbols.\n *\n * @internal\n */\n protected defaultOptions: SymbolOptions;\n\n /**\n * Caches the results of the icon generation\n *\n * @internal\n * @todo Use LRU cache to limit memory usage.\n */\n protected generationCache = new Map<string, string>();\n\n constructor(...args: Partial<SymbolLayerProps<TData>>[]) {\n // Props are frozen after the construction\n const customGetIcons = {\n getIcon: (data: TData, info: AccessorContext<TData>) =>\n this.generateIcon(data, info),\n } as IconLayerProps<TData>;\n\n // biome-ignore lint/suspicious/noExplicitAny: Needed to retype the layer.\n super(...(args as any), customGetIcons as any);\n\n // Default options need to be set in the constructor.\n this.defaultOptions = {\n size: 100,\n colorMode: 'Dark',\n ...this.props.defaultSymbolOptions,\n };\n }\n\n /**\n * Generates an icon using the provided SIDC and symbol options.\n *\n * @param data A point's data\n * @param info Contextual information about the point\n * @returns DeckGL Icon Object\n */\n protected generateIcon = (data: TData, info: AccessorContext<TData>) => {\n const { getSidc, getSymbolOptions } = this.props;\n const sidc = getSidc(data, info).toString();\n\n let currentSymbolOptions = this.defaultOptions;\n\n const localOptions = getSymbolOptions(data, info);\n\n if (localOptions) {\n currentSymbolOptions = {\n ...currentSymbolOptions,\n ...localOptions,\n };\n }\n\n const size = currentSymbolOptions.size as number;\n\n const cacheKey = this.generateCacheKey(sidc, currentSymbolOptions);\n\n if (this.generationCache.has(cacheKey)) {\n const cachedUrl = this.generationCache.get(cacheKey) as string;\n\n return {\n id: cacheKey,\n url: cachedUrl,\n height: size,\n width: size,\n };\n }\n\n const dataUrl = new MilSymbol(sidc, currentSymbolOptions).toDataURL();\n\n this.generationCache.set(cacheKey, dataUrl);\n\n const returnData = {\n id: cacheKey,\n url: dataUrl,\n height: size,\n width: size,\n };\n\n return returnData;\n };\n\n /**\n * Generates a cache key for the given SIDC and symbol options.\n *\n * @param sidc SIDC of the symbol\n * @param options Options used to generate the symbol\n * @returns String key for caching\n */\n protected generateCacheKey(sidc: string, options: SymbolOptions) {\n return `${sidc}-${JSON.stringify(options)}`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoBA,MAAM,YAAY,GAAG;AAuBrB,MAAMA,eAA+C;CAEnD,SAAS;EAAE,MAAM;EAAY,QAAQ,MAAW,EAAE;EAAM;CACxD,kBAAkB;EAAE,MAAM;EAAY,aAAa;EAAM;CACzD,SAAS;EAAE,MAAM;EAAY,OAAO;EAAI;CACxC,sBAAsB;EAAE,MAAM;EAAU,OAAO,EAAE;EAAE;CACpD;;;;AAKD,IAAa,cAAb,cAIU,UAAmE;CAC3E,OAAgB,eAAe;CAC/B,OAAgB,YAAY;;;;;;CAO5B,AAAU;;;;;;;CAQV,AAAU,kCAAkB,IAAI,KAAqB;CAErD,YAAY,GAAG,MAA0C;EAEvD,MAAM,iBAAiB,EACrB,UAAU,MAAa,SACrB,KAAK,aAAa,MAAM,KAAK,EAChC;AAGD,QAAM,GAAI,MAAc,eAAsB;AAG9C,OAAK,iBAAiB;GACpB,MAAM;GACN,WAAW;GACX,GAAG,KAAK,MAAM;GACf;;;;;;;;;CAUH,AAAU,gBAAgB,MAAa,SAAiC;EACtE,MAAM,EAAE,SAAS,qBAAqB,KAAK;EAC3C,MAAM,OAAO,QAAQ,MAAM,KAAK,CAAC,UAAU;EAE3C,IAAI,uBAAuB,KAAK;EAEhC,MAAM,eAAe,iBAAiB,MAAM,KAAK;AAEjD,MAAI,aACF,wBAAuB;GACrB,GAAG;GACH,GAAG;GACJ;EAGH,MAAM,OAAO,qBAAqB;EAElC,MAAM,WAAW,KAAK,iBAAiB,MAAM,qBAAqB;AAElE,MAAI,KAAK,gBAAgB,IAAI,SAAS,CAGpC,QAAO;GACL,IAAI;GACJ,KAJgB,KAAK,gBAAgB,IAAI,SAAS;GAKlD,QAAQ;GACR,OAAO;GACR;EAGH,MAAM,UAAU,IAAI,UAAU,MAAM,qBAAqB,CAAC,WAAW;AAErE,OAAK,gBAAgB,IAAI,UAAU,QAAQ;AAS3C,SAPmB;GACjB,IAAI;GACJ,KAAK;GACL,QAAQ;GACR,OAAO;GACR;;;;;;;;;CAYH,AAAU,iBAAiB,MAAc,SAAwB;AAC/D,SAAO,GAAG,KAAK,GAAG,KAAK,UAAU,QAAQ"}
1
+ {"version":3,"file":"index.js","names":["defaultProps: DefaultProps<SymbolLayerProps>"],"sources":["../../../src/deckgl/symbol-layer/index.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 { IconLayer, type IconLayerProps } from '@deck.gl/layers';\nimport ms, { type SymbolOptions } from 'milsymbol';\nimport type {\n AccessorContext,\n AccessorFunction,\n DefaultProps,\n} from '@deck.gl/core';\n\nconst MilSymbol = ms.Symbol;\n\ntype _SymbolLayerProps<TData = unknown> = {\n /**\n * An accessor function that returns the SIDC for a given data point.\n */\n getSidc?: AccessorFunction<TData, string | number | bigint>;\n /**\n * An accessor function that returns symbol options for a given data point.\n */\n getSymbolOptions?: AccessorFunction<TData, SymbolOptions | null>;\n /**\n * Default symbol options to use when rendering symbols.\n */\n defaultSymbolOptions?: SymbolOptions;\n};\n\nexport type SymbolLayerProps<TData = unknown> = _SymbolLayerProps<TData> &\n Omit<\n IconLayerProps<TData>,\n 'getIcon' | 'getColor' | 'iconAtlas' | 'iconMapping'\n >;\n\nconst defaultProps: DefaultProps<SymbolLayerProps> = {\n // biome-ignore lint/suspicious/noExplicitAny: We don't know what the data type is.\n getSidc: { type: 'accessor', value: (x: any) => x.sidc },\n getSymbolOptions: { type: 'accessor', value: () => null },\n getSize: { type: 'accessor', value: 32 },\n defaultSymbolOptions: { type: 'object', value: {} },\n};\n\n/**\n * Provides a layer for rendering MIL-STD-2525 and APP-6 symbols.\n */\nexport class SymbolLayer<\n TData = unknown,\n // biome-ignore lint/complexity/noBannedTypes: Follows DeckGL format.\n TExtraProps extends {} = {},\n> extends IconLayer<TData, TExtraProps & Required<_SymbolLayerProps<TData>>> {\n static override defaultProps = defaultProps;\n static override layerName = 'SymbolLayer';\n\n /**\n * The default symbol options to use when rendering symbols.\n *\n * @internal\n */\n protected defaultOptions: SymbolOptions;\n\n /**\n * Caches the results of the icon generation\n *\n * @internal\n * @todo Use LRU cache to limit memory usage.\n */\n protected generationCache = new Map<string, string>();\n\n constructor(...args: Partial<SymbolLayerProps<TData>>[]) {\n // Props are frozen after the construction\n const customGetIcons = {\n getIcon: (data: TData, info: AccessorContext<TData>) =>\n this.generateIcon(data, info),\n } as IconLayerProps<TData>;\n\n // biome-ignore lint/suspicious/noExplicitAny: Needed to retype the layer.\n super(...(args as any), customGetIcons as any);\n\n // Default options need to be set in the constructor.\n this.defaultOptions = {\n size: 100,\n colorMode: 'Dark',\n ...this.props.defaultSymbolOptions,\n };\n }\n\n /**\n * Generates an icon using the provided SIDC and symbol options.\n *\n * @param data A point's data\n * @param info Contextual information about the point\n * @returns DeckGL Icon Object\n */\n protected generateIcon = (data: TData, info: AccessorContext<TData>) => {\n const { getSidc, getSymbolOptions } = this.props;\n const sidc = getSidc(data, info).toString();\n\n let currentSymbolOptions = this.defaultOptions;\n\n const localOptions = getSymbolOptions(data, info);\n\n if (localOptions) {\n currentSymbolOptions = {\n ...currentSymbolOptions,\n ...localOptions,\n };\n }\n\n const size = currentSymbolOptions.size as number;\n\n const cacheKey = this.generateCacheKey(sidc, currentSymbolOptions);\n\n if (this.generationCache.has(cacheKey)) {\n const cachedUrl = this.generationCache.get(cacheKey) as string;\n\n return {\n id: cacheKey,\n url: cachedUrl,\n height: size,\n width: size,\n };\n }\n\n const dataUrl = new MilSymbol(sidc, currentSymbolOptions).toDataURL();\n\n this.generationCache.set(cacheKey, dataUrl);\n\n const returnData = {\n id: cacheKey,\n url: dataUrl,\n height: size,\n width: size,\n };\n\n return returnData;\n };\n\n /**\n * Generates a cache key for the given SIDC and symbol options.\n *\n * @param sidc SIDC of the symbol\n * @param options Options used to generate the symbol\n * @returns String key for caching\n */\n protected generateCacheKey(sidc: string, options: SymbolOptions) {\n return `${sidc}-${JSON.stringify(options)}`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoBA,MAAM,YAAY,GAAG;AAuBrB,MAAMA,eAA+C;CAEnD,SAAS;EAAE,MAAM;EAAY,QAAQ,MAAW,EAAE;EAAM;CACxD,kBAAkB;EAAE,MAAM;EAAY,aAAa;EAAM;CACzD,SAAS;EAAE,MAAM;EAAY,OAAO;EAAI;CACxC,sBAAsB;EAAE,MAAM;EAAU,OAAO,EAAE;EAAE;CACpD;;;;AAKD,IAAa,cAAb,cAIU,UAAmE;CAC3E,OAAgB,eAAe;CAC/B,OAAgB,YAAY;;;;;;CAO5B,AAAU;;;;;;;CAQV,AAAU,kCAAkB,IAAI,KAAqB;CAErD,YAAY,GAAG,MAA0C;EAEvD,MAAM,iBAAiB,EACrB,UAAU,MAAa,SACrB,KAAK,aAAa,MAAM,KAAK,EAChC;AAGD,QAAM,GAAI,MAAc,eAAsB;AAG9C,OAAK,iBAAiB;GACpB,MAAM;GACN,WAAW;GACX,GAAG,KAAK,MAAM;GACf;;;;;;;;;CAUH,AAAU,gBAAgB,MAAa,SAAiC;EACtE,MAAM,EAAE,SAAS,qBAAqB,KAAK;EAC3C,MAAM,OAAO,QAAQ,MAAM,KAAK,CAAC,UAAU;EAE3C,IAAI,uBAAuB,KAAK;EAEhC,MAAM,eAAe,iBAAiB,MAAM,KAAK;AAEjD,MAAI,aACF,wBAAuB;GACrB,GAAG;GACH,GAAG;GACJ;EAGH,MAAM,OAAO,qBAAqB;EAElC,MAAM,WAAW,KAAK,iBAAiB,MAAM,qBAAqB;AAElE,MAAI,KAAK,gBAAgB,IAAI,SAAS,CAGpC,QAAO;GACL,IAAI;GACJ,KAJgB,KAAK,gBAAgB,IAAI,SAAS;GAKlD,QAAQ;GACR,OAAO;GACR;EAGH,MAAM,UAAU,IAAI,UAAU,MAAM,qBAAqB,CAAC,WAAW;AAErE,OAAK,gBAAgB,IAAI,UAAU,QAAQ;AAS3C,SAPmB;GACjB,IAAI;GACJ,KAAK;GACL,QAAQ;GACR,OAAO;GACR;;;;;;;;;CAYH,AAAU,iBAAiB,MAAc,SAAwB;AAC/D,SAAO,GAAG,KAAK,GAAG,KAAK,UAAU,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"character-sets.js","names":[],"sources":["../../../src/deckgl/text-layer/character-sets.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\nconst ALL_NUMBERS = '1234567890';\n\nconst ASCII_LETTERS_LOWERCASE = 'abcdefghijklmnopqrstuvwxyz';\nconst ASCII_LETTERS_UPPERCASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nconst ASCII_SYMBOLS = ' !\"#$%&\\'()*+,-./:;<=>?@[]^_`{|}~';\n\nconst ASCII_LETTERS = `${ASCII_LETTERS_LOWERCASE}${ASCII_LETTERS_UPPERCASE}`;\nconst ASCII_ALPHA_NUMERIC = `${ASCII_LETTERS}${ALL_NUMBERS}`;\nconst ASCII_ALL = `${ASCII_LETTERS}${ALL_NUMBERS}${ASCII_SYMBOLS}`;\n\nconst AUTO = 'auto';\n\nconst LATIN_LETTERS_LOWERCASE = 'àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿß';\nconst LATIN_LETTERS_UPPERCASE = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ';\nconst LATIN_SYMBOLS = ' ¡¿¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿×÷';\n\nconst LATIN_LETTERS = `${LATIN_LETTERS_LOWERCASE}${LATIN_LETTERS_UPPERCASE}`;\nconst LATIN_ALPHA_NUMERIC = `${LATIN_LETTERS}${ALL_NUMBERS}`;\nconst LATIN_ALL = `${LATIN_LETTERS}${ALL_NUMBERS}${LATIN_SYMBOLS}`;\n\nconst EXPANDED = `${ASCII_ALL}${LATIN_ALL}`;\n\nexport type CharacterSetsKeys = keyof typeof CHARACTER_SETS;\n\n/**\n * Predefined character sets for TextLayer.\n *\n * Use smaller character sets (ASCII_ALL, ASCII_ALPHA_NUMERIC) for better performance,\n * or use AUTO for dynamic optimization based on content.\n * EXPANDED includes ASCII and Latin characters with diacritics for international text.\n */\nexport const CHARACTER_SETS = Object.freeze({\n ALL_NUMBERS,\n\n ASCII_ALL,\n ASCII_ALPHA_NUMERIC,\n ASCII_LETTERS,\n ASCII_LETTERS_LOWERCASE,\n ASCII_LETTERS_UPPERCASE,\n ASCII_SYMBOLS,\n\n AUTO,\n EXPANDED,\n\n LATIN_ALL,\n LATIN_ALPHA_NUMERIC,\n LATIN_LETTERS,\n LATIN_LETTERS_LOWERCASE,\n LATIN_LETTERS_UPPERCASE,\n LATIN_SYMBOLS,\n} as const);\n"],"mappings":";;;;;;;;;;;;;;AAYA,MAAM,cAAc;AAEpB,MAAM,0BAA0B;AAChC,MAAM,0BAA0B;AAChC,MAAM,gBAAgB;AAEtB,MAAM,gBAAgB,GAAG,0BAA0B;AACnD,MAAM,sBAAsB,GAAG,gBAAgB;AAC/C,MAAM,YAAY,GAAG,gBAAgB,cAAc;AAEnD,MAAM,OAAO;AAEb,MAAM,0BAA0B;AAChC,MAAM,0BAA0B;AAChC,MAAM,gBAAgB;AAEtB,MAAM,gBAAgB,GAAG,0BAA0B;AACnD,MAAM,sBAAsB,GAAG,gBAAgB;AAC/C,MAAM,YAAY,GAAG,gBAAgB,cAAc;AAEnD,MAAM,WAAW,GAAG,YAAY;;;;;;;;AAWhC,MAAa,iBAAiB,OAAO,OAAO;CAC1C;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACD,CAAU"}
1
+ {"version":3,"file":"character-sets.js","names":[],"sources":["../../../src/deckgl/text-layer/character-sets.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\nconst ALL_NUMBERS = '1234567890';\n\nconst ASCII_LETTERS_LOWERCASE = 'abcdefghijklmnopqrstuvwxyz';\nconst ASCII_LETTERS_UPPERCASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nconst ASCII_SYMBOLS = ' !\"#$%&\\'()*+,-./:;<=>?@[]^_`{|}~';\n\nconst ASCII_LETTERS = `${ASCII_LETTERS_LOWERCASE}${ASCII_LETTERS_UPPERCASE}`;\nconst ASCII_ALPHA_NUMERIC = `${ASCII_LETTERS}${ALL_NUMBERS}`;\nconst ASCII_ALL = `${ASCII_LETTERS}${ALL_NUMBERS}${ASCII_SYMBOLS}`;\n\nconst AUTO = 'auto';\n\nconst LATIN_LETTERS_LOWERCASE = 'àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿß';\nconst LATIN_LETTERS_UPPERCASE = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ';\nconst LATIN_SYMBOLS = ' ¡¿¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿×÷';\n\nconst LATIN_LETTERS = `${LATIN_LETTERS_LOWERCASE}${LATIN_LETTERS_UPPERCASE}`;\nconst LATIN_ALPHA_NUMERIC = `${LATIN_LETTERS}${ALL_NUMBERS}`;\nconst LATIN_ALL = `${LATIN_LETTERS}${ALL_NUMBERS}${LATIN_SYMBOLS}`;\n\nconst EXPANDED = `${ASCII_ALL}${LATIN_ALL}`;\n\nexport type CharacterSetsKeys = keyof typeof CHARACTER_SETS;\n\n/**\n * Predefined character sets for TextLayer.\n *\n * Use smaller character sets (ASCII_ALL, ASCII_ALPHA_NUMERIC) for better performance,\n * or use AUTO for dynamic optimization based on content.\n * EXPANDED includes ASCII and Latin characters with diacritics for international text.\n */\nexport const CHARACTER_SETS = Object.freeze({\n ALL_NUMBERS,\n\n ASCII_ALL,\n ASCII_ALPHA_NUMERIC,\n ASCII_LETTERS,\n ASCII_LETTERS_LOWERCASE,\n ASCII_LETTERS_UPPERCASE,\n ASCII_SYMBOLS,\n\n AUTO,\n EXPANDED,\n\n LATIN_ALL,\n LATIN_ALPHA_NUMERIC,\n LATIN_LETTERS,\n LATIN_LETTERS_LOWERCASE,\n LATIN_LETTERS_UPPERCASE,\n LATIN_SYMBOLS,\n} as const);\n"],"mappings":";;;;;;;;;;;;;;AAYA,MAAM,cAAc;AAEpB,MAAM,0BAA0B;AAChC,MAAM,0BAA0B;AAChC,MAAM,gBAAgB;AAEtB,MAAM,gBAAgB,GAAG,0BAA0B;AACnD,MAAM,sBAAsB,GAAG,gBAAgB;AAC/C,MAAM,YAAY,GAAG,gBAAgB,cAAc;AAEnD,MAAM,OAAO;AAEb,MAAM,0BAA0B;AAChC,MAAM,0BAA0B;AAChC,MAAM,gBAAgB;AAEtB,MAAM,gBAAgB,GAAG,0BAA0B;AACnD,MAAM,sBAAsB,GAAG,gBAAgB;AAC/C,MAAM,YAAY,GAAG,gBAAgB,cAAc;AAEnD,MAAM,WAAW,GAAG,YAAY;;;;;;;;AAWhC,MAAa,iBAAiB,OAAO,OAAO;CAC1C;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACD,CAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"default-settings.js","names":["defaultSettings: Partial<DglTextLayerProps>"],"sources":["../../../src/deckgl/text-layer/default-settings.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 { DEFAULT_TEXT_STYLE } from '../text-settings';\nimport type { TextLayerProps as DglTextLayerProps } from '@deck.gl/layers';\n\nexport const defaultSettings: Partial<DglTextLayerProps> = {\n ...DEFAULT_TEXT_STYLE,\n fontFamily: 'system-ui, sans-serif',\n getAlignmentBaseline: 'center',\n getTextAnchor: 'middle',\n lineHeight: 1,\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,MAAaA,kBAA8C;CACzD,GAAG;CACH,YAAY;CACZ,sBAAsB;CACtB,eAAe;CACf,YAAY;CACb"}
1
+ {"version":3,"file":"default-settings.js","names":["defaultSettings: Partial<DglTextLayerProps>"],"sources":["../../../src/deckgl/text-layer/default-settings.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 { DEFAULT_TEXT_STYLE } from '../text-settings';\nimport type { TextLayerProps as DglTextLayerProps } from '@deck.gl/layers';\n\nexport const defaultSettings: Partial<DglTextLayerProps> = {\n ...DEFAULT_TEXT_STYLE,\n fontFamily: 'system-ui, sans-serif',\n getAlignmentBaseline: 'center',\n getTextAnchor: 'middle',\n lineHeight: 1,\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,MAAaA,kBAA8C;CACzD,GAAG;CACH,YAAY;CACZ,sBAAsB;CACtB,eAAe;CACf,YAAY;CACb"}
@@ -1 +1 @@
1
- {"version":3,"file":"fiber.js","names":[],"sources":["../../../src/deckgl/text-layer/fiber.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 { extend } from '@deckgl-fiber-renderer/dom';\nimport { TextLayer, type TextLayerProps } from './index';\n\nextend({ TextLayer });\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 styled text layer for DeckGL Fiber with enhanced styling capabilities.\n *\n * Provides customizable font styling, text outline support, and extended character sets.\n *\n * @example\n * ```tsx\n * <textLayer\n * id=\"my-text\"\n * data={textData}\n * getText={d => d.text}\n * getPosition={d => d.position}\n * getSize={12}\n * fontWeight={500}\n * />\n * ```\n */\n textLayer: TextLayerProps;\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAeA,OAAO,EAAE,WAAW,CAAC"}
1
+ {"version":3,"file":"fiber.js","names":[],"sources":["../../../src/deckgl/text-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 { TextLayer, type TextLayerProps } from './index';\n\nextend({ TextLayer });\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 styled text layer for DeckGL Fiber with enhanced styling capabilities.\n *\n * Provides customizable font styling, text outline support, and extended character sets.\n *\n * @example\n * ```tsx\n * <textLayer\n * id=\"my-text\"\n * data={textData}\n * getText={d => d.text}\n * getPosition={d => d.position}\n * getSize={12}\n * fontWeight={500}\n * />\n * ```\n */\n textLayer: TextLayerProps;\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAeA,OAAO,EAAE,WAAW,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["DglTextLayer"],"sources":["../../../src/deckgl/text-layer/index.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 {\n TextLayer as DglTextLayer,\n type TextLayerProps as DglTextLayerProps,\n} from '@deck.gl/layers';\nimport { CHARACTER_SETS, type CharacterSetsKeys } from './character-sets.js';\nimport { defaultSettings } from './default-settings.js';\nimport type { LiteralUnion } from 'type-fest';\n\nexport interface TextLayerProps<TData = unknown>\n extends DglTextLayerProps<TData> {\n // A union type that preserves autocompletion for CharacterSetsKeys while allowing any string.\n characterSet?: LiteralUnion<CharacterSetsKeys, string>;\n}\n\n/**\n * A styled text layer that extends Deck.gl's TextLayer with enhanced styling capabilities.\n *\n * This layer provides:\n * - Customizable font styling (size, weight, family, line height)\n * - Text outline support\n * - Extended character set support\n * - Consistent styling based on design specifications\n *\n * Can be used directly with Deck.gl or as a JSX element with React Fiber:\n * - React Fiber: `<textLayer id=\"text\" data={[...]} ... />`\n * - Direct: `new TextLayer({ id: 'text', data: [...], ... })`\n */\nexport class TextLayer<TData = unknown> extends DglTextLayer<TData> {\n static CHARACTER_SETS = CHARACTER_SETS;\n\n static override layerName = 'textLayer';\n\n constructor(props: TextLayerProps<TData>) {\n const {\n characterSet = CHARACTER_SETS.EXPANDED,\n fontSettings,\n ...rest\n } = props;\n\n super({\n // set opinionated defaults\n ...defaultSettings,\n\n // user props override defaults\n ...rest,\n\n // handle special characterSet logic\n characterSet:\n CHARACTER_SETS[characterSet as CharacterSetsKeys] ?? characterSet,\n\n fontSettings: {\n // merge fontSettings\n ...defaultSettings.fontSettings,\n\n // user props override defaults\n ...fontSettings,\n },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,IAAa,YAAb,cAAgDA,YAAoB;CAClE,OAAO,iBAAiB;CAExB,OAAgB,YAAY;CAE5B,YAAY,OAA8B;EACxC,MAAM,EACJ,eAAe,eAAe,UAC9B,cACA,GAAG,SACD;AAEJ,QAAM;GAEJ,GAAG;GAGH,GAAG;GAGH,cACE,eAAe,iBAAsC;GAEvD,cAAc;IAEZ,GAAG,gBAAgB;IAGnB,GAAG;IACJ;GACF,CAAC"}
1
+ {"version":3,"file":"index.js","names":["DglTextLayer"],"sources":["../../../src/deckgl/text-layer/index.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 TextLayer as DglTextLayer,\n type TextLayerProps as DglTextLayerProps,\n} from '@deck.gl/layers';\nimport { CHARACTER_SETS, type CharacterSetsKeys } from './character-sets.js';\nimport { defaultSettings } from './default-settings.js';\nimport type { LiteralUnion } from 'type-fest';\n\nexport interface TextLayerProps<TData = unknown>\n extends DglTextLayerProps<TData> {\n // A union type that preserves autocompletion for CharacterSetsKeys while allowing any string.\n characterSet?: LiteralUnion<CharacterSetsKeys, string>;\n}\n\n/**\n * A styled text layer that extends Deck.gl's TextLayer with enhanced styling capabilities.\n *\n * This layer provides:\n * - Customizable font styling (size, weight, family, line height)\n * - Text outline support\n * - Extended character set support\n * - Consistent styling based on design specifications\n *\n * Can be used directly with Deck.gl or as a JSX element with React Fiber:\n * - React Fiber: `<textLayer id=\"text\" data={[...]} ... />`\n * - Direct: `new TextLayer({ id: 'text', data: [...], ... })`\n */\nexport class TextLayer<TData = unknown> extends DglTextLayer<TData> {\n static CHARACTER_SETS = CHARACTER_SETS;\n\n static override layerName = 'textLayer';\n\n constructor(props: TextLayerProps<TData>) {\n const {\n characterSet = CHARACTER_SETS.EXPANDED,\n fontSettings,\n ...rest\n } = props;\n\n super({\n // set opinionated defaults\n ...defaultSettings,\n\n // user props override defaults\n ...rest,\n\n // handle special characterSet logic\n characterSet:\n CHARACTER_SETS[characterSet as CharacterSetsKeys] ?? characterSet,\n\n fontSettings: {\n // merge fontSettings\n ...defaultSettings.fontSettings,\n\n // user props override defaults\n ...fontSettings,\n },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,IAAa,YAAb,cAAgDA,YAAoB;CAClE,OAAO,iBAAiB;CAExB,OAAgB,YAAY;CAE5B,YAAY,OAA8B;EACxC,MAAM,EACJ,eAAe,eAAe,UAC9B,cACA,GAAG,SACD;AAEJ,QAAM;GAEJ,GAAG;GAGH,GAAG;GAGH,cACE,eAAe,iBAAsC;GAEvD,cAAc;IAEZ,GAAG,gBAAgB;IAGnB,GAAG;IACJ;GACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"text-settings.js","names":["SDF_FONT_SETTINGS: NonNullable<TextLayerProps['fontSettings']>","DEFAULT_TEXT_COLOR: Color","DEFAULT_TEXT_OUTLINE_COLOR: Color"],"sources":["../../src/deckgl/text-settings.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 type { Color } from '@deck.gl/core';\nimport type { TextLayerProps } from '@deck.gl/layers';\n\n/**\n * Shared font settings for SDF (Signed Distance Field) text rendering.\n *\n * These settings are optimized for cross-platform legibility, particularly\n * on Windows machines where text can appear thin/hard to read without\n * proper SDF configuration.\n *\n * Used by:\n * - TextLayer component\n * - Shape label layers\n * - Draw/edit mode tooltips\n */\nexport const SDF_FONT_SETTINGS: NonNullable<TextLayerProps['fontSettings']> = {\n fontSize: 22,\n sdf: true,\n buffer: 10,\n cutoff: 0.19,\n radius: 10,\n smoothing: 0.1,\n};\n\n/**\n * Default text size in pixels for deck.gl TextLayer.\n * Works in conjunction with SDF_FONT_SETTINGS for proper rendering.\n */\nexport const DEFAULT_TEXT_SIZE = 12;\n\n/**\n * Default text color (white) for deck.gl TextLayer.\n */\nexport const DEFAULT_TEXT_COLOR: Color = [255, 255, 255, 255];\n\n/**\n * Default text outline color (black) for deck.gl TextLayer.\n */\nexport const DEFAULT_TEXT_OUTLINE_COLOR: Color = [0, 0, 0, 255];\n\n/**\n * Default text outline width in pixels for deck.gl TextLayer.\n */\nexport const DEFAULT_TEXT_OUTLINE_WIDTH = 2;\n\n/**\n * Default font weight for deck.gl TextLayer.\n */\nexport const DEFAULT_FONT_WEIGHT = 500;\n\n/**\n * Combined default text style settings for deck.gl TextLayer.\n * Spread this object into TextLayer props for consistent cross-platform rendering.\n *\n * Includes: fontSettings, fontWeight, getSize, getColor, outlineWidth, outlineColor\n */\nexport const DEFAULT_TEXT_STYLE = {\n fontSettings: { ...SDF_FONT_SETTINGS },\n fontWeight: DEFAULT_FONT_WEIGHT,\n getSize: DEFAULT_TEXT_SIZE,\n getColor: DEFAULT_TEXT_COLOR,\n outlineWidth: DEFAULT_TEXT_OUTLINE_WIDTH,\n outlineColor: DEFAULT_TEXT_OUTLINE_COLOR,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAaA,oBAAiE;CAC5E,UAAU;CACV,KAAK;CACL,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,WAAW;CACZ;;;;;AAMD,MAAa,oBAAoB;;;;AAKjC,MAAaC,qBAA4B;CAAC;CAAK;CAAK;CAAK;CAAI;;;;AAK7D,MAAaC,6BAAoC;CAAC;CAAG;CAAG;CAAG;CAAI;;;;AAK/D,MAAa,6BAA6B;;;;AAK1C,MAAa,sBAAsB;;;;;;;AAQnC,MAAa,qBAAqB;CAChC,cAAc,EAAE,GAAG,mBAAmB;CACtC,YAAY;CACZ,SAAS;CACT,UAAU;CACV,cAAc;CACd,cAAc;CACf"}
1
+ {"version":3,"file":"text-settings.js","names":["SDF_FONT_SETTINGS: NonNullable<TextLayerProps['fontSettings']>","DEFAULT_TEXT_COLOR: Color","DEFAULT_TEXT_OUTLINE_COLOR: Color"],"sources":["../../src/deckgl/text-settings.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 type { Color } from '@deck.gl/core';\nimport type { TextLayerProps } from '@deck.gl/layers';\n\n/**\n * Shared font settings for SDF (Signed Distance Field) text rendering.\n *\n * These settings are optimized for cross-platform legibility, particularly\n * on Windows machines where text can appear thin/hard to read without\n * proper SDF configuration.\n *\n * Used by:\n * - TextLayer component\n * - Shape label layers\n * - Draw/edit mode tooltips\n */\nexport const SDF_FONT_SETTINGS: NonNullable<TextLayerProps['fontSettings']> = {\n fontSize: 22,\n sdf: true,\n buffer: 10,\n cutoff: 0.19,\n radius: 10,\n smoothing: 0.1,\n};\n\n/**\n * Default text size in pixels for deck.gl TextLayer.\n * Works in conjunction with SDF_FONT_SETTINGS for proper rendering.\n */\nexport const DEFAULT_TEXT_SIZE = 12;\n\n/**\n * Default text color (white) for deck.gl TextLayer.\n */\nexport const DEFAULT_TEXT_COLOR: Color = [255, 255, 255, 255];\n\n/**\n * Default text outline color (black) for deck.gl TextLayer.\n */\nexport const DEFAULT_TEXT_OUTLINE_COLOR: Color = [0, 0, 0, 255];\n\n/**\n * Default text outline width in pixels for deck.gl TextLayer.\n */\nexport const DEFAULT_TEXT_OUTLINE_WIDTH = 2;\n\n/**\n * Default font weight for deck.gl TextLayer.\n */\nexport const DEFAULT_FONT_WEIGHT = 500;\n\n/**\n * Combined default text style settings for deck.gl TextLayer.\n * Spread this object into TextLayer props for consistent cross-platform rendering.\n *\n * Includes: fontSettings, fontWeight, getSize, getColor, outlineWidth, outlineColor\n */\nexport const DEFAULT_TEXT_STYLE = {\n fontSettings: { ...SDF_FONT_SETTINGS },\n fontWeight: DEFAULT_FONT_WEIGHT,\n getSize: DEFAULT_TEXT_SIZE,\n getColor: DEFAULT_TEXT_COLOR,\n outlineWidth: DEFAULT_TEXT_OUTLINE_WIDTH,\n outlineColor: DEFAULT_TEXT_OUTLINE_COLOR,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAaA,oBAAiE;CAC5E,UAAU;CACV,KAAK;CACL,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,WAAW;CACZ;;;;;AAMD,MAAa,oBAAoB;;;;AAKjC,MAAaC,qBAA4B;CAAC;CAAK;CAAK;CAAK;CAAI;;;;AAK7D,MAAaC,6BAAoC;CAAC;CAAG;CAAG;CAAG;CAAI;;;;AAK/D,MAAa,6BAA6B;;;;AAK1C,MAAa,sBAAsB;;;;;;;AAQnC,MAAa,qBAAqB;CAChC,cAAc,EAAE,GAAG,mBAAmB;CACtC,YAAY;CACZ,SAAS;CACT,UAAU;CACV,cAAc;CACd,cAAc;CACf"}
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","names":[],"sources":["../../src/map-cursor/events.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/**\n * Event keys for map cursor state changes.\n * These events are used for communication between cursor stores and consumers.\n */\nexport const MapCursorEvents = {\n /** Emitted when a component requests a cursor change */\n changeRequest: 'cursor:change-request',\n /** Emitted when the cursor has been changed */\n changed: 'cursor:changed',\n /** Emitted when a cursor change request is rejected */\n rejected: 'cursor:rejected',\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA,MAAa,kBAAkB;CAE7B,eAAe;CAEf,SAAS;CAET,UAAU;CACX"}
1
+ {"version":3,"file":"events.js","names":[],"sources":["../../src/map-cursor/events.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 * Event keys for map cursor state changes.\n * These events are used for communication between cursor stores and consumers.\n */\nexport const MapCursorEvents = {\n /** Emitted when a component requests a cursor change */\n changeRequest: 'cursor:change-request',\n /** Emitted when the cursor has been changed */\n changed: 'cursor:changed',\n /** Emitted when a cursor change request is rejected */\n rejected: 'cursor:rejected',\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA,MAAa,kBAAkB;CAE7B,eAAe;CAEf,SAAS;CAET,UAAU;CACX"}