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/dist/version.txt CHANGED
@@ -1 +1 @@
1
- ode-explorer=1.0-SNAPSHOT 09/01/2024 16:06:03
1
+ ode-explorer=1.0-SNAPSHOT 10/01/2024 15:31:08
package/explorer.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./dist/ode-explorer";
@@ -0,0 +1,281 @@
1
+ import { jsx as u, Fragment as j, jsxs as V } from "react/jsx-runtime";
2
+ import { useState as F, useEffect as $, Suspense as ce, lazy as y } from "react";
3
+ import { useUser as ae, Button as G, ActionBar as ie, LoadingScreen as le } from "@edifice-ui/react";
4
+ import { useTransition as ue, animated as de } from "@react-spring/web";
5
+ import { useTranslation as q } from "react-i18next";
6
+ import { odeServices as w, ACTION as l } from "edifice-ts-client";
7
+ import { d as Y, e as fe, b as he, f as pe, g as J, h as me, i as Re, j as Se, k as Ee, u as K, a as Oe, l as ye, m as Ce } from "./index2.js";
8
+ import "@edifice-ui/icons";
9
+ import "i18next";
10
+ import "zustand";
11
+ import "@tanstack/react-query";
12
+ function be({
13
+ roles: o,
14
+ rights: e,
15
+ action: r
16
+ }) {
17
+ const [a, s] = F(!1), {
18
+ user: m
19
+ } = ae(), R = Y();
20
+ $(() => {
21
+ S();
22
+ }, [o, e]);
23
+ const d = async function(c) {
24
+ const t = c instanceof Array ? c : [c];
25
+ if (o instanceof Array) {
26
+ const p = await w.rights().sessionHasAtLeastOneResourceRight(o, t);
27
+ s(p);
28
+ } else {
29
+ const p = await w.rights().sessionHasResourceRight(o, t);
30
+ s(p);
31
+ }
32
+ }, f = async function(c) {
33
+ if (o instanceof Array) {
34
+ const t = await w.rights().sessionHasAtLeastOneResourceRightForEachList(o, c);
35
+ s(t);
36
+ } else {
37
+ const t = await w.rights().sessionHasResourceRightForEachList(o, c);
38
+ s(t);
39
+ }
40
+ }, S = async function() {
41
+ var c, t, p;
42
+ if (o === void 0) {
43
+ s(!0);
44
+ return;
45
+ }
46
+ if (R && ((t = (c = e[0]) == null ? void 0 : c.trashedBy) != null && t.includes(m == null ? void 0 : m.userId)) && r === "restore" && !((p = e[0]) != null && p.trashed)) {
47
+ s(!0);
48
+ return;
49
+ }
50
+ if (e instanceof Array)
51
+ if (e.length > 0)
52
+ if (typeof e[0] == "string")
53
+ await d(e);
54
+ else {
55
+ const C = e.map((O) => O.rights);
56
+ await f(C);
57
+ }
58
+ else
59
+ s(!1);
60
+ else
61
+ typeof e == "string" ? await d(e) : await d(e.rights);
62
+ };
63
+ return {
64
+ visible: a,
65
+ refreshState: S
66
+ };
67
+ }
68
+ function Q() {
69
+ const [o, e] = F(!1), [r, a] = F("void"), [s, m] = F(), R = fe((n) => n.config), d = he(), f = pe(), S = J(), c = me(), t = Re(), p = Y(), C = Se(), O = Ee(), {
70
+ openResource: I,
71
+ printSelectedResource: P,
72
+ openFolder: T,
73
+ clearSelectedItems: B,
74
+ clearSelectedIds: D
75
+ } = K(), {
76
+ data: L
77
+ } = Oe();
78
+ $(() => {
79
+ if (f.length === 0 && t.length === 0) {
80
+ e(!1);
81
+ return;
82
+ }
83
+ if (O) {
84
+ e(!1);
85
+ return;
86
+ }
87
+ e(!0);
88
+ }, [f, t]);
89
+ async function _(n) {
90
+ var M;
91
+ switch ((M = document.getElementById("root")) == null || M.setAttribute("aria-hidden", "true"), m(n), n.id) {
92
+ case l.OPEN:
93
+ return f.length > 0 ? I(S[0]) : T({
94
+ folder: c[0],
95
+ folderId: c[0].id
96
+ });
97
+ case l.MOVE:
98
+ return a("move");
99
+ case l.PRINT:
100
+ return P();
101
+ case l.DELETE:
102
+ return a("delete");
103
+ case l.RESTORE:
104
+ return await v();
105
+ case l.PUBLISH:
106
+ return a("publish");
107
+ case l.UPD_PROPS:
108
+ case "edit":
109
+ return ne();
110
+ case l.SHARE:
111
+ return a("share");
112
+ default:
113
+ throw Error(`Unknown action: ${n.id}`);
114
+ }
115
+ }
116
+ function N(n) {
117
+ const M = f.length + t.length, b = f.length === 1 || t.length === 1, z = M === 1, g = t.length === 0;
118
+ switch (n.id) {
119
+ case l.OPEN:
120
+ return z;
121
+ case l.MANAGE:
122
+ return b;
123
+ case l.PUBLISH:
124
+ return b && g;
125
+ case l.UPD_PROPS:
126
+ return b && g;
127
+ case l.SHARE:
128
+ return g && b;
129
+ case l.PRINT:
130
+ return b && g;
131
+ case "edit":
132
+ return z;
133
+ default:
134
+ return !0;
135
+ }
136
+ }
137
+ const x = () => !0;
138
+ async function v() {
139
+ try {
140
+ if (p)
141
+ await C.mutate();
142
+ else
143
+ throw new Error("Cannot restore untrashed resources");
144
+ E();
145
+ } catch (n) {
146
+ console.error(n);
147
+ }
148
+ }
149
+ function E() {
150
+ var n;
151
+ a("void"), s != null && s.id && ((n = document.getElementById(s == null ? void 0 : s.id)) == null || n.focus());
152
+ }
153
+ const i = (n) => () => {
154
+ r === n && (E(), B(), D());
155
+ }, A = i("move"), H = i("move"), U = i("delete"), k = i("delete"), h = i("publish"), X = i("publish"), Z = i("edit_folder"), W = i("edit_folder"), ee = i("edit_resource"), se = i("edit_resource"), te = i("share"), oe = i("share");
156
+ function ne() {
157
+ f && f.length > 0 ? a("edit_resource") : a("edit_folder");
158
+ }
159
+ function re(n) {
160
+ return n.id === "edit" && t.length > 0 ? "explorer.rename" : `explorer.actions.${n.id}`;
161
+ }
162
+ return {
163
+ onRestore: v,
164
+ actions: p ? R == null ? void 0 : R.trashActions : L,
165
+ selectedElement: [...S, ...c],
166
+ currentFolderId: d == null ? void 0 : d.id,
167
+ overrideLabel: re,
168
+ handleClick: _,
169
+ isActivable: p ? x : N,
170
+ isActionBarOpen: o,
171
+ isMoveModalOpen: r === "move",
172
+ onMoveCancel: A,
173
+ onMoveSuccess: H,
174
+ isDeleteModalOpen: r === "delete",
175
+ onDeleteCancel: k,
176
+ onDeleteSuccess: U,
177
+ isPublishModalOpen: r === "publish",
178
+ onPublishCancel: X,
179
+ onPublishSuccess: h,
180
+ isEditFolderOpen: r === "edit_folder",
181
+ onEditFolderCancel: W,
182
+ onEditFolderSuccess: Z,
183
+ isEditResourceOpen: r === "edit_resource",
184
+ onEditResourceCancel: se,
185
+ onEditResourceSuccess: ee,
186
+ isShareResourceOpen: r === "share",
187
+ onShareResourceCancel: oe,
188
+ onShareResourceSuccess: te,
189
+ onClearActionBar: E
190
+ };
191
+ }
192
+ function ve({
193
+ resourceRights: o,
194
+ roleExpected: e,
195
+ action: r,
196
+ children: a,
197
+ renderWhenForbidden: s
198
+ }) {
199
+ const {
200
+ t: m
201
+ } = q(), {
202
+ overrideLabel: R
203
+ } = Q(), {
204
+ visible: d
205
+ } = be({
206
+ roles: e,
207
+ rights: o,
208
+ action: r == null ? void 0 : r.id
209
+ }), {
210
+ setResourceActionDisable: f
211
+ } = K(), S = Y();
212
+ return d ? /* @__PURE__ */ u(j, { children: a }) : s ? s() : S && !d ? /* @__PURE__ */ u(G, { type: "button", color: "primary", variant: "filled", onClick: () => {
213
+ f(!0);
214
+ }, children: m(R(r)) }) : /* @__PURE__ */ u(j, {});
215
+ }
216
+ const Ae = /* @__PURE__ */ y(async () => ({
217
+ default: (await import("@edifice-ui/react")).ShareModal
218
+ })), Me = /* @__PURE__ */ y(async () => ({
219
+ default: (await import("@edifice-ui/react")).PublishModal
220
+ })), ge = /* @__PURE__ */ y(async () => ({
221
+ default: (await import("@edifice-ui/react")).ResourceModal
222
+ })), we = /* @__PURE__ */ y(async () => await import("./DeleteModal.js")), Fe = /* @__PURE__ */ y(async () => await import("./MoveModal.js")), Ie = /* @__PURE__ */ y(async () => await import("./FolderModal.js"));
223
+ function je() {
224
+ const {
225
+ t: o
226
+ } = q(), {
227
+ actions: e,
228
+ selectedElement: r,
229
+ isMoveModalOpen: a,
230
+ isDeleteModalOpen: s,
231
+ isPublishModalOpen: m,
232
+ isActionBarOpen: R,
233
+ isEditFolderOpen: d,
234
+ overrideLabel: f,
235
+ onEditFolderCancel: S,
236
+ onEditFolderSuccess: c,
237
+ isEditResourceOpen: t,
238
+ onEditResourceCancel: p,
239
+ onEditResourceSuccess: C,
240
+ isShareResourceOpen: O,
241
+ onShareResourceCancel: I,
242
+ onShareResourceSuccess: P,
243
+ onMoveCancel: T,
244
+ onMoveSuccess: B,
245
+ onDeleteCancel: D,
246
+ onDeleteSuccess: L,
247
+ onPublishCancel: _,
248
+ onPublishSuccess: N,
249
+ isActivable: x,
250
+ handleClick: v
251
+ } = Q(), E = J(), i = ye(), A = Ce(), H = ue(R, {
252
+ from: {
253
+ opacity: 0,
254
+ transform: "translateY(100%)"
255
+ },
256
+ enter: {
257
+ opacity: 1,
258
+ transform: "translateY(0)"
259
+ },
260
+ leave: {
261
+ opacity: 0,
262
+ transform: "translateY(100%)"
263
+ }
264
+ });
265
+ return /* @__PURE__ */ V(j, { children: [
266
+ H((U, k) => k && /* @__PURE__ */ u(de.div, { className: "position-fixed bottom-0 start-0 end-0 z-3", style: U, children: /* @__PURE__ */ u(ie, { children: e == null ? void 0 : e.filter((h) => h.available && h.target === "actionbar").map((h) => x(h) && /* @__PURE__ */ u(ve, { resourceRights: r, roleExpected: h.right, action: h, children: /* @__PURE__ */ u(G, { id: h.id, type: "button", color: "primary", variant: "filled", onClick: () => {
267
+ v(h);
268
+ }, children: o(f(h)) }, h.id) }, h.id)) }) })),
269
+ /* @__PURE__ */ V(ce, { fallback: /* @__PURE__ */ u(le, {}), children: [
270
+ a && /* @__PURE__ */ u(Fe, { isOpen: a, onCancel: T, onSuccess: B }),
271
+ s && /* @__PURE__ */ u(we, { isOpen: s, onCancel: D, onSuccess: L }),
272
+ m && /* @__PURE__ */ u(Me, { isOpen: m, resource: E[0], onCancel: _, onSuccess: N }),
273
+ d && /* @__PURE__ */ u(Ie, { edit: !0, isOpen: d, onCancel: S, onSuccess: c }),
274
+ t && /* @__PURE__ */ u(ge, { mode: "update", actions: e, isOpen: t, selectedResource: E[0], updateResource: A, onCancel: p, onSuccess: C }),
275
+ O && /* @__PURE__ */ u(Ae, { isOpen: O, resource: E[0], updateResource: A, shareResource: i, onCancel: I, onSuccess: P })
276
+ ] })
277
+ ] });
278
+ }
279
+ export {
280
+ je as default
281
+ };
@@ -0,0 +1,34 @@
1
+ import { jsxs as d, Fragment as p, jsx as e } from "react/jsx-runtime";
2
+ import { Suspense as f, lazy as C } from "react";
3
+ import { Plus as g } from "@edifice-ui/icons";
4
+ import { useToggle as R, useOdeClient as S, Button as h, LoadingScreen as O } from "@edifice-ui/react";
5
+ import { useTranslation as x } from "react-i18next";
6
+ import { u as y, a as A, b, c as F } from "./index2.js";
7
+ import "edifice-ts-client";
8
+ import "i18next";
9
+ import "zustand";
10
+ import "@tanstack/react-query";
11
+ const I = /* @__PURE__ */ C(async () => ({
12
+ default: (await import("@edifice-ui/react")).ResourceModal
13
+ }));
14
+ function q() {
15
+ const [o, r] = R(), {
16
+ appCode: n
17
+ } = S(), {
18
+ t: s
19
+ } = x(n), {
20
+ clearSelectedItems: a,
21
+ clearSelectedIds: c
22
+ } = y(), {
23
+ data: t
24
+ } = A(), l = t == null ? void 0 : t.find((m) => m.id === "create"), i = b(), u = F();
25
+ return l ? /* @__PURE__ */ d(p, { children: [
26
+ /* @__PURE__ */ e(h, { type: "button", color: "primary", variant: "filled", leftIcon: /* @__PURE__ */ e(g, {}), className: "ms-auto", onClick: () => {
27
+ a(), c(), r();
28
+ }, children: s("explorer.create.title") }),
29
+ /* @__PURE__ */ e(f, { fallback: /* @__PURE__ */ e(O, {}), children: o && /* @__PURE__ */ e(I, { mode: "create", actions: t, currentFolder: i, createResource: u, isOpen: o, onSuccess: r, onCancel: r }) })
30
+ ] }) : null;
31
+ }
32
+ export {
33
+ q as default
34
+ };
@@ -0,0 +1,52 @@
1
+ import { jsxs as s, jsx as l } from "react/jsx-runtime";
2
+ import { Modal as a, Button as d } from "@edifice-ui/react";
3
+ import { createPortal as m } from "react-dom";
4
+ import { useTranslation as p } from "react-i18next";
5
+ import { q as c, r as h, d as u } from "./index2.js";
6
+ import "react";
7
+ import "@edifice-ui/icons";
8
+ import "edifice-ts-client";
9
+ import "i18next";
10
+ import "zustand";
11
+ import "@tanstack/react-query";
12
+ function f({
13
+ onSuccess: t
14
+ }) {
15
+ const i = c(), r = h(), e = u();
16
+ async function o() {
17
+ try {
18
+ e ? await i.mutate() : await r.mutate(), t == null || t();
19
+ } catch (n) {
20
+ console.error(n);
21
+ }
22
+ }
23
+ return {
24
+ isTrashFolder: e,
25
+ onDelete: o
26
+ };
27
+ }
28
+ function k({
29
+ isOpen: t,
30
+ onSuccess: i = () => ({}),
31
+ onCancel: r = () => ({})
32
+ }) {
33
+ const {
34
+ t: e
35
+ } = p(), {
36
+ isTrashFolder: o,
37
+ onDelete: n
38
+ } = f({
39
+ onSuccess: i
40
+ });
41
+ return /* @__PURE__ */ m(/* @__PURE__ */ s(a, { isOpen: t, onModalClose: r, id: "deleteModal", children: [
42
+ /* @__PURE__ */ l(a.Header, { onModalClose: r, children: e(o ? "explorer.delete.title" : "explorer.trash.title") }),
43
+ /* @__PURE__ */ l(a.Body, { children: /* @__PURE__ */ l("p", { className: "body", children: e(o ? "explorer.delete.subtitle" : "explorer.trash.subtitle") }) }),
44
+ /* @__PURE__ */ s(a.Footer, { children: [
45
+ /* @__PURE__ */ l(d, { color: "tertiary", onClick: r, type: "button", variant: "ghost", children: e("explorer.cancel") }),
46
+ /* @__PURE__ */ l(d, { color: "danger", onClick: n, type: "button", variant: "filled", children: e(o ? "explorer.delete" : "explorer.trash") })
47
+ ] })
48
+ ] }), document.getElementById("portal"));
49
+ }
50
+ export {
51
+ k as default
52
+ };
@@ -0,0 +1,20 @@
1
+ import { jsxs as a, jsx as o } from "react/jsx-runtime";
2
+ import { Modal as r, Button as i } from "@edifice-ui/react";
3
+ import { createPortal as n } from "react-dom";
4
+ import { useTranslation as d } from "react-i18next";
5
+ function u({
6
+ isOpen: l,
7
+ onCancel: t = () => ({})
8
+ }) {
9
+ const {
10
+ t: e
11
+ } = d();
12
+ return /* @__PURE__ */ n(/* @__PURE__ */ a(r, { isOpen: l, onModalClose: t, id: "trash_action_disable_resource", children: [
13
+ /* @__PURE__ */ o(r.Header, { onModalClose: () => t(), children: e("explorer.trash.action.modal.title") }),
14
+ /* @__PURE__ */ o(r.Body, { children: /* @__PURE__ */ o("p", { className: "body", children: e("explorer.trash.action.modal.text") }) }),
15
+ /* @__PURE__ */ o(r.Footer, { children: /* @__PURE__ */ o(i, { color: "primary", onClick: t, type: "button", variant: "outline", children: e("close") }) })
16
+ ] }), document.getElementById("portal"));
17
+ }
18
+ export {
19
+ u as default
20
+ };
@@ -0,0 +1,37 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { useOdeClient as m, useOdeTheme as a, usePaths as c, EmptyScreen as u } from "@edifice-ui/react";
3
+ import { useTranslation as d } from "react-i18next";
4
+ import { a as x } from "./index2.js";
5
+ import "react";
6
+ import "@edifice-ui/icons";
7
+ import "edifice-ts-client";
8
+ import "i18next";
9
+ import "zustand";
10
+ import "@tanstack/react-query";
11
+ function P() {
12
+ const {
13
+ appCode: r
14
+ } = m(), {
15
+ theme: t
16
+ } = a(), [i] = c(), {
17
+ t: o
18
+ } = d(), {
19
+ data: p
20
+ } = x(), e = p == null ? void 0 : p.find((s) => s.id === "create"), n = () => e != null && e.available && (t != null && t.is1d) ? o("explorer.emptyScreen.txt1d.create", {
21
+ ns: r
22
+ }) : e != null && e.available && !(t != null && t.is1d) ? o("explorer.emptyScreen.txt2d.create", {
23
+ ns: r
24
+ }) : !(e != null && e.available) && (t != null && t.is1d) ? o("explorer.emptyScreen.txt1d.consultation", {
25
+ ns: r
26
+ }) : o("explorer.emptyScreen.txt2d.consultation", {
27
+ ns: r
28
+ });
29
+ return /* @__PURE__ */ l(u, { imageSrc: `${i}/emptyscreen/illu-${r}.svg`, imageAlt: o("explorer.emptyScreen.app.alt", {
30
+ ns: r
31
+ }), title: `${e != null && e.available ? o("explorer.emptyScreen.title.create", {
32
+ ns: r
33
+ }) : o("explorer.emptyScreen.title.consultation")}`, text: n() });
34
+ }
35
+ export {
36
+ P as default
37
+ };
@@ -0,0 +1,12 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { usePaths as o, EmptyScreen as m } from "@edifice-ui/react";
3
+ import { useTranslation as n } from "react-i18next";
4
+ function c() {
5
+ const [r] = o(), {
6
+ t: e
7
+ } = n();
8
+ return /* @__PURE__ */ t(m, { imageSrc: `${r}/emptyscreen/illu-error.svg`, imageAlt: e("explorer.emptyScreen.error.alt"), text: "explorer.emptyScreen.error.text" });
9
+ }
10
+ export {
11
+ c as default
12
+ };
@@ -0,0 +1,18 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { usePaths as o, useOdeClient as m, EmptyScreen as l } from "@edifice-ui/react";
3
+ import { useTranslation as p } from "react-i18next";
4
+ function i() {
5
+ const [n] = o(), {
6
+ appCode: e
7
+ } = m(), {
8
+ t
9
+ } = p();
10
+ return /* @__PURE__ */ r(l, { imageSrc: `${n}/emptyscreen/illu-no-content-in-folder.svg`, imageAlt: t("explorer.emptyScreen.folder.empty.alt", {
11
+ ns: e
12
+ }), text: t("explorer.emptyScreen.label", {
13
+ ns: e
14
+ }) });
15
+ }
16
+ export {
17
+ i as default
18
+ };
@@ -0,0 +1,18 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { useOdeClient as n, usePaths as a, EmptyScreen as o } from "@edifice-ui/react";
3
+ import { useTranslation as c } from "react-i18next";
4
+ function l() {
5
+ const {
6
+ appCode: e
7
+ } = n(), [r] = a(), {
8
+ t
9
+ } = c();
10
+ return /* @__PURE__ */ s(o, { imageSrc: `${r}/emptyscreen/illu-search.svg`, imageAlt: t("explorer.emptyScreen.search.alt", {
11
+ ns: e
12
+ }), text: t("explorer.emptyScreen.search.text", {
13
+ ns: e
14
+ }) });
15
+ }
16
+ export {
17
+ l as default
18
+ };
@@ -0,0 +1,16 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { useOdeClient as a, usePaths as m, EmptyScreen as n } from "@edifice-ui/react";
3
+ import { useTranslation as o } from "react-i18next";
4
+ function c() {
5
+ const {
6
+ appCode: t
7
+ } = a(), [r] = m(), {
8
+ t: e
9
+ } = o();
10
+ return /* @__PURE__ */ s(n, { imageSrc: `${r}/emptyscreen/illu-trash.svg`, imageAlt: e("explorer.emptyScreen.trash.alt"), title: e("explorer.emptyScreen.trash.title"), text: e("explorer.emptyScreen.trash.empty", {
11
+ ns: t
12
+ }) });
13
+ }
14
+ export {
15
+ c as default
16
+ };
@@ -0,0 +1,119 @@
1
+ import { jsxs as b, jsx as a } from "react/jsx-runtime";
2
+ import { useId as B, useEffect as L } from "react";
3
+ import { Modal as m, FormControl as j, Label as w, Input as R, Button as I } from "@edifice-ui/react";
4
+ import { createPortal as T } from "react-dom";
5
+ import { useTranslation as U } from "react-i18next";
6
+ import { FOLDER as V } from "edifice-ts-client";
7
+ import { useForm as _ } from "react-hook-form";
8
+ import { h as k, b as z, o as A, p as H } from "./index2.js";
9
+ import "@edifice-ui/icons";
10
+ import "i18next";
11
+ import "zustand";
12
+ import "@tanstack/react-query";
13
+ function P({
14
+ edit: o,
15
+ onSuccess: e,
16
+ onClose: s
17
+ }) {
18
+ var x;
19
+ const l = k(), r = z(), c = A(), f = H(), u = o ? (x = l[0]) == null ? void 0 : x.name : void 0, {
20
+ reset: t,
21
+ register: p,
22
+ handleSubmit: n,
23
+ setFocus: h,
24
+ formState: {
25
+ errors: F,
26
+ isSubmitting: d,
27
+ isDirty: g,
28
+ isValid: v
29
+ }
30
+ } = _({
31
+ mode: "onChange",
32
+ values: {
33
+ name: u || ""
34
+ }
35
+ }), M = B(), D = async function({
36
+ name: y
37
+ }) {
38
+ var C;
39
+ try {
40
+ if (o) {
41
+ const i = (C = l[0]) == null ? void 0 : C.parentId, q = l[0].id;
42
+ await f.mutate({
43
+ folderId: q,
44
+ parentId: i,
45
+ name: y
46
+ }), t(), e == null || e();
47
+ } else {
48
+ const i = (r == null ? void 0 : r.id) || V.DEFAULT;
49
+ await c.mutate({
50
+ name: y,
51
+ parentId: i
52
+ }), t(), e == null || e();
53
+ }
54
+ } catch (i) {
55
+ console.error(i);
56
+ }
57
+ };
58
+ function E() {
59
+ t(), s();
60
+ }
61
+ return {
62
+ formId: `createModal_${M}`,
63
+ errors: F,
64
+ isSubmitting: d,
65
+ isDirty: g,
66
+ isValid: v,
67
+ register: p,
68
+ setFocus: h,
69
+ handleSubmit: n,
70
+ onCancel: E,
71
+ onSubmit: D
72
+ };
73
+ }
74
+ function oe({
75
+ isOpen: o,
76
+ edit: e,
77
+ onSuccess: s,
78
+ onCancel: l
79
+ }) {
80
+ const {
81
+ t: r
82
+ } = U(), {
83
+ isDirty: c,
84
+ isValid: f,
85
+ isSubmitting: u,
86
+ formId: t,
87
+ onSubmit: p,
88
+ onCancel: n,
89
+ handleSubmit: h,
90
+ register: F,
91
+ setFocus: d
92
+ } = P({
93
+ edit: e,
94
+ onSuccess: s,
95
+ onClose: l
96
+ });
97
+ return L(() => {
98
+ o && d("name");
99
+ }, [o, d]), o ? /* @__PURE__ */ T(/* @__PURE__ */ b(m, { isOpen: o, onModalClose: n, id: "modal_" + t, children: [
100
+ /* @__PURE__ */ a(m.Header, { onModalClose: n, children: r(e ? "explorer.rename.folder" : "explorer.create.folder") }),
101
+ /* @__PURE__ */ a(m.Body, { children: /* @__PURE__ */ a("form", { id: t, onSubmit: h(p), children: /* @__PURE__ */ b(j, { id: "nameFolder", isRequired: !0, children: [
102
+ /* @__PURE__ */ a(w, { children: r("explorer.create.folder.name") }),
103
+ /* @__PURE__ */ a(R, { type: "text", ...F("name", {
104
+ required: !0,
105
+ pattern: {
106
+ value: /[^ ]/,
107
+ message: "invalid title"
108
+ }
109
+ }), placeholder: r("explorer.create.folder.name"), size: "md", "aria-required": !0 })
110
+ ] }) }) }),
111
+ /* @__PURE__ */ b(m.Footer, { children: [
112
+ /* @__PURE__ */ a(I, { color: "tertiary", onClick: n, type: "button", variant: "ghost", children: r("explorer.cancel") }),
113
+ /* @__PURE__ */ a(I, { form: t, type: "submit", color: "primary", variant: "filled", disabled: !c || !f || u, children: r(e ? "explorer.rename" : "explorer.create") })
114
+ ] })
115
+ ] }), document.getElementById("portal")) : null;
116
+ }
117
+ export {
118
+ oe as default
119
+ };
@@ -0,0 +1,64 @@
1
+ import { jsx as i, jsxs as y } from "react/jsx-runtime";
2
+ import { Card as d, useOdeClient as C, useScrollToTop as T } from "@edifice-ui/react";
3
+ import { useSpring as I, animated as a } from "@react-spring/web";
4
+ import { Files as N } from "@edifice-ui/icons";
5
+ import { h as x, i as j, u as A } from "./index2.js";
6
+ import "react";
7
+ import "react-i18next";
8
+ import "edifice-ts-client";
9
+ import "i18next";
10
+ import "zustand";
11
+ import "@tanstack/react-query";
12
+ const g = ({
13
+ app: s,
14
+ name: n,
15
+ isSelected: l = !1,
16
+ isSelectable: o = !0,
17
+ onClick: t,
18
+ onSelect: c
19
+ }) => /* @__PURE__ */ i(d, { app: s, isSelectable: o, isSelected: l, onClick: t, onSelect: c, children: (p) => /* @__PURE__ */ y(d.Body, { children: [
20
+ /* @__PURE__ */ i(N, { width: "48", height: "48", className: `color-app-${p}` }),
21
+ /* @__PURE__ */ i(d.Title, { children: n })
22
+ ] }) });
23
+ g.displayName = "FolderCard";
24
+ const E = ({
25
+ data: s
26
+ }) => {
27
+ var m, u;
28
+ const {
29
+ currentApp: n
30
+ } = C(), l = x(), o = j(), {
31
+ setSelectedFolders: t,
32
+ setFolderIds: c,
33
+ openFolder: p
34
+ } = A();
35
+ function h(e) {
36
+ o.includes(e.id) ? (c(o.filter((r) => r !== e.id)), t(l.filter((r) => r.id !== e.id))) : (c([...o, e.id]), t([...l, e]));
37
+ }
38
+ const F = I({
39
+ from: {
40
+ opacity: 0
41
+ },
42
+ to: {
43
+ opacity: 1
44
+ }
45
+ }), f = T();
46
+ return (m = s == null ? void 0 : s.pages[0]) != null && m.folders.length ? /* @__PURE__ */ i(a.ul, { className: "grid ps-0 list-unstyled mb-24", children: (u = s == null ? void 0 : s.pages[0]) == null ? void 0 : u.folders.map((e) => {
47
+ const {
48
+ id: r,
49
+ name: S
50
+ } = e;
51
+ return /* @__PURE__ */ i(a.li, { className: "g-col-4 z-1", style: {
52
+ position: "relative",
53
+ ...F
54
+ }, children: /* @__PURE__ */ i(g, { name: S, app: n, isSelected: o.includes(e.id), onClick: () => {
55
+ f(), p({
56
+ folder: e,
57
+ folderId: e.id
58
+ });
59
+ }, onSelect: () => h(e) }) }, r);
60
+ }) }) : null;
61
+ };
62
+ export {
63
+ E as default
64
+ };