@open-pioneer/scale-viewer 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/ScaleViewer.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-viewer
|
|
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
|
|
@@ -76,17 +78,17 @@
|
|
|
76
78
|
- 193068a: Deprecate the `mapId` property on React components.
|
|
77
79
|
Use the `MapModel` directly instead to pass a reference to the map.
|
|
78
80
|
|
|
79
|
-
|
|
81
|
+
Example:
|
|
80
82
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
```tsx
|
|
84
|
+
// Default map for entire component tree
|
|
85
|
+
<DefaultMapProvider map={mapModel}>
|
|
86
|
+
<Toc />
|
|
87
|
+
</DefaultMapProvider>
|
|
86
88
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
// Map for specific component
|
|
90
|
+
<Toc map={mapModel} />
|
|
91
|
+
```
|
|
90
92
|
|
|
91
93
|
### Patch Changes
|
|
92
94
|
|
|
@@ -105,9 +107,9 @@
|
|
|
105
107
|
### Minor Changes
|
|
106
108
|
|
|
107
109
|
- 2fa8020: Update trails core package dependencies.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
- Also updates Chakra UI to the latest 2.x version and Chakra React Select to version 5.
|
|
111
|
+
- Removes any obsolete references to `@chakra-ui/system`.
|
|
112
|
+
This dependency seems to be no longer required and may lead to duplicate packages in your dependency tree.
|
|
111
113
|
|
|
112
114
|
### Patch Changes
|
|
113
115
|
|
|
@@ -126,7 +128,7 @@
|
|
|
126
128
|
- 583f1d6: The `mapId` or `map` properties are now optional on individual components.
|
|
127
129
|
You can use the `DefaultMapProvider` to configure an implicit default value.
|
|
128
130
|
|
|
129
|
-
|
|
131
|
+
Note that configuring _neither_ a default _nor_ an explicit `map` or `mapId` will trigger a runtime error.
|
|
130
132
|
|
|
131
133
|
- 583f1d6: All UI components in this project now accept the `mapId` (a `string`) _or_ the `map` (a `MapModel`) directly.
|
|
132
134
|
- 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\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,OAAA,EAAQ;AAErB,EAAA,MAAM,KAAA,GAAQ,oBAAoB,MAAM,GAAA,CAAI,SAAS,CAAA,EAAG,CAAC,GAAG,CAAC,CAAA;AAC7D,EAAA,MAAM,YAAA,GAAe,IAAA,CAAK,YAAA,CAAa,KAAK,CAAA;AAK5C,EAAA,MAAM,cAAA,GAAiB,iBAAA,CAAkB,KAAA,EAAO,GAAI,CAAA;AACpD,EAAA,MAAM,SAAA,GAAY,IAAA,CAAK,aAAA,CAAc,EAAE,EAAA,EAAI,cAAa,EAAG,EAAE,KAAA,EAAO,cAAA,EAAgB,CAAA;AAEpF,EAAA,MAAM,cAAA,GAAiB,OAAA;AAAA,IACnB,MACI,gBAAA;AAAA,MACI;AAAA,QACI,IAAA,EAAM,QAAA;AAAA,QACN,cAAc,IAAA,CAAK,aAAA,CAAc,EAAE,EAAA,EAAI,eAAe;AAAA,OAC1D;AAAA,MACA;AAAA,KACJ;AAAA,IACJ,CAAC,MAAM,cAAc;AAAA,GACzB;AAEA,EAAA,uBACI,IAAA,CAAC,GAAA,EAAA,EAAK,GAAG,cAAA,EACL,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,cAAA,EAAA,EAAe,WAAA,EAAU,QAAA,EAAS,aAAA,EAAY,QAC1C,QAAA,EAAA,SAAA,EACL,CAAA;AAAA,oBACA,IAAA,CAAC,IAAA,EAAA,EAAK,EAAA,EAAG,GAAA,EAAI,eAAY,MAAA,EAAO,QAAA,EAAA;AAAA,MAAA,IAAA;AAAA,MACzB;AAAA,KAAA,EACP;AAAA,GAAA,EACJ,CAAA;AAER;AAGA,SAAS,iBAAA,CAAqB,YAAA,EAAiB,OAAA,GAAU,GAAA,EAAS;AAC9D,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAAY,YAAY,CAAA;AAElD,EAAA,SAAA,CAAU,MAAM;AACZ,IAAA,MAAM,KAAK,UAAA,CAAW,MAAM,QAAA,CAAS,YAAY,GAAG,OAAO,CAAA;AAC3D,IAAA,OAAO,MAAM,aAAa,EAAE,CAAA;AAAA,EAChC,CAAA,EAAG,CAAC,YAAA,EAAc,OAAO,CAAC,CAAA;AAE1B,EAAA,OAAO,KAAA;AACX
|
|
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;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AO,QAAQ,CAAA,GAAI,SAAY,YAAY,CAAA;AAElD,EAAA,SAAA,CAAU,MAAM;AACZ,IAAA,MAAM,KAAK,UAAA,CAAW,MAAM,QAAA,CAAS,YAAY,GAAG,OAAO,CAAA;AAC3D,IAAA,OAAO,MAAM,aAAa,EAAE,CAAA;AAAA,EAChC,CAAA,EAAG,CAAC,YAAA,EAAc,OAAO,CAAC,CAAA;AAE1B,EAAA,OAAO,KAAA;AACX;;"}
|
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-viewer",
|
|
4
|
-
"version": "1.5.0
|
|
4
|
+
"version": "1.5.0",
|
|
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"
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@chakra-ui/react": "^3.37.0",
|
|
18
|
-
"@open-pioneer/map": "1.5.0
|
|
19
|
-
"@open-pioneer/react-utils": "4.8.0
|
|
20
|
-
"@open-pioneer/reactivity": "4.8.0
|
|
21
|
-
"@open-pioneer/runtime": "4.8.0
|
|
22
|
-
"react": "^19.
|
|
18
|
+
"@open-pioneer/map": "1.5.0",
|
|
19
|
+
"@open-pioneer/react-utils": "^4.8.0",
|
|
20
|
+
"@open-pioneer/reactivity": "^4.8.0",
|
|
21
|
+
"@open-pioneer/runtime": "^4.8.0",
|
|
22
|
+
"react": "^19.3.0"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"directory": "dist",
|