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/index.html +1 -1
- package/dist/index.js +105 -105
- package/dist/version.txt +1 -1
- package/lib/FoldersList.js +64 -61
- package/lib/ResourcesList.js +88 -86
- package/lib/index2.js +427 -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= 08/11/2024 18:25:55
|
package/lib/FoldersList.js
CHANGED
|
@@ -1,81 +1,84 @@
|
|
|
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 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:
|
|
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: y
|
|
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: I,
|
|
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
|
-
|
|
44
|
-
|
|
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
|
|
47
|
-
const n =
|
|
49
|
+
return M(() => {
|
|
50
|
+
const n = s.elementDrag === l;
|
|
48
51
|
a(n);
|
|
49
|
-
}, [
|
|
50
|
-
...
|
|
51
|
-
}, children:
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
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
|
|
60
|
+
const ee = ({
|
|
58
61
|
data: r
|
|
59
62
|
}) => {
|
|
60
|
-
var u,
|
|
61
|
-
const
|
|
62
|
-
currentApp:
|
|
63
|
-
} =
|
|
64
|
-
setSelectedFolders:
|
|
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
|
-
} =
|
|
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
|
-
|
|
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:
|
|
78
|
+
queryClient: c
|
|
76
79
|
});
|
|
77
80
|
}
|
|
78
|
-
const
|
|
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__ */
|
|
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:
|
|
90
|
-
} = e,
|
|
91
|
-
return /* @__PURE__ */
|
|
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
|
-
...
|
|
94
|
-
}, children: /* @__PURE__ */
|
|
95
|
-
|
|
96
|
-
}, onSelect: () =>
|
|
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
|
-
|
|
103
|
+
ee as default
|
|
101
104
|
};
|
package/lib/ResourcesList.js
CHANGED
|
@@ -1,131 +1,133 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import O, { useState as
|
|
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:
|
|
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:
|
|
16
|
-
isSelected:
|
|
17
|
-
isSelectable:
|
|
18
|
-
onClick:
|
|
19
|
-
onSelect:
|
|
15
|
+
time: x,
|
|
16
|
+
isSelected: b = !1,
|
|
17
|
+
isSelectable: u = !0,
|
|
18
|
+
onClick: r,
|
|
19
|
+
onSelect: o
|
|
20
20
|
}) => {
|
|
21
|
-
const [s,
|
|
22
|
-
|
|
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:
|
|
26
|
+
rights: D,
|
|
25
27
|
creatorId: F
|
|
26
28
|
} = a || {};
|
|
27
|
-
return
|
|
29
|
+
return D.filter((T) => !T.includes(F)).length >= 1;
|
|
28
30
|
}
|
|
29
|
-
const
|
|
30
|
-
t:
|
|
31
|
-
} =
|
|
32
|
-
attributes:
|
|
33
|
-
listeners:
|
|
34
|
-
setNodeRef:
|
|
35
|
-
transform:
|
|
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: !!
|
|
43
|
-
}),
|
|
44
|
+
disabled: !!I || !h
|
|
45
|
+
}), l = {
|
|
44
46
|
position: s ? "absolute" : "relative",
|
|
45
47
|
zIndex: s ? 2e3 : 1,
|
|
46
|
-
transform: `translate3d(${((
|
|
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
|
|
49
|
-
const a =
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
...
|
|
53
|
-
}, children: s ? /* @__PURE__ */ e(
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */ e("div", { className: "card-image medium", children: t != null && t.thumbnail ? /* @__PURE__ */ e(
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */ e(
|
|
58
|
-
/* @__PURE__ */ e(
|
|
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__ */
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
64
|
-
/* @__PURE__ */ e(
|
|
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__ */
|
|
67
|
-
|
|
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(
|
|
70
|
-
|
|
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(
|
|
74
|
+
}), placement: "top", children: /* @__PURE__ */ e(it, { width: 16, height: 16 }) })
|
|
73
75
|
] })
|
|
74
76
|
] })
|
|
75
77
|
] }) }) });
|
|
76
78
|
};
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
data:
|
|
79
|
+
$.displayName = "ResourceCard";
|
|
80
|
+
const xt = ({
|
|
81
|
+
data: n,
|
|
80
82
|
fetchNextPage: t
|
|
81
83
|
}) => {
|
|
82
84
|
const {
|
|
83
|
-
currentApp:
|
|
84
|
-
} =
|
|
85
|
-
t:
|
|
86
|
-
} =
|
|
87
|
-
fromNow:
|
|
88
|
-
} =
|
|
89
|
-
setSelectedResources:
|
|
90
|
-
setResourceIds:
|
|
91
|
-
openResource:
|
|
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
|
-
} =
|
|
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 =
|
|
102
|
+
}), g = r.pagination.startIdx + r.pagination.pageSize < (r.pagination.maxIdx || 0), f = E(() => {
|
|
101
103
|
t();
|
|
102
|
-
}, []),
|
|
103
|
-
I ? (R(!0),
|
|
104
|
+
}, []), y = (i) => {
|
|
105
|
+
I ? (R(!0), h([i.id]), m([i])) : p(i);
|
|
104
106
|
};
|
|
105
|
-
async function
|
|
106
|
-
if (
|
|
107
|
-
|
|
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
|
-
|
|
112
|
+
h([...o, i.id]), m([...s, i]);
|
|
111
113
|
}
|
|
112
|
-
const
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
-
/* @__PURE__ */ e(
|
|
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:
|
|
117
|
-
updatedAt:
|
|
118
|
-
} =
|
|
119
|
-
return /* @__PURE__ */ e(
|
|
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(
|
|
123
|
-
|
|
124
|
-
}, onSelect: () =>
|
|
125
|
-
}) },
|
|
126
|
-
g && /* @__PURE__ */ e("div", { className: "d-grid gap-2 col-4 mx-auto my-24", children: /* @__PURE__ */ e(
|
|
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
|
-
|
|
132
|
+
xt as default
|
|
131
133
|
};
|