ode-explorer 1.3.2-dev.202401091744 → 1.3.2-dev.202401101530

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,261 +1,249 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import React, { useCallback } from "react";
3
- import { Card, Image, AppIcon, Avatar, Tooltip, useOdeClient, Button } from "@edifice-ui/react";
4
- import { useSpring, animated } from "@react-spring/web";
5
- import clsx from "clsx";
6
- import { useTranslation } from "react-i18next";
7
- import { Users, Globe } from "@edifice-ui/icons";
8
- import { OneProfile } from "@edifice-ui/icons/nav";
9
- import require$$0 from "dayjs";
10
- import { n as useSearchParams, f as useResourceIds, g as useSelectedResources, u as useStoreActions, d as useIsTrash } from "./index2.js";
1
+ import { jsx as s, jsxs as g, Fragment as J } from "react/jsx-runtime";
2
+ import F, { useCallback as q } from "react";
3
+ import { Card as j, Image as C, AppIcon as B, Avatar as G, Tooltip as I, useOdeClient as U, Button as K } from "@edifice-ui/react";
4
+ import { useSpring as Q, animated as z } from "@react-spring/web";
5
+ import V from "clsx";
6
+ import { useTranslation as A } from "react-i18next";
7
+ import { Users as W, Globe as X } from "@edifice-ui/icons";
8
+ import { OneProfile as Z } from "@edifice-ui/icons/nav";
9
+ import b from "dayjs";
10
+ import { n as ee, f as te, g as ne, u as oe, d as ae } from "./index2.js";
11
11
  import "edifice-ts-client";
12
12
  import "i18next";
13
13
  import "zustand";
14
14
  import "@tanstack/react-query";
15
- const ResourceCard = ({
16
- app,
17
- resource,
18
- time,
19
- isSelected = false,
20
- isSelectable = true,
21
- onClick,
22
- onSelect
15
+ const P = ({
16
+ app: a,
17
+ resource: t,
18
+ time: i,
19
+ isSelected: n = !1,
20
+ isSelectable: d = !0,
21
+ onClick: o,
22
+ onSelect: e
23
23
  }) => {
24
- const avatar = `/userbook/avatar/${resource == null ? void 0 : resource.creatorId}`;
25
- function isResourceShared(resource2) {
24
+ const p = `/userbook/avatar/${t == null ? void 0 : t.creatorId}`;
25
+ function l(h) {
26
26
  const {
27
- rights,
28
- creatorId
29
- } = resource2 || {};
30
- const filteredRights = rights.filter((right) => !right.includes(creatorId));
31
- return filteredRights.length >= 1;
27
+ rights: v,
28
+ creatorId: Y
29
+ } = h || {};
30
+ return v.filter((y) => !y.includes(Y)).length >= 1;
32
31
  }
33
- const isShared = isResourceShared(resource);
34
- const isPublic = resource == null ? void 0 : resource.public;
35
- const {
36
- t
37
- } = useTranslation();
38
- return /* @__PURE__ */ jsx(Card, { app, isSelected, isSelectable, onClick, onSelect, children: (appCode) => /* @__PURE__ */ jsxs(Fragment, { children: [
39
- /* @__PURE__ */ jsxs(Card.Body, { children: [
40
- /* @__PURE__ */ jsx("div", { className: "card-image medium", children: (resource == null ? void 0 : resource.thumbnail) ? /* @__PURE__ */ jsx(Image, { alt: "", src: resource == null ? void 0 : resource.thumbnail, objectFit: "cover", className: "h-full" }) : /* @__PURE__ */ jsx(AppIcon, { app, iconFit: "ratio", size: "80", variant: "rounded" }) }),
41
- /* @__PURE__ */ jsxs("div", { className: "text-truncate", children: [
42
- /* @__PURE__ */ jsx(Card.Title, { children: resource == null ? void 0 : resource.name }),
43
- /* @__PURE__ */ jsx(Card.Text, { children: /* @__PURE__ */ jsx("em", { children: time }) })
32
+ const r = l(t), _ = t == null ? void 0 : t.public, {
33
+ t: m
34
+ } = A();
35
+ return /* @__PURE__ */ s(j, { app: a, isSelected: n, isSelectable: d, onClick: o, onSelect: e, children: (h) => /* @__PURE__ */ g(J, { children: [
36
+ /* @__PURE__ */ g(j.Body, { children: [
37
+ /* @__PURE__ */ s("div", { className: "card-image medium", children: t != null && t.thumbnail ? /* @__PURE__ */ s(C, { alt: "", src: t == null ? void 0 : t.thumbnail, objectFit: "cover", className: "h-full" }) : /* @__PURE__ */ s(B, { app: a, iconFit: "ratio", size: "80", variant: "rounded" }) }),
38
+ /* @__PURE__ */ g("div", { className: "text-truncate", children: [
39
+ /* @__PURE__ */ s(j.Title, { children: t == null ? void 0 : t.name }),
40
+ /* @__PURE__ */ s(j.Text, { children: /* @__PURE__ */ s("em", { children: i }) })
44
41
  ] })
45
42
  ] }),
46
- /* @__PURE__ */ jsxs(Card.Footer, { children: [
47
- /* @__PURE__ */ jsxs("div", { className: "d-inline-flex align-items-center gap-8 text-truncate", children: [
48
- avatar ? /* @__PURE__ */ jsx(Avatar, { alt: (resource == null ? void 0 : resource.creatorName) || "", size: "xs", src: avatar, variant: "circle", width: "24", height: "24" }) : /* @__PURE__ */ jsx(OneProfile, {}),
49
- /* @__PURE__ */ jsx(Card.Text, { children: resource == null ? void 0 : resource.creatorName })
43
+ /* @__PURE__ */ g(j.Footer, { children: [
44
+ /* @__PURE__ */ g("div", { className: "d-inline-flex align-items-center gap-8 text-truncate", children: [
45
+ p ? /* @__PURE__ */ s(G, { alt: (t == null ? void 0 : t.creatorName) || "", size: "xs", src: p, variant: "circle", width: "24", height: "24" }) : /* @__PURE__ */ s(Z, {}),
46
+ /* @__PURE__ */ s(j.Text, { children: t == null ? void 0 : t.creatorName })
50
47
  ] }),
51
- /* @__PURE__ */ jsxs("div", { className: "d-inline-flex align-items-center gap-8", children: [
52
- isShared && /* @__PURE__ */ jsx(Tooltip, { message: t("tooltip.shared", {
53
- ns: appCode
54
- }), placement: "top", children: /* @__PURE__ */ jsx(Users, { width: 16, height: 16 }) }),
55
- isPublic && /* @__PURE__ */ jsx(Tooltip, { message: t("tooltip.public", {
56
- ns: appCode
57
- }), placement: "top", children: /* @__PURE__ */ jsx(Globe, { width: 16, height: 16 }) })
48
+ /* @__PURE__ */ g("div", { className: "d-inline-flex align-items-center gap-8", children: [
49
+ r && /* @__PURE__ */ s(I, { message: m("tooltip.shared", {
50
+ ns: h
51
+ }), placement: "top", children: /* @__PURE__ */ s(W, { width: 16, height: 16 }) }),
52
+ _ && /* @__PURE__ */ s(I, { message: m("tooltip.public", {
53
+ ns: h
54
+ }), placement: "top", children: /* @__PURE__ */ s(X, { width: 16, height: 16 }) })
58
55
  ] })
59
56
  ] })
60
57
  ] }) });
61
58
  };
62
- ResourceCard.displayName = "ResourceCard";
63
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
64
- function getDefaultExportFromCjs(x) {
65
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
59
+ P.displayName = "ResourceCard";
60
+ var x = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
61
+ function ie(a) {
62
+ return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
66
63
  }
67
- var relativeTime$1 = { exports: {} };
68
- (function(module, exports) {
69
- !function(r, e) {
70
- module.exports = e();
71
- }(commonjsGlobal, function() {
72
- return function(r, e, t) {
73
- r = r || {};
74
- var n = e.prototype, o = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
75
- function i(r2, e2, t2, o2) {
76
- return n.fromToBase(r2, e2, t2, o2);
64
+ var w = { exports: {} }, Ye = w.exports;
65
+ (function(a, t) {
66
+ (function(i, n) {
67
+ a.exports = n();
68
+ })(x, function() {
69
+ "use strict";
70
+ return function(i, n, d) {
71
+ i = i || {};
72
+ var o = n.prototype, e = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
73
+ function p(r, _, m, h) {
74
+ return o.fromToBase(r, _, m, h);
77
75
  }
78
- t.en.relativeTime = o, n.fromToBase = function(e2, n2, i2, d2, u) {
79
- for (var f, a, s, l = i2.$locale().relativeTime || o, h = r.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], m = h.length, c = 0; c < m; c += 1) {
80
- var y = h[c];
81
- y.d && (f = d2 ? t(e2).diff(i2, y.d, true) : i2.diff(e2, y.d, true));
82
- var p = (r.rounding || Math.round)(Math.abs(f));
83
- if (s = f > 0, p <= y.r || !y.r) {
84
- p <= 1 && c > 0 && (y = h[c - 1]);
85
- var v = l[y.l];
86
- u && (p = u("" + p)), a = "string" == typeof v ? v.replace("%d", p) : v(p, n2, y.l, s);
76
+ d.en.relativeTime = e, o.fromToBase = function(r, _, m, h, v) {
77
+ for (var Y, M, y, L = m.$locale().relativeTime || e, T = i.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], $ = T.length, u = 0; u < $; u += 1) {
78
+ var f = T[u];
79
+ f.d && (Y = h ? d(r).diff(m, f.d, !0) : m.diff(r, f.d, !0));
80
+ var c = (i.rounding || Math.round)(Math.abs(Y));
81
+ if (y = Y > 0, c <= f.r || !f.r) {
82
+ c <= 1 && u > 0 && (f = T[u - 1]);
83
+ var S = L[f.l];
84
+ v && (c = v("" + c)), M = typeof S == "string" ? S.replace("%d", c) : S(c, _, f.l, y);
87
85
  break;
88
86
  }
89
87
  }
90
- if (n2)
91
- return a;
92
- var M = s ? l.future : l.past;
93
- return "function" == typeof M ? M(a) : M.replace("%s", a);
94
- }, n.to = function(r2, e2) {
95
- return i(r2, e2, this, true);
96
- }, n.from = function(r2, e2) {
97
- return i(r2, e2, this);
88
+ if (_)
89
+ return M;
90
+ var D = y ? L.future : L.past;
91
+ return typeof D == "function" ? D(M) : D.replace("%s", M);
92
+ }, o.to = function(r, _) {
93
+ return p(r, _, this, !0);
94
+ }, o.from = function(r, _) {
95
+ return p(r, _, this);
98
96
  };
99
- var d = function(r2) {
100
- return r2.$u ? t.utc() : t();
97
+ var l = function(r) {
98
+ return r.$u ? d.utc() : d();
101
99
  };
102
- n.toNow = function(r2) {
103
- return this.to(d(this), r2);
104
- }, n.fromNow = function(r2) {
105
- return this.from(d(this), r2);
100
+ o.toNow = function(r) {
101
+ return this.to(l(this), r);
102
+ }, o.fromNow = function(r) {
103
+ return this.from(l(this), r);
106
104
  };
107
105
  };
108
106
  });
109
- })(relativeTime$1);
110
- var relativeTimeExports = relativeTime$1.exports;
111
- const relativeTime = /* @__PURE__ */ getDefaultExportFromCjs(relativeTimeExports);
112
- var de = { exports: {} };
113
- (function(module, exports) {
114
- !function(e, n) {
115
- module.exports = n(require$$0);
116
- }(commonjsGlobal, function(e) {
117
- function n(e2) {
118
- return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
107
+ })(w, w.exports);
108
+ var re = w.exports;
109
+ const se = /* @__PURE__ */ ie(re);
110
+ var H = { exports: {} }, je = H.exports;
111
+ (function(a, t) {
112
+ (function(i, n) {
113
+ a.exports = n(b);
114
+ })(x, function(i) {
115
+ "use strict";
116
+ function n(l) {
117
+ return l && typeof l == "object" && "default" in l ? l : { default: l };
119
118
  }
120
- var t = n(e), a = { s: "ein paar Sekunden", m: ["eine Minute", "einer Minute"], mm: "%d Minuten", h: ["eine Stunde", "einer Stunde"], hh: "%d Stunden", d: ["ein Tag", "einem Tag"], dd: ["%d Tage", "%d Tagen"], M: ["ein Monat", "einem Monat"], MM: ["%d Monate", "%d Monaten"], y: ["ein Jahr", "einem Jahr"], yy: ["%d Jahre", "%d Jahren"] };
121
- function i(e2, n2, t2) {
122
- var i2 = a[t2];
123
- return Array.isArray(i2) && (i2 = i2[n2 ? 0 : 1]), i2.replace("%d", e2);
119
+ var d = n(i), o = { s: "ein paar Sekunden", m: ["eine Minute", "einer Minute"], mm: "%d Minuten", h: ["eine Stunde", "einer Stunde"], hh: "%d Stunden", d: ["ein Tag", "einem Tag"], dd: ["%d Tage", "%d Tagen"], M: ["ein Monat", "einem Monat"], MM: ["%d Monate", "%d Monaten"], y: ["ein Jahr", "einem Jahr"], yy: ["%d Jahre", "%d Jahren"] };
120
+ function e(l, r, _) {
121
+ var m = o[_];
122
+ return Array.isArray(m) && (m = m[r ? 0 : 1]), m.replace("%d", l);
124
123
  }
125
- var r = { name: "de", weekdays: "Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"), weekdaysShort: "So._Mo._Di._Mi._Do._Fr._Sa.".split("_"), weekdaysMin: "So_Mo_Di_Mi_Do_Fr_Sa".split("_"), months: "Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"), monthsShort: "Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"), ordinal: function(e2) {
126
- return e2 + ".";
127
- }, weekStart: 1, yearStart: 4, formats: { LTS: "HH:mm:ss", LT: "HH:mm", L: "DD.MM.YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY HH:mm", LLLL: "dddd, D. MMMM YYYY HH:mm" }, relativeTime: { future: "in %s", past: "vor %s", s: i, m: i, mm: i, h: i, hh: i, d: i, dd: i, M: i, MM: i, y: i, yy: i } };
128
- return t.default.locale(r, null, true), r;
124
+ var p = { name: "de", weekdays: "Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"), weekdaysShort: "So._Mo._Di._Mi._Do._Fr._Sa.".split("_"), weekdaysMin: "So_Mo_Di_Mi_Do_Fr_Sa".split("_"), months: "Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"), monthsShort: "Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"), ordinal: function(l) {
125
+ return l + ".";
126
+ }, weekStart: 1, yearStart: 4, formats: { LTS: "HH:mm:ss", LT: "HH:mm", L: "DD.MM.YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY HH:mm", LLLL: "dddd, D. MMMM YYYY HH:mm" }, relativeTime: { future: "in %s", past: "vor %s", s: e, m: e, mm: e, h: e, hh: e, d: e, dd: e, M: e, MM: e, y: e, yy: e } };
127
+ return d.default.locale(p, null, !0), p;
129
128
  });
130
- })(de);
131
- var es = { exports: {} };
132
- (function(module, exports) {
133
- !function(e, o) {
134
- module.exports = o(require$$0);
135
- }(commonjsGlobal, function(e) {
136
- function o(e2) {
137
- return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
129
+ })(H, H.exports);
130
+ var xe = H.exports;
131
+ var k = { exports: {} }, Le = k.exports;
132
+ (function(a, t) {
133
+ (function(i, n) {
134
+ a.exports = n(b);
135
+ })(x, function(i) {
136
+ "use strict";
137
+ function n(e) {
138
+ return e && typeof e == "object" && "default" in e ? e : { default: e };
138
139
  }
139
- var s = o(e), d = { name: "es", monthsShort: "ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"), weekdays: "domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"), weekdaysShort: "dom._lun._mar._mié._jue._vie._sáb.".split("_"), weekdaysMin: "do_lu_ma_mi_ju_vi_sá".split("_"), months: "enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"), weekStart: 1, formats: { LT: "H:mm", LTS: "H:mm:ss", L: "DD/MM/YYYY", LL: "D [de] MMMM [de] YYYY", LLL: "D [de] MMMM [de] YYYY H:mm", LLLL: "dddd, D [de] MMMM [de] YYYY H:mm" }, relativeTime: { future: "en %s", past: "hace %s", s: "unos segundos", m: "un minuto", mm: "%d minutos", h: "una hora", hh: "%d horas", d: "un día", dd: "%d días", M: "un mes", MM: "%d meses", y: "un año", yy: "%d años" }, ordinal: function(e2) {
140
- return e2 + "º";
140
+ var d = n(i), o = { name: "es", monthsShort: "ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"), weekdays: "domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"), weekdaysShort: "dom._lun._mar._mié._jue._vie._sáb.".split("_"), weekdaysMin: "do_lu_ma_mi_ju_vi_sá".split("_"), months: "enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"), weekStart: 1, formats: { LT: "H:mm", LTS: "H:mm:ss", L: "DD/MM/YYYY", LL: "D [de] MMMM [de] YYYY", LLL: "D [de] MMMM [de] YYYY H:mm", LLLL: "dddd, D [de] MMMM [de] YYYY H:mm" }, relativeTime: { future: "en %s", past: "hace %s", s: "unos segundos", m: "un minuto", mm: "%d minutos", h: "una hora", hh: "%d horas", d: "un día", dd: "%d días", M: "un mes", MM: "%d meses", y: "un año", yy: "%d años" }, ordinal: function(e) {
141
+ return e + "º";
141
142
  } };
142
- return s.default.locale(d, null, true), d;
143
+ return d.default.locale(o, null, !0), o;
143
144
  });
144
- })(es);
145
- var pt = { exports: {} };
146
- (function(module, exports) {
147
- !function(e, a) {
148
- module.exports = a(require$$0);
149
- }(commonjsGlobal, function(e) {
150
- function a(e2) {
151
- return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
145
+ })(k, k.exports);
146
+ var Te = k.exports;
147
+ var N = { exports: {} }, Se = N.exports;
148
+ (function(a, t) {
149
+ (function(i, n) {
150
+ a.exports = n(b);
151
+ })(x, function(i) {
152
+ "use strict";
153
+ function n(e) {
154
+ return e && typeof e == "object" && "default" in e ? e : { default: e };
152
155
  }
153
- var o = a(e), t = { name: "pt", weekdays: "domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"), weekdaysShort: "dom_seg_ter_qua_qui_sex_sab".split("_"), weekdaysMin: "Do_2ª_3ª_4ª_5ª_6ª_Sa".split("_"), months: "janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"), monthsShort: "jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"), ordinal: function(e2) {
154
- return e2 + "º";
156
+ var d = n(i), o = { name: "pt", weekdays: "domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"), weekdaysShort: "dom_seg_ter_qua_qui_sex_sab".split("_"), weekdaysMin: "Do_2ª_3ª_4ª_5ª_6ª_Sa".split("_"), months: "janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"), monthsShort: "jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"), ordinal: function(e) {
157
+ return e + "º";
155
158
  }, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D [de] MMMM [de] YYYY", LLL: "D [de] MMMM [de] YYYY [às] HH:mm", LLLL: "dddd, D [de] MMMM [de] YYYY [às] HH:mm" }, relativeTime: { future: "em %s", past: "há %s", s: "alguns segundos", m: "um minuto", mm: "%d minutos", h: "uma hora", hh: "%d horas", d: "um dia", dd: "%d dias", M: "um mês", MM: "%d meses", y: "um ano", yy: "%d anos" } };
156
- return o.default.locale(t, null, true), t;
159
+ return d.default.locale(o, null, !0), o;
157
160
  });
158
- })(pt);
159
- var fr = { exports: {} };
160
- (function(module, exports) {
161
- !function(e, n) {
162
- module.exports = n(require$$0);
163
- }(commonjsGlobal, function(e) {
164
- function n(e2) {
165
- return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
161
+ })(N, N.exports);
162
+ var De = N.exports;
163
+ var O = { exports: {} }, we = O.exports;
164
+ (function(a, t) {
165
+ (function(i, n) {
166
+ a.exports = n(b);
167
+ })(x, function(i) {
168
+ "use strict";
169
+ function n(e) {
170
+ return e && typeof e == "object" && "default" in e ? e : { default: e };
166
171
  }
167
- var t = n(e), i = { name: "fr", weekdays: "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"), weekdaysShort: "dim._lun._mar._mer._jeu._ven._sam.".split("_"), weekdaysMin: "di_lu_ma_me_je_ve_sa".split("_"), months: "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"), monthsShort: "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"), weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm" }, relativeTime: { future: "dans %s", past: "il y a %s", s: "quelques secondes", m: "une minute", mm: "%d minutes", h: "une heure", hh: "%d heures", d: "un jour", dd: "%d jours", M: "un mois", MM: "%d mois", y: "un an", yy: "%d ans" }, ordinal: function(e2) {
168
- return "" + e2 + (1 === e2 ? "er" : "");
172
+ var d = n(i), o = { name: "fr", weekdays: "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"), weekdaysShort: "dim._lun._mar._mer._jeu._ven._sam.".split("_"), weekdaysMin: "di_lu_ma_me_je_ve_sa".split("_"), months: "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"), monthsShort: "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"), weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm" }, relativeTime: { future: "dans %s", past: "il y a %s", s: "quelques secondes", m: "une minute", mm: "%d minutes", h: "une heure", hh: "%d heures", d: "un jour", dd: "%d jours", M: "un mois", MM: "%d mois", y: "un an", yy: "%d ans" }, ordinal: function(e) {
173
+ return "" + e + (e === 1 ? "er" : "");
169
174
  } };
170
- return t.default.locale(i, null, true), i;
175
+ return d.default.locale(o, null, !0), o;
171
176
  });
172
- })(fr);
173
- var it = { exports: {} };
174
- (function(module, exports) {
175
- !function(e, o) {
176
- module.exports = o(require$$0);
177
- }(commonjsGlobal, function(e) {
178
- function o(e2) {
179
- return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
177
+ })(O, O.exports);
178
+ var He = O.exports;
179
+ var R = { exports: {} }, ke = R.exports;
180
+ (function(a, t) {
181
+ (function(i, n) {
182
+ a.exports = n(b);
183
+ })(x, function(i) {
184
+ "use strict";
185
+ function n(e) {
186
+ return e && typeof e == "object" && "default" in e ? e : { default: e };
180
187
  }
181
- var t = o(e), n = { name: "it", weekdays: "domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"), weekdaysShort: "dom_lun_mar_mer_gio_ven_sab".split("_"), weekdaysMin: "do_lu_ma_me_gi_ve_sa".split("_"), months: "gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"), weekStart: 1, monthsShort: "gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"), formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm" }, relativeTime: { future: "tra %s", past: "%s fa", s: "qualche secondo", m: "un minuto", mm: "%d minuti", h: "un' ora", hh: "%d ore", d: "un giorno", dd: "%d giorni", M: "un mese", MM: "%d mesi", y: "un anno", yy: "%d anni" }, ordinal: function(e2) {
182
- return e2 + "º";
188
+ var d = n(i), o = { name: "it", weekdays: "domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"), weekdaysShort: "dom_lun_mar_mer_gio_ven_sab".split("_"), weekdaysMin: "do_lu_ma_me_gi_ve_sa".split("_"), months: "gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"), weekStart: 1, monthsShort: "gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"), formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm" }, relativeTime: { future: "tra %s", past: "%s fa", s: "qualche secondo", m: "un minuto", mm: "%d minuti", h: "un' ora", hh: "%d ore", d: "un giorno", dd: "%d giorni", M: "un mese", MM: "%d mesi", y: "un anno", yy: "%d anni" }, ordinal: function(e) {
189
+ return e + "º";
183
190
  } };
184
- return t.default.locale(n, null, true), n;
191
+ return d.default.locale(o, null, !0), o;
185
192
  });
186
- })(it);
187
- require$$0.extend(relativeTime);
188
- const ResourcesList = ({
189
- data,
190
- fetchNextPage
193
+ })(R, R.exports);
194
+ var Ne = R.exports;
195
+ b.extend(se);
196
+ const Oe = ({
197
+ data: a,
198
+ fetchNextPage: t
191
199
  }) => {
192
200
  const {
193
- currentApp,
194
- currentLanguage
195
- } = useOdeClient();
196
- const {
197
- t
198
- } = useTranslation();
199
- const searchParams = useSearchParams();
200
- const resourceIds = useResourceIds();
201
- const selectedResources = useSelectedResources();
202
- const {
203
- setSelectedResources,
204
- setResourceIds,
205
- openResource,
206
- setResourceIsTrash
207
- } = useStoreActions();
208
- const isTrashFolder = useIsTrash();
209
- const springs = useSpring({
201
+ currentApp: i,
202
+ currentLanguage: n
203
+ } = U(), {
204
+ t: d
205
+ } = A(), o = ee(), e = te(), p = ne(), {
206
+ setSelectedResources: l,
207
+ setResourceIds: r,
208
+ openResource: _,
209
+ setResourceIsTrash: m
210
+ } = oe(), h = ae(), v = Q({
210
211
  from: {
211
212
  opacity: 0
212
213
  },
213
214
  to: {
214
215
  opacity: 1
215
216
  }
216
- });
217
- const currentMaxIdx = searchParams.pagination.startIdx + searchParams.pagination.pageSize;
218
- const hasMoreResources = currentMaxIdx < (searchParams.pagination.maxIdx || 0);
219
- const handleNextPage = useCallback(() => {
220
- fetchNextPage();
221
- }, []);
222
- const clickOnResource = (resource) => {
223
- if (isTrashFolder) {
224
- setResourceIsTrash(true);
225
- setResourceIds([resource.id]);
226
- setSelectedResources([resource]);
227
- } else {
228
- openResource(resource);
229
- }
217
+ }), M = o.pagination.startIdx + o.pagination.pageSize < (o.pagination.maxIdx || 0), y = q(() => {
218
+ t();
219
+ }, []), L = (u) => {
220
+ h ? (m(!0), r([u.id]), l([u])) : _(u);
230
221
  };
231
- async function toggleSelect(resource) {
232
- if (resourceIds.includes(resource.id)) {
233
- setResourceIds(resourceIds.filter((selectedResource) => selectedResource !== resource.id));
234
- setSelectedResources(selectedResources.filter((selectedResource) => selectedResource.id !== resource.id));
222
+ async function T(u) {
223
+ if (e.includes(u.id)) {
224
+ r(e.filter((f) => f !== u.id)), l(p.filter((f) => f.id !== u.id));
235
225
  return;
236
226
  }
237
- setResourceIds([...resourceIds, resource.id]);
238
- setSelectedResources([...selectedResources, resource]);
227
+ r([...e, u.id]), l([...p, u]);
239
228
  }
240
- const classes = clsx("grid ps-0 list-unstyled");
241
- return /* @__PURE__ */ jsxs(React.Fragment, { children: [
242
- /* @__PURE__ */ jsx(animated.ul, { className: classes, children: data == null ? void 0 : data.pages.map((page, index) => (
229
+ const $ = V("grid ps-0 list-unstyled");
230
+ return /* @__PURE__ */ g(F.Fragment, { children: [
231
+ /* @__PURE__ */ s(z.ul, { className: $, children: a == null ? void 0 : a.pages.map((u, f) => (
243
232
  // eslint-disable-next-line react/no-array-index-key
244
- /* @__PURE__ */ jsx(React.Fragment, { children: page.resources.map((resource) => {
233
+ /* @__PURE__ */ s(F.Fragment, { children: u.resources.map((c) => {
245
234
  const {
246
- id,
247
- updatedAt
248
- } = resource;
249
- const time = require$$0(updatedAt).locale(currentLanguage).fromNow();
250
- return /* @__PURE__ */ jsx(animated.li, { className: "g-col-4 z-1", style: {
235
+ id: S,
236
+ updatedAt: D
237
+ } = c, E = b(D).locale(n).fromNow();
238
+ return /* @__PURE__ */ s(z.li, { className: "g-col-4 z-1", style: {
251
239
  position: "relative",
252
- ...springs
253
- }, children: /* @__PURE__ */ jsx(ResourceCard, { app: currentApp, resource, time, isSelectable: true, isSelected: resourceIds.includes(resource.id), onClick: () => clickOnResource(resource), onSelect: () => toggleSelect(resource) }) }, id);
254
- }) }, index)
240
+ ...v
241
+ }, children: /* @__PURE__ */ s(P, { app: i, resource: c, time: E, isSelectable: !0, isSelected: e.includes(c.id), onClick: () => L(c), onSelect: () => T(c) }) }, S);
242
+ }) }, f)
255
243
  )) }),
256
- hasMoreResources && /* @__PURE__ */ jsx("div", { className: "d-grid gap-2 col-4 mx-auto my-24", children: /* @__PURE__ */ jsx(Button, { type: "button", color: "secondary", variant: "filled", onClick: handleNextPage, children: t("explorer.see.more") }) })
244
+ M && /* @__PURE__ */ s("div", { className: "d-grid gap-2 col-4 mx-auto my-24", children: /* @__PURE__ */ s(K, { type: "button", color: "secondary", variant: "filled", onClick: y, children: d("explorer.see.more") }) })
257
245
  ] });
258
246
  };
259
247
  export {
260
- ResourcesList as default
248
+ Oe as default
261
249
  };
package/lib/TrashModal.js CHANGED
@@ -1,20 +1,20 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { Modal, Button } from "@edifice-ui/react";
3
- import { createPortal } from "react-dom";
4
- import { useTranslation } from "react-i18next";
5
- function TrashedResourceModal({
6
- isOpen,
7
- onCancel = () => ({})
1
+ import { jsxs as a, jsx as o } from "react/jsx-runtime";
2
+ import { Modal as r, Button as d } from "@edifice-ui/react";
3
+ import { createPortal as i } from "react-dom";
4
+ import { useTranslation as s } from "react-i18next";
5
+ function h({
6
+ isOpen: l,
7
+ onCancel: e = () => ({})
8
8
  }) {
9
9
  const {
10
10
  t
11
- } = useTranslation();
12
- return /* @__PURE__ */ createPortal(/* @__PURE__ */ jsxs(Modal, { isOpen, onModalClose: onCancel, id: "trash_resource", children: [
13
- /* @__PURE__ */ jsx(Modal.Header, { onModalClose: () => onCancel(), children: t("explorer.trash.modal.title") }),
14
- /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx("p", { className: "body", children: t("explorer.trash.modal.text") }) }),
15
- /* @__PURE__ */ jsx(Modal.Footer, { children: /* @__PURE__ */ jsx(Button, { color: "primary", onClick: onCancel, type: "button", variant: "outline", children: t("close") }) })
11
+ } = s();
12
+ return /* @__PURE__ */ i(/* @__PURE__ */ a(r, { isOpen: l, onModalClose: e, id: "trash_resource", children: [
13
+ /* @__PURE__ */ o(r.Header, { onModalClose: () => e(), children: t("explorer.trash.modal.title") }),
14
+ /* @__PURE__ */ o(r.Body, { children: /* @__PURE__ */ o("p", { className: "body", children: t("explorer.trash.modal.text") }) }),
15
+ /* @__PURE__ */ o(r.Footer, { children: /* @__PURE__ */ o(d, { color: "primary", onClick: e, type: "button", variant: "outline", children: t("close") }) })
16
16
  ] }), document.getElementById("portal"));
17
17
  }
18
18
  export {
19
- TrashedResourceModal as default
19
+ h as default
20
20
  };
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { E } from "./index2.js";
1
+ import { E as l } from "./index2.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "@edifice-ui/react";
@@ -9,5 +9,5 @@ import "i18next";
9
9
  import "zustand";
10
10
  import "@tanstack/react-query";
11
11
  export {
12
- E as Explorer
12
+ l as Explorer
13
13
  };