@trackunit/react-map 0.2.39 → 0.2.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -1312,7 +1312,7 @@ function useMapAdapterState(adapterConfig) {
1312
1312
  * @returns Tuple of [Map component, API object]
1313
1313
  * @example Basic usage
1314
1314
  * ```tsx
1315
- * import { useMap, Controls } from "@trackunit/react-map";
1315
+ * import { useMap, DefaultControls } from "@trackunit/react-map";
1316
1316
  * import { googleMapsAdapter } from "@trackunit/react-map-adapter-google";
1317
1317
  *
1318
1318
  * const MyMap = () => {
@@ -1323,7 +1323,7 @@ function useMapAdapterState(adapterConfig) {
1323
1323
  *
1324
1324
  * return (
1325
1325
  * <Map>
1326
- * <Controls api={api} />
1326
+ * <DefaultControls api={api} />
1327
1327
  * </Map>
1328
1328
  * );
1329
1329
  * };
@@ -10923,7 +10923,7 @@ const applyPortalZIndex = (container, zIndex) => {
10923
10923
  *
10924
10924
  * return (
10925
10925
  * <Map>
10926
- * <Controls api={api} />
10926
+ * <DefaultControls api={api} />
10927
10927
  * <Layers api={api} layers={layers} />
10928
10928
  * </Map>
10929
10929
  * );
@@ -11543,14 +11543,24 @@ const composeControlAreas = (areas) => ({
11543
11543
  *
11544
11544
  * Returns `defineControlStack` and `composeControlAreas` for consumers building
11545
11545
  * custom control layouts without duplicating the stack-ordering logic already
11546
- * used by `Controls`.
11546
+ * used by `Controls`. Pass area stacks directly to `composeControlAreas` — it
11547
+ * runs `defineControlStack` per area. Use `defineControlStack` on its own when
11548
+ * assembling a single area's `{ controls }` outside `composeControlAreas`.
11547
11549
  *
11548
11550
  * @example
11549
11551
  * ```tsx
11550
- * const { defineControlStack, composeControlAreas } = useControlStack();
11552
+ * const { composeControlAreas } = useControlStack();
11551
11553
  * const controls = composeControlAreas({
11552
- * navigation: [builtIn.navigation.zoom, builtIn.navigation.fullscreen],
11553
- * settings: [builtIn.settings.mapStyle],
11554
+ * navigation: [
11555
+ * builtIn.navigation.myLocation,
11556
+ * builtIn.navigation.zoom,
11557
+ * builtIn.navigation.fullscreen,
11558
+ * ],
11559
+ * settings: [
11560
+ * ...markers.layer.controls.settings ?? [],
11561
+ * builtIn.settings.mapStyle,
11562
+ * isAdmin ? adminControl : undefined,
11563
+ * ],
11554
11564
  * });
11555
11565
  * ```
11556
11566
  */
package/index.esm.js CHANGED
@@ -1311,7 +1311,7 @@ function useMapAdapterState(adapterConfig) {
1311
1311
  * @returns Tuple of [Map component, API object]
1312
1312
  * @example Basic usage
1313
1313
  * ```tsx
1314
- * import { useMap, Controls } from "@trackunit/react-map";
1314
+ * import { useMap, DefaultControls } from "@trackunit/react-map";
1315
1315
  * import { googleMapsAdapter } from "@trackunit/react-map-adapter-google";
1316
1316
  *
1317
1317
  * const MyMap = () => {
@@ -1322,7 +1322,7 @@ function useMapAdapterState(adapterConfig) {
1322
1322
  *
1323
1323
  * return (
1324
1324
  * <Map>
1325
- * <Controls api={api} />
1325
+ * <DefaultControls api={api} />
1326
1326
  * </Map>
1327
1327
  * );
1328
1328
  * };
@@ -10922,7 +10922,7 @@ const applyPortalZIndex = (container, zIndex) => {
10922
10922
  *
10923
10923
  * return (
10924
10924
  * <Map>
10925
- * <Controls api={api} />
10925
+ * <DefaultControls api={api} />
10926
10926
  * <Layers api={api} layers={layers} />
10927
10927
  * </Map>
10928
10928
  * );
@@ -11542,14 +11542,24 @@ const composeControlAreas = (areas) => ({
11542
11542
  *
11543
11543
  * Returns `defineControlStack` and `composeControlAreas` for consumers building
11544
11544
  * custom control layouts without duplicating the stack-ordering logic already
11545
- * used by `Controls`.
11545
+ * used by `Controls`. Pass area stacks directly to `composeControlAreas` — it
11546
+ * runs `defineControlStack` per area. Use `defineControlStack` on its own when
11547
+ * assembling a single area's `{ controls }` outside `composeControlAreas`.
11546
11548
  *
11547
11549
  * @example
11548
11550
  * ```tsx
11549
- * const { defineControlStack, composeControlAreas } = useControlStack();
11551
+ * const { composeControlAreas } = useControlStack();
11550
11552
  * const controls = composeControlAreas({
11551
- * navigation: [builtIn.navigation.zoom, builtIn.navigation.fullscreen],
11552
- * settings: [builtIn.settings.mapStyle],
11553
+ * navigation: [
11554
+ * builtIn.navigation.myLocation,
11555
+ * builtIn.navigation.zoom,
11556
+ * builtIn.navigation.fullscreen,
11557
+ * ],
11558
+ * settings: [
11559
+ * ...markers.layer.controls.settings ?? [],
11560
+ * builtIn.settings.mapStyle,
11561
+ * isAdmin ? adminControl : undefined,
11562
+ * ],
11553
11563
  * });
11554
11564
  * ```
11555
11565
  */
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@trackunit/react-map",
3
- "version": "0.2.39",
3
+ "version": "0.2.40",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
7
7
  "node": ">=24.x"
8
8
  },
9
9
  "dependencies": {
10
- "@trackunit/react-components": "2.3.0",
11
- "@trackunit/css-class-variance-utilities": "1.13.85",
12
- "@trackunit/react-form-components": "2.3.0",
13
- "@trackunit/react-core-hooks": "1.19.0",
14
- "@trackunit/geo-json-utils": "1.14.88",
15
- "@trackunit/i18n-library-translation": "2.2.0",
10
+ "@trackunit/react-components": "2.3.1",
11
+ "@trackunit/css-class-variance-utilities": "1.13.86",
12
+ "@trackunit/react-form-components": "2.3.1",
13
+ "@trackunit/react-core-hooks": "1.19.1",
14
+ "@trackunit/geo-json-utils": "1.14.89",
15
+ "@trackunit/i18n-library-translation": "2.2.1",
16
16
  "react-minimal-pie-chart": "^8.4.0",
17
- "@trackunit/react-map-adapter-shared": "0.0.69",
18
- "@trackunit/react-map-color-utils": "0.0.54",
19
- "@trackunit/ui-design-tokens": "1.13.84",
17
+ "@trackunit/react-map-adapter-shared": "0.0.70",
18
+ "@trackunit/react-map-color-utils": "0.0.55",
19
+ "@trackunit/ui-design-tokens": "1.13.85",
20
20
  "@floating-ui/react": "^0.26.25",
21
21
  "es-toolkit": "^1.39.10",
22
22
  "tailwind-merge": "^2.0.0",
@@ -9,14 +9,24 @@ export type ControlStackHelpers = Readonly<{
9
9
  *
10
10
  * Returns `defineControlStack` and `composeControlAreas` for consumers building
11
11
  * custom control layouts without duplicating the stack-ordering logic already
12
- * used by `Controls`.
12
+ * used by `Controls`. Pass area stacks directly to `composeControlAreas` — it
13
+ * runs `defineControlStack` per area. Use `defineControlStack` on its own when
14
+ * assembling a single area's `{ controls }` outside `composeControlAreas`.
13
15
  *
14
16
  * @example
15
17
  * ```tsx
16
- * const { defineControlStack, composeControlAreas } = useControlStack();
18
+ * const { composeControlAreas } = useControlStack();
17
19
  * const controls = composeControlAreas({
18
- * navigation: [builtIn.navigation.zoom, builtIn.navigation.fullscreen],
19
- * settings: [builtIn.settings.mapStyle],
20
+ * navigation: [
21
+ * builtIn.navigation.myLocation,
22
+ * builtIn.navigation.zoom,
23
+ * builtIn.navigation.fullscreen,
24
+ * ],
25
+ * settings: [
26
+ * ...markers.layer.controls.settings ?? [],
27
+ * builtIn.settings.mapStyle,
28
+ * isAdmin ? adminControl : undefined,
29
+ * ],
20
30
  * });
21
31
  * ```
22
32
  */
@@ -181,7 +181,7 @@ export type MapApi = Readonly<{
181
181
  *
182
182
  * return (
183
183
  * <Map>
184
- * <Controls api={api} />
184
+ * <DefaultControls api={api} />
185
185
  * </Map>
186
186
  * );
187
187
  * ```
@@ -17,7 +17,7 @@ import { type UseMapReturn } from "./types";
17
17
  * @returns Tuple of [Map component, API object]
18
18
  * @example Basic usage
19
19
  * ```tsx
20
- * import { useMap, Controls } from "@trackunit/react-map";
20
+ * import { useMap, DefaultControls } from "@trackunit/react-map";
21
21
  * import { googleMapsAdapter } from "@trackunit/react-map-adapter-google";
22
22
  *
23
23
  * const MyMap = () => {
@@ -28,7 +28,7 @@ import { type UseMapReturn } from "./types";
28
28
  *
29
29
  * return (
30
30
  * <Map>
31
- * <Controls api={api} />
31
+ * <DefaultControls api={api} />
32
32
  * </Map>
33
33
  * );
34
34
  * };
@@ -41,7 +41,7 @@ type LayersProps = Readonly<{
41
41
  *
42
42
  * return (
43
43
  * <Map>
44
- * <Controls api={api} />
44
+ * <DefaultControls api={api} />
45
45
  * <Layers api={api} layers={layers} />
46
46
  * </Map>
47
47
  * );