ode-explorer 1.3.2-dev.202401091605 → 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.
Files changed (80) hide show
  1. package/dist/index.js +3 -3
  2. package/dist/version.txt +1 -1
  3. package/explorer.d.ts +1 -0
  4. package/lib/ActionBarContainer.js +281 -0
  5. package/lib/AppAction.js +34 -0
  6. package/lib/DeleteModal.js +52 -0
  7. package/lib/DisableModal.js +20 -0
  8. package/lib/EmptyScreenApp.js +37 -0
  9. package/lib/EmptyScreenError.js +12 -0
  10. package/lib/EmptyScreenNoContentInFolder.js +18 -0
  11. package/lib/EmptyScreenSearch.js +18 -0
  12. package/lib/EmptyScreenTrash.js +16 -0
  13. package/lib/FolderModal.js +119 -0
  14. package/lib/FoldersList.js +64 -0
  15. package/lib/Library.js +16 -0
  16. package/lib/MoveModal.js +78 -0
  17. package/lib/ResourcesList.js +249 -0
  18. package/lib/TrashModal.js +20 -0
  19. package/lib/app/root/index.d.ts +2 -0
  20. package/lib/components/AppAction/AppAction.d.ts +1 -0
  21. package/lib/components/EmptyScreens/EmptyScreenApp.d.ts +2 -0
  22. package/lib/components/EmptyScreens/EmptyScreenError.d.ts +2 -0
  23. package/lib/components/EmptyScreens/EmptyScreenNoContentInFolder.d.ts +2 -0
  24. package/lib/components/EmptyScreens/EmptyScreenSearch.d.ts +2 -0
  25. package/lib/components/EmptyScreens/EmptyScreenTrash.d.ts +1 -0
  26. package/lib/components/Explorer.d.ts +5 -0
  27. package/lib/components/ExplorerBreadcrumb.d.ts +1 -0
  28. package/lib/components/LoadMore.d.ts +3 -0
  29. package/lib/config/getExplorerConfig.d.ts +11 -0
  30. package/lib/config/index.d.ts +3 -0
  31. package/lib/features/AccessControl/AccessControl.d.ts +12 -0
  32. package/lib/features/AccessControl/useAccessControl.d.ts +14 -0
  33. package/lib/features/ActionBar/ActionBarContainer.d.ts +1 -0
  34. package/lib/features/ActionBar/Delete/DeleteModal.d.ts +8 -0
  35. package/lib/features/ActionBar/Delete/useDeleteModal.d.ts +8 -0
  36. package/lib/features/ActionBar/Disable/DisableModal.d.ts +5 -0
  37. package/lib/features/ActionBar/Disable/useDisableModal.d.ts +4 -0
  38. package/lib/features/ActionBar/Folder/FolderModal.d.ts +9 -0
  39. package/lib/features/ActionBar/Folder/useFolderModal.d.ts +22 -0
  40. package/lib/features/ActionBar/Move/MoveModal.d.ts +8 -0
  41. package/lib/features/ActionBar/Move/useMoveModal.d.ts +12 -0
  42. package/lib/features/ActionBar/Trash/TrashModal.d.ts +5 -0
  43. package/lib/features/ActionBar/Trash/useTrashModal.d.ts +4 -0
  44. package/lib/features/ActionBar/useActionBar.d.ts +30 -0
  45. package/lib/features/List/FolderCard.d.ts +17 -0
  46. package/lib/features/List/FoldersList.d.ts +7 -0
  47. package/lib/features/List/List.d.ts +1 -0
  48. package/lib/features/List/ResourceCard.d.ts +22 -0
  49. package/lib/features/List/ResourcesList.d.ts +8 -0
  50. package/lib/features/SearchForm/SearchForm.d.ts +1 -0
  51. package/lib/features/SearchForm/useSearchForm.d.ts +8 -0
  52. package/lib/features/SearchForm/useSelectedFilters.d.ts +8 -0
  53. package/lib/features/SideBar/Library/Library.d.ts +2 -0
  54. package/lib/features/SideBar/TrashButton.d.ts +7 -0
  55. package/lib/features/SideBar/TreeViewContainer.d.ts +1 -0
  56. package/lib/i18n.d.ts +2 -0
  57. package/lib/index.d.ts +1 -0
  58. package/lib/index.js +13 -0
  59. package/lib/index2.js +1376 -0
  60. package/lib/main.d.ts +0 -0
  61. package/lib/services/api/index.d.ts +129 -0
  62. package/lib/store/index.d.ts +98 -0
  63. package/lib/style.css +1 -0
  64. package/lib/utils/TreeNodeFolderWrapper.d.ts +12 -0
  65. package/lib/utils/addNode.d.ts +6 -0
  66. package/lib/utils/arrayUnique.d.ts +1 -0
  67. package/lib/utils/capitalizeFirstLetter.d.ts +1 -0
  68. package/lib/utils/deleteNode.d.ts +4 -0
  69. package/lib/utils/findNodeById.d.ts +2 -0
  70. package/lib/utils/fullTextSearch.d.ts +1 -0
  71. package/lib/utils/getAncestors.d.ts +2 -0
  72. package/lib/utils/getAppParams.d.ts +10 -0
  73. package/lib/utils/hasChildren.d.ts +2 -0
  74. package/lib/utils/isResourceShared.d.ts +2 -0
  75. package/lib/utils/modifyNode.d.ts +2 -0
  76. package/lib/utils/moveNode.d.ts +5 -0
  77. package/lib/utils/scrollToTop.d.ts +1 -0
  78. package/lib/utils/updateNode.d.ts +6 -0
  79. package/lib/utils/wrapTreeNode.d.ts +3 -0
  80. package/package.json +33 -4
package/lib/Library.js ADDED
@@ -0,0 +1,16 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { useOdeTheme as i, useLibraryUrl as s, usePaths as l, Library as b } from "@edifice-ui/react";
3
+ import { useTranslation as n } from "react-i18next";
4
+ const u = () => {
5
+ const {
6
+ t: r
7
+ } = n(), {
8
+ theme: t
9
+ } = i(), {
10
+ libraryUrl: a
11
+ } = s(), [e] = l();
12
+ return /* @__PURE__ */ o(b, { src: `${e}/${t == null ? void 0 : t.bootstrapVersion}/image-library.svg`, url: a, alt: r("explorer.libray.img.alt"), text: r("explorer.libray.title"), textButton: r("explorer.libray.btn") });
13
+ };
14
+ export {
15
+ u as default
16
+ };
@@ -0,0 +1,78 @@
1
+ import { jsxs as h, jsx as l } from "react/jsx-runtime";
2
+ import { Modal as a, TreeView as T, Button as I } from "@edifice-ui/react";
3
+ import { createPortal as M } from "react-dom";
4
+ import { useTranslation as y } from "react-i18next";
5
+ import { useState as b } from "react";
6
+ import { useQueryClient as F } from "@tanstack/react-query";
7
+ import { s as x, h as S, g as w, u as g, t as B } from "./index2.js";
8
+ import "@edifice-ui/icons";
9
+ import "edifice-ts-client";
10
+ import "i18next";
11
+ import "zustand";
12
+ function C({
13
+ onSuccess: n
14
+ }) {
15
+ const [d, t] = b(), r = x(), i = S(), m = w(), {
16
+ foldTreeItem: s,
17
+ unfoldTreeItem: c
18
+ } = g(), f = F();
19
+ async function u() {
20
+ try {
21
+ if (!d)
22
+ throw new Error("explorer.move.selection.empty");
23
+ await r.mutate(d), await (n == null ? void 0 : n());
24
+ } catch (e) {
25
+ console.error(e);
26
+ }
27
+ }
28
+ const v = (e) => {
29
+ var p;
30
+ for (const o of i)
31
+ if (e === o.id || e === o.parentId)
32
+ return !1;
33
+ for (const o of m)
34
+ if (e === ((o == null ? void 0 : o.folderIds) && o.folderIds[0]) || ((p = o == null ? void 0 : o.folderIds) == null ? void 0 : p.length) === 0 && e === "default")
35
+ return !1;
36
+ return !0;
37
+ };
38
+ return {
39
+ disableSubmit: !d,
40
+ handleTreeItemSelect: (e) => {
41
+ v(e) ? t(e) : t(void 0);
42
+ },
43
+ handleTreeItemFold: s,
44
+ handleTreeItemUnfold: async (e) => await c(e, f),
45
+ onMove: () => {
46
+ u();
47
+ }
48
+ };
49
+ }
50
+ function z({
51
+ isOpen: n,
52
+ onSuccess: d,
53
+ onCancel: t
54
+ }) {
55
+ const {
56
+ t: r
57
+ } = y(), {
58
+ handleTreeItemFold: i,
59
+ handleTreeItemSelect: m,
60
+ handleTreeItemUnfold: s,
61
+ onMove: c,
62
+ disableSubmit: f
63
+ } = C({
64
+ onSuccess: d
65
+ }), u = B();
66
+ return /* @__PURE__ */ M(/* @__PURE__ */ h(a, { isOpen: n, onModalClose: t, id: "moveModal", children: [
67
+ /* @__PURE__ */ l(a.Header, { onModalClose: t, children: r("explorer.move.title") }),
68
+ /* @__PURE__ */ l(a.Subtitle, { children: r("explorer.move.subtitle") }),
69
+ /* @__PURE__ */ l(a.Body, { children: /* @__PURE__ */ l(T, { data: u, onTreeItemSelect: m, onTreeItemFold: i, onTreeItemUnfold: s }) }),
70
+ /* @__PURE__ */ h(a.Footer, { children: [
71
+ /* @__PURE__ */ l(I, { color: "tertiary", onClick: t, type: "button", variant: "ghost", children: r("explorer.cancel") }),
72
+ /* @__PURE__ */ l(I, { color: "primary", onClick: c, type: "button", variant: "filled", disabled: f, children: r("explorer.move") })
73
+ ] })
74
+ ] }), document.getElementById("portal"));
75
+ }
76
+ export {
77
+ z as default
78
+ };
@@ -0,0 +1,249 @@
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
+ import "edifice-ts-client";
12
+ import "i18next";
13
+ import "zustand";
14
+ import "@tanstack/react-query";
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
+ }) => {
24
+ const p = `/userbook/avatar/${t == null ? void 0 : t.creatorId}`;
25
+ function l(h) {
26
+ const {
27
+ rights: v,
28
+ creatorId: Y
29
+ } = h || {};
30
+ return v.filter((y) => !y.includes(Y)).length >= 1;
31
+ }
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 }) })
41
+ ] })
42
+ ] }),
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 })
47
+ ] }),
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 }) })
55
+ ] })
56
+ ] })
57
+ ] }) });
58
+ };
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;
63
+ }
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);
75
+ }
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);
85
+ break;
86
+ }
87
+ }
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);
96
+ };
97
+ var l = function(r) {
98
+ return r.$u ? d.utc() : d();
99
+ };
100
+ o.toNow = function(r) {
101
+ return this.to(l(this), r);
102
+ }, o.fromNow = function(r) {
103
+ return this.from(l(this), r);
104
+ };
105
+ };
106
+ });
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 };
118
+ }
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);
123
+ }
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;
128
+ });
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 };
139
+ }
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 + "º";
142
+ } };
143
+ return d.default.locale(o, null, !0), o;
144
+ });
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 };
155
+ }
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 + "º";
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" } };
159
+ return d.default.locale(o, null, !0), o;
160
+ });
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 };
171
+ }
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" : "");
174
+ } };
175
+ return d.default.locale(o, null, !0), o;
176
+ });
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 };
187
+ }
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 + "º";
190
+ } };
191
+ return d.default.locale(o, null, !0), o;
192
+ });
193
+ })(R, R.exports);
194
+ var Ne = R.exports;
195
+ b.extend(se);
196
+ const Oe = ({
197
+ data: a,
198
+ fetchNextPage: t
199
+ }) => {
200
+ const {
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({
211
+ from: {
212
+ opacity: 0
213
+ },
214
+ to: {
215
+ opacity: 1
216
+ }
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);
221
+ };
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));
225
+ return;
226
+ }
227
+ r([...e, u.id]), l([...p, u]);
228
+ }
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) => (
232
+ // eslint-disable-next-line react/no-array-index-key
233
+ /* @__PURE__ */ s(F.Fragment, { children: u.resources.map((c) => {
234
+ const {
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: {
239
+ position: "relative",
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)
243
+ )) }),
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") }) })
245
+ ] });
246
+ };
247
+ export {
248
+ Oe as default
249
+ };
@@ -0,0 +1,20 @@
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
+ }) {
9
+ const {
10
+ t
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
+ ] }), document.getElementById("portal"));
17
+ }
18
+ export {
19
+ h as default
20
+ };
@@ -0,0 +1,2 @@
1
+ declare function Root(): import("react/jsx-runtime").JSX.Element;
2
+ export default Root;
@@ -0,0 +1 @@
1
+ export default function AppAction(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function EmptyScreenApp(): JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function EmptyScreenError(): JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function EmptyScreenNoContentInFolder(): JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function EmptyScreenSearch(): JSX.Element;
@@ -0,0 +1 @@
1
+ export default function EmptyScreenTrash(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { AppParams } from "../utils/getAppParams";
2
+ declare const Explorer: ({ config }: {
3
+ config: AppParams;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default Explorer;
@@ -0,0 +1 @@
1
+ export declare function ExplorerBreadcrumb(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const LoadMore: import("react").ForwardRefExoticComponent<import("react").RefAttributes<HTMLButtonElement>>;
3
+ export default LoadMore;
@@ -0,0 +1,11 @@
1
+ import { type App, type ResourceType, type IAction, type IFilter, type IOrder } from "edifice-ts-client";
2
+ export interface AppParams {
3
+ app: App;
4
+ types: ResourceType[];
5
+ filters: IFilter[];
6
+ orders: IOrder[];
7
+ actions: IAction[];
8
+ trashActions: IAction[];
9
+ libraryAppFilter?: string;
10
+ }
11
+ export declare function getExplorerConfig(): AppParams;
@@ -0,0 +1,3 @@
1
+ import clsx from "clsx";
2
+ import dayjs from "dayjs";
3
+ export { clsx, dayjs };
@@ -0,0 +1,12 @@
1
+ import { type ReactNode, type ReactElement } from "react";
2
+ import { IAction, RightRole } from "edifice-ts-client";
3
+ import { IObjectWithRights } from './useAccessControl';
4
+ interface AccessControlProps {
5
+ roleExpected: RightRole | RightRole[];
6
+ resourceRights: string | string[] | IObjectWithRights | IObjectWithRights[];
7
+ action: IAction;
8
+ children: ReactNode;
9
+ renderWhenForbidden?: () => ReactElement;
10
+ }
11
+ export declare function AccessControl({ resourceRights, roleExpected, action, children, renderWhenForbidden, }: AccessControlProps): ReactElement;
12
+ export {};
@@ -0,0 +1,14 @@
1
+ import { type RightRole } from "edifice-ts-client";
2
+ export interface IObjectWithRights {
3
+ rights: string[];
4
+ }
5
+ interface AccessControlProps {
6
+ roles: RightRole | RightRole[];
7
+ rights: string | string[] | IObjectWithRights | IObjectWithRights[];
8
+ action: string | undefined;
9
+ }
10
+ export declare function useAccessControl({ roles, rights, action, }: AccessControlProps): {
11
+ visible: boolean;
12
+ refreshState: () => Promise<void>;
13
+ };
14
+ export {};
@@ -0,0 +1 @@
1
+ export default function ActionBarContainer(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ interface ModalProps {
3
+ isOpen: boolean;
4
+ onSuccess?: () => void;
5
+ onCancel?: () => void;
6
+ }
7
+ export default function DeleteModal({ isOpen, onSuccess, onCancel, }: ModalProps): import("react").ReactPortal;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ interface ModalProps {
2
+ onSuccess?: () => void;
3
+ }
4
+ export declare function useDeleteModal({ onSuccess }: ModalProps): {
5
+ isTrashFolder: boolean;
6
+ onDelete: () => Promise<void>;
7
+ };
8
+ export {};
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export default function ActionResourceDisableModal({ isOpen, onCancel, }: {
3
+ isOpen: boolean;
4
+ onCancel?: () => void;
5
+ }): import("react").ReactPortal;
@@ -0,0 +1,4 @@
1
+ export declare const useDisableModal: () => {
2
+ isActionDisableModalOpen: boolean;
3
+ onActionDisableCancel: () => void;
4
+ };
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ interface FolderModalProps {
3
+ isOpen: boolean;
4
+ edit: boolean;
5
+ onSuccess?: () => void;
6
+ onCancel: () => void;
7
+ }
8
+ export default function FolderModal({ isOpen, edit, onSuccess, onCancel: onClose, }: FolderModalProps): import("react").ReactPortal | null;
9
+ export {};
@@ -0,0 +1,22 @@
1
+ import { type SubmitHandler } from "react-hook-form";
2
+ interface useFolderModalProps {
3
+ edit: boolean;
4
+ onSuccess?: () => void;
5
+ onClose: () => void;
6
+ }
7
+ interface HandlerProps {
8
+ name: string;
9
+ }
10
+ export declare function useFolderModal({ edit, onSuccess, onClose, }: useFolderModalProps): {
11
+ formId: string;
12
+ errors: import("react-hook-form").FieldErrors<HandlerProps>;
13
+ isSubmitting: boolean;
14
+ isDirty: boolean;
15
+ isValid: boolean;
16
+ register: import("react-hook-form").UseFormRegister<HandlerProps>;
17
+ setFocus: import("react-hook-form").UseFormSetFocus<HandlerProps>;
18
+ handleSubmit: import("react-hook-form").UseFormHandleSubmit<HandlerProps, undefined>;
19
+ onCancel: () => void;
20
+ onSubmit: SubmitHandler<HandlerProps>;
21
+ };
22
+ export {};
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ interface MoveModalProps {
3
+ isOpen: boolean;
4
+ onSuccess: () => void;
5
+ onCancel: () => void;
6
+ }
7
+ export default function MoveModal({ isOpen, onSuccess, onCancel, }: MoveModalProps): import("react").ReactPortal;
8
+ export {};
@@ -0,0 +1,12 @@
1
+ import { type ID } from "edifice-ts-client";
2
+ interface ModalProps {
3
+ onSuccess?: () => void;
4
+ }
5
+ export declare function useMoveModal({ onSuccess }: ModalProps): {
6
+ disableSubmit: boolean;
7
+ handleTreeItemSelect: (folderId: string) => void;
8
+ handleTreeItemFold: (folderId: string) => void;
9
+ handleTreeItemUnfold: (folderId: ID) => Promise<void>;
10
+ onMove: () => void;
11
+ };
12
+ export {};
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export default function TrashedResourceModal({ isOpen, onCancel, }: {
3
+ isOpen: boolean;
4
+ onCancel?: () => void;
5
+ }): import("react").ReactPortal;
@@ -0,0 +1,4 @@
1
+ export declare const useTrashModal: () => {
2
+ isTrashedModalOpen: boolean;
3
+ onTrashedCancel: () => void;
4
+ };
@@ -0,0 +1,30 @@
1
+ import { type IAction } from "edifice-ts-client";
2
+ export default function useActionBar(): {
3
+ onRestore: () => Promise<void>;
4
+ actions: IAction[] | undefined;
5
+ selectedElement: (import("edifice-ts-client").IFolder | import("edifice-ts-client").IResource)[];
6
+ currentFolderId: string | undefined;
7
+ overrideLabel: (action: IAction) => string;
8
+ handleClick: (action: IAction) => Promise<void>;
9
+ isActivable: (action: IAction) => boolean;
10
+ isActionBarOpen: boolean;
11
+ isMoveModalOpen: boolean;
12
+ onMoveCancel: () => void;
13
+ onMoveSuccess: () => void;
14
+ isDeleteModalOpen: boolean;
15
+ onDeleteCancel: () => void;
16
+ onDeleteSuccess: () => void;
17
+ isPublishModalOpen: boolean;
18
+ onPublishCancel: () => void;
19
+ onPublishSuccess: () => void;
20
+ isEditFolderOpen: boolean;
21
+ onEditFolderCancel: () => void;
22
+ onEditFolderSuccess: () => void;
23
+ isEditResourceOpen: boolean;
24
+ onEditResourceCancel: () => void;
25
+ onEditResourceSuccess: () => void;
26
+ isShareResourceOpen: boolean;
27
+ onShareResourceCancel: () => void;
28
+ onShareResourceSuccess: () => void;
29
+ onClearActionBar: () => void;
30
+ };
@@ -0,0 +1,17 @@
1
+ import { CardProps } from "@edifice-ui/react";
2
+ import { IWebApp } from "edifice-ts-client";
3
+ export interface FolderCardProps extends Omit<CardProps, "children"> {
4
+ /**
5
+ * IWeb App
6
+ */
7
+ app?: IWebApp | undefined;
8
+ /**
9
+ * Folder's name
10
+ */
11
+ name: string;
12
+ }
13
+ declare const FolderCard: {
14
+ ({ app, name, isSelected, isSelectable, onClick, onSelect, }: FolderCardProps): import("react/jsx-runtime").JSX.Element;
15
+ displayName: string;
16
+ };
17
+ export default FolderCard;
@@ -0,0 +1,7 @@
1
+ import { InfiniteData } from "@tanstack/react-query";
2
+ import { ISearchResults } from "edifice-ts-client";
3
+ declare const FoldersList: ({ data, }: {
4
+ data: InfiniteData<ISearchResults> | undefined;
5
+ isFetching: boolean;
6
+ }) => import("react/jsx-runtime").JSX.Element | null;
7
+ export default FoldersList;
@@ -0,0 +1 @@
1
+ export declare const List: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { CardProps } from "@edifice-ui/react";
2
+ import { IResource, IWebApp } from "edifice-ts-client";
3
+ type OmitChildren = Omit<CardProps, "children">;
4
+ export interface ResourceCardProps extends OmitChildren {
5
+ /**
6
+ * IWeb App
7
+ */
8
+ app?: IWebApp | undefined;
9
+ /**
10
+ * Resource
11
+ */
12
+ resource: Partial<IResource>;
13
+ /**
14
+ * Updated date
15
+ */
16
+ time: string;
17
+ }
18
+ declare const ResourceCard: {
19
+ ({ app, resource, time, isSelected, isSelectable, onClick, onSelect, }: ResourceCardProps): import("react/jsx-runtime").JSX.Element;
20
+ displayName: string;
21
+ };
22
+ export default ResourceCard;