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/index.html +1 -1
- package/dist/index.js +106 -106
- package/dist/version.txt +1 -1
- package/lib/FoldersList.js +65 -62
- package/lib/ResourcesList.js +90 -89
- package/lib/index2.js +1 -3
- package/package.json +1 -1
package/dist/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ode-explorer=
|
|
1
|
+
ode-explorer= 08/11/2024 08:43:10
|
package/lib/FoldersList.js
CHANGED
|
@@ -1,82 +1,85 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Card as S, useScrollToTop as
|
|
3
|
-
import { useSpring as
|
|
4
|
-
import { useQueryClient as
|
|
5
|
-
import { o as C, s as
|
|
6
|
-
import { useState as
|
|
7
|
-
import { useDroppable as
|
|
8
|
-
import { Files as
|
|
9
|
-
import { D as
|
|
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:
|
|
13
|
-
idFolder:
|
|
14
|
-
isSelected:
|
|
15
|
-
isSelectable:
|
|
16
|
-
onClick:
|
|
17
|
-
onSelect:
|
|
12
|
+
name: c,
|
|
13
|
+
idFolder: l,
|
|
14
|
+
isSelected: i = !1,
|
|
15
|
+
isSelectable: m = !0,
|
|
16
|
+
onClick: D,
|
|
17
|
+
onSelect: b
|
|
18
18
|
}) => {
|
|
19
|
-
const [
|
|
20
|
-
|
|
21
|
-
} =
|
|
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:
|
|
25
|
-
name:
|
|
26
|
+
id: l,
|
|
27
|
+
name: c,
|
|
26
28
|
isTreeview: !1,
|
|
27
29
|
accepts: ["folder", "resource"]
|
|
28
30
|
}
|
|
29
31
|
}), {
|
|
30
|
-
attributes:
|
|
31
|
-
listeners:
|
|
32
|
-
setNodeRef:
|
|
33
|
-
transform:
|
|
34
|
-
} =
|
|
32
|
+
attributes: y,
|
|
33
|
+
listeners: u,
|
|
34
|
+
setNodeRef: g,
|
|
35
|
+
transform: e
|
|
36
|
+
} = Q({
|
|
35
37
|
id: p,
|
|
36
38
|
data: {
|
|
37
|
-
id:
|
|
39
|
+
id: l,
|
|
38
40
|
type: "folder"
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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:
|
|
48
|
+
cursor: T
|
|
46
49
|
};
|
|
47
|
-
return
|
|
48
|
-
const
|
|
49
|
-
a(
|
|
50
|
-
}, [
|
|
51
|
-
...
|
|
52
|
-
}, children:
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
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
|
|
61
|
+
const ee = ({
|
|
59
62
|
data: r
|
|
60
63
|
}) => {
|
|
61
|
-
var u,
|
|
62
|
-
const
|
|
63
|
-
currentApp:
|
|
64
|
-
} =
|
|
65
|
-
setSelectedFolders:
|
|
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
|
-
} =
|
|
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
|
-
|
|
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:
|
|
79
|
+
queryClient: c
|
|
77
80
|
});
|
|
78
81
|
}
|
|
79
|
-
const
|
|
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__ */
|
|
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:
|
|
91
|
-
} = e,
|
|
92
|
-
return /* @__PURE__ */
|
|
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
|
-
...
|
|
95
|
-
}, children: /* @__PURE__ */
|
|
96
|
-
|
|
97
|
-
}, onSelect: () =>
|
|
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
|
-
|
|
104
|
+
ee as default
|
|
102
105
|
};
|
package/lib/ResourcesList.js
CHANGED
|
@@ -1,133 +1,134 @@
|
|
|
1
1
|
import { jsx as e, jsxs as o, Fragment as j } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { Card as
|
|
4
|
-
import { useSpring as
|
|
5
|
-
import
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { f as
|
|
8
|
-
import { useDraggable as
|
|
9
|
-
import { Users as
|
|
10
|
-
import { OneProfile as
|
|
11
|
-
import { D as
|
|
12
|
-
const
|
|
13
|
-
app:
|
|
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:
|
|
16
|
-
isSelected:
|
|
17
|
-
isSelectable:
|
|
18
|
-
onClick:
|
|
15
|
+
time: x,
|
|
16
|
+
isSelected: u = !1,
|
|
17
|
+
isSelectable: b = !0,
|
|
18
|
+
onClick: m,
|
|
19
19
|
onSelect: c
|
|
20
20
|
}) => {
|
|
21
|
-
const [
|
|
22
|
-
|
|
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:
|
|
25
|
-
creatorId:
|
|
26
|
-
} =
|
|
27
|
-
return
|
|
26
|
+
rights: D,
|
|
27
|
+
creatorId: F
|
|
28
|
+
} = a || {};
|
|
29
|
+
return D.filter((T) => !T.includes(F)).length >= 1;
|
|
28
30
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
}, [
|
|
54
|
-
...
|
|
55
|
-
}, children:
|
|
56
|
-
/* @__PURE__ */ o(
|
|
57
|
-
/* @__PURE__ */ e("div", { className: "card-image medium", children: t != null && t.thumbnail ? /* @__PURE__ */ e(
|
|
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(
|
|
60
|
-
/* @__PURE__ */ e(
|
|
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(
|
|
64
|
+
/* @__PURE__ */ o(r.Footer, { children: [
|
|
64
65
|
/* @__PURE__ */ o("div", { className: "d-inline-flex align-items-center gap-8 text-truncate", children: [
|
|
65
|
-
|
|
66
|
-
/* @__PURE__ */ e(
|
|
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
|
-
|
|
70
|
-
ns:
|
|
71
|
-
}), placement: "top", children: /* @__PURE__ */ e(
|
|
72
|
-
|
|
73
|
-
ns:
|
|
74
|
-
}), placement: "top", children: /* @__PURE__ */ e(
|
|
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
|
-
|
|
80
|
-
const
|
|
81
|
-
data:
|
|
80
|
+
$.displayName = "ResourceCard";
|
|
81
|
+
const xt = ({
|
|
82
|
+
data: l,
|
|
82
83
|
fetchNextPage: t
|
|
83
84
|
}) => {
|
|
84
85
|
const {
|
|
85
|
-
currentApp:
|
|
86
|
-
} =
|
|
87
|
-
t:
|
|
88
|
-
} =
|
|
89
|
-
fromNow:
|
|
90
|
-
} =
|
|
91
|
-
setSelectedResources:
|
|
92
|
-
setResourceIds:
|
|
93
|
-
openResource:
|
|
94
|
-
setResourceIsTrash:
|
|
95
|
-
} =
|
|
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 =
|
|
103
|
+
}), y = m.pagination.startIdx + m.pagination.pageSize < (m.pagination.maxIdx || 0), n = E(() => {
|
|
103
104
|
t();
|
|
104
|
-
}, []),
|
|
105
|
-
I ? (
|
|
105
|
+
}, []), S = (i) => {
|
|
106
|
+
I ? (g(!0), p([i.id]), h([i])) : R(i);
|
|
106
107
|
};
|
|
107
|
-
async function
|
|
108
|
+
async function N(i) {
|
|
108
109
|
if (c.includes(i.id)) {
|
|
109
|
-
|
|
110
|
+
p(c.filter((d) => d !== i.id)), h(s.filter((d) => d.id !== i.id));
|
|
110
111
|
return;
|
|
111
112
|
}
|
|
112
|
-
|
|
113
|
+
p([...c, i.id]), h([...s, i]);
|
|
113
114
|
}
|
|
114
|
-
const
|
|
115
|
-
return /* @__PURE__ */ o(
|
|
116
|
-
/* @__PURE__ */ e(
|
|
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:
|
|
119
|
+
id: D,
|
|
119
120
|
updatedAt: F
|
|
120
|
-
} =
|
|
121
|
-
return /* @__PURE__ */ e(
|
|
121
|
+
} = a, k = b(F);
|
|
122
|
+
return /* @__PURE__ */ e(P.li, { className: "g-col-4", style: {
|
|
122
123
|
position: "relative",
|
|
123
|
-
...
|
|
124
|
-
}, children: /* @__PURE__ */ e(
|
|
125
|
-
|
|
126
|
-
}, onSelect: () =>
|
|
127
|
-
}) },
|
|
128
|
-
y && /* @__PURE__ */ e("div", { className: "d-grid gap-2 col-4 mx-auto my-24", children: /* @__PURE__ */ e(
|
|
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
|
-
|
|
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
|
|
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") }) }),
|