@open-pioneer/scale-viewer 0.7.0 → 0.8.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 CHANGED
@@ -1,5 +1,31 @@
1
1
  # @open-pioneer/scale-viewer
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 2fa8020: Update trails core package dependencies.
8
+
9
+ - Also updates Chakra UI to the latest 2.x version and Chakra React Select to version 5.
10
+ - Removes any obsolete references to `@chakra-ui/system`.
11
+ This dependency seems to be no longer required and may lead to duplicate packages in your dependency tree.
12
+
13
+ ### Patch Changes
14
+
15
+ - 49f0207: Update trails core packages to version 2.4.0
16
+ - d8337a6: Refactor implementation to use the new reactive properties of the map model.
17
+ - Updated dependencies [b717121]
18
+ - Updated dependencies [e7978a8]
19
+ - Updated dependencies [7a5f1e1]
20
+ - Updated dependencies [7ae9f90]
21
+ - Updated dependencies [d8337a6]
22
+ - Updated dependencies [49f0207]
23
+ - Updated dependencies [b2127df]
24
+ - Updated dependencies [2fa8020]
25
+ - Updated dependencies [7ae9f90]
26
+ - Updated dependencies [d8337a6]
27
+ - @open-pioneer/map@0.8.0
28
+
3
29
  ## 0.7.0
4
30
 
5
31
  ### Minor Changes
package/ScaleViewer.js CHANGED
@@ -1,14 +1,15 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { Box, Text } from '@open-pioneer/chakra-integration';
3
- import { useMapModel, useScale } from '@open-pioneer/map';
3
+ import { useMapModel } from '@open-pioneer/map';
4
4
  import { useCommonComponentProps } from '@open-pioneer/react-utils';
5
+ import { useReactiveSnapshot } from '@open-pioneer/reactivity';
5
6
  import { useIntl } from './_virtual/_virtual-pioneer-module_react-hooks.js';
6
7
 
7
8
  const ScaleViewer = (props) => {
8
9
  const { containerProps } = useCommonComponentProps("scale-viewer", props);
9
10
  const { map } = useMapModel(props);
10
11
  const intl = useIntl();
11
- const scale = useScale(map?.olMap);
12
+ const scale = useReactiveSnapshot(() => map?.scale ?? 1, [map]);
12
13
  const displayScale = scale ? intl.formatNumber(scale) : void 0;
13
14
  return /* @__PURE__ */ jsx(Box, { ...containerProps, children: displayScale && /* @__PURE__ */ jsxs(Text, { children: [
14
15
  "1:",
@@ -1 +1 @@
1
- {"version":3,"file":"ScaleViewer.js","sources":["ScaleViewer.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { Box, Text } from \"@open-pioneer/chakra-integration\";\nimport { MapModelProps, useMapModel, useScale } from \"@open-pioneer/map\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport { useIntl } from \"open-pioneer:react-hooks\";\nimport { FC } 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 } = useMapModel(props);\n const intl = useIntl();\n const scale = useScale(map?.olMap);\n const displayScale = scale ? intl.formatNumber(scale) : undefined;\n\n return <Box {...containerProps}>{displayScale && <Text>1:{displayScale}</Text>}</Box>;\n};\n"],"names":[],"mappings":";;;;;;AAaa,MAAA,WAAA,GAAoC,CAAC,KAAU,KAAA;AACxD,EAAA,MAAM,EAAE,cAAA,EAAmB,GAAA,uBAAA,CAAwB,gBAAgB,KAAK,CAAA,CAAA;AACxE,EAAA,MAAM,EAAE,GAAA,EAAQ,GAAA,WAAA,CAAY,KAAK,CAAA,CAAA;AACjC,EAAA,MAAM,OAAO,OAAQ,EAAA,CAAA;AACrB,EAAM,MAAA,KAAA,GAAQ,QAAS,CAAA,GAAA,EAAK,KAAK,CAAA,CAAA;AACjC,EAAA,MAAM,YAAe,GAAA,KAAA,GAAQ,IAAK,CAAA,YAAA,CAAa,KAAK,CAAI,GAAA,KAAA,CAAA,CAAA;AAExD,EAAA,2BAAQ,GAAK,EAAA,EAAA,GAAG,cAAiB,EAAA,QAAA,EAAA,YAAA,yBAAiB,IAAK,EAAA,EAAA,QAAA,EAAA;AAAA,IAAA,IAAA;AAAA,IAAG,YAAA;AAAA,GAAA,EAAa,CAAQ,EAAA,CAAA,CAAA;AACnF;;;;"}
1
+ {"version":3,"file":"ScaleViewer.js","sources":["ScaleViewer.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { Box, Text } from \"@open-pioneer/chakra-integration\";\nimport { MapModelProps, useMapModel } from \"@open-pioneer/map\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport { useReactiveSnapshot } from \"@open-pioneer/reactivity\";\nimport { useIntl } from \"open-pioneer:react-hooks\";\nimport { FC } 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 } = useMapModel(props);\n const intl = useIntl();\n const scale = useReactiveSnapshot(() => map?.scale ?? 1, [map]);\n const displayScale = scale ? intl.formatNumber(scale) : undefined;\n\n return <Box {...containerProps}>{displayScale && <Text>1:{displayScale}</Text>}</Box>;\n};\n"],"names":[],"mappings":";;;;;;;AAca,MAAA,WAAA,GAAoC,CAAC,KAAU,KAAA;AACxD,EAAA,MAAM,EAAE,cAAA,EAAmB,GAAA,uBAAA,CAAwB,gBAAgB,KAAK,CAAA,CAAA;AACxE,EAAA,MAAM,EAAE,GAAA,EAAQ,GAAA,WAAA,CAAY,KAAK,CAAA,CAAA;AACjC,EAAA,MAAM,OAAO,OAAQ,EAAA,CAAA;AACrB,EAAM,MAAA,KAAA,GAAQ,oBAAoB,MAAM,GAAA,EAAK,SAAS,CAAG,EAAA,CAAC,GAAG,CAAC,CAAA,CAAA;AAC9D,EAAA,MAAM,YAAe,GAAA,KAAA,GAAQ,IAAK,CAAA,YAAA,CAAa,KAAK,CAAI,GAAA,KAAA,CAAA,CAAA;AAExD,EAAA,2BAAQ,GAAK,EAAA,EAAA,GAAG,cAAiB,EAAA,QAAA,EAAA,YAAA,yBAAiB,IAAK,EAAA,EAAA,QAAA,EAAA;AAAA,IAAA,IAAA;AAAA,IAAG,YAAA;AAAA,GAAA,EAAa,CAAQ,EAAA,CAAA,CAAA;AACnF;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@open-pioneer/scale-viewer",
4
- "version": "0.7.0",
4
+ "version": "0.8.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"
@@ -14,11 +14,12 @@
14
14
  "directory": "src/packages/scale-viewer"
15
15
  },
16
16
  "dependencies": {
17
- "@open-pioneer/chakra-integration": "^2.3.0",
18
- "@open-pioneer/react-utils": "^2.3.0",
19
- "@open-pioneer/runtime": "^2.3.0",
17
+ "@open-pioneer/chakra-integration": "^2.4.0",
18
+ "@open-pioneer/react-utils": "^2.4.0",
19
+ "@open-pioneer/runtime": "^2.4.0",
20
+ "@open-pioneer/reactivity": "^2.4.0",
20
21
  "react": "^18.3.1",
21
- "@open-pioneer/map": "^0.7.0"
22
+ "@open-pioneer/map": "^0.8.0"
22
23
  },
23
24
  "exports": {
24
25
  "./package.json": "./package.json",