ode-explorer 1.4.12-develop.202406121500 → 1.4.12-develop.202406251122
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 +746 -4783
- package/dist/version.txt +1 -1
- package/lib/ActionBarContainer.js +35 -31
- package/package.json +1 -1
package/dist/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ode-explorer=1.0-b2school-SNAPSHOT
|
|
1
|
+
ode-explorer=1.0-b2school-SNAPSHOT 25/06/2024 11:22:46
|
|
@@ -4,7 +4,7 @@ import { useUser as pe, Button as W, useOdeClient as he, ActionBar as fe, Loadin
|
|
|
4
4
|
import { useTransition as Oe, animated as ye } from "@react-spring/web";
|
|
5
5
|
import { useTranslation as ee } from "react-i18next";
|
|
6
6
|
import { odeServices as D, ACTION as c } from "edifice-ts-client";
|
|
7
|
-
import { e as X, f as be, b as
|
|
7
|
+
import { e as X, f as be, b as Ie, h as ve, i as se, j as Ae, k as ge, l as Me, m as Pe, d as we, n as xe, u as te, a as Fe, o as Te, p as Be, q as De } from "./index2.js";
|
|
8
8
|
import "@edifice-ui/icons";
|
|
9
9
|
import "i18next";
|
|
10
10
|
import "zustand";
|
|
@@ -15,7 +15,7 @@ function Le({
|
|
|
15
15
|
action: s
|
|
16
16
|
}) {
|
|
17
17
|
const [d, t] = L(!1), {
|
|
18
|
-
user:
|
|
18
|
+
user: E
|
|
19
19
|
} = pe(), h = X();
|
|
20
20
|
Z(() => {
|
|
21
21
|
f();
|
|
@@ -43,7 +43,7 @@ function Le({
|
|
|
43
43
|
t(!0);
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
if (h && ((r = (l = o[0]) == null ? void 0 : l.trashedBy) != null && r.includes(
|
|
46
|
+
if (h && ((r = (l = o[0]) == null ? void 0 : l.trashedBy) != null && r.includes(E == null ? void 0 : E.userId)) && s === "restore" && !((m = o[0]) != null && m.trashed)) {
|
|
47
47
|
t(!0);
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
@@ -52,7 +52,7 @@ function Le({
|
|
|
52
52
|
if (typeof o[0] == "string")
|
|
53
53
|
await R(o);
|
|
54
54
|
else {
|
|
55
|
-
const b = o.map((
|
|
55
|
+
const b = o.map((I) => I.rights);
|
|
56
56
|
await p(b);
|
|
57
57
|
}
|
|
58
58
|
else
|
|
@@ -66,7 +66,7 @@ function Le({
|
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
function oe() {
|
|
69
|
-
const [n, o] = L(!1), [s, d] = L("void"), [t,
|
|
69
|
+
const [n, o] = L(!1), [s, d] = L("void"), [t, E] = L(), h = be((e) => e.config), R = Ie(), p = ve(), f = se(), l = Ae(), r = ge(), m = X(), b = Me(), I = Pe(), M = we(), _ = xe(), {
|
|
70
70
|
openResource: N,
|
|
71
71
|
printSelectedResource: P,
|
|
72
72
|
openFolder: k,
|
|
@@ -80,7 +80,7 @@ function oe() {
|
|
|
80
80
|
o(!1);
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
if (
|
|
83
|
+
if (I) {
|
|
84
84
|
o(!1);
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
@@ -88,7 +88,7 @@ function oe() {
|
|
|
88
88
|
}, [p, r]);
|
|
89
89
|
async function U(e) {
|
|
90
90
|
var B;
|
|
91
|
-
switch ((B = document.getElementById("root")) == null || B.setAttribute("aria-hidden", "true"),
|
|
91
|
+
switch ((B = document.getElementById("root")) == null || B.setAttribute("aria-hidden", "true"), E(e), e.id) {
|
|
92
92
|
case c.OPEN:
|
|
93
93
|
return p.length > 0 ? N(f[0]) : k({
|
|
94
94
|
folder: l[0],
|
|
@@ -149,18 +149,18 @@ function oe() {
|
|
|
149
149
|
await b.mutate();
|
|
150
150
|
else
|
|
151
151
|
throw new Error("Cannot restore untrashed resources");
|
|
152
|
-
|
|
152
|
+
v();
|
|
153
153
|
} catch (e) {
|
|
154
154
|
console.error(e);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function v() {
|
|
158
158
|
var e;
|
|
159
159
|
d("void"), t != null && t.id && ((e = document.getElementById(t == null ? void 0 : t.id)) == null || e.focus());
|
|
160
160
|
}
|
|
161
161
|
const i = (e) => () => {
|
|
162
|
-
s === e && (
|
|
163
|
-
}, J = i("move"),
|
|
162
|
+
s === e && (v(), w(), x());
|
|
163
|
+
}, J = i("move"), S = i("move"), z = i("delete"), T = i("delete"), V = i("publish"), A = i("publish"), g = i("edit_folder"), u = i("edit_folder"), $ = i("edit_resource"), q = i("edit_resource"), ne = i("share"), re = i("share"), ce = i("export"), ae = i("export");
|
|
164
164
|
async function ie() {
|
|
165
165
|
if (f && f.length > 0) {
|
|
166
166
|
const e = f[0];
|
|
@@ -171,7 +171,7 @@ function oe() {
|
|
|
171
171
|
if (p && p.length > 0) {
|
|
172
172
|
const e = f[0].assetId;
|
|
173
173
|
(h == null ? void 0 : h.app) == "scrapbook" ? Te({
|
|
174
|
-
searchParams:
|
|
174
|
+
searchParams: M,
|
|
175
175
|
assetId: e
|
|
176
176
|
}) : d("edit_resource");
|
|
177
177
|
} else
|
|
@@ -191,16 +191,16 @@ function oe() {
|
|
|
191
191
|
isActionBarOpen: n,
|
|
192
192
|
isMoveModalOpen: s === "move",
|
|
193
193
|
onMoveCancel: J,
|
|
194
|
-
onMoveSuccess:
|
|
194
|
+
onMoveSuccess: S,
|
|
195
195
|
isDeleteModalOpen: s === "delete",
|
|
196
196
|
onDeleteCancel: T,
|
|
197
197
|
onDeleteSuccess: z,
|
|
198
198
|
isPublishModalOpen: s === "publish",
|
|
199
|
-
onPublishCancel:
|
|
199
|
+
onPublishCancel: A,
|
|
200
200
|
onPublishSuccess: V,
|
|
201
201
|
isEditFolderOpen: s === "edit_folder",
|
|
202
202
|
onEditFolderCancel: u,
|
|
203
|
-
onEditFolderSuccess:
|
|
203
|
+
onEditFolderSuccess: g,
|
|
204
204
|
isEditResourceOpen: s === "edit_resource",
|
|
205
205
|
onEditResourceCancel: q,
|
|
206
206
|
onEditResourceSuccess: $,
|
|
@@ -210,7 +210,7 @@ function oe() {
|
|
|
210
210
|
isExportModalOpen: s === "export",
|
|
211
211
|
onExportCancel: ce,
|
|
212
212
|
onExportSuccess: ae,
|
|
213
|
-
onClearActionBar:
|
|
213
|
+
onClearActionBar: v
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
216
|
function _e({
|
|
@@ -221,7 +221,7 @@ function _e({
|
|
|
221
221
|
renderWhenForbidden: t
|
|
222
222
|
}) {
|
|
223
223
|
const {
|
|
224
|
-
t:
|
|
224
|
+
t: E
|
|
225
225
|
} = ee(), {
|
|
226
226
|
overrideLabel: h
|
|
227
227
|
} = oe(), {
|
|
@@ -235,7 +235,7 @@ function _e({
|
|
|
235
235
|
} = te(), f = X();
|
|
236
236
|
return R ? /* @__PURE__ */ a(G, { children: d }) : t ? t() : f && !R ? /* @__PURE__ */ a(W, { type: "button", color: "primary", variant: "filled", onClick: () => {
|
|
237
237
|
p(!0);
|
|
238
|
-
}, children:
|
|
238
|
+
}, children: E(h(s)) }) : /* @__PURE__ */ a(G, {});
|
|
239
239
|
}
|
|
240
240
|
const Ne = /* @__PURE__ */ y(async () => await import("./PublishModal.js")), ke = /* @__PURE__ */ y(async () => await import("./ResourceModal.js")), He = /* @__PURE__ */ y(async () => await import("./DeleteModal.js")), Ue = /* @__PURE__ */ y(async () => await import("./MoveModal.js")), Ye = /* @__PURE__ */ y(async () => await import("./FolderModal.js")), je = /* @__PURE__ */ y(async () => await import("./ExportModal.js"));
|
|
241
241
|
function es() {
|
|
@@ -247,7 +247,7 @@ function es() {
|
|
|
247
247
|
actions: s,
|
|
248
248
|
selectedElement: d,
|
|
249
249
|
isMoveModalOpen: t,
|
|
250
|
-
isDeleteModalOpen:
|
|
250
|
+
isDeleteModalOpen: E,
|
|
251
251
|
isPublishModalOpen: h,
|
|
252
252
|
isActionBarOpen: R,
|
|
253
253
|
isEditFolderOpen: p,
|
|
@@ -256,8 +256,8 @@ function es() {
|
|
|
256
256
|
onEditFolderSuccess: r,
|
|
257
257
|
isEditResourceOpen: m,
|
|
258
258
|
onEditResourceCancel: b,
|
|
259
|
-
onEditResourceSuccess:
|
|
260
|
-
isShareResourceOpen:
|
|
259
|
+
onEditResourceSuccess: I,
|
|
260
|
+
isShareResourceOpen: M,
|
|
261
261
|
onShareResourceCancel: _,
|
|
262
262
|
onShareResourceSuccess: N,
|
|
263
263
|
isExportModalOpen: P,
|
|
@@ -269,9 +269,9 @@ function es() {
|
|
|
269
269
|
onDeleteSuccess: Y,
|
|
270
270
|
onPublishCancel: j,
|
|
271
271
|
onPublishSuccess: F,
|
|
272
|
-
isActivable:
|
|
272
|
+
isActivable: v,
|
|
273
273
|
handleClick: i
|
|
274
|
-
} = oe(),
|
|
274
|
+
} = oe(), S = se()[0], z = Be(n), T = De(n), V = Oe(R, {
|
|
275
275
|
from: {
|
|
276
276
|
opacity: 0,
|
|
277
277
|
transform: "translateY(100%)"
|
|
@@ -286,20 +286,24 @@ function es() {
|
|
|
286
286
|
}
|
|
287
287
|
});
|
|
288
288
|
return /* @__PURE__ */ Q(G, { children: [
|
|
289
|
-
V((
|
|
290
|
-
...
|
|
289
|
+
V((A, g) => g && /* @__PURE__ */ a(ye.div, { className: "position-fixed bottom-0 start-0 end-0", style: {
|
|
290
|
+
...A,
|
|
291
291
|
zIndex: 4
|
|
292
|
-
}, children: /* @__PURE__ */ a(fe, { children: s == null ? void 0 : s.filter((u) => u.available && u.target === "actionbar").map((u) =>
|
|
292
|
+
}, children: /* @__PURE__ */ a(fe, { children: s == null ? void 0 : s.filter((u) => u.available && u.target === "actionbar").map((u) => v(u) && /* @__PURE__ */ a(_e, { resourceRights: d, roleExpected: u.right, action: u, children: /* @__PURE__ */ a(W, { id: u.id, type: "button", color: "primary", variant: "filled", onClick: () => {
|
|
293
293
|
i(u);
|
|
294
294
|
}, children: o(f(u)) }, u.id) }, u.id)) }) })),
|
|
295
295
|
/* @__PURE__ */ Q(de, { fallback: /* @__PURE__ */ a(me, {}), children: [
|
|
296
296
|
t && /* @__PURE__ */ a(Ue, { isOpen: t, onCancel: x, onSuccess: H }),
|
|
297
|
-
|
|
298
|
-
h &&
|
|
297
|
+
E && /* @__PURE__ */ a(He, { isOpen: E, onCancel: U, onSuccess: Y }),
|
|
298
|
+
h && S && /* @__PURE__ */ a(Ne, { isOpen: h, resourceId: S.assetId, onCancel: j, onSuccess: F }),
|
|
299
299
|
p && /* @__PURE__ */ a(Ye, { edit: !0, isOpen: p, onCancel: l, onSuccess: r }),
|
|
300
|
-
m &&
|
|
301
|
-
|
|
302
|
-
|
|
300
|
+
m && S && /* @__PURE__ */ a(ke, { mode: "update", isOpen: m, resourceId: S.assetId, updateResource: T, onCancel: b, onSuccess: I, children: (A, g, u, $, q) => n === "blog" && Re("createPublic", s) && /* @__PURE__ */ a(Se, { appCode: n, isUpdating: g, resource: A, watch: u, setValue: $, register: q }) }),
|
|
301
|
+
M && S && /* @__PURE__ */ a(Ee, { isOpen: M, shareResource: z, shareOptions: {
|
|
302
|
+
resourceCreatorId: S.creatorId,
|
|
303
|
+
resourceId: S.assetId,
|
|
304
|
+
resourceRights: S.rights
|
|
305
|
+
}, onCancel: _, onSuccess: N, children: n === "blog" ? /* @__PURE__ */ a(Ce, { resourceId: S.assetId, updateResource: T }) : null }),
|
|
306
|
+
P && S && /* @__PURE__ */ a(je, { isOpen: P, onCancel: k, onSuccess: w })
|
|
303
307
|
] })
|
|
304
308
|
] });
|
|
305
309
|
}
|