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/ResourcesList.js
CHANGED
|
@@ -1,113 +1,136 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Card as
|
|
4
|
-
import { useSpring as
|
|
5
|
-
import
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { jsx as e, jsxs as o, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import C, { useState as $, useEffect as j, useCallback as M } from "react";
|
|
3
|
+
import { Card as m, Image as B, AppIcon as E, Avatar as G, Tooltip as O, useOdeClient as L, useDate as U, Button as q } from "@edifice-ui/react";
|
|
4
|
+
import { useSpring as H, animated as k } from "@react-spring/web";
|
|
5
|
+
import J from "clsx";
|
|
6
|
+
import { useTranslation as w } from "react-i18next";
|
|
7
|
+
import { o as K, e as Q, h as V, i as W, a as X, f as Y } from "./index2.js";
|
|
8
|
+
import { useDraggable as Z } from "@dnd-kit/core";
|
|
9
|
+
import { Users as _, Globe as tt } from "@edifice-ui/icons";
|
|
10
|
+
import { OneProfile as et } from "@edifice-ui/icons/nav";
|
|
11
|
+
import { D as it } from "./DraggableCard.js";
|
|
12
|
+
import "@dnd-kit/modifiers";
|
|
10
13
|
import "edifice-ts-client";
|
|
11
14
|
import "i18next";
|
|
12
15
|
import "zustand";
|
|
13
16
|
import "@tanstack/react-query";
|
|
14
|
-
const
|
|
15
|
-
app:
|
|
17
|
+
const A = ({
|
|
18
|
+
app: s,
|
|
16
19
|
resource: t,
|
|
17
|
-
time:
|
|
18
|
-
isSelected:
|
|
20
|
+
time: x,
|
|
21
|
+
isSelected: b = !1,
|
|
19
22
|
isSelectable: u = !0,
|
|
20
|
-
onClick:
|
|
21
|
-
onSelect:
|
|
23
|
+
onClick: p,
|
|
24
|
+
onSelect: c
|
|
22
25
|
}) => {
|
|
23
|
-
const
|
|
24
|
-
function
|
|
26
|
+
const [a, h] = $(!1), r = `/userbook/avatar/${t == null ? void 0 : t.creatorId}`;
|
|
27
|
+
function R(i) {
|
|
25
28
|
const {
|
|
26
|
-
rights:
|
|
27
|
-
creatorId:
|
|
28
|
-
} =
|
|
29
|
-
return
|
|
29
|
+
rights: l,
|
|
30
|
+
creatorId: d
|
|
31
|
+
} = i || {};
|
|
32
|
+
return l.filter((F) => !F.includes(d)).length >= 1;
|
|
30
33
|
}
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
const {
|
|
35
|
+
attributes: I,
|
|
36
|
+
listeners: v,
|
|
37
|
+
setNodeRef: y,
|
|
38
|
+
transform: n
|
|
39
|
+
} = Z({
|
|
40
|
+
id: t.id,
|
|
41
|
+
data: {
|
|
42
|
+
id: t.id,
|
|
43
|
+
type: "resource"
|
|
44
|
+
}
|
|
45
|
+
}), S = R(t), N = t == null ? void 0 : t.public, g = K(), {
|
|
46
|
+
t: f
|
|
47
|
+
} = w(), D = {
|
|
48
|
+
position: a ? "absolute" : "relative",
|
|
49
|
+
zIndex: a ? 2e3 : 1,
|
|
50
|
+
transform: `translate3d(${((n == null ? void 0 : n.x) ?? 0) / 1}px, ${((n == null ? void 0 : n.y) ?? 0) / 1}px, 0)`
|
|
51
|
+
};
|
|
52
|
+
return j(() => {
|
|
53
|
+
const i = g.elementDrag === t.id;
|
|
54
|
+
h(i);
|
|
55
|
+
}, [g]), /* @__PURE__ */ e("div", { ref: y, ...v, ...I, style: {
|
|
56
|
+
...D
|
|
57
|
+
}, children: a ? /* @__PURE__ */ e(it, { app: s, type: "resource", name: t == null ? void 0 : t.name }) : /* @__PURE__ */ e(m, { app: s, isSelected: !a && b, isSelectable: !a && u, onClick: p, onSelect: c, children: (i) => /* @__PURE__ */ o(z, { children: [
|
|
58
|
+
/* @__PURE__ */ o(m.Body, { children: [
|
|
59
|
+
/* @__PURE__ */ e("div", { className: "card-image medium", children: t != null && t.thumbnail ? /* @__PURE__ */ e(B, { alt: "", src: `${t == null ? void 0 : t.thumbnail}?thumbnail=80x80`, objectFit: "cover", className: "h-full w-100" }) : /* @__PURE__ */ e(E, { app: s, iconFit: "ratio", size: "80", variant: "rounded" }) }),
|
|
60
|
+
/* @__PURE__ */ o("div", { className: "text-truncate", children: [
|
|
61
|
+
/* @__PURE__ */ e(m.Title, { children: t == null ? void 0 : t.name }),
|
|
62
|
+
/* @__PURE__ */ e(m.Text, { children: /* @__PURE__ */ e("em", { children: x }) })
|
|
40
63
|
] })
|
|
41
64
|
] }),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
|
|
45
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ o(m.Footer, { children: [
|
|
66
|
+
/* @__PURE__ */ o("div", { className: "d-inline-flex align-items-center gap-8 text-truncate", children: [
|
|
67
|
+
r ? /* @__PURE__ */ e(G, { alt: (t == null ? void 0 : t.creatorName) || "", size: "xs", src: r, variant: "circle", width: "24", height: "24" }) : /* @__PURE__ */ e(et, {}),
|
|
68
|
+
/* @__PURE__ */ e(m.Text, { children: t == null ? void 0 : t.creatorName })
|
|
46
69
|
] }),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
|
|
49
|
-
ns:
|
|
50
|
-
}), placement: "top", children: /* @__PURE__ */
|
|
51
|
-
|
|
52
|
-
ns:
|
|
53
|
-
}), placement: "top", children: /* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ o("div", { className: "d-inline-flex align-items-center gap-8", children: [
|
|
71
|
+
S && /* @__PURE__ */ e(O, { message: f("tooltip.shared", {
|
|
72
|
+
ns: i
|
|
73
|
+
}), placement: "top", children: /* @__PURE__ */ e(_, { width: 16, height: 16 }) }),
|
|
74
|
+
N && /* @__PURE__ */ e(O, { message: f("tooltip.public", {
|
|
75
|
+
ns: i
|
|
76
|
+
}), placement: "top", children: /* @__PURE__ */ e(tt, { width: 16, height: 16 }) })
|
|
54
77
|
] })
|
|
55
78
|
] })
|
|
56
|
-
] }) });
|
|
79
|
+
] }) }) });
|
|
57
80
|
};
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
data:
|
|
81
|
+
A.displayName = "ResourceCard";
|
|
82
|
+
const Rt = ({
|
|
83
|
+
data: s,
|
|
61
84
|
fetchNextPage: t
|
|
62
85
|
}) => {
|
|
63
86
|
const {
|
|
64
|
-
currentApp:
|
|
65
|
-
} =
|
|
66
|
-
t:
|
|
67
|
-
} =
|
|
87
|
+
currentApp: x
|
|
88
|
+
} = L(), {
|
|
89
|
+
t: b
|
|
90
|
+
} = w(), {
|
|
68
91
|
fromNow: u
|
|
69
|
-
} =
|
|
70
|
-
setSelectedResources:
|
|
92
|
+
} = U(), p = Q(), c = V(), a = W(), {
|
|
93
|
+
setSelectedResources: h,
|
|
71
94
|
setResourceIds: r,
|
|
72
95
|
openResource: R,
|
|
73
|
-
setResourceIsTrash:
|
|
74
|
-
} =
|
|
96
|
+
setResourceIsTrash: I
|
|
97
|
+
} = X(), v = Y(), y = H({
|
|
75
98
|
from: {
|
|
76
99
|
opacity: 0
|
|
77
100
|
},
|
|
78
101
|
to: {
|
|
79
102
|
opacity: 1
|
|
80
103
|
}
|
|
81
|
-
}),
|
|
104
|
+
}), S = p.pagination.startIdx + p.pagination.pageSize < (p.pagination.maxIdx || 0), N = M(() => {
|
|
82
105
|
t();
|
|
83
|
-
}, []),
|
|
84
|
-
|
|
106
|
+
}, []), g = (i) => {
|
|
107
|
+
v ? (I(!0), r([i.id]), h([i])) : R(i);
|
|
85
108
|
};
|
|
86
|
-
async function
|
|
87
|
-
if (
|
|
88
|
-
r(
|
|
109
|
+
async function f(i) {
|
|
110
|
+
if (c.includes(i.id)) {
|
|
111
|
+
r(c.filter((l) => l !== i.id)), h(a.filter((l) => l.id !== i.id));
|
|
89
112
|
return;
|
|
90
113
|
}
|
|
91
|
-
r([...
|
|
114
|
+
r([...c, i.id]), h([...a, i]);
|
|
92
115
|
}
|
|
93
|
-
const
|
|
94
|
-
return /* @__PURE__ */
|
|
95
|
-
/* @__PURE__ */
|
|
116
|
+
const D = J("grid ps-0 list-unstyled");
|
|
117
|
+
return /* @__PURE__ */ o(C.Fragment, { children: [
|
|
118
|
+
/* @__PURE__ */ e(k.ul, { className: D, children: s == null ? void 0 : s.pages.map((i, l) => (
|
|
96
119
|
// eslint-disable-next-line react/no-array-index-key
|
|
97
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ e(C.Fragment, { children: i.resources.map((d) => {
|
|
98
121
|
const {
|
|
99
|
-
id:
|
|
100
|
-
updatedAt:
|
|
101
|
-
} =
|
|
102
|
-
return /* @__PURE__ */
|
|
122
|
+
id: T,
|
|
123
|
+
updatedAt: F
|
|
124
|
+
} = d, P = u(F);
|
|
125
|
+
return /* @__PURE__ */ e(k.li, { className: "g-col-4", style: {
|
|
103
126
|
position: "relative",
|
|
104
|
-
...
|
|
105
|
-
}, children: /* @__PURE__ */
|
|
106
|
-
}) },
|
|
127
|
+
...y
|
|
128
|
+
}, children: /* @__PURE__ */ e(A, { app: x, resource: d, time: P, isSelectable: !0, isSelected: c.includes(d.id), onClick: () => g(d), onSelect: () => f(d) }) }, T);
|
|
129
|
+
}) }, l)
|
|
107
130
|
)) }),
|
|
108
|
-
|
|
131
|
+
S && /* @__PURE__ */ e("div", { className: "d-grid gap-2 col-4 mx-auto my-24", children: /* @__PURE__ */ e(q, { type: "button", color: "secondary", variant: "filled", onClick: N, children: b("explorer.see.more") }) })
|
|
109
132
|
] });
|
|
110
133
|
};
|
|
111
134
|
export {
|
|
112
|
-
|
|
135
|
+
Rt as default
|
|
113
136
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResourceService, type App, type IAction, type IFilter, type IOrder, type ResourceType } from "edifice-ts-client";
|
|
2
2
|
export interface AppParams {
|
|
3
3
|
/** Application code */
|
|
4
4
|
app: App;
|
|
5
|
+
/**
|
|
6
|
+
* Initialize App Resource Service
|
|
7
|
+
*/
|
|
8
|
+
service: typeof ResourceService;
|
|
5
9
|
/** Array of ResourceType */
|
|
6
10
|
types: ResourceType[];
|
|
7
11
|
/** Array of IFilter */
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { type ID } from "edifice-ts-client";
|
|
2
1
|
interface ModalProps {
|
|
3
2
|
onSuccess?: () => void;
|
|
4
3
|
}
|
|
5
4
|
export declare function useMoveModal({ onSuccess }: ModalProps): {
|
|
5
|
+
treeData: import("@edifice-ui/react").TreeData;
|
|
6
6
|
disableSubmit: boolean;
|
|
7
7
|
handleTreeItemSelect: (folderId: string) => void;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
onMove: () => void;
|
|
8
|
+
handleOnTreeItemUnfold: (nodeId: string) => void;
|
|
9
|
+
onMove: () => Promise<void>;
|
|
11
10
|
};
|
|
12
11
|
export {};
|
|
@@ -2,7 +2,7 @@ import { type IAction } from "edifice-ts-client";
|
|
|
2
2
|
export default function useActionBar(): {
|
|
3
3
|
onRestore: () => Promise<void>;
|
|
4
4
|
actions: IAction[] | undefined;
|
|
5
|
-
selectedElement: (import("edifice-ts-client").
|
|
5
|
+
selectedElement: (import("edifice-ts-client").IResource | import("edifice-ts-client").IFolder)[];
|
|
6
6
|
currentFolderId: string | undefined;
|
|
7
7
|
overrideLabel: (action: IAction) => string;
|
|
8
8
|
handleClick: (action: IAction) => Promise<void>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DragEndEvent, DragOverEvent, DragStartEvent } from "@dnd-kit/core";
|
|
2
|
+
export default function useDndKit(): {
|
|
3
|
+
handleDragEnd: (event: DragEndEvent) => Promise<void>;
|
|
4
|
+
handleDragStart: (event: DragStartEvent) => void;
|
|
5
|
+
handleDragOver: (event: DragOverEvent) => void;
|
|
6
|
+
sensors: import("@dnd-kit/core").SensorDescriptor<import("@dnd-kit/core").SensorOptions>[];
|
|
7
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CardProps } from "@edifice-ui/react";
|
|
2
|
-
import { IWebApp } from "edifice-ts-client";
|
|
2
|
+
import { ID, IWebApp } from "edifice-ts-client";
|
|
3
3
|
export interface FolderCardProps extends Omit<CardProps, "children"> {
|
|
4
4
|
/**
|
|
5
5
|
* IWeb App
|
|
@@ -9,9 +9,13 @@ export interface FolderCardProps extends Omit<CardProps, "children"> {
|
|
|
9
9
|
* Folder's name
|
|
10
10
|
*/
|
|
11
11
|
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* Folder's id
|
|
14
|
+
*/
|
|
15
|
+
idFolder: ID;
|
|
12
16
|
}
|
|
13
17
|
declare const FolderCard: {
|
|
14
|
-
({ app, name, isSelected, isSelectable, onClick, onSelect, }: FolderCardProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
({ app, name, idFolder, isSelected, isSelectable, onClick, onSelect, }: FolderCardProps): import("react/jsx-runtime").JSX.Element;
|
|
15
19
|
displayName: string;
|
|
16
20
|
};
|
|
17
21
|
export default FolderCard;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Explorer } from "./components/Explorer";
|
|
2
|
-
export * from "./config/
|
|
2
|
+
export * from "./config/explorer";
|
package/lib/index.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { E as
|
|
1
|
+
import { E as s, B as n } from "./index2.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
|
+
import "@dnd-kit/core";
|
|
5
|
+
import "@dnd-kit/modifiers";
|
|
4
6
|
import "@edifice-ui/react";
|
|
5
|
-
import "@edifice-ui/icons";
|
|
6
|
-
import "react-i18next";
|
|
7
7
|
import "edifice-ts-client";
|
|
8
8
|
import "i18next";
|
|
9
9
|
import "zustand";
|
|
10
10
|
import "@tanstack/react-query";
|
|
11
|
+
import "react-i18next";
|
|
12
|
+
import "@edifice-ui/icons";
|
|
11
13
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
s as Explorer,
|
|
15
|
+
n as getExplorerConfig
|
|
14
16
|
};
|