@arcadeai/design-system 3.27.0 → 3.27.2
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/README.md +2 -2
- package/dist/assets/icons/railway.js +10 -0
- package/dist/calendar-w1IATMME.js +3042 -0
- package/dist/components/index.js +444 -435
- package/dist/components/ui/atoms/accordion.js +4 -4
- package/dist/components/ui/atoms/alert-dialog.js +11 -11
- package/dist/components/ui/atoms/breadcrumb.js +3 -3
- package/dist/components/ui/atoms/calendar.d.ts +21 -0
- package/dist/components/ui/atoms/calendar.d.ts.map +1 -0
- package/dist/components/ui/atoms/calendar.js +10 -0
- package/dist/components/ui/atoms/command.js +1 -1
- package/dist/components/ui/atoms/dialog.js +1 -1
- package/dist/components/ui/atoms/dropdown-menu.js +5 -5
- package/dist/components/ui/atoms/form.js +3 -3
- package/dist/components/ui/atoms/hover-card.js +1 -1
- package/dist/components/ui/atoms/icons/index.d.ts +1 -0
- package/dist/components/ui/atoms/icons/index.d.ts.map +1 -1
- package/dist/components/ui/atoms/icons/index.js +80 -78
- package/dist/components/ui/atoms/icons/railway.d.ts +4 -0
- package/dist/components/ui/atoms/icons/railway.d.ts.map +1 -0
- package/dist/components/ui/atoms/icons/railway.js +31 -0
- package/dist/components/ui/atoms/index.d.ts +2 -0
- package/dist/components/ui/atoms/index.d.ts.map +1 -1
- package/dist/components/ui/atoms/index.js +429 -422
- package/dist/components/ui/atoms/popover.js +5 -5
- package/dist/components/ui/atoms/radio-group.js +1 -1
- package/dist/components/ui/atoms/resizable.js +3 -3
- package/dist/components/ui/atoms/select.js +1 -1
- package/dist/components/ui/atoms/sheet.js +4 -4
- package/dist/components/ui/atoms/tabs.js +1 -1
- package/dist/components/ui/atoms/tooltip.js +1 -1
- package/dist/components/ui/atoms/virtualized-grid.d.ts +23 -0
- package/dist/components/ui/atoms/virtualized-grid.d.ts.map +1 -0
- package/dist/components/ui/atoms/virtualized-grid.js +682 -0
- package/dist/components/ui/index.js +444 -435
- package/dist/components/ui/molecules/date-time-picker.d.ts +12 -0
- package/dist/components/ui/molecules/date-time-picker.d.ts.map +1 -0
- package/dist/components/ui/molecules/date-time-picker.js +84 -0
- package/dist/components/ui/molecules/index.d.ts +1 -0
- package/dist/components/ui/molecules/index.d.ts.map +1 -1
- package/dist/components/ui/molecules/index.js +13 -11
- package/dist/components/ui/molecules/requirement-badges.js +7 -6
- package/dist/components/ui/molecules/toolkit-card.d.ts.map +1 -1
- package/dist/components/ui/molecules/toolkit-card.js +1 -1
- package/dist/components/ui/molecules/toolkit-selection-summary.js +6 -5
- package/dist/components/ui/organisms/toolkit-picker/components/search-input.js +16 -15
- package/dist/components/ui/organisms/toolkit-picker/components/select-button.d.ts.map +1 -1
- package/dist/components/ui/organisms/toolkit-picker/components/select-button.js +11 -10
- package/dist/components/ui/organisms/toolkit-picker/components/toolkit-card-with-selection.js +1 -1
- package/dist/components/ui/organisms/toolkit-picker/components/toolkit-list.d.ts +3 -1
- package/dist/components/ui/organisms/toolkit-picker/components/toolkit-list.d.ts.map +1 -1
- package/dist/components/ui/organisms/toolkit-picker/components/toolkit-list.js +110 -58
- package/dist/components/ui/organisms/toolkit-picker/components/tools-list.d.ts +3 -1
- package/dist/components/ui/organisms/toolkit-picker/components/tools-list.d.ts.map +1 -1
- package/dist/components/ui/organisms/toolkit-picker/components/tools-list.js +75 -70
- package/dist/components/ui/organisms/toolkit-picker/hooks/featured-toolkits.d.ts +8 -0
- package/dist/components/ui/organisms/toolkit-picker/hooks/featured-toolkits.d.ts.map +1 -0
- package/dist/components/ui/organisms/toolkit-picker/hooks/featured-toolkits.js +11 -0
- package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker.d.ts +6 -4
- package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker.d.ts.map +1 -1
- package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker.js +195 -261
- package/dist/components/ui/organisms/toolkit-picker/mocks/toolkit-collection.d.ts +5 -1
- package/dist/components/ui/organisms/toolkit-picker/mocks/toolkit-collection.d.ts.map +1 -1
- package/dist/components/ui/organisms/toolkit-picker/mocks/toolkit-collection.js +154 -80
- package/dist/components/ui/organisms/toolkit-picker/toolkit-picker.d.ts.map +1 -1
- package/dist/components/ui/organisms/toolkit-picker/toolkit-picker.js +89 -75
- package/dist/hooks/use-columns.d.ts +6 -0
- package/dist/hooks/use-columns.d.ts.map +1 -0
- package/dist/hooks/use-columns.js +20 -0
- package/dist/{index-C8tglJS9.js → index-By-GFSsC.js} +3 -3
- package/dist/{index-8kzT5-zz.js → index-DO05OIM5.js} +385 -380
- package/dist/main.js +478 -469
- package/dist/metadata/toolkit-icons.d.ts.map +1 -1
- package/dist/metadata/toolkit-icons.js +80 -78
- package/dist/metadata/toolkits.js +13 -13
- package/dist/metadata/utils.js +3 -3
- package/dist/{react-resizable-panels.browser-31wAXhAV.js → react-resizable-panels.browser-DYl0LXfw.js} +5 -5
- package/dist/{toolkit-card-CsV6xoOG.js → toolkit-card-D6Dqff6p.js} +5 -3
- package/package.json +43 -34
|
@@ -1,323 +1,257 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
) : new Set(
|
|
6
|
-
if (!
|
|
1
|
+
import { jsx as A } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as F, useReducer as b, useMemo as _, useEffect as g, useContext as v } from "react";
|
|
3
|
+
const I = (e, o) => o ? new Set(
|
|
4
|
+
e.filter((t) => t.searchableText?.toLowerCase().includes(o))
|
|
5
|
+
) : new Set(e), C = (e, o) => {
|
|
6
|
+
if (!o)
|
|
7
7
|
return [];
|
|
8
|
-
const
|
|
9
|
-
if (!
|
|
8
|
+
const t = o.toolkitMap?.get(e);
|
|
9
|
+
if (!t?.tools?.length)
|
|
10
10
|
return [];
|
|
11
|
-
if (!
|
|
11
|
+
if (!o.tools?.length)
|
|
12
12
|
return [];
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
},
|
|
16
|
-
if (!
|
|
13
|
+
const s = new Set(t.tools.map((l) => l.fully_qualified_name));
|
|
14
|
+
return o.tools.filter((l) => s.has(l.fully_qualified_name));
|
|
15
|
+
}, q = (e, o) => {
|
|
16
|
+
if (!o)
|
|
17
17
|
return {
|
|
18
18
|
selectedToolkits: /* @__PURE__ */ new Map(),
|
|
19
19
|
selectedTools: /* @__PURE__ */ new Map()
|
|
20
20
|
};
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
23
|
-
for (const
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
28
|
-
|
|
21
|
+
const t = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
22
|
+
if (e)
|
|
23
|
+
for (const l of e) {
|
|
24
|
+
s.set(l, !0);
|
|
25
|
+
const c = o.toolToToolkitMap?.get(l);
|
|
26
|
+
if (c) {
|
|
27
|
+
const i = o.toolkitMap?.get(c);
|
|
28
|
+
i && t.set(c, i);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
else
|
|
32
|
-
for (const
|
|
33
|
-
|
|
34
|
-
for (const
|
|
35
|
-
|
|
32
|
+
for (const l of o.toolkits) {
|
|
33
|
+
t.set(l.name, l);
|
|
34
|
+
for (const c of l.tools)
|
|
35
|
+
s.set(c.fully_qualified_name, !0);
|
|
36
36
|
}
|
|
37
|
-
return { selectedToolkits:
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
activeTab: "toolkits",
|
|
43
|
-
filteredToolkits: /* @__PURE__ */ new Set(),
|
|
44
|
-
filteredTools: /* @__PURE__ */ new Set()
|
|
45
|
-
};
|
|
46
|
-
const l = t ? new Set(d(t, e)) : new Set(e.tools || []);
|
|
47
|
-
return {
|
|
48
|
-
searchQuery: o,
|
|
49
|
-
activeTab: "toolkits",
|
|
50
|
-
filteredToolkits: new Set(e.toolkits || []),
|
|
51
|
-
filteredTools: l
|
|
52
|
-
};
|
|
53
|
-
}, L = (o, t) => {
|
|
54
|
-
const e = o.toLowerCase().trim(), { toolkits: l = [], tools: i = [] } = t.toolkitCollection || {}, n = !l.length, s = !i.length;
|
|
55
|
-
if (n && s)
|
|
56
|
-
return { searchQuery: o };
|
|
57
|
-
const c = r(l, e), u = t.toolkitFilter ? d(t.toolkitFilter, t.toolkitCollection) : i, a = r(u, e);
|
|
58
|
-
return {
|
|
59
|
-
searchQuery: o,
|
|
60
|
-
filteredToolkits: c,
|
|
61
|
-
filteredTools: a,
|
|
62
|
-
activeTab: h(t.activeTab, c, a)
|
|
63
|
-
};
|
|
64
|
-
}, M = (o, t) => {
|
|
65
|
-
const e = t.selectedTools.has(o), l = t.toolkitCollection?.toolToToolkitMap?.get(o), i = new Map(t.selectedToolkits), n = new Map(t.selectedTools);
|
|
37
|
+
return { selectedToolkits: t, selectedTools: s };
|
|
38
|
+
}, f = (e, o, t) => {
|
|
39
|
+
const s = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
40
|
+
if (!t)
|
|
41
|
+
return { selectedToolkits: s, selectedTools: l };
|
|
66
42
|
if (e)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
t.toolkitCollection
|
|
71
|
-
) || i.delete(l));
|
|
72
|
-
else if (t.selectionMode === "single" && (n.clear(), i.clear()), n.set(o, !0), l) {
|
|
73
|
-
const s = t.toolkitCollection?.toolkitMap?.get(l);
|
|
74
|
-
s && i.set(l, s);
|
|
75
|
-
}
|
|
76
|
-
return { selectedTools: n, selectedToolkits: i };
|
|
77
|
-
}, k = (o, t, e) => {
|
|
78
|
-
const l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
79
|
-
if (!e)
|
|
80
|
-
return { selectedToolkits: l, selectedTools: i };
|
|
81
|
-
if (o)
|
|
82
|
-
for (const n of o) {
|
|
83
|
-
const s = e.toolkitMap?.get(n);
|
|
84
|
-
s && l.set(n, s);
|
|
43
|
+
for (const c of e) {
|
|
44
|
+
const i = t.toolkitMap?.get(c);
|
|
45
|
+
i && s.set(c, i);
|
|
85
46
|
}
|
|
86
|
-
if (
|
|
87
|
-
for (const
|
|
88
|
-
|
|
89
|
-
return { selectedToolkits:
|
|
90
|
-
},
|
|
91
|
-
const { selectedToolkits:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
), { selectedToolkits:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
47
|
+
if (o)
|
|
48
|
+
for (const c of o)
|
|
49
|
+
l.set(c, !0);
|
|
50
|
+
return { selectedToolkits: s, selectedTools: l };
|
|
51
|
+
}, N = (e) => {
|
|
52
|
+
const { selectedToolkits: o, selectedTools: t } = f(
|
|
53
|
+
e.initialProps?.selectedToolkits,
|
|
54
|
+
e.initialProps?.selectedTools,
|
|
55
|
+
e.toolkitCollection
|
|
56
|
+
), { selectedToolkits: s, selectedTools: l } = f(
|
|
57
|
+
e.initialProps?.committedToolkits || e.initialProps?.selectedToolkits,
|
|
58
|
+
e.initialProps?.committedTools || e.initialProps?.selectedTools,
|
|
59
|
+
e.toolkitCollection
|
|
99
60
|
);
|
|
100
61
|
return {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
committedTools: i,
|
|
62
|
+
selectionMode: e.selectionMode || "multi",
|
|
63
|
+
selectedToolkits: o,
|
|
64
|
+
selectedTools: t,
|
|
65
|
+
committedToolkits: s,
|
|
66
|
+
committedTools: l,
|
|
107
67
|
searchQuery: "",
|
|
108
68
|
toolkitFilter: "",
|
|
109
|
-
activeTab: "toolkits"
|
|
110
|
-
filteredToolkits: new Set(o.toolkitCollection?.toolkits || []),
|
|
111
|
-
filteredTools: new Set(o.toolkitCollection?.tools || [])
|
|
69
|
+
activeTab: "toolkits"
|
|
112
70
|
};
|
|
113
|
-
},
|
|
114
|
-
switch (
|
|
71
|
+
}, P = (e, o) => {
|
|
72
|
+
switch (o.type) {
|
|
115
73
|
case "TOGGLE_TOOLKIT": {
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
|
|
119
|
-
for (const
|
|
120
|
-
T.delete(
|
|
74
|
+
const t = o.payload, { name: s, tools: l } = t, c = e.selectedToolkits.has(s), i = new Map(e.selectedToolkits), T = new Map(e.selectedTools);
|
|
75
|
+
if (c) {
|
|
76
|
+
i.delete(s);
|
|
77
|
+
for (const r of l)
|
|
78
|
+
T.delete(r.fully_qualified_name);
|
|
121
79
|
} else {
|
|
122
|
-
|
|
123
|
-
for (const
|
|
124
|
-
T.set(
|
|
80
|
+
i.set(s, t);
|
|
81
|
+
for (const r of l)
|
|
82
|
+
T.set(r.fully_qualified_name, !0);
|
|
125
83
|
}
|
|
126
84
|
return {
|
|
127
|
-
...
|
|
128
|
-
selectedToolkits:
|
|
85
|
+
...e,
|
|
86
|
+
selectedToolkits: i,
|
|
129
87
|
selectedTools: T
|
|
130
88
|
};
|
|
131
89
|
}
|
|
132
90
|
case "SET_INITIAL_SELECTIONS": {
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
91
|
+
const t = o.payload, s = o.collection, { selectedToolkits: l, selectedTools: c } = f(
|
|
92
|
+
t.selectedToolkits,
|
|
93
|
+
t.selectedTools,
|
|
94
|
+
s
|
|
137
95
|
), {
|
|
138
|
-
selectedToolkits:
|
|
139
|
-
selectedTools:
|
|
140
|
-
} =
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
96
|
+
selectedToolkits: i,
|
|
97
|
+
selectedTools: T
|
|
98
|
+
} = f(
|
|
99
|
+
t.committedToolkits || t.selectedToolkits,
|
|
100
|
+
t.committedTools || t.selectedTools,
|
|
101
|
+
s
|
|
144
102
|
);
|
|
145
103
|
return {
|
|
146
|
-
...
|
|
104
|
+
...e,
|
|
147
105
|
selectedToolkits: l,
|
|
148
|
-
selectedTools:
|
|
149
|
-
committedToolkits:
|
|
150
|
-
committedTools:
|
|
106
|
+
selectedTools: c,
|
|
107
|
+
committedToolkits: i,
|
|
108
|
+
committedTools: T
|
|
151
109
|
};
|
|
152
110
|
}
|
|
153
111
|
case "TOGGLE_TOOL": {
|
|
154
|
-
const
|
|
155
|
-
return
|
|
112
|
+
const { toolFqn: t, toolkitName: s, toolkit: l, selectionMode: c } = o.payload, i = e.selectedTools.has(t), T = new Map(e.selectedToolkits), r = new Map(e.selectedTools);
|
|
113
|
+
return i ? (r.delete(t), s && l && (l.tools?.some(
|
|
114
|
+
(d) => d.fully_qualified_name !== t && r.has(d.fully_qualified_name)
|
|
115
|
+
) || T.delete(s))) : (c === "single" && (r.clear(), T.clear()), r.set(t, !0), s && l && T.set(s, l)), {
|
|
116
|
+
...e,
|
|
117
|
+
selectedTools: r,
|
|
118
|
+
selectedToolkits: T
|
|
119
|
+
};
|
|
156
120
|
}
|
|
157
121
|
case "SELECT_ALL": {
|
|
158
|
-
const
|
|
159
|
-
if (l ||
|
|
160
|
-
return
|
|
161
|
-
const
|
|
162
|
-
return { ...
|
|
122
|
+
const { visibleToolFqns: t, collection: s } = o.payload, l = t?.length === 0, i = !t && !s?.toolkits?.length;
|
|
123
|
+
if (l || i)
|
|
124
|
+
return e;
|
|
125
|
+
const T = q(t, s);
|
|
126
|
+
return { ...e, ...T };
|
|
163
127
|
}
|
|
164
128
|
case "CLEAR_SELECTIONS":
|
|
165
129
|
return {
|
|
166
|
-
...
|
|
130
|
+
...e,
|
|
167
131
|
selectedToolkits: /* @__PURE__ */ new Map(),
|
|
168
132
|
selectedTools: /* @__PURE__ */ new Map()
|
|
169
133
|
};
|
|
170
134
|
case "COMMIT_SELECTIONS":
|
|
171
135
|
return {
|
|
172
|
-
...
|
|
173
|
-
committedToolkits: new Map(
|
|
174
|
-
committedTools: new Map(
|
|
136
|
+
...e,
|
|
137
|
+
committedToolkits: new Map(e.selectedToolkits),
|
|
138
|
+
committedTools: new Map(e.selectedTools)
|
|
175
139
|
};
|
|
176
140
|
case "RESTORE_COMMITTED_STATE":
|
|
177
141
|
return {
|
|
178
|
-
...
|
|
179
|
-
selectedToolkits: new Map(
|
|
180
|
-
selectedTools: new Map(
|
|
142
|
+
...e,
|
|
143
|
+
selectedToolkits: new Map(e.committedToolkits),
|
|
144
|
+
selectedTools: new Map(e.committedTools)
|
|
181
145
|
};
|
|
182
|
-
case "SET_SEARCH_QUERY":
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
o.toolkitCollection
|
|
191
|
-
);
|
|
192
|
-
return { ...o, ...n };
|
|
193
|
-
}
|
|
194
|
-
const i = L(e, o);
|
|
195
|
-
return { ...o, ...i };
|
|
196
|
-
}
|
|
197
|
-
case "CLEAR_SEARCH_QUERY": {
|
|
198
|
-
const e = o.toolkitFilter ? new Set(
|
|
199
|
-
d(o.toolkitFilter, o.toolkitCollection)
|
|
200
|
-
) : new Set(o.toolkitCollection?.tools || []);
|
|
201
|
-
return {
|
|
202
|
-
...o,
|
|
203
|
-
searchQuery: "",
|
|
204
|
-
activeTab: "toolkits",
|
|
205
|
-
filteredToolkits: new Set(o.toolkitCollection?.toolkits || []),
|
|
206
|
-
filteredTools: e
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
case "SET_TOOLKIT_FILTER": {
|
|
210
|
-
const e = t.payload, l = d(
|
|
211
|
-
e,
|
|
212
|
-
o.toolkitCollection
|
|
213
|
-
);
|
|
214
|
-
if (!l.length)
|
|
215
|
-
return { ...o, toolkitFilter: e };
|
|
216
|
-
const i = o.searchQuery.toLowerCase().trim();
|
|
217
|
-
return {
|
|
218
|
-
...o,
|
|
219
|
-
toolkitFilter: e,
|
|
220
|
-
activeTab: "tools",
|
|
221
|
-
filteredTools: r(l, i)
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
case "CLEAR_FILTER": {
|
|
225
|
-
const e = o.searchQuery.toLowerCase().trim();
|
|
226
|
-
return e ? {
|
|
227
|
-
...o,
|
|
228
|
-
toolkitFilter: "",
|
|
229
|
-
activeTab: "toolkits",
|
|
230
|
-
filteredToolkits: r(
|
|
231
|
-
o.toolkitCollection?.toolkits || [],
|
|
232
|
-
e
|
|
233
|
-
),
|
|
234
|
-
filteredTools: r(
|
|
235
|
-
o.toolkitCollection?.tools || [],
|
|
236
|
-
e
|
|
237
|
-
)
|
|
238
|
-
} : {
|
|
239
|
-
...o,
|
|
240
|
-
toolkitFilter: "",
|
|
241
|
-
activeTab: "toolkits",
|
|
242
|
-
filteredToolkits: new Set(o.toolkitCollection?.toolkits || []),
|
|
243
|
-
filteredTools: new Set(o.toolkitCollection?.tools || [])
|
|
244
|
-
};
|
|
245
|
-
}
|
|
146
|
+
case "SET_SEARCH_QUERY":
|
|
147
|
+
return { ...e, searchQuery: o.payload };
|
|
148
|
+
case "CLEAR_SEARCH_QUERY":
|
|
149
|
+
return { ...e, searchQuery: "", activeTab: "toolkits" };
|
|
150
|
+
case "SET_TOOLKIT_FILTER":
|
|
151
|
+
return { ...e, toolkitFilter: o.payload, activeTab: "tools" };
|
|
152
|
+
case "CLEAR_FILTER":
|
|
153
|
+
return { ...e, toolkitFilter: "", activeTab: "toolkits" };
|
|
246
154
|
case "SET_ACTIVE_TAB": {
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
const l = o.searchQuery.toLowerCase().trim();
|
|
250
|
-
return l ? {
|
|
251
|
-
...o,
|
|
252
|
-
activeTab: e,
|
|
253
|
-
toolkitFilter: "",
|
|
254
|
-
filteredToolkits: r(
|
|
255
|
-
o.toolkitCollection?.toolkits || [],
|
|
256
|
-
l
|
|
257
|
-
),
|
|
258
|
-
filteredTools: r(
|
|
259
|
-
o.toolkitCollection?.tools || [],
|
|
260
|
-
l
|
|
261
|
-
)
|
|
262
|
-
} : {
|
|
263
|
-
...o,
|
|
264
|
-
activeTab: e,
|
|
265
|
-
toolkitFilter: "",
|
|
266
|
-
filteredToolkits: new Set(o.toolkitCollection?.toolkits || []),
|
|
267
|
-
filteredTools: new Set(o.toolkitCollection?.tools || [])
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
return { ...o, activeTab: e };
|
|
155
|
+
const t = o.payload;
|
|
156
|
+
return t === "toolkits" && e.toolkitFilter ? { ...e, activeTab: t, toolkitFilter: "" } : { ...e, activeTab: t };
|
|
271
157
|
}
|
|
272
158
|
default:
|
|
273
|
-
return
|
|
159
|
+
return e;
|
|
274
160
|
}
|
|
275
|
-
},
|
|
161
|
+
}, O = F(
|
|
276
162
|
null
|
|
277
163
|
);
|
|
278
|
-
function
|
|
279
|
-
children:
|
|
280
|
-
toolkitCollection:
|
|
281
|
-
selectionMode:
|
|
282
|
-
initialProps:
|
|
164
|
+
function G({
|
|
165
|
+
children: e,
|
|
166
|
+
toolkitCollection: o,
|
|
167
|
+
selectionMode: t,
|
|
168
|
+
initialProps: s
|
|
283
169
|
}) {
|
|
284
|
-
const
|
|
285
|
-
toolkitCollection:
|
|
286
|
-
selectionMode:
|
|
287
|
-
initialProps:
|
|
288
|
-
}, [
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
170
|
+
const l = {
|
|
171
|
+
toolkitCollection: o,
|
|
172
|
+
selectionMode: t,
|
|
173
|
+
initialProps: s
|
|
174
|
+
}, [c, i] = b(
|
|
175
|
+
P,
|
|
176
|
+
l,
|
|
177
|
+
N
|
|
178
|
+
), { searchQuery: T, toolkitFilter: r, activeTab: k } = c, { filteredToolkits: d, filteredTools: p, effectiveTab: S } = _(() => {
|
|
179
|
+
const n = T.toLowerCase().trim(), u = o?.toolkits || [], a = r ? C(r, o) : [], m = r && a.length > 0 ? a : o?.tools || [], M = I(u, n), L = I(m, n);
|
|
180
|
+
let E = k;
|
|
181
|
+
if (n) {
|
|
182
|
+
const w = M.size > 0, h = L.size > 0;
|
|
183
|
+
!w && h ? E = "tools" : w && !h && (E = "toolkits");
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
filteredToolkits: M,
|
|
187
|
+
filteredTools: L,
|
|
188
|
+
effectiveTab: E
|
|
189
|
+
};
|
|
190
|
+
}, [o, T, r, k]), y = _(
|
|
191
|
+
() => ({
|
|
192
|
+
...c,
|
|
193
|
+
activeTab: S,
|
|
194
|
+
toolkitCollection: o,
|
|
195
|
+
filteredToolkits: d,
|
|
196
|
+
filteredTools: p
|
|
197
|
+
}),
|
|
198
|
+
[
|
|
199
|
+
c,
|
|
200
|
+
S,
|
|
201
|
+
o,
|
|
202
|
+
d,
|
|
203
|
+
p
|
|
204
|
+
]
|
|
292
205
|
);
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
206
|
+
g(() => {
|
|
207
|
+
o && s && (s.selectedToolkits || s.selectedTools || s.committedToolkits || s.committedTools) && i({
|
|
208
|
+
type: "SET_INITIAL_SELECTIONS",
|
|
209
|
+
payload: s,
|
|
210
|
+
collection: o
|
|
211
|
+
});
|
|
212
|
+
}, [o, s]);
|
|
213
|
+
const R = _(
|
|
214
|
+
() => ({
|
|
215
|
+
state: y,
|
|
216
|
+
toggleToolkit: (n) => i({ type: "TOGGLE_TOOLKIT", payload: n }),
|
|
217
|
+
toggleTool: (n) => {
|
|
218
|
+
const u = n.fully_qualified_name, a = o?.toolToToolkitMap?.get(u), m = a ? o?.toolkitMap?.get(a) : void 0;
|
|
219
|
+
i({
|
|
220
|
+
type: "TOGGLE_TOOL",
|
|
221
|
+
payload: {
|
|
222
|
+
toolFqn: u,
|
|
223
|
+
toolkitName: a,
|
|
224
|
+
toolkit: m,
|
|
225
|
+
selectionMode: c.selectionMode
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
},
|
|
229
|
+
selectAll: (n) => i({
|
|
230
|
+
type: "SELECT_ALL",
|
|
231
|
+
payload: { visibleToolFqns: n, collection: o }
|
|
232
|
+
}),
|
|
233
|
+
clearSelections: () => i({ type: "CLEAR_SELECTIONS" }),
|
|
234
|
+
commitSelections: () => i({ type: "COMMIT_SELECTIONS" }),
|
|
235
|
+
restoreCommittedState: () => i({ type: "RESTORE_COMMITTED_STATE" }),
|
|
236
|
+
setSearchQuery: (n) => i({ type: "SET_SEARCH_QUERY", payload: n }),
|
|
237
|
+
clearSearchQuery: () => i({ type: "CLEAR_SEARCH_QUERY" }),
|
|
238
|
+
setToolkitFilter: (n) => i({ type: "SET_TOOLKIT_FILTER", payload: n }),
|
|
239
|
+
clearFilter: () => i({ type: "CLEAR_FILTER" }),
|
|
240
|
+
setActiveTab: (n) => i({ type: "SET_ACTIVE_TAB", payload: n })
|
|
241
|
+
}),
|
|
242
|
+
[y, o, c.selectionMode]
|
|
243
|
+
);
|
|
244
|
+
return /* @__PURE__ */ A(O.Provider, { value: R, children: e });
|
|
311
245
|
}
|
|
312
|
-
function
|
|
313
|
-
const
|
|
314
|
-
if (!
|
|
246
|
+
function V() {
|
|
247
|
+
const e = v(O);
|
|
248
|
+
if (!e)
|
|
315
249
|
throw new Error(
|
|
316
250
|
"useToolkitPicker must be used within a ToolkitPickerProvider. Make sure to wrap your component with <ToolkitPickerProvider>."
|
|
317
251
|
);
|
|
318
|
-
return
|
|
252
|
+
return e;
|
|
319
253
|
}
|
|
320
254
|
export {
|
|
321
|
-
|
|
322
|
-
|
|
255
|
+
G as ToolkitPickerProvider,
|
|
256
|
+
V as useToolkitPicker
|
|
323
257
|
};
|
|
@@ -6,5 +6,9 @@ export declare const mockToolkitCollection: ToolkitCollection;
|
|
|
6
6
|
export declare const simpleMockToolkitCollection: ToolkitCollection;
|
|
7
7
|
export declare const demoMockToolkits: Record<string, Toolkit>;
|
|
8
8
|
export declare const demoMockToolkitCollection: ToolkitCollection;
|
|
9
|
-
export declare function generateLargeDataset(
|
|
9
|
+
export declare function generateLargeDataset(options?: {
|
|
10
|
+
toolkitCount?: number;
|
|
11
|
+
minToolsPerToolkit?: number;
|
|
12
|
+
maxToolsPerToolkit?: number;
|
|
13
|
+
}): Record<string, Toolkit>;
|
|
10
14
|
//# sourceMappingURL=toolkit-collection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolkit-collection.d.ts","sourceRoot":"","sources":["../../../../../../lib/components/ui/organisms/toolkit-picker/mocks/toolkit-collection.ts"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAGV,OAAO,EACP,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AA2C/B,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAqPhD,CAAC;AAGF,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,iBAAiB,CA8HnB;AAGD,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAqDtD,CAAC;AAEF,eAAO,MAAM,qBAAqB,mBAA4C,CAAC;AAC/E,eAAO,MAAM,2BAA2B,mBACS,CAAC;AAGlD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CA2LpD,CAAC;AAEF,eAAO,MAAM,yBAAyB,mBACS,CAAC;AAGhD,wBAAgB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"toolkit-collection.d.ts","sourceRoot":"","sources":["../../../../../../lib/components/ui/organisms/toolkit-picker/mocks/toolkit-collection.ts"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAGV,OAAO,EACP,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AA2C/B,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAqPhD,CAAC;AAGF,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,iBAAiB,CA8HnB;AAGD,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAqDtD,CAAC;AAEF,eAAO,MAAM,qBAAqB,mBAA4C,CAAC;AAC/E,eAAO,MAAM,2BAA2B,mBACS,CAAC;AAGlD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CA2LpD,CAAC;AAEF,eAAO,MAAM,yBAAyB,mBACS,CAAC;AAGhD,wBAAgB,oBAAoB,CAClC,OAAO,GAAE;IACP,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACxB,GACL,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA2LzB"}
|