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