ode-explorer 1.4.19-develop-integration.202411070959 → 1.4.19-develop-integration.202411081824

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