@open-pioneer/scale-bar 1.3.0-dev.20260408130821 → 1.3.0-dev.20260422120518
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 +5 -1
- package/ScaleBar.js +1 -1
- package/ScaleBar.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @open-pioneer/scale-bar
|
|
2
2
|
|
|
3
|
-
## 1.3.0-dev.
|
|
3
|
+
## 1.3.0-dev.20260422120518
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
- d54ccfd: Update to Chakra UI 3.34.0
|
|
9
9
|
- 206b397: Update to trails core packages 4.5.0
|
|
10
10
|
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 0f1277f: minor changes to support dark color mode
|
|
14
|
+
|
|
11
15
|
## 1.2.0
|
|
12
16
|
|
|
13
17
|
### Patch Changes
|
package/ScaleBar.js
CHANGED
|
@@ -24,7 +24,7 @@ const ScaleBar = (props) => {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
}, [displayMode, map]);
|
|
27
|
-
return /* @__PURE__ */ jsx(Box, { ref: scaleBarElem, backgroundColor: "
|
|
27
|
+
return /* @__PURE__ */ jsx(Box, { ref: scaleBarElem, backgroundColor: "bg/80", ...containerProps });
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
export { ScaleBar };
|
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, 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 ref={scaleBarElem} backgroundColor=\"
|
|
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 ref={scaleBarElem} backgroundColor=\"bg/80\" {...containerProps} />;\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,EAAI,GAAA,EAAK,cAAc,eAAA,EAAgB,OAAA,EAAS,GAAG,cAAA,EAAgB,CAAA;AAC/E;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@open-pioneer/scale-bar",
|
|
4
|
-
"version": "1.3.0-dev.
|
|
4
|
+
"version": "1.3.0-dev.20260422120518",
|
|
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"
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@chakra-ui/react": "^3.34.0",
|
|
18
|
-
"@open-pioneer/react-utils": "
|
|
19
|
-
"@open-pioneer/runtime": "
|
|
20
|
-
"ol": "^10.
|
|
21
|
-
"react": "^19.2.
|
|
22
|
-
"@open-pioneer/map": "1.3.0-dev.
|
|
18
|
+
"@open-pioneer/react-utils": "4.6.0-dev.20260420101935",
|
|
19
|
+
"@open-pioneer/runtime": "4.6.0-dev.20260420101935",
|
|
20
|
+
"ol": "^10.9.0",
|
|
21
|
+
"react": "^19.2.5",
|
|
22
|
+
"@open-pioneer/map": "1.3.0-dev.20260422120518"
|
|
23
23
|
},
|
|
24
24
|
"exports": {
|
|
25
25
|
"./package.json": "./package.json",
|