@uipath/apollo-react 4.58.0 → 4.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/components/AddNodePanel/AddNodePanelEmptyMessage.cjs +84 -0
- package/dist/canvas/components/AddNodePanel/AddNodePanelEmptyMessage.d.ts +24 -0
- package/dist/canvas/components/AddNodePanel/AddNodePanelEmptyMessage.d.ts.map +1 -0
- package/dist/canvas/components/AddNodePanel/AddNodePanelEmptyMessage.js +50 -0
- package/dist/canvas/components/AddNodePanel/index.cjs +4 -0
- package/dist/canvas/components/AddNodePanel/index.d.ts +1 -0
- package/dist/canvas/components/AddNodePanel/index.d.ts.map +1 -1
- package/dist/canvas/components/AddNodePanel/index.js +2 -1
- package/dist/canvas/components/AgentCanvas/agent-flow.manifest.d.ts +1 -0
- package/dist/canvas/components/AgentCanvas/agent-flow.manifest.d.ts.map +1 -1
- package/dist/canvas/components/CanvasTooltip.cjs +7 -4
- package/dist/canvas/components/CanvasTooltip.d.ts +5 -1
- package/dist/canvas/components/CanvasTooltip.d.ts.map +1 -1
- package/dist/canvas/components/CanvasTooltip.js +7 -4
- package/dist/canvas/components/CaseFlow/case-flow.manifest.d.ts +1 -0
- package/dist/canvas/components/CaseFlow/case-flow.manifest.d.ts.map +1 -1
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.cjs +3 -3
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.js +1 -1
- package/dist/canvas/components/Toolbox/ListView.cjs +152 -50
- package/dist/canvas/components/Toolbox/ListView.d.ts +17 -0
- package/dist/canvas/components/Toolbox/ListView.d.ts.map +1 -1
- package/dist/canvas/components/Toolbox/ListView.js +136 -52
- package/dist/canvas/components/Toolbox/ListView.styles.cjs +12 -23
- package/dist/canvas/components/Toolbox/ListView.styles.d.ts +0 -4
- package/dist/canvas/components/Toolbox/ListView.styles.d.ts.map +1 -1
- package/dist/canvas/components/Toolbox/ListView.styles.js +11 -19
- package/dist/canvas/constants.cjs +1 -1
- package/dist/canvas/constants.d.ts +1 -1
- package/dist/canvas/constants.d.ts.map +1 -1
- package/dist/canvas/constants.js +1 -1
- package/dist/canvas/core/CategoryTreeAdapter.cjs +1 -0
- package/dist/canvas/core/CategoryTreeAdapter.d.ts.map +1 -1
- package/dist/canvas/core/CategoryTreeAdapter.js +1 -0
- package/dist/canvas/schema/node-definition/category-manifest.cjs +1 -0
- package/dist/canvas/schema/node-definition/category-manifest.d.ts +1 -0
- package/dist/canvas/schema/node-definition/category-manifest.d.ts.map +1 -1
- package/dist/canvas/schema/node-definition/category-manifest.js +1 -0
- package/dist/canvas/storybook-utils/manifests/index.d.ts +1 -0
- package/dist/canvas/storybook-utils/manifests/index.d.ts.map +1 -1
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/package.json +2 -2
|
@@ -2,12 +2,30 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Column } from "../../layouts/index.js";
|
|
3
3
|
import { CanvasIcon, partition } from "../../utils/index.js";
|
|
4
4
|
import { Skeleton } from "@uipath/apollo-wind";
|
|
5
|
-
import { forwardRef, memo, useCallback, useImperativeHandle, useMemo } from "react";
|
|
5
|
+
import { forwardRef, memo, useCallback, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { useCanvasTheme } from "../BaseCanvas/CanvasThemeContext.js";
|
|
7
7
|
import { CanvasTooltip } from "../CanvasTooltip.js";
|
|
8
8
|
import { InitialsBadge } from "../shared/InitialsBadge.js";
|
|
9
|
-
import { IconContainer, ListItemButton,
|
|
9
|
+
import { IconContainer, ListItemButton, StyledList } from "./ListView.styles.js";
|
|
10
10
|
const DEFAULT_SKELETON_COUNT = 3;
|
|
11
|
+
const ROW_HEIGHT_ITEM = 32;
|
|
12
|
+
const ROW_HEIGHT_ITEM_TWO_LINE = 44;
|
|
13
|
+
const ROW_HEIGHT_SECTION = 30;
|
|
14
|
+
const ROW_HEIGHT_SECTION_FIRST = 22;
|
|
15
|
+
const ROW_HEIGHT_DIVIDER = 13;
|
|
16
|
+
function getRenderItemHeight(renderItem) {
|
|
17
|
+
if (!renderItem) return ROW_HEIGHT_ITEM;
|
|
18
|
+
switch(renderItem.type){
|
|
19
|
+
case 'divider':
|
|
20
|
+
return ROW_HEIGHT_DIVIDER;
|
|
21
|
+
case 'section':
|
|
22
|
+
return renderItem.first ? ROW_HEIGHT_SECTION_FIRST : ROW_HEIGHT_SECTION;
|
|
23
|
+
case 'skeleton':
|
|
24
|
+
return ROW_HEIGHT_ITEM;
|
|
25
|
+
default:
|
|
26
|
+
return renderItem.item.description ? ROW_HEIGHT_ITEM_TWO_LINE : ROW_HEIGHT_ITEM;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
11
29
|
function buildRenderedItems(items, enableSections, loadingSkeleton) {
|
|
12
30
|
const result = [];
|
|
13
31
|
const skeletonConfig = 'object' == typeof loadingSkeleton ? loadingSkeleton : loadingSkeleton ? {} : void 0;
|
|
@@ -17,6 +35,15 @@ function buildRenderedItems(items, enableSections, loadingSkeleton) {
|
|
|
17
35
|
type: 'skeleton'
|
|
18
36
|
});
|
|
19
37
|
};
|
|
38
|
+
const pushItem = (item)=>{
|
|
39
|
+
if (item.dividerBefore && result.length > 0) result.push({
|
|
40
|
+
type: 'divider'
|
|
41
|
+
});
|
|
42
|
+
result.push({
|
|
43
|
+
type: 'item',
|
|
44
|
+
item
|
|
45
|
+
});
|
|
46
|
+
};
|
|
20
47
|
if (!enableSections) {
|
|
21
48
|
for (const item of items)result.push({
|
|
22
49
|
type: 'item',
|
|
@@ -26,10 +53,7 @@ function buildRenderedItems(items, enableSections, loadingSkeleton) {
|
|
|
26
53
|
return result;
|
|
27
54
|
}
|
|
28
55
|
const [itemsWithSection, itemsWithoutSection] = partition(items, (item)=>!!item.section);
|
|
29
|
-
for (const item of itemsWithoutSection)
|
|
30
|
-
type: 'item',
|
|
31
|
-
item
|
|
32
|
-
});
|
|
56
|
+
for (const item of itemsWithoutSection)pushItem(item);
|
|
33
57
|
const itemsBySection = new Map();
|
|
34
58
|
for (const item of itemsWithSection){
|
|
35
59
|
const name = item.section;
|
|
@@ -50,12 +74,10 @@ function buildRenderedItems(items, enableSections, loadingSkeleton) {
|
|
|
50
74
|
for (const sectionName of sectionNames){
|
|
51
75
|
result.push({
|
|
52
76
|
type: 'section',
|
|
53
|
-
sectionName
|
|
54
|
-
|
|
55
|
-
for (const item of itemsBySection.get(sectionName) ?? [])result.push({
|
|
56
|
-
type: 'item',
|
|
57
|
-
item
|
|
77
|
+
sectionName,
|
|
78
|
+
first: 0 === result.length
|
|
58
79
|
});
|
|
80
|
+
for (const item of itemsBySection.get(sectionName) ?? [])pushItem(item);
|
|
59
81
|
const skeletonForSection = skeletonBySection.get(sectionName);
|
|
60
82
|
if (skeletonForSection) pushSkeletons(skeletonForSection.count ?? baseSkeletonCount);
|
|
61
83
|
}
|
|
@@ -71,6 +93,21 @@ const ListViewRow = /*#__PURE__*/ memo(({ index, style, ariaAttributes, rendered
|
|
|
71
93
|
}), [
|
|
72
94
|
style
|
|
73
95
|
]);
|
|
96
|
+
const nameRef = useRef(null);
|
|
97
|
+
const descriptionRef = useRef(null);
|
|
98
|
+
const [truncated, setTruncated] = useState({
|
|
99
|
+
name: false,
|
|
100
|
+
description: false
|
|
101
|
+
});
|
|
102
|
+
const measureTruncation = useCallback(()=>{
|
|
103
|
+
const n = nameRef.current;
|
|
104
|
+
const d = descriptionRef.current;
|
|
105
|
+
const next = {
|
|
106
|
+
name: !!n && n.scrollWidth > n.clientWidth,
|
|
107
|
+
description: !!d && d.scrollWidth > d.clientWidth
|
|
108
|
+
};
|
|
109
|
+
setTruncated((prev)=>prev.name === next.name && prev.description === next.description ? prev : next);
|
|
110
|
+
}, []);
|
|
74
111
|
const handleButtonClick = useCallback(()=>{
|
|
75
112
|
const clickTarget = renderedItems[index];
|
|
76
113
|
if (clickTarget?.type === 'item') onItemClick(clickTarget.item, index);
|
|
@@ -80,18 +117,22 @@ const ListViewRow = /*#__PURE__*/ memo(({ index, style, ariaAttributes, rendered
|
|
|
80
117
|
index
|
|
81
118
|
]);
|
|
82
119
|
const handleButtonHover = useCallback(()=>{
|
|
120
|
+
measureTruncation();
|
|
83
121
|
const hoverTarget = renderedItems[index];
|
|
84
122
|
if (hoverTarget?.type === 'item') onItemHover?.(hoverTarget.item);
|
|
85
123
|
}, [
|
|
124
|
+
measureTruncation,
|
|
86
125
|
onItemHover,
|
|
87
126
|
renderedItems,
|
|
88
127
|
index
|
|
89
128
|
]);
|
|
90
|
-
if ('section' === renderItem.type) return /*#__PURE__*/ jsx(
|
|
91
|
-
|
|
129
|
+
if ('section' === renderItem.type) return /*#__PURE__*/ jsx("div", {
|
|
130
|
+
role: "presentation",
|
|
92
131
|
style: style,
|
|
132
|
+
className: `flex items-end box-border ${renderItem.first ? 'px-2 py-1' : 'px-2 pt-3 pb-1'}`,
|
|
133
|
+
"data-testid": "list-section-header",
|
|
93
134
|
children: /*#__PURE__*/ jsx("span", {
|
|
94
|
-
className: "text-xs",
|
|
135
|
+
className: "uppercase text-foreground-muted font-bold text-xs",
|
|
95
136
|
children: renderItem.sectionName
|
|
96
137
|
})
|
|
97
138
|
});
|
|
@@ -99,10 +140,20 @@ const ListViewRow = /*#__PURE__*/ memo(({ index, style, ariaAttributes, rendered
|
|
|
99
140
|
style: style,
|
|
100
141
|
children: /*#__PURE__*/ jsx(ListItemSkeleton, {})
|
|
101
142
|
});
|
|
143
|
+
if ('divider' === renderItem.type) return /*#__PURE__*/ jsx("div", {
|
|
144
|
+
role: "presentation",
|
|
145
|
+
"aria-hidden": "true",
|
|
146
|
+
"data-testid": "list-item-divider",
|
|
147
|
+
style: style,
|
|
148
|
+
className: "flex items-center box-border px-1.5",
|
|
149
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
150
|
+
className: "w-full border-t border-border-de-emp"
|
|
151
|
+
})
|
|
152
|
+
});
|
|
102
153
|
const item = renderItem.item;
|
|
103
154
|
const bgColor = isDarkMode ? item.colorDark ?? item.color : item.color;
|
|
104
155
|
const isActive = index === activeIndex;
|
|
105
|
-
|
|
156
|
+
const button = /*#__PURE__*/ jsxs(ListItemButton, {
|
|
106
157
|
...ariaAttributes,
|
|
107
158
|
tabIndex: -1,
|
|
108
159
|
id: `toolbox-item-${item.id}`,
|
|
@@ -116,24 +167,24 @@ const ListViewRow = /*#__PURE__*/ memo(({ index, style, ariaAttributes, rendered
|
|
|
116
167
|
children: [
|
|
117
168
|
/*#__PURE__*/ jsxs(IconContainerMemoized, {
|
|
118
169
|
bgColor: bgColor,
|
|
119
|
-
|
|
170
|
+
style: item.contentColor ? {
|
|
171
|
+
color: item.contentColor
|
|
172
|
+
} : void 0,
|
|
120
173
|
"data-testid": "list-item-icon",
|
|
121
174
|
children: [
|
|
122
175
|
item.icon?.url && /*#__PURE__*/ jsx("img", {
|
|
123
176
|
src: item.icon?.url,
|
|
124
177
|
alt: item.name,
|
|
125
|
-
|
|
126
|
-
width: 24,
|
|
127
|
-
height: 24
|
|
128
|
-
}
|
|
178
|
+
className: "w-5 h-5"
|
|
129
179
|
}),
|
|
130
180
|
item.icon?.name && /*#__PURE__*/ jsx(CanvasIcon, {
|
|
131
181
|
icon: item.icon.name,
|
|
132
|
-
size:
|
|
182
|
+
size: 20
|
|
133
183
|
}),
|
|
134
184
|
item.icon?.Component && /*#__PURE__*/ jsx(item.icon.Component, {}),
|
|
135
185
|
!item.icon?.url && !item.icon?.name && !item.icon?.Component && /*#__PURE__*/ jsx(InitialsBadge, {
|
|
136
186
|
name: item.name,
|
|
187
|
+
size: "20px",
|
|
137
188
|
"data-testid": "list-item-initials-badge"
|
|
138
189
|
})
|
|
139
190
|
]
|
|
@@ -142,53 +193,83 @@ const ListViewRow = /*#__PURE__*/ memo(({ index, style, ariaAttributes, rendered
|
|
|
142
193
|
flex: 1,
|
|
143
194
|
overflow: "hidden",
|
|
144
195
|
children: [
|
|
145
|
-
/*#__PURE__*/ jsx(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
})
|
|
196
|
+
/*#__PURE__*/ jsx("span", {
|
|
197
|
+
ref: nameRef,
|
|
198
|
+
className: "text-sm list-view-item-name",
|
|
199
|
+
style: item.contentColor ? {
|
|
200
|
+
color: item.contentColor
|
|
201
|
+
} : void 0,
|
|
202
|
+
children: item.name
|
|
153
203
|
}),
|
|
154
|
-
item.description && /*#__PURE__*/ jsx(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
children: /*#__PURE__*/ jsx("span", {
|
|
159
|
-
className: "text-xs list-view-item-name text-foreground-muted",
|
|
160
|
-
children: item.description
|
|
161
|
-
})
|
|
204
|
+
item.description && /*#__PURE__*/ jsx("span", {
|
|
205
|
+
ref: descriptionRef,
|
|
206
|
+
className: "text-xs list-view-item-name text-foreground-muted",
|
|
207
|
+
children: item.description
|
|
162
208
|
})
|
|
163
209
|
]
|
|
164
210
|
}),
|
|
211
|
+
item.badge && /*#__PURE__*/ jsx("span", {
|
|
212
|
+
className: "shrink-0 uppercase font-semibold text-[10px] py-px px-1 rounded border border-border text-foreground-muted",
|
|
213
|
+
"data-testid": "list-item-badge",
|
|
214
|
+
children: item.badge
|
|
215
|
+
}),
|
|
216
|
+
item.trailingIcon && !item.children && /*#__PURE__*/ jsx("span", {
|
|
217
|
+
"data-testid": "list-item-trailing-icon",
|
|
218
|
+
className: "flex shrink-0",
|
|
219
|
+
children: /*#__PURE__*/ jsx(CanvasIcon, {
|
|
220
|
+
icon: item.trailingIcon.name,
|
|
221
|
+
size: 16,
|
|
222
|
+
color: item.trailingIcon.color ?? 'var(--canvas-foreground-de-emp)'
|
|
223
|
+
})
|
|
224
|
+
}),
|
|
165
225
|
!!item.children && /*#__PURE__*/ jsx(CanvasIcon, {
|
|
166
226
|
icon: "chevron-right",
|
|
167
|
-
size:
|
|
227
|
+
size: 16,
|
|
168
228
|
color: "var(--canvas-foreground-de-emp)"
|
|
169
229
|
})
|
|
170
230
|
]
|
|
171
231
|
});
|
|
232
|
+
const showName = truncated.name;
|
|
233
|
+
const showDescription = !!item.description && truncated.description;
|
|
234
|
+
const showPopover = truncated.name || truncated.description || !!item.detail;
|
|
235
|
+
const popover = showPopover ? /*#__PURE__*/ jsxs("div", {
|
|
236
|
+
className: "flex flex-col gap-0.5",
|
|
237
|
+
children: [
|
|
238
|
+
showName && /*#__PURE__*/ jsx("span", {
|
|
239
|
+
className: "text-sm",
|
|
240
|
+
children: item.name
|
|
241
|
+
}),
|
|
242
|
+
showDescription && /*#__PURE__*/ jsx("span", {
|
|
243
|
+
className: "text-xs text-foreground-muted",
|
|
244
|
+
children: item.description
|
|
245
|
+
}),
|
|
246
|
+
item.detail && /*#__PURE__*/ jsx("span", {
|
|
247
|
+
className: "text-xs",
|
|
248
|
+
children: item.detail
|
|
249
|
+
})
|
|
250
|
+
]
|
|
251
|
+
}) : null;
|
|
252
|
+
return /*#__PURE__*/ jsx(CanvasTooltip, {
|
|
253
|
+
content: popover,
|
|
254
|
+
placement: "right",
|
|
255
|
+
delay: true,
|
|
256
|
+
contentClassName: "max-w-64",
|
|
257
|
+
hide: !showPopover,
|
|
258
|
+
disableSkipDelay: true,
|
|
259
|
+
children: button
|
|
260
|
+
}, item.id);
|
|
172
261
|
});
|
|
173
262
|
const ListItemSkeleton = ()=>/*#__PURE__*/ jsxs("div", {
|
|
174
|
-
className: "flex items-center gap-2.5 h-8",
|
|
263
|
+
className: "flex items-center gap-2.5 h-8 px-1.5",
|
|
175
264
|
role: "presentation",
|
|
176
265
|
"aria-hidden": "true",
|
|
177
266
|
"data-testid": "list-item-skeleton",
|
|
178
267
|
children: [
|
|
179
268
|
/*#__PURE__*/ jsx(Skeleton, {
|
|
180
|
-
className: "h-
|
|
269
|
+
className: "h-6 w-6 shrink-0 rounded-md"
|
|
181
270
|
}),
|
|
182
|
-
/*#__PURE__*/
|
|
183
|
-
className: "
|
|
184
|
-
children: [
|
|
185
|
-
/*#__PURE__*/ jsx(Skeleton, {
|
|
186
|
-
className: "h-3.5 w-1/3"
|
|
187
|
-
}),
|
|
188
|
-
/*#__PURE__*/ jsx(Skeleton, {
|
|
189
|
-
className: "h-3 w-2/3"
|
|
190
|
-
})
|
|
191
|
-
]
|
|
271
|
+
/*#__PURE__*/ jsx(Skeleton, {
|
|
272
|
+
className: "h-3.5 w-1/2"
|
|
192
273
|
})
|
|
193
274
|
]
|
|
194
275
|
});
|
|
@@ -220,6 +301,9 @@ const ListViewInner = /*#__PURE__*/ forwardRef(function({ items, activeIndex = -
|
|
|
220
301
|
onItemClick,
|
|
221
302
|
onItemHover
|
|
222
303
|
]);
|
|
304
|
+
const getRowHeight = useCallback((index)=>getRenderItemHeight(renderedItems[index]), [
|
|
305
|
+
renderedItems
|
|
306
|
+
]);
|
|
223
307
|
if (0 === renderedItems.length) {
|
|
224
308
|
if (renderEmptyState) return renderEmptyState();
|
|
225
309
|
return /*#__PURE__*/ jsxs(Column, {
|
|
@@ -251,10 +335,10 @@ const ListViewInner = /*#__PURE__*/ forwardRef(function({ items, activeIndex = -
|
|
|
251
335
|
rowProps: rowProps,
|
|
252
336
|
rowComponent: ListViewRow,
|
|
253
337
|
rowCount: renderedItems.length,
|
|
254
|
-
rowHeight:
|
|
338
|
+
rowHeight: getRowHeight,
|
|
255
339
|
overscanCount: 20,
|
|
256
340
|
onScroll: onScroll
|
|
257
341
|
});
|
|
258
342
|
});
|
|
259
343
|
const ListView_ListView = /*#__PURE__*/ memo(ListViewInner);
|
|
260
|
-
export { ListView_ListView as ListView, buildRenderedItems };
|
|
344
|
+
export { ListView_ListView as ListView, ROW_HEIGHT_DIVIDER, ROW_HEIGHT_ITEM, ROW_HEIGHT_ITEM_TWO_LINE, ROW_HEIGHT_SECTION, ROW_HEIGHT_SECTION_FIRST, buildRenderedItems, getRenderItemHeight };
|
|
@@ -33,29 +33,14 @@ var __webpack_require__ = {};
|
|
|
33
33
|
var __webpack_exports__ = {};
|
|
34
34
|
__webpack_require__.r(__webpack_exports__);
|
|
35
35
|
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
-
IconContainer: ()=>IconContainer,
|
|
37
36
|
StyledList: ()=>StyledList,
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
ListItemButton: ()=>ListItemButton,
|
|
38
|
+
IconContainer: ()=>IconContainer
|
|
40
39
|
});
|
|
41
40
|
const styled_namespaceObject = require("@emotion/styled");
|
|
42
41
|
var styled_default = /*#__PURE__*/ __webpack_require__.n(styled_namespaceObject);
|
|
43
42
|
const react_namespaceObject = require("motion/react");
|
|
44
43
|
const external_react_window_namespaceObject = require("react-window");
|
|
45
|
-
const SectionHeader = styled_default().div`
|
|
46
|
-
display: flex;
|
|
47
|
-
align-items: center;
|
|
48
|
-
border-top: 1px solid var(--canvas-border-de-emp);
|
|
49
|
-
|
|
50
|
-
&:first-of-type {
|
|
51
|
-
border-top: none;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
&.loading {
|
|
55
|
-
opacity: 0.5;
|
|
56
|
-
pointer-events: none;
|
|
57
|
-
}
|
|
58
|
-
`;
|
|
59
44
|
const ListItemButton = styled_default()(react_namespaceObject.motion.button)`
|
|
60
45
|
display: flex;
|
|
61
46
|
align-items: center;
|
|
@@ -66,6 +51,10 @@ const ListItemButton = styled_default()(react_namespaceObject.motion.button)`
|
|
|
66
51
|
cursor: pointer;
|
|
67
52
|
text-align: left;
|
|
68
53
|
width: 100%;
|
|
54
|
+
// Don't rely on a consumer's global reset: the row combines width:100% + an
|
|
55
|
+
// explicit react-window height with its own padding, so content-box would
|
|
56
|
+
// overflow the slot and desync the virtualizer's row positions.
|
|
57
|
+
box-sizing: border-box;
|
|
69
58
|
// Reserve the focus ring geometry in the resting state (invisible via a
|
|
70
59
|
// transparent color) so activating a row only flips outline-color. Without
|
|
71
60
|
// this the outline falls back to UA defaults (3px / currentColor) and every
|
|
@@ -84,13 +73,15 @@ const ListItemButton = styled_default()(react_namespaceObject.motion.button)`
|
|
|
84
73
|
}
|
|
85
74
|
`;
|
|
86
75
|
const IconContainer = styled_default().div`
|
|
87
|
-
width:
|
|
88
|
-
height:
|
|
76
|
+
width: 24px;
|
|
77
|
+
height: 24px;
|
|
89
78
|
display: flex;
|
|
90
79
|
align-items: center;
|
|
91
80
|
justify-content: center;
|
|
92
|
-
background
|
|
93
|
-
|
|
81
|
+
// Transparent unless the item declares a background (color / colorDark),
|
|
82
|
+
// so plain rows read as icon + text without a tile.
|
|
83
|
+
background: ${(props)=>props.bgColor || 'transparent'};
|
|
84
|
+
border-radius: 6px;
|
|
94
85
|
color: var(--canvas-foreground-emp);
|
|
95
86
|
opacity: 0.9;
|
|
96
87
|
flex-shrink: 0;
|
|
@@ -134,12 +125,10 @@ const StyledList = styled_default()(external_react_window_namespaceObject.List)`
|
|
|
134
125
|
`;
|
|
135
126
|
exports.IconContainer = __webpack_exports__.IconContainer;
|
|
136
127
|
exports.ListItemButton = __webpack_exports__.ListItemButton;
|
|
137
|
-
exports.SectionHeader = __webpack_exports__.SectionHeader;
|
|
138
128
|
exports.StyledList = __webpack_exports__.StyledList;
|
|
139
129
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
140
130
|
"IconContainer",
|
|
141
131
|
"ListItemButton",
|
|
142
|
-
"SectionHeader",
|
|
143
132
|
"StyledList"
|
|
144
133
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
145
134
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { List } from 'react-window';
|
|
2
|
-
export declare const SectionHeader: import("@emotion/styled").StyledComponent<{
|
|
3
|
-
theme?: import("@emotion/react").Theme;
|
|
4
|
-
as?: React.ElementType;
|
|
5
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
2
|
export declare const ListItemButton: import("@emotion/styled").StyledComponent<Omit<import("motion/react").HTMLMotionProps<"button">, "ref"> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
7
3
|
theme?: import("@emotion/react").Theme;
|
|
8
4
|
}, {}, {}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListView.styles.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Toolbox/ListView.styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"ListView.styles.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Toolbox/ListView.styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,eAAO,MAAM,cAAc;;UA8B1B,CAAC;AAEF,eAAO,MAAM,aAAa;;;;cAA0B,MAAM;yGAezD,CAAC;AAEF,eAAO,MAAM,UAAU,EAkClB,OAAO,IAAI,CAAC"}
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { motion } from "motion/react";
|
|
3
3
|
import { List } from "react-window";
|
|
4
|
-
const SectionHeader = styled.div`
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
border-top: 1px solid var(--canvas-border-de-emp);
|
|
8
|
-
|
|
9
|
-
&:first-of-type {
|
|
10
|
-
border-top: none;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
&.loading {
|
|
14
|
-
opacity: 0.5;
|
|
15
|
-
pointer-events: none;
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
4
|
const ListItemButton = styled(motion.button)`
|
|
19
5
|
display: flex;
|
|
20
6
|
align-items: center;
|
|
@@ -25,6 +11,10 @@ const ListItemButton = styled(motion.button)`
|
|
|
25
11
|
cursor: pointer;
|
|
26
12
|
text-align: left;
|
|
27
13
|
width: 100%;
|
|
14
|
+
// Don't rely on a consumer's global reset: the row combines width:100% + an
|
|
15
|
+
// explicit react-window height with its own padding, so content-box would
|
|
16
|
+
// overflow the slot and desync the virtualizer's row positions.
|
|
17
|
+
box-sizing: border-box;
|
|
28
18
|
// Reserve the focus ring geometry in the resting state (invisible via a
|
|
29
19
|
// transparent color) so activating a row only flips outline-color. Without
|
|
30
20
|
// this the outline falls back to UA defaults (3px / currentColor) and every
|
|
@@ -43,13 +33,15 @@ const ListItemButton = styled(motion.button)`
|
|
|
43
33
|
}
|
|
44
34
|
`;
|
|
45
35
|
const IconContainer = styled.div`
|
|
46
|
-
width:
|
|
47
|
-
height:
|
|
36
|
+
width: 24px;
|
|
37
|
+
height: 24px;
|
|
48
38
|
display: flex;
|
|
49
39
|
align-items: center;
|
|
50
40
|
justify-content: center;
|
|
51
|
-
background
|
|
52
|
-
|
|
41
|
+
// Transparent unless the item declares a background (color / colorDark),
|
|
42
|
+
// so plain rows read as icon + text without a tile.
|
|
43
|
+
background: ${(props)=>props.bgColor || 'transparent'};
|
|
44
|
+
border-radius: 6px;
|
|
53
45
|
color: var(--canvas-foreground-emp);
|
|
54
46
|
opacity: 0.9;
|
|
55
47
|
flex-shrink: 0;
|
|
@@ -91,4 +83,4 @@ const StyledList = styled(List)`
|
|
|
91
83
|
}
|
|
92
84
|
}
|
|
93
85
|
`;
|
|
94
|
-
export { IconContainer, ListItemButton,
|
|
86
|
+
export { IconContainer, ListItemButton, StyledList };
|
|
@@ -60,7 +60,7 @@ const DEFAULT_NODE_SIZE = 96;
|
|
|
60
60
|
const GRID_SPACING = 16;
|
|
61
61
|
const CANVAS_COMPACT_BREAKPOINT = 600;
|
|
62
62
|
const TOOLBOX_WIDTH = 320;
|
|
63
|
-
const TOOLBOX_HEIGHT =
|
|
63
|
+
const TOOLBOX_HEIGHT = 410;
|
|
64
64
|
const TOOLBOX_PADDING_X = 20;
|
|
65
65
|
const TOOLBOX_PADDING_Y = 12;
|
|
66
66
|
const TOOLBOX_GAP = 12;
|
|
@@ -5,7 +5,7 @@ export declare const DEFAULT_NODE_SIZE = 96;
|
|
|
5
5
|
export declare const GRID_SPACING = 16;
|
|
6
6
|
export declare const CANVAS_COMPACT_BREAKPOINT = 600;
|
|
7
7
|
export declare const TOOLBOX_WIDTH = 320;
|
|
8
|
-
export declare const TOOLBOX_HEIGHT =
|
|
8
|
+
export declare const TOOLBOX_HEIGHT = 410;
|
|
9
9
|
export declare const TOOLBOX_PADDING_X = 20;
|
|
10
10
|
export declare const TOOLBOX_PADDING_Y = 12;
|
|
11
11
|
export declare const TOOLBOX_GAP = 12;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/canvas/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,wBAAwB,WAAW,CAAC;AACjD,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,eAAO,MAAM,YAAY,KAAK,CAAC;AAG/B,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAG7C,eAAO,MAAM,aAAa,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/canvas/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,wBAAwB,WAAW,CAAC;AACjD,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,eAAO,MAAM,YAAY,KAAK,CAAC;AAG/B,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAG7C,eAAO,MAAM,aAAa,MAAM,CAAC;AAOjC,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,eAAO,MAAM,WAAW,KAAK,CAAC;AAU9B,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAG/C,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAGhD,eAAO,MAAM,mBAAmB,QAAmB,CAAC;AACpD,eAAO,MAAM,yBAAyB,QAAmB,CAAC;AAC1D,eAAO,MAAM,yBAAyB,QAAoB,CAAC;AAC3D,eAAO,MAAM,yBAAyB,QAAoB,CAAC;AAO3D,eAAO,MAAM,2BAA2B,QAAyB,CAAC;AAClE,eAAO,MAAM,sBAAsB,QAAyB,CAAC;AAC7D,eAAO,MAAM,qBAAqB,QAAyB,CAAC;AAC5D,eAAO,MAAM,uBAAuB,QAAyB,CAAC;AAC9D,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAGlC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAGvC,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,oCAAoC,MAAM,CAAC;AAGxD,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,eAAO,MAAM,uBAAuB,KAAK,CAAC"}
|
package/dist/canvas/constants.js
CHANGED
|
@@ -5,7 +5,7 @@ const DEFAULT_NODE_SIZE = 96;
|
|
|
5
5
|
const GRID_SPACING = 16;
|
|
6
6
|
const CANVAS_COMPACT_BREAKPOINT = 600;
|
|
7
7
|
const TOOLBOX_WIDTH = 320;
|
|
8
|
-
const TOOLBOX_HEIGHT =
|
|
8
|
+
const TOOLBOX_HEIGHT = 410;
|
|
9
9
|
const TOOLBOX_PADDING_X = 20;
|
|
10
10
|
const TOOLBOX_PADDING_Y = 12;
|
|
11
11
|
const TOOLBOX_GAP = 12;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoryTreeAdapter.d.ts","sourceRoot":"","sources":["../../../src/canvas/core/CategoryTreeAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,gBAAgB,CAAC;AAcrE,qBAAa,mBAAmB;IAClB,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,YAAY;IAetC,WAAW,IAAI,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"CategoryTreeAdapter.d.ts","sourceRoot":"","sources":["../../../src/canvas/core/CategoryTreeAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,gBAAgB,CAAC;AAcrE,qBAAa,mBAAmB;IAClB,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,YAAY;IAetC,WAAW,IAAI,QAAQ,EAAE;CAkE1B"}
|
|
@@ -30,6 +30,7 @@ const external_zod_namespaceObject = require("zod");
|
|
|
30
30
|
const categoryManifestSchema = external_zod_namespaceObject.z.object({
|
|
31
31
|
id: external_zod_namespaceObject.z.string().min(1),
|
|
32
32
|
name: external_zod_namespaceObject.z.string().min(1),
|
|
33
|
+
description: external_zod_namespaceObject.z.string().optional(),
|
|
33
34
|
parentId: external_zod_namespaceObject.z.string().optional(),
|
|
34
35
|
sortOrder: external_zod_namespaceObject.z.number().int().nonnegative(),
|
|
35
36
|
color: external_zod_namespaceObject.z.string().min(1).optional(),
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const categoryManifestSchema: z.ZodObject<{
|
|
3
3
|
id: z.ZodString;
|
|
4
4
|
name: z.ZodString;
|
|
5
|
+
description: z.ZodOptional<z.ZodString>;
|
|
5
6
|
parentId: z.ZodOptional<z.ZodString>;
|
|
6
7
|
sortOrder: z.ZodNumber;
|
|
7
8
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category-manifest.d.ts","sourceRoot":"","sources":["../../../../src/canvas/schema/node-definition/category-manifest.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"category-manifest.d.ts","sourceRoot":"","sources":["../../../../src/canvas/schema/node-definition/category-manifest.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,eAAO,MAAM,sBAAsB;;;;;;;;;;iBA2CjC,CAAC;AAGH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
const categoryManifestSchema = z.object({
|
|
3
3
|
id: z.string().min(1),
|
|
4
4
|
name: z.string().min(1),
|
|
5
|
+
description: z.string().optional(),
|
|
5
6
|
parentId: z.string().optional(),
|
|
6
7
|
sortOrder: z.number().int().nonnegative(),
|
|
7
8
|
color: z.string().min(1).optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/storybook-utils/manifests/index.ts"],"names":[],"mappings":"AAGA,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AAKnC,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/storybook-utils/manifests/index.ts"],"names":[],"mappings":"AAGA,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AAKnC,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAInC,CAAC"}
|