@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.
- package/CHANGELOG.md +49 -24
- package/catalog-info.yaml +5 -7
- package/dist/cursor-coordinates/index.d.ts +14 -3
- package/dist/cursor-coordinates/index.js +16 -3
- package/dist/cursor-coordinates/use-cursor-coordinates.d.ts +20 -6
- package/dist/cursor-coordinates/use-cursor-coordinates.js +247 -128
- package/dist/cursor-coordinates/use-cursor-coordinates.js.map +1 -1
- package/dist/deckgl/base-map/constants.d.ts +14 -12
- package/dist/deckgl/base-map/constants.js +26 -12
- package/dist/deckgl/base-map/constants.js.map +1 -1
- package/dist/deckgl/base-map/events.d.ts +6 -4
- package/dist/deckgl/base-map/events.js +18 -4
- package/dist/deckgl/base-map/events.js.map +1 -1
- package/dist/deckgl/base-map/index.d.ts +45 -18
- package/dist/deckgl/base-map/index.js +216 -148
- package/dist/deckgl/base-map/index.js.map +1 -1
- package/dist/deckgl/base-map/provider.d.ts +48 -32
- package/dist/deckgl/base-map/provider.js +122 -11
- package/dist/deckgl/base-map/provider.js.map +1 -1
- package/dist/deckgl/base-map/types.d.ts +49 -39
- package/dist/deckgl/base-map/types.js +11 -2
- package/dist/deckgl/index.d.ts +18 -13
- package/dist/deckgl/index.js +19 -6
- package/dist/deckgl/symbol-layer/fiber.d.ts +21 -10
- package/dist/deckgl/symbol-layer/fiber.js +18 -3
- package/dist/deckgl/symbol-layer/fiber.js.map +1 -1
- package/dist/deckgl/symbol-layer/index.d.ts +68 -54
- package/dist/deckgl/symbol-layer/index.js +105 -85
- package/dist/deckgl/symbol-layer/index.js.map +1 -1
- package/dist/deckgl/text-layer/character-sets.d.ts +19 -17
- package/dist/deckgl/text-layer/character-sets.js +40 -19
- package/dist/deckgl/text-layer/character-sets.js.map +1 -1
- package/dist/deckgl/text-layer/default-settings.d.ts +16 -2
- package/dist/deckgl/text-layer/default-settings.js +42 -18
- package/dist/deckgl/text-layer/default-settings.js.map +1 -1
- package/dist/deckgl/text-layer/fiber.d.ts +38 -27
- package/dist/deckgl/text-layer/fiber.js +18 -3
- package/dist/deckgl/text-layer/fiber.js.map +1 -1
- package/dist/deckgl/text-layer/index.d.ts +39 -25
- package/dist/deckgl/text-layer/index.js +47 -29
- package/dist/deckgl/text-layer/index.js.map +1 -1
- package/dist/decorators/deckgl.d.ts +16 -2
- package/dist/decorators/deckgl.js +25 -7
- package/dist/decorators/deckgl.js.map +1 -1
- package/dist/map-cursor/events.d.ts +16 -0
- package/dist/map-cursor/events.js +27 -0
- package/dist/map-cursor/events.js.map +1 -0
- package/dist/map-cursor/index.d.ts +17 -0
- package/dist/map-cursor/index.js +18 -0
- package/dist/map-cursor/store.d.ts +93 -0
- package/dist/map-cursor/store.js +351 -0
- package/dist/map-cursor/store.js.map +1 -0
- package/dist/map-cursor/types.d.ts +81 -0
- package/dist/map-cursor/types.js +12 -0
- package/dist/map-cursor/use-map-cursor.d.ts +99 -0
- package/dist/map-cursor/use-map-cursor.js +116 -0
- package/dist/map-cursor/use-map-cursor.js.map +1 -0
- package/dist/map-mode/events.d.ts +11 -9
- package/dist/map-mode/events.js +43 -9
- package/dist/map-mode/events.js.map +1 -1
- package/dist/map-mode/index.d.ts +17 -6
- package/dist/map-mode/index.js +18 -5
- package/dist/map-mode/store.d.ts +26 -3
- package/dist/map-mode/store.js +329 -265
- package/dist/map-mode/store.js.map +1 -1
- package/dist/map-mode/types.d.ts +49 -35
- package/dist/map-mode/types.js +11 -2
- package/dist/map-mode/use-map-mode.d.ts +21 -7
- package/dist/map-mode/use-map-mode.js +66 -23
- package/dist/map-mode/use-map-mode.js.map +1 -1
- package/dist/maplibre/constants.d.ts +10 -8
- package/dist/maplibre/constants.js +22 -8
- package/dist/maplibre/constants.js.map +1 -1
- package/dist/maplibre/hooks/use-maplibre.d.ts +17 -2
- package/dist/maplibre/hooks/use-maplibre.js +77 -31
- package/dist/maplibre/hooks/use-maplibre.js.map +1 -1
- package/dist/maplibre/index.d.ts +15 -3
- package/dist/maplibre/index.js +17 -4
- package/dist/viewport/constants.d.ts +8 -6
- package/dist/viewport/constants.js +20 -6
- package/dist/viewport/constants.js.map +1 -1
- package/dist/viewport/index.d.ts +18 -13
- package/dist/viewport/index.js +19 -6
- package/dist/viewport/types.d.ts +27 -17
- package/dist/viewport/types.js +11 -2
- package/dist/viewport/use-viewport-state.d.ts +29 -14
- package/dist/viewport/use-viewport-state.js +200 -87
- package/dist/viewport/use-viewport-state.js.map +1 -1
- package/dist/viewport/utils.d.ts +25 -10
- package/dist/viewport/utils.js +67 -37
- package/dist/viewport/utils.js.map +1 -1
- package/dist/viewport/viewport-size.d.ts +27 -15
- package/dist/viewport/viewport-size.js +54 -11
- package/dist/viewport/viewport-size.js.map +1 -1
- package/package.json +107 -78
- package/dist/cursor-coordinates/index.js.map +0 -1
- package/dist/deckgl/base-map/types.js.map +0 -1
- package/dist/deckgl/index.js.map +0 -1
- package/dist/map-mode/index.js.map +0 -1
- package/dist/map-mode/types.js.map +0 -1
- package/dist/maplibre/index.js.map +0 -1
- package/dist/metafile-esm.json +0 -1
- package/dist/viewport/index.js.map +0 -1
- package/dist/viewport/types.js.map +0 -1
|
@@ -1,9 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
*/
|
|
4
12
|
|
|
13
|
+
import { CharacterSetsKeys } from "./character-sets.js";
|
|
14
|
+
import { TextLayer as TextLayer$1, TextLayerProps as TextLayerProps$1 } from "@deck.gl/layers";
|
|
15
|
+
import { LiteralUnion } from "type-fest";
|
|
16
|
+
|
|
17
|
+
//#region src/deckgl/text-layer/index.d.ts
|
|
5
18
|
interface TextLayerProps<TData = unknown> extends TextLayerProps$1<TData> {
|
|
6
|
-
|
|
19
|
+
characterSet?: LiteralUnion<CharacterSetsKeys, string>;
|
|
7
20
|
}
|
|
8
21
|
/**
|
|
9
22
|
* A styled text layer that extends Deck.gl's TextLayer with enhanced styling capabilities.
|
|
@@ -19,25 +32,26 @@ interface TextLayerProps<TData = unknown> extends TextLayerProps$1<TData> {
|
|
|
19
32
|
* - Direct: `new TextLayer({ id: 'text', data: [...], ... })`
|
|
20
33
|
*/
|
|
21
34
|
declare class TextLayer<TData = unknown> extends TextLayer$1<TData> {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
static CHARACTER_SETS: Readonly<{
|
|
36
|
+
readonly ALL_NUMBERS: "1234567890";
|
|
37
|
+
readonly ASCII_ALL: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 !\"#$%&'()*+,-./:;<=>?@[]^_`{|}~";
|
|
38
|
+
readonly ASCII_ALPHA_NUMERIC: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
|
|
39
|
+
readonly ASCII_LETTERS: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
40
|
+
readonly ASCII_LETTERS_LOWERCASE: "abcdefghijklmnopqrstuvwxyz";
|
|
41
|
+
readonly ASCII_LETTERS_UPPERCASE: "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
42
|
+
readonly ASCII_SYMBOLS: " !\"#$%&'()*+,-./:;<=>?@[]^_`{|}~";
|
|
43
|
+
readonly AUTO: "auto";
|
|
44
|
+
readonly EXPANDED: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 !\"#$%&'()*+,-./:;<=>?@[]^_`{|}~àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ1234567890 ¡¿¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿×÷";
|
|
45
|
+
readonly LATIN_ALL: "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ1234567890 ¡¿¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿×÷";
|
|
46
|
+
readonly LATIN_ALPHA_NUMERIC: "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ1234567890";
|
|
47
|
+
readonly LATIN_LETTERS: "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ";
|
|
48
|
+
readonly LATIN_LETTERS_LOWERCASE: "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿß";
|
|
49
|
+
readonly LATIN_LETTERS_UPPERCASE: "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ";
|
|
50
|
+
readonly LATIN_SYMBOLS: " ¡¿¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿×÷";
|
|
51
|
+
}>;
|
|
52
|
+
static layerName: string;
|
|
53
|
+
constructor(props: TextLayerProps<TData>);
|
|
41
54
|
}
|
|
42
|
-
|
|
43
|
-
export { TextLayer,
|
|
55
|
+
//#endregion
|
|
56
|
+
export { TextLayer, TextLayerProps };
|
|
57
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,33 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
*/
|
|
4
12
|
|
|
5
|
-
class TextLayer extends TextLayer$1 {
|
|
6
|
-
static CHARACTER_SETS = CHARACTER_SETS;
|
|
7
|
-
static layerName = "textLayer";
|
|
8
|
-
constructor(props) {
|
|
9
|
-
const {
|
|
10
|
-
characterSet = CHARACTER_SETS.EXPANDED,
|
|
11
|
-
fontSettings,
|
|
12
|
-
...rest
|
|
13
|
-
} = props;
|
|
14
|
-
super({
|
|
15
|
-
// set opinionated defaults
|
|
16
|
-
...defaultSettings,
|
|
17
|
-
// user props override defaults
|
|
18
|
-
...rest,
|
|
19
|
-
// handle special characterSet logic
|
|
20
|
-
characterSet: CHARACTER_SETS[characterSet] ?? characterSet,
|
|
21
|
-
fontSettings: {
|
|
22
|
-
// merge fontSettings
|
|
23
|
-
...defaultSettings.fontSettings,
|
|
24
|
-
// user props override defaults
|
|
25
|
-
...fontSettings
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
13
|
|
|
14
|
+
import { CHARACTER_SETS } from "./character-sets.js";
|
|
15
|
+
import { defaultSettings } from "./default-settings.js";
|
|
16
|
+
import { TextLayer as TextLayer$1 } from "@deck.gl/layers";
|
|
17
|
+
|
|
18
|
+
//#region src/deckgl/text-layer/index.ts
|
|
19
|
+
/**
|
|
20
|
+
* A styled text layer that extends Deck.gl's TextLayer with enhanced styling capabilities.
|
|
21
|
+
*
|
|
22
|
+
* This layer provides:
|
|
23
|
+
* - Customizable font styling (size, weight, family, line height)
|
|
24
|
+
* - Text outline support
|
|
25
|
+
* - Extended character set support
|
|
26
|
+
* - Consistent styling based on design specifications
|
|
27
|
+
*
|
|
28
|
+
* Can be used directly with Deck.gl or as a JSX element with React Fiber:
|
|
29
|
+
* - React Fiber: `<textLayer id="text" data={[...]} ... />`
|
|
30
|
+
* - Direct: `new TextLayer({ id: 'text', data: [...], ... })`
|
|
31
|
+
*/
|
|
32
|
+
var TextLayer = class extends TextLayer$1 {
|
|
33
|
+
static CHARACTER_SETS = CHARACTER_SETS;
|
|
34
|
+
static layerName = "textLayer";
|
|
35
|
+
constructor(props) {
|
|
36
|
+
const { characterSet = CHARACTER_SETS.EXPANDED, fontSettings, ...rest } = props;
|
|
37
|
+
super({
|
|
38
|
+
...defaultSettings,
|
|
39
|
+
...rest,
|
|
40
|
+
characterSet: CHARACTER_SETS[characterSet] ?? characterSet,
|
|
41
|
+
fontSettings: {
|
|
42
|
+
...defaultSettings.fontSettings,
|
|
43
|
+
...fontSettings
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
31
50
|
export { TextLayer };
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
|
33
51
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["DglTextLayer"],"sources":["../../../src/deckgl/text-layer/index.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n TextLayer as DglTextLayer,\n type TextLayerProps as DglTextLayerProps,\n} from '@deck.gl/layers';\nimport { CHARACTER_SETS, type CharacterSetsKeys } from './character-sets.js';\nimport { defaultSettings } from './default-settings.js';\nimport type { LiteralUnion } from 'type-fest';\n\nexport interface TextLayerProps<TData = unknown>\n extends DglTextLayerProps<TData> {\n // A union type that preserves autocompletion for CharacterSetsKeys while allowing any string.\n characterSet?: LiteralUnion<CharacterSetsKeys, string>;\n}\n\n/**\n * A styled text layer that extends Deck.gl's TextLayer with enhanced styling capabilities.\n *\n * This layer provides:\n * - Customizable font styling (size, weight, family, line height)\n * - Text outline support\n * - Extended character set support\n * - Consistent styling based on design specifications\n *\n * Can be used directly with Deck.gl or as a JSX element with React Fiber:\n * - React Fiber: `<textLayer id=\"text\" data={[...]} ... />`\n * - Direct: `new TextLayer({ id: 'text', data: [...], ... })`\n */\nexport class TextLayer<TData = unknown> extends DglTextLayer<TData> {\n static CHARACTER_SETS = CHARACTER_SETS;\n\n static override layerName = 'textLayer';\n\n constructor(props: TextLayerProps<TData>) {\n const {\n characterSet = CHARACTER_SETS.EXPANDED,\n fontSettings,\n ...rest\n } = props;\n\n super({\n // set opinionated defaults\n ...defaultSettings,\n\n // user props override defaults\n ...rest,\n\n // handle special characterSet logic\n characterSet:\n CHARACTER_SETS[characterSet as CharacterSetsKeys] ?? characterSet,\n\n fontSettings: {\n // merge fontSettings\n ...defaultSettings.fontSettings,\n\n // user props override defaults\n ...fontSettings,\n },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,IAAa,YAAb,cAAgDA,YAAoB;CAClE,OAAO,iBAAiB;CAExB,OAAgB,YAAY;CAE5B,YAAY,OAA8B;EACxC,MAAM,EACJ,eAAe,eAAe,UAC9B,cACA,GAAG,SACD;AAEJ,QAAM;GAEJ,GAAG;GAGH,GAAG;GAGH,cACE,eAAe,iBAAsC;GAEvD,cAAc;IAEZ,GAAG,gBAAgB;IAGnB,GAAG;IACJ;GACF,CAAC"}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
|
|
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
|
+
*/
|
|
2
12
|
|
|
3
|
-
|
|
13
|
+
import { Decorator } from "@storybook/react-vite";
|
|
4
14
|
|
|
15
|
+
//#region src/decorators/deckgl.d.ts
|
|
16
|
+
declare const withDeckGL: () => Decorator;
|
|
17
|
+
//#endregion
|
|
5
18
|
export { withDeckGL };
|
|
19
|
+
//# sourceMappingURL=deckgl.d.ts.map
|
|
@@ -1,14 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
*/
|
|
4
12
|
|
|
13
|
+
|
|
14
|
+
import { BaseMap } from "../deckgl/base-map/index.js";
|
|
15
|
+
import { uuid } from "@accelint/core";
|
|
16
|
+
import { jsx } from "react/jsx-runtime";
|
|
17
|
+
|
|
18
|
+
//#region src/decorators/deckgl.tsx
|
|
5
19
|
const STORYBOOK_MAP_ID = uuid();
|
|
6
20
|
const withDeckGL = () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
21
|
+
return (Story) => {
|
|
22
|
+
return /* @__PURE__ */ jsx(BaseMap, {
|
|
23
|
+
className: "h-dvh w-dvw",
|
|
24
|
+
id: STORYBOOK_MAP_ID,
|
|
25
|
+
children: /* @__PURE__ */ jsx(Story, {})
|
|
26
|
+
});
|
|
27
|
+
};
|
|
10
28
|
};
|
|
11
29
|
|
|
30
|
+
//#endregion
|
|
12
31
|
export { withDeckGL };
|
|
13
|
-
//# sourceMappingURL=deckgl.js.map
|
|
14
32
|
//# sourceMappingURL=deckgl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/map-cursor/events.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Event keys for map cursor state changes.
|
|
4
|
+
* These events are used for communication between cursor stores and consumers.
|
|
5
|
+
*/
|
|
6
|
+
declare const MapCursorEvents: {
|
|
7
|
+
/** Emitted when a component requests a cursor change */
|
|
8
|
+
readonly changeRequest: "cursor:change-request";
|
|
9
|
+
/** Emitted when the cursor has been changed */
|
|
10
|
+
readonly changed: "cursor:changed";
|
|
11
|
+
/** Emitted when a cursor change request is rejected */
|
|
12
|
+
readonly rejected: "cursor:rejected";
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { MapCursorEvents };
|
|
16
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
//#region src/map-cursor/events.ts
|
|
15
|
+
/**
|
|
16
|
+
* Event keys for map cursor state changes.
|
|
17
|
+
* These events are used for communication between cursor stores and consumers.
|
|
18
|
+
*/
|
|
19
|
+
const MapCursorEvents = {
|
|
20
|
+
changeRequest: "cursor:change-request",
|
|
21
|
+
changed: "cursor:changed",
|
|
22
|
+
rejected: "cursor:rejected"
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { MapCursorEvents };
|
|
27
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","names":[],"sources":["../../src/map-cursor/events.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/**\n * Event keys for map cursor state changes.\n * These events are used for communication between cursor stores and consumers.\n */\nexport const MapCursorEvents = {\n /** Emitted when a component requests a cursor change */\n changeRequest: 'cursor:change-request',\n /** Emitted when the cursor has been changed */\n changed: 'cursor:changed',\n /** Emitted when a cursor change request is rejected */\n rejected: 'cursor:rejected',\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA,MAAa,kBAAkB;CAE7B,eAAe;CAEf,SAAS;CAET,UAAU;CACX"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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 { MapCursorEvents } from "./events.js";
|
|
14
|
+
import { CSSCursorType, CursorChangeRequestEvent, CursorChangedEvent, CursorRejectedEvent, MapCursorEventType } from "./types.js";
|
|
15
|
+
import { destroyStore, getOrCreateStore } from "./store.js";
|
|
16
|
+
import { UseMapCursorReturn, useMapCursor, useMapCursorEffect } from "./use-map-cursor.js";
|
|
17
|
+
export { type CSSCursorType, type CursorChangeRequestEvent, type CursorChangedEvent, type CursorRejectedEvent, type MapCursorEventType, MapCursorEvents, type UseMapCursorReturn, destroyStore, getOrCreateStore, useMapCursor, useMapCursorEffect };
|
|
@@ -0,0 +1,18 @@
|
|
|
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 { MapCursorEvents } from "./events.js";
|
|
15
|
+
import { destroyStore, getOrCreateStore } from "./store.js";
|
|
16
|
+
import { useMapCursor, useMapCursorEffect } from "./use-map-cursor.js";
|
|
17
|
+
|
|
18
|
+
export { MapCursorEvents, destroyStore, getOrCreateStore, useMapCursor, useMapCursorEffect };
|
|
@@ -0,0 +1,93 @@
|
|
|
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 { CSSCursorType } from "./types.js";
|
|
14
|
+
import { UniqueId } from "@accelint/core";
|
|
15
|
+
|
|
16
|
+
//#region src/map-cursor/store.d.ts
|
|
17
|
+
/**
|
|
18
|
+
* Creates or retrieves a cached subscription function for a given instanceId.
|
|
19
|
+
* Uses a fan-out pattern: 1 bus listener -> N React subscribers.
|
|
20
|
+
* Automatically cleans up cursor state when the last subscriber unsubscribes.
|
|
21
|
+
*
|
|
22
|
+
* @param instanceId - The unique identifier for the map cursor instance
|
|
23
|
+
* @returns A subscription function for useSyncExternalStore
|
|
24
|
+
*/
|
|
25
|
+
declare function getOrCreateSubscription(instanceId: UniqueId): (onStoreChange: () => void) => () => void;
|
|
26
|
+
/**
|
|
27
|
+
* Creates or retrieves a cached snapshot function for a given instanceId.
|
|
28
|
+
* The cursor returned gets equality checked, so it needs to be stable or React re-renders unnecessarily.
|
|
29
|
+
*
|
|
30
|
+
* @param instanceId - The unique identifier for the map cursor instance
|
|
31
|
+
* @returns A snapshot function for useSyncExternalStore
|
|
32
|
+
*/
|
|
33
|
+
declare function getOrCreateSnapshot(instanceId: UniqueId): () => CSSCursorType;
|
|
34
|
+
/**
|
|
35
|
+
* Creates or retrieves a cached server snapshot function for a given instanceId.
|
|
36
|
+
* Server snapshots always return the default cursor since cursor state is client-only.
|
|
37
|
+
* Required for SSR/RSC compatibility with useSyncExternalStore.
|
|
38
|
+
*
|
|
39
|
+
* @param instanceId - The unique identifier for the map cursor instance
|
|
40
|
+
* @returns A server snapshot function for useSyncExternalStore
|
|
41
|
+
*/
|
|
42
|
+
declare function getOrCreateServerSnapshot(instanceId: UniqueId): () => CSSCursorType;
|
|
43
|
+
/**
|
|
44
|
+
* Creates or retrieves a cached requestCursorChange function for a given instanceId.
|
|
45
|
+
* This maintains referential stability for the function reference.
|
|
46
|
+
*
|
|
47
|
+
* @param instanceId - The unique identifier for the map cursor instance
|
|
48
|
+
* @returns A requestCursorChange function for this instance
|
|
49
|
+
*/
|
|
50
|
+
declare function getOrCreateRequestCursorChange(instanceId: UniqueId): (cursor: CSSCursorType, owner: string) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Creates or retrieves a cached clearCursor function for a given instanceId.
|
|
53
|
+
* This maintains referential stability for the function reference.
|
|
54
|
+
*
|
|
55
|
+
* @param instanceId - The unique identifier for the map cursor instance
|
|
56
|
+
* @returns A clearCursor function for this instance
|
|
57
|
+
*/
|
|
58
|
+
declare function getOrCreateClearCursor(instanceId: UniqueId): (owner: string) => void;
|
|
59
|
+
/**
|
|
60
|
+
* Get the current cursor for a given instance (direct access, not reactive).
|
|
61
|
+
* @internal - For internal map-toolkit use only
|
|
62
|
+
*
|
|
63
|
+
* @param instanceId - The unique identifier for the map instance
|
|
64
|
+
* @returns The current cursor
|
|
65
|
+
*/
|
|
66
|
+
declare function getCursor(instanceId: UniqueId): CSSCursorType;
|
|
67
|
+
/**
|
|
68
|
+
* Manually clear all cursor state for a specific instanceId.
|
|
69
|
+
* This is typically not needed as cleanup happens automatically when all subscribers unmount.
|
|
70
|
+
* Use this only in advanced scenarios where manual cleanup is required.
|
|
71
|
+
*
|
|
72
|
+
* @param instanceId - The unique identifier for the map cursor instance to clear
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* // Manual cleanup (rarely needed)
|
|
77
|
+
* clearCursorState('my-map-instance');
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
declare function clearCursorState(instanceId: UniqueId): void;
|
|
81
|
+
/** @deprecated Use module functions directly */
|
|
82
|
+
declare function getOrCreateStore(id: UniqueId): {
|
|
83
|
+
getSnapshot: () => CSSCursorType;
|
|
84
|
+
};
|
|
85
|
+
/** @deprecated Use clearCursorState instead */
|
|
86
|
+
declare function destroyStore(id: UniqueId): void;
|
|
87
|
+
/** @deprecated Use direct function calls instead */
|
|
88
|
+
declare function getStore(id: UniqueId): {
|
|
89
|
+
getSnapshot: () => CSSCursorType;
|
|
90
|
+
} | undefined;
|
|
91
|
+
//#endregion
|
|
92
|
+
export { clearCursorState, destroyStore, getCursor, getOrCreateClearCursor, getOrCreateRequestCursorChange, getOrCreateServerSnapshot, getOrCreateSnapshot, getOrCreateStore, getOrCreateSubscription, getStore };
|
|
93
|
+
//# sourceMappingURL=store.d.ts.map
|