ode-explorer 1.3.2-dev.202401091744 → 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.
- package/dist/index.js +3 -3
- package/dist/version.txt +1 -1
- package/lib/ActionBarContainer.js +219 -313
- package/lib/AppAction.js +26 -39
- package/lib/DeleteModal.js +31 -39
- package/lib/DisableModal.js +14 -14
- package/lib/EmptyScreenApp.js +27 -43
- package/lib/EmptyScreenError.js +9 -10
- package/lib/EmptyScreenNoContentInFolder.js +12 -14
- package/lib/EmptyScreenSearch.js +11 -13
- package/lib/EmptyScreenTrash.js +11 -13
- package/lib/FolderModal.js +86 -105
- package/lib/FoldersList.js +42 -55
- package/lib/Library.js +12 -15
- package/lib/MoveModal.js +53 -69
- package/lib/ResourcesList.js +190 -202
- package/lib/TrashModal.js +13 -13
- package/lib/index.js +2 -2
- package/lib/index2.js +1012 -1503
- package/lib/style.css +1 -410
- package/package.json +3 -4
package/lib/FoldersList.js
CHANGED
|
@@ -1,77 +1,64 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Card, useOdeClient, useScrollToTop } from "@edifice-ui/react";
|
|
3
|
-
import { useSpring, animated } from "@react-spring/web";
|
|
4
|
-
import { Files } from "@edifice-ui/icons";
|
|
5
|
-
import { h as
|
|
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
6
|
import "react";
|
|
7
7
|
import "react-i18next";
|
|
8
8
|
import "edifice-ts-client";
|
|
9
9
|
import "i18next";
|
|
10
10
|
import "zustand";
|
|
11
11
|
import "@tanstack/react-query";
|
|
12
|
-
const
|
|
13
|
-
app,
|
|
14
|
-
name,
|
|
15
|
-
isSelected =
|
|
16
|
-
isSelectable =
|
|
17
|
-
onClick,
|
|
18
|
-
onSelect
|
|
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
|
|
19
26
|
}) => {
|
|
20
|
-
|
|
21
|
-
/* @__PURE__ */ jsx(Files, { width: "48", height: "48", className: `color-app-${appCode}` }),
|
|
22
|
-
/* @__PURE__ */ jsx(Card.Title, { children: name })
|
|
23
|
-
] }) });
|
|
24
|
-
};
|
|
25
|
-
FolderCard.displayName = "FolderCard";
|
|
26
|
-
const FoldersList = ({
|
|
27
|
-
data
|
|
28
|
-
}) => {
|
|
29
|
-
var _a, _b;
|
|
27
|
+
var m, u;
|
|
30
28
|
const {
|
|
31
|
-
currentApp
|
|
32
|
-
} =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} = useStoreActions();
|
|
40
|
-
function toggleSelect(folder) {
|
|
41
|
-
if (folderIds.includes(folder.id)) {
|
|
42
|
-
setFolderIds(folderIds.filter((selectedFolder) => selectedFolder !== folder.id));
|
|
43
|
-
setSelectedFolders(selectedFolders.filter((selectedFolder) => selectedFolder.id !== folder.id));
|
|
44
|
-
} else {
|
|
45
|
-
setFolderIds([...folderIds, folder.id]);
|
|
46
|
-
setSelectedFolders([...selectedFolders, folder]);
|
|
47
|
-
}
|
|
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]));
|
|
48
37
|
}
|
|
49
|
-
const
|
|
38
|
+
const F = I({
|
|
50
39
|
from: {
|
|
51
40
|
opacity: 0
|
|
52
41
|
},
|
|
53
42
|
to: {
|
|
54
43
|
opacity: 1
|
|
55
44
|
}
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
return ((_a = data == null ? void 0 : data.pages[0]) == null ? void 0 : _a.folders.length) ? /* @__PURE__ */ jsx(animated.ul, { className: "grid ps-0 list-unstyled mb-24", children: (_b = data == null ? void 0 : data.pages[0]) == null ? void 0 : _b.folders.map((folder) => {
|
|
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) => {
|
|
59
47
|
const {
|
|
60
|
-
id,
|
|
61
|
-
name
|
|
62
|
-
} =
|
|
63
|
-
return /* @__PURE__ */
|
|
48
|
+
id: r,
|
|
49
|
+
name: S
|
|
50
|
+
} = e;
|
|
51
|
+
return /* @__PURE__ */ i(a.li, { className: "g-col-4 z-1", style: {
|
|
64
52
|
position: "relative",
|
|
65
|
-
...
|
|
66
|
-
}, children: /* @__PURE__ */
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
folderId: folder.id
|
|
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
|
|
71
58
|
});
|
|
72
|
-
}, onSelect: () =>
|
|
59
|
+
}, onSelect: () => h(e) }) }, r);
|
|
73
60
|
}) }) : null;
|
|
74
61
|
};
|
|
75
62
|
export {
|
|
76
|
-
|
|
63
|
+
E as default
|
|
77
64
|
};
|
package/lib/Library.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useOdeTheme, useLibraryUrl, usePaths, Library as
|
|
3
|
-
import { useTranslation } from "react-i18next";
|
|
4
|
-
const
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useOdeTheme as i, useLibraryUrl as s, usePaths as l, Library as b } from "@edifice-ui/react";
|
|
3
|
+
import { useTranslation as n } from "react-i18next";
|
|
4
|
+
const u = () => {
|
|
5
5
|
const {
|
|
6
|
-
t
|
|
7
|
-
} =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} = useLibraryUrl();
|
|
14
|
-
const [imagePath] = usePaths();
|
|
15
|
-
return /* @__PURE__ */ jsx(Library$1, { src: `${imagePath}/${theme == null ? void 0 : theme.bootstrapVersion}/image-library.svg`, url: libraryUrl, alt: t("explorer.libray.img.alt"), text: t("explorer.libray.title"), textButton: t("explorer.libray.btn") });
|
|
6
|
+
t: r
|
|
7
|
+
} = n(), {
|
|
8
|
+
theme: t
|
|
9
|
+
} = i(), {
|
|
10
|
+
libraryUrl: a
|
|
11
|
+
} = s(), [e] = l();
|
|
12
|
+
return /* @__PURE__ */ o(b, { src: `${e}/${t == null ? void 0 : t.bootstrapVersion}/image-library.svg`, url: a, alt: r("explorer.libray.img.alt"), text: r("explorer.libray.title"), textButton: r("explorer.libray.btn") });
|
|
16
13
|
};
|
|
17
14
|
export {
|
|
18
|
-
|
|
15
|
+
u as default
|
|
19
16
|
};
|
package/lib/MoveModal.js
CHANGED
|
@@ -1,94 +1,78 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Modal, TreeView, Button } from "@edifice-ui/react";
|
|
3
|
-
import { createPortal } from "react-dom";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { useState } from "react";
|
|
6
|
-
import { useQueryClient } from "@tanstack/react-query";
|
|
7
|
-
import { s as
|
|
1
|
+
import { jsxs as h, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { Modal as a, TreeView as T, Button as I } from "@edifice-ui/react";
|
|
3
|
+
import { createPortal as M } from "react-dom";
|
|
4
|
+
import { useTranslation as y } from "react-i18next";
|
|
5
|
+
import { useState as b } from "react";
|
|
6
|
+
import { useQueryClient as F } from "@tanstack/react-query";
|
|
7
|
+
import { s as x, h as S, g as w, u as g, t as B } from "./index2.js";
|
|
8
8
|
import "@edifice-ui/icons";
|
|
9
9
|
import "edifice-ts-client";
|
|
10
10
|
import "i18next";
|
|
11
11
|
import "zustand";
|
|
12
|
-
function
|
|
13
|
-
onSuccess
|
|
12
|
+
function C({
|
|
13
|
+
onSuccess: n
|
|
14
14
|
}) {
|
|
15
|
-
const [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
foldTreeItem,
|
|
21
|
-
unfoldTreeItem
|
|
22
|
-
} = useStoreActions();
|
|
23
|
-
const queryclient = useQueryClient();
|
|
24
|
-
async function onMove() {
|
|
15
|
+
const [d, t] = b(), r = x(), i = S(), m = w(), {
|
|
16
|
+
foldTreeItem: s,
|
|
17
|
+
unfoldTreeItem: c
|
|
18
|
+
} = g(), f = F();
|
|
19
|
+
async function u() {
|
|
25
20
|
try {
|
|
26
|
-
if (!
|
|
21
|
+
if (!d)
|
|
27
22
|
throw new Error("explorer.move.selection.empty");
|
|
28
|
-
await
|
|
29
|
-
await (onSuccess == null ? void 0 : onSuccess());
|
|
23
|
+
await r.mutate(d), await (n == null ? void 0 : n());
|
|
30
24
|
} catch (e) {
|
|
31
25
|
console.error(e);
|
|
32
26
|
}
|
|
33
27
|
}
|
|
34
|
-
const
|
|
35
|
-
var
|
|
36
|
-
for (const
|
|
37
|
-
if (
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return true;
|
|
28
|
+
const v = (e) => {
|
|
29
|
+
var p;
|
|
30
|
+
for (const o of i)
|
|
31
|
+
if (e === o.id || e === o.parentId)
|
|
32
|
+
return !1;
|
|
33
|
+
for (const o of m)
|
|
34
|
+
if (e === ((o == null ? void 0 : o.folderIds) && o.folderIds[0]) || ((p = o == null ? void 0 : o.folderIds) == null ? void 0 : p.length) === 0 && e === "default")
|
|
35
|
+
return !1;
|
|
36
|
+
return !0;
|
|
47
37
|
};
|
|
48
38
|
return {
|
|
49
|
-
disableSubmit: !
|
|
50
|
-
handleTreeItemSelect: (
|
|
51
|
-
|
|
52
|
-
setSelectedFolder(folderId);
|
|
53
|
-
} else {
|
|
54
|
-
setSelectedFolder(void 0);
|
|
55
|
-
}
|
|
39
|
+
disableSubmit: !d,
|
|
40
|
+
handleTreeItemSelect: (e) => {
|
|
41
|
+
v(e) ? t(e) : t(void 0);
|
|
56
42
|
},
|
|
57
|
-
handleTreeItemFold:
|
|
58
|
-
handleTreeItemUnfold: async (
|
|
43
|
+
handleTreeItemFold: s,
|
|
44
|
+
handleTreeItemUnfold: async (e) => await c(e, f),
|
|
59
45
|
onMove: () => {
|
|
60
|
-
|
|
46
|
+
u();
|
|
61
47
|
}
|
|
62
48
|
};
|
|
63
49
|
}
|
|
64
|
-
function
|
|
65
|
-
isOpen,
|
|
66
|
-
onSuccess,
|
|
67
|
-
onCancel
|
|
50
|
+
function z({
|
|
51
|
+
isOpen: n,
|
|
52
|
+
onSuccess: d,
|
|
53
|
+
onCancel: t
|
|
68
54
|
}) {
|
|
69
55
|
const {
|
|
70
|
-
t
|
|
71
|
-
} =
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
/* @__PURE__ */ jsx(Button, { color: "tertiary", onClick: onCancel, type: "button", variant: "ghost", children: t("explorer.cancel") }),
|
|
88
|
-
/* @__PURE__ */ jsx(Button, { color: "primary", onClick: onMove, type: "button", variant: "filled", disabled: disableSubmit, children: t("explorer.move") })
|
|
56
|
+
t: r
|
|
57
|
+
} = y(), {
|
|
58
|
+
handleTreeItemFold: i,
|
|
59
|
+
handleTreeItemSelect: m,
|
|
60
|
+
handleTreeItemUnfold: s,
|
|
61
|
+
onMove: c,
|
|
62
|
+
disableSubmit: f
|
|
63
|
+
} = C({
|
|
64
|
+
onSuccess: d
|
|
65
|
+
}), u = B();
|
|
66
|
+
return /* @__PURE__ */ M(/* @__PURE__ */ h(a, { isOpen: n, onModalClose: t, id: "moveModal", children: [
|
|
67
|
+
/* @__PURE__ */ l(a.Header, { onModalClose: t, children: r("explorer.move.title") }),
|
|
68
|
+
/* @__PURE__ */ l(a.Subtitle, { children: r("explorer.move.subtitle") }),
|
|
69
|
+
/* @__PURE__ */ l(a.Body, { children: /* @__PURE__ */ l(T, { data: u, onTreeItemSelect: m, onTreeItemFold: i, onTreeItemUnfold: s }) }),
|
|
70
|
+
/* @__PURE__ */ h(a.Footer, { children: [
|
|
71
|
+
/* @__PURE__ */ l(I, { color: "tertiary", onClick: t, type: "button", variant: "ghost", children: r("explorer.cancel") }),
|
|
72
|
+
/* @__PURE__ */ l(I, { color: "primary", onClick: c, type: "button", variant: "filled", disabled: f, children: r("explorer.move") })
|
|
89
73
|
] })
|
|
90
74
|
] }), document.getElementById("portal"));
|
|
91
75
|
}
|
|
92
76
|
export {
|
|
93
|
-
|
|
77
|
+
z as default
|
|
94
78
|
};
|