ode-explorer 1.3.2-dev.202401241302 → 1.3.2-develop-pedago.202401251156

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