ode-explorer 1.3.2 → 1.3.3-develop-b2school.202402081140

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 08/02/2024 11:41:23
@@ -1,248 +1,268 @@
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 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
+ import { useTranslation as X } from "react-i18next";
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 be({
13
- roles: c,
14
- rights: e,
15
- action: o
12
+ function Be({
13
+ roles: r,
14
+ rights: o,
15
+ action: n
16
16
  }) {
17
- const [a, s] = F(!1), {
18
- user: m
19
- } = ae(), R = Y();
20
- $(() => {
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);
17
+ const [h, s] = T(!1), {
18
+ user: S
19
+ } = le(), p = q();
20
+ K(() => {
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 p = await w.rights().sessionHasResourceRight(c, t);
30
- s(p);
29
+ const f = await F.rights().sessionHasResourceRight(r, c);
30
+ s(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
+ }, 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 t = await w.rights().sessionHasResourceRightForEachList(c, r);
38
- s(t);
37
+ const c = await F.rights().sessionHasResourceRightForEachList(r, l);
38
+ s(c);
39
39
  }
40
- }, S = async function() {
41
- var r, t, p;
42
- if (c === void 0) {
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 (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)) {
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 (e instanceof Array)
51
- if (e.length > 0)
52
- if (typeof e[0] == "string")
53
- await d(e);
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 C = e.map((O) => O.rights);
56
- await f(C);
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 e == "string" ? await d(e) : await d(e.rights);
61
+ typeof o == "string" ? await m(o) : await m(o.rights);
62
62
  };
63
63
  return {
64
- visible: a,
65
- refreshState: S
64
+ visible: h,
65
+ refreshState: R
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(), {
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);
68
+ function ee() {
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
+ } = W(), {
76
+ data: N
77
+ } = Me();
78
+ K(() => {
79
+ if (a.length === 0 && c.length === 0) {
80
+ o(!1);
81
81
  return;
82
82
  }
83
- if (O) {
84
- e(!1);
83
+ if (b) {
84
+ o(!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
+ o(!0);
88
+ }, [a, c]);
89
+ async function k(e) {
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 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 d.MOVE:
98
+ return h("move");
99
+ case d.PRINT:
100
+ return x();
101
+ case d.DELETE:
102
+ return h("delete");
103
+ case d.RESTORE:
104
+ return await A();
105
+ case d.PUBLISH:
106
+ return h("publish");
107
+ case d.UPD_PROPS:
108
108
  case "edit":
109
- return oe();
110
- case l.SHARE:
111
- return a("share");
109
+ return re();
110
+ case "export":
111
+ return ce();
112
+ case d.SHARE:
113
+ return h("share");
112
114
  default:
113
- throw Error(`Unknown action: ${n.id}`);
115
+ throw Error(`Unknown action: ${e.id}`);
114
116
  }
115
117
  }
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;
118
+ function H(e) {
119
+ const P = a.length + c.length, I = a.length === 1 || c.length === 1, G = P === 1, w = c.length === 0;
120
+ switch (e.id) {
121
+ case d.OPEN:
122
+ return G;
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;
131
133
  case "edit":
132
- return z;
134
+ return G;
133
135
  default:
134
136
  return !0;
135
137
  }
136
138
  }
137
- const x = () => !0;
138
- async function v() {
139
+ const U = () => !0;
140
+ async function A() {
139
141
  try {
140
- if (p)
141
- await C.mutate();
142
+ if (f)
143
+ await E.mutate();
142
144
  else
143
145
  throw new Error("Cannot restore untrashed resources");
144
- E();
145
- } catch (n) {
146
- console.error(n);
146
+ g();
147
+ } catch (e) {
148
+ console.error(e);
147
149
  }
148
150
  }
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());
151
+ function g() {
152
+ var e;
153
+ h("void"), s != null && s.id && ((e = document.getElementById(s == null ? void 0 : s.id)) == null || e.focus());
152
154
  }
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");
156
- function oe() {
157
- f && f.length > 0 ? a("edit_resource") : a("edit_folder");
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({
162
+ searchParams: O,
163
+ assetId: e
164
+ }) : h("edit_resource");
165
+ } else
166
+ h("edit_folder");
158
167
  }
159
- function re(n) {
160
- return n.id === "edit" && t.length > 0 ? "explorer.rename" : `explorer.actions.${n.id}`;
168
+ function ce() {
169
+ if (a && a.length > 0) {
170
+ const e = R[0].assetId;
171
+ we({
172
+ searchParams: O,
173
+ assetId: e
174
+ });
175
+ }
176
+ }
177
+ function ae(e) {
178
+ return e.id === "edit" && c.length > 0 ? "explorer.rename" : `explorer.actions.${e.id}`;
161
179
  }
162
180
  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,
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",
184
- onEditResourceCancel: se,
185
- onEditResourceSuccess: ee,
186
- isShareResourceOpen: o === "share",
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,
186
+ handleClick: k,
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",
187
205
  onShareResourceCancel: ne,
188
- onShareResourceSuccess: te,
189
- onClearActionBar: E
206
+ onShareResourceSuccess: oe,
207
+ onClearActionBar: g
190
208
  };
191
209
  }
192
- function ve({
193
- resourceRights: c,
194
- roleExpected: e,
195
- action: o,
196
- children: a,
210
+ function xe({
211
+ resourceRights: r,
212
+ roleExpected: o,
213
+ action: n,
214
+ children: h,
197
215
  renderWhenForbidden: s
198
216
  }) {
199
217
  const {
200
- t: m
201
- } = q(), {
202
- overrideLabel: R
203
- } = Q(), {
204
- visible: d
205
- } = be({
206
- roles: e,
207
- rights: c,
208
- action: o == null ? void 0 : o.id
218
+ t: S
219
+ } = X(), {
220
+ overrideLabel: p
221
+ } = ee(), {
222
+ visible: m
223
+ } = Be({
224
+ roles: o,
225
+ rights: r,
226
+ action: n == null ? void 0 : n.id
209
227
  }), {
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, {});
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($, {});
215
233
  }
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() {
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() {
218
236
  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,
237
+ appCode: r
238
+ } = ue(), {
239
+ t: o
240
+ } = X(), {
241
+ actions: n,
242
+ selectedElement: h,
243
+ isMoveModalOpen: s,
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,
234
254
  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, {
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, {
246
266
  from: {
247
267
  opacity: 0,
248
268
  transform: "translateY(100%)"
@@ -256,20 +276,20 @@ function je() {
256
276
  transform: "translateY(100%)"
257
277
  }
258
278
  });
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 })
279
+ return /* @__PURE__ */ J($, { children: [
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 })
270
290
  ] })
271
291
  ] });
272
292
  }
273
293
  export {
274
- je as default
294
+ Qe as default
275
295
  };
package/lib/AppAction.js CHANGED
@@ -1,32 +1,39 @@
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 b, Fragment as h, jsx as e } from "react/jsx-runtime";
2
+ import { Suspense as S, lazy as A } from "react";
3
+ import { Plus as O } from "@edifice-ui/icons";
4
+ import { useToggle as P, useOdeClient as R, Button as x, LoadingScreen as y, isActionAvailable as I, BlogPublic as k } from "@edifice-ui/react";
5
+ import { useTranslation as F } from "react-i18next";
6
+ import { u as T, a as j, b as v, c as B, d as w, g as z } 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(), {
16
- t: s
17
- } = x(n), {
18
- clearSelectedItems: a,
19
- clearSelectedIds: c
20
- } = y(), {
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();
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 }) })
11
+ const L = /* @__PURE__ */ A(async () => await import("./ResourceModal.js"));
12
+ function V() {
13
+ const [s, t] = P(), {
14
+ appCode: r
15
+ } = R(), {
16
+ t: n
17
+ } = F(r), {
18
+ clearSelectedItems: l,
19
+ clearSelectedIds: i
20
+ } = T(), {
21
+ data: o
22
+ } = j(), u = o == null ? void 0 : o.find((a) => a.id === "create"), c = v(), d = B(), m = w();
23
+ return u ? /* @__PURE__ */ b(h, { children: [
24
+ /* @__PURE__ */ e(x, { type: "button", color: "primary", variant: "filled", leftIcon: /* @__PURE__ */ e(O, {}), className: "ms-auto", onClick: () => {
25
+ if (r == "scrapbook") {
26
+ z({
27
+ searchParams: m,
28
+ folderId: c.id
29
+ });
30
+ return;
31
+ }
32
+ l(), i(), t();
33
+ }, children: n("explorer.create.title") }),
34
+ /* @__PURE__ */ e(S, { fallback: /* @__PURE__ */ e(y, {}), children: s && /* @__PURE__ */ e(L, { mode: "create", currentFolder: c, createResource: d, isOpen: s, onSuccess: t, onCancel: t, children: (a, p, f, C, g) => r === "blog" && I("createPublic", o) && /* @__PURE__ */ e(k, { appCode: r, isUpdating: p, resource: a, watch: f, setValue: C, register: g }) }) })
28
35
  ] }) : null;
29
36
  }
30
37
  export {
31
- q as default
38
+ V as default
32
39
  };
@@ -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 { q as c, r as h, d as u } from "./index2.js";
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 k({
28
+ function j({
29
29
  isOpen: t,
30
30
  onSuccess: i = () => ({}),
31
31
  onCancel: r = () => ({})
@@ -48,5 +48,5 @@ function k({
48
48
  ] }), document.getElementById("portal"));
49
49
  }
50
50
  export {
51
- k as default
51
+ j as default
52
52
  };