ode-explorer 1.4.19-develop.202411071619 → 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 16:20:16
1
+ ode-explorer= 08/11/2024 08:43:10
@@ -1,82 +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 A, a as z } 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: n = !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: h,
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(), y = (c) => {
41
- u(c), b(c);
42
- }, g = s.overId === i, I = !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)`,
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)`,
44
47
  touchAction: "none",
45
- cursor: I
48
+ cursor: T
46
49
  };
47
- return B(() => {
48
- const c = e.elementDrag === i;
49
- a(c);
50
- }, [e]), /* @__PURE__ */ l("div", { ref: y, ...h, ...F, style: {
51
- ...T
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}` }),
54
- /* @__PURE__ */ l(S.Title, { children: d })
50
+ return M(() => {
51
+ const n = s.elementDrag === l;
52
+ a(n);
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 })
55
58
  ] }) }) });
56
59
  };
57
60
  O.displayName = "FolderCard";
58
- const Z = ({
61
+ const ee = ({
59
62
  data: r
60
63
  }) => {
61
- var u, o;
62
- const d = $(), i = k(), n = A(), f = C(), m = N(), {
63
- currentApp: D
64
- } = R(), {
65
- 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,
66
69
  setFolderIds: a,
67
70
  openFolder: p
68
- } = z();
69
- function b(e) {
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]));
71
- }
71
+ } = E();
72
72
  function F(e) {
73
- 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({
74
77
  folder: e,
75
78
  folderId: e.id,
76
- queryClient: d
79
+ queryClient: c
77
80
  });
78
81
  }
79
- const h = w({
82
+ const y = $({
80
83
  from: {
81
84
  opacity: 0
82
85
  },
@@ -84,19 +87,19 @@ const Z = ({
84
87
  opacity: 1
85
88
  }
86
89
  });
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) => {
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) => {
88
91
  const {
89
92
  id: s,
90
- name: y
91
- } = e, g = f.elementDrag === s;
92
- 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: {
93
96
  position: "relative",
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);
97
- }, onSelect: () => b(e) }) }, s);
97
+ ...y
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);
98
101
  }) }) : null;
99
102
  };
100
103
  export {
101
- Z as default
104
+ ee as default
102
105
  };
@@ -1,133 +1,134 @@
1
1
  import { jsx as e, jsxs as o, Fragment as j } from "react/jsx-runtime";
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
- import Q from "clsx";
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
- 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 w = ({
13
- app: s,
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
+ import { useTranslation as w } from "react-i18next";
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
+ app: l,
14
14
  resource: t,
15
- time: f,
16
- isSelected: x = !1,
17
- isSelectable: u = !0,
18
- onClick: h,
15
+ time: x,
16
+ isSelected: u = !1,
17
+ isSelectable: b = !0,
18
+ onClick: m,
19
19
  onSelect: c
20
20
  }) => {
21
- const [a, p] = M(!1), r = `/userbook/avatar/${t == null ? void 0 : t.creatorId}`;
22
- function b(i) {
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: l,
25
- creatorId: d
26
- } = i || {};
27
- return l.filter((F) => !F.includes(d)).length >= 1;
26
+ rights: D,
27
+ creatorId: F
28
+ } = a || {};
29
+ return D.filter((T) => !T.includes(F)).length >= 1;
28
30
  }
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,
31
+ const {
32
+ attributes: v,
33
+ listeners: C,
34
+ setNodeRef: y,
36
35
  transform: n
37
- } = _({
36
+ } = tt({
38
37
  id: t.id,
39
38
  data: {
40
39
  id: t.id,
41
40
  type: "resource"
42
- }
43
- // disabled: !!isTrashFolder,
44
- }), D = {
45
- position: a ? "absolute" : "relative",
46
- touchAction: "none",
47
- zIndex: a ? 2e3 : 1,
48
- transform: `translate3d(${((n == null ? void 0 : n.x) ?? 0) / 1}px, ${((n == null ? void 0 : n.y) ?? 0) / 1}px, 0)`
41
+ },
42
+ disabled: !!p || !R
43
+ }), S = I(t), N = t == null ? void 0 : t.public, f = W(), {
44
+ t: i
45
+ } = w(), d = {
46
+ position: s ? "absolute" : "relative",
47
+ zIndex: s ? 2e3 : 1,
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"
49
50
  };
50
- return B(() => {
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: [
56
- /* @__PURE__ */ o(m.Body, { children: [
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" }) }),
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" }) }),
58
59
  /* @__PURE__ */ o("div", { className: "text-truncate", children: [
59
- /* @__PURE__ */ e(m.Title, { children: t == null ? void 0 : t.name }),
60
- /* @__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 }) })
61
62
  ] })
62
63
  ] }),
63
- /* @__PURE__ */ o(m.Footer, { children: [
64
+ /* @__PURE__ */ o(r.Footer, { children: [
64
65
  /* @__PURE__ */ o("div", { className: "d-inline-flex align-items-center gap-8 text-truncate", children: [
65
- r ? /* @__PURE__ */ e(U, { alt: (t == null ? void 0 : t.creatorName) || "", size: "xs", src: r, variant: "circle", width: "24", height: "24" }) : /* @__PURE__ */ e(it, {}),
66
- /* @__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 })
67
68
  ] }),
68
69
  /* @__PURE__ */ o("div", { className: "d-inline-flex align-items-center gap-8", children: [
69
- R && /* @__PURE__ */ e(A, { message: v("tooltip.shared", {
70
- ns: i
71
- }), placement: "top", children: /* @__PURE__ */ e(tt, { width: 16, height: 16 }) }),
72
- I && /* @__PURE__ */ e(A, { message: v("tooltip.public", {
73
- ns: i
74
- }), placement: "top", children: /* @__PURE__ */ e(et, { width: 16, height: 16 }) })
70
+ S && /* @__PURE__ */ e(O, { message: i("tooltip.shared", {
71
+ ns: a
72
+ }), placement: "top", children: /* @__PURE__ */ e(et, { width: 16, height: 16 }) }),
73
+ N && /* @__PURE__ */ e(O, { message: i("tooltip.public", {
74
+ ns: a
75
+ }), placement: "top", children: /* @__PURE__ */ e(it, { width: 16, height: 16 }) })
75
76
  ] })
76
77
  ] })
77
78
  ] }) }) });
78
79
  };
79
- w.displayName = "ResourceCard";
80
- const ft = ({
81
- data: s,
80
+ $.displayName = "ResourceCard";
81
+ const xt = ({
82
+ data: l,
82
83
  fetchNextPage: t
83
84
  }) => {
84
85
  const {
85
- currentApp: f
86
- } = q(), {
87
- t: x
88
- } = P(), {
89
- fromNow: u
90
- } = H(), h = W(), c = X(), a = Y(), {
91
- setSelectedResources: p,
92
- setResourceIds: r,
93
- openResource: b,
94
- setResourceIsTrash: R
95
- } = Z(), I = k(), g = K({
86
+ currentApp: x
87
+ } = H(), {
88
+ t: u
89
+ } = w(), {
90
+ fromNow: b
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({
96
97
  from: {
97
98
  opacity: 0
98
99
  },
99
100
  to: {
100
101
  opacity: 1
101
102
  }
102
- }), y = 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(() => {
103
104
  t();
104
- }, []), N = (i) => {
105
- I ? (R(!0), r([i.id]), p([i])) : b(i);
105
+ }, []), S = (i) => {
106
+ I ? (g(!0), p([i.id]), h([i])) : R(i);
106
107
  };
107
- async function n(i) {
108
+ async function N(i) {
108
109
  if (c.includes(i.id)) {
109
- r(c.filter((l) => l !== i.id)), p(a.filter((l) => l.id !== i.id));
110
+ p(c.filter((d) => d !== i.id)), h(s.filter((d) => d.id !== i.id));
110
111
  return;
111
112
  }
112
- r([...c, i.id]), p([...a, i]);
113
+ p([...c, i.id]), h([...s, i]);
113
114
  }
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
+ 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) => {
117
118
  const {
118
- id: T,
119
+ id: D,
119
120
  updatedAt: F
120
- } = d, z = u(F);
121
- return /* @__PURE__ */ e(O.li, { className: "g-col-4", style: {
121
+ } = a, k = b(F);
122
+ return /* @__PURE__ */ e(P.li, { className: "g-col-4", style: {
122
123
  position: "relative",
123
- ...g
124
- }, children: /* @__PURE__ */ e(w, { app: f, resource: d, time: z, isSelectable: !0, isSelected: c.includes(d.id), onClick: ($) => {
125
- $.stopPropagation(), N(d);
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") }) })
124
+ ...v
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") }) })
129
130
  ] });
130
131
  };
131
132
  export {
132
- ft as default
133
+ xt as default
133
134
  };
package/lib/index2.js CHANGED
@@ -1404,9 +1404,7 @@ const At = /* @__PURE__ */ q(async () => await import("./EmptyScreenApp.js")), Q
1404
1404
  }, O = () => {
1405
1405
  m(), D(), t();
1406
1406
  };
1407
- return console.log({
1408
- elementDragOver: n
1409
- }), /* @__PURE__ */ E(G, { children: [
1407
+ return /* @__PURE__ */ E(G, { children: [
1410
1408
  /* @__PURE__ */ c(Be, { data: h, selectedNodeId: p, draggedNode: n != null && n.isTreeview ? n : void 0, onTreeItemClick: w, onTreeItemUnfold: C }),
1411
1409
  /* @__PURE__ */ c(Kt, { id: N.BIN, selected: o, onSelect: d }),
1412
1410
  /* @__PURE__ */ c("div", { className: "d-grid my-16", children: /* @__PURE__ */ c(Ke, { disabled: o, type: "button", color: "primary", variant: "outline", leftIcon: /* @__PURE__ */ c(et, {}), onClick: O, children: l("explorer.folder.new") }) }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ode-explorer",
3
- "version": "1.4.19-develop.202411071619",
3
+ "version": "1.4.19-develop.202411080842",
4
4
  "description": "Edifice Explorer",
5
5
  "homepage": "https://github.com/edificeio/explorer#readme",
6
6
  "bugs": {