@itwin/presentation-hierarchies-react 2.0.0-alpha.6 → 2.0.0-alpha.61

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.
Files changed (163) hide show
  1. package/CHANGELOG.md +1151 -11
  2. package/README.md +93 -160
  3. package/lib/presentation-hierarchies-react/FlatTreeNode.d.ts +49 -0
  4. package/lib/presentation-hierarchies-react/FlatTreeNode.d.ts.map +1 -0
  5. package/lib/presentation-hierarchies-react/FlatTreeNode.js +96 -0
  6. package/lib/presentation-hierarchies-react/FlatTreeNode.js.map +1 -0
  7. package/lib/presentation-hierarchies-react/LocalizationContext.d.ts +24 -0
  8. package/lib/presentation-hierarchies-react/LocalizationContext.d.ts.map +1 -0
  9. package/lib/presentation-hierarchies-react/LocalizationContext.js +40 -0
  10. package/lib/presentation-hierarchies-react/LocalizationContext.js.map +1 -0
  11. package/lib/presentation-hierarchies-react/Renderers.d.ts +92 -0
  12. package/lib/presentation-hierarchies-react/Renderers.d.ts.map +1 -0
  13. package/lib/presentation-hierarchies-react/TreeNode.d.ts +80 -0
  14. package/lib/presentation-hierarchies-react/TreeNode.d.ts.map +1 -0
  15. package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/UseIModelTree.d.ts +28 -15
  16. package/lib/presentation-hierarchies-react/UseIModelTree.d.ts.map +1 -0
  17. package/lib/presentation-hierarchies-react/UseIModelTree.js +183 -0
  18. package/lib/presentation-hierarchies-react/UseIModelTree.js.map +1 -0
  19. package/lib/presentation-hierarchies-react/UseNodeHighlighting.d.ts +30 -0
  20. package/lib/presentation-hierarchies-react/UseNodeHighlighting.d.ts.map +1 -0
  21. package/lib/presentation-hierarchies-react/UseNodeHighlighting.js +57 -0
  22. package/lib/presentation-hierarchies-react/UseNodeHighlighting.js.map +1 -0
  23. package/lib/presentation-hierarchies-react/UseSelectionHandler.d.ts +23 -0
  24. package/lib/presentation-hierarchies-react/UseSelectionHandler.d.ts.map +1 -0
  25. package/lib/presentation-hierarchies-react/UseSelectionHandler.js +124 -0
  26. package/lib/presentation-hierarchies-react/UseSelectionHandler.js.map +1 -0
  27. package/lib/presentation-hierarchies-react/UseTree.d.ts +112 -0
  28. package/lib/presentation-hierarchies-react/UseTree.d.ts.map +1 -0
  29. package/lib/presentation-hierarchies-react/UseTree.js +298 -0
  30. package/lib/presentation-hierarchies-react/UseTree.js.map +1 -0
  31. package/lib/presentation-hierarchies-react/Utils.js +56 -0
  32. package/lib/presentation-hierarchies-react/Utils.js.map +1 -0
  33. package/lib/presentation-hierarchies-react/internal/DisposePolyfill.js +10 -0
  34. package/lib/presentation-hierarchies-react/internal/DisposePolyfill.js.map +1 -0
  35. package/lib/presentation-hierarchies-react/internal/LocalizedStrings.d.ts +9 -0
  36. package/lib/presentation-hierarchies-react/internal/LocalizedStrings.d.ts.map +1 -0
  37. package/lib/presentation-hierarchies-react/internal/LocalizedStrings.js +12 -0
  38. package/lib/presentation-hierarchies-react/internal/LocalizedStrings.js.map +1 -0
  39. package/lib/presentation-hierarchies-react/internal/TreeActions.js +294 -0
  40. package/lib/presentation-hierarchies-react/internal/TreeActions.js.map +1 -0
  41. package/lib/presentation-hierarchies-react/internal/TreeLoader.js +98 -0
  42. package/lib/presentation-hierarchies-react/internal/TreeLoader.js.map +1 -0
  43. package/lib/presentation-hierarchies-react/internal/TreeModel.d.ts +1 -0
  44. package/lib/presentation-hierarchies-react/internal/TreeModel.js +115 -0
  45. package/lib/presentation-hierarchies-react/internal/TreeModel.js.map +1 -0
  46. package/lib/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts +35 -0
  47. package/lib/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts.map +1 -0
  48. package/lib/presentation-hierarchies-react/internal/UseUnifiedSelection.js +141 -0
  49. package/lib/presentation-hierarchies-react/internal/UseUnifiedSelection.js.map +1 -0
  50. package/lib/presentation-hierarchies-react/internal/Utils.js +42 -0
  51. package/lib/presentation-hierarchies-react/internal/Utils.js.map +1 -0
  52. package/lib/presentation-hierarchies-react/stratakit/ErrorItemRenderer.d.ts +40 -0
  53. package/lib/presentation-hierarchies-react/stratakit/ErrorItemRenderer.d.ts.map +1 -0
  54. package/lib/presentation-hierarchies-react/stratakit/ErrorItemRenderer.js +387 -0
  55. package/lib/presentation-hierarchies-react/stratakit/ErrorItemRenderer.js.map +1 -0
  56. package/lib/presentation-hierarchies-react/stratakit/RootErrorRenderer.d.ts +21 -0
  57. package/lib/presentation-hierarchies-react/stratakit/RootErrorRenderer.d.ts.map +1 -0
  58. package/lib/presentation-hierarchies-react/stratakit/RootErrorRenderer.js +185 -0
  59. package/lib/presentation-hierarchies-react/stratakit/RootErrorRenderer.js.map +1 -0
  60. package/lib/presentation-hierarchies-react/stratakit/TreeAction.d.ts +49 -0
  61. package/lib/presentation-hierarchies-react/stratakit/TreeAction.d.ts.map +1 -0
  62. package/lib/presentation-hierarchies-react/stratakit/TreeAction.js +88 -0
  63. package/lib/presentation-hierarchies-react/stratakit/TreeAction.js.map +1 -0
  64. package/lib/presentation-hierarchies-react/stratakit/TreeErrorRenderer.d.ts +38 -0
  65. package/lib/presentation-hierarchies-react/stratakit/TreeErrorRenderer.d.ts.map +1 -0
  66. package/lib/presentation-hierarchies-react/stratakit/TreeErrorRenderer.js +77 -0
  67. package/lib/presentation-hierarchies-react/stratakit/TreeErrorRenderer.js.map +1 -0
  68. package/lib/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.d.ts +29 -0
  69. package/lib/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.d.ts.map +1 -0
  70. package/lib/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.js +91 -0
  71. package/lib/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.js.map +1 -0
  72. package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts +31 -0
  73. package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts.map +1 -0
  74. package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.js +155 -0
  75. package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.js.map +1 -0
  76. package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.css +25 -0
  77. package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts +14 -0
  78. package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts.map +1 -0
  79. package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.js +540 -0
  80. package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.js.map +1 -0
  81. package/lib/presentation-hierarchies-react/stratakit/TreeRenderer.d.ts +75 -0
  82. package/lib/presentation-hierarchies-react/stratakit/TreeRenderer.d.ts.map +1 -0
  83. package/lib/presentation-hierarchies-react/stratakit/TreeRenderer.js +417 -0
  84. package/lib/presentation-hierarchies-react/stratakit/TreeRenderer.js.map +1 -0
  85. package/lib/presentation-hierarchies-react-extract.d.ts +17 -0
  86. package/lib/presentation-hierarchies-react-extract.js +16 -0
  87. package/lib/presentation-hierarchies-react-stratakit.d.ts +8 -0
  88. package/lib/presentation-hierarchies-react-stratakit.js +8 -0
  89. package/lib/presentation-hierarchies-react.d.ts +11 -0
  90. package/lib/presentation-hierarchies-react.js +8 -0
  91. package/lib/public/locales/en/PresentationHierarchies_1.0.json +26 -0
  92. package/package.json +78 -56
  93. package/lib/esm/presentation-hierarchies-react/TreeNode.d.ts +0 -75
  94. package/lib/esm/presentation-hierarchies-react/TreeNode.d.ts.map +0 -1
  95. package/lib/esm/presentation-hierarchies-react/TreeNode.js +0 -12
  96. package/lib/esm/presentation-hierarchies-react/TreeNode.js.map +0 -1
  97. package/lib/esm/presentation-hierarchies-react/UnifiedSelectionContext.d.ts +0 -15
  98. package/lib/esm/presentation-hierarchies-react/UnifiedSelectionContext.d.ts.map +0 -1
  99. package/lib/esm/presentation-hierarchies-react/UnifiedSelectionContext.js +0 -22
  100. package/lib/esm/presentation-hierarchies-react/UnifiedSelectionContext.js.map +0 -1
  101. package/lib/esm/presentation-hierarchies-react/UseIModelTree.d.ts.map +0 -1
  102. package/lib/esm/presentation-hierarchies-react/UseIModelTree.js +0 -62
  103. package/lib/esm/presentation-hierarchies-react/UseIModelTree.js.map +0 -1
  104. package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.d.ts +0 -46
  105. package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.d.ts.map +0 -1
  106. package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.js +0 -98
  107. package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.js.map +0 -1
  108. package/lib/esm/presentation-hierarchies-react/UseTree.d.ts +0 -132
  109. package/lib/esm/presentation-hierarchies-react/UseTree.d.ts.map +0 -1
  110. package/lib/esm/presentation-hierarchies-react/UseTree.js +0 -242
  111. package/lib/esm/presentation-hierarchies-react/UseTree.js.map +0 -1
  112. package/lib/esm/presentation-hierarchies-react/internal/DisposePolyfill.d.ts +0 -2
  113. package/lib/esm/presentation-hierarchies-react/internal/DisposePolyfill.d.ts.map +0 -1
  114. package/lib/esm/presentation-hierarchies-react/internal/DisposePolyfill.js +0 -11
  115. package/lib/esm/presentation-hierarchies-react/internal/DisposePolyfill.js.map +0 -1
  116. package/lib/esm/presentation-hierarchies-react/internal/TreeActions.d.ts +0 -53
  117. package/lib/esm/presentation-hierarchies-react/internal/TreeActions.d.ts.map +0 -1
  118. package/lib/esm/presentation-hierarchies-react/internal/TreeActions.js +0 -307
  119. package/lib/esm/presentation-hierarchies-react/internal/TreeActions.js.map +0 -1
  120. package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.d.ts +0 -44
  121. package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.d.ts.map +0 -1
  122. package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.js +0 -94
  123. package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.js.map +0 -1
  124. package/lib/esm/presentation-hierarchies-react/internal/TreeModel.d.ts +0 -70
  125. package/lib/esm/presentation-hierarchies-react/internal/TreeModel.d.ts.map +0 -1
  126. package/lib/esm/presentation-hierarchies-react/internal/TreeModel.js +0 -153
  127. package/lib/esm/presentation-hierarchies-react/internal/TreeModel.js.map +0 -1
  128. package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts +0 -28
  129. package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts.map +0 -1
  130. package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.js +0 -128
  131. package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.js.map +0 -1
  132. package/lib/esm/presentation-hierarchies-react/internal/Utils.d.ts +0 -23
  133. package/lib/esm/presentation-hierarchies-react/internal/Utils.d.ts.map +0 -1
  134. package/lib/esm/presentation-hierarchies-react/internal/Utils.js +0 -58
  135. package/lib/esm/presentation-hierarchies-react/internal/Utils.js.map +0 -1
  136. package/lib/esm/presentation-hierarchies-react/itwinui/FlatTreeNode.d.ts +0 -21
  137. package/lib/esm/presentation-hierarchies-react/itwinui/FlatTreeNode.d.ts.map +0 -1
  138. package/lib/esm/presentation-hierarchies-react/itwinui/FlatTreeNode.js +0 -30
  139. package/lib/esm/presentation-hierarchies-react/itwinui/FlatTreeNode.js.map +0 -1
  140. package/lib/esm/presentation-hierarchies-react/itwinui/LocalizationContext.d.ts +0 -73
  141. package/lib/esm/presentation-hierarchies-react/itwinui/LocalizationContext.d.ts.map +0 -1
  142. package/lib/esm/presentation-hierarchies-react/itwinui/LocalizationContext.js +0 -34
  143. package/lib/esm/presentation-hierarchies-react/itwinui/LocalizationContext.js.map +0 -1
  144. package/lib/esm/presentation-hierarchies-react/itwinui/TreeActionButton.d.ts +0 -25
  145. package/lib/esm/presentation-hierarchies-react/itwinui/TreeActionButton.d.ts.map +0 -1
  146. package/lib/esm/presentation-hierarchies-react/itwinui/TreeActionButton.js +0 -40
  147. package/lib/esm/presentation-hierarchies-react/itwinui/TreeActionButton.js.map +0 -1
  148. package/lib/esm/presentation-hierarchies-react/itwinui/TreeErrorRenderer.d.ts +0 -23
  149. package/lib/esm/presentation-hierarchies-react/itwinui/TreeErrorRenderer.d.ts.map +0 -1
  150. package/lib/esm/presentation-hierarchies-react/itwinui/TreeErrorRenderer.js +0 -72
  151. package/lib/esm/presentation-hierarchies-react/itwinui/TreeErrorRenderer.js.map +0 -1
  152. package/lib/esm/presentation-hierarchies-react/itwinui/TreeNodeRenderer.d.ts +0 -40
  153. package/lib/esm/presentation-hierarchies-react/itwinui/TreeNodeRenderer.d.ts.map +0 -1
  154. package/lib/esm/presentation-hierarchies-react/itwinui/TreeNodeRenderer.js +0 -80
  155. package/lib/esm/presentation-hierarchies-react/itwinui/TreeNodeRenderer.js.map +0 -1
  156. package/lib/esm/presentation-hierarchies-react/itwinui/TreeRenderer.d.ts +0 -30
  157. package/lib/esm/presentation-hierarchies-react/itwinui/TreeRenderer.d.ts.map +0 -1
  158. package/lib/esm/presentation-hierarchies-react/itwinui/TreeRenderer.js +0 -48
  159. package/lib/esm/presentation-hierarchies-react/itwinui/TreeRenderer.js.map +0 -1
  160. package/lib/esm/presentation-hierarchies-react.d.ts +0 -13
  161. package/lib/esm/presentation-hierarchies-react.d.ts.map +0 -1
  162. package/lib/esm/presentation-hierarchies-react.js +0 -16
  163. package/lib/esm/presentation-hierarchies-react.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,900 @@
1
1
  # @itwin/presentation-hierarchies-react
2
2
 
3
+ ## 2.0.0-alpha.61
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1267](https://github.com/iTwin/presentation/pull/1267): `TreeNode` now supports multiple errors via `errors: ErrorInfo[]`, allowing both internal errors and custom errors provided through `getTreeNodeErrors` to be combined and displayed.
8
+
9
+ **Breaking changes:**
10
+
11
+ - `TreeNode.error?: ErrorInfo` replaced by `TreeNode.errors: ErrorInfo[]`.
12
+ - `UseTreeProps.getTreeNodeError` renamed to `getTreeNodeErrors` and now returns `ErrorInfo[]` instead of `ErrorInfo | undefined`.
13
+ - `ErrorItemRendererProps` now provides `treeNode` without `errors` and `error` instead of `errorNode`.
14
+ - `TreeErrorRenderer`'s `renderError` callback is now called once per error (instead of once per node), receiving the updated `ErrorItemRendererProps`.
15
+ - `scrollToNode` callback in `ErrorItemRendererProps` now receives `Omit<TreeNode, "errors">` instead of `TreeNode`.
16
+
17
+ ## 2.0.0-alpha.60
18
+
19
+ ### Minor Changes
20
+
21
+ - ce317097cb094c1c0eb15b66f7560dd54ad7893b: Updated optional `@stratakit/*` peer dependencies to their latest versions (`@stratakit/foundations@0.4.7`, `@stratakit/icons@0.3.1`, `@stratakit/structures@0.5.6`).
22
+
23
+ ## 2.0.0-alpha.59
24
+
25
+ ### Major Changes
26
+
27
+ - [#1259](https://github.com/iTwin/presentation/pull/1259): Introduce separate import path for StrataKit based components. StrataKit based components have to be imported through `@itwin/presentation-hierarchies-react/stratakit`. This allows to use this package with or without StrataKit dependencies.
28
+
29
+ ### Patch Changes
30
+
31
+ - [#1256](https://github.com/iTwin/presentation/pull/1256): Fix `alpha` dependencies being specified with a range (`^`), allowing package manager to use higher versions, possibly with breaking changes.
32
+ - Updated dependencies:
33
+ - @itwin/presentation-hierarchies@2.0.0-alpha.14
34
+
35
+ ## 2.0.0-alpha.58
36
+
37
+ ### Major Changes
38
+
39
+ - [#1236](https://github.com/iTwin/presentation/pull/1236): Start using tree structure for defining hierarchy search paths.
40
+
41
+ The expected return type of `useTree` hooks' `getSearchPaths` callback prop has changed from `Promise<HierarchySearchPath[] | undefined>` to `Promise<HierarchySearchTree[] | undefined>`. The newly added `HierarchySearchTree.createFromPathsList` from `@itwin/presentation-hierarchies` can be used to do the conversion:`
42
+
43
+ ```tsx
44
+ import { HierarchySearchTree } from "@itwin/presentation-hierarchies";
45
+
46
+ function MyTree() {
47
+ const [searchText, setSearchText] = useState("");
48
+ const treeProps = useIModelUnifiedSelectionTree({
49
+ // ...
50
+ getSearchPaths: useMemo<UseIModelTreeProps["getSearchPaths"]>(() => {
51
+ return async () => {
52
+ // before
53
+ return getSearchTargetPaths({ searchText }),
54
+ // after
55
+ return HierarchySearchTree.createFromPathsList(await getSearchTargetPaths({ searchText }));
56
+ };
57
+ }, [searchText]),
58
+ });
59
+
60
+ // ...
61
+
62
+ return (
63
+ <StrataKitTreeRenderer
64
+ {...treeProps.treeRendererProps}
65
+ // ...
66
+ />
67
+ );
68
+ }
69
+ ```
70
+
71
+ ### Patch Changes
72
+
73
+ - Updated dependencies:
74
+ - @itwin/unified-selection@1.6.9-alpha.0
75
+ - @itwin/presentation-hierarchies@2.0.0-alpha.13
76
+ - @itwin/presentation-shared@2.0.0-alpha.9
77
+
78
+ ## 2.0.0-alpha.57
79
+
80
+ ### Patch Changes
81
+
82
+ - [#1238](https://github.com/iTwin/presentation/pull/1238): Fix root nodes with errors not being counted when collapsed
83
+
84
+ ## 2.0.0-alpha.56
85
+
86
+ ### Minor Changes
87
+
88
+ - [#1230](https://github.com/iTwin/presentation/pull/1230): Added `isNodeExpandable` property to `GenericErrorInfo`, allowing nodes with generic errors to remain expandable.
89
+
90
+ ## 2.0.0-alpha.55
91
+
92
+ ### Major Changes
93
+
94
+ - [#1223](https://github.com/iTwin/presentation/pull/1223): Reworked `localization` to use `i18next`-compatible approach. Instead of passing a `localizedStrings` object into `LocalizationContextProvider`, the package now delivers an English locale JSON file and resolves strings through a `getLocalizedString` function at runtime.
95
+
96
+ **Breaking changes**
97
+
98
+ - `LocalizationContextProvider` no longer accepts a `localizedStrings` object. It now requires a `localization` prop — an object with a `getLocalizedString(key: string): string` method (compatible with `Localization` from @itwin/core-common).
99
+ - `LOCALIZATION_NAMESPACES` must be registered with your localization provider during app initialization to make localized strings available.
100
+
101
+ ### Minor Changes
102
+
103
+ - [#1221](https://github.com/iTwin/presentation/pull/1221): Add `getTreeNodeError` callback prop to `useTree` hook and its derivatives, providing a way to set custom errors on tree nodes.
104
+
105
+ ### Patch Changes
106
+
107
+ - [#1219](https://github.com/iTwin/presentation/pull/1219): Fix component documentation mentioning iTwinUI
108
+ - Updated dependencies:
109
+ - @itwin/presentation-shared@2.0.0-alpha.8
110
+ - @itwin/presentation-hierarchies@2.0.0-alpha.12
111
+ - @itwin/unified-selection@1.6.8-alpha.0
112
+
113
+ ## 2.0.0-alpha.54
114
+
115
+ ### Patch Changes
116
+
117
+ - [#1198](https://github.com/iTwin/presentation/pull/1198): Change `HierarchyProvider.hierarchyChanged` argument to be required.
118
+
119
+ This simplifies the API for users of `HierarchyProvider`, as they no longer need to check for `undefined` when handling hierarchy changes.
120
+
121
+ For implementors of custom `HierarchyProvider`, this change means that they must always provide an even argument when raising the `hierarchyChanged` event. Since all members of the argument type are optional, it's okay to raise the even with an empty object, e.g.: `this.hierarchyChanged.raiseEvent({})`.
122
+
123
+ - [#1200](https://github.com/iTwin/presentation/pull/1200): Removed unnecessary, always-truthy condition checks.
124
+ - [#1193](https://github.com/iTwin/presentation/pull/1193): Process package output with [React Compiler](https://react.dev/reference/react-compiler/compiling-libraries).
125
+ - Updated dependencies:
126
+ - @itwin/presentation-shared@2.0.0-alpha.7
127
+ - @itwin/presentation-hierarchies@2.0.0-alpha.11
128
+
129
+ ## 2.0.0-alpha.53
130
+
131
+ ### Patch Changes
132
+
133
+ - [#1192](https://github.com/iTwin/presentation/pull/1192): Fix situations where expander was rendered for leaf nodes.
134
+ - [#1196](https://github.com/iTwin/presentation/pull/1196): Added accessible name for tree node rename input.
135
+
136
+ ## 2.0.0-alpha.52
137
+
138
+ ### Patch Changes
139
+
140
+ - [#1187](https://github.com/iTwin/presentation/pull/1187): Fixed tree node rename committed with keyboard activating previously focused element.
141
+
142
+ ## 2.0.0-alpha.51
143
+
144
+ ### Major Changes
145
+
146
+ - [#1185](https://github.com/iTwin/presentation/pull/1185): Bumped peer dependencies:
147
+ - `@stratakit/bricks`: `^0.5.4`
148
+ - `@stratakit/foundations`: `^0.4.5`
149
+ - `@stratakit/icons`: `^0.2.2`
150
+ - `@stratakit/structures`: `^0.5.4`
151
+
152
+ ## 2.0.0-alpha.50
153
+
154
+ ### Major Changes
155
+
156
+ - [#1184](https://github.com/iTwin/presentation/pull/1184): Fixed selection handling in `StrataKitTreeRenderer`. Mouse double clicks are now correctly ignored to prevent rapid selection toggling. Keyboard selection using `Space` and `Enter` keys is working.
157
+
158
+ **Breaking changes**
159
+
160
+ - `useSelectionHandler` is no longer exported. This function is an internal implementation detail of `StrataKitTreeRenderer` and should not be used directly.
161
+
162
+ - [#1181](https://github.com/iTwin/presentation/pull/1181): **Breaking change:** Rename `PresentationHierarchyNode` to `TreeNode` for clarity.
163
+
164
+ We already have a `HierarchyNode` type in `@itwin/presentation-hierarchies`, so having a `PresentationHierarchyNode` in `@itwin/presentation-hierarchies-react` was causing confusion. Additionally, this change aligns with the naming convention that we try to keep, where "hierarchy" refers to data and "tree" refers to UI components.
165
+
166
+ - [#1183](https://github.com/iTwin/presentation/pull/1183): Clean up `TreeErrorRenderer` and `ErrorItemRenderer`.
167
+
168
+ **Breaking changes:**
169
+
170
+ - Replaced `useErrorList` hook with `useErrorNodes` hook that returns error nodes (`TreeNode[]`) instead of error items. The `expandTo` function became unnecessary, because expanding to error nodes is now handled internally. As a result, the whole `ErrorItem` type (result of `useErrorList`) was removed. Reacting to this, the following other breaking changes were made:
171
+ - Renamed `errorItem` -> `errorNode` in `ErrorItemRenderer` component and changed the type from removed `ErrorItem` to `TreeNode`.
172
+ - Renamed `errorList` -> `errorNodes` in `TreeErrorRenderer` component and changed the type from `ErrorItem[]` to `TreeNode[]`.
173
+ - The `reloadTree` function prop in `ErrorItemRenderer` and `TreeErrorRenderer` components no longer takes the `state` option. The option was required and always had the same value, so it was redundant.
174
+ - Renamed `onFilterClick` -> `filterHierarchyLevel` in `ErrorItemRenderer`, `TreeErrorRenderer` and `StrataKitTreeRenderer` components. This makes its name consistent with other function props ("do something" vs "on something happened").
175
+ - Renamed `scrollToElement` -> `scrollToNode` in `ErrorItemRenderer` and `TreeErrorRenderer`, and changed its type to take `TreeNode` instead of an error item returned by `useErrorList` hook.
176
+
177
+ ## 2.0.0-alpha.49
178
+
179
+ ### Major Changes
180
+
181
+ - [#1166](https://github.com/iTwin/presentation/pull/1166): Added ability to enter node rename mode programmatically through `StrataKitTreeRenderer` ref. The `renameNode` method accepts a predicate function to identify the target node. If the node is not visible (because its parent is collapsed), all parents will be expanded automatically to make it visible and the node will be scrolled into view.
182
+
183
+ Example:
184
+
185
+ ```tsx
186
+ import {
187
+ StrataKitTreeRenderer,
188
+ StrataKitTreeRendererAttributes,
189
+ } from "@itwin/presentation-hierarchies-react";
190
+
191
+ function MyTree() {
192
+ const treeRef = useRef<StrataKitTreeRendererAttributes>(null);
193
+
194
+ return (
195
+ <>
196
+ <div className="tree-header">
197
+ <button
198
+ onClick={() => {
199
+ treeRef.current?.renameNode(
200
+ (node) => node.label === "Node to rename"
201
+ );
202
+ }}
203
+ >
204
+ Rename node
205
+ </button>
206
+ </div>
207
+ <StrataKitTreeRenderer ref={treeRef} />
208
+ </>
209
+ );
210
+ }
211
+ ```
212
+
213
+ **Breaking changes**
214
+
215
+ - `StrataKitTreeNodeRenderer` is no longer exported.
216
+ - `RenameContextProvider` is no longer exported. It is not necessary when using `StrataKitTreeRenderer`.
217
+ - `RenameAction` now requires a `node` prop.
218
+
219
+ - [#1179](https://github.com/iTwin/presentation/pull/1179): **Breaking change:** Rename tree node action components for clarity.
220
+
221
+ - `FilterAction` -> `TreeNodeFilterAction`
222
+ - `RenameAction` -> `TreeNodeRenameAction`
223
+
224
+ - [#1178](https://github.com/iTwin/presentation/pull/1178): Updated tree node rename UI to show input in popover instead of inline. Additionally added ability to show hint for supported characters and validate new label.
225
+
226
+ Example:
227
+
228
+ ```tsx
229
+ type TreeRendererProps = ComponentProps<typeof StrataKitTreeRenderer>;
230
+
231
+ const getEditingProps = useCallback<
232
+ Required<TreeRendererProps>["getEditingProps"]
233
+ >((node) => {
234
+ return {
235
+ onLabelChanged: (newLabel: string) => {
236
+ // Handle label change
237
+ },
238
+ labelValidationHint: `Allowed are A to Z, 0 to 9, "-" and "_"`,
239
+ validate: (newLabel: string) => /^[A-Za-z0-9\- ]+$/.test(newLabel),
240
+ };
241
+ }, []);
242
+
243
+ return (
244
+ <StrataKitTreeRenderer {...treeProps} getEditingProps={getEditingProps} />
245
+ );
246
+ ```
247
+
248
+ **Breaking changes**
249
+
250
+ - `getEditingProps` callback was changed to require `onLabelChanged`. If node does not support renaming `getEditingProps` should return `undefined`.
251
+
252
+ ### Patch Changes
253
+
254
+ - Updated dependencies:
255
+ - @itwin/presentation-hierarchies@2.0.0-alpha.10
256
+ - @itwin/presentation-shared@2.0.0-alpha.6
257
+ - @itwin/unified-selection@1.6.6-alpha.0
258
+
259
+ ## 2.0.0-alpha.48
260
+
261
+ ### Minor Changes
262
+
263
+ - [#1159](https://github.com/iTwin/presentation/pull/1159): Introduced `getTreeItemProps` and `treeRootProps` to `StrataKitTreeRenderer`. This allows passing props to underlying `Tree.Item` and `Tree.Root` components.
264
+
265
+ **Breaking changes**
266
+
267
+ `StrataKitTreeNodeRenderer` props changes:
268
+
269
+ - `getMenuActions` callback changed to `menuActions` prop (type: `ReactNode[]`)
270
+ - `getInlineActions` callback changed to `inlineActions` prop (type: `ReactNode[]`)
271
+ - `getContextMenuActions` callback changed to `contextMenuActions` prop (type: `ReactNode[]`)
272
+ - `getLabel` callback removed - use `label` prop instead
273
+ - `getSublabel` callback removed - use `description` prop instead
274
+ - `getDecorations` callback removed - use `decorations` prop instead
275
+ - `getClassName` callback removed - use `className` prop instead
276
+ - `onNodeClick` and `onNodeKeyDown` callbacks removed - use `onClick` and `onKeyDown` props instead
277
+
278
+ `StrataKitTreeRenderer` props changes:
279
+
280
+ - Props previously passed to `StrataKitTreeNodeRenderer` are no longer accepted
281
+ - Use `getTreeItemProps` callback to provide props to specific `Tree.Item` components
282
+ - Use `getMenuActions`, `getInlineActions`, and `getContextMenuActions` on `StrataKitTreeRenderer` to provide actions for nodes
283
+
284
+ ### Patch Changes
285
+
286
+ - Updated dependencies:
287
+ - @itwin/presentation-hierarchies@2.0.0-alpha.9
288
+
289
+ ## 2.0.0-alpha.47
290
+
291
+ ### Patch Changes
292
+
293
+ - [#1142](https://github.com/iTwin/presentation/pull/1142): Bump dependencies.
294
+ - [#1142](https://github.com/iTwin/presentation/pull/1142): Fix `StrataKitTreeRenderer` getting into infinite React render loop.
295
+ - Updated dependencies:
296
+ - @itwin/presentation-hierarchies@2.0.0-alpha.8
297
+ - @itwin/presentation-shared@2.0.0-alpha.5
298
+
299
+ ## 2.0.0-alpha.46
300
+
301
+ ### Minor Changes
302
+
303
+ - [#1011](https://github.com/iTwin/presentation/pull/1011): Renamed `getFilteredPaths` prop to `getSearchPaths` in tree hooks: `useTree`, `useUnifiedSelectionTree`, `useIModelTree`, `useIModelUnifiedSelectionTree`.
304
+
305
+ ### Patch Changes
306
+
307
+ - Updated dependencies:
308
+ - @itwin/presentation-hierarchies@2.0.0-alpha.7
309
+
310
+ ## 2.0.0-alpha.45
311
+
312
+ ### Patch Changes
313
+
314
+ - [#1134](https://github.com/iTwin/presentation/pull/1134): Fixed expanded tree nodes showing expander when tree is reloaded and child nodes are removed.
315
+
316
+ ## 2.0.0-alpha.44
317
+
318
+ ### Patch Changes
319
+
320
+ - Updated dependencies:
321
+ - @itwin/unified-selection@1.6.3-alpha.0
322
+
323
+ ## 2.0.0-alpha.43
324
+
325
+ ### Patch Changes
326
+
327
+ - cc836290199b9ff778773b03ab578f90043e95f0: Do not open tree context menu is there is no actions.
328
+ - Updated dependencies:
329
+ - @itwin/presentation-shared@2.0.0-alpha.4
330
+ - @itwin/presentation-hierarchies@2.0.0-alpha.6
331
+
332
+ ## 2.0.0-alpha.42
333
+
334
+ ### Patch Changes
335
+
336
+ - [#1118](https://github.com/iTwin/presentation/pull/1118): Fixed first hidden inline action causing second action to be focused when navigating using keyboard.
337
+
338
+ ## 2.0.0-alpha.41
339
+
340
+ ### Major Changes
341
+
342
+ - [#1113](https://github.com/iTwin/presentation/pull/1113): Pass selected nodes to tree node action getters to support actions that should be applied on all selected nodes.
343
+
344
+ **Breaking changes**
345
+
346
+ - `StrataKitTreeRenderer.getInlineActions` callback receives `{ targetNode: PresentationHierarchyNode; selectedNodes: PresentationHierarchyNode[] }` props instead of `PresentationHierarchyNode`.
347
+ - `StrataKitTreeRenderer.getMenuActions` callback receives `{ targetNode: PresentationHierarchyNode; selectedNodes: PresentationHierarchyNode[] }` props instead of `PresentationHierarchyNode`.
348
+
349
+ Before
350
+
351
+ ```tsx
352
+ return (
353
+ <StrataKitTreeRenderer
354
+ getInlineActions={(node) => [<InlineAction node={node} />]}
355
+ getMenuActions={(node) => [<MenuAction node={node} />]}
356
+ />
357
+ );
358
+ ```
359
+
360
+ After
361
+
362
+ ```tsx
363
+ return (
364
+ <StrataKitTreeRenderer
365
+ getInlineActions={({ targetNode }) => [
366
+ <InlineAction node={targetNode} />,
367
+ ]}
368
+ getMenuActions={({ targetNode }) => [<MenuAction node={targetNode} />]}
369
+ />
370
+ );
371
+ ```
372
+
373
+ - [#1115](https://github.com/iTwin/presentation/pull/1115): Unified tree actions handling to make it easier defining actions that could be reused in different contexts: inline, context menu and actions dropdown.
374
+
375
+ **Breaking changes**
376
+
377
+ - Removed `reserveSpace` property from `<RenameAction />` and `<FilterAction />`. These actions now automatically infer the context they're used in.
378
+ - Added requirement to render newly introduced `<TreeActionBase />` component instead of `<Tree.ItemAction />` when rendering custom tree actions.
379
+
380
+ ### Minor Changes
381
+
382
+ - [#1115](https://github.com/iTwin/presentation/pull/1115): Added `getContextMenuActions` callback for rendering tree actions in context menu.
383
+
384
+ ## 2.0.0-alpha.40
385
+
386
+ ### Patch Changes
387
+
388
+ - [#1110](https://github.com/iTwin/presentation/pull/1110): Bump dependencies.
389
+ - Updated dependencies:
390
+ - @itwin/presentation-hierarchies@2.0.0-alpha.5
391
+ - @itwin/presentation-shared@2.0.0-alpha.3
392
+ - @itwin/unified-selection@1.6.2-alpha.0
393
+
394
+ ## 2.0.0-alpha.39
395
+
396
+ ### Minor Changes
397
+
398
+ - [#1106](https://github.com/iTwin/presentation/pull/1106): Added an `id` property to `StrataKitTreeRenderer` that is passed to it's scroll wrapper.
399
+ - [#1107](https://github.com/iTwin/presentation/pull/1107): Introduced new `getClassName` callback to `StrataKitTreeRenderer` and `StrataKitTreeNodeRenderer` for providing class to tree node HTML element.
400
+
401
+ ### Patch Changes
402
+
403
+ - [#1109](https://github.com/iTwin/presentation/pull/1109): Fixed error item Anchor font size.
404
+
405
+ ## 2.0.0-alpha.38
406
+
407
+ ### Patch Changes
408
+
409
+ - [#1102](https://github.com/iTwin/presentation/pull/1102): Updated tree error item renderer to render error actions as buttons based on StrataKit docs JSDoc suggestion.
410
+
411
+ ## 2.0.0-alpha.37
412
+
413
+ ### Major Changes
414
+
415
+ - [#1100](https://github.com/iTwin/presentation/pull/1100): Bumped StrataKit peer dependencies to:
416
+ - `@stratakit/structures`: ^0.5.0
417
+ - `@stratakit/icons`: ^0.2.0
418
+ - `@stratakit/foundations`: ^0.4.0
419
+ - `@stratakit/bricks`: ^0.5.0
420
+
421
+ ## 2.0.0-alpha.36
422
+
423
+ ### Major Changes
424
+
425
+ - [#1094](https://github.com/iTwin/presentation/pull/1094): Improve custom errors rendering API:
426
+
427
+ - Separated `ChildrenLoad` error from the `Unknown` error. All expected tree errors have dedicated type and `Unknown` error can be used to handle custom errors encountered outside of tree.
428
+ - Exposed `ErrorItemRenderer` that renders all error types supported by the tree.
429
+ - Updated `TreeErrorRenderer` to pass all props necessary to render `ErrorItemRenderer` into `renderError` callback.
430
+
431
+ These changes makes it easier to customize only some types of errors and leave default handling for others.
432
+
433
+ Example:
434
+
435
+ ```tsx
436
+ <StrataKitTreeRenderer
437
+ {...treeProps}
438
+ errorRenderer={(errorProps) => {
439
+ return (
440
+ <TreeErrorRenderer
441
+ {...errorProps}
442
+ renderError={(errorItemProps) => {
443
+ if (errorItemProps.errorItem.errorNode.error.type === "Unknown") {
444
+ return (
445
+ <ErrorRegion.Item
446
+ message="Custom error"
447
+ messageId={errorItemProps.errorItem.errorNode.id}
448
+ />
449
+ );
450
+ }
451
+ return <ErrorItemRenderer {...errorItemProps} />;
452
+ }}
453
+ />
454
+ );
455
+ }}
456
+ />
457
+ ```
458
+
459
+ ## 2.0.0-alpha.35
460
+
461
+ ### Patch Changes
462
+
463
+ - [#1075](https://github.com/iTwin/presentation/pull/1075): Fix accessibility issues in `<TreeErrorRenderer />`.
464
+
465
+ This involves a few localized string changes:
466
+
467
+ - Added `issuesForTree`, defaulting to "Issues for {{tree_label}}.", used as a region landmark label for the error message container.
468
+ - Added `noIssuesFound`, defaulting to "No issues found.", used as a label for errors' list when there are no issues.
469
+ - Changed `issuesFound` to default to "{{number_of_issues}} issue(s) found.", and updated its usage to inject the number of issues found into the string instead of prefixing it before the string, which allows to place the number at any place in the string (may be a requirement for some languages). This is **a breaking change** for anyone, supplying their own localized strings.
470
+
471
+ Also, **a new required prop** `treeLabel` was added to `<TreeErrorRenderer />` and `<StrataKitTreeRenderer />` components. The label is used to uniquely identify a tree in the application, which is required for accessibility purposes.
472
+
473
+ ## 2.0.0-alpha.34
474
+
475
+ ### Patch Changes
476
+
477
+ - [#1068](https://github.com/iTwin/presentation/pull/1068): Extend `@stratakit` peer dependency range to support the latest versions
478
+
479
+ ## 2.0.0-alpha.33
480
+
481
+ ### Patch Changes
482
+
483
+ - [#1057](https://github.com/iTwin/presentation/pull/1057): Change `useNodeHighlighting` hook to only highlight nodes that are filter targets.
484
+
485
+ ## 2.0.0-alpha.32
486
+
487
+ ### Patch Changes
488
+
489
+ - [#1045](https://github.com/iTwin/presentation/pull/1045): Fix highlight matching in `useNodeHighlighting` hook. Highlighting now works when the `highlightText` contains special characters (`[`, `+`, `*`, etc.).
490
+
491
+ ## 2.0.0-alpha.31
492
+
493
+ ### Patch Changes
494
+
495
+ - [#1042](https://github.com/iTwin/presentation/pull/1042): Version bump
496
+ - [#1040](https://github.com/iTwin/presentation/pull/1040): Added a react hook `useNodeHighlighting` that helps create highlighted node labels based on provided text that should be highlighted.
497
+
498
+ Example usage:
499
+
500
+ ```ts
501
+ import {
502
+ StrataKitTreeRenderer,
503
+ useNodeHighlighting,
504
+ } from "@itwin/presentation-hierarchies-react";
505
+
506
+ type BaseTreeRendererProps = React.ComponentPropsWithoutRef<
507
+ typeof StrataKitTreeRenderer
508
+ >;
509
+
510
+ function MyComponent(props: BaseTreeRendererProps & { searchText: string }) {
511
+ // Create highlight based on searchText
512
+ const highlightText =
513
+ props.searchText !== "" ? props.searchText : undefined;
514
+ const { getLabel } = useNodeHighlighting({ highlightText });
515
+
516
+ // Provide getLabel function to tree renderer
517
+ return <StrataKitTreeRenderer {...props} getLabel={getLabel} />;
518
+ }
519
+ ```
520
+
521
+ - Updated dependencies:
522
+ - @itwin/presentation-hierarchies@2.0.0-alpha.4
523
+ - @itwin/presentation-shared@2.0.0-alpha.2
524
+ - @itwin/unified-selection@1.5.1-alpha.1
525
+
526
+ ## 2.0.0-alpha.30
527
+
528
+ ### Patch Changes
529
+
530
+ - [#1037](https://github.com/iTwin/presentation/pull/1037): Added additional documentation for `RenameAction`
531
+
532
+ ## 2.0.0-alpha.29
533
+
534
+ ### Patch Changes
535
+
536
+ - [#1035](https://github.com/iTwin/presentation/pull/1035): Version bump after merge from `master`.
537
+
538
+ ## 2.0.0-alpha.28
539
+
540
+ ### Patch Changes
541
+
542
+ - [#1031](https://github.com/iTwin/presentation/pull/1031): Version bump
543
+ - Updated dependencies:
544
+ - @itwin/presentation-hierarchies@2.0.0-alpha.3
545
+ - @itwin/unified-selection@1.5.1-alpha.0
546
+
547
+ ## 2.0.0-alpha.27
548
+
549
+ ### Patch Changes
550
+
551
+ - [#1026](https://github.com/iTwin/presentation/pull/1026): Fix `reserveSpace` property being required instead of optional for `FilterAction` and `RenameAction`.
552
+
553
+ ## 2.0.0-alpha.26
554
+
555
+ ### Major Changes
556
+
557
+ - [#1023](https://github.com/iTwin/presentation/pull/1023): Split `getActions` into `getMenuActions` & `getInlineActions` for `StrataKitTreeRenderer` and `StrataKitTreeNodeRenderer`.
558
+
559
+ Updated peer dependencies:
560
+
561
+ - @stratakit/bricks@0.3.3
562
+ - @stratakit/foundations@0.2.2
563
+ - @stratakit/structures@0.3.1
564
+
565
+ Added `reserveSpace` property to `FilterAction` and `RenameAction`, which reserves space for the action when it is not available
566
+
567
+ ### Minor Changes
568
+
569
+ - [#1007](https://github.com/iTwin/presentation/pull/1007): Renames:
570
+ `FlatNode` => `FlatTreeNodeItem`
571
+ `FlatTreeNode` => `FlatTreeItem`
572
+ `PlaceholderNode` => `PlaceholderItem`
573
+ `useFlatTreeNodeList` => `useFlatTreeItems`
574
+
575
+ Changed `FlatTreeNodeItem` (previously `FlatNode`) to have property `node: PresentationHierarchyNode` instead of extending `PresentationHierarchyNode`.
576
+
577
+ ### Patch Changes
578
+
579
+ - Updated dependencies:
580
+ - @itwin/presentation-hierarchies@2.0.0-alpha.2
581
+
582
+ ## 2.0.0-alpha.25
583
+
584
+ ### Patch Changes
585
+
586
+ - Updated dependencies:
587
+ - @itwin/presentation-hierarchies@2.0.0-alpha.1
588
+ - @itwin/presentation-shared@2.0.0-alpha.1
589
+ - @itwin/unified-selection@1.4.3-alpha.0
590
+
591
+ ## 2.0.0-alpha.24
592
+
593
+ ### Patch Changes
594
+
595
+ - [#975](https://github.com/iTwin/presentation/pull/975): Associate tree nodes rendered by `<StrataKitTreeNodeRenderer />` component with error messages rendered in `<TreeErrorRenderer />`. This improves accessibility by linking error information to the node.
596
+ - [#979](https://github.com/iTwin/presentation/pull/979): Adjust how `useTree` and other variants of it determines `isReloading` value. `isReloading` is now set to `true` if root nodes are being loaded.
597
+
598
+ ## 2.0.0-alpha.23
599
+
600
+ ### Minor Changes
601
+
602
+ - [#972](https://github.com/iTwin/presentation/pull/972): Added `getEditingProps` prop to `<StrataKitTreeRenderer />` component that allows to make node labels editable. In order to enter label editing mode `<RenameAction />` component was added.
603
+
604
+ ## 2.0.0-alpha.22
605
+
606
+ ### Minor Changes
607
+
608
+ - [#970](https://github.com/iTwin/presentation/pull/970): Exposed the type of tree state hooks' result `treeRendererProps` attribute - `TreeRendererProps`. The type can be useful when creating custom tree renderers.
609
+
610
+ ## 2.0.0-alpha.21
611
+
612
+ ### Major Changes
613
+
614
+ - [#961](https://github.com/iTwin/presentation/pull/961): **Breaking changes** to tree state hooks `useTree`, `useUnifiedSelectionTree`, `useIModelTree`, `useIModelUnifiedSelectionTree`:
615
+
616
+ - All tree rendering props have been moved under `treeRendererProps`. The value can be passed to `<StrataKitTreeRenderer />` component.
617
+ - In case an error occurs while loading the root hierarchy level, instead of `treeRendererProps`, the `rootErrorRendererProps` are set, which can be passed to `<StrataKitRootErrorRenderer />` component to render the error state.
618
+ - The `isLoading` attribute has been renamed to `isReloading`.
619
+ - Errors are no longer defined as children of `PresentationHierarchyNode` and instead are now included as `error` attribute for more fluent API.
620
+
621
+ When rendering tree state, the recommended order of checks is:
622
+
623
+ 1. If `rootErrorRendererProps` is defined, there was an error - render error state.
624
+ 2. If `treeRendererProps` is not defined, the component is doing the initial load - render loading state.
625
+ 3. If `treeRendererProps` is defined, the hierarchy is loaded - render the tree component.
626
+
627
+ The `isReloading` attribute may also be set at the same time, indicating that the hierarchy is being reloaded in the background. Consumers may want to render an overlay in this case, or not render the tree at all.
628
+
629
+ Example:
630
+
631
+ ```ts
632
+ function MyComponent () {
633
+ const useTreeResult = useIModelUnifiedSelectionTree({...});
634
+
635
+ // handle possible root errors with our provided component or your own custom implementation
636
+ if (treeProps.rootErrorRendererProps) {
637
+ return <StrataKitRootErrorRenderer {...useTreeResult.rootErrorRendererProps} />;
638
+ }
639
+
640
+ // handle loading state
641
+ if (!treeProps.treeRendererProps) {
642
+ return <MyLoadingComponent />;
643
+ }
644
+
645
+ // handle loaded hierarchy
646
+ return <StrataKitTreeRenderer {...useTreeResult.treeProps} />;
647
+ }
648
+ ```
649
+
650
+ ## 2.0.0-alpha.20
651
+
652
+ ### Major Changes
653
+
654
+ - [#965](https://github.com/iTwin/presentation/pull/965): Added `@stratakit/structures` as a peer dependency.
655
+
656
+ ## 2.0.0-alpha.19
657
+
658
+ ### Major Changes
659
+
660
+ - [#954](https://github.com/iTwin/presentation/pull/954): Add additional requirements for types in `EC` metadata namespace, whose objects are returned by `ECSchemaProvider`.
661
+
662
+ - `EC.Schema`, `EC.Class` and `EC.Property` now all have an async `getCustomAttributes()` method that returns an `EC.CustomAttributeSet`, allowing consumers to access custom attributes of these schema items.
663
+ - `EC.Class` now additionally has these members:
664
+ - `baseClass: Promise<Class | undefined>`
665
+ - `getDerivedClasses(): Promise<Class[]>`
666
+
667
+ While this is an addition, it's considered a breaking change, because objects of the updated types are expected to be supplied to us by consumers.
668
+
669
+ In reality, consumers will likely use `@itwin/presentation-core-interop` package for creating them, and the package has been updated to handle the change, so reacting to the breaking change is as simple as bumping the version of `@itwin/presentation-core-interop` package in the consumer's `package.json`.
670
+
671
+ ### Patch Changes
672
+
673
+ - [#957](https://github.com/iTwin/presentation/pull/957): Avoid leaking custom props to the `PlaceholderNode` that are causing console errors.
674
+ - Updated dependencies:
675
+ - @itwin/presentation-hierarchies@2.0.0-alpha.0
676
+ - @itwin/presentation-shared@2.0.0-alpha.0
677
+ - @itwin/unified-selection@1.4.2-alpha.0
678
+
679
+ ## 2.0.0-alpha.18
680
+
681
+ ### Major Changes
682
+
683
+ - [#951](https://github.com/iTwin/presentation/pull/951): Move from `@itwin/itwinui-react@5.0.0-alpha` to `@stratakit/*` packages.
684
+
685
+ ## 2.0.0-alpha.17
686
+
687
+ ### Patch Changes
688
+
689
+ - [#949](https://github.com/iTwin/presentation/pull/949): Use default imports instead of `URL` constructor for icons.
690
+
691
+ ## 2.0.0-alpha.16
692
+
693
+ ### Minor Changes
694
+
695
+ - [#945](https://github.com/iTwin/presentation/pull/945): Re-export `getLogger` and `setLogger` functions from `@itwin/presentation-hierarchies` to allow setting a logger.
696
+
697
+ ## 2.0.0-alpha.15
698
+
699
+ ### Major Changes
700
+
701
+ - [#942](https://github.com/iTwin/presentation/pull/942): Unified selection API cleanup.
702
+
703
+ - Remove deprecated `UnifiedSelectionProvider`.
704
+ - Make `selectionStorage` prop required for unified selection - enabled tree state hooks (`useUnifiedSelectionTree` and `useIModelUnifiedSelectionTree`).
705
+
706
+ Previously, the `selectionStorage` prop was optional, and if not provided, the hooks used unified selection React context (provided by `UnifiedSelectionProvider`) as fallback. Finally, if the context was not provided either, the hooks acted as regular non-unified selection hooks.
707
+
708
+ This didn't make much sense, as the hooks were designed to work with unified selection, as their name suggests. So it makes sense to require the selection storage to be provided to them, and at that point the context becomes redundant.
709
+
710
+ - [#936](https://github.com/iTwin/presentation/pull/936): Replaced `actions` property on `TreeNodeRenderer` with `getActions` to match how decorations are handled. Removed `useFilterAction` hook and replaced it with `FilterAction` component.
711
+
712
+ Before:
713
+
714
+ ```tsx
715
+ import {
716
+ TreeNodeRenderer,
717
+ useFilterAction,
718
+ } from "@itwin/presentation-hierarchies-react";
719
+
720
+ const filterAction = useFilterAction({ onFilter, getHierarchyLevelDetails });
721
+ return (
722
+ <TreeNodeRenderer
723
+ actions={useMemo(
724
+ () => [
725
+ filterAction,
726
+ (node) => ({
727
+ label: "Custom Action",
728
+ actions: () => log(node.label),
729
+ icon: customIconHref,
730
+ }),
731
+ ],
732
+ [filterAction]
733
+ )}
734
+ />
735
+ );
736
+ ```
737
+
738
+ After:
739
+
740
+ ```tsx
741
+ import { Icon, Tree } from "@itwin/itwinui-react";
742
+ import {
743
+ FilterAction,
744
+ TreeNodeRenderer,
745
+ } from "@itwin/presentation-hierarchies-react";
746
+
747
+ return (
748
+ <TreeNodeRenderer
749
+ getActions={useCallback(
750
+ (node) => [
751
+ <FilterAction
752
+ key="filter"
753
+ node={node}
754
+ onFilter={onFilter}
755
+ getHierarchyLevelDetails={getHierarchyLevelDetails}
756
+ />,
757
+ <Tree.ItemAction
758
+ key="customAction"
759
+ label="Custom action"
760
+ onClick={() => log(node.label)}
761
+ icon={<Icon href={customIconHref} />}
762
+ />,
763
+ ],
764
+ [onFilter, getHierarchyLevelDetails]
765
+ )}
766
+ />
767
+ );
768
+ ```
769
+
770
+ ### Minor Changes
771
+
772
+ - [#930](https://github.com/iTwin/presentation/pull/930): Exposed `TreeErrorRenderer`, which takes `renderError` property to render custom error messages.
773
+ `TreeRenderer` now takes `errorRenderer` to render a custom error display component.
774
+
775
+ Custom error display component example:
776
+
777
+ ```ts
778
+ <TreeRenderer
779
+ {...treeProps}
780
+ errorRenderer={(errorsRendererProps) => (
781
+ <MyErrorRenderer {...errorsRendererProps} />
782
+ )}
783
+ />
784
+ ```
785
+
786
+ Custom error message example:
787
+
788
+ ```ts
789
+ <TreeRenderer
790
+ {...treeProps}
791
+ errorRenderer={(errorsRendererProps) => (
792
+ <TreeErrorRenderer
793
+ {...errorsRendererProps}
794
+ renderError={(errorProps) => {
795
+ return <unstable_ErrorRegion.Item message={...} />;
796
+ }}
797
+ />
798
+ )}
799
+ />
800
+ ```
801
+
802
+ - [#937](https://github.com/iTwin/presentation/pull/937): `TreeRenderer` now takes `rootErrorRenderer` to render a custom root error display component.
803
+
804
+ Custom error display component example:
805
+
806
+ ```ts
807
+ <TreeRenderer
808
+ {...treeProps}
809
+ rootErrorRenderer={(rootErrorRendererProps) => (
810
+ <MyRootErrorRenderer {...rootErrorRendererProps} />
811
+ )}
812
+ />
813
+ ```
814
+
815
+ - [#930](https://github.com/iTwin/presentation/pull/930): Changed flat tree building functions to hooks:
816
+ - `flattenNodes` => `useFlatTreeNodeList`.
817
+ - `getErrors` => `useErrorList`.
818
+
819
+ ### Patch Changes
820
+
821
+ - [#930](https://github.com/iTwin/presentation/pull/930): Fix `ResultSetTooLarge` error suggesting filtering when parent node is not filterable.
822
+
823
+ ## 2.0.0-alpha.14
824
+
825
+ ### Patch Changes
826
+
827
+ - [#928](https://github.com/iTwin/presentation/pull/928): Memoize tree components to reduce the amount of renders.
828
+
829
+ ## 2.0.0-alpha.13
830
+
831
+ ### Patch Changes
832
+
833
+ - [#924](https://github.com/iTwin/presentation/pull/924): Fix tree error dropdown not applying actions.
834
+
835
+ ## 2.0.0-alpha.12
836
+
837
+ ### Patch Changes
838
+
839
+ - [#922](https://github.com/iTwin/presentation/pull/922): Fix tree displaying aditional scrollbars, when scrolling to the last element with low tree width.
840
+
841
+ ## 2.0.0-alpha.11
842
+
843
+ ### Patch Changes
844
+
845
+ - [#916](https://github.com/iTwin/presentation/pull/916): Fix tree nodes overlapping when nodes with and without sublabel are rendered alongside.
846
+ - [#920](https://github.com/iTwin/presentation/pull/920): Changed error display for node errors to match new design system.
847
+
848
+ ## 2.0.0-alpha.10
849
+
850
+ ### Patch Changes
851
+
852
+ - [#913](https://github.com/iTwin/presentation/pull/913): Removed outline showed after node expander is clicked.
853
+
854
+ ## 2.0.0-alpha.9
855
+
856
+ ### Patch Changes
857
+
858
+ - [#906](https://github.com/iTwin/presentation/pull/906): Replaced `TreeNodeRenderer.getIcon` prop with `getDecorations` prop.
859
+
860
+ The `getIcon` prop took either an icon URI, or a `ReactElement`. The new `getDecorations` prop allows passing multiple React elements, allowing consumers to render not just the icon, but also addition components like a tag or a color swatch. Migration:
861
+
862
+ ```ts
863
+ // previously, when `getIcon` returned a `ReactElement`:
864
+ function myGetIcon(node: PresentationHierarchyNode): React.ReactElement {
865
+ // implementation...
866
+ }
867
+ <TreeNodeRenderer getIcon={myGetIcon} />
868
+
869
+ // now:
870
+ <TreeNodeRenderer getDecorations={myGetIcon} />
871
+
872
+ // previously, when `getIcon` returned an icon URI:
873
+ function myGetIconUri(node: PresentationHierarchyNode): string {
874
+ // implementation...
875
+ }
876
+ <TreeNodeRenderer getIcon={myGetIconUri} />
877
+
878
+ // now:
879
+ <TreeNodeRenderer getDecorations={(node) => <Icon href={myGetIconUri(node)} />} />
880
+ ```
881
+
882
+ - [#911](https://github.com/iTwin/presentation/pull/911): Fix incorrect left padding on tree items
883
+
884
+ ## 2.0.0-alpha.8
885
+
886
+ ### Patch Changes
887
+
888
+ - [#903](https://github.com/iTwin/presentation/pull/903): Added `activeDescription` optional property to TreeItemAction interface, which when provided a value will display a dot above the button indicating an active state. The provided value is used to set accesible description and should explain why the action item is active.
889
+ - [#903](https://github.com/iTwin/presentation/pull/903): Changed `createFilterAction` function to a React hook and renamed it to `useFilterAction`.
890
+
891
+ ## 2.0.0-alpha.7
892
+
893
+ ### Patch Changes
894
+
895
+ - [#892](https://github.com/iTwin/presentation/pull/892): Fix focus outline for tree items not being visible on action items click.
896
+ - [#894](https://github.com/iTwin/presentation/pull/894): Fix `treeRenderer` property `getSublabel` not being used.
897
+
3
898
  ## 2.0.0-alpha.6
4
899
 
5
900
  ### Patch Changes
@@ -32,7 +927,6 @@
32
927
  ### Patch Changes
33
928
 
34
929
  - [#870](https://github.com/iTwin/presentation/pull/870): `TreeRenderer` and `TreeNodeRenderer` now take actions as specification function array.
35
-
36
930
  - `label`: Action item's label.
37
931
  - `action`: The action performed when the button is clicked.
38
932
  - `show` A boolean determining whether the button should be displayed.
@@ -64,6 +958,244 @@
64
958
 
65
959
  - [#847](https://github.com/iTwin/presentation/pull/847): Moving tree rendering components to a new design systems.
66
960
 
961
+ ## 1.9.13
962
+
963
+ ### Patch Changes
964
+
965
+ - [#1242](https://github.com/iTwin/presentation/pull/1242): Bump dependencies.
966
+ - [#1252](https://github.com/iTwin/presentation/pull/1252): Fix tree node outline not appearing on touch devices.
967
+ - Updated dependencies:
968
+ - @itwin/presentation-hierarchies@1.7.11
969
+ - @itwin/presentation-shared@1.2.10
970
+ - @itwin/unified-selection@1.6.8
971
+
972
+ ## 1.9.12
973
+
974
+ ### Patch Changes
975
+
976
+ - [#1215](https://github.com/iTwin/presentation/pull/1215): Update dependencies.
977
+ - Updated dependencies:
978
+ - @itwin/presentation-hierarchies@1.7.10
979
+ - @itwin/presentation-shared@1.2.9
980
+ - @itwin/unified-selection@1.6.7
981
+
982
+ ## 1.9.11
983
+
984
+ ### Patch Changes
985
+
986
+ - [#1208](https://github.com/iTwin/presentation/pull/1208): Bump dependencies.
987
+ - Updated dependencies:
988
+ - @itwin/presentation-hierarchies@1.7.9
989
+ - @itwin/presentation-shared@1.2.8
990
+ - @itwin/unified-selection@1.6.6
991
+
992
+ ## 1.9.10
993
+
994
+ ### Patch Changes
995
+
996
+ - [#1168](https://github.com/iTwin/presentation/pull/1168): Bump dependencies.
997
+ - [#1167](https://github.com/iTwin/presentation/pull/1167): Fix a greedy regular expression in `TreeNodeRenderer` that renders a "result set too large" error node.
998
+ - [#1161](https://github.com/iTwin/presentation/pull/1161): Bump iTwin.js dependencies to `^5.5.0`.
999
+ - Updated dependencies:
1000
+ - @itwin/presentation-hierarchies@1.7.8
1001
+ - @itwin/presentation-shared@1.2.7
1002
+ - @itwin/unified-selection@1.6.5
1003
+
1004
+ ## 1.9.9
1005
+
1006
+ ### Patch Changes
1007
+
1008
+ - [#1160](https://github.com/iTwin/presentation/pull/1160): Fixed tree placeholder node spinner size to match tree node icons.
1009
+
1010
+ ## 1.9.8
1011
+
1012
+ ### Patch Changes
1013
+
1014
+ - [#1152](https://github.com/iTwin/presentation/pull/1152): Bump dependencies.
1015
+ - Updated dependencies:
1016
+ - @itwin/presentation-hierarchies@1.7.7
1017
+ - @itwin/presentation-shared@1.2.6
1018
+ - @itwin/unified-selection@1.6.4
1019
+
1020
+ ## 1.9.7
1021
+
1022
+ ### Patch Changes
1023
+
1024
+ - [#1139](https://github.com/iTwin/presentation/pull/1139): Bump dependencies.
1025
+ - Updated dependencies:
1026
+ - @itwin/presentation-hierarchies@1.7.6
1027
+ - @itwin/presentation-shared@1.2.5
1028
+ - @itwin/unified-selection@1.6.3
1029
+
1030
+ ## 1.9.6
1031
+
1032
+ ### Patch Changes
1033
+
1034
+ - [#1124](https://github.com/iTwin/presentation/pull/1124): Bump dependencies.
1035
+ - Updated dependencies:
1036
+ - @itwin/unified-selection@1.6.2
1037
+ - @itwin/presentation-hierarchies@1.7.5
1038
+ - @itwin/presentation-shared@1.2.4
1039
+
1040
+ ## 1.9.5
1041
+
1042
+ ### Patch Changes
1043
+
1044
+ - [#1079](https://github.com/iTwin/presentation/pull/1079): Fixed tree node actions background color when node is selected and hovered.
1045
+
1046
+ ## 1.9.4
1047
+
1048
+ ### Patch Changes
1049
+
1050
+ - [#1063](https://github.com/iTwin/presentation/pull/1063): Make sure tree node actions are properly sticking to the right side when scrolling tree horizontally.
1051
+
1052
+ ## 1.9.3
1053
+
1054
+ ### Patch Changes
1055
+
1056
+ - [#1054](https://github.com/iTwin/presentation/pull/1054): Show tooltip with full label on tree nodes.
1057
+
1058
+ ## 1.9.2
1059
+
1060
+ ### Patch Changes
1061
+
1062
+ - [#1039](https://github.com/iTwin/presentation/pull/1039): Bump iTwin.js core dependencies to `^5.1.1`.
1063
+ - Updated dependencies:
1064
+ - @itwin/presentation-hierarchies@1.7.2
1065
+ - @itwin/presentation-shared@1.2.3
1066
+ - @itwin/unified-selection@1.5.1
1067
+
1068
+ ## 1.9.1
1069
+
1070
+ ### Patch Changes
1071
+
1072
+ - [#1033](https://github.com/iTwin/presentation/pull/1033): Fix unified selection tree state hooks `useUnifiedSelectionTree` and `useIModelUnifiedSelectionTree` not handling the recently added `createSelectableForGenericNode` prop.
1073
+
1074
+ ## 1.9.0
1075
+
1076
+ ### Minor Changes
1077
+
1078
+ - [#1027](https://github.com/iTwin/presentation/pull/1027): Added `getActions` property to `TreeRenderer` and `TreeNodeRenderer` to allow providing custom actions for tree nodes.
1079
+
1080
+ ## 1.8.1
1081
+
1082
+ ### Patch Changes
1083
+
1084
+ - Updated dependencies:
1085
+ - @itwin/presentation-hierarchies@1.7.1
1086
+
1087
+ ## 1.8.0
1088
+
1089
+ ### Minor Changes
1090
+
1091
+ - [#1019](https://github.com/iTwin/presentation/pull/1019): Add ability to customize `Selectable` objects that are added to unified selection, when a generic node in a unified selection-driven tree component is selected.
1092
+
1093
+ By default, when a generic node is selected in a unified selection-driven tree component, the `Selectable` that is created for it gets a per-tree unique identifier. This means that a similar generic node somewhere else in the tree or a different tree will not be considered the same. However, in some cases we do want generic nodes to be treated as the same, and for that matter unified selection-enabling tree state hooks now have a new `createSelectableForGenericNode` option:
1094
+
1095
+ ```tsx
1096
+ import { useUnifiedSelectionTree } from "@itwin/presentation-hierarchies-react";
1097
+
1098
+ const treeState = useUnifiedSelectionTree({
1099
+ selectionStorage,
1100
+ createSelectableForGenericNode: useCallback<
1101
+ NonNullable<
1102
+ Props<typeof useUnifiedSelectionTree>["createSelectableForGenericNode"]
1103
+ >
1104
+ >(
1105
+ (node, uniqueId) => ({
1106
+ identifier: node.key.id,
1107
+ data: node,
1108
+ async *loadInstanceKeys() {},
1109
+ }),
1110
+ []
1111
+ ),
1112
+ // ...other options
1113
+ });
1114
+ ```
1115
+
1116
+ ### Patch Changes
1117
+
1118
+ - Updated dependencies:
1119
+ - @itwin/unified-selection@1.5.0
1120
+
1121
+ ## 1.7.2
1122
+
1123
+ ### Patch Changes
1124
+
1125
+ - Updated dependencies:
1126
+ - @itwin/presentation-hierarchies@1.7.0
1127
+
1128
+ ## 1.7.1
1129
+
1130
+ ### Patch Changes
1131
+
1132
+ - Updated dependencies:
1133
+ - @itwin/presentation-hierarchies@1.6.1
1134
+
1135
+ ## 1.7.0
1136
+
1137
+ ### Minor Changes
1138
+
1139
+ - 64e80beaeb87e5797d8238c14fa9cd8dbfcee7c3: Added `abortSignal` to `getFilteredPaths` callback used by `UseTree` hook. This allows to cancel ongoing requests when component is unmounted or new request is started.
1140
+
1141
+ ### Patch Changes
1142
+
1143
+ - Updated dependencies:
1144
+ - @itwin/presentation-hierarchies@1.6.0
1145
+
1146
+ ## 1.6.9
1147
+
1148
+ ### Patch Changes
1149
+
1150
+ - [#1000](https://github.com/iTwin/presentation/pull/1000): Made sure `Apply filter` button becomes focused after hierarchy level filter is applied.
1151
+
1152
+ ## 1.6.8
1153
+
1154
+ ### Patch Changes
1155
+
1156
+ - [#982](https://github.com/iTwin/presentation/pull/982): Update itwinjs-core dependencies to v5.0.0
1157
+ - Updated dependencies:
1158
+ - @itwin/presentation-hierarchies@1.5.1
1159
+ - @itwin/presentation-shared@1.2.2
1160
+ - @itwin/unified-selection@1.4.2
1161
+
1162
+ ## 1.6.7
1163
+
1164
+ ### Patch Changes
1165
+
1166
+ - [#974](https://github.com/iTwin/presentation/pull/974): Removed tree node outline on mobile devices.
1167
+ - Updated dependencies:
1168
+ - @itwin/presentation-hierarchies@1.5.0
1169
+
1170
+ ## 1.6.6
1171
+
1172
+ ### Patch Changes
1173
+
1174
+ - [#944](https://github.com/iTwin/presentation/pull/944): Fixed `extended` selection mode not replacing existing selection when selected node is clicked.
1175
+
1176
+ ## 1.6.5
1177
+
1178
+ ### Patch Changes
1179
+
1180
+ - [#938](https://github.com/iTwin/presentation/pull/938): Fixed hierarchy level size exceeded message that suggest applying filtering on hierarchy levels that do not support filtering.
1181
+
1182
+ ## 1.6.4
1183
+
1184
+ ### Patch Changes
1185
+
1186
+ - [#909](https://github.com/iTwin/presentation/pull/909): Do not use `dev` versions of `@itwin/*` packages.
1187
+ - Updated dependencies:
1188
+ - @itwin/unified-selection@1.4.1
1189
+ - @itwin/presentation-hierarchies@1.4.2
1190
+ - @itwin/presentation-shared@1.2.1
1191
+
1192
+ ## 1.6.3
1193
+
1194
+ ### Patch Changes
1195
+
1196
+ - Updated dependencies:
1197
+ - @itwin/unified-selection@1.4.0
1198
+
67
1199
  ## 1.6.2
68
1200
 
69
1201
  ### Patch Changes
@@ -128,7 +1260,6 @@
128
1260
  ### Minor Changes
129
1261
 
130
1262
  - [#840](https://github.com/iTwin/presentation/pull/840): Added `filterButtonsVisibility` to `treeNodeRenderer`. Which allows configuring filter buttons visibility for the whole tree.
131
-
132
1263
  - `show-on-hover` - default value, shows filter buttons on node hover or focus.
133
1264
  - `hide` - hides filter buttons on focus and hover, but will continue to show buttons on nodes in which filter is applied. Reaching hierarchy limit will continue to provide a way to filter nodes.
134
1265
 
@@ -159,7 +1290,11 @@
159
1290
  Example usage:
160
1291
 
161
1292
  ```tsx
162
- function MyTreeComponentInternal({ imodelAccess }: { imodelAccess: IModelAccess }) {
1293
+ function MyTreeComponentInternal({
1294
+ imodelAccess,
1295
+ }: {
1296
+ imodelAccess: IModelAccess;
1297
+ }) {
163
1298
  const {
164
1299
  rootNodes,
165
1300
  getNode,
@@ -174,18 +1309,22 @@
174
1309
  async (nodeId: string, isExpanded: boolean) => {
175
1310
  const node = getNode(nodeId);
176
1311
  if (node) {
177
- console.log(`${isExpanded ? "Expanding" : "Collapsing"} node: ${node.label}`);
1312
+ console.log(
1313
+ `${isExpanded ? "Expanding" : "Collapsing"} node: ${node.label}`
1314
+ );
178
1315
  }
179
1316
  doExpandNode(nodeId, isExpanded);
180
1317
  },
181
- [getNode, doExpandNode],
1318
+ [getNode, doExpandNode]
182
1319
  );
183
1320
 
184
1321
  // render the tree
185
1322
  if (!rootNodes || !rootNodes.length) {
186
1323
  return "No data to display";
187
1324
  }
188
- return <TreeRenderer {...state} expandNode={expandNode} rootNodes={rootNodes} />;
1325
+ return (
1326
+ <TreeRenderer {...state} expandNode={expandNode} rootNodes={rootNodes} />
1327
+ );
189
1328
  }
190
1329
  ```
191
1330
 
@@ -532,11 +1671,12 @@
532
1671
  const hierarchyLevelDetails = getHierarchyLevelDetails(nodeId);
533
1672
  someFunc(hierarchyLevelDetails);
534
1673
  }}
535
-
536
1674
  // After the change
537
1675
  onNodeClick={(node, isSelected, event) => someFunc(node.id)}
538
1676
  onNodeKeyDown={(node, isSelected, event) => someFunc(node.id)}
539
- onFilterClick={(hierarchyLevelDetails) => someFunc(hierarchyLevelDetails)}
1677
+ onFilterClick={(hierarchyLevelDetails) =>
1678
+ someFunc(hierarchyLevelDetails)
1679
+ }
540
1680
  />
541
1681
  );
542
1682
  }
@@ -569,7 +1709,7 @@
569
1709
  ...props,
570
1710
  onHierarchyLimitExceeded: ({ nodeId, filter, limit }) => {
571
1711
  console.log(`Hierarchy limit of ${limit} exceeded for node ${nodeId}.`);
572
- }
1712
+ },
573
1713
  });
574
1714
  return <TreeRenderer {...state} />;
575
1715
  }
@@ -580,7 +1720,7 @@
580
1720
  ```ts
581
1721
  import { registerTxnListeners } from "@itwin/presentation-core-interop";
582
1722
 
583
- function MyTree({ imodel, ...props}: Props) {
1723
+ function MyTree({ imodel, ...props }: Props) {
584
1724
  const { reloadTree, treeProps } = useTree(props);
585
1725
  useEffect(() => {
586
1726
  // listen for changes in iModel and reload tree
@@ -606,7 +1746,7 @@
606
1746
  ...props,
607
1747
  onPerformanceMeasured: (action, duration) => {
608
1748
  telemetryClient.log(`MyTree [${feature}] took ${duration} ms`);
609
- }
1749
+ },
610
1750
  });
611
1751
  return <TreeRenderer {...state} />;
612
1752
  }