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