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/index.html +1 -1
- package/dist/index.js +108 -108
- package/dist/version.txt +1 -1
- package/lib/FoldersList.js +21 -20
- package/lib/ResourcesList.js +61 -59
- package/lib/index2.js +429 -429
- package/lib/services/api/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ode-explorer=
|
|
1
|
+
ode-explorer= 07/11/2024 16:20:16
|
package/lib/FoldersList.js
CHANGED
|
@@ -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
|
|
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:
|
|
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:
|
|
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(),
|
|
41
|
-
u(
|
|
42
|
-
}, g = s.overId === i,
|
|
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
|
-
|
|
44
|
+
touchAction: "none",
|
|
45
|
+
cursor: I
|
|
45
46
|
};
|
|
46
47
|
return B(() => {
|
|
47
|
-
const
|
|
48
|
-
a(
|
|
49
|
-
}, [e]), /* @__PURE__ */ l("div", { ref:
|
|
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 &&
|
|
52
|
-
/* @__PURE__ */ l(P, { width: "48", height: "48", className: `color-app-${
|
|
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(),
|
|
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
|
-
} =
|
|
68
|
+
} = z();
|
|
68
69
|
function b(e) {
|
|
69
|
-
|
|
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
|
|
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:
|
|
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
|
-
...
|
|
94
|
-
}, children: /* @__PURE__ */ l(O, { name:
|
|
95
|
-
|
|
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
|
};
|
package/lib/ResourcesList.js
CHANGED
|
@@ -1,58 +1,60 @@
|
|
|
1
1
|
import { jsx as e, jsxs as o, Fragment as j } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { Card as m, Image as G, AppIcon as L, Avatar as U, Tooltip as
|
|
4
|
-
import { useSpring as K, animated as
|
|
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
|
|
7
|
-
import { f as
|
|
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
|
|
13
|
-
app:
|
|
12
|
+
const w = ({
|
|
13
|
+
app: s,
|
|
14
14
|
resource: t,
|
|
15
15
|
time: f,
|
|
16
16
|
isSelected: x = !1,
|
|
17
|
-
isSelectable:
|
|
17
|
+
isSelectable: u = !0,
|
|
18
18
|
onClick: h,
|
|
19
19
|
onSelect: c
|
|
20
20
|
}) => {
|
|
21
|
-
const [
|
|
22
|
-
function
|
|
21
|
+
const [a, p] = M(!1), r = `/userbook/avatar/${t == null ? void 0 : t.creatorId}`;
|
|
22
|
+
function b(i) {
|
|
23
23
|
const {
|
|
24
|
-
rights:
|
|
25
|
-
creatorId:
|
|
26
|
-
} =
|
|
27
|
-
return
|
|
24
|
+
rights: l,
|
|
25
|
+
creatorId: d
|
|
26
|
+
} = i || {};
|
|
27
|
+
return l.filter((F) => !F.includes(d)).length >= 1;
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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: !!
|
|
43
|
-
}),
|
|
44
|
-
position:
|
|
45
|
-
|
|
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
|
|
50
|
-
p(
|
|
51
|
-
}, [
|
|
52
|
-
...
|
|
53
|
-
}, 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:
|
|
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
|
-
|
|
68
|
-
ns:
|
|
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
|
-
|
|
71
|
-
ns:
|
|
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
|
-
|
|
79
|
+
w.displayName = "ResourceCard";
|
|
78
80
|
const ft = ({
|
|
79
|
-
data:
|
|
81
|
+
data: s,
|
|
80
82
|
fetchNextPage: t
|
|
81
83
|
}) => {
|
|
82
84
|
const {
|
|
83
85
|
currentApp: f
|
|
84
86
|
} = q(), {
|
|
85
87
|
t: x
|
|
86
|
-
} =
|
|
87
|
-
fromNow:
|
|
88
|
-
} = H(), h = W(), c = X(),
|
|
88
|
+
} = P(), {
|
|
89
|
+
fromNow: u
|
|
90
|
+
} = H(), h = W(), c = X(), a = Y(), {
|
|
89
91
|
setSelectedResources: p,
|
|
90
92
|
setResourceIds: r,
|
|
91
|
-
openResource:
|
|
93
|
+
openResource: b,
|
|
92
94
|
setResourceIsTrash: R
|
|
93
|
-
} = Z(), I =
|
|
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
|
-
}),
|
|
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])) :
|
|
105
|
+
I ? (R(!0), r([i.id]), p([i])) : b(i);
|
|
104
106
|
};
|
|
105
|
-
async function
|
|
107
|
+
async function n(i) {
|
|
106
108
|
if (c.includes(i.id)) {
|
|
107
|
-
r(c.filter((
|
|
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([...
|
|
112
|
+
r([...c, i.id]), p([...a, i]);
|
|
111
113
|
}
|
|
112
|
-
const
|
|
113
|
-
return /* @__PURE__ */ o(
|
|
114
|
-
/* @__PURE__ */ e(
|
|
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:
|
|
117
|
-
updatedAt:
|
|
118
|
-
} = d,
|
|
119
|
-
return /* @__PURE__ */ e(
|
|
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
|
-
...
|
|
122
|
-
}, children: /* @__PURE__ */ e(
|
|
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: () =>
|
|
125
|
-
}) },
|
|
126
|
-
|
|
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 {
|