ode-explorer 1.4.8 → 1.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2937 -607
- package/dist/version.txt +1 -1
- package/lib/ActionBarContainer.js +198 -199
- package/lib/DeleteModal.js +3 -3
- package/lib/FolderModal.js +22 -23
- package/lib/Library.js +1 -1
- package/lib/MoveModal.js +6 -6
- package/lib/ResourcesList.js +207 -71
- package/lib/features/ActionBar/useActionBar.d.ts +1 -4
- package/lib/index2.js +249 -250
- package/package.json +21 -7
- package/lib/ExportModal.js +0 -53
- package/lib/features/ActionBar/Export/ExportModal.d.ts +0 -11
- package/lib/features/ActionBar/Export/useExportModal.d.ts +0 -3
package/lib/index2.js
CHANGED
|
@@ -2,16 +2,16 @@ var ge = Object.defineProperty;
|
|
|
2
2
|
var ye = (e, s, t) => s in e ? ge(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
|
|
3
3
|
var $ = (e, s, t) => (ye(e, typeof s != "symbol" ? s + "" : s, t), t);
|
|
4
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,
|
|
6
|
-
import { useScrollToTop as
|
|
7
|
-
import { ArrowLeft as
|
|
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
|
|
10
|
-
import { t as
|
|
11
|
-
import { create as
|
|
12
|
-
import { useQuery as Me, useInfiniteQuery as Ke, useQueryClient as E, useMutation as
|
|
9
|
+
import { odeServices as x, FOLDER as T, SORT_ORDER as ve } from "edifice-ts-client";
|
|
10
|
+
import { t as S } from "i18next";
|
|
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
13
|
const de = async (e) => {
|
|
14
|
-
const s = await
|
|
14
|
+
const s = await x.resource(e.application).searchContext(e);
|
|
15
15
|
return {
|
|
16
16
|
...s,
|
|
17
17
|
folders: s.folders.filter((t) => !t.trashed)
|
|
@@ -27,7 +27,7 @@ const de = async (e) => {
|
|
|
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
|
}, _e = async ({
|
|
32
32
|
folderId: e,
|
|
33
33
|
searchParams: s,
|
|
@@ -41,7 +41,7 @@ const de = async (e) => {
|
|
|
41
41
|
application: s.application,
|
|
42
42
|
type: s.types[0]
|
|
43
43
|
};
|
|
44
|
-
return await
|
|
44
|
+
return await x.resource(s.application).updateFolder(n);
|
|
45
45
|
}, $e = async ({
|
|
46
46
|
searchParams: e,
|
|
47
47
|
resourceIds: s,
|
|
@@ -54,7 +54,7 @@ const de = async (e) => {
|
|
|
54
54
|
resourceIds: s,
|
|
55
55
|
folderIds: r
|
|
56
56
|
};
|
|
57
|
-
return await
|
|
57
|
+
return await x.resource(e.application).trashAll(n, t);
|
|
58
58
|
}, ze = async ({
|
|
59
59
|
searchParams: e,
|
|
60
60
|
resourceIds: s,
|
|
@@ -67,7 +67,7 @@ const de = async (e) => {
|
|
|
67
67
|
resourceIds: s,
|
|
68
68
|
folderIds: r
|
|
69
69
|
};
|
|
70
|
-
return await
|
|
70
|
+
return await x.resource(e.application).deleteAll(n, t);
|
|
71
71
|
}, je = async ({
|
|
72
72
|
searchParams: e,
|
|
73
73
|
resourceIds: s,
|
|
@@ -80,8 +80,8 @@ const de = async (e) => {
|
|
|
80
80
|
resourceIds: s,
|
|
81
81
|
folderIds: t
|
|
82
82
|
};
|
|
83
|
-
return await
|
|
84
|
-
}, Ve = async (e, s) => await
|
|
83
|
+
return await x.resource(e.application).restoreAll(n, r);
|
|
84
|
+
}, Ve = async (e, s) => await x.resource(e.application).copy({
|
|
85
85
|
application: e.application,
|
|
86
86
|
resourceId: s
|
|
87
87
|
}), ue = async ({
|
|
@@ -97,39 +97,40 @@ const de = async (e) => {
|
|
|
97
97
|
resourceIds: s,
|
|
98
98
|
folderIds: r
|
|
99
99
|
};
|
|
100
|
-
return await
|
|
101
|
-
}
|
|
100
|
+
return await x.resource(e.application).moveToFolder(a, n);
|
|
101
|
+
};
|
|
102
|
+
const He = async (e) => await x.rights().sessionHasWorkflowRights(e), We = ({
|
|
102
103
|
searchParams: e,
|
|
103
104
|
assetId: s
|
|
104
105
|
}) => {
|
|
105
|
-
const t =
|
|
106
|
+
const t = x.resource(e.application).getViewUrl(s);
|
|
106
107
|
window.open(t, "_self");
|
|
107
|
-
},
|
|
108
|
+
}, Je = ({
|
|
108
109
|
searchParams: e,
|
|
109
110
|
params: s
|
|
110
|
-
}) =>
|
|
111
|
+
}) => x.resource(e.application).create(s), Ge = ({
|
|
111
112
|
searchParams: e,
|
|
112
113
|
assetId: s
|
|
113
114
|
}) => {
|
|
114
|
-
const t =
|
|
115
|
+
const t = x.resource(e.application).getPrintUrl(s);
|
|
115
116
|
return window.open(t, "_blank");
|
|
116
117
|
}, $t = ({
|
|
117
118
|
searchParams: e,
|
|
118
119
|
folderId: s
|
|
119
120
|
}) => {
|
|
120
|
-
const t =
|
|
121
|
+
const t = x.resource(e.application).getFormUrl(s);
|
|
121
122
|
return window.open(t, "_self");
|
|
122
123
|
}, zt = ({
|
|
123
124
|
searchParams: e,
|
|
124
125
|
assetId: s
|
|
125
126
|
}) => {
|
|
126
|
-
const t =
|
|
127
|
+
const t = x.resource(e.application).getEditUrl(s);
|
|
127
128
|
return window.open(t, "_self");
|
|
128
129
|
}, jt = ({
|
|
129
130
|
searchParams: e,
|
|
130
131
|
assetId: s
|
|
131
132
|
}) => {
|
|
132
|
-
const t =
|
|
133
|
+
const t = x.resource(e.application).getExportUrl(s);
|
|
133
134
|
return window.open(t, "_self");
|
|
134
135
|
};
|
|
135
136
|
function se(e) {
|
|
@@ -143,12 +144,12 @@ function W(e, s) {
|
|
|
143
144
|
function Xe(e, s) {
|
|
144
145
|
var r;
|
|
145
146
|
const t = W(e, s);
|
|
146
|
-
return (r = t == null ? void 0 : t.folder) != null && r.ancestors ? [...(t == null ? void 0 : t.folder.ancestors) || [], e] : e ===
|
|
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];
|
|
147
148
|
}
|
|
148
149
|
function fe(e, s) {
|
|
149
150
|
return s.id === e && s.children ? s.children.length > 0 : s.children ? s.children.some((t) => fe(s.id, t)) : !1;
|
|
150
151
|
}
|
|
151
|
-
function
|
|
152
|
+
function J(e, s) {
|
|
152
153
|
return he(e, s) || e;
|
|
153
154
|
}
|
|
154
155
|
function he(e, s, t) {
|
|
@@ -157,8 +158,8 @@ function he(e, s, t) {
|
|
|
157
158
|
if ((n = r == null ? void 0 : r.children) != null && n.length) {
|
|
158
159
|
const a = [];
|
|
159
160
|
for (const o of (r == null ? void 0 : r.children) || []) {
|
|
160
|
-
const
|
|
161
|
-
|
|
161
|
+
const l = he(o, s, r);
|
|
162
|
+
l && a.push(l);
|
|
162
163
|
}
|
|
163
164
|
return {
|
|
164
165
|
...r,
|
|
@@ -167,7 +168,7 @@ function he(e, s, t) {
|
|
|
167
168
|
}
|
|
168
169
|
return r;
|
|
169
170
|
}
|
|
170
|
-
class
|
|
171
|
+
class G {
|
|
171
172
|
constructor(s) {
|
|
172
173
|
$(this, "id");
|
|
173
174
|
$(this, "name");
|
|
@@ -177,20 +178,20 @@ class J {
|
|
|
177
178
|
this.folder = s, this.id = s.id, this.name = s.name, this.childNumber = s.childNumber;
|
|
178
179
|
}
|
|
179
180
|
}
|
|
180
|
-
const pe = (e, s, t) =>
|
|
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 = {
|
|
181
182
|
config: null,
|
|
182
183
|
searchConfig: {
|
|
183
184
|
minLength: 1
|
|
184
185
|
},
|
|
185
186
|
searchParams: {
|
|
186
187
|
filters: {
|
|
187
|
-
folder:
|
|
188
|
+
folder: T.DEFAULT,
|
|
188
189
|
owner: void 0,
|
|
189
190
|
shared: void 0,
|
|
190
191
|
public: void 0
|
|
191
192
|
},
|
|
192
193
|
orders: {
|
|
193
|
-
updatedAt:
|
|
194
|
+
updatedAt: ve.DESC
|
|
194
195
|
},
|
|
195
196
|
application: "",
|
|
196
197
|
types: [],
|
|
@@ -202,8 +203,8 @@ const pe = (e, s, t) => G(e, (r) => (r.id === t && (r.children = s == null ? voi
|
|
|
202
203
|
trashed: !1
|
|
203
204
|
},
|
|
204
205
|
treeData: {
|
|
205
|
-
id:
|
|
206
|
-
name:
|
|
206
|
+
id: T.DEFAULT,
|
|
207
|
+
name: S("explorer.filters.mine"),
|
|
207
208
|
section: !0,
|
|
208
209
|
children: []
|
|
209
210
|
},
|
|
@@ -218,7 +219,7 @@ const pe = (e, s, t) => G(e, (r) => (r.id === t && (r.children = s == null ? voi
|
|
|
218
219
|
resourceIsTrash: !1,
|
|
219
220
|
resourceActionDisable: !1,
|
|
220
221
|
status: void 0
|
|
221
|
-
},
|
|
222
|
+
}, w = Le()((e, s) => ({
|
|
222
223
|
...Ye,
|
|
223
224
|
updaters: {
|
|
224
225
|
setConfig: (t) => e({
|
|
@@ -329,7 +330,7 @@ const pe = (e, s, t) => G(e, (r) => (r.id === t && (r.children = s == null ? voi
|
|
|
329
330
|
if (r.length !== 1)
|
|
330
331
|
throw new Error("Cannot open more than 1 resource");
|
|
331
332
|
const a = r.find((o) => o.id === n[0]);
|
|
332
|
-
|
|
333
|
+
Ge({
|
|
333
334
|
searchParams: t,
|
|
334
335
|
assetId: a.assetId
|
|
335
336
|
});
|
|
@@ -344,7 +345,7 @@ const pe = (e, s, t) => G(e, (r) => (r.id === t && (r.children = s == null ? voi
|
|
|
344
345
|
const {
|
|
345
346
|
searchParams: n,
|
|
346
347
|
treeData: a
|
|
347
|
-
} = s(), o = n.filters.folder,
|
|
348
|
+
} = s(), o = n.filters.folder, l = Xe(t, a), f = se([...l, t]);
|
|
348
349
|
o !== t && e((d) => ({
|
|
349
350
|
...d,
|
|
350
351
|
// reset selection when changing folder
|
|
@@ -361,7 +362,7 @@ const pe = (e, s, t) => G(e, (r) => (r.id === t && (r.children = s == null ? voi
|
|
|
361
362
|
...n.filters,
|
|
362
363
|
folder: t
|
|
363
364
|
},
|
|
364
|
-
trashed: t ===
|
|
365
|
+
trashed: t === T.BIN
|
|
365
366
|
}
|
|
366
367
|
}));
|
|
367
368
|
},
|
|
@@ -396,11 +397,11 @@ const pe = (e, s, t) => G(e, (r) => (r.id === t && (r.children = s == null ? voi
|
|
|
396
397
|
folderId: t,
|
|
397
398
|
trashed: !1
|
|
398
399
|
}]);
|
|
399
|
-
e((
|
|
400
|
+
e((l) => {
|
|
400
401
|
var f;
|
|
401
402
|
return {
|
|
402
|
-
...
|
|
403
|
-
treeData: pe(n, (f = o == null ? void 0 : o.pages[0]) == null ? void 0 : f.folders, t ||
|
|
403
|
+
...l,
|
|
404
|
+
treeData: pe(n, (f = o == null ? void 0 : o.pages[0]) == null ? void 0 : f.folders, t || T.DEFAULT)
|
|
404
405
|
};
|
|
405
406
|
});
|
|
406
407
|
}
|
|
@@ -411,10 +412,10 @@ const pe = (e, s, t) => G(e, (r) => (r.id === t && (r.children = s == null ? voi
|
|
|
411
412
|
} = s(), {
|
|
412
413
|
openFolder: n
|
|
413
414
|
} = s().updaters, a = W(t, r);
|
|
414
|
-
|
|
415
|
-
...
|
|
415
|
+
Se()(), e((l) => ({
|
|
416
|
+
...l,
|
|
416
417
|
searchParams: {
|
|
417
|
-
...
|
|
418
|
+
...l.searchParams,
|
|
418
419
|
search: void 0
|
|
419
420
|
},
|
|
420
421
|
status: "select",
|
|
@@ -436,7 +437,7 @@ const pe = (e, s, t) => G(e, (r) => (r.id === t && (r.children = s == null ? voi
|
|
|
436
437
|
const o = W(t[a - 2], r);
|
|
437
438
|
n({
|
|
438
439
|
folder: o,
|
|
439
|
-
folderId: (o == null ? void 0 : o.id) ||
|
|
440
|
+
folderId: (o == null ? void 0 : o.id) || T.DEFAULT
|
|
440
441
|
});
|
|
441
442
|
},
|
|
442
443
|
goToTrash: () => e((t) => ({
|
|
@@ -450,25 +451,25 @@ const pe = (e, s, t) => G(e, (r) => (r.id === t && (r.children = s == null ? voi
|
|
|
450
451
|
...t.searchParams,
|
|
451
452
|
search: void 0,
|
|
452
453
|
filters: {
|
|
453
|
-
folder:
|
|
454
|
+
folder: T.BIN
|
|
454
455
|
},
|
|
455
456
|
trashed: !0
|
|
456
457
|
},
|
|
457
458
|
currentFolder: {
|
|
458
|
-
id:
|
|
459
|
+
id: T.BIN
|
|
459
460
|
}
|
|
460
461
|
}))
|
|
461
462
|
}
|
|
462
|
-
})),
|
|
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 = () => {
|
|
463
464
|
const e = H();
|
|
464
|
-
return (e == null ? void 0 : e.id) ===
|
|
465
|
-
}, et = () =>
|
|
465
|
+
return (e == null ? void 0 : e.id) === T.BIN;
|
|
466
|
+
}, et = () => w((e) => e.resourceIsTrash), tt = () => w((e) => e.resourceActionDisable), st = () => {
|
|
466
467
|
const e = H();
|
|
467
468
|
return (e == null ? void 0 : e.id) === "default";
|
|
468
|
-
}, rt = () => re().length > 1, nt = () =>
|
|
469
|
-
const e =
|
|
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), {
|
|
470
471
|
setSearchParams: o
|
|
471
|
-
} =
|
|
472
|
+
} = b(), l = (u) => {
|
|
472
473
|
const h = u.target.value;
|
|
473
474
|
t(h.toString());
|
|
474
475
|
}, f = (u) => {
|
|
@@ -498,7 +499,7 @@ const pe = (e, s, t) => G(e, (r) => (r.id === t && (r.children = s == null ? voi
|
|
|
498
499
|
}, [e]), {
|
|
499
500
|
formRef: a,
|
|
500
501
|
inputSearch: s,
|
|
501
|
-
handleInputSearchChange:
|
|
502
|
+
handleInputSearchChange: l,
|
|
502
503
|
handleKeyPress: f,
|
|
503
504
|
handleSearchSubmit: d
|
|
504
505
|
};
|
|
@@ -508,24 +509,24 @@ function ot() {
|
|
|
508
509
|
appCode: e
|
|
509
510
|
} = K(), {
|
|
510
511
|
gotoPreviousFolder: s
|
|
511
|
-
} =
|
|
512
|
+
} = b(), {
|
|
512
513
|
t
|
|
513
|
-
} = j(
|
|
514
|
+
} = j(), {
|
|
514
515
|
inputSearch: r
|
|
515
|
-
} = me(), n = re(), a = ne(), o = H(),
|
|
516
|
+
} = me(), n = re(), a = ne(), o = H(), l = t("explorer.tree.trash"), f = t("explorer.tree.search"), d = t("explorer.filters.mine", {
|
|
516
517
|
ns: e
|
|
517
518
|
}), u = (o == null ? void 0 : o.name) || d;
|
|
518
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: [
|
|
519
|
-
/* @__PURE__ */ c(xe, { icon: /* @__PURE__ */ c(
|
|
520
|
+
/* @__PURE__ */ c(xe, { icon: /* @__PURE__ */ c(Oe, {}), variant: "ghost", color: "tertiary", "aria-label": t("back"), className: "ms-n16", onClick: s }),
|
|
520
521
|
/* @__PURE__ */ c("p", { className: "body py-8 text-truncate", children: /* @__PURE__ */ c("strong", { children: u }) })
|
|
521
|
-
] }) : /* @__PURE__ */ c("h2", { className: "body py-8 fw-bold", children: r.length !== 0 ? f : a ?
|
|
522
|
+
] }) : /* @__PURE__ */ c("h2", { className: "body py-8 fw-bold", children: r.length !== 0 ? f : a ? l : d }) });
|
|
522
523
|
}
|
|
523
524
|
const at = () => {
|
|
524
525
|
const e = tt(), {
|
|
525
526
|
clearSelectedIds: s,
|
|
526
527
|
setResourceActionDisable: t,
|
|
527
528
|
clearSelectedItems: r
|
|
528
|
-
} =
|
|
529
|
+
} = b();
|
|
529
530
|
return {
|
|
530
531
|
isActionDisableModalOpen: e,
|
|
531
532
|
onActionDisableCancel: () => {
|
|
@@ -537,7 +538,7 @@ const at = () => {
|
|
|
537
538
|
clearSelectedIds: s,
|
|
538
539
|
setResourceIsTrash: t,
|
|
539
540
|
clearSelectedItems: r
|
|
540
|
-
} =
|
|
541
|
+
} = b();
|
|
541
542
|
return {
|
|
542
543
|
isTrashedModalOpen: e,
|
|
543
544
|
onTrashedCancel: () => {
|
|
@@ -549,13 +550,13 @@ function it(e, {
|
|
|
549
550
|
parentId: s,
|
|
550
551
|
newFolder: t
|
|
551
552
|
}) {
|
|
552
|
-
return
|
|
553
|
+
return J(e, (r) => {
|
|
553
554
|
var n;
|
|
554
555
|
if (r.id === s) {
|
|
555
556
|
const a = [...((n = r.folder) == null ? void 0 : n.ancestors) || []], o = se([...a, r.id]);
|
|
556
557
|
return {
|
|
557
558
|
...r,
|
|
558
|
-
children: [...r.children || [], new
|
|
559
|
+
children: [...r.children || [], new G({
|
|
559
560
|
...t,
|
|
560
561
|
ancestors: o
|
|
561
562
|
})]
|
|
@@ -567,7 +568,7 @@ function it(e, {
|
|
|
567
568
|
function lt(e, {
|
|
568
569
|
folders: s
|
|
569
570
|
}) {
|
|
570
|
-
return
|
|
571
|
+
return J(e, (t) => {
|
|
571
572
|
if (!s.includes(t.id))
|
|
572
573
|
return t;
|
|
573
574
|
});
|
|
@@ -576,13 +577,13 @@ function dt(e, {
|
|
|
576
577
|
destinationId: s,
|
|
577
578
|
folders: t
|
|
578
579
|
}) {
|
|
579
|
-
return
|
|
580
|
+
return J(e, (r, n) => {
|
|
580
581
|
var a, o;
|
|
581
582
|
if (s === r.id) {
|
|
582
|
-
const
|
|
583
|
-
for (const
|
|
584
|
-
if (!u.includes(
|
|
585
|
-
const p = W(
|
|
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)
|
|
585
|
+
if (!u.includes(i)) {
|
|
586
|
+
const p = W(i, e);
|
|
586
587
|
p && d.push({
|
|
587
588
|
...p,
|
|
588
589
|
folder: {
|
|
@@ -603,10 +604,10 @@ function ut(e, {
|
|
|
603
604
|
folderId: s,
|
|
604
605
|
newFolder: t
|
|
605
606
|
}) {
|
|
606
|
-
return
|
|
607
|
+
return J(e, (r) => r.id === s ? new G(t) : r);
|
|
607
608
|
}
|
|
608
609
|
const ft = () => {
|
|
609
|
-
const e =
|
|
610
|
+
const e = w((s) => s.config);
|
|
610
611
|
return Me({
|
|
611
612
|
queryKey: ["actions"],
|
|
612
613
|
queryFn: async () => {
|
|
@@ -621,7 +622,7 @@ const ft = () => {
|
|
|
621
622
|
enabled: !!e
|
|
622
623
|
});
|
|
623
624
|
}, ht = () => {
|
|
624
|
-
const e =
|
|
625
|
+
const e = w((o) => o.config), s = D(), {
|
|
625
626
|
filters: t,
|
|
626
627
|
trashed: r,
|
|
627
628
|
search: n
|
|
@@ -651,12 +652,12 @@ const ft = () => {
|
|
|
651
652
|
getNextPageParam: (o) => o.pagination.startIdx + o.pagination.pageSize
|
|
652
653
|
});
|
|
653
654
|
}, Wt = () => {
|
|
654
|
-
const e =
|
|
655
|
+
const e = U(), s = E(), t = D(), r = V(), n = X(), a = Z(), o = Y(), l = ee().length > 0, f = l ? a : o, {
|
|
655
656
|
clearSelectedItems: d,
|
|
656
657
|
clearSelectedIds: u,
|
|
657
658
|
setTreeData: h,
|
|
658
|
-
setSearchParams:
|
|
659
|
-
} =
|
|
659
|
+
setSearchParams: i
|
|
660
|
+
} = b(), {
|
|
660
661
|
filters: p,
|
|
661
662
|
trashed: m
|
|
662
663
|
} = t, y = ["context", {
|
|
@@ -664,49 +665,49 @@ const ft = () => {
|
|
|
664
665
|
filters: p,
|
|
665
666
|
trashed: m
|
|
666
667
|
}];
|
|
667
|
-
return
|
|
668
|
+
return v({
|
|
668
669
|
mutationFn: async () => await $e({
|
|
669
670
|
searchParams: t,
|
|
670
671
|
folderIds: n,
|
|
671
672
|
resourceIds: f,
|
|
672
|
-
useAssetIds:
|
|
673
|
+
useAssetIds: l
|
|
673
674
|
}),
|
|
674
675
|
onError(g) {
|
|
675
|
-
typeof g == "string" && e.error(
|
|
676
|
+
typeof g == "string" && e.error(S(g));
|
|
676
677
|
},
|
|
677
678
|
onSuccess: async (g) => {
|
|
678
679
|
if (await s.cancelQueries({
|
|
679
680
|
queryKey: y
|
|
680
681
|
}), s.getQueryData(y))
|
|
681
|
-
return e.success(
|
|
682
|
+
return e.success(S("explorer.trash.title")), s.setQueryData(y, (C) => {
|
|
682
683
|
var Q;
|
|
683
684
|
if (C) {
|
|
684
|
-
const
|
|
685
|
+
const k = {
|
|
685
686
|
...C,
|
|
686
687
|
pages: C == null ? void 0 : C.pages.map((R) => {
|
|
687
688
|
var P;
|
|
688
689
|
return {
|
|
689
690
|
...R,
|
|
690
|
-
folders: R.folders.filter((
|
|
691
|
+
folders: R.folders.filter((O) => !n.includes(O.id)),
|
|
691
692
|
pagination: {
|
|
692
693
|
...R.pagination,
|
|
693
694
|
// @ts-ignore
|
|
694
695
|
maxIdx: ((P = R == null ? void 0 : R.pagination) == null ? void 0 : P.maxIdx) - g.resources.length
|
|
695
696
|
},
|
|
696
|
-
resources: R.resources.filter((
|
|
697
|
+
resources: R.resources.filter((O) => l ? !a.includes(O.assetId) : !f.includes(O.id))
|
|
697
698
|
};
|
|
698
699
|
})
|
|
699
700
|
}, B = lt(r, {
|
|
700
701
|
folders: n
|
|
701
702
|
});
|
|
702
|
-
return h(B),
|
|
703
|
+
return h(B), i({
|
|
703
704
|
...t,
|
|
704
705
|
pagination: {
|
|
705
706
|
...t.pagination,
|
|
706
707
|
// @ts-ignore
|
|
707
708
|
maxIdx: ((Q = t.pagination) == null ? void 0 : Q.maxIdx) - g.resources.length
|
|
708
709
|
}
|
|
709
|
-
}),
|
|
710
|
+
}), k;
|
|
710
711
|
}
|
|
711
712
|
});
|
|
712
713
|
},
|
|
@@ -714,42 +715,42 @@ const ft = () => {
|
|
|
714
715
|
d(), u();
|
|
715
716
|
}
|
|
716
717
|
});
|
|
717
|
-
},
|
|
718
|
-
const e =
|
|
718
|
+
}, Jt = () => {
|
|
719
|
+
const e = U(), s = E(), t = D(), r = X(), n = Z(), a = Y(), o = ee().length > 0, l = o ? n : a, {
|
|
719
720
|
setFolderIds: f,
|
|
720
721
|
setResourceIds: d,
|
|
721
722
|
setSelectedResources: u,
|
|
722
723
|
setSelectedFolders: h
|
|
723
|
-
} =
|
|
724
|
-
filters:
|
|
724
|
+
} = b(), {
|
|
725
|
+
filters: i,
|
|
725
726
|
trashed: p
|
|
726
727
|
} = t, m = ["context", {
|
|
727
|
-
folderId:
|
|
728
|
-
filters:
|
|
728
|
+
folderId: i.folder,
|
|
729
|
+
filters: i,
|
|
729
730
|
trashed: p
|
|
730
731
|
}];
|
|
731
|
-
return
|
|
732
|
+
return v({
|
|
732
733
|
mutationFn: async () => await je({
|
|
733
734
|
searchParams: t,
|
|
734
735
|
folderIds: r,
|
|
735
|
-
resourceIds:
|
|
736
|
+
resourceIds: l,
|
|
736
737
|
useAssetIds: o
|
|
737
738
|
}),
|
|
738
739
|
onError(y) {
|
|
739
|
-
typeof y == "string" && e.error(
|
|
740
|
+
typeof y == "string" && e.error(S(y));
|
|
740
741
|
},
|
|
741
742
|
onSuccess: async () => {
|
|
742
743
|
if (await s.cancelQueries({
|
|
743
744
|
queryKey: m
|
|
744
745
|
}), s.getQueryData(m))
|
|
745
|
-
return e.success(
|
|
746
|
+
return e.success(S("explorer.trash.toast")), s.setQueryData(m, (g) => {
|
|
746
747
|
if (g)
|
|
747
748
|
return {
|
|
748
749
|
...g,
|
|
749
750
|
pages: g == null ? void 0 : g.pages.map((I) => ({
|
|
750
751
|
...I,
|
|
751
752
|
folders: I.folders.filter((C) => !r.includes(C.id)),
|
|
752
|
-
resources: I.resources.filter((C) => o ? !n.includes(C.assetId) : !
|
|
753
|
+
resources: I.resources.filter((C) => o ? !n.includes(C.assetId) : !l.includes(C.id))
|
|
753
754
|
}))
|
|
754
755
|
};
|
|
755
756
|
});
|
|
@@ -758,40 +759,40 @@ const ft = () => {
|
|
|
758
759
|
d([]), u([]), f([]), h([]);
|
|
759
760
|
}
|
|
760
761
|
});
|
|
761
|
-
},
|
|
762
|
-
const e =
|
|
762
|
+
}, Gt = () => {
|
|
763
|
+
const e = U(), s = E(), t = D(), r = X(), n = Z(), a = Y(), o = ee().length > 0, l = o ? n : a, {
|
|
763
764
|
clearSelectedItems: f,
|
|
764
765
|
clearSelectedIds: d
|
|
765
|
-
} =
|
|
766
|
+
} = b(), {
|
|
766
767
|
filters: u,
|
|
767
768
|
trashed: h
|
|
768
|
-
} = t,
|
|
769
|
+
} = t, i = ["context", {
|
|
769
770
|
folderId: u.folder,
|
|
770
771
|
filters: u,
|
|
771
772
|
trashed: h
|
|
772
773
|
}];
|
|
773
|
-
return
|
|
774
|
+
return v({
|
|
774
775
|
mutationFn: async () => await ze({
|
|
775
776
|
searchParams: t,
|
|
776
777
|
folderIds: r,
|
|
777
|
-
resourceIds:
|
|
778
|
+
resourceIds: l,
|
|
778
779
|
useAssetIds: o
|
|
779
780
|
}),
|
|
780
781
|
onError(p) {
|
|
781
|
-
typeof p == "string" && e.error(
|
|
782
|
+
typeof p == "string" && e.error(S(p));
|
|
782
783
|
},
|
|
783
784
|
onSuccess: async () => {
|
|
784
785
|
if (await s.cancelQueries({
|
|
785
|
-
queryKey:
|
|
786
|
-
}), s.getQueryData(
|
|
787
|
-
return e.success(
|
|
786
|
+
queryKey: i
|
|
787
|
+
}), s.getQueryData(i))
|
|
788
|
+
return e.success(S("explorer.removed.from.trash")), s.setQueryData(i, (m) => {
|
|
788
789
|
if (m)
|
|
789
790
|
return {
|
|
790
791
|
...m,
|
|
791
792
|
pages: m == null ? void 0 : m.pages.map((g) => ({
|
|
792
793
|
...g,
|
|
793
794
|
folders: g.folders.filter((I) => !r.includes(I.id)),
|
|
794
|
-
resources: g.resources.filter((I) => o ? !n.includes(I.assetId) : !
|
|
795
|
+
resources: g.resources.filter((I) => o ? !n.includes(I.assetId) : !l.includes(I.id))
|
|
795
796
|
}))
|
|
796
797
|
};
|
|
797
798
|
});
|
|
@@ -801,27 +802,27 @@ const ft = () => {
|
|
|
801
802
|
}
|
|
802
803
|
});
|
|
803
804
|
}, Xt = () => {
|
|
804
|
-
const e =
|
|
805
|
+
const e = U(), s = D(), t = E(), {
|
|
805
806
|
user: r
|
|
806
807
|
} = le(), n = H(), {
|
|
807
808
|
filters: a,
|
|
808
809
|
trashed: o
|
|
809
|
-
} = s,
|
|
810
|
+
} = s, l = "duplicate_start", f = ["context", {
|
|
810
811
|
folderId: a.folder,
|
|
811
812
|
filters: a,
|
|
812
813
|
trashed: o
|
|
813
814
|
}];
|
|
814
|
-
return
|
|
815
|
-
mutationFn: async (d) => (e.info(
|
|
816
|
-
id:
|
|
815
|
+
return v({
|
|
816
|
+
mutationFn: async (d) => (e.info(S("duplicate.start"), {
|
|
817
|
+
id: l
|
|
817
818
|
}), await Ve(s, d.assetId)),
|
|
818
819
|
onSuccess: async (d, u) => {
|
|
819
|
-
e.remove(
|
|
820
|
+
e.remove(l), e.success(S("duplicate.done")), await t.cancelQueries({
|
|
820
821
|
queryKey: f
|
|
821
822
|
});
|
|
822
|
-
const h = t.getQueryData(f),
|
|
823
|
+
const h = t.getQueryData(f), i = {
|
|
823
824
|
...u,
|
|
824
|
-
name: `${u.name}${
|
|
825
|
+
name: `${u.name}${S("duplicate.suffix")}`,
|
|
825
826
|
assetId: d.duplicateId,
|
|
826
827
|
id: d.duplicateId,
|
|
827
828
|
creatorId: r == null ? void 0 : r.userId,
|
|
@@ -841,10 +842,10 @@ const ft = () => {
|
|
|
841
842
|
...p,
|
|
842
843
|
pages: p == null ? void 0 : p.pages.map((m) => ({
|
|
843
844
|
...m,
|
|
844
|
-
resources: [
|
|
845
|
+
resources: [i, ...m.resources]
|
|
845
846
|
}))
|
|
846
847
|
};
|
|
847
|
-
}), n.id && n.id !==
|
|
848
|
+
}), n.id && n.id !== "default" && ue({
|
|
848
849
|
searchParams: s,
|
|
849
850
|
resourceIds: [d.duplicateId],
|
|
850
851
|
folderId: n.id,
|
|
@@ -853,16 +854,16 @@ const ft = () => {
|
|
|
853
854
|
});
|
|
854
855
|
},
|
|
855
856
|
onError: (d) => {
|
|
856
|
-
e.remove(
|
|
857
|
+
e.remove(l), typeof d == "string" && e.error(`${S("duplicate.error")}: ${d}`);
|
|
857
858
|
}
|
|
858
859
|
});
|
|
859
860
|
}, Yt = () => {
|
|
860
|
-
const e =
|
|
861
|
+
const e = U(), s = E(), t = D(), r = V(), n = X(), a = Z(), o = Y(), l = ee().length > 0, f = l ? a : o, {
|
|
861
862
|
clearSelectedIds: d,
|
|
862
863
|
clearSelectedItems: u,
|
|
863
864
|
setTreeData: h,
|
|
864
|
-
setSearchParams:
|
|
865
|
-
} =
|
|
865
|
+
setSearchParams: i
|
|
866
|
+
} = b(), {
|
|
866
867
|
filters: p,
|
|
867
868
|
trashed: m
|
|
868
869
|
} = t, y = ["context", {
|
|
@@ -870,21 +871,21 @@ const ft = () => {
|
|
|
870
871
|
filters: p,
|
|
871
872
|
trashed: m
|
|
872
873
|
}];
|
|
873
|
-
return
|
|
874
|
+
return v({
|
|
874
875
|
mutationFn: async (g) => await ue({
|
|
875
876
|
searchParams: t,
|
|
876
877
|
folderId: g,
|
|
877
878
|
folderIds: n,
|
|
878
879
|
resourceIds: f,
|
|
879
|
-
useAssetIds:
|
|
880
|
+
useAssetIds: l
|
|
880
881
|
}),
|
|
881
882
|
onError(g) {
|
|
882
|
-
typeof g == "string" && e.error(
|
|
883
|
+
typeof g == "string" && e.error(S(g));
|
|
883
884
|
},
|
|
884
885
|
onSuccess: async (g, I) => {
|
|
885
886
|
if (s.getQueryData(y))
|
|
886
887
|
return s.setQueryData(y, (Q) => {
|
|
887
|
-
var
|
|
888
|
+
var k;
|
|
888
889
|
if (Q) {
|
|
889
890
|
const B = dt(r, {
|
|
890
891
|
destinationId: I,
|
|
@@ -892,25 +893,25 @@ const ft = () => {
|
|
|
892
893
|
}), R = {
|
|
893
894
|
...Q,
|
|
894
895
|
pages: Q == null ? void 0 : Q.pages.map((P) => {
|
|
895
|
-
var
|
|
896
|
+
var O;
|
|
896
897
|
return {
|
|
897
898
|
...P,
|
|
898
899
|
folders: P.folders.filter((_) => !n.includes(_.id)),
|
|
899
900
|
pagination: {
|
|
900
901
|
...P.pagination,
|
|
901
902
|
// @ts-ignore
|
|
902
|
-
maxIdx: ((
|
|
903
|
+
maxIdx: ((O = P.pagination) == null ? void 0 : O.maxIdx) - g.resources.length
|
|
903
904
|
},
|
|
904
|
-
resources: P.resources.filter((_) =>
|
|
905
|
+
resources: P.resources.filter((_) => l ? !a.includes(_.assetId) : !f.includes(_.id))
|
|
905
906
|
};
|
|
906
907
|
})
|
|
907
908
|
};
|
|
908
|
-
return h(B),
|
|
909
|
+
return h(B), i({
|
|
909
910
|
...t,
|
|
910
911
|
pagination: {
|
|
911
912
|
...t.pagination,
|
|
912
913
|
// @ts-ignore
|
|
913
|
-
maxIdx: ((
|
|
914
|
+
maxIdx: ((k = t.pagination) == null ? void 0 : k.maxIdx) - g.resources.length
|
|
914
915
|
}
|
|
915
916
|
}), R;
|
|
916
917
|
}
|
|
@@ -921,17 +922,17 @@ const ft = () => {
|
|
|
921
922
|
}
|
|
922
923
|
});
|
|
923
924
|
}, Zt = () => {
|
|
924
|
-
const e =
|
|
925
|
+
const e = U(), s = E(), t = D(), r = V(), {
|
|
925
926
|
setTreeData: n
|
|
926
|
-
} =
|
|
927
|
+
} = b(), {
|
|
927
928
|
filters: a,
|
|
928
929
|
trashed: o
|
|
929
|
-
} = t,
|
|
930
|
+
} = t, l = ["context", {
|
|
930
931
|
folderId: a.folder,
|
|
931
932
|
filters: a,
|
|
932
933
|
trashed: o
|
|
933
934
|
}];
|
|
934
|
-
return
|
|
935
|
+
return v({
|
|
935
936
|
mutationFn: async ({
|
|
936
937
|
name: f,
|
|
937
938
|
parentId: d
|
|
@@ -941,24 +942,24 @@ const ft = () => {
|
|
|
941
942
|
parentId: d
|
|
942
943
|
}),
|
|
943
944
|
onError(f) {
|
|
944
|
-
typeof f == "string" && e.error(
|
|
945
|
+
typeof f == "string" && e.error(S(f));
|
|
945
946
|
},
|
|
946
947
|
onSuccess: async (f, d) => {
|
|
947
948
|
await s.cancelQueries({
|
|
948
|
-
queryKey:
|
|
949
|
+
queryKey: l
|
|
949
950
|
});
|
|
950
|
-
const u = s.getQueryData(
|
|
951
|
+
const u = s.getQueryData(l), h = {
|
|
951
952
|
...f,
|
|
952
953
|
parentId: d.parentId,
|
|
953
954
|
children: [],
|
|
954
955
|
rights: [`creator:${f == null ? void 0 : f.creator_id}`]
|
|
955
956
|
};
|
|
956
957
|
if (u)
|
|
957
|
-
return s.setQueryData(
|
|
958
|
-
if (
|
|
958
|
+
return s.setQueryData(l, (i) => {
|
|
959
|
+
if (i) {
|
|
959
960
|
const p = {
|
|
960
|
-
...
|
|
961
|
-
pages:
|
|
961
|
+
...i,
|
|
962
|
+
pages: i == null ? void 0 : i.pages.map((y) => ({
|
|
962
963
|
...y,
|
|
963
964
|
folders: [...y.folders, h]
|
|
964
965
|
}))
|
|
@@ -972,31 +973,31 @@ const ft = () => {
|
|
|
972
973
|
}
|
|
973
974
|
});
|
|
974
975
|
}, es = () => {
|
|
975
|
-
const e =
|
|
976
|
+
const e = U(), s = E(), t = D(), r = V(), {
|
|
976
977
|
setFolderIds: n,
|
|
977
978
|
setSelectedFolders: a,
|
|
978
979
|
setTreeData: o
|
|
979
|
-
} =
|
|
980
|
-
filters:
|
|
980
|
+
} = b(), {
|
|
981
|
+
filters: l,
|
|
981
982
|
trashed: f
|
|
982
983
|
} = t, d = ["context", {
|
|
983
|
-
folderId:
|
|
984
|
-
filters:
|
|
984
|
+
folderId: l.folder,
|
|
985
|
+
filters: l,
|
|
985
986
|
trashed: f
|
|
986
987
|
}];
|
|
987
|
-
return
|
|
988
|
+
return v({
|
|
988
989
|
mutationFn: async ({
|
|
989
990
|
folderId: u,
|
|
990
991
|
name: h,
|
|
991
|
-
parentId:
|
|
992
|
+
parentId: i
|
|
992
993
|
}) => await _e({
|
|
993
994
|
searchParams: t,
|
|
994
995
|
folderId: u,
|
|
995
|
-
parentId:
|
|
996
|
+
parentId: i,
|
|
996
997
|
name: h
|
|
997
998
|
}),
|
|
998
999
|
onError(u) {
|
|
999
|
-
typeof u == "string" && e.error(
|
|
1000
|
+
typeof u == "string" && e.error(S(u));
|
|
1000
1001
|
},
|
|
1001
1002
|
onSuccess: async (u, h) => {
|
|
1002
1003
|
if (await s.cancelQueries({
|
|
@@ -1027,13 +1028,13 @@ const ft = () => {
|
|
|
1027
1028
|
}
|
|
1028
1029
|
});
|
|
1029
1030
|
}, ts = (e) => {
|
|
1030
|
-
const s = E(), t =
|
|
1031
|
+
const s = E(), t = D(), {
|
|
1031
1032
|
setResourceIds: r,
|
|
1032
1033
|
setSelectedResources: n
|
|
1033
|
-
} =
|
|
1034
|
+
} = b(), {
|
|
1034
1035
|
filters: a,
|
|
1035
1036
|
trashed: o
|
|
1036
|
-
} = t,
|
|
1037
|
+
} = t, l = ["context", {
|
|
1037
1038
|
folderId: a.folder,
|
|
1038
1039
|
filters: a,
|
|
1039
1040
|
trashed: o
|
|
@@ -1043,15 +1044,15 @@ const ft = () => {
|
|
|
1043
1044
|
options: {
|
|
1044
1045
|
onSuccess: async (f, d) => {
|
|
1045
1046
|
if (await s.cancelQueries({
|
|
1046
|
-
queryKey:
|
|
1047
|
-
}), s.getQueryData(
|
|
1048
|
-
return s.setQueryData(
|
|
1047
|
+
queryKey: l
|
|
1048
|
+
}), s.getQueryData(l))
|
|
1049
|
+
return s.setQueryData(l, (h) => {
|
|
1049
1050
|
if (h)
|
|
1050
1051
|
return {
|
|
1051
1052
|
...h,
|
|
1052
|
-
pages: h == null ? void 0 : h.pages.map((
|
|
1053
|
-
...
|
|
1054
|
-
resources:
|
|
1053
|
+
pages: h == null ? void 0 : h.pages.map((i) => ({
|
|
1054
|
+
...i,
|
|
1055
|
+
resources: i.resources.map((p) => {
|
|
1055
1056
|
if (p.assetId === (d == null ? void 0 : d.resourceId)) {
|
|
1056
1057
|
let m = [`creator:${p.creatorId}`];
|
|
1057
1058
|
return (d == null ? void 0 : d.rights.length) >= 1 && (m = [...m, ...d.rights.flatMap((y) => y.actions.map((g) => `${y.type}:${y.id}:${g.id}`))]), {
|
|
@@ -1071,7 +1072,7 @@ const ft = () => {
|
|
|
1071
1072
|
}
|
|
1072
1073
|
});
|
|
1073
1074
|
}, ss = (e) => {
|
|
1074
|
-
const s = E(), t =
|
|
1075
|
+
const s = E(), t = D(), {
|
|
1075
1076
|
filters: r,
|
|
1076
1077
|
trashed: n
|
|
1077
1078
|
} = t, a = ["context", {
|
|
@@ -1082,7 +1083,7 @@ const ft = () => {
|
|
|
1082
1083
|
return be({
|
|
1083
1084
|
application: e,
|
|
1084
1085
|
options: {
|
|
1085
|
-
onSuccess: async (o,
|
|
1086
|
+
onSuccess: async (o, l) => {
|
|
1086
1087
|
if (await s.cancelQueries({
|
|
1087
1088
|
queryKey: a
|
|
1088
1089
|
}), s.getQueryData(a))
|
|
@@ -1093,20 +1094,20 @@ const ft = () => {
|
|
|
1093
1094
|
pages: d == null ? void 0 : d.pages.map((u) => ({
|
|
1094
1095
|
...u,
|
|
1095
1096
|
resources: u.resources.map((h) => {
|
|
1096
|
-
if (h.assetId === (
|
|
1097
|
+
if (h.assetId === (l == null ? void 0 : l.entId)) {
|
|
1097
1098
|
const {
|
|
1098
|
-
name:
|
|
1099
|
+
name: i,
|
|
1099
1100
|
thumbnail: p,
|
|
1100
1101
|
public: m,
|
|
1101
1102
|
description: y,
|
|
1102
1103
|
slug: g,
|
|
1103
1104
|
...I
|
|
1104
|
-
} =
|
|
1105
|
+
} = l;
|
|
1105
1106
|
return {
|
|
1106
1107
|
...h,
|
|
1107
1108
|
...I,
|
|
1108
1109
|
// add any custom field
|
|
1109
|
-
name:
|
|
1110
|
+
name: i,
|
|
1110
1111
|
thumbnail: typeof p == "string" ? p : URL.createObjectURL(p),
|
|
1111
1112
|
public: m,
|
|
1112
1113
|
description: y,
|
|
@@ -1121,8 +1122,9 @@ const ft = () => {
|
|
|
1121
1122
|
}
|
|
1122
1123
|
}
|
|
1123
1124
|
});
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1125
|
+
};
|
|
1126
|
+
const rs = () => {
|
|
1127
|
+
const e = U(), s = E(), t = D(), {
|
|
1126
1128
|
user: r
|
|
1127
1129
|
} = le(), {
|
|
1128
1130
|
appCode: n
|
|
@@ -1131,87 +1133,89 @@ const ft = () => {
|
|
|
1131
1133
|
filters: t.filters,
|
|
1132
1134
|
trashed: t.trashed
|
|
1133
1135
|
}];
|
|
1134
|
-
return
|
|
1135
|
-
mutationFn: async (o) => await
|
|
1136
|
+
return v({
|
|
1137
|
+
mutationFn: async (o) => await Je({
|
|
1136
1138
|
searchParams: t,
|
|
1137
1139
|
params: o
|
|
1138
1140
|
}),
|
|
1139
1141
|
onError(o) {
|
|
1140
|
-
typeof o == "string" && e.error(
|
|
1142
|
+
typeof o == "string" && e.error(S(o));
|
|
1141
1143
|
},
|
|
1142
|
-
onSuccess: async (o,
|
|
1143
|
-
var
|
|
1144
|
+
onSuccess: async (o, l) => {
|
|
1145
|
+
var h, i, p;
|
|
1144
1146
|
await s.cancelQueries({
|
|
1145
1147
|
queryKey: a
|
|
1146
1148
|
});
|
|
1147
|
-
const f = s.getQueryData(a),
|
|
1148
|
-
|
|
1149
|
-
|
|
1149
|
+
const f = s.getQueryData(a), {
|
|
1150
|
+
thumbnail: d
|
|
1151
|
+
} = l, u = {
|
|
1152
|
+
...l,
|
|
1153
|
+
thumbnail: d ? URL.createObjectURL(d) : "",
|
|
1150
1154
|
application: n,
|
|
1151
1155
|
assetId: o._id || o.entId || "",
|
|
1152
1156
|
id: o._id || o.entId || "",
|
|
1153
1157
|
creatorId: r == null ? void 0 : r.userId,
|
|
1154
1158
|
creatorName: r == null ? void 0 : r.username,
|
|
1155
1159
|
createdAt: Date.now(),
|
|
1156
|
-
slug:
|
|
1157
|
-
modifiedAt: ((
|
|
1158
|
-
modifierId: ((
|
|
1159
|
-
modifierName: ((
|
|
1160
|
+
slug: l.slug || "",
|
|
1161
|
+
modifiedAt: ((h = o.modified) == null ? void 0 : h.$date) || "",
|
|
1162
|
+
modifierId: ((i = o.author) == null ? void 0 : i.userId) || "",
|
|
1163
|
+
modifierName: ((p = o.author) == null ? void 0 : p.username) || "",
|
|
1160
1164
|
updatedAt: Date.now(),
|
|
1161
1165
|
trashed: !1,
|
|
1162
1166
|
rights: [`creator:${r == null ? void 0 : r.userId}`]
|
|
1163
1167
|
};
|
|
1164
1168
|
if (f)
|
|
1165
|
-
return s.setQueryData(a, (
|
|
1166
|
-
if (
|
|
1169
|
+
return s.setQueryData(a, (m) => {
|
|
1170
|
+
if (m)
|
|
1167
1171
|
return {
|
|
1168
|
-
...
|
|
1169
|
-
pages:
|
|
1170
|
-
...
|
|
1171
|
-
resources: [
|
|
1172
|
+
...m,
|
|
1173
|
+
pages: m == null ? void 0 : m.pages.map((y) => ({
|
|
1174
|
+
...y,
|
|
1175
|
+
resources: [u, ...y.resources]
|
|
1172
1176
|
}))
|
|
1173
1177
|
};
|
|
1174
1178
|
});
|
|
1175
1179
|
}
|
|
1176
1180
|
});
|
|
1177
|
-
}, 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")),
|
|
1178
|
-
const e = st(), s = ne(), t = rt(), r =
|
|
1179
|
-
appCode:
|
|
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(), {
|
|
1183
|
+
appCode: l
|
|
1180
1184
|
} = K(), {
|
|
1181
1185
|
t: f
|
|
1182
|
-
} = j(
|
|
1186
|
+
} = j(), {
|
|
1183
1187
|
setSearchParams: d,
|
|
1184
1188
|
setSearchConfig: u,
|
|
1185
1189
|
setTreeData: h
|
|
1186
|
-
} =
|
|
1187
|
-
data:
|
|
1190
|
+
} = b(), {
|
|
1191
|
+
data: i,
|
|
1188
1192
|
isError: p,
|
|
1189
1193
|
error: m,
|
|
1190
1194
|
isLoading: y,
|
|
1191
1195
|
isFetching: g,
|
|
1192
1196
|
fetchNextPage: I
|
|
1193
|
-
} = ht(), C = (
|
|
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;
|
|
1194
1198
|
return M(() => {
|
|
1195
1199
|
var B, R, P;
|
|
1196
|
-
if (
|
|
1197
|
-
const
|
|
1198
|
-
(R =
|
|
1199
|
-
id:
|
|
1200
|
+
if (i) {
|
|
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,
|
|
1200
1204
|
section: !0,
|
|
1201
|
-
children:
|
|
1205
|
+
children: O.map((_) => new G(_)),
|
|
1202
1206
|
name: f("explorer.filters.mine", {
|
|
1203
|
-
ns:
|
|
1207
|
+
ns: l
|
|
1204
1208
|
})
|
|
1205
|
-
}) : h(pe(a,
|
|
1209
|
+
}) : h(pe(a, O, r.filters.folder || T.DEFAULT))), d({
|
|
1206
1210
|
...r,
|
|
1207
|
-
pagination: (P =
|
|
1211
|
+
pagination: (P = i == null ? void 0 : i.pages[(i == null ? void 0 : i.pages.length) - 1]) == null ? void 0 : P.pagination
|
|
1208
1212
|
});
|
|
1209
1213
|
}
|
|
1210
|
-
}, [
|
|
1214
|
+
}, [i]), M(() => {
|
|
1211
1215
|
m && typeof m == "string" && o.error(f(m));
|
|
1212
|
-
}, [m]), y ? /* @__PURE__ */ c(A, {}) : p ? /* @__PURE__ */ c(
|
|
1213
|
-
/* @__PURE__ */ c(
|
|
1214
|
-
/* @__PURE__ */ c(
|
|
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 })
|
|
1215
1219
|
] });
|
|
1216
1220
|
}, Dt = () => {
|
|
1217
1221
|
const {
|
|
@@ -1225,16 +1229,16 @@ const ft = () => {
|
|
|
1225
1229
|
return;
|
|
1226
1230
|
}
|
|
1227
1231
|
n(u);
|
|
1228
|
-
}, o = H(),
|
|
1232
|
+
}, o = H(), l = D(), {
|
|
1229
1233
|
setSearchParams: f
|
|
1230
|
-
} =
|
|
1234
|
+
} = b();
|
|
1231
1235
|
M(() => {
|
|
1232
|
-
const u = () => r.includes("1") ? !0 : void 0, h = () => r.includes("2") ? !0 : void 0,
|
|
1236
|
+
const u = () => r.includes("1") ? !0 : void 0, h = () => r.includes("2") ? !0 : void 0, i = () => r.includes("7") ? !0 : void 0;
|
|
1233
1237
|
f({
|
|
1234
|
-
...
|
|
1238
|
+
...l,
|
|
1235
1239
|
filters: {
|
|
1236
1240
|
owner: u(),
|
|
1237
|
-
public:
|
|
1241
|
+
public: i(),
|
|
1238
1242
|
shared: h(),
|
|
1239
1243
|
folder: o ? o.id : "default"
|
|
1240
1244
|
}
|
|
@@ -1290,22 +1294,22 @@ const ft = () => {
|
|
|
1290
1294
|
} = Dt(), {
|
|
1291
1295
|
formRef: a,
|
|
1292
1296
|
inputSearch: o,
|
|
1293
|
-
handleInputSearchChange:
|
|
1297
|
+
handleInputSearchChange: l,
|
|
1294
1298
|
handleKeyPress: f,
|
|
1295
1299
|
handleSearchSubmit: d
|
|
1296
1300
|
} = me(), u = t.length > 0 ? t.length : void 0;
|
|
1297
|
-
return /* @__PURE__ */ N("form", { noValidate: !0, className: "bg-light p-16 ps-24 ms-n16 ms-lg-n24 me-n16 position-relative d-flex gap-8", ref: a, children: [
|
|
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: [
|
|
1298
1302
|
/* @__PURE__ */ N(Te, { id: "search", className: "input-group", children: [
|
|
1299
1303
|
/* @__PURE__ */ c(Fe, { type: "search", placeholder: s("explorer.label.search", {
|
|
1300
1304
|
ns: e
|
|
1301
|
-
}), size: "lg", noValidationIcon: !0, value: o, onChange:
|
|
1305
|
+
}), size: "lg", noValidationIcon: !0, value: o, onChange: l, onKeyDown: f }),
|
|
1302
1306
|
/* @__PURE__ */ c(Ce, { type: "submit", "aria-label": s("explorer.label.search", {
|
|
1303
1307
|
ns: e
|
|
1304
1308
|
}), onClick: d })
|
|
1305
1309
|
] }),
|
|
1306
1310
|
/* @__PURE__ */ N(z, { placement: "bottom-end", children: [
|
|
1307
|
-
/* @__PURE__ */ c(z.Trigger, { label: s("explorer.filters"), icon: /* @__PURE__ */ c(
|
|
1308
|
-
/* @__PURE__ */ c(z.Menu, { children: r.map((h) => h.value === "0" ? /* @__PURE__ */ N(
|
|
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: [
|
|
1309
1313
|
/* @__PURE__ */ c(z.RadioItem, { value: h.value, model: t, onChange: () => n(h.value), children: h.label }),
|
|
1310
1314
|
/* @__PURE__ */ c(z.Separator, {})
|
|
1311
1315
|
] }, "0") : /* @__PURE__ */ c(z.RadioItem, { value: h.value, model: t, onChange: () => n(h.value), children: h.label }, h.value)) })
|
|
@@ -1320,44 +1324,39 @@ const ft = () => {
|
|
|
1320
1324
|
t: r
|
|
1321
1325
|
} = j();
|
|
1322
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: [
|
|
1323
|
-
/* @__PURE__ */ c(
|
|
1327
|
+
/* @__PURE__ */ c(Ue, { width: "20", height: "20" }),
|
|
1324
1328
|
/* @__PURE__ */ c("span", { children: r("explorer.tree.trash") })
|
|
1325
1329
|
] }) }) }) }) }) }) });
|
|
1326
1330
|
}, Ft = /* @__PURE__ */ F(async () => await import("./FolderModal.js")), Ct = () => {
|
|
1327
1331
|
const e = E(), [s, t] = Ne(), r = V(), n = ne(), a = re(), {
|
|
1328
1332
|
appCode: o
|
|
1329
1333
|
} = K(), {
|
|
1330
|
-
t:
|
|
1334
|
+
t: l
|
|
1331
1335
|
} = j(["common", o]), {
|
|
1332
1336
|
goToTrash: f,
|
|
1333
1337
|
selectTreeItem: d,
|
|
1334
1338
|
unfoldTreeItem: u,
|
|
1335
1339
|
foldTreeItem: h,
|
|
1336
|
-
clearSelectedItems:
|
|
1340
|
+
clearSelectedItems: i,
|
|
1337
1341
|
clearSelectedIds: p
|
|
1338
|
-
} =
|
|
1342
|
+
} = b(), m = async (g) => {
|
|
1339
1343
|
await u(g, e);
|
|
1340
1344
|
}, y = () => {
|
|
1341
|
-
|
|
1345
|
+
i(), p(), t();
|
|
1342
1346
|
};
|
|
1343
1347
|
return /* @__PURE__ */ N(ce, { children: [
|
|
1344
|
-
/* @__PURE__ */ c(Re, { data:
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
})
|
|
1349
|
-
}, selectedNodesIds: a, onTreeItemSelect: d, onTreeItemFold: h, onTreeItemUnfold: m }),
|
|
1350
|
-
/* @__PURE__ */ c(Tt, { id: w.BIN, selected: n, onSelect: f }),
|
|
1351
|
-
/* @__PURE__ */ c("div", { className: "d-grid my-16", children: /* @__PURE__ */ c(Pe, { disabled: n, type: "button", color: "primary", variant: "outline", leftIcon: /* @__PURE__ */ c(Ue, {}), onClick: y, children: i("explorer.folder.new") }) }),
|
|
1352
|
-
/* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: s && /* @__PURE__ */ c(Ft, { edit: !1, isOpen: s, onSuccess: t, onCancel: t }) })
|
|
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 }) })
|
|
1353
1352
|
] });
|
|
1354
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 = ({
|
|
1355
1354
|
config: e
|
|
1356
1355
|
}) => {
|
|
1357
|
-
const s =
|
|
1356
|
+
const s = D(), {
|
|
1358
1357
|
setConfig: t,
|
|
1359
1358
|
setSearchParams: r
|
|
1360
|
-
} =
|
|
1359
|
+
} = b();
|
|
1361
1360
|
M(() => {
|
|
1362
1361
|
t(e || {}), r({
|
|
1363
1362
|
...s,
|
|
@@ -1371,7 +1370,7 @@ const ft = () => {
|
|
|
1371
1370
|
data: a
|
|
1372
1371
|
} = ft(), {
|
|
1373
1372
|
isTrashedModalOpen: o,
|
|
1374
|
-
onTrashedCancel:
|
|
1373
|
+
onTrashedCancel: l
|
|
1375
1374
|
} = ct(), {
|
|
1376
1375
|
isActionDisableModalOpen: f,
|
|
1377
1376
|
onActionDisableCancel: d
|
|
@@ -1379,9 +1378,9 @@ const ft = () => {
|
|
|
1379
1378
|
Ae();
|
|
1380
1379
|
const u = oe("publish", a), h = oe("create", a);
|
|
1381
1380
|
return e && /* @__PURE__ */ N(ce, { children: [
|
|
1382
|
-
/* @__PURE__ */ c(Ee, { render: () => h ? /* @__PURE__ */ c(
|
|
1381
|
+
/* @__PURE__ */ c(Ee, { render: () => h ? /* @__PURE__ */ c(q, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(Nt, {}) }) : null, children: /* @__PURE__ */ c(Qe, { app: n }) }),
|
|
1383
1382
|
/* @__PURE__ */ N(te, { className: "flex-grow-1", children: [
|
|
1384
|
-
/* @__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(
|
|
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: [
|
|
1385
1384
|
/* @__PURE__ */ c(Ct, {}),
|
|
1386
1385
|
u && /* @__PURE__ */ c(Rt, {})
|
|
1387
1386
|
] }) }),
|
|
@@ -1390,7 +1389,7 @@ const ft = () => {
|
|
|
1390
1389
|
/* @__PURE__ */ c(ot, {}),
|
|
1391
1390
|
/* @__PURE__ */ c(xt, {})
|
|
1392
1391
|
] }),
|
|
1393
|
-
/* @__PURE__ */ N(
|
|
1392
|
+
/* @__PURE__ */ N(q, { fallback: /* @__PURE__ */ c(A, {}), children: [
|
|
1394
1393
|
/* @__PURE__ */ c(Pt, {}),
|
|
1395
1394
|
e.enableOnboarding && /* @__PURE__ */ c(Qt, { id: "showOnboardingTrash", items: [{
|
|
1396
1395
|
src: "onboarding/illu-trash-menu.svg",
|
|
@@ -1410,19 +1409,19 @@ const ft = () => {
|
|
|
1410
1409
|
nextText: "explorer.modal.onboarding.trash.next",
|
|
1411
1410
|
closeText: "explorer.modal.onboarding.trash.close"
|
|
1412
1411
|
} }),
|
|
1413
|
-
o && /* @__PURE__ */ c(Et, { isOpen: o, onCancel:
|
|
1412
|
+
o && /* @__PURE__ */ c(Et, { isOpen: o, onCancel: l }),
|
|
1414
1413
|
f && /* @__PURE__ */ c(At, { isOpen: f, onCancel: d })
|
|
1415
1414
|
] })
|
|
1416
1415
|
] })
|
|
1417
1416
|
] });
|
|
1418
|
-
},
|
|
1417
|
+
}, L = document.querySelector("[data-explorer-config]");
|
|
1419
1418
|
let ae;
|
|
1420
1419
|
function os() {
|
|
1421
1420
|
var e;
|
|
1422
|
-
if ((e =
|
|
1421
|
+
if ((e = L == null ? void 0 : L.dataset) != null && e.explorerConfig) {
|
|
1423
1422
|
const {
|
|
1424
1423
|
explorerConfig: s
|
|
1425
|
-
} =
|
|
1424
|
+
} = L.dataset;
|
|
1426
1425
|
try {
|
|
1427
1426
|
const t = JSON.parse(s);
|
|
1428
1427
|
ae = {
|
|
@@ -1430,7 +1429,7 @@ function os() {
|
|
|
1430
1429
|
enableOnboarding: t.enableOnboarding !== void 0 ? t.enableOnboarding : !0
|
|
1431
1430
|
};
|
|
1432
1431
|
} catch (t) {
|
|
1433
|
-
console.error("[Explorer Config] could not parse app params from root data attributes:",
|
|
1432
|
+
console.error("[Explorer Config] could not parse app params from root data attributes:", L == null ? void 0 : L.dataset, t);
|
|
1434
1433
|
}
|
|
1435
1434
|
}
|
|
1436
1435
|
return ae;
|
|
@@ -1440,27 +1439,27 @@ export {
|
|
|
1440
1439
|
ft as a,
|
|
1441
1440
|
H as b,
|
|
1442
1441
|
rs as c,
|
|
1443
|
-
|
|
1442
|
+
D as d,
|
|
1444
1443
|
ne as e,
|
|
1445
|
-
|
|
1444
|
+
w as f,
|
|
1446
1445
|
$t as g,
|
|
1447
1446
|
Y as h,
|
|
1448
1447
|
Ht as i,
|
|
1449
1448
|
Vt as j,
|
|
1450
1449
|
X as k,
|
|
1451
|
-
|
|
1450
|
+
Jt as l,
|
|
1452
1451
|
et as m,
|
|
1453
1452
|
Xt as n,
|
|
1454
1453
|
zt as o,
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
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,
|
|
1465
1464
|
os as z
|
|
1466
1465
|
};
|