ode-explorer 1.4.19-develop.202411041127 → 1.4.19-develop.202411071534
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 +107 -107
- package/dist/version.txt +1 -1
- package/lib/ResourcesList.js +72 -71
- package/package.json +1 -1
package/dist/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ode-explorer=
|
|
1
|
+
ode-explorer= 07/11/2024 15:35:26
|
package/lib/ResourcesList.js
CHANGED
|
@@ -1,128 +1,129 @@
|
|
|
1
|
-
import { jsx as e, jsxs as o, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { Card as m, Image as
|
|
4
|
-
import { useSpring as
|
|
5
|
-
import
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import {
|
|
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
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 z = ({
|
|
13
|
+
app: l,
|
|
14
14
|
resource: t,
|
|
15
|
-
time:
|
|
16
|
-
isSelected:
|
|
17
|
-
isSelectable:
|
|
15
|
+
time: f,
|
|
16
|
+
isSelected: x = !1,
|
|
17
|
+
isSelectable: b = !0,
|
|
18
18
|
onClick: h,
|
|
19
19
|
onSelect: c
|
|
20
20
|
}) => {
|
|
21
|
-
const [
|
|
22
|
-
function
|
|
21
|
+
const [s, p] = M(!1), r = `/userbook/avatar/${t == null ? void 0 : t.creatorId}`;
|
|
22
|
+
function u(a) {
|
|
23
23
|
const {
|
|
24
|
-
rights:
|
|
25
|
-
creatorId:
|
|
26
|
-
} =
|
|
27
|
-
return
|
|
24
|
+
rights: d,
|
|
25
|
+
creatorId: F
|
|
26
|
+
} = a || {};
|
|
27
|
+
return d.filter((T) => !T.includes(F)).length >= 1;
|
|
28
28
|
}
|
|
29
|
-
const {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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,
|
|
33
35
|
transform: n
|
|
34
36
|
} = _({
|
|
35
37
|
id: t.id,
|
|
36
38
|
data: {
|
|
37
39
|
id: t.id,
|
|
38
40
|
type: "resource"
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
zIndex: a ? 2e3 : 1,
|
|
41
|
+
},
|
|
42
|
+
disabled: !!R
|
|
43
|
+
}), i = {
|
|
44
|
+
position: s ? "absolute" : "relative",
|
|
45
|
+
zIndex: s ? 2e3 : 1,
|
|
45
46
|
transform: `translate3d(${((n == null ? void 0 : n.x) ?? 0) / 1}px, ${((n == null ? void 0 : n.y) ?? 0) / 1}px, 0)`
|
|
46
47
|
};
|
|
47
|
-
return
|
|
48
|
-
const
|
|
49
|
-
p(
|
|
50
|
-
}, [
|
|
51
|
-
...
|
|
52
|
-
}, children:
|
|
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: [
|
|
53
54
|
/* @__PURE__ */ o(m.Body, { children: [
|
|
54
|
-
/* @__PURE__ */ e("div", { className: "card-image medium", children: t != null && t.thumbnail ? /* @__PURE__ */ e(
|
|
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" }) }),
|
|
55
56
|
/* @__PURE__ */ o("div", { className: "text-truncate", children: [
|
|
56
57
|
/* @__PURE__ */ e(m.Title, { children: t == null ? void 0 : t.name }),
|
|
57
|
-
/* @__PURE__ */ e(m.Text, { children: /* @__PURE__ */ e("em", { children:
|
|
58
|
+
/* @__PURE__ */ e(m.Text, { children: /* @__PURE__ */ e("em", { children: f }) })
|
|
58
59
|
] })
|
|
59
60
|
] }),
|
|
60
61
|
/* @__PURE__ */ o(m.Footer, { children: [
|
|
61
62
|
/* @__PURE__ */ o("div", { className: "d-inline-flex align-items-center gap-8 text-truncate", children: [
|
|
62
|
-
r ? /* @__PURE__ */ e(
|
|
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, {}),
|
|
63
64
|
/* @__PURE__ */ e(m.Text, { children: t == null ? void 0 : t.creatorName })
|
|
64
65
|
] }),
|
|
65
66
|
/* @__PURE__ */ o("div", { className: "d-inline-flex align-items-center gap-8", children: [
|
|
66
|
-
|
|
67
|
-
ns:
|
|
67
|
+
I && /* @__PURE__ */ e(P, { message: g("tooltip.shared", {
|
|
68
|
+
ns: a
|
|
68
69
|
}), placement: "top", children: /* @__PURE__ */ e(tt, { width: 16, height: 16 }) }),
|
|
69
|
-
|
|
70
|
-
ns:
|
|
70
|
+
v && /* @__PURE__ */ e(P, { message: g("tooltip.public", {
|
|
71
|
+
ns: a
|
|
71
72
|
}), placement: "top", children: /* @__PURE__ */ e(et, { width: 16, height: 16 }) })
|
|
72
73
|
] })
|
|
73
74
|
] })
|
|
74
75
|
] }) }) });
|
|
75
76
|
};
|
|
76
|
-
|
|
77
|
+
z.displayName = "ResourceCard";
|
|
77
78
|
const ft = ({
|
|
78
|
-
data:
|
|
79
|
+
data: l,
|
|
79
80
|
fetchNextPage: t
|
|
80
81
|
}) => {
|
|
81
82
|
const {
|
|
82
|
-
currentApp:
|
|
83
|
-
} =
|
|
84
|
-
t:
|
|
85
|
-
} =
|
|
86
|
-
fromNow:
|
|
87
|
-
} =
|
|
83
|
+
currentApp: f
|
|
84
|
+
} = q(), {
|
|
85
|
+
t: x
|
|
86
|
+
} = w(), {
|
|
87
|
+
fromNow: b
|
|
88
|
+
} = H(), h = W(), c = X(), s = Y(), {
|
|
88
89
|
setSelectedResources: p,
|
|
89
90
|
setResourceIds: r,
|
|
90
|
-
openResource:
|
|
91
|
-
setResourceIsTrash:
|
|
92
|
-
} =
|
|
91
|
+
openResource: u,
|
|
92
|
+
setResourceIsTrash: R
|
|
93
|
+
} = Z(), I = A(), v = K({
|
|
93
94
|
from: {
|
|
94
95
|
opacity: 0
|
|
95
96
|
},
|
|
96
97
|
to: {
|
|
97
98
|
opacity: 1
|
|
98
99
|
}
|
|
99
|
-
}),
|
|
100
|
+
}), g = h.pagination.startIdx + h.pagination.pageSize < (h.pagination.maxIdx || 0), S = E(() => {
|
|
100
101
|
t();
|
|
101
|
-
}, []),
|
|
102
|
-
|
|
102
|
+
}, []), N = (i) => {
|
|
103
|
+
I ? (R(!0), r([i.id]), p([i])) : u(i);
|
|
103
104
|
};
|
|
104
|
-
async function
|
|
105
|
+
async function D(i) {
|
|
105
106
|
if (c.includes(i.id)) {
|
|
106
|
-
r(c.filter((
|
|
107
|
+
r(c.filter((a) => a !== i.id)), p(s.filter((a) => a.id !== i.id));
|
|
107
108
|
return;
|
|
108
109
|
}
|
|
109
|
-
r([...c, i.id]), p([...
|
|
110
|
+
r([...c, i.id]), p([...s, i]);
|
|
110
111
|
}
|
|
111
|
-
const
|
|
112
|
-
return /* @__PURE__ */ o(
|
|
113
|
-
/* @__PURE__ */ e(
|
|
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
115
|
const {
|
|
115
|
-
id:
|
|
116
|
-
updatedAt:
|
|
117
|
-
} = d,
|
|
118
|
-
return /* @__PURE__ */ e(
|
|
116
|
+
id: F,
|
|
117
|
+
updatedAt: C
|
|
118
|
+
} = d, T = b(C);
|
|
119
|
+
return /* @__PURE__ */ e(k.li, { className: "g-col-4", style: {
|
|
119
120
|
position: "relative",
|
|
120
|
-
...
|
|
121
|
-
}, children: /* @__PURE__ */ e(
|
|
122
|
-
|
|
123
|
-
}, onSelect: () =>
|
|
124
|
-
}) },
|
|
125
|
-
|
|
121
|
+
...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") }) })
|
|
126
127
|
] });
|
|
127
128
|
};
|
|
128
129
|
export {
|