ode-explorer 1.4.19-develop.202411071534 → 1.4.19-develop.202411080842

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