ode-explorer 2.6.0-develop.202605292350 → 2.6.0-develop.202606031517

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.
@@ -4,7 +4,7 @@ import { odeServices as D, ACTION as c, isActionAvailable as he } from "@edifice
4
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 { l as J, x as Ie, h as ge, n as ve, t as se, s as Ae, k as Me, q as Pe, o as we, r as Fe, d as xe, p as Te, w as te, u as Be, b as De, v as Le, A 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,
package/lib/AppAction.js CHANGED
@@ -1,14 +1,14 @@
1
- import { jsxs as b, Fragment as x, jsx as e } from "react/jsx-runtime";
2
- import { Suspense as A, lazy as I } from "react";
1
+ import { jsxs as h, Fragment as A, jsx as e } from "react/jsx-runtime";
2
+ import { Suspense as x, lazy as I } from "react";
3
3
  import { isActionAvailable as P } from "@edifice.io/client";
4
4
  import { useToggle as R, useEdificeClient as y, Button as O, BlogPublic as k, LoadingScreen as v } from "@edifice.io/react";
5
- import { x as F, w as T, u as j, h as w, f as B, r as z, S as E, a as L } from "./index2.js";
5
+ import { u as F, a as T, b as j, c as B, d as w, e as z, S as E, g as L } from "./index2.js";
6
6
  import { useTranslation as M } from "react-i18next";
7
7
  const N = /* @__PURE__ */ I(async () => await import("./ResourceModal.js"));
8
8
  function U({
9
9
  onResourceCreated: l
10
10
  }) {
11
- const [n, s] = R(), a = F((o) => o.config), {
11
+ const [c, s] = R(), a = F((o) => o.config), {
12
12
  appCode: t
13
13
  } = y(), {
14
14
  t: i
@@ -17,21 +17,21 @@ function U({
17
17
  clearSelectedIds: d
18
18
  } = T(), {
19
19
  data: r
20
- } = j(a == null ? void 0 : a.actions), m = r == null ? void 0 : r.find((o) => o.id === "create"), c = w(), p = B({
20
+ } = j(a == null ? void 0 : a.actions), m = r == null ? void 0 : r.find((o) => o.id === "create"), n = B(), p = w({
21
21
  onResourceCreated: l
22
22
  }), f = z();
23
- return m ? /* @__PURE__ */ b(x, { children: [
23
+ return m ? /* @__PURE__ */ h(A, { children: [
24
24
  /* @__PURE__ */ e(O, { type: "button", color: "primary", variant: "filled", leftIcon: /* @__PURE__ */ e(E, {}), className: "ms-auto", onClick: () => {
25
25
  if (t == "scrapbook") {
26
26
  L({
27
27
  searchParams: f,
28
- folderId: c.id
28
+ folderId: n.id
29
29
  });
30
30
  return;
31
31
  }
32
32
  u(), d(), s();
33
33
  }, children: i("explorer.create.title") }),
34
- /* @__PURE__ */ e(A, { fallback: /* @__PURE__ */ e(v, {}), children: n && /* @__PURE__ */ e(N, { mode: "create", currentFolder: c, createResource: p, isOpen: n, onSuccess: s, onCancel: s, children: (o, C, g, S, h) => t === "blog" && P("createPublic", r) && /* @__PURE__ */ e(k, { appCode: t, isUpdating: C, resource: o, watch: g, setValue: S, register: h }) }) })
34
+ /* @__PURE__ */ e(x, { fallback: /* @__PURE__ */ e(v, {}), children: c && /* @__PURE__ */ e(N, { mode: "create", currentFolder: n, createResource: p, isOpen: c, onSuccess: s, onCancel: s, children: (o, C, g, S, b) => t === "blog" && P("createPublic", r) && /* @__PURE__ */ e(k, { appCode: t, isUpdating: C, resource: o, watch: g, setValue: S, register: b }) }) })
35
35
  ] }) : null;
36
36
  }
37
37
  export {
@@ -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.io/react";
3
3
  import { createPortal as c } from "react-dom";
4
4
  import { useTranslation as h } from "react-i18next";
5
- import { i as m, y as p, l as u } from "./index2.js";
5
+ import { w as m, x as p, f as u } from "./index2.js";
6
6
  function f({
7
7
  onSuccess: t
8
8
  }) {
@@ -38,6 +38,6 @@ const u = ({
38
38
  ] });
39
39
  export {
40
40
  u as D,
41
- n as S,
42
- h as a
41
+ h as S,
42
+ n as a
43
43
  };
@@ -5,7 +5,7 @@ import { useState as b, useEffect as v } from "react";
5
5
  import "@edifice.io/client";
6
6
  import "@tanstack/react-query";
7
7
  import "i18next";
8
- import { x as _, u as x } from "./index2.js";
8
+ import { u as _, b as x } from "./index2.js";
9
9
  const S = (t, e, o) => {
10
10
  const s = t[e];
11
11
  return s ? typeof s == "function" ? s() : Promise.resolve(s) : new Promise((m, r) => {
@@ -1,32 +1,32 @@
1
1
  import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
- import { useToast as d, Modal as n, Alert as p, Button as c } from "@edifice.io/react";
2
+ import { useToast as d, Modal as n, Alert as p, Button as a } from "@edifice.io/react";
3
3
  import { createPortal as x } from "react-dom";
4
- import { useTranslation as a } from "react-i18next";
5
- import { t as h, r as u, c as m } from "./index2.js";
6
- const f = (s) => {
7
- const t = h(), o = u(), i = d(), {
4
+ import { useTranslation as c } from "react-i18next";
5
+ import { i as h, e as u, A as m } from "./index2.js";
6
+ const f = (i) => {
7
+ const t = h(), o = u(), s = d(), {
8
8
  t: e
9
- } = a();
9
+ } = c();
10
10
  return {
11
11
  handleExportClick: () => {
12
12
  t.length ? (m({
13
13
  searchParams: o,
14
14
  assetId: t[0].assetId
15
- }), s()) : i.error(e("explorer.error.noResourceSelected"));
15
+ }), i()) : s.error(e("explorer.error.noResourceSelected"));
16
16
  }
17
17
  };
18
18
  };
19
19
  function C({
20
- isOpen: s,
20
+ isOpen: i,
21
21
  onSuccess: t,
22
22
  onCancel: o
23
23
  }) {
24
24
  const {
25
- handleExportClick: i
25
+ handleExportClick: s
26
26
  } = f(t), {
27
27
  t: e
28
- } = a();
29
- return /* @__PURE__ */ x(/* @__PURE__ */ l(n, { isOpen: s, onModalClose: o, id: "exportModal", children: [
28
+ } = c();
29
+ return /* @__PURE__ */ x(/* @__PURE__ */ l(n, { isOpen: i, onModalClose: o, id: "exportModal", children: [
30
30
  /* @__PURE__ */ r(n.Header, { onModalClose: o, children: e("explorer.export.title") }),
31
31
  /* @__PURE__ */ l(n.Body, { children: [
32
32
  /* @__PURE__ */ l("ul", { children: [
@@ -37,8 +37,8 @@ function C({
37
37
  /* @__PURE__ */ r(p, { type: "warning", children: e("explorer.export.body.warning") })
38
38
  ] }),
39
39
  /* @__PURE__ */ l(n.Footer, { children: [
40
- /* @__PURE__ */ r(c, { color: "tertiary", onClick: o, type: "button", variant: "ghost", children: e("explorer.cancel") }),
41
- /* @__PURE__ */ r(c, { color: "primary", onClick: i, type: "button", variant: "filled", children: e("explorer.actions.export") })
40
+ /* @__PURE__ */ r(a, { color: "tertiary", onClick: o, type: "button", variant: "ghost", children: e("explorer.cancel") }),
41
+ /* @__PURE__ */ r(a, { color: "primary", onClick: s, type: "button", variant: "filled", children: e("explorer.actions.export") })
42
42
  ] })
43
43
  ] }), document.getElementById("portal"));
44
44
  }
@@ -1,11 +1,11 @@
1
1
  import { jsxs as x, jsx as a } from "react/jsx-runtime";
2
- import { useId as E, useEffect as q } from "react";
3
- import { Modal as m, FormControl as j, Label as w, Input as R, Button as C } from "@edifice.io/react";
2
+ import { useId as j, useEffect as q } from "react";
3
+ import { Modal as m, FormControl as B, Label as w, Input as R, Button as C } from "@edifice.io/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.io/client";
7
7
  import { useForm as _ } from "react-hook-form";
8
- import { s as k, h as z, e as A, B as H } from "./index2.js";
8
+ import { j as k, c as z, t as A, v as H } from "./index2.js";
9
9
  function P({
10
10
  edit: t,
11
11
  onSuccess: e,
@@ -28,15 +28,15 @@ function P({
28
28
  values: {
29
29
  name: u || ""
30
30
  }
31
- }), M = E(), L = async function({
31
+ }), M = j(), L = async function({
32
32
  name: y
33
33
  }) {
34
34
  var g;
35
35
  try {
36
36
  if (t) {
37
- const d = (g = l[0]) == null ? void 0 : g.parentId, D = l[0].id;
37
+ const d = (g = l[0]) == null ? void 0 : g.parentId, E = l[0].id;
38
38
  await f.mutate({
39
- folderId: D,
39
+ folderId: E,
40
40
  parentId: d,
41
41
  name: y
42
42
  }), o(), e == null || e();
@@ -51,7 +51,7 @@ function P({
51
51
  console.error(d);
52
52
  }
53
53
  };
54
- function B() {
54
+ function D() {
55
55
  o(), s();
56
56
  }
57
57
  return {
@@ -63,7 +63,7 @@ function P({
63
63
  register: p,
64
64
  setFocus: h,
65
65
  handleSubmit: n,
66
- onCancel: B,
66
+ onCancel: D,
67
67
  onSubmit: L
68
68
  };
69
69
  }
@@ -94,7 +94,7 @@ function Z({
94
94
  t && i("name");
95
95
  }, [t, i]), t ? /* @__PURE__ */ T(/* @__PURE__ */ x(m, { isOpen: t, onModalClose: n, id: "modal_" + o, children: [
96
96
  /* @__PURE__ */ a(m.Header, { onModalClose: n, children: r(e ? "explorer.rename.folder" : "explorer.create.folder") }),
97
- /* @__PURE__ */ a(m.Body, { children: /* @__PURE__ */ a("form", { id: o, onSubmit: h(p), children: /* @__PURE__ */ x(j, { id: "nameFolder", isRequired: !0, children: [
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", {
100
100
  required: !0,
@@ -1,13 +1,13 @@
1
- import { jsx as s, jsxs as S, Fragment as w } from "react/jsx-runtime";
2
- import { useBreakpoint as R, Card as v, IconButton as k, useScrollToTop as z, useEdificeClient as $ } from "@edifice.io/react";
1
+ import { jsx as s, jsxs as S, Fragment as R } from "react/jsx-runtime";
2
+ import { useBreakpoint as w, Card as v, IconButton as k, useScrollToTop as z, useEdificeClient as $ } from "@edifice.io/react";
3
3
  import { useSpring as j, animated as C } from "@react-spring/web";
4
4
  import { useQueryClient as B } from "@tanstack/react-query";
5
- import { p as x, j as E, s as A, k as M, w as q } from "./index2.js";
5
+ import { o as x, s as E, j as A, k as M, a as q } from "./index2.js";
6
6
  import { useState as L, useId as P, useEffect as Q } from "react";
7
7
  import { useDroppable as G, useDraggable as H } from "@dnd-kit/core";
8
- import { a as J, S as K, D as U } from "./DraggableCard.js";
8
+ import { S as J, a as K, D as U } from "./DraggableCard.js";
9
9
  const N = ({
10
- app: o,
10
+ app: r,
11
11
  name: n,
12
12
  idFolder: l,
13
13
  isSelected: i = !1,
@@ -17,7 +17,7 @@ const N = ({
17
17
  }) => {
18
18
  const [t, a] = L(!1), p = P(), {
19
19
  lg: g
20
- } = R(), {
20
+ } = w(), {
21
21
  setNodeRef: I
22
22
  } = G({
23
23
  id: p,
@@ -39,18 +39,18 @@ const N = ({
39
39
  type: "folder"
40
40
  },
41
41
  disabled: !g
42
- }), r = x(), d = E(), F = (c) => {
42
+ }), o = x(), d = E(), F = (c) => {
43
43
  f(c), I(c);
44
44
  }, m = d.overId === l, O = !d.canMove && d.isTreeview ? "no-drop" : t ? "grabbing" : "default", T = {
45
45
  transform: `translate3d(${((e == null ? void 0 : e.x) ?? 0) / 1}px, ${((e == null ? void 0 : e.y) ?? 0) / 1}px, 0)`,
46
46
  cursor: O
47
47
  };
48
48
  return Q(() => {
49
- const c = r.elementDrag === l;
49
+ const c = o.elementDrag === l;
50
50
  a(c);
51
- }, [r]), /* @__PURE__ */ s("div", { ref: F, style: {
51
+ }, [o]), /* @__PURE__ */ s("div", { ref: F, style: {
52
52
  ...T
53
- }, children: t ? /* @__PURE__ */ s(U, { name: n, app: o, type: "folder" }) : /* @__PURE__ */ s(v, { app: o, isSelectable: !t && h, isSelected: !t && i || m && t, isFocused: m, onClick: D, onSelect: b, children: (c) => /* @__PURE__ */ S(w, { children: [
53
+ }, children: t ? /* @__PURE__ */ s(U, { name: n, app: r, type: "folder" }) : /* @__PURE__ */ s(v, { app: r, isSelectable: !t && h, isSelected: !t && i || m && t, isFocused: m, onClick: D, onSelect: b, children: (c) => /* @__PURE__ */ S(R, { children: [
54
54
  !t && g && /* @__PURE__ */ s("div", { className: "card-header z-3", style: {
55
55
  position: "fixed",
56
56
  left: "37px"
@@ -62,8 +62,8 @@ const N = ({
62
62
  ] }) }) });
63
63
  };
64
64
  N.displayName = "FolderCard";
65
- const re = ({
66
- data: o
65
+ const oe = ({
66
+ data: r
67
67
  }) => {
68
68
  var u, f;
69
69
  const n = B(), l = A(), i = M(), h = x(), D = z(), {
@@ -74,7 +74,7 @@ const re = ({
74
74
  openFolder: p
75
75
  } = q();
76
76
  function g(e) {
77
- i.includes(e.id) ? (a(i.filter((r) => r !== e.id)), t(l.filter((r) => r.id !== e.id))) : (a([e.id, ...i]), t([e, ...l]));
77
+ i.includes(e.id) ? (a(i.filter((o) => o !== e.id)), t(l.filter((o) => o.id !== e.id))) : (a([e.id, ...i]), t([e, ...l]));
78
78
  }
79
79
  function I(e) {
80
80
  D(), p({
@@ -91,19 +91,19 @@ const re = ({
91
91
  opacity: 1
92
92
  }
93
93
  });
94
- return (u = o == null ? void 0 : o.pages[0]) != null && u.folders.length ? /* @__PURE__ */ s(C.ul, { className: "grid ps-0 list-unstyled mb-24", children: (f = o == null ? void 0 : o.pages[0]) == null ? void 0 : f.folders.map((e) => {
94
+ return (u = r == null ? void 0 : r.pages[0]) != null && u.folders.length ? /* @__PURE__ */ s(C.ul, { className: "grid ps-0 list-unstyled mb-24", children: (f = r == null ? void 0 : r.pages[0]) == null ? void 0 : f.folders.map((e) => {
95
95
  const {
96
- id: r,
96
+ id: o,
97
97
  name: d
98
- } = e, F = h.elementDrag === r;
98
+ } = e, F = h.elementDrag === o;
99
99
  return /* @__PURE__ */ s(C.li, { className: `g-col-4 ${F ? "z-2000" : "z-1"}`, style: {
100
100
  position: "relative",
101
101
  ...y
102
- }, children: /* @__PURE__ */ s(N, { name: d, idFolder: r, app: b, isSelected: i.includes(e.id), onClick: (m) => {
102
+ }, children: /* @__PURE__ */ s(N, { name: d, idFolder: o, app: b, isSelected: i.includes(e.id), onClick: (m) => {
103
103
  m.stopPropagation(), I(e);
104
- }, onSelect: () => g(e) }) }, r);
104
+ }, onSelect: () => g(e) }) }, o);
105
105
  }) }) : null;
106
106
  };
107
107
  export {
108
- re as default
108
+ oe as default
109
109
  };
package/lib/MoveModal.js CHANGED
@@ -1,48 +1,48 @@
1
1
  import { jsxs as T, jsx as s } from "react/jsx-runtime";
2
- import { findNodeById as x, getAncestors as C, useEdificeClient as S, Modal as m, TreeView as w, Button as b } from "@edifice.io/react";
3
- import { createPortal as F } from "react-dom";
4
- import { useTranslation as g } from "react-i18next";
2
+ import { findNodeById as x, getAncestors as C, useEdificeClient as S, Modal as m, TreeView as F, Button as b } from "@edifice.io/react";
3
+ import { createPortal as g } from "react-dom";
4
+ import { useTranslation as w } from "react-i18next";
5
5
  import { useQueryClient as A } from "@tanstack/react-query";
6
6
  import { useState as B } from "react";
7
- import { m as D, s as E, t as k, z as U, w as j } from "./index2.js";
7
+ 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 = k(), i = U(), {
11
+ const [i, n] = B(), u = A(), o = D(), h = E(), p = j(), d = k(), {
12
12
  fetchTreeData: v
13
- } = j();
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());
18
- } catch (t) {
19
- console.error(t);
16
+ if (!i) throw new Error("explorer.move.selection.empty");
17
+ await o.mutate(i), await (a == null ? void 0 : a());
18
+ } catch (r) {
19
+ console.error(r);
20
20
  }
21
21
  }
22
- const I = (t) => {
22
+ const I = (r) => {
23
23
  var f, c;
24
- const r = C(i, t);
24
+ const t = C(d, r);
25
25
  for (const e of h)
26
- if (t === e.id || t === e.parentId || (f = e.childrenIds) != null && f.includes(t) || r.includes(e.id))
26
+ if (r === e.id || r === e.parentId || (f = e.childrenIds) != null && f.includes(r) || t.includes(e.id))
27
27
  return !1;
28
28
  for (const e of p)
29
- if (t === ((e == null ? void 0 : e.folderIds) && e.folderIds[0]) || ((c = e == null ? void 0 : e.folderIds) == null ? void 0 : c.length) === 0 && t === "default")
29
+ if (r === ((e == null ? void 0 : e.folderIds) && e.folderIds[0]) || ((c = e == null ? void 0 : e.folderIds) == null ? void 0 : c.length) === 0 && r === "default")
30
30
  return !1;
31
31
  return !0;
32
32
  };
33
33
  return {
34
- treeData: i,
35
- disableSubmit: !d,
36
- handleTreeItemSelect: (t) => {
37
- I(t) ? n(t) : n(void 0);
34
+ treeData: d,
35
+ disableSubmit: !i,
36
+ handleTreeItemSelect: (r) => {
37
+ I(r) ? n(r) : n(void 0);
38
38
  },
39
- handleOnTreeItemUnfold: (t) => {
39
+ handleOnTreeItemUnfold: (r) => {
40
40
  var c, e;
41
- const r = x(i, t), f = (c = r == null ? void 0 : r.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
  });
45
- (e = r == null ? void 0 : r.children) == null || e.forEach((l) => {
45
+ (e = t == null ? void 0 : t.children) == null || e.forEach((l) => {
46
46
  f || v(l.id, u);
47
47
  });
48
48
  },
@@ -51,31 +51,31 @@ 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 {
58
58
  appCode: u
59
59
  } = S(), {
60
60
  t: o
61
- } = g(), {
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", {
72
72
  ns: u
73
73
  })
74
74
  };
75
- return /* @__PURE__ */ F(/* @__PURE__ */ T(m, { isOpen: a, onModalClose: n, id: "moveModal", children: [
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(w, { 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") })
@@ -1,45 +1,45 @@
1
- import { jsxs as l, jsx as t, Fragment as H } from "react/jsx-runtime";
1
+ import { jsxs as l, jsx as i, Fragment as H } from "react/jsx-runtime";
2
2
  import D, { useState as $, useEffect as j, useCallback as V } from "react";
3
3
  import { useBreakpoint as E, useEdificeClient as T, Card as m, IconButton as G, Image as L, AppIcon as U, Avatar as q, Tooltip as F, useDate as J, Button as K } from "@edifice.io/react";
4
4
  import { useSpring as Q, animated as P } from "@react-spring/web";
5
5
  import W from "clsx";
6
6
  import { useTranslation as z } from "react-i18next";
7
- import { l as B, p as X, r as Y, n as Z, t as ee, w as te } from "./index2.js";
8
- import { useDraggable as ie } from "@dnd-kit/core";
9
- import { a as ae, D as le } from "./DraggableCard.js";
7
+ import { f as B, o as X, e as Y, h as Z, i as ee, a as ie } from "./index2.js";
8
+ import { useDraggable as te } from "@dnd-kit/core";
9
+ import { S as ae, D as le } from "./DraggableCard.js";
10
10
  const ne = ({
11
- title: i,
11
+ title: t,
12
12
  titleId: e,
13
13
  ...n
14
14
  }) => /* @__PURE__ */ l("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", "aria-labelledby": e, ...n, children: [
15
- i ? /* @__PURE__ */ t("title", { id: e, children: i }) : null,
16
- /* @__PURE__ */ t("path", { fill: "currentColor", fillRule: "evenodd", d: "M9.726 3.29A9.01 9.01 0 0 0 3.055 11H7.05a16.3 16.3 0 0 1 2.676-7.71m4.548 0A16.3 16.3 0 0 1 16.95 11h3.995a9.01 9.01 0 0 0-6.67-7.71m.668 7.71A14.3 14.3 0 0 0 12 3.55 14.3 14.3 0 0 0 9.058 11zm-5.884 2h5.884A14.3 14.3 0 0 1 12 20.45 14.3 14.3 0 0 1 9.058 13M7.05 13H3.055a9.01 9.01 0 0 0 6.67 7.71A16.3 16.3 0 0 1 7.05 13m7.224 7.71A16.3 16.3 0 0 0 16.95 13h3.995a9.01 9.01 0 0 1-6.67 7.71M12 23c6.075 0 11-4.925 11-11S18.075 1 12 1 1 5.925 1 12s4.925 11 11 11", clipRule: "evenodd" })
15
+ t ? /* @__PURE__ */ i("title", { id: e, children: t }) : null,
16
+ /* @__PURE__ */ i("path", { fill: "currentColor", fillRule: "evenodd", d: "M9.726 3.29A9.01 9.01 0 0 0 3.055 11H7.05a16.3 16.3 0 0 1 2.676-7.71m4.548 0A16.3 16.3 0 0 1 16.95 11h3.995a9.01 9.01 0 0 0-6.67-7.71m.668 7.71A14.3 14.3 0 0 0 12 3.55 14.3 14.3 0 0 0 9.058 11zm-5.884 2h5.884A14.3 14.3 0 0 1 12 20.45 14.3 14.3 0 0 1 9.058 13M7.05 13H3.055a9.01 9.01 0 0 0 6.67 7.71A16.3 16.3 0 0 1 7.05 13m7.224 7.71A16.3 16.3 0 0 0 16.95 13h3.995a9.01 9.01 0 0 1-6.67 7.71M12 23c6.075 0 11-4.925 11-11S18.075 1 12 1 1 5.925 1 12s4.925 11 11 11", clipRule: "evenodd" })
17
17
  ] }), se = ({
18
- title: i,
18
+ title: t,
19
19
  titleId: e,
20
20
  ...n
21
21
  }) => /* @__PURE__ */ l("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", "aria-labelledby": e, ...n, children: [
22
- i ? /* @__PURE__ */ t("title", { id: e, children: i }) : null,
23
- /* @__PURE__ */ t("g", { fill: "currentColor", fillRule: "evenodd", clipPath: "url(#icon-users_svg__a)", clipRule: "evenodd", children: /* @__PURE__ */ t("path", { d: "M19.055 12.803a1 1 0 0 1 1.272-.618c1.128.39 2.061 1.247 2.7 2.351.64 1.106.972 2.435.973 3.782V21a1 1 0 1 1-2 0v-2.681c0-1.03-.258-2.009-.704-2.782-.448-.773-1.034-1.258-1.623-1.462a1 1 0 0 1-.618-1.272M15.187 1.384a1 1 0 0 1 1.036-.962 5.129 5.129 0 0 1 2.11 9.71 1 1 0 1 1-.896-1.788 3.129 3.129 0 0 0-1.288-5.924 1 1 0 0 1-.962-1.036M1.505 15.694C2.481 14.622 3.825 14 5.25 14h8.5c1.424 0 2.769.622 3.744 1.694.974 1.068 1.506 2.498 1.506 3.973V22a1 1 0 1 1-2 0v-2.333c0-1.001-.363-1.945-.984-2.627-.618-.679-1.436-1.04-2.266-1.04h-8.5c-.83 0-1.648.361-2.266 1.04-.621.682-.984 1.626-.984 2.627V22a1 1 0 1 1-2 0v-2.333c0-1.475.533-2.905 1.505-3.974M9.5 3a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7M4 6.5a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0" }) }),
24
- /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ t("clipPath", { id: "icon-users_svg__a", children: /* @__PURE__ */ t("path", { fill: "#fff", d: "M0 0h24v24H0z" }) }) })
22
+ t ? /* @__PURE__ */ i("title", { id: e, children: t }) : null,
23
+ /* @__PURE__ */ i("g", { fill: "currentColor", fillRule: "evenodd", clipPath: "url(#icon-users_svg__a)", clipRule: "evenodd", children: /* @__PURE__ */ i("path", { d: "M19.055 12.803a1 1 0 0 1 1.272-.618c1.128.39 2.061 1.247 2.7 2.351.64 1.106.972 2.435.973 3.782V21a1 1 0 1 1-2 0v-2.681c0-1.03-.258-2.009-.704-2.782-.448-.773-1.034-1.258-1.623-1.462a1 1 0 0 1-.618-1.272M15.187 1.384a1 1 0 0 1 1.036-.962 5.129 5.129 0 0 1 2.11 9.71 1 1 0 1 1-.896-1.788 3.129 3.129 0 0 0-1.288-5.924 1 1 0 0 1-.962-1.036M1.505 15.694C2.481 14.622 3.825 14 5.25 14h8.5c1.424 0 2.769.622 3.744 1.694.974 1.068 1.506 2.498 1.506 3.973V22a1 1 0 1 1-2 0v-2.333c0-1.001-.363-1.945-.984-2.627-.618-.679-1.436-1.04-2.266-1.04h-8.5c-.83 0-1.648.361-2.266 1.04-.621.682-.984 1.626-.984 2.627V22a1 1 0 1 1-2 0v-2.333c0-1.475.533-2.905 1.505-3.974M9.5 3a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7M4 6.5a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0" }) }),
24
+ /* @__PURE__ */ i("defs", { children: /* @__PURE__ */ i("clipPath", { id: "icon-users_svg__a", children: /* @__PURE__ */ i("path", { fill: "#fff", d: "M0 0h24v24H0z" }) }) })
25
25
  ] }), de = ({
26
- title: i,
26
+ title: t,
27
27
  titleId: e,
28
28
  ...n
29
29
  }) => /* @__PURE__ */ l("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", width: "24", height: "24", "aria-hidden": "true", "aria-labelledby": e, ...n, children: [
30
- i ? /* @__PURE__ */ t("title", { id: e, children: i }) : null,
31
- /* @__PURE__ */ t("g", { clipPath: "url(#icon-one-profile_svg__a)", children: /* @__PURE__ */ t("path", { fill: "currentColor", d: "M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24m0 4.65a4.26 4.26 0 1 1 0 8.51 4.26 4.26 0 0 1 0-8.51m0 16.64a9.27 9.27 0 0 1-7.09-3.3 5.4 5.4 0 0 1 4.77-2.9c.11 0 .23.03.34.06.63.2 1.29.33 1.98.33.7 0 1.35-.13 1.98-.33.11-.03.23-.05.34-.05a5.4 5.4 0 0 1 4.77 2.89 9.27 9.27 0 0 1-7.09 3.3" }) }),
32
- /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ t("clipPath", { id: "icon-one-profile_svg__a", children: /* @__PURE__ */ t("path", { fill: "#fff", d: "M0 0h24v24H0z" }) }) })
30
+ t ? /* @__PURE__ */ i("title", { id: e, children: t }) : null,
31
+ /* @__PURE__ */ i("g", { clipPath: "url(#icon-one-profile_svg__a)", children: /* @__PURE__ */ i("path", { fill: "currentColor", d: "M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24m0 4.65a4.26 4.26 0 1 1 0 8.51 4.26 4.26 0 0 1 0-8.51m0 16.64a9.27 9.27 0 0 1-7.09-3.3 5.4 5.4 0 0 1 4.77-2.9c.11 0 .23.03.34.06.63.2 1.29.33 1.98.33.7 0 1.35-.13 1.98-.33.11-.03.23-.05.34-.05a5.4 5.4 0 0 1 4.77 2.89 9.27 9.27 0 0 1-7.09 3.3" }) }),
32
+ /* @__PURE__ */ i("defs", { children: /* @__PURE__ */ i("clipPath", { id: "icon-one-profile_svg__a", children: /* @__PURE__ */ i("path", { fill: "#fff", d: "M0 0h24v24H0z" }) }) })
33
33
  ] }), k = ({
34
- app: i,
34
+ app: t,
35
35
  resource: e,
36
36
  time: n,
37
37
  isSelected: b = !1,
38
38
  isSelectable: w = !0,
39
- onClick: p,
39
+ onClick: g,
40
40
  onSelect: r
41
41
  }) => {
42
- const [s, g] = $(!1), h = B(), {
42
+ const [s, p] = $(!1), h = B(), {
43
43
  lg: v
44
44
  } = E(), u = `/userbook/avatar/${e == null ? void 0 : e.creatorId}`;
45
45
  function R(f) {
@@ -50,18 +50,18 @@ const ne = ({
50
50
  return M.filter((O) => !O.includes(C)).length >= 1;
51
51
  }
52
52
  const {
53
- attributes: y,
53
+ attributes: S,
54
54
  listeners: _,
55
- setNodeRef: I,
55
+ setNodeRef: y,
56
56
  transform: d
57
- } = ie({
57
+ } = te({
58
58
  id: e.id,
59
59
  data: {
60
60
  id: e.id,
61
61
  type: "resource"
62
62
  },
63
63
  disabled: !!h || !v
64
- }), S = R(e), N = e == null ? void 0 : e.public, x = X(), {
64
+ }), I = R(e), N = e == null ? void 0 : e.public, x = X(), {
65
65
  appCode: a
66
66
  } = T(), {
67
67
  t: c
@@ -72,40 +72,40 @@ const ne = ({
72
72
  };
73
73
  return j(() => {
74
74
  const f = x.elementDrag === e.id;
75
- g(f);
76
- }, [x]), /* @__PURE__ */ t("div", { ref: I, style: {
75
+ p(f);
76
+ }, [x]), /* @__PURE__ */ i("div", { ref: y, style: {
77
77
  ...o
78
- }, children: s ? /* @__PURE__ */ t(le, { app: i, type: "resource", name: e == null ? void 0 : e.name }) : /* @__PURE__ */ t(m, { app: i, isSelected: !s && b, isSelectable: !s && w, onClick: p, onSelect: r, children: () => /* @__PURE__ */ l(H, { children: [
79
- !s && v && !h && /* @__PURE__ */ t("div", { className: "card-header z-3", style: {
78
+ }, children: s ? /* @__PURE__ */ i(le, { app: t, type: "resource", name: e == null ? void 0 : e.name }) : /* @__PURE__ */ i(m, { app: t, isSelected: !s && b, isSelectable: !s && w, onClick: g, onSelect: r, children: () => /* @__PURE__ */ l(H, { children: [
79
+ !s && v && !h && /* @__PURE__ */ i("div", { className: "card-header z-3", style: {
80
80
  position: "fixed",
81
81
  left: "37px"
82
- }, children: /* @__PURE__ */ t(G, { ..._, ...y, className: "bg-white z-3", color: "secondary", icon: /* @__PURE__ */ t(ae, {}), variant: "ghost" }) }),
82
+ }, children: /* @__PURE__ */ i(G, { ..._, ...S, className: "bg-white z-3", color: "secondary", icon: /* @__PURE__ */ i(ae, {}), variant: "ghost" }) }),
83
83
  /* @__PURE__ */ l(m.Body, { children: [
84
- /* @__PURE__ */ t("div", { className: "card-image medium", children: e != null && e.thumbnail ? /* @__PURE__ */ t(L, { alt: "", src: `${e == null ? void 0 : e.thumbnail}?thumbnail=80x80`, objectFit: "cover", className: "h-full w-100" }) : /* @__PURE__ */ t(U, { app: i, iconFit: "ratio", size: "80", variant: "rounded" }) }),
84
+ /* @__PURE__ */ i("div", { className: "card-image medium", children: e != null && e.thumbnail ? /* @__PURE__ */ i(L, { alt: "", src: `${e == null ? void 0 : e.thumbnail}?thumbnail=80x80`, objectFit: "cover", className: "h-full w-100" }) : /* @__PURE__ */ i(U, { app: t, iconFit: "ratio", size: "80", variant: "rounded" }) }),
85
85
  /* @__PURE__ */ l("div", { className: "text-truncate", children: [
86
- /* @__PURE__ */ t(m.Title, { children: e == null ? void 0 : e.name }),
87
- /* @__PURE__ */ t(m.Text, { children: /* @__PURE__ */ t("em", { children: n }) })
86
+ /* @__PURE__ */ i(m.Title, { children: e == null ? void 0 : e.name }),
87
+ /* @__PURE__ */ i(m.Text, { children: /* @__PURE__ */ i("em", { children: n }) })
88
88
  ] })
89
89
  ] }),
90
90
  /* @__PURE__ */ l(m.Footer, { children: [
91
91
  /* @__PURE__ */ l("div", { className: "d-inline-flex align-items-center gap-8 text-truncate", children: [
92
- u ? /* @__PURE__ */ t(q, { alt: (e == null ? void 0 : e.creatorName) || "", size: "xs", src: u, variant: "circle", width: "24", height: "24" }) : /* @__PURE__ */ t(de, {}),
93
- /* @__PURE__ */ t(m.Text, { children: e == null ? void 0 : e.creatorName })
92
+ u ? /* @__PURE__ */ i(q, { alt: (e == null ? void 0 : e.creatorName) || "", size: "xs", src: u, variant: "circle", width: "24", height: "24" }) : /* @__PURE__ */ i(de, {}),
93
+ /* @__PURE__ */ i(m.Text, { children: e == null ? void 0 : e.creatorName })
94
94
  ] }),
95
95
  /* @__PURE__ */ l("div", { className: "d-inline-flex align-items-center gap-8", children: [
96
- S && /* @__PURE__ */ t(F, { message: c("tooltip.shared", {
96
+ I && /* @__PURE__ */ i(F, { message: c("tooltip.shared", {
97
97
  ns: a
98
- }), placement: "top", children: /* @__PURE__ */ t(se, { width: 16, height: 16 }) }),
99
- N && /* @__PURE__ */ t(F, { message: c("tooltip.public", {
98
+ }), placement: "top", children: /* @__PURE__ */ i(se, { width: 16, height: 16 }) }),
99
+ N && /* @__PURE__ */ i(F, { message: c("tooltip.public", {
100
100
  ns: a
101
- }), placement: "top", children: /* @__PURE__ */ t(ne, { width: 16, height: 16 }) })
101
+ }), placement: "top", children: /* @__PURE__ */ i(ne, { width: 16, height: 16 }) })
102
102
  ] })
103
103
  ] })
104
104
  ] }) }) });
105
105
  };
106
106
  k.displayName = "ResourceCard";
107
107
  const ue = ({
108
- data: i,
108
+ data: t,
109
109
  fetchNextPage: e
110
110
  }) => {
111
111
  const {
@@ -114,45 +114,45 @@ const ue = ({
114
114
  t: b
115
115
  } = z(), {
116
116
  fromNow: w
117
- } = J(), p = Y(), r = Z(), s = ee(), {
118
- setSelectedResources: g,
117
+ } = J(), g = Y(), r = Z(), s = ee(), {
118
+ setSelectedResources: p,
119
119
  setResourceIds: h,
120
120
  openResource: v,
121
121
  setResourceIsTrash: u
122
- } = te(), R = B(), y = Q({
122
+ } = ie(), R = B(), S = Q({
123
123
  from: {
124
124
  opacity: 0
125
125
  },
126
126
  to: {
127
127
  opacity: 1
128
128
  }
129
- }), I = p.pagination.startIdx + p.pagination.pageSize < (p.pagination.maxIdx || 0), d = V(() => {
129
+ }), y = g.pagination.startIdx + g.pagination.pageSize < (g.pagination.maxIdx || 0), d = V(() => {
130
130
  e();
131
- }, []), S = (a) => {
132
- R ? (u(!0), h([a.id]), g([a])) : v(a);
131
+ }, []), I = (a) => {
132
+ R ? (u(!0), h([a.id]), p([a])) : v(a);
133
133
  };
134
134
  async function N(a) {
135
135
  if (r.includes(a.id)) {
136
- h(r.filter((c) => c !== a.id)), g(s.filter((c) => c.id !== a.id));
136
+ h(r.filter((c) => c !== a.id)), p(s.filter((c) => c.id !== a.id));
137
137
  return;
138
138
  }
139
- h([...r, a.id]), g([...s, a]);
139
+ h([...r, a.id]), p([...s, a]);
140
140
  }
141
141
  const x = W("grid ps-0 list-unstyled");
142
142
  return /* @__PURE__ */ l(D.Fragment, { children: [
143
- /* @__PURE__ */ t(P.ul, { className: x, children: i == null ? void 0 : i.pages.map((a, c) => /* @__PURE__ */ t(D.Fragment, { children: a.resources.map((o) => {
143
+ /* @__PURE__ */ i(P.ul, { className: x, children: t == null ? void 0 : t.pages.map((a, c) => /* @__PURE__ */ i(D.Fragment, { children: a.resources.map((o) => {
144
144
  const {
145
145
  id: f,
146
146
  updatedAt: M
147
147
  } = o, C = w(M);
148
- return /* @__PURE__ */ t(P.li, { className: "g-col-4", style: {
148
+ return /* @__PURE__ */ i(P.li, { className: "g-col-4", style: {
149
149
  position: "relative",
150
- ...y
151
- }, children: /* @__PURE__ */ t(k, { app: n, resource: o, time: C, isSelectable: !0, isSelected: r.includes(o.id), onClick: (A) => {
152
- A.stopPropagation(), S(o);
150
+ ...S
151
+ }, children: /* @__PURE__ */ i(k, { app: n, resource: o, time: C, isSelectable: !0, isSelected: r.includes(o.id), onClick: (A) => {
152
+ A.stopPropagation(), I(o);
153
153
  }, onSelect: () => N(o) }) }, f);
154
154
  }) }, c)) }),
155
- I && /* @__PURE__ */ t("div", { className: "d-grid gap-2 col-4 mx-auto my-24", children: /* @__PURE__ */ t(K, { type: "button", color: "secondary", variant: "filled", onClick: d, children: b("explorer.see.more") }) })
155
+ y && /* @__PURE__ */ i("div", { className: "d-grid gap-2 col-4 mx-auto my-24", children: /* @__PURE__ */ i(K, { type: "button", color: "secondary", variant: "filled", onClick: d, children: b("explorer.see.more") }) })
156
156
  ] });
157
157
  };
158
158
  export {
@@ -1,2 +1,2 @@
1
- declare function Root(): import("react/jsx-runtime").JSX.Element;
1
+ declare function Root(): import("react").JSX.Element;
2
2
  export default Root;
@@ -1,4 +1,4 @@
1
1
  import { IResource } from '@edifice.io/client';
2
2
  export default function AppAction({ onResourceCreated, }: {
3
3
  onResourceCreated?: (resource: IResource) => void;
4
- }): import("react/jsx-runtime").JSX.Element | null;
4
+ }): import("react").JSX.Element | null;
@@ -1 +1 @@
1
- export default function EmptyScreenTrash(): import("react/jsx-runtime").JSX.Element;
1
+ export default function EmptyScreenTrash(): import("react").JSX.Element;