@itwin/presentation-hierarchies-react 2.0.0-alpha.54 → 2.0.0-alpha.56
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 +38 -0
- package/README.md +23 -61
- package/lib/presentation-hierarchies-react/Renderers.d.ts.map +1 -0
- package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/TreeNode.d.ts +2 -0
- package/lib/presentation-hierarchies-react/TreeNode.d.ts.map +1 -0
- package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/UseIModelTree.d.ts +1 -1
- package/lib/presentation-hierarchies-react/UseIModelTree.d.ts.map +1 -0
- package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/UseIModelTree.js +43 -48
- package/lib/presentation-hierarchies-react/UseIModelTree.js.map +1 -0
- package/lib/presentation-hierarchies-react/UseNodeHighlighting.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/UseNodeHighlighting.js.map +1 -0
- package/lib/presentation-hierarchies-react/UseSelectionHandler.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/UseSelectionHandler.js.map +1 -0
- package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/UseTree.d.ts +8 -3
- package/lib/presentation-hierarchies-react/UseTree.d.ts.map +1 -0
- package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/UseTree.js +21 -21
- package/lib/presentation-hierarchies-react/UseTree.js.map +1 -0
- package/lib/presentation-hierarchies-react/Utils.js.map +1 -0
- package/lib/presentation-hierarchies-react/internal/DisposePolyfill.js.map +1 -0
- package/lib/presentation-hierarchies-react/internal/LocalizedStrings.d.ts +9 -0
- package/lib/presentation-hierarchies-react/internal/LocalizedStrings.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/internal/LocalizedStrings.js +12 -0
- package/lib/presentation-hierarchies-react/internal/LocalizedStrings.js.map +1 -0
- package/lib/presentation-hierarchies-react/internal/TreeActions.js.map +1 -0
- package/lib/presentation-hierarchies-react/internal/TreeLoader.js.map +1 -0
- package/lib/presentation-hierarchies-react/internal/TreeModel.js.map +1 -0
- package/lib/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/internal/UseUnifiedSelection.js.map +1 -0
- package/lib/presentation-hierarchies-react/internal/Utils.js.map +1 -0
- package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/ErrorItemRenderer.d.ts +3 -3
- package/lib/presentation-hierarchies-react/stratakit/ErrorItemRenderer.d.ts.map +1 -0
- package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/ErrorItemRenderer.js +158 -128
- package/lib/presentation-hierarchies-react/stratakit/ErrorItemRenderer.js.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/FlatTreeNode.d.ts.map +1 -0
- package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/FlatTreeNode.js +7 -4
- package/lib/presentation-hierarchies-react/stratakit/FlatTreeNode.js.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/LocalizationContext.d.ts +24 -0
- package/lib/presentation-hierarchies-react/stratakit/LocalizationContext.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/LocalizationContext.js +41 -0
- package/lib/presentation-hierarchies-react/stratakit/LocalizationContext.js.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/RootErrorRenderer.d.ts.map +1 -0
- package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/RootErrorRenderer.js +64 -46
- package/lib/presentation-hierarchies-react/stratakit/RootErrorRenderer.js.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeAction.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeAction.js.map +1 -0
- package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/TreeErrorRenderer.d.ts +3 -3
- package/lib/presentation-hierarchies-react/stratakit/TreeErrorRenderer.d.ts.map +1 -0
- package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/TreeErrorRenderer.js +19 -20
- package/lib/presentation-hierarchies-react/stratakit/TreeErrorRenderer.js.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.d.ts.map +1 -0
- package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/TreeNodeFilterAction.js +43 -30
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.js.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts.map +1 -0
- package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/TreeNodeRenameAction.js +37 -31
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.js.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts.map +1 -0
- package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/TreeNodeRenderer.js +227 -192
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.js.map +1 -0
- package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/TreeRenderer.d.ts +3 -6
- package/lib/presentation-hierarchies-react/stratakit/TreeRenderer.d.ts.map +1 -0
- package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/TreeRenderer.js +39 -45
- package/lib/presentation-hierarchies-react/stratakit/TreeRenderer.js.map +1 -0
- package/lib/{esm/presentation-hierarchies-react.d.ts → presentation-hierarchies-react.d.ts} +3 -2
- package/lib/{esm/presentation-hierarchies-react.js → presentation-hierarchies-react.js} +3 -2
- package/lib/public/locales/en/PresentationHierarchies_1.0.json +26 -0
- package/package.json +19 -15
- package/lib/esm/presentation-hierarchies-react/Renderers.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/TreeNode.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/UseIModelTree.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/UseIModelTree.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/UseNodeHighlighting.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/UseNodeHighlighting.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/UseTree.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/UseTree.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/Utils.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/DisposePolyfill.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeActions.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeModel.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/Utils.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/ErrorItemRenderer.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/ErrorItemRenderer.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/FlatTreeNode.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/FlatTreeNode.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/LocalizationContext.d.ts +0 -138
- package/lib/esm/presentation-hierarchies-react/stratakit/LocalizationContext.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/LocalizationContext.js +0 -67
- package/lib/esm/presentation-hierarchies-react/stratakit/LocalizationContext.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/RootErrorRenderer.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/RootErrorRenderer.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeAction.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeAction.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeErrorRenderer.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeErrorRenderer.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenderer.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeRenderer.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeRenderer.js.map +0 -1
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/Renderers.d.ts +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/UseNodeHighlighting.d.ts +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/UseNodeHighlighting.js +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/UseSelectionHandler.d.ts +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/UseSelectionHandler.js +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/Utils.js +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/internal/DisposePolyfill.js +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/internal/TreeActions.js +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/internal/TreeLoader.js +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/internal/TreeModel.d.ts +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/internal/TreeModel.js +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/internal/UseUnifiedSelection.d.ts +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/internal/UseUnifiedSelection.js +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/internal/Utils.js +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/FlatTreeNode.d.ts +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/RootErrorRenderer.d.ts +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/TreeAction.d.ts +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/TreeAction.js +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/TreeNodeFilterAction.d.ts +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/TreeNodeRenameAction.d.ts +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/TreeNodeRenderer.css +0 -0
- /package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/stratakit/TreeNodeRenderer.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { useTranslation } from "./LocalizationContext.js";
|
|
1
2
|
import { TreeActionBase } from "./TreeAction.js";
|
|
2
|
-
import { useLocalizationContext } from "./LocalizationContext.js";
|
|
3
3
|
import { useTreeNodeRenameContext } from "./TreeNodeRenameAction.js";
|
|
4
4
|
import { c } from "react-compiler-runtime";
|
|
5
5
|
import { cloneElement, forwardRef, isValidElement, memo, useEffect, useId, useRef, useState } from "react";
|
|
@@ -13,13 +13,12 @@ import refreshSvg from "@stratakit/icons/refresh.svg";
|
|
|
13
13
|
|
|
14
14
|
//#region src/presentation-hierarchies-react/stratakit/TreeNodeRenderer.tsx
|
|
15
15
|
/**
|
|
16
|
-
* A component that renders given `
|
|
17
|
-
* `FlatTreeNode` objects for this renderer are generally created using the `useFlatTreeNodeList` hook.
|
|
16
|
+
* A component that renders a given `TreeNode` using the `Tree.Item` component from `@stratakit/structures`.
|
|
18
17
|
*
|
|
19
18
|
* @internal
|
|
20
19
|
*/
|
|
21
20
|
const StrataKitTreeNodeRenderer = memo(forwardRef(function HierarchyNode(props, forwardedRef) {
|
|
22
|
-
const $ = c(
|
|
21
|
+
const $ = c(64);
|
|
23
22
|
let contextMenuActions;
|
|
24
23
|
let decorations;
|
|
25
24
|
let expandNode;
|
|
@@ -49,7 +48,7 @@ const StrataKitTreeNodeRenderer = memo(forwardRef(function HierarchyNode(props,
|
|
|
49
48
|
reloadTree = $[7];
|
|
50
49
|
treeItemProps = $[8];
|
|
51
50
|
}
|
|
52
|
-
const
|
|
51
|
+
const translate = useTranslation();
|
|
53
52
|
const renameContext = useTreeNodeRenameContext();
|
|
54
53
|
const [contextMenuProps, setContextMenuProps] = useState(void 0);
|
|
55
54
|
const label = treeItemProps.label ?? node.label;
|
|
@@ -57,29 +56,35 @@ const StrataKitTreeNodeRenderer = memo(forwardRef(function HierarchyNode(props,
|
|
|
57
56
|
bb0: {
|
|
58
57
|
if (node.error !== void 0 && node.error.type === "ChildrenLoad") {
|
|
59
58
|
let t1;
|
|
60
|
-
if ($[9] !==
|
|
61
|
-
t1 = ()
|
|
59
|
+
if ($[9] !== translate) {
|
|
60
|
+
t1 = translate("retry");
|
|
61
|
+
$[9] = translate;
|
|
62
|
+
$[10] = t1;
|
|
63
|
+
} else t1 = $[10];
|
|
64
|
+
let t2;
|
|
65
|
+
if ($[11] !== node.id || $[12] !== reloadTree) {
|
|
66
|
+
t2 = () => reloadTree({
|
|
62
67
|
parentNodeId: node.id,
|
|
63
68
|
state: "reset"
|
|
64
69
|
});
|
|
65
|
-
$[
|
|
66
|
-
$[
|
|
67
|
-
$[
|
|
68
|
-
} else
|
|
69
|
-
let
|
|
70
|
-
if ($[
|
|
71
|
-
|
|
72
|
-
label:
|
|
73
|
-
onClick:
|
|
70
|
+
$[11] = node.id;
|
|
71
|
+
$[12] = reloadTree;
|
|
72
|
+
$[13] = t2;
|
|
73
|
+
} else t2 = $[13];
|
|
74
|
+
let t3;
|
|
75
|
+
if ($[14] !== t1 || $[15] !== t2) {
|
|
76
|
+
t3 = [/* @__PURE__ */ jsx(TreeActionBase, {
|
|
77
|
+
label: t1,
|
|
78
|
+
onClick: t2,
|
|
74
79
|
visible: true,
|
|
75
80
|
icon: refreshSvg,
|
|
76
81
|
variant: "inline"
|
|
77
82
|
}, "retry")];
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
80
|
-
$[
|
|
81
|
-
} else
|
|
82
|
-
t0 =
|
|
83
|
+
$[14] = t1;
|
|
84
|
+
$[15] = t2;
|
|
85
|
+
$[16] = t3;
|
|
86
|
+
} else t3 = $[16];
|
|
87
|
+
t0 = t3;
|
|
83
88
|
break bb0;
|
|
84
89
|
}
|
|
85
90
|
if (!inlineActions) {
|
|
@@ -87,11 +92,11 @@ const StrataKitTreeNodeRenderer = memo(forwardRef(function HierarchyNode(props,
|
|
|
87
92
|
break bb0;
|
|
88
93
|
}
|
|
89
94
|
let t1;
|
|
90
|
-
if ($[
|
|
95
|
+
if ($[17] !== inlineActions) {
|
|
91
96
|
t1 = injectActionVariant(inlineActions, "inline");
|
|
92
|
-
$[
|
|
93
|
-
$[
|
|
94
|
-
} else t1 = $[
|
|
97
|
+
$[17] = inlineActions;
|
|
98
|
+
$[18] = t1;
|
|
99
|
+
} else t1 = $[18];
|
|
95
100
|
t0 = t1;
|
|
96
101
|
}
|
|
97
102
|
const inlineActionItems = t0;
|
|
@@ -102,17 +107,17 @@ const StrataKitTreeNodeRenderer = memo(forwardRef(function HierarchyNode(props,
|
|
|
102
107
|
break bb1;
|
|
103
108
|
}
|
|
104
109
|
let t2;
|
|
105
|
-
if ($[
|
|
110
|
+
if ($[19] !== menuActions) {
|
|
106
111
|
t2 = injectActionVariant(menuActions, "default");
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
} else t2 = $[
|
|
112
|
+
$[19] = menuActions;
|
|
113
|
+
$[20] = t2;
|
|
114
|
+
} else t2 = $[20];
|
|
110
115
|
t1 = t2;
|
|
111
116
|
}
|
|
112
117
|
const menuActionItems = t1;
|
|
113
118
|
let t2;
|
|
114
119
|
bb2: {
|
|
115
|
-
if (node.error) {
|
|
120
|
+
if (node.error && (node.error.type !== "Unknown" || !node.error.isNodeExpandable)) {
|
|
116
121
|
t2 = void 0;
|
|
117
122
|
break bb2;
|
|
118
123
|
}
|
|
@@ -124,17 +129,17 @@ const StrataKitTreeNodeRenderer = memo(forwardRef(function HierarchyNode(props,
|
|
|
124
129
|
}
|
|
125
130
|
const expanded = t2;
|
|
126
131
|
let t3;
|
|
127
|
-
if ($[
|
|
132
|
+
if ($[21] !== renameContext) {
|
|
128
133
|
t3 = renameContext ?? {};
|
|
129
|
-
$[
|
|
130
|
-
$[
|
|
131
|
-
} else t3 = $[
|
|
134
|
+
$[21] = renameContext;
|
|
135
|
+
$[22] = t3;
|
|
136
|
+
} else t3 = $[22];
|
|
132
137
|
const { renameParameters, cancelRename } = t3;
|
|
133
138
|
const t4 = renameParameters?.commit;
|
|
134
139
|
const t5 = renameParameters?.labelValidationHint;
|
|
135
140
|
const t6 = renameParameters?.validate;
|
|
136
141
|
let t7;
|
|
137
|
-
if ($[
|
|
142
|
+
if ($[23] !== cancelRename || $[24] !== node.label || $[25] !== t4 || $[26] !== t5 || $[27] !== t6) {
|
|
138
143
|
t7 = /* @__PURE__ */ jsx(LabelEditor, {
|
|
139
144
|
initialLabel: node.label,
|
|
140
145
|
onChange: t4,
|
|
@@ -142,28 +147,28 @@ const StrataKitTreeNodeRenderer = memo(forwardRef(function HierarchyNode(props,
|
|
|
142
147
|
labelValidationHint: t5,
|
|
143
148
|
validate: t6
|
|
144
149
|
});
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
} else t7 = $[
|
|
150
|
+
$[23] = cancelRename;
|
|
151
|
+
$[24] = node.label;
|
|
152
|
+
$[25] = t4;
|
|
153
|
+
$[26] = t5;
|
|
154
|
+
$[27] = t6;
|
|
155
|
+
$[28] = t7;
|
|
156
|
+
} else t7 = $[28];
|
|
152
157
|
const labelEditor = t7;
|
|
153
158
|
const t8 = renameParameters?.nodeId === node.id;
|
|
154
159
|
let t9;
|
|
155
|
-
if ($[
|
|
160
|
+
if ($[29] !== expandNode || $[30] !== node.id) {
|
|
156
161
|
t9 = (isExpanded) => {
|
|
157
162
|
expandNode(node.id, isExpanded);
|
|
158
163
|
};
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
} else t9 = $[
|
|
164
|
+
$[29] = expandNode;
|
|
165
|
+
$[30] = node.id;
|
|
166
|
+
$[31] = t9;
|
|
167
|
+
} else t9 = $[31];
|
|
163
168
|
const t10 = t9;
|
|
164
169
|
const t11 = node.error ? node.error.id : void 0;
|
|
165
170
|
let t12;
|
|
166
|
-
if ($[
|
|
171
|
+
if ($[32] !== contextMenuActions || $[33] !== treeItemProps) {
|
|
167
172
|
t12 = (e) => {
|
|
168
173
|
if (treeItemProps.onContextMenu) treeItemProps.onContextMenu(e);
|
|
169
174
|
if (!contextMenuActions) return;
|
|
@@ -178,12 +183,12 @@ const StrataKitTreeNodeRenderer = memo(forwardRef(function HierarchyNode(props,
|
|
|
178
183
|
actions
|
|
179
184
|
});
|
|
180
185
|
};
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
184
|
-
} else t12 = $[
|
|
186
|
+
$[32] = contextMenuActions;
|
|
187
|
+
$[33] = treeItemProps;
|
|
188
|
+
$[34] = t12;
|
|
189
|
+
} else t12 = $[34];
|
|
185
190
|
let t13;
|
|
186
|
-
if ($[
|
|
191
|
+
if ($[35] !== decorations || $[36] !== expanded || $[37] !== forwardedRef || $[38] !== inlineActionItems || $[39] !== label || $[40] !== menuActionItems || $[41] !== t10 || $[42] !== t11 || $[43] !== t12 || $[44] !== treeItemProps) {
|
|
187
192
|
t13 = /* @__PURE__ */ jsx(Tree.Item, {
|
|
188
193
|
...treeItemProps,
|
|
189
194
|
ref: forwardedRef,
|
|
@@ -196,20 +201,20 @@ const StrataKitTreeNodeRenderer = memo(forwardRef(function HierarchyNode(props,
|
|
|
196
201
|
error: t11,
|
|
197
202
|
onContextMenu: t12
|
|
198
203
|
});
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
} else t13 = $[
|
|
204
|
+
$[35] = decorations;
|
|
205
|
+
$[36] = expanded;
|
|
206
|
+
$[37] = forwardedRef;
|
|
207
|
+
$[38] = inlineActionItems;
|
|
208
|
+
$[39] = label;
|
|
209
|
+
$[40] = menuActionItems;
|
|
210
|
+
$[41] = t10;
|
|
211
|
+
$[42] = t11;
|
|
212
|
+
$[43] = t12;
|
|
213
|
+
$[44] = treeItemProps;
|
|
214
|
+
$[45] = t13;
|
|
215
|
+
} else t13 = $[45];
|
|
211
216
|
let t14;
|
|
212
|
-
if ($[
|
|
217
|
+
if ($[46] !== cancelRename || $[47] !== labelEditor || $[48] !== t13 || $[49] !== t8) {
|
|
213
218
|
t14 = /* @__PURE__ */ jsx(unstable_Popover, {
|
|
214
219
|
content: labelEditor,
|
|
215
220
|
placement: "bottom",
|
|
@@ -218,23 +223,23 @@ const StrataKitTreeNodeRenderer = memo(forwardRef(function HierarchyNode(props,
|
|
|
218
223
|
unmountOnHide: true,
|
|
219
224
|
children: t13
|
|
220
225
|
});
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
} else t14 = $[
|
|
226
|
+
$[46] = cancelRename;
|
|
227
|
+
$[47] = labelEditor;
|
|
228
|
+
$[48] = t13;
|
|
229
|
+
$[49] = t8;
|
|
230
|
+
$[50] = t14;
|
|
231
|
+
} else t14 = $[50];
|
|
227
232
|
const t15 = contextMenuProps !== void 0;
|
|
228
233
|
let t16;
|
|
229
|
-
if ($[
|
|
234
|
+
if ($[51] === Symbol.for("react.memo_cache_sentinel")) {
|
|
230
235
|
t16 = (open) => {
|
|
231
236
|
if (!open) setContextMenuProps(void 0);
|
|
232
237
|
};
|
|
233
|
-
$[
|
|
234
|
-
} else t16 = $[
|
|
238
|
+
$[51] = t16;
|
|
239
|
+
} else t16 = $[51];
|
|
235
240
|
const t17 = `${node.id}-${contextMenuProps?.position.x ?? ""}-${contextMenuProps?.position.y ?? ""}`;
|
|
236
241
|
let t18;
|
|
237
|
-
if ($[
|
|
242
|
+
if ($[52] !== contextMenuProps) {
|
|
238
243
|
t18 = contextMenuProps ? /* @__PURE__ */ jsx(DropdownMenu.Button, {
|
|
239
244
|
style: {
|
|
240
245
|
position: "fixed",
|
|
@@ -243,80 +248,92 @@ const StrataKitTreeNodeRenderer = memo(forwardRef(function HierarchyNode(props,
|
|
|
243
248
|
},
|
|
244
249
|
render: /* @__PURE__ */ jsx("div", {})
|
|
245
250
|
}) : null;
|
|
246
|
-
$[
|
|
247
|
-
$[
|
|
248
|
-
} else t18 = $[
|
|
251
|
+
$[52] = contextMenuProps;
|
|
252
|
+
$[53] = t18;
|
|
253
|
+
} else t18 = $[53];
|
|
249
254
|
const t19 = contextMenuProps?.actions;
|
|
250
255
|
let t20;
|
|
251
|
-
if ($[
|
|
256
|
+
if ($[54] !== t19) {
|
|
252
257
|
t20 = /* @__PURE__ */ jsx(DropdownMenu.Content, {
|
|
253
258
|
focusable: true,
|
|
254
259
|
autoFocus: true,
|
|
255
260
|
children: t19
|
|
256
261
|
});
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
259
|
-
} else t20 = $[
|
|
262
|
+
$[54] = t19;
|
|
263
|
+
$[55] = t20;
|
|
264
|
+
} else t20 = $[55];
|
|
260
265
|
let t21;
|
|
261
|
-
if ($[
|
|
266
|
+
if ($[56] !== t15 || $[57] !== t17 || $[58] !== t18 || $[59] !== t20) {
|
|
262
267
|
t21 = /* @__PURE__ */ jsxs(DropdownMenu.Provider, {
|
|
263
268
|
open: t15,
|
|
264
269
|
setOpen: t16,
|
|
265
270
|
children: [t18, t20]
|
|
266
271
|
}, t17);
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
} else t21 = $[
|
|
272
|
+
$[56] = t15;
|
|
273
|
+
$[57] = t17;
|
|
274
|
+
$[58] = t18;
|
|
275
|
+
$[59] = t20;
|
|
276
|
+
$[60] = t21;
|
|
277
|
+
} else t21 = $[60];
|
|
273
278
|
let t22;
|
|
274
|
-
if ($[
|
|
279
|
+
if ($[61] !== t14 || $[62] !== t21) {
|
|
275
280
|
t22 = /* @__PURE__ */ jsxs(Fragment, { children: [t14, t21] });
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
} else t22 = $[
|
|
281
|
+
$[61] = t14;
|
|
282
|
+
$[62] = t21;
|
|
283
|
+
$[63] = t22;
|
|
284
|
+
} else t22 = $[63];
|
|
280
285
|
return t22;
|
|
281
286
|
}));
|
|
282
287
|
const PlaceholderNode = memo(forwardRef(function PlaceholderNode(t0, forwardedRef) {
|
|
283
|
-
const $ = c(
|
|
288
|
+
const $ = c(13);
|
|
284
289
|
let props;
|
|
285
290
|
if ($[0] !== t0) {
|
|
286
291
|
({...props} = t0);
|
|
287
292
|
$[0] = t0;
|
|
288
293
|
$[1] = props;
|
|
289
294
|
} else props = $[1];
|
|
290
|
-
const
|
|
295
|
+
const translate = useTranslation();
|
|
291
296
|
let t1;
|
|
292
|
-
if ($[2] !==
|
|
293
|
-
t1 =
|
|
294
|
-
|
|
295
|
-
title: localizedStrings.loading
|
|
296
|
-
});
|
|
297
|
-
$[2] = localizedStrings.loading;
|
|
297
|
+
if ($[2] !== translate) {
|
|
298
|
+
t1 = translate("loading");
|
|
299
|
+
$[2] = translate;
|
|
298
300
|
$[3] = t1;
|
|
299
301
|
} else t1 = $[3];
|
|
300
302
|
let t2;
|
|
301
|
-
if ($[4] !==
|
|
302
|
-
t2 =
|
|
303
|
+
if ($[4] !== translate) {
|
|
304
|
+
t2 = translate("loading");
|
|
305
|
+
$[4] = translate;
|
|
306
|
+
$[5] = t2;
|
|
307
|
+
} else t2 = $[5];
|
|
308
|
+
let t3;
|
|
309
|
+
if ($[6] !== t2) {
|
|
310
|
+
t3 = /* @__PURE__ */ jsx(Spinner, {
|
|
311
|
+
size: "small",
|
|
312
|
+
title: t2
|
|
313
|
+
});
|
|
314
|
+
$[6] = t2;
|
|
315
|
+
$[7] = t3;
|
|
316
|
+
} else t3 = $[7];
|
|
317
|
+
let t4;
|
|
318
|
+
if ($[8] !== forwardedRef || $[9] !== props || $[10] !== t1 || $[11] !== t3) {
|
|
319
|
+
t4 = /* @__PURE__ */ jsx(Tree.Item, {
|
|
303
320
|
...props,
|
|
304
321
|
ref: forwardedRef,
|
|
305
|
-
label:
|
|
306
|
-
unstable_decorations:
|
|
322
|
+
label: t1,
|
|
323
|
+
unstable_decorations: t3
|
|
307
324
|
});
|
|
308
|
-
$[
|
|
309
|
-
$[
|
|
310
|
-
$[
|
|
311
|
-
$[
|
|
312
|
-
$[
|
|
313
|
-
} else
|
|
314
|
-
return
|
|
325
|
+
$[8] = forwardedRef;
|
|
326
|
+
$[9] = props;
|
|
327
|
+
$[10] = t1;
|
|
328
|
+
$[11] = t3;
|
|
329
|
+
$[12] = t4;
|
|
330
|
+
} else t4 = $[12];
|
|
331
|
+
return t4;
|
|
315
332
|
}));
|
|
316
333
|
function LabelEditor(t0) {
|
|
317
|
-
const $ = c(
|
|
334
|
+
const $ = c(49);
|
|
318
335
|
const { initialLabel, labelValidationHint, onChange, onCancel, validate } = t0;
|
|
319
|
-
const
|
|
336
|
+
const translate = useTranslation();
|
|
320
337
|
const inputRef = useRef(null);
|
|
321
338
|
const [newLabelValue, setNewLabelValue] = useState(initialLabel);
|
|
322
339
|
const [hasError, setHasError] = useState(false);
|
|
@@ -378,93 +395,111 @@ function LabelEditor(t0) {
|
|
|
378
395
|
} else t5 = $[11];
|
|
379
396
|
const t6 = hasError ? "with-error" : void 0;
|
|
380
397
|
let t7;
|
|
381
|
-
if ($[12]
|
|
382
|
-
t7 = (
|
|
398
|
+
if ($[12] !== translate) {
|
|
399
|
+
t7 = translate("newLabel");
|
|
400
|
+
$[12] = translate;
|
|
401
|
+
$[13] = t7;
|
|
402
|
+
} else t7 = $[13];
|
|
403
|
+
let t8;
|
|
404
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
405
|
+
t8 = (event) => {
|
|
383
406
|
setNewLabelValue(event.target.value);
|
|
384
407
|
setHasError(false);
|
|
385
408
|
};
|
|
386
|
-
$[
|
|
387
|
-
} else
|
|
388
|
-
let
|
|
389
|
-
if ($[
|
|
390
|
-
|
|
409
|
+
$[14] = t8;
|
|
410
|
+
} else t8 = $[14];
|
|
411
|
+
let t9;
|
|
412
|
+
if ($[15] !== cancelLabelChange || $[16] !== handleLabelChange) {
|
|
413
|
+
t9 = (event_0) => {
|
|
391
414
|
if (event_0.key === "Enter") handleLabelChange();
|
|
392
415
|
else if (event_0.key === "Escape") cancelLabelChange();
|
|
393
416
|
};
|
|
394
|
-
$[
|
|
395
|
-
$[
|
|
396
|
-
$[
|
|
397
|
-
} else
|
|
398
|
-
let
|
|
399
|
-
if ($[
|
|
400
|
-
|
|
417
|
+
$[15] = cancelLabelChange;
|
|
418
|
+
$[16] = handleLabelChange;
|
|
419
|
+
$[17] = t9;
|
|
420
|
+
} else t9 = $[17];
|
|
421
|
+
let t10;
|
|
422
|
+
if ($[18] !== inputId || $[19] !== newLabelValue || $[20] !== t7 || $[21] !== t9) {
|
|
423
|
+
t10 = /* @__PURE__ */ jsx(TextBox.Input, {
|
|
401
424
|
id: inputId,
|
|
402
425
|
ref: inputRef,
|
|
403
|
-
"aria-label":
|
|
426
|
+
"aria-label": t7,
|
|
404
427
|
value: newLabelValue,
|
|
405
|
-
onChange:
|
|
406
|
-
onKeyUp:
|
|
428
|
+
onChange: t8,
|
|
429
|
+
onKeyUp: t9
|
|
407
430
|
});
|
|
408
|
-
$[
|
|
409
|
-
$[
|
|
410
|
-
$[
|
|
411
|
-
$[
|
|
412
|
-
$[
|
|
413
|
-
} else
|
|
414
|
-
let
|
|
415
|
-
if ($[
|
|
416
|
-
|
|
431
|
+
$[18] = inputId;
|
|
432
|
+
$[19] = newLabelValue;
|
|
433
|
+
$[20] = t7;
|
|
434
|
+
$[21] = t9;
|
|
435
|
+
$[22] = t10;
|
|
436
|
+
} else t10 = $[22];
|
|
437
|
+
let t11;
|
|
438
|
+
if ($[23] !== t10 || $[24] !== t6) {
|
|
439
|
+
t11 = /* @__PURE__ */ jsx(TextBox.Root, {
|
|
417
440
|
style: t5,
|
|
418
441
|
className: t6,
|
|
419
|
-
children:
|
|
442
|
+
children: t10
|
|
420
443
|
});
|
|
421
|
-
$[21] = t6;
|
|
422
|
-
$[22] = t9;
|
|
423
444
|
$[23] = t10;
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
$[25] = localizedStrings.cancel;
|
|
434
|
-
$[26] = t11;
|
|
435
|
-
} else t11 = $[26];
|
|
436
|
-
const t12 = !canRename;
|
|
445
|
+
$[24] = t6;
|
|
446
|
+
$[25] = t11;
|
|
447
|
+
} else t11 = $[25];
|
|
448
|
+
let t12;
|
|
449
|
+
if ($[26] !== translate) {
|
|
450
|
+
t12 = translate("cancel");
|
|
451
|
+
$[26] = translate;
|
|
452
|
+
$[27] = t12;
|
|
453
|
+
} else t12 = $[27];
|
|
437
454
|
let t13;
|
|
438
|
-
if ($[
|
|
455
|
+
if ($[28] !== cancelLabelChange || $[29] !== t12) {
|
|
439
456
|
t13 = /* @__PURE__ */ jsx(IconButton, {
|
|
440
|
-
icon:
|
|
441
|
-
label:
|
|
442
|
-
onClick:
|
|
443
|
-
disabled: t12
|
|
457
|
+
icon: dismissSvg,
|
|
458
|
+
label: t12,
|
|
459
|
+
onClick: cancelLabelChange
|
|
444
460
|
});
|
|
445
|
-
$[
|
|
446
|
-
$[28] = localizedStrings.confirm;
|
|
461
|
+
$[28] = cancelLabelChange;
|
|
447
462
|
$[29] = t12;
|
|
448
463
|
$[30] = t13;
|
|
449
464
|
} else t13 = $[30];
|
|
450
465
|
let t14;
|
|
451
|
-
if ($[31] !==
|
|
452
|
-
t14 =
|
|
466
|
+
if ($[31] !== translate) {
|
|
467
|
+
t14 = translate("confirm");
|
|
468
|
+
$[31] = translate;
|
|
469
|
+
$[32] = t14;
|
|
470
|
+
} else t14 = $[32];
|
|
471
|
+
const t15 = !canRename;
|
|
472
|
+
let t16;
|
|
473
|
+
if ($[33] !== handleLabelChange || $[34] !== t14 || $[35] !== t15) {
|
|
474
|
+
t16 = /* @__PURE__ */ jsx(IconButton, {
|
|
475
|
+
icon: checkmarkSvg,
|
|
476
|
+
label: t14,
|
|
477
|
+
onClick: handleLabelChange,
|
|
478
|
+
disabled: t15
|
|
479
|
+
});
|
|
480
|
+
$[33] = handleLabelChange;
|
|
481
|
+
$[34] = t14;
|
|
482
|
+
$[35] = t15;
|
|
483
|
+
$[36] = t16;
|
|
484
|
+
} else t16 = $[36];
|
|
485
|
+
let t17;
|
|
486
|
+
if ($[37] !== t11 || $[38] !== t13 || $[39] !== t16) {
|
|
487
|
+
t17 = /* @__PURE__ */ jsxs("div", {
|
|
453
488
|
className: "phr-node-label-editor-input-row",
|
|
454
489
|
children: [
|
|
455
|
-
t10,
|
|
456
490
|
t11,
|
|
457
|
-
t13
|
|
491
|
+
t13,
|
|
492
|
+
t16
|
|
458
493
|
]
|
|
459
494
|
});
|
|
460
|
-
$[
|
|
461
|
-
$[
|
|
462
|
-
$[
|
|
463
|
-
$[
|
|
464
|
-
} else
|
|
465
|
-
let
|
|
466
|
-
if ($[
|
|
467
|
-
|
|
495
|
+
$[37] = t11;
|
|
496
|
+
$[38] = t13;
|
|
497
|
+
$[39] = t16;
|
|
498
|
+
$[40] = t17;
|
|
499
|
+
} else t17 = $[40];
|
|
500
|
+
let t18;
|
|
501
|
+
if ($[41] !== hasError || $[42] !== inputId || $[43] !== labelValidationHint) {
|
|
502
|
+
t18 = labelValidationHint !== void 0 ? /* @__PURE__ */ jsx(Description, {
|
|
468
503
|
id: inputId,
|
|
469
504
|
tone: hasError ? "critical" : "neutral",
|
|
470
505
|
style: { display: "flex" },
|
|
@@ -473,23 +508,23 @@ function LabelEditor(t0) {
|
|
|
473
508
|
children: labelValidationHint
|
|
474
509
|
})
|
|
475
510
|
}) : void 0;
|
|
476
|
-
$[
|
|
477
|
-
$[
|
|
478
|
-
$[
|
|
479
|
-
$[
|
|
480
|
-
} else
|
|
481
|
-
let
|
|
482
|
-
if ($[
|
|
483
|
-
|
|
511
|
+
$[41] = hasError;
|
|
512
|
+
$[42] = inputId;
|
|
513
|
+
$[43] = labelValidationHint;
|
|
514
|
+
$[44] = t18;
|
|
515
|
+
} else t18 = $[44];
|
|
516
|
+
let t19;
|
|
517
|
+
if ($[45] !== initialLabel || $[46] !== t17 || $[47] !== t18) {
|
|
518
|
+
t19 = /* @__PURE__ */ jsxs("div", {
|
|
484
519
|
className: "phr-node-label-editor",
|
|
485
|
-
children: [
|
|
520
|
+
children: [t17, t18]
|
|
486
521
|
}, initialLabel);
|
|
487
|
-
$[
|
|
488
|
-
$[
|
|
489
|
-
$[
|
|
490
|
-
$[
|
|
491
|
-
} else
|
|
492
|
-
return
|
|
522
|
+
$[45] = initialLabel;
|
|
523
|
+
$[46] = t17;
|
|
524
|
+
$[47] = t18;
|
|
525
|
+
$[48] = t19;
|
|
526
|
+
} else t19 = $[48];
|
|
527
|
+
return t19;
|
|
493
528
|
}
|
|
494
529
|
function injectActionVariant(actions, variant) {
|
|
495
530
|
return actions.filter((action) => isValidElement(action)).map((action) => cloneElement(action, { variant }));
|