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.
@@ -1,158 +1,160 @@
1
- import { jsxs as n, jsx as i, Fragment as k } from "react/jsx-runtime";
2
- import D, { useState as O, useEffect as H, useCallback as $ } from "react";
3
- import { useBreakpoint as j, Card as m, IconButton as V, Image as E, AppIcon as G, Avatar as L, Tooltip as F, useEdificeClient as U, useDate as q, Button as J } from "@edifice.io/react";
4
- import { useSpring as K, animated as P } from "@react-spring/web";
5
- import Q from "clsx";
6
- import { useTranslation as T } from "react-i18next";
7
- import { f as z, o as W, e as X, h as Y, i as Z, a as ee } from "./index2.js";
8
- import { useDraggable as ie } from "@dnd-kit/core";
9
- import { S as te, D as ae } from "./DraggableCard.js";
10
- const le = ({
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
- ...s
14
- }) => /* @__PURE__ */ n("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, ...s, children: [
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
- ] }), ne = ({
17
+ ] }), se = ({
18
18
  title: t,
19
19
  titleId: e,
20
- ...s
21
- }) => /* @__PURE__ */ n("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, ...s, children: [
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
- ] }), se = ({
25
+ ] }), de = ({
26
26
  title: t,
27
27
  titleId: e,
28
- ...s
29
- }) => /* @__PURE__ */ n("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, ...s, children: [
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
- ] }), B = ({
33
+ ] }), k = ({
34
34
  app: t,
35
35
  resource: e,
36
- time: s,
37
- isSelected: x = !1,
38
- isSelectable: b = !0,
36
+ time: n,
37
+ isSelected: b = !1,
38
+ isSelectable: w = !0,
39
39
  onClick: g,
40
40
  onSelect: r
41
41
  }) => {
42
- const [d, p] = O(!1), h = z(), {
43
- lg: f
44
- } = j(), v = `/userbook/avatar/${e == null ? void 0 : e.creatorId}`;
45
- function w(l) {
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: N,
48
- creatorId: M
49
- } = l || {};
50
- return N.filter((C) => !C.includes(M)).length >= 1;
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: R,
53
+ attributes: S,
54
54
  listeners: _,
55
- setNodeRef: S,
56
- transform: c
57
- } = ie({
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 || !f
64
- }), y = w(e), I = e == null ? void 0 : e.public, u = W(), {
65
- t: a
66
- } = T(), o = {
67
- position: d ? "absolute" : "relative",
68
- zIndex: d ? 2e3 : 1,
69
- transform: `translate3d(${((c == null ? void 0 : c.x) ?? 0) / 1}px, ${((c == null ? void 0 : c.y) ?? 0) / 1}px, 0)`
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 H(() => {
72
- const l = u.elementDrag === e.id;
73
- p(l);
74
- }, [u]), /* @__PURE__ */ i("div", { ref: S, style: {
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: d ? /* @__PURE__ */ i(ae, { app: t, type: "resource", name: e == null ? void 0 : e.name }) : /* @__PURE__ */ i(m, { app: t, isSelected: !d && x, isSelectable: !d && b, onClick: g, onSelect: r, children: (l) => /* @__PURE__ */ n(k, { children: [
77
- !d && f && !h && /* @__PURE__ */ i("div", { className: "card-header z-3", style: {
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(V, { ..._, ...R, className: "bg-white z-3", color: "secondary", icon: /* @__PURE__ */ i(te, {}), variant: "ghost" }) }),
81
- /* @__PURE__ */ n(m.Body, { children: [
82
- /* @__PURE__ */ i("div", { className: "card-image medium", children: e != null && e.thumbnail ? /* @__PURE__ */ i(E, { alt: "", src: `${e == null ? void 0 : e.thumbnail}?thumbnail=80x80`, objectFit: "cover", className: "h-full w-100" }) : /* @__PURE__ */ i(G, { app: t, iconFit: "ratio", size: "80", variant: "rounded" }) }),
83
- /* @__PURE__ */ n("div", { className: "text-truncate", children: [
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: s }) })
87
+ /* @__PURE__ */ i(m.Text, { children: /* @__PURE__ */ i("em", { children: n }) })
86
88
  ] })
87
89
  ] }),
88
- /* @__PURE__ */ n(m.Footer, { children: [
89
- /* @__PURE__ */ n("div", { className: "d-inline-flex align-items-center gap-8 text-truncate", children: [
90
- v ? /* @__PURE__ */ i(L, { alt: (e == null ? void 0 : e.creatorName) || "", size: "xs", src: v, variant: "circle", width: "24", height: "24" }) : /* @__PURE__ */ i(se, {}),
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__ */ n("div", { className: "d-inline-flex align-items-center gap-8", children: [
94
- y && /* @__PURE__ */ i(F, { message: a("tooltip.shared", {
95
- ns: l
96
- }), placement: "top", children: /* @__PURE__ */ i(ne, { width: 16, height: 16 }) }),
97
- I && /* @__PURE__ */ i(F, { message: a("tooltip.public", {
98
- ns: l
99
- }), placement: "top", children: /* @__PURE__ */ i(le, { width: 16, height: 16 }) })
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
- B.displayName = "ResourceCard";
105
- const ve = ({
106
+ k.displayName = "ResourceCard";
107
+ const ue = ({
106
108
  data: t,
107
109
  fetchNextPage: e
108
110
  }) => {
109
111
  const {
110
- currentApp: s
111
- } = U(), {
112
- t: x
112
+ currentApp: n
113
113
  } = T(), {
114
- fromNow: b
115
- } = q(), g = X(), r = Y(), d = Z(), {
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: f,
119
- setResourceIsTrash: v
120
- } = ee(), w = z(), R = K({
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
- }), S = g.pagination.startIdx + g.pagination.pageSize < (g.pagination.maxIdx || 0), c = $(() => {
129
+ }), y = g.pagination.startIdx + g.pagination.pageSize < (g.pagination.maxIdx || 0), d = V(() => {
128
130
  e();
129
- }, []), y = (a) => {
130
- w ? (v(!0), h([a.id]), p([a])) : f(a);
131
+ }, []), I = (a) => {
132
+ R ? (u(!0), h([a.id]), p([a])) : v(a);
131
133
  };
132
- async function I(a) {
134
+ async function N(a) {
133
135
  if (r.includes(a.id)) {
134
- h(r.filter((o) => o !== a.id)), p(d.filter((o) => o.id !== a.id));
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([...d, a]);
139
+ h([...r, a.id]), p([...s, a]);
138
140
  }
139
- const u = Q("grid ps-0 list-unstyled");
140
- return /* @__PURE__ */ n(D.Fragment, { children: [
141
- /* @__PURE__ */ i(P.ul, { className: u, children: t == null ? void 0 : t.pages.map((a, o) => /* @__PURE__ */ i(D.Fragment, { children: a.resources.map((l) => {
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: N,
145
+ id: f,
144
146
  updatedAt: M
145
- } = l, A = b(M);
147
+ } = o, C = w(M);
146
148
  return /* @__PURE__ */ i(P.li, { className: "g-col-4", style: {
147
149
  position: "relative",
148
- ...R
149
- }, children: /* @__PURE__ */ i(B, { app: s, resource: l, time: A, isSelectable: !0, isSelected: r.includes(l.id), onClick: (C) => {
150
- C.stopPropagation(), y(l);
151
- }, onSelect: () => I(l) }) }, N);
152
- }) }, o)) }),
153
- S && /* @__PURE__ */ i("div", { className: "d-grid gap-2 col-4 mx-auto my-24", children: /* @__PURE__ */ i(J, { type: "button", color: "secondary", variant: "filled", onClick: c, children: x("explorer.see.more") }) })
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
- ve as default
159
+ ue as default
158
160
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ode-explorer",
3
- "version": "2.1.3",
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": "2.1.2",
42
- "@edifice.io/bootstrap": "2.1.2",
43
- "@edifice.io/client": "2.1.2",
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",