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/dist/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ode-explorer=1.0-b2school-SNAPSHOT
|
|
1
|
+
ode-explorer=1.0-b2school-SNAPSHOT 07/10/2024 17:39:43
|
|
@@ -1,277 +1,283 @@
|
|
|
1
|
-
import { jsx as a, Fragment as
|
|
2
|
-
import { useState as L, useEffect as Z, Suspense as
|
|
3
|
-
import { useUser as
|
|
4
|
-
import { useTransition as
|
|
1
|
+
import { jsx as a, Fragment as X, jsxs as Q } from "react/jsx-runtime";
|
|
2
|
+
import { useState as L, useEffect as Z, Suspense as pe, lazy as b } from "react";
|
|
3
|
+
import { useUser as he, Button as W, useOdeClient as fe, ActionBar as me, LoadingScreen as Re, isActionAvailable as Se, BlogPublic as Ee, ShareModal as Oe, ShareBlog as Ce } from "@edifice-ui/react";
|
|
4
|
+
import { useTransition as be, animated as ye } from "@react-spring/web";
|
|
5
5
|
import { useTranslation as ee } from "react-i18next";
|
|
6
6
|
import { odeServices as D, ACTION as c } from "edifice-ts-client";
|
|
7
|
-
import {
|
|
8
|
-
import "@
|
|
7
|
+
import { f as J, u as Ie, c as ge, h as ve, i as se, j as Ae, k as Me, l as Pe, m as we, e as Fe, n as xe, o as Te, a as te, b as Be, p as De, q as Le, r as _e } from "./index2.js";
|
|
8
|
+
import "@dnd-kit/core";
|
|
9
|
+
import "@dnd-kit/modifiers";
|
|
9
10
|
import "i18next";
|
|
10
11
|
import "zustand";
|
|
11
12
|
import "@tanstack/react-query";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
import "@edifice-ui/icons";
|
|
14
|
+
function Ne({
|
|
15
|
+
roles: r,
|
|
16
|
+
rights: s,
|
|
17
|
+
action: t
|
|
16
18
|
}) {
|
|
17
|
-
const [
|
|
19
|
+
const [p, o] = L(!1), {
|
|
18
20
|
user: E
|
|
19
|
-
} =
|
|
21
|
+
} = he(), i = J();
|
|
20
22
|
Z(() => {
|
|
21
23
|
f();
|
|
22
|
-
}, [
|
|
24
|
+
}, [r, s]);
|
|
23
25
|
const R = async function(l) {
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
const m = await D.rights().sessionHasAtLeastOneResourceRight(
|
|
27
|
-
|
|
26
|
+
const n = l instanceof Array ? l : [l];
|
|
27
|
+
if (r instanceof Array) {
|
|
28
|
+
const m = await D.rights().sessionHasAtLeastOneResourceRight(r, n);
|
|
29
|
+
o(m);
|
|
28
30
|
} else {
|
|
29
|
-
const m = await D.rights().sessionHasResourceRight(
|
|
30
|
-
|
|
31
|
+
const m = await D.rights().sessionHasResourceRight(r, n);
|
|
32
|
+
o(m);
|
|
31
33
|
}
|
|
32
|
-
},
|
|
33
|
-
if (
|
|
34
|
-
const
|
|
35
|
-
|
|
34
|
+
}, h = async function(l) {
|
|
35
|
+
if (r instanceof Array) {
|
|
36
|
+
const n = await D.rights().sessionHasAtLeastOneResourceRightForEachList(r, l);
|
|
37
|
+
o(n);
|
|
36
38
|
} else {
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
+
const n = await D.rights().sessionHasResourceRightForEachList(r, l);
|
|
40
|
+
o(n);
|
|
39
41
|
}
|
|
40
42
|
}, f = async function() {
|
|
41
|
-
var l,
|
|
42
|
-
if (
|
|
43
|
-
|
|
43
|
+
var l, n, m;
|
|
44
|
+
if (r === void 0) {
|
|
45
|
+
o(!0);
|
|
44
46
|
return;
|
|
45
47
|
}
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
+
if (i && ((n = (l = s[0]) == null ? void 0 : l.trashedBy) != null && n.includes(E == null ? void 0 : E.userId)) && t === "restore" && !((m = s[0]) != null && m.trashed)) {
|
|
49
|
+
o(!0);
|
|
48
50
|
return;
|
|
49
51
|
}
|
|
50
|
-
if (
|
|
51
|
-
if (
|
|
52
|
-
if (typeof
|
|
53
|
-
await R(
|
|
52
|
+
if (s instanceof Array)
|
|
53
|
+
if (s.length > 0)
|
|
54
|
+
if (typeof s[0] == "string")
|
|
55
|
+
await R(s);
|
|
54
56
|
else {
|
|
55
|
-
const
|
|
56
|
-
await
|
|
57
|
+
const y = s.map((I) => I.rights);
|
|
58
|
+
await h(y);
|
|
57
59
|
}
|
|
58
60
|
else
|
|
59
|
-
|
|
61
|
+
o(!1);
|
|
60
62
|
else
|
|
61
|
-
typeof
|
|
63
|
+
typeof s == "string" ? await R(s) : await R(s.rights);
|
|
62
64
|
};
|
|
63
65
|
return {
|
|
64
|
-
visible:
|
|
66
|
+
visible: p,
|
|
65
67
|
refreshState: f
|
|
66
68
|
};
|
|
67
69
|
}
|
|
68
70
|
function oe() {
|
|
69
|
-
const [
|
|
70
|
-
openResource:
|
|
71
|
-
printSelectedResource:
|
|
72
|
-
openFolder:
|
|
71
|
+
const [r, s] = L(!1), [t, p] = L("void"), [o, E] = L(), i = Ie((e) => e.config), R = ge(), h = ve(), f = se(), l = Ae(), n = Me(), m = J(), y = Pe(), I = we(), M = Fe(), _ = xe(), N = Te(), {
|
|
72
|
+
openResource: P,
|
|
73
|
+
printSelectedResource: k,
|
|
74
|
+
openFolder: H,
|
|
73
75
|
clearSelectedItems: w,
|
|
74
|
-
clearSelectedIds:
|
|
76
|
+
clearSelectedIds: F
|
|
75
77
|
} = te(), {
|
|
76
|
-
data:
|
|
77
|
-
} =
|
|
78
|
+
data: U
|
|
79
|
+
} = Be(i == null ? void 0 : i.actions);
|
|
78
80
|
Z(() => {
|
|
79
|
-
if (
|
|
80
|
-
|
|
81
|
+
if (h.length === 0 && n.length === 0) {
|
|
82
|
+
s(!1);
|
|
81
83
|
return;
|
|
82
84
|
}
|
|
83
85
|
if (I) {
|
|
84
|
-
|
|
86
|
+
s(!1);
|
|
85
87
|
return;
|
|
86
88
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
if (N.isDrag) {
|
|
90
|
+
s(!1);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
s(!0);
|
|
94
|
+
}, [h, n]);
|
|
95
|
+
async function Y(e) {
|
|
90
96
|
var B;
|
|
91
97
|
switch ((B = document.getElementById("root")) == null || B.setAttribute("aria-hidden", "true"), E(e), e.id) {
|
|
92
98
|
case c.OPEN:
|
|
93
|
-
return
|
|
99
|
+
return h.length > 0 ? P(f[0]) : H({
|
|
94
100
|
folder: l[0],
|
|
95
101
|
folderId: l[0].id
|
|
96
102
|
});
|
|
97
103
|
case c.COPY:
|
|
98
|
-
return
|
|
104
|
+
return le();
|
|
99
105
|
case c.MOVE:
|
|
100
|
-
return
|
|
106
|
+
return p("move");
|
|
101
107
|
case c.PRINT:
|
|
102
|
-
return
|
|
108
|
+
return k();
|
|
103
109
|
case c.DELETE:
|
|
104
|
-
return
|
|
110
|
+
return p("delete");
|
|
105
111
|
case c.RESTORE:
|
|
106
|
-
return await
|
|
112
|
+
return await x();
|
|
107
113
|
case c.PUBLISH:
|
|
108
|
-
return
|
|
114
|
+
return p("publish");
|
|
109
115
|
case c.UPD_PROPS:
|
|
110
116
|
case "edit":
|
|
111
|
-
return
|
|
117
|
+
return ue();
|
|
112
118
|
case c.SHARE:
|
|
113
|
-
return
|
|
119
|
+
return p("share");
|
|
114
120
|
case c.EXPORT:
|
|
115
|
-
return
|
|
121
|
+
return p("export");
|
|
116
122
|
default:
|
|
117
123
|
throw Error(`Unknown action: ${e.id}`);
|
|
118
124
|
}
|
|
119
125
|
}
|
|
120
|
-
function
|
|
121
|
-
const B =
|
|
126
|
+
function j(e) {
|
|
127
|
+
const B = h.length + n.length, O = h.length === 1 || n.length === 1, K = B === 1, C = n.length === 0;
|
|
122
128
|
switch (e.id) {
|
|
123
129
|
case c.OPEN:
|
|
124
130
|
return K;
|
|
125
131
|
case c.MANAGE:
|
|
126
|
-
return
|
|
132
|
+
return O;
|
|
127
133
|
case c.COPY:
|
|
128
|
-
return
|
|
134
|
+
return O && C;
|
|
129
135
|
case c.PUBLISH:
|
|
130
|
-
return
|
|
136
|
+
return O && C;
|
|
131
137
|
case c.UPD_PROPS:
|
|
132
|
-
return C && O;
|
|
133
|
-
case c.SHARE:
|
|
134
138
|
return O && C;
|
|
135
|
-
case
|
|
139
|
+
case c.SHARE:
|
|
136
140
|
return C && O;
|
|
141
|
+
case "export":
|
|
142
|
+
return O && C;
|
|
137
143
|
case c.PRINT:
|
|
138
|
-
return
|
|
144
|
+
return O && C;
|
|
139
145
|
case "edit":
|
|
140
146
|
return K;
|
|
141
147
|
default:
|
|
142
148
|
return !0;
|
|
143
149
|
}
|
|
144
150
|
}
|
|
145
|
-
const
|
|
146
|
-
async function
|
|
151
|
+
const z = () => !0;
|
|
152
|
+
async function x() {
|
|
147
153
|
try {
|
|
148
154
|
if (m)
|
|
149
|
-
await
|
|
155
|
+
await y.mutate();
|
|
150
156
|
else
|
|
151
157
|
throw new Error("Cannot restore untrashed resources");
|
|
152
|
-
|
|
158
|
+
g();
|
|
153
159
|
} catch (e) {
|
|
154
160
|
console.error(e);
|
|
155
161
|
}
|
|
156
162
|
}
|
|
157
|
-
function
|
|
163
|
+
function g() {
|
|
158
164
|
var e;
|
|
159
|
-
|
|
165
|
+
p("void"), o != null && o.id && ((e = document.getElementById(o == null ? void 0 : o.id)) == null || e.focus());
|
|
160
166
|
}
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
},
|
|
164
|
-
async function
|
|
167
|
+
const u = (e) => () => {
|
|
168
|
+
t === e && (g(), w(), F());
|
|
169
|
+
}, S = u("move"), V = u("move"), T = u("delete"), $ = u("delete"), v = u("publish"), A = u("publish"), d = u("edit_folder"), q = u("edit_folder"), G = u("edit_resource"), re = u("edit_resource"), ne = u("share"), ce = u("share"), ae = u("export"), ie = u("export");
|
|
170
|
+
async function le() {
|
|
165
171
|
if (f && f.length > 0) {
|
|
166
172
|
const e = f[0];
|
|
167
|
-
await _.mutate(e), w(),
|
|
173
|
+
await _.mutate(e), w(), F();
|
|
168
174
|
}
|
|
169
175
|
}
|
|
170
|
-
function
|
|
171
|
-
if (
|
|
176
|
+
function ue() {
|
|
177
|
+
if (h && h.length > 0) {
|
|
172
178
|
const e = f[0].assetId;
|
|
173
|
-
(
|
|
179
|
+
(i == null ? void 0 : i.app) == "scrapbook" ? De({
|
|
174
180
|
searchParams: M,
|
|
175
181
|
assetId: e
|
|
176
|
-
}) :
|
|
182
|
+
}) : p("edit_resource");
|
|
177
183
|
} else
|
|
178
|
-
|
|
184
|
+
p("edit_folder");
|
|
179
185
|
}
|
|
180
|
-
function
|
|
181
|
-
return e.id === "edit" &&
|
|
186
|
+
function de(e) {
|
|
187
|
+
return e.id === "edit" && n.length > 0 ? "explorer.rename" : `explorer.actions.${e.id}`;
|
|
182
188
|
}
|
|
183
189
|
return {
|
|
184
|
-
onRestore:
|
|
185
|
-
actions: m ?
|
|
190
|
+
onRestore: x,
|
|
191
|
+
actions: m ? i == null ? void 0 : i.trashActions : U,
|
|
186
192
|
selectedElement: [...f, ...l],
|
|
187
193
|
currentFolderId: R == null ? void 0 : R.id,
|
|
188
|
-
overrideLabel:
|
|
189
|
-
handleClick:
|
|
190
|
-
isActivable: m ?
|
|
191
|
-
isActionBarOpen:
|
|
192
|
-
isMoveModalOpen:
|
|
193
|
-
onMoveCancel:
|
|
194
|
-
onMoveSuccess:
|
|
195
|
-
isDeleteModalOpen:
|
|
196
|
-
onDeleteCancel:
|
|
197
|
-
onDeleteSuccess:
|
|
198
|
-
isPublishModalOpen:
|
|
194
|
+
overrideLabel: de,
|
|
195
|
+
handleClick: Y,
|
|
196
|
+
isActivable: m ? z : j,
|
|
197
|
+
isActionBarOpen: r,
|
|
198
|
+
isMoveModalOpen: t === "move",
|
|
199
|
+
onMoveCancel: S,
|
|
200
|
+
onMoveSuccess: V,
|
|
201
|
+
isDeleteModalOpen: t === "delete",
|
|
202
|
+
onDeleteCancel: $,
|
|
203
|
+
onDeleteSuccess: T,
|
|
204
|
+
isPublishModalOpen: t === "publish",
|
|
199
205
|
onPublishCancel: A,
|
|
200
|
-
onPublishSuccess:
|
|
201
|
-
isEditFolderOpen:
|
|
202
|
-
onEditFolderCancel:
|
|
203
|
-
onEditFolderSuccess:
|
|
204
|
-
isEditResourceOpen:
|
|
205
|
-
onEditResourceCancel:
|
|
206
|
-
onEditResourceSuccess:
|
|
207
|
-
isShareResourceOpen:
|
|
208
|
-
onShareResourceCancel:
|
|
206
|
+
onPublishSuccess: v,
|
|
207
|
+
isEditFolderOpen: t === "edit_folder",
|
|
208
|
+
onEditFolderCancel: q,
|
|
209
|
+
onEditFolderSuccess: d,
|
|
210
|
+
isEditResourceOpen: t === "edit_resource",
|
|
211
|
+
onEditResourceCancel: re,
|
|
212
|
+
onEditResourceSuccess: G,
|
|
213
|
+
isShareResourceOpen: t === "share",
|
|
214
|
+
onShareResourceCancel: ce,
|
|
209
215
|
onShareResourceSuccess: ne,
|
|
210
|
-
isExportModalOpen:
|
|
211
|
-
onExportCancel:
|
|
212
|
-
onExportSuccess:
|
|
213
|
-
onClearActionBar:
|
|
216
|
+
isExportModalOpen: t === "export",
|
|
217
|
+
onExportCancel: ae,
|
|
218
|
+
onExportSuccess: ie,
|
|
219
|
+
onClearActionBar: g
|
|
214
220
|
};
|
|
215
221
|
}
|
|
216
|
-
function
|
|
217
|
-
resourceRights:
|
|
218
|
-
roleExpected:
|
|
219
|
-
action:
|
|
220
|
-
children:
|
|
221
|
-
renderWhenForbidden:
|
|
222
|
+
function ke({
|
|
223
|
+
resourceRights: r,
|
|
224
|
+
roleExpected: s,
|
|
225
|
+
action: t,
|
|
226
|
+
children: p,
|
|
227
|
+
renderWhenForbidden: o
|
|
222
228
|
}) {
|
|
223
229
|
const {
|
|
224
230
|
t: E
|
|
225
231
|
} = ee(), {
|
|
226
|
-
overrideLabel:
|
|
232
|
+
overrideLabel: i
|
|
227
233
|
} = oe(), {
|
|
228
234
|
visible: R
|
|
229
|
-
} =
|
|
230
|
-
roles:
|
|
231
|
-
rights:
|
|
232
|
-
action:
|
|
235
|
+
} = Ne({
|
|
236
|
+
roles: s,
|
|
237
|
+
rights: r,
|
|
238
|
+
action: t == null ? void 0 : t.id
|
|
233
239
|
}), {
|
|
234
|
-
setResourceActionDisable:
|
|
235
|
-
} = te(), f =
|
|
236
|
-
return R ? /* @__PURE__ */ a(
|
|
237
|
-
|
|
238
|
-
}, children: E(
|
|
240
|
+
setResourceActionDisable: h
|
|
241
|
+
} = te(), f = J();
|
|
242
|
+
return R ? /* @__PURE__ */ a(X, { children: p }) : o ? o() : f && !R ? /* @__PURE__ */ a(W, { type: "button", color: "primary", variant: "filled", onClick: () => {
|
|
243
|
+
h(!0);
|
|
244
|
+
}, children: E(i(t)) }) : /* @__PURE__ */ a(X, {});
|
|
239
245
|
}
|
|
240
|
-
const
|
|
241
|
-
function
|
|
246
|
+
const He = /* @__PURE__ */ b(async () => await import("./PublishModal.js")), Ue = /* @__PURE__ */ b(async () => await import("./ResourceModal.js")), Ye = /* @__PURE__ */ b(async () => await import("./DeleteModal.js")), je = /* @__PURE__ */ b(async () => await import("./MoveModal.js")), ze = /* @__PURE__ */ b(async () => await import("./FolderModal.js")), Ve = /* @__PURE__ */ b(async () => await import("./ExportModal.js"));
|
|
247
|
+
function rs() {
|
|
242
248
|
const {
|
|
243
|
-
appCode:
|
|
244
|
-
} =
|
|
245
|
-
t:
|
|
249
|
+
appCode: r
|
|
250
|
+
} = fe(), {
|
|
251
|
+
t: s
|
|
246
252
|
} = ee(), {
|
|
247
|
-
actions:
|
|
248
|
-
selectedElement:
|
|
249
|
-
isMoveModalOpen:
|
|
253
|
+
actions: t,
|
|
254
|
+
selectedElement: p,
|
|
255
|
+
isMoveModalOpen: o,
|
|
250
256
|
isDeleteModalOpen: E,
|
|
251
|
-
isPublishModalOpen:
|
|
257
|
+
isPublishModalOpen: i,
|
|
252
258
|
isActionBarOpen: R,
|
|
253
|
-
isEditFolderOpen:
|
|
259
|
+
isEditFolderOpen: h,
|
|
254
260
|
overrideLabel: f,
|
|
255
261
|
onEditFolderCancel: l,
|
|
256
|
-
onEditFolderSuccess:
|
|
262
|
+
onEditFolderSuccess: n,
|
|
257
263
|
isEditResourceOpen: m,
|
|
258
|
-
onEditResourceCancel:
|
|
264
|
+
onEditResourceCancel: y,
|
|
259
265
|
onEditResourceSuccess: I,
|
|
260
266
|
isShareResourceOpen: M,
|
|
261
267
|
onShareResourceCancel: _,
|
|
262
268
|
onShareResourceSuccess: N,
|
|
263
269
|
isExportModalOpen: P,
|
|
264
270
|
onExportCancel: k,
|
|
265
|
-
onExportSuccess:
|
|
266
|
-
onMoveCancel:
|
|
267
|
-
onMoveSuccess:
|
|
271
|
+
onExportSuccess: H,
|
|
272
|
+
onMoveCancel: w,
|
|
273
|
+
onMoveSuccess: F,
|
|
268
274
|
onDeleteCancel: U,
|
|
269
275
|
onDeleteSuccess: Y,
|
|
270
276
|
onPublishCancel: j,
|
|
271
|
-
onPublishSuccess:
|
|
272
|
-
isActivable:
|
|
273
|
-
handleClick:
|
|
274
|
-
} = oe(), S = se()[0],
|
|
277
|
+
onPublishSuccess: z,
|
|
278
|
+
isActivable: x,
|
|
279
|
+
handleClick: g
|
|
280
|
+
} = oe(), S = se()[0], V = Le(r), T = _e(r), $ = be(R, {
|
|
275
281
|
from: {
|
|
276
282
|
opacity: 0,
|
|
277
283
|
transform: "translateY(100%)"
|
|
@@ -285,28 +291,28 @@ function es() {
|
|
|
285
291
|
transform: "translateY(100%)"
|
|
286
292
|
}
|
|
287
293
|
});
|
|
288
|
-
return /* @__PURE__ */ Q(
|
|
289
|
-
|
|
290
|
-
...
|
|
294
|
+
return /* @__PURE__ */ Q(X, { children: [
|
|
295
|
+
$((v, A) => A && /* @__PURE__ */ a(ye.div, { className: "position-fixed bottom-0 start-0 end-0", style: {
|
|
296
|
+
...v,
|
|
291
297
|
zIndex: 4
|
|
292
|
-
}, children: /* @__PURE__ */ a(
|
|
293
|
-
|
|
294
|
-
}, children:
|
|
295
|
-
/* @__PURE__ */ Q(
|
|
296
|
-
|
|
297
|
-
E && /* @__PURE__ */ a(
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
m && S && /* @__PURE__ */ a(
|
|
301
|
-
M && S && /* @__PURE__ */ a(
|
|
298
|
+
}, children: /* @__PURE__ */ a(me, { children: t == null ? void 0 : t.filter((d) => d.available && d.target === "actionbar").map((d) => x(d) && /* @__PURE__ */ a(ke, { resourceRights: p, roleExpected: d.right, action: d, children: /* @__PURE__ */ a(W, { id: d.id, type: "button", color: "primary", variant: "filled", onClick: () => {
|
|
299
|
+
g(d);
|
|
300
|
+
}, children: s(f(d)) }, d.id) }, d.id)) }) })),
|
|
301
|
+
/* @__PURE__ */ Q(pe, { fallback: /* @__PURE__ */ a(Re, {}), children: [
|
|
302
|
+
o && /* @__PURE__ */ a(je, { isOpen: o, onCancel: w, onSuccess: F }),
|
|
303
|
+
E && /* @__PURE__ */ a(Ye, { isOpen: E, onCancel: U, onSuccess: Y }),
|
|
304
|
+
i && S && /* @__PURE__ */ a(He, { isOpen: i, resourceId: S.assetId, onCancel: j, onSuccess: z }),
|
|
305
|
+
h && /* @__PURE__ */ a(ze, { edit: !0, isOpen: h, onCancel: l, onSuccess: n }),
|
|
306
|
+
m && S && /* @__PURE__ */ a(Ue, { mode: "update", isOpen: m, resourceId: S.assetId, updateResource: T, onCancel: y, onSuccess: I, children: (v, A, d, q, G) => r === "blog" && Se("createPublic", t) && /* @__PURE__ */ a(Ee, { appCode: r, isUpdating: A, resource: v, watch: d, setValue: q, register: G }) }),
|
|
307
|
+
M && S && /* @__PURE__ */ a(Oe, { isOpen: M, shareResource: V, shareOptions: {
|
|
302
308
|
resourceCreatorId: S.creatorId,
|
|
303
309
|
resourceId: S.assetId,
|
|
304
310
|
resourceRights: S.rights
|
|
305
|
-
}, onCancel: _, onSuccess: N, children:
|
|
306
|
-
P && S && /* @__PURE__ */ a(
|
|
311
|
+
}, onCancel: _, onSuccess: N, children: r === "blog" ? /* @__PURE__ */ a(Ce, { resourceId: S.assetId, updateResource: T }) : null }),
|
|
312
|
+
P && S && /* @__PURE__ */ a(Ve, { isOpen: P, onCancel: k, onSuccess: H })
|
|
307
313
|
] })
|
|
308
314
|
] });
|
|
309
315
|
}
|
|
310
316
|
export {
|
|
311
|
-
|
|
317
|
+
rs as default
|
|
312
318
|
};
|
package/lib/AppAction.js
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Suspense as
|
|
1
|
+
import { jsxs as h, Fragment as S, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense as A, lazy as x } from "react";
|
|
3
3
|
import { Plus as O } from "@edifice-ui/icons";
|
|
4
|
-
import { useToggle as P, useOdeClient as R, Button as
|
|
5
|
-
import { useTranslation as
|
|
6
|
-
import { u as
|
|
4
|
+
import { useToggle as P, useOdeClient as R, Button as y, LoadingScreen as I, isActionAvailable as k, BlogPublic as F } from "@edifice-ui/react";
|
|
5
|
+
import { useTranslation as T } from "react-i18next";
|
|
6
|
+
import { u as j, a as v, b as B, c as w, d as z, e as L, g as M } from "./index2.js";
|
|
7
|
+
import "@dnd-kit/core";
|
|
8
|
+
import "@dnd-kit/modifiers";
|
|
7
9
|
import "edifice-ts-client";
|
|
8
10
|
import "i18next";
|
|
9
11
|
import "zustand";
|
|
10
12
|
import "@tanstack/react-query";
|
|
11
|
-
const
|
|
12
|
-
function
|
|
13
|
-
const [
|
|
14
|
-
appCode:
|
|
13
|
+
const N = /* @__PURE__ */ x(async () => await import("./ResourceModal.js"));
|
|
14
|
+
function Z() {
|
|
15
|
+
const [c, s] = P(), a = j((t) => t.config), {
|
|
16
|
+
appCode: o
|
|
15
17
|
} = R(), {
|
|
16
|
-
t:
|
|
17
|
-
} =
|
|
18
|
+
t: i
|
|
19
|
+
} = T(o), {
|
|
18
20
|
clearSelectedItems: l,
|
|
19
|
-
clearSelectedIds:
|
|
20
|
-
} =
|
|
21
|
-
data:
|
|
22
|
-
} =
|
|
23
|
-
return
|
|
24
|
-
/* @__PURE__ */ e(
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
searchParams:
|
|
28
|
-
folderId:
|
|
21
|
+
clearSelectedIds: u
|
|
22
|
+
} = v(), {
|
|
23
|
+
data: r
|
|
24
|
+
} = B(a == null ? void 0 : a.actions), m = r == null ? void 0 : r.find((t) => t.id === "create"), n = w(), d = z(), p = L();
|
|
25
|
+
return m ? /* @__PURE__ */ h(S, { children: [
|
|
26
|
+
/* @__PURE__ */ e(y, { type: "button", color: "primary", variant: "filled", leftIcon: /* @__PURE__ */ e(O, {}), className: "ms-auto", onClick: () => {
|
|
27
|
+
if (o == "scrapbook") {
|
|
28
|
+
M({
|
|
29
|
+
searchParams: p,
|
|
30
|
+
folderId: n.id
|
|
29
31
|
});
|
|
30
32
|
return;
|
|
31
33
|
}
|
|
32
|
-
l(),
|
|
33
|
-
}, children:
|
|
34
|
-
/* @__PURE__ */ e(
|
|
34
|
+
l(), u(), s();
|
|
35
|
+
}, children: i("explorer.create.title") }),
|
|
36
|
+
/* @__PURE__ */ e(A, { fallback: /* @__PURE__ */ e(I, {}), children: c && /* @__PURE__ */ e(N, { mode: "create", currentFolder: n, createResource: d, isOpen: c, onSuccess: s, onCancel: s, children: (t, f, C, g, b) => o === "blog" && k("createPublic", r) && /* @__PURE__ */ e(F, { appCode: o, isUpdating: f, resource: t, watch: C, setValue: g, register: b }) }) })
|
|
35
37
|
] }) : null;
|
|
36
38
|
}
|
|
37
39
|
export {
|
|
38
|
-
|
|
40
|
+
Z as default
|
|
39
41
|
};
|
package/lib/DeleteModal.js
CHANGED
|
@@ -2,13 +2,15 @@ import { jsxs as s, jsx as l } from "react/jsx-runtime";
|
|
|
2
2
|
import { Modal as a, Button as d } from "@edifice-ui/react";
|
|
3
3
|
import { createPortal as m } from "react-dom";
|
|
4
4
|
import { useTranslation as p } from "react-i18next";
|
|
5
|
-
import {
|
|
5
|
+
import { w as c, x as h, f 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
|
function f({
|
|
13
15
|
onSuccess: t
|
|
14
16
|
}) {
|
|
@@ -25,7 +27,7 @@ function f({
|
|
|
25
27
|
onDelete: o
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
|
-
function
|
|
30
|
+
function v({
|
|
29
31
|
isOpen: t,
|
|
30
32
|
onSuccess: i = () => ({}),
|
|
31
33
|
onCancel: r = () => ({})
|
|
@@ -48,5 +50,5 @@ function j({
|
|
|
48
50
|
] }), document.getElementById("portal"));
|
|
49
51
|
}
|
|
50
52
|
export {
|
|
51
|
-
|
|
53
|
+
v as default
|
|
52
54
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Files as s } from "@edifice-ui/icons";
|
|
3
|
+
import { AppIcon as l } from "@edifice-ui/react";
|
|
4
|
+
function n({
|
|
5
|
+
app: e,
|
|
6
|
+
type: i
|
|
7
|
+
}) {
|
|
8
|
+
return i === "folder" ? /* @__PURE__ */ r(s, { width: "24", height: "24", className: `color-app-${e == null ? void 0 : e.displayName}` }) : i === "resource" ? /* @__PURE__ */ r(l, { app: e, iconFit: "ratio", size: "24", variant: "rounded" }) : null;
|
|
9
|
+
}
|
|
10
|
+
const g = ({
|
|
11
|
+
app: e,
|
|
12
|
+
type: i,
|
|
13
|
+
name: t
|
|
14
|
+
}) => /* @__PURE__ */ a("div", { className: "d-inline-flex align-items-center card is-selected gap-8", style: {
|
|
15
|
+
flexDirection: "row",
|
|
16
|
+
width: "252px",
|
|
17
|
+
height: "32px",
|
|
18
|
+
boxShadow: "0 0.2rem 0.6em rgba(0, 0, 0, 0.15)"
|
|
19
|
+
}, children: [
|
|
20
|
+
/* @__PURE__ */ r("div", { className: "ms-8", children: /* @__PURE__ */ r(n, { app: e, type: i }) }),
|
|
21
|
+
/* @__PURE__ */ r("div", { className: "text-truncate", children: t })
|
|
22
|
+
] });
|
|
23
|
+
export {
|
|
24
|
+
g as D
|
|
25
|
+
};
|