@trackunit/react-map-adapter-shared 0.0.101-alpha-62031fc7c43.0 → 0.0.102
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 +2 -8
- package/index.esm.js +3 -9
- package/migrations/entry.js.map +1 -0
- package/package.json +4 -4
- package/src/restrictBounds.d.ts +1 -1
- package/src/types.d.ts +1 -1
package/index.cjs.js
CHANGED
|
@@ -1682,7 +1682,7 @@ const mapStateEquals = (a, b) => cameraStateEquals(a, b) && statusEquals(a, b);
|
|
|
1682
1682
|
/**
|
|
1683
1683
|
* Resolve effective restrict bounds from config.
|
|
1684
1684
|
* Returns null if no restriction; GeoJsonBbox otherwise.
|
|
1685
|
-
* Validates custom bbox with
|
|
1685
|
+
* Validates custom bbox with validateBbox; on failure, console.warn and fallback to null.
|
|
1686
1686
|
*
|
|
1687
1687
|
* @note - Why fallback to null and not WORLD_BBOX?
|
|
1688
1688
|
* Different map providers handle full world bounds differently.
|
|
@@ -1692,13 +1692,7 @@ const mapStateEquals = (a, b) => cameraStateEquals(a, b) && statusEquals(a, b);
|
|
|
1692
1692
|
function getEffectiveRestrictBounds(configValue) {
|
|
1693
1693
|
if (configValue === null || configValue === undefined)
|
|
1694
1694
|
return null;
|
|
1695
|
-
|
|
1696
|
-
if (!result.success) {
|
|
1697
|
-
// eslint-disable-next-line no-console -- Intentional: warn devs when invalid restrictBounds bbox is passed; fallback to null
|
|
1698
|
-
console.warn("[restrictBounds]", result.error.message);
|
|
1699
|
-
return null;
|
|
1700
|
-
}
|
|
1701
|
-
return result.data;
|
|
1695
|
+
return geoJsonUtils.validateBbox(configValue, "[restrictBounds]");
|
|
1702
1696
|
}
|
|
1703
1697
|
|
|
1704
1698
|
/**
|
package/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { validatePosition, validateBbox
|
|
1
|
+
import { validatePosition, validateBbox } from '@trackunit/geo-json-utils';
|
|
2
2
|
import { color } from '@trackunit/ui-design-tokens';
|
|
3
3
|
import { isEqual } from 'es-toolkit';
|
|
4
4
|
import { z } from 'zod';
|
|
@@ -1680,7 +1680,7 @@ const mapStateEquals = (a, b) => cameraStateEquals(a, b) && statusEquals(a, b);
|
|
|
1680
1680
|
/**
|
|
1681
1681
|
* Resolve effective restrict bounds from config.
|
|
1682
1682
|
* Returns null if no restriction; GeoJsonBbox otherwise.
|
|
1683
|
-
* Validates custom bbox with
|
|
1683
|
+
* Validates custom bbox with validateBbox; on failure, console.warn and fallback to null.
|
|
1684
1684
|
*
|
|
1685
1685
|
* @note - Why fallback to null and not WORLD_BBOX?
|
|
1686
1686
|
* Different map providers handle full world bounds differently.
|
|
@@ -1690,13 +1690,7 @@ const mapStateEquals = (a, b) => cameraStateEquals(a, b) && statusEquals(a, b);
|
|
|
1690
1690
|
function getEffectiveRestrictBounds(configValue) {
|
|
1691
1691
|
if (configValue === null || configValue === undefined)
|
|
1692
1692
|
return null;
|
|
1693
|
-
|
|
1694
|
-
if (!result.success) {
|
|
1695
|
-
// eslint-disable-next-line no-console -- Intentional: warn devs when invalid restrictBounds bbox is passed; fallback to null
|
|
1696
|
-
console.warn("[restrictBounds]", result.error.message);
|
|
1697
|
-
return null;
|
|
1698
|
-
}
|
|
1699
|
-
return result.data;
|
|
1693
|
+
return validateBbox(configValue, "[restrictBounds]");
|
|
1700
1694
|
}
|
|
1701
1695
|
|
|
1702
1696
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry.js","sourceRoot":"","sources":["../../../../../libs/react/map-adapter-shared/migrations/entry.ts"],"names":[],"mappings":"","sourcesContent":["export {};\n"]}
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-map-adapter-shared",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.102",
|
|
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-map-color-utils": "0.0.82
|
|
11
|
-
"@trackunit/geo-json-utils": "1.15.21
|
|
12
|
-
"@trackunit/ui-design-tokens": "1.15.9
|
|
10
|
+
"@trackunit/react-map-color-utils": "0.0.82",
|
|
11
|
+
"@trackunit/geo-json-utils": "1.15.21",
|
|
12
|
+
"@trackunit/ui-design-tokens": "1.15.9",
|
|
13
13
|
"es-toolkit": "^1.39.10",
|
|
14
14
|
"zod": "^3.25.76"
|
|
15
15
|
},
|
package/src/restrictBounds.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type GeoJsonBbox } from "@trackunit/geo-json-utils";
|
|
|
2
2
|
/**
|
|
3
3
|
* Resolve effective restrict bounds from config.
|
|
4
4
|
* Returns null if no restriction; GeoJsonBbox otherwise.
|
|
5
|
-
* Validates custom bbox with
|
|
5
|
+
* Validates custom bbox with validateBbox; on failure, console.warn and fallback to null.
|
|
6
6
|
*
|
|
7
7
|
* @note - Why fallback to null and not WORLD_BBOX?
|
|
8
8
|
* Different map providers handle full world bounds differently.
|
package/src/types.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export type BaseAdapterConfig = Readonly<{
|
|
|
39
39
|
* - `undefined` (default): no restriction (infinite horizontal scroll)
|
|
40
40
|
* - `null`: no restriction (infinite horizontal scroll)
|
|
41
41
|
* - `GeoJsonBbox`: restrict to custom region (e.g. Europe only)
|
|
42
|
-
* Invalid bboxes are validated with
|
|
42
|
+
* Invalid bboxes are validated with validateBbox; on failure, console.warn is emitted
|
|
43
43
|
* and null (no restriction) is used as fallback.
|
|
44
44
|
*/
|
|
45
45
|
restrictBounds?: GeoJsonBbox | null;
|