@open-pioneer/scale-setter 0.9.0-dev.20250220091855 → 0.9.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,88 +1,97 @@
1
1
  # @open-pioneer/scale-setter
2
2
 
3
- ## 0.9.0-dev.20250220091855
3
+ ## 0.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - cb94c75: update dependencies
4
8
 
5
9
  ### Patch Changes
6
10
 
7
- - Updated dependencies [f327eec]
8
- - Updated dependencies [f327eec]
9
- - Updated dependencies [209eb8e]
10
- - @open-pioneer/map@0.9.0-dev.20250220091855
11
+ - Updated dependencies [e7fdc5d]
12
+ - Updated dependencies [cb94c75]
13
+ - Updated dependencies [37cd707]
14
+ - Updated dependencies [32ed2cd]
15
+ - Updated dependencies [f327eec]
16
+ - Updated dependencies [f327eec]
17
+ - Updated dependencies [209eb8e]
18
+ - Updated dependencies [d72e42c]
19
+ - @open-pioneer/map@0.9.0
11
20
 
12
21
  ## 0.8.0
13
22
 
14
23
  ### Minor Changes
15
24
 
16
- - 2fa8020: Update trails core package dependencies.
25
+ - 2fa8020: Update trails core package dependencies.
17
26
 
18
- - Also updates Chakra UI to the latest 2.x version and Chakra React Select to version 5.
19
- - Removes any obsolete references to `@chakra-ui/system`.
20
- This dependency seems to be no longer required and may lead to duplicate packages in your dependency tree.
27
+ - Also updates Chakra UI to the latest 2.x version and Chakra React Select to version 5.
28
+ - Removes any obsolete references to `@chakra-ui/system`.
29
+ This dependency seems to be no longer required and may lead to duplicate packages in your dependency tree.
21
30
 
22
31
  ### Patch Changes
23
32
 
24
- - 49f0207: Update trails core packages to version 2.4.0
25
- - d8337a6: Refactor implementation to use the new reactive properties of the map model.
26
- - Updated dependencies [b717121]
27
- - Updated dependencies [e7978a8]
28
- - Updated dependencies [7a5f1e1]
29
- - Updated dependencies [7ae9f90]
30
- - Updated dependencies [d8337a6]
31
- - Updated dependencies [49f0207]
32
- - Updated dependencies [b2127df]
33
- - Updated dependencies [2fa8020]
34
- - Updated dependencies [7ae9f90]
35
- - Updated dependencies [d8337a6]
36
- - @open-pioneer/map@0.8.0
33
+ - 49f0207: Update trails core packages to version 2.4.0
34
+ - d8337a6: Refactor implementation to use the new reactive properties of the map model.
35
+ - Updated dependencies [b717121]
36
+ - Updated dependencies [e7978a8]
37
+ - Updated dependencies [7a5f1e1]
38
+ - Updated dependencies [7ae9f90]
39
+ - Updated dependencies [d8337a6]
40
+ - Updated dependencies [49f0207]
41
+ - Updated dependencies [b2127df]
42
+ - Updated dependencies [2fa8020]
43
+ - Updated dependencies [7ae9f90]
44
+ - Updated dependencies [d8337a6]
45
+ - @open-pioneer/map@0.8.0
37
46
 
38
47
  ## 0.7.0
39
48
 
40
49
  ### Minor Changes
41
50
 
42
- - 310800c: Switch from `peerDependencies` to normal `dependencies`. Peer dependencies have some usability problems when used at scale.
51
+ - 310800c: Switch from `peerDependencies` to normal `dependencies`. Peer dependencies have some usability problems when used at scale.
43
52
 
44
53
  ### Patch Changes
45
54
 
46
- - 310800c: Update core packages version.
47
- - 583f1d6: The `mapId` or `map` properties are now optional on individual components.
48
- You can use the `DefaultMapProvider` to configure an implicit default value.
55
+ - 310800c: Update core packages version.
56
+ - 583f1d6: The `mapId` or `map` properties are now optional on individual components.
57
+ You can use the `DefaultMapProvider` to configure an implicit default value.
49
58
 
50
59
  Note that configuring _neither_ a default _nor_ an explicit `map` or `mapId` will trigger a runtime error.
51
60
 
52
- - 583f1d6: All UI components in this project now accept the `mapId` (a `string`) _or_ the `map` (a `MapModel`) directly.
53
- - a8b3449: Switch to a new versioning strategy.
54
- From now on, packages released by this repository share a common version number.
55
- - 900eb11: Update dependencies.
56
- - Updated dependencies [310800c]
57
- - Updated dependencies [2502050]
58
- - Updated dependencies [583f1d6]
59
- - Updated dependencies [583f1d6]
60
- - Updated dependencies [397d617]
61
- - Updated dependencies [a8b3449]
62
- - Updated dependencies [310800c]
63
- - Updated dependencies [900eb11]
64
- - Updated dependencies [583f1d6]
65
- - Updated dependencies [397d617]
66
- - @open-pioneer/map@0.7.0
61
+ - 583f1d6: All UI components in this project now accept the `mapId` (a `string`) _or_ the `map` (a `MapModel`) directly.
62
+ - a8b3449: Switch to a new versioning strategy.
63
+ From now on, packages released by this repository share a common version number.
64
+ - 900eb11: Update dependencies.
65
+ - Updated dependencies [310800c]
66
+ - Updated dependencies [2502050]
67
+ - Updated dependencies [583f1d6]
68
+ - Updated dependencies [583f1d6]
69
+ - Updated dependencies [397d617]
70
+ - Updated dependencies [a8b3449]
71
+ - Updated dependencies [310800c]
72
+ - Updated dependencies [900eb11]
73
+ - Updated dependencies [583f1d6]
74
+ - Updated dependencies [397d617]
75
+ - @open-pioneer/map@0.7.0
67
76
 
68
77
  ## 0.1.1
69
78
 
70
79
  ### Patch Changes
71
80
 
72
- - b152428: Update trails dependencies
73
- - Updated dependencies [b152428]
74
- - Updated dependencies [291ccb6]
75
- - @open-pioneer/map@0.6.1
81
+ - b152428: Update trails dependencies
82
+ - Updated dependencies [b152428]
83
+ - Updated dependencies [291ccb6]
84
+ - @open-pioneer/map@0.6.1
76
85
 
77
86
  ## 0.1.0
78
87
 
79
88
  ### Minor Changes
80
89
 
81
- - b9f5f39: Initial release
90
+ - b9f5f39: Initial release
82
91
 
83
92
  ### Patch Changes
84
93
 
85
- - Updated dependencies [28e092a]
86
- - Updated dependencies [0d51d2f]
87
- - Updated dependencies [76f8863]
88
- - @open-pioneer/map@0.6.0
94
+ - Updated dependencies [28e092a]
95
+ - Updated dependencies [0d51d2f]
96
+ - Updated dependencies [76f8863]
97
+ - @open-pioneer/map@0.6.0
@@ -1 +1 @@
1
- {"version":3,"file":"ScaleSetter.js","sources":["ScaleSetter.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { ChevronUpIcon } from \"@chakra-ui/icons\";\nimport {\n Box,\n Button,\n Menu,\n MenuButton,\n MenuItem,\n MenuList,\n Portal\n} 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 { PackageIntl } from \"@open-pioneer/runtime\";\nimport { useIntl } from \"open-pioneer:react-hooks\";\nimport { FC } from \"react\";\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 activeScale = useReactiveSnapshot(() => map?.scale ?? 1, [map]);\n\n const scaleSelectOptions = scales.map((scaleValue) => {\n return (\n <MenuItem\n value={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 className=\"scale-setter-option\"\n >\n {renderDisplayScale(intl, scaleValue)}\n </MenuItem>\n );\n });\n\n const renderedScale = renderDisplayScale(intl, activeScale);\n return (\n <Box {...containerProps}>\n <Menu isLazy>\n <MenuButton\n as={Button}\n rightIcon={<ChevronUpIcon />}\n className=\"scale-setter-menubutton\"\n aria-label={intl.formatMessage(\n {\n id: \"button.ariaLabel\"\n },\n { scale: renderedScale }\n )}\n // eslint-disable-next-line jsx-a11y/aria-props\n aria-description={intl.formatMessage({\n id: \"button.ariaDescription\"\n })}\n >\n {renderedScale}\n </MenuButton>\n <Portal>\n <MenuList\n className=\"scale-setter-menuoptions\"\n maxHeight=\"20em\"\n overflowY=\"auto\"\n >\n {scaleSelectOptions}\n </MenuList>\n </Portal>\n </Menu>\n </Box>\n );\n};\n\nfunction renderDisplayScale(intl: PackageIntl, rawScale: number): string {\n return \"1 : \" + intl.formatNumber(rawScale);\n}\n"],"names":[],"mappings":";;;;;;;;AAmBA,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,IAAA;AACV,CAAA,CAAA;AAea,MAAA,WAAA,GAAoC,CAAC,KAAU,KAAA;AACxD,EAAM,MAAA,EAAE,MAAS,GAAA,cAAA,EAAmB,GAAA,KAAA,CAAA;AACpC,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;AAErB,EAAM,MAAA,WAAA,GAAc,oBAAoB,MAAM,GAAA,EAAK,SAAS,CAAG,EAAA,CAAC,GAAG,CAAC,CAAA,CAAA;AAEpE,EAAA,MAAM,kBAAqB,GAAA,MAAA,CAAO,GAAI,CAAA,CAAC,UAAe,KAAA;AAClD,IACI,uBAAA,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACG,KAAO,EAAA,UAAA;AAAA,QAEP,OAAS,EAAA,MAAM,GAAK,EAAA,QAAA,CAAS,UAAU,CAAA;AAAA,QACvC,OAAA,EAAS,CAAC,CAAM,KAAA;A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A;AACrE,EAAO,OAAA,MAAA,GAAS,IAAK,CAAA,YAAA,CAAa,QAAQ,CAAA,CAAA;AAC9C;;;;"}
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 { ChevronUpIcon } from \"@chakra-ui/icons\";\nimport {\n Box,\n Button,\n Menu,\n MenuButton,\n MenuItem,\n MenuList,\n Portal\n} 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 { PackageIntl } from \"@open-pioneer/runtime\";\nimport { useIntl } from \"open-pioneer:react-hooks\";\nimport { FC } from \"react\";\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 activeScale = useReactiveSnapshot(() => map?.scale ?? 1, [map]);\n\n const scaleSelectOptions = scales.map((scaleValue) => {\n return (\n <MenuItem\n value={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 className=\"scale-setter-option\"\n >\n {renderDisplayScale(intl, scaleValue)}\n </MenuItem>\n );\n });\n\n const renderedScale = renderDisplayScale(intl, activeScale);\n return (\n <Box {...containerProps}>\n <Menu isLazy>\n <MenuButton\n as={Button}\n rightIcon={<ChevronUpIcon />}\n className=\"scale-setter-menubutton\"\n aria-label={intl.formatMessage(\n {\n id: \"button.ariaLabel\"\n },\n { scale: renderedScale }\n )}\n // eslint-disable-next-line jsx-a11y/aria-props\n aria-description={intl.formatMessage({\n id: \"button.ariaDescription\"\n })}\n >\n {renderedScale}\n </MenuButton>\n <Portal>\n <MenuList\n className=\"scale-setter-menuoptions\"\n maxHeight=\"20em\"\n overflowY=\"auto\"\n >\n {scaleSelectOptions}\n </MenuList>\n </Portal>\n </Menu>\n </Box>\n );\n};\n\nfunction renderDisplayScale(intl: PackageIntl, rawScale: number): string {\n return \"1 : \" + intl.formatNumber(rawScale);\n}\n"],"names":[],"mappings":";;;;;;;;AAmBA,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,EAAM,MAAA,WAAA,GAAc,oBAAoB,MAAM,GAAA,EAAK,SAAS,CAAG,EAAA,CAAC,GAAG,CAAC,CAAA;AAEpE,EAAA,MAAM,kBAAq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MAAA;AAAA,QAET,QAAA,EAAA;AAAA;AAAA,KAET,EAAA;AAAA,GAAA,EACJ,CACJ,EAAA,CAAA;AAER;AAEA,SAAS,kBAAA,CAAmB,MAAmB,QAA0B,EAAA;AACrE,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.9.0-dev.20250220091855",
4
+ "version": "0.9.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"
@@ -15,13 +15,13 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@chakra-ui/icons": "^2.2.4",
18
- "@open-pioneer/chakra-integration": "^2.4.0",
19
- "@open-pioneer/react-utils": "^2.4.0",
20
- "@open-pioneer/runtime": "^2.4.0",
21
- "@open-pioneer/reactivity": "^2.4.0",
22
- "ol": "^10.3.0",
23
- "react": "^18.3.1",
24
- "@open-pioneer/map": "^0.9.0-dev.20250220091855"
18
+ "@open-pioneer/chakra-integration": "^3.0.0",
19
+ "@open-pioneer/react-utils": "^3.0.0",
20
+ "@open-pioneer/runtime": "^3.0.0",
21
+ "@open-pioneer/reactivity": "^3.0.0",
22
+ "ol": "^10.4.0",
23
+ "react": "^19.0.0",
24
+ "@open-pioneer/map": "^0.9.0"
25
25
  },
26
26
  "exports": {
27
27
  "./package.json": "./package.json",