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