@accelint/map-toolkit 0.3.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/CHANGELOG.md +49 -24
  2. package/catalog-info.yaml +5 -7
  3. package/dist/cursor-coordinates/index.d.ts +14 -3
  4. package/dist/cursor-coordinates/index.js +16 -3
  5. package/dist/cursor-coordinates/use-cursor-coordinates.d.ts +20 -6
  6. package/dist/cursor-coordinates/use-cursor-coordinates.js +247 -128
  7. package/dist/cursor-coordinates/use-cursor-coordinates.js.map +1 -1
  8. package/dist/deckgl/base-map/constants.d.ts +14 -12
  9. package/dist/deckgl/base-map/constants.js +26 -12
  10. package/dist/deckgl/base-map/constants.js.map +1 -1
  11. package/dist/deckgl/base-map/events.d.ts +6 -4
  12. package/dist/deckgl/base-map/events.js +18 -4
  13. package/dist/deckgl/base-map/events.js.map +1 -1
  14. package/dist/deckgl/base-map/index.d.ts +45 -18
  15. package/dist/deckgl/base-map/index.js +216 -148
  16. package/dist/deckgl/base-map/index.js.map +1 -1
  17. package/dist/deckgl/base-map/provider.d.ts +48 -32
  18. package/dist/deckgl/base-map/provider.js +122 -11
  19. package/dist/deckgl/base-map/provider.js.map +1 -1
  20. package/dist/deckgl/base-map/types.d.ts +49 -39
  21. package/dist/deckgl/base-map/types.js +11 -2
  22. package/dist/deckgl/index.d.ts +18 -13
  23. package/dist/deckgl/index.js +19 -6
  24. package/dist/deckgl/symbol-layer/fiber.d.ts +21 -10
  25. package/dist/deckgl/symbol-layer/fiber.js +18 -3
  26. package/dist/deckgl/symbol-layer/fiber.js.map +1 -1
  27. package/dist/deckgl/symbol-layer/index.d.ts +68 -54
  28. package/dist/deckgl/symbol-layer/index.js +105 -85
  29. package/dist/deckgl/symbol-layer/index.js.map +1 -1
  30. package/dist/deckgl/text-layer/character-sets.d.ts +19 -17
  31. package/dist/deckgl/text-layer/character-sets.js +40 -19
  32. package/dist/deckgl/text-layer/character-sets.js.map +1 -1
  33. package/dist/deckgl/text-layer/default-settings.d.ts +16 -2
  34. package/dist/deckgl/text-layer/default-settings.js +42 -18
  35. package/dist/deckgl/text-layer/default-settings.js.map +1 -1
  36. package/dist/deckgl/text-layer/fiber.d.ts +38 -27
  37. package/dist/deckgl/text-layer/fiber.js +18 -3
  38. package/dist/deckgl/text-layer/fiber.js.map +1 -1
  39. package/dist/deckgl/text-layer/index.d.ts +39 -25
  40. package/dist/deckgl/text-layer/index.js +47 -29
  41. package/dist/deckgl/text-layer/index.js.map +1 -1
  42. package/dist/decorators/deckgl.d.ts +16 -2
  43. package/dist/decorators/deckgl.js +25 -7
  44. package/dist/decorators/deckgl.js.map +1 -1
  45. package/dist/map-cursor/events.d.ts +16 -0
  46. package/dist/map-cursor/events.js +27 -0
  47. package/dist/map-cursor/events.js.map +1 -0
  48. package/dist/map-cursor/index.d.ts +17 -0
  49. package/dist/map-cursor/index.js +18 -0
  50. package/dist/map-cursor/store.d.ts +93 -0
  51. package/dist/map-cursor/store.js +351 -0
  52. package/dist/map-cursor/store.js.map +1 -0
  53. package/dist/map-cursor/types.d.ts +81 -0
  54. package/dist/map-cursor/types.js +12 -0
  55. package/dist/map-cursor/use-map-cursor.d.ts +99 -0
  56. package/dist/map-cursor/use-map-cursor.js +116 -0
  57. package/dist/map-cursor/use-map-cursor.js.map +1 -0
  58. package/dist/map-mode/events.d.ts +11 -9
  59. package/dist/map-mode/events.js +43 -9
  60. package/dist/map-mode/events.js.map +1 -1
  61. package/dist/map-mode/index.d.ts +17 -6
  62. package/dist/map-mode/index.js +18 -5
  63. package/dist/map-mode/store.d.ts +26 -3
  64. package/dist/map-mode/store.js +329 -265
  65. package/dist/map-mode/store.js.map +1 -1
  66. package/dist/map-mode/types.d.ts +49 -35
  67. package/dist/map-mode/types.js +11 -2
  68. package/dist/map-mode/use-map-mode.d.ts +21 -7
  69. package/dist/map-mode/use-map-mode.js +66 -23
  70. package/dist/map-mode/use-map-mode.js.map +1 -1
  71. package/dist/maplibre/constants.d.ts +10 -8
  72. package/dist/maplibre/constants.js +22 -8
  73. package/dist/maplibre/constants.js.map +1 -1
  74. package/dist/maplibre/hooks/use-maplibre.d.ts +17 -2
  75. package/dist/maplibre/hooks/use-maplibre.js +77 -31
  76. package/dist/maplibre/hooks/use-maplibre.js.map +1 -1
  77. package/dist/maplibre/index.d.ts +15 -3
  78. package/dist/maplibre/index.js +17 -4
  79. package/dist/viewport/constants.d.ts +8 -6
  80. package/dist/viewport/constants.js +20 -6
  81. package/dist/viewport/constants.js.map +1 -1
  82. package/dist/viewport/index.d.ts +18 -13
  83. package/dist/viewport/index.js +19 -6
  84. package/dist/viewport/types.d.ts +27 -17
  85. package/dist/viewport/types.js +11 -2
  86. package/dist/viewport/use-viewport-state.d.ts +29 -14
  87. package/dist/viewport/use-viewport-state.js +200 -87
  88. package/dist/viewport/use-viewport-state.js.map +1 -1
  89. package/dist/viewport/utils.d.ts +25 -10
  90. package/dist/viewport/utils.js +67 -37
  91. package/dist/viewport/utils.js.map +1 -1
  92. package/dist/viewport/viewport-size.d.ts +27 -15
  93. package/dist/viewport/viewport-size.js +54 -11
  94. package/dist/viewport/viewport-size.js.map +1 -1
  95. package/package.json +107 -78
  96. package/dist/cursor-coordinates/index.js.map +0 -1
  97. package/dist/deckgl/base-map/types.js.map +0 -1
  98. package/dist/deckgl/index.js.map +0 -1
  99. package/dist/map-mode/index.js.map +0 -1
  100. package/dist/map-mode/types.js.map +0 -1
  101. package/dist/maplibre/index.js.map +0 -1
  102. package/dist/metafile-esm.json +0 -1
  103. package/dist/viewport/index.js.map +0 -1
  104. package/dist/viewport/types.js.map +0 -1
@@ -1,92 +1,112 @@
1
- import { IconLayer } from '@deck.gl/layers';
2
- import ms from 'milsymbol';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
3
12
 
13
+
14
+ import { IconLayer } from "@deck.gl/layers";
15
+ import ms from "milsymbol";
16
+
17
+ //#region src/deckgl/symbol-layer/index.ts
4
18
  const MilSymbol = ms.Symbol;
5
19
  const defaultProps = {
6
- // biome-ignore lint/suspicious/noExplicitAny: We don't know what the data type is.
7
- getSidc: { type: "accessor", value: (x) => x.sidc },
8
- getSymbolOptions: { type: "accessor", value: () => null },
9
- getSize: { type: "accessor", value: 32 },
10
- defaultSymbolOptions: { type: "object", value: {} }
20
+ getSidc: {
21
+ type: "accessor",
22
+ value: (x) => x.sidc
23
+ },
24
+ getSymbolOptions: {
25
+ type: "accessor",
26
+ value: () => null
27
+ },
28
+ getSize: {
29
+ type: "accessor",
30
+ value: 32
31
+ },
32
+ defaultSymbolOptions: {
33
+ type: "object",
34
+ value: {}
35
+ }
36
+ };
37
+ /**
38
+ * Provides a layer for rendering MIL-STD-2525 and APP-6 symbols.
39
+ */
40
+ var SymbolLayer = class extends IconLayer {
41
+ static defaultProps = defaultProps;
42
+ static layerName = "SymbolLayer";
43
+ /**
44
+ * The default symbol options to use when rendering symbols.
45
+ *
46
+ * @internal
47
+ */
48
+ defaultOptions;
49
+ /**
50
+ * Caches the results of the icon generation
51
+ *
52
+ * @internal
53
+ * @todo Use LRU cache to limit memory usage.
54
+ */
55
+ generationCache = /* @__PURE__ */ new Map();
56
+ constructor(...args) {
57
+ const customGetIcons = { getIcon: (data, info) => this.generateIcon(data, info) };
58
+ super(...args, customGetIcons);
59
+ this.defaultOptions = {
60
+ size: 100,
61
+ colorMode: "Dark",
62
+ ...this.props.defaultSymbolOptions
63
+ };
64
+ }
65
+ /**
66
+ * Generates an icon using the provided SIDC and symbol options.
67
+ *
68
+ * @param data A point's data
69
+ * @param info Contextual information about the point
70
+ * @returns DeckGL Icon Object
71
+ */
72
+ generateIcon = (data, info) => {
73
+ const { getSidc, getSymbolOptions } = this.props;
74
+ const sidc = getSidc(data, info).toString();
75
+ let currentSymbolOptions = this.defaultOptions;
76
+ const localOptions = getSymbolOptions(data, info);
77
+ if (localOptions) currentSymbolOptions = {
78
+ ...currentSymbolOptions,
79
+ ...localOptions
80
+ };
81
+ const size = currentSymbolOptions.size;
82
+ const cacheKey = this.generateCacheKey(sidc, currentSymbolOptions);
83
+ if (this.generationCache.has(cacheKey)) return {
84
+ id: cacheKey,
85
+ url: this.generationCache.get(cacheKey),
86
+ height: size,
87
+ width: size
88
+ };
89
+ const dataUrl = new MilSymbol(sidc, currentSymbolOptions).toDataURL();
90
+ this.generationCache.set(cacheKey, dataUrl);
91
+ return {
92
+ id: cacheKey,
93
+ url: dataUrl,
94
+ height: size,
95
+ width: size
96
+ };
97
+ };
98
+ /**
99
+ * Generates a cache key for the given SIDC and symbol options.
100
+ *
101
+ * @param sidc SIDC of the symbol
102
+ * @param options Options used to generate the symbol
103
+ * @returns String key for caching
104
+ */
105
+ generateCacheKey(sidc, options) {
106
+ return `${sidc}-${JSON.stringify(options)}`;
107
+ }
11
108
  };
12
- class SymbolLayer extends IconLayer {
13
- static defaultProps = defaultProps;
14
- static layerName = "SymbolLayer";
15
- /**
16
- * The default symbol options to use when rendering symbols.
17
- *
18
- * @internal
19
- */
20
- defaultOptions;
21
- /**
22
- * Caches the results of the icon generation
23
- *
24
- * @internal
25
- * @todo Use LRU cache to limit memory usage.
26
- */
27
- generationCache = /* @__PURE__ */ new Map();
28
- constructor(...args) {
29
- const customGetIcons = {
30
- getIcon: (data, info) => this.generateIcon(data, info)
31
- };
32
- super(...args, customGetIcons);
33
- this.defaultOptions = {
34
- size: 100,
35
- colorMode: "Dark",
36
- ...this.props.defaultSymbolOptions
37
- };
38
- }
39
- /**
40
- * Generates an icon using the provided SIDC and symbol options.
41
- *
42
- * @param data A point's data
43
- * @param info Contextual information about the point
44
- * @returns DeckGL Icon Object
45
- */
46
- generateIcon = (data, info) => {
47
- const { getSidc, getSymbolOptions } = this.props;
48
- const sidc = getSidc(data, info).toString();
49
- let currentSymbolOptions = this.defaultOptions;
50
- const localOptions = getSymbolOptions(data, info);
51
- if (localOptions) {
52
- currentSymbolOptions = {
53
- ...currentSymbolOptions,
54
- ...localOptions
55
- };
56
- }
57
- const size = currentSymbolOptions.size;
58
- const cacheKey = this.generateCacheKey(sidc, currentSymbolOptions);
59
- if (this.generationCache.has(cacheKey)) {
60
- const cachedUrl = this.generationCache.get(cacheKey);
61
- return {
62
- id: cacheKey,
63
- url: cachedUrl,
64
- height: size,
65
- width: size
66
- };
67
- }
68
- const dataUrl = new MilSymbol(sidc, currentSymbolOptions).toDataURL();
69
- this.generationCache.set(cacheKey, dataUrl);
70
- const returnData = {
71
- id: cacheKey,
72
- url: dataUrl,
73
- height: size,
74
- width: size
75
- };
76
- return returnData;
77
- };
78
- /**
79
- * Generates a cache key for the given SIDC and symbol options.
80
- *
81
- * @param sidc SIDC of the symbol
82
- * @param options Options used to generate the symbol
83
- * @returns String key for caching
84
- */
85
- generateCacheKey(sidc, options) {
86
- return `${sidc}-${JSON.stringify(options)}`;
87
- }
88
- }
89
109
 
110
+ //#endregion
90
111
  export { SymbolLayer };
91
- //# sourceMappingURL=index.js.map
92
112
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/deckgl/symbol-layer/index.ts"],"names":[],"mappings":"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","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 { IconLayer, type IconLayerProps } from '@deck.gl/layers';\nimport ms, { type SymbolOptions } from 'milsymbol';\nimport type {\n AccessorContext,\n AccessorFunction,\n DefaultProps,\n} from '@deck.gl/core';\n\nconst MilSymbol = ms.Symbol;\n\ntype _SymbolLayerProps<TData = unknown> = {\n /**\n * An accessor function that returns the SIDC for a given data point.\n */\n getSidc?: AccessorFunction<TData, string | number | bigint>;\n /**\n * An accessor function that returns symbol options for a given data point.\n */\n getSymbolOptions?: AccessorFunction<TData, SymbolOptions | null>;\n /**\n * Default symbol options to use when rendering symbols.\n */\n defaultSymbolOptions?: SymbolOptions;\n};\n\nexport type SymbolLayerProps<TData = unknown> = _SymbolLayerProps<TData> &\n Omit<\n IconLayerProps<TData>,\n 'getIcon' | 'getColor' | 'iconAtlas' | 'iconMapping'\n >;\n\nconst defaultProps: DefaultProps<SymbolLayerProps> = {\n // biome-ignore lint/suspicious/noExplicitAny: We don't know what the data type is.\n getSidc: { type: 'accessor', value: (x: any) => x.sidc },\n getSymbolOptions: { type: 'accessor', value: () => null },\n getSize: { type: 'accessor', value: 32 },\n defaultSymbolOptions: { type: 'object', value: {} },\n};\n\n/**\n * Provides a layer for rendering MIL-STD-2525 and APP-6 symbols.\n */\nexport class SymbolLayer<\n TData = unknown,\n // biome-ignore lint/complexity/noBannedTypes: Follows DeckGL format.\n TExtraProps extends {} = {},\n> extends IconLayer<TData, TExtraProps & Required<_SymbolLayerProps<TData>>> {\n static override defaultProps = defaultProps;\n static override layerName = 'SymbolLayer';\n\n /**\n * The default symbol options to use when rendering symbols.\n *\n * @internal\n */\n protected defaultOptions: SymbolOptions;\n\n /**\n * Caches the results of the icon generation\n *\n * @internal\n * @todo Use LRU cache to limit memory usage.\n */\n protected generationCache = new Map<string, string>();\n\n constructor(...args: Partial<SymbolLayerProps<TData>>[]) {\n // Props are frozen after the construction\n const customGetIcons = {\n getIcon: (data: TData, info: AccessorContext<TData>) =>\n this.generateIcon(data, info),\n } as IconLayerProps<TData>;\n\n // biome-ignore lint/suspicious/noExplicitAny: Needed to retype the layer.\n super(...(args as any), customGetIcons as any);\n\n // Default options need to be set in the constructor.\n this.defaultOptions = {\n size: 100,\n colorMode: 'Dark',\n ...this.props.defaultSymbolOptions,\n };\n }\n\n /**\n * Generates an icon using the provided SIDC and symbol options.\n *\n * @param data A point's data\n * @param info Contextual information about the point\n * @returns DeckGL Icon Object\n */\n protected generateIcon = (data: TData, info: AccessorContext<TData>) => {\n const { getSidc, getSymbolOptions } = this.props;\n const sidc = getSidc(data, info).toString();\n\n let currentSymbolOptions = this.defaultOptions;\n\n const localOptions = getSymbolOptions(data, info);\n\n if (localOptions) {\n currentSymbolOptions = {\n ...currentSymbolOptions,\n ...localOptions,\n };\n }\n\n const size = currentSymbolOptions.size as number;\n\n const cacheKey = this.generateCacheKey(sidc, currentSymbolOptions);\n\n if (this.generationCache.has(cacheKey)) {\n const cachedUrl = this.generationCache.get(cacheKey) as string;\n\n return {\n id: cacheKey,\n url: cachedUrl,\n height: size,\n width: size,\n };\n }\n\n const dataUrl = new MilSymbol(sidc, currentSymbolOptions).toDataURL();\n\n this.generationCache.set(cacheKey, dataUrl);\n\n const returnData = {\n id: cacheKey,\n url: dataUrl,\n height: size,\n width: size,\n };\n\n return returnData;\n };\n\n /**\n * Generates a cache key for the given SIDC and symbol options.\n *\n * @param sidc SIDC of the symbol\n * @param options Options used to generate the symbol\n * @returns String key for caching\n */\n protected generateCacheKey(sidc: string, options: SymbolOptions) {\n return `${sidc}-${JSON.stringify(options)}`;\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","names":["defaultProps: DefaultProps<SymbolLayerProps>"],"sources":["../../../src/deckgl/symbol-layer/index.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { IconLayer, type IconLayerProps } from '@deck.gl/layers';\nimport ms, { type SymbolOptions } from 'milsymbol';\nimport type {\n AccessorContext,\n AccessorFunction,\n DefaultProps,\n} from '@deck.gl/core';\n\nconst MilSymbol = ms.Symbol;\n\ntype _SymbolLayerProps<TData = unknown> = {\n /**\n * An accessor function that returns the SIDC for a given data point.\n */\n getSidc?: AccessorFunction<TData, string | number | bigint>;\n /**\n * An accessor function that returns symbol options for a given data point.\n */\n getSymbolOptions?: AccessorFunction<TData, SymbolOptions | null>;\n /**\n * Default symbol options to use when rendering symbols.\n */\n defaultSymbolOptions?: SymbolOptions;\n};\n\nexport type SymbolLayerProps<TData = unknown> = _SymbolLayerProps<TData> &\n Omit<\n IconLayerProps<TData>,\n 'getIcon' | 'getColor' | 'iconAtlas' | 'iconMapping'\n >;\n\nconst defaultProps: DefaultProps<SymbolLayerProps> = {\n // biome-ignore lint/suspicious/noExplicitAny: We don't know what the data type is.\n getSidc: { type: 'accessor', value: (x: any) => x.sidc },\n getSymbolOptions: { type: 'accessor', value: () => null },\n getSize: { type: 'accessor', value: 32 },\n defaultSymbolOptions: { type: 'object', value: {} },\n};\n\n/**\n * Provides a layer for rendering MIL-STD-2525 and APP-6 symbols.\n */\nexport class SymbolLayer<\n TData = unknown,\n // biome-ignore lint/complexity/noBannedTypes: Follows DeckGL format.\n TExtraProps extends {} = {},\n> extends IconLayer<TData, TExtraProps & Required<_SymbolLayerProps<TData>>> {\n static override defaultProps = defaultProps;\n static override layerName = 'SymbolLayer';\n\n /**\n * The default symbol options to use when rendering symbols.\n *\n * @internal\n */\n protected defaultOptions: SymbolOptions;\n\n /**\n * Caches the results of the icon generation\n *\n * @internal\n * @todo Use LRU cache to limit memory usage.\n */\n protected generationCache = new Map<string, string>();\n\n constructor(...args: Partial<SymbolLayerProps<TData>>[]) {\n // Props are frozen after the construction\n const customGetIcons = {\n getIcon: (data: TData, info: AccessorContext<TData>) =>\n this.generateIcon(data, info),\n } as IconLayerProps<TData>;\n\n // biome-ignore lint/suspicious/noExplicitAny: Needed to retype the layer.\n super(...(args as any), customGetIcons as any);\n\n // Default options need to be set in the constructor.\n this.defaultOptions = {\n size: 100,\n colorMode: 'Dark',\n ...this.props.defaultSymbolOptions,\n };\n }\n\n /**\n * Generates an icon using the provided SIDC and symbol options.\n *\n * @param data A point's data\n * @param info Contextual information about the point\n * @returns DeckGL Icon Object\n */\n protected generateIcon = (data: TData, info: AccessorContext<TData>) => {\n const { getSidc, getSymbolOptions } = this.props;\n const sidc = getSidc(data, info).toString();\n\n let currentSymbolOptions = this.defaultOptions;\n\n const localOptions = getSymbolOptions(data, info);\n\n if (localOptions) {\n currentSymbolOptions = {\n ...currentSymbolOptions,\n ...localOptions,\n };\n }\n\n const size = currentSymbolOptions.size as number;\n\n const cacheKey = this.generateCacheKey(sidc, currentSymbolOptions);\n\n if (this.generationCache.has(cacheKey)) {\n const cachedUrl = this.generationCache.get(cacheKey) as string;\n\n return {\n id: cacheKey,\n url: cachedUrl,\n height: size,\n width: size,\n };\n }\n\n const dataUrl = new MilSymbol(sidc, currentSymbolOptions).toDataURL();\n\n this.generationCache.set(cacheKey, dataUrl);\n\n const returnData = {\n id: cacheKey,\n url: dataUrl,\n height: size,\n width: size,\n };\n\n return returnData;\n };\n\n /**\n * Generates a cache key for the given SIDC and symbol options.\n *\n * @param sidc SIDC of the symbol\n * @param options Options used to generate the symbol\n * @returns String key for caching\n */\n protected generateCacheKey(sidc: string, options: SymbolOptions) {\n return `${sidc}-${JSON.stringify(options)}`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoBA,MAAM,YAAY,GAAG;AAuBrB,MAAMA,eAA+C;CAEnD,SAAS;EAAE,MAAM;EAAY,QAAQ,MAAW,EAAE;EAAM;CACxD,kBAAkB;EAAE,MAAM;EAAY,aAAa;EAAM;CACzD,SAAS;EAAE,MAAM;EAAY,OAAO;EAAI;CACxC,sBAAsB;EAAE,MAAM;EAAU,OAAO,EAAE;EAAE;CACpD;;;;AAKD,IAAa,cAAb,cAIU,UAAmE;CAC3E,OAAgB,eAAe;CAC/B,OAAgB,YAAY;;;;;;CAO5B,AAAU;;;;;;;CAQV,AAAU,kCAAkB,IAAI,KAAqB;CAErD,YAAY,GAAG,MAA0C;EAEvD,MAAM,iBAAiB,EACrB,UAAU,MAAa,SACrB,KAAK,aAAa,MAAM,KAAK,EAChC;AAGD,QAAM,GAAI,MAAc,eAAsB;AAG9C,OAAK,iBAAiB;GACpB,MAAM;GACN,WAAW;GACX,GAAG,KAAK,MAAM;GACf;;;;;;;;;CAUH,AAAU,gBAAgB,MAAa,SAAiC;EACtE,MAAM,EAAE,SAAS,qBAAqB,KAAK;EAC3C,MAAM,OAAO,QAAQ,MAAM,KAAK,CAAC,UAAU;EAE3C,IAAI,uBAAuB,KAAK;EAEhC,MAAM,eAAe,iBAAiB,MAAM,KAAK;AAEjD,MAAI,aACF,wBAAuB;GACrB,GAAG;GACH,GAAG;GACJ;EAGH,MAAM,OAAO,qBAAqB;EAElC,MAAM,WAAW,KAAK,iBAAiB,MAAM,qBAAqB;AAElE,MAAI,KAAK,gBAAgB,IAAI,SAAS,CAGpC,QAAO;GACL,IAAI;GACJ,KAJgB,KAAK,gBAAgB,IAAI,SAAS;GAKlD,QAAQ;GACR,OAAO;GACR;EAGH,MAAM,UAAU,IAAI,UAAU,MAAM,qBAAqB,CAAC,WAAW;AAErE,OAAK,gBAAgB,IAAI,UAAU,QAAQ;AAS3C,SAPmB;GACjB,IAAI;GACJ,KAAK;GACL,QAAQ;GACR,OAAO;GACR;;;;;;;;;CAYH,AAAU,iBAAiB,MAAc,SAAwB;AAC/D,SAAO,GAAG,KAAK,GAAG,KAAK,UAAU,QAAQ"}
@@ -1,3 +1,4 @@
1
+ //#region src/deckgl/text-layer/character-sets.d.ts
1
2
  type CharacterSetsKeys = keyof typeof CHARACTER_SETS;
2
3
  /**
3
4
  * Predefined character sets for TextLayer.
@@ -7,21 +8,22 @@ type CharacterSetsKeys = keyof typeof CHARACTER_SETS;
7
8
  * EXPANDED includes ASCII and Latin characters with diacritics for international text.
8
9
  */
9
10
  declare const CHARACTER_SETS: Readonly<{
10
- readonly ALL_NUMBERS: "1234567890";
11
- readonly ASCII_ALL: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 !\"#$%&'()*+,-./:;<=>?@[]^_`{|}~";
12
- readonly ASCII_ALPHA_NUMERIC: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
13
- readonly ASCII_LETTERS: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
14
- readonly ASCII_LETTERS_LOWERCASE: "abcdefghijklmnopqrstuvwxyz";
15
- readonly ASCII_LETTERS_UPPERCASE: "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
16
- readonly ASCII_SYMBOLS: " !\"#$%&'()*+,-./:;<=>?@[]^_`{|}~";
17
- readonly AUTO: "auto";
18
- readonly EXPANDED: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 !\"#$%&'()*+,-./:;<=>?@[]^_`{|}~àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ1234567890 ¡¿¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿×÷";
19
- readonly LATIN_ALL: "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ1234567890 ¡¿¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿×÷";
20
- readonly LATIN_ALPHA_NUMERIC: "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ1234567890";
21
- readonly LATIN_LETTERS: "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ";
22
- readonly LATIN_LETTERS_LOWERCASE: "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿß";
23
- readonly LATIN_LETTERS_UPPERCASE: "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ";
24
- readonly LATIN_SYMBOLS: " ¡¿¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿×÷";
11
+ readonly ALL_NUMBERS: "1234567890";
12
+ readonly ASCII_ALL: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 !\"#$%&'()*+,-./:;<=>?@[]^_`{|}~";
13
+ readonly ASCII_ALPHA_NUMERIC: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
14
+ readonly ASCII_LETTERS: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
15
+ readonly ASCII_LETTERS_LOWERCASE: "abcdefghijklmnopqrstuvwxyz";
16
+ readonly ASCII_LETTERS_UPPERCASE: "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
17
+ readonly ASCII_SYMBOLS: " !\"#$%&'()*+,-./:;<=>?@[]^_`{|}~";
18
+ readonly AUTO: "auto";
19
+ readonly EXPANDED: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 !\"#$%&'()*+,-./:;<=>?@[]^_`{|}~àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ1234567890 ¡¿¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿×÷";
20
+ readonly LATIN_ALL: "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ1234567890 ¡¿¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿×÷";
21
+ readonly LATIN_ALPHA_NUMERIC: "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ1234567890";
22
+ readonly LATIN_LETTERS: "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ";
23
+ readonly LATIN_LETTERS_LOWERCASE: "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿß";
24
+ readonly LATIN_LETTERS_UPPERCASE: "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ";
25
+ readonly LATIN_SYMBOLS: " ¡¿¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿×÷";
25
26
  }>;
26
-
27
- export { CHARACTER_SETS, type CharacterSetsKeys };
27
+ //#endregion
28
+ export { CHARACTER_SETS, CharacterSetsKeys };
29
+ //# sourceMappingURL=character-sets.d.ts.map
@@ -1,3 +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
+
14
+ //#region src/deckgl/text-layer/character-sets.ts
1
15
  const ALL_NUMBERS = "1234567890";
2
16
  const ASCII_LETTERS_LOWERCASE = "abcdefghijklmnopqrstuvwxyz";
3
17
  const ASCII_LETTERS_UPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
@@ -6,31 +20,38 @@ const ASCII_LETTERS = `${ASCII_LETTERS_LOWERCASE}${ASCII_LETTERS_UPPERCASE}`;
6
20
  const ASCII_ALPHA_NUMERIC = `${ASCII_LETTERS}${ALL_NUMBERS}`;
7
21
  const ASCII_ALL = `${ASCII_LETTERS}${ALL_NUMBERS}${ASCII_SYMBOLS}`;
8
22
  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";
23
+ const LATIN_LETTERS_LOWERCASE = "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿß";
24
+ const LATIN_LETTERS_UPPERCASE = "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ";
25
+ const LATIN_SYMBOLS = " ¡¿¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿×÷";
12
26
  const LATIN_LETTERS = `${LATIN_LETTERS_LOWERCASE}${LATIN_LETTERS_UPPERCASE}`;
13
27
  const LATIN_ALPHA_NUMERIC = `${LATIN_LETTERS}${ALL_NUMBERS}`;
14
28
  const LATIN_ALL = `${LATIN_LETTERS}${ALL_NUMBERS}${LATIN_SYMBOLS}`;
15
29
  const EXPANDED = `${ASCII_ALL}${LATIN_ALL}`;
30
+ /**
31
+ * Predefined character sets for TextLayer.
32
+ *
33
+ * Use smaller character sets (ASCII_ALL, ASCII_ALPHA_NUMERIC) for better performance,
34
+ * or use AUTO for dynamic optimization based on content.
35
+ * EXPANDED includes ASCII and Latin characters with diacritics for international text.
36
+ */
16
37
  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
38
+ ALL_NUMBERS,
39
+ ASCII_ALL,
40
+ ASCII_ALPHA_NUMERIC,
41
+ ASCII_LETTERS,
42
+ ASCII_LETTERS_LOWERCASE,
43
+ ASCII_LETTERS_UPPERCASE,
44
+ ASCII_SYMBOLS,
45
+ AUTO,
46
+ EXPANDED,
47
+ LATIN_ALL,
48
+ LATIN_ALPHA_NUMERIC,
49
+ LATIN_LETTERS,
50
+ LATIN_LETTERS_LOWERCASE,
51
+ LATIN_LETTERS_UPPERCASE,
52
+ LATIN_SYMBOLS
32
53
  });
33
54
 
55
+ //#endregion
34
56
  export { CHARACTER_SETS };
35
- //# sourceMappingURL=character-sets.js.map
36
57
  //# sourceMappingURL=character-sets.js.map
@@ -1 +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"]}
1
+ {"version":3,"file":"character-sets.js","names":[],"sources":["../../../src/deckgl/text-layer/character-sets.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nconst ALL_NUMBERS = '1234567890';\n\nconst ASCII_LETTERS_LOWERCASE = 'abcdefghijklmnopqrstuvwxyz';\nconst ASCII_LETTERS_UPPERCASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nconst ASCII_SYMBOLS = ' !\"#$%&\\'()*+,-./:;<=>?@[]^_`{|}~';\n\nconst ASCII_LETTERS = `${ASCII_LETTERS_LOWERCASE}${ASCII_LETTERS_UPPERCASE}`;\nconst ASCII_ALPHA_NUMERIC = `${ASCII_LETTERS}${ALL_NUMBERS}`;\nconst ASCII_ALL = `${ASCII_LETTERS}${ALL_NUMBERS}${ASCII_SYMBOLS}`;\n\nconst AUTO = 'auto';\n\nconst LATIN_LETTERS_LOWERCASE = 'àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿß';\nconst LATIN_LETTERS_UPPERCASE = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ';\nconst LATIN_SYMBOLS = ' ¡¿¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿×÷';\n\nconst LATIN_LETTERS = `${LATIN_LETTERS_LOWERCASE}${LATIN_LETTERS_UPPERCASE}`;\nconst LATIN_ALPHA_NUMERIC = `${LATIN_LETTERS}${ALL_NUMBERS}`;\nconst LATIN_ALL = `${LATIN_LETTERS}${ALL_NUMBERS}${LATIN_SYMBOLS}`;\n\nconst EXPANDED = `${ASCII_ALL}${LATIN_ALL}`;\n\nexport type CharacterSetsKeys = keyof typeof CHARACTER_SETS;\n\n/**\n * Predefined character sets for TextLayer.\n *\n * Use smaller character sets (ASCII_ALL, ASCII_ALPHA_NUMERIC) for better performance,\n * or use AUTO for dynamic optimization based on content.\n * EXPANDED includes ASCII and Latin characters with diacritics for international text.\n */\nexport const CHARACTER_SETS = Object.freeze({\n ALL_NUMBERS,\n\n ASCII_ALL,\n ASCII_ALPHA_NUMERIC,\n ASCII_LETTERS,\n ASCII_LETTERS_LOWERCASE,\n ASCII_LETTERS_UPPERCASE,\n ASCII_SYMBOLS,\n\n AUTO,\n EXPANDED,\n\n LATIN_ALL,\n LATIN_ALPHA_NUMERIC,\n LATIN_LETTERS,\n LATIN_LETTERS_LOWERCASE,\n LATIN_LETTERS_UPPERCASE,\n LATIN_SYMBOLS,\n} as const);\n"],"mappings":";;;;;;;;;;;;;;AAYA,MAAM,cAAc;AAEpB,MAAM,0BAA0B;AAChC,MAAM,0BAA0B;AAChC,MAAM,gBAAgB;AAEtB,MAAM,gBAAgB,GAAG,0BAA0B;AACnD,MAAM,sBAAsB,GAAG,gBAAgB;AAC/C,MAAM,YAAY,GAAG,gBAAgB,cAAc;AAEnD,MAAM,OAAO;AAEb,MAAM,0BAA0B;AAChC,MAAM,0BAA0B;AAChC,MAAM,gBAAgB;AAEtB,MAAM,gBAAgB,GAAG,0BAA0B;AACnD,MAAM,sBAAsB,GAAG,gBAAgB;AAC/C,MAAM,YAAY,GAAG,gBAAgB,cAAc;AAEnD,MAAM,WAAW,GAAG,YAAY;;;;;;;;AAWhC,MAAa,iBAAiB,OAAO,OAAO;CAC1C;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACD,CAAU"}
@@ -1,5 +1,19 @@
1
- import { TextLayerProps } from '@deck.gl/layers';
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
- declare const defaultSettings: Partial<TextLayerProps>;
13
+ import { TextLayerProps } from "@deck.gl/layers";
4
14
 
15
+ //#region src/deckgl/text-layer/default-settings.d.ts
16
+ declare const defaultSettings: Partial<TextLayerProps>;
17
+ //#endregion
5
18
  export { defaultSettings };
19
+ //# sourceMappingURL=default-settings.d.ts.map
@@ -1,23 +1,47 @@
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/deckgl/text-layer/default-settings.ts
1
15
  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
16
+ fontFamily: "system-ui, sans-serif",
17
+ fontSettings: {
18
+ fontSize: 22,
19
+ sdf: true,
20
+ buffer: 10,
21
+ cutoff: .19,
22
+ radius: 10,
23
+ smoothing: .1
24
+ },
25
+ fontWeight: 500,
26
+ getAlignmentBaseline: "center",
27
+ getColor: [
28
+ 255,
29
+ 255,
30
+ 255,
31
+ 255
32
+ ],
33
+ getSize: 12,
34
+ getTextAnchor: "middle",
35
+ lineHeight: 1,
36
+ outlineColor: [
37
+ 0,
38
+ 0,
39
+ 0,
40
+ 255
41
+ ],
42
+ outlineWidth: 2
19
43
  };
20
44
 
45
+ //#endregion
21
46
  export { defaultSettings };
22
- //# sourceMappingURL=default-settings.js.map
23
47
  //# sourceMappingURL=default-settings.js.map
@@ -1 +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"]}
1
+ {"version":3,"file":"default-settings.js","names":["defaultSettings: Partial<DglTextLayerProps>"],"sources":["../../../src/deckgl/text-layer/default-settings.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport 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"],"mappings":";;;;;;;;;;;;;;AAeA,MAAaA,kBAA8C;CACzD,YAAY;CACZ,cAAc;EACZ,UAAU;EACV,KAAK;EACL,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,WAAW;EACZ;CACD,YAAY;CACZ,sBAAsB;CACtB,UAAU;EAAC;EAAK;EAAK;EAAK;EAAI;CAC9B,SAAS;CACT,eAAe;CACf,YAAY;CACZ,cAAc;EAAC;EAAG;EAAG;EAAG;EAAI;CAC5B,cAAc;CACf"}
@@ -1,31 +1,42 @@
1
- import { TextLayerProps } from './index.js';
2
- import '@deck.gl/layers';
3
- import './character-sets.js';
4
- import 'type-fest';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
5
12
 
13
+ import { TextLayerProps } from "./index.js";
14
+
15
+ //#region src/deckgl/text-layer/fiber.d.ts
6
16
  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
- }
17
+ namespace React {
18
+ namespace JSX {
19
+ interface IntrinsicElements {
20
+ /**
21
+ * A styled text layer for DeckGL Fiber with enhanced styling capabilities.
22
+ *
23
+ * Provides customizable font styling, text outline support, and extended character sets.
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * <textLayer
28
+ * id="my-text"
29
+ * data={textData}
30
+ * getText={d => d.text}
31
+ * getPosition={d => d.position}
32
+ * getSize={12}
33
+ * fontWeight={500}
34
+ * />
35
+ * ```
36
+ */
37
+ textLayer: TextLayerProps;
38
+ }
30
39
  }
40
+ }
31
41
  }
42
+ //# sourceMappingURL=fiber.d.ts.map
@@ -1,6 +1,21 @@
1
- import { extend } from '@deckgl-fiber-renderer/dom';
2
- import { TextLayer } from './index.js';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
3
12
 
13
+
14
+ import { TextLayer } from "./index.js";
15
+ import { extend } from "@deckgl-fiber-renderer/dom";
16
+
17
+ //#region src/deckgl/text-layer/fiber.ts
4
18
  extend({ TextLayer });
5
- //# sourceMappingURL=fiber.js.map
19
+
20
+ //#endregion
6
21
  //# sourceMappingURL=fiber.js.map
@@ -1 +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"]}
1
+ {"version":3,"file":"fiber.js","names":[],"sources":["../../../src/deckgl/text-layer/fiber.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { extend } from '@deckgl-fiber-renderer/dom';\nimport { TextLayer, type TextLayerProps } from './index';\n\nextend({ TextLayer });\n\ndeclare global {\n namespace React {\n // biome-ignore lint/style/useNamingConvention: Built-in React namespace.\n namespace JSX {\n interface IntrinsicElements {\n /**\n * A styled text layer for DeckGL Fiber with enhanced styling capabilities.\n *\n * Provides customizable font styling, text outline support, and extended character sets.\n *\n * @example\n * ```tsx\n * <textLayer\n * id=\"my-text\"\n * data={textData}\n * getText={d => d.text}\n * getPosition={d => d.position}\n * getSize={12}\n * fontWeight={500}\n * />\n * ```\n */\n textLayer: TextLayerProps;\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAeA,OAAO,EAAE,WAAW,CAAC"}