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.
- package/dist/index.html +1 -1
- package/dist/index.js +1388 -76626
- package/dist/version.txt +1 -1
- package/lib/ActionBarContainer.js +172 -166
- package/lib/AppAction.js +27 -25
- package/lib/DeleteModal.js +6 -4
- package/lib/DraggableCard.js +25 -0
- package/lib/EmptyScreenApp.js +26 -24
- package/lib/ExportModal.js +13 -11
- package/lib/FolderModal.js +6 -4
- package/lib/FoldersList.js +84 -44
- package/lib/Library.js +25 -27
- package/lib/MoveModal.js +71 -55
- package/lib/ResourcesList.js +96 -73
- package/lib/components/Explorer.d.ts +1 -1
- package/lib/config/dndkit.d.ts +2 -0
- package/lib/config/{getExplorerConfig.d.ts → explorer.d.ts} +5 -1
- package/lib/config/index.d.ts +2 -0
- package/lib/features/AccessControl/AccessControl.d.ts +1 -1
- package/lib/features/ActionBar/Move/useMoveModal.d.ts +3 -4
- package/lib/features/ActionBar/useActionBar.d.ts +1 -1
- package/lib/features/DndKit/useDndKit.d.ts +7 -0
- package/lib/features/List/DraggableCard.d.ts +6 -0
- package/lib/features/List/FolderCard.d.ts +6 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +7 -5
- package/lib/index2.js +1019 -950
- package/lib/providers/index.d.ts +6 -0
- package/lib/services/resource/service.d.ts +11 -0
- package/lib/store/index.d.ts +87 -33
- package/lib/utils/getChildrenIds.d.ts +2 -0
- package/package.json +7 -5
- package/lib/utils/TreeNodeFolderWrapper.d.ts +0 -12
- package/lib/utils/addNode.d.ts +0 -6
- package/lib/utils/deleteNode.d.ts +0 -4
- package/lib/utils/findNodeById.d.ts +0 -2
- package/lib/utils/getAncestors.d.ts +0 -2
- package/lib/utils/hasChildren.d.ts +0 -2
- package/lib/utils/modifyNode.d.ts +0 -2
- package/lib/utils/moveNode.d.ts +0 -5
- package/lib/utils/updateNode.d.ts +0 -6
- package/lib/utils/wrapTreeNode.d.ts +0 -3
package/lib/EmptyScreenApp.js
CHANGED
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import
|
|
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 "@
|
|
11
|
-
function
|
|
12
|
-
const {
|
|
12
|
+
import "@edifice-ui/icons";
|
|
13
|
+
function w() {
|
|
14
|
+
const [n] = m(), {
|
|
13
15
|
appCode: r
|
|
14
|
-
} =
|
|
16
|
+
} = u(), {
|
|
15
17
|
theme: e
|
|
16
|
-
} = d(),
|
|
17
|
-
t:
|
|
18
|
-
} =
|
|
19
|
-
data:
|
|
20
|
-
} =
|
|
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) ?
|
|
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) ?
|
|
26
|
+
}) : !(t != null && t.available) && (e != null && e.is1d) ? i("explorer.emptyScreen.txt1d.consultation", {
|
|
25
27
|
ns: r
|
|
26
|
-
}) :
|
|
28
|
+
}) : i("explorer.emptyScreen.txt2d.consultation", {
|
|
27
29
|
ns: r
|
|
28
|
-
}),
|
|
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) ?
|
|
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) ?
|
|
34
|
+
}) : !(t != null && t.available) && (e != null && e.is1d) ? i("explorer.emptyScreen.title1d.consultation", {
|
|
33
35
|
ns: r
|
|
34
|
-
}) :
|
|
36
|
+
}) : i("explorer.emptyScreen.title2d.consultation", {
|
|
35
37
|
ns: r
|
|
36
38
|
});
|
|
37
|
-
return /* @__PURE__ */ a(
|
|
39
|
+
return /* @__PURE__ */ a(x, { imageSrc: `${n}/emptyscreen/illu-${r}.svg`, imageAlt: i("explorer.emptyScreen.app.alt", {
|
|
38
40
|
ns: r
|
|
39
|
-
}), title:
|
|
41
|
+
}), title: c(), text: p() });
|
|
40
42
|
}
|
|
41
43
|
export {
|
|
42
|
-
|
|
44
|
+
w as default
|
|
43
45
|
};
|
package/lib/ExportModal.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useToast as
|
|
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
|
|
5
|
-
import { i as m,
|
|
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 "@
|
|
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 =
|
|
15
|
+
const t = m(), e = h(), s = c(), {
|
|
14
16
|
t: r
|
|
15
|
-
} =
|
|
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
|
|
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
|
-
} =
|
|
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(
|
|
47
|
-
/* @__PURE__ */ o(
|
|
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
|
-
|
|
54
|
+
v as default
|
|
53
55
|
};
|
package/lib/FolderModal.js
CHANGED
|
@@ -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,
|
|
9
|
-
import "@
|
|
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
|
|
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
|
-
|
|
121
|
+
ae as default
|
|
120
122
|
};
|
package/lib/FoldersList.js
CHANGED
|
@@ -1,64 +1,104 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Card as
|
|
3
|
-
import { useSpring as
|
|
4
|
-
import {
|
|
5
|
-
import { j, k as
|
|
6
|
-
import "react";
|
|
7
|
-
import "
|
|
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 "
|
|
12
|
-
const
|
|
13
|
-
app:
|
|
14
|
-
name:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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:
|
|
70
|
+
setFolderIds: a,
|
|
33
71
|
openFolder: p
|
|
34
|
-
} =
|
|
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
|
-
|
|
77
|
+
f(), p({
|
|
78
|
+
folder: e,
|
|
79
|
+
folderId: e.id,
|
|
80
|
+
queryClient: d
|
|
81
|
+
});
|
|
37
82
|
}
|
|
38
|
-
const
|
|
83
|
+
const y = w({
|
|
39
84
|
from: {
|
|
40
85
|
opacity: 0
|
|
41
86
|
},
|
|
42
87
|
to: {
|
|
43
88
|
opacity: 1
|
|
44
89
|
}
|
|
45
|
-
})
|
|
46
|
-
return (
|
|
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:
|
|
49
|
-
name:
|
|
50
|
-
} = e;
|
|
51
|
-
return /* @__PURE__ */
|
|
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
|
-
...
|
|
54
|
-
}, children: /* @__PURE__ */
|
|
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
|
-
|
|
103
|
+
oe as default
|
|
64
104
|
};
|
package/lib/Library.js
CHANGED
|
@@ -1,38 +1,36 @@
|
|
|
1
|
-
import { jsxs as t, jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
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
|
-
|
|
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:
|
|
14
|
-
imageFullURL:
|
|
11
|
+
libraryUrl: e,
|
|
12
|
+
imageFullURL: a,
|
|
15
13
|
handleClick: () => {
|
|
16
|
-
|
|
14
|
+
e && (window.open(e, "_blank"), d.data().trackAccessLibraryFromExplorer());
|
|
17
15
|
}
|
|
18
16
|
};
|
|
19
|
-
},
|
|
17
|
+
}, k = () => {
|
|
20
18
|
const {
|
|
21
|
-
libraryUrl:
|
|
22
|
-
imageFullURL:
|
|
23
|
-
handleClick:
|
|
24
|
-
} =
|
|
25
|
-
t:
|
|
26
|
-
} =
|
|
27
|
-
return
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */ t("button", { type: "button", onClick:
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
35
|
+
k as default
|
|
38
36
|
};
|
package/lib/MoveModal.js
CHANGED
|
@@ -1,78 +1,94 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Modal as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import "@
|
|
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
|
-
|
|
13
|
-
|
|
13
|
+
import "@edifice-ui/icons";
|
|
14
|
+
function U({
|
|
15
|
+
onSuccess: s
|
|
14
16
|
}) {
|
|
15
|
-
const [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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 (!
|
|
22
|
+
if (!a)
|
|
22
23
|
throw new Error("explorer.move.selection.empty");
|
|
23
|
-
await
|
|
24
|
-
} catch (
|
|
25
|
-
console.error(
|
|
24
|
+
await o.mutate(a), await (s == null ? void 0 : s());
|
|
25
|
+
} catch (r) {
|
|
26
|
+
console.error(r);
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
|
-
const
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
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
|
|
34
|
-
if (
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
treeData: d,
|
|
42
|
+
disableSubmit: !a,
|
|
43
|
+
handleTreeItemSelect: (r) => {
|
|
44
|
+
I(r) ? n(r) : n(void 0);
|
|
42
45
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
|
51
|
-
isOpen:
|
|
52
|
-
onSuccess:
|
|
53
|
-
onCancel:
|
|
59
|
+
function Y({
|
|
60
|
+
isOpen: s,
|
|
61
|
+
onSuccess: a,
|
|
62
|
+
onCancel: n
|
|
54
63
|
}) {
|
|
55
64
|
const {
|
|
56
|
-
|
|
57
|
-
} =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
93
|
+
Y as default
|
|
78
94
|
};
|