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.
Files changed (69) hide show
  1. package/dist/index.html +48 -48
  2. package/dist/index.js +1387 -76618
  3. package/dist/version.txt +1 -1
  4. package/explorer.d.ts +1 -1
  5. package/lib/ActionBarContainer.js +175 -175
  6. package/lib/AppAction.js +26 -30
  7. package/lib/DeleteModal.js +8 -14
  8. package/lib/DraggableCard.js +25 -0
  9. package/lib/EmptyScreenApp.js +22 -25
  10. package/lib/ExportModal.js +24 -30
  11. package/lib/FolderModal.js +14 -18
  12. package/lib/FoldersList.js +84 -47
  13. package/lib/Library.js +25 -27
  14. package/lib/MoveModal.js +65 -56
  15. package/lib/ResourcesList.js +98 -81
  16. package/lib/components/EmptyScreens/EmptyScreenApp.d.ts +0 -1
  17. package/lib/components/EmptyScreens/EmptyScreenError.d.ts +0 -1
  18. package/lib/components/EmptyScreens/EmptyScreenNoContentInFolder.d.ts +0 -1
  19. package/lib/components/EmptyScreens/EmptyScreenSearch.d.ts +0 -1
  20. package/lib/components/Explorer.d.ts +1 -1
  21. package/lib/components/LoadMore.d.ts +1 -2
  22. package/lib/components/OnboardingModal.d.ts +1 -1
  23. package/lib/config/dndkit.d.ts +2 -0
  24. package/lib/config/{getExplorerConfig.d.ts → explorer.d.ts} +5 -1
  25. package/lib/config/index.d.ts +2 -0
  26. package/lib/features/AccessControl/AccessControl.d.ts +2 -2
  27. package/lib/features/AccessControl/useAccessControl.d.ts +1 -1
  28. package/lib/features/ActionBar/Delete/DeleteModal.d.ts +1 -2
  29. package/lib/features/ActionBar/Disable/DisableModal.d.ts +1 -2
  30. package/lib/features/ActionBar/Export/ExportModal.d.ts +1 -2
  31. package/lib/features/ActionBar/Folder/FolderModal.d.ts +1 -2
  32. package/lib/features/ActionBar/Folder/useFolderModal.d.ts +5 -5
  33. package/lib/features/ActionBar/Move/MoveModal.d.ts +1 -2
  34. package/lib/features/ActionBar/Move/useMoveModal.d.ts +3 -4
  35. package/lib/features/ActionBar/Publish/PublishModal.d.ts +1 -1
  36. package/lib/features/ActionBar/Resource/ResourceModal.d.ts +1 -1
  37. package/lib/features/ActionBar/Share/ShareModal.d.ts +1 -1
  38. package/lib/features/ActionBar/Trash/TrashModal.d.ts +1 -2
  39. package/lib/features/ActionBar/useActionBar.d.ts +2 -2
  40. package/lib/features/DndKit/useDndKit.d.ts +7 -0
  41. package/lib/features/List/DraggableCard.d.ts +6 -0
  42. package/lib/features/List/FolderCard.d.ts +8 -4
  43. package/lib/features/List/FoldersList.d.ts +2 -2
  44. package/lib/features/List/ResourceCard.d.ts +3 -3
  45. package/lib/features/List/ResourcesList.d.ts +2 -2
  46. package/lib/features/SearchForm/useSearchForm.d.ts +1 -2
  47. package/lib/i18n.d.ts +1 -1
  48. package/lib/index.d.ts +2 -2
  49. package/lib/index.js +3 -12
  50. package/lib/index2.js +1018 -951
  51. package/lib/providers/index.d.ts +6 -0
  52. package/lib/services/api/index.d.ts +16 -16
  53. package/lib/services/queries/actions.d.ts +18 -0
  54. package/lib/services/queries/index.d.ts +46 -0
  55. package/lib/services/resource/service.d.ts +11 -0
  56. package/lib/store/index.d.ts +89 -35
  57. package/lib/utils/getChildrenIds.d.ts +2 -0
  58. package/lib/utils/isResourceShared.d.ts +1 -1
  59. package/package.json +52 -53
  60. package/lib/utils/TreeNodeFolderWrapper.d.ts +0 -12
  61. package/lib/utils/addNode.d.ts +0 -6
  62. package/lib/utils/deleteNode.d.ts +0 -4
  63. package/lib/utils/findNodeById.d.ts +0 -2
  64. package/lib/utils/getAncestors.d.ts +0 -2
  65. package/lib/utils/hasChildren.d.ts +0 -2
  66. package/lib/utils/modifyNode.d.ts +0 -2
  67. package/lib/utils/moveNode.d.ts +0 -5
  68. package/lib/utils/updateNode.d.ts +0 -6
  69. package/lib/utils/wrapTreeNode.d.ts +0 -3
package/dist/version.txt CHANGED
@@ -1 +1 @@
1
- ode-explorer=1.0-b2school-SNAPSHOT 20/09/2024 12:43:39
1
+ ode-explorer= 25/10/2024 16:19:14
package/explorer.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./dist/ode-explorer";
1
+ export * from './dist/ode-explorer';
@@ -1,277 +1,277 @@
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 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 { 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";
9
- import "i18next";
10
- import "zustand";
11
- import "@tanstack/react-query";
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 [d, t] = L(!1), {
13
+ const [p, o] = L(!1), {
18
14
  user: E
19
- } = pe(), h = X();
15
+ } = he(), i = J();
20
16
  Z(() => {
21
17
  f();
22
- }, [n, o]);
23
- 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);
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 m = await D.rights().sessionHasResourceRight(n, r);
30
- t(m);
25
+ const R = await D.rights().sessionHasResourceRight(r, n);
26
+ o(R);
31
27
  }
32
- }, p = async function(l) {
33
- if (n instanceof Array) {
34
- const r = await D.rights().sessionHasAtLeastOneResourceRightForEachList(n, l);
35
- t(r);
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 r = await D.rights().sessionHasResourceRightForEachList(n, l);
38
- t(r);
33
+ const n = await D.rights().sessionHasResourceRightForEachList(r, l);
34
+ o(n);
39
35
  }
40
36
  }, f = async function() {
41
- var l, r, m;
42
- if (n === void 0) {
43
- t(!0);
37
+ var l, n, R;
38
+ if (r === void 0) {
39
+ o(!0);
44
40
  return;
45
41
  }
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);
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 (o instanceof Array)
51
- if (o.length > 0)
52
- if (typeof o[0] == "string")
53
- await R(o);
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 b = o.map((I) => I.rights);
56
- await p(b);
51
+ const y = s.map((I) => I.rights);
52
+ await h(y);
57
53
  }
58
54
  else
59
- t(!1);
55
+ o(!1);
60
56
  else
61
- typeof o == "string" ? await R(o) : await R(o.rights);
57
+ typeof s == "string" ? await m(s) : await m(s.rights);
62
58
  };
63
59
  return {
64
- visible: d,
60
+ visible: p,
65
61
  refreshState: f
66
62
  };
67
63
  }
68
64
  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,
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: x
70
+ clearSelectedIds: F
75
71
  } = te(), {
76
- data: H
77
- } = Fe();
72
+ data: U
73
+ } = Be(i == null ? void 0 : i.actions);
78
74
  Z(() => {
79
- if (p.length === 0 && r.length === 0) {
80
- o(!1);
75
+ if (h.length === 0 && n.length === 0) {
76
+ s(!1);
81
77
  return;
82
78
  }
83
79
  if (I) {
84
- o(!1);
80
+ s(!1);
85
81
  return;
86
82
  }
87
- o(!0);
88
- }, [p, r]);
89
- async function U(e) {
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 p.length > 0 ? N(f[0]) : k({
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 ie();
98
+ return le();
99
99
  case c.MOVE:
100
- return d("move");
100
+ return p("move");
101
101
  case c.PRINT:
102
- return P();
102
+ return k();
103
103
  case c.DELETE:
104
- return d("delete");
104
+ return p("delete");
105
105
  case c.RESTORE:
106
- return await F();
106
+ return await x();
107
107
  case c.PUBLISH:
108
- return d("publish");
108
+ return p("publish");
109
109
  case c.UPD_PROPS:
110
110
  case "edit":
111
- return le();
111
+ return ue();
112
112
  case c.SHARE:
113
- return d("share");
113
+ return p("share");
114
114
  case c.EXPORT:
115
- return d("export");
115
+ return p("export");
116
116
  default:
117
117
  throw Error(`Unknown action: ${e.id}`);
118
118
  }
119
119
  }
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;
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 C;
126
+ return O;
127
127
  case c.COPY:
128
- return C && O;
128
+ return O && C;
129
129
  case c.PUBLISH:
130
- return C && O;
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 "export":
133
+ case c.SHARE:
136
134
  return C && O;
135
+ case "export":
136
+ return O && C;
137
137
  case c.PRINT:
138
- return C && O;
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 j = () => !0;
146
- async function F() {
145
+ const z = () => !0;
146
+ async function x() {
147
147
  try {
148
- if (m)
149
- await b.mutate();
148
+ if (R)
149
+ await y.mutate();
150
150
  else
151
151
  throw new Error("Cannot restore untrashed resources");
152
- v();
152
+ g();
153
153
  } catch (e) {
154
154
  console.error(e);
155
155
  }
156
156
  }
157
- function v() {
157
+ function g() {
158
158
  var e;
159
- d("void"), t != null && t.id && ((e = document.getElementById(t == null ? void 0 : t.id)) == null || e.focus());
159
+ p("void"), o != null && o.id && ((e = document.getElementById(o == null ? void 0 : o.id)) == null || e.focus());
160
160
  }
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() {
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(), x();
167
+ await _.mutate(e), w(), F();
168
168
  }
169
169
  }
170
- function le() {
171
- if (p && p.length > 0) {
170
+ function ue() {
171
+ if (h && h.length > 0) {
172
172
  const e = f[0].assetId;
173
- (h == null ? void 0 : h.app) == "scrapbook" ? Te({
173
+ (i == null ? void 0 : i.app) === "scrapbook" ? De({
174
174
  searchParams: M,
175
175
  assetId: e
176
- }) : d("edit_resource");
176
+ }) : p("edit_resource");
177
177
  } else
178
- d("edit_folder");
178
+ p("edit_folder");
179
179
  }
180
- function ue(e) {
181
- return e.id === "edit" && r.length > 0 ? "explorer.rename" : `explorer.actions.${e.id}`;
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: F,
185
- actions: m ? h == null ? void 0 : h.trashActions : H,
184
+ onRestore: x,
185
+ actions: R ? i == null ? void 0 : i.trashActions : U,
186
186
  selectedElement: [...f, ...l],
187
- 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",
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: 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,
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: s === "export",
211
- onExportCancel: ce,
212
- onExportSuccess: ae,
213
- onClearActionBar: v
210
+ isExportModalOpen: t === "export",
211
+ onExportCancel: ae,
212
+ onExportSuccess: ie,
213
+ onClearActionBar: g
214
214
  };
215
215
  }
216
- function _e({
217
- resourceRights: n,
218
- roleExpected: o,
219
- action: s,
220
- children: d,
221
- renderWhenForbidden: t
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: h
226
+ overrideLabel: i
227
227
  } = oe(), {
228
- visible: R
229
- } = Le({
230
- roles: o,
231
- rights: n,
232
- action: s == null ? void 0 : s.id
228
+ visible: m
229
+ } = Ne({
230
+ roles: s,
231
+ rights: r,
232
+ action: t == null ? void 0 : t.id
233
233
  }), {
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, {});
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 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() {
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: n
244
- } = he(), {
245
- t: o
243
+ appCode: r
244
+ } = fe(), {
245
+ t: s
246
246
  } = ee(), {
247
- actions: s,
248
- selectedElement: d,
249
- isMoveModalOpen: t,
247
+ actions: t,
248
+ selectedElement: p,
249
+ isMoveModalOpen: o,
250
250
  isDeleteModalOpen: E,
251
- isPublishModalOpen: h,
252
- isActionBarOpen: R,
253
- isEditFolderOpen: p,
251
+ isPublishModalOpen: i,
252
+ isActionBarOpen: m,
253
+ isEditFolderOpen: h,
254
254
  overrideLabel: f,
255
255
  onEditFolderCancel: l,
256
- onEditFolderSuccess: r,
257
- isEditResourceOpen: m,
258
- onEditResourceCancel: b,
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: w,
266
- onMoveCancel: x,
267
- onMoveSuccess: H,
265
+ onExportSuccess: H,
266
+ onMoveCancel: w,
267
+ onMoveSuccess: F,
268
268
  onDeleteCancel: U,
269
269
  onDeleteSuccess: Y,
270
270
  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, {
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(G, { children: [
289
- V((A, g) => g && /* @__PURE__ */ a(ye.div, { className: "position-fixed bottom-0 start-0 end-0", style: {
290
- ...A,
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(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: {
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: n === "blog" ? /* @__PURE__ */ a(Ce, { resourceId: S.assetId, updateResource: T }) : null }),
306
- P && S && /* @__PURE__ */ a(je, { isOpen: P, onCancel: k, onSuccess: w })
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
- es as default
311
+ Ze as default
312
312
  };
package/lib/AppAction.js CHANGED
@@ -1,39 +1,35 @@
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";
7
- import "edifice-ts-client";
8
- import "i18next";
9
- import "zustand";
10
- 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
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: n
17
- } = F(r), {
18
- 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
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
- 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 }) }) })
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
- V as default
34
+ Q as default
39
35
  };
@@ -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 m } from "react-dom";
4
- import { useTranslation as p } from "react-i18next";
5
- import { t as c, v as h, e as u } from "./index2.js";
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 = c(), r = h(), e = u();
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 j({
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
- } = p(), {
29
+ } = h(), {
36
30
  isTrashFolder: o,
37
31
  onDelete: n
38
32
  } = f({
39
33
  onSuccess: i
40
34
  });
41
- return /* @__PURE__ */ m(/* @__PURE__ */ s(a, { isOpen: t, onModalClose: r, id: "deleteModal", children: [
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
- j as default
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
+ };