ode-explorer 1.3.2-dev.202401241302 → 1.3.2-develop-pedago.202401251156
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/ActionBarContainer.js +1 -1
- package/dist/AppAction.js +1 -1
- package/dist/DeleteModal.js +1 -1
- package/dist/EmptyScreenApp.js +1 -1
- package/dist/FolderModal.js +1 -1
- package/dist/FoldersList.js +1 -1
- package/dist/MoveModal.js +1 -1
- package/dist/ResourcesList.js +1 -1
- package/dist/edifice-react.js +18 -18
- package/dist/index.js +3 -3
- package/dist/version.txt +1 -1
- package/lib/ActionBarContainer.js +117 -110
- package/lib/AppAction.js +29 -22
- package/lib/DeleteModal.js +8 -8
- package/lib/EmptyScreenApp.js +26 -20
- package/lib/FolderModal.js +11 -11
- package/lib/FoldersList.js +7 -7
- package/lib/MoveModal.js +10 -10
- package/lib/ResourcesList.js +2 -2
- package/lib/index2.js +204 -190
- package/lib/services/api/index.d.ts +8 -0
- package/package.json +5 -5
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
import { jsx as u, Fragment as j, jsxs as V } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useUser as
|
|
4
|
-
import { useTransition as
|
|
2
|
+
import { useState as w, useEffect as $, Suspense as ae, lazy as y } from "react";
|
|
3
|
+
import { useUser as ie, Button as G, ActionBar as le, LoadingScreen as ue } from "@edifice-ui/react";
|
|
4
|
+
import { useTransition as de, animated as fe } from "@react-spring/web";
|
|
5
5
|
import { useTranslation as q } from "react-i18next";
|
|
6
|
-
import { odeServices as
|
|
7
|
-
import {
|
|
6
|
+
import { odeServices as I, ACTION as l } from "edifice-ts-client";
|
|
7
|
+
import { e as Y, f as he, b as pe, h as me, i as J, j as Re, k as Se, l as Ee, m as Oe, d as ye, u as K, a as Ce, n as be, o as ve, p as Ae } from "./index2.js";
|
|
8
8
|
import "@edifice-ui/icons";
|
|
9
9
|
import "i18next";
|
|
10
10
|
import "zustand";
|
|
11
11
|
import "@tanstack/react-query";
|
|
12
|
-
function
|
|
13
|
-
roles:
|
|
12
|
+
function Me({
|
|
13
|
+
roles: a,
|
|
14
14
|
rights: e,
|
|
15
15
|
action: o
|
|
16
16
|
}) {
|
|
17
|
-
const [
|
|
18
|
-
user:
|
|
19
|
-
} =
|
|
17
|
+
const [i, s] = w(!1), {
|
|
18
|
+
user: R
|
|
19
|
+
} = ie(), p = Y();
|
|
20
20
|
$(() => {
|
|
21
21
|
S();
|
|
22
|
-
}, [
|
|
22
|
+
}, [a, e]);
|
|
23
23
|
const d = async function(r) {
|
|
24
24
|
const t = r instanceof Array ? r : [r];
|
|
25
|
-
if (
|
|
26
|
-
const
|
|
27
|
-
s(
|
|
25
|
+
if (a instanceof Array) {
|
|
26
|
+
const m = await I.rights().sessionHasAtLeastOneResourceRight(a, t);
|
|
27
|
+
s(m);
|
|
28
28
|
} else {
|
|
29
|
-
const
|
|
30
|
-
s(
|
|
29
|
+
const m = await I.rights().sessionHasResourceRight(a, t);
|
|
30
|
+
s(m);
|
|
31
31
|
}
|
|
32
32
|
}, f = async function(r) {
|
|
33
|
-
if (
|
|
34
|
-
const t = await
|
|
33
|
+
if (a instanceof Array) {
|
|
34
|
+
const t = await I.rights().sessionHasAtLeastOneResourceRightForEachList(a, r);
|
|
35
35
|
s(t);
|
|
36
36
|
} else {
|
|
37
|
-
const t = await
|
|
37
|
+
const t = await I.rights().sessionHasResourceRightForEachList(a, r);
|
|
38
38
|
s(t);
|
|
39
39
|
}
|
|
40
40
|
}, S = async function() {
|
|
41
|
-
var r, t,
|
|
42
|
-
if (
|
|
41
|
+
var r, t, m;
|
|
42
|
+
if (a === void 0) {
|
|
43
43
|
s(!0);
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
if (
|
|
46
|
+
if (p && ((t = (r = e[0]) == null ? void 0 : r.trashedBy) != null && t.includes(R == null ? void 0 : R.userId)) && o === "restore" && !((m = e[0]) != null && m.trashed)) {
|
|
47
47
|
s(!0);
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
@@ -52,7 +52,7 @@ function be({
|
|
|
52
52
|
if (typeof e[0] == "string")
|
|
53
53
|
await d(e);
|
|
54
54
|
else {
|
|
55
|
-
const C = e.map((
|
|
55
|
+
const C = e.map((E) => E.rights);
|
|
56
56
|
await f(C);
|
|
57
57
|
}
|
|
58
58
|
else
|
|
@@ -61,188 +61,195 @@ function be({
|
|
|
61
61
|
typeof e == "string" ? await d(e) : await d(e.rights);
|
|
62
62
|
};
|
|
63
63
|
return {
|
|
64
|
-
visible:
|
|
64
|
+
visible: i,
|
|
65
65
|
refreshState: S
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
function Q() {
|
|
69
|
-
const [
|
|
70
|
-
openResource:
|
|
69
|
+
const [a, e] = w(!1), [o, i] = w("void"), [s, R] = w(), p = he((n) => n.config), d = pe(), f = me(), S = J(), r = Re(), t = Se(), m = Y(), C = Ee(), E = Oe(), g = ye(), {
|
|
70
|
+
openResource: F,
|
|
71
71
|
printSelectedResource: P,
|
|
72
72
|
openFolder: T,
|
|
73
73
|
clearSelectedItems: B,
|
|
74
74
|
clearSelectedIds: D
|
|
75
75
|
} = K(), {
|
|
76
76
|
data: L
|
|
77
|
-
} =
|
|
77
|
+
} = Ce();
|
|
78
78
|
$(() => {
|
|
79
79
|
if (f.length === 0 && t.length === 0) {
|
|
80
80
|
e(!1);
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
if (
|
|
83
|
+
if (E) {
|
|
84
84
|
e(!1);
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
e(!0);
|
|
88
88
|
}, [f, t]);
|
|
89
89
|
async function _(n) {
|
|
90
|
-
var
|
|
91
|
-
switch ((
|
|
90
|
+
var A;
|
|
91
|
+
switch ((A = document.getElementById("root")) == null || A.setAttribute("aria-hidden", "true"), R(n), n.id) {
|
|
92
92
|
case l.OPEN:
|
|
93
|
-
return f.length > 0 ?
|
|
93
|
+
return f.length > 0 ? F(S[0]) : T({
|
|
94
94
|
folder: r[0],
|
|
95
95
|
folderId: r[0].id
|
|
96
96
|
});
|
|
97
97
|
case l.MOVE:
|
|
98
|
-
return
|
|
98
|
+
return i("move");
|
|
99
99
|
case l.PRINT:
|
|
100
100
|
return P();
|
|
101
101
|
case l.DELETE:
|
|
102
|
-
return
|
|
102
|
+
return i("delete");
|
|
103
103
|
case l.RESTORE:
|
|
104
|
-
return await
|
|
104
|
+
return await O();
|
|
105
105
|
case l.PUBLISH:
|
|
106
|
-
return
|
|
106
|
+
return i("publish");
|
|
107
107
|
case l.UPD_PROPS:
|
|
108
108
|
case "edit":
|
|
109
|
-
return
|
|
109
|
+
return re();
|
|
110
110
|
case l.SHARE:
|
|
111
|
-
return
|
|
111
|
+
return i("share");
|
|
112
112
|
default:
|
|
113
113
|
throw Error(`Unknown action: ${n.id}`);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
function N(n) {
|
|
117
|
-
const
|
|
117
|
+
const A = f.length + t.length, v = f.length === 1 || t.length === 1, z = A === 1, M = t.length === 0;
|
|
118
118
|
switch (n.id) {
|
|
119
119
|
case l.OPEN:
|
|
120
120
|
return z;
|
|
121
121
|
case l.MANAGE:
|
|
122
|
-
return
|
|
122
|
+
return v;
|
|
123
123
|
case l.PUBLISH:
|
|
124
|
-
return
|
|
124
|
+
return v && M;
|
|
125
125
|
case l.UPD_PROPS:
|
|
126
|
-
return
|
|
126
|
+
return v && M;
|
|
127
127
|
case l.SHARE:
|
|
128
|
-
return
|
|
128
|
+
return M && v;
|
|
129
129
|
case l.PRINT:
|
|
130
|
-
return
|
|
130
|
+
return v && M;
|
|
131
131
|
case "edit":
|
|
132
132
|
return z;
|
|
133
133
|
default:
|
|
134
134
|
return !0;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
const
|
|
138
|
-
async function
|
|
137
|
+
const k = () => !0;
|
|
138
|
+
async function O() {
|
|
139
139
|
try {
|
|
140
|
-
if (
|
|
140
|
+
if (m)
|
|
141
141
|
await C.mutate();
|
|
142
142
|
else
|
|
143
143
|
throw new Error("Cannot restore untrashed resources");
|
|
144
|
-
|
|
144
|
+
b();
|
|
145
145
|
} catch (n) {
|
|
146
146
|
console.error(n);
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function b() {
|
|
150
150
|
var n;
|
|
151
|
-
|
|
151
|
+
i("void"), s != null && s.id && ((n = document.getElementById(s == null ? void 0 : s.id)) == null || n.focus());
|
|
152
152
|
}
|
|
153
|
-
const
|
|
154
|
-
o === n && (
|
|
155
|
-
},
|
|
156
|
-
function
|
|
157
|
-
f && f.length > 0
|
|
153
|
+
const c = (n) => () => {
|
|
154
|
+
o === n && (b(), B(), D());
|
|
155
|
+
}, x = c("move"), H = c("move"), U = c("delete"), h = c("delete"), X = c("publish"), Z = c("publish"), W = c("edit_folder"), ee = c("edit_folder"), se = c("edit_resource"), te = c("edit_resource"), ne = c("share"), oe = c("share");
|
|
156
|
+
function re() {
|
|
157
|
+
if (f && f.length > 0) {
|
|
158
|
+
const n = S[0].assetId;
|
|
159
|
+
(p == null ? void 0 : p.app) == "scrapbook" ? be({
|
|
160
|
+
searchParams: g,
|
|
161
|
+
assetId: n
|
|
162
|
+
}) : i("edit_resource");
|
|
163
|
+
} else
|
|
164
|
+
i("edit_folder");
|
|
158
165
|
}
|
|
159
|
-
function
|
|
166
|
+
function ce(n) {
|
|
160
167
|
return n.id === "edit" && t.length > 0 ? "explorer.rename" : `explorer.actions.${n.id}`;
|
|
161
168
|
}
|
|
162
169
|
return {
|
|
163
|
-
onRestore:
|
|
164
|
-
actions:
|
|
170
|
+
onRestore: O,
|
|
171
|
+
actions: m ? p == null ? void 0 : p.trashActions : L,
|
|
165
172
|
selectedElement: [...S, ...r],
|
|
166
173
|
currentFolderId: d == null ? void 0 : d.id,
|
|
167
|
-
overrideLabel:
|
|
174
|
+
overrideLabel: ce,
|
|
168
175
|
handleClick: _,
|
|
169
|
-
isActivable:
|
|
170
|
-
isActionBarOpen:
|
|
176
|
+
isActivable: m ? k : N,
|
|
177
|
+
isActionBarOpen: a,
|
|
171
178
|
isMoveModalOpen: o === "move",
|
|
172
|
-
onMoveCancel:
|
|
179
|
+
onMoveCancel: x,
|
|
173
180
|
onMoveSuccess: H,
|
|
174
181
|
isDeleteModalOpen: o === "delete",
|
|
175
|
-
onDeleteCancel:
|
|
182
|
+
onDeleteCancel: h,
|
|
176
183
|
onDeleteSuccess: U,
|
|
177
184
|
isPublishModalOpen: o === "publish",
|
|
178
|
-
onPublishCancel:
|
|
179
|
-
onPublishSuccess:
|
|
185
|
+
onPublishCancel: Z,
|
|
186
|
+
onPublishSuccess: X,
|
|
180
187
|
isEditFolderOpen: o === "edit_folder",
|
|
181
|
-
onEditFolderCancel:
|
|
182
|
-
onEditFolderSuccess:
|
|
188
|
+
onEditFolderCancel: ee,
|
|
189
|
+
onEditFolderSuccess: W,
|
|
183
190
|
isEditResourceOpen: o === "edit_resource",
|
|
184
|
-
onEditResourceCancel:
|
|
185
|
-
onEditResourceSuccess:
|
|
191
|
+
onEditResourceCancel: te,
|
|
192
|
+
onEditResourceSuccess: se,
|
|
186
193
|
isShareResourceOpen: o === "share",
|
|
187
|
-
onShareResourceCancel:
|
|
188
|
-
onShareResourceSuccess:
|
|
189
|
-
onClearActionBar:
|
|
194
|
+
onShareResourceCancel: oe,
|
|
195
|
+
onShareResourceSuccess: ne,
|
|
196
|
+
onClearActionBar: b
|
|
190
197
|
};
|
|
191
198
|
}
|
|
192
|
-
function
|
|
193
|
-
resourceRights:
|
|
199
|
+
function Ie({
|
|
200
|
+
resourceRights: a,
|
|
194
201
|
roleExpected: e,
|
|
195
202
|
action: o,
|
|
196
|
-
children:
|
|
203
|
+
children: i,
|
|
197
204
|
renderWhenForbidden: s
|
|
198
205
|
}) {
|
|
199
206
|
const {
|
|
200
|
-
t:
|
|
207
|
+
t: R
|
|
201
208
|
} = q(), {
|
|
202
|
-
overrideLabel:
|
|
209
|
+
overrideLabel: p
|
|
203
210
|
} = Q(), {
|
|
204
211
|
visible: d
|
|
205
|
-
} =
|
|
212
|
+
} = Me({
|
|
206
213
|
roles: e,
|
|
207
|
-
rights:
|
|
214
|
+
rights: a,
|
|
208
215
|
action: o == null ? void 0 : o.id
|
|
209
216
|
}), {
|
|
210
217
|
setResourceActionDisable: f
|
|
211
218
|
} = K(), S = Y();
|
|
212
|
-
return d ? /* @__PURE__ */ u(j, { children:
|
|
219
|
+
return d ? /* @__PURE__ */ u(j, { children: i }) : s ? s() : S && !d ? /* @__PURE__ */ u(G, { type: "button", color: "primary", variant: "filled", onClick: () => {
|
|
213
220
|
f(!0);
|
|
214
|
-
}, children:
|
|
221
|
+
}, children: R(p(o)) }) : /* @__PURE__ */ u(j, {});
|
|
215
222
|
}
|
|
216
|
-
const
|
|
217
|
-
function
|
|
223
|
+
const we = /* @__PURE__ */ y(async () => await import("./ShareModal.js")), ge = /* @__PURE__ */ y(async () => await import("./PublishModal.js")), Fe = /* @__PURE__ */ y(async () => await import("./ResourceModal.js")), Pe = /* @__PURE__ */ y(async () => await import("./DeleteModal.js")), Te = /* @__PURE__ */ y(async () => await import("./MoveModal.js")), Be = /* @__PURE__ */ y(async () => await import("./FolderModal.js"));
|
|
224
|
+
function Ve() {
|
|
218
225
|
const {
|
|
219
|
-
t:
|
|
226
|
+
t: a
|
|
220
227
|
} = q(), {
|
|
221
228
|
actions: e,
|
|
222
229
|
selectedElement: o,
|
|
223
|
-
isMoveModalOpen:
|
|
230
|
+
isMoveModalOpen: i,
|
|
224
231
|
isDeleteModalOpen: s,
|
|
225
|
-
isPublishModalOpen:
|
|
226
|
-
isActionBarOpen:
|
|
232
|
+
isPublishModalOpen: R,
|
|
233
|
+
isActionBarOpen: p,
|
|
227
234
|
isEditFolderOpen: d,
|
|
228
235
|
overrideLabel: f,
|
|
229
236
|
onEditFolderCancel: S,
|
|
230
237
|
onEditFolderSuccess: r,
|
|
231
238
|
isEditResourceOpen: t,
|
|
232
|
-
onEditResourceCancel:
|
|
239
|
+
onEditResourceCancel: m,
|
|
233
240
|
onEditResourceSuccess: C,
|
|
234
|
-
isShareResourceOpen:
|
|
235
|
-
onShareResourceCancel:
|
|
236
|
-
onShareResourceSuccess:
|
|
237
|
-
onMoveCancel:
|
|
238
|
-
onMoveSuccess:
|
|
239
|
-
onDeleteCancel:
|
|
240
|
-
onDeleteSuccess:
|
|
241
|
-
onPublishCancel:
|
|
242
|
-
onPublishSuccess:
|
|
243
|
-
isActivable:
|
|
244
|
-
handleClick:
|
|
245
|
-
} = Q(),
|
|
241
|
+
isShareResourceOpen: E,
|
|
242
|
+
onShareResourceCancel: g,
|
|
243
|
+
onShareResourceSuccess: F,
|
|
244
|
+
onMoveCancel: P,
|
|
245
|
+
onMoveSuccess: T,
|
|
246
|
+
onDeleteCancel: B,
|
|
247
|
+
onDeleteSuccess: D,
|
|
248
|
+
onPublishCancel: L,
|
|
249
|
+
onPublishSuccess: _,
|
|
250
|
+
isActivable: N,
|
|
251
|
+
handleClick: k
|
|
252
|
+
} = Q(), O = J(), b = ve(), c = Ae(), x = de(p, {
|
|
246
253
|
from: {
|
|
247
254
|
opacity: 0,
|
|
248
255
|
transform: "translateY(100%)"
|
|
@@ -257,19 +264,19 @@ function je() {
|
|
|
257
264
|
}
|
|
258
265
|
});
|
|
259
266
|
return /* @__PURE__ */ V(j, { children: [
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}, children:
|
|
263
|
-
/* @__PURE__ */ V(
|
|
264
|
-
|
|
265
|
-
s && /* @__PURE__ */ u(
|
|
266
|
-
|
|
267
|
-
d && /* @__PURE__ */ u(
|
|
268
|
-
t && /* @__PURE__ */ u(
|
|
269
|
-
|
|
267
|
+
x((H, U) => U && /* @__PURE__ */ u(fe.div, { className: "position-fixed bottom-0 start-0 end-0 z-3", style: H, children: /* @__PURE__ */ u(le, { children: e == null ? void 0 : e.filter((h) => h.available && h.target === "actionbar").map((h) => N(h) && /* @__PURE__ */ u(Ie, { resourceRights: o, roleExpected: h.right, action: h, children: /* @__PURE__ */ u(G, { id: h.id, type: "button", color: "primary", variant: "filled", onClick: () => {
|
|
268
|
+
k(h);
|
|
269
|
+
}, children: a(f(h)) }, h.id) }, h.id)) }) })),
|
|
270
|
+
/* @__PURE__ */ V(ae, { fallback: /* @__PURE__ */ u(ue, {}), children: [
|
|
271
|
+
i && /* @__PURE__ */ u(Te, { isOpen: i, onCancel: P, onSuccess: T }),
|
|
272
|
+
s && /* @__PURE__ */ u(Pe, { isOpen: s, onCancel: B, onSuccess: D }),
|
|
273
|
+
R && /* @__PURE__ */ u(ge, { isOpen: R, resource: O[0], onCancel: L, onSuccess: _ }),
|
|
274
|
+
d && /* @__PURE__ */ u(Be, { edit: !0, isOpen: d, onCancel: S, onSuccess: r }),
|
|
275
|
+
t && /* @__PURE__ */ u(Fe, { mode: "update", actions: e, isOpen: t, selectedResource: O[0], updateResource: c, onCancel: m, onSuccess: C }),
|
|
276
|
+
E && /* @__PURE__ */ u(we, { isOpen: E, resource: O[0], updateResource: c, shareResource: b, onCancel: g, onSuccess: F })
|
|
270
277
|
] })
|
|
271
278
|
] });
|
|
272
279
|
}
|
|
273
280
|
export {
|
|
274
|
-
|
|
281
|
+
Ve as default
|
|
275
282
|
};
|
package/lib/AppAction.js
CHANGED
|
@@ -1,32 +1,39 @@
|
|
|
1
|
-
import { jsxs as p, Fragment as
|
|
2
|
-
import { Suspense as
|
|
3
|
-
import { Plus as
|
|
4
|
-
import { useToggle as S, useOdeClient as
|
|
1
|
+
import { jsxs as p, Fragment as f, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense as C, lazy as g } from "react";
|
|
3
|
+
import { Plus as h } from "@edifice-ui/icons";
|
|
4
|
+
import { useToggle as S, useOdeClient as O, Button as R, LoadingScreen as b } from "@edifice-ui/react";
|
|
5
5
|
import { useTranslation as x } from "react-i18next";
|
|
6
|
-
import { u as y, a as A, b, c as F } from "./index2.js";
|
|
6
|
+
import { u as y, a as A, b as I, c as k, d as F, g as P } from "./index2.js";
|
|
7
7
|
import "edifice-ts-client";
|
|
8
8
|
import "i18next";
|
|
9
9
|
import "zustand";
|
|
10
10
|
import "@tanstack/react-query";
|
|
11
|
-
const
|
|
12
|
-
function
|
|
13
|
-
const [
|
|
14
|
-
appCode:
|
|
15
|
-
} =
|
|
16
|
-
t:
|
|
17
|
-
} = x(
|
|
18
|
-
clearSelectedItems:
|
|
19
|
-
clearSelectedIds:
|
|
11
|
+
const T = /* @__PURE__ */ g(async () => await import("./ResourceModal.js"));
|
|
12
|
+
function G() {
|
|
13
|
+
const [o, t] = S(), {
|
|
14
|
+
appCode: s
|
|
15
|
+
} = O(), {
|
|
16
|
+
t: n
|
|
17
|
+
} = x(s), {
|
|
18
|
+
clearSelectedItems: c,
|
|
19
|
+
clearSelectedIds: l
|
|
20
20
|
} = y(), {
|
|
21
|
-
data:
|
|
22
|
-
} = A(),
|
|
23
|
-
return
|
|
24
|
-
/* @__PURE__ */ e(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
data: r
|
|
22
|
+
} = A(), i = r == null ? void 0 : r.find((d) => d.id === "create"), a = I(), u = k(), m = F();
|
|
23
|
+
return i ? /* @__PURE__ */ p(f, { children: [
|
|
24
|
+
/* @__PURE__ */ e(R, { type: "button", color: "primary", variant: "filled", leftIcon: /* @__PURE__ */ e(h, {}), className: "ms-auto", onClick: () => {
|
|
25
|
+
if (s == "scrapbook") {
|
|
26
|
+
P({
|
|
27
|
+
searchParams: m,
|
|
28
|
+
folderId: a.id
|
|
29
|
+
});
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
c(), l(), t();
|
|
33
|
+
}, children: n("explorer.create.title") }),
|
|
34
|
+
/* @__PURE__ */ e(C, { fallback: /* @__PURE__ */ e(b, {}), children: o && /* @__PURE__ */ e(T, { mode: "create", actions: r, currentFolder: a, createResource: u, isOpen: o, onSuccess: t, onCancel: t }) })
|
|
28
35
|
] }) : null;
|
|
29
36
|
}
|
|
30
37
|
export {
|
|
31
|
-
|
|
38
|
+
G as default
|
|
32
39
|
};
|
package/lib/DeleteModal.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as n, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { Modal as a, Button as d } from "@edifice-ui/react";
|
|
3
3
|
import { createPortal as m } from "react-dom";
|
|
4
4
|
import { useTranslation as p } from "react-i18next";
|
|
5
|
-
import {
|
|
5
|
+
import { s as c, t as h, e as u } from "./index2.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "@edifice-ui/icons";
|
|
8
8
|
import "edifice-ts-client";
|
|
@@ -16,8 +16,8 @@ function f({
|
|
|
16
16
|
async function o() {
|
|
17
17
|
try {
|
|
18
18
|
e ? await i.mutate() : await r.mutate(), t == null || t();
|
|
19
|
-
} catch (
|
|
20
|
-
console.error(
|
|
19
|
+
} catch (s) {
|
|
20
|
+
console.error(s);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
return {
|
|
@@ -34,16 +34,16 @@ function k({
|
|
|
34
34
|
t: e
|
|
35
35
|
} = p(), {
|
|
36
36
|
isTrashFolder: o,
|
|
37
|
-
onDelete:
|
|
37
|
+
onDelete: s
|
|
38
38
|
} = f({
|
|
39
39
|
onSuccess: i
|
|
40
40
|
});
|
|
41
|
-
return /* @__PURE__ */ m(/* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ m(/* @__PURE__ */ n(a, { isOpen: t, onModalClose: r, id: "deleteModal", children: [
|
|
42
42
|
/* @__PURE__ */ l(a.Header, { onModalClose: r, children: e(o ? "explorer.delete.title" : "explorer.trash.title") }),
|
|
43
43
|
/* @__PURE__ */ l(a.Body, { children: /* @__PURE__ */ l("p", { className: "body", children: e(o ? "explorer.delete.subtitle" : "explorer.trash.subtitle") }) }),
|
|
44
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ n(a.Footer, { children: [
|
|
45
45
|
/* @__PURE__ */ l(d, { color: "tertiary", onClick: r, type: "button", variant: "ghost", children: e("explorer.cancel") }),
|
|
46
|
-
/* @__PURE__ */ l(d, { color: "danger", onClick:
|
|
46
|
+
/* @__PURE__ */ l(d, { color: "danger", onClick: s, type: "button", variant: "filled", children: e(o ? "explorer.delete" : "explorer.trash") })
|
|
47
47
|
] })
|
|
48
48
|
] }), document.getElementById("portal"));
|
|
49
49
|
}
|
package/lib/EmptyScreenApp.js
CHANGED
|
@@ -1,37 +1,43 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useOdeClient as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { a as
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useOdeClient as c, useOdeTheme as d, usePaths as m, EmptyScreen as u } from "@edifice-ui/react";
|
|
3
|
+
import { useTranslation as x } from "react-i18next";
|
|
4
|
+
import { a as y } from "./index2.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "@edifice-ui/icons";
|
|
7
7
|
import "edifice-ts-client";
|
|
8
8
|
import "i18next";
|
|
9
9
|
import "zustand";
|
|
10
10
|
import "@tanstack/react-query";
|
|
11
|
-
function
|
|
11
|
+
function $() {
|
|
12
12
|
const {
|
|
13
13
|
appCode: r
|
|
14
|
-
} =
|
|
15
|
-
theme:
|
|
16
|
-
} =
|
|
17
|
-
t:
|
|
18
|
-
} =
|
|
19
|
-
data:
|
|
20
|
-
} =
|
|
14
|
+
} = c(), {
|
|
15
|
+
theme: e
|
|
16
|
+
} = d(), [s] = m(), {
|
|
17
|
+
t: l
|
|
18
|
+
} = x(), {
|
|
19
|
+
data: i
|
|
20
|
+
} = y(), t = i == null ? void 0 : i.find((o) => o.id === "create"), p = () => t != null && t.available && (e != null && e.is1d) ? l("explorer.emptyScreen.txt1d.create", {
|
|
21
21
|
ns: r
|
|
22
|
-
}) :
|
|
22
|
+
}) : t != null && t.available && !(e != null && e.is1d) ? l("explorer.emptyScreen.txt2d.create", {
|
|
23
23
|
ns: r
|
|
24
|
-
}) : !(
|
|
24
|
+
}) : !(t != null && t.available) && (e != null && e.is1d) ? l("explorer.emptyScreen.txt1d.consultation", {
|
|
25
25
|
ns: r
|
|
26
|
-
}) :
|
|
26
|
+
}) : l("explorer.emptyScreen.txt2d.consultation", {
|
|
27
27
|
ns: r
|
|
28
|
-
})
|
|
29
|
-
|
|
28
|
+
}), n = () => t != null && t.available && (e != null && e.is1d) ? l("explorer.emptyScreen.title1d.create", {
|
|
29
|
+
ns: r
|
|
30
|
+
}) : t != null && t.available && !(e != null && e.is1d) ? l("explorer.emptyScreen.title2d.create", {
|
|
31
|
+
ns: r
|
|
32
|
+
}) : !(t != null && t.available) && (e != null && e.is1d) ? l("explorer.emptyScreen.title1d.consultation", {
|
|
30
33
|
ns: r
|
|
31
|
-
})
|
|
34
|
+
}) : l("explorer.emptyScreen.title2d.consultation", {
|
|
35
|
+
ns: r
|
|
36
|
+
});
|
|
37
|
+
return /* @__PURE__ */ a(u, { imageSrc: `${s}/emptyscreen/illu-${r}.svg`, imageAlt: l("explorer.emptyScreen.app.alt", {
|
|
32
38
|
ns: r
|
|
33
|
-
}) :
|
|
39
|
+
}), title: n(), text: p() });
|
|
34
40
|
}
|
|
35
41
|
export {
|
|
36
|
-
|
|
42
|
+
$ as default
|
|
37
43
|
};
|
package/lib/FolderModal.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as b, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { useId as
|
|
3
|
-
import { Modal as m, FormControl as
|
|
2
|
+
import { useId as j, useEffect as B } from "react";
|
|
3
|
+
import { Modal as m, FormControl as L, Label as w, Input as R, Button as I } from "@edifice-ui/react";
|
|
4
4
|
import { createPortal as T } from "react-dom";
|
|
5
5
|
import { useTranslation as U } from "react-i18next";
|
|
6
6
|
import { FOLDER as V } from "edifice-ts-client";
|
|
7
7
|
import { useForm as _ } from "react-hook-form";
|
|
8
|
-
import {
|
|
8
|
+
import { j as k, b as z, q as A, r as H } from "./index2.js";
|
|
9
9
|
import "@edifice-ui/icons";
|
|
10
10
|
import "i18next";
|
|
11
11
|
import "zustand";
|
|
@@ -32,15 +32,15 @@ function P({
|
|
|
32
32
|
values: {
|
|
33
33
|
name: u || ""
|
|
34
34
|
}
|
|
35
|
-
}), M =
|
|
35
|
+
}), M = j(), q = async function({
|
|
36
36
|
name: y
|
|
37
37
|
}) {
|
|
38
38
|
var C;
|
|
39
39
|
try {
|
|
40
40
|
if (o) {
|
|
41
|
-
const i = (C = l[0]) == null ? void 0 : C.parentId,
|
|
41
|
+
const i = (C = l[0]) == null ? void 0 : C.parentId, E = l[0].id;
|
|
42
42
|
await f.mutate({
|
|
43
|
-
folderId:
|
|
43
|
+
folderId: E,
|
|
44
44
|
parentId: i,
|
|
45
45
|
name: y
|
|
46
46
|
}), t(), e == null || e();
|
|
@@ -55,7 +55,7 @@ function P({
|
|
|
55
55
|
console.error(i);
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
-
function
|
|
58
|
+
function D() {
|
|
59
59
|
t(), s();
|
|
60
60
|
}
|
|
61
61
|
return {
|
|
@@ -67,8 +67,8 @@ function P({
|
|
|
67
67
|
register: p,
|
|
68
68
|
setFocus: h,
|
|
69
69
|
handleSubmit: n,
|
|
70
|
-
onCancel:
|
|
71
|
-
onSubmit:
|
|
70
|
+
onCancel: D,
|
|
71
|
+
onSubmit: q
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
function oe({
|
|
@@ -94,11 +94,11 @@ function oe({
|
|
|
94
94
|
onSuccess: s,
|
|
95
95
|
onClose: l
|
|
96
96
|
});
|
|
97
|
-
return
|
|
97
|
+
return B(() => {
|
|
98
98
|
o && d("name");
|
|
99
99
|
}, [o, d]), o ? /* @__PURE__ */ T(/* @__PURE__ */ b(m, { isOpen: o, onModalClose: n, id: "modal_" + t, children: [
|
|
100
100
|
/* @__PURE__ */ a(m.Header, { onModalClose: n, children: r(e ? "explorer.rename.folder" : "explorer.create.folder") }),
|
|
101
|
-
/* @__PURE__ */ a(m.Body, { children: /* @__PURE__ */ a("form", { id: t, onSubmit: h(p), children: /* @__PURE__ */ b(
|
|
101
|
+
/* @__PURE__ */ a(m.Body, { children: /* @__PURE__ */ a("form", { id: t, onSubmit: h(p), children: /* @__PURE__ */ b(L, { id: "nameFolder", isRequired: !0, children: [
|
|
102
102
|
/* @__PURE__ */ a(w, { children: r("explorer.create.folder.name") }),
|
|
103
103
|
/* @__PURE__ */ a(R, { type: "text", ...F("name", {
|
|
104
104
|
required: !0,
|