@open-pioneer/scale-setter 1.5.0-dev.20260911123645 → 1.5.0
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 +16 -14
- package/ScaleSetter.js.map +1 -1
- package/_virtual/hooks.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
# @open-pioneer/scale-setter
|
|
2
2
|
|
|
3
|
-
## 1.5.0
|
|
3
|
+
## 1.5.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
7
|
- f790fda: Update to Chakra 3.37.0
|
|
8
|
+
- a186f5d: Update core packages to 4.8.0.
|
|
8
9
|
|
|
9
10
|
### Patch Changes
|
|
10
11
|
|
|
12
|
+
- 0d9a9d0: Adapt to timing changes during map initialization.
|
|
11
13
|
- 09ec7c7: Updated dependencies
|
|
12
14
|
|
|
13
15
|
## 1.4.0
|
|
@@ -78,17 +80,17 @@
|
|
|
78
80
|
- 193068a: Deprecate the `mapId` property on React components.
|
|
79
81
|
Use the `MapModel` directly instead to pass a reference to the map.
|
|
80
82
|
|
|
81
|
-
|
|
83
|
+
Example:
|
|
82
84
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
```tsx
|
|
86
|
+
// Default map for entire component tree
|
|
87
|
+
<DefaultMapProvider map={mapModel}>
|
|
88
|
+
<Toc />
|
|
89
|
+
</DefaultMapProvider>
|
|
88
90
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
// Map for specific component
|
|
92
|
+
<Toc map={mapModel} />
|
|
93
|
+
```
|
|
92
94
|
|
|
93
95
|
### Patch Changes
|
|
94
96
|
|
|
@@ -107,9 +109,9 @@
|
|
|
107
109
|
### Minor Changes
|
|
108
110
|
|
|
109
111
|
- 2fa8020: Update trails core package dependencies.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
- Also updates Chakra UI to the latest 2.x version and Chakra React Select to version 5.
|
|
113
|
+
- Removes any obsolete references to `@chakra-ui/system`.
|
|
114
|
+
This dependency seems to be no longer required and may lead to duplicate packages in your dependency tree.
|
|
113
115
|
|
|
114
116
|
### Patch Changes
|
|
115
117
|
|
|
@@ -128,7 +130,7 @@
|
|
|
128
130
|
- 583f1d6: The `mapId` or `map` properties are now optional on individual components.
|
|
129
131
|
You can use the `DefaultMapProvider` to configure an implicit default value.
|
|
130
132
|
|
|
131
|
-
|
|
133
|
+
Note that configuring _neither_ a default _nor_ an explicit `map` or `mapId` will trigger a runtime error.
|
|
132
134
|
|
|
133
135
|
- 583f1d6: All UI components in this project now accept the `mapId` (a `string`) _or_ the `map` (a `MapModel`) directly.
|
|
134
136
|
- a8b3449: Switch to a new versioning strategy.
|
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\n\nimport { Box, Button, Icon, Menu, Portal } from \"@chakra-ui/react\";\nimport { MapModelProps, useMapModelValue } 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 = useMapModelValue(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":";;;;;;;;;AAYA,MAAM,cAAA,GAAiB;AAAA,EACnB,QAAA;AAAA,EAAU,OAAA;AAAA,EAAS,OAAA;AAAA,EAAS,OAAA;AAAA,EAAS,OAAA;AAAA,EAAS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// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Box, Button, Icon, Menu, Portal } from \"@chakra-ui/react\";\nimport { MapModelProps, useMapModelValue } 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 = useMapModelValue(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":";;;;;;;;;AAYA,MAAM,cAAA,GAAiB;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;AAeO,MAAM,WAAA,GAAoC,CAAC,KAAA,KAAU;AACxD,EAAA,MAAM,EAAE,MAAA,GAAS,cAAA,EAAe,GAAI,KAAA;AACpC,EAAA,MAAM,EAAE,cAAA,EAAe,GAAI,uBAAA,CAAwB,gBAAgB,KAAK,CAAA;AACxE,EAAA,MAAM,GAAA,GAAM,iBAAiB,KAAK,CAAA;AAClC,EAAA,MAAM,OAAO,OAAA,EAAQ;AAErB,EAAA,MAAM,kBAAA,GAAqB,OAAA;AAAA,IACvB,MACI,MAAA,CAAO,GAAA,CAAI,CAAC,UAAA,KAAe;AACvB,MAAA,uBACI,GAAA;AAAA,QAAC,IAAA,CAAK,IAAA;AAAA,QAAL;AAAA,UACG,SAAA,EAAU,qBAAA;AAAA,UACV,cAAY,IAAA,CAAK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A,EAAA,EAAc,CAAA,EACnB;AAAA;AAAA;AAAA,KACJ,EACJ,CAAA;AAAA,oBACA,GAAA,CAAC,MAAA,EAAA,EACG,QAAA,kBAAA,GAAA,CAAC,IAAA,CAAK,YAAL,EACG,QAAA,kBAAA,GAAA;AAAA,MAAC,IAAA,CAAK,OAAA;AAAA,MAAL;AAAA,QACG,SAAA,EAAU,0BAAA;AAAA,QACV,SAAA,EAAU,MAAA;AAAA,QACV,SAAA,EAAU,MAAA;AAAA,QAET,QAAA,EAAA;AAAA;AAAA,OAET,CAAA,EACJ;AAAA,GAAA,EACJ,CAAA,EACJ,CAAA;AAER;AAEA,SAAS,eAAA,CAAgB,MAAmB,QAAA,EAA0B;AAClE,EAAA,OAAO,MAAA,GAAS,IAAA,CAAK,YAAA,CAAa,QAAQ,CAAA;AAC9C;;"}
|
package/_virtual/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hooks.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@open-pioneer/scale-setter",
|
|
4
|
-
"version": "1.5.0
|
|
4
|
+
"version": "1.5.0",
|
|
5
5
|
"description": "This package provides a UI component to change the scale of the map.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"open-pioneer-trails"
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@chakra-ui/react": "^3.37.0",
|
|
18
18
|
"@conterra/reactivity-core": "^0.8.8",
|
|
19
|
-
"@open-pioneer/map": "1.5.0
|
|
20
|
-
"@open-pioneer/react-utils": "4.8.0
|
|
21
|
-
"@open-pioneer/reactivity": "4.8.0
|
|
22
|
-
"@open-pioneer/runtime": "4.8.0
|
|
19
|
+
"@open-pioneer/map": "1.5.0",
|
|
20
|
+
"@open-pioneer/react-utils": "^4.8.0",
|
|
21
|
+
"@open-pioneer/reactivity": "^4.8.0",
|
|
22
|
+
"@open-pioneer/runtime": "^4.8.0",
|
|
23
23
|
"ol": "^10.10.0",
|
|
24
|
-
"react": "^19.
|
|
24
|
+
"react": "^19.3.0",
|
|
25
25
|
"react-icons": "^5.7.0"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|