ode-explorer 1.4.19-develop.202411061500 → 1.4.19-develop.202411071619

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= 06/11/2024 15:01:27
1
+ ode-explorer= 07/11/2024 16:20:16
@@ -2,7 +2,7 @@ import { jsx as l, jsxs as x } from "react/jsx-runtime";
2
2
  import { Card as S, useScrollToTop as N, useOdeClient as R } from "@edifice-ui/react";
3
3
  import { useSpring as w, animated as v } from "@react-spring/web";
4
4
  import { useQueryClient as $ } from "@tanstack/react-query";
5
- import { o as C, s as j, j as k, k as z, a as A } from "./index2.js";
5
+ import { o as C, s as j, j as k, k as A, a as z } from "./index2.js";
6
6
  import { useState as E, useId as q, useEffect as B } from "react";
7
7
  import { useDroppable as L, useDraggable as M } from "@dnd-kit/core";
8
8
  import { Files as P } from "@edifice-ui/icons";
@@ -11,7 +11,7 @@ const O = ({
11
11
  app: r,
12
12
  name: d,
13
13
  idFolder: i,
14
- isSelected: c = !1,
14
+ isSelected: n = !1,
15
15
  isSelectable: f = !0,
16
16
  onClick: m,
17
17
  onSelect: D
@@ -28,7 +28,7 @@ const O = ({
28
28
  }
29
29
  }), {
30
30
  attributes: F,
31
- listeners: y,
31
+ listeners: h,
32
32
  setNodeRef: u,
33
33
  transform: o
34
34
  } = M({
@@ -37,19 +37,20 @@ const O = ({
37
37
  id: i,
38
38
  type: "folder"
39
39
  }
40
- }), e = C(), s = j(), I = (n) => {
41
- u(n), b(n);
42
- }, g = s.overId === i, h = !s.canMove && s.isTreeview ? "no-drop" : t ? "grabbing" : "default", T = {
40
+ }), e = C(), s = j(), y = (c) => {
41
+ u(c), b(c);
42
+ }, g = s.overId === i, I = !s.canMove && s.isTreeview ? "no-drop" : t ? "grabbing" : "default", T = {
43
43
  transform: `translate3d(${((o == null ? void 0 : o.x) ?? 0) / 1}px, ${((o == null ? void 0 : o.y) ?? 0) / 1}px, 0)`,
44
- cursor: h
44
+ touchAction: "none",
45
+ cursor: I
45
46
  };
46
47
  return B(() => {
47
- const n = e.elementDrag === i;
48
- a(n);
49
- }, [e]), /* @__PURE__ */ l("div", { ref: I, ...y, ...F, style: {
48
+ const c = e.elementDrag === i;
49
+ a(c);
50
+ }, [e]), /* @__PURE__ */ l("div", { ref: y, ...h, ...F, style: {
50
51
  ...T
51
- }, children: t ? /* @__PURE__ */ l(Q, { name: d, app: r, type: "folder" }) : /* @__PURE__ */ l(S, { app: r, isSelectable: !t && f, isSelected: !t && c || g && t, isFocused: g, onClick: m, onSelect: D, children: (n) => /* @__PURE__ */ x(S.Body, { children: [
52
- /* @__PURE__ */ l(P, { width: "48", height: "48", className: `color-app-${n}` }),
52
+ }, children: t ? /* @__PURE__ */ l(Q, { name: d, app: r, type: "folder" }) : /* @__PURE__ */ l(S, { app: r, isSelectable: !t && f, isSelected: !t && n || g && t, isFocused: g, onClick: m, onSelect: D, children: (c) => /* @__PURE__ */ x(S.Body, { children: [
53
+ /* @__PURE__ */ l(P, { width: "48", height: "48", className: `color-app-${c}` }),
53
54
  /* @__PURE__ */ l(S.Title, { children: d })
54
55
  ] }) }) });
55
56
  };
@@ -58,15 +59,15 @@ const Z = ({
58
59
  data: r
59
60
  }) => {
60
61
  var u, o;
61
- const d = $(), i = k(), c = z(), f = C(), m = N(), {
62
+ const d = $(), i = k(), n = A(), f = C(), m = N(), {
62
63
  currentApp: D
63
64
  } = R(), {
64
65
  setSelectedFolders: t,
65
66
  setFolderIds: a,
66
67
  openFolder: p
67
- } = A();
68
+ } = z();
68
69
  function b(e) {
69
- c.includes(e.id) ? (a(c.filter((s) => s !== e.id)), t(i.filter((s) => s.id !== e.id))) : (a([e.id, ...c]), t([e, ...i]));
70
+ n.includes(e.id) ? (a(n.filter((s) => s !== e.id)), t(i.filter((s) => s.id !== e.id))) : (a([e.id, ...n]), t([e, ...i]));
70
71
  }
71
72
  function F(e) {
72
73
  m(), p({
@@ -75,7 +76,7 @@ const Z = ({
75
76
  queryClient: d
76
77
  });
77
78
  }
78
- const y = w({
79
+ const h = w({
79
80
  from: {
80
81
  opacity: 0
81
82
  },
@@ -86,13 +87,13 @@ const Z = ({
86
87
  return (u = r == null ? void 0 : r.pages[0]) != null && u.folders.length ? /* @__PURE__ */ l(v.ul, { className: "grid ps-0 list-unstyled mb-24", children: (o = r == null ? void 0 : r.pages[0]) == null ? void 0 : o.folders.map((e) => {
87
88
  const {
88
89
  id: s,
89
- name: I
90
+ name: y
90
91
  } = e, g = f.elementDrag === s;
91
92
  return /* @__PURE__ */ l(v.li, { className: `g-col-4 ${g ? "z-2000" : "z-1"}`, style: {
92
93
  position: "relative",
93
- ...y
94
- }, children: /* @__PURE__ */ l(O, { name: I, idFolder: s, app: D, isSelected: c.includes(e.id), onClick: (h) => {
95
- h.stopPropagation(), F(e);
94
+ ...h
95
+ }, children: /* @__PURE__ */ l(O, { name: y, idFolder: s, app: D, isSelected: n.includes(e.id), onClick: (I) => {
96
+ I.stopPropagation(), F(e);
96
97
  }, onSelect: () => b(e) }) }, s);
97
98
  }) }) : null;
98
99
  };
@@ -1,58 +1,60 @@
1
1
  import { jsx as e, jsxs as o, Fragment as j } from "react/jsx-runtime";
2
- import O, { useState as M, useEffect as B, useCallback as E } from "react";
3
- import { Card as m, Image as G, AppIcon as L, Avatar as U, Tooltip as P, useOdeClient as q, useDate as H, Button as J } from "@edifice-ui/react";
4
- import { useSpring as K, animated as k } from "@react-spring/web";
2
+ import C, { useState as M, useEffect as B, useCallback as E } from "react";
3
+ import { Card as m, Image as G, AppIcon as L, Avatar as U, Tooltip as A, useOdeClient as q, useDate as H, Button as J } from "@edifice-ui/react";
4
+ import { useSpring as K, animated as O } from "@react-spring/web";
5
5
  import Q from "clsx";
6
- import { useTranslation as w } from "react-i18next";
7
- import { f as A, o as V, e as W, h as X, i as Y, a as Z } from "./index2.js";
6
+ import { useTranslation as P } from "react-i18next";
7
+ import { f as k, o as V, e as W, h as X, i as Y, a as Z } from "./index2.js";
8
8
  import { useDraggable as _ } from "@dnd-kit/core";
9
9
  import { Users as tt, Globe as et } from "@edifice-ui/icons";
10
10
  import { OneProfile as it } from "@edifice-ui/icons/nav";
11
11
  import { D as at } from "./DraggableCard.js";
12
- const z = ({
13
- app: l,
12
+ const w = ({
13
+ app: s,
14
14
  resource: t,
15
15
  time: f,
16
16
  isSelected: x = !1,
17
- isSelectable: b = !0,
17
+ isSelectable: u = !0,
18
18
  onClick: h,
19
19
  onSelect: c
20
20
  }) => {
21
- const [s, p] = M(!1), r = `/userbook/avatar/${t == null ? void 0 : t.creatorId}`;
22
- function u(a) {
21
+ const [a, p] = M(!1), r = `/userbook/avatar/${t == null ? void 0 : t.creatorId}`;
22
+ function b(i) {
23
23
  const {
24
- rights: d,
25
- creatorId: F
26
- } = a || {};
27
- return d.filter((T) => !T.includes(F)).length >= 1;
24
+ rights: l,
25
+ creatorId: d
26
+ } = i || {};
27
+ return l.filter((F) => !F.includes(d)).length >= 1;
28
28
  }
29
- const R = A(), I = u(t), v = t == null ? void 0 : t.public, y = V(), {
30
- t: g
31
- } = w(), {
32
- attributes: S,
33
- listeners: N,
34
- setNodeRef: D,
29
+ k();
30
+ const R = b(t), I = t == null ? void 0 : t.public, g = V(), {
31
+ t: v
32
+ } = P(), {
33
+ attributes: y,
34
+ listeners: S,
35
+ setNodeRef: N,
35
36
  transform: n
36
37
  } = _({
37
38
  id: t.id,
38
39
  data: {
39
40
  id: t.id,
40
41
  type: "resource"
41
- },
42
- disabled: !!R
43
- }), i = {
44
- position: s ? "absolute" : "relative",
45
- zIndex: s ? 2e3 : 1,
42
+ }
43
+ // disabled: !!isTrashFolder,
44
+ }), D = {
45
+ position: a ? "absolute" : "relative",
46
+ touchAction: "none",
47
+ zIndex: a ? 2e3 : 1,
46
48
  transform: `translate3d(${((n == null ? void 0 : n.x) ?? 0) / 1}px, ${((n == null ? void 0 : n.y) ?? 0) / 1}px, 0)`
47
49
  };
48
50
  return B(() => {
49
- const a = y.elementDrag === t.id;
50
- p(a);
51
- }, [y]), /* @__PURE__ */ e("div", { ref: D, ...N, ...S, style: {
52
- ...i
53
- }, children: s ? /* @__PURE__ */ e(at, { app: l, type: "resource", name: t == null ? void 0 : t.name }) : /* @__PURE__ */ e(m, { app: l, isSelected: !s && x, isSelectable: !s && b, onClick: h, onSelect: c, children: (a) => /* @__PURE__ */ o(j, { children: [
51
+ const i = g.elementDrag === t.id;
52
+ p(i);
53
+ }, [g]), /* @__PURE__ */ e("div", { ref: N, ...S, ...y, style: {
54
+ ...D
55
+ }, children: a ? /* @__PURE__ */ e(at, { app: s, type: "resource", name: t == null ? void 0 : t.name }) : /* @__PURE__ */ e(m, { app: s, isSelected: !a && x, isSelectable: !a && u, onClick: h, onSelect: c, children: (i) => /* @__PURE__ */ o(j, { children: [
54
56
  /* @__PURE__ */ o(m.Body, { children: [
55
- /* @__PURE__ */ e("div", { className: "card-image medium", children: t != null && t.thumbnail ? /* @__PURE__ */ e(G, { alt: "", src: `${t == null ? void 0 : t.thumbnail}?thumbnail=80x80`, objectFit: "cover", className: "h-full w-100" }) : /* @__PURE__ */ e(L, { app: l, iconFit: "ratio", size: "80", variant: "rounded" }) }),
57
+ /* @__PURE__ */ e("div", { className: "card-image medium", children: t != null && t.thumbnail ? /* @__PURE__ */ e(G, { alt: "", src: `${t == null ? void 0 : t.thumbnail}?thumbnail=80x80`, objectFit: "cover", className: "h-full w-100" }) : /* @__PURE__ */ e(L, { app: s, iconFit: "ratio", size: "80", variant: "rounded" }) }),
56
58
  /* @__PURE__ */ o("div", { className: "text-truncate", children: [
57
59
  /* @__PURE__ */ e(m.Title, { children: t == null ? void 0 : t.name }),
58
60
  /* @__PURE__ */ e(m.Text, { children: /* @__PURE__ */ e("em", { children: f }) })
@@ -64,66 +66,66 @@ const z = ({
64
66
  /* @__PURE__ */ e(m.Text, { children: t == null ? void 0 : t.creatorName })
65
67
  ] }),
66
68
  /* @__PURE__ */ o("div", { className: "d-inline-flex align-items-center gap-8", children: [
67
- I && /* @__PURE__ */ e(P, { message: g("tooltip.shared", {
68
- ns: a
69
+ R && /* @__PURE__ */ e(A, { message: v("tooltip.shared", {
70
+ ns: i
69
71
  }), placement: "top", children: /* @__PURE__ */ e(tt, { width: 16, height: 16 }) }),
70
- v && /* @__PURE__ */ e(P, { message: g("tooltip.public", {
71
- ns: a
72
+ I && /* @__PURE__ */ e(A, { message: v("tooltip.public", {
73
+ ns: i
72
74
  }), placement: "top", children: /* @__PURE__ */ e(et, { width: 16, height: 16 }) })
73
75
  ] })
74
76
  ] })
75
77
  ] }) }) });
76
78
  };
77
- z.displayName = "ResourceCard";
79
+ w.displayName = "ResourceCard";
78
80
  const ft = ({
79
- data: l,
81
+ data: s,
80
82
  fetchNextPage: t
81
83
  }) => {
82
84
  const {
83
85
  currentApp: f
84
86
  } = q(), {
85
87
  t: x
86
- } = w(), {
87
- fromNow: b
88
- } = H(), h = W(), c = X(), s = Y(), {
88
+ } = P(), {
89
+ fromNow: u
90
+ } = H(), h = W(), c = X(), a = Y(), {
89
91
  setSelectedResources: p,
90
92
  setResourceIds: r,
91
- openResource: u,
93
+ openResource: b,
92
94
  setResourceIsTrash: R
93
- } = Z(), I = A(), v = K({
95
+ } = Z(), I = k(), g = K({
94
96
  from: {
95
97
  opacity: 0
96
98
  },
97
99
  to: {
98
100
  opacity: 1
99
101
  }
100
- }), g = h.pagination.startIdx + h.pagination.pageSize < (h.pagination.maxIdx || 0), S = E(() => {
102
+ }), y = h.pagination.startIdx + h.pagination.pageSize < (h.pagination.maxIdx || 0), S = E(() => {
101
103
  t();
102
104
  }, []), N = (i) => {
103
- I ? (R(!0), r([i.id]), p([i])) : u(i);
105
+ I ? (R(!0), r([i.id]), p([i])) : b(i);
104
106
  };
105
- async function D(i) {
107
+ async function n(i) {
106
108
  if (c.includes(i.id)) {
107
- r(c.filter((a) => a !== i.id)), p(s.filter((a) => a.id !== i.id));
109
+ r(c.filter((l) => l !== i.id)), p(a.filter((l) => l.id !== i.id));
108
110
  return;
109
111
  }
110
- r([...c, i.id]), p([...s, i]);
112
+ r([...c, i.id]), p([...a, i]);
111
113
  }
112
- const n = Q("grid ps-0 list-unstyled");
113
- return /* @__PURE__ */ o(O.Fragment, { children: [
114
- /* @__PURE__ */ e(k.ul, { className: n, children: l == null ? void 0 : l.pages.map((i, a) => /* @__PURE__ */ e(O.Fragment, { children: i.resources.map((d) => {
114
+ const D = Q("grid ps-0 list-unstyled");
115
+ return /* @__PURE__ */ o(C.Fragment, { children: [
116
+ /* @__PURE__ */ e(O.ul, { className: D, children: s == null ? void 0 : s.pages.map((i, l) => /* @__PURE__ */ e(C.Fragment, { children: i.resources.map((d) => {
115
117
  const {
116
- id: F,
117
- updatedAt: C
118
- } = d, T = b(C);
119
- return /* @__PURE__ */ e(k.li, { className: "g-col-4", style: {
118
+ id: T,
119
+ updatedAt: F
120
+ } = d, z = u(F);
121
+ return /* @__PURE__ */ e(O.li, { className: "g-col-4", style: {
120
122
  position: "relative",
121
- ...v
122
- }, children: /* @__PURE__ */ e(z, { app: f, resource: d, time: T, isSelectable: !0, isSelected: c.includes(d.id), onClick: ($) => {
123
+ ...g
124
+ }, children: /* @__PURE__ */ e(w, { app: f, resource: d, time: z, isSelectable: !0, isSelected: c.includes(d.id), onClick: ($) => {
123
125
  $.stopPropagation(), N(d);
124
- }, onSelect: () => D(d) }) }, F);
125
- }) }, a)) }),
126
- g && /* @__PURE__ */ e("div", { className: "d-grid gap-2 col-4 mx-auto my-24", children: /* @__PURE__ */ e(J, { type: "button", color: "secondary", variant: "filled", onClick: S, children: x("explorer.see.more") }) })
126
+ }, onSelect: () => n(d) }) }, T);
127
+ }) }, l)) }),
128
+ y && /* @__PURE__ */ e("div", { className: "d-grid gap-2 col-4 mx-auto my-24", children: /* @__PURE__ */ e(J, { type: "button", color: "secondary", variant: "filled", onClick: S, children: x("explorer.see.more") }) })
127
129
  ] });
128
130
  };
129
131
  export {