ode-explorer 1.4.18-develop-integration.202410021150 → 1.4.18-develop-pedago.202410071739

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 (42) hide show
  1. package/dist/index.html +1 -1
  2. package/dist/index.js +1388 -76626
  3. package/dist/version.txt +1 -1
  4. package/lib/ActionBarContainer.js +172 -166
  5. package/lib/AppAction.js +27 -25
  6. package/lib/DeleteModal.js +6 -4
  7. package/lib/DraggableCard.js +25 -0
  8. package/lib/EmptyScreenApp.js +26 -24
  9. package/lib/ExportModal.js +13 -11
  10. package/lib/FolderModal.js +6 -4
  11. package/lib/FoldersList.js +84 -44
  12. package/lib/Library.js +25 -27
  13. package/lib/MoveModal.js +71 -55
  14. package/lib/ResourcesList.js +96 -73
  15. package/lib/components/Explorer.d.ts +1 -1
  16. package/lib/config/dndkit.d.ts +2 -0
  17. package/lib/config/{getExplorerConfig.d.ts → explorer.d.ts} +5 -1
  18. package/lib/config/index.d.ts +2 -0
  19. package/lib/features/AccessControl/AccessControl.d.ts +1 -1
  20. package/lib/features/ActionBar/Move/useMoveModal.d.ts +3 -4
  21. package/lib/features/ActionBar/useActionBar.d.ts +1 -1
  22. package/lib/features/DndKit/useDndKit.d.ts +7 -0
  23. package/lib/features/List/DraggableCard.d.ts +6 -0
  24. package/lib/features/List/FolderCard.d.ts +6 -2
  25. package/lib/index.d.ts +1 -1
  26. package/lib/index.js +7 -5
  27. package/lib/index2.js +1019 -950
  28. package/lib/providers/index.d.ts +6 -0
  29. package/lib/services/resource/service.d.ts +11 -0
  30. package/lib/store/index.d.ts +87 -33
  31. package/lib/utils/getChildrenIds.d.ts +2 -0
  32. package/package.json +7 -5
  33. package/lib/utils/TreeNodeFolderWrapper.d.ts +0 -12
  34. package/lib/utils/addNode.d.ts +0 -6
  35. package/lib/utils/deleteNode.d.ts +0 -4
  36. package/lib/utils/findNodeById.d.ts +0 -2
  37. package/lib/utils/getAncestors.d.ts +0 -2
  38. package/lib/utils/hasChildren.d.ts +0 -2
  39. package/lib/utils/modifyNode.d.ts +0 -2
  40. package/lib/utils/moveNode.d.ts +0 -5
  41. package/lib/utils/updateNode.d.ts +0 -6
  42. package/lib/utils/wrapTreeNode.d.ts +0 -3
@@ -1,43 +1,45 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
- import { useOdeClient as c, useOdeTheme as d, usePaths as m, EmptyScreen as u } from "@edifice-ui/react";
3
- import { useTranslation as x } from "react-i18next";
4
- import { a as y } from "./index2.js";
5
- import "react";
6
- import "@edifice-ui/icons";
2
+ import { usePaths as m, useOdeClient as u, useOdeTheme as d, EmptyScreen as x } from "@edifice-ui/react";
3
+ import { useTranslation as S } from "react-i18next";
4
+ import "@tanstack/react-query";
7
5
  import "edifice-ts-client";
8
6
  import "i18next";
7
+ import { u as y, b as f } from "./index2.js";
8
+ import "react";
9
+ import "@dnd-kit/core";
10
+ import "@dnd-kit/modifiers";
9
11
  import "zustand";
10
- import "@tanstack/react-query";
11
- function $() {
12
- const {
12
+ import "@edifice-ui/icons";
13
+ function w() {
14
+ const [n] = m(), {
13
15
  appCode: r
14
- } = c(), {
16
+ } = u(), {
15
17
  theme: e
16
- } = d(), [s] = m(), {
17
- t: l
18
- } = x(), {
19
- data: i
20
- } = y(), t = i == null ? void 0 : i.find((o) => o.id === "create"), p = () => t != null && t.available && (e != null && e.is1d) ? l("explorer.emptyScreen.txt1d.create", {
18
+ } = d(), {
19
+ t: i
20
+ } = S(), o = y((l) => l.config), {
21
+ data: s
22
+ } = f(o == null ? void 0 : o.actions), t = s == null ? void 0 : s.find((l) => l.id === "create"), p = () => t != null && t.available && (e != null && e.is1d) ? i("explorer.emptyScreen.txt1d.create", {
21
23
  ns: r
22
- }) : t != null && t.available && !(e != null && e.is1d) ? l("explorer.emptyScreen.txt2d.create", {
24
+ }) : t != null && t.available && !(e != null && e.is1d) ? i("explorer.emptyScreen.txt2d.create", {
23
25
  ns: r
24
- }) : !(t != null && t.available) && (e != null && e.is1d) ? l("explorer.emptyScreen.txt1d.consultation", {
26
+ }) : !(t != null && t.available) && (e != null && e.is1d) ? i("explorer.emptyScreen.txt1d.consultation", {
25
27
  ns: r
26
- }) : l("explorer.emptyScreen.txt2d.consultation", {
28
+ }) : i("explorer.emptyScreen.txt2d.consultation", {
27
29
  ns: r
28
- }), n = () => t != null && t.available && (e != null && e.is1d) ? l("explorer.emptyScreen.title1d.create", {
30
+ }), c = () => t != null && t.available && (e != null && e.is1d) ? i("explorer.emptyScreen.title1d.create", {
29
31
  ns: r
30
- }) : t != null && t.available && !(e != null && e.is1d) ? l("explorer.emptyScreen.title2d.create", {
32
+ }) : t != null && t.available && !(e != null && e.is1d) ? i("explorer.emptyScreen.title2d.create", {
31
33
  ns: r
32
- }) : !(t != null && t.available) && (e != null && e.is1d) ? l("explorer.emptyScreen.title1d.consultation", {
34
+ }) : !(t != null && t.available) && (e != null && e.is1d) ? i("explorer.emptyScreen.title1d.consultation", {
33
35
  ns: r
34
- }) : l("explorer.emptyScreen.title2d.consultation", {
36
+ }) : i("explorer.emptyScreen.title2d.consultation", {
35
37
  ns: r
36
38
  });
37
- return /* @__PURE__ */ a(u, { imageSrc: `${s}/emptyscreen/illu-${r}.svg`, imageAlt: l("explorer.emptyScreen.app.alt", {
39
+ return /* @__PURE__ */ a(x, { imageSrc: `${n}/emptyscreen/illu-${r}.svg`, imageAlt: i("explorer.emptyScreen.app.alt", {
38
40
  ns: r
39
- }), title: n(), text: p() });
41
+ }), title: c(), text: p() });
40
42
  }
41
43
  export {
42
- $ as default
44
+ w as default
43
45
  };
@@ -1,18 +1,20 @@
1
1
  import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
- import { useToast as p, Modal as i, Alert as d, Button as a } from "@edifice-ui/react";
2
+ import { useToast as c, Modal as i, Alert as d, Button as p } from "@edifice-ui/react";
3
3
  import { createPortal as x } from "react-dom";
4
- import { useTranslation as c } from "react-i18next";
5
- import { i as m, d as h, y as u } from "./index2.js";
4
+ import { useTranslation as a } from "react-i18next";
5
+ import { i as m, e as h, A as u } from "./index2.js";
6
6
  import "react";
7
- import "@edifice-ui/icons";
7
+ import "@dnd-kit/core";
8
+ import "@dnd-kit/modifiers";
8
9
  import "edifice-ts-client";
9
10
  import "i18next";
10
11
  import "zustand";
11
12
  import "@tanstack/react-query";
13
+ import "@edifice-ui/icons";
12
14
  const f = (n) => {
13
- const t = m(), e = h(), s = p(), {
15
+ const t = m(), e = h(), s = c(), {
14
16
  t: r
15
- } = c();
17
+ } = a();
16
18
  return {
17
19
  handleExportClick: () => {
18
20
  t.length ? (u({
@@ -22,7 +24,7 @@ const f = (n) => {
22
24
  }
23
25
  };
24
26
  };
25
- function T({
27
+ function v({
26
28
  isOpen: n,
27
29
  onSuccess: t,
28
30
  onCancel: e
@@ -31,7 +33,7 @@ function T({
31
33
  handleExportClick: s
32
34
  } = f(t), {
33
35
  t: r
34
- } = c();
36
+ } = a();
35
37
  return /* @__PURE__ */ x(/* @__PURE__ */ l(i, { isOpen: n, onModalClose: e, id: "exportModal", children: [
36
38
  /* @__PURE__ */ o(i.Header, { onModalClose: e, children: r("explorer.export.title") }),
37
39
  /* @__PURE__ */ l(i.Body, { children: [
@@ -43,11 +45,11 @@ function T({
43
45
  /* @__PURE__ */ o(d, { type: "warning", children: r("explorer.export.body.warning") })
44
46
  ] }),
45
47
  /* @__PURE__ */ l(i.Footer, { children: [
46
- /* @__PURE__ */ o(a, { color: "tertiary", onClick: e, type: "button", variant: "ghost", children: r("explorer.cancel") }),
47
- /* @__PURE__ */ o(a, { color: "primary", onClick: s, type: "button", variant: "filled", children: r("explorer.actions.export") })
48
+ /* @__PURE__ */ o(p, { color: "tertiary", onClick: e, type: "button", variant: "ghost", children: r("explorer.cancel") }),
49
+ /* @__PURE__ */ o(p, { color: "primary", onClick: s, type: "button", variant: "filled", children: r("explorer.actions.export") })
48
50
  ] })
49
51
  ] }), document.getElementById("portal"));
50
52
  }
51
53
  export {
52
- T as default
54
+ v as default
53
55
  };
@@ -5,11 +5,13 @@ import { createPortal as T } from "react-dom";
5
5
  import { useTranslation as U } from "react-i18next";
6
6
  import { FOLDER as V } from "edifice-ts-client";
7
7
  import { useForm as _ } from "react-hook-form";
8
- import { j as k, b as z, r as A, s as H } from "./index2.js";
9
- import "@edifice-ui/icons";
8
+ import { j as k, c as z, t as A, v as H } from "./index2.js";
9
+ import "@dnd-kit/core";
10
+ import "@dnd-kit/modifiers";
10
11
  import "i18next";
11
12
  import "zustand";
12
13
  import "@tanstack/react-query";
14
+ import "@edifice-ui/icons";
13
15
  function P({
14
16
  edit: t,
15
17
  onSuccess: e,
@@ -71,7 +73,7 @@ function P({
71
73
  onSubmit: L
72
74
  };
73
75
  }
74
- function te({
76
+ function ae({
75
77
  isOpen: t,
76
78
  edit: e,
77
79
  onSuccess: s,
@@ -116,5 +118,5 @@ function te({
116
118
  ] }), document.getElementById("portal")) : null;
117
119
  }
118
120
  export {
119
- te as default
121
+ ae as default
120
122
  };
@@ -1,64 +1,104 @@
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 { j, k as x, u as k } from "./index2.js";
6
- import "react";
7
- import "react-i18next";
1
+ import { jsx as l, jsxs as x } from "react/jsx-runtime";
2
+ import { Card as h, useScrollToTop as N, useOdeClient as R } from "@edifice-ui/react";
3
+ import { useSpring as w, animated as S } from "@react-spring/web";
4
+ import { useQueryClient as $ } from "@tanstack/react-query";
5
+ import { o as v, s as j, j as k, k as z, a as A } from "./index2.js";
6
+ import { useState as E, useId as q, useEffect as B } from "react";
7
+ import { useDroppable as L, useDraggable as M } from "@dnd-kit/core";
8
+ import { Files as Q } from "@edifice-ui/icons";
9
+ import { D as G } from "./DraggableCard.js";
10
+ import "@dnd-kit/modifiers";
8
11
  import "edifice-ts-client";
9
12
  import "i18next";
10
13
  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
14
+ import "react-i18next";
15
+ const C = ({
16
+ app: r,
17
+ name: d,
18
+ idFolder: i,
19
+ isSelected: c = !1,
20
+ isSelectable: m = !0,
21
+ onClick: f,
22
+ onSelect: D
26
23
  }) => {
27
- var m, u;
28
- const {
29
- currentApp: n
30
- } = C(), l = j(), o = x(), {
24
+ const [t, a] = E(!1), p = q(), {
25
+ setNodeRef: b
26
+ } = L({
27
+ id: p,
28
+ data: {
29
+ id: i,
30
+ name: d,
31
+ isTreeview: !1,
32
+ accepts: ["folder", "resource"]
33
+ }
34
+ }), {
35
+ attributes: F,
36
+ listeners: y,
37
+ setNodeRef: u,
38
+ transform: o
39
+ } = M({
40
+ id: p,
41
+ data: {
42
+ id: i,
43
+ type: "folder"
44
+ }
45
+ }), e = v(), s = j(), I = (n) => {
46
+ u(n), b(n);
47
+ }, g = s.overId === i, O = !s.canMove && s.isTreeview ? "no-drop" : t ? "grabbing" : "default", T = {
48
+ transform: `translate3d(${((o == null ? void 0 : o.x) ?? 0) / 1}px, ${((o == null ? void 0 : o.y) ?? 0) / 1}px, 0)`,
49
+ cursor: O
50
+ };
51
+ return B(() => {
52
+ const n = e.elementDrag === i;
53
+ a(n);
54
+ }, [e]), /* @__PURE__ */ l("div", { ref: I, ...y, ...F, style: {
55
+ ...T
56
+ }, children: t ? /* @__PURE__ */ l(G, { name: d, app: r, type: "folder" }) : /* @__PURE__ */ l(h, { app: r, isSelectable: !t && m, isSelected: !t && c || g && t, isFocused: g, onClick: f, onSelect: D, children: (n) => /* @__PURE__ */ x(h.Body, { children: [
57
+ /* @__PURE__ */ l(Q, { width: "48", height: "48", className: `color-app-${n}` }),
58
+ /* @__PURE__ */ l(h.Title, { children: d })
59
+ ] }) }) });
60
+ };
61
+ C.displayName = "FolderCard";
62
+ const oe = ({
63
+ data: r
64
+ }) => {
65
+ var u, o;
66
+ const d = $(), i = k(), c = z(), m = v(), f = N(), {
67
+ currentApp: D
68
+ } = R(), {
31
69
  setSelectedFolders: t,
32
- setFolderIds: c,
70
+ setFolderIds: a,
33
71
  openFolder: p
34
- } = k();
72
+ } = A();
73
+ function b(e) {
74
+ c.includes(e.id) ? (a(c.filter((s) => s !== e.id)), t(i.filter((s) => s.id !== e.id))) : (a([e.id, ...c]), t([e, ...i]));
75
+ }
35
76
  function F(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]));
77
+ f(), p({
78
+ folder: e,
79
+ folderId: e.id,
80
+ queryClient: d
81
+ });
37
82
  }
38
- const h = I({
83
+ const y = w({
39
84
  from: {
40
85
  opacity: 0
41
86
  },
42
87
  to: {
43
88
  opacity: 1
44
89
  }
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) => {
90
+ });
91
+ return (u = r == null ? void 0 : r.pages[0]) != null && u.folders.length ? /* @__PURE__ */ l(S.ul, { className: "grid ps-0 list-unstyled mb-24", children: (o = r == null ? void 0 : r.pages[0]) == null ? void 0 : o.folders.map((e) => {
47
92
  const {
48
- id: r,
49
- name: S
50
- } = e;
51
- return /* @__PURE__ */ i(a.li, { className: "g-col-4 z-1", style: {
93
+ id: s,
94
+ name: I
95
+ } = e, g = m.elementDrag === s;
96
+ return /* @__PURE__ */ l(S.li, { className: `g-col-4 ${g ? "z-2000" : "z-1"}`, style: {
52
97
  position: "relative",
53
- ...h
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: () => F(e) }) }, r);
98
+ ...y
99
+ }, children: /* @__PURE__ */ l(C, { name: I, idFolder: s, app: D, isSelected: c.includes(e.id), onClick: () => F(e), onSelect: () => b(e) }) }, s);
60
100
  }) }) : null;
61
101
  };
62
102
  export {
63
- E as default
103
+ oe as default
64
104
  };
package/lib/Library.js CHANGED
@@ -1,38 +1,36 @@
1
- import { jsxs as t, jsx as a } from "react/jsx-runtime";
2
- import { useOdeClient as s, useOdeTheme as c, usePaths as m, useLibraryUrl as d, Image as p } from "@edifice-ui/react";
3
- import { odeServices as b } from "edifice-ts-client";
4
- import { ArrowRight as g } from "@edifice-ui/icons";
5
- import { useTranslation as u } from "react-i18next";
6
- const y = () => {
1
+ import { jsxs as t, jsx as i } from "react/jsx-runtime";
2
+ import { ArrowRight as o } from "@edifice-ui/icons";
3
+ import { useOdeTheme as n, usePaths as s, useLibraryUrl as c, Image as m } from "@edifice-ui/react";
4
+ import { useTranslation as p } from "react-i18next";
5
+ import { odeServices as d } from "edifice-ts-client";
6
+ const b = () => {
7
7
  const {
8
- currentLanguage: i
9
- } = s(), {
10
- theme: e
11
- } = c(), [l] = m(), r = d(), n = i === "fr" ? "image-library-year-end.gif" : "image-library.svg", o = `${l}/${e == null ? void 0 : e.bootstrapVersion}/${n}`;
8
+ theme: r
9
+ } = n(), [l] = s(), e = c(), a = `${l}/${r == null ? void 0 : r.bootstrapVersion}/image-library.svg`;
12
10
  return {
13
- libraryUrl: r,
14
- imageFullURL: o,
11
+ libraryUrl: e,
12
+ imageFullURL: a,
15
13
  handleClick: () => {
16
- r && (window.open(r, "_blank"), b.data().trackAccessLibraryFromExplorer());
14
+ e && (window.open(e, "_blank"), d.data().trackAccessLibraryFromExplorer());
17
15
  }
18
16
  };
19
- }, U = () => {
17
+ }, k = () => {
20
18
  const {
21
- libraryUrl: i,
22
- imageFullURL: e,
23
- handleClick: l
24
- } = y(), {
25
- t: r
26
- } = u();
27
- return i && /* @__PURE__ */ t("div", { className: "p-16", children: [
28
- /* @__PURE__ */ a(p, { width: "270", height: "140", loading: "lazy", className: "rounded", src: e, alt: r("explorer.libray.img.alt") }),
29
- /* @__PURE__ */ a("p", { className: "m-8", children: r("explorer.libray.title") }),
30
- /* @__PURE__ */ t("button", { type: "button", onClick: l, rel: "noreferrer", className: "btn btn-ghost-primary d-inline-flex align-items-center gap-4 p-8", children: [
31
- /* @__PURE__ */ a("span", { children: r("explorer.libray.btn") }),
32
- /* @__PURE__ */ a(g, {})
19
+ libraryUrl: r,
20
+ imageFullURL: l,
21
+ handleClick: e
22
+ } = b(), {
23
+ t: a
24
+ } = p();
25
+ return r && /* @__PURE__ */ t("div", { className: "p-16", children: [
26
+ /* @__PURE__ */ i(m, { width: "270", height: "140", loading: "lazy", className: "rounded", src: l, alt: a("explorer.libray.img.alt") }),
27
+ /* @__PURE__ */ i("p", { className: "m-8", children: a("explorer.libray.title") }),
28
+ /* @__PURE__ */ t("button", { type: "button", onClick: e, rel: "noreferrer", className: "btn btn-ghost-primary d-inline-flex align-items-center gap-4 p-8", children: [
29
+ /* @__PURE__ */ i("span", { children: a("explorer.libray.btn") }),
30
+ /* @__PURE__ */ i(o, {})
33
31
  ] })
34
32
  ] });
35
33
  };
36
34
  export {
37
- U as default
35
+ k as default
38
36
  };
package/lib/MoveModal.js CHANGED
@@ -1,78 +1,94 @@
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 x } from "@tanstack/react-query";
7
- import { w as F, j as w, i as S, u as g, x as j } from "./index2.js";
8
- import "@edifice-ui/icons";
1
+ import { jsxs as T, jsx as i } from "react/jsx-runtime";
2
+ import { findNodeById as x, getAncestors as C, useOdeClient as S, Modal as c, TreeView as F, Button as b } from "@edifice-ui/react";
3
+ import { createPortal as g } from "react-dom";
4
+ import { useTranslation as w } from "react-i18next";
5
+ import { useQueryClient as A } from "@tanstack/react-query";
6
+ import { useState as B } from "react";
7
+ import { y as D, j, i as k, z as E, a as O } from "./index2.js";
8
+ import "@dnd-kit/core";
9
+ import "@dnd-kit/modifiers";
9
10
  import "edifice-ts-client";
10
11
  import "i18next";
11
12
  import "zustand";
12
- function B({
13
- onSuccess: n
13
+ import "@edifice-ui/icons";
14
+ function U({
15
+ onSuccess: s
14
16
  }) {
15
- const [d, t] = b(), r = F(), i = w(), m = S(), {
16
- foldTreeItem: s,
17
- unfoldTreeItem: c
18
- } = g(), f = x();
19
- async function u() {
17
+ const [a, n] = B(), u = A(), o = D(), p = j(), h = k(), d = E(), {
18
+ fetchTreeData: v
19
+ } = O();
20
+ async function y() {
20
21
  try {
21
- if (!d)
22
+ if (!a)
22
23
  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);
24
+ await o.mutate(a), await (s == null ? void 0 : s());
25
+ } catch (r) {
26
+ console.error(r);
26
27
  }
27
28
  }
28
- const v = (e) => {
29
- var p;
30
- for (const o of i)
31
- if (e === o.id || e === o.parentId)
29
+ const I = (r) => {
30
+ var f, m;
31
+ const t = C(d, r);
32
+ for (const e of p)
33
+ if (r === e.id || r === e.parentId || (f = e.childrenIds) != null && f.includes(r) || t.includes(e.id))
32
34
  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
+ for (const e of h)
36
+ if (r === ((e == null ? void 0 : e.folderIds) && e.folderIds[0]) || ((m = e == null ? void 0 : e.folderIds) == null ? void 0 : m.length) === 0 && r === "default")
35
37
  return !1;
36
38
  return !0;
37
39
  };
38
40
  return {
39
- disableSubmit: !d,
40
- handleTreeItemSelect: (e) => {
41
- v(e) ? t(e) : t(void 0);
41
+ treeData: d,
42
+ disableSubmit: !a,
43
+ handleTreeItemSelect: (r) => {
44
+ I(r) ? n(r) : n(void 0);
42
45
  },
43
- handleTreeItemFold: s,
44
- handleTreeItemUnfold: async (e) => await c(e, f),
45
- onMove: () => {
46
- u();
47
- }
46
+ handleOnTreeItemUnfold: (r) => {
47
+ var m, e;
48
+ const t = x(d, r), f = (m = t == null ? void 0 : t.children) == null ? void 0 : m.some((l) => {
49
+ var M;
50
+ return Array.isArray(l == null ? void 0 : l.children) && ((M = l.children) == null ? void 0 : M.length) > 0;
51
+ });
52
+ (e = t == null ? void 0 : t.children) == null || e.forEach((l) => {
53
+ f || v(l.id, u);
54
+ });
55
+ },
56
+ onMove: () => y()
48
57
  };
49
58
  }
50
- function z({
51
- isOpen: n,
52
- onSuccess: d,
53
- onCancel: t
59
+ function Y({
60
+ isOpen: s,
61
+ onSuccess: a,
62
+ onCancel: n
54
63
  }) {
55
64
  const {
56
- t: r
57
- } = y(), {
58
- handleTreeItemFold: i,
59
- handleTreeItemSelect: m,
60
- handleTreeItemUnfold: s,
61
- onMove: c,
62
- disableSubmit: f
63
- } = B({
64
- onSuccess: d
65
- }), u = j();
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") })
65
+ appCode: u
66
+ } = S(), {
67
+ t: o
68
+ } = w(), {
69
+ treeData: p,
70
+ handleTreeItemSelect: h,
71
+ handleOnTreeItemUnfold: d,
72
+ onMove: v,
73
+ disableSubmit: y
74
+ } = U({
75
+ onSuccess: a
76
+ }), I = {
77
+ ...p,
78
+ name: o("explorer.filters.mine", {
79
+ ns: u
80
+ })
81
+ };
82
+ return /* @__PURE__ */ g(/* @__PURE__ */ T(c, { isOpen: s, onModalClose: n, id: "moveModal", children: [
83
+ /* @__PURE__ */ i(c.Header, { onModalClose: n, children: o("explorer.move.title") }),
84
+ /* @__PURE__ */ i(c.Subtitle, { children: o("explorer.move.subtitle") }),
85
+ /* @__PURE__ */ i(c.Body, { children: /* @__PURE__ */ i(F, { data: I, onTreeItemClick: h, onTreeItemUnfold: d }) }),
86
+ /* @__PURE__ */ T(c.Footer, { children: [
87
+ /* @__PURE__ */ i(b, { color: "tertiary", onClick: n, type: "button", variant: "ghost", children: o("explorer.cancel") }),
88
+ /* @__PURE__ */ i(b, { color: "primary", onClick: v, type: "button", variant: "filled", disabled: y, children: o("explorer.move") })
73
89
  ] })
74
90
  ] }), document.getElementById("portal"));
75
91
  }
76
92
  export {
77
- z as default
93
+ Y as default
78
94
  };