@accelint/map-toolkit 0.1.0 → 0.3.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 +103 -0
- package/README.md +91 -18
- package/catalog-info.yaml +16 -10
- package/dist/cursor-coordinates/index.d.ts +3 -0
- package/dist/cursor-coordinates/index.js +3 -0
- package/dist/cursor-coordinates/index.js.map +1 -0
- package/dist/cursor-coordinates/use-cursor-coordinates.d.ts +76 -0
- package/dist/cursor-coordinates/use-cursor-coordinates.js +161 -0
- package/dist/cursor-coordinates/use-cursor-coordinates.js.map +1 -0
- package/dist/deckgl/base-map/events.d.ts +1 -0
- package/dist/deckgl/base-map/events.js +2 -1
- package/dist/deckgl/base-map/events.js.map +1 -1
- package/dist/deckgl/base-map/index.d.ts +91 -8
- package/dist/deckgl/base-map/index.js +93 -33
- package/dist/deckgl/base-map/index.js.map +1 -1
- package/dist/deckgl/base-map/provider.d.ts +129 -0
- package/dist/deckgl/base-map/provider.js +18 -0
- package/dist/deckgl/base-map/provider.js.map +1 -0
- package/dist/deckgl/base-map/types.d.ts +64 -3
- package/dist/deckgl/index.d.ts +3 -2
- package/dist/deckgl/index.js +1 -1
- package/dist/deckgl/text-layer/character-sets.d.ts +27 -0
- package/dist/deckgl/text-layer/character-sets.js +36 -0
- package/dist/deckgl/text-layer/character-sets.js.map +1 -0
- package/dist/deckgl/text-layer/default-settings.d.ts +5 -0
- package/dist/deckgl/text-layer/default-settings.js +23 -0
- package/dist/deckgl/text-layer/default-settings.js.map +1 -0
- package/dist/deckgl/text-layer/fiber.d.ts +31 -0
- package/dist/deckgl/text-layer/fiber.js +6 -0
- package/dist/deckgl/text-layer/fiber.js.map +1 -0
- package/dist/deckgl/text-layer/index.d.ts +43 -0
- package/dist/deckgl/text-layer/index.js +33 -0
- package/dist/deckgl/text-layer/index.js.map +1 -0
- package/dist/decorators/deckgl.d.ts +1 -1
- package/dist/decorators/deckgl.js +3 -1
- package/dist/decorators/deckgl.js.map +1 -1
- package/dist/map-mode/events.d.ts +37 -0
- package/dist/map-mode/events.js +15 -0
- package/dist/map-mode/events.js.map +1 -0
- package/dist/map-mode/index.d.ts +6 -0
- package/dist/map-mode/index.js +5 -0
- package/dist/map-mode/index.js.map +1 -0
- package/dist/map-mode/store.d.ts +48 -0
- package/dist/map-mode/store.js +306 -0
- package/dist/map-mode/store.js.map +1 -0
- package/dist/map-mode/types.d.ts +83 -0
- package/dist/map-mode/types.js +3 -0
- package/dist/map-mode/types.js.map +1 -0
- package/dist/map-mode/use-map-mode.d.ts +52 -0
- package/dist/map-mode/use-map-mode.js +29 -0
- package/dist/map-mode/use-map-mode.js.map +1 -0
- package/dist/maplibre/hooks/use-maplibre.d.ts +34 -0
- package/dist/maplibre/hooks/use-maplibre.js +3 -2
- package/dist/maplibre/hooks/use-maplibre.js.map +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/viewport/constants.d.ts +9 -0
- package/dist/viewport/constants.js +11 -0
- package/dist/viewport/constants.js.map +1 -0
- package/dist/viewport/index.d.ts +13 -0
- package/dist/viewport/index.js +6 -0
- package/dist/viewport/index.js.map +1 -0
- package/dist/viewport/types.d.ts +22 -0
- package/dist/viewport/types.js +3 -0
- package/dist/viewport/types.js.map +1 -0
- package/dist/viewport/use-viewport-state.d.ts +85 -0
- package/dist/viewport/use-viewport-state.js +109 -0
- package/dist/viewport/use-viewport-state.js.map +1 -0
- package/dist/viewport/utils.d.ts +37 -0
- package/dist/viewport/utils.js +46 -0
- package/dist/viewport/utils.js.map +1 -0
- package/dist/viewport/viewport-size.d.ts +42 -0
- package/dist/viewport/viewport-size.js +16 -0
- package/dist/viewport/viewport-size.js.map +1 -0
- package/package.json +48 -46
- package/dist/test/setup.d.ts +0 -2
- package/dist/test/setup.js +0 -11
- package/dist/test/setup.js.map +0 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const ALL_NUMBERS = "1234567890";
|
|
2
|
+
const ASCII_LETTERS_LOWERCASE = "abcdefghijklmnopqrstuvwxyz";
|
|
3
|
+
const ASCII_LETTERS_UPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
4
|
+
const ASCII_SYMBOLS = " !\"#$%&'()*+,-./:;<=>?@[]^_`{|}~";
|
|
5
|
+
const ASCII_LETTERS = `${ASCII_LETTERS_LOWERCASE}${ASCII_LETTERS_UPPERCASE}`;
|
|
6
|
+
const ASCII_ALPHA_NUMERIC = `${ASCII_LETTERS}${ALL_NUMBERS}`;
|
|
7
|
+
const ASCII_ALL = `${ASCII_LETTERS}${ALL_NUMBERS}${ASCII_SYMBOLS}`;
|
|
8
|
+
const AUTO = "auto";
|
|
9
|
+
const LATIN_LETTERS_LOWERCASE = "\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF\xDF";
|
|
10
|
+
const LATIN_LETTERS_UPPERCASE = "\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD8\xD9\xDA\xDB\xDC\xDD\xDE";
|
|
11
|
+
const LATIN_SYMBOLS = " \xA1\xBF\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xD7\xF7";
|
|
12
|
+
const LATIN_LETTERS = `${LATIN_LETTERS_LOWERCASE}${LATIN_LETTERS_UPPERCASE}`;
|
|
13
|
+
const LATIN_ALPHA_NUMERIC = `${LATIN_LETTERS}${ALL_NUMBERS}`;
|
|
14
|
+
const LATIN_ALL = `${LATIN_LETTERS}${ALL_NUMBERS}${LATIN_SYMBOLS}`;
|
|
15
|
+
const EXPANDED = `${ASCII_ALL}${LATIN_ALL}`;
|
|
16
|
+
const CHARACTER_SETS = Object.freeze({
|
|
17
|
+
ALL_NUMBERS,
|
|
18
|
+
ASCII_ALL,
|
|
19
|
+
ASCII_ALPHA_NUMERIC,
|
|
20
|
+
ASCII_LETTERS,
|
|
21
|
+
ASCII_LETTERS_LOWERCASE,
|
|
22
|
+
ASCII_LETTERS_UPPERCASE,
|
|
23
|
+
ASCII_SYMBOLS,
|
|
24
|
+
AUTO,
|
|
25
|
+
EXPANDED,
|
|
26
|
+
LATIN_ALL,
|
|
27
|
+
LATIN_ALPHA_NUMERIC,
|
|
28
|
+
LATIN_LETTERS,
|
|
29
|
+
LATIN_LETTERS_LOWERCASE,
|
|
30
|
+
LATIN_LETTERS_UPPERCASE,
|
|
31
|
+
LATIN_SYMBOLS
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export { CHARACTER_SETS };
|
|
35
|
+
//# sourceMappingURL=character-sets.js.map
|
|
36
|
+
//# sourceMappingURL=character-sets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/deckgl/text-layer/character-sets.ts"],"names":[],"mappings":"AAYA,MAAM,WAAA,GAAc,YAAA;AAEpB,MAAM,uBAAA,GAA0B,4BAAA;AAChC,MAAM,uBAAA,GAA0B,4BAAA;AAChC,MAAM,aAAA,GAAgB,mCAAA;AAEtB,MAAM,aAAA,GAAgB,CAAA,EAAG,uBAAuB,CAAA,EAAG,uBAAuB,CAAA,CAAA;AAC1E,MAAM,mBAAA,GAAsB,CAAA,EAAG,aAAa,CAAA,EAAG,WAAW,CAAA,CAAA;AAC1D,MAAM,YAAY,CAAA,EAAG,aAAa,CAAA,EAAG,WAAW,GAAG,aAAa,CAAA,CAAA;AAEhE,MAAM,IAAA,GAAO,MAAA;AAEb,MAAM,uBAAA,GAA0B,kIAAA;AAChC,MAAM,uBAAA,GAA0B,0HAAA;AAChC,MAAM,aAAA,GAAgB,2IAAA;AAEtB,MAAM,aAAA,GAAgB,CAAA,EAAG,uBAAuB,CAAA,EAAG,uBAAuB,CAAA,CAAA;AAC1E,MAAM,mBAAA,GAAsB,CAAA,EAAG,aAAa,CAAA,EAAG,WAAW,CAAA,CAAA;AAC1D,MAAM,YAAY,CAAA,EAAG,aAAa,CAAA,EAAG,WAAW,GAAG,aAAa,CAAA,CAAA;AAEhE,MAAM,QAAA,GAAW,CAAA,EAAG,SAAS,CAAA,EAAG,SAAS,CAAA,CAAA;AAWlC,MAAM,cAAA,GAAiB,OAAO,MAAA,CAAO;AAAA,EAC1C,WAAA;AAAA,EAEA,SAAA;AAAA,EACA,mBAAA;AAAA,EACA,aAAA;AAAA,EACA,uBAAA;AAAA,EACA,uBAAA;AAAA,EACA,aAAA;AAAA,EAEA,IAAA;AAAA,EACA,QAAA;AAAA,EAEA,SAAA;AAAA,EACA,mBAAA;AAAA,EACA,aAAA;AAAA,EACA,uBAAA;AAAA,EACA,uBAAA;AAAA,EACA;AACF,CAAU","file":"character-sets.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\nconst ALL_NUMBERS = '1234567890';\n\nconst ASCII_LETTERS_LOWERCASE = 'abcdefghijklmnopqrstuvwxyz';\nconst ASCII_LETTERS_UPPERCASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nconst ASCII_SYMBOLS = ' !\"#$%&\\'()*+,-./:;<=>?@[]^_`{|}~';\n\nconst ASCII_LETTERS = `${ASCII_LETTERS_LOWERCASE}${ASCII_LETTERS_UPPERCASE}`;\nconst ASCII_ALPHA_NUMERIC = `${ASCII_LETTERS}${ALL_NUMBERS}`;\nconst ASCII_ALL = `${ASCII_LETTERS}${ALL_NUMBERS}${ASCII_SYMBOLS}`;\n\nconst AUTO = 'auto';\n\nconst LATIN_LETTERS_LOWERCASE = 'àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿß';\nconst LATIN_LETTERS_UPPERCASE = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ';\nconst LATIN_SYMBOLS = ' ¡¿¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿×÷';\n\nconst LATIN_LETTERS = `${LATIN_LETTERS_LOWERCASE}${LATIN_LETTERS_UPPERCASE}`;\nconst LATIN_ALPHA_NUMERIC = `${LATIN_LETTERS}${ALL_NUMBERS}`;\nconst LATIN_ALL = `${LATIN_LETTERS}${ALL_NUMBERS}${LATIN_SYMBOLS}`;\n\nconst EXPANDED = `${ASCII_ALL}${LATIN_ALL}`;\n\nexport type CharacterSetsKeys = keyof typeof CHARACTER_SETS;\n\n/**\n * Predefined character sets for TextLayer.\n *\n * Use smaller character sets (ASCII_ALL, ASCII_ALPHA_NUMERIC) for better performance,\n * or use AUTO for dynamic optimization based on content.\n * EXPANDED includes ASCII and Latin characters with diacritics for international text.\n */\nexport const CHARACTER_SETS = Object.freeze({\n ALL_NUMBERS,\n\n ASCII_ALL,\n ASCII_ALPHA_NUMERIC,\n ASCII_LETTERS,\n ASCII_LETTERS_LOWERCASE,\n ASCII_LETTERS_UPPERCASE,\n ASCII_SYMBOLS,\n\n AUTO,\n EXPANDED,\n\n LATIN_ALL,\n LATIN_ALPHA_NUMERIC,\n LATIN_LETTERS,\n LATIN_LETTERS_LOWERCASE,\n LATIN_LETTERS_UPPERCASE,\n LATIN_SYMBOLS,\n} as const);\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const defaultSettings = {
|
|
2
|
+
fontFamily: "system-ui, sans-serif",
|
|
3
|
+
fontSettings: {
|
|
4
|
+
fontSize: 22,
|
|
5
|
+
sdf: true,
|
|
6
|
+
buffer: 10,
|
|
7
|
+
cutoff: 0.19,
|
|
8
|
+
radius: 10,
|
|
9
|
+
smoothing: 0.1
|
|
10
|
+
},
|
|
11
|
+
fontWeight: 500,
|
|
12
|
+
getAlignmentBaseline: "center",
|
|
13
|
+
getColor: [255, 255, 255, 255],
|
|
14
|
+
getSize: 12,
|
|
15
|
+
getTextAnchor: "middle",
|
|
16
|
+
lineHeight: 1,
|
|
17
|
+
outlineColor: [0, 0, 0, 255],
|
|
18
|
+
outlineWidth: 2
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { defaultSettings };
|
|
22
|
+
//# sourceMappingURL=default-settings.js.map
|
|
23
|
+
//# sourceMappingURL=default-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/deckgl/text-layer/default-settings.ts"],"names":[],"mappings":"AAeO,MAAM,eAAA,GAA8C;AAAA,EACzD,UAAA,EAAY,uBAAA;AAAA,EACZ,YAAA,EAAc;AAAA,IACZ,QAAA,EAAU,EAAA;AAAA,IACV,GAAA,EAAK,IAAA;AAAA,IACL,MAAA,EAAQ,EAAA;AAAA,IACR,MAAA,EAAQ,IAAA;AAAA,IACR,MAAA,EAAQ,EAAA;AAAA,IACR,SAAA,EAAW;AAAA,GACb;AAAA,EACA,UAAA,EAAY,GAAA;AAAA,EACZ,oBAAA,EAAsB,QAAA;AAAA,EACtB,QAAA,EAAU,CAAC,GAAA,EAAK,GAAA,EAAK,KAAK,GAAG,CAAA;AAAA,EAC7B,OAAA,EAAS,EAAA;AAAA,EACT,aAAA,EAAe,QAAA;AAAA,EACf,UAAA,EAAY,CAAA;AAAA,EACZ,YAAA,EAAc,CAAC,CAAA,EAAG,CAAA,EAAG,GAAG,GAAG,CAAA;AAAA,EAC3B,YAAA,EAAc;AAChB","file":"default-settings.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 type { Color } from '@deck.gl/core';\nimport type { TextLayerProps as DglTextLayerProps } from '@deck.gl/layers';\n\nexport const defaultSettings: Partial<DglTextLayerProps> = {\n fontFamily: 'system-ui, sans-serif',\n fontSettings: {\n fontSize: 22,\n sdf: true,\n buffer: 10,\n cutoff: 0.19,\n radius: 10,\n smoothing: 0.1,\n },\n fontWeight: 500,\n getAlignmentBaseline: 'center',\n getColor: [255, 255, 255, 255] as Color,\n getSize: 12,\n getTextAnchor: 'middle',\n lineHeight: 1,\n outlineColor: [0, 0, 0, 255] as Color,\n outlineWidth: 2,\n} as const;\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TextLayerProps } from './index.js';
|
|
2
|
+
import '@deck.gl/layers';
|
|
3
|
+
import './character-sets.js';
|
|
4
|
+
import 'type-fest';
|
|
5
|
+
|
|
6
|
+
declare global {
|
|
7
|
+
namespace React {
|
|
8
|
+
namespace JSX {
|
|
9
|
+
interface IntrinsicElements {
|
|
10
|
+
/**
|
|
11
|
+
* A styled text layer for DeckGL Fiber with enhanced styling capabilities.
|
|
12
|
+
*
|
|
13
|
+
* Provides customizable font styling, text outline support, and extended character sets.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <textLayer
|
|
18
|
+
* id="my-text"
|
|
19
|
+
* data={textData}
|
|
20
|
+
* getText={d => d.text}
|
|
21
|
+
* getPosition={d => d.position}
|
|
22
|
+
* getSize={12}
|
|
23
|
+
* fontWeight={500}
|
|
24
|
+
* />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
textLayer: TextLayerProps;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/deckgl/text-layer/fiber.ts"],"names":[],"mappings":";;;AAeA,MAAA,CAAO,EAAE,WAAW,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 { TextLayer, type TextLayerProps } from './index';\n\nextend({ TextLayer });\n\ndeclare global {\n namespace React {\n // biome-ignore lint/style/useNamingConvention: Built-in React namespace.\n namespace JSX {\n interface IntrinsicElements {\n /**\n * A styled text layer for DeckGL Fiber with enhanced styling capabilities.\n *\n * Provides customizable font styling, text outline support, and extended character sets.\n *\n * @example\n * ```tsx\n * <textLayer\n * id=\"my-text\"\n * data={textData}\n * getText={d => d.text}\n * getPosition={d => d.position}\n * getSize={12}\n * fontWeight={500}\n * />\n * ```\n */\n textLayer: TextLayerProps;\n }\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { TextLayerProps as TextLayerProps$1, TextLayer as TextLayer$1 } from '@deck.gl/layers';
|
|
2
|
+
import { CharacterSetsKeys } from './character-sets.js';
|
|
3
|
+
import { LiteralUnion } from 'type-fest';
|
|
4
|
+
|
|
5
|
+
interface TextLayerProps<TData = unknown> extends TextLayerProps$1<TData> {
|
|
6
|
+
characterSet?: LiteralUnion<CharacterSetsKeys, string>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A styled text layer that extends Deck.gl's TextLayer with enhanced styling capabilities.
|
|
10
|
+
*
|
|
11
|
+
* This layer provides:
|
|
12
|
+
* - Customizable font styling (size, weight, family, line height)
|
|
13
|
+
* - Text outline support
|
|
14
|
+
* - Extended character set support
|
|
15
|
+
* - Consistent styling based on design specifications
|
|
16
|
+
*
|
|
17
|
+
* Can be used directly with Deck.gl or as a JSX element with React Fiber:
|
|
18
|
+
* - React Fiber: `<textLayer id="text" data={[...]} ... />`
|
|
19
|
+
* - Direct: `new TextLayer({ id: 'text', data: [...], ... })`
|
|
20
|
+
*/
|
|
21
|
+
declare class TextLayer<TData = unknown> extends TextLayer$1<TData> {
|
|
22
|
+
static CHARACTER_SETS: Readonly<{
|
|
23
|
+
readonly ALL_NUMBERS: "1234567890";
|
|
24
|
+
readonly ASCII_ALL: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 !\"#$%&'()*+,-./:;<=>?@[]^_`{|}~";
|
|
25
|
+
readonly ASCII_ALPHA_NUMERIC: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
|
|
26
|
+
readonly ASCII_LETTERS: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
27
|
+
readonly ASCII_LETTERS_LOWERCASE: "abcdefghijklmnopqrstuvwxyz";
|
|
28
|
+
readonly ASCII_LETTERS_UPPERCASE: "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
29
|
+
readonly ASCII_SYMBOLS: " !\"#$%&'()*+,-./:;<=>?@[]^_`{|}~";
|
|
30
|
+
readonly AUTO: "auto";
|
|
31
|
+
readonly EXPANDED: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 !\"#$%&'()*+,-./:;<=>?@[]^_`{|}~àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ1234567890 ¡¿¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿×÷";
|
|
32
|
+
readonly LATIN_ALL: "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ1234567890 ¡¿¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿×÷";
|
|
33
|
+
readonly LATIN_ALPHA_NUMERIC: "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ1234567890";
|
|
34
|
+
readonly LATIN_LETTERS: "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ";
|
|
35
|
+
readonly LATIN_LETTERS_LOWERCASE: "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿß";
|
|
36
|
+
readonly LATIN_LETTERS_UPPERCASE: "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ";
|
|
37
|
+
readonly LATIN_SYMBOLS: " ¡¿¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿×÷";
|
|
38
|
+
}>;
|
|
39
|
+
static layerName: string;
|
|
40
|
+
constructor(props: TextLayerProps<TData>);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { TextLayer, type TextLayerProps };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { TextLayer as TextLayer$1 } from '@deck.gl/layers';
|
|
2
|
+
import { CHARACTER_SETS } from './character-sets.js';
|
|
3
|
+
import { defaultSettings } from './default-settings.js';
|
|
4
|
+
|
|
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
|
+
|
|
31
|
+
export { TextLayer };
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/deckgl/text-layer/index.ts"],"names":["DglTextLayer"],"mappings":";;;;AAuCO,MAAM,kBAAmCA,WAAA,CAAoB;AAAA,EAClE,OAAO,cAAA,GAAiB,cAAA;AAAA,EAExB,OAAgB,SAAA,GAAY,WAAA;AAAA,EAE5B,YAAY,KAAA,EAA8B;AACxC,IAAA,MAAM;AAAA,MACJ,eAAe,cAAA,CAAe,QAAA;AAAA,MAC9B,YAAA;AAAA,MACA,GAAG;AAAA,KACL,GAAI,KAAA;AAEJ,IAAA,KAAA,CAAM;AAAA;AAAA,MAEJ,GAAG,eAAA;AAAA;AAAA,MAGH,GAAG,IAAA;AAAA;AAAA,MAGH,YAAA,EACE,cAAA,CAAe,YAAiC,CAAA,IAAK,YAAA;AAAA,MAEvD,YAAA,EAAc;AAAA;AAAA,QAEZ,GAAG,eAAA,CAAgB,YAAA;AAAA;AAAA,QAGnB,GAAG;AAAA;AACL,KACD,CAAA;AAAA,EACH;AACF","file":"index.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 {\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"]}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { uuid } from '@accelint/core';
|
|
2
3
|
import { BaseMap } from '../deckgl/base-map/index.js';
|
|
3
4
|
|
|
5
|
+
const STORYBOOK_MAP_ID = uuid();
|
|
4
6
|
const withDeckGL = () => {
|
|
5
7
|
return (Story) => {
|
|
6
|
-
return /* @__PURE__ */ jsx(BaseMap, { className: "h-dvh w-dvw", children: /* @__PURE__ */ jsx(Story, {}) });
|
|
8
|
+
return /* @__PURE__ */ jsx(BaseMap, { className: "h-dvh w-dvw", id: STORYBOOK_MAP_ID, children: /* @__PURE__ */ jsx(Story, {}) });
|
|
7
9
|
};
|
|
8
10
|
};
|
|
9
11
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/decorators/deckgl.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/decorators/deckgl.tsx"],"names":[],"mappings":";;;;AAmBA,MAAM,mBAAmB,IAAA,EAAK;AAEvB,MAAM,aAAa,MAAiB;AACzC,EAAA,OAAO,CAAC,KAAA,KAAU;AAChB,IAAA,uBACE,GAAA,CAAC,WAAQ,SAAA,EAAU,aAAA,EAAc,IAAI,gBAAA,EACnC,QAAA,kBAAA,GAAA,CAAC,SAAM,CAAA,EACT,CAAA;AAAA,EAEJ,CAAA;AACF","file":"deckgl.js","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"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Namespace prefix for all map mode events.
|
|
3
|
+
*/
|
|
4
|
+
declare const MapModeEventsNamespace = "map-mode";
|
|
5
|
+
/**
|
|
6
|
+
* Event type constants for map mode state management.
|
|
7
|
+
*
|
|
8
|
+
* These events are emitted through the `@accelint/bus` event bus to coordinate
|
|
9
|
+
* map mode changes across components in a decoupled manner.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { useOn, useEmit } from '@accelint/bus/react';
|
|
14
|
+
* import { MapModeEvents } from '@accelint/map-toolkit/map-mode';
|
|
15
|
+
*
|
|
16
|
+
* // Listen for mode changes
|
|
17
|
+
* useOn(MapModeEvents.changed, (event) => {
|
|
18
|
+
* console.log('Mode changed to:', event.payload.currentMode);
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* // Emit a decision
|
|
22
|
+
* const emitDecision = useEmit(MapModeEvents.changeDecision);
|
|
23
|
+
* emitDecision({ authId, approved: true, owner: 'my-id', id });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
declare const MapModeEvents: {
|
|
27
|
+
/** Emitted when the map mode has successfully changed */
|
|
28
|
+
readonly changed: "map-mode:changed";
|
|
29
|
+
/** Emitted when a component requests a mode change */
|
|
30
|
+
readonly changeRequest: "map-mode:change:request";
|
|
31
|
+
/** Emitted when authorization is required for a mode change */
|
|
32
|
+
readonly changeAuthorization: "map-mode:change:authorization";
|
|
33
|
+
/** Emitted when an authorization decision is made (approve/reject) */
|
|
34
|
+
readonly changeDecision: "map-mode:change:decision";
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { MapModeEvents, MapModeEventsNamespace };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const MapModeEventsNamespace = "map-mode";
|
|
2
|
+
const MapModeEvents = {
|
|
3
|
+
/** Emitted when the map mode has successfully changed */
|
|
4
|
+
changed: `${MapModeEventsNamespace}:changed`,
|
|
5
|
+
/** Emitted when a component requests a mode change */
|
|
6
|
+
changeRequest: `${MapModeEventsNamespace}:change:request`,
|
|
7
|
+
/** Emitted when authorization is required for a mode change */
|
|
8
|
+
changeAuthorization: `${MapModeEventsNamespace}:change:authorization`,
|
|
9
|
+
/** Emitted when an authorization decision is made (approve/reject) */
|
|
10
|
+
changeDecision: `${MapModeEventsNamespace}:change:decision`
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { MapModeEvents, MapModeEventsNamespace };
|
|
14
|
+
//# sourceMappingURL=events.js.map
|
|
15
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/map-mode/events.ts"],"names":[],"mappings":"AAeO,MAAM,sBAAA,GAAyB;AAuB/B,MAAM,aAAA,GAAgB;AAAA;AAAA,EAE3B,OAAA,EAAS,GAAG,sBAAsB,CAAA,QAAA,CAAA;AAAA;AAAA,EAElC,aAAA,EAAe,GAAG,sBAAsB,CAAA,eAAA,CAAA;AAAA;AAAA,EAExC,mBAAA,EAAqB,GAAG,sBAAsB,CAAA,qBAAA,CAAA;AAAA;AAAA,EAE9C,cAAA,EAAgB,GAAG,sBAAsB,CAAA,gBAAA;AAC3C","file":"events.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/**\n * Namespace prefix for all map mode events.\n */\nexport const MapModeEventsNamespace = 'map-mode';\n\n/**\n * Event type constants for map mode state management.\n *\n * These events are emitted through the `@accelint/bus` event bus to coordinate\n * map mode changes across components in a decoupled manner.\n *\n * @example\n * ```ts\n * import { useOn, useEmit } from '@accelint/bus/react';\n * import { MapModeEvents } from '@accelint/map-toolkit/map-mode';\n *\n * // Listen for mode changes\n * useOn(MapModeEvents.changed, (event) => {\n * console.log('Mode changed to:', event.payload.currentMode);\n * });\n *\n * // Emit a decision\n * const emitDecision = useEmit(MapModeEvents.changeDecision);\n * emitDecision({ authId, approved: true, owner: 'my-id', id });\n * ```\n */\nexport const MapModeEvents = {\n /** Emitted when the map mode has successfully changed */\n changed: `${MapModeEventsNamespace}:changed`,\n /** Emitted when a component requests a mode change */\n changeRequest: `${MapModeEventsNamespace}:change:request`,\n /** Emitted when authorization is required for a mode change */\n changeAuthorization: `${MapModeEventsNamespace}:change:authorization`,\n /** Emitted when an authorization decision is made (approve/reject) */\n changeDecision: `${MapModeEventsNamespace}:change:decision`,\n} as const;\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { MapModeEvents, MapModeEventsNamespace } from './events.js';
|
|
2
|
+
export { clearMapModeState, getCurrentModeOwner } from './store.js';
|
|
3
|
+
export { UseMapModeReturn, useMapMode } from './use-map-mode.js';
|
|
4
|
+
export { MapModeEventType, ModeChangeAuthorizationEvent, ModeChangeAuthorizationPayload, ModeChangeDecisionEvent, ModeChangeDecisionPayload, ModeChangeRequestEvent, ModeChangeRequestPayload, ModeChangedEvent, ModeChangedPayload } from './types.js';
|
|
5
|
+
import '@accelint/core';
|
|
6
|
+
import '@accelint/bus';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { UniqueId } from '@accelint/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Creates or retrieves a cached subscription function for a given instanceId.
|
|
5
|
+
* Uses a fan-out pattern: 1 bus listener -> N React subscribers.
|
|
6
|
+
* Automatically cleans up map mode state when the last subscriber unsubscribes.
|
|
7
|
+
*
|
|
8
|
+
* @param instanceId - The unique identifier for the map mode instance
|
|
9
|
+
* @returns A subscription function for useSyncExternalStore
|
|
10
|
+
*/
|
|
11
|
+
declare function getOrCreateSubscription(instanceId: UniqueId): (onStoreChange: () => void) => () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Creates or retrieves a cached snapshot function for a given instanceId.
|
|
14
|
+
* The string returned gets equality checked, so it needs to be stable or React re-renders unnecessarily.
|
|
15
|
+
*
|
|
16
|
+
* @param instanceId - The unique identifier for the map mode instance
|
|
17
|
+
* @returns A snapshot function for useSyncExternalStore
|
|
18
|
+
*/
|
|
19
|
+
declare function getOrCreateSnapshot(instanceId: UniqueId): () => string;
|
|
20
|
+
/**
|
|
21
|
+
* Creates or retrieves a cached requestModeChange function for a given instanceId.
|
|
22
|
+
* This maintains referential stability for the function reference.
|
|
23
|
+
*
|
|
24
|
+
* @param instanceId - The unique identifier for the map mode instance
|
|
25
|
+
* @returns A requestModeChange function for this instance
|
|
26
|
+
*/
|
|
27
|
+
declare function getOrCreateRequestModeChange(instanceId: UniqueId): (desiredMode: string, requestOwner: string) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Get the owner of the current mode for a given map instance
|
|
30
|
+
* @internal - For internal map-toolkit use only
|
|
31
|
+
*/
|
|
32
|
+
declare function getCurrentModeOwner(instanceId: UniqueId): string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Manually clear map mode state for a specific instanceId.
|
|
35
|
+
* This is typically not needed as cleanup happens automatically when all subscribers unmount.
|
|
36
|
+
* Use this only in advanced scenarios where manual cleanup is required.
|
|
37
|
+
*
|
|
38
|
+
* @param instanceId - The unique identifier for the map mode instance to clear
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* // Manual cleanup (rarely needed)
|
|
43
|
+
* clearMapModeState('my-map-instance');
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
declare function clearMapModeState(instanceId: UniqueId): void;
|
|
47
|
+
|
|
48
|
+
export { clearMapModeState, getCurrentModeOwner, getOrCreateRequestModeChange, getOrCreateSnapshot, getOrCreateSubscription };
|