@open-pioneer/scale-viewer 1.4.0-dev.20260727093741 → 1.5.0-dev.20260910103330
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 +29 -14
- package/ScaleViewer.js.map +1 -1
- package/package.json +11 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
# @open-pioneer/scale-viewer
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.5.0-dev.20260910103330
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f790fda: Update to Chakra 3.37.0
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 09ec7c7: Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 1.4.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
6
16
|
|
|
7
17
|
- c30396d: Update Chakra to 3.36.1
|
|
18
|
+
- d862003: Update to trails core-packages 4.7.0
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- c16a401: Migrated from eslint to oxlint and from prettier to oxfmt.
|
|
8
23
|
|
|
9
24
|
## 1.3.0
|
|
10
25
|
|
|
@@ -61,17 +76,17 @@
|
|
|
61
76
|
- 193068a: Deprecate the `mapId` property on React components.
|
|
62
77
|
Use the `MapModel` directly instead to pass a reference to the map.
|
|
63
78
|
|
|
64
|
-
|
|
79
|
+
Example:
|
|
65
80
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
81
|
+
```tsx
|
|
82
|
+
// Default map for entire component tree
|
|
83
|
+
<DefaultMapProvider map={mapModel}>
|
|
84
|
+
<Toc />
|
|
85
|
+
</DefaultMapProvider>
|
|
71
86
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
87
|
+
// Map for specific component
|
|
88
|
+
<Toc map={mapModel} />
|
|
89
|
+
```
|
|
75
90
|
|
|
76
91
|
### Patch Changes
|
|
77
92
|
|
|
@@ -90,9 +105,9 @@
|
|
|
90
105
|
### Minor Changes
|
|
91
106
|
|
|
92
107
|
- 2fa8020: Update trails core package dependencies.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
108
|
+
- Also updates Chakra UI to the latest 2.x version and Chakra React Select to version 5.
|
|
109
|
+
- Removes any obsolete references to `@chakra-ui/system`.
|
|
110
|
+
This dependency seems to be no longer required and may lead to duplicate packages in your dependency tree.
|
|
96
111
|
|
|
97
112
|
### Patch Changes
|
|
98
113
|
|
|
@@ -111,7 +126,7 @@
|
|
|
111
126
|
- 583f1d6: The `mapId` or `map` properties are now optional on individual components.
|
|
112
127
|
You can use the `DefaultMapProvider` to configure an implicit default value.
|
|
113
128
|
|
|
114
|
-
|
|
129
|
+
Note that configuring _neither_ a default _nor_ an explicit `map` or `mapId` will trigger a runtime error.
|
|
115
130
|
|
|
116
131
|
- 583f1d6: All UI components in this project now accept the `mapId` (a `string`) _or_ the `map` (a `MapModel`) directly.
|
|
117
132
|
- a8b3449: Switch to a new versioning strategy.
|
package/ScaleViewer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScaleViewer.js","sources":["ScaleViewer.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { Box, BoxProps, Text, VisuallyHidden } from \"@chakra-ui/react\";\nimport { MapModelProps, useMapModelValue } from \"@open-pioneer/map\";\nimport {\n CommonComponentProps,\n mergeChakraProps,\n useCommonComponentProps\n} from \"@open-pioneer/react-utils\";\nimport { useReactiveSnapshot } from \"@open-pioneer/reactivity\";\nimport { useIntl } from \"open-pioneer:react-hooks\";\nimport { FC, useEffect, useMemo, useState } from \"react\";\n\n/**\n * These are the properties supported by the {@link ScaleViewer}.\n */\nexport interface ScaleViewerProps extends CommonComponentProps, MapModelProps {}\n\nexport const ScaleViewer: FC<ScaleViewerProps> = (props) => {\n const { containerProps } = useCommonComponentProps(\"scale-viewer\", props);\n const map = useMapModelValue(props);\n const intl = useIntl();\n\n const scale = useReactiveSnapshot(() => map.scale ?? 1, [map]);\n const displayScale = intl.formatNumber(scale);\n\n // Make the scale shown to the screen reader lag behind a bit via debounce.\n // Otherwise, the user is notified of too many updates (individual scale changes).\n // See https://github.com/open-pioneer/trails-openlayers-base-packages/issues/431\n const debouncedScale = useDebouncedValue(scale, 3000);\n const ariaLabel = intl.formatMessage({ id: \"scaleLabel\" }, { scale: debouncedScale });\n\n const mergedBoxProps = useMemo(\n () =>\n mergeChakraProps<BoxProps>(\n {\n role: \"region\",\n \"aria-label\": intl.formatMessage({ id: \"regionLabel\" })\n },\n containerProps\n ),\n [intl, containerProps]\n );\n\n return (\n <Box {...mergedBoxProps}>\n <VisuallyHidden aria-live=\"polite\" aria-atomic=\"true\">\n {ariaLabel}\n </VisuallyHidden>\n <Text as=\"p\" aria-hidden=\"true\">\n 1:{displayScale}\n </Text>\n </Box>\n );\n};\n\n// TODO: Might be useful in a shared package\nfunction useDebouncedValue<T>(currentValue: T, timeout = 1000): T {\n const [value, setValue] = useState<T>(currentValue);\n\n useEffect(() => {\n const id = setTimeout(() => setValue(currentValue), timeout);\n return () => clearTimeout(id);\n }, [currentValue, timeout]);\n\n return value;\n}\n"],"names":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"ScaleViewer.js","sources":["ScaleViewer.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Box, BoxProps, Text, VisuallyHidden } from \"@chakra-ui/react\";\nimport { MapModelProps, useMapModelValue } from \"@open-pioneer/map\";\nimport {\n CommonComponentProps,\n mergeChakraProps,\n useCommonComponentProps\n} from \"@open-pioneer/react-utils\";\nimport { useReactiveSnapshot } from \"@open-pioneer/reactivity\";\nimport { useIntl } from \"open-pioneer:react-hooks\";\nimport { FC, useEffect, useMemo, useState } from \"react\";\n\n/**\n * These are the properties supported by the {@link ScaleViewer}.\n */\nexport interface ScaleViewerProps extends CommonComponentProps, MapModelProps {}\n\nexport const ScaleViewer: FC<ScaleViewerProps> = (props) => {\n const { containerProps } = useCommonComponentProps(\"scale-viewer\", props);\n const map = useMapModelValue(props);\n const intl = useIntl();\n\n const scale = useReactiveSnapshot(() => map.scale ?? 1, [map]);\n const displayScale = intl.formatNumber(scale);\n\n // Make the scale shown to the screen reader lag behind a bit via debounce.\n // Otherwise, the user is notified of too many updates (individual scale changes).\n // See https://github.com/open-pioneer/trails-openlayers-base-packages/issues/431\n const debouncedScale = useDebouncedValue(scale, 3000);\n const ariaLabel = intl.formatMessage({ id: \"scaleLabel\" }, { scale: debouncedScale });\n\n const mergedBoxProps = useMemo(\n () =>\n mergeChakraProps<BoxProps>(\n {\n role: \"region\",\n \"aria-label\": intl.formatMessage({ id: \"regionLabel\" })\n },\n containerProps\n ),\n [intl, containerProps]\n );\n\n return (\n <Box {...mergedBoxProps}>\n <VisuallyHidden aria-live=\"polite\" aria-atomic=\"true\">\n {ariaLabel}\n </VisuallyHidden>\n <Text as=\"p\" aria-hidden=\"true\">\n 1:{displayScale}\n </Text>\n </Box>\n );\n};\n\n// TODO: Might be useful in a shared package\nfunction useDebouncedValue<T>(currentValue: T, timeout = 1000): T {\n const [value, setValue] = useState<T>(currentValue);\n\n useEffect(() => {\n const id = setTimeout(() => setValue(currentValue), timeout);\n return () => clearTimeout(id);\n }, [currentValue, timeout]);\n\n return value;\n}\n"],"names":[],"mappings":";;;;;;;;AAmBO,MAAM,WAAA,GAAoC,CAAC,KAAA,KAAU;AACxD,EAAA,MAAM,EAAE,cAAA,EAAe,GAAI,uBAAA,CAAwB,gBAAgB,KAAK,CAAA;AACxE,EAAA,MAAM,GAAA,GAAM,iBAAiB,KAAK,CAAA;AAClC,EAAA,MAAM,OAAO,OAA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,IAAA,OAAO,MAAM,aAAa,EAAE,CAAA;AAAA,EAChC,CAAA,EAAG,CAAC,YAAA,EAAc,OAAO,CAAC,CAAA;AAE1B,EAAA,OAAO,KAAA;AACX;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@open-pioneer/scale-viewer",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.0-dev.20260910103330",
|
|
5
5
|
"description": "This package provides a UI component to show the actual map scale to the user.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"open-pioneer-trails"
|
|
@@ -14,12 +14,16 @@
|
|
|
14
14
|
"directory": "src/packages/scale-viewer"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@chakra-ui/react": "^3.
|
|
18
|
-
"@open-pioneer/
|
|
19
|
-
"@open-pioneer/
|
|
20
|
-
"@open-pioneer/reactivity": "4.
|
|
21
|
-
"
|
|
22
|
-
"
|
|
17
|
+
"@chakra-ui/react": "^3.37.0",
|
|
18
|
+
"@open-pioneer/map": "1.5.0-dev.20260910103330",
|
|
19
|
+
"@open-pioneer/react-utils": "4.8.0-dev.20260910101405",
|
|
20
|
+
"@open-pioneer/reactivity": "4.8.0-dev.20260910101405",
|
|
21
|
+
"@open-pioneer/runtime": "4.8.0-dev.20260910101405",
|
|
22
|
+
"react": "^19.2.8"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"directory": "dist",
|
|
26
|
+
"linkDirectory": false
|
|
23
27
|
},
|
|
24
28
|
"exports": {
|
|
25
29
|
"./package.json": "./package.json",
|