ode-explorer 1.3.2-dev.202401091744 → 1.3.2-dev.202401101530
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/index.js +3 -3
- package/dist/version.txt +1 -1
- package/lib/ActionBarContainer.js +219 -313
- package/lib/AppAction.js +26 -39
- package/lib/DeleteModal.js +31 -39
- package/lib/DisableModal.js +14 -14
- package/lib/EmptyScreenApp.js +27 -43
- package/lib/EmptyScreenError.js +9 -10
- package/lib/EmptyScreenNoContentInFolder.js +12 -14
- package/lib/EmptyScreenSearch.js +11 -13
- package/lib/EmptyScreenTrash.js +11 -13
- package/lib/FolderModal.js +86 -105
- package/lib/FoldersList.js +42 -55
- package/lib/Library.js +12 -15
- package/lib/MoveModal.js +53 -69
- package/lib/ResourcesList.js +190 -202
- package/lib/TrashModal.js +13 -13
- package/lib/index.js +2 -2
- package/lib/index2.js +1012 -1503
- package/lib/style.css +1 -410
- package/package.json +3 -4
package/lib/index2.js
CHANGED
|
@@ -1,228 +1,163 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import { useQuery, useInfiniteQuery, useQueryClient, useMutation } from "@tanstack/react-query";
|
|
16
|
-
const searchContext = async (searchParams) => {
|
|
17
|
-
const search = await odeServices.resource(searchParams.app).searchContext(searchParams);
|
|
1
|
+
var fe = Object.defineProperty;
|
|
2
|
+
var pe = (e, s, t) => s in e ? fe(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
|
|
3
|
+
var $ = (e, s, t) => (pe(e, typeof s != "symbol" ? s + "" : s, t), t);
|
|
4
|
+
import { jsx as l, jsxs as C, Fragment as ae } from "react/jsx-runtime";
|
|
5
|
+
import { useState as ce, useRef as me, useEffect as U, lazy as b, Suspense as v, Fragment as ye } from "react";
|
|
6
|
+
import { useScrollToTop as ge, useOdeClient as M, IconButton as Ie, useToast as q, useUser as Se, LoadingScreen as A, FormControl as we, Input as xe, SearchButton as De, Dropdown as j, useToggle as be, TreeView as Te, Button as Fe, useXitiTrackPageLoad as Ce, isActionAvailable as oe, AppHeader as Ne, Breadcrumb as Re, Grid as ee } from "@edifice-ui/react";
|
|
7
|
+
import { ArrowLeft as Pe, Filter as Ae, Delete as Ee, Plus as Qe } from "@edifice-ui/icons";
|
|
8
|
+
import { useTranslation as z } from "react-i18next";
|
|
9
|
+
import { odeServices as N, FOLDER as F, APP as se } from "edifice-ts-client";
|
|
10
|
+
import { t as D } from "i18next";
|
|
11
|
+
import { create as ve } from "zustand";
|
|
12
|
+
import { useQuery as qe, useInfiniteQuery as Oe, useQueryClient as O, useMutation as L } from "@tanstack/react-query";
|
|
13
|
+
const le = async (e) => {
|
|
14
|
+
const s = await N.resource(e.app).searchContext(e);
|
|
18
15
|
return {
|
|
19
|
-
...
|
|
20
|
-
folders:
|
|
16
|
+
...s,
|
|
17
|
+
folders: s.folders.filter((t) => !t.trashed)
|
|
21
18
|
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
parentId
|
|
19
|
+
}, Le = async ({
|
|
20
|
+
searchParams: e,
|
|
21
|
+
name: s,
|
|
22
|
+
parentId: t
|
|
27
23
|
}) => {
|
|
28
|
-
const
|
|
29
|
-
name,
|
|
30
|
-
parentId,
|
|
31
|
-
app:
|
|
32
|
-
type:
|
|
24
|
+
const r = {
|
|
25
|
+
name: s,
|
|
26
|
+
parentId: t,
|
|
27
|
+
app: e.app,
|
|
28
|
+
type: e.types[0]
|
|
33
29
|
};
|
|
34
|
-
return await
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
name
|
|
30
|
+
return await N.resource(e.app).createFolder(r);
|
|
31
|
+
}, ke = async ({
|
|
32
|
+
folderId: e,
|
|
33
|
+
searchParams: s,
|
|
34
|
+
parentId: t,
|
|
35
|
+
name: r
|
|
41
36
|
}) => {
|
|
42
|
-
const
|
|
43
|
-
folderId,
|
|
44
|
-
name,
|
|
45
|
-
parentId,
|
|
46
|
-
app:
|
|
47
|
-
type:
|
|
37
|
+
const n = {
|
|
38
|
+
folderId: e,
|
|
39
|
+
name: r,
|
|
40
|
+
parentId: t,
|
|
41
|
+
app: s.app,
|
|
42
|
+
type: s.types[0]
|
|
48
43
|
};
|
|
49
|
-
return await
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
folderIds
|
|
44
|
+
return await N.resource(s.app).updateFolder(n);
|
|
45
|
+
}, Ue = async ({
|
|
46
|
+
searchParams: e,
|
|
47
|
+
resourceIds: s,
|
|
48
|
+
useAssetIds: t,
|
|
49
|
+
folderIds: r
|
|
56
50
|
}) => {
|
|
57
|
-
const
|
|
58
|
-
application:
|
|
59
|
-
resourceType:
|
|
60
|
-
resourceIds,
|
|
61
|
-
folderIds
|
|
51
|
+
const n = {
|
|
52
|
+
application: e.app,
|
|
53
|
+
resourceType: e.types[0],
|
|
54
|
+
resourceIds: s,
|
|
55
|
+
folderIds: r
|
|
62
56
|
};
|
|
63
|
-
return await
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
folderIds
|
|
57
|
+
return await N.resource(e.app).trashAll(n, t);
|
|
58
|
+
}, Me = async ({
|
|
59
|
+
searchParams: e,
|
|
60
|
+
resourceIds: s,
|
|
61
|
+
useAssetIds: t,
|
|
62
|
+
folderIds: r
|
|
70
63
|
}) => {
|
|
71
|
-
const
|
|
72
|
-
application:
|
|
73
|
-
resourceType:
|
|
74
|
-
resourceIds,
|
|
75
|
-
folderIds
|
|
64
|
+
const n = {
|
|
65
|
+
application: e.app,
|
|
66
|
+
resourceType: e.types[0],
|
|
67
|
+
resourceIds: s,
|
|
68
|
+
folderIds: r
|
|
76
69
|
};
|
|
77
|
-
return await
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
useAssetIds
|
|
70
|
+
return await N.resource(e.app).deleteAll(n, t);
|
|
71
|
+
}, Be = async ({
|
|
72
|
+
searchParams: e,
|
|
73
|
+
resourceIds: s,
|
|
74
|
+
folderIds: t,
|
|
75
|
+
useAssetIds: r
|
|
84
76
|
}) => {
|
|
85
|
-
const
|
|
86
|
-
application:
|
|
87
|
-
resourceType:
|
|
88
|
-
resourceIds,
|
|
89
|
-
folderIds
|
|
77
|
+
const n = {
|
|
78
|
+
application: e.app,
|
|
79
|
+
resourceType: e.types[0],
|
|
80
|
+
resourceIds: s,
|
|
81
|
+
folderIds: t
|
|
90
82
|
};
|
|
91
|
-
return await
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
useAssetIds
|
|
83
|
+
return await N.resource(e.app).restoreAll(n, r);
|
|
84
|
+
}, Ke = async ({
|
|
85
|
+
searchParams: e,
|
|
86
|
+
resourceIds: s,
|
|
87
|
+
folderId: t,
|
|
88
|
+
folderIds: r,
|
|
89
|
+
useAssetIds: n
|
|
99
90
|
}) => {
|
|
100
|
-
const
|
|
101
|
-
application:
|
|
102
|
-
folderId,
|
|
103
|
-
resourceIds,
|
|
104
|
-
folderIds
|
|
91
|
+
const i = {
|
|
92
|
+
application: e.app,
|
|
93
|
+
folderId: t,
|
|
94
|
+
resourceIds: s,
|
|
95
|
+
folderIds: r
|
|
105
96
|
};
|
|
106
|
-
return await
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
assetId
|
|
127
|
-
}) => {
|
|
128
|
-
return odeServices.resource(searchParams.app).gotoView(assetId);
|
|
129
|
-
};
|
|
130
|
-
const createResource = ({
|
|
131
|
-
searchParams,
|
|
132
|
-
params
|
|
133
|
-
}) => {
|
|
134
|
-
const result = odeServices.resource(searchParams.app).create(params);
|
|
135
|
-
return result;
|
|
136
|
-
};
|
|
137
|
-
const printResource = ({
|
|
138
|
-
searchParams,
|
|
139
|
-
assetId
|
|
140
|
-
}) => {
|
|
141
|
-
const result = odeServices.resource(searchParams.app).gotoPrint(assetId);
|
|
142
|
-
return result;
|
|
143
|
-
};
|
|
144
|
-
function arrayUnique(array) {
|
|
145
|
-
return array.filter((item, index) => array.indexOf(item) === index);
|
|
97
|
+
return await N.resource(e.app).moveToFolder(i, n);
|
|
98
|
+
}, $e = async ({
|
|
99
|
+
app: e,
|
|
100
|
+
resourceId: s,
|
|
101
|
+
rights: t
|
|
102
|
+
}) => await N.share().saveRights(e, s, t), je = async ({
|
|
103
|
+
app: e,
|
|
104
|
+
params: s
|
|
105
|
+
}) => await N.resource(e).update(s), ze = async (e) => await N.rights().sessionHasWorkflowRights(e), Ve = ({
|
|
106
|
+
searchParams: e,
|
|
107
|
+
assetId: s
|
|
108
|
+
}) => N.resource(e.app).gotoView(s), _e = ({
|
|
109
|
+
searchParams: e,
|
|
110
|
+
params: s
|
|
111
|
+
}) => N.resource(e.app).create(s), He = ({
|
|
112
|
+
searchParams: e,
|
|
113
|
+
assetId: s
|
|
114
|
+
}) => N.resource(e.app).gotoPrint(s);
|
|
115
|
+
function te(e) {
|
|
116
|
+
return e.filter((s, t) => e.indexOf(s) === t);
|
|
146
117
|
}
|
|
147
|
-
function
|
|
148
|
-
var
|
|
149
|
-
let
|
|
150
|
-
|
|
151
|
-
return data;
|
|
152
|
-
}
|
|
153
|
-
if ((_a = data == null ? void 0 : data.children) == null ? void 0 : _a.length) {
|
|
154
|
-
(_b = data == null ? void 0 : data.children) == null ? void 0 : _b.every((childNode) => {
|
|
155
|
-
res = findNodeById(id, childNode);
|
|
156
|
-
return res === void 0;
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
return res;
|
|
118
|
+
function _(e, s) {
|
|
119
|
+
var r, n;
|
|
120
|
+
let t;
|
|
121
|
+
return (s == null ? void 0 : s.id) === e ? s : ((r = s == null ? void 0 : s.children) != null && r.length && ((n = s == null ? void 0 : s.children) == null || n.every((i) => (t = _(e, i), t === void 0))), t);
|
|
160
122
|
}
|
|
161
|
-
function
|
|
162
|
-
var
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
const nodes = (findItem == null ? void 0 : findItem.folder.ancestors) || [];
|
|
166
|
-
return [...nodes, folderId];
|
|
167
|
-
} else if (folderId === FOLDER.BIN) {
|
|
168
|
-
return [FOLDER.BIN];
|
|
169
|
-
} else {
|
|
170
|
-
return [FOLDER.DEFAULT];
|
|
171
|
-
}
|
|
123
|
+
function We(e, s) {
|
|
124
|
+
var r;
|
|
125
|
+
const t = _(e, s);
|
|
126
|
+
return (r = t == null ? void 0 : t.folder) != null && r.ancestors ? [...(t == null ? void 0 : t.folder.ancestors) || [], e] : e === F.BIN ? [F.BIN] : [F.DEFAULT];
|
|
172
127
|
}
|
|
173
|
-
function
|
|
174
|
-
|
|
175
|
-
return data.children.length > 0;
|
|
176
|
-
}
|
|
177
|
-
if (data.children) {
|
|
178
|
-
return data.children.some((child) => hasChildren(data.id, child));
|
|
179
|
-
}
|
|
180
|
-
return false;
|
|
128
|
+
function ie(e, s) {
|
|
129
|
+
return s.id === e && s.children ? s.children.length > 0 : s.children ? s.children.some((t) => ie(s.id, t)) : !1;
|
|
181
130
|
}
|
|
182
|
-
function
|
|
183
|
-
|
|
184
|
-
return root;
|
|
131
|
+
function H(e, s) {
|
|
132
|
+
return de(e, s) || e;
|
|
185
133
|
}
|
|
186
|
-
function
|
|
187
|
-
var
|
|
188
|
-
const
|
|
189
|
-
if ((
|
|
190
|
-
const
|
|
191
|
-
for (const
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
children.push(res);
|
|
195
|
-
}
|
|
134
|
+
function de(e, s, t) {
|
|
135
|
+
var n;
|
|
136
|
+
const r = s(e, t);
|
|
137
|
+
if ((n = r == null ? void 0 : r.children) != null && n.length) {
|
|
138
|
+
const i = [];
|
|
139
|
+
for (const o of (r == null ? void 0 : r.children) || []) {
|
|
140
|
+
const d = de(o, s, r);
|
|
141
|
+
d && i.push(d);
|
|
196
142
|
}
|
|
197
143
|
return {
|
|
198
|
-
...
|
|
199
|
-
children
|
|
144
|
+
...r,
|
|
145
|
+
children: i
|
|
200
146
|
};
|
|
201
147
|
}
|
|
202
|
-
return
|
|
148
|
+
return r;
|
|
203
149
|
}
|
|
204
|
-
class
|
|
205
|
-
constructor(
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
this.folder =
|
|
212
|
-
this.id = folder.id;
|
|
213
|
-
this.name = folder.name;
|
|
214
|
-
this.childNumber = folder.childNumber;
|
|
150
|
+
class X {
|
|
151
|
+
constructor(s) {
|
|
152
|
+
$(this, "id");
|
|
153
|
+
$(this, "name");
|
|
154
|
+
$(this, "childNumber");
|
|
155
|
+
$(this, "section", !1);
|
|
156
|
+
$(this, "children", []);
|
|
157
|
+
this.folder = s, this.id = s.id, this.name = s.name, this.childNumber = s.childNumber;
|
|
215
158
|
}
|
|
216
159
|
}
|
|
217
|
-
const
|
|
218
|
-
return modifyNode(treeNode, (node) => {
|
|
219
|
-
if (node.id === parentId) {
|
|
220
|
-
node.children = folders == null ? void 0 : folders.map((e) => new TreeNodeFolderWrapper(e));
|
|
221
|
-
}
|
|
222
|
-
return node;
|
|
223
|
-
});
|
|
224
|
-
};
|
|
225
|
-
const useStoreContext = create()((set, get) => ({
|
|
160
|
+
const ue = (e, s, t) => H(e, (r) => (r.id === t && (r.children = s == null ? void 0 : s.map((n) => new X(n))), r)), S = ve()((e, s) => ({
|
|
226
161
|
config: null,
|
|
227
162
|
searchConfig: {
|
|
228
163
|
minLength: 1
|
|
@@ -244,12 +179,12 @@ const useStoreContext = create()((set, get) => ({
|
|
|
244
179
|
pageSize: 48,
|
|
245
180
|
maxIdx: 0
|
|
246
181
|
},
|
|
247
|
-
trashed:
|
|
182
|
+
trashed: !1
|
|
248
183
|
},
|
|
249
184
|
treeData: {
|
|
250
|
-
id:
|
|
251
|
-
name:
|
|
252
|
-
section:
|
|
185
|
+
id: F.DEFAULT,
|
|
186
|
+
name: D("explorer.filters.mine"),
|
|
187
|
+
section: !0,
|
|
253
188
|
children: []
|
|
254
189
|
},
|
|
255
190
|
selectedNodesIds: ["default"],
|
|
@@ -260,1564 +195,1138 @@ const useStoreContext = create()((set, get) => ({
|
|
|
260
195
|
selectedResources: [],
|
|
261
196
|
folderIds: [],
|
|
262
197
|
resourceIds: [],
|
|
263
|
-
resourceIsTrash:
|
|
264
|
-
resourceActionDisable:
|
|
198
|
+
resourceIsTrash: !1,
|
|
199
|
+
resourceActionDisable: !1,
|
|
265
200
|
status: void 0,
|
|
266
201
|
updaters: {
|
|
267
|
-
setConfig: (
|
|
268
|
-
config
|
|
202
|
+
setConfig: (t) => e({
|
|
203
|
+
config: t
|
|
269
204
|
}),
|
|
270
|
-
setSearchConfig: (
|
|
205
|
+
setSearchConfig: (t) => e((r) => ({
|
|
271
206
|
searchConfig: {
|
|
272
|
-
...
|
|
273
|
-
...
|
|
207
|
+
...r.searchConfig,
|
|
208
|
+
...t
|
|
274
209
|
}
|
|
275
210
|
})),
|
|
276
|
-
setTreeData: (
|
|
277
|
-
treeData
|
|
211
|
+
setTreeData: (t) => e(() => ({
|
|
212
|
+
treeData: t
|
|
278
213
|
})),
|
|
279
|
-
setSearchParams: (
|
|
280
|
-
|
|
214
|
+
setSearchParams: (t) => {
|
|
215
|
+
e((r) => {
|
|
281
216
|
const {
|
|
282
|
-
searchParams:
|
|
283
|
-
} =
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
folder: void 0
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
};
|
|
302
|
-
} else {
|
|
303
|
-
return {
|
|
304
|
-
...state,
|
|
305
|
-
selectedFolders: [],
|
|
306
|
-
selectedNodesIds: ["default"],
|
|
307
|
-
selectedResources: [],
|
|
308
|
-
currentFolder: {
|
|
309
|
-
id: "default"
|
|
310
|
-
},
|
|
311
|
-
searchParams: {
|
|
312
|
-
...previousSearchParams,
|
|
313
|
-
...searchParams,
|
|
314
|
-
trashed: false,
|
|
315
|
-
filters: {
|
|
316
|
-
...previousSearchParams.filters
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
};
|
|
217
|
+
searchParams: n
|
|
218
|
+
} = r;
|
|
219
|
+
return n.search !== t.search ? t.search ? {
|
|
220
|
+
...r,
|
|
221
|
+
selectedFolders: [],
|
|
222
|
+
selectedNodesIds: [],
|
|
223
|
+
selectedResources: [],
|
|
224
|
+
currentFolder: void 0,
|
|
225
|
+
searchParams: {
|
|
226
|
+
...n,
|
|
227
|
+
...t,
|
|
228
|
+
trashed: !1,
|
|
229
|
+
filters: {
|
|
230
|
+
...n.filters,
|
|
231
|
+
folder: void 0
|
|
232
|
+
}
|
|
320
233
|
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
234
|
+
} : {
|
|
235
|
+
...r,
|
|
236
|
+
selectedFolders: [],
|
|
237
|
+
selectedNodesIds: ["default"],
|
|
238
|
+
selectedResources: [],
|
|
239
|
+
currentFolder: {
|
|
240
|
+
id: "default"
|
|
241
|
+
},
|
|
242
|
+
searchParams: {
|
|
243
|
+
...n,
|
|
244
|
+
...t,
|
|
245
|
+
trashed: !1,
|
|
246
|
+
filters: {
|
|
247
|
+
...n.filters
|
|
326
248
|
}
|
|
327
|
-
}
|
|
328
|
-
}
|
|
249
|
+
}
|
|
250
|
+
} : {
|
|
251
|
+
searchParams: {
|
|
252
|
+
...n,
|
|
253
|
+
...t
|
|
254
|
+
}
|
|
255
|
+
};
|
|
329
256
|
});
|
|
330
257
|
},
|
|
331
|
-
setSelectedFolders: (
|
|
332
|
-
selectedFolders
|
|
258
|
+
setSelectedFolders: (t) => e(() => ({
|
|
259
|
+
selectedFolders: t
|
|
333
260
|
})),
|
|
334
|
-
setSelectedResources: (
|
|
335
|
-
selectedResources
|
|
261
|
+
setSelectedResources: (t) => e(() => ({
|
|
262
|
+
selectedResources: t
|
|
336
263
|
})),
|
|
337
|
-
setFolderIds: (
|
|
338
|
-
folderIds
|
|
264
|
+
setFolderIds: (t) => e(() => ({
|
|
265
|
+
folderIds: t
|
|
339
266
|
})),
|
|
340
|
-
setResourceIds: (
|
|
341
|
-
resourceIds
|
|
267
|
+
setResourceIds: (t) => e(() => ({
|
|
268
|
+
resourceIds: t
|
|
342
269
|
})),
|
|
343
|
-
setResourceIsTrash: (
|
|
344
|
-
resourceIsTrash
|
|
270
|
+
setResourceIsTrash: (t) => e(() => ({
|
|
271
|
+
resourceIsTrash: t
|
|
345
272
|
})),
|
|
346
|
-
setResourceActionDisable: (
|
|
347
|
-
resourceActionDisable
|
|
273
|
+
setResourceActionDisable: (t) => e(() => ({
|
|
274
|
+
resourceActionDisable: t
|
|
348
275
|
})),
|
|
349
|
-
setCurrentFolder: (
|
|
350
|
-
currentFolder
|
|
276
|
+
setCurrentFolder: (t) => e(() => ({
|
|
277
|
+
currentFolder: t
|
|
351
278
|
})),
|
|
352
|
-
clearSelectedItems: () =>
|
|
279
|
+
clearSelectedItems: () => e(() => ({
|
|
353
280
|
selectedFolders: [],
|
|
354
281
|
selectedResources: []
|
|
355
282
|
})),
|
|
356
|
-
clearSelectedIds: () =>
|
|
283
|
+
clearSelectedIds: () => e(() => ({
|
|
357
284
|
resourceIds: [],
|
|
358
285
|
folderIds: []
|
|
359
286
|
})),
|
|
360
|
-
openResource: (
|
|
287
|
+
openResource: (t) => {
|
|
361
288
|
try {
|
|
362
289
|
const {
|
|
363
|
-
searchParams
|
|
364
|
-
} =
|
|
365
|
-
|
|
366
|
-
searchParams,
|
|
367
|
-
assetId:
|
|
290
|
+
searchParams: r
|
|
291
|
+
} = s();
|
|
292
|
+
Ve({
|
|
293
|
+
searchParams: r,
|
|
294
|
+
assetId: t.assetId
|
|
368
295
|
});
|
|
369
|
-
} catch (
|
|
370
|
-
console.error("explorer open failed: ",
|
|
296
|
+
} catch (r) {
|
|
297
|
+
console.error("explorer open failed: ", r);
|
|
371
298
|
}
|
|
372
299
|
},
|
|
373
300
|
printSelectedResource: () => {
|
|
374
301
|
try {
|
|
375
302
|
const {
|
|
376
|
-
searchParams,
|
|
377
|
-
selectedResources,
|
|
378
|
-
resourceIds
|
|
379
|
-
} =
|
|
380
|
-
if (
|
|
303
|
+
searchParams: t,
|
|
304
|
+
selectedResources: r,
|
|
305
|
+
resourceIds: n
|
|
306
|
+
} = s();
|
|
307
|
+
if (r.length !== 1)
|
|
381
308
|
throw new Error("Cannot open more than 1 resource");
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
assetId: item.assetId
|
|
309
|
+
const i = r.find((o) => o.id === n[0]);
|
|
310
|
+
He({
|
|
311
|
+
searchParams: t,
|
|
312
|
+
assetId: i.assetId
|
|
387
313
|
});
|
|
388
|
-
} catch (
|
|
389
|
-
console.error("explorer print failed: ",
|
|
314
|
+
} catch (t) {
|
|
315
|
+
console.error("explorer print failed: ", t);
|
|
390
316
|
}
|
|
391
317
|
},
|
|
392
318
|
openFolder: ({
|
|
393
|
-
folderId,
|
|
394
|
-
folder
|
|
319
|
+
folderId: t,
|
|
320
|
+
folder: r
|
|
395
321
|
}) => {
|
|
396
322
|
const {
|
|
397
|
-
searchParams,
|
|
398
|
-
treeData
|
|
399
|
-
} =
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
323
|
+
searchParams: n,
|
|
324
|
+
treeData: i
|
|
325
|
+
} = s(), o = n.filters.folder, d = We(t, i), u = te([...d, t]);
|
|
326
|
+
o !== t && e((h) => ({
|
|
327
|
+
...h,
|
|
328
|
+
// reset selection when changing folder
|
|
329
|
+
folderIds: [],
|
|
330
|
+
resourceIds: [],
|
|
331
|
+
selectedNodesIds: u,
|
|
332
|
+
currentFolder: r || {
|
|
333
|
+
id: t
|
|
334
|
+
},
|
|
335
|
+
searchParams: {
|
|
336
|
+
...n,
|
|
337
|
+
search: void 0,
|
|
338
|
+
filters: {
|
|
339
|
+
...n.filters,
|
|
340
|
+
folder: t
|
|
414
341
|
},
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
filters: {
|
|
419
|
-
...searchParams.filters,
|
|
420
|
-
folder: folderId
|
|
421
|
-
},
|
|
422
|
-
trashed: folderId === FOLDER.BIN
|
|
423
|
-
}
|
|
424
|
-
};
|
|
425
|
-
});
|
|
342
|
+
trashed: t === F.BIN
|
|
343
|
+
}
|
|
344
|
+
}));
|
|
426
345
|
},
|
|
427
|
-
foldTreeItem: () =>
|
|
428
|
-
...
|
|
346
|
+
foldTreeItem: () => e((t) => ({
|
|
347
|
+
...t,
|
|
429
348
|
status: "fold"
|
|
430
349
|
})),
|
|
431
|
-
unfoldTreeItem: async (
|
|
350
|
+
unfoldTreeItem: async (t, r) => {
|
|
432
351
|
const {
|
|
433
|
-
treeData,
|
|
434
|
-
searchParams
|
|
435
|
-
} =
|
|
436
|
-
|
|
437
|
-
...
|
|
352
|
+
treeData: n,
|
|
353
|
+
searchParams: i
|
|
354
|
+
} = s();
|
|
355
|
+
if (e((o) => ({
|
|
356
|
+
...o,
|
|
438
357
|
status: "unfold"
|
|
439
|
-
}))
|
|
440
|
-
|
|
441
|
-
await queryClient.prefetchInfiniteQuery({
|
|
358
|
+
})), !ie(t, n)) {
|
|
359
|
+
await r.prefetchInfiniteQuery({
|
|
442
360
|
queryKey: ["prefetchContext", {
|
|
443
|
-
folderId,
|
|
444
|
-
trashed:
|
|
361
|
+
folderId: t,
|
|
362
|
+
trashed: !1
|
|
445
363
|
}],
|
|
446
|
-
queryFn: async () => await
|
|
447
|
-
...
|
|
364
|
+
queryFn: async () => await le({
|
|
365
|
+
...i,
|
|
448
366
|
filters: {
|
|
449
|
-
...
|
|
450
|
-
folder:
|
|
367
|
+
...i.filters,
|
|
368
|
+
folder: t
|
|
451
369
|
}
|
|
452
370
|
})
|
|
453
371
|
});
|
|
454
|
-
const
|
|
455
|
-
folderId,
|
|
456
|
-
trashed:
|
|
372
|
+
const o = r.getQueryData(["prefetchContext", {
|
|
373
|
+
folderId: t,
|
|
374
|
+
trashed: !1
|
|
457
375
|
}]);
|
|
458
|
-
|
|
459
|
-
var
|
|
376
|
+
e((d) => {
|
|
377
|
+
var u;
|
|
460
378
|
return {
|
|
461
|
-
...
|
|
462
|
-
treeData:
|
|
379
|
+
...d,
|
|
380
|
+
treeData: ue(n, (u = o == null ? void 0 : o.pages[0]) == null ? void 0 : u.folders, t || F.DEFAULT)
|
|
463
381
|
};
|
|
464
382
|
});
|
|
465
383
|
}
|
|
466
384
|
},
|
|
467
|
-
selectTreeItem: (
|
|
468
|
-
const {
|
|
469
|
-
treeData
|
|
470
|
-
} = get();
|
|
385
|
+
selectTreeItem: (t) => {
|
|
471
386
|
const {
|
|
472
|
-
|
|
473
|
-
} =
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
...state,
|
|
387
|
+
treeData: r
|
|
388
|
+
} = s(), {
|
|
389
|
+
openFolder: n
|
|
390
|
+
} = s().updaters, i = _(t, r);
|
|
391
|
+
ge()(), e((d) => ({
|
|
392
|
+
...d,
|
|
479
393
|
searchParams: {
|
|
480
|
-
...
|
|
394
|
+
...d.searchParams,
|
|
481
395
|
search: void 0
|
|
482
396
|
},
|
|
483
397
|
status: "select",
|
|
484
398
|
selectedResources: []
|
|
485
|
-
}))
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
folderId
|
|
399
|
+
})), n({
|
|
400
|
+
folder: i,
|
|
401
|
+
folderId: t
|
|
489
402
|
});
|
|
490
403
|
},
|
|
491
404
|
gotoPreviousFolder: () => {
|
|
492
405
|
const {
|
|
493
|
-
selectedNodesIds,
|
|
494
|
-
treeData
|
|
495
|
-
} =
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
openFolder({
|
|
505
|
-
folder: previousFolder,
|
|
506
|
-
folderId: (previousFolder == null ? void 0 : previousFolder.id) || FOLDER.DEFAULT
|
|
406
|
+
selectedNodesIds: t,
|
|
407
|
+
treeData: r
|
|
408
|
+
} = s(), {
|
|
409
|
+
openFolder: n
|
|
410
|
+
} = s().updaters, i = t.length;
|
|
411
|
+
if (i < 2)
|
|
412
|
+
return;
|
|
413
|
+
const o = _(t[i - 2], r);
|
|
414
|
+
n({
|
|
415
|
+
folder: o,
|
|
416
|
+
folderId: (o == null ? void 0 : o.id) || F.DEFAULT
|
|
507
417
|
});
|
|
508
418
|
},
|
|
509
|
-
goToTrash: () =>
|
|
510
|
-
...
|
|
419
|
+
goToTrash: () => e((t) => ({
|
|
420
|
+
...t,
|
|
511
421
|
selectedNodesIds: [],
|
|
512
422
|
selectedResources: [],
|
|
513
423
|
resourceIds: [],
|
|
514
424
|
folderIds: [],
|
|
515
425
|
status: "select",
|
|
516
426
|
searchParams: {
|
|
517
|
-
...
|
|
427
|
+
...t.searchParams,
|
|
518
428
|
search: void 0,
|
|
519
429
|
filters: {
|
|
520
|
-
folder:
|
|
430
|
+
folder: F.BIN
|
|
521
431
|
},
|
|
522
|
-
trashed:
|
|
432
|
+
trashed: !0
|
|
523
433
|
},
|
|
524
434
|
currentFolder: {
|
|
525
|
-
id:
|
|
435
|
+
id: F.BIN
|
|
526
436
|
}
|
|
527
437
|
}))
|
|
528
438
|
}
|
|
529
|
-
}))
|
|
530
|
-
const
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
const
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
const
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
};
|
|
549
|
-
const useResourceActionDisable = () => {
|
|
550
|
-
return useStoreContext((state) => state.resourceActionDisable);
|
|
551
|
-
};
|
|
552
|
-
const useIsRoot = () => {
|
|
553
|
-
const currentFolder = useCurrentFolder();
|
|
554
|
-
return (currentFolder == null ? void 0 : currentFolder.id) === "default";
|
|
555
|
-
};
|
|
556
|
-
const useHasSelectedNodes = () => {
|
|
557
|
-
const selectedNodesIds = useSelectedNodesIds();
|
|
558
|
-
return selectedNodesIds.length > 1;
|
|
559
|
-
};
|
|
560
|
-
const useTreeStatus = () => useStoreContext((state) => state.status);
|
|
561
|
-
const useSearchForm = () => {
|
|
562
|
-
const searchParams = useSearchParams();
|
|
563
|
-
const [inputSearch, setInputSearch] = useState("");
|
|
564
|
-
const searchConfig = useSearchConfig();
|
|
565
|
-
const status = useTreeStatus();
|
|
566
|
-
const formRef = useRef(null);
|
|
567
|
-
const {
|
|
568
|
-
setSearchParams
|
|
569
|
-
} = useStoreActions();
|
|
570
|
-
const handleInputSearchChange = (event) => {
|
|
571
|
-
const newText = event.target.value;
|
|
572
|
-
setInputSearch(newText.toString());
|
|
573
|
-
};
|
|
574
|
-
const handleKeyPress = (event) => {
|
|
575
|
-
if (event.key === "Enter" || event.key === "Return") {
|
|
576
|
-
event.preventDefault();
|
|
577
|
-
setSearchParams({
|
|
578
|
-
search: inputSearch ? inputSearch : void 0
|
|
579
|
-
});
|
|
580
|
-
}
|
|
581
|
-
};
|
|
582
|
-
const handleSearchSubmit = (e) => {
|
|
583
|
-
e.preventDefault();
|
|
584
|
-
setSearchParams({
|
|
585
|
-
search: inputSearch ? inputSearch : void 0
|
|
439
|
+
})), T = () => S((e) => e.searchParams), re = () => S((e) => e.selectedNodesIds), V = () => S((e) => e.treeData), Ms = () => S((e) => e.selectedFolders), Bs = () => S((e) => e.selectedResources), Xe = () => S((e) => e.searchConfig), G = () => S((e) => e.folderIds), Z = () => S((e) => e.resourceIds), J = () => S((e) => e.selectedResources.map((s) => s.assetId)), Y = () => S((e) => e.selectedResources.filter((s) => s.assetId === s.id)), W = () => S((e) => e.currentFolder), x = () => S((e) => e.updaters), ne = () => {
|
|
440
|
+
const e = W();
|
|
441
|
+
return (e == null ? void 0 : e.id) === F.BIN;
|
|
442
|
+
}, Ge = () => S((e) => e.resourceIsTrash), Ze = () => S((e) => e.resourceActionDisable), Je = () => {
|
|
443
|
+
const e = W();
|
|
444
|
+
return (e == null ? void 0 : e.id) === "default";
|
|
445
|
+
}, Ye = () => re().length > 1, es = () => S((e) => e.status), he = () => {
|
|
446
|
+
const e = T(), [s, t] = ce(""), r = Xe(), n = es(), i = me(null), {
|
|
447
|
+
setSearchParams: o
|
|
448
|
+
} = x(), d = (c) => {
|
|
449
|
+
const f = c.target.value;
|
|
450
|
+
t(f.toString());
|
|
451
|
+
}, u = (c) => {
|
|
452
|
+
(c.key === "Enter" || c.key === "Return") && (c.preventDefault(), o({
|
|
453
|
+
search: s || void 0
|
|
454
|
+
}));
|
|
455
|
+
}, h = (c) => {
|
|
456
|
+
c.preventDefault(), o({
|
|
457
|
+
search: s || void 0
|
|
586
458
|
});
|
|
587
459
|
};
|
|
588
|
-
|
|
589
|
-
const
|
|
590
|
-
|
|
591
|
-
search: inputSearch ? inputSearch : void 0
|
|
460
|
+
return U(() => {
|
|
461
|
+
const f = s.length == 0 || s.length >= r.minLength ? {
|
|
462
|
+
search: s || void 0
|
|
592
463
|
} : {};
|
|
593
|
-
|
|
594
|
-
...
|
|
595
|
-
...
|
|
464
|
+
o({
|
|
465
|
+
...e,
|
|
466
|
+
...f
|
|
596
467
|
});
|
|
597
|
-
}, [
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
setInputSearch(() => {
|
|
604
|
-
var _a;
|
|
605
|
-
return ((_a = searchParams.search) == null ? void 0 : _a.toString()) ?? "";
|
|
468
|
+
}, [s, r.minLength]), U(() => {
|
|
469
|
+
n === "select" && t("");
|
|
470
|
+
}, [n]), U(() => {
|
|
471
|
+
t(() => {
|
|
472
|
+
var c;
|
|
473
|
+
return ((c = e.search) == null ? void 0 : c.toString()) ?? "";
|
|
606
474
|
});
|
|
607
|
-
}, [
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
handleSearchSubmit
|
|
475
|
+
}, [e]), {
|
|
476
|
+
formRef: i,
|
|
477
|
+
inputSearch: s,
|
|
478
|
+
handleInputSearchChange: d,
|
|
479
|
+
handleKeyPress: u,
|
|
480
|
+
handleSearchSubmit: h
|
|
614
481
|
};
|
|
615
482
|
};
|
|
616
|
-
function
|
|
483
|
+
function ss() {
|
|
617
484
|
const {
|
|
618
|
-
appCode
|
|
619
|
-
} =
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
} =
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
const trashName = t2("explorer.tree.trash");
|
|
633
|
-
const searchName = t2("explorer.tree.search");
|
|
634
|
-
const rootName = t2("explorer.filters.mine", {
|
|
635
|
-
ns: appCode
|
|
636
|
-
});
|
|
637
|
-
const previousName = (currentFolder == null ? void 0 : currentFolder.name) || rootName;
|
|
638
|
-
return /* @__PURE__ */ jsx("div", { className: "py-16", children: selectedNodesIds.length > 1 && !isTrashFolder ? /* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center gap-8", children: [
|
|
639
|
-
/* @__PURE__ */ jsx(IconButton, { icon: /* @__PURE__ */ jsx(ArrowLeft, {}), variant: "ghost", color: "tertiary", "aria-label": t2("back"), className: "ms-n16", onClick: gotoPreviousFolder }),
|
|
640
|
-
/* @__PURE__ */ jsx("p", { className: "body py-8 text-truncate", children: /* @__PURE__ */ jsx("strong", { children: previousName }) })
|
|
641
|
-
] }) : /* @__PURE__ */ jsx("h2", { className: "body py-8 fw-bold", children: inputSearch.length !== 0 ? searchName : !isTrashFolder ? rootName : trashName }) });
|
|
485
|
+
appCode: e
|
|
486
|
+
} = M(), {
|
|
487
|
+
gotoPreviousFolder: s
|
|
488
|
+
} = x(), {
|
|
489
|
+
t
|
|
490
|
+
} = z(), {
|
|
491
|
+
inputSearch: r
|
|
492
|
+
} = he(), n = re(), i = ne(), o = W(), d = t("explorer.tree.trash"), u = t("explorer.tree.search"), h = t("explorer.filters.mine", {
|
|
493
|
+
ns: e
|
|
494
|
+
}), c = (o == null ? void 0 : o.name) || h;
|
|
495
|
+
return /* @__PURE__ */ l("div", { className: "py-16", children: n.length > 1 && !i ? /* @__PURE__ */ C("div", { className: "d-flex align-items-center gap-8", children: [
|
|
496
|
+
/* @__PURE__ */ l(Ie, { icon: /* @__PURE__ */ l(Pe, {}), variant: "ghost", color: "tertiary", "aria-label": t("back"), className: "ms-n16", onClick: s }),
|
|
497
|
+
/* @__PURE__ */ l("p", { className: "body py-8 text-truncate", children: /* @__PURE__ */ l("strong", { children: c }) })
|
|
498
|
+
] }) : /* @__PURE__ */ l("h2", { className: "body py-8 fw-bold", children: r.length !== 0 ? u : i ? d : h }) });
|
|
642
499
|
}
|
|
643
|
-
const
|
|
644
|
-
const
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
} = useStoreActions();
|
|
650
|
-
const onActionDisableCancel = () => {
|
|
651
|
-
clearSelectedIds();
|
|
652
|
-
clearSelectedItems();
|
|
653
|
-
setResourceActionDisable(false);
|
|
654
|
-
};
|
|
500
|
+
const ts = () => {
|
|
501
|
+
const e = Ze(), {
|
|
502
|
+
clearSelectedIds: s,
|
|
503
|
+
setResourceActionDisable: t,
|
|
504
|
+
clearSelectedItems: r
|
|
505
|
+
} = x();
|
|
655
506
|
return {
|
|
656
|
-
isActionDisableModalOpen,
|
|
657
|
-
onActionDisableCancel
|
|
658
|
-
|
|
659
|
-
}
|
|
660
|
-
const useTrashModal = () => {
|
|
661
|
-
const isTrashedModalOpen = useResourceIsTrash();
|
|
662
|
-
const {
|
|
663
|
-
clearSelectedIds,
|
|
664
|
-
setResourceIsTrash,
|
|
665
|
-
clearSelectedItems
|
|
666
|
-
} = useStoreActions();
|
|
667
|
-
const onTrashedCancel = () => {
|
|
668
|
-
clearSelectedIds();
|
|
669
|
-
clearSelectedItems();
|
|
670
|
-
setResourceIsTrash(false);
|
|
507
|
+
isActionDisableModalOpen: e,
|
|
508
|
+
onActionDisableCancel: () => {
|
|
509
|
+
s(), r(), t(!1);
|
|
510
|
+
}
|
|
671
511
|
};
|
|
512
|
+
}, rs = () => {
|
|
513
|
+
const e = Ge(), {
|
|
514
|
+
clearSelectedIds: s,
|
|
515
|
+
setResourceIsTrash: t,
|
|
516
|
+
clearSelectedItems: r
|
|
517
|
+
} = x();
|
|
672
518
|
return {
|
|
673
|
-
isTrashedModalOpen,
|
|
674
|
-
onTrashedCancel
|
|
519
|
+
isTrashedModalOpen: e,
|
|
520
|
+
onTrashedCancel: () => {
|
|
521
|
+
s(), r(), t(!1);
|
|
522
|
+
}
|
|
675
523
|
};
|
|
676
524
|
};
|
|
677
|
-
function
|
|
678
|
-
parentId,
|
|
679
|
-
newFolder
|
|
525
|
+
function ns(e, {
|
|
526
|
+
parentId: s,
|
|
527
|
+
newFolder: t
|
|
680
528
|
}) {
|
|
681
|
-
return
|
|
682
|
-
var
|
|
683
|
-
if (
|
|
684
|
-
const
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
...
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
ancestors
|
|
529
|
+
return H(e, (r) => {
|
|
530
|
+
var n;
|
|
531
|
+
if (r.id === s) {
|
|
532
|
+
const i = [...((n = r.folder) == null ? void 0 : n.ancestors) || []], o = te([...i, r.id]);
|
|
533
|
+
return {
|
|
534
|
+
...r,
|
|
535
|
+
children: [...r.children || [], new X({
|
|
536
|
+
...t,
|
|
537
|
+
ancestors: o
|
|
691
538
|
})]
|
|
692
539
|
};
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
return node;
|
|
696
|
-
}
|
|
540
|
+
} else
|
|
541
|
+
return r;
|
|
697
542
|
});
|
|
698
543
|
}
|
|
699
|
-
function
|
|
700
|
-
folders
|
|
544
|
+
function os(e, {
|
|
545
|
+
folders: s
|
|
701
546
|
}) {
|
|
702
|
-
return
|
|
703
|
-
if (
|
|
704
|
-
return
|
|
705
|
-
} else {
|
|
706
|
-
return node;
|
|
707
|
-
}
|
|
547
|
+
return H(e, (t) => {
|
|
548
|
+
if (!s.includes(t.id))
|
|
549
|
+
return t;
|
|
708
550
|
});
|
|
709
551
|
}
|
|
710
|
-
function
|
|
711
|
-
destinationId,
|
|
712
|
-
folders
|
|
552
|
+
function as(e, {
|
|
553
|
+
destinationId: s,
|
|
554
|
+
folders: t
|
|
713
555
|
}) {
|
|
714
|
-
return
|
|
715
|
-
var
|
|
716
|
-
if (
|
|
717
|
-
const
|
|
718
|
-
const
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
const item = findNodeById(folder, treeData);
|
|
724
|
-
item && newChildren.push({
|
|
725
|
-
...item,
|
|
556
|
+
return H(e, (r, n) => {
|
|
557
|
+
var i, o;
|
|
558
|
+
if (s === r.id) {
|
|
559
|
+
const d = [...((i = r.folder) == null ? void 0 : i.ancestors) || []], u = te([...d, r.id]), h = [...r.children || []], c = ((o = r.children) == null ? void 0 : o.map((a) => a.id)) || [];
|
|
560
|
+
for (const a of t)
|
|
561
|
+
if (!c.includes(a)) {
|
|
562
|
+
const m = _(a, e);
|
|
563
|
+
m && h.push({
|
|
564
|
+
...m,
|
|
726
565
|
folder: {
|
|
727
|
-
...
|
|
728
|
-
ancestors
|
|
566
|
+
...m == null ? void 0 : m.folder,
|
|
567
|
+
ancestors: u
|
|
729
568
|
}
|
|
730
569
|
});
|
|
731
570
|
}
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
children: newChildren
|
|
571
|
+
return {
|
|
572
|
+
...r,
|
|
573
|
+
children: h
|
|
736
574
|
};
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
return void 0;
|
|
740
|
-
} else {
|
|
741
|
-
return node;
|
|
742
|
-
}
|
|
575
|
+
} else
|
|
576
|
+
return t.includes(r.id) && s !== (n == null ? void 0 : n.id) ? void 0 : r;
|
|
743
577
|
});
|
|
744
578
|
}
|
|
745
|
-
function
|
|
746
|
-
folderId,
|
|
747
|
-
newFolder
|
|
579
|
+
function cs(e, {
|
|
580
|
+
folderId: s,
|
|
581
|
+
newFolder: t
|
|
748
582
|
}) {
|
|
749
|
-
return
|
|
750
|
-
if (node.id === folderId) {
|
|
751
|
-
return new TreeNodeFolderWrapper(newFolder);
|
|
752
|
-
} else {
|
|
753
|
-
return node;
|
|
754
|
-
}
|
|
755
|
-
});
|
|
583
|
+
return H(e, (r) => r.id === s ? new X(t) : r);
|
|
756
584
|
}
|
|
757
|
-
const
|
|
758
|
-
const
|
|
759
|
-
return
|
|
585
|
+
const ls = () => {
|
|
586
|
+
const e = S((s) => s.config);
|
|
587
|
+
return qe({
|
|
760
588
|
queryKey: ["actions"],
|
|
761
589
|
queryFn: async () => {
|
|
762
|
-
const
|
|
763
|
-
|
|
764
|
-
return availableRights;
|
|
590
|
+
const s = e == null ? void 0 : e.actions.map((r) => r.workflow);
|
|
591
|
+
return await ze(s);
|
|
765
592
|
},
|
|
766
|
-
select: (
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
staleTime: Infinity,
|
|
773
|
-
enabled: !!config
|
|
593
|
+
select: (s) => e == null ? void 0 : e.actions.map((t) => ({
|
|
594
|
+
...t,
|
|
595
|
+
available: s[t.workflow]
|
|
596
|
+
})),
|
|
597
|
+
staleTime: 1 / 0,
|
|
598
|
+
enabled: !!e
|
|
774
599
|
});
|
|
775
|
-
}
|
|
776
|
-
const
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
folderId: filters.folder,
|
|
786
|
-
filters,
|
|
787
|
-
trashed,
|
|
788
|
-
search
|
|
600
|
+
}, is = () => {
|
|
601
|
+
const e = S((o) => o.config), s = T(), {
|
|
602
|
+
filters: t,
|
|
603
|
+
trashed: r,
|
|
604
|
+
search: n
|
|
605
|
+
} = s, i = ["context", {
|
|
606
|
+
folderId: t.folder,
|
|
607
|
+
filters: t,
|
|
608
|
+
trashed: r,
|
|
609
|
+
search: n
|
|
789
610
|
}];
|
|
790
|
-
return
|
|
791
|
-
queryKey,
|
|
611
|
+
return Oe({
|
|
612
|
+
queryKey: i,
|
|
792
613
|
queryFn: async ({
|
|
793
|
-
pageParam
|
|
794
|
-
}) => {
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
pagination
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
});
|
|
804
|
-
},
|
|
614
|
+
pageParam: o
|
|
615
|
+
}) => await le({
|
|
616
|
+
...s,
|
|
617
|
+
app: e == null ? void 0 : e.app,
|
|
618
|
+
types: e == null ? void 0 : e.types,
|
|
619
|
+
pagination: {
|
|
620
|
+
...s.pagination,
|
|
621
|
+
startIdx: o
|
|
622
|
+
}
|
|
623
|
+
}),
|
|
805
624
|
initialPageParam: 0,
|
|
806
|
-
enabled: !!
|
|
807
|
-
retry:
|
|
808
|
-
getNextPageParam: (
|
|
809
|
-
return lastPage.pagination.startIdx + lastPage.pagination.pageSize;
|
|
810
|
-
}
|
|
625
|
+
enabled: !!e,
|
|
626
|
+
retry: !1,
|
|
627
|
+
getNextPageParam: (o) => o.pagination.startIdx + o.pagination.pageSize
|
|
811
628
|
});
|
|
812
|
-
}
|
|
813
|
-
const
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
clearSelectedIds,
|
|
826
|
-
setTreeData,
|
|
827
|
-
setSearchParams
|
|
828
|
-
} = useStoreActions();
|
|
829
|
-
const {
|
|
830
|
-
filters,
|
|
831
|
-
trashed
|
|
832
|
-
} = searchParams;
|
|
833
|
-
const queryKey = ["context", {
|
|
834
|
-
folderId: filters.folder,
|
|
835
|
-
filters,
|
|
836
|
-
trashed
|
|
629
|
+
}, Ks = () => {
|
|
630
|
+
const e = q(), s = O(), t = T(), r = V(), n = G(), i = J(), o = Z(), d = Y().length > 0, u = d ? i : o, {
|
|
631
|
+
clearSelectedItems: h,
|
|
632
|
+
clearSelectedIds: c,
|
|
633
|
+
setTreeData: f,
|
|
634
|
+
setSearchParams: a
|
|
635
|
+
} = x(), {
|
|
636
|
+
filters: m,
|
|
637
|
+
trashed: p
|
|
638
|
+
} = t, g = ["context", {
|
|
639
|
+
folderId: m.folder,
|
|
640
|
+
filters: m,
|
|
641
|
+
trashed: p
|
|
837
642
|
}];
|
|
838
|
-
return
|
|
839
|
-
mutationFn: async () => await
|
|
840
|
-
searchParams,
|
|
841
|
-
folderIds,
|
|
842
|
-
resourceIds,
|
|
843
|
-
useAssetIds
|
|
643
|
+
return L({
|
|
644
|
+
mutationFn: async () => await Ue({
|
|
645
|
+
searchParams: t,
|
|
646
|
+
folderIds: n,
|
|
647
|
+
resourceIds: u,
|
|
648
|
+
useAssetIds: d
|
|
844
649
|
}),
|
|
845
|
-
onError(
|
|
846
|
-
|
|
847
|
-
toast.error(t(error));
|
|
650
|
+
onError(y) {
|
|
651
|
+
typeof y == "string" && e.error(D(y));
|
|
848
652
|
},
|
|
849
|
-
onSuccess: async (
|
|
850
|
-
await
|
|
851
|
-
queryKey
|
|
852
|
-
})
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
...prev,
|
|
861
|
-
pages: prev == null ? void 0 : prev.pages.map((page) => {
|
|
862
|
-
var _a2;
|
|
653
|
+
onSuccess: async (y) => {
|
|
654
|
+
if (await s.cancelQueries({
|
|
655
|
+
queryKey: g
|
|
656
|
+
}), s.getQueryData(g))
|
|
657
|
+
return e.success(D("explorer.trash.title")), s.setQueryData(g, (w) => {
|
|
658
|
+
var E;
|
|
659
|
+
if (w) {
|
|
660
|
+
const k = {
|
|
661
|
+
...w,
|
|
662
|
+
pages: w == null ? void 0 : w.pages.map((R) => {
|
|
663
|
+
var P;
|
|
863
664
|
return {
|
|
864
|
-
...
|
|
865
|
-
folders:
|
|
665
|
+
...R,
|
|
666
|
+
folders: R.folders.filter((Q) => !n.includes(Q.id)),
|
|
866
667
|
pagination: {
|
|
867
|
-
...
|
|
668
|
+
...R.pagination,
|
|
868
669
|
// @ts-ignore
|
|
869
|
-
maxIdx: ((
|
|
670
|
+
maxIdx: ((P = R == null ? void 0 : R.pagination) == null ? void 0 : P.maxIdx) - y.resources.length
|
|
870
671
|
},
|
|
871
|
-
resources:
|
|
872
|
-
if (useAssetIds) {
|
|
873
|
-
return !assetIds.includes(resource.assetId);
|
|
874
|
-
} else {
|
|
875
|
-
return !resourceIds.includes(resource.id);
|
|
876
|
-
}
|
|
877
|
-
})
|
|
672
|
+
resources: R.resources.filter((Q) => d ? !i.includes(Q.assetId) : !u.includes(Q.id))
|
|
878
673
|
};
|
|
879
674
|
})
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
folders: folderIds
|
|
675
|
+
}, B = os(r, {
|
|
676
|
+
folders: n
|
|
883
677
|
});
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
...searchParams,
|
|
678
|
+
return f(B), a({
|
|
679
|
+
...t,
|
|
887
680
|
pagination: {
|
|
888
|
-
...
|
|
681
|
+
...t.pagination,
|
|
889
682
|
// @ts-ignore
|
|
890
|
-
maxIdx: ((
|
|
683
|
+
maxIdx: ((E = t.pagination) == null ? void 0 : E.maxIdx) - y.resources.length
|
|
891
684
|
}
|
|
892
|
-
});
|
|
893
|
-
return newData;
|
|
685
|
+
}), k;
|
|
894
686
|
}
|
|
895
|
-
return void 0;
|
|
896
687
|
});
|
|
897
|
-
}
|
|
898
688
|
},
|
|
899
689
|
onSettled: () => {
|
|
900
|
-
|
|
901
|
-
clearSelectedIds();
|
|
690
|
+
h(), c();
|
|
902
691
|
}
|
|
903
692
|
});
|
|
904
|
-
}
|
|
905
|
-
const
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
setSelectedResources,
|
|
918
|
-
setSelectedFolders
|
|
919
|
-
} = useStoreActions();
|
|
920
|
-
const {
|
|
921
|
-
filters,
|
|
922
|
-
trashed
|
|
923
|
-
} = searchParams;
|
|
924
|
-
const queryKey = ["context", {
|
|
925
|
-
folderId: filters.folder,
|
|
926
|
-
filters,
|
|
927
|
-
trashed
|
|
693
|
+
}, $s = () => {
|
|
694
|
+
const e = q(), s = O(), t = T(), r = G(), n = J(), i = Z(), o = Y().length > 0, d = o ? n : i, {
|
|
695
|
+
setFolderIds: u,
|
|
696
|
+
setResourceIds: h,
|
|
697
|
+
setSelectedResources: c,
|
|
698
|
+
setSelectedFolders: f
|
|
699
|
+
} = x(), {
|
|
700
|
+
filters: a,
|
|
701
|
+
trashed: m
|
|
702
|
+
} = t, p = ["context", {
|
|
703
|
+
folderId: a.folder,
|
|
704
|
+
filters: a,
|
|
705
|
+
trashed: m
|
|
928
706
|
}];
|
|
929
|
-
return
|
|
930
|
-
mutationFn: async () => await
|
|
931
|
-
searchParams,
|
|
932
|
-
folderIds,
|
|
933
|
-
resourceIds,
|
|
934
|
-
useAssetIds
|
|
707
|
+
return L({
|
|
708
|
+
mutationFn: async () => await Be({
|
|
709
|
+
searchParams: t,
|
|
710
|
+
folderIds: r,
|
|
711
|
+
resourceIds: d,
|
|
712
|
+
useAssetIds: o
|
|
935
713
|
}),
|
|
936
|
-
onError(
|
|
937
|
-
|
|
938
|
-
toast.error(t(error));
|
|
714
|
+
onError(g) {
|
|
715
|
+
typeof g == "string" && e.error(D(g));
|
|
939
716
|
},
|
|
940
717
|
onSuccess: async () => {
|
|
941
|
-
await
|
|
942
|
-
queryKey
|
|
943
|
-
})
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
toast.success(t("explorer.trash.toast"));
|
|
947
|
-
return queryClient.setQueryData(queryKey, (prev) => {
|
|
948
|
-
if (prev) {
|
|
718
|
+
if (await s.cancelQueries({
|
|
719
|
+
queryKey: p
|
|
720
|
+
}), s.getQueryData(p))
|
|
721
|
+
return e.success(D("explorer.trash.toast")), s.setQueryData(p, (y) => {
|
|
722
|
+
if (y)
|
|
949
723
|
return {
|
|
950
|
-
...
|
|
951
|
-
pages:
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
if (useAssetIds) {
|
|
957
|
-
return !assetIds.includes(resource.assetId);
|
|
958
|
-
} else {
|
|
959
|
-
return !resourceIds.includes(resource.id);
|
|
960
|
-
}
|
|
961
|
-
})
|
|
962
|
-
};
|
|
963
|
-
})
|
|
724
|
+
...y,
|
|
725
|
+
pages: y == null ? void 0 : y.pages.map((I) => ({
|
|
726
|
+
...I,
|
|
727
|
+
folders: I.folders.filter((w) => !r.includes(w.id)),
|
|
728
|
+
resources: I.resources.filter((w) => o ? !n.includes(w.assetId) : !d.includes(w.id))
|
|
729
|
+
}))
|
|
964
730
|
};
|
|
965
|
-
}
|
|
966
|
-
return void 0;
|
|
967
731
|
});
|
|
968
|
-
}
|
|
969
732
|
},
|
|
970
733
|
onSettled: () => {
|
|
971
|
-
|
|
972
|
-
setSelectedResources([]);
|
|
973
|
-
setFolderIds([]);
|
|
974
|
-
setSelectedFolders([]);
|
|
734
|
+
h([]), c([]), u([]), f([]);
|
|
975
735
|
}
|
|
976
736
|
});
|
|
977
|
-
}
|
|
978
|
-
const
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
clearSelectedItems,
|
|
989
|
-
clearSelectedIds
|
|
990
|
-
} = useStoreActions();
|
|
991
|
-
const {
|
|
992
|
-
filters,
|
|
993
|
-
trashed
|
|
994
|
-
} = searchParams;
|
|
995
|
-
const queryKey = ["context", {
|
|
996
|
-
folderId: filters.folder,
|
|
997
|
-
filters,
|
|
998
|
-
trashed
|
|
737
|
+
}, js = () => {
|
|
738
|
+
const e = q(), s = O(), t = T(), r = G(), n = J(), i = Z(), o = Y().length > 0, d = o ? n : i, {
|
|
739
|
+
clearSelectedItems: u,
|
|
740
|
+
clearSelectedIds: h
|
|
741
|
+
} = x(), {
|
|
742
|
+
filters: c,
|
|
743
|
+
trashed: f
|
|
744
|
+
} = t, a = ["context", {
|
|
745
|
+
folderId: c.folder,
|
|
746
|
+
filters: c,
|
|
747
|
+
trashed: f
|
|
999
748
|
}];
|
|
1000
|
-
return
|
|
1001
|
-
mutationFn: async () => await
|
|
1002
|
-
searchParams,
|
|
1003
|
-
folderIds,
|
|
1004
|
-
resourceIds,
|
|
1005
|
-
useAssetIds
|
|
749
|
+
return L({
|
|
750
|
+
mutationFn: async () => await Me({
|
|
751
|
+
searchParams: t,
|
|
752
|
+
folderIds: r,
|
|
753
|
+
resourceIds: d,
|
|
754
|
+
useAssetIds: o
|
|
1006
755
|
}),
|
|
1007
|
-
onError(
|
|
1008
|
-
|
|
1009
|
-
toast.error(t(error));
|
|
756
|
+
onError(m) {
|
|
757
|
+
typeof m == "string" && e.error(D(m));
|
|
1010
758
|
},
|
|
1011
759
|
onSuccess: async () => {
|
|
1012
|
-
await
|
|
1013
|
-
queryKey
|
|
1014
|
-
})
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
...page,
|
|
1025
|
-
folders: page.folders.filter((folder) => !folderIds.includes(folder.id)),
|
|
1026
|
-
resources: page.resources.filter((resource) => {
|
|
1027
|
-
if (useAssetIds) {
|
|
1028
|
-
return !assetIds.includes(resource.assetId);
|
|
1029
|
-
} else {
|
|
1030
|
-
return !resourceIds.includes(resource.id);
|
|
1031
|
-
}
|
|
1032
|
-
})
|
|
1033
|
-
};
|
|
1034
|
-
})
|
|
760
|
+
if (await s.cancelQueries({
|
|
761
|
+
queryKey: a
|
|
762
|
+
}), s.getQueryData(a))
|
|
763
|
+
return e.success(D("explorer.removed.from.trash")), s.setQueryData(a, (p) => {
|
|
764
|
+
if (p)
|
|
765
|
+
return {
|
|
766
|
+
...p,
|
|
767
|
+
pages: p == null ? void 0 : p.pages.map((y) => ({
|
|
768
|
+
...y,
|
|
769
|
+
folders: y.folders.filter((I) => !r.includes(I.id)),
|
|
770
|
+
resources: y.resources.filter((I) => o ? !n.includes(I.assetId) : !d.includes(I.id))
|
|
771
|
+
}))
|
|
1035
772
|
};
|
|
1036
|
-
return newData;
|
|
1037
|
-
}
|
|
1038
|
-
return void 0;
|
|
1039
773
|
});
|
|
1040
|
-
}
|
|
1041
774
|
},
|
|
1042
775
|
onSettled: () => {
|
|
1043
|
-
|
|
1044
|
-
clearSelectedIds();
|
|
776
|
+
u(), h();
|
|
1045
777
|
}
|
|
1046
778
|
});
|
|
1047
|
-
}
|
|
1048
|
-
const
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
clearSelectedItems,
|
|
1061
|
-
setTreeData,
|
|
1062
|
-
setSearchParams
|
|
1063
|
-
} = useStoreActions();
|
|
1064
|
-
const {
|
|
1065
|
-
filters,
|
|
1066
|
-
trashed
|
|
1067
|
-
} = searchParams;
|
|
1068
|
-
const queryKey = ["context", {
|
|
1069
|
-
folderId: filters.folder,
|
|
1070
|
-
filters,
|
|
1071
|
-
trashed
|
|
779
|
+
}, zs = () => {
|
|
780
|
+
const e = q(), s = O(), t = T(), r = V(), n = G(), i = J(), o = Z(), d = Y().length > 0, u = d ? i : o, {
|
|
781
|
+
clearSelectedIds: h,
|
|
782
|
+
clearSelectedItems: c,
|
|
783
|
+
setTreeData: f,
|
|
784
|
+
setSearchParams: a
|
|
785
|
+
} = x(), {
|
|
786
|
+
filters: m,
|
|
787
|
+
trashed: p
|
|
788
|
+
} = t, g = ["context", {
|
|
789
|
+
folderId: m.folder,
|
|
790
|
+
filters: m,
|
|
791
|
+
trashed: p
|
|
1072
792
|
}];
|
|
1073
|
-
return
|
|
1074
|
-
mutationFn: async (
|
|
1075
|
-
searchParams,
|
|
1076
|
-
folderId,
|
|
1077
|
-
folderIds,
|
|
1078
|
-
resourceIds,
|
|
1079
|
-
useAssetIds
|
|
793
|
+
return L({
|
|
794
|
+
mutationFn: async (y) => await Ke({
|
|
795
|
+
searchParams: t,
|
|
796
|
+
folderId: y,
|
|
797
|
+
folderIds: n,
|
|
798
|
+
resourceIds: u,
|
|
799
|
+
useAssetIds: d
|
|
1080
800
|
}),
|
|
1081
|
-
onError(
|
|
1082
|
-
|
|
1083
|
-
toast.error(t(error));
|
|
801
|
+
onError(y) {
|
|
802
|
+
typeof y == "string" && e.error(D(y));
|
|
1084
803
|
},
|
|
1085
|
-
onSuccess: async (
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
pages: prev == null ? void 0 : prev.pages.map((page) => {
|
|
1098
|
-
var _a2;
|
|
804
|
+
onSuccess: async (y, I) => {
|
|
805
|
+
if (s.getQueryData(g))
|
|
806
|
+
return s.setQueryData(g, (E) => {
|
|
807
|
+
var k;
|
|
808
|
+
if (E) {
|
|
809
|
+
const B = as(r, {
|
|
810
|
+
destinationId: I,
|
|
811
|
+
folders: n
|
|
812
|
+
}), R = {
|
|
813
|
+
...E,
|
|
814
|
+
pages: E == null ? void 0 : E.pages.map((P) => {
|
|
815
|
+
var Q;
|
|
1099
816
|
return {
|
|
1100
|
-
...
|
|
1101
|
-
folders:
|
|
817
|
+
...P,
|
|
818
|
+
folders: P.folders.filter((K) => !n.includes(K.id)),
|
|
1102
819
|
pagination: {
|
|
1103
|
-
...
|
|
820
|
+
...P.pagination,
|
|
1104
821
|
// @ts-ignore
|
|
1105
|
-
maxIdx: ((
|
|
822
|
+
maxIdx: ((Q = P.pagination) == null ? void 0 : Q.maxIdx) - y.resources.length
|
|
1106
823
|
},
|
|
1107
|
-
resources:
|
|
1108
|
-
if (useAssetIds) {
|
|
1109
|
-
return !assetIds.includes(resource.assetId);
|
|
1110
|
-
} else {
|
|
1111
|
-
return !resourceIds.includes(resource.id);
|
|
1112
|
-
}
|
|
1113
|
-
})
|
|
824
|
+
resources: P.resources.filter((K) => d ? !i.includes(K.assetId) : !u.includes(K.id))
|
|
1114
825
|
};
|
|
1115
826
|
})
|
|
1116
827
|
};
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
...searchParams,
|
|
828
|
+
return f(B), a({
|
|
829
|
+
...t,
|
|
1120
830
|
pagination: {
|
|
1121
|
-
...
|
|
831
|
+
...t.pagination,
|
|
1122
832
|
// @ts-ignore
|
|
1123
|
-
maxIdx: ((
|
|
833
|
+
maxIdx: ((k = t.pagination) == null ? void 0 : k.maxIdx) - y.resources.length
|
|
1124
834
|
}
|
|
1125
|
-
});
|
|
1126
|
-
return newData;
|
|
835
|
+
}), R;
|
|
1127
836
|
}
|
|
1128
|
-
return void 0;
|
|
1129
837
|
});
|
|
1130
|
-
}
|
|
1131
838
|
},
|
|
1132
839
|
onSettled: () => {
|
|
1133
|
-
|
|
1134
|
-
clearSelectedIds();
|
|
840
|
+
c(), h();
|
|
1135
841
|
}
|
|
1136
842
|
});
|
|
1137
|
-
}
|
|
1138
|
-
const
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
filters,
|
|
1148
|
-
trashed
|
|
1149
|
-
} = searchParams;
|
|
1150
|
-
const queryKey = ["context", {
|
|
1151
|
-
folderId: filters.folder,
|
|
1152
|
-
filters,
|
|
1153
|
-
trashed
|
|
843
|
+
}, Vs = () => {
|
|
844
|
+
const e = q(), s = O(), t = T(), r = V(), {
|
|
845
|
+
setTreeData: n
|
|
846
|
+
} = x(), {
|
|
847
|
+
filters: i,
|
|
848
|
+
trashed: o
|
|
849
|
+
} = t, d = ["context", {
|
|
850
|
+
folderId: i.folder,
|
|
851
|
+
filters: i,
|
|
852
|
+
trashed: o
|
|
1154
853
|
}];
|
|
1155
|
-
return
|
|
854
|
+
return L({
|
|
1156
855
|
mutationFn: async ({
|
|
1157
|
-
name,
|
|
1158
|
-
parentId
|
|
1159
|
-
}) => await
|
|
1160
|
-
searchParams,
|
|
1161
|
-
name,
|
|
1162
|
-
parentId
|
|
856
|
+
name: u,
|
|
857
|
+
parentId: h
|
|
858
|
+
}) => await Le({
|
|
859
|
+
searchParams: t,
|
|
860
|
+
name: u,
|
|
861
|
+
parentId: h
|
|
1163
862
|
}),
|
|
1164
|
-
onError(
|
|
1165
|
-
|
|
1166
|
-
toast.error(t(error));
|
|
863
|
+
onError(u) {
|
|
864
|
+
typeof u == "string" && e.error(D(u));
|
|
1167
865
|
},
|
|
1168
|
-
onSuccess: async (
|
|
1169
|
-
await
|
|
1170
|
-
queryKey
|
|
866
|
+
onSuccess: async (u, h) => {
|
|
867
|
+
await s.cancelQueries({
|
|
868
|
+
queryKey: d
|
|
1171
869
|
});
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
parentId: variables.parentId,
|
|
870
|
+
const c = s.getQueryData(d), f = {
|
|
871
|
+
...u,
|
|
872
|
+
parentId: h.parentId,
|
|
1176
873
|
children: [],
|
|
1177
|
-
rights: [`creator:${
|
|
874
|
+
rights: [`creator:${u == null ? void 0 : u.creator_id}`]
|
|
1178
875
|
};
|
|
1179
|
-
if (
|
|
1180
|
-
return
|
|
1181
|
-
if (
|
|
1182
|
-
const
|
|
1183
|
-
...
|
|
1184
|
-
pages:
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
const update = addNode(treeData, {
|
|
1192
|
-
parentId: variables.parentId,
|
|
1193
|
-
newFolder
|
|
876
|
+
if (c)
|
|
877
|
+
return s.setQueryData(d, (a) => {
|
|
878
|
+
if (a) {
|
|
879
|
+
const m = {
|
|
880
|
+
...a,
|
|
881
|
+
pages: a == null ? void 0 : a.pages.map((g) => ({
|
|
882
|
+
...g,
|
|
883
|
+
folders: [...g.folders, f]
|
|
884
|
+
}))
|
|
885
|
+
}, p = ns(r, {
|
|
886
|
+
parentId: h.parentId,
|
|
887
|
+
newFolder: f
|
|
1194
888
|
});
|
|
1195
|
-
|
|
1196
|
-
return newData;
|
|
889
|
+
return n(p), m;
|
|
1197
890
|
}
|
|
1198
|
-
return void 0;
|
|
1199
891
|
});
|
|
1200
|
-
}
|
|
1201
892
|
}
|
|
1202
893
|
});
|
|
1203
|
-
}
|
|
1204
|
-
const
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
filters,
|
|
1216
|
-
trashed
|
|
1217
|
-
} = searchParams;
|
|
1218
|
-
const queryKey = ["context", {
|
|
1219
|
-
folderId: filters.folder,
|
|
1220
|
-
filters,
|
|
1221
|
-
trashed
|
|
894
|
+
}, _s = () => {
|
|
895
|
+
const e = q(), s = O(), t = T(), r = V(), {
|
|
896
|
+
setFolderIds: n,
|
|
897
|
+
setSelectedFolders: i,
|
|
898
|
+
setTreeData: o
|
|
899
|
+
} = x(), {
|
|
900
|
+
filters: d,
|
|
901
|
+
trashed: u
|
|
902
|
+
} = t, h = ["context", {
|
|
903
|
+
folderId: d.folder,
|
|
904
|
+
filters: d,
|
|
905
|
+
trashed: u
|
|
1222
906
|
}];
|
|
1223
|
-
return
|
|
907
|
+
return L({
|
|
1224
908
|
mutationFn: async ({
|
|
1225
|
-
folderId,
|
|
1226
|
-
name,
|
|
1227
|
-
parentId
|
|
1228
|
-
}) => await
|
|
1229
|
-
searchParams,
|
|
1230
|
-
folderId,
|
|
1231
|
-
parentId,
|
|
1232
|
-
name
|
|
909
|
+
folderId: c,
|
|
910
|
+
name: f,
|
|
911
|
+
parentId: a
|
|
912
|
+
}) => await ke({
|
|
913
|
+
searchParams: t,
|
|
914
|
+
folderId: c,
|
|
915
|
+
parentId: a,
|
|
916
|
+
name: f
|
|
1233
917
|
}),
|
|
1234
|
-
onError(
|
|
1235
|
-
|
|
1236
|
-
toast.error(t(error));
|
|
918
|
+
onError(c) {
|
|
919
|
+
typeof c == "string" && e.error(D(c));
|
|
1237
920
|
},
|
|
1238
|
-
onSuccess: async (
|
|
1239
|
-
await
|
|
1240
|
-
queryKey
|
|
1241
|
-
})
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
};
|
|
1258
|
-
} else {
|
|
1259
|
-
return folder;
|
|
1260
|
-
}
|
|
1261
|
-
})
|
|
1262
|
-
};
|
|
1263
|
-
})
|
|
1264
|
-
};
|
|
1265
|
-
const update = updateNode(treeData, {
|
|
1266
|
-
folderId: variables.folderId,
|
|
1267
|
-
newFolder: data
|
|
921
|
+
onSuccess: async (c, f) => {
|
|
922
|
+
if (await s.cancelQueries({
|
|
923
|
+
queryKey: h
|
|
924
|
+
}), s.getQueryData(h))
|
|
925
|
+
return s.setQueryData(h, (m) => {
|
|
926
|
+
if (m) {
|
|
927
|
+
const p = {
|
|
928
|
+
...m,
|
|
929
|
+
pages: m == null ? void 0 : m.pages.map((y) => ({
|
|
930
|
+
...y,
|
|
931
|
+
folders: y.folders.map((I) => I.id === c.id ? {
|
|
932
|
+
...c,
|
|
933
|
+
parentId: f.parentId,
|
|
934
|
+
rights: I.rights
|
|
935
|
+
} : I)
|
|
936
|
+
}))
|
|
937
|
+
}, g = cs(r, {
|
|
938
|
+
folderId: f.folderId,
|
|
939
|
+
newFolder: c
|
|
1268
940
|
});
|
|
1269
|
-
|
|
1270
|
-
return newData;
|
|
941
|
+
return o(g), p;
|
|
1271
942
|
}
|
|
1272
|
-
return void 0;
|
|
1273
943
|
});
|
|
1274
|
-
}
|
|
1275
944
|
},
|
|
1276
945
|
onSettled: () => {
|
|
1277
|
-
|
|
1278
|
-
setSelectedFolders([]);
|
|
946
|
+
n([]), i([]);
|
|
1279
947
|
}
|
|
1280
948
|
});
|
|
1281
|
-
}
|
|
1282
|
-
const
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
} =
|
|
1290
|
-
|
|
1291
|
-
filters,
|
|
1292
|
-
trashed
|
|
1293
|
-
app
|
|
1294
|
-
} = searchParams;
|
|
1295
|
-
const queryKey = ["context", {
|
|
1296
|
-
folderId: filters.folder,
|
|
1297
|
-
filters,
|
|
1298
|
-
trashed
|
|
949
|
+
}, Hs = () => {
|
|
950
|
+
const e = q(), s = O(), t = T(), {
|
|
951
|
+
setResourceIds: r,
|
|
952
|
+
setSelectedResources: n
|
|
953
|
+
} = x(), {
|
|
954
|
+
filters: i,
|
|
955
|
+
trashed: o,
|
|
956
|
+
app: d
|
|
957
|
+
} = t, u = ["context", {
|
|
958
|
+
folderId: i.folder,
|
|
959
|
+
filters: i,
|
|
960
|
+
trashed: o
|
|
1299
961
|
}];
|
|
1300
|
-
return
|
|
962
|
+
return L({
|
|
1301
963
|
mutationFn: async ({
|
|
1302
|
-
resourceId,
|
|
1303
|
-
rights
|
|
1304
|
-
}) => await
|
|
1305
|
-
app,
|
|
1306
|
-
resourceId,
|
|
1307
|
-
rights
|
|
964
|
+
resourceId: h,
|
|
965
|
+
rights: c
|
|
966
|
+
}) => await $e({
|
|
967
|
+
app: d,
|
|
968
|
+
resourceId: h,
|
|
969
|
+
rights: c
|
|
1308
970
|
}),
|
|
1309
|
-
onError(
|
|
1310
|
-
|
|
1311
|
-
toast.error(t("explorer.shared.status.error"));
|
|
971
|
+
onError(h) {
|
|
972
|
+
typeof h == "string" && e.error(D("explorer.shared.status.error"));
|
|
1312
973
|
},
|
|
1313
|
-
onSuccess: async (
|
|
1314
|
-
await
|
|
1315
|
-
queryKey
|
|
1316
|
-
})
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
toast.success(t("explorer.shared.status.saved"));
|
|
1320
|
-
return queryClient.setQueryData(queryKey, (prev) => {
|
|
1321
|
-
if (prev) {
|
|
974
|
+
onSuccess: async (h, c) => {
|
|
975
|
+
if (await s.cancelQueries({
|
|
976
|
+
queryKey: u
|
|
977
|
+
}), s.getQueryData(u))
|
|
978
|
+
return e.success(D("explorer.shared.status.saved")), s.setQueryData(u, (a) => {
|
|
979
|
+
if (a)
|
|
1322
980
|
return {
|
|
1323
|
-
...
|
|
1324
|
-
pages:
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
return {
|
|
1338
|
-
...resource,
|
|
1339
|
-
rights
|
|
1340
|
-
};
|
|
1341
|
-
} else {
|
|
1342
|
-
return resource;
|
|
1343
|
-
}
|
|
1344
|
-
})
|
|
1345
|
-
};
|
|
1346
|
-
})
|
|
981
|
+
...a,
|
|
982
|
+
pages: a == null ? void 0 : a.pages.map((m) => ({
|
|
983
|
+
...m,
|
|
984
|
+
resources: m.resources.map((p) => {
|
|
985
|
+
if (p.assetId === (c == null ? void 0 : c.resourceId)) {
|
|
986
|
+
let g = [`creator:${p.creatorId}`];
|
|
987
|
+
return (c == null ? void 0 : c.rights.length) >= 1 && (g = [...g, ...c.rights.flatMap((y) => y.actions.map((I) => `${y.type}:${y.id}:${I.id}`))]), {
|
|
988
|
+
...p,
|
|
989
|
+
rights: g
|
|
990
|
+
};
|
|
991
|
+
} else
|
|
992
|
+
return p;
|
|
993
|
+
})
|
|
994
|
+
}))
|
|
1347
995
|
};
|
|
1348
|
-
}
|
|
1349
|
-
return void 0;
|
|
1350
996
|
});
|
|
1351
|
-
}
|
|
1352
997
|
},
|
|
1353
998
|
onSettled: () => {
|
|
1354
|
-
|
|
1355
|
-
setSelectedResources([]);
|
|
999
|
+
r([]), n([]);
|
|
1356
1000
|
}
|
|
1357
1001
|
});
|
|
1358
|
-
}
|
|
1359
|
-
const
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
} = searchParams;
|
|
1368
|
-
const queryKey = ["context", {
|
|
1369
|
-
folderId: filters.folder,
|
|
1370
|
-
filters,
|
|
1371
|
-
trashed
|
|
1002
|
+
}, Ws = () => {
|
|
1003
|
+
const e = q(), s = O(), t = T(), {
|
|
1004
|
+
filters: r,
|
|
1005
|
+
trashed: n,
|
|
1006
|
+
app: i
|
|
1007
|
+
} = t, o = ["context", {
|
|
1008
|
+
folderId: r.folder,
|
|
1009
|
+
filters: r,
|
|
1010
|
+
trashed: n
|
|
1372
1011
|
}];
|
|
1373
|
-
return
|
|
1374
|
-
mutationFn: async (
|
|
1375
|
-
app,
|
|
1376
|
-
params
|
|
1012
|
+
return L({
|
|
1013
|
+
mutationFn: async (d) => await je({
|
|
1014
|
+
app: i,
|
|
1015
|
+
params: d
|
|
1377
1016
|
}),
|
|
1378
|
-
onError(
|
|
1379
|
-
|
|
1380
|
-
toast.error(t(error));
|
|
1017
|
+
onError(d) {
|
|
1018
|
+
typeof d == "string" && e.error(D(d));
|
|
1381
1019
|
},
|
|
1382
|
-
onSuccess: async (
|
|
1383
|
-
await
|
|
1384
|
-
queryKey
|
|
1385
|
-
})
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
return queryClient.setQueryData(queryKey, (prev) => {
|
|
1389
|
-
if (prev) {
|
|
1020
|
+
onSuccess: async (d, u) => {
|
|
1021
|
+
if (await s.cancelQueries({
|
|
1022
|
+
queryKey: o
|
|
1023
|
+
}), s.getQueryData(o))
|
|
1024
|
+
return s.setQueryData(o, (c) => {
|
|
1025
|
+
if (c)
|
|
1390
1026
|
return {
|
|
1391
|
-
...
|
|
1392
|
-
pages:
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
})
|
|
1419
|
-
};
|
|
1420
|
-
})
|
|
1027
|
+
...c,
|
|
1028
|
+
pages: c == null ? void 0 : c.pages.map((f) => ({
|
|
1029
|
+
...f,
|
|
1030
|
+
resources: f.resources.map((a) => {
|
|
1031
|
+
if (a.assetId === (u == null ? void 0 : u.entId)) {
|
|
1032
|
+
const {
|
|
1033
|
+
name: m,
|
|
1034
|
+
thumbnail: p,
|
|
1035
|
+
public: g,
|
|
1036
|
+
description: y,
|
|
1037
|
+
slug: I,
|
|
1038
|
+
...w
|
|
1039
|
+
} = u;
|
|
1040
|
+
return {
|
|
1041
|
+
...a,
|
|
1042
|
+
...w,
|
|
1043
|
+
// add any custom field
|
|
1044
|
+
name: m,
|
|
1045
|
+
thumbnail: typeof p == "string" ? p : URL.createObjectURL(p),
|
|
1046
|
+
public: g,
|
|
1047
|
+
description: y,
|
|
1048
|
+
slug: I
|
|
1049
|
+
};
|
|
1050
|
+
} else
|
|
1051
|
+
return a;
|
|
1052
|
+
})
|
|
1053
|
+
}))
|
|
1421
1054
|
};
|
|
1422
|
-
}
|
|
1423
|
-
return void 0;
|
|
1424
1055
|
});
|
|
1425
|
-
}
|
|
1426
1056
|
}
|
|
1427
1057
|
});
|
|
1428
|
-
}
|
|
1429
|
-
const
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
appCode: application
|
|
1438
|
-
} = useOdeClient();
|
|
1439
|
-
const queryKey = ["context", {
|
|
1440
|
-
folderId: searchParams.filters.folder,
|
|
1441
|
-
filters: searchParams.filters,
|
|
1442
|
-
trashed: searchParams.trashed
|
|
1058
|
+
}, Xs = () => {
|
|
1059
|
+
const e = q(), s = O(), t = T(), {
|
|
1060
|
+
user: r
|
|
1061
|
+
} = Se(), {
|
|
1062
|
+
appCode: n
|
|
1063
|
+
} = M(), i = ["context", {
|
|
1064
|
+
folderId: t.filters.folder,
|
|
1065
|
+
filters: t.filters,
|
|
1066
|
+
trashed: t.trashed
|
|
1443
1067
|
}];
|
|
1444
|
-
return
|
|
1445
|
-
mutationFn: async (
|
|
1446
|
-
searchParams,
|
|
1447
|
-
params
|
|
1068
|
+
return L({
|
|
1069
|
+
mutationFn: async (o) => await _e({
|
|
1070
|
+
searchParams: t,
|
|
1071
|
+
params: o
|
|
1448
1072
|
}),
|
|
1449
|
-
onError(
|
|
1450
|
-
|
|
1451
|
-
toast.error(t(error));
|
|
1073
|
+
onError(o) {
|
|
1074
|
+
typeof o == "string" && e.error(D(o));
|
|
1452
1075
|
},
|
|
1453
|
-
onSuccess: async (
|
|
1454
|
-
var
|
|
1455
|
-
await
|
|
1456
|
-
queryKey
|
|
1076
|
+
onSuccess: async (o, d) => {
|
|
1077
|
+
var f, a, m;
|
|
1078
|
+
await s.cancelQueries({
|
|
1079
|
+
queryKey: i
|
|
1457
1080
|
});
|
|
1458
|
-
const
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
creatorId: user == null ? void 0 : user.userId,
|
|
1469
|
-
creatorName: user == null ? void 0 : user.username,
|
|
1081
|
+
const u = s.getQueryData(i), {
|
|
1082
|
+
thumbnail: h
|
|
1083
|
+
} = d, c = {
|
|
1084
|
+
...d,
|
|
1085
|
+
thumbnail: h ? URL.createObjectURL(h) : "",
|
|
1086
|
+
application: n,
|
|
1087
|
+
assetId: o._id || o.entId || "",
|
|
1088
|
+
id: o._id || o.entId || "",
|
|
1089
|
+
creatorId: r == null ? void 0 : r.userId,
|
|
1090
|
+
creatorName: r == null ? void 0 : r.username,
|
|
1470
1091
|
createdAt: Date.now(),
|
|
1471
|
-
slug:
|
|
1472
|
-
modifiedAt: ((
|
|
1473
|
-
modifierId: ((
|
|
1474
|
-
modifierName: ((
|
|
1092
|
+
slug: d.slug || "",
|
|
1093
|
+
modifiedAt: ((f = o.modified) == null ? void 0 : f.$date) || "",
|
|
1094
|
+
modifierId: ((a = o.author) == null ? void 0 : a.userId) || "",
|
|
1095
|
+
modifierName: ((m = o.author) == null ? void 0 : m.username) || "",
|
|
1475
1096
|
updatedAt: Date.now(),
|
|
1476
|
-
trashed:
|
|
1477
|
-
rights: [`creator:${
|
|
1097
|
+
trashed: !1,
|
|
1098
|
+
rights: [`creator:${r == null ? void 0 : r.userId}`]
|
|
1478
1099
|
};
|
|
1479
|
-
if (
|
|
1480
|
-
return
|
|
1481
|
-
if (
|
|
1100
|
+
if (u)
|
|
1101
|
+
return s.setQueryData(i, (p) => {
|
|
1102
|
+
if (p)
|
|
1482
1103
|
return {
|
|
1483
|
-
...
|
|
1484
|
-
pages:
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
};
|
|
1489
|
-
})
|
|
1104
|
+
...p,
|
|
1105
|
+
pages: p == null ? void 0 : p.pages.map((g) => ({
|
|
1106
|
+
...g,
|
|
1107
|
+
resources: [c, ...g.resources]
|
|
1108
|
+
}))
|
|
1490
1109
|
};
|
|
1491
|
-
}
|
|
1492
|
-
return void 0;
|
|
1493
1110
|
});
|
|
1494
|
-
}
|
|
1495
1111
|
}
|
|
1496
1112
|
});
|
|
1497
|
-
}
|
|
1498
|
-
const
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
isLoading,
|
|
1529
|
-
isFetching,
|
|
1530
|
-
fetchNextPage
|
|
1531
|
-
} = useSearchContext();
|
|
1532
|
-
const hasNoFolders = (data == null ? void 0 : data.pages[0].folders.length) === 0;
|
|
1533
|
-
const hasNoResources = (data == null ? void 0 : data.pages[0].resources.length) === 0;
|
|
1534
|
-
const hasNoData = hasNoFolders && hasNoResources;
|
|
1535
|
-
useEffect(() => {
|
|
1536
|
-
var _a, _b, _c;
|
|
1537
|
-
if (data) {
|
|
1538
|
-
const folders = [...((_a = data == null ? void 0 : data.pages[0]) == null ? void 0 : _a.folders) ?? []];
|
|
1539
|
-
if ((_b = data == null ? void 0 : data.pages[0]) == null ? void 0 : _b.searchConfig) {
|
|
1540
|
-
setSearchConfig(data.pages[0].searchConfig);
|
|
1541
|
-
}
|
|
1542
|
-
if (!searchParams.search) {
|
|
1543
|
-
if ((currentFolder == null ? void 0 : currentFolder.id) === "default") {
|
|
1544
|
-
setTreeData({
|
|
1545
|
-
id: FOLDER.DEFAULT,
|
|
1546
|
-
section: true,
|
|
1547
|
-
children: folders.map((folder) => new TreeNodeFolderWrapper(folder)),
|
|
1548
|
-
name: t2("explorer.filters.mine", {
|
|
1549
|
-
ns: appCode
|
|
1550
|
-
})
|
|
1551
|
-
});
|
|
1552
|
-
} else {
|
|
1553
|
-
setTreeData(wrapTreeNode(treeData, folders, searchParams.filters.folder || FOLDER.DEFAULT));
|
|
1554
|
-
}
|
|
1555
|
-
}
|
|
1556
|
-
setSearchParams({
|
|
1557
|
-
...searchParams,
|
|
1558
|
-
pagination: (_c = data == null ? void 0 : data.pages[(data == null ? void 0 : data.pages.length) - 1]) == null ? void 0 : _c.pagination
|
|
1113
|
+
}, ds = /* @__PURE__ */ b(async () => await import("./EmptyScreenApp.js")), us = /* @__PURE__ */ b(async () => await import("./EmptyScreenSearch.js")), hs = /* @__PURE__ */ b(async () => await import("./EmptyScreenError.js")), fs = /* @__PURE__ */ b(async () => await import("./EmptyScreenNoContentInFolder.js")), ps = /* @__PURE__ */ b(async () => await import("./EmptyScreenTrash.js")), ms = /* @__PURE__ */ b(async () => await import("./FoldersList.js")), ys = /* @__PURE__ */ b(async () => await import("./ResourcesList.js")), gs = () => {
|
|
1114
|
+
const e = Je(), s = ne(), t = Ye(), r = T(), n = W(), i = V(), o = q(), {
|
|
1115
|
+
appCode: d
|
|
1116
|
+
} = M(), {
|
|
1117
|
+
t: u
|
|
1118
|
+
} = z(), {
|
|
1119
|
+
setSearchParams: h,
|
|
1120
|
+
setSearchConfig: c,
|
|
1121
|
+
setTreeData: f
|
|
1122
|
+
} = x(), {
|
|
1123
|
+
data: a,
|
|
1124
|
+
isError: m,
|
|
1125
|
+
error: p,
|
|
1126
|
+
isLoading: g,
|
|
1127
|
+
isFetching: y,
|
|
1128
|
+
fetchNextPage: I
|
|
1129
|
+
} = is(), w = (a == null ? void 0 : a.pages[0].folders.length) === 0, E = (a == null ? void 0 : a.pages[0].resources.length) === 0, k = w && E;
|
|
1130
|
+
return U(() => {
|
|
1131
|
+
var B, R, P;
|
|
1132
|
+
if (a) {
|
|
1133
|
+
const Q = [...((B = a == null ? void 0 : a.pages[0]) == null ? void 0 : B.folders) ?? []];
|
|
1134
|
+
(R = a == null ? void 0 : a.pages[0]) != null && R.searchConfig && c(a.pages[0].searchConfig), r.search || ((n == null ? void 0 : n.id) === "default" ? f({
|
|
1135
|
+
id: F.DEFAULT,
|
|
1136
|
+
section: !0,
|
|
1137
|
+
children: Q.map((K) => new X(K)),
|
|
1138
|
+
name: u("explorer.filters.mine", {
|
|
1139
|
+
ns: d
|
|
1140
|
+
})
|
|
1141
|
+
}) : f(ue(i, Q, r.filters.folder || F.DEFAULT))), h({
|
|
1142
|
+
...r,
|
|
1143
|
+
pagination: (P = a == null ? void 0 : a.pages[(a == null ? void 0 : a.pages.length) - 1]) == null ? void 0 : P.pagination
|
|
1559
1144
|
});
|
|
1560
1145
|
}
|
|
1561
|
-
}, [
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
}
|
|
1566
|
-
}, [error]);
|
|
1567
|
-
if (isLoading)
|
|
1568
|
-
return /* @__PURE__ */ jsx(LoadingScreen, {});
|
|
1569
|
-
if (isError) {
|
|
1570
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingScreen, {}), children: /* @__PURE__ */ jsx(EmptyScreenError, {}) });
|
|
1571
|
-
}
|
|
1572
|
-
if (searchParams.search && hasNoData) {
|
|
1573
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingScreen, {}), children: /* @__PURE__ */ jsx(EmptyScreenSearch, {}) });
|
|
1574
|
-
}
|
|
1575
|
-
if (isRoot && hasNoData) {
|
|
1576
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingScreen, {}), children: /* @__PURE__ */ jsx(EmptyScreenApp, {}) });
|
|
1577
|
-
}
|
|
1578
|
-
if (hasSelectedNodes && hasNoData && !isTrashFolder) {
|
|
1579
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingScreen, {}), children: /* @__PURE__ */ jsx(EmptyScreenNoContentInFolder, {}) });
|
|
1580
|
-
}
|
|
1581
|
-
if (isTrashFolder && (data == null ? void 0 : data.pages[0].resources.length) === 0) {
|
|
1582
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingScreen, {}), children: /* @__PURE__ */ jsx(EmptyScreenTrash, {}) });
|
|
1583
|
-
}
|
|
1584
|
-
return /* @__PURE__ */ jsxs(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingScreen, {}), children: [
|
|
1585
|
-
/* @__PURE__ */ jsx(FoldersList, { data, isFetching }),
|
|
1586
|
-
/* @__PURE__ */ jsx(ResourcesList, { data, isFetching, fetchNextPage })
|
|
1146
|
+
}, [a]), U(() => {
|
|
1147
|
+
p && typeof p == "string" && o.error(u(p));
|
|
1148
|
+
}, [p]), g ? /* @__PURE__ */ l(A, {}) : m ? /* @__PURE__ */ l(v, { fallback: /* @__PURE__ */ l(A, {}), children: /* @__PURE__ */ l(hs, {}) }) : r.search && k ? /* @__PURE__ */ l(v, { fallback: /* @__PURE__ */ l(A, {}), children: /* @__PURE__ */ l(us, {}) }) : e && k ? /* @__PURE__ */ l(v, { fallback: /* @__PURE__ */ l(A, {}), children: /* @__PURE__ */ l(ds, {}) }) : t && k && !s ? /* @__PURE__ */ l(v, { fallback: /* @__PURE__ */ l(A, {}), children: /* @__PURE__ */ l(fs, {}) }) : s && (a == null ? void 0 : a.pages[0].resources.length) === 0 ? /* @__PURE__ */ l(v, { fallback: /* @__PURE__ */ l(A, {}), children: /* @__PURE__ */ l(ps, {}) }) : /* @__PURE__ */ C(v, { fallback: /* @__PURE__ */ l(A, {}), children: [
|
|
1149
|
+
/* @__PURE__ */ l(ms, { data: a, isFetching: y }),
|
|
1150
|
+
/* @__PURE__ */ l(ys, { data: a, isFetching: y, fetchNextPage: I })
|
|
1587
1151
|
] });
|
|
1588
|
-
}
|
|
1589
|
-
const useSelectedFilters = () => {
|
|
1152
|
+
}, Is = () => {
|
|
1590
1153
|
const {
|
|
1591
|
-
appCode,
|
|
1592
|
-
currentApp
|
|
1593
|
-
} =
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
const handleOnSelectFilter = (value) => {
|
|
1599
|
-
if (value === "0") {
|
|
1600
|
-
setSelectedFilters("");
|
|
1154
|
+
appCode: e,
|
|
1155
|
+
currentApp: s
|
|
1156
|
+
} = M(), {
|
|
1157
|
+
t
|
|
1158
|
+
} = z(), [r, n] = ce(""), i = (c) => {
|
|
1159
|
+
if (c === "0") {
|
|
1160
|
+
n("");
|
|
1601
1161
|
return;
|
|
1602
1162
|
}
|
|
1603
|
-
|
|
1604
|
-
}
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
const isOwnerSelected = () => {
|
|
1612
|
-
return selectedFilters.includes("1") ? true : void 0;
|
|
1613
|
-
};
|
|
1614
|
-
const isSharedSelected = () => {
|
|
1615
|
-
return selectedFilters.includes("2") ? true : void 0;
|
|
1616
|
-
};
|
|
1617
|
-
const isPublicSelected = () => {
|
|
1618
|
-
return selectedFilters.includes("7") ? true : void 0;
|
|
1619
|
-
};
|
|
1620
|
-
setSearchParams({
|
|
1621
|
-
...searchParams,
|
|
1163
|
+
n(c);
|
|
1164
|
+
}, o = W(), d = T(), {
|
|
1165
|
+
setSearchParams: u
|
|
1166
|
+
} = x();
|
|
1167
|
+
U(() => {
|
|
1168
|
+
const c = () => r.includes("1") ? !0 : void 0, f = () => r.includes("2") ? !0 : void 0, a = () => r.includes("7") ? !0 : void 0;
|
|
1169
|
+
u({
|
|
1170
|
+
...d,
|
|
1622
1171
|
filters: {
|
|
1623
|
-
owner:
|
|
1624
|
-
public:
|
|
1625
|
-
shared:
|
|
1626
|
-
folder:
|
|
1172
|
+
owner: c(),
|
|
1173
|
+
public: a(),
|
|
1174
|
+
shared: f(),
|
|
1175
|
+
folder: o ? o.id : "default"
|
|
1627
1176
|
}
|
|
1628
1177
|
});
|
|
1629
|
-
}, [
|
|
1630
|
-
const
|
|
1631
|
-
label:
|
|
1632
|
-
ns:
|
|
1178
|
+
}, [o, u, r]);
|
|
1179
|
+
const h = [{
|
|
1180
|
+
label: t("explorer.filter.all", {
|
|
1181
|
+
ns: e
|
|
1633
1182
|
}),
|
|
1634
1183
|
value: "0"
|
|
1635
1184
|
}, {
|
|
1636
|
-
label:
|
|
1637
|
-
ns:
|
|
1185
|
+
label: t("explorer.filter.owner", {
|
|
1186
|
+
ns: e
|
|
1638
1187
|
}),
|
|
1639
1188
|
value: "1"
|
|
1640
1189
|
}, {
|
|
1641
|
-
label:
|
|
1642
|
-
ns:
|
|
1190
|
+
label: t("explorer.filter.shared", {
|
|
1191
|
+
ns: e
|
|
1643
1192
|
}),
|
|
1644
1193
|
value: "2"
|
|
1645
|
-
}, ...(
|
|
1194
|
+
}, ...(s == null ? void 0 : s.displayName) == se.EXERCIZER ? [{
|
|
1646
1195
|
label: "Exercices interactifs",
|
|
1647
1196
|
value: "3"
|
|
1648
|
-
}] : [], ...(
|
|
1197
|
+
}] : [], ...(s == null ? void 0 : s.displayName) == se.EXERCIZER ? [{
|
|
1649
1198
|
label: "Exercices à rendre",
|
|
1650
1199
|
value: "4"
|
|
1651
|
-
}] : [], ...(
|
|
1200
|
+
}] : [], ...(s == null ? void 0 : s.displayName) == "pages" ? [{
|
|
1652
1201
|
label: "Projets publics",
|
|
1653
1202
|
value: "5"
|
|
1654
|
-
}] : [], ...(
|
|
1203
|
+
}] : [], ...(s == null ? void 0 : s.displayName) == "pages" ? [{
|
|
1655
1204
|
label: "Projets internes",
|
|
1656
1205
|
value: "6"
|
|
1657
|
-
}] : [], ...(
|
|
1658
|
-
label:
|
|
1659
|
-
ns:
|
|
1206
|
+
}] : [], ...(s == null ? void 0 : s.displayName) == se.BLOG ? [{
|
|
1207
|
+
label: t("explorer.filter.public", {
|
|
1208
|
+
ns: e
|
|
1660
1209
|
}),
|
|
1661
1210
|
value: "7"
|
|
1662
1211
|
}] : []];
|
|
1663
1212
|
return {
|
|
1664
|
-
selectedFilters,
|
|
1665
|
-
options,
|
|
1666
|
-
handleOnSelectFilter
|
|
1213
|
+
selectedFilters: r,
|
|
1214
|
+
options: h,
|
|
1215
|
+
handleOnSelectFilter: i
|
|
1667
1216
|
};
|
|
1668
|
-
}
|
|
1669
|
-
const SearchForm = () => {
|
|
1670
|
-
const {
|
|
1671
|
-
appCode
|
|
1672
|
-
} = useOdeClient();
|
|
1673
|
-
const {
|
|
1674
|
-
t: t2
|
|
1675
|
-
} = useTranslation();
|
|
1676
|
-
const {
|
|
1677
|
-
selectedFilters,
|
|
1678
|
-
options,
|
|
1679
|
-
handleOnSelectFilter
|
|
1680
|
-
} = useSelectedFilters();
|
|
1217
|
+
}, Ss = () => {
|
|
1681
1218
|
const {
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1219
|
+
appCode: e
|
|
1220
|
+
} = M(), {
|
|
1221
|
+
t: s
|
|
1222
|
+
} = z(), {
|
|
1223
|
+
selectedFilters: t,
|
|
1224
|
+
options: r,
|
|
1225
|
+
handleOnSelectFilter: n
|
|
1226
|
+
} = Is(), {
|
|
1227
|
+
formRef: i,
|
|
1228
|
+
inputSearch: o,
|
|
1229
|
+
handleInputSearchChange: d,
|
|
1230
|
+
handleKeyPress: u,
|
|
1231
|
+
handleSearchSubmit: h
|
|
1232
|
+
} = he(), c = t.length > 0 ? t.length : void 0;
|
|
1233
|
+
return /* @__PURE__ */ C("form", { noValidate: !0, className: "bg-light p-16 ps-24 ms-n16 ms-lg-n24 me-n16 position-relative z-3 d-flex gap-8", ref: i, children: [
|
|
1234
|
+
/* @__PURE__ */ C(we, { id: "search", className: "input-group", children: [
|
|
1235
|
+
/* @__PURE__ */ l(xe, { type: "search", placeholder: s("explorer.label.search", {
|
|
1236
|
+
ns: e
|
|
1237
|
+
}), size: "lg", noValidationIcon: !0, value: o, onChange: d, onKeyDown: u }),
|
|
1238
|
+
/* @__PURE__ */ l(De, { type: "submit", "aria-label": s("explorer.label.search", {
|
|
1239
|
+
ns: e
|
|
1240
|
+
}), onClick: h })
|
|
1697
1241
|
] }),
|
|
1698
|
-
/* @__PURE__ */
|
|
1699
|
-
/* @__PURE__ */
|
|
1700
|
-
/* @__PURE__ */
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
/* @__PURE__ */ jsx(Dropdown.Separator, {})
|
|
1705
|
-
] }, "0");
|
|
1706
|
-
}
|
|
1707
|
-
return /* @__PURE__ */ jsx(Dropdown.RadioItem, { value: option.value, model: selectedFilters, onChange: () => handleOnSelectFilter(option.value), children: option.label }, option.value);
|
|
1708
|
-
}) })
|
|
1242
|
+
/* @__PURE__ */ C(j, { placement: "bottom-end", children: [
|
|
1243
|
+
/* @__PURE__ */ l(j.Trigger, { label: s("explorer.filters"), icon: /* @__PURE__ */ l(Ae, { width: 20 }), variant: "ghost", badgeContent: c }),
|
|
1244
|
+
/* @__PURE__ */ l(j.Menu, { children: r.map((f) => f.value === "0" ? /* @__PURE__ */ C(ye, { children: [
|
|
1245
|
+
/* @__PURE__ */ l(j.RadioItem, { value: f.value, model: t, onChange: () => n(f.value), children: f.label }),
|
|
1246
|
+
/* @__PURE__ */ l(j.Separator, {})
|
|
1247
|
+
] }, "0") : /* @__PURE__ */ l(j.RadioItem, { value: f.value, model: t, onChange: () => n(f.value), children: f.label }, f.value)) })
|
|
1709
1248
|
] })
|
|
1710
1249
|
] });
|
|
1711
|
-
}
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
onSelect
|
|
1250
|
+
}, ws = ({
|
|
1251
|
+
id: e,
|
|
1252
|
+
selected: s,
|
|
1253
|
+
onSelect: t
|
|
1716
1254
|
}) => {
|
|
1717
1255
|
const {
|
|
1718
|
-
t:
|
|
1719
|
-
} =
|
|
1720
|
-
return /* @__PURE__ */
|
|
1721
|
-
/* @__PURE__ */
|
|
1722
|
-
/* @__PURE__ */
|
|
1256
|
+
t: r
|
|
1257
|
+
} = z();
|
|
1258
|
+
return /* @__PURE__ */ l("div", { className: "treeview", children: /* @__PURE__ */ l("ul", { role: "tree", className: "m-0 p-0", children: /* @__PURE__ */ l("li", { id: e, role: "treeitem", "aria-selected": s, children: /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("div", { className: "action-container", children: /* @__PURE__ */ l("div", { onClick: t, role: "button", tabIndex: 0, children: /* @__PURE__ */ C("div", { className: "d-flex align-items-center gap-8 py-8 ps-24", children: [
|
|
1259
|
+
/* @__PURE__ */ l(Ee, { width: "20", height: "20" }),
|
|
1260
|
+
/* @__PURE__ */ l("span", { children: r("explorer.tree.trash") })
|
|
1723
1261
|
] }) }) }) }) }) }) });
|
|
1724
|
-
}
|
|
1725
|
-
const
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
selectTreeItem,
|
|
1741
|
-
unfoldTreeItem,
|
|
1742
|
-
foldTreeItem,
|
|
1743
|
-
clearSelectedItems,
|
|
1744
|
-
clearSelectedIds
|
|
1745
|
-
} = useStoreActions();
|
|
1746
|
-
const handleTreeItemUnfold = async (folderId) => {
|
|
1747
|
-
await unfoldTreeItem(folderId, queryclient);
|
|
1748
|
-
};
|
|
1749
|
-
const handleOnFolderCreate = () => {
|
|
1750
|
-
clearSelectedItems();
|
|
1751
|
-
clearSelectedIds();
|
|
1752
|
-
toggle();
|
|
1262
|
+
}, xs = /* @__PURE__ */ b(async () => await import("./FolderModal.js")), Ds = () => {
|
|
1263
|
+
const e = O(), [s, t] = be(), r = V(), n = ne(), i = re(), {
|
|
1264
|
+
appCode: o
|
|
1265
|
+
} = M(), {
|
|
1266
|
+
t: d
|
|
1267
|
+
} = z(["common", o]), {
|
|
1268
|
+
goToTrash: u,
|
|
1269
|
+
selectTreeItem: h,
|
|
1270
|
+
unfoldTreeItem: c,
|
|
1271
|
+
foldTreeItem: f,
|
|
1272
|
+
clearSelectedItems: a,
|
|
1273
|
+
clearSelectedIds: m
|
|
1274
|
+
} = x(), p = async (y) => {
|
|
1275
|
+
await c(y, e);
|
|
1276
|
+
}, g = () => {
|
|
1277
|
+
a(), m(), t();
|
|
1753
1278
|
};
|
|
1754
|
-
return /* @__PURE__ */
|
|
1755
|
-
/* @__PURE__ */
|
|
1756
|
-
/* @__PURE__ */
|
|
1757
|
-
/* @__PURE__ */
|
|
1758
|
-
/* @__PURE__ */
|
|
1279
|
+
return /* @__PURE__ */ C(ae, { children: [
|
|
1280
|
+
/* @__PURE__ */ l(Te, { data: r, selectedNodesIds: i, onTreeItemSelect: h, onTreeItemFold: f, onTreeItemUnfold: p }),
|
|
1281
|
+
/* @__PURE__ */ l(ws, { id: F.BIN, selected: n, onSelect: u }),
|
|
1282
|
+
/* @__PURE__ */ l("div", { className: "d-grid my-16", children: /* @__PURE__ */ l(Fe, { disabled: n, type: "button", color: "primary", variant: "outline", leftIcon: /* @__PURE__ */ l(Qe, {}), onClick: g, children: d("explorer.folder.new") }) }),
|
|
1283
|
+
/* @__PURE__ */ l(v, { fallback: /* @__PURE__ */ l(A, {}), children: s && /* @__PURE__ */ l(xs, { edit: !1, isOpen: s, onSuccess: t, onCancel: t }) })
|
|
1759
1284
|
] });
|
|
1760
1285
|
};
|
|
1761
|
-
const
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
default: module.OnboardingModal
|
|
1766
|
-
};
|
|
1767
|
-
});
|
|
1768
|
-
const AppAction = /* @__PURE__ */ lazy(async () => await import("./AppAction.js"));
|
|
1769
|
-
const Library = /* @__PURE__ */ lazy(async () => await import("./Library.js"));
|
|
1770
|
-
const ActionBar = /* @__PURE__ */ lazy(async () => await import("./ActionBarContainer.js"));
|
|
1771
|
-
const ActionResourceDisableModal = /* @__PURE__ */ lazy(async () => await import("./DisableModal.js"));
|
|
1772
|
-
const TrashedResourceModal = /* @__PURE__ */ lazy(async () => await import("./TrashModal.js"));
|
|
1773
|
-
const Explorer = ({
|
|
1774
|
-
config
|
|
1286
|
+
const bs = /* @__PURE__ */ b(async () => ({
|
|
1287
|
+
default: (await import("@edifice-ui/react")).OnboardingModal
|
|
1288
|
+
})), Ts = /* @__PURE__ */ b(async () => await import("./AppAction.js")), Fs = /* @__PURE__ */ b(async () => await import("./Library.js")), Cs = /* @__PURE__ */ b(async () => await import("./ActionBarContainer.js")), Ns = /* @__PURE__ */ b(async () => await import("./DisableModal.js")), Rs = /* @__PURE__ */ b(async () => await import("./TrashModal.js")), Gs = ({
|
|
1289
|
+
config: e
|
|
1775
1290
|
}) => {
|
|
1776
|
-
const
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
app: config.app,
|
|
1786
|
-
types: config.types
|
|
1291
|
+
const s = T(), {
|
|
1292
|
+
setConfig: t,
|
|
1293
|
+
setSearchParams: r
|
|
1294
|
+
} = x();
|
|
1295
|
+
U(() => {
|
|
1296
|
+
t(e || {}), r({
|
|
1297
|
+
...s,
|
|
1298
|
+
app: e.app,
|
|
1299
|
+
types: e.types
|
|
1787
1300
|
});
|
|
1788
|
-
}, [
|
|
1789
|
-
const {
|
|
1790
|
-
currentApp
|
|
1791
|
-
} = useOdeClient();
|
|
1792
|
-
const {
|
|
1793
|
-
data: actions
|
|
1794
|
-
} = useActions();
|
|
1795
|
-
const {
|
|
1796
|
-
isTrashedModalOpen,
|
|
1797
|
-
onTrashedCancel
|
|
1798
|
-
} = useTrashModal();
|
|
1301
|
+
}, [e]);
|
|
1799
1302
|
const {
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1303
|
+
currentApp: n
|
|
1304
|
+
} = M(), {
|
|
1305
|
+
data: i
|
|
1306
|
+
} = ls(), {
|
|
1307
|
+
isTrashedModalOpen: o,
|
|
1308
|
+
onTrashedCancel: d
|
|
1309
|
+
} = rs(), {
|
|
1310
|
+
isActionDisableModalOpen: u,
|
|
1311
|
+
onActionDisableCancel: h
|
|
1312
|
+
} = ts();
|
|
1313
|
+
Ce();
|
|
1314
|
+
const c = oe("publish", i), f = oe("create", i);
|
|
1315
|
+
return e && /* @__PURE__ */ C(ae, { children: [
|
|
1316
|
+
/* @__PURE__ */ l(Ne, { render: () => f ? /* @__PURE__ */ l(v, { fallback: /* @__PURE__ */ l(A, {}), children: /* @__PURE__ */ l(Ts, {}) }) : null, children: /* @__PURE__ */ l(Re, { app: n }) }),
|
|
1317
|
+
/* @__PURE__ */ C(ee, { className: "flex-grow-1", children: [
|
|
1318
|
+
/* @__PURE__ */ l(ee.Col, { sm: "3", lg: "2", xl: "3", className: "border-end pt-16 pe-16 d-none d-lg-block", as: "aside", children: /* @__PURE__ */ C(v, { fallback: /* @__PURE__ */ l(A, {}), children: [
|
|
1319
|
+
/* @__PURE__ */ l(Ds, {}),
|
|
1320
|
+
c && /* @__PURE__ */ l(Fs, {})
|
|
1812
1321
|
] }) }),
|
|
1813
|
-
/* @__PURE__ */
|
|
1814
|
-
/* @__PURE__ */
|
|
1815
|
-
/* @__PURE__ */
|
|
1816
|
-
/* @__PURE__ */
|
|
1322
|
+
/* @__PURE__ */ C(ee.Col, { sm: "4", md: "8", lg: "6", xl: "9", children: [
|
|
1323
|
+
/* @__PURE__ */ l(Ss, {}),
|
|
1324
|
+
/* @__PURE__ */ l(ss, {}),
|
|
1325
|
+
/* @__PURE__ */ l(gs, {})
|
|
1817
1326
|
] }),
|
|
1818
|
-
/* @__PURE__ */
|
|
1819
|
-
/* @__PURE__ */
|
|
1820
|
-
/* @__PURE__ */
|
|
1327
|
+
/* @__PURE__ */ C(v, { fallback: /* @__PURE__ */ l(A, {}), children: [
|
|
1328
|
+
/* @__PURE__ */ l(Cs, {}),
|
|
1329
|
+
/* @__PURE__ */ l(bs, { id: "showOnboardingTrash", items: [{
|
|
1821
1330
|
src: "onboarding/illu-trash-menu.svg",
|
|
1822
1331
|
alt: "explorer.modal.onboarding.trash.screen1.alt",
|
|
1823
1332
|
text: "explorer.modal.onboarding.trash.screen1.title"
|
|
@@ -1835,33 +1344,33 @@ const Explorer = ({
|
|
|
1835
1344
|
nextText: "explorer.modal.onboarding.trash.next",
|
|
1836
1345
|
closeText: "explorer.modal.onboarding.trash.close"
|
|
1837
1346
|
} }),
|
|
1838
|
-
|
|
1839
|
-
|
|
1347
|
+
o && /* @__PURE__ */ l(Rs, { isOpen: o, onCancel: d }),
|
|
1348
|
+
u && /* @__PURE__ */ l(Ns, { isOpen: u, onCancel: h })
|
|
1840
1349
|
] })
|
|
1841
1350
|
] })
|
|
1842
1351
|
] });
|
|
1843
1352
|
};
|
|
1844
1353
|
export {
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1354
|
+
Gs as E,
|
|
1355
|
+
ls as a,
|
|
1356
|
+
W as b,
|
|
1357
|
+
Xs as c,
|
|
1358
|
+
ne as d,
|
|
1359
|
+
S as e,
|
|
1360
|
+
Z as f,
|
|
1361
|
+
Bs as g,
|
|
1362
|
+
Ms as h,
|
|
1363
|
+
G as i,
|
|
1364
|
+
$s as j,
|
|
1365
|
+
Ge as k,
|
|
1366
|
+
Hs as l,
|
|
1367
|
+
Ws as m,
|
|
1368
|
+
T as n,
|
|
1369
|
+
Vs as o,
|
|
1370
|
+
_s as p,
|
|
1371
|
+
js as q,
|
|
1372
|
+
Ks as r,
|
|
1373
|
+
zs as s,
|
|
1374
|
+
V as t,
|
|
1375
|
+
x as u
|
|
1867
1376
|
};
|