@open-pioneer/scale-setter 0.11.0 → 0.12.0-dev.20250725080856
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 +17 -1
- package/ScaleSetter.js +2 -2
- package/ScaleSetter.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @open-pioneer/scale-setter
|
|
2
2
|
|
|
3
|
+
## 0.12.0-dev.20250725080856
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 2732052: Icons have been changed to unify the appearance of the components. Preferably, Lucide react-icons are used.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 10d2fe7: Update dependencies
|
|
12
|
+
- da6a410: Update dependencies
|
|
13
|
+
- Updated dependencies [10d2fe7]
|
|
14
|
+
- Updated dependencies [2702df4]
|
|
15
|
+
- Updated dependencies [8986b3b]
|
|
16
|
+
- Updated dependencies [f1f69f2]
|
|
17
|
+
- Updated dependencies [da6a410]
|
|
18
|
+
- @open-pioneer/map@0.12.0-dev.20250725080856
|
|
19
|
+
|
|
3
20
|
## 0.11.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -73,7 +90,6 @@
|
|
|
73
90
|
### Minor Changes
|
|
74
91
|
|
|
75
92
|
- 2fa8020: Update trails core package dependencies.
|
|
76
|
-
|
|
77
93
|
- Also updates Chakra UI to the latest 2.x version and Chakra React Select to version 5.
|
|
78
94
|
- Removes any obsolete references to `@chakra-ui/system`.
|
|
79
95
|
This dependency seems to be no longer required and may lead to duplicate packages in your dependency tree.
|
package/ScaleSetter.js
CHANGED
|
@@ -5,7 +5,7 @@ import { useCommonComponentProps } from '@open-pioneer/react-utils';
|
|
|
5
5
|
import { useReactiveSnapshot } from '@open-pioneer/reactivity';
|
|
6
6
|
import { useIntl } from './_virtual/_virtual-pioneer-module_react-hooks.js';
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
|
-
import {
|
|
8
|
+
import { LuChevronDown } from 'react-icons/lu';
|
|
9
9
|
|
|
10
10
|
const DEFAULT_SCALES = [
|
|
11
11
|
17471320,
|
|
@@ -73,7 +73,7 @@ const ScaleSetter = (props) => {
|
|
|
73
73
|
}),
|
|
74
74
|
children: [
|
|
75
75
|
renderScaleText(intl, activeScale),
|
|
76
|
-
/* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(
|
|
76
|
+
/* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(LuChevronDown, {}) })
|
|
77
77
|
]
|
|
78
78
|
}
|
|
79
79
|
) }),
|
package/ScaleSetter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScaleSetter.js","sources":["ScaleSetter.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { Box, Button, Icon, Menu, Portal } from \"@chakra-ui/react\";\nimport { MapModelProps, useMapModel } from \"@open-pioneer/map\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport { useReactiveSnapshot } from \"@open-pioneer/reactivity\";\nimport { PackageIntl } from \"@open-pioneer/runtime\";\nimport { useIntl } from \"open-pioneer:react-hooks\";\nimport { FC, useMemo } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"ScaleSetter.js","sources":["ScaleSetter.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { Box, Button, Icon, Menu, Portal } from \"@chakra-ui/react\";\nimport { MapModelProps, useMapModel } from \"@open-pioneer/map\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport { useReactiveSnapshot } from \"@open-pioneer/reactivity\";\nimport { PackageIntl } from \"@open-pioneer/runtime\";\nimport { useIntl } from \"open-pioneer:react-hooks\";\nimport { FC, useMemo } from \"react\";\nimport { LuChevronDown } from \"react-icons/lu\";\n\nconst DEFAULT_SCALES = [\n 17471320, 8735660, 4367830, 2183915, 1091957, 545978, 272989, 136494, 68247, 34123, 17061, 8530,\n 4265, 2132\n];\n\n/**\n * These are the properties supported by the {@link ScaleSetter}.\n */\nexport interface ScaleSetterProps extends CommonComponentProps, MapModelProps {\n /**\n * The set of scales that can be selected by the user.\n */\n scales?: number[];\n}\n\n/**\n * Displays the current scale and allows the user to change it.\n */\nexport const ScaleSetter: FC<ScaleSetterProps> = (props) => {\n const { scales = DEFAULT_SCALES } = props;\n const { containerProps } = useCommonComponentProps(\"scale-setter\", props);\n const { map } = useMapModel(props);\n const intl = useIntl();\n\n const scaleSelectOptions = useMemo(\n () =>\n scales.map((scaleValue) => {\n return (\n <Menu.Item\n className=\"scale-setter-option\"\n aria-label={intl.formatMessage(\n {\n id: \"option.ariaLabel\"\n },\n { scale: scaleValue }\n )}\n value={String(scaleValue)}\n key={scaleValue}\n onClick={() => map?.setScale(scaleValue)}\n onFocus={(e) => {\n // Not available in unit tests\n e.target?.scrollIntoView?.({\n block: \"nearest\"\n });\n }}\n >\n {renderScaleText(intl, scaleValue)}\n </Menu.Item>\n );\n }),\n [intl, map, scales]\n );\n\n const activeScale = useReactiveSnapshot(() => map?.scale ?? 1, [map]);\n return (\n <Box {...containerProps}>\n <Menu.Root>\n <Menu.Trigger asChild>\n <Button\n className=\"scale-setter-menubutton\"\n aria-label={intl.formatMessage(\n {\n id: \"button.ariaLabel\"\n },\n {\n scale: activeScale\n }\n )}\n aria-description={intl.formatMessage({\n id: \"button.ariaDescription\"\n })}\n >\n {renderScaleText(intl, activeScale)}\n <Icon>\n <LuChevronDown />\n </Icon>\n </Button>\n </Menu.Trigger>\n <Portal>\n <Menu.Positioner>\n <Menu.Content\n className=\"scale-setter-menuoptions\"\n maxHeight=\"20em\"\n overflowY=\"auto\"\n >\n {scaleSelectOptions}\n </Menu.Content>\n </Menu.Positioner>\n </Portal>\n </Menu.Root>\n </Box>\n );\n};\n\nfunction renderScaleText(intl: PackageIntl, rawScale: number): string {\n return \"1 : \" + intl.formatNumber(rawScale);\n}\n"],"names":[],"mappings":";;;;;;;;;AAWA,MAAM,cAAiB,GAAA;AAAA,EACnB,QAAA;AAAA,EAAU,OAAA;AAAA,EAAS,OAAA;AAAA,EAAS,OAAA;AAAA,EAAS,OAAA;AAAA,EAAS,MAAA;AAAA,EAAQ,MAAA;AAAA,EAAQ,MAAA;AAAA,EAAQ,KAAA;AAAA,EAAO,KAAA;AAAA,EAAO,KAAA;AAAA,EAAO,IAAA;AAAA,EAC3F,IAAA;AAAA,EAAM;AACV,CAAA;AAea,MAAA,WAAA,GAAoC,CAAC,KAAU,KAAA;AACxD,EAAM,MAAA,EAAE,MAAS,GAAA,cAAA,EAAmB,GAAA,KAAA;AACpC,EAAA,MAAM,EAAE,cAAA,EAAmB,GAAA,uBAAA,CAAwB,gBAAgB,KAAK,CAAA;AACxE,EAAA,MAAM,EAAE,GAAA,EAAQ,GAAA,WAAA,CAAY,KAAK,CAAA;AACjC,EAAA,MAAM,OAAO,OAAQ,EAAA;AAErB,EAAA,MAAM,kBAAqB,GAAA,OAAA;AAAA,IACvB,MACI,MAAA,CAAO,GAAI,CAAA,CAAC,UAAe,KAAA;AACvB,MACI,uBAAA,GAAA;AAAA,QAAC,IAAK,CAAA,IAAA;AAAA,QAAL;AAAA,UACG,SAAU,EAAA,qBAAA;AAAA,UACV,cAAY,IAAK,CAAA,aAAA;AAAA,YACb;AAAA,cACI,EAAI,EAAA;AAAA,aACR;AAAA,YACA,EAAE,OAAO,UAAW;AAAA,WACxB;AAAA,UACA,KAAA,EAAO,OAAO,UAAU,CAAA;AAAA,UAExB,OAAS,EAAA,MAAM,GAAK,EAAA,QAAA,CAAS,UAAU,CAAA;AAAA,UACvC,OAAA,EAAS,CAAC,CAAM,KAAA;AAEZ,Y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AA,MAAA;AAAA,QACV,SAAU,EAAA,MAAA;AAAA,QAET,QAAA,EAAA;AAAA;AAAA,OAET,CACJ,EAAA;AAAA,GAAA,EACJ,CACJ,EAAA,CAAA;AAER;AAEA,SAAS,eAAA,CAAgB,MAAmB,QAA0B,EAAA;AAClE,EAAO,OAAA,MAAA,GAAS,IAAK,CAAA,YAAA,CAAa,QAAQ,CAAA;AAC9C;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@open-pioneer/scale-setter",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.12.0-dev.20250725080856",
|
|
5
5
|
"description": "This package provides a UI component to change the scale of the map.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"open-pioneer-trails"
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
"directory": "src/packages/scale-setter"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@chakra-ui/react": "^3.
|
|
17
|
+
"@chakra-ui/react": "^3.21.1",
|
|
18
18
|
"@open-pioneer/react-utils": "^4.0.0",
|
|
19
19
|
"@open-pioneer/runtime": "^4.0.0",
|
|
20
20
|
"@open-pioneer/reactivity": "^4.0.0",
|
|
21
|
-
"ol": "^10.
|
|
21
|
+
"ol": "^10.6.1",
|
|
22
22
|
"react": "^19.1.0",
|
|
23
23
|
"react-icons": "^5.5.0",
|
|
24
|
-
"@open-pioneer/map": "
|
|
24
|
+
"@open-pioneer/map": "0.12.0-dev.20250725080856"
|
|
25
25
|
},
|
|
26
26
|
"exports": {
|
|
27
27
|
"./package.json": "./package.json",
|