@accelint/map-toolkit 0.4.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +3 -0
- package/catalog-info.yaml +6 -3
- package/dist/camera/events.d.ts +15 -0
- package/dist/camera/events.js +29 -0
- package/dist/camera/events.js.map +1 -0
- package/dist/camera/index.d.ts +16 -0
- package/dist/camera/index.js +17 -0
- package/dist/camera/types.d.ts +84 -0
- package/dist/{decorators/deckgl.d.ts → camera/types.js} +0 -7
- package/dist/camera/use-camera-state.d.ts +153 -0
- package/dist/camera/use-camera-state.js +418 -0
- package/dist/camera/use-camera-state.js.map +1 -0
- package/dist/cursor-coordinates/use-cursor-coordinates.js +1 -1
- package/dist/deckgl/base-map/constants.d.ts +14 -2
- package/dist/deckgl/base-map/constants.js +14 -2
- package/dist/deckgl/base-map/constants.js.map +1 -1
- package/dist/deckgl/base-map/controls.d.ts +34 -0
- package/dist/deckgl/base-map/controls.js +50 -0
- package/dist/deckgl/base-map/controls.js.map +1 -0
- package/dist/deckgl/base-map/events.d.ts +4 -0
- package/dist/deckgl/base-map/events.js +5 -1
- package/dist/deckgl/base-map/events.js.map +1 -1
- package/dist/deckgl/base-map/index.d.ts +10 -23
- package/dist/deckgl/base-map/index.js +81 -42
- package/dist/deckgl/base-map/index.js.map +1 -1
- package/dist/deckgl/base-map/types.d.ts +48 -2
- package/dist/deckgl/index.d.ts +11 -4
- package/dist/deckgl/index.js +7 -2
- package/dist/deckgl/saved-viewports/index.d.ts +32 -0
- package/dist/deckgl/saved-viewports/index.js +51 -0
- package/dist/deckgl/saved-viewports/index.js.map +1 -0
- package/dist/deckgl/saved-viewports/storage.d.ts +21 -0
- package/dist/deckgl/saved-viewports/storage.js +39 -0
- package/dist/deckgl/saved-viewports/storage.js.map +1 -0
- package/dist/deckgl/shapes/display-shape-layer/constants.d.ts +44 -0
- package/dist/deckgl/shapes/display-shape-layer/constants.js +61 -0
- package/dist/deckgl/shapes/display-shape-layer/constants.js.map +1 -0
- package/dist/deckgl/shapes/display-shape-layer/fiber.d.ts +25 -0
- package/dist/deckgl/shapes/display-shape-layer/fiber.js +21 -0
- package/dist/deckgl/shapes/display-shape-layer/fiber.js.map +1 -0
- package/dist/deckgl/shapes/display-shape-layer/index.d.ts +206 -0
- package/dist/deckgl/shapes/display-shape-layer/index.js +416 -0
- package/dist/deckgl/shapes/display-shape-layer/index.js.map +1 -0
- package/dist/deckgl/shapes/display-shape-layer/shape-label-layer.d.ts +66 -0
- package/dist/deckgl/shapes/display-shape-layer/shape-label-layer.js +116 -0
- package/dist/deckgl/shapes/display-shape-layer/shape-label-layer.js.map +1 -0
- package/dist/deckgl/shapes/display-shape-layer/store.d.ts +87 -0
- package/dist/deckgl/shapes/display-shape-layer/store.js +316 -0
- package/dist/deckgl/shapes/display-shape-layer/store.js.map +1 -0
- package/dist/deckgl/shapes/display-shape-layer/types.d.ts +115 -0
- package/dist/deckgl/shapes/display-shape-layer/types.js +12 -0
- package/dist/deckgl/shapes/display-shape-layer/use-shape-selection.d.ts +89 -0
- package/dist/deckgl/shapes/display-shape-layer/use-shape-selection.js +88 -0
- package/dist/deckgl/shapes/display-shape-layer/use-shape-selection.js.map +1 -0
- package/dist/deckgl/shapes/display-shape-layer/utils/display-style.d.ts +61 -0
- package/dist/deckgl/shapes/display-shape-layer/utils/display-style.js +111 -0
- package/dist/deckgl/shapes/display-shape-layer/utils/display-style.js.map +1 -0
- package/dist/deckgl/shapes/display-shape-layer/utils/labels.d.ts +196 -0
- package/dist/deckgl/shapes/display-shape-layer/utils/labels.js +368 -0
- package/dist/deckgl/shapes/display-shape-layer/utils/labels.js.map +1 -0
- package/dist/deckgl/shapes/index.d.ts +20 -0
- package/dist/deckgl/shapes/index.js +20 -0
- package/dist/deckgl/shapes/shared/constants.d.ts +78 -0
- package/dist/deckgl/shapes/shared/constants.js +109 -0
- package/dist/deckgl/shapes/shared/constants.js.map +1 -0
- package/dist/deckgl/shapes/shared/events.d.ts +73 -0
- package/dist/deckgl/shapes/shared/events.js +58 -0
- package/dist/deckgl/shapes/shared/events.js.map +1 -0
- package/dist/deckgl/shapes/shared/types.d.ts +158 -0
- package/dist/{decorators/deckgl.js → deckgl/shapes/shared/types.js} +12 -15
- package/dist/deckgl/shapes/shared/types.js.map +1 -0
- package/dist/deckgl/symbol-layer/index.d.ts +1 -1
- package/dist/maplibre/hooks/use-maplibre.d.ts +2 -2
- package/dist/maplibre/hooks/use-maplibre.js +2 -2
- package/dist/maplibre/hooks/use-maplibre.js.map +1 -1
- package/dist/viewport/viewport-size.d.ts +2 -2
- package/package.json +50 -23
- package/dist/decorators/deckgl.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","names":["DEFAULT_STYLE_PROPERTIES: StyleProperties","DASH_ARRAYS: Record<\n 'solid' | 'dashed' | 'dotted',\n [number, number] | null\n>"],"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 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 (60%) for standard semi-transparent look\n */\nexport const BASE_FILL_OPACITY = 0.2;\n\n/**\n * Default stroke width in pixels when not specified in styleProperties\n */\nexport const DEFAULT_STROKE_WIDTH = 2;\n\n/**\n * Additional pixels added to stroke width on hover\n */\nexport const HOVER_WIDTH_INCREASE = 2;\n\n/**\n * Additional pixels added to stroke 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 */\nexport const DEFAULT_COLORS = {\n /** Default fill color (background-surface-muted gray at full alpha) */\n fill: [255, 255, 255, 255] as Color,\n /** Default stroke color (outline-interactive-hover gray at full alpha) */\n stroke: [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 * Default style properties for new shapes\n */\nexport const DEFAULT_STYLE_PROPERTIES: StyleProperties = {\n fillColor: DEFAULT_COLORS.fill,\n strokeColor: DEFAULT_COLORS.stroke,\n strokeWidth: 2,\n strokePattern: 'solid',\n};\n\n/**\n * Stroke width options\n */\nexport const STROKE_WIDTHS = [1, 2, 4, 8] as const;\n\n/**\n * Stroke pattern options\n */\nexport const STROKE_PATTERNS = ['solid', 'dashed', 'dotted'] as const;\n\n/**\n * Dash array patterns for stroke 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"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,MAAa,kBAAkB;CAC7B,SAAS;CACT,mBAAmB;CACnB,gBAAgB;CACjB;;;;AAKD,MAAa,oBAAoB;;;;AAKjC,MAAa,uBAAuB;;;;AAKpC,MAAa,uBAAuB;;;;AAKpC,MAAa,2BAA2B;;;;AAKxC,MAAa,2BAA2B;;;;AAKxC,MAAa,uBAAuB;;;;AAKpC,MAAa,iBAAiB;CAE5B,MAAM;EAAC;EAAK;EAAK;EAAK;EAAI;CAE1B,QAAQ;EAAC;EAAK;EAAK;EAAK;EAAI;CAE5B,WAAW;EAAC;EAAI;EAAK;EAAK;EAAI;CAC/B;;;;AAKD,MAAaA,2BAA4C;CACvD,WAAW,eAAe;CAC1B,aAAa,eAAe;CAC5B,aAAa;CACb,eAAe;CAChB;;;;AAKD,MAAa,gBAAgB;CAAC;CAAG;CAAG;CAAG;CAAE;;;;AAKzC,MAAa,kBAAkB;CAAC;CAAS;CAAU;CAAS;;;;AAK5D,MAAaC,cAGT;CACF,OAAO;CACP,QAAQ,CAAC,GAAG,EAAE;CACd,QAAQ,CAAC,GAAG,EAAE;CACf"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { ShapeId } from "./types.js";
|
|
14
|
+
import { Payload } from "@accelint/bus";
|
|
15
|
+
import { UniqueId } from "@accelint/core";
|
|
16
|
+
|
|
17
|
+
//#region src/deckgl/shapes/shared/events.d.ts
|
|
18
|
+
/**
|
|
19
|
+
* Shape interaction events for DisplayShapeLayer
|
|
20
|
+
*/
|
|
21
|
+
declare const ShapeEvents: {
|
|
22
|
+
/** Shape selected */
|
|
23
|
+
readonly selected: "shapes:selected";
|
|
24
|
+
/** Selection cleared */
|
|
25
|
+
readonly deselected: "shapes:deselected";
|
|
26
|
+
/** Shape hovered (for cursor changes) */
|
|
27
|
+
readonly hovered: "shapes:hovered";
|
|
28
|
+
};
|
|
29
|
+
type ShapeEventType = (typeof ShapeEvents)[keyof typeof ShapeEvents];
|
|
30
|
+
/**
|
|
31
|
+
* Event payload types (all payloads are serializable)
|
|
32
|
+
*/
|
|
33
|
+
type ShapeSelectedEvent = Payload<'shapes:selected', {
|
|
34
|
+
shapeId: ShapeId;
|
|
35
|
+
/** Map instance ID for multi-map event isolation */
|
|
36
|
+
mapId: UniqueId;
|
|
37
|
+
}>;
|
|
38
|
+
type ShapeDeselectedEvent = Payload<'shapes:deselected', {
|
|
39
|
+
/** Map instance ID for multi-map event isolation */
|
|
40
|
+
mapId: UniqueId;
|
|
41
|
+
}>;
|
|
42
|
+
type ShapeHoveredEvent = Payload<'shapes:hovered', {
|
|
43
|
+
/** Shape ID being hovered, or null when hover ends */
|
|
44
|
+
shapeId: ShapeId | null;
|
|
45
|
+
/** Map instance ID for multi-map event isolation */
|
|
46
|
+
mapId: UniqueId;
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* Union of all shape event types
|
|
50
|
+
*/
|
|
51
|
+
type ShapeEvent = ShapeSelectedEvent | ShapeDeselectedEvent | ShapeHoveredEvent;
|
|
52
|
+
/**
|
|
53
|
+
* Aliases for backward compatibility
|
|
54
|
+
*/
|
|
55
|
+
declare const SHAPE_EVENTS: {
|
|
56
|
+
/** Shape selected */
|
|
57
|
+
readonly selected: "shapes:selected";
|
|
58
|
+
/** Selection cleared */
|
|
59
|
+
readonly deselected: "shapes:deselected";
|
|
60
|
+
/** Shape hovered (for cursor changes) */
|
|
61
|
+
readonly hovered: "shapes:hovered";
|
|
62
|
+
};
|
|
63
|
+
type ShapeEventPayload = ShapeEvent;
|
|
64
|
+
type ShapeEventHandler<T extends ShapeEventType = ShapeEventType> = (event: Extract<ShapeEvent, {
|
|
65
|
+
type: T;
|
|
66
|
+
}>) => void;
|
|
67
|
+
/**
|
|
68
|
+
* Shape events namespace for bus integration
|
|
69
|
+
*/
|
|
70
|
+
declare const ShapeEventsNamespace = "shapes";
|
|
71
|
+
//#endregion
|
|
72
|
+
export { SHAPE_EVENTS, ShapeDeselectedEvent, ShapeEvent, ShapeEventHandler, ShapeEventPayload, ShapeEventType, ShapeEvents, ShapeEventsNamespace, ShapeHoveredEvent, ShapeSelectedEvent };
|
|
73
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
'use client';
|
|
15
|
+
|
|
16
|
+
//#region src/deckgl/shapes/shared/events.ts
|
|
17
|
+
/**
|
|
18
|
+
* Shape interaction events for DisplayShapeLayer
|
|
19
|
+
*/
|
|
20
|
+
const ShapeEvents = {
|
|
21
|
+
selected: "shapes:selected",
|
|
22
|
+
deselected: "shapes:deselected",
|
|
23
|
+
hovered: "shapes:hovered"
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Aliases for backward compatibility
|
|
27
|
+
*/
|
|
28
|
+
const SHAPE_EVENTS = ShapeEvents;
|
|
29
|
+
/**
|
|
30
|
+
* Shape events namespace for bus integration
|
|
31
|
+
*/
|
|
32
|
+
const ShapeEventsNamespace = "shapes";
|
|
33
|
+
/**
|
|
34
|
+
* Note: These utility functions are deprecated in favor of direct bus usage.
|
|
35
|
+
* Use `useEmit` and `useOn` from '@accelint/bus/react' in React components instead.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* import { useEmit, useOn } from '@accelint/bus/react';
|
|
40
|
+
* import { ShapeEvents } from '@accelint/map-toolkit/deckgl/shapes';
|
|
41
|
+
*
|
|
42
|
+
* function MyComponent() {
|
|
43
|
+
* const emit = useEmit();
|
|
44
|
+
*
|
|
45
|
+
* // Emit shape selected event
|
|
46
|
+
* emit(ShapeEvents.selected, { shapeId: 'some-id' });
|
|
47
|
+
*
|
|
48
|
+
* // Listen to shape events
|
|
49
|
+
* useOn(ShapeEvents.selected, (event) => {
|
|
50
|
+
* console.log('Shape selected:', event.data.shapeId);
|
|
51
|
+
* });
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export { SHAPE_EVENTS, ShapeEvents, ShapeEventsNamespace };
|
|
58
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +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\n/**\n * Aliases for backward compatibility\n */\nexport const SHAPE_EVENTS = ShapeEvents;\nexport type ShapeEventPayload = ShapeEvent;\nexport type ShapeEventHandler<T extends ShapeEventType = ShapeEventType> = (\n event: Extract<ShapeEvent, { type: T }>,\n) => void;\n\n/**\n * Shape events namespace for bus integration\n */\nexport const ShapeEventsNamespace = 'shapes';\n\n/**\n * Note: These utility functions are deprecated in favor of direct bus usage.\n * Use `useEmit` and `useOn` from '@accelint/bus/react' in React components instead.\n *\n * @example\n * ```tsx\n * import { useEmit, useOn } from '@accelint/bus/react';\n * import { ShapeEvents } from '@accelint/map-toolkit/deckgl/shapes';\n *\n * function MyComponent() {\n * const emit = useEmit();\n *\n * // Emit shape selected event\n * emit(ShapeEvents.selected, { shapeId: 'some-id' });\n *\n * // Listen to shape events\n * useOn(ShapeEvents.selected, (event) => {\n * console.log('Shape selected:', event.data.shapeId);\n * });\n * }\n * ```\n */\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,MAAa,cAAc;CAEzB,UAAU;CAEV,YAAY;CAEZ,SAAS;CACV;;;;AA8CD,MAAa,eAAe;;;;AAS5B,MAAa,uBAAuB"}
|
|
@@ -0,0 +1,158 @@
|
|
|
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 { UniqueId } from "@accelint/core";
|
|
14
|
+
import { Color } from "@deck.gl/core";
|
|
15
|
+
import { Feature, LineString, Point, Polygon } from "geojson";
|
|
16
|
+
|
|
17
|
+
//#region src/deckgl/shapes/shared/types.d.ts
|
|
18
|
+
/**
|
|
19
|
+
* Supported shape types
|
|
20
|
+
*/
|
|
21
|
+
declare const ShapeFeatureType: {
|
|
22
|
+
readonly Circle: "Circle";
|
|
23
|
+
readonly Polygon: "Polygon";
|
|
24
|
+
readonly LineString: "LineString";
|
|
25
|
+
readonly Point: "Point";
|
|
26
|
+
};
|
|
27
|
+
type ShapeFeatureType = (typeof ShapeFeatureType)[keyof typeof ShapeFeatureType];
|
|
28
|
+
/**
|
|
29
|
+
* Shape ID type - uses UniqueId from core
|
|
30
|
+
*/
|
|
31
|
+
type ShapeId = UniqueId;
|
|
32
|
+
/**
|
|
33
|
+
* Stroke width options (in pixels)
|
|
34
|
+
*/
|
|
35
|
+
type StrokeWidth = 1 | 2 | 4 | 8;
|
|
36
|
+
/**
|
|
37
|
+
* Stroke pattern options
|
|
38
|
+
*/
|
|
39
|
+
type StrokePattern = 'solid' | 'dashed' | 'dotted';
|
|
40
|
+
/**
|
|
41
|
+
* Style properties for rendering shapes
|
|
42
|
+
*/
|
|
43
|
+
interface StyleProperties {
|
|
44
|
+
/** Fill color as RGBA array [r, g, b, a] where each value is 0-255 */
|
|
45
|
+
fillColor: Color;
|
|
46
|
+
/** Stroke color as RGBA array [r, g, b, a] where each value is 0-255 */
|
|
47
|
+
strokeColor: Color;
|
|
48
|
+
/** Stroke width in pixels */
|
|
49
|
+
strokeWidth: StrokeWidth;
|
|
50
|
+
/** Stroke pattern */
|
|
51
|
+
strokePattern: StrokePattern;
|
|
52
|
+
/** Optional icon properties for Point geometries */
|
|
53
|
+
icon?: {
|
|
54
|
+
/** Icon atlas URL or data */
|
|
55
|
+
atlas?: string;
|
|
56
|
+
/** Icon mapping (name to position in atlas) */
|
|
57
|
+
mapping?: Record<string, {
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
width: number;
|
|
61
|
+
height: number;
|
|
62
|
+
mask?: boolean;
|
|
63
|
+
}>;
|
|
64
|
+
/** Icon name to use from mapping */
|
|
65
|
+
name?: string;
|
|
66
|
+
/** Icon size in pixels */
|
|
67
|
+
size?: number;
|
|
68
|
+
};
|
|
69
|
+
/** Optional custom label pixel offset [x, y] */
|
|
70
|
+
labelOffset?: [number, number];
|
|
71
|
+
/** Optional custom label vertical anchor */
|
|
72
|
+
labelVerticalAnchor?: 'top' | 'middle' | 'bottom';
|
|
73
|
+
/** Optional custom label horizontal anchor */
|
|
74
|
+
labelHorizontalAnchor?: 'left' | 'center' | 'right';
|
|
75
|
+
/** Optional custom label coordinate anchor (position along geometry) */
|
|
76
|
+
labelCoordinateAnchor?: 'center' | 'start' | 'middle' | 'end' | 'top' | 'right' | 'bottom' | 'left';
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Circle-specific properties for precise rendering
|
|
80
|
+
* Stored alongside the polygon approximation
|
|
81
|
+
*/
|
|
82
|
+
interface CircleProperties {
|
|
83
|
+
/** Center point as [longitude, latitude] */
|
|
84
|
+
center: [number, number];
|
|
85
|
+
/** Radius with value and units */
|
|
86
|
+
radius: {
|
|
87
|
+
/** Radius value */
|
|
88
|
+
value: number;
|
|
89
|
+
/** Units (hardcoded to kilometers for v1) */
|
|
90
|
+
units: 'kilometers';
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Custom geometry types supported
|
|
95
|
+
*/
|
|
96
|
+
type CustomGeometry = Point | LineString | Polygon;
|
|
97
|
+
/**
|
|
98
|
+
* GeoJSON Feature with style properties
|
|
99
|
+
*/
|
|
100
|
+
interface StyledFeature extends Feature {
|
|
101
|
+
properties: {
|
|
102
|
+
/** Style properties for rendering */
|
|
103
|
+
styleProperties: StyleProperties;
|
|
104
|
+
/** Circle properties (only for Circle type shapes) */
|
|
105
|
+
circleProperties?: CircleProperties;
|
|
106
|
+
/** Shape ID for correlation */
|
|
107
|
+
shapeId?: ShapeId;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Shape data structure for DisplayShapeLayer
|
|
112
|
+
*/
|
|
113
|
+
interface DisplayShape {
|
|
114
|
+
/** Unique identifier */
|
|
115
|
+
id: ShapeId;
|
|
116
|
+
/** Full shape name used internally and in UI */
|
|
117
|
+
name: string;
|
|
118
|
+
/**
|
|
119
|
+
* Optional short display label shown on the map
|
|
120
|
+
* If not provided, the `name` property will be used instead
|
|
121
|
+
* Useful for showing abbreviated text on the map (e.g., "NYC" vs "New York City Office")
|
|
122
|
+
*/
|
|
123
|
+
label?: string;
|
|
124
|
+
/** Shape type */
|
|
125
|
+
shapeType: ShapeFeatureTypeValues;
|
|
126
|
+
/** GeoJSON feature with geometry and style properties */
|
|
127
|
+
feature: ShapeFeature;
|
|
128
|
+
/** UTC timestamp (only set when saved) */
|
|
129
|
+
lastUpdated?: number;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Alias for backward compatibility
|
|
133
|
+
* @deprecated Use DisplayShape instead
|
|
134
|
+
*/
|
|
135
|
+
type EditableShape = DisplayShape;
|
|
136
|
+
/**
|
|
137
|
+
* Alias for ShapeFeatureType values
|
|
138
|
+
*/
|
|
139
|
+
type ShapeFeatureTypeValues = ShapeFeatureType;
|
|
140
|
+
/**
|
|
141
|
+
* Alias for StyledFeature (shape feature)
|
|
142
|
+
*/
|
|
143
|
+
type ShapeFeature = StyledFeature;
|
|
144
|
+
/**
|
|
145
|
+
* Alias for StyledFeature properties
|
|
146
|
+
*/
|
|
147
|
+
type ShapeFeatureProperties = StyledFeature['properties'];
|
|
148
|
+
/**
|
|
149
|
+
* Circle radius type
|
|
150
|
+
*/
|
|
151
|
+
type CircleRadius = CircleProperties['radius'];
|
|
152
|
+
/**
|
|
153
|
+
* Coordinate as [longitude, latitude]
|
|
154
|
+
*/
|
|
155
|
+
type Coordinate = [number, number];
|
|
156
|
+
//#endregion
|
|
157
|
+
export { CircleProperties, CircleRadius, Coordinate, CustomGeometry, DisplayShape, EditableShape, ShapeFeature, ShapeFeatureProperties, ShapeFeatureType, ShapeFeatureTypeValues, ShapeId, StrokePattern, StrokeWidth, StyleProperties, StyledFeature };
|
|
158
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -11,22 +11,19 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
import { uuid } from "@accelint/core";
|
|
16
|
-
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
'use client';
|
|
17
15
|
|
|
18
|
-
//#region src/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
16
|
+
//#region src/deckgl/shapes/shared/types.ts
|
|
17
|
+
/**
|
|
18
|
+
* Supported shape types
|
|
19
|
+
*/
|
|
20
|
+
const ShapeFeatureType = {
|
|
21
|
+
Circle: "Circle",
|
|
22
|
+
Polygon: "Polygon",
|
|
23
|
+
LineString: "LineString",
|
|
24
|
+
Point: "Point"
|
|
28
25
|
};
|
|
29
26
|
|
|
30
27
|
//#endregion
|
|
31
|
-
export {
|
|
32
|
-
//# sourceMappingURL=
|
|
28
|
+
export { ShapeFeatureType };
|
|
29
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +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';\n\n/**\n * Supported shape types\n */\nexport const ShapeFeatureType = {\n Circle: 'Circle',\n Polygon: 'Polygon',\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 * Stroke width options (in pixels)\n */\nexport type StrokeWidth = 1 | 2 | 4 | 8;\n\n/**\n * Stroke pattern options\n */\nexport type StrokePattern = '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 /** Stroke color as RGBA array [r, g, b, a] where each value is 0-255 */\n strokeColor: Color;\n /** Stroke width in pixels */\n strokeWidth: StrokeWidth;\n /** Stroke pattern */\n strokePattern: StrokePattern;\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 (hardcoded to kilometers for v1) */\n units: 'kilometers';\n };\n}\n\n/**\n * Custom geometry types supported\n */\nexport type CustomGeometry = Point | LineString | Polygon;\n\n/**\n * GeoJSON Feature with style properties\n */\nexport interface StyledFeature extends Feature {\n properties: {\n /** Style properties for rendering */\n styleProperties: StyleProperties;\n /** Circle properties (only for Circle type shapes) */\n circleProperties?: CircleProperties;\n /** Shape ID for correlation */\n shapeId?: ShapeId;\n };\n}\n\n/**\n * Shape data structure for DisplayShapeLayer\n */\nexport interface DisplayShape {\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 /** Shape type */\n shapeType: ShapeFeatureTypeValues;\n /** GeoJSON feature with geometry and style properties */\n feature: ShapeFeature;\n /** UTC timestamp (only set when saved) */\n lastUpdated?: number;\n}\n\n/**\n * Alias for backward compatibility\n * @deprecated Use DisplayShape instead\n */\nexport type EditableShape = DisplayShape;\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"],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,MAAa,mBAAmB;CAC9B,QAAQ;CACR,SAAS;CACT,YAAY;CACZ,OAAO;CACR"}
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import { AccessorContext, AccessorFunction, DefaultProps } from "@deck.gl/core";
|
|
13
14
|
import { IconLayer, IconLayerProps } from "@deck.gl/layers";
|
|
14
15
|
import { SymbolOptions } from "milsymbol";
|
|
15
|
-
import { AccessorContext, AccessorFunction, DefaultProps } from "@deck.gl/core";
|
|
16
16
|
|
|
17
17
|
//#region src/deckgl/symbol-layer/index.d.ts
|
|
18
18
|
type _SymbolLayerProps<TData = unknown> = {
|
|
@@ -24,7 +24,7 @@ import { IControl, Map, MapOptions } from "maplibre-gl";
|
|
|
24
24
|
* @param deck - The Deck.gl IControl instance to add to the map
|
|
25
25
|
* @param styleUrl - The MapLibre style URL to use for the map
|
|
26
26
|
* @param options - MapLibre map options (container, center, zoom, etc.)
|
|
27
|
-
* @returns
|
|
27
|
+
* @returns A ref containing the MapLibre map instance (ref.current may be null before initialization)
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
30
|
* ```tsx
|
|
@@ -48,7 +48,7 @@ import { IControl, Map, MapOptions } from "maplibre-gl";
|
|
|
48
48
|
* }
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
|
-
declare function useMapLibre(deck: IControl | null, styleUrl: string, options: MapOptions): Map | null
|
|
51
|
+
declare function useMapLibre(deck: IControl | null, styleUrl: string, options: MapOptions): React.RefObject<Map | null>;
|
|
52
52
|
//#endregion
|
|
53
53
|
export { useMapLibre };
|
|
54
54
|
//# sourceMappingURL=use-maplibre.d.ts.map
|
|
@@ -25,7 +25,7 @@ import { Map } from "maplibre-gl";
|
|
|
25
25
|
* @param deck - The Deck.gl IControl instance to add to the map
|
|
26
26
|
* @param styleUrl - The MapLibre style URL to use for the map
|
|
27
27
|
* @param options - MapLibre map options (container, center, zoom, etc.)
|
|
28
|
-
* @returns
|
|
28
|
+
* @returns A ref containing the MapLibre map instance (ref.current may be null before initialization)
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* ```tsx
|
|
@@ -75,7 +75,7 @@ function useMapLibre(deck, styleUrl, options) {
|
|
|
75
75
|
useEffect(() => {
|
|
76
76
|
if (mapRef.current) mapRef.current.setStyle(styleUrl);
|
|
77
77
|
}, [styleUrl]);
|
|
78
|
-
return mapRef
|
|
78
|
+
return mapRef;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-maplibre.js","names":["MapLibre"],"sources":["../../../src/maplibre/hooks/use-maplibre.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 IControl, Map as MapLibre, type MapOptions } from 'maplibre-gl';\nimport { useEffect, useRef } from 'react';\n\n/**\n * Hook to integrate a MapLibre GL map with a Deck.gl instance.\n *\n * This hook manages the lifecycle of a MapLibre map, including initialization,\n * style updates, and cleanup. It ensures the Deck.gl control is properly added\n * to the map and handles cleanup when the component unmounts.\n *\n * @param deck - The Deck.gl IControl instance to add to the map\n * @param styleUrl - The MapLibre style URL to use for the map\n * @param options - MapLibre map options (container, center, zoom, etc.)\n * @returns
|
|
1
|
+
{"version":3,"file":"use-maplibre.js","names":["MapLibre"],"sources":["../../../src/maplibre/hooks/use-maplibre.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 IControl, Map as MapLibre, type MapOptions } from 'maplibre-gl';\nimport { useEffect, useRef } from 'react';\n\n/**\n * Hook to integrate a MapLibre GL map with a Deck.gl instance.\n *\n * This hook manages the lifecycle of a MapLibre map, including initialization,\n * style updates, and cleanup. It ensures the Deck.gl control is properly added\n * to the map and handles cleanup when the component unmounts.\n *\n * @param deck - The Deck.gl IControl instance to add to the map\n * @param styleUrl - The MapLibre style URL to use for the map\n * @param options - MapLibre map options (container, center, zoom, etc.)\n * @returns A ref containing the MapLibre map instance (ref.current may be null before initialization)\n *\n * @example\n * ```tsx\n * function MapComponent() {\n * const deckglInstance = useDeckgl();\n * const container = useId();\n *\n * const mapOptions = useMemo(() => ({\n * container,\n * center: [-122.4, 37.8],\n * zoom: 12,\n * }), [container]);\n *\n * useMapLibre(\n * deckglInstance as IControl,\n * 'https://tiles.example.com/style.json',\n * mapOptions\n * );\n *\n * return <div id={container} />;\n * }\n * ```\n */\nexport function useMapLibre(\n deck: IControl | null,\n styleUrl: string,\n options: MapOptions,\n) {\n const mapRef = useRef<MapLibre | null>(null);\n // Using a ref for options to avoid re-creating the map when options object reference changes\n // The map is only created once on mount, options changes after that are ignored\n const optionsRef = useRef(options);\n // using a ref in the initial setup so that it doesn't cause a re-run of the effect on change\n const styleRef = useRef(styleUrl);\n\n // Initialize MapLibre instance once\n useEffect(() => {\n if (deck && !mapRef.current) {\n mapRef.current = new MapLibre({\n ...optionsRef.current,\n style: styleRef.current,\n });\n\n mapRef.current.once('style.load', () => {\n mapRef.current?.setProjection({ type: 'mercator' });\n mapRef.current?.addControl(deck);\n });\n\n return () => {\n if (mapRef.current) {\n mapRef.current.removeControl(deck);\n mapRef.current.remove();\n mapRef.current = null;\n }\n };\n }\n }, [deck]);\n\n // Update style when it changes\n useEffect(() => {\n if (mapRef.current) {\n mapRef.current.setStyle(styleUrl);\n }\n }, [styleUrl]);\n\n return mapRef;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,SAAgB,YACd,MACA,UACA,SACA;CACA,MAAM,SAAS,OAAwB,KAAK;CAG5C,MAAM,aAAa,OAAO,QAAQ;CAElC,MAAM,WAAW,OAAO,SAAS;AAGjC,iBAAgB;AACd,MAAI,QAAQ,CAAC,OAAO,SAAS;AAC3B,UAAO,UAAU,IAAIA,IAAS;IAC5B,GAAG,WAAW;IACd,OAAO,SAAS;IACjB,CAAC;AAEF,UAAO,QAAQ,KAAK,oBAAoB;AACtC,WAAO,SAAS,cAAc,EAAE,MAAM,YAAY,CAAC;AACnD,WAAO,SAAS,WAAW,KAAK;KAChC;AAEF,gBAAa;AACX,QAAI,OAAO,SAAS;AAClB,YAAO,QAAQ,cAAc,KAAK;AAClC,YAAO,QAAQ,QAAQ;AACvB,YAAO,UAAU;;;;IAItB,CAAC,KAAK,CAAC;AAGV,iBAAgB;AACd,MAAI,OAAO,QACT,QAAO,QAAQ,SAAS,SAAS;IAElC,CAAC,SAAS,CAAC;AAEd,QAAO"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { SupportedDistanceUnit } from "./types.js";
|
|
14
14
|
import { ComponentPropsWithRef } from "react";
|
|
15
15
|
import { UniqueId } from "@accelint/core";
|
|
16
|
-
import * as
|
|
16
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
17
17
|
|
|
18
18
|
//#region src/viewport/viewport-size.d.ts
|
|
19
19
|
type ViewportSizeProps = ComponentPropsWithRef<'span'> & {
|
|
@@ -48,7 +48,7 @@ declare function ViewportSize({
|
|
|
48
48
|
instanceId,
|
|
49
49
|
unit,
|
|
50
50
|
...rest
|
|
51
|
-
}: ViewportSizeProps):
|
|
51
|
+
}: ViewportSizeProps): react_jsx_runtime1.JSX.Element;
|
|
52
52
|
//#endregion
|
|
53
53
|
export { ViewportSize, ViewportSizeProps };
|
|
54
54
|
//# sourceMappingURL=viewport-size.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@accelint/map-toolkit",
|
|
3
3
|
"description": "A collection of components and utilities to simplify visualizing and working with geospatial data.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"author": "https://hypergiant.com",
|
|
6
6
|
"$schema": "https://json.schemastore.org/package",
|
|
7
7
|
"devDependencies": {
|
|
8
8
|
"@deck.gl/core": "~9.1",
|
|
9
9
|
"@deck.gl/extensions": "~9.1",
|
|
10
|
-
"@deck.gl/geo-layers": "~9.1",
|
|
11
10
|
"@deck.gl/layers": "~9.1",
|
|
12
|
-
"@deck.gl/mapbox": "~9.1",
|
|
13
|
-
"@deck.gl/mesh-layers": "~9.1",
|
|
14
|
-
"@deck.gl/widgets": "~9.1",
|
|
15
11
|
"@deckgl-fiber-renderer/dom": "^1.4.0",
|
|
16
12
|
"@deckgl-fiber-renderer/shared": "^1.4.0",
|
|
17
13
|
"@deckgl-fiber-renderer/types": "^1.4.0",
|
|
@@ -24,6 +20,7 @@
|
|
|
24
20
|
"@testing-library/jest-dom": "^6.9.1",
|
|
25
21
|
"@testing-library/react": "^16.3.0",
|
|
26
22
|
"@testing-library/user-event": "^14.6.1",
|
|
23
|
+
"@types/geojson": "^7946.0.14",
|
|
27
24
|
"@types/node": "^22",
|
|
28
25
|
"@types/react": "^19",
|
|
29
26
|
"@types/react-dom": "^19",
|
|
@@ -34,6 +31,7 @@
|
|
|
34
31
|
"node-fetch": "^2.6.7",
|
|
35
32
|
"react": "^19",
|
|
36
33
|
"react-dom": "^19",
|
|
34
|
+
"remark-gfm": "^4.0.1",
|
|
37
35
|
"storybook": "^9.1.16",
|
|
38
36
|
"tailwindcss": "^4.1.18",
|
|
39
37
|
"tsdown": "^0.18.0",
|
|
@@ -44,32 +42,53 @@
|
|
|
44
42
|
"@accelint/biome-config": "1.0.2",
|
|
45
43
|
"@accelint/bus": "3.0.2",
|
|
46
44
|
"@accelint/core": "0.5.2",
|
|
47
|
-
"@accelint/design-
|
|
48
|
-
"@accelint/
|
|
49
|
-
"@accelint/
|
|
45
|
+
"@accelint/design-toolkit": "9.1.1",
|
|
46
|
+
"@accelint/geo": "0.5.0",
|
|
47
|
+
"@accelint/postcss-tailwind-css-modules": "1.0.1",
|
|
48
|
+
"@accelint/smeegl": "0.3.4",
|
|
50
49
|
"@accelint/typescript-config": "0.1.4",
|
|
51
|
-
"@accelint/vitest-config": "0.1.6"
|
|
50
|
+
"@accelint/vitest-config": "0.1.6",
|
|
51
|
+
"@accelint/design-foundation": "2.0.0"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=22",
|
|
55
55
|
"pnpm": ">=10"
|
|
56
56
|
},
|
|
57
57
|
"exports": {
|
|
58
|
+
"./camera": "./dist/camera/index.js",
|
|
59
|
+
"./camera/events": "./dist/camera/events.js",
|
|
60
|
+
"./camera/types": "./dist/camera/types.js",
|
|
61
|
+
"./camera/use-camera-state": "./dist/camera/use-camera-state.js",
|
|
58
62
|
"./cursor-coordinates": "./dist/cursor-coordinates/index.js",
|
|
59
63
|
"./cursor-coordinates/use-cursor-coordinates": "./dist/cursor-coordinates/use-cursor-coordinates.js",
|
|
60
64
|
"./deckgl": "./dist/deckgl/index.js",
|
|
61
65
|
"./deckgl/base-map": "./dist/deckgl/base-map/index.js",
|
|
62
66
|
"./deckgl/base-map/constants": "./dist/deckgl/base-map/constants.js",
|
|
67
|
+
"./deckgl/base-map/controls": "./dist/deckgl/base-map/controls.js",
|
|
63
68
|
"./deckgl/base-map/events": "./dist/deckgl/base-map/events.js",
|
|
64
69
|
"./deckgl/base-map/provider": "./dist/deckgl/base-map/provider.js",
|
|
65
70
|
"./deckgl/base-map/types": "./dist/deckgl/base-map/types.js",
|
|
71
|
+
"./deckgl/saved-viewports": "./dist/deckgl/saved-viewports/index.js",
|
|
72
|
+
"./deckgl/saved-viewports/storage": "./dist/deckgl/saved-viewports/storage.js",
|
|
73
|
+
"./deckgl/shapes": "./dist/deckgl/shapes/index.js",
|
|
74
|
+
"./deckgl/shapes/display-shape-layer": "./dist/deckgl/shapes/display-shape-layer/index.js",
|
|
75
|
+
"./deckgl/shapes/display-shape-layer/constants": "./dist/deckgl/shapes/display-shape-layer/constants.js",
|
|
76
|
+
"./deckgl/shapes/display-shape-layer/fiber": "./dist/deckgl/shapes/display-shape-layer/fiber.js",
|
|
77
|
+
"./deckgl/shapes/display-shape-layer/shape-label-layer": "./dist/deckgl/shapes/display-shape-layer/shape-label-layer.js",
|
|
78
|
+
"./deckgl/shapes/display-shape-layer/store": "./dist/deckgl/shapes/display-shape-layer/store.js",
|
|
79
|
+
"./deckgl/shapes/display-shape-layer/types": "./dist/deckgl/shapes/display-shape-layer/types.js",
|
|
80
|
+
"./deckgl/shapes/display-shape-layer/use-shape-selection": "./dist/deckgl/shapes/display-shape-layer/use-shape-selection.js",
|
|
81
|
+
"./deckgl/shapes/display-shape-layer/utils/display-style": "./dist/deckgl/shapes/display-shape-layer/utils/display-style.js",
|
|
82
|
+
"./deckgl/shapes/display-shape-layer/utils/labels": "./dist/deckgl/shapes/display-shape-layer/utils/labels.js",
|
|
83
|
+
"./deckgl/shapes/shared/constants": "./dist/deckgl/shapes/shared/constants.js",
|
|
84
|
+
"./deckgl/shapes/shared/events": "./dist/deckgl/shapes/shared/events.js",
|
|
85
|
+
"./deckgl/shapes/shared/types": "./dist/deckgl/shapes/shared/types.js",
|
|
66
86
|
"./deckgl/symbol-layer": "./dist/deckgl/symbol-layer/index.js",
|
|
67
87
|
"./deckgl/symbol-layer/fiber": "./dist/deckgl/symbol-layer/fiber.js",
|
|
68
88
|
"./deckgl/text-layer": "./dist/deckgl/text-layer/index.js",
|
|
69
89
|
"./deckgl/text-layer/character-sets": "./dist/deckgl/text-layer/character-sets.js",
|
|
70
90
|
"./deckgl/text-layer/default-settings": "./dist/deckgl/text-layer/default-settings.js",
|
|
71
91
|
"./deckgl/text-layer/fiber": "./dist/deckgl/text-layer/fiber.js",
|
|
72
|
-
"./decorators/deckgl": "./dist/decorators/deckgl.js",
|
|
73
92
|
"./map-cursor": "./dist/map-cursor/index.js",
|
|
74
93
|
"./map-cursor/events": "./dist/map-cursor/events.js",
|
|
75
94
|
"./map-cursor/store": "./dist/map-cursor/store.js",
|
|
@@ -106,26 +125,26 @@
|
|
|
106
125
|
],
|
|
107
126
|
"license": "Apache-2.0",
|
|
108
127
|
"optionalDependencies": {
|
|
109
|
-
"@deck.gl/core": "9.1
|
|
110
|
-
"@deck.gl/extensions": "9.1
|
|
111
|
-
"@deck.gl/
|
|
112
|
-
"@
|
|
113
|
-
"@deck.gl/mapbox": "9.1.14",
|
|
114
|
-
"@deck.gl/mesh-layers": "9.1.14",
|
|
115
|
-
"@deck.gl/widgets": "9.1.14",
|
|
116
|
-
"@deckgl-fiber-renderer/dom": "1.4.0",
|
|
128
|
+
"@deck.gl/core": "~9.1",
|
|
129
|
+
"@deck.gl/extensions": "~9.1",
|
|
130
|
+
"@deck.gl/layers": "~9.1",
|
|
131
|
+
"@deckgl-fiber-renderer/dom": "^1.4.0",
|
|
117
132
|
"@deckgl-fiber-renderer/shared": "^1.4.0",
|
|
118
133
|
"@deckgl-fiber-renderer/types": "^1.4.0",
|
|
134
|
+
"@math.gl/web-mercator": "^4.1.0",
|
|
119
135
|
"maplibre-gl": "^5.7.1",
|
|
120
|
-
"milsymbol": "3.0.2",
|
|
121
|
-
"mjolnir.js": "^3.0.0"
|
|
136
|
+
"milsymbol": "^3.0.2",
|
|
137
|
+
"mjolnir.js": "^3.0.0",
|
|
138
|
+
"react-map-gl": "^8.1.0",
|
|
139
|
+
"@accelint/hotkey-manager": "0.1.3"
|
|
122
140
|
},
|
|
123
141
|
"owner": "default/pathfinder",
|
|
124
142
|
"peerDependencies": {
|
|
143
|
+
"@types/geojson": "^7946.0.14",
|
|
125
144
|
"react": "^19",
|
|
126
145
|
"@accelint/bus": "3.0.2",
|
|
127
146
|
"@accelint/core": "0.5.2",
|
|
128
|
-
"@accelint/geo": "0.
|
|
147
|
+
"@accelint/geo": "0.5.0"
|
|
129
148
|
},
|
|
130
149
|
"private": false,
|
|
131
150
|
"publishConfig": {
|
|
@@ -135,21 +154,29 @@
|
|
|
135
154
|
"type": "git",
|
|
136
155
|
"url": "https://github.com/gohypergiant/standard-toolkit"
|
|
137
156
|
},
|
|
138
|
-
"sideEffects":
|
|
157
|
+
"sideEffects": [
|
|
158
|
+
"./src/deckgl/shapes/display-shape-layer/fiber.ts",
|
|
159
|
+
"./src/deckgl/symbol-layer/fiber.ts",
|
|
160
|
+
"./src/deckgl/text-layer/fiber.ts",
|
|
161
|
+
"./dist/deckgl/shapes/display-shape-layer/fiber.js",
|
|
162
|
+
"./dist/deckgl/symbol-layer/fiber.js",
|
|
163
|
+
"./dist/deckgl/text-layer/fiber.js"
|
|
164
|
+
],
|
|
139
165
|
"subPath": "packages/map-toolkit",
|
|
140
166
|
"title": "Accelint Map Toolkit",
|
|
141
167
|
"type": "module",
|
|
142
|
-
"types": "./dist/index.d.ts",
|
|
143
168
|
"scripts": {
|
|
144
169
|
"bench": "pnpm vitest bench --run --dir src",
|
|
145
170
|
"build": "pnpm tsdown",
|
|
146
171
|
"build-storybook": "pnpm storybook build",
|
|
172
|
+
"build:icons": "smeegl --in '.storybook/icons' --out 'src/deckgl/shapes/__fixtures__/atlas'",
|
|
147
173
|
"constellation-tracker": "pnpm exec constellation-tracker",
|
|
148
174
|
"dev": "pnpm tsc --watch",
|
|
149
175
|
"format": "pnpm biome format . --write --verbose",
|
|
150
176
|
"format:check": "pnpm biome format . --verbose",
|
|
151
177
|
"license": "pnpm zx ../../scripts/license.mjs",
|
|
152
178
|
"lint": "pnpm biome lint . --verbose",
|
|
179
|
+
"lint:package": "pnpm publint",
|
|
153
180
|
"preview": "pnpm storybook dev -p 6007",
|
|
154
181
|
"test": "pnpm vitest --dir=src",
|
|
155
182
|
"test:watch": "pnpm vitest --dir=src --watch"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deckgl.js","names":[],"sources":["../../src/decorators/deckgl.tsx"],"sourcesContent":["// __private-exports\n\n/*\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 { uuid } from '@accelint/core';\nimport { BaseMap } from '../deckgl/base-map';\nimport type { Decorator } from '@storybook/react-vite';\n\n// Module-level constant - stable across all Storybook renders\nconst STORYBOOK_MAP_ID = uuid();\n\nexport const withDeckGL = (): Decorator => {\n return (Story) => {\n return (\n <BaseMap className='h-dvh w-dvw' id={STORYBOOK_MAP_ID}>\n <Story />\n </BaseMap>\n );\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,MAAM,mBAAmB,MAAM;AAE/B,MAAa,mBAA8B;AACzC,SAAQ,UAAU;AAChB,SACE,oBAAC;GAAQ,WAAU;GAAc,IAAI;aACnC,oBAAC,UAAQ;IACD"}
|