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/version.txt CHANGED
@@ -1 +1 @@
1
- ode-explorer= 04/11/2024 11:27:37
1
+ ode-explorer= 07/11/2024 15:35:26
@@ -1,128 +1,129 @@
1
- import { jsx as e, jsxs as o, Fragment as $ } from "react/jsx-runtime";
2
- import C, { useState as j, useEffect as M, useCallback as B } from "react";
3
- import { Card as m, Image as E, AppIcon as G, Avatar as L, Tooltip as O, useOdeClient as U, useDate as q, Button as H } from "@edifice-ui/react";
4
- import { useSpring as J, animated as P } from "@react-spring/web";
5
- import K from "clsx";
6
- import { useTranslation as k } from "react-i18next";
7
- import { o as Q, e as V, h as W, i as X, a as Y, f as Z } from "./index2.js";
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 w = ({
13
- app: s,
12
+ const z = ({
13
+ app: l,
14
14
  resource: t,
15
- time: x,
16
- isSelected: b = !1,
17
- isSelectable: u = !0,
15
+ time: f,
16
+ isSelected: x = !1,
17
+ isSelectable: b = !0,
18
18
  onClick: h,
19
19
  onSelect: c
20
20
  }) => {
21
- const [a, p] = j(!1), r = `/userbook/avatar/${t == null ? void 0 : t.creatorId}`;
22
- function R(i) {
21
+ const [s, p] = M(!1), r = `/userbook/avatar/${t == null ? void 0 : t.creatorId}`;
22
+ function u(a) {
23
23
  const {
24
- rights: l,
25
- creatorId: d
26
- } = i || {};
27
- return l.filter((F) => !F.includes(d)).length >= 1;
24
+ rights: d,
25
+ creatorId: F
26
+ } = a || {};
27
+ return d.filter((T) => !T.includes(F)).length >= 1;
28
28
  }
29
- const {
30
- attributes: I,
31
- listeners: v,
32
- setNodeRef: y,
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
- }), S = R(t), N = t == null ? void 0 : t.public, g = Q(), {
41
- t: f
42
- } = k(), D = {
43
- position: a ? "absolute" : "relative",
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 M(() => {
48
- const i = g.elementDrag === t.id;
49
- p(i);
50
- }, [g]), /* @__PURE__ */ e("div", { ref: y, ...v, ...I, style: {
51
- ...D
52
- }, children: a ? /* @__PURE__ */ e(at, { app: s, type: "resource", name: t == null ? void 0 : t.name }) : /* @__PURE__ */ e(m, { app: s, isSelected: !a && b, isSelectable: !a && u, onClick: h, onSelect: c, children: (i) => /* @__PURE__ */ o($, { 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(E, { alt: "", src: `${t == null ? void 0 : t.thumbnail}?thumbnail=80x80`, objectFit: "cover", className: "h-full w-100" }) : /* @__PURE__ */ e(G, { app: s, iconFit: "ratio", size: "80", variant: "rounded" }) }),
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: x }) })
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(L, { alt: (t == null ? void 0 : t.creatorName) || "", size: "xs", src: r, variant: "circle", width: "24", height: "24" }) : /* @__PURE__ */ e(it, {}),
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
- S && /* @__PURE__ */ e(O, { message: f("tooltip.shared", {
67
- ns: i
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
- N && /* @__PURE__ */ e(O, { message: f("tooltip.public", {
70
- ns: i
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
- w.displayName = "ResourceCard";
77
+ z.displayName = "ResourceCard";
77
78
  const ft = ({
78
- data: s,
79
+ data: l,
79
80
  fetchNextPage: t
80
81
  }) => {
81
82
  const {
82
- currentApp: x
83
- } = U(), {
84
- t: b
85
- } = k(), {
86
- fromNow: u
87
- } = q(), h = V(), c = W(), a = X(), {
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: R,
91
- setResourceIsTrash: I
92
- } = Y(), v = Z(), y = J({
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
- }), S = h.pagination.startIdx + h.pagination.pageSize < (h.pagination.maxIdx || 0), N = B(() => {
100
+ }), g = h.pagination.startIdx + h.pagination.pageSize < (h.pagination.maxIdx || 0), S = E(() => {
100
101
  t();
101
- }, []), g = (i) => {
102
- v ? (I(!0), r([i.id]), p([i])) : R(i);
102
+ }, []), N = (i) => {
103
+ I ? (R(!0), r([i.id]), p([i])) : u(i);
103
104
  };
104
- async function f(i) {
105
+ async function D(i) {
105
106
  if (c.includes(i.id)) {
106
- r(c.filter((l) => l !== i.id)), p(a.filter((l) => l.id !== i.id));
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([...a, i]);
110
+ r([...c, i.id]), p([...s, i]);
110
111
  }
111
- const D = K("grid ps-0 list-unstyled");
112
- return /* @__PURE__ */ o(C.Fragment, { children: [
113
- /* @__PURE__ */ e(P.ul, { className: D, children: s == null ? void 0 : s.pages.map((i, l) => /* @__PURE__ */ e(C.Fragment, { children: i.resources.map((d) => {
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: T,
116
- updatedAt: F
117
- } = d, A = u(F);
118
- return /* @__PURE__ */ e(P.li, { className: "g-col-4", style: {
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
- ...y
121
- }, children: /* @__PURE__ */ e(w, { app: x, resource: d, time: A, isSelectable: !0, isSelected: c.includes(d.id), onClick: (z) => {
122
- z.stopPropagation(), g(d);
123
- }, onSelect: () => f(d) }) }, T);
124
- }) }, l)) }),
125
- S && /* @__PURE__ */ e("div", { className: "d-grid gap-2 col-4 mx-auto my-24", children: /* @__PURE__ */ e(H, { type: "button", color: "secondary", variant: "filled", onClick: N, children: b("explorer.see.more") }) })
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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ode-explorer",
3
- "version": "1.4.19-develop.202411041127",
3
+ "version": "1.4.19-develop.202411071534",
4
4
  "description": "Edifice Explorer",
5
5
  "homepage": "https://github.com/edificeio/explorer#readme",
6
6
  "bugs": {