ode-explorer 1.4.19 → 1.5.0
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 +48 -48
- package/dist/index.js +1387 -76631
- package/dist/version.txt +1 -1
- package/explorer.d.ts +1 -1
- package/lib/ActionBarContainer.js +175 -175
- package/lib/AppAction.js +26 -30
- package/lib/DeleteModal.js +8 -14
- package/lib/DraggableCard.js +25 -0
- package/lib/EmptyScreenApp.js +22 -25
- package/lib/ExportModal.js +24 -30
- package/lib/FolderModal.js +14 -18
- package/lib/FoldersList.js +88 -48
- package/lib/Library.js +25 -27
- package/lib/MoveModal.js +65 -56
- package/lib/ResourcesList.js +101 -81
- package/lib/components/EmptyScreens/EmptyScreenApp.d.ts +0 -1
- package/lib/components/EmptyScreens/EmptyScreenError.d.ts +0 -1
- package/lib/components/EmptyScreens/EmptyScreenNoContentInFolder.d.ts +0 -1
- package/lib/components/EmptyScreens/EmptyScreenSearch.d.ts +0 -1
- package/lib/components/Explorer.d.ts +1 -1
- package/lib/components/LoadMore.d.ts +1 -2
- package/lib/components/OnboardingModal.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 +2 -2
- package/lib/features/AccessControl/useAccessControl.d.ts +1 -1
- package/lib/features/ActionBar/Delete/DeleteModal.d.ts +1 -2
- package/lib/features/ActionBar/Disable/DisableModal.d.ts +1 -2
- package/lib/features/ActionBar/Export/ExportModal.d.ts +1 -2
- package/lib/features/ActionBar/Folder/FolderModal.d.ts +1 -2
- package/lib/features/ActionBar/Folder/useFolderModal.d.ts +5 -5
- package/lib/features/ActionBar/Move/MoveModal.d.ts +1 -2
- package/lib/features/ActionBar/Move/useMoveModal.d.ts +3 -4
- package/lib/features/ActionBar/Publish/PublishModal.d.ts +1 -1
- package/lib/features/ActionBar/Resource/ResourceModal.d.ts +1 -1
- package/lib/features/ActionBar/Share/ShareModal.d.ts +1 -1
- package/lib/features/ActionBar/Trash/TrashModal.d.ts +1 -2
- package/lib/features/ActionBar/useActionBar.d.ts +2 -2
- 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 +8 -4
- package/lib/features/List/FoldersList.d.ts +2 -2
- package/lib/features/List/ResourceCard.d.ts +3 -3
- package/lib/features/List/ResourcesList.d.ts +2 -2
- package/lib/features/SearchForm/useSearchForm.d.ts +1 -2
- package/lib/i18n.d.ts +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +3 -12
- package/lib/index2.js +1017 -952
- package/lib/providers/index.d.ts +6 -0
- package/lib/services/api/index.d.ts +16 -16
- package/lib/services/queries/actions.d.ts +18 -0
- package/lib/services/queries/index.d.ts +46 -0
- package/lib/services/resource/service.d.ts +11 -0
- package/lib/store/index.d.ts +89 -35
- package/lib/utils/getChildrenIds.d.ts +2 -0
- package/lib/utils/isResourceShared.d.ts +1 -1
- package/package.json +52 -53
- 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,40 @@
|
|
|
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 u, useOdeClient as d, useOdeTheme as m, 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";
|
|
9
|
-
import "
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const {
|
|
7
|
+
import { u as y, b as f } from "./index2.js";
|
|
8
|
+
function P() {
|
|
9
|
+
const [o] = u(), {
|
|
13
10
|
appCode: r
|
|
14
|
-
} =
|
|
11
|
+
} = d(), {
|
|
15
12
|
theme: e
|
|
16
|
-
} =
|
|
17
|
-
t:
|
|
18
|
-
} =
|
|
19
|
-
data:
|
|
20
|
-
} =
|
|
13
|
+
} = m(), {
|
|
14
|
+
t: s
|
|
15
|
+
} = S(), l = y((i) => i.config), {
|
|
16
|
+
data: n
|
|
17
|
+
} = f(l == null ? void 0 : l.actions), t = n == null ? void 0 : n.find((i) => i.id === "create"), p = () => t != null && t.available && (e != null && e.is1d) ? s("explorer.emptyScreen.txt1d.create", {
|
|
21
18
|
ns: r
|
|
22
|
-
}) : t != null && t.available && !(e != null && e.is1d) ?
|
|
19
|
+
}) : t != null && t.available && !(e != null && e.is1d) ? s("explorer.emptyScreen.txt2d.create", {
|
|
23
20
|
ns: r
|
|
24
|
-
}) : !(t != null && t.available) && (e != null && e.is1d) ?
|
|
21
|
+
}) : !(t != null && t.available) && (e != null && e.is1d) ? s("explorer.emptyScreen.txt1d.consultation", {
|
|
25
22
|
ns: r
|
|
26
|
-
}) :
|
|
23
|
+
}) : s("explorer.emptyScreen.txt2d.consultation", {
|
|
27
24
|
ns: r
|
|
28
|
-
}),
|
|
25
|
+
}), c = () => t != null && t.available && (e != null && e.is1d) ? s("explorer.emptyScreen.title1d.create", {
|
|
29
26
|
ns: r
|
|
30
|
-
}) : t != null && t.available && !(e != null && e.is1d) ?
|
|
27
|
+
}) : t != null && t.available && !(e != null && e.is1d) ? s("explorer.emptyScreen.title2d.create", {
|
|
31
28
|
ns: r
|
|
32
|
-
}) : !(t != null && t.available) && (e != null && e.is1d) ?
|
|
29
|
+
}) : !(t != null && t.available) && (e != null && e.is1d) ? s("explorer.emptyScreen.title1d.consultation", {
|
|
33
30
|
ns: r
|
|
34
|
-
}) :
|
|
31
|
+
}) : s("explorer.emptyScreen.title2d.consultation", {
|
|
35
32
|
ns: r
|
|
36
33
|
});
|
|
37
|
-
return /* @__PURE__ */ a(
|
|
34
|
+
return /* @__PURE__ */ a(x, { imageSrc: `${o}/emptyscreen/illu-${r}.svg`, imageAlt: s("explorer.emptyScreen.app.alt", {
|
|
38
35
|
ns: r
|
|
39
|
-
}), title:
|
|
36
|
+
}), title: c(), text: p() });
|
|
40
37
|
}
|
|
41
38
|
export {
|
|
42
|
-
|
|
39
|
+
P as default
|
|
43
40
|
};
|
package/lib/ExportModal.js
CHANGED
|
@@ -1,53 +1,47 @@
|
|
|
1
|
-
import { jsxs as l, jsx as
|
|
2
|
-
import { useToast as
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useToast as d, Modal as n, Alert as p, Button as a } from "@edifice-ui/react";
|
|
3
3
|
import { createPortal as x } from "react-dom";
|
|
4
4
|
import { useTranslation as c } from "react-i18next";
|
|
5
|
-
import { i as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import "i18next";
|
|
10
|
-
import "zustand";
|
|
11
|
-
import "@tanstack/react-query";
|
|
12
|
-
const f = (n) => {
|
|
13
|
-
const t = m(), e = h(), s = p(), {
|
|
14
|
-
t: r
|
|
5
|
+
import { i as h, e as u, A as m } from "./index2.js";
|
|
6
|
+
const f = (i) => {
|
|
7
|
+
const t = h(), o = u(), s = d(), {
|
|
8
|
+
t: e
|
|
15
9
|
} = c();
|
|
16
10
|
return {
|
|
17
11
|
handleExportClick: () => {
|
|
18
|
-
t.length ? (
|
|
19
|
-
searchParams:
|
|
12
|
+
t.length ? (m({
|
|
13
|
+
searchParams: o,
|
|
20
14
|
assetId: t[0].assetId
|
|
21
|
-
}),
|
|
15
|
+
}), i()) : s.error(e("explorer.error.noResourceSelected"));
|
|
22
16
|
}
|
|
23
17
|
};
|
|
24
18
|
};
|
|
25
|
-
function
|
|
26
|
-
isOpen:
|
|
19
|
+
function C({
|
|
20
|
+
isOpen: i,
|
|
27
21
|
onSuccess: t,
|
|
28
|
-
onCancel:
|
|
22
|
+
onCancel: o
|
|
29
23
|
}) {
|
|
30
24
|
const {
|
|
31
25
|
handleExportClick: s
|
|
32
26
|
} = f(t), {
|
|
33
|
-
t:
|
|
27
|
+
t: e
|
|
34
28
|
} = c();
|
|
35
|
-
return /* @__PURE__ */ x(/* @__PURE__ */ l(
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */ l(
|
|
29
|
+
return /* @__PURE__ */ x(/* @__PURE__ */ l(n, { isOpen: i, onModalClose: o, id: "exportModal", children: [
|
|
30
|
+
/* @__PURE__ */ r(n.Header, { onModalClose: o, children: e("explorer.export.title") }),
|
|
31
|
+
/* @__PURE__ */ l(n.Body, { children: [
|
|
38
32
|
/* @__PURE__ */ l("ul", { children: [
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ r("li", { children: e("explorer.export.body.info.1") }),
|
|
34
|
+
/* @__PURE__ */ r("li", { children: e("explorer.export.body.info.2") }),
|
|
35
|
+
/* @__PURE__ */ r("li", { children: e("explorer.export.body.info.3") })
|
|
42
36
|
] }),
|
|
43
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ r(p, { type: "warning", children: e("explorer.export.body.warning") })
|
|
44
38
|
] }),
|
|
45
|
-
/* @__PURE__ */ l(
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ l(n.Footer, { children: [
|
|
40
|
+
/* @__PURE__ */ r(a, { color: "tertiary", onClick: o, type: "button", variant: "ghost", children: e("explorer.cancel") }),
|
|
41
|
+
/* @__PURE__ */ r(a, { color: "primary", onClick: s, type: "button", variant: "filled", children: e("explorer.actions.export") })
|
|
48
42
|
] })
|
|
49
43
|
] }), document.getElementById("portal"));
|
|
50
44
|
}
|
|
51
45
|
export {
|
|
52
|
-
|
|
46
|
+
C as default
|
|
53
47
|
};
|
package/lib/FolderModal.js
CHANGED
|
@@ -5,11 +5,7 @@ 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 "@edifice-ui/icons";
|
|
10
|
-
import "i18next";
|
|
11
|
-
import "zustand";
|
|
12
|
-
import "@tanstack/react-query";
|
|
8
|
+
import { j as k, c as z, t as A, v as H } from "./index2.js";
|
|
13
9
|
function P({
|
|
14
10
|
edit: t,
|
|
15
11
|
onSuccess: e,
|
|
@@ -23,7 +19,7 @@ function P({
|
|
|
23
19
|
setFocus: h,
|
|
24
20
|
formState: {
|
|
25
21
|
errors: F,
|
|
26
|
-
isSubmitting:
|
|
22
|
+
isSubmitting: i,
|
|
27
23
|
isDirty: I,
|
|
28
24
|
isValid: v
|
|
29
25
|
}
|
|
@@ -38,21 +34,21 @@ function P({
|
|
|
38
34
|
var g;
|
|
39
35
|
try {
|
|
40
36
|
if (t) {
|
|
41
|
-
const
|
|
37
|
+
const d = (g = l[0]) == null ? void 0 : g.parentId, E = l[0].id;
|
|
42
38
|
await f.mutate({
|
|
43
39
|
folderId: E,
|
|
44
|
-
parentId:
|
|
40
|
+
parentId: d,
|
|
45
41
|
name: y
|
|
46
42
|
}), o(), e == null || e();
|
|
47
43
|
} else {
|
|
48
|
-
const
|
|
44
|
+
const d = (r == null ? void 0 : r.id) || V.DEFAULT;
|
|
49
45
|
await c.mutate({
|
|
50
46
|
name: y,
|
|
51
|
-
parentId:
|
|
47
|
+
parentId: d
|
|
52
48
|
}), o(), e == null || e();
|
|
53
49
|
}
|
|
54
|
-
} catch (
|
|
55
|
-
console.error(
|
|
50
|
+
} catch (d) {
|
|
51
|
+
console.error(d);
|
|
56
52
|
}
|
|
57
53
|
};
|
|
58
54
|
function D() {
|
|
@@ -61,7 +57,7 @@ function P({
|
|
|
61
57
|
return {
|
|
62
58
|
formId: `createModal_${M}`,
|
|
63
59
|
errors: F,
|
|
64
|
-
isSubmitting:
|
|
60
|
+
isSubmitting: i,
|
|
65
61
|
isDirty: I,
|
|
66
62
|
isValid: v,
|
|
67
63
|
register: p,
|
|
@@ -71,7 +67,7 @@ function P({
|
|
|
71
67
|
onSubmit: L
|
|
72
68
|
};
|
|
73
69
|
}
|
|
74
|
-
function
|
|
70
|
+
function Z({
|
|
75
71
|
isOpen: t,
|
|
76
72
|
edit: e,
|
|
77
73
|
onSuccess: s,
|
|
@@ -88,15 +84,15 @@ function te({
|
|
|
88
84
|
onCancel: n,
|
|
89
85
|
handleSubmit: h,
|
|
90
86
|
register: F,
|
|
91
|
-
setFocus:
|
|
87
|
+
setFocus: i
|
|
92
88
|
} = P({
|
|
93
89
|
edit: e,
|
|
94
90
|
onSuccess: s,
|
|
95
91
|
onClose: l
|
|
96
92
|
});
|
|
97
93
|
return q(() => {
|
|
98
|
-
t &&
|
|
99
|
-
}, [t,
|
|
94
|
+
t && i("name");
|
|
95
|
+
}, [t, i]), t ? /* @__PURE__ */ T(/* @__PURE__ */ x(m, { isOpen: t, onModalClose: n, id: "modal_" + o, children: [
|
|
100
96
|
/* @__PURE__ */ a(m.Header, { onModalClose: n, children: r(e ? "explorer.rename.folder" : "explorer.create.folder") }),
|
|
101
97
|
/* @__PURE__ */ a(m.Body, { children: /* @__PURE__ */ a("form", { id: o, onSubmit: h(p), children: /* @__PURE__ */ x(B, { id: "nameFolder", isRequired: !0, children: [
|
|
102
98
|
/* @__PURE__ */ a(w, { children: r("explorer.create.folder.name") }),
|
|
@@ -116,5 +112,5 @@ function te({
|
|
|
116
112
|
] }), document.getElementById("portal")) : null;
|
|
117
113
|
}
|
|
118
114
|
export {
|
|
119
|
-
|
|
115
|
+
Z as default
|
|
120
116
|
};
|
package/lib/FoldersList.js
CHANGED
|
@@ -1,64 +1,104 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import { useSpring as
|
|
4
|
-
import {
|
|
5
|
-
import { j, k as
|
|
6
|
-
import "react";
|
|
7
|
-
import "
|
|
8
|
-
import "edifice-
|
|
9
|
-
import "
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
1
|
+
import { jsx as t, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import { useBreakpoint as R, Card as S, useScrollToTop as k, useOdeClient as w } from "@edifice-ui/react";
|
|
3
|
+
import { useSpring as $, animated as v } from "@react-spring/web";
|
|
4
|
+
import { useQueryClient as j } from "@tanstack/react-query";
|
|
5
|
+
import { o as C, s as z, j as A, k as B, a as E } from "./index2.js";
|
|
6
|
+
import { useState as q, useId as L, useEffect as M } from "react";
|
|
7
|
+
import { useDroppable as P, useDraggable as Q } from "@dnd-kit/core";
|
|
8
|
+
import { Files as G } from "@edifice-ui/icons";
|
|
9
|
+
import { D as H } from "./DraggableCard.js";
|
|
10
|
+
const O = ({
|
|
11
|
+
app: r,
|
|
12
|
+
name: c,
|
|
13
|
+
idFolder: l,
|
|
14
|
+
isSelected: i = !1,
|
|
15
|
+
isSelectable: m = !0,
|
|
16
|
+
onClick: D,
|
|
17
|
+
onSelect: b
|
|
26
18
|
}) => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
const [o, a] = q(!1), p = L(), {
|
|
20
|
+
lg: F
|
|
21
|
+
} = R(), {
|
|
22
|
+
setNodeRef: y
|
|
23
|
+
} = P({
|
|
24
|
+
id: p,
|
|
25
|
+
data: {
|
|
26
|
+
id: l,
|
|
27
|
+
name: c,
|
|
28
|
+
isTreeview: !1,
|
|
29
|
+
accepts: ["folder", "resource"]
|
|
30
|
+
}
|
|
31
|
+
}), {
|
|
32
|
+
attributes: I,
|
|
33
|
+
listeners: u,
|
|
34
|
+
setNodeRef: g,
|
|
35
|
+
transform: e
|
|
36
|
+
} = Q({
|
|
37
|
+
id: p,
|
|
38
|
+
data: {
|
|
39
|
+
id: l,
|
|
40
|
+
type: "folder"
|
|
41
|
+
},
|
|
42
|
+
disabled: !F
|
|
43
|
+
}), s = C(), d = z(), h = (n) => {
|
|
44
|
+
g(n), y(n);
|
|
45
|
+
}, f = d.overId === l, T = !d.canMove && d.isTreeview ? "no-drop" : o ? "grabbing" : "default", x = {
|
|
46
|
+
transform: `translate3d(${((e == null ? void 0 : e.x) ?? 0) / 1}px, ${((e == null ? void 0 : e.y) ?? 0) / 1}px, 0)`,
|
|
47
|
+
cursor: T
|
|
48
|
+
};
|
|
49
|
+
return M(() => {
|
|
50
|
+
const n = s.elementDrag === l;
|
|
51
|
+
a(n);
|
|
52
|
+
}, [s]), /* @__PURE__ */ t("div", { ref: h, ...u, ...I, style: {
|
|
53
|
+
...x
|
|
54
|
+
}, children: o ? /* @__PURE__ */ t(H, { name: c, app: r, type: "folder" }) : /* @__PURE__ */ t(S, { app: r, isSelectable: !o && m, isSelected: !o && i || f && o, isFocused: f, onClick: D, onSelect: b, children: (n) => /* @__PURE__ */ N(S.Body, { children: [
|
|
55
|
+
/* @__PURE__ */ t(G, { width: "48", height: "48", className: `color-app-${n}` }),
|
|
56
|
+
/* @__PURE__ */ t(S.Title, { children: c })
|
|
57
|
+
] }) }) });
|
|
58
|
+
};
|
|
59
|
+
O.displayName = "FolderCard";
|
|
60
|
+
const ee = ({
|
|
61
|
+
data: r
|
|
62
|
+
}) => {
|
|
63
|
+
var u, g;
|
|
64
|
+
const c = j(), l = A(), i = B(), m = C(), D = k(), {
|
|
65
|
+
currentApp: b
|
|
66
|
+
} = w(), {
|
|
67
|
+
setSelectedFolders: o,
|
|
68
|
+
setFolderIds: a,
|
|
33
69
|
openFolder: p
|
|
34
|
-
} =
|
|
70
|
+
} = E();
|
|
35
71
|
function F(e) {
|
|
36
|
-
|
|
72
|
+
i.includes(e.id) ? (a(i.filter((s) => s !== e.id)), o(l.filter((s) => s.id !== e.id))) : (a([e.id, ...i]), o([e, ...l]));
|
|
73
|
+
}
|
|
74
|
+
function y(e) {
|
|
75
|
+
D(), p({
|
|
76
|
+
folder: e,
|
|
77
|
+
folderId: e.id,
|
|
78
|
+
queryClient: c
|
|
79
|
+
});
|
|
37
80
|
}
|
|
38
|
-
const
|
|
81
|
+
const I = $({
|
|
39
82
|
from: {
|
|
40
83
|
opacity: 0
|
|
41
84
|
},
|
|
42
85
|
to: {
|
|
43
86
|
opacity: 1
|
|
44
87
|
}
|
|
45
|
-
})
|
|
46
|
-
return (
|
|
88
|
+
});
|
|
89
|
+
return (u = r == null ? void 0 : r.pages[0]) != null && u.folders.length ? /* @__PURE__ */ t(v.ul, { className: "grid ps-0 list-unstyled mb-24", children: (g = r == null ? void 0 : r.pages[0]) == null ? void 0 : g.folders.map((e) => {
|
|
47
90
|
const {
|
|
48
|
-
id:
|
|
49
|
-
name:
|
|
50
|
-
} = e;
|
|
51
|
-
return /* @__PURE__ */
|
|
91
|
+
id: s,
|
|
92
|
+
name: d
|
|
93
|
+
} = e, h = m.elementDrag === s;
|
|
94
|
+
return /* @__PURE__ */ t(v.li, { className: `g-col-4 ${h ? "z-2000" : "z-1"}`, style: {
|
|
52
95
|
position: "relative",
|
|
53
|
-
...
|
|
54
|
-
}, children: /* @__PURE__ */
|
|
55
|
-
f(),
|
|
56
|
-
|
|
57
|
-
folderId: e.id
|
|
58
|
-
});
|
|
59
|
-
}, onSelect: () => F(e) }) }, r);
|
|
96
|
+
...I
|
|
97
|
+
}, children: /* @__PURE__ */ t(O, { name: d, idFolder: s, app: b, isSelected: i.includes(e.id), onClick: (f) => {
|
|
98
|
+
f.stopPropagation(), y(e);
|
|
99
|
+
}, onSelect: () => F(e) }) }, s);
|
|
60
100
|
}) }) : null;
|
|
61
101
|
};
|
|
62
102
|
export {
|
|
63
|
-
|
|
103
|
+
ee 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,87 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Modal as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import "i18next";
|
|
11
|
-
import "zustand";
|
|
12
|
-
function B({
|
|
13
|
-
onSuccess: n
|
|
1
|
+
import { jsxs as T, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { findNodeById as x, getAncestors as C, useOdeClient as S, Modal as m, 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
|
+
function U({
|
|
9
|
+
onSuccess: a
|
|
14
10
|
}) {
|
|
15
|
-
const [d,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
async function u() {
|
|
11
|
+
const [d, n] = B(), u = A(), o = D(), h = j(), p = k(), i = E(), {
|
|
12
|
+
fetchTreeData: v
|
|
13
|
+
} = O();
|
|
14
|
+
async function y() {
|
|
20
15
|
try {
|
|
21
|
-
if (!d)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
console.error(e);
|
|
16
|
+
if (!d) throw new Error("explorer.move.selection.empty");
|
|
17
|
+
await o.mutate(d), await (a == null ? void 0 : a());
|
|
18
|
+
} catch (r) {
|
|
19
|
+
console.error(r);
|
|
26
20
|
}
|
|
27
21
|
}
|
|
28
|
-
const
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
const I = (r) => {
|
|
23
|
+
var f, c;
|
|
24
|
+
const t = C(i, r);
|
|
25
|
+
for (const e of h)
|
|
26
|
+
if (r === e.id || r === e.parentId || (f = e.childrenIds) != null && f.includes(r) || t.includes(e.id))
|
|
32
27
|
return !1;
|
|
33
|
-
for (const
|
|
34
|
-
if (
|
|
28
|
+
for (const e of p)
|
|
29
|
+
if (r === ((e == null ? void 0 : e.folderIds) && e.folderIds[0]) || ((c = e == null ? void 0 : e.folderIds) == null ? void 0 : c.length) === 0 && r === "default")
|
|
35
30
|
return !1;
|
|
36
31
|
return !0;
|
|
37
32
|
};
|
|
38
33
|
return {
|
|
34
|
+
treeData: i,
|
|
39
35
|
disableSubmit: !d,
|
|
40
|
-
handleTreeItemSelect: (
|
|
41
|
-
|
|
36
|
+
handleTreeItemSelect: (r) => {
|
|
37
|
+
I(r) ? n(r) : n(void 0);
|
|
42
38
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
handleOnTreeItemUnfold: (r) => {
|
|
40
|
+
var c, e;
|
|
41
|
+
const t = x(i, r), f = (c = t == null ? void 0 : t.children) == null ? void 0 : c.some((l) => {
|
|
42
|
+
var M;
|
|
43
|
+
return Array.isArray(l == null ? void 0 : l.children) && ((M = l.children) == null ? void 0 : M.length) > 0;
|
|
44
|
+
});
|
|
45
|
+
(e = t == null ? void 0 : t.children) == null || e.forEach((l) => {
|
|
46
|
+
f || v(l.id, u);
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
onMove: () => y()
|
|
48
50
|
};
|
|
49
51
|
}
|
|
50
|
-
function
|
|
51
|
-
isOpen:
|
|
52
|
+
function W({
|
|
53
|
+
isOpen: a,
|
|
52
54
|
onSuccess: d,
|
|
53
|
-
onCancel:
|
|
55
|
+
onCancel: n
|
|
54
56
|
}) {
|
|
55
57
|
const {
|
|
56
|
-
|
|
57
|
-
} =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
appCode: u
|
|
59
|
+
} = S(), {
|
|
60
|
+
t: o
|
|
61
|
+
} = w(), {
|
|
62
|
+
treeData: h,
|
|
63
|
+
handleTreeItemSelect: p,
|
|
64
|
+
handleOnTreeItemUnfold: i,
|
|
65
|
+
onMove: v,
|
|
66
|
+
disableSubmit: y
|
|
67
|
+
} = U({
|
|
64
68
|
onSuccess: d
|
|
65
|
-
}),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
}), I = {
|
|
70
|
+
...h,
|
|
71
|
+
name: o("explorer.filters.mine", {
|
|
72
|
+
ns: u
|
|
73
|
+
})
|
|
74
|
+
};
|
|
75
|
+
return /* @__PURE__ */ g(/* @__PURE__ */ T(m, { isOpen: a, onModalClose: n, id: "moveModal", children: [
|
|
76
|
+
/* @__PURE__ */ s(m.Header, { onModalClose: n, children: o("explorer.move.title") }),
|
|
77
|
+
/* @__PURE__ */ s(m.Subtitle, { children: o("explorer.move.subtitle") }),
|
|
78
|
+
/* @__PURE__ */ s(m.Body, { children: /* @__PURE__ */ s(F, { data: I, onTreeItemClick: p, onTreeItemUnfold: i }) }),
|
|
79
|
+
/* @__PURE__ */ T(m.Footer, { children: [
|
|
80
|
+
/* @__PURE__ */ s(b, { color: "tertiary", onClick: n, type: "button", variant: "ghost", children: o("explorer.cancel") }),
|
|
81
|
+
/* @__PURE__ */ s(b, { color: "primary", onClick: v, type: "button", variant: "filled", disabled: y, children: o("explorer.move") })
|
|
73
82
|
] })
|
|
74
83
|
] }), document.getElementById("portal"));
|
|
75
84
|
}
|
|
76
85
|
export {
|
|
77
|
-
|
|
86
|
+
W as default
|
|
78
87
|
};
|