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.
Files changed (42) hide show
  1. package/dist/index.html +1 -1
  2. package/dist/index.js +1388 -76626
  3. package/dist/version.txt +1 -1
  4. package/lib/ActionBarContainer.js +172 -166
  5. package/lib/AppAction.js +27 -25
  6. package/lib/DeleteModal.js +6 -4
  7. package/lib/DraggableCard.js +25 -0
  8. package/lib/EmptyScreenApp.js +26 -24
  9. package/lib/ExportModal.js +13 -11
  10. package/lib/FolderModal.js +6 -4
  11. package/lib/FoldersList.js +84 -44
  12. package/lib/Library.js +25 -27
  13. package/lib/MoveModal.js +71 -55
  14. package/lib/ResourcesList.js +96 -73
  15. package/lib/components/Explorer.d.ts +1 -1
  16. package/lib/config/dndkit.d.ts +2 -0
  17. package/lib/config/{getExplorerConfig.d.ts → explorer.d.ts} +5 -1
  18. package/lib/config/index.d.ts +2 -0
  19. package/lib/features/AccessControl/AccessControl.d.ts +1 -1
  20. package/lib/features/ActionBar/Move/useMoveModal.d.ts +3 -4
  21. package/lib/features/ActionBar/useActionBar.d.ts +1 -1
  22. package/lib/features/DndKit/useDndKit.d.ts +7 -0
  23. package/lib/features/List/DraggableCard.d.ts +6 -0
  24. package/lib/features/List/FolderCard.d.ts +6 -2
  25. package/lib/index.d.ts +1 -1
  26. package/lib/index.js +7 -5
  27. package/lib/index2.js +1019 -950
  28. package/lib/providers/index.d.ts +6 -0
  29. package/lib/services/resource/service.d.ts +11 -0
  30. package/lib/store/index.d.ts +87 -33
  31. package/lib/utils/getChildrenIds.d.ts +2 -0
  32. package/package.json +7 -5
  33. package/lib/utils/TreeNodeFolderWrapper.d.ts +0 -12
  34. package/lib/utils/addNode.d.ts +0 -6
  35. package/lib/utils/deleteNode.d.ts +0 -4
  36. package/lib/utils/findNodeById.d.ts +0 -2
  37. package/lib/utils/getAncestors.d.ts +0 -2
  38. package/lib/utils/hasChildren.d.ts +0 -2
  39. package/lib/utils/modifyNode.d.ts +0 -2
  40. package/lib/utils/moveNode.d.ts +0 -5
  41. package/lib/utils/updateNode.d.ts +0 -6
  42. package/lib/utils/wrapTreeNode.d.ts +0 -3
package/dist/version.txt CHANGED
@@ -1 +1 @@
1
- ode-explorer=1.0-b2school-SNAPSHOT 02/10/2024 11:50:36
1
+ ode-explorer=1.0-b2school-SNAPSHOT 07/10/2024 17:39:43
@@ -1,277 +1,283 @@
1
- import { jsx as a, Fragment as G, jsxs as Q } from "react/jsx-runtime";
2
- import { useState as L, useEffect as Z, Suspense as de, lazy as y } from "react";
3
- import { useUser as pe, Button as W, useOdeClient as he, ActionBar as fe, LoadingScreen as me, isActionAvailable as Re, BlogPublic as Se, ShareModal as Ee, ShareBlog as Ce } from "@edifice-ui/react";
4
- import { useTransition as Oe, animated as ye } from "@react-spring/web";
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 { e as X, f as be, b as Ie, h as ve, i as se, j as Ae, k as ge, l as Me, m as Pe, d as we, n as xe, u as te, a as Fe, o as Te, p as Be, q as De } from "./index2.js";
8
- import "@edifice-ui/icons";
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
- function Le({
13
- roles: n,
14
- rights: o,
15
- action: s
13
+ import "@edifice-ui/icons";
14
+ function Ne({
15
+ roles: r,
16
+ rights: s,
17
+ action: t
16
18
  }) {
17
- const [d, t] = L(!1), {
19
+ const [p, o] = L(!1), {
18
20
  user: E
19
- } = pe(), h = X();
21
+ } = he(), i = J();
20
22
  Z(() => {
21
23
  f();
22
- }, [n, o]);
24
+ }, [r, s]);
23
25
  const R = async function(l) {
24
- const r = l instanceof Array ? l : [l];
25
- if (n instanceof Array) {
26
- const m = await D.rights().sessionHasAtLeastOneResourceRight(n, r);
27
- t(m);
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(n, r);
30
- t(m);
31
+ const m = await D.rights().sessionHasResourceRight(r, n);
32
+ o(m);
31
33
  }
32
- }, p = async function(l) {
33
- if (n instanceof Array) {
34
- const r = await D.rights().sessionHasAtLeastOneResourceRightForEachList(n, l);
35
- t(r);
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 r = await D.rights().sessionHasResourceRightForEachList(n, l);
38
- t(r);
39
+ const n = await D.rights().sessionHasResourceRightForEachList(r, l);
40
+ o(n);
39
41
  }
40
42
  }, f = async function() {
41
- var l, r, m;
42
- if (n === void 0) {
43
- t(!0);
43
+ var l, n, m;
44
+ if (r === void 0) {
45
+ o(!0);
44
46
  return;
45
47
  }
46
- if (h && ((r = (l = o[0]) == null ? void 0 : l.trashedBy) != null && r.includes(E == null ? void 0 : E.userId)) && s === "restore" && !((m = o[0]) != null && m.trashed)) {
47
- t(!0);
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 (o instanceof Array)
51
- if (o.length > 0)
52
- if (typeof o[0] == "string")
53
- await R(o);
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 b = o.map((I) => I.rights);
56
- await p(b);
57
+ const y = s.map((I) => I.rights);
58
+ await h(y);
57
59
  }
58
60
  else
59
- t(!1);
61
+ o(!1);
60
62
  else
61
- typeof o == "string" ? await R(o) : await R(o.rights);
63
+ typeof s == "string" ? await R(s) : await R(s.rights);
62
64
  };
63
65
  return {
64
- visible: d,
66
+ visible: p,
65
67
  refreshState: f
66
68
  };
67
69
  }
68
70
  function oe() {
69
- const [n, o] = L(!1), [s, d] = L("void"), [t, E] = L(), h = be((e) => e.config), R = Ie(), p = ve(), f = se(), l = Ae(), r = ge(), m = X(), b = Me(), I = Pe(), M = we(), _ = xe(), {
70
- openResource: N,
71
- printSelectedResource: P,
72
- openFolder: k,
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: x
76
+ clearSelectedIds: F
75
77
  } = te(), {
76
- data: H
77
- } = Fe();
78
+ data: U
79
+ } = Be(i == null ? void 0 : i.actions);
78
80
  Z(() => {
79
- if (p.length === 0 && r.length === 0) {
80
- o(!1);
81
+ if (h.length === 0 && n.length === 0) {
82
+ s(!1);
81
83
  return;
82
84
  }
83
85
  if (I) {
84
- o(!1);
86
+ s(!1);
85
87
  return;
86
88
  }
87
- o(!0);
88
- }, [p, r]);
89
- async function U(e) {
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 p.length > 0 ? N(f[0]) : k({
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 ie();
104
+ return le();
99
105
  case c.MOVE:
100
- return d("move");
106
+ return p("move");
101
107
  case c.PRINT:
102
- return P();
108
+ return k();
103
109
  case c.DELETE:
104
- return d("delete");
110
+ return p("delete");
105
111
  case c.RESTORE:
106
- return await F();
112
+ return await x();
107
113
  case c.PUBLISH:
108
- return d("publish");
114
+ return p("publish");
109
115
  case c.UPD_PROPS:
110
116
  case "edit":
111
- return le();
117
+ return ue();
112
118
  case c.SHARE:
113
- return d("share");
119
+ return p("share");
114
120
  case c.EXPORT:
115
- return d("export");
121
+ return p("export");
116
122
  default:
117
123
  throw Error(`Unknown action: ${e.id}`);
118
124
  }
119
125
  }
120
- function Y(e) {
121
- const B = p.length + r.length, C = p.length === 1 || r.length === 1, K = B === 1, O = r.length === 0;
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 C;
132
+ return O;
127
133
  case c.COPY:
128
- return C && O;
134
+ return O && C;
129
135
  case c.PUBLISH:
130
- return C && O;
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 "export":
139
+ case c.SHARE:
136
140
  return C && O;
141
+ case "export":
142
+ return O && C;
137
143
  case c.PRINT:
138
- return C && O;
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 j = () => !0;
146
- async function F() {
151
+ const z = () => !0;
152
+ async function x() {
147
153
  try {
148
154
  if (m)
149
- await b.mutate();
155
+ await y.mutate();
150
156
  else
151
157
  throw new Error("Cannot restore untrashed resources");
152
- v();
158
+ g();
153
159
  } catch (e) {
154
160
  console.error(e);
155
161
  }
156
162
  }
157
- function v() {
163
+ function g() {
158
164
  var e;
159
- d("void"), t != null && t.id && ((e = document.getElementById(t == null ? void 0 : t.id)) == null || e.focus());
165
+ p("void"), o != null && o.id && ((e = document.getElementById(o == null ? void 0 : o.id)) == null || e.focus());
160
166
  }
161
- const i = (e) => () => {
162
- s === e && (v(), w(), x());
163
- }, J = i("move"), S = i("move"), z = i("delete"), T = i("delete"), V = i("publish"), A = i("publish"), g = i("edit_folder"), u = i("edit_folder"), $ = i("edit_resource"), q = i("edit_resource"), ne = i("share"), re = i("share"), ce = i("export"), ae = i("export");
164
- async function ie() {
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(), x();
173
+ await _.mutate(e), w(), F();
168
174
  }
169
175
  }
170
- function le() {
171
- if (p && p.length > 0) {
176
+ function ue() {
177
+ if (h && h.length > 0) {
172
178
  const e = f[0].assetId;
173
- (h == null ? void 0 : h.app) == "scrapbook" ? Te({
179
+ (i == null ? void 0 : i.app) == "scrapbook" ? De({
174
180
  searchParams: M,
175
181
  assetId: e
176
- }) : d("edit_resource");
182
+ }) : p("edit_resource");
177
183
  } else
178
- d("edit_folder");
184
+ p("edit_folder");
179
185
  }
180
- function ue(e) {
181
- return e.id === "edit" && r.length > 0 ? "explorer.rename" : `explorer.actions.${e.id}`;
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: F,
185
- actions: m ? h == null ? void 0 : h.trashActions : H,
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: ue,
189
- handleClick: U,
190
- isActivable: m ? j : Y,
191
- isActionBarOpen: n,
192
- isMoveModalOpen: s === "move",
193
- onMoveCancel: J,
194
- onMoveSuccess: S,
195
- isDeleteModalOpen: s === "delete",
196
- onDeleteCancel: T,
197
- onDeleteSuccess: z,
198
- isPublishModalOpen: s === "publish",
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: V,
201
- isEditFolderOpen: s === "edit_folder",
202
- onEditFolderCancel: u,
203
- onEditFolderSuccess: g,
204
- isEditResourceOpen: s === "edit_resource",
205
- onEditResourceCancel: q,
206
- onEditResourceSuccess: $,
207
- isShareResourceOpen: s === "share",
208
- onShareResourceCancel: re,
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: s === "export",
211
- onExportCancel: ce,
212
- onExportSuccess: ae,
213
- onClearActionBar: v
216
+ isExportModalOpen: t === "export",
217
+ onExportCancel: ae,
218
+ onExportSuccess: ie,
219
+ onClearActionBar: g
214
220
  };
215
221
  }
216
- function _e({
217
- resourceRights: n,
218
- roleExpected: o,
219
- action: s,
220
- children: d,
221
- renderWhenForbidden: t
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: h
232
+ overrideLabel: i
227
233
  } = oe(), {
228
234
  visible: R
229
- } = Le({
230
- roles: o,
231
- rights: n,
232
- action: s == null ? void 0 : s.id
235
+ } = Ne({
236
+ roles: s,
237
+ rights: r,
238
+ action: t == null ? void 0 : t.id
233
239
  }), {
234
- setResourceActionDisable: p
235
- } = te(), f = X();
236
- return R ? /* @__PURE__ */ a(G, { children: d }) : t ? t() : f && !R ? /* @__PURE__ */ a(W, { type: "button", color: "primary", variant: "filled", onClick: () => {
237
- p(!0);
238
- }, children: E(h(s)) }) : /* @__PURE__ */ a(G, {});
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 Ne = /* @__PURE__ */ y(async () => await import("./PublishModal.js")), ke = /* @__PURE__ */ y(async () => await import("./ResourceModal.js")), He = /* @__PURE__ */ y(async () => await import("./DeleteModal.js")), Ue = /* @__PURE__ */ y(async () => await import("./MoveModal.js")), Ye = /* @__PURE__ */ y(async () => await import("./FolderModal.js")), je = /* @__PURE__ */ y(async () => await import("./ExportModal.js"));
241
- function es() {
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: n
244
- } = he(), {
245
- t: o
249
+ appCode: r
250
+ } = fe(), {
251
+ t: s
246
252
  } = ee(), {
247
- actions: s,
248
- selectedElement: d,
249
- isMoveModalOpen: t,
253
+ actions: t,
254
+ selectedElement: p,
255
+ isMoveModalOpen: o,
250
256
  isDeleteModalOpen: E,
251
- isPublishModalOpen: h,
257
+ isPublishModalOpen: i,
252
258
  isActionBarOpen: R,
253
- isEditFolderOpen: p,
259
+ isEditFolderOpen: h,
254
260
  overrideLabel: f,
255
261
  onEditFolderCancel: l,
256
- onEditFolderSuccess: r,
262
+ onEditFolderSuccess: n,
257
263
  isEditResourceOpen: m,
258
- onEditResourceCancel: b,
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: w,
266
- onMoveCancel: x,
267
- onMoveSuccess: H,
271
+ onExportSuccess: H,
272
+ onMoveCancel: w,
273
+ onMoveSuccess: F,
268
274
  onDeleteCancel: U,
269
275
  onDeleteSuccess: Y,
270
276
  onPublishCancel: j,
271
- onPublishSuccess: F,
272
- isActivable: v,
273
- handleClick: i
274
- } = oe(), S = se()[0], z = Be(n), T = De(n), V = Oe(R, {
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(G, { children: [
289
- V((A, g) => g && /* @__PURE__ */ a(ye.div, { className: "position-fixed bottom-0 start-0 end-0", style: {
290
- ...A,
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(fe, { children: s == null ? void 0 : s.filter((u) => u.available && u.target === "actionbar").map((u) => v(u) && /* @__PURE__ */ a(_e, { resourceRights: d, roleExpected: u.right, action: u, children: /* @__PURE__ */ a(W, { id: u.id, type: "button", color: "primary", variant: "filled", onClick: () => {
293
- i(u);
294
- }, children: o(f(u)) }, u.id) }, u.id)) }) })),
295
- /* @__PURE__ */ Q(de, { fallback: /* @__PURE__ */ a(me, {}), children: [
296
- t && /* @__PURE__ */ a(Ue, { isOpen: t, onCancel: x, onSuccess: H }),
297
- E && /* @__PURE__ */ a(He, { isOpen: E, onCancel: U, onSuccess: Y }),
298
- h && S && /* @__PURE__ */ a(Ne, { isOpen: h, resourceId: S.assetId, onCancel: j, onSuccess: F }),
299
- p && /* @__PURE__ */ a(Ye, { edit: !0, isOpen: p, onCancel: l, onSuccess: r }),
300
- m && S && /* @__PURE__ */ a(ke, { mode: "update", isOpen: m, resourceId: S.assetId, updateResource: T, onCancel: b, onSuccess: I, children: (A, g, u, $, q) => n === "blog" && Re("createPublic", s) && /* @__PURE__ */ a(Se, { appCode: n, isUpdating: g, resource: A, watch: u, setValue: $, register: q }) }),
301
- M && S && /* @__PURE__ */ a(Ee, { isOpen: M, shareResource: z, shareOptions: {
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: n === "blog" ? /* @__PURE__ */ a(Ce, { resourceId: S.assetId, updateResource: T }) : null }),
306
- P && S && /* @__PURE__ */ a(je, { isOpen: P, onCancel: k, onSuccess: w })
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
- es as default
317
+ rs as default
312
318
  };
package/lib/AppAction.js CHANGED
@@ -1,39 +1,41 @@
1
- import { jsxs as b, Fragment as h, jsx as e } from "react/jsx-runtime";
2
- import { Suspense as S, lazy as A } from "react";
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 x, LoadingScreen as y, isActionAvailable as I, BlogPublic as k } from "@edifice-ui/react";
5
- import { useTranslation as F } from "react-i18next";
6
- import { u as T, a as j, b as v, c as B, d as w, g as z } from "./index2.js";
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 L = /* @__PURE__ */ A(async () => await import("./ResourceModal.js"));
12
- function V() {
13
- const [s, t] = P(), {
14
- appCode: r
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: n
17
- } = F(r), {
18
+ t: i
19
+ } = T(o), {
18
20
  clearSelectedItems: l,
19
- clearSelectedIds: i
20
- } = T(), {
21
- data: o
22
- } = j(), u = o == null ? void 0 : o.find((a) => a.id === "create"), c = v(), d = B(), m = w();
23
- return u ? /* @__PURE__ */ b(h, { children: [
24
- /* @__PURE__ */ e(x, { type: "button", color: "primary", variant: "filled", leftIcon: /* @__PURE__ */ e(O, {}), className: "ms-auto", onClick: () => {
25
- if (r == "scrapbook") {
26
- z({
27
- searchParams: m,
28
- folderId: c.id
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(), i(), t();
33
- }, children: n("explorer.create.title") }),
34
- /* @__PURE__ */ e(S, { fallback: /* @__PURE__ */ e(y, {}), children: s && /* @__PURE__ */ e(L, { mode: "create", currentFolder: c, createResource: d, isOpen: s, onSuccess: t, onCancel: t, children: (a, p, f, C, g) => r === "blog" && I("createPublic", o) && /* @__PURE__ */ e(k, { appCode: r, isUpdating: p, resource: a, watch: f, setValue: C, register: g }) }) })
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
- V as default
40
+ Z as default
39
41
  };
@@ -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 { t as c, v as h, e as u } from "./index2.js";
5
+ import { w as c, x as h, f as u } from "./index2.js";
6
6
  import "react";
7
- import "@edifice-ui/icons";
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 j({
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
- j as default
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
+ };