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