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