@open-pioneer/toc 1.5.0-dev.20260917081843 → 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 +73 -72
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# @open-pioneer/toc
|
|
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
|
|
|
@@ -64,39 +65,39 @@
|
|
|
64
65
|
|
|
65
66
|
- 2702df4: Layers that are marked as `internal` are not considered by the Toc.
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
68
|
+
```typescript
|
|
69
|
+
//internal layer will not be displayed in the Toc
|
|
70
|
+
const internalLayer = new SimpleLayer({
|
|
71
|
+
id: "layer1",
|
|
72
|
+
title: "layer 1",
|
|
73
|
+
olLayer: myOlLayer,
|
|
74
|
+
internal: true
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The layer's `internal` state also affects other UI widgets (e.g. Legend). If the layer should be hidden specifically in the toc (but not in other widgets) the `listMode` attribute can be used to hide the layer item.
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
//use listMode to hide the layer specifically in Toc
|
|
82
|
+
const hiddenLayer = new SimpleLayer({
|
|
83
|
+
id: "layer1",
|
|
84
|
+
title: "layer 1",
|
|
85
|
+
olLayer: myOlLayer,
|
|
86
|
+
attributes: {
|
|
87
|
+
toc: {
|
|
88
|
+
listMode: "hide"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Valid values for `listMode` are:
|
|
95
|
+
|
|
96
|
+
- `"show"` layer item is displayed in Toc
|
|
97
|
+
- `"hide"` layer item is not rendered in Toc
|
|
98
|
+
- `"hide-children"` layer item for the layer itself is displayed in Toc but no layer items for child layers (e.g. sublayers of a group) are rendered
|
|
99
|
+
|
|
100
|
+
The `listMode` does always have precedence over the layer's `internal` property. For example, if the `listMode` is `"show"` the layer item is displayed even if `internal` is `true`.
|
|
100
101
|
|
|
101
102
|
- cb5368f: Introduce Toc API for programmatic control of toc items, see [PR](https://github.com/open-pioneer/trails-openlayers-base-packages/pull/420).
|
|
102
103
|
- 2732052: Icons have been changed to unify the appearance of the components. Preferably, Lucide react-icons are used.
|
|
@@ -121,16 +122,16 @@
|
|
|
121
122
|
|
|
122
123
|
- 9376a74: Ensure that icons and other decorative elements are hidden from the screen reader using the `aria-hidden="true"` attribute.
|
|
123
124
|
|
|
124
|
-
|
|
125
|
+
The easiest way to do that is to wrap icons into chakra's `<Icon />` component, for example:
|
|
125
126
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
```tsx
|
|
128
|
+
import { Icon } from "@chakra-ui/react";
|
|
129
|
+
import { FiX } from "react-icons/fi";
|
|
129
130
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
<Icon>
|
|
132
|
+
<FiX />
|
|
133
|
+
</Icon>;
|
|
134
|
+
```
|
|
134
135
|
|
|
135
136
|
- e00186b: Add a tooltip around the menu trigger buttons (map tools and layer tools).
|
|
136
137
|
|
|
@@ -141,17 +142,17 @@
|
|
|
141
142
|
- 193068a: Deprecate the `mapId` property on React components.
|
|
142
143
|
Use the `MapModel` directly instead to pass a reference to the map.
|
|
143
144
|
|
|
144
|
-
|
|
145
|
+
Example:
|
|
145
146
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
147
|
+
```tsx
|
|
148
|
+
// Default map for entire component tree
|
|
149
|
+
<DefaultMapProvider map={mapModel}>
|
|
150
|
+
<Toc />
|
|
151
|
+
</DefaultMapProvider>
|
|
151
152
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
// Map for specific component
|
|
154
|
+
<Toc map={mapModel} />
|
|
155
|
+
```
|
|
155
156
|
|
|
156
157
|
### Patch Changes
|
|
157
158
|
|
|
@@ -169,20 +170,20 @@
|
|
|
169
170
|
If the property `initiallyCollapsed` is `true` all groups are collapsed by default when the TOC is rendered.
|
|
170
171
|
This is helpful if the app has a large layer tree.
|
|
171
172
|
|
|
172
|
-
|
|
173
|
-
|
|
173
|
+
Additionally, a menu item to collapse all groups can be added to the tools section by setting `toolsConfig.showCollapseAllGroups` to `true` (default is `true`).
|
|
174
|
+
This is only applicable if `collapsibleGroups` and `showTools` are both `true`.
|
|
174
175
|
|
|
175
|
-
|
|
176
|
-
|
|
176
|
+
```jsx
|
|
177
|
+
import { Toc } from "@open-pioneer/toc";
|
|
177
178
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
179
|
+
<Toc
|
|
180
|
+
mapId={MAP_ID}
|
|
181
|
+
showTools={true}
|
|
182
|
+
collapsibleGroups={true} //groups are collapsible in TOC
|
|
183
|
+
initiallyCollapsed={true} //groups are collapsed initially
|
|
184
|
+
toolsConfig={{ showCollapseAllGroups: true }} //show 'collapse all' menu item in Tools
|
|
185
|
+
/>;
|
|
186
|
+
```
|
|
186
187
|
|
|
187
188
|
## 0.8.0
|
|
188
189
|
|
|
@@ -190,18 +191,18 @@
|
|
|
190
191
|
|
|
191
192
|
- 2fa8020: Update trails core package dependencies.
|
|
192
193
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
- Also updates Chakra UI to the latest 2.x version and Chakra React Select to version 5.
|
|
195
|
+
- Removes any obsolete references to `@chakra-ui/system`.
|
|
196
|
+
This dependency seems to be no longer required and may lead to duplicate packages in your dependency tree.
|
|
196
197
|
|
|
197
198
|
- 7ae9f90: When showing a layer via the toc, all parent layers of that layer will also be made visible.
|
|
198
199
|
|
|
199
|
-
|
|
200
|
+
This can be disabled by configuring `autoShowParents={false}` on the `TOC` component.
|
|
200
201
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
```jsx
|
|
203
|
+
// Default: true
|
|
204
|
+
<Toc autoShowParents={false} />
|
|
205
|
+
```
|
|
205
206
|
|
|
206
207
|
### Patch Changes
|
|
207
208
|
|
|
@@ -222,7 +223,7 @@
|
|
|
222
223
|
- 583f1d6: The `mapId` or `map` properties are now optional on individual components.
|
|
223
224
|
You can use the `DefaultMapProvider` to configure an implicit default value.
|
|
224
225
|
|
|
225
|
-
|
|
226
|
+
Note that configuring _neither_ a default _nor_ an explicit `map` or `mapId` will trigger a runtime error.
|
|
226
227
|
|
|
227
228
|
- 583f1d6: All UI components in this project now accept the `mapId` (a `string`) _or_ the `map` (a `MapModel`) directly.
|
|
228
229
|
- a8b3449: Switch to a new versioning strategy.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@open-pioneer/toc",
|
|
4
|
-
"version": "1.5.0
|
|
4
|
+
"version": "1.5.0",
|
|
5
5
|
"description": "This package provides a UI component that displays the map content to the user and allows them to control it.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"open-pioneer-trails"
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@chakra-ui/react": "^3.37.0",
|
|
18
18
|
"@conterra/reactivity-core": "^0.8.8",
|
|
19
|
-
"@open-pioneer/basemap-switcher": "1.5.0
|
|
20
|
-
"@open-pioneer/chakra-snippets": "4.8.0
|
|
21
|
-
"@open-pioneer/core": "4.8.0
|
|
22
|
-
"@open-pioneer/map": "1.5.0
|
|
23
|
-
"@open-pioneer/react-utils": "4.8.0
|
|
24
|
-
"@open-pioneer/reactivity": "4.8.0
|
|
25
|
-
"@open-pioneer/runtime": "4.8.0
|
|
19
|
+
"@open-pioneer/basemap-switcher": "1.5.0",
|
|
20
|
+
"@open-pioneer/chakra-snippets": "^4.8.0",
|
|
21
|
+
"@open-pioneer/core": "^4.8.0",
|
|
22
|
+
"@open-pioneer/map": "1.5.0",
|
|
23
|
+
"@open-pioneer/react-utils": "^4.8.0",
|
|
24
|
+
"@open-pioneer/reactivity": "^4.8.0",
|
|
25
|
+
"@open-pioneer/runtime": "^4.8.0",
|
|
26
26
|
"ol": "^10.10.0",
|
|
27
27
|
"react": "^19.3.0",
|
|
28
28
|
"react-icons": "^5.7.0"
|