ode-explorer 2.1.1 → 2.1.2-develop.202502181359

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,10 +1,10 @@
1
1
  import { jsx as a, Fragment as X, jsxs as Q } from "react/jsx-runtime";
2
2
  import { useState as L, useEffect as Z, Suspense as pe, lazy as b } from "react";
3
3
  import { odeServices as D, ACTION as c, isActionAvailable as he } from "@edifice.io/client";
4
- import { useUser as fe, Button as W, useEdificeClient as Re, ActionBar as me, LoadingScreen as Se, BlogPublic as Ee, ShareModal as Oe, ShareBlog as Ce } from "@edifice.io/react";
4
+ import { useUser as fe, Button as W, useEdificeClient as Re, ActionBar as me, BlogPublic as Se, ShareModal as Ee, ShareBlog as Oe, LoadingScreen as Ce } from "@edifice.io/react";
5
5
  import { useTransition as be, animated as ye } from "@react-spring/web";
6
6
  import { useTranslation as ee } from "react-i18next";
7
- import { f as J, u as Ie, c as ge, h as Ae, i as se, j as ve, k as Me, l as Pe, m as we, e as Fe, n as xe, o as Te, a as te, b as Be, p as De, q as Le, r as _e } from "./index2.js";
7
+ import { f as J, u as Ie, c as ge, h as ve, i as se, j as Ae, k as Me, l as Pe, m as we, e as Fe, n as xe, o as Te, a as te, b as Be, p as De, q as Le, r as _e } from "./index2.js";
8
8
  function Ne({
9
9
  roles: r,
10
10
  rights: s,
@@ -62,7 +62,7 @@ function Ne({
62
62
  };
63
63
  }
64
64
  function oe() {
65
- const [r, s] = L(!1), [t, p] = L("void"), [o, E] = L(), i = Ie((e) => e.config), m = ge(), h = Ae(), f = se(), l = ve(), n = Me(), R = J(), y = Pe(), I = we(), M = Fe(), _ = xe(), N = Te(), {
65
+ const [r, s] = L(!1), [t, p] = L("void"), [o, E] = L(), i = Ie((e) => e.config), m = ge(), h = ve(), f = se(), l = Ae(), n = Me(), R = J(), y = Pe(), I = we(), M = Fe(), _ = xe(), N = Te(), {
66
66
  openResource: P,
67
67
  printSelectedResource: k,
68
68
  openFolder: H,
@@ -160,7 +160,7 @@ function oe() {
160
160
  }
161
161
  const u = (e) => () => {
162
162
  t === e && (g(), w(), F());
163
- }, S = u("move"), V = u("move"), T = u("delete"), $ = u("delete"), A = u("publish"), v = u("publish"), d = u("edit_folder"), q = u("edit_folder"), G = u("edit_resource"), re = u("edit_resource"), ne = u("share"), ce = u("share"), ae = u("export"), ie = u("export");
163
+ }, S = u("move"), V = u("move"), T = u("delete"), $ = u("delete"), v = u("publish"), A = u("publish"), d = u("edit_folder"), q = u("edit_folder"), G = u("edit_resource"), re = u("edit_resource"), ne = u("share"), ce = u("share"), ae = u("export"), ie = u("export");
164
164
  async function le() {
165
165
  if (f && f.length > 0) {
166
166
  const e = f[0];
@@ -196,8 +196,8 @@ function oe() {
196
196
  onDeleteCancel: $,
197
197
  onDeleteSuccess: T,
198
198
  isPublishModalOpen: t === "publish",
199
- onPublishCancel: v,
200
- onPublishSuccess: A,
199
+ onPublishCancel: A,
200
+ onPublishSuccess: v,
201
201
  isEditFolderOpen: t === "edit_folder",
202
202
  onEditFolderCancel: q,
203
203
  onEditFolderSuccess: d,
@@ -286,23 +286,23 @@ function Ze() {
286
286
  }
287
287
  });
288
288
  return /* @__PURE__ */ Q(X, { children: [
289
- $((A, v) => v && /* @__PURE__ */ a(ye.div, { className: "position-fixed bottom-0 start-0 end-0", style: {
290
- ...A,
289
+ $((v, A) => A && /* @__PURE__ */ a(ye.div, { className: "position-fixed bottom-0 start-0 end-0", style: {
290
+ ...v,
291
291
  zIndex: 4
292
292
  }, children: /* @__PURE__ */ a(me, { children: t == null ? void 0 : t.filter((d) => d.available && d.target === "actionbar").map((d) => x(d) && /* @__PURE__ */ a(ke, { resourceRights: p, roleExpected: d.right, action: d, children: /* @__PURE__ */ a(W, { id: d.id, type: "button", color: "primary", variant: "filled", onClick: () => {
293
293
  g(d);
294
294
  }, children: s(f(d)) }, d.id) }, d.id)) }) })),
295
- /* @__PURE__ */ Q(pe, { fallback: /* @__PURE__ */ a(Se, {}), children: [
295
+ /* @__PURE__ */ Q(pe, { fallback: /* @__PURE__ */ a(Ce, {}), children: [
296
296
  o && /* @__PURE__ */ a(je, { isOpen: o, onCancel: w, onSuccess: F }),
297
297
  E && /* @__PURE__ */ a(Ye, { isOpen: E, onCancel: U, onSuccess: Y }),
298
298
  i && S && /* @__PURE__ */ a(He, { isOpen: i, resourceId: S.assetId, onCancel: j, onSuccess: z }),
299
299
  h && /* @__PURE__ */ a(ze, { edit: !0, isOpen: h, onCancel: l, onSuccess: n }),
300
- R && S && /* @__PURE__ */ a(Ue, { mode: "update", isOpen: R, resourceId: S.assetId, updateResource: T, onCancel: y, onSuccess: I, children: (A, v, d, q, G) => r === "blog" && he("createPublic", t) && /* @__PURE__ */ a(Ee, { appCode: r, isUpdating: v, resource: A, watch: d, setValue: q, register: G }) }),
301
- M && S && /* @__PURE__ */ a(Oe, { isOpen: M, shareResource: V, shareOptions: {
300
+ R && S && /* @__PURE__ */ a(Ue, { mode: "update", isOpen: R, resourceId: S.assetId, updateResource: T, onCancel: y, onSuccess: I, children: (v, A, d, q, G) => r === "blog" && he("createPublic", t) && /* @__PURE__ */ a(Se, { appCode: r, isUpdating: A, resource: v, watch: d, setValue: q, register: G }) }),
301
+ M && S && /* @__PURE__ */ a(Ee, { isOpen: M, shareResource: V, shareOptions: {
302
302
  resourceCreatorId: S.creatorId,
303
303
  resourceId: S.assetId,
304
304
  resourceRights: S.rights
305
- }, onCancel: _, onSuccess: N, children: r === "blog" ? /* @__PURE__ */ a(Ce, { resourceId: S.assetId, updateResource: T }) : null }),
305
+ }, onCancel: _, onSuccess: N, children: r === "blog" ? /* @__PURE__ */ a(Oe, { resourceId: S.assetId, updateResource: T }) : null }),
306
306
  P && S && /* @__PURE__ */ a(Ve, { isOpen: P, onCancel: k, onSuccess: H })
307
307
  ] })
308
308
  ] });
package/lib/AppAction.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsxs as b, Fragment as h, jsx as e } from "react/jsx-runtime";
2
2
  import { Suspense as A, lazy as x } from "react";
3
3
  import { isActionAvailable as I } from "@edifice.io/client";
4
- import { useToggle as P, useEdificeClient as R, Button as y, LoadingScreen as O, BlogPublic as k } from "@edifice.io/react";
4
+ import { useToggle as P, useEdificeClient as R, Button as y, BlogPublic as O, LoadingScreen as k } from "@edifice.io/react";
5
5
  import { u as v, a as F, b as T, c as j, d as B, e as w, S as z, g as E } from "./index2.js";
6
6
  import { useTranslation as L } from "react-i18next";
7
7
  const M = /* @__PURE__ */ x(async () => await import("./ResourceModal.js"));
@@ -27,7 +27,7 @@ function Q() {
27
27
  }
28
28
  i(), u(), s();
29
29
  }, children: l("explorer.create.title") }),
30
- /* @__PURE__ */ e(A, { fallback: /* @__PURE__ */ e(O, {}), children: c && /* @__PURE__ */ e(M, { mode: "create", currentFolder: n, createResource: m, isOpen: c, onSuccess: s, onCancel: s, children: (o, f, C, g, S) => t === "blog" && I("createPublic", r) && /* @__PURE__ */ e(k, { appCode: t, isUpdating: f, resource: o, watch: C, setValue: g, register: S }) }) })
30
+ /* @__PURE__ */ e(A, { fallback: /* @__PURE__ */ e(k, {}), children: c && /* @__PURE__ */ e(M, { mode: "create", currentFolder: n, createResource: m, isOpen: c, onSuccess: s, onCancel: s, children: (o, f, C, g, S) => t === "blog" && I("createPublic", r) && /* @__PURE__ */ e(O, { appCode: t, isUpdating: f, resource: o, watch: C, setValue: g, register: S }) }) })
31
31
  ] }) : null;
32
32
  }
33
33
  export {
@@ -12,10 +12,10 @@ function P({
12
12
  onClose: s
13
13
  }) {
14
14
  var b;
15
- const n = k(), r = z(), c = A(), f = H(), u = t ? (b = n[0]) == null ? void 0 : b.name : void 0, {
15
+ const l = k(), r = z(), c = A(), f = H(), u = t ? (b = l[0]) == null ? void 0 : b.name : void 0, {
16
16
  reset: o,
17
17
  register: p,
18
- handleSubmit: l,
18
+ handleSubmit: n,
19
19
  setFocus: h,
20
20
  formState: {
21
21
  errors: F,
@@ -34,7 +34,7 @@ function P({
34
34
  var g;
35
35
  try {
36
36
  if (t) {
37
- const d = (g = n[0]) == null ? void 0 : g.parentId, E = n[0].id;
37
+ const d = (g = l[0]) == null ? void 0 : g.parentId, E = l[0].id;
38
38
  await f.mutate({
39
39
  folderId: E,
40
40
  parentId: d,
@@ -62,7 +62,7 @@ function P({
62
62
  isValid: v,
63
63
  register: p,
64
64
  setFocus: h,
65
- handleSubmit: l,
65
+ handleSubmit: n,
66
66
  onCancel: D,
67
67
  onSubmit: L
68
68
  };
@@ -71,7 +71,7 @@ function Z({
71
71
  isOpen: t,
72
72
  edit: e,
73
73
  onSuccess: s,
74
- onCancel: n
74
+ onCancel: l
75
75
  }) {
76
76
  const {
77
77
  t: r
@@ -81,19 +81,19 @@ function Z({
81
81
  isSubmitting: u,
82
82
  formId: o,
83
83
  onSubmit: p,
84
- onCancel: l,
84
+ onCancel: n,
85
85
  handleSubmit: h,
86
86
  register: F,
87
87
  setFocus: i
88
88
  } = P({
89
89
  edit: e,
90
90
  onSuccess: s,
91
- onClose: n
91
+ onClose: l
92
92
  });
93
93
  return q(() => {
94
94
  t && i("name");
95
- }, [t, i]), t ? /* @__PURE__ */ T(/* @__PURE__ */ x(m, { isOpen: t, onModalClose: l, id: "modal_" + o, children: [
96
- /* @__PURE__ */ a(m.Header, { onModalClose: l, children: r(e ? "explorer.rename.folder" : "explorer.create.folder") }),
95
+ }, [t, i]), t ? /* @__PURE__ */ T(/* @__PURE__ */ x(m, { isOpen: t, onModalClose: n, id: "modal_" + o, children: [
96
+ /* @__PURE__ */ a(m.Header, { onModalClose: n, children: r(e ? "explorer.rename.folder" : "explorer.create.folder") }),
97
97
  /* @__PURE__ */ a(m.Body, { children: /* @__PURE__ */ a("form", { id: o, onSubmit: h(p), children: /* @__PURE__ */ x(B, { id: "nameFolder", isRequired: !0, children: [
98
98
  /* @__PURE__ */ a(w, { children: r("explorer.create.folder.name") }),
99
99
  /* @__PURE__ */ a(R, { type: "text", ...F("name", {
@@ -106,7 +106,7 @@ function Z({
106
106
  }), placeholder: r("explorer.create.folder.name"), size: "md", "aria-required": !0, maxLength: 60 })
107
107
  ] }) }) }),
108
108
  /* @__PURE__ */ x(m.Footer, { children: [
109
- /* @__PURE__ */ a(C, { color: "tertiary", onClick: l, type: "button", variant: "ghost", children: r("explorer.cancel") }),
109
+ /* @__PURE__ */ a(C, { color: "tertiary", onClick: n, type: "button", variant: "ghost", children: r("explorer.cancel") }),
110
110
  /* @__PURE__ */ a(C, { form: o, type: "submit", color: "primary", variant: "filled", disabled: !c || !f || u, children: r(e ? "explorer.rename" : "explorer.create") })
111
111
  ] })
112
112
  ] }), document.getElementById("portal")) : null;
package/lib/MoveModal.js CHANGED
@@ -8,20 +8,20 @@ import { y as D, j as E, i as j, z as k, a as U } from "./index2.js";
8
8
  function O({
9
9
  onSuccess: a
10
10
  }) {
11
- const [d, n] = B(), u = A(), o = D(), h = E(), p = j(), i = k(), {
11
+ const [i, n] = B(), u = A(), o = D(), h = E(), p = j(), d = k(), {
12
12
  fetchTreeData: v
13
13
  } = U();
14
14
  async function y() {
15
15
  try {
16
- if (!d) throw new Error("explorer.move.selection.empty");
17
- await o.mutate(d), await (a == null ? void 0 : a());
16
+ if (!i) throw new Error("explorer.move.selection.empty");
17
+ await o.mutate(i), await (a == null ? void 0 : a());
18
18
  } catch (r) {
19
19
  console.error(r);
20
20
  }
21
21
  }
22
22
  const I = (r) => {
23
23
  var f, c;
24
- const t = C(i, r);
24
+ const t = C(d, r);
25
25
  for (const e of h)
26
26
  if (r === e.id || r === e.parentId || (f = e.childrenIds) != null && f.includes(r) || t.includes(e.id))
27
27
  return !1;
@@ -31,14 +31,14 @@ function O({
31
31
  return !0;
32
32
  };
33
33
  return {
34
- treeData: i,
35
- disableSubmit: !d,
34
+ treeData: d,
35
+ disableSubmit: !i,
36
36
  handleTreeItemSelect: (r) => {
37
37
  I(r) ? n(r) : n(void 0);
38
38
  },
39
39
  handleOnTreeItemUnfold: (r) => {
40
40
  var c, e;
41
- const t = x(i, r), f = (c = t == null ? void 0 : t.children) == null ? void 0 : c.some((l) => {
41
+ const t = x(d, r), f = (c = t == null ? void 0 : t.children) == null ? void 0 : c.some((l) => {
42
42
  var M;
43
43
  return Array.isArray(l == null ? void 0 : l.children) && ((M = l.children) == null ? void 0 : M.length) > 0;
44
44
  });
@@ -51,7 +51,7 @@ function O({
51
51
  }
52
52
  function W({
53
53
  isOpen: a,
54
- onSuccess: d,
54
+ onSuccess: i,
55
55
  onCancel: n
56
56
  }) {
57
57
  const {
@@ -61,11 +61,11 @@ function W({
61
61
  } = w(), {
62
62
  treeData: h,
63
63
  handleTreeItemSelect: p,
64
- handleOnTreeItemUnfold: i,
64
+ handleOnTreeItemUnfold: d,
65
65
  onMove: v,
66
66
  disableSubmit: y
67
67
  } = O({
68
- onSuccess: d
68
+ onSuccess: i
69
69
  }), I = {
70
70
  ...h,
71
71
  name: o("explorer.filters.mine", {
@@ -75,7 +75,7 @@ function W({
75
75
  return /* @__PURE__ */ g(/* @__PURE__ */ T(m, { isOpen: a, onModalClose: n, id: "moveModal", children: [
76
76
  /* @__PURE__ */ s(m.Header, { onModalClose: n, children: o("explorer.move.title") }),
77
77
  /* @__PURE__ */ s(m.Subtitle, { children: o("explorer.move.subtitle") }),
78
- /* @__PURE__ */ s(m.Body, { children: /* @__PURE__ */ s(F, { data: I, onTreeItemClick: p, onTreeItemUnfold: i }) }),
78
+ /* @__PURE__ */ s(m.Body, { children: /* @__PURE__ */ s(F, { data: I, onTreeItemClick: p, onTreeItemUnfold: d }) }),
79
79
  /* @__PURE__ */ T(m.Footer, { children: [
80
80
  /* @__PURE__ */ s(b, { color: "tertiary", onClick: n, type: "button", variant: "ghost", children: o("explorer.cancel") }),
81
81
  /* @__PURE__ */ s(b, { color: "primary", onClick: v, type: "button", variant: "filled", disabled: y, children: o("explorer.move") })