@accelint/map-toolkit 0.3.1 → 0.4.1

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 (104) hide show
  1. package/CHANGELOG.md +49 -24
  2. package/catalog-info.yaml +5 -7
  3. package/dist/cursor-coordinates/index.d.ts +14 -3
  4. package/dist/cursor-coordinates/index.js +16 -3
  5. package/dist/cursor-coordinates/use-cursor-coordinates.d.ts +20 -6
  6. package/dist/cursor-coordinates/use-cursor-coordinates.js +247 -128
  7. package/dist/cursor-coordinates/use-cursor-coordinates.js.map +1 -1
  8. package/dist/deckgl/base-map/constants.d.ts +14 -12
  9. package/dist/deckgl/base-map/constants.js +26 -12
  10. package/dist/deckgl/base-map/constants.js.map +1 -1
  11. package/dist/deckgl/base-map/events.d.ts +6 -4
  12. package/dist/deckgl/base-map/events.js +18 -4
  13. package/dist/deckgl/base-map/events.js.map +1 -1
  14. package/dist/deckgl/base-map/index.d.ts +45 -18
  15. package/dist/deckgl/base-map/index.js +216 -148
  16. package/dist/deckgl/base-map/index.js.map +1 -1
  17. package/dist/deckgl/base-map/provider.d.ts +48 -32
  18. package/dist/deckgl/base-map/provider.js +122 -11
  19. package/dist/deckgl/base-map/provider.js.map +1 -1
  20. package/dist/deckgl/base-map/types.d.ts +49 -39
  21. package/dist/deckgl/base-map/types.js +11 -2
  22. package/dist/deckgl/index.d.ts +18 -13
  23. package/dist/deckgl/index.js +19 -6
  24. package/dist/deckgl/symbol-layer/fiber.d.ts +21 -10
  25. package/dist/deckgl/symbol-layer/fiber.js +18 -3
  26. package/dist/deckgl/symbol-layer/fiber.js.map +1 -1
  27. package/dist/deckgl/symbol-layer/index.d.ts +68 -54
  28. package/dist/deckgl/symbol-layer/index.js +105 -85
  29. package/dist/deckgl/symbol-layer/index.js.map +1 -1
  30. package/dist/deckgl/text-layer/character-sets.d.ts +19 -17
  31. package/dist/deckgl/text-layer/character-sets.js +40 -19
  32. package/dist/deckgl/text-layer/character-sets.js.map +1 -1
  33. package/dist/deckgl/text-layer/default-settings.d.ts +16 -2
  34. package/dist/deckgl/text-layer/default-settings.js +42 -18
  35. package/dist/deckgl/text-layer/default-settings.js.map +1 -1
  36. package/dist/deckgl/text-layer/fiber.d.ts +38 -27
  37. package/dist/deckgl/text-layer/fiber.js +18 -3
  38. package/dist/deckgl/text-layer/fiber.js.map +1 -1
  39. package/dist/deckgl/text-layer/index.d.ts +39 -25
  40. package/dist/deckgl/text-layer/index.js +47 -29
  41. package/dist/deckgl/text-layer/index.js.map +1 -1
  42. package/dist/decorators/deckgl.d.ts +16 -2
  43. package/dist/decorators/deckgl.js +25 -7
  44. package/dist/decorators/deckgl.js.map +1 -1
  45. package/dist/map-cursor/events.d.ts +16 -0
  46. package/dist/map-cursor/events.js +27 -0
  47. package/dist/map-cursor/events.js.map +1 -0
  48. package/dist/map-cursor/index.d.ts +17 -0
  49. package/dist/map-cursor/index.js +18 -0
  50. package/dist/map-cursor/store.d.ts +93 -0
  51. package/dist/map-cursor/store.js +351 -0
  52. package/dist/map-cursor/store.js.map +1 -0
  53. package/dist/map-cursor/types.d.ts +81 -0
  54. package/dist/map-cursor/types.js +12 -0
  55. package/dist/map-cursor/use-map-cursor.d.ts +99 -0
  56. package/dist/map-cursor/use-map-cursor.js +116 -0
  57. package/dist/map-cursor/use-map-cursor.js.map +1 -0
  58. package/dist/map-mode/events.d.ts +11 -9
  59. package/dist/map-mode/events.js +43 -9
  60. package/dist/map-mode/events.js.map +1 -1
  61. package/dist/map-mode/index.d.ts +17 -6
  62. package/dist/map-mode/index.js +18 -5
  63. package/dist/map-mode/store.d.ts +26 -3
  64. package/dist/map-mode/store.js +329 -265
  65. package/dist/map-mode/store.js.map +1 -1
  66. package/dist/map-mode/types.d.ts +49 -35
  67. package/dist/map-mode/types.js +11 -2
  68. package/dist/map-mode/use-map-mode.d.ts +21 -7
  69. package/dist/map-mode/use-map-mode.js +66 -23
  70. package/dist/map-mode/use-map-mode.js.map +1 -1
  71. package/dist/maplibre/constants.d.ts +10 -8
  72. package/dist/maplibre/constants.js +22 -8
  73. package/dist/maplibre/constants.js.map +1 -1
  74. package/dist/maplibre/hooks/use-maplibre.d.ts +17 -2
  75. package/dist/maplibre/hooks/use-maplibre.js +77 -31
  76. package/dist/maplibre/hooks/use-maplibre.js.map +1 -1
  77. package/dist/maplibre/index.d.ts +15 -3
  78. package/dist/maplibre/index.js +17 -4
  79. package/dist/viewport/constants.d.ts +8 -6
  80. package/dist/viewport/constants.js +20 -6
  81. package/dist/viewport/constants.js.map +1 -1
  82. package/dist/viewport/index.d.ts +18 -13
  83. package/dist/viewport/index.js +19 -6
  84. package/dist/viewport/types.d.ts +27 -17
  85. package/dist/viewport/types.js +11 -2
  86. package/dist/viewport/use-viewport-state.d.ts +29 -14
  87. package/dist/viewport/use-viewport-state.js +200 -87
  88. package/dist/viewport/use-viewport-state.js.map +1 -1
  89. package/dist/viewport/utils.d.ts +25 -10
  90. package/dist/viewport/utils.js +67 -37
  91. package/dist/viewport/utils.js.map +1 -1
  92. package/dist/viewport/viewport-size.d.ts +27 -15
  93. package/dist/viewport/viewport-size.js +54 -11
  94. package/dist/viewport/viewport-size.js.map +1 -1
  95. package/package.json +107 -78
  96. package/dist/cursor-coordinates/index.js.map +0 -1
  97. package/dist/deckgl/base-map/types.js.map +0 -1
  98. package/dist/deckgl/index.js.map +0 -1
  99. package/dist/map-mode/index.js.map +0 -1
  100. package/dist/map-mode/types.js.map +0 -1
  101. package/dist/maplibre/index.js.map +0 -1
  102. package/dist/metafile-esm.json +0 -1
  103. package/dist/viewport/index.js.map +0 -1
  104. package/dist/viewport/types.js.map +0 -1
@@ -1,18 +1,129 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import 'client-only';
3
- import { createContext, useEffect } from 'react';
4
- import { clearMapModeState } from '../../map-mode/store.js';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
5
12
 
13
+
14
+ 'use client';
15
+
16
+ import { clearMapModeState } from "../../map-mode/store.js";
17
+ import { clearCursorState } from "../../map-cursor/store.js";
18
+ import { createContext, useEffect } from "react";
19
+ import { jsx } from "react/jsx-runtime";
20
+
21
+ //#region src/deckgl/base-map/provider.tsx
22
+ /**
23
+ * React context for map ID.
24
+ * Use the `useMapMode` hook to access the map mode state.
25
+ */
6
26
  const MapContext = createContext(null);
27
+ /**
28
+ * Provider component for managing map modes with ownership and authorization.
29
+ *
30
+ * **Note**: This provider is used internally by `BaseMap` and should not be used directly.
31
+ * Consumers should pass the `id` prop to `BaseMap`, which will create this provider automatically.
32
+ *
33
+ * This component uses a hybrid architecture combining React Context (for map instance identity)
34
+ * with module-level state management (for map mode state). The provider:
35
+ * - Provides a unique `id` via Context
36
+ * - Cleans up map mode state when unmounted
37
+ * - Allows components to subscribe to mode changes via `useMapMode` hook (which uses `useSyncExternalStore`)
38
+ *
39
+ * The module-level state management system implements a state machine for map modes where
40
+ * components can request mode changes with ownership. When a mode is owned by a component,
41
+ * other components must request authorization to change to a different mode. The system handles:
42
+ *
43
+ * - Automatic mode changes when no ownership conflicts exist
44
+ * - Authorization flow when switching between owned modes
45
+ * - Per-mode ownership tracking that persists throughout the session
46
+ * - Pending request management (one pending request per requester)
47
+ * - Auto-acceptance of first pending request when mode owner returns to default
48
+ * - Auto-rejection of other pending requests when one is approved
49
+ * - Event emission through a centralized event bus
50
+ * - Instance isolation for multiple map scenarios (main map + minimap)
51
+ * - Always initializes in 'default' mode
52
+ *
53
+ * ## Instance Isolation
54
+ *
55
+ * Each MapProvider instance operates independently. Mode changes in one instance
56
+ * do not affect other instances, even when multiple maps are rendered on the same page.
57
+ * This enables scenarios like:
58
+ * - Main map in "drawing" mode while minimap stays in "view" mode
59
+ * - Multiple independent map views with different interaction modes
60
+ *
61
+ * Events are scoped to specific instances using the `id` prop. The event bus
62
+ * filters events to ensure each provider only responds to events for its own instance.
63
+ *
64
+ * ## Pending Request Behavior
65
+ *
66
+ * - Pending requests are stored by requester ID (not mode owner)
67
+ * - Each requester can have only one pending request at a time
68
+ * - New requests from the same requester auto-replace previous requests
69
+ * - Pending requests persist when mode owner switches between their own modes
70
+ * - When any request is approved, all other pending requests are auto-rejected
71
+ * - When mode owner returns to default mode:
72
+ * - If first pending request is for default mode, all pending requests are rejected (already in requested mode)
73
+ * - If first pending request is for a different mode, that request is auto-approved and others are rejected
74
+ *
75
+ * ## Instance ID Stability and Lifecycle
76
+ *
77
+ * The provider's cleanup mechanism (via `useEffect`) ensures proper state management:
78
+ * - Map mode state is cleaned up when the provider unmounts
79
+ * - Changing the `id` prop will trigger cleanup of the old state via the effect dependency
80
+ * - State is lazily initialized on first subscription (no manual creation needed)
81
+ *
82
+ * While the `id` prop should typically remain stable (created as a module-level constant
83
+ * or with `useState`), changing it will work correctly due to the cleanup mechanism.
84
+ *
85
+ * @param props - Provider props including children and required id
86
+ * @returns Provider component that wraps children with map instance identity context
87
+ *
88
+ * @example
89
+ * Internal usage within BaseMap:
90
+ * ```tsx
91
+ * // BaseMap automatically creates the provider
92
+ * function BaseMap({ id, children, ...props }: BaseMapProps) {
93
+ * return (
94
+ * <div>
95
+ * <MapProvider id={id}>
96
+ * <Deckgl {...props}>
97
+ * {children}
98
+ * </Deckgl>
99
+ * </MapProvider>
100
+ * </div>
101
+ * );
102
+ * }
103
+ * ```
104
+ *
105
+ * @example
106
+ * With authorization handling - use id in event payloads:
107
+ * ```tsx
108
+ * useOn(MapModeEvents.changeAuthorization, (event) => {
109
+ * const { authId, id } = event.payload;
110
+ * emitDecision({ authId, approved: true, owner: 'tool', id });
111
+ * });
112
+ * ```
113
+ */
7
114
  function MapProvider({ children, id }) {
8
- useEffect(() => {
9
- return () => {
10
- clearMapModeState(id);
11
- };
12
- }, [id]);
13
- return /* @__PURE__ */ jsx(MapContext.Provider, { value: id, children });
115
+ useEffect(() => {
116
+ return () => {
117
+ clearMapModeState(id);
118
+ clearCursorState(id);
119
+ };
120
+ }, [id]);
121
+ return /* @__PURE__ */ jsx(MapContext.Provider, {
122
+ value: id,
123
+ children
124
+ });
14
125
  }
15
126
 
127
+ //#endregion
16
128
  export { MapContext, MapProvider };
17
- //# sourceMappingURL=provider.js.map
18
129
  //# sourceMappingURL=provider.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/deckgl/base-map/provider.tsx"],"names":[],"mappings":";;;;;AAuBO,MAAM,UAAA,GAAa,cAA+B,IAAI;AAuHtD,SAAS,WAAA,CAAY,EAAE,QAAA,EAAU,EAAA,EAAG,EAAqB;AAG9D,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,OAAO,MAAM;AACX,MAAA,iBAAA,CAAkB,EAAE,CAAA;AAAA,IACtB,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,EAAE,CAAC,CAAA;AAEP,EAAA,2BAAQ,UAAA,CAAW,QAAA,EAAX,EAAoB,KAAA,EAAO,IAAK,QAAA,EAAS,CAAA;AACnD","file":"provider.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport 'client-only';\nimport { createContext, type ReactNode, useEffect } from 'react';\nimport { clearMapModeState } from '../../map-mode/store';\nimport type { UniqueId } from '@accelint/core';\n\n/**\n * React context for map ID.\n * Use the `useMapMode` hook to access the map mode state.\n */\nexport const MapContext = createContext<UniqueId | null>(null);\n\n/**\n * Props for the MapProvider component.\n */\nexport type MapProviderProps = {\n /** Child components that will have access to map mode context */\n children: ReactNode;\n /**\n * Unique identifier for this map instance.\n *\n * Used to isolate mode changes between different map instances (e.g., main map vs minimap).\n * This is required and should be provided by the parent component (typically BaseMap).\n *\n * @example\n * ```tsx\n * // Multiple independent map instances\n * const mainMapId = uuid();\n * const minimapId = uuid();\n *\n * <MapProvider id={mainMapId}>\n * // Map layers and components\n * </MapProvider>\n *\n * <MapProvider id={minimapId}>\n * // Minimap layers and components\n * </MapProvider>\n * ```\n */\n id: UniqueId;\n};\n\n/**\n * Provider component for managing map modes with ownership and authorization.\n *\n * **Note**: This provider is used internally by `BaseMap` and should not be used directly.\n * Consumers should pass the `id` prop to `BaseMap`, which will create this provider automatically.\n *\n * This component uses a hybrid architecture combining React Context (for map instance identity)\n * with module-level state management (for map mode state). The provider:\n * - Provides a unique `id` via Context\n * - Cleans up map mode state when unmounted\n * - Allows components to subscribe to mode changes via `useMapMode` hook (which uses `useSyncExternalStore`)\n *\n * The module-level state management system implements a state machine for map modes where\n * components can request mode changes with ownership. When a mode is owned by a component,\n * other components must request authorization to change to a different mode. The system handles:\n *\n * - Automatic mode changes when no ownership conflicts exist\n * - Authorization flow when switching between owned modes\n * - Per-mode ownership tracking that persists throughout the session\n * - Pending request management (one pending request per requester)\n * - Auto-acceptance of first pending request when mode owner returns to default\n * - Auto-rejection of other pending requests when one is approved\n * - Event emission through a centralized event bus\n * - Instance isolation for multiple map scenarios (main map + minimap)\n * - Always initializes in 'default' mode\n *\n * ## Instance Isolation\n *\n * Each MapProvider instance operates independently. Mode changes in one instance\n * do not affect other instances, even when multiple maps are rendered on the same page.\n * This enables scenarios like:\n * - Main map in \"drawing\" mode while minimap stays in \"view\" mode\n * - Multiple independent map views with different interaction modes\n *\n * Events are scoped to specific instances using the `id` prop. The event bus\n * filters events to ensure each provider only responds to events for its own instance.\n *\n * ## Pending Request Behavior\n *\n * - Pending requests are stored by requester ID (not mode owner)\n * - Each requester can have only one pending request at a time\n * - New requests from the same requester auto-replace previous requests\n * - Pending requests persist when mode owner switches between their own modes\n * - When any request is approved, all other pending requests are auto-rejected\n * - When mode owner returns to default mode:\n * - If first pending request is for default mode, all pending requests are rejected (already in requested mode)\n * - If first pending request is for a different mode, that request is auto-approved and others are rejected\n *\n * ## Instance ID Stability and Lifecycle\n *\n * The provider's cleanup mechanism (via `useEffect`) ensures proper state management:\n * - Map mode state is cleaned up when the provider unmounts\n * - Changing the `id` prop will trigger cleanup of the old state via the effect dependency\n * - State is lazily initialized on first subscription (no manual creation needed)\n *\n * While the `id` prop should typically remain stable (created as a module-level constant\n * or with `useState`), changing it will work correctly due to the cleanup mechanism.\n *\n * @param props - Provider props including children and required id\n * @returns Provider component that wraps children with map instance identity context\n *\n * @example\n * Internal usage within BaseMap:\n * ```tsx\n * // BaseMap automatically creates the provider\n * function BaseMap({ id, children, ...props }: BaseMapProps) {\n * return (\n * <div>\n * <MapProvider id={id}>\n * <Deckgl {...props}>\n * {children}\n * </Deckgl>\n * </MapProvider>\n * </div>\n * );\n * }\n * ```\n *\n * @example\n * With authorization handling - use id in event payloads:\n * ```tsx\n * useOn(MapModeEvents.changeAuthorization, (event) => {\n * const { authId, id } = event.payload;\n * emitDecision({ authId, approved: true, owner: 'tool', id });\n * });\n * ```\n */\nexport function MapProvider({ children, id }: MapProviderProps) {\n // Cleanup when component unmounts\n // State is created automatically on first subscription in useMapMode\n useEffect(() => {\n return () => {\n clearMapModeState(id);\n };\n }, [id]);\n\n return <MapContext.Provider value={id}>{children}</MapContext.Provider>;\n}\n"]}
1
+ {"version":3,"file":"provider.js","names":[],"sources":["../../../src/deckgl/base-map/provider.tsx"],"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 { createContext, type ReactNode, useEffect } from 'react';\nimport { clearCursorState } from '../../map-cursor/store';\nimport { clearMapModeState } from '../../map-mode/store';\nimport type { UniqueId } from '@accelint/core';\n\n/**\n * React context for map ID.\n * Use the `useMapMode` hook to access the map mode state.\n */\nexport const MapContext = createContext<UniqueId | null>(null);\n\n/**\n * Props for the MapProvider component.\n */\nexport type MapProviderProps = {\n /** Child components that will have access to map mode context */\n children: ReactNode;\n /**\n * Unique identifier for this map instance.\n *\n * Used to isolate mode changes between different map instances (e.g., main map vs minimap).\n * This is required and should be provided by the parent component (typically BaseMap).\n *\n * @example\n * ```tsx\n * // Multiple independent map instances\n * const mainMapId = uuid();\n * const minimapId = uuid();\n *\n * <MapProvider id={mainMapId}>\n * // Map layers and components\n * </MapProvider>\n *\n * <MapProvider id={minimapId}>\n * // Minimap layers and components\n * </MapProvider>\n * ```\n */\n id: UniqueId;\n};\n\n/**\n * Provider component for managing map modes with ownership and authorization.\n *\n * **Note**: This provider is used internally by `BaseMap` and should not be used directly.\n * Consumers should pass the `id` prop to `BaseMap`, which will create this provider automatically.\n *\n * This component uses a hybrid architecture combining React Context (for map instance identity)\n * with module-level state management (for map mode state). The provider:\n * - Provides a unique `id` via Context\n * - Cleans up map mode state when unmounted\n * - Allows components to subscribe to mode changes via `useMapMode` hook (which uses `useSyncExternalStore`)\n *\n * The module-level state management system implements a state machine for map modes where\n * components can request mode changes with ownership. When a mode is owned by a component,\n * other components must request authorization to change to a different mode. The system handles:\n *\n * - Automatic mode changes when no ownership conflicts exist\n * - Authorization flow when switching between owned modes\n * - Per-mode ownership tracking that persists throughout the session\n * - Pending request management (one pending request per requester)\n * - Auto-acceptance of first pending request when mode owner returns to default\n * - Auto-rejection of other pending requests when one is approved\n * - Event emission through a centralized event bus\n * - Instance isolation for multiple map scenarios (main map + minimap)\n * - Always initializes in 'default' mode\n *\n * ## Instance Isolation\n *\n * Each MapProvider instance operates independently. Mode changes in one instance\n * do not affect other instances, even when multiple maps are rendered on the same page.\n * This enables scenarios like:\n * - Main map in \"drawing\" mode while minimap stays in \"view\" mode\n * - Multiple independent map views with different interaction modes\n *\n * Events are scoped to specific instances using the `id` prop. The event bus\n * filters events to ensure each provider only responds to events for its own instance.\n *\n * ## Pending Request Behavior\n *\n * - Pending requests are stored by requester ID (not mode owner)\n * - Each requester can have only one pending request at a time\n * - New requests from the same requester auto-replace previous requests\n * - Pending requests persist when mode owner switches between their own modes\n * - When any request is approved, all other pending requests are auto-rejected\n * - When mode owner returns to default mode:\n * - If first pending request is for default mode, all pending requests are rejected (already in requested mode)\n * - If first pending request is for a different mode, that request is auto-approved and others are rejected\n *\n * ## Instance ID Stability and Lifecycle\n *\n * The provider's cleanup mechanism (via `useEffect`) ensures proper state management:\n * - Map mode state is cleaned up when the provider unmounts\n * - Changing the `id` prop will trigger cleanup of the old state via the effect dependency\n * - State is lazily initialized on first subscription (no manual creation needed)\n *\n * While the `id` prop should typically remain stable (created as a module-level constant\n * or with `useState`), changing it will work correctly due to the cleanup mechanism.\n *\n * @param props - Provider props including children and required id\n * @returns Provider component that wraps children with map instance identity context\n *\n * @example\n * Internal usage within BaseMap:\n * ```tsx\n * // BaseMap automatically creates the provider\n * function BaseMap({ id, children, ...props }: BaseMapProps) {\n * return (\n * <div>\n * <MapProvider id={id}>\n * <Deckgl {...props}>\n * {children}\n * </Deckgl>\n * </MapProvider>\n * </div>\n * );\n * }\n * ```\n *\n * @example\n * With authorization handling - use id in event payloads:\n * ```tsx\n * useOn(MapModeEvents.changeAuthorization, (event) => {\n * const { authId, id } = event.payload;\n * emitDecision({ authId, approved: true, owner: 'tool', id });\n * });\n * ```\n */\nexport function MapProvider({ children, id }: MapProviderProps) {\n // Cleanup when component unmounts\n // State is created automatically on first subscription in useMapMode/useMapCursor\n useEffect(() => {\n return () => {\n clearMapModeState(id);\n clearCursorState(id);\n };\n }, [id]);\n\n return <MapContext.Provider value={id}>{children}</MapContext.Provider>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAa,aAAa,cAA+B,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuH9D,SAAgB,YAAY,EAAE,UAAU,MAAwB;AAG9D,iBAAgB;AACd,eAAa;AACX,qBAAkB,GAAG;AACrB,oBAAiB,GAAG;;IAErB,CAAC,GAAG,CAAC;AAER,QAAO,oBAAC,WAAW;EAAS,OAAO;EAAK;GAA+B"}
@@ -1,19 +1,32 @@
1
- import { Payload } from '@accelint/bus';
2
- import { UniqueId } from '@accelint/core';
3
- import { PickingInfo } from '@deck.gl/core';
4
- import { MjolnirGestureEvent, MjolnirPointerEvent } from 'mjolnir.js';
5
- import { MapEvents } from './events.js';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { MapEvents } from "./events.js";
14
+ import { Payload } from "@accelint/bus";
15
+ import { UniqueId } from "@accelint/core";
16
+ import { PickingInfo } from "@deck.gl/core";
17
+ import { MjolnirGestureEvent, MjolnirPointerEvent } from "mjolnir.js";
6
18
 
19
+ //#region src/deckgl/base-map/types.d.ts
7
20
  /**
8
21
  * PickingInfo modified for serialization through the event bus.
9
22
  * Omits viewport, layer, and sourceLayer (which contain non-serializable functions),
10
23
  * and adds layerId and sourceLayerId extracted from the original layer objects.
11
24
  */
12
- type NonFuncPickingInfo = Omit<PickingInfo, 'viewport' | 'layer' | 'sourceLayer'> & {
13
- /** ID of the picked layer (extracted from layer.id before omission) */
14
- layerId?: NonNullable<PickingInfo['layer']>['id'];
15
- /** ID of the source layer if applicable (extracted from sourceLayer.id before omission) */
16
- sourceLayerId?: NonNullable<PickingInfo['sourceLayer']>['id'];
25
+ type SerializablePickingInfo = Omit<PickingInfo, 'viewport' | 'layer' | 'sourceLayer'> & {
26
+ /** ID of the picked layer (extracted from layer.id before omission) */
27
+ layerId?: NonNullable<PickingInfo['layer']>['id'];
28
+ /** ID of the source layer if applicable (extracted from sourceLayer.id before omission) */
29
+ sourceLayerId?: NonNullable<PickingInfo['sourceLayer']>['id'];
17
30
  };
18
31
  /**
19
32
  * MjolnirGestureEvent without function properties and non-serializable objects.
@@ -30,41 +43,37 @@ type NonFuncMjolnirPointerEvent = Omit<MjolnirPointerEvent, 'stopPropagation' |
30
43
  * Contains picking information about what was clicked and the gesture event details.
31
44
  */
32
45
  type MapClickPayload = {
33
- /** Information about the picked object and its properties */
34
- info: NonFuncPickingInfo;
35
- /** The gesture event that triggered the click */
36
- event: NonFuncMjolnirGestureEvent;
37
- /** The map instance the event occurred within */
38
- id: UniqueId;
46
+ /** Information about the picked object and its properties */
47
+ info: SerializablePickingInfo;
48
+ /** The gesture event that triggered the click */
49
+ event: NonFuncMjolnirGestureEvent;
50
+ /** The map instance the event occurred within */
51
+ id: UniqueId;
39
52
  };
40
53
  /**
41
54
  * Payload for map hover events emitted through the event bus.
42
55
  * Contains picking information about what is being hovered and the pointer event details.
43
56
  */
44
57
  type MapHoverPayload = {
45
- /** Information about the picked object and its properties */
46
- info: NonFuncPickingInfo;
47
- /** The pointer event that triggered the hover */
48
- event: NonFuncMjolnirPointerEvent;
49
- /** The map instance the event occurred within */
50
- id: UniqueId;
58
+ /** Information about the picked object and its properties */
59
+ info: SerializablePickingInfo;
60
+ /** The pointer event that triggered the hover */
61
+ event: NonFuncMjolnirPointerEvent;
62
+ /** The map instance the event occurred within */
63
+ id: UniqueId;
51
64
  };
52
- type Bounds = [
53
- minLon: number,
54
- minLat: number,
55
- maxLon: number,
56
- maxLat: number
57
- ];
65
+ type Bounds = [minLon: number, minLat: number, maxLon: number, maxLat: number];
58
66
  type MapViewportPayload = {
59
- bounds: Bounds;
60
- latitude: number;
61
- longitude: number;
62
- zoom: number;
63
- /** Viewport width in pixels */
64
- width: number;
65
- /** Viewport height in pixels */
66
- height: number;
67
- id: UniqueId;
67
+ /** Viewport bounds, undefined if viewport not yet initialized */
68
+ bounds?: Bounds;
69
+ latitude: number;
70
+ longitude: number;
71
+ zoom: number;
72
+ /** Viewport width in pixels */
73
+ width: number;
74
+ /** Viewport height in pixels */
75
+ height: number;
76
+ id: UniqueId;
68
77
  };
69
78
  /**
70
79
  * Type for map click events in the event bus.
@@ -78,5 +87,6 @@ type MapClickEvent = Payload<typeof MapEvents.click, MapClickPayload>;
78
87
  type MapHoverEvent = Payload<typeof MapEvents.hover, MapHoverPayload>;
79
88
  type MapViewportEvent = Payload<typeof MapEvents.viewport, MapViewportPayload>;
80
89
  type MapEventType = MapClickEvent | MapHoverEvent | MapViewportEvent;
81
-
82
- export type { Bounds, MapClickEvent, MapClickPayload, MapEventType, MapHoverEvent, MapHoverPayload, MapViewportEvent, MapViewportPayload };
90
+ //#endregion
91
+ export { Bounds, MapClickEvent, MapClickPayload, MapEventType, MapHoverEvent, MapHoverPayload, MapViewportEvent, MapViewportPayload, SerializablePickingInfo };
92
+ //# sourceMappingURL=types.d.ts.map
@@ -1,3 +1,12 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
1
12
 
2
- //# sourceMappingURL=types.js.map
3
- //# sourceMappingURL=types.js.map
@@ -1,13 +1,18 @@
1
- export { BaseMap, BaseMapProps } from './base-map/index.js';
2
- export { BASE_MAP_STYLE, PARAMETERS } from './base-map/constants.js';
3
- export { MapEvents, MapEventsNamespace } from './base-map/events.js';
4
- export { SymbolLayer, SymbolLayerProps } from './symbol-layer/index.js';
5
- export { MapClickEvent, MapClickPayload, MapEventType, MapHoverEvent, MapHoverPayload } from './base-map/types.js';
6
- import 'react/jsx-runtime';
7
- import '@accelint/core';
8
- import '@deckgl-fiber-renderer/types';
9
- import '@deck.gl/layers';
10
- import 'milsymbol';
11
- import '@deck.gl/core';
12
- import '@accelint/bus';
13
- import 'mjolnir.js';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { BASE_MAP_STYLE, PARAMETERS } from "./base-map/constants.js";
14
+ import { MapEvents, MapEventsNamespace } from "./base-map/events.js";
15
+ import { BaseMap, BaseMapProps } from "./base-map/index.js";
16
+ import { MapClickEvent, MapClickPayload, MapEventType, MapHoverEvent, MapHoverPayload } from "./base-map/types.js";
17
+ import { SymbolLayer, SymbolLayerProps } from "./symbol-layer/index.js";
18
+ export { BASE_MAP_STYLE, BaseMap, type BaseMapProps, type MapClickEvent, type MapClickPayload, type MapEventType, MapEvents, MapEventsNamespace, type MapHoverEvent, type MapHoverPayload, PARAMETERS, SymbolLayer, type SymbolLayerProps };
@@ -1,6 +1,19 @@
1
- export { BaseMap } from './base-map/index.js';
2
- export { BASE_MAP_STYLE, PARAMETERS } from './base-map/constants.js';
3
- export { MapEvents, MapEventsNamespace } from './base-map/events.js';
4
- export { SymbolLayer } from './symbol-layer/index.js';
5
- //# sourceMappingURL=index.js.map
6
- //# sourceMappingURL=index.js.map
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ import { MapEvents, MapEventsNamespace } from "./base-map/events.js";
15
+ import { BASE_MAP_STYLE, PARAMETERS } from "./base-map/constants.js";
16
+ import { BaseMap } from "./base-map/index.js";
17
+ import { SymbolLayer } from "./symbol-layer/index.js";
18
+
19
+ export { BASE_MAP_STYLE, BaseMap, MapEvents, MapEventsNamespace, PARAMETERS, SymbolLayer };
@@ -1,14 +1,25 @@
1
- import { SymbolLayerProps } from './index.js';
2
- import '@deck.gl/layers';
3
- import 'milsymbol';
4
- import '@deck.gl/core';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
5
12
 
13
+ import { SymbolLayerProps } from "./index.js";
14
+
15
+ //#region src/deckgl/symbol-layer/fiber.d.ts
6
16
  declare global {
7
- namespace React {
8
- namespace JSX {
9
- interface IntrinsicElements {
10
- symbolLayer: SymbolLayerProps;
11
- }
12
- }
17
+ namespace React {
18
+ namespace JSX {
19
+ interface IntrinsicElements {
20
+ symbolLayer: SymbolLayerProps;
21
+ }
13
22
  }
23
+ }
14
24
  }
25
+ //# sourceMappingURL=fiber.d.ts.map
@@ -1,6 +1,21 @@
1
- import { extend } from '@deckgl-fiber-renderer/dom';
2
- import { SymbolLayer } from './index.js';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
3
12
 
13
+
14
+ import { SymbolLayer } from "./index.js";
15
+ import { extend } from "@deckgl-fiber-renderer/dom";
16
+
17
+ //#region src/deckgl/symbol-layer/fiber.ts
4
18
  extend({ SymbolLayer });
5
- //# sourceMappingURL=fiber.js.map
19
+
20
+ //#endregion
6
21
  //# sourceMappingURL=fiber.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/deckgl/symbol-layer/fiber.ts"],"names":[],"mappings":";;;AAeA,MAAA,CAAO,EAAE,aAAa,CAAA","file":"fiber.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\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"]}
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,63 +1,77 @@
1
- import { IconLayerProps, IconLayer } from '@deck.gl/layers';
2
- import { SymbolOptions } from 'milsymbol';
3
- import { AccessorFunction, DefaultProps, AccessorContext } from '@deck.gl/core';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { IconLayer, IconLayerProps } from "@deck.gl/layers";
14
+ import { SymbolOptions } from "milsymbol";
15
+ import { AccessorContext, AccessorFunction, DefaultProps } from "@deck.gl/core";
4
16
 
17
+ //#region src/deckgl/symbol-layer/index.d.ts
5
18
  type _SymbolLayerProps<TData = unknown> = {
6
- /**
7
- * An accessor function that returns the SIDC for a given data point.
8
- */
9
- getSidc?: AccessorFunction<TData, string | number | bigint>;
10
- /**
11
- * An accessor function that returns symbol options for a given data point.
12
- */
13
- getSymbolOptions?: AccessorFunction<TData, SymbolOptions | null>;
14
- /**
15
- * Default symbol options to use when rendering symbols.
16
- */
17
- defaultSymbolOptions?: SymbolOptions;
19
+ /**
20
+ * An accessor function that returns the SIDC for a given data point.
21
+ */
22
+ getSidc?: AccessorFunction<TData, string | number | bigint>;
23
+ /**
24
+ * An accessor function that returns symbol options for a given data point.
25
+ */
26
+ getSymbolOptions?: AccessorFunction<TData, SymbolOptions | null>;
27
+ /**
28
+ * Default symbol options to use when rendering symbols.
29
+ */
30
+ defaultSymbolOptions?: SymbolOptions;
18
31
  };
19
32
  type SymbolLayerProps<TData = unknown> = _SymbolLayerProps<TData> & Omit<IconLayerProps<TData>, 'getIcon' | 'getColor' | 'iconAtlas' | 'iconMapping'>;
20
33
  /**
21
34
  * Provides a layer for rendering MIL-STD-2525 and APP-6 symbols.
22
35
  */
23
36
  declare class SymbolLayer<TData = unknown, TExtraProps extends {} = {}> extends IconLayer<TData, TExtraProps & Required<_SymbolLayerProps<TData>>> {
24
- static defaultProps: DefaultProps<SymbolLayerProps<unknown>>;
25
- static layerName: string;
26
- /**
27
- * The default symbol options to use when rendering symbols.
28
- *
29
- * @internal
30
- */
31
- protected defaultOptions: SymbolOptions;
32
- /**
33
- * Caches the results of the icon generation
34
- *
35
- * @internal
36
- * @todo Use LRU cache to limit memory usage.
37
- */
38
- protected generationCache: Map<string, string>;
39
- constructor(...args: Partial<SymbolLayerProps<TData>>[]);
40
- /**
41
- * Generates an icon using the provided SIDC and symbol options.
42
- *
43
- * @param data A point's data
44
- * @param info Contextual information about the point
45
- * @returns DeckGL Icon Object
46
- */
47
- protected generateIcon: (data: TData, info: AccessorContext<TData>) => {
48
- id: string;
49
- url: string;
50
- height: number;
51
- width: number;
52
- };
53
- /**
54
- * Generates a cache key for the given SIDC and symbol options.
55
- *
56
- * @param sidc SIDC of the symbol
57
- * @param options Options used to generate the symbol
58
- * @returns String key for caching
59
- */
60
- protected generateCacheKey(sidc: string, options: SymbolOptions): string;
37
+ static defaultProps: DefaultProps<SymbolLayerProps<unknown>>;
38
+ static layerName: string;
39
+ /**
40
+ * The default symbol options to use when rendering symbols.
41
+ *
42
+ * @internal
43
+ */
44
+ protected defaultOptions: SymbolOptions;
45
+ /**
46
+ * Caches the results of the icon generation
47
+ *
48
+ * @internal
49
+ * @todo Use LRU cache to limit memory usage.
50
+ */
51
+ protected generationCache: Map<string, string>;
52
+ constructor(...args: Partial<SymbolLayerProps<TData>>[]);
53
+ /**
54
+ * Generates an icon using the provided SIDC and symbol options.
55
+ *
56
+ * @param data A point's data
57
+ * @param info Contextual information about the point
58
+ * @returns DeckGL Icon Object
59
+ */
60
+ protected generateIcon: (data: TData, info: AccessorContext<TData>) => {
61
+ id: string;
62
+ url: string;
63
+ height: number;
64
+ width: number;
65
+ };
66
+ /**
67
+ * Generates a cache key for the given SIDC and symbol options.
68
+ *
69
+ * @param sidc SIDC of the symbol
70
+ * @param options Options used to generate the symbol
71
+ * @returns String key for caching
72
+ */
73
+ protected generateCacheKey(sidc: string, options: SymbolOptions): string;
61
74
  }
62
-
63
- export { SymbolLayer, type SymbolLayerProps };
75
+ //#endregion
76
+ export { SymbolLayer, SymbolLayerProps };
77
+ //# sourceMappingURL=index.d.ts.map