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