ode-explorer 1.4.0-develop.202403061042 → 1.4.0-develop.202403111000
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 +94 -39
- package/dist/version.txt +1 -1
- package/lib/index2.js +485 -480
- package/package.json +1 -1
package/lib/index2.js
CHANGED
|
@@ -1,164 +1,164 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var _ = (e,
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { useState as ae, useRef as
|
|
6
|
-
import { useScrollToTop as
|
|
7
|
-
import { ArrowLeft as
|
|
1
|
+
var pe = Object.defineProperty;
|
|
2
|
+
var me = (e, t, s) => t in e ? pe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var _ = (e, t, s) => (me(e, typeof t != "symbol" ? t + "" : t, s), s);
|
|
4
|
+
import { jsx as c, jsxs as N, Fragment as oe } from "react/jsx-runtime";
|
|
5
|
+
import { useState as ae, useRef as ge, useEffect as L, lazy as b, Suspense as O, Fragment as ye } from "react";
|
|
6
|
+
import { useScrollToTop as Ie, useOdeClient as M, IconButton as we, useToast as k, useUser as ce, useShareMutation as Se, useUpdateMutation as xe, LoadingScreen as A, FormControl as De, Input as Te, SearchButton as be, Dropdown as $, useToggle as Fe, TreeView as Ce, Button as Ne, useXitiTrackPageLoad as Re, isActionAvailable as ne, AppHeader as Pe, Breadcrumb as Ae, Grid as ee } from "@edifice-ui/react";
|
|
7
|
+
import { ArrowLeft as Ee, Filter as Qe, Delete as qe, Plus as Oe } from "@edifice-ui/icons";
|
|
8
8
|
import { useTranslation as j } from "react-i18next";
|
|
9
9
|
import { odeServices as x, FOLDER as C } from "edifice-ts-client";
|
|
10
10
|
import { t as S } from "i18next";
|
|
11
|
-
import { create as
|
|
12
|
-
import { useQuery as
|
|
11
|
+
import { create as ke } from "zustand";
|
|
12
|
+
import { useQuery as Ue, useInfiniteQuery as ve, useQueryClient as E, useMutation as v } from "@tanstack/react-query";
|
|
13
13
|
const ie = async (e) => {
|
|
14
|
-
const
|
|
14
|
+
const t = await x.resource(e.application).searchContext(e);
|
|
15
15
|
return {
|
|
16
|
-
...
|
|
17
|
-
folders:
|
|
16
|
+
...t,
|
|
17
|
+
folders: t.folders.filter((s) => !s.trashed)
|
|
18
18
|
};
|
|
19
|
-
},
|
|
19
|
+
}, Le = async ({
|
|
20
20
|
searchParams: e,
|
|
21
|
-
name:
|
|
22
|
-
parentId:
|
|
21
|
+
name: t,
|
|
22
|
+
parentId: s
|
|
23
23
|
}) => {
|
|
24
24
|
const r = {
|
|
25
|
-
name:
|
|
26
|
-
parentId:
|
|
25
|
+
name: t,
|
|
26
|
+
parentId: s,
|
|
27
27
|
application: e.application,
|
|
28
28
|
type: e.types[0]
|
|
29
29
|
};
|
|
30
30
|
return await x.resource(e.application).createFolder(r);
|
|
31
|
-
},
|
|
31
|
+
}, Me = async ({
|
|
32
32
|
folderId: e,
|
|
33
|
-
searchParams:
|
|
34
|
-
parentId:
|
|
33
|
+
searchParams: t,
|
|
34
|
+
parentId: s,
|
|
35
35
|
name: r
|
|
36
36
|
}) => {
|
|
37
37
|
const n = {
|
|
38
38
|
folderId: e,
|
|
39
39
|
name: r,
|
|
40
|
-
parentId:
|
|
41
|
-
application:
|
|
42
|
-
type:
|
|
40
|
+
parentId: s,
|
|
41
|
+
application: t.application,
|
|
42
|
+
type: t.types[0]
|
|
43
43
|
};
|
|
44
|
-
return await x.resource(
|
|
45
|
-
},
|
|
44
|
+
return await x.resource(t.application).updateFolder(n);
|
|
45
|
+
}, Ke = async ({
|
|
46
46
|
searchParams: e,
|
|
47
|
-
resourceIds:
|
|
48
|
-
useAssetIds:
|
|
47
|
+
resourceIds: t,
|
|
48
|
+
useAssetIds: s,
|
|
49
49
|
folderIds: r
|
|
50
50
|
}) => {
|
|
51
51
|
const n = {
|
|
52
52
|
application: e.application,
|
|
53
53
|
resourceType: e.types[0],
|
|
54
|
-
resourceIds:
|
|
54
|
+
resourceIds: t,
|
|
55
55
|
folderIds: r
|
|
56
56
|
};
|
|
57
|
-
return await x.resource(e.application).trashAll(n,
|
|
58
|
-
},
|
|
57
|
+
return await x.resource(e.application).trashAll(n, s);
|
|
58
|
+
}, Be = async ({
|
|
59
59
|
searchParams: e,
|
|
60
|
-
resourceIds:
|
|
61
|
-
useAssetIds:
|
|
60
|
+
resourceIds: t,
|
|
61
|
+
useAssetIds: s,
|
|
62
62
|
folderIds: r
|
|
63
63
|
}) => {
|
|
64
64
|
const n = {
|
|
65
65
|
application: e.application,
|
|
66
66
|
resourceType: e.types[0],
|
|
67
|
-
resourceIds:
|
|
67
|
+
resourceIds: t,
|
|
68
68
|
folderIds: r
|
|
69
69
|
};
|
|
70
|
-
return await x.resource(e.application).deleteAll(n,
|
|
71
|
-
},
|
|
70
|
+
return await x.resource(e.application).deleteAll(n, s);
|
|
71
|
+
}, _e = async ({
|
|
72
72
|
searchParams: e,
|
|
73
|
-
resourceIds:
|
|
74
|
-
folderIds:
|
|
73
|
+
resourceIds: t,
|
|
74
|
+
folderIds: s,
|
|
75
75
|
useAssetIds: r
|
|
76
76
|
}) => {
|
|
77
77
|
const n = {
|
|
78
78
|
application: e.application,
|
|
79
79
|
resourceType: e.types[0],
|
|
80
|
-
resourceIds:
|
|
81
|
-
folderIds:
|
|
80
|
+
resourceIds: t,
|
|
81
|
+
folderIds: s
|
|
82
82
|
};
|
|
83
83
|
return await x.resource(e.application).restoreAll(n, r);
|
|
84
|
-
},
|
|
84
|
+
}, $e = async (e, t) => await x.resource(e.application).copy({
|
|
85
85
|
application: e.application,
|
|
86
|
-
resourceId:
|
|
87
|
-
}),
|
|
86
|
+
resourceId: t
|
|
87
|
+
}), le = async ({
|
|
88
88
|
searchParams: e,
|
|
89
|
-
resourceIds:
|
|
90
|
-
folderId:
|
|
89
|
+
resourceIds: t,
|
|
90
|
+
folderId: s,
|
|
91
91
|
folderIds: r,
|
|
92
92
|
useAssetIds: n
|
|
93
93
|
}) => {
|
|
94
94
|
const a = {
|
|
95
95
|
application: e.application,
|
|
96
|
-
folderId:
|
|
97
|
-
resourceIds:
|
|
96
|
+
folderId: s,
|
|
97
|
+
resourceIds: t,
|
|
98
98
|
folderIds: r
|
|
99
99
|
};
|
|
100
100
|
return await x.resource(e.application).moveToFolder(a, n);
|
|
101
101
|
};
|
|
102
102
|
const je = async (e) => await x.rights().sessionHasWorkflowRights(e), ze = ({
|
|
103
103
|
searchParams: e,
|
|
104
|
-
assetId:
|
|
104
|
+
assetId: t
|
|
105
105
|
}) => {
|
|
106
|
-
const
|
|
107
|
-
window.open(
|
|
106
|
+
const s = x.resource(e.application).getViewUrl(t);
|
|
107
|
+
window.open(s, "_self");
|
|
108
108
|
}, Ve = ({
|
|
109
109
|
searchParams: e,
|
|
110
|
-
params:
|
|
111
|
-
}) => x.resource(e.application).create(
|
|
110
|
+
params: t
|
|
111
|
+
}) => x.resource(e.application).create(t), He = ({
|
|
112
112
|
searchParams: e,
|
|
113
|
-
assetId:
|
|
113
|
+
assetId: t
|
|
114
114
|
}) => {
|
|
115
|
-
const
|
|
116
|
-
return window.open(
|
|
115
|
+
const s = x.resource(e.application).getPrintUrl(t);
|
|
116
|
+
return window.open(s, "_blank");
|
|
117
117
|
}, Mt = ({
|
|
118
118
|
searchParams: e,
|
|
119
|
-
folderId:
|
|
119
|
+
folderId: t
|
|
120
120
|
}) => {
|
|
121
|
-
const
|
|
122
|
-
return window.open(
|
|
121
|
+
const s = x.resource(e.application).getFormUrl(t);
|
|
122
|
+
return window.open(s, "_self");
|
|
123
123
|
}, Kt = ({
|
|
124
124
|
searchParams: e,
|
|
125
|
-
assetId:
|
|
125
|
+
assetId: t
|
|
126
126
|
}) => {
|
|
127
|
-
const
|
|
128
|
-
return window.open(
|
|
127
|
+
const s = x.resource(e.application).getEditUrl(t);
|
|
128
|
+
return window.open(s, "_self");
|
|
129
129
|
}, Bt = ({
|
|
130
130
|
searchParams: e,
|
|
131
|
-
assetId:
|
|
131
|
+
assetId: t
|
|
132
132
|
}) => {
|
|
133
|
-
const
|
|
134
|
-
return window.open(
|
|
133
|
+
const s = x.resource(e.application).getExportUrl(t);
|
|
134
|
+
return window.open(s, "_self");
|
|
135
135
|
};
|
|
136
136
|
function te(e) {
|
|
137
|
-
return e.filter((
|
|
137
|
+
return e.filter((t, s) => e.indexOf(t) === s);
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function H(e, t) {
|
|
140
140
|
var r, n;
|
|
141
|
-
let
|
|
142
|
-
return (
|
|
141
|
+
let s;
|
|
142
|
+
return (t == null ? void 0 : t.id) === e ? t : ((r = t == null ? void 0 : t.children) != null && r.length && ((n = t == null ? void 0 : t.children) == null || n.every((a) => (s = H(e, a), s === void 0))), s);
|
|
143
143
|
}
|
|
144
|
-
function We(e,
|
|
144
|
+
function We(e, t) {
|
|
145
145
|
var r;
|
|
146
|
-
const
|
|
147
|
-
return (r =
|
|
146
|
+
const s = H(e, t);
|
|
147
|
+
return (r = s == null ? void 0 : s.folder) != null && r.ancestors ? [...(s == null ? void 0 : s.folder.ancestors) || [], e] : e === C.BIN ? [C.BIN] : [C.DEFAULT];
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
return
|
|
149
|
+
function de(e, t) {
|
|
150
|
+
return t.id === e && t.children ? t.children.length > 0 : t.children ? t.children.some((s) => de(t.id, s)) : !1;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
return
|
|
152
|
+
function W(e, t) {
|
|
153
|
+
return ue(e, t) || e;
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function ue(e, t, s) {
|
|
156
156
|
var n;
|
|
157
|
-
const r =
|
|
157
|
+
const r = t(e, s);
|
|
158
158
|
if ((n = r == null ? void 0 : r.children) != null && n.length) {
|
|
159
159
|
const a = [];
|
|
160
160
|
for (const o of (r == null ? void 0 : r.children) || []) {
|
|
161
|
-
const l =
|
|
161
|
+
const l = ue(o, t, r);
|
|
162
162
|
l && a.push(l);
|
|
163
163
|
}
|
|
164
164
|
return {
|
|
@@ -169,16 +169,16 @@ function de(e, s, t) {
|
|
|
169
169
|
return r;
|
|
170
170
|
}
|
|
171
171
|
class G {
|
|
172
|
-
constructor(
|
|
172
|
+
constructor(t) {
|
|
173
173
|
_(this, "id");
|
|
174
174
|
_(this, "name");
|
|
175
175
|
_(this, "childNumber");
|
|
176
176
|
_(this, "section", !1);
|
|
177
177
|
_(this, "children", []);
|
|
178
|
-
this.folder =
|
|
178
|
+
this.folder = t, this.id = t.id, this.name = t.name, this.childNumber = t.childNumber;
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
const
|
|
181
|
+
const he = (e, t, s) => W(e, (r) => (r.id === s && (r.children = t == null ? void 0 : t.map((n) => new G(n))), r)), w = ke()((e, t) => ({
|
|
182
182
|
config: null,
|
|
183
183
|
searchConfig: {
|
|
184
184
|
minLength: 1
|
|
@@ -220,24 +220,24 @@ const ue = (e, s, t) => H(e, (r) => (r.id === t && (r.children = s == null ? voi
|
|
|
220
220
|
resourceActionDisable: !1,
|
|
221
221
|
status: void 0,
|
|
222
222
|
updaters: {
|
|
223
|
-
setConfig: (
|
|
224
|
-
config:
|
|
223
|
+
setConfig: (s) => e({
|
|
224
|
+
config: s
|
|
225
225
|
}),
|
|
226
|
-
setSearchConfig: (
|
|
226
|
+
setSearchConfig: (s) => e((r) => ({
|
|
227
227
|
searchConfig: {
|
|
228
228
|
...r.searchConfig,
|
|
229
|
-
...
|
|
229
|
+
...s
|
|
230
230
|
}
|
|
231
231
|
})),
|
|
232
|
-
setTreeData: (
|
|
233
|
-
treeData:
|
|
232
|
+
setTreeData: (s) => e(() => ({
|
|
233
|
+
treeData: s
|
|
234
234
|
})),
|
|
235
|
-
setSearchParams: (
|
|
235
|
+
setSearchParams: (s) => {
|
|
236
236
|
e((r) => {
|
|
237
237
|
const {
|
|
238
238
|
searchParams: n
|
|
239
239
|
} = r;
|
|
240
|
-
return n.search !==
|
|
240
|
+
return n.search !== s.search ? s.search ? {
|
|
241
241
|
...r,
|
|
242
242
|
selectedFolders: [],
|
|
243
243
|
selectedNodesIds: [],
|
|
@@ -245,7 +245,7 @@ const ue = (e, s, t) => H(e, (r) => (r.id === t && (r.children = s == null ? voi
|
|
|
245
245
|
currentFolder: void 0,
|
|
246
246
|
searchParams: {
|
|
247
247
|
...n,
|
|
248
|
-
...
|
|
248
|
+
...s,
|
|
249
249
|
trashed: !1,
|
|
250
250
|
filters: {
|
|
251
251
|
...n.filters,
|
|
@@ -262,7 +262,7 @@ const ue = (e, s, t) => H(e, (r) => (r.id === t && (r.children = s == null ? voi
|
|
|
262
262
|
},
|
|
263
263
|
searchParams: {
|
|
264
264
|
...n,
|
|
265
|
-
...
|
|
265
|
+
...s,
|
|
266
266
|
trashed: !1,
|
|
267
267
|
filters: {
|
|
268
268
|
...n.filters
|
|
@@ -271,31 +271,31 @@ const ue = (e, s, t) => H(e, (r) => (r.id === t && (r.children = s == null ? voi
|
|
|
271
271
|
} : {
|
|
272
272
|
searchParams: {
|
|
273
273
|
...n,
|
|
274
|
-
...
|
|
274
|
+
...s
|
|
275
275
|
}
|
|
276
276
|
};
|
|
277
277
|
});
|
|
278
278
|
},
|
|
279
|
-
setSelectedFolders: (
|
|
280
|
-
selectedFolders:
|
|
279
|
+
setSelectedFolders: (s) => e(() => ({
|
|
280
|
+
selectedFolders: s
|
|
281
281
|
})),
|
|
282
|
-
setSelectedResources: (
|
|
283
|
-
selectedResources:
|
|
282
|
+
setSelectedResources: (s) => e(() => ({
|
|
283
|
+
selectedResources: s
|
|
284
284
|
})),
|
|
285
|
-
setFolderIds: (
|
|
286
|
-
folderIds:
|
|
285
|
+
setFolderIds: (s) => e(() => ({
|
|
286
|
+
folderIds: s
|
|
287
287
|
})),
|
|
288
|
-
setResourceIds: (
|
|
289
|
-
resourceIds:
|
|
288
|
+
setResourceIds: (s) => e(() => ({
|
|
289
|
+
resourceIds: s
|
|
290
290
|
})),
|
|
291
|
-
setResourceIsTrash: (
|
|
292
|
-
resourceIsTrash:
|
|
291
|
+
setResourceIsTrash: (s) => e(() => ({
|
|
292
|
+
resourceIsTrash: s
|
|
293
293
|
})),
|
|
294
|
-
setResourceActionDisable: (
|
|
295
|
-
resourceActionDisable:
|
|
294
|
+
setResourceActionDisable: (s) => e(() => ({
|
|
295
|
+
resourceActionDisable: s
|
|
296
296
|
})),
|
|
297
|
-
setCurrentFolder: (
|
|
298
|
-
currentFolder:
|
|
297
|
+
setCurrentFolder: (s) => e(() => ({
|
|
298
|
+
currentFolder: s
|
|
299
299
|
})),
|
|
300
300
|
clearSelectedItems: () => e(() => ({
|
|
301
301
|
selectedFolders: [],
|
|
@@ -305,14 +305,14 @@ const ue = (e, s, t) => H(e, (r) => (r.id === t && (r.children = s == null ? voi
|
|
|
305
305
|
resourceIds: [],
|
|
306
306
|
folderIds: []
|
|
307
307
|
})),
|
|
308
|
-
openResource: (
|
|
308
|
+
openResource: (s) => {
|
|
309
309
|
try {
|
|
310
310
|
const {
|
|
311
311
|
searchParams: r
|
|
312
|
-
} =
|
|
312
|
+
} = t();
|
|
313
313
|
ze({
|
|
314
314
|
searchParams: r,
|
|
315
|
-
assetId:
|
|
315
|
+
assetId: s.assetId
|
|
316
316
|
});
|
|
317
317
|
} catch (r) {
|
|
318
318
|
console.error("explorer open failed: ", r);
|
|
@@ -321,96 +321,96 @@ const ue = (e, s, t) => H(e, (r) => (r.id === t && (r.children = s == null ? voi
|
|
|
321
321
|
printSelectedResource: () => {
|
|
322
322
|
try {
|
|
323
323
|
const {
|
|
324
|
-
searchParams:
|
|
324
|
+
searchParams: s,
|
|
325
325
|
selectedResources: r,
|
|
326
326
|
resourceIds: n
|
|
327
|
-
} =
|
|
327
|
+
} = t();
|
|
328
328
|
if (r.length !== 1)
|
|
329
329
|
throw new Error("Cannot open more than 1 resource");
|
|
330
330
|
const a = r.find((o) => o.id === n[0]);
|
|
331
331
|
He({
|
|
332
|
-
searchParams:
|
|
332
|
+
searchParams: s,
|
|
333
333
|
assetId: a.assetId
|
|
334
334
|
});
|
|
335
|
-
} catch (
|
|
336
|
-
console.error("explorer print failed: ",
|
|
335
|
+
} catch (s) {
|
|
336
|
+
console.error("explorer print failed: ", s);
|
|
337
337
|
}
|
|
338
338
|
},
|
|
339
339
|
openFolder: ({
|
|
340
|
-
folderId:
|
|
340
|
+
folderId: s,
|
|
341
341
|
folder: r
|
|
342
342
|
}) => {
|
|
343
343
|
const {
|
|
344
344
|
searchParams: n,
|
|
345
345
|
treeData: a
|
|
346
|
-
} =
|
|
347
|
-
o !==
|
|
348
|
-
...
|
|
346
|
+
} = t(), o = n.filters.folder, l = We(s, a), h = te([...l, s]);
|
|
347
|
+
o !== s && e((d) => ({
|
|
348
|
+
...d,
|
|
349
349
|
// reset selection when changing folder
|
|
350
350
|
folderIds: [],
|
|
351
351
|
resourceIds: [],
|
|
352
|
-
selectedNodesIds:
|
|
352
|
+
selectedNodesIds: h,
|
|
353
353
|
currentFolder: r || {
|
|
354
|
-
id:
|
|
354
|
+
id: s
|
|
355
355
|
},
|
|
356
356
|
searchParams: {
|
|
357
357
|
...n,
|
|
358
358
|
search: void 0,
|
|
359
359
|
filters: {
|
|
360
360
|
...n.filters,
|
|
361
|
-
folder:
|
|
361
|
+
folder: s
|
|
362
362
|
},
|
|
363
|
-
trashed:
|
|
363
|
+
trashed: s === C.BIN
|
|
364
364
|
}
|
|
365
365
|
}));
|
|
366
366
|
},
|
|
367
|
-
foldTreeItem: () => e((
|
|
368
|
-
...
|
|
367
|
+
foldTreeItem: () => e((s) => ({
|
|
368
|
+
...s,
|
|
369
369
|
status: "fold"
|
|
370
370
|
})),
|
|
371
|
-
unfoldTreeItem: async (
|
|
371
|
+
unfoldTreeItem: async (s, r) => {
|
|
372
372
|
const {
|
|
373
373
|
treeData: n,
|
|
374
374
|
searchParams: a
|
|
375
|
-
} =
|
|
375
|
+
} = t();
|
|
376
376
|
if (e((o) => ({
|
|
377
377
|
...o,
|
|
378
378
|
status: "unfold"
|
|
379
|
-
})), !
|
|
379
|
+
})), !de(s, n)) {
|
|
380
380
|
await r.prefetchInfiniteQuery({
|
|
381
381
|
initialPageParam: 0,
|
|
382
382
|
queryKey: ["prefetchContext", {
|
|
383
|
-
folderId:
|
|
383
|
+
folderId: s,
|
|
384
384
|
trashed: !1
|
|
385
385
|
}],
|
|
386
386
|
queryFn: async () => await ie({
|
|
387
387
|
...a,
|
|
388
388
|
filters: {
|
|
389
389
|
...a.filters,
|
|
390
|
-
folder:
|
|
390
|
+
folder: s
|
|
391
391
|
}
|
|
392
392
|
})
|
|
393
393
|
});
|
|
394
394
|
const o = r.getQueryData(["prefetchContext", {
|
|
395
|
-
folderId:
|
|
395
|
+
folderId: s,
|
|
396
396
|
trashed: !1
|
|
397
397
|
}]);
|
|
398
398
|
e((l) => {
|
|
399
|
-
var
|
|
399
|
+
var h;
|
|
400
400
|
return {
|
|
401
401
|
...l,
|
|
402
|
-
treeData:
|
|
402
|
+
treeData: he(n, (h = o == null ? void 0 : o.pages[0]) == null ? void 0 : h.folders, s || C.DEFAULT)
|
|
403
403
|
};
|
|
404
404
|
});
|
|
405
405
|
}
|
|
406
406
|
},
|
|
407
|
-
selectTreeItem: (
|
|
407
|
+
selectTreeItem: (s) => {
|
|
408
408
|
const {
|
|
409
409
|
treeData: r
|
|
410
|
-
} =
|
|
410
|
+
} = t(), {
|
|
411
411
|
openFolder: n
|
|
412
|
-
} =
|
|
413
|
-
|
|
412
|
+
} = t().updaters, a = H(s, r);
|
|
413
|
+
Ie()(), e((l) => ({
|
|
414
414
|
...l,
|
|
415
415
|
searchParams: {
|
|
416
416
|
...l.searchParams,
|
|
@@ -420,33 +420,33 @@ const ue = (e, s, t) => H(e, (r) => (r.id === t && (r.children = s == null ? voi
|
|
|
420
420
|
selectedResources: []
|
|
421
421
|
})), n({
|
|
422
422
|
folder: a,
|
|
423
|
-
folderId:
|
|
423
|
+
folderId: s
|
|
424
424
|
});
|
|
425
425
|
},
|
|
426
426
|
gotoPreviousFolder: () => {
|
|
427
427
|
const {
|
|
428
|
-
selectedNodesIds:
|
|
428
|
+
selectedNodesIds: s,
|
|
429
429
|
treeData: r
|
|
430
|
-
} =
|
|
430
|
+
} = t(), {
|
|
431
431
|
openFolder: n
|
|
432
|
-
} =
|
|
432
|
+
} = t().updaters, a = s.length;
|
|
433
433
|
if (a < 2)
|
|
434
434
|
return;
|
|
435
|
-
const o =
|
|
435
|
+
const o = H(s[a - 2], r);
|
|
436
436
|
n({
|
|
437
437
|
folder: o,
|
|
438
438
|
folderId: (o == null ? void 0 : o.id) || C.DEFAULT
|
|
439
439
|
});
|
|
440
440
|
},
|
|
441
|
-
goToTrash: () => e((
|
|
442
|
-
...
|
|
441
|
+
goToTrash: () => e((s) => ({
|
|
442
|
+
...s,
|
|
443
443
|
selectedNodesIds: [],
|
|
444
444
|
selectedResources: [],
|
|
445
445
|
resourceIds: [],
|
|
446
446
|
folderIds: [],
|
|
447
447
|
status: "select",
|
|
448
448
|
searchParams: {
|
|
449
|
-
...
|
|
449
|
+
...s.searchParams,
|
|
450
450
|
search: void 0,
|
|
451
451
|
filters: {
|
|
452
452
|
folder: C.BIN
|
|
@@ -458,104 +458,104 @@ const ue = (e, s, t) => H(e, (r) => (r.id === t && (r.children = s == null ? voi
|
|
|
458
458
|
}
|
|
459
459
|
}))
|
|
460
460
|
}
|
|
461
|
-
})), D = () => w((e) => e.searchParams), se = () => w((e) => e.selectedNodesIds), z = () => w((e) => e.treeData), _t = () => w((e) => e.selectedFolders), $t = () => w((e) => e.selectedResources), Ge = () => w((e) => e.searchConfig), J = () => w((e) => e.folderIds), X = () => w((e) => e.resourceIds), Y = () => w((e) => e.selectedResources.map((
|
|
462
|
-
const e =
|
|
461
|
+
})), D = () => w((e) => e.searchParams), se = () => w((e) => e.selectedNodesIds), z = () => w((e) => e.treeData), _t = () => w((e) => e.selectedFolders), $t = () => w((e) => e.selectedResources), Ge = () => w((e) => e.searchConfig), J = () => w((e) => e.folderIds), X = () => w((e) => e.resourceIds), Y = () => w((e) => e.selectedResources.map((t) => t.assetId)), Z = () => w((e) => e.selectedResources.filter((t) => t.assetId === t.id)), V = () => w((e) => e.currentFolder), T = () => w((e) => e.updaters), re = () => {
|
|
462
|
+
const e = V();
|
|
463
463
|
return (e == null ? void 0 : e.id) === C.BIN;
|
|
464
464
|
}, Je = () => w((e) => e.resourceIsTrash), Xe = () => w((e) => e.resourceActionDisable), Ye = () => {
|
|
465
|
-
const e =
|
|
465
|
+
const e = V();
|
|
466
466
|
return (e == null ? void 0 : e.id) === "default";
|
|
467
|
-
}, Ze = () => se().length > 1, et = () => w((e) => e.status),
|
|
468
|
-
const e = D(), [
|
|
467
|
+
}, Ze = () => se().length > 1, et = () => w((e) => e.status), fe = () => {
|
|
468
|
+
const e = D(), [t, s] = ae(""), r = Ge(), n = et(), a = ge(null), {
|
|
469
469
|
setSearchParams: o
|
|
470
|
-
} = T(), l = (
|
|
471
|
-
const f =
|
|
472
|
-
|
|
473
|
-
},
|
|
474
|
-
(
|
|
475
|
-
search:
|
|
470
|
+
} = T(), l = (u) => {
|
|
471
|
+
const f = u.target.value;
|
|
472
|
+
s(f.toString());
|
|
473
|
+
}, h = (u) => {
|
|
474
|
+
(u.key === "Enter" || u.key === "Return") && (u.preventDefault(), o({
|
|
475
|
+
search: t || void 0
|
|
476
476
|
}));
|
|
477
|
-
},
|
|
478
|
-
|
|
479
|
-
search:
|
|
477
|
+
}, d = (u) => {
|
|
478
|
+
u.preventDefault(), o({
|
|
479
|
+
search: t || void 0
|
|
480
480
|
});
|
|
481
481
|
};
|
|
482
482
|
return L(() => {
|
|
483
|
-
const f =
|
|
484
|
-
search:
|
|
483
|
+
const f = t.length == 0 || t.length >= r.minLength ? {
|
|
484
|
+
search: t || void 0
|
|
485
485
|
} : {};
|
|
486
486
|
o({
|
|
487
487
|
...e,
|
|
488
488
|
...f
|
|
489
489
|
});
|
|
490
|
-
}, [
|
|
491
|
-
n === "select" &&
|
|
490
|
+
}, [t, r.minLength]), L(() => {
|
|
491
|
+
n === "select" && s("");
|
|
492
492
|
}, [n]), L(() => {
|
|
493
|
-
|
|
494
|
-
var
|
|
495
|
-
return ((
|
|
493
|
+
s(() => {
|
|
494
|
+
var u;
|
|
495
|
+
return ((u = e.search) == null ? void 0 : u.toString()) ?? "";
|
|
496
496
|
});
|
|
497
497
|
}, [e]), {
|
|
498
498
|
formRef: a,
|
|
499
|
-
inputSearch:
|
|
499
|
+
inputSearch: t,
|
|
500
500
|
handleInputSearchChange: l,
|
|
501
|
-
handleKeyPress:
|
|
502
|
-
handleSearchSubmit:
|
|
501
|
+
handleKeyPress: h,
|
|
502
|
+
handleSearchSubmit: d
|
|
503
503
|
};
|
|
504
504
|
};
|
|
505
505
|
function tt() {
|
|
506
506
|
const {
|
|
507
507
|
appCode: e
|
|
508
508
|
} = M(), {
|
|
509
|
-
gotoPreviousFolder:
|
|
509
|
+
gotoPreviousFolder: t
|
|
510
510
|
} = T(), {
|
|
511
|
-
t
|
|
511
|
+
t: s
|
|
512
512
|
} = j(), {
|
|
513
513
|
inputSearch: r
|
|
514
|
-
} =
|
|
514
|
+
} = fe(), n = se(), a = re(), o = V(), l = s("explorer.tree.trash"), h = s("explorer.tree.search"), d = s("explorer.filters.mine", {
|
|
515
515
|
ns: e
|
|
516
|
-
}),
|
|
517
|
-
return /* @__PURE__ */
|
|
518
|
-
/* @__PURE__ */
|
|
519
|
-
/* @__PURE__ */
|
|
520
|
-
] }) : /* @__PURE__ */
|
|
516
|
+
}), u = (o == null ? void 0 : o.name) || d;
|
|
517
|
+
return /* @__PURE__ */ c("div", { className: "py-16", children: n.length > 1 && !a ? /* @__PURE__ */ N("div", { className: "d-flex align-items-center gap-8", children: [
|
|
518
|
+
/* @__PURE__ */ c(we, { icon: /* @__PURE__ */ c(Ee, {}), variant: "ghost", color: "tertiary", "aria-label": s("back"), className: "ms-n16", onClick: t }),
|
|
519
|
+
/* @__PURE__ */ c("p", { className: "body py-8 text-truncate", children: /* @__PURE__ */ c("strong", { children: u }) })
|
|
520
|
+
] }) : /* @__PURE__ */ c("h2", { className: "body py-8 fw-bold", children: r.length !== 0 ? h : a ? l : d }) });
|
|
521
521
|
}
|
|
522
522
|
const st = () => {
|
|
523
523
|
const e = Xe(), {
|
|
524
|
-
clearSelectedIds:
|
|
525
|
-
setResourceActionDisable:
|
|
524
|
+
clearSelectedIds: t,
|
|
525
|
+
setResourceActionDisable: s,
|
|
526
526
|
clearSelectedItems: r
|
|
527
527
|
} = T();
|
|
528
528
|
return {
|
|
529
529
|
isActionDisableModalOpen: e,
|
|
530
530
|
onActionDisableCancel: () => {
|
|
531
|
-
|
|
531
|
+
t(), r(), s(!1);
|
|
532
532
|
}
|
|
533
533
|
};
|
|
534
534
|
}, rt = () => {
|
|
535
535
|
const e = Je(), {
|
|
536
|
-
clearSelectedIds:
|
|
537
|
-
setResourceIsTrash:
|
|
536
|
+
clearSelectedIds: t,
|
|
537
|
+
setResourceIsTrash: s,
|
|
538
538
|
clearSelectedItems: r
|
|
539
539
|
} = T();
|
|
540
540
|
return {
|
|
541
541
|
isTrashedModalOpen: e,
|
|
542
542
|
onTrashedCancel: () => {
|
|
543
|
-
|
|
543
|
+
t(), r(), s(!1);
|
|
544
544
|
}
|
|
545
545
|
};
|
|
546
546
|
};
|
|
547
547
|
function nt(e, {
|
|
548
|
-
parentId:
|
|
549
|
-
newFolder:
|
|
548
|
+
parentId: t,
|
|
549
|
+
newFolder: s
|
|
550
550
|
}) {
|
|
551
|
-
return
|
|
551
|
+
return W(e, (r) => {
|
|
552
552
|
var n;
|
|
553
|
-
if (r.id ===
|
|
553
|
+
if (r.id === t) {
|
|
554
554
|
const a = [...((n = r.folder) == null ? void 0 : n.ancestors) || []], o = te([...a, r.id]);
|
|
555
555
|
return {
|
|
556
556
|
...r,
|
|
557
557
|
children: [...r.children || [], new G({
|
|
558
|
-
...
|
|
558
|
+
...s,
|
|
559
559
|
ancestors: o
|
|
560
560
|
})]
|
|
561
561
|
};
|
|
@@ -564,82 +564,82 @@ function nt(e, {
|
|
|
564
564
|
});
|
|
565
565
|
}
|
|
566
566
|
function ot(e, {
|
|
567
|
-
folders:
|
|
567
|
+
folders: t
|
|
568
568
|
}) {
|
|
569
|
-
return
|
|
570
|
-
if (!
|
|
571
|
-
return
|
|
569
|
+
return W(e, (s) => {
|
|
570
|
+
if (!t.includes(s.id))
|
|
571
|
+
return s;
|
|
572
572
|
});
|
|
573
573
|
}
|
|
574
574
|
function at(e, {
|
|
575
|
-
destinationId:
|
|
576
|
-
folders:
|
|
575
|
+
destinationId: t,
|
|
576
|
+
folders: s
|
|
577
577
|
}) {
|
|
578
|
-
return
|
|
578
|
+
return W(e, (r, n) => {
|
|
579
579
|
var a, o;
|
|
580
|
-
if (
|
|
581
|
-
const l = [...((a = r.folder) == null ? void 0 : a.ancestors) || []],
|
|
582
|
-
for (const
|
|
583
|
-
if (!
|
|
584
|
-
const p =
|
|
585
|
-
p &&
|
|
580
|
+
if (t === r.id) {
|
|
581
|
+
const l = [...((a = r.folder) == null ? void 0 : a.ancestors) || []], h = te([...l, r.id]), d = [...r.children || []], u = ((o = r.children) == null ? void 0 : o.map((i) => i.id)) || [];
|
|
582
|
+
for (const i of s)
|
|
583
|
+
if (!u.includes(i)) {
|
|
584
|
+
const p = H(i, e);
|
|
585
|
+
p && d.push({
|
|
586
586
|
...p,
|
|
587
587
|
folder: {
|
|
588
588
|
...p == null ? void 0 : p.folder,
|
|
589
|
-
ancestors:
|
|
589
|
+
ancestors: h
|
|
590
590
|
}
|
|
591
591
|
});
|
|
592
592
|
}
|
|
593
593
|
return {
|
|
594
594
|
...r,
|
|
595
|
-
children:
|
|
595
|
+
children: d
|
|
596
596
|
};
|
|
597
597
|
} else
|
|
598
|
-
return
|
|
598
|
+
return s.includes(r.id) && t !== (n == null ? void 0 : n.id) ? void 0 : r;
|
|
599
599
|
});
|
|
600
600
|
}
|
|
601
601
|
function ct(e, {
|
|
602
|
-
folderId:
|
|
603
|
-
newFolder:
|
|
602
|
+
folderId: t,
|
|
603
|
+
newFolder: s
|
|
604
604
|
}) {
|
|
605
|
-
return
|
|
605
|
+
return W(e, (r) => r.id === t ? new G(s) : r);
|
|
606
606
|
}
|
|
607
607
|
const it = () => {
|
|
608
|
-
const e = w((
|
|
609
|
-
return
|
|
608
|
+
const e = w((t) => t.config);
|
|
609
|
+
return Ue({
|
|
610
610
|
queryKey: ["actions"],
|
|
611
611
|
queryFn: async () => {
|
|
612
|
-
const
|
|
613
|
-
return await je(
|
|
612
|
+
const t = e == null ? void 0 : e.actions.map((r) => r.workflow);
|
|
613
|
+
return await je(t);
|
|
614
614
|
},
|
|
615
|
-
select: (
|
|
616
|
-
...
|
|
617
|
-
available: s
|
|
615
|
+
select: (t) => e == null ? void 0 : e.actions.map((s) => ({
|
|
616
|
+
...s,
|
|
617
|
+
available: t[s.workflow]
|
|
618
618
|
})),
|
|
619
619
|
staleTime: 1 / 0,
|
|
620
620
|
enabled: !!e
|
|
621
621
|
});
|
|
622
622
|
}, lt = () => {
|
|
623
|
-
const e = w((o) => o.config),
|
|
624
|
-
filters:
|
|
623
|
+
const e = w((o) => o.config), t = D(), {
|
|
624
|
+
filters: s,
|
|
625
625
|
trashed: r,
|
|
626
626
|
search: n
|
|
627
|
-
} =
|
|
628
|
-
folderId:
|
|
629
|
-
filters:
|
|
627
|
+
} = t, a = ["context", {
|
|
628
|
+
folderId: s.folder,
|
|
629
|
+
filters: s,
|
|
630
630
|
trashed: r,
|
|
631
631
|
search: n
|
|
632
632
|
}];
|
|
633
|
-
return
|
|
633
|
+
return ve({
|
|
634
634
|
queryKey: a,
|
|
635
635
|
queryFn: async ({
|
|
636
636
|
pageParam: o
|
|
637
637
|
}) => await ie({
|
|
638
|
-
...
|
|
638
|
+
...t,
|
|
639
639
|
application: e == null ? void 0 : e.app,
|
|
640
640
|
types: e == null ? void 0 : e.types,
|
|
641
641
|
pagination: {
|
|
642
|
-
...
|
|
642
|
+
...t.pagination,
|
|
643
643
|
startIdx: o
|
|
644
644
|
}
|
|
645
645
|
}),
|
|
@@ -650,34 +650,34 @@ const it = () => {
|
|
|
650
650
|
getNextPageParam: (o) => o.pagination.startIdx + o.pagination.pageSize
|
|
651
651
|
});
|
|
652
652
|
}, jt = () => {
|
|
653
|
-
const e = k(),
|
|
654
|
-
clearSelectedItems:
|
|
655
|
-
clearSelectedIds:
|
|
653
|
+
const e = k(), t = E(), s = D(), r = z(), n = J(), a = Y(), o = X(), l = Z().length > 0, h = l ? a : o, {
|
|
654
|
+
clearSelectedItems: d,
|
|
655
|
+
clearSelectedIds: u,
|
|
656
656
|
setTreeData: f,
|
|
657
|
-
setSearchParams:
|
|
657
|
+
setSearchParams: i
|
|
658
658
|
} = T(), {
|
|
659
659
|
filters: p,
|
|
660
660
|
trashed: m
|
|
661
|
-
} =
|
|
661
|
+
} = s, y = ["context", {
|
|
662
662
|
folderId: p.folder,
|
|
663
663
|
filters: p,
|
|
664
664
|
trashed: m
|
|
665
665
|
}];
|
|
666
666
|
return v({
|
|
667
|
-
mutationFn: async () => await
|
|
668
|
-
searchParams:
|
|
667
|
+
mutationFn: async () => await Ke({
|
|
668
|
+
searchParams: s,
|
|
669
669
|
folderIds: n,
|
|
670
|
-
resourceIds:
|
|
670
|
+
resourceIds: h,
|
|
671
671
|
useAssetIds: l
|
|
672
672
|
}),
|
|
673
673
|
onError(g) {
|
|
674
674
|
typeof g == "string" && e.error(S(g));
|
|
675
675
|
},
|
|
676
676
|
onSuccess: async (g) => {
|
|
677
|
-
if (await
|
|
677
|
+
if (await t.cancelQueries({
|
|
678
678
|
queryKey: y
|
|
679
|
-
}),
|
|
680
|
-
return e.success(S("explorer.trash.title")),
|
|
679
|
+
}), t.getQueryData(y))
|
|
680
|
+
return e.success(S("explorer.trash.title")), t.setQueryData(y, (F) => {
|
|
681
681
|
var Q;
|
|
682
682
|
if (F) {
|
|
683
683
|
const U = {
|
|
@@ -692,44 +692,44 @@ const it = () => {
|
|
|
692
692
|
// @ts-ignore
|
|
693
693
|
maxIdx: ((P = R == null ? void 0 : R.pagination) == null ? void 0 : P.maxIdx) - g.resources.length
|
|
694
694
|
},
|
|
695
|
-
resources: R.resources.filter((q) => l ? !a.includes(q.assetId) : !
|
|
695
|
+
resources: R.resources.filter((q) => l ? !a.includes(q.assetId) : !h.includes(q.id))
|
|
696
696
|
};
|
|
697
697
|
})
|
|
698
698
|
}, K = ot(r, {
|
|
699
699
|
folders: n
|
|
700
700
|
});
|
|
701
|
-
return f(K),
|
|
702
|
-
...
|
|
701
|
+
return f(K), i({
|
|
702
|
+
...s,
|
|
703
703
|
pagination: {
|
|
704
|
-
...
|
|
704
|
+
...s.pagination,
|
|
705
705
|
// @ts-ignore
|
|
706
|
-
maxIdx: ((Q =
|
|
706
|
+
maxIdx: ((Q = s.pagination) == null ? void 0 : Q.maxIdx) - g.resources.length
|
|
707
707
|
}
|
|
708
708
|
}), U;
|
|
709
709
|
}
|
|
710
710
|
});
|
|
711
711
|
},
|
|
712
712
|
onSettled: () => {
|
|
713
|
-
|
|
713
|
+
d(), u();
|
|
714
714
|
}
|
|
715
715
|
});
|
|
716
716
|
}, zt = () => {
|
|
717
|
-
const e = k(),
|
|
718
|
-
setFolderIds:
|
|
719
|
-
setResourceIds:
|
|
720
|
-
setSelectedResources:
|
|
717
|
+
const e = k(), t = E(), s = D(), r = J(), n = Y(), a = X(), o = Z().length > 0, l = o ? n : a, {
|
|
718
|
+
setFolderIds: h,
|
|
719
|
+
setResourceIds: d,
|
|
720
|
+
setSelectedResources: u,
|
|
721
721
|
setSelectedFolders: f
|
|
722
722
|
} = T(), {
|
|
723
|
-
filters:
|
|
723
|
+
filters: i,
|
|
724
724
|
trashed: p
|
|
725
|
-
} =
|
|
726
|
-
folderId:
|
|
727
|
-
filters:
|
|
725
|
+
} = s, m = ["context", {
|
|
726
|
+
folderId: i.folder,
|
|
727
|
+
filters: i,
|
|
728
728
|
trashed: p
|
|
729
729
|
}];
|
|
730
730
|
return v({
|
|
731
|
-
mutationFn: async () => await
|
|
732
|
-
searchParams:
|
|
731
|
+
mutationFn: async () => await _e({
|
|
732
|
+
searchParams: s,
|
|
733
733
|
folderIds: r,
|
|
734
734
|
resourceIds: l,
|
|
735
735
|
useAssetIds: o
|
|
@@ -738,10 +738,10 @@ const it = () => {
|
|
|
738
738
|
typeof y == "string" && e.error(S(y));
|
|
739
739
|
},
|
|
740
740
|
onSuccess: async () => {
|
|
741
|
-
if (await
|
|
741
|
+
if (await t.cancelQueries({
|
|
742
742
|
queryKey: m
|
|
743
|
-
}),
|
|
744
|
-
return e.success(S("explorer.trash.toast")),
|
|
743
|
+
}), t.getQueryData(m))
|
|
744
|
+
return e.success(S("explorer.trash.toast")), t.setQueryData(m, (g) => {
|
|
745
745
|
if (g)
|
|
746
746
|
return {
|
|
747
747
|
...g,
|
|
@@ -754,24 +754,24 @@ const it = () => {
|
|
|
754
754
|
});
|
|
755
755
|
},
|
|
756
756
|
onSettled: () => {
|
|
757
|
-
|
|
757
|
+
d([]), u([]), h([]), f([]);
|
|
758
758
|
}
|
|
759
759
|
});
|
|
760
760
|
}, Vt = () => {
|
|
761
|
-
const e = k(),
|
|
762
|
-
clearSelectedItems:
|
|
763
|
-
clearSelectedIds:
|
|
761
|
+
const e = k(), t = E(), s = D(), r = J(), n = Y(), a = X(), o = Z().length > 0, l = o ? n : a, {
|
|
762
|
+
clearSelectedItems: h,
|
|
763
|
+
clearSelectedIds: d
|
|
764
764
|
} = T(), {
|
|
765
|
-
filters:
|
|
765
|
+
filters: u,
|
|
766
766
|
trashed: f
|
|
767
|
-
} =
|
|
768
|
-
folderId:
|
|
769
|
-
filters:
|
|
767
|
+
} = s, i = ["context", {
|
|
768
|
+
folderId: u.folder,
|
|
769
|
+
filters: u,
|
|
770
770
|
trashed: f
|
|
771
771
|
}];
|
|
772
772
|
return v({
|
|
773
|
-
mutationFn: async () => await
|
|
774
|
-
searchParams:
|
|
773
|
+
mutationFn: async () => await Be({
|
|
774
|
+
searchParams: s,
|
|
775
775
|
folderIds: r,
|
|
776
776
|
resourceIds: l,
|
|
777
777
|
useAssetIds: o
|
|
@@ -780,10 +780,10 @@ const it = () => {
|
|
|
780
780
|
typeof p == "string" && e.error(S(p));
|
|
781
781
|
},
|
|
782
782
|
onSuccess: async () => {
|
|
783
|
-
if (await
|
|
784
|
-
queryKey:
|
|
785
|
-
}),
|
|
786
|
-
return e.success(S("explorer.removed.from.trash")),
|
|
783
|
+
if (await t.cancelQueries({
|
|
784
|
+
queryKey: i
|
|
785
|
+
}), t.getQueryData(i))
|
|
786
|
+
return e.success(S("explorer.removed.from.trash")), t.setQueryData(i, (m) => {
|
|
787
787
|
if (m)
|
|
788
788
|
return {
|
|
789
789
|
...m,
|
|
@@ -796,29 +796,29 @@ const it = () => {
|
|
|
796
796
|
});
|
|
797
797
|
},
|
|
798
798
|
onSettled: () => {
|
|
799
|
-
|
|
799
|
+
h(), d();
|
|
800
800
|
}
|
|
801
801
|
});
|
|
802
802
|
}, Ht = () => {
|
|
803
|
-
const e = k(),
|
|
803
|
+
const e = k(), t = D(), s = E(), {
|
|
804
804
|
user: r
|
|
805
|
-
} = ce(), {
|
|
806
|
-
filters:
|
|
807
|
-
trashed:
|
|
808
|
-
} =
|
|
809
|
-
folderId:
|
|
810
|
-
filters:
|
|
811
|
-
trashed:
|
|
805
|
+
} = ce(), n = V(), {
|
|
806
|
+
filters: a,
|
|
807
|
+
trashed: o
|
|
808
|
+
} = t, l = "duplicate_start", h = ["context", {
|
|
809
|
+
folderId: a.folder,
|
|
810
|
+
filters: a,
|
|
811
|
+
trashed: o
|
|
812
812
|
}];
|
|
813
813
|
return v({
|
|
814
814
|
mutationFn: async (d) => (e.info(S("duplicate.start"), {
|
|
815
|
-
id:
|
|
816
|
-
}), await
|
|
815
|
+
id: l
|
|
816
|
+
}), await $e(t, d.assetId)),
|
|
817
817
|
onSuccess: async (d, u) => {
|
|
818
|
-
e.remove(
|
|
819
|
-
queryKey:
|
|
818
|
+
e.remove(l), e.success(S("duplicate.done")), await s.cancelQueries({
|
|
819
|
+
queryKey: h
|
|
820
820
|
});
|
|
821
|
-
const
|
|
821
|
+
const f = s.getQueryData(h), i = {
|
|
822
822
|
...u,
|
|
823
823
|
name: `${u.name}${S("duplicate.suffix")}`,
|
|
824
824
|
assetId: d.duplicateId,
|
|
@@ -834,50 +834,55 @@ const it = () => {
|
|
|
834
834
|
trashed: !1,
|
|
835
835
|
rights: [`creator:${r == null ? void 0 : r.userId}`]
|
|
836
836
|
};
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
837
|
+
f && s.setQueryData(h, (p) => {
|
|
838
|
+
if (p)
|
|
839
|
+
return {
|
|
840
|
+
...p,
|
|
841
|
+
pages: p == null ? void 0 : p.pages.map((m) => ({
|
|
842
|
+
...m,
|
|
843
|
+
resources: [i, ...m.resources]
|
|
844
|
+
}))
|
|
845
|
+
};
|
|
846
|
+
}), n.id && n.id !== "default" && le({
|
|
847
|
+
searchParams: t,
|
|
848
|
+
resourceIds: [d.duplicateId],
|
|
849
|
+
folderId: n.id,
|
|
850
|
+
folderIds: [],
|
|
851
|
+
useAssetIds: !0
|
|
852
|
+
});
|
|
848
853
|
},
|
|
849
854
|
onError: (d) => {
|
|
850
|
-
e.remove(
|
|
855
|
+
e.remove(l), typeof d == "string" && e.error(`${S("duplicate.error")}: ${d}`);
|
|
851
856
|
}
|
|
852
857
|
});
|
|
853
858
|
}, Wt = () => {
|
|
854
|
-
const e = k(),
|
|
855
|
-
clearSelectedIds:
|
|
856
|
-
clearSelectedItems:
|
|
859
|
+
const e = k(), t = E(), s = D(), r = z(), n = J(), a = Y(), o = X(), l = Z().length > 0, h = l ? a : o, {
|
|
860
|
+
clearSelectedIds: d,
|
|
861
|
+
clearSelectedItems: u,
|
|
857
862
|
setTreeData: f,
|
|
858
|
-
setSearchParams:
|
|
863
|
+
setSearchParams: i
|
|
859
864
|
} = T(), {
|
|
860
865
|
filters: p,
|
|
861
866
|
trashed: m
|
|
862
|
-
} =
|
|
867
|
+
} = s, y = ["context", {
|
|
863
868
|
folderId: p.folder,
|
|
864
869
|
filters: p,
|
|
865
870
|
trashed: m
|
|
866
871
|
}];
|
|
867
872
|
return v({
|
|
868
|
-
mutationFn: async (g) => await
|
|
869
|
-
searchParams:
|
|
873
|
+
mutationFn: async (g) => await le({
|
|
874
|
+
searchParams: s,
|
|
870
875
|
folderId: g,
|
|
871
876
|
folderIds: n,
|
|
872
|
-
resourceIds:
|
|
877
|
+
resourceIds: h,
|
|
873
878
|
useAssetIds: l
|
|
874
879
|
}),
|
|
875
880
|
onError(g) {
|
|
876
881
|
typeof g == "string" && e.error(S(g));
|
|
877
882
|
},
|
|
878
883
|
onSuccess: async (g, I) => {
|
|
879
|
-
if (
|
|
880
|
-
return
|
|
884
|
+
if (t.getQueryData(y))
|
|
885
|
+
return t.setQueryData(y, (Q) => {
|
|
881
886
|
var U;
|
|
882
887
|
if (Q) {
|
|
883
888
|
const K = at(r, {
|
|
@@ -895,69 +900,69 @@ const it = () => {
|
|
|
895
900
|
// @ts-ignore
|
|
896
901
|
maxIdx: ((q = P.pagination) == null ? void 0 : q.maxIdx) - g.resources.length
|
|
897
902
|
},
|
|
898
|
-
resources: P.resources.filter((B) => l ? !a.includes(B.assetId) : !
|
|
903
|
+
resources: P.resources.filter((B) => l ? !a.includes(B.assetId) : !h.includes(B.id))
|
|
899
904
|
};
|
|
900
905
|
})
|
|
901
906
|
};
|
|
902
|
-
return f(K),
|
|
903
|
-
...
|
|
907
|
+
return f(K), i({
|
|
908
|
+
...s,
|
|
904
909
|
pagination: {
|
|
905
|
-
...
|
|
910
|
+
...s.pagination,
|
|
906
911
|
// @ts-ignore
|
|
907
|
-
maxIdx: ((U =
|
|
912
|
+
maxIdx: ((U = s.pagination) == null ? void 0 : U.maxIdx) - g.resources.length
|
|
908
913
|
}
|
|
909
914
|
}), R;
|
|
910
915
|
}
|
|
911
916
|
});
|
|
912
917
|
},
|
|
913
918
|
onSettled: () => {
|
|
914
|
-
|
|
919
|
+
u(), d();
|
|
915
920
|
}
|
|
916
921
|
});
|
|
917
922
|
}, Gt = () => {
|
|
918
|
-
const e = k(),
|
|
923
|
+
const e = k(), t = E(), s = D(), r = z(), {
|
|
919
924
|
setTreeData: n
|
|
920
925
|
} = T(), {
|
|
921
926
|
filters: a,
|
|
922
927
|
trashed: o
|
|
923
|
-
} =
|
|
928
|
+
} = s, l = ["context", {
|
|
924
929
|
folderId: a.folder,
|
|
925
930
|
filters: a,
|
|
926
931
|
trashed: o
|
|
927
932
|
}];
|
|
928
933
|
return v({
|
|
929
934
|
mutationFn: async ({
|
|
930
|
-
name:
|
|
931
|
-
parentId:
|
|
932
|
-
}) => await
|
|
933
|
-
searchParams:
|
|
934
|
-
name:
|
|
935
|
-
parentId:
|
|
935
|
+
name: h,
|
|
936
|
+
parentId: d
|
|
937
|
+
}) => await Le({
|
|
938
|
+
searchParams: s,
|
|
939
|
+
name: h,
|
|
940
|
+
parentId: d
|
|
936
941
|
}),
|
|
937
|
-
onError(
|
|
938
|
-
typeof
|
|
942
|
+
onError(h) {
|
|
943
|
+
typeof h == "string" && e.error(S(h));
|
|
939
944
|
},
|
|
940
|
-
onSuccess: async (
|
|
941
|
-
await
|
|
945
|
+
onSuccess: async (h, d) => {
|
|
946
|
+
await t.cancelQueries({
|
|
942
947
|
queryKey: l
|
|
943
948
|
});
|
|
944
|
-
const
|
|
945
|
-
...
|
|
946
|
-
parentId:
|
|
949
|
+
const u = t.getQueryData(l), f = {
|
|
950
|
+
...h,
|
|
951
|
+
parentId: d.parentId,
|
|
947
952
|
children: [],
|
|
948
|
-
rights: [`creator:${
|
|
953
|
+
rights: [`creator:${h == null ? void 0 : h.creator_id}`]
|
|
949
954
|
};
|
|
950
|
-
if (
|
|
951
|
-
return
|
|
952
|
-
if (
|
|
955
|
+
if (u)
|
|
956
|
+
return t.setQueryData(l, (i) => {
|
|
957
|
+
if (i) {
|
|
953
958
|
const p = {
|
|
954
|
-
...
|
|
955
|
-
pages:
|
|
959
|
+
...i,
|
|
960
|
+
pages: i == null ? void 0 : i.pages.map((y) => ({
|
|
956
961
|
...y,
|
|
957
962
|
folders: [...y.folders, f]
|
|
958
963
|
}))
|
|
959
964
|
}, m = nt(r, {
|
|
960
|
-
parentId:
|
|
965
|
+
parentId: d.parentId,
|
|
961
966
|
newFolder: f
|
|
962
967
|
});
|
|
963
968
|
return n(m), p;
|
|
@@ -966,51 +971,51 @@ const it = () => {
|
|
|
966
971
|
}
|
|
967
972
|
});
|
|
968
973
|
}, Jt = () => {
|
|
969
|
-
const e = k(),
|
|
974
|
+
const e = k(), t = E(), s = D(), r = z(), {
|
|
970
975
|
setFolderIds: n,
|
|
971
976
|
setSelectedFolders: a,
|
|
972
977
|
setTreeData: o
|
|
973
978
|
} = T(), {
|
|
974
979
|
filters: l,
|
|
975
|
-
trashed:
|
|
976
|
-
} =
|
|
980
|
+
trashed: h
|
|
981
|
+
} = s, d = ["context", {
|
|
977
982
|
folderId: l.folder,
|
|
978
983
|
filters: l,
|
|
979
|
-
trashed:
|
|
984
|
+
trashed: h
|
|
980
985
|
}];
|
|
981
986
|
return v({
|
|
982
987
|
mutationFn: async ({
|
|
983
|
-
folderId:
|
|
988
|
+
folderId: u,
|
|
984
989
|
name: f,
|
|
985
|
-
parentId:
|
|
986
|
-
}) => await
|
|
987
|
-
searchParams:
|
|
988
|
-
folderId:
|
|
989
|
-
parentId:
|
|
990
|
+
parentId: i
|
|
991
|
+
}) => await Me({
|
|
992
|
+
searchParams: s,
|
|
993
|
+
folderId: u,
|
|
994
|
+
parentId: i,
|
|
990
995
|
name: f
|
|
991
996
|
}),
|
|
992
|
-
onError(
|
|
993
|
-
typeof
|
|
997
|
+
onError(u) {
|
|
998
|
+
typeof u == "string" && e.error(S(u));
|
|
994
999
|
},
|
|
995
|
-
onSuccess: async (
|
|
996
|
-
if (await
|
|
997
|
-
queryKey:
|
|
998
|
-
}),
|
|
999
|
-
return
|
|
1000
|
+
onSuccess: async (u, f) => {
|
|
1001
|
+
if (await t.cancelQueries({
|
|
1002
|
+
queryKey: d
|
|
1003
|
+
}), t.getQueryData(d))
|
|
1004
|
+
return t.setQueryData(d, (p) => {
|
|
1000
1005
|
if (p) {
|
|
1001
1006
|
const m = {
|
|
1002
1007
|
...p,
|
|
1003
1008
|
pages: p == null ? void 0 : p.pages.map((g) => ({
|
|
1004
1009
|
...g,
|
|
1005
|
-
folders: g.folders.map((I) => I.id ===
|
|
1006
|
-
...
|
|
1010
|
+
folders: g.folders.map((I) => I.id === u.id ? {
|
|
1011
|
+
...u,
|
|
1007
1012
|
parentId: f.parentId,
|
|
1008
1013
|
rights: I.rights
|
|
1009
1014
|
} : I)
|
|
1010
1015
|
}))
|
|
1011
1016
|
}, y = ct(r, {
|
|
1012
1017
|
folderId: f.folderId,
|
|
1013
|
-
newFolder:
|
|
1018
|
+
newFolder: u
|
|
1014
1019
|
});
|
|
1015
1020
|
return o(y), m;
|
|
1016
1021
|
}
|
|
@@ -1021,34 +1026,34 @@ const it = () => {
|
|
|
1021
1026
|
}
|
|
1022
1027
|
});
|
|
1023
1028
|
}, Xt = (e) => {
|
|
1024
|
-
const
|
|
1029
|
+
const t = E(), s = D(), {
|
|
1025
1030
|
setResourceIds: r,
|
|
1026
1031
|
setSelectedResources: n
|
|
1027
1032
|
} = T(), {
|
|
1028
1033
|
filters: a,
|
|
1029
1034
|
trashed: o
|
|
1030
|
-
} =
|
|
1035
|
+
} = s, l = ["context", {
|
|
1031
1036
|
folderId: a.folder,
|
|
1032
1037
|
filters: a,
|
|
1033
1038
|
trashed: o
|
|
1034
1039
|
}];
|
|
1035
|
-
return
|
|
1040
|
+
return Se({
|
|
1036
1041
|
application: e,
|
|
1037
1042
|
options: {
|
|
1038
|
-
onSuccess: async (
|
|
1039
|
-
if (await
|
|
1043
|
+
onSuccess: async (h, d) => {
|
|
1044
|
+
if (await t.cancelQueries({
|
|
1040
1045
|
queryKey: l
|
|
1041
|
-
}),
|
|
1042
|
-
return
|
|
1046
|
+
}), t.getQueryData(l))
|
|
1047
|
+
return t.setQueryData(l, (f) => {
|
|
1043
1048
|
if (f)
|
|
1044
1049
|
return {
|
|
1045
1050
|
...f,
|
|
1046
|
-
pages: f == null ? void 0 : f.pages.map((
|
|
1047
|
-
...
|
|
1048
|
-
resources:
|
|
1049
|
-
if (p.assetId === (
|
|
1051
|
+
pages: f == null ? void 0 : f.pages.map((i) => ({
|
|
1052
|
+
...i,
|
|
1053
|
+
resources: i.resources.map((p) => {
|
|
1054
|
+
if (p.assetId === (d == null ? void 0 : d.resourceId)) {
|
|
1050
1055
|
let m = [`creator:${p.creatorId}`];
|
|
1051
|
-
return (
|
|
1056
|
+
return (d == null ? void 0 : d.rights.length) >= 1 && (m = [...m, ...d.rights.flatMap((y) => y.actions.map((g) => `${y.type}:${y.id}:${g.id}`))]), {
|
|
1052
1057
|
...p,
|
|
1053
1058
|
rights: m
|
|
1054
1059
|
};
|
|
@@ -1065,31 +1070,31 @@ const it = () => {
|
|
|
1065
1070
|
}
|
|
1066
1071
|
});
|
|
1067
1072
|
}, Yt = (e) => {
|
|
1068
|
-
const
|
|
1073
|
+
const t = E(), s = D(), {
|
|
1069
1074
|
filters: r,
|
|
1070
1075
|
trashed: n
|
|
1071
|
-
} =
|
|
1076
|
+
} = s, a = ["context", {
|
|
1072
1077
|
folderId: r.folder,
|
|
1073
1078
|
filters: r,
|
|
1074
1079
|
trashed: n
|
|
1075
1080
|
}];
|
|
1076
|
-
return
|
|
1081
|
+
return xe({
|
|
1077
1082
|
application: e,
|
|
1078
1083
|
options: {
|
|
1079
1084
|
onSuccess: async (o, l) => {
|
|
1080
|
-
if (await
|
|
1085
|
+
if (await t.cancelQueries({
|
|
1081
1086
|
queryKey: a
|
|
1082
|
-
}),
|
|
1083
|
-
return
|
|
1084
|
-
if (
|
|
1087
|
+
}), t.getQueryData(a))
|
|
1088
|
+
return t.setQueryData(a, (d) => {
|
|
1089
|
+
if (d)
|
|
1085
1090
|
return {
|
|
1086
|
-
...
|
|
1087
|
-
pages:
|
|
1088
|
-
...
|
|
1089
|
-
resources:
|
|
1091
|
+
...d,
|
|
1092
|
+
pages: d == null ? void 0 : d.pages.map((u) => ({
|
|
1093
|
+
...u,
|
|
1094
|
+
resources: u.resources.map((f) => {
|
|
1090
1095
|
if (f.assetId === (l == null ? void 0 : l.entId)) {
|
|
1091
1096
|
const {
|
|
1092
|
-
name:
|
|
1097
|
+
name: i,
|
|
1093
1098
|
thumbnail: p,
|
|
1094
1099
|
public: m,
|
|
1095
1100
|
description: y,
|
|
@@ -1100,7 +1105,7 @@ const it = () => {
|
|
|
1100
1105
|
...f,
|
|
1101
1106
|
...I,
|
|
1102
1107
|
// add any custom field
|
|
1103
|
-
name:
|
|
1108
|
+
name: i,
|
|
1104
1109
|
thumbnail: typeof p == "string" ? p : URL.createObjectURL(p),
|
|
1105
1110
|
public: m,
|
|
1106
1111
|
description: y,
|
|
@@ -1117,33 +1122,33 @@ const it = () => {
|
|
|
1117
1122
|
});
|
|
1118
1123
|
};
|
|
1119
1124
|
const Zt = () => {
|
|
1120
|
-
const e = k(),
|
|
1125
|
+
const e = k(), t = E(), s = D(), {
|
|
1121
1126
|
user: r
|
|
1122
1127
|
} = ce(), {
|
|
1123
1128
|
appCode: n
|
|
1124
1129
|
} = M(), a = ["context", {
|
|
1125
|
-
folderId:
|
|
1126
|
-
filters:
|
|
1127
|
-
trashed:
|
|
1130
|
+
folderId: s.filters.folder,
|
|
1131
|
+
filters: s.filters,
|
|
1132
|
+
trashed: s.trashed
|
|
1128
1133
|
}];
|
|
1129
1134
|
return v({
|
|
1130
1135
|
mutationFn: async (o) => await Ve({
|
|
1131
|
-
searchParams:
|
|
1136
|
+
searchParams: s,
|
|
1132
1137
|
params: o
|
|
1133
1138
|
}),
|
|
1134
1139
|
onError(o) {
|
|
1135
1140
|
typeof o == "string" && e.error(S(o));
|
|
1136
1141
|
},
|
|
1137
1142
|
onSuccess: async (o, l) => {
|
|
1138
|
-
var f,
|
|
1139
|
-
await
|
|
1143
|
+
var f, i, p;
|
|
1144
|
+
await t.cancelQueries({
|
|
1140
1145
|
queryKey: a
|
|
1141
1146
|
});
|
|
1142
|
-
const
|
|
1143
|
-
thumbnail:
|
|
1144
|
-
} = l,
|
|
1147
|
+
const h = t.getQueryData(a), {
|
|
1148
|
+
thumbnail: d
|
|
1149
|
+
} = l, u = {
|
|
1145
1150
|
...l,
|
|
1146
|
-
thumbnail:
|
|
1151
|
+
thumbnail: d ? URL.createObjectURL(d) : "",
|
|
1147
1152
|
application: n,
|
|
1148
1153
|
assetId: o._id || o.entId || "",
|
|
1149
1154
|
id: o._id || o.entId || "",
|
|
@@ -1152,207 +1157,207 @@ const Zt = () => {
|
|
|
1152
1157
|
createdAt: Date.now(),
|
|
1153
1158
|
slug: l.slug || "",
|
|
1154
1159
|
modifiedAt: ((f = o.modified) == null ? void 0 : f.$date) || "",
|
|
1155
|
-
modifierId: ((
|
|
1160
|
+
modifierId: ((i = o.author) == null ? void 0 : i.userId) || "",
|
|
1156
1161
|
modifierName: ((p = o.author) == null ? void 0 : p.username) || "",
|
|
1157
1162
|
updatedAt: Date.now(),
|
|
1158
1163
|
trashed: !1,
|
|
1159
1164
|
rights: [`creator:${r == null ? void 0 : r.userId}`]
|
|
1160
1165
|
};
|
|
1161
|
-
if (
|
|
1162
|
-
return
|
|
1166
|
+
if (h)
|
|
1167
|
+
return t.setQueryData(a, (m) => {
|
|
1163
1168
|
if (m)
|
|
1164
1169
|
return {
|
|
1165
1170
|
...m,
|
|
1166
1171
|
pages: m == null ? void 0 : m.pages.map((y) => ({
|
|
1167
1172
|
...y,
|
|
1168
|
-
resources: [
|
|
1173
|
+
resources: [u, ...y.resources]
|
|
1169
1174
|
}))
|
|
1170
1175
|
};
|
|
1171
1176
|
});
|
|
1172
1177
|
}
|
|
1173
1178
|
});
|
|
1174
1179
|
}, dt = /* @__PURE__ */ b(async () => await import("./EmptyScreenApp.js")), ut = /* @__PURE__ */ b(async () => await import("./EmptyScreenSearch.js")), ht = /* @__PURE__ */ b(async () => await import("./EmptyScreenError.js")), ft = /* @__PURE__ */ b(async () => await import("./EmptyScreenNoContentInFolder.js")), pt = /* @__PURE__ */ b(async () => await import("./EmptyScreenTrash.js")), mt = /* @__PURE__ */ b(async () => await import("./FoldersList.js")), gt = /* @__PURE__ */ b(async () => await import("./ResourcesList.js")), yt = () => {
|
|
1175
|
-
const e = Ye(),
|
|
1180
|
+
const e = Ye(), t = re(), s = Ze(), r = D(), n = V(), a = z(), o = k(), {
|
|
1176
1181
|
appCode: l
|
|
1177
1182
|
} = M(), {
|
|
1178
|
-
t:
|
|
1183
|
+
t: h
|
|
1179
1184
|
} = j(), {
|
|
1180
|
-
setSearchParams:
|
|
1181
|
-
setSearchConfig:
|
|
1185
|
+
setSearchParams: d,
|
|
1186
|
+
setSearchConfig: u,
|
|
1182
1187
|
setTreeData: f
|
|
1183
1188
|
} = T(), {
|
|
1184
|
-
data:
|
|
1189
|
+
data: i,
|
|
1185
1190
|
isError: p,
|
|
1186
1191
|
error: m,
|
|
1187
1192
|
isLoading: y,
|
|
1188
1193
|
isFetching: g,
|
|
1189
1194
|
fetchNextPage: I
|
|
1190
|
-
} = lt(), F = (
|
|
1195
|
+
} = lt(), F = (i == null ? void 0 : i.pages[0].folders.length) === 0, Q = (i == null ? void 0 : i.pages[0].resources.length) === 0, U = F && Q;
|
|
1191
1196
|
return L(() => {
|
|
1192
1197
|
var K, R, P;
|
|
1193
|
-
if (
|
|
1194
|
-
const q = [...((K =
|
|
1195
|
-
(R =
|
|
1198
|
+
if (i) {
|
|
1199
|
+
const q = [...((K = i == null ? void 0 : i.pages[0]) == null ? void 0 : K.folders) ?? []];
|
|
1200
|
+
(R = i == null ? void 0 : i.pages[0]) != null && R.searchConfig && u(i.pages[0].searchConfig), r.search || ((n == null ? void 0 : n.id) === "default" ? f({
|
|
1196
1201
|
id: C.DEFAULT,
|
|
1197
1202
|
section: !0,
|
|
1198
1203
|
children: q.map((B) => new G(B)),
|
|
1199
|
-
name:
|
|
1204
|
+
name: h("explorer.filters.mine", {
|
|
1200
1205
|
ns: l
|
|
1201
1206
|
})
|
|
1202
|
-
}) : f(
|
|
1207
|
+
}) : f(he(a, q, r.filters.folder || C.DEFAULT))), d({
|
|
1203
1208
|
...r,
|
|
1204
|
-
pagination: (P =
|
|
1209
|
+
pagination: (P = i == null ? void 0 : i.pages[(i == null ? void 0 : i.pages.length) - 1]) == null ? void 0 : P.pagination
|
|
1205
1210
|
});
|
|
1206
1211
|
}
|
|
1207
|
-
}, [
|
|
1208
|
-
m && typeof m == "string" && o.error(
|
|
1209
|
-
}, [m]), y ? /* @__PURE__ */
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
/* @__PURE__ */
|
|
1212
|
+
}, [i]), L(() => {
|
|
1213
|
+
m && typeof m == "string" && o.error(h(m));
|
|
1214
|
+
}, [m]), y ? /* @__PURE__ */ c(A, {}) : p ? /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(ht, {}) }) : r.search && U ? /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(ut, {}) }) : e && U ? /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(dt, {}) }) : s && U && !t ? /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(ft, {}) }) : t && (i == null ? void 0 : i.pages[0].resources.length) === 0 ? /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(pt, {}) }) : /* @__PURE__ */ N(O, { fallback: /* @__PURE__ */ c(A, {}), children: [
|
|
1215
|
+
/* @__PURE__ */ c(mt, { data: i, isFetching: g }),
|
|
1216
|
+
/* @__PURE__ */ c(gt, { data: i, isFetching: g, fetchNextPage: I })
|
|
1212
1217
|
] });
|
|
1213
1218
|
}, It = () => {
|
|
1214
1219
|
const {
|
|
1215
1220
|
appCode: e,
|
|
1216
|
-
currentApp:
|
|
1221
|
+
currentApp: t
|
|
1217
1222
|
} = M(), {
|
|
1218
|
-
t
|
|
1219
|
-
} = j(), [r, n] = ae(""), a = (
|
|
1220
|
-
if (
|
|
1223
|
+
t: s
|
|
1224
|
+
} = j(), [r, n] = ae(""), a = (u) => {
|
|
1225
|
+
if (u === "0") {
|
|
1221
1226
|
n("");
|
|
1222
1227
|
return;
|
|
1223
1228
|
}
|
|
1224
|
-
n(
|
|
1225
|
-
}, o =
|
|
1226
|
-
setSearchParams:
|
|
1229
|
+
n(u);
|
|
1230
|
+
}, o = V(), l = D(), {
|
|
1231
|
+
setSearchParams: h
|
|
1227
1232
|
} = T();
|
|
1228
1233
|
L(() => {
|
|
1229
|
-
const
|
|
1230
|
-
|
|
1234
|
+
const u = () => r.includes("1") ? !0 : void 0, f = () => r.includes("2") ? !0 : void 0, i = () => r.includes("7") ? !0 : void 0;
|
|
1235
|
+
h({
|
|
1231
1236
|
...l,
|
|
1232
1237
|
filters: {
|
|
1233
|
-
owner:
|
|
1234
|
-
public:
|
|
1238
|
+
owner: u(),
|
|
1239
|
+
public: i(),
|
|
1235
1240
|
shared: f(),
|
|
1236
1241
|
folder: o ? o.id : "default"
|
|
1237
1242
|
}
|
|
1238
1243
|
});
|
|
1239
|
-
}, [o,
|
|
1240
|
-
const
|
|
1241
|
-
label:
|
|
1244
|
+
}, [o, h, r]);
|
|
1245
|
+
const d = [{
|
|
1246
|
+
label: s("explorer.filter.all", {
|
|
1242
1247
|
ns: e
|
|
1243
1248
|
}),
|
|
1244
1249
|
value: "0"
|
|
1245
1250
|
}, {
|
|
1246
|
-
label:
|
|
1251
|
+
label: s("explorer.filter.owner", {
|
|
1247
1252
|
ns: e
|
|
1248
1253
|
}),
|
|
1249
1254
|
value: "1"
|
|
1250
1255
|
}, {
|
|
1251
|
-
label:
|
|
1256
|
+
label: s("explorer.filter.shared", {
|
|
1252
1257
|
ns: e
|
|
1253
1258
|
}),
|
|
1254
1259
|
value: "2"
|
|
1255
|
-
}, ...(
|
|
1260
|
+
}, ...(t == null ? void 0 : t.displayName) == "exercizer" ? [{
|
|
1256
1261
|
label: "Exercices interactifs",
|
|
1257
1262
|
value: "3"
|
|
1258
|
-
}] : [], ...(
|
|
1263
|
+
}] : [], ...(t == null ? void 0 : t.displayName) == "exercizer" ? [{
|
|
1259
1264
|
label: "Exercices à rendre",
|
|
1260
1265
|
value: "4"
|
|
1261
|
-
}] : [], ...(
|
|
1266
|
+
}] : [], ...(t == null ? void 0 : t.displayName) == "pages" ? [{
|
|
1262
1267
|
label: "Projets publics",
|
|
1263
1268
|
value: "5"
|
|
1264
|
-
}] : [], ...(
|
|
1269
|
+
}] : [], ...(t == null ? void 0 : t.displayName) == "pages" ? [{
|
|
1265
1270
|
label: "Projets internes",
|
|
1266
1271
|
value: "6"
|
|
1267
|
-
}] : [], ...(
|
|
1268
|
-
label:
|
|
1272
|
+
}] : [], ...(t == null ? void 0 : t.displayName) == "blog" ? [{
|
|
1273
|
+
label: s("explorer.filter.public", {
|
|
1269
1274
|
ns: e
|
|
1270
1275
|
}),
|
|
1271
1276
|
value: "7"
|
|
1272
1277
|
}] : []];
|
|
1273
1278
|
return {
|
|
1274
1279
|
selectedFilters: r,
|
|
1275
|
-
options:
|
|
1280
|
+
options: d,
|
|
1276
1281
|
handleOnSelectFilter: a
|
|
1277
1282
|
};
|
|
1278
1283
|
}, wt = () => {
|
|
1279
1284
|
const {
|
|
1280
1285
|
appCode: e
|
|
1281
1286
|
} = M(), {
|
|
1282
|
-
t
|
|
1287
|
+
t
|
|
1283
1288
|
} = j(), {
|
|
1284
|
-
selectedFilters:
|
|
1289
|
+
selectedFilters: s,
|
|
1285
1290
|
options: r,
|
|
1286
1291
|
handleOnSelectFilter: n
|
|
1287
1292
|
} = It(), {
|
|
1288
1293
|
formRef: a,
|
|
1289
1294
|
inputSearch: o,
|
|
1290
1295
|
handleInputSearchChange: l,
|
|
1291
|
-
handleKeyPress:
|
|
1292
|
-
handleSearchSubmit:
|
|
1293
|
-
} =
|
|
1296
|
+
handleKeyPress: h,
|
|
1297
|
+
handleSearchSubmit: d
|
|
1298
|
+
} = fe(), u = s.length > 0 ? s.length : void 0;
|
|
1294
1299
|
return /* @__PURE__ */ N("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: a, children: [
|
|
1295
|
-
/* @__PURE__ */ N(
|
|
1296
|
-
/* @__PURE__ */
|
|
1300
|
+
/* @__PURE__ */ N(De, { id: "search", className: "input-group", children: [
|
|
1301
|
+
/* @__PURE__ */ c(Te, { type: "search", placeholder: t("explorer.label.search", {
|
|
1297
1302
|
ns: e
|
|
1298
|
-
}), size: "lg", noValidationIcon: !0, value: o, onChange: l, onKeyDown:
|
|
1299
|
-
/* @__PURE__ */
|
|
1303
|
+
}), size: "lg", noValidationIcon: !0, value: o, onChange: l, onKeyDown: h }),
|
|
1304
|
+
/* @__PURE__ */ c(be, { type: "submit", "aria-label": t("explorer.label.search", {
|
|
1300
1305
|
ns: e
|
|
1301
|
-
}), onClick:
|
|
1306
|
+
}), onClick: d })
|
|
1302
1307
|
] }),
|
|
1303
1308
|
/* @__PURE__ */ N($, { placement: "bottom-end", children: [
|
|
1304
|
-
/* @__PURE__ */
|
|
1305
|
-
/* @__PURE__ */
|
|
1306
|
-
/* @__PURE__ */
|
|
1307
|
-
/* @__PURE__ */
|
|
1308
|
-
] }, "0") : /* @__PURE__ */
|
|
1309
|
+
/* @__PURE__ */ c($.Trigger, { label: t("explorer.filters"), icon: /* @__PURE__ */ c(Qe, { width: 20 }), variant: "ghost", badgeContent: u }),
|
|
1310
|
+
/* @__PURE__ */ c($.Menu, { children: r.map((f) => f.value === "0" ? /* @__PURE__ */ N(ye, { children: [
|
|
1311
|
+
/* @__PURE__ */ c($.RadioItem, { value: f.value, model: s, onChange: () => n(f.value), children: f.label }),
|
|
1312
|
+
/* @__PURE__ */ c($.Separator, {})
|
|
1313
|
+
] }, "0") : /* @__PURE__ */ c($.RadioItem, { value: f.value, model: s, onChange: () => n(f.value), children: f.label }, f.value)) })
|
|
1309
1314
|
] })
|
|
1310
1315
|
] });
|
|
1311
1316
|
}, St = ({
|
|
1312
1317
|
id: e,
|
|
1313
|
-
selected:
|
|
1314
|
-
onSelect:
|
|
1318
|
+
selected: t,
|
|
1319
|
+
onSelect: s
|
|
1315
1320
|
}) => {
|
|
1316
1321
|
const {
|
|
1317
1322
|
t: r
|
|
1318
1323
|
} = j();
|
|
1319
|
-
return /* @__PURE__ */
|
|
1320
|
-
/* @__PURE__ */
|
|
1321
|
-
/* @__PURE__ */
|
|
1324
|
+
return /* @__PURE__ */ c("div", { className: "treeview", children: /* @__PURE__ */ c("ul", { role: "tree", className: "m-0 p-0", children: /* @__PURE__ */ c("li", { id: e, role: "treeitem", "aria-selected": t, children: /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c("div", { className: "action-container", children: /* @__PURE__ */ c("div", { onClick: s, role: "button", tabIndex: 0, children: /* @__PURE__ */ N("div", { className: "d-flex align-items-center gap-8 py-8 ps-24", children: [
|
|
1325
|
+
/* @__PURE__ */ c(qe, { width: "20", height: "20" }),
|
|
1326
|
+
/* @__PURE__ */ c("span", { children: r("explorer.tree.trash") })
|
|
1322
1327
|
] }) }) }) }) }) }) });
|
|
1323
1328
|
}, xt = /* @__PURE__ */ b(async () => await import("./FolderModal.js")), Dt = () => {
|
|
1324
|
-
const e = E(), [
|
|
1329
|
+
const e = E(), [t, s] = Fe(), r = z(), n = re(), a = se(), {
|
|
1325
1330
|
appCode: o
|
|
1326
1331
|
} = M(), {
|
|
1327
1332
|
t: l
|
|
1328
1333
|
} = j(["common", o]), {
|
|
1329
|
-
goToTrash:
|
|
1330
|
-
selectTreeItem:
|
|
1331
|
-
unfoldTreeItem:
|
|
1334
|
+
goToTrash: h,
|
|
1335
|
+
selectTreeItem: d,
|
|
1336
|
+
unfoldTreeItem: u,
|
|
1332
1337
|
foldTreeItem: f,
|
|
1333
|
-
clearSelectedItems:
|
|
1338
|
+
clearSelectedItems: i,
|
|
1334
1339
|
clearSelectedIds: p
|
|
1335
1340
|
} = T(), m = async (g) => {
|
|
1336
|
-
await
|
|
1341
|
+
await u(g, e);
|
|
1337
1342
|
}, y = () => {
|
|
1338
|
-
|
|
1343
|
+
i(), p(), s();
|
|
1339
1344
|
};
|
|
1340
1345
|
return /* @__PURE__ */ N(oe, { children: [
|
|
1341
|
-
/* @__PURE__ */
|
|
1342
|
-
/* @__PURE__ */
|
|
1343
|
-
/* @__PURE__ */
|
|
1344
|
-
/* @__PURE__ */
|
|
1346
|
+
/* @__PURE__ */ c(Ce, { data: r, selectedNodesIds: a, onTreeItemSelect: d, onTreeItemFold: f, onTreeItemUnfold: m }),
|
|
1347
|
+
/* @__PURE__ */ c(St, { id: C.BIN, selected: n, onSelect: h }),
|
|
1348
|
+
/* @__PURE__ */ c("div", { className: "d-grid my-16", children: /* @__PURE__ */ c(Ne, { disabled: n, type: "button", color: "primary", variant: "outline", leftIcon: /* @__PURE__ */ c(Oe, {}), onClick: y, children: l("explorer.folder.new") }) }),
|
|
1349
|
+
/* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: t && /* @__PURE__ */ c(xt, { edit: !1, isOpen: t, onSuccess: s, onCancel: s }) })
|
|
1345
1350
|
] });
|
|
1346
1351
|
}, Tt = /* @__PURE__ */ b(async () => await import("./AppAction.js")), bt = /* @__PURE__ */ b(async () => await import("./Library.js")), Ft = /* @__PURE__ */ b(async () => await import("./ActionBarContainer.js")), Ct = /* @__PURE__ */ b(async () => await import("./DisableModal.js")), Nt = /* @__PURE__ */ b(async () => await import("./TrashModal.js")), Rt = /* @__PURE__ */ b(async () => await import("./OnboardingModal.js")), es = ({
|
|
1347
1352
|
config: e
|
|
1348
1353
|
}) => {
|
|
1349
|
-
const
|
|
1350
|
-
setConfig:
|
|
1354
|
+
const t = D(), {
|
|
1355
|
+
setConfig: s,
|
|
1351
1356
|
setSearchParams: r
|
|
1352
1357
|
} = T();
|
|
1353
1358
|
L(() => {
|
|
1354
|
-
|
|
1355
|
-
...
|
|
1359
|
+
s(e || {}), r({
|
|
1360
|
+
...t,
|
|
1356
1361
|
application: e.app,
|
|
1357
1362
|
types: e.types
|
|
1358
1363
|
});
|
|
@@ -1365,26 +1370,26 @@ const Zt = () => {
|
|
|
1365
1370
|
isTrashedModalOpen: o,
|
|
1366
1371
|
onTrashedCancel: l
|
|
1367
1372
|
} = rt(), {
|
|
1368
|
-
isActionDisableModalOpen:
|
|
1369
|
-
onActionDisableCancel:
|
|
1373
|
+
isActionDisableModalOpen: h,
|
|
1374
|
+
onActionDisableCancel: d
|
|
1370
1375
|
} = st();
|
|
1371
|
-
|
|
1372
|
-
const
|
|
1376
|
+
Re();
|
|
1377
|
+
const u = ne("publish", a), f = ne("create", a);
|
|
1373
1378
|
return e && /* @__PURE__ */ N(oe, { children: [
|
|
1374
|
-
/* @__PURE__ */
|
|
1379
|
+
/* @__PURE__ */ c(Pe, { render: () => f ? /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(Tt, {}) }) : null, children: /* @__PURE__ */ c(Ae, { app: n }) }),
|
|
1375
1380
|
/* @__PURE__ */ N(ee, { className: "flex-grow-1", children: [
|
|
1376
|
-
/* @__PURE__ */
|
|
1377
|
-
/* @__PURE__ */
|
|
1378
|
-
|
|
1381
|
+
/* @__PURE__ */ c(ee.Col, { sm: "3", lg: "2", xl: "3", className: "border-end pt-16 pe-16 d-none d-lg-block", as: "aside", children: /* @__PURE__ */ N(O, { fallback: /* @__PURE__ */ c(A, {}), children: [
|
|
1382
|
+
/* @__PURE__ */ c(Dt, {}),
|
|
1383
|
+
u && /* @__PURE__ */ c(bt, {})
|
|
1379
1384
|
] }) }),
|
|
1380
1385
|
/* @__PURE__ */ N(ee.Col, { sm: "4", md: "8", lg: "6", xl: "9", children: [
|
|
1381
|
-
/* @__PURE__ */
|
|
1382
|
-
/* @__PURE__ */
|
|
1383
|
-
/* @__PURE__ */
|
|
1386
|
+
/* @__PURE__ */ c(wt, {}),
|
|
1387
|
+
/* @__PURE__ */ c(tt, {}),
|
|
1388
|
+
/* @__PURE__ */ c(yt, {})
|
|
1384
1389
|
] }),
|
|
1385
|
-
/* @__PURE__ */ N(O, { fallback: /* @__PURE__ */
|
|
1386
|
-
/* @__PURE__ */
|
|
1387
|
-
/* @__PURE__ */
|
|
1390
|
+
/* @__PURE__ */ N(O, { fallback: /* @__PURE__ */ c(A, {}), children: [
|
|
1391
|
+
/* @__PURE__ */ c(Ft, {}),
|
|
1392
|
+
/* @__PURE__ */ c(Rt, { id: "showOnboardingTrash", items: [{
|
|
1388
1393
|
src: "onboarding/illu-trash-menu.svg",
|
|
1389
1394
|
alt: "explorer.modal.onboarding.trash.screen1.alt",
|
|
1390
1395
|
text: "explorer.modal.onboarding.trash.screen1.title"
|
|
@@ -1402,8 +1407,8 @@ const Zt = () => {
|
|
|
1402
1407
|
nextText: "explorer.modal.onboarding.trash.next",
|
|
1403
1408
|
closeText: "explorer.modal.onboarding.trash.close"
|
|
1404
1409
|
} }),
|
|
1405
|
-
o && /* @__PURE__ */
|
|
1406
|
-
|
|
1410
|
+
o && /* @__PURE__ */ c(Nt, { isOpen: o, onCancel: l }),
|
|
1411
|
+
h && /* @__PURE__ */ c(Ct, { isOpen: h, onCancel: d })
|
|
1407
1412
|
] })
|
|
1408
1413
|
] })
|
|
1409
1414
|
] });
|
|
@@ -1411,7 +1416,7 @@ const Zt = () => {
|
|
|
1411
1416
|
export {
|
|
1412
1417
|
es as E,
|
|
1413
1418
|
it as a,
|
|
1414
|
-
|
|
1419
|
+
V as b,
|
|
1415
1420
|
Zt as c,
|
|
1416
1421
|
D as d,
|
|
1417
1422
|
re as e,
|