@studiometa/ui-mapbox 0.0.1 → 1.10.0-beta.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 (117) hide show
  1. package/AbstractMapboxControl.d.ts +53 -0
  2. package/AbstractMapboxControl.js +70 -0
  3. package/AbstractMapboxControl.js.map +1 -0
  4. package/AbstractMapboxMapChild.d.ts +229 -0
  5. package/AbstractMapboxMapChild.js +336 -0
  6. package/AbstractMapboxMapChild.js.map +1 -0
  7. package/LICENSE.md +110 -0
  8. package/MapboxCluster.d.ts +208 -0
  9. package/MapboxCluster.js +418 -0
  10. package/MapboxCluster.js.map +1 -0
  11. package/MapboxClusterItem.d.ts +130 -0
  12. package/MapboxClusterItem.js +182 -0
  13. package/MapboxClusterItem.js.map +1 -0
  14. package/MapboxFullscreenControl.d.ts +21 -0
  15. package/MapboxFullscreenControl.js +21 -0
  16. package/MapboxFullscreenControl.js.map +1 -0
  17. package/MapboxGeocoder.d.ts +64 -0
  18. package/MapboxGeocoder.js +80 -0
  19. package/MapboxGeocoder.js.map +1 -0
  20. package/MapboxGeolocateControl.d.ts +23 -0
  21. package/MapboxGeolocateControl.js +31 -0
  22. package/MapboxGeolocateControl.js.map +1 -0
  23. package/MapboxImage.d.ts +49 -0
  24. package/MapboxImage.js +83 -0
  25. package/MapboxImage.js.map +1 -0
  26. package/MapboxImages.d.ts +66 -0
  27. package/MapboxImages.js +95 -0
  28. package/MapboxImages.js.map +1 -0
  29. package/MapboxLayer.d.ts +99 -0
  30. package/MapboxLayer.js +148 -0
  31. package/MapboxLayer.js.map +1 -0
  32. package/MapboxMap.d.ts +64 -0
  33. package/MapboxMap.js +131 -0
  34. package/MapboxMap.js.map +1 -0
  35. package/MapboxMarker.d.ts +56 -0
  36. package/MapboxMarker.js +73 -0
  37. package/MapboxMarker.js.map +1 -0
  38. package/MapboxNavigationControl.d.ts +27 -0
  39. package/MapboxNavigationControl.js +28 -0
  40. package/MapboxNavigationControl.js.map +1 -0
  41. package/MapboxPopup.d.ts +51 -0
  42. package/MapboxPopup.js +76 -0
  43. package/MapboxPopup.js.map +1 -0
  44. package/MapboxSource.d.ts +68 -0
  45. package/MapboxSource.js +104 -0
  46. package/MapboxSource.js.map +1 -0
  47. package/README.md +85 -0
  48. package/StoreLocator.d.ts +323 -0
  49. package/StoreLocator.js +538 -0
  50. package/StoreLocator.js.map +1 -0
  51. package/catalog.d.ts +7 -0
  52. package/catalog.js +68 -0
  53. package/catalog.js.map +1 -0
  54. package/dependencies.d.ts +85 -0
  55. package/dependencies.js +84 -0
  56. package/dependencies.js.map +1 -0
  57. package/index.d.ts +18 -0
  58. package/index.js +19 -0
  59. package/index.js.map +1 -0
  60. package/manifest.d.ts +6 -0
  61. package/manifest.js +133 -0
  62. package/manifest.js.map +1 -0
  63. package/package.json +43 -3
  64. package/utils.d.ts +112 -0
  65. package/utils.js +143 -0
  66. package/utils.js.map +1 -0
  67. package/Claude-of-Duty/node_modules/@esbuild/darwin-arm64/bin/esbuild +0 -0
  68. package/alfred-projects-cache.tsv +0 -137
  69. package/claude-501/-Users-titouanmathis--dotfiles/298a49f7-c4b3-4a50-9707-a9c0d0733e95/scratchpad/pptest/config.json +0 -1
  70. package/claude-501/-Users-titouanmathis--dotfiles/298a49f7-c4b3-4a50-9707-a9c0d0733e95/scratchpad/pptest/stub/herdr +0 -8
  71. package/claude-501/-Users-titouanmathis--dotfiles/7d127a50-a71a-411a-bc1f-15b070f909f9/tasks/bg1cckto6.output +0 -4
  72. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/after.toml +0 -298
  73. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/before.toml +0 -298
  74. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/extracted.txt +0 -36
  75. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/final.log +0 -496
  76. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/guard.sh +0 -18
  77. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/lock.check +0 -917
  78. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/mise-registry.json +0 -3827
  79. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/mise.lock.before +0 -917
  80. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/misetest/.config/mise/conf.d/extra.toml +0 -2
  81. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/misetest/.config/mise/mise.lock +0 -47
  82. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/misetest/mise.lock +0 -47
  83. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/misetest/mise.toml +0 -2
  84. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/probe/.github/workflows/mise-check.yml +0 -188
  85. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/probe/.github/workflows/renovate.yml +0 -62
  86. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/probe/mise.lock +0 -917
  87. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/probe/mise.toml +0 -291
  88. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/probe/probe.log +0 -4974
  89. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/probe/probe2.log +0 -22
  90. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/probe/probe3.log +0 -4916
  91. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/probe/renovate.json +0 -62
  92. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/renovate-local.log +0 -670
  93. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/symtest/link/mise.lock +0 -47
  94. package/claude-501/-Users-titouanmathis--dotfiles/dd4cd328-df52-4522-a502-48fa24b7b142/scratchpad/symtest/real/source.toml +0 -4
  95. package/claude-501/-Users-titouanmathis-Lab--studiometa-automations/d6c27f69-577a-468b-9bb3-a45c03a66143/scratchpad/cookie.txt +0 -1
  96. package/gitlab-docs-read.md +0 -8
  97. package/gitlab-instance-limits.txt +0 -8
  98. package/piab-501/piab-devops-019fcbcc991d-59c77b27-fresh-47da8bd318.config +0 -1
  99. package/pins-new.txt +0 -36
  100. package/pins-old.txt +0 -36
  101. package/reply +0 -0
  102. package/zsh0IBbcP +0 -0
  103. package/zsh2LqT39 +0 -0
  104. package/zsh6KJGTP +0 -0
  105. package/zshN1hNdy +0 -0
  106. package/zshNjWSYH +0 -11
  107. package/zshNvB745 +0 -0
  108. package/zshOXC0uH +0 -0
  109. package/zshPG9CFU +0 -0
  110. package/zshVOeZsK +0 -0
  111. package/zshVqIgQS +0 -0
  112. package/zshXTrFg8 +0 -0
  113. package/zshaUGubs +0 -11
  114. package/zshbzOT6d +0 -1
  115. package/zshnbtbGK +0 -0
  116. package/zshpQi1EI +0 -2
  117. package/zshwhMjOD +0 -1
@@ -0,0 +1,85 @@
1
+ import mapboxgl from "mapbox-gl";
2
+
3
+ //#region dependencies.d.ts
4
+ /**
5
+ * The `mapbox-gl` default export namespace (`Map`, `Marker`, `Popup`, `LngLat`,
6
+ * the `*Control` constructors, ...). This is the shape every component consumes,
7
+ * whether it was injected with {@link provideMapboxGl} or resolved through the
8
+ * fallback dynamic import.
9
+ */
10
+ type MapboxGl = typeof mapboxgl;
11
+ /**
12
+ * Structural shape of the optional Mapbox geocoder control instances this
13
+ * package builds. Declared locally so the optional `@mapbox/mapbox-gl-geocoder`
14
+ * peer never leaks into the public type surface (and therefore never into the
15
+ * emitted declarations), which would break consumers who install
16
+ * `@studiometa/ui-mapbox` without the optional geocoder peer.
17
+ */
18
+ interface MapboxGeocoderControl {
19
+ addTo(target: unknown): void;
20
+ onRemove(): void;
21
+ /**
22
+ * Subscribe to a geocoder control event. Declared optional so the structural
23
+ * type stays satisfiable by minimal test doubles and older control versions.
24
+ */
25
+ on?(type: string, callback: (event: {
26
+ result: unknown;
27
+ }) => void): void;
28
+ }
29
+ /**
30
+ * Structural constructor type for the optional Mapbox geocoder control, kept out
31
+ * of the public peer type surface for the same reason as {@link MapboxGeocoderControl}.
32
+ */
33
+ interface MapboxGeocoderConstructor {
34
+ new (options: Record<string, unknown>): MapboxGeocoderControl;
35
+ }
36
+ /**
37
+ * Inject the `mapbox-gl` module the components should use.
38
+ *
39
+ * Call once, before the components mount (e.g. right before `createApp`). Once
40
+ * provided, `@studiometa/ui-mapbox` never imports `mapbox-gl` by specifier — it
41
+ * uses this instance — so a host can supply its own build (a specific version, a
42
+ * self-hosted worker for strict CSP, an import-map or CDN module).
43
+ *
44
+ * @param {MapboxGl} instance The `mapbox-gl` default export namespace.
45
+ */
46
+ declare function provideMapboxGl(instance: MapboxGl): void;
47
+ /**
48
+ * Inject the optional Mapbox geocoder control constructor the `MapboxGeocoder`
49
+ * component should use, so the optional `@mapbox/mapbox-gl-geocoder` peer is
50
+ * never imported by specifier either.
51
+ *
52
+ * @param {MapboxGeocoderConstructor} constructor The geocoder control constructor.
53
+ */
54
+ declare function provideMapboxGeocoder(constructor: MapboxGeocoderConstructor): void;
55
+ /**
56
+ * Resolve the `mapbox-gl` namespace: the injected instance when one was provided
57
+ * through {@link provideMapboxGl}, otherwise a lazily loaded `import('mapbox-gl')`.
58
+ *
59
+ * The result is memoized, so `mapbox-gl` loads at most once and repeated calls
60
+ * are cheap. The resolved instance is also cached for {@link getMapboxGl}.
61
+ *
62
+ * @returns {Promise<MapboxGl>}
63
+ */
64
+ declare function resolveMapboxGl(): Promise<MapboxGl>;
65
+ /**
66
+ * Resolve the optional Mapbox geocoder control constructor: the injected one
67
+ * when provided through {@link provideMapboxGeocoder}, otherwise a lazily loaded
68
+ * `import('@mapbox/mapbox-gl-geocoder')`. Memoized like {@link resolveMapboxGl}.
69
+ *
70
+ * @returns {Promise<MapboxGeocoderConstructor>}
71
+ */
72
+ declare function resolveMapboxGeocoder(): Promise<MapboxGeocoderConstructor>;
73
+ /**
74
+ * Synchronously read the resolved `mapbox-gl` namespace.
75
+ *
76
+ * Only valid after {@link resolveMapboxGl} (or {@link provideMapboxGl}) has run;
77
+ * it throws otherwise. Components read it on synchronous hot paths (building a
78
+ * control, marker, popup or `LngLat`) that are only ever reached once the map —
79
+ * and therefore `mapbox-gl` — is ready.
80
+ *
81
+ * @returns {MapboxGl}
82
+ */
83
+ declare function getMapboxGl(): MapboxGl;
84
+ //#endregion
85
+ export { MapboxGeocoderConstructor, MapboxGeocoderControl, MapboxGl, getMapboxGl, provideMapboxGeocoder, provideMapboxGl, resolveMapboxGeocoder, resolveMapboxGl };
@@ -0,0 +1,84 @@
1
+ //#region dependencies.ts
2
+ let mapboxGlInstance;
3
+ let mapboxGlPromise;
4
+ let mapboxGlProvided = false;
5
+ let geocoderConstructor;
6
+ let geocoderPromise;
7
+ let geocoderProvided = false;
8
+ /**
9
+ * Inject the `mapbox-gl` module the components should use.
10
+ *
11
+ * Call once, before the components mount (e.g. right before `createApp`). Once
12
+ * provided, `@studiometa/ui-mapbox` never imports `mapbox-gl` by specifier — it
13
+ * uses this instance — so a host can supply its own build (a specific version, a
14
+ * self-hosted worker for strict CSP, an import-map or CDN module).
15
+ *
16
+ * @param {MapboxGl} instance The `mapbox-gl` default export namespace.
17
+ */
18
+ function provideMapboxGl(instance) {
19
+ mapboxGlProvided = true;
20
+ mapboxGlInstance = instance;
21
+ mapboxGlPromise = Promise.resolve(instance);
22
+ }
23
+ /**
24
+ * Inject the optional Mapbox geocoder control constructor the `MapboxGeocoder`
25
+ * component should use, so the optional `@mapbox/mapbox-gl-geocoder` peer is
26
+ * never imported by specifier either.
27
+ *
28
+ * @param {MapboxGeocoderConstructor} constructor The geocoder control constructor.
29
+ */
30
+ function provideMapboxGeocoder(constructor) {
31
+ geocoderProvided = true;
32
+ geocoderConstructor = constructor;
33
+ geocoderPromise = Promise.resolve(constructor);
34
+ }
35
+ /**
36
+ * Resolve the `mapbox-gl` namespace: the injected instance when one was provided
37
+ * through {@link provideMapboxGl}, otherwise a lazily loaded `import('mapbox-gl')`.
38
+ *
39
+ * The result is memoized, so `mapbox-gl` loads at most once and repeated calls
40
+ * are cheap. The resolved instance is also cached for {@link getMapboxGl}.
41
+ *
42
+ * @returns {Promise<MapboxGl>}
43
+ */
44
+ function resolveMapboxGl() {
45
+ if (!mapboxGlPromise) mapboxGlPromise = import("mapbox-gl").then((module) => {
46
+ const instance = module.default ?? module;
47
+ if (!mapboxGlProvided) mapboxGlInstance = instance;
48
+ return mapboxGlInstance;
49
+ });
50
+ return mapboxGlPromise;
51
+ }
52
+ /**
53
+ * Resolve the optional Mapbox geocoder control constructor: the injected one
54
+ * when provided through {@link provideMapboxGeocoder}, otherwise a lazily loaded
55
+ * `import('@mapbox/mapbox-gl-geocoder')`. Memoized like {@link resolveMapboxGl}.
56
+ *
57
+ * @returns {Promise<MapboxGeocoderConstructor>}
58
+ */
59
+ function resolveMapboxGeocoder() {
60
+ if (!geocoderPromise) geocoderPromise = import("@mapbox/mapbox-gl-geocoder").then((module) => {
61
+ const constructor = module.default;
62
+ if (!geocoderProvided) geocoderConstructor = constructor;
63
+ return geocoderConstructor;
64
+ });
65
+ return geocoderPromise;
66
+ }
67
+ /**
68
+ * Synchronously read the resolved `mapbox-gl` namespace.
69
+ *
70
+ * Only valid after {@link resolveMapboxGl} (or {@link provideMapboxGl}) has run;
71
+ * it throws otherwise. Components read it on synchronous hot paths (building a
72
+ * control, marker, popup or `LngLat`) that are only ever reached once the map —
73
+ * and therefore `mapbox-gl` — is ready.
74
+ *
75
+ * @returns {MapboxGl}
76
+ */
77
+ function getMapboxGl() {
78
+ if (!mapboxGlInstance) throw new Error("[@studiometa/ui-mapbox] mapbox-gl has not been resolved yet. Await resolveMapboxGl() (or call provideMapboxGl()) before reading it synchronously.");
79
+ return mapboxGlInstance;
80
+ }
81
+ //#endregion
82
+ export { getMapboxGl, provideMapboxGeocoder, provideMapboxGl, resolveMapboxGeocoder, resolveMapboxGl };
83
+
84
+ //# sourceMappingURL=dependencies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependencies.js","names":[],"sources":["../dependencies.ts"],"sourcesContent":["import type mapboxgl from 'mapbox-gl';\n\n/**\n * The `mapbox-gl` default export namespace (`Map`, `Marker`, `Popup`, `LngLat`,\n * the `*Control` constructors, ...). This is the shape every component consumes,\n * whether it was injected with {@link provideMapboxGl} or resolved through the\n * fallback dynamic import.\n */\nexport type MapboxGl = typeof mapboxgl;\n\n/**\n * Structural shape of the optional Mapbox geocoder control instances this\n * package builds. Declared locally so the optional `@mapbox/mapbox-gl-geocoder`\n * peer never leaks into the public type surface (and therefore never into the\n * emitted declarations), which would break consumers who install\n * `@studiometa/ui-mapbox` without the optional geocoder peer.\n */\nexport interface MapboxGeocoderControl {\n addTo(target: unknown): void;\n onRemove(): void;\n /**\n * Subscribe to a geocoder control event. Declared optional so the structural\n * type stays satisfiable by minimal test doubles and older control versions.\n */\n on?(type: string, callback: (event: { result: unknown }) => void): void;\n}\n\n/**\n * Structural constructor type for the optional Mapbox geocoder control, kept out\n * of the public peer type surface for the same reason as {@link MapboxGeocoderControl}.\n */\nexport interface MapboxGeocoderConstructor {\n new (options: Record<string, unknown>): MapboxGeocoderControl;\n}\n\nlet mapboxGlInstance: MapboxGl | undefined;\nlet mapboxGlPromise: Promise<MapboxGl> | undefined;\nlet mapboxGlProvided = false;\n\nlet geocoderConstructor: MapboxGeocoderConstructor | undefined;\nlet geocoderPromise: Promise<MapboxGeocoderConstructor> | undefined;\nlet geocoderProvided = false;\n\n/**\n * Inject the `mapbox-gl` module the components should use.\n *\n * Call once, before the components mount (e.g. right before `createApp`). Once\n * provided, `@studiometa/ui-mapbox` never imports `mapbox-gl` by specifier — it\n * uses this instance — so a host can supply its own build (a specific version, a\n * self-hosted worker for strict CSP, an import-map or CDN module).\n *\n * @param {MapboxGl} instance The `mapbox-gl` default export namespace.\n */\nexport function provideMapboxGl(instance: MapboxGl): void {\n mapboxGlProvided = true;\n mapboxGlInstance = instance;\n mapboxGlPromise = Promise.resolve(instance);\n}\n\n/**\n * Inject the optional Mapbox geocoder control constructor the `MapboxGeocoder`\n * component should use, so the optional `@mapbox/mapbox-gl-geocoder` peer is\n * never imported by specifier either.\n *\n * @param {MapboxGeocoderConstructor} constructor The geocoder control constructor.\n */\nexport function provideMapboxGeocoder(constructor: MapboxGeocoderConstructor): void {\n geocoderProvided = true;\n geocoderConstructor = constructor;\n geocoderPromise = Promise.resolve(constructor);\n}\n\n/**\n * Resolve the `mapbox-gl` namespace: the injected instance when one was provided\n * through {@link provideMapboxGl}, otherwise a lazily loaded `import('mapbox-gl')`.\n *\n * The result is memoized, so `mapbox-gl` loads at most once and repeated calls\n * are cheap. The resolved instance is also cached for {@link getMapboxGl}.\n *\n * @returns {Promise<MapboxGl>}\n */\nexport function resolveMapboxGl(): Promise<MapboxGl> {\n if (!mapboxGlPromise) {\n mapboxGlPromise = import('mapbox-gl').then((module) => {\n const instance = ((module as { default?: MapboxGl }).default ?? module) as MapboxGl;\n // A provideMapboxGl() call may have won the race while this import was in\n // flight: never let the fallback overwrite an injected instance. Returning\n // the authoritative instance also keeps callers that awaited this promise\n // before the injection consistent with the provided one.\n if (!mapboxGlProvided) {\n mapboxGlInstance = instance;\n }\n return mapboxGlInstance as MapboxGl;\n });\n }\n\n return mapboxGlPromise;\n}\n\n/**\n * Resolve the optional Mapbox geocoder control constructor: the injected one\n * when provided through {@link provideMapboxGeocoder}, otherwise a lazily loaded\n * `import('@mapbox/mapbox-gl-geocoder')`. Memoized like {@link resolveMapboxGl}.\n *\n * @returns {Promise<MapboxGeocoderConstructor>}\n */\nexport function resolveMapboxGeocoder(): Promise<MapboxGeocoderConstructor> {\n if (!geocoderPromise) {\n geocoderPromise = import('@mapbox/mapbox-gl-geocoder').then((module) => {\n // Cast through `unknown`: the peer's real constructor signature is narrower\n // than the structural `MapboxGeocoderConstructor` kept out of the public\n // type surface, so the two do not directly overlap.\n const constructor = (module as unknown as { default: MapboxGeocoderConstructor }).default;\n // Same race guard as resolveMapboxGl(): a provideMapboxGeocoder() call that\n // landed while this import was in flight must not be overwritten.\n if (!geocoderProvided) {\n geocoderConstructor = constructor;\n }\n return geocoderConstructor as MapboxGeocoderConstructor;\n });\n }\n\n return geocoderPromise;\n}\n\n/**\n * Synchronously read the resolved `mapbox-gl` namespace.\n *\n * Only valid after {@link resolveMapboxGl} (or {@link provideMapboxGl}) has run;\n * it throws otherwise. Components read it on synchronous hot paths (building a\n * control, marker, popup or `LngLat`) that are only ever reached once the map —\n * and therefore `mapbox-gl` — is ready.\n *\n * @returns {MapboxGl}\n */\nexport function getMapboxGl(): MapboxGl {\n if (!mapboxGlInstance) {\n throw new Error(\n '[@studiometa/ui-mapbox] mapbox-gl has not been resolved yet. Await resolveMapboxGl() (or call provideMapboxGl()) before reading it synchronously.',\n );\n }\n\n return mapboxGlInstance;\n}\n"],"mappings":";AAmCA,IAAI;AACJ,IAAI;AACJ,IAAI,mBAAmB;AAEvB,IAAI;AACJ,IAAI;AACJ,IAAI,mBAAmB;;;;;;;;;;;AAYvB,SAAgB,gBAAgB,UAA0B;AACxD,oBAAmB;AACnB,oBAAmB;AACnB,mBAAkB,QAAQ,QAAQ,SAAS;;;;;;;;;AAU7C,SAAgB,sBAAsB,aAA8C;AAClF,oBAAmB;AACnB,uBAAsB;AACtB,mBAAkB,QAAQ,QAAQ,YAAY;;;;;;;;;;;AAYhD,SAAgB,kBAAqC;AACnD,KAAI,CAAC,gBACH,mBAAkB,OAAO,aAAa,MAAM,WAAW;EACrD,MAAM,WAAa,OAAkC,WAAW;AAKhE,MAAI,CAAC,iBACH,oBAAmB;AAErB,SAAO;GACP;AAGJ,QAAO;;;;;;;;;AAUT,SAAgB,wBAA4D;AAC1E,KAAI,CAAC,gBACH,mBAAkB,OAAO,8BAA8B,MAAM,WAAW;EAItE,MAAM,cAAe,OAA6D;AAGlF,MAAI,CAAC,iBACH,uBAAsB;AAExB,SAAO;GACP;AAGJ,QAAO;;;;;;;;;;;;AAaT,SAAgB,cAAwB;AACtC,KAAI,CAAC,iBACH,OAAM,IAAI,MACR,oJACD;AAGH,QAAO"}
package/index.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ import { MapboxMap, MapboxMapProps } from "./MapboxMap.js";
2
+ import { AbstractMapboxMapChild, AbstractMapboxMapChildProps, MAPBOX_MAP_CONNECTED } from "./AbstractMapboxMapChild.js";
3
+ import { AbstractMapboxControl, AbstractMapboxControlProps } from "./AbstractMapboxControl.js";
4
+ import { MapboxClusterItem, MapboxClusterItemProps } from "./MapboxClusterItem.js";
5
+ import { MAPBOX_CLUSTER_CONNECTED, MapboxCluster, MapboxClusterProps } from "./MapboxCluster.js";
6
+ import { MapboxFullscreenControl, MapboxFullscreenControlProps } from "./MapboxFullscreenControl.js";
7
+ import { MapboxGeocoderConstructor, MapboxGeocoderControl, MapboxGl, provideMapboxGeocoder, provideMapboxGl, resolveMapboxGeocoder, resolveMapboxGl } from "./dependencies.js";
8
+ import { MapboxGeocoder, MapboxGeocoderProps } from "./MapboxGeocoder.js";
9
+ import { MapboxGeolocateControl, MapboxGeolocateControlProps } from "./MapboxGeolocateControl.js";
10
+ import { MapboxImage, MapboxImageProps } from "./MapboxImage.js";
11
+ import { MapboxImages, MapboxImagesProps } from "./MapboxImages.js";
12
+ import { MapboxLayer, MapboxLayerProps } from "./MapboxLayer.js";
13
+ import { MapboxPopup, MapboxPopupProps } from "./MapboxPopup.js";
14
+ import { MapboxMarker, MapboxMarkerProps } from "./MapboxMarker.js";
15
+ import { MapboxNavigationControl, MapboxNavigationControlProps } from "./MapboxNavigationControl.js";
16
+ import { MapboxSource, MapboxSourceProps } from "./MapboxSource.js";
17
+ import { StoreLocator, StoreLocatorProps } from "./StoreLocator.js";
18
+ export { AbstractMapboxControl, AbstractMapboxControlProps, AbstractMapboxMapChild, AbstractMapboxMapChildProps, MAPBOX_CLUSTER_CONNECTED, MAPBOX_MAP_CONNECTED, MapboxCluster, MapboxClusterItem, MapboxClusterItemProps, MapboxClusterProps, MapboxFullscreenControl, MapboxFullscreenControlProps, MapboxGeocoder, type MapboxGeocoderConstructor, type MapboxGeocoderControl, MapboxGeocoderProps, MapboxGeolocateControl, MapboxGeolocateControlProps, type MapboxGl, MapboxImage, MapboxImageProps, MapboxImages, MapboxImagesProps, MapboxLayer, MapboxLayerProps, MapboxMap, MapboxMapProps, MapboxMarker, MapboxMarkerProps, MapboxNavigationControl, MapboxNavigationControlProps, MapboxPopup, MapboxPopupProps, MapboxSource, MapboxSourceProps, StoreLocator, StoreLocatorProps, provideMapboxGeocoder, provideMapboxGl, resolveMapboxGeocoder, resolveMapboxGl };
package/index.js ADDED
@@ -0,0 +1,19 @@
1
+ import { AbstractMapboxMapChild, MAPBOX_MAP_CONNECTED } from "./AbstractMapboxMapChild.js";
2
+ import { AbstractMapboxControl } from "./AbstractMapboxControl.js";
3
+ import { MAPBOX_CLUSTER_CONNECTED, MapboxCluster } from "./MapboxCluster.js";
4
+ import { MapboxClusterItem } from "./MapboxClusterItem.js";
5
+ import { provideMapboxGeocoder, provideMapboxGl, resolveMapboxGeocoder, resolveMapboxGl } from "./dependencies.js";
6
+ import { MapboxFullscreenControl } from "./MapboxFullscreenControl.js";
7
+ import { MapboxGeocoder } from "./MapboxGeocoder.js";
8
+ import { MapboxGeolocateControl } from "./MapboxGeolocateControl.js";
9
+ import { MapboxImage } from "./MapboxImage.js";
10
+ import { MapboxImages } from "./MapboxImages.js";
11
+ import { MapboxLayer } from "./MapboxLayer.js";
12
+ import { MapboxMap } from "./MapboxMap.js";
13
+ import { MapboxMarker } from "./MapboxMarker.js";
14
+ import { MapboxNavigationControl } from "./MapboxNavigationControl.js";
15
+ import { MapboxPopup } from "./MapboxPopup.js";
16
+ import { MapboxSource } from "./MapboxSource.js";
17
+ import { StoreLocator } from "./StoreLocator.js";
18
+ export { AbstractMapboxControl, AbstractMapboxMapChild, MAPBOX_CLUSTER_CONNECTED, MAPBOX_MAP_CONNECTED, MapboxCluster, MapboxClusterItem, MapboxFullscreenControl, MapboxGeocoder, MapboxGeolocateControl, MapboxImage, MapboxImages, MapboxLayer, MapboxMap, MapboxMarker, MapboxNavigationControl, MapboxPopup, MapboxSource, StoreLocator, provideMapboxGeocoder, provideMapboxGl, resolveMapboxGeocoder, resolveMapboxGl };
19
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/manifest.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { ComponentManifest } from "@studiometa/ui-autoload";
2
+
3
+ //#region manifest.d.ts
4
+ declare const manifest: ComponentManifest;
5
+ //#endregion
6
+ export { manifest };
package/manifest.js ADDED
@@ -0,0 +1,133 @@
1
+ //#region manifest.ts
2
+ const manifest = {
3
+ MapboxCluster: {
4
+ token: "MapboxCluster",
5
+ packageName: "@studiometa/ui-mapbox",
6
+ subpath: "MapboxCluster",
7
+ exportName: "MapboxCluster",
8
+ strategy: "visible",
9
+ group: "mapbox",
10
+ load: () => import("./MapboxCluster.js").then(({ MapboxCluster }) => MapboxCluster)
11
+ },
12
+ MapboxClusterItem: {
13
+ token: "MapboxClusterItem",
14
+ packageName: "@studiometa/ui-mapbox",
15
+ subpath: "MapboxClusterItem",
16
+ exportName: "MapboxClusterItem",
17
+ strategy: "visible",
18
+ group: "mapbox",
19
+ load: () => import("./MapboxClusterItem.js").then(({ MapboxClusterItem }) => MapboxClusterItem)
20
+ },
21
+ MapboxFullscreenControl: {
22
+ token: "MapboxFullscreenControl",
23
+ packageName: "@studiometa/ui-mapbox",
24
+ subpath: "MapboxFullscreenControl",
25
+ exportName: "MapboxFullscreenControl",
26
+ strategy: "visible",
27
+ group: "mapbox",
28
+ load: () => import("./MapboxFullscreenControl.js").then(({ MapboxFullscreenControl }) => MapboxFullscreenControl)
29
+ },
30
+ MapboxGeocoder: {
31
+ token: "MapboxGeocoder",
32
+ packageName: "@studiometa/ui-mapbox",
33
+ subpath: "MapboxGeocoder",
34
+ exportName: "MapboxGeocoder",
35
+ strategy: "visible",
36
+ group: "mapbox",
37
+ load: () => import("./MapboxGeocoder.js").then(({ MapboxGeocoder }) => MapboxGeocoder)
38
+ },
39
+ MapboxGeolocateControl: {
40
+ token: "MapboxGeolocateControl",
41
+ packageName: "@studiometa/ui-mapbox",
42
+ subpath: "MapboxGeolocateControl",
43
+ exportName: "MapboxGeolocateControl",
44
+ strategy: "visible",
45
+ group: "mapbox",
46
+ load: () => import("./MapboxGeolocateControl.js").then(({ MapboxGeolocateControl }) => MapboxGeolocateControl)
47
+ },
48
+ MapboxImage: {
49
+ token: "MapboxImage",
50
+ packageName: "@studiometa/ui-mapbox",
51
+ subpath: "MapboxImage",
52
+ exportName: "MapboxImage",
53
+ strategy: "visible",
54
+ group: "mapbox",
55
+ load: () => import("./MapboxImage.js").then(({ MapboxImage }) => MapboxImage)
56
+ },
57
+ MapboxImages: {
58
+ token: "MapboxImages",
59
+ packageName: "@studiometa/ui-mapbox",
60
+ subpath: "MapboxImages",
61
+ exportName: "MapboxImages",
62
+ strategy: "visible",
63
+ group: "mapbox",
64
+ load: () => import("./MapboxImages.js").then(({ MapboxImages }) => MapboxImages)
65
+ },
66
+ MapboxLayer: {
67
+ token: "MapboxLayer",
68
+ packageName: "@studiometa/ui-mapbox",
69
+ subpath: "MapboxLayer",
70
+ exportName: "MapboxLayer",
71
+ strategy: "visible",
72
+ group: "mapbox",
73
+ load: () => import("./MapboxLayer.js").then(({ MapboxLayer }) => MapboxLayer)
74
+ },
75
+ MapboxMap: {
76
+ token: "MapboxMap",
77
+ packageName: "@studiometa/ui-mapbox",
78
+ subpath: "MapboxMap",
79
+ exportName: "MapboxMap",
80
+ strategy: "visible",
81
+ group: "mapbox",
82
+ load: () => import("./MapboxMap.js").then(({ MapboxMap }) => MapboxMap)
83
+ },
84
+ MapboxMarker: {
85
+ token: "MapboxMarker",
86
+ packageName: "@studiometa/ui-mapbox",
87
+ subpath: "MapboxMarker",
88
+ exportName: "MapboxMarker",
89
+ strategy: "visible",
90
+ group: "mapbox",
91
+ load: () => import("./MapboxMarker.js").then(({ MapboxMarker }) => MapboxMarker)
92
+ },
93
+ MapboxNavigationControl: {
94
+ token: "MapboxNavigationControl",
95
+ packageName: "@studiometa/ui-mapbox",
96
+ subpath: "MapboxNavigationControl",
97
+ exportName: "MapboxNavigationControl",
98
+ strategy: "visible",
99
+ group: "mapbox",
100
+ load: () => import("./MapboxNavigationControl.js").then(({ MapboxNavigationControl }) => MapboxNavigationControl)
101
+ },
102
+ MapboxPopup: {
103
+ token: "MapboxPopup",
104
+ packageName: "@studiometa/ui-mapbox",
105
+ subpath: "MapboxPopup",
106
+ exportName: "MapboxPopup",
107
+ strategy: "visible",
108
+ group: "mapbox",
109
+ load: () => import("./MapboxPopup.js").then(({ MapboxPopup }) => MapboxPopup)
110
+ },
111
+ MapboxSource: {
112
+ token: "MapboxSource",
113
+ packageName: "@studiometa/ui-mapbox",
114
+ subpath: "MapboxSource",
115
+ exportName: "MapboxSource",
116
+ strategy: "visible",
117
+ group: "mapbox",
118
+ load: () => import("./MapboxSource.js").then(({ MapboxSource }) => MapboxSource)
119
+ },
120
+ StoreLocator: {
121
+ token: "StoreLocator",
122
+ packageName: "@studiometa/ui-mapbox",
123
+ subpath: "StoreLocator",
124
+ exportName: "StoreLocator",
125
+ strategy: "visible",
126
+ group: "mapbox",
127
+ load: () => import("./StoreLocator.js").then(({ StoreLocator }) => StoreLocator)
128
+ }
129
+ };
130
+ //#endregion
131
+ export { manifest };
132
+
133
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","names":[],"sources":["../manifest.ts"],"sourcesContent":["// This file is generated by scripts/generate-manifests.ts. Do not edit.\nimport type { ComponentManifest } from '@studiometa/ui-autoload';\n\nexport const manifest: ComponentManifest = {\n MapboxCluster: {\n token: 'MapboxCluster',\n packageName: '@studiometa/ui-mapbox',\n subpath: 'MapboxCluster',\n exportName: 'MapboxCluster',\n strategy: 'visible',\n group: 'mapbox',\n load: () => import('./MapboxCluster.js').then(({ MapboxCluster }) => MapboxCluster),\n },\n MapboxClusterItem: {\n token: 'MapboxClusterItem',\n packageName: '@studiometa/ui-mapbox',\n subpath: 'MapboxClusterItem',\n exportName: 'MapboxClusterItem',\n strategy: 'visible',\n group: 'mapbox',\n load: () => import('./MapboxClusterItem.js').then(({ MapboxClusterItem }) => MapboxClusterItem),\n },\n MapboxFullscreenControl: {\n token: 'MapboxFullscreenControl',\n packageName: '@studiometa/ui-mapbox',\n subpath: 'MapboxFullscreenControl',\n exportName: 'MapboxFullscreenControl',\n strategy: 'visible',\n group: 'mapbox',\n load: () =>\n import('./MapboxFullscreenControl.js').then(\n ({ MapboxFullscreenControl }) => MapboxFullscreenControl,\n ),\n },\n MapboxGeocoder: {\n token: 'MapboxGeocoder',\n packageName: '@studiometa/ui-mapbox',\n subpath: 'MapboxGeocoder',\n exportName: 'MapboxGeocoder',\n strategy: 'visible',\n group: 'mapbox',\n load: () => import('./MapboxGeocoder.js').then(({ MapboxGeocoder }) => MapboxGeocoder),\n },\n MapboxGeolocateControl: {\n token: 'MapboxGeolocateControl',\n packageName: '@studiometa/ui-mapbox',\n subpath: 'MapboxGeolocateControl',\n exportName: 'MapboxGeolocateControl',\n strategy: 'visible',\n group: 'mapbox',\n load: () =>\n import('./MapboxGeolocateControl.js').then(\n ({ MapboxGeolocateControl }) => MapboxGeolocateControl,\n ),\n },\n MapboxImage: {\n token: 'MapboxImage',\n packageName: '@studiometa/ui-mapbox',\n subpath: 'MapboxImage',\n exportName: 'MapboxImage',\n strategy: 'visible',\n group: 'mapbox',\n load: () => import('./MapboxImage.js').then(({ MapboxImage }) => MapboxImage),\n },\n MapboxImages: {\n token: 'MapboxImages',\n packageName: '@studiometa/ui-mapbox',\n subpath: 'MapboxImages',\n exportName: 'MapboxImages',\n strategy: 'visible',\n group: 'mapbox',\n load: () => import('./MapboxImages.js').then(({ MapboxImages }) => MapboxImages),\n },\n MapboxLayer: {\n token: 'MapboxLayer',\n packageName: '@studiometa/ui-mapbox',\n subpath: 'MapboxLayer',\n exportName: 'MapboxLayer',\n strategy: 'visible',\n group: 'mapbox',\n load: () => import('./MapboxLayer.js').then(({ MapboxLayer }) => MapboxLayer),\n },\n MapboxMap: {\n token: 'MapboxMap',\n packageName: '@studiometa/ui-mapbox',\n subpath: 'MapboxMap',\n exportName: 'MapboxMap',\n strategy: 'visible',\n group: 'mapbox',\n load: () => import('./MapboxMap.js').then(({ MapboxMap }) => MapboxMap),\n },\n MapboxMarker: {\n token: 'MapboxMarker',\n packageName: '@studiometa/ui-mapbox',\n subpath: 'MapboxMarker',\n exportName: 'MapboxMarker',\n strategy: 'visible',\n group: 'mapbox',\n load: () => import('./MapboxMarker.js').then(({ MapboxMarker }) => MapboxMarker),\n },\n MapboxNavigationControl: {\n token: 'MapboxNavigationControl',\n packageName: '@studiometa/ui-mapbox',\n subpath: 'MapboxNavigationControl',\n exportName: 'MapboxNavigationControl',\n strategy: 'visible',\n group: 'mapbox',\n load: () =>\n import('./MapboxNavigationControl.js').then(\n ({ MapboxNavigationControl }) => MapboxNavigationControl,\n ),\n },\n MapboxPopup: {\n token: 'MapboxPopup',\n packageName: '@studiometa/ui-mapbox',\n subpath: 'MapboxPopup',\n exportName: 'MapboxPopup',\n strategy: 'visible',\n group: 'mapbox',\n load: () => import('./MapboxPopup.js').then(({ MapboxPopup }) => MapboxPopup),\n },\n MapboxSource: {\n token: 'MapboxSource',\n packageName: '@studiometa/ui-mapbox',\n subpath: 'MapboxSource',\n exportName: 'MapboxSource',\n strategy: 'visible',\n group: 'mapbox',\n load: () => import('./MapboxSource.js').then(({ MapboxSource }) => MapboxSource),\n },\n StoreLocator: {\n token: 'StoreLocator',\n packageName: '@studiometa/ui-mapbox',\n subpath: 'StoreLocator',\n exportName: 'StoreLocator',\n strategy: 'visible',\n group: 'mapbox',\n load: () => import('./StoreLocator.js').then(({ StoreLocator }) => StoreLocator),\n },\n};\n"],"mappings":";AAGA,MAAa,WAA8B;CACzC,eAAe;EACb,OAAO;EACP,aAAa;EACb,SAAS;EACT,YAAY;EACZ,UAAU;EACV,OAAO;EACP,YAAY,OAAO,sBAAsB,MAAM,EAAE,oBAAoB,cAAc;EACpF;CACD,mBAAmB;EACjB,OAAO;EACP,aAAa;EACb,SAAS;EACT,YAAY;EACZ,UAAU;EACV,OAAO;EACP,YAAY,OAAO,0BAA0B,MAAM,EAAE,wBAAwB,kBAAkB;EAChG;CACD,yBAAyB;EACvB,OAAO;EACP,aAAa;EACb,SAAS;EACT,YAAY;EACZ,UAAU;EACV,OAAO;EACP,YACE,OAAO,gCAAgC,MACpC,EAAE,8BAA8B,wBAClC;EACJ;CACD,gBAAgB;EACd,OAAO;EACP,aAAa;EACb,SAAS;EACT,YAAY;EACZ,UAAU;EACV,OAAO;EACP,YAAY,OAAO,uBAAuB,MAAM,EAAE,qBAAqB,eAAe;EACvF;CACD,wBAAwB;EACtB,OAAO;EACP,aAAa;EACb,SAAS;EACT,YAAY;EACZ,UAAU;EACV,OAAO;EACP,YACE,OAAO,+BAA+B,MACnC,EAAE,6BAA6B,uBACjC;EACJ;CACD,aAAa;EACX,OAAO;EACP,aAAa;EACb,SAAS;EACT,YAAY;EACZ,UAAU;EACV,OAAO;EACP,YAAY,OAAO,oBAAoB,MAAM,EAAE,kBAAkB,YAAY;EAC9E;CACD,cAAc;EACZ,OAAO;EACP,aAAa;EACb,SAAS;EACT,YAAY;EACZ,UAAU;EACV,OAAO;EACP,YAAY,OAAO,qBAAqB,MAAM,EAAE,mBAAmB,aAAa;EACjF;CACD,aAAa;EACX,OAAO;EACP,aAAa;EACb,SAAS;EACT,YAAY;EACZ,UAAU;EACV,OAAO;EACP,YAAY,OAAO,oBAAoB,MAAM,EAAE,kBAAkB,YAAY;EAC9E;CACD,WAAW;EACT,OAAO;EACP,aAAa;EACb,SAAS;EACT,YAAY;EACZ,UAAU;EACV,OAAO;EACP,YAAY,OAAO,kBAAkB,MAAM,EAAE,gBAAgB,UAAU;EACxE;CACD,cAAc;EACZ,OAAO;EACP,aAAa;EACb,SAAS;EACT,YAAY;EACZ,UAAU;EACV,OAAO;EACP,YAAY,OAAO,qBAAqB,MAAM,EAAE,mBAAmB,aAAa;EACjF;CACD,yBAAyB;EACvB,OAAO;EACP,aAAa;EACb,SAAS;EACT,YAAY;EACZ,UAAU;EACV,OAAO;EACP,YACE,OAAO,gCAAgC,MACpC,EAAE,8BAA8B,wBAClC;EACJ;CACD,aAAa;EACX,OAAO;EACP,aAAa;EACb,SAAS;EACT,YAAY;EACZ,UAAU;EACV,OAAO;EACP,YAAY,OAAO,oBAAoB,MAAM,EAAE,kBAAkB,YAAY;EAC9E;CACD,cAAc;EACZ,OAAO;EACP,aAAa;EACb,SAAS;EACT,YAAY;EACZ,UAAU;EACV,OAAO;EACP,YAAY,OAAO,qBAAqB,MAAM,EAAE,mBAAmB,aAAa;EACjF;CACD,cAAc;EACZ,OAAO;EACP,aAAa;EACb,SAAS;EACT,YAAY;EACZ,UAAU;EACV,OAAO;EACP,YAAY,OAAO,qBAAqB,MAAM,EAAE,mBAAmB,aAAa;EACjF;CACF"}
package/package.json CHANGED
@@ -1,12 +1,31 @@
1
1
  {
2
2
  "name": "@studiometa/ui-mapbox",
3
- "version": "0.0.1",
3
+ "version": "1.10.0-beta.1",
4
4
  "description": "Vanilla js-toolkit components to build Mapbox GL maps declaratively",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
8
  "type": "module",
9
9
  "sideEffects": false,
10
+ "main": "index.js",
11
+ "types": "index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./index.d.ts",
15
+ "import": "./index.js"
16
+ },
17
+ "./*.js": {
18
+ "types": "./*.d.ts",
19
+ "import": "./*.js"
20
+ },
21
+ "./*": {
22
+ "types": "./*.d.ts",
23
+ "import": "./*.js"
24
+ }
25
+ },
26
+ "scripts": {
27
+ "build": "node scripts/build.js"
28
+ },
10
29
  "repository": {
11
30
  "type": "git",
12
31
  "url": "git+https://github.com/studiometa/ui.git"
@@ -24,6 +43,27 @@
24
43
  "bugs": {
25
44
  "url": "https://github.com/studiometa/ui/issues"
26
45
  },
27
- "homepage": "https://github.com/studiometa/ui#readme"
46
+ "homepage": "https://github.com/studiometa/ui#readme",
47
+ "peerDependencies": {
48
+ "@mapbox/mapbox-gl-geocoder": "^5.0.0",
49
+ "@studiometa/js-toolkit": "^3.8.0",
50
+ "@studiometa/ui-autoload": "^1.9.0",
51
+ "mapbox-gl": "^3.0.0"
52
+ },
53
+ "peerDependenciesMeta": {
54
+ "@mapbox/mapbox-gl-geocoder": {
55
+ "optional": true
56
+ },
57
+ "@studiometa/ui-autoload": {
58
+ "optional": true
59
+ }
60
+ },
61
+ "devDependencies": {
62
+ "@mapbox/mapbox-gl-geocoder": "^5.1.0",
63
+ "@studiometa/js-toolkit": "^3.8.0",
64
+ "@studiometa/ui-autoload": "file:../ui-autoload",
65
+ "@types/mapbox__mapbox-gl-geocoder": "^5.0.0",
66
+ "mapbox-gl": "^3.13.0",
67
+ "tsdown": "0.21.5"
68
+ }
28
69
  }
29
-
package/utils.d.ts ADDED
@@ -0,0 +1,112 @@
1
+ import { Map } from "mapbox-gl";
2
+
3
+ //#region utils.d.ts
4
+ /**
5
+ * Claim ownership of an id-addressed contribution on a map for the given owner,
6
+ * taking over from any previous owner of the same id.
7
+ *
8
+ * @param {object} map The Mapbox map instance the contribution lives on.
9
+ * @param {string} key The `kind:id` ownership key.
10
+ * @param {unknown} owner The claiming component instance.
11
+ * @param {() => boolean} isLive Probe reporting whether the resource this owner
12
+ * added is still the one on the live map. Checked on every `getMapboxOwner`
13
+ * read so a resource that was wiped by `setStyle` or removed/replaced
14
+ * externally is not mistaken for a live family-owned contribution.
15
+ */
16
+ declare function claimMapboxOwnership(map: object, key: string, owner: unknown, isLive: () => boolean): void;
17
+ /**
18
+ * The current owner of an id-addressed contribution, if any.
19
+ *
20
+ * Validates the entry's liveness before reporting it: if the owner's resource is
21
+ * no longer on the live map (removed by `setStyle`, an external
22
+ * `removeSource`/`removeLayer`, or replaced by a different resource under the
23
+ * same id), the stale entry is pruned and `undefined` is returned so the caller
24
+ * treats the id as unowned — never adopting or deleting a stranger's resource.
25
+ *
26
+ * @param {object} map The Mapbox map instance the contribution lives on.
27
+ * @param {string} key The `kind:id` ownership key.
28
+ * @returns {unknown} The owning instance, or `undefined` when nobody owns it.
29
+ */
30
+ declare function getMapboxOwner(map: object, key: string): unknown;
31
+ /**
32
+ * Release ownership of an id-addressed contribution, but only when the given
33
+ * owner is still the current one — a newer instance may already have taken over.
34
+ *
35
+ * @param {object} map The Mapbox map instance the contribution lives on.
36
+ * @param {string} key The `kind:id` ownership key.
37
+ * @param {unknown} owner The instance releasing the id.
38
+ */
39
+ declare function releaseMapboxOwnership(map: object, key: string, owner: unknown): void;
40
+ /**
41
+ * The kind of image the Mapbox `loadImage` method resolves with.
42
+ */
43
+ type MapboxImage = ImageBitmap | HTMLImageElement | ImageData;
44
+ /**
45
+ * The options accepted by the Mapbox `addImage` method.
46
+ *
47
+ * Derived from the method signature as the underlying `StyleImageMetadata`
48
+ * type is not part of the public `mapbox-gl` exports.
49
+ */
50
+ type MapboxImageOptions = NonNullable<Parameters<Map['addImage']>[2]>;
51
+ /**
52
+ * Describe a single image to register against a map sprite.
53
+ */
54
+ interface MapboxImageDefinition {
55
+ /**
56
+ * The id of the image once registered in the map sprite.
57
+ */
58
+ name: string;
59
+ /**
60
+ * The URL of the image file, must be in png, webp or jpg format.
61
+ */
62
+ url: string;
63
+ /**
64
+ * The image options forwarded to `map.addImage`.
65
+ */
66
+ options?: MapboxImageOptions;
67
+ }
68
+ /**
69
+ * Load an image from an external URL with the Mapbox `loadImage` method.
70
+ *
71
+ * The installed `mapbox-gl` version still exposes a callback based
72
+ * `loadImage`, so we wrap it into a promise to keep the components async.
73
+ *
74
+ * @param {Map} map The Mapbox map instance.
75
+ * @param {string} url The URL of the image to load.
76
+ * @returns {Promise<MapboxImage>}
77
+ */
78
+ declare function loadMapboxImage(map: Map, url: string): Promise<MapboxImage>;
79
+ /**
80
+ * The result of registering an image against a map sprite.
81
+ */
82
+ interface AddMapboxImageResult {
83
+ /**
84
+ * The image loaded from the URL.
85
+ */
86
+ image: MapboxImage;
87
+ /**
88
+ * Whether this call actually added the image to the map sprite. It is `false`
89
+ * when the sprite already existed (registered by someone else), signalling to
90
+ * callers that they do not own it and must not remove it on teardown.
91
+ */
92
+ added: boolean;
93
+ }
94
+ /**
95
+ * Load and register a single image against the map sprite.
96
+ *
97
+ * The image is only added when it is not already registered to avoid the
98
+ * "An image with this name already exists" error thrown by Mapbox. The returned
99
+ * `added` flag reports whether this call owns the sprite so callers can restrict
100
+ * teardown to the sprites they actually added.
101
+ *
102
+ * @param {Map} map The Mapbox map instance.
103
+ * @param {MapboxImageDefinition} definition The image definition to register.
104
+ * @returns {Promise<AddMapboxImageResult>}
105
+ */
106
+ declare function addMapboxImage(map: Map, {
107
+ name,
108
+ url,
109
+ options
110
+ }: MapboxImageDefinition): Promise<AddMapboxImageResult>;
111
+ //#endregion
112
+ export { AddMapboxImageResult, MapboxImage, MapboxImageDefinition, MapboxImageOptions, addMapboxImage, claimMapboxOwnership, getMapboxOwner, loadMapboxImage, releaseMapboxOwnership };