@open-pioneer/legend 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 CHANGED
@@ -1,13 +1,25 @@
1
1
  # @open-pioneer/legend
2
2
 
3
- ## 1.4.0-dev.20260727093741
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
8
19
 
9
20
  ### Patch Changes
10
21
 
22
+ - c16a401: Migrated from eslint to oxlint and from prettier to oxfmt.
11
23
  - c17f0e7: Support reactive changes of layer.title
12
24
 
13
25
  ## 1.3.0
@@ -45,26 +57,26 @@
45
57
 
46
58
  - 1723382: Introduce `listMode` for layer legend configurations:
47
59
 
48
- ```typescript
49
- //sublayer with legend configuration
50
- const internalLayer = new SimpleLayer({
51
- id: "layer1",
52
- title: "layer 1",
53
- olLayer: myOlLayer,
54
- visible: true,
55
- attributes: {
56
- legend: {
57
- listMode: "show"
58
- } satisfies LegendItemAttributes
59
- },
60
- sublayers: [
61
- {
62
- name: "sublayer1",
63
- title: "Sub Layer 1"
64
- }
65
- ]
66
- });
67
- ```
60
+ ```typescript
61
+ //sublayer with legend configuration
62
+ const internalLayer = new SimpleLayer({
63
+ id: "layer1",
64
+ title: "layer 1",
65
+ olLayer: myOlLayer,
66
+ visible: true,
67
+ attributes: {
68
+ legend: {
69
+ listMode: "show",
70
+ } satisfies LegendItemAttributes,
71
+ },
72
+ sublayers: [
73
+ {
74
+ name: "sublayer1",
75
+ title: "Sub Layer 1",
76
+ },
77
+ ],
78
+ });
79
+ ```
68
80
 
69
81
  - 2702df4: A layer's `internal` property is now respected by the Legend widget. If a layer is marked as internal (`internal` is `true`) no legend entry is displayed for this layer even if the legend is configured in the layer attributes.
70
82
  - 2732052: Icons have been changed to unify the appearance of the components. Preferably, Lucide react-icons are used.
@@ -92,17 +104,17 @@
92
104
  - 193068a: Deprecate the `mapId` property on React components.
93
105
  Use the `MapModel` directly instead to pass a reference to the map.
94
106
 
95
- Example:
107
+ Example:
96
108
 
97
- ```tsx
98
- // Default map for entire component tree
99
- <DefaultMapProvider map={mapModel}>
100
- <Toc />
101
- </DefaultMapProvider>
109
+ ```tsx
110
+ // Default map for entire component tree
111
+ <DefaultMapProvider map={mapModel}>
112
+ <Toc />
113
+ </DefaultMapProvider>
102
114
 
103
- // Map for specific component
104
- <Toc map={mapModel} />
105
- ```
115
+ // Map for specific component
116
+ <Toc map={mapModel} />
117
+ ```
106
118
 
107
119
  ### Patch Changes
108
120
 
@@ -122,9 +134,9 @@
122
134
  ### Minor Changes
123
135
 
124
136
  - 2fa8020: Update trails core package dependencies.
125
- - Also updates Chakra UI to the latest 2.x version and Chakra React Select to version 5.
126
- - Removes any obsolete references to `@chakra-ui/system`.
127
- This dependency seems to be no longer required and may lead to duplicate packages in your dependency tree.
137
+ - Also updates Chakra UI to the latest 2.x version and Chakra React Select to version 5.
138
+ - Removes any obsolete references to `@chakra-ui/system`.
139
+ This dependency seems to be no longer required and may lead to duplicate packages in your dependency tree.
128
140
 
129
141
  ### Patch Changes
130
142
 
@@ -143,7 +155,7 @@
143
155
  - 583f1d6: The `mapId` or `map` properties are now optional on individual components.
144
156
  You can use the `DefaultMapProvider` to configure an implicit default value.
145
157
 
146
- Note that configuring _neither_ a default _nor_ an explicit `map` or `mapId` will trigger a runtime error.
158
+ Note that configuring _neither_ a default _nor_ an explicit `map` or `mapId` will trigger a runtime error.
147
159
 
148
160
  - 583f1d6: All UI components in this project now accept the `mapId` (a `string`) _or_ the `map` (a `MapModel`) directly.
149
161
  - a8b3449: Switch to a new versioning strategy.
package/Legend.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Legend.js","sources":["Legend.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { Box, Icon, Image, List, Text } from \"@chakra-ui/react\";\nimport {\n AnyLayer,\n Layer,\n MapModel,\n MapModelProps,\n isLayer,\n useMapModelValue\n} from \"@open-pioneer/map\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport { useReactiveSnapshot } from \"@open-pioneer/reactivity\";\nimport { classNames } from \"@open-pioneer/react-utils\";\nimport { useIntl } from \"open-pioneer:react-hooks\";\nimport { ComponentType, FC, ReactNode, useEffect, useMemo, useState } from \"react\";\nimport { LuTriangleAlert } from \"react-icons/lu\";\n\n/**\n * Properties of a legend item React component.\n */\nexport interface LegendItemComponentProps {\n /**\n * Related layer of the legend.\n */\n layer: AnyLayer;\n}\n\n/**\n * Attributes of the legend attribute that can be specified on a layer.\n *\n * To show a legend for the layer, provide an imageUrl to an image to show\n * or provide a React component that will be rendered as a legend.\n *\n * LegendItemAttributes should be registered with a layer as the `\"legend\"` attribute.\n */\nexport interface LegendItemAttributes {\n /**\n * (Optional) URL to an image that will be shown as a legend for the layer.\n */\n imageUrl?: string;\n\n /**\n * (Optional) React component that will be shown as customized legend for the layer.\n */\n Component?: ComponentType<LegendItemComponentProps>;\n\n /**\n * (Optional) Additional property to control the display of the layer in the legend.\n */\n listMode?: ListMode;\n}\n\n/**\n * These are special properties for the Legend.\n */\nexport interface LegendProps extends CommonComponentProps, MapModelProps {\n /**\n * Specifies whether legend for active base layer is shown in the legend UI.\n * Defaults to `false`.\n */\n showBaseLayers?: boolean;\n}\n\n/**\n * ListMode determines if a layer item is displayed in the Legend for the layer.\n * The option `\"hide-children\"` provides a shortcut to hide all child layers (e.g. sublayers of group) of the layer in the Legend.\n * It has the same effect as manually setting the `listMode` to `\"hide\"` on all child layers.\n *\n * ListMode has precedence over the layer's `internal` attribute but specifically configures the layer's display in the legend.\n *\n * By default, the list mode becomes `\"hide-children\"` if a layer has an associated legend.\n */\nexport type ListMode = \"show\" | \"hide\" | \"hide-children\";\n\n/**\n * The `Legend` component can be used to display the legend of layers that are visible in the map.\n */\nexport const Legend: FC<LegendProps> = (props) => {\n const { showBaseLayers = false } = props;\n const { containerProps } = useCommonComponentProps(\"legend\", props);\n const map = useMapModelValue(props);\n\n return (\n <Box {...containerProps}>\n <LegendList map={map} showBaseLayers={showBaseLayers} />\n </Box>\n );\n};\n\nfunction LegendList(props: { map: MapModel; showBaseLayers: boolean }): ReactNode {\n const { map, showBaseLayers } = props;\n\n const layers = useLayers(map);\n const legendListItems: ReactNode[] = layers.map((layer) => {\n return (\n <LegendItem key={layer.id} layer={layer} showBaseLayers={showBaseLayers}></LegendItem>\n );\n });\n\n return (\n <List.Root\n // Note: not using UnorderedList because it adds default margins\n as=\"ul\"\n className=\"legend-layer-list\"\n listStyleType=\"none\"\n gap={2}\n >\n {legendListItems}\n </List.Root>\n );\n}\n\nfunction LegendItem(props: { layer: AnyLayer; showBaseLayers: boolean }): ReactNode {\n const { layer, showBaseLayers } = props;\n const { isVisible, isInternal } = useReactiveSnapshot(() => {\n return {\n isVisible: layer.visible,\n isInternal: layer.internal\n };\n }, [layer]);\n const childLayers = useChildLayers(layer);\n const listModeProp = useListMode(layer);\n const legendContent = useLegendContent(layer);\n const listMode = getListMode(listModeProp, isInternal, !!legendContent);\n\n if (!isVisible || listMode === \"hide\" || (!showBaseLayers && isBaseLayer(layer))) {\n return;\n }\n\n // legend items for all child layers (sublayers or layers in a group)\n let childItems: ReactNode[] = [];\n if (listMode === \"show\") {\n childItems = childLayers.map((child) => (\n <LegendItem key={child.id} layer={child} showBaseLayers={showBaseLayers} />\n ));\n }\n // listMode: hide/hide-children -> childItems stays empty\n\n return (\n <>\n <LegendContent layer={layer} content={legendContent} />\n {childItems}\n </>\n );\n}\n\nfunction LegendContent(props: { layer: AnyLayer; content: ReactNode }) {\n const intl = useIntl();\n\n const { layer, content } = props;\n const baseLayer = isBaseLayer(layer);\n return content ? (\n <Box as=\"li\" className={classNames(\"legend-item\", `layer-${slug(layer.id)}`)}>\n {baseLayer ? (\n /* Render additional text, if layer is a configured basemap */\n <Text as=\"b\">{intl.formatMessage({ id: \"basemapLabel\" })}</Text>\n ) : null}\n {content}\n </Box>\n ) : undefined;\n}\n\nfunction LegendImage(props: { imageUrl: string; layer: AnyLayer }) {\n const intl = useIntl();\n const { layer, imageUrl } = props;\n const title = useReactiveSnapshot(() => layer.title, [layer]);\n const [isError, setIsError] = useState(false);\n useEffect(() => {\n setIsError(false);\n }, [imageUrl]);\n\n const content = useMemo(() => {\n if (isError) {\n return (\n <Box>\n <Text>\n <Icon me={2}>\n <LuTriangleAlert />\n </Icon>\n {intl.formatMessage({ id: \"fallbackLabel\" })}\n </Text>\n </Box>\n );\n }\n\n return (\n <Image\n maxW=\"none\"\n maxH=\"none\"\n src={imageUrl}\n alt={intl.formatMessage({ id: \"altLabel\" }, { layerName: title })}\n className={\"legend-item__image\"}\n onError={() => setIsError(true)}\n />\n );\n }, [intl, title, imageUrl, isError]);\n\n return (\n <Box>\n <Text>{title}</Text>\n {content}\n </Box>\n );\n}\n\n/**\n * Resolves the content that would be rendered for the given layer.\n */\nfunction useLegendContent(layer: AnyLayer): ReactNode | undefined {\n const legendAttributes = useLegendAttributes(layer);\n const legendUrl = useReactiveSnapshot(() => layer.legend, [layer]);\n return useMemo(() => {\n let renderedComponent: ReactNode | undefined;\n if (legendAttributes?.Component) {\n renderedComponent = <legendAttributes.Component layer={layer} />;\n } else if (legendAttributes?.imageUrl) {\n renderedComponent = <LegendImage layer={layer} imageUrl={legendAttributes.imageUrl} />;\n } else {\n if (legendUrl) {\n renderedComponent = <LegendImage layer={layer} imageUrl={legendUrl} />;\n }\n }\n return renderedComponent;\n }, [legendUrl, legendAttributes, layer]);\n}\n\n/** Returns the top level operational layers in render order (topmost layer first). */\nfunction useLayers(map: MapModel): Layer[] {\n return useReactiveSnapshot(() => {\n const layers =\n map.layers.getLayers({\n sortByDisplayOrder: true,\n includeInternalLayers: true //internal status is handled by LegendItems\n }) ?? [];\n layers.reverse(); // render topmost layer first\n return layers;\n }, [map]);\n}\n\n/**\n * Returns the child layers (sublayers or layers belonging to a GroupLayer) of the given layer.\n * Layers are returned in render order (topmost layer first).\n */\nfunction useChildLayers(layer: AnyLayer): AnyLayer[] {\n return (\n useReactiveSnapshot(() => {\n const childLayers = layer.children?.getItems({\n includeInternalLayers: true //internal status is handled by LegendItems\n });\n if (!childLayers) {\n return undefined;\n }\n\n childLayers.reverse(); // render topmost layer first\n return childLayers;\n }, [layer]) ?? []\n );\n}\n\nfunction useLegendAttributes(layer: AnyLayer): LegendItemAttributes | undefined {\n return useReactiveSnapshot(\n () => layer.attributes.legend as LegendItemAttributes | undefined,\n [layer]\n );\n}\n\nfunction getListMode(\n listModeProp: ListMode | undefined,\n isInternal: boolean,\n hasLegendContent: boolean\n): ListMode {\n if (listModeProp) {\n return listModeProp; // Explicit value wins\n }\n if (isInternal) {\n return \"hide\";\n }\n if (hasLegendContent) {\n return \"hide-children\";\n }\n return \"show\";\n}\n\nfunction isBaseLayer(layer: AnyLayer) {\n return isLayer(layer) && layer.isBaseLayer;\n}\n\nfunction slug(id: string) {\n return id\n .toLowerCase()\n .replace(/[^a-z0-9 -]/g, \"\")\n .replace(/\\s+/g, \"-\")\n .replace(/-+/g, \"-\");\n}\n\nfunction useListMode(layer: AnyLayer): ListMode | undefined {\n return useReactiveSnapshot(\n () => (layer.attributes.legend as LegendItemAttributes | undefined)?.listMode,\n [layer]\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AA8EO,MAAM,MAAA,GAA0B,CAAC,KAAA,KAAU;AAC9C,EAAA,MAAM,EAAE,cAAA,GAAiB,KAAA,EAAM,GAAI,KAAA;AACnC,EAAA,MAAM,EAAE,cAAA,EAAe,GAAI,uBAAA,CAAwB,UAAU,KAAK,CAAA;AAClE,E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,UAAA,CAAW,MAAA,EAA6C,QAAA;AAAA,IACrE,CAAC,KAAK;AAAA,GACV;AACJ;;;;"}
1
+ {"version":3,"file":"Legend.js","sources":["Legend.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Box, Icon, Image, List, Text } from \"@chakra-ui/react\";\nimport {\n AnyLayer,\n Layer,\n MapModel,\n MapModelProps,\n isLayer,\n useMapModelValue\n} from \"@open-pioneer/map\";\nimport {\n CommonComponentProps,\n useCommonComponentProps,\n classNames\n} from \"@open-pioneer/react-utils\";\nimport { useReactiveSnapshot } from \"@open-pioneer/reactivity\";\nimport { useIntl } from \"open-pioneer:react-hooks\";\nimport { ComponentType, FC, ReactNode, useEffect, useMemo, useState } from \"react\";\nimport { LuTriangleAlert } from \"react-icons/lu\";\n\n/**\n * Properties of a legend item React component.\n */\nexport interface LegendItemComponentProps {\n /**\n * Related layer of the legend.\n */\n layer: AnyLayer;\n}\n\n/**\n * Attributes of the legend attribute that can be specified on a layer.\n *\n * To show a legend for the layer, provide an imageUrl to an image to show\n * or provide a React component that will be rendered as a legend.\n *\n * LegendItemAttributes should be registered with a layer as the `\"legend\"` attribute.\n */\nexport interface LegendItemAttributes {\n /**\n * (Optional) URL to an image that will be shown as a legend for the layer.\n */\n imageUrl?: string;\n\n /**\n * (Optional) React component that will be shown as customized legend for the layer.\n */\n Component?: ComponentType<LegendItemComponentProps>;\n\n /**\n * (Optional) Additional property to control the display of the layer in the legend.\n */\n listMode?: ListMode;\n}\n\n/**\n * These are special properties for the Legend.\n */\nexport interface LegendProps extends CommonComponentProps, MapModelProps {\n /**\n * Specifies whether legend for active base layer is shown in the legend UI.\n * Defaults to `false`.\n */\n showBaseLayers?: boolean;\n}\n\n/**\n * ListMode determines if a layer item is displayed in the Legend for the layer.\n * The option `\"hide-children\"` provides a shortcut to hide all child layers (e.g. sublayers of group) of the layer in the Legend.\n * It has the same effect as manually setting the `listMode` to `\"hide\"` on all child layers.\n *\n * ListMode has precedence over the layer's `internal` attribute but specifically configures the layer's display in the legend.\n *\n * By default, the list mode becomes `\"hide-children\"` if a layer has an associated legend.\n */\nexport type ListMode = \"show\" | \"hide\" | \"hide-children\";\n\n/**\n * The `Legend` component can be used to display the legend of layers that are visible in the map.\n */\nexport const Legend: FC<LegendProps> = (props) => {\n const { showBaseLayers = false } = props;\n const { containerProps } = useCommonComponentProps(\"legend\", props);\n const map = useMapModelValue(props);\n\n return (\n <Box {...containerProps}>\n <LegendList map={map} showBaseLayers={showBaseLayers} />\n </Box>\n );\n};\n\nfunction LegendList(props: { map: MapModel; showBaseLayers: boolean }): ReactNode {\n const { map, showBaseLayers } = props;\n\n const layers = useLayers(map);\n const legendListItems: ReactNode[] = layers.map((layer) => {\n return <LegendItem key={layer.id} layer={layer} showBaseLayers={showBaseLayers} />;\n });\n\n return (\n <List.Root\n // Note: not using UnorderedList because it adds default margins\n as=\"ul\"\n className=\"legend-layer-list\"\n listStyleType=\"none\"\n gap={2}\n >\n {legendListItems}\n </List.Root>\n );\n}\n\nfunction LegendItem(props: { layer: AnyLayer; showBaseLayers: boolean }): ReactNode {\n const { layer, showBaseLayers } = props;\n const { isVisible, isInternal } = useReactiveSnapshot(() => {\n return {\n isVisible: layer.visible,\n isInternal: layer.internal\n };\n }, [layer]);\n const childLayers = useChildLayers(layer);\n const listModeProp = useListMode(layer);\n const legendContent = useLegendContent(layer);\n const listMode = getListMode(listModeProp, isInternal, !!legendContent);\n\n if (!isVisible || listMode === \"hide\" || (!showBaseLayers && isBaseLayer(layer))) {\n return;\n }\n\n // legend items for all child layers (sublayers or layers in a group)\n let childItems: ReactNode[] = [];\n if (listMode === \"show\") {\n childItems = childLayers.map((child) => (\n <LegendItem key={child.id} layer={child} showBaseLayers={showBaseLayers} />\n ));\n }\n // listMode: hide/hide-children -> childItems stays empty\n\n return (\n <>\n <LegendContent layer={layer} content={legendContent} />\n {childItems}\n </>\n );\n}\n\nfunction LegendContent(props: { layer: AnyLayer; content: ReactNode }) {\n const intl = useIntl();\n\n const { layer, content } = props;\n const baseLayer = isBaseLayer(layer);\n return content ? (\n <Box as=\"li\" className={classNames(\"legend-item\", `layer-${slug(layer.id)}`)}>\n {baseLayer ? (\n /* Render additional text, if layer is a configured basemap */\n <Text as=\"b\">{intl.formatMessage({ id: \"basemapLabel\" })}</Text>\n ) : null}\n {content}\n </Box>\n ) : undefined;\n}\n\nfunction LegendImage(props: { imageUrl: string; layer: AnyLayer }) {\n const intl = useIntl();\n const { layer, imageUrl } = props;\n const title = useReactiveSnapshot(() => layer.title, [layer]);\n const [isError, setIsError] = useState(false);\n useEffect(() => {\n setIsError(false);\n }, [imageUrl]);\n\n const content = useMemo(() => {\n if (isError) {\n return (\n <Box>\n <Text>\n <Icon me={2}>\n <LuTriangleAlert />\n </Icon>\n {intl.formatMessage({ id: \"fallbackLabel\" })}\n </Text>\n </Box>\n );\n }\n\n return (\n <Image\n maxW=\"none\"\n maxH=\"none\"\n src={imageUrl}\n alt={intl.formatMessage({ id: \"altLabel\" }, { layerName: title })}\n className={\"legend-item__image\"}\n onError={() => setIsError(true)}\n />\n );\n }, [intl, title, imageUrl, isError]);\n\n return (\n <Box>\n <Text>{title}</Text>\n {content}\n </Box>\n );\n}\n\n/**\n * Resolves the content that would be rendered for the given layer.\n */\nfunction useLegendContent(layer: AnyLayer): ReactNode | undefined {\n const legendAttributes = useLegendAttributes(layer);\n const legendUrl = useReactiveSnapshot(() => layer.legend, [layer]);\n return useMemo(() => {\n let renderedComponent: ReactNode | undefined;\n if (legendAttributes?.Component) {\n renderedComponent = <legendAttributes.Component layer={layer} />;\n } else if (legendAttributes?.imageUrl) {\n renderedComponent = <LegendImage layer={layer} imageUrl={legendAttributes.imageUrl} />;\n } else {\n if (legendUrl) {\n renderedComponent = <LegendImage layer={layer} imageUrl={legendUrl} />;\n }\n }\n return renderedComponent;\n }, [legendUrl, legendAttributes, layer]);\n}\n\n/** Returns the top level operational layers in render order (topmost layer first). */\nfunction useLayers(map: MapModel): Layer[] {\n return useReactiveSnapshot(() => {\n const layers =\n map.layers.getLayers({\n sortByDisplayOrder: true,\n includeInternalLayers: true //internal status is handled by LegendItems\n }) ?? [];\n layers.reverse(); // render topmost layer first\n return layers;\n }, [map]);\n}\n\n/**\n * Returns the child layers (sublayers or layers belonging to a GroupLayer) of the given layer.\n * Layers are returned in render order (topmost layer first).\n */\nfunction useChildLayers(layer: AnyLayer): AnyLayer[] {\n return (\n useReactiveSnapshot(() => {\n const childLayers = layer.children?.getItems({\n includeInternalLayers: true //internal status is handled by LegendItems\n });\n if (!childLayers) {\n return undefined;\n }\n\n childLayers.reverse(); // render topmost layer first\n return childLayers;\n }, [layer]) ?? []\n );\n}\n\nfunction useLegendAttributes(layer: AnyLayer): LegendItemAttributes | undefined {\n return useReactiveSnapshot(\n () => layer.attributes.legend as LegendItemAttributes | undefined,\n [layer]\n );\n}\n\nfunction getListMode(\n listModeProp: ListMode | undefined,\n isInternal: boolean,\n hasLegendContent: boolean\n): ListMode {\n if (listModeProp) {\n return listModeProp; // Explicit value wins\n }\n if (isInternal) {\n return \"hide\";\n }\n if (hasLegendContent) {\n return \"hide-children\";\n }\n return \"show\";\n}\n\nfunction isBaseLayer(layer: AnyLayer) {\n return isLayer(layer) && layer.isBaseLayer;\n}\n\nfunction slug(id: string) {\n return id\n .toLowerCase()\n .replace(/[^a-z0-9 -]/g, \"\")\n .replace(/\\s+/g, \"-\")\n .replace(/-+/g, \"-\");\n}\n\nfunction useListMode(layer: AnyLayer): ListMode | undefined {\n return useReactiveSnapshot(\n () => (layer.attributes.legend as LegendItemAttributes | undefined)?.listMode,\n [layer]\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAkFO,MAAM,MAAA,GAA0B,CAAC,KAAA,KAAU;AAC9C,EAAA,MAAM,EAAE,cAAA,GAAiB,KAAA,EAAM,GAAI,KAAA;AACnC,EAAA,MAAM,EAAE,cAAA,EAAe,GA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A,OAAO,mBAAA;AAAA,IACH,MAAO,KAAA,CAAM,UAAA,CAAW,MAAA,EAA6C,QAAA;AAAA,IACrE,CAAC,KAAK;AAAA,GACV;AACJ;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@open-pioneer/legend",
4
- "version": "1.4.0-dev.20260727093741",
4
+ "version": "1.5.0-dev.20260910103330",
5
5
  "description": "This package provides a legend UI component that allows a user to see legend information for layers in the map.",
6
6
  "keywords": [
7
7
  "open-pioneer-trails"
@@ -14,14 +14,18 @@
14
14
  "directory": "src/packages/legend"
15
15
  },
16
16
  "dependencies": {
17
- "@chakra-ui/react": "^3.36.1",
18
- "@open-pioneer/react-utils": "4.7.0-dev.20260727091735",
19
- "@open-pioneer/runtime": "4.7.0-dev.20260727091735",
20
- "ol": "^10.9.0",
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
+ "ol": "^10.10.0",
21
23
  "react": "^19.2.8",
22
- "@open-pioneer/reactivity": "4.7.0-dev.20260727091735",
23
- "react-icons": "^5.7.0",
24
- "@open-pioneer/map": "1.4.0-dev.20260727093741"
24
+ "react-icons": "^5.7.0"
25
+ },
26
+ "publishConfig": {
27
+ "directory": "dist",
28
+ "linkDirectory": false
25
29
  },
26
30
  "exports": {
27
31
  "./package.json": "./package.json",