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