@open-pioneer/scale-bar 0.11.0 → 0.12.0-dev.20250905090001

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @open-pioneer/scale-bar
2
2
 
3
+ ## 0.12.0-dev.20250905090001
4
+
5
+ ### Patch Changes
6
+
7
+ - 10d2fe7: Update dependencies
8
+ - da6a410: Update dependencies
9
+ - Updated dependencies [29a10df]
10
+ - Updated dependencies [10d2fe7]
11
+ - Updated dependencies [2702df4]
12
+ - Updated dependencies [12561fe]
13
+ - Updated dependencies [5df900f]
14
+ - Updated dependencies [8986b3b]
15
+ - Updated dependencies [aeb9000]
16
+ - Updated dependencies [5df900f]
17
+ - Updated dependencies [f1f69f2]
18
+ - Updated dependencies [da6a410]
19
+ - @open-pioneer/map@0.12.0-dev.20250905090001
20
+
3
21
  ## 0.11.0
4
22
 
5
23
  ### Minor Changes
@@ -73,7 +91,6 @@
73
91
  ### Minor Changes
74
92
 
75
93
  - 2fa8020: Update trails core package dependencies.
76
-
77
94
  - Also updates Chakra UI to the latest 2.x version and Chakra React Select to version 5.
78
95
  - Removes any obsolete references to `@chakra-ui/system`.
79
96
  This dependency seems to be no longer required and may lead to duplicate packages in your dependency tree.
package/ScaleBar.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { Box } from '@chakra-ui/react';
3
- import { useMapModel } from '@open-pioneer/map';
3
+ import { useMapModelValue } from '@open-pioneer/map';
4
4
  import { useCommonComponentProps } from '@open-pioneer/react-utils';
5
5
  import { ScaleLine } from 'ol/control.js';
6
6
  import { useRef, useEffect } from 'react';
@@ -8,10 +8,10 @@ import { useRef, useEffect } from 'react';
8
8
  const ScaleBar = (props) => {
9
9
  const { displayMode = "line" } = props;
10
10
  const { containerProps } = useCommonComponentProps("scale-bar", props);
11
- const { map } = useMapModel(props);
11
+ const map = useMapModelValue(props);
12
12
  const scaleBarElem = useRef(null);
13
13
  useEffect(() => {
14
- if (scaleBarElem.current && map) {
14
+ if (scaleBarElem.current) {
15
15
  const olMap = map.olMap;
16
16
  const scaleLine = new ScaleLine({
17
17
  units: "metric",
package/ScaleBar.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ScaleBar.js","sources":["ScaleBar.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { Box } from \"@chakra-ui/react\";\nimport { MapModelProps, useMapModel } from \"@open-pioneer/map\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport { ScaleLine } from \"ol/control\";\nimport { FC, useEffect, useRef } from \"react\";\n\n/**\n * These are the properties supported by the {@link ScaleBar}.\n */\nexport interface ScaleBarProps extends CommonComponentProps, MapModelProps {\n /**\n * Display the scale either as a line or a bar. Defaults to `\"line\"`.\n */\n displayMode?: \"bar\" | \"line\";\n}\n\nexport const ScaleBar: FC<ScaleBarProps> = (props) => {\n const { displayMode = \"line\" } = props;\n const { containerProps } = useCommonComponentProps(\"scale-bar\", props);\n const { map } = useMapModel(props);\n const scaleBarElem = useRef(null);\n\n useEffect(() => {\n if (scaleBarElem.current && map) {\n const olMap = map.olMap;\n const scaleLine = new ScaleLine({\n units: \"metric\",\n target: scaleBarElem.current,\n bar: displayMode === \"bar\"\n });\n olMap.addControl(scaleLine);\n return () => {\n olMap.removeControl(scaleLine);\n };\n }\n }, [displayMode, map]);\n\n return <Box {...containerProps} ref={scaleBarElem} backgroundColor=\"whiteAlpha.800\" />;\n};\n"],"names":[],"mappings":";;;;;;;AAkBa,MAAA,QAAA,GAA8B,CAAC,KAAU,KAAA;AAClD,EAAM,MAAA,EAAE,WAAc,GAAA,MAAA,EAAW,GAAA,KAAA;AACjC,EAAA,MAAM,EAAE,cAAA,EAAmB,GAAA,uBAAA,CAAwB,aAAa,KAAK,CAAA;AACrE,EAAA,MAAM,EAAE,GAAA,EAAQ,GAAA,WAAA,CAAY,KAAK,CAAA;AACjC,EAAM,MAAA,YAAA,GAAe,OAAO,IAAI,CAAA;AAEhC,EAAA,SAAA,CAAU,MAAM;AACZ,IAAI,IAAA,YAAA,CAAa,WAAW,GAAK,EAAA;AAC7B,MAAA,MAAM,QAAQ,GAAI,CAAA,KAAA;AAClB,MAAM,MAAA,SAAA,GAAY,IAAI,SAAU,CAAA;AAAA,QAC5B,KAAO,EAAA,QAAA;AAAA,QACP,QAAQ,YAAa,CAAA,OAAA;AAAA,QACrB,KAAK,WAAgB,KAAA;AAAA,OACxB,CAAA;AACD,MAAA,KAAA,CAAM,WAAW,SAAS,CAAA;AAC1B,MAAA,OAAO,MAAM;AACT,QAAA,KAAA,CAAM,cAAc,SAAS,CAAA;AAAA,OACjC;AAAA;AACJ,GACD,EAAA,CAAC,WAAa,EAAA,GAAG,CAAC,CAAA;AAErB,EAAA,2BAAQ,GAAK,EAAA,EAAA,GAAG,gBAAgB,GAAK,EAAA,YAAA,EAAc,iBAAgB,gBAAiB,EAAA,CAAA;AACxF;;;;"}
1
+ {"version":3,"file":"ScaleBar.js","sources":["ScaleBar.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { Box } from \"@chakra-ui/react\";\nimport { MapModelProps, useMapModelValue } from \"@open-pioneer/map\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport { ScaleLine } from \"ol/control\";\nimport { FC, useEffect, useRef } from \"react\";\n\n/**\n * These are the properties supported by the {@link ScaleBar}.\n */\nexport interface ScaleBarProps extends CommonComponentProps, MapModelProps {\n /**\n * Display the scale either as a line or a bar. Defaults to `\"line\"`.\n */\n displayMode?: \"bar\" | \"line\";\n}\n\nexport const ScaleBar: FC<ScaleBarProps> = (props) => {\n const { displayMode = \"line\" } = props;\n const { containerProps } = useCommonComponentProps(\"scale-bar\", props);\n const map = useMapModelValue(props);\n const scaleBarElem = useRef(null);\n\n useEffect(() => {\n if (scaleBarElem.current) {\n const olMap = map.olMap;\n const scaleLine = new ScaleLine({\n units: \"metric\",\n target: scaleBarElem.current,\n bar: displayMode === \"bar\"\n });\n olMap.addControl(scaleLine);\n return () => {\n olMap.removeControl(scaleLine);\n };\n }\n }, [displayMode, map]);\n\n return <Box {...containerProps} ref={scaleBarElem} backgroundColor=\"whiteAlpha.800\" />;\n};\n"],"names":[],"mappings":";;;;;;;AAkBO,MAAM,QAAA,GAA8B,CAAC,KAAA,KAAU;AAClD,EAAA,MAAM,EAAE,WAAA,GAAc,MAAA,EAAO,GAAI,KAAA;AACjC,EAAA,MAAM,EAAE,cAAA,EAAe,GAAI,uBAAA,CAAwB,aAAa,KAAK,CAAA;AACrE,EAAA,MAAM,GAAA,GAAM,iBAAiB,KAAK,CAAA;AAClC,EAAA,MAAM,YAAA,GAAe,OAAO,IAAI,CAAA;AAEhC,EAAA,SAAA,CAAU,MAAM;AACZ,IAAA,IAAI,aAAa,OAAA,EAAS;AACtB,MAAA,MAAM,QAAQ,GAAA,CAAI,KAAA;AAClB,MAAA,MAAM,SAAA,GAAY,IAAI,SAAA,CAAU;AAAA,QAC5B,KAAA,EAAO,QAAA;AAAA,QACP,QAAQ,YAAA,CAAa,OAAA;AAAA,QACrB,KAAK,WAAA,KAAgB;AAAA,OACxB,CAAA;AACD,MAAA,KAAA,CAAM,WAAW,SAAS,CAAA;AAC1B,MAAA,OAAO,MAAM;AACT,QAAA,KAAA,CAAM,cAAc,SAAS,CAAA;AAAA,MACjC,CAAA;AAAA,IACJ;AAAA,EACJ,CAAA,EAAG,CAAC,WAAA,EAAa,GAAG,CAAC,CAAA;AAErB,EAAA,2BAAQ,GAAA,EAAA,EAAK,GAAG,gBAAgB,GAAA,EAAK,YAAA,EAAc,iBAAgB,gBAAA,EAAiB,CAAA;AACxF;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@open-pioneer/scale-bar",
4
- "version": "0.11.0",
4
+ "version": "0.12.0-dev.20250905090001",
5
5
  "description": "This package provides a UI component to show the scale as a line or bar to the user.",
6
6
  "keywords": [
7
7
  "open-pioneer-trails"
@@ -14,12 +14,12 @@
14
14
  "directory": "src/packages/scale-bar"
15
15
  },
16
16
  "dependencies": {
17
- "@chakra-ui/react": "^3.19.2",
17
+ "@chakra-ui/react": "^3.24.2",
18
18
  "@open-pioneer/react-utils": "^4.0.0",
19
19
  "@open-pioneer/runtime": "^4.0.0",
20
- "ol": "^10.5.0",
21
- "react": "^19.1.0",
22
- "@open-pioneer/map": "^0.11.0"
20
+ "ol": "^10.6.1",
21
+ "react": "^19.1.1",
22
+ "@open-pioneer/map": "0.12.0-dev.20250905090001"
23
23
  },
24
24
  "exports": {
25
25
  "./package.json": "./package.json",