ode-explorer 1.3.3-develop.202402061659 → 1.3.3-develop.202402071721

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 06/02/2024 16:59:59
1
+ ode-explorer=1.0-b2school-SNAPSHOT 07/02/2024 17:22:15
@@ -1,250 +1,268 @@
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";
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 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";
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 Me({
13
- roles: n,
14
- rights: s,
15
- action: t
12
+ function Be({
13
+ roles: r,
14
+ rights: o,
15
+ action: n
16
16
  }) {
17
- const [d, e] = T(!1), {
18
- user: m
19
- } = ae(), R = G();
17
+ const [h, s] = T(!1), {
18
+ user: S
19
+ } = le(), p = q();
20
20
  K(() => {
21
- S();
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);
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 f = await B.rights().sessionHasResourceRight(n, o);
30
- e(f);
29
+ const f = await F.rights().sessionHasResourceRight(r, c);
30
+ s(f);
31
31
  }
32
- }, l = async function(a) {
33
- if (n instanceof Array) {
34
- const o = await B.rights().sessionHasAtLeastOneResourceRightForEachList(n, a);
35
- e(o);
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 o = await B.rights().sessionHasResourceRightForEachList(n, a);
38
- e(o);
37
+ const c = await F.rights().sessionHasResourceRightForEachList(r, l);
38
+ s(c);
39
39
  }
40
- }, S = async function() {
41
- var a, o, f;
42
- if (n === void 0) {
43
- e(!0);
40
+ }, R = async function() {
41
+ var l, c, f;
42
+ if (r === void 0) {
43
+ s(!0);
44
44
  return;
45
45
  }
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);
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
+ s(!0);
48
48
  return;
49
49
  }
50
- if (s instanceof Array)
51
- if (s.length > 0)
52
- if (typeof s[0] == "string")
53
- await p(s);
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 E = s.map((O) => O.rights);
56
- await l(E);
55
+ const E = o.map((b) => b.rights);
56
+ await a(E);
57
57
  }
58
58
  else
59
- e(!1);
59
+ s(!1);
60
60
  else
61
- typeof s == "string" ? await p(s) : await p(s.rights);
61
+ typeof o == "string" ? await m(o) : await m(o.rights);
62
62
  };
63
63
  return {
64
- visible: d,
65
- refreshState: S
64
+ visible: h,
65
+ refreshState: R
66
66
  };
67
67
  }
68
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
- openResource: I,
71
- printSelectedResource: D,
72
- openFolder: L,
73
- clearSelectedItems: _,
74
- clearSelectedIds: N
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
- data: x
77
- } = Ae();
76
+ data: N
77
+ } = Me();
78
78
  K(() => {
79
- if (l.length === 0 && o.length === 0) {
80
- s(!1);
79
+ if (a.length === 0 && c.length === 0) {
80
+ o(!1);
81
81
  return;
82
82
  }
83
- if (O) {
84
- s(!1);
83
+ if (b) {
84
+ o(!1);
85
85
  return;
86
86
  }
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
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 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:
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 u.SHARE:
111
- return d("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: ${r.id}`);
115
+ throw Error(`Unknown action: ${e.id}`);
114
116
  }
115
117
  }
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;
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 q;
134
+ return G;
133
135
  default:
134
136
  return !0;
135
137
  }
136
138
  }
137
- const k = () => !0;
138
- async function M() {
139
+ const U = () => !0;
140
+ async function A() {
139
141
  try {
140
142
  if (f)
141
143
  await E.mutate();
142
144
  else
143
145
  throw new Error("Cannot restore untrashed resources");
144
- C();
145
- } catch (r) {
146
- console.error(r);
146
+ g();
147
+ } catch (e) {
148
+ console.error(e);
147
149
  }
148
150
  }
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());
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 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
- function oe() {
157
- l && l.length > 0 ? d("edit_resource") : d("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(r) {
160
- return r.id === "edit" && o.length > 0 ? "explorer.rename" : `explorer.actions.${r.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: M,
164
- actions: f ? R == null ? void 0 : R.trashActions : x,
165
- selectedElement: [...S, ...a],
166
- currentFolderId: p == null ? void 0 : p.id,
167
- overrideLabel: re,
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,
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,
179
197
  onPublishSuccess: y,
180
- isEditFolderOpen: t === "edit_folder",
181
- onEditFolderCancel: z,
182
- onEditFolderSuccess: i,
183
- isEditResourceOpen: t === "edit_resource",
184
- onEditResourceCancel: se,
185
- onEditResourceSuccess: V,
186
- isShareResourceOpen: t === "share",
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: C
206
+ onShareResourceSuccess: oe,
207
+ onClearActionBar: g
190
208
  };
191
209
  }
192
- function we({
193
- resourceRights: n,
194
- roleExpected: s,
195
- action: t,
196
- children: d,
197
- renderWhenForbidden: e
210
+ function xe({
211
+ resourceRights: r,
212
+ roleExpected: o,
213
+ action: n,
214
+ children: h,
215
+ renderWhenForbidden: s
198
216
  }) {
199
217
  const {
200
- t: m
218
+ t: S
201
219
  } = X(), {
202
- overrideLabel: R
220
+ overrideLabel: p
203
221
  } = ee(), {
204
- visible: p
205
- } = Me({
206
- roles: s,
207
- rights: n,
208
- action: t == null ? void 0 : t.id
222
+ visible: m
223
+ } = Be({
224
+ roles: o,
225
+ rights: r,
226
+ action: n == null ? void 0 : n.id
209
227
  }), {
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($, {});
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 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() {
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
- appCode: n
220
- } = ie(), {
221
- t: s
237
+ appCode: r
238
+ } = ue(), {
239
+ t: o
222
240
  } = 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,
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,
233
251
  isEditResourceOpen: f,
234
252
  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, {
253
+ onEditResourceSuccess: b,
254
+ isShareResourceOpen: O,
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, {
248
266
  from: {
249
267
  opacity: 0,
250
268
  transform: "translateY(100%)"
@@ -259,19 +277,19 @@ function $e() {
259
277
  }
260
278
  });
261
279
  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 })
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 })
272
290
  ] })
273
291
  ] });
274
292
  }
275
293
  export {
276
- $e as default
294
+ Qe as default
277
295
  };
package/lib/AppAction.js CHANGED
@@ -1,32 +1,39 @@
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";
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 T = /* @__PURE__ */ A(async () => await import("./ResourceModal.js"));
12
- function K() {
13
- const [n, o] = O(), {
11
+ const L = /* @__PURE__ */ A(async () => await import("./ResourceModal.js"));
12
+ function V() {
13
+ const [s, t] = P(), {
14
14
  appCode: r
15
15
  } = R(), {
16
- t: s
17
- } = P(r), {
18
- clearSelectedItems: a,
19
- clearSelectedIds: l
20
- } = j(), {
21
- data: t
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
- }, children: s("explorer.create.title") }),
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 }) }) })
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
- K 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
  };