ode-explorer 2.1.3 → 2.2.0-develop.202503031128
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.js +13 -13
- package/dist/style.css +1 -1
- package/lib/ResourcesList.js +92 -90
- package/package.json +4 -4
package/lib/ResourcesList.js
CHANGED
|
@@ -1,158 +1,160 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import D, { useState as
|
|
3
|
-
import { useBreakpoint as
|
|
4
|
-
import { useSpring as
|
|
5
|
-
import
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { f as
|
|
8
|
-
import { useDraggable as
|
|
9
|
-
import { S as
|
|
10
|
-
const
|
|
1
|
+
import { jsxs as l, jsx as i, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import D, { useState as $, useEffect as j, useCallback as V } from "react";
|
|
3
|
+
import { useBreakpoint as E, useEdificeClient as T, Card as m, IconButton as G, Image as L, AppIcon as U, Avatar as q, Tooltip as F, useDate as J, Button as K } from "@edifice.io/react";
|
|
4
|
+
import { useSpring as Q, animated as P } from "@react-spring/web";
|
|
5
|
+
import W from "clsx";
|
|
6
|
+
import { useTranslation as z } from "react-i18next";
|
|
7
|
+
import { f as B, o as X, e as Y, h as Z, i as ee, a as ie } from "./index2.js";
|
|
8
|
+
import { useDraggable as te } from "@dnd-kit/core";
|
|
9
|
+
import { S as ae, D as le } from "./DraggableCard.js";
|
|
10
|
+
const ne = ({
|
|
11
11
|
title: t,
|
|
12
12
|
titleId: e,
|
|
13
|
-
...
|
|
14
|
-
}) => /* @__PURE__ */
|
|
13
|
+
...n
|
|
14
|
+
}) => /* @__PURE__ */ l("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", "aria-labelledby": e, ...n, children: [
|
|
15
15
|
t ? /* @__PURE__ */ i("title", { id: e, children: t }) : null,
|
|
16
16
|
/* @__PURE__ */ i("path", { fill: "currentColor", fillRule: "evenodd", d: "M9.726 3.29A9.01 9.01 0 0 0 3.055 11H7.05a16.3 16.3 0 0 1 2.676-7.71m4.548 0A16.3 16.3 0 0 1 16.95 11h3.995a9.01 9.01 0 0 0-6.67-7.71m.668 7.71A14.3 14.3 0 0 0 12 3.55 14.3 14.3 0 0 0 9.058 11zm-5.884 2h5.884A14.3 14.3 0 0 1 12 20.45 14.3 14.3 0 0 1 9.058 13M7.05 13H3.055a9.01 9.01 0 0 0 6.67 7.71A16.3 16.3 0 0 1 7.05 13m7.224 7.71A16.3 16.3 0 0 0 16.95 13h3.995a9.01 9.01 0 0 1-6.67 7.71M12 23c6.075 0 11-4.925 11-11S18.075 1 12 1 1 5.925 1 12s4.925 11 11 11", clipRule: "evenodd" })
|
|
17
|
-
] }),
|
|
17
|
+
] }), se = ({
|
|
18
18
|
title: t,
|
|
19
19
|
titleId: e,
|
|
20
|
-
...
|
|
21
|
-
}) => /* @__PURE__ */
|
|
20
|
+
...n
|
|
21
|
+
}) => /* @__PURE__ */ l("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", "aria-labelledby": e, ...n, children: [
|
|
22
22
|
t ? /* @__PURE__ */ i("title", { id: e, children: t }) : null,
|
|
23
23
|
/* @__PURE__ */ i("g", { fill: "currentColor", fillRule: "evenodd", clipPath: "url(#icon-users_svg__a)", clipRule: "evenodd", children: /* @__PURE__ */ i("path", { d: "M19.055 12.803a1 1 0 0 1 1.272-.618c1.128.39 2.061 1.247 2.7 2.351.64 1.106.972 2.435.973 3.782V21a1 1 0 1 1-2 0v-2.681c0-1.03-.258-2.009-.704-2.782-.448-.773-1.034-1.258-1.623-1.462a1 1 0 0 1-.618-1.272M15.187 1.384a1 1 0 0 1 1.036-.962 5.129 5.129 0 0 1 2.11 9.71 1 1 0 1 1-.896-1.788 3.129 3.129 0 0 0-1.288-5.924 1 1 0 0 1-.962-1.036M1.505 15.694C2.481 14.622 3.825 14 5.25 14h8.5c1.424 0 2.769.622 3.744 1.694.974 1.068 1.506 2.498 1.506 3.973V22a1 1 0 1 1-2 0v-2.333c0-1.001-.363-1.945-.984-2.627-.618-.679-1.436-1.04-2.266-1.04h-8.5c-.83 0-1.648.361-2.266 1.04-.621.682-.984 1.626-.984 2.627V22a1 1 0 1 1-2 0v-2.333c0-1.475.533-2.905 1.505-3.974M9.5 3a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7M4 6.5a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0" }) }),
|
|
24
24
|
/* @__PURE__ */ i("defs", { children: /* @__PURE__ */ i("clipPath", { id: "icon-users_svg__a", children: /* @__PURE__ */ i("path", { fill: "#fff", d: "M0 0h24v24H0z" }) }) })
|
|
25
|
-
] }),
|
|
25
|
+
] }), de = ({
|
|
26
26
|
title: t,
|
|
27
27
|
titleId: e,
|
|
28
|
-
...
|
|
29
|
-
}) => /* @__PURE__ */
|
|
28
|
+
...n
|
|
29
|
+
}) => /* @__PURE__ */ l("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", width: "24", height: "24", "aria-hidden": "true", "aria-labelledby": e, ...n, children: [
|
|
30
30
|
t ? /* @__PURE__ */ i("title", { id: e, children: t }) : null,
|
|
31
31
|
/* @__PURE__ */ i("g", { clipPath: "url(#icon-one-profile_svg__a)", children: /* @__PURE__ */ i("path", { fill: "currentColor", d: "M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24m0 4.65a4.26 4.26 0 1 1 0 8.51 4.26 4.26 0 0 1 0-8.51m0 16.64a9.27 9.27 0 0 1-7.09-3.3 5.4 5.4 0 0 1 4.77-2.9c.11 0 .23.03.34.06.63.2 1.29.33 1.98.33.7 0 1.35-.13 1.98-.33.11-.03.23-.05.34-.05a5.4 5.4 0 0 1 4.77 2.89 9.27 9.27 0 0 1-7.09 3.3" }) }),
|
|
32
32
|
/* @__PURE__ */ i("defs", { children: /* @__PURE__ */ i("clipPath", { id: "icon-one-profile_svg__a", children: /* @__PURE__ */ i("path", { fill: "#fff", d: "M0 0h24v24H0z" }) }) })
|
|
33
|
-
] }),
|
|
33
|
+
] }), k = ({
|
|
34
34
|
app: t,
|
|
35
35
|
resource: e,
|
|
36
|
-
time:
|
|
37
|
-
isSelected:
|
|
38
|
-
isSelectable:
|
|
36
|
+
time: n,
|
|
37
|
+
isSelected: b = !1,
|
|
38
|
+
isSelectable: w = !0,
|
|
39
39
|
onClick: g,
|
|
40
40
|
onSelect: r
|
|
41
41
|
}) => {
|
|
42
|
-
const [
|
|
43
|
-
lg:
|
|
44
|
-
} =
|
|
45
|
-
function
|
|
42
|
+
const [s, p] = $(!1), h = B(), {
|
|
43
|
+
lg: v
|
|
44
|
+
} = E(), u = `/userbook/avatar/${e == null ? void 0 : e.creatorId}`;
|
|
45
|
+
function R(f) {
|
|
46
46
|
const {
|
|
47
|
-
rights:
|
|
48
|
-
creatorId:
|
|
49
|
-
} =
|
|
50
|
-
return
|
|
47
|
+
rights: M,
|
|
48
|
+
creatorId: C
|
|
49
|
+
} = f || {};
|
|
50
|
+
return M.filter((O) => !O.includes(C)).length >= 1;
|
|
51
51
|
}
|
|
52
52
|
const {
|
|
53
|
-
attributes:
|
|
53
|
+
attributes: S,
|
|
54
54
|
listeners: _,
|
|
55
|
-
setNodeRef:
|
|
56
|
-
transform:
|
|
57
|
-
} =
|
|
55
|
+
setNodeRef: y,
|
|
56
|
+
transform: d
|
|
57
|
+
} = te({
|
|
58
58
|
id: e.id,
|
|
59
59
|
data: {
|
|
60
60
|
id: e.id,
|
|
61
61
|
type: "resource"
|
|
62
62
|
},
|
|
63
|
-
disabled: !!h || !
|
|
64
|
-
}),
|
|
65
|
-
|
|
66
|
-
} = T(),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
disabled: !!h || !v
|
|
64
|
+
}), I = R(e), N = e == null ? void 0 : e.public, x = X(), {
|
|
65
|
+
appCode: a
|
|
66
|
+
} = T(), {
|
|
67
|
+
t: c
|
|
68
|
+
} = z(), o = {
|
|
69
|
+
position: s ? "absolute" : "relative",
|
|
70
|
+
zIndex: s ? 2e3 : 1,
|
|
71
|
+
transform: `translate3d(${((d == null ? void 0 : d.x) ?? 0) / 1}px, ${((d == null ? void 0 : d.y) ?? 0) / 1}px, 0)`
|
|
70
72
|
};
|
|
71
|
-
return
|
|
72
|
-
const
|
|
73
|
-
p(
|
|
74
|
-
}, [
|
|
73
|
+
return j(() => {
|
|
74
|
+
const f = x.elementDrag === e.id;
|
|
75
|
+
p(f);
|
|
76
|
+
}, [x]), /* @__PURE__ */ i("div", { ref: y, style: {
|
|
75
77
|
...o
|
|
76
|
-
}, children:
|
|
77
|
-
!
|
|
78
|
+
}, children: s ? /* @__PURE__ */ i(le, { app: t, type: "resource", name: e == null ? void 0 : e.name }) : /* @__PURE__ */ i(m, { app: t, isSelected: !s && b, isSelectable: !s && w, onClick: g, onSelect: r, children: () => /* @__PURE__ */ l(H, { children: [
|
|
79
|
+
!s && v && !h && /* @__PURE__ */ i("div", { className: "card-header z-3", style: {
|
|
78
80
|
position: "fixed",
|
|
79
81
|
left: "37px"
|
|
80
|
-
}, children: /* @__PURE__ */ i(
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */ i("div", { className: "card-image medium", children: e != null && e.thumbnail ? /* @__PURE__ */ i(
|
|
83
|
-
/* @__PURE__ */
|
|
82
|
+
}, children: /* @__PURE__ */ i(G, { ..._, ...S, className: "bg-white z-3", color: "secondary", icon: /* @__PURE__ */ i(ae, {}), variant: "ghost" }) }),
|
|
83
|
+
/* @__PURE__ */ l(m.Body, { children: [
|
|
84
|
+
/* @__PURE__ */ i("div", { className: "card-image medium", children: e != null && e.thumbnail ? /* @__PURE__ */ i(L, { alt: "", src: `${e == null ? void 0 : e.thumbnail}?thumbnail=80x80`, objectFit: "cover", className: "h-full w-100" }) : /* @__PURE__ */ i(U, { app: t, iconFit: "ratio", size: "80", variant: "rounded" }) }),
|
|
85
|
+
/* @__PURE__ */ l("div", { className: "text-truncate", children: [
|
|
84
86
|
/* @__PURE__ */ i(m.Title, { children: e == null ? void 0 : e.name }),
|
|
85
|
-
/* @__PURE__ */ i(m.Text, { children: /* @__PURE__ */ i("em", { children:
|
|
87
|
+
/* @__PURE__ */ i(m.Text, { children: /* @__PURE__ */ i("em", { children: n }) })
|
|
86
88
|
] })
|
|
87
89
|
] }),
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
90
|
+
/* @__PURE__ */ l(m.Footer, { children: [
|
|
91
|
+
/* @__PURE__ */ l("div", { className: "d-inline-flex align-items-center gap-8 text-truncate", children: [
|
|
92
|
+
u ? /* @__PURE__ */ i(q, { alt: (e == null ? void 0 : e.creatorName) || "", size: "xs", src: u, variant: "circle", width: "24", height: "24" }) : /* @__PURE__ */ i(de, {}),
|
|
91
93
|
/* @__PURE__ */ i(m.Text, { children: e == null ? void 0 : e.creatorName })
|
|
92
94
|
] }),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
|
|
95
|
-
ns:
|
|
96
|
-
}), placement: "top", children: /* @__PURE__ */ i(
|
|
97
|
-
|
|
98
|
-
ns:
|
|
99
|
-
}), placement: "top", children: /* @__PURE__ */ i(
|
|
95
|
+
/* @__PURE__ */ l("div", { className: "d-inline-flex align-items-center gap-8", children: [
|
|
96
|
+
I && /* @__PURE__ */ i(F, { message: c("tooltip.shared", {
|
|
97
|
+
ns: a
|
|
98
|
+
}), placement: "top", children: /* @__PURE__ */ i(se, { width: 16, height: 16 }) }),
|
|
99
|
+
N && /* @__PURE__ */ i(F, { message: c("tooltip.public", {
|
|
100
|
+
ns: a
|
|
101
|
+
}), placement: "top", children: /* @__PURE__ */ i(ne, { width: 16, height: 16 }) })
|
|
100
102
|
] })
|
|
101
103
|
] })
|
|
102
104
|
] }) }) });
|
|
103
105
|
};
|
|
104
|
-
|
|
105
|
-
const
|
|
106
|
+
k.displayName = "ResourceCard";
|
|
107
|
+
const ue = ({
|
|
106
108
|
data: t,
|
|
107
109
|
fetchNextPage: e
|
|
108
110
|
}) => {
|
|
109
111
|
const {
|
|
110
|
-
currentApp:
|
|
111
|
-
} = U(), {
|
|
112
|
-
t: x
|
|
112
|
+
currentApp: n
|
|
113
113
|
} = T(), {
|
|
114
|
-
|
|
115
|
-
} =
|
|
114
|
+
t: b
|
|
115
|
+
} = z(), {
|
|
116
|
+
fromNow: w
|
|
117
|
+
} = J(), g = Y(), r = Z(), s = ee(), {
|
|
116
118
|
setSelectedResources: p,
|
|
117
119
|
setResourceIds: h,
|
|
118
|
-
openResource:
|
|
119
|
-
setResourceIsTrash:
|
|
120
|
-
} =
|
|
120
|
+
openResource: v,
|
|
121
|
+
setResourceIsTrash: u
|
|
122
|
+
} = ie(), R = B(), S = Q({
|
|
121
123
|
from: {
|
|
122
124
|
opacity: 0
|
|
123
125
|
},
|
|
124
126
|
to: {
|
|
125
127
|
opacity: 1
|
|
126
128
|
}
|
|
127
|
-
}),
|
|
129
|
+
}), y = g.pagination.startIdx + g.pagination.pageSize < (g.pagination.maxIdx || 0), d = V(() => {
|
|
128
130
|
e();
|
|
129
|
-
}, []),
|
|
130
|
-
|
|
131
|
+
}, []), I = (a) => {
|
|
132
|
+
R ? (u(!0), h([a.id]), p([a])) : v(a);
|
|
131
133
|
};
|
|
132
|
-
async function
|
|
134
|
+
async function N(a) {
|
|
133
135
|
if (r.includes(a.id)) {
|
|
134
|
-
h(r.filter((
|
|
136
|
+
h(r.filter((c) => c !== a.id)), p(s.filter((c) => c.id !== a.id));
|
|
135
137
|
return;
|
|
136
138
|
}
|
|
137
|
-
h([...r, a.id]), p([...
|
|
139
|
+
h([...r, a.id]), p([...s, a]);
|
|
138
140
|
}
|
|
139
|
-
const
|
|
140
|
-
return /* @__PURE__ */
|
|
141
|
-
/* @__PURE__ */ i(P.ul, { className:
|
|
141
|
+
const x = W("grid ps-0 list-unstyled");
|
|
142
|
+
return /* @__PURE__ */ l(D.Fragment, { children: [
|
|
143
|
+
/* @__PURE__ */ i(P.ul, { className: x, children: t == null ? void 0 : t.pages.map((a, c) => /* @__PURE__ */ i(D.Fragment, { children: a.resources.map((o) => {
|
|
142
144
|
const {
|
|
143
|
-
id:
|
|
145
|
+
id: f,
|
|
144
146
|
updatedAt: M
|
|
145
|
-
} =
|
|
147
|
+
} = o, C = w(M);
|
|
146
148
|
return /* @__PURE__ */ i(P.li, { className: "g-col-4", style: {
|
|
147
149
|
position: "relative",
|
|
148
|
-
...
|
|
149
|
-
}, children: /* @__PURE__ */ i(
|
|
150
|
-
|
|
151
|
-
}, onSelect: () =>
|
|
152
|
-
}) },
|
|
153
|
-
|
|
150
|
+
...S
|
|
151
|
+
}, children: /* @__PURE__ */ i(k, { app: n, resource: o, time: C, isSelectable: !0, isSelected: r.includes(o.id), onClick: (A) => {
|
|
152
|
+
A.stopPropagation(), I(o);
|
|
153
|
+
}, onSelect: () => N(o) }) }, f);
|
|
154
|
+
}) }, c)) }),
|
|
155
|
+
y && /* @__PURE__ */ i("div", { className: "d-grid gap-2 col-4 mx-auto my-24", children: /* @__PURE__ */ i(K, { type: "button", color: "secondary", variant: "filled", onClick: d, children: b("explorer.see.more") }) })
|
|
154
156
|
] });
|
|
155
157
|
};
|
|
156
158
|
export {
|
|
157
|
-
|
|
159
|
+
ue as default
|
|
158
160
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ode-explorer",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-develop.202503031128",
|
|
4
4
|
"description": "Edifice Explorer",
|
|
5
5
|
"homepage": "https://github.com/edificeio/explorer#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@dnd-kit/core": "^6.1.0",
|
|
40
40
|
"@dnd-kit/modifiers": "^7.0.0",
|
|
41
|
-
"@edifice.io/react": "
|
|
42
|
-
"@edifice.io/bootstrap": "
|
|
43
|
-
"@edifice.io/client": "
|
|
41
|
+
"@edifice.io/react": "develop",
|
|
42
|
+
"@edifice.io/bootstrap": "develop",
|
|
43
|
+
"@edifice.io/client": "develop",
|
|
44
44
|
"@react-spring/web": "^9.7.3",
|
|
45
45
|
"@tanstack/react-query": "5.62.7",
|
|
46
46
|
"clsx": "^2.1.1",
|