ode-explorer 1.3.3-develop-pedago.202402271742 → 1.3.3-develop-pedago.202402291533

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.js CHANGED
@@ -69082,6 +69082,8 @@ function useActionBar() {
69082
69082
  return onlyOneSelected;
69083
69083
  case ACTION.MANAGE:
69084
69084
  return onlyOneItemSelected;
69085
+ case ACTION.COPY:
69086
+ return onlyOneItemSelected && noFolderSelected;
69085
69087
  case ACTION.PUBLISH:
69086
69088
  return onlyOneItemSelected && noFolderSelected;
69087
69089
  case ACTION.UPD_PROPS:
package/dist/version.txt CHANGED
@@ -1 +1 @@
1
- ode-explorer=1.0-b2school-SNAPSHOT 27/02/2024 17:42:52
1
+ ode-explorer=1.0-b2school-SNAPSHOT 29/02/2024 15:33:58
@@ -1,10 +1,10 @@
1
- import { jsx as a, Fragment as $, jsxs as J } from "react/jsx-runtime";
1
+ import { jsx as i, Fragment as $, jsxs as J } from "react/jsx-runtime";
2
2
  import { useState as B, useEffect as K, Suspense as ue, lazy as g } from "react";
3
- import { useUser as de, Button as Q, useOdeClient as pe, ActionBar as he, LoadingScreen as fe, isActionAvailable as me, BlogPublic as Re, ShareModal as Se, ShareBlog as Ee } from "@edifice-ui/react";
4
- import { useTransition as Ce, animated as be } from "@react-spring/web";
3
+ import { useUser as de, Button as Q, useOdeClient as pe, ActionBar as he, LoadingScreen as fe, isActionAvailable as me, BlogPublic as Re, ShareModal as Se, ShareBlog as Ce } from "@edifice-ui/react";
4
+ import { useTransition as Ee, animated as Oe } from "@react-spring/web";
5
5
  import { useTranslation as X } from "react-i18next";
6
- import { odeServices as T, ACTION as u } from "edifice-ts-client";
7
- import { e as q, f as ye, b as Oe, h as Ie, i as Z, j as ve, k as Ae, l as ge, m as Me, d as Pe, n as we, u as W, a as Fe, o as Te, p as Be, q as xe, r as De } from "./index2.js";
6
+ import { odeServices as T, ACTION as a } from "edifice-ts-client";
7
+ import { e as q, f as be, b as ye, h as Ie, i as Z, j as ve, k as Ae, l as ge, m as Pe, d as Me, n as we, u as W, a as Fe, o as Te, p as Be, q as xe, r as De } from "./index2.js";
8
8
  import "@edifice-ui/icons";
9
9
  import "i18next";
10
10
  import "zustand";
@@ -15,13 +15,13 @@ function Le({
15
15
  action: o
16
16
  }) {
17
17
  const [h, s] = B(!1), {
18
- user: E
18
+ user: C
19
19
  } = de(), f = q();
20
20
  K(() => {
21
21
  d();
22
22
  }, [n, t]);
23
- const R = async function(i) {
24
- const r = i instanceof Array ? i : [i];
23
+ const R = async function(l) {
24
+ const r = l instanceof Array ? l : [l];
25
25
  if (n instanceof Array) {
26
26
  const m = await T.rights().sessionHasAtLeastOneResourceRight(n, r);
27
27
  s(m);
@@ -29,21 +29,21 @@ function Le({
29
29
  const m = await T.rights().sessionHasResourceRight(n, r);
30
30
  s(m);
31
31
  }
32
- }, c = async function(i) {
32
+ }, c = async function(l) {
33
33
  if (n instanceof Array) {
34
- const r = await T.rights().sessionHasAtLeastOneResourceRightForEachList(n, i);
34
+ const r = await T.rights().sessionHasAtLeastOneResourceRightForEachList(n, l);
35
35
  s(r);
36
36
  } else {
37
- const r = await T.rights().sessionHasResourceRightForEachList(n, i);
37
+ const r = await T.rights().sessionHasResourceRightForEachList(n, l);
38
38
  s(r);
39
39
  }
40
40
  }, d = async function() {
41
- var i, r, m;
41
+ var l, r, m;
42
42
  if (n === void 0) {
43
43
  s(!0);
44
44
  return;
45
45
  }
46
- if (f && ((r = (i = t[0]) == null ? void 0 : i.trashedBy) != null && r.includes(E == null ? void 0 : E.userId)) && o === "restore" && !((m = t[0]) != null && m.trashed)) {
46
+ if (f && ((r = (l = t[0]) == null ? void 0 : l.trashedBy) != null && r.includes(C == null ? void 0 : C.userId)) && o === "restore" && !((m = t[0]) != null && m.trashed)) {
47
47
  s(!0);
48
48
  return;
49
49
  }
@@ -66,12 +66,12 @@ function Le({
66
66
  };
67
67
  }
68
68
  function ee() {
69
- const [n, t] = B(!1), [o, h] = B("void"), [s, E] = B(), f = ye((e) => e.config), R = Oe(), c = Ie(), d = Z(), i = ve(), r = Ae(), m = q(), b = ge(), y = Me(), O = Pe(), x = we(), {
69
+ const [n, t] = B(!1), [o, h] = B("void"), [s, C] = B(), f = be((e) => e.config), R = ye(), c = Ie(), d = Z(), l = ve(), r = Ae(), m = q(), b = ge(), y = Pe(), I = Me(), x = we(), {
70
70
  openResource: D,
71
71
  printSelectedResource: L,
72
72
  openFolder: _,
73
- clearSelectedItems: M,
74
- clearSelectedIds: P
73
+ clearSelectedItems: P,
74
+ clearSelectedIds: M
75
75
  } = W(), {
76
76
  data: N
77
77
  } = Fe();
@@ -88,52 +88,54 @@ function ee() {
88
88
  }, [c, r]);
89
89
  async function k(e) {
90
90
  var F;
91
- switch ((F = document.getElementById("root")) == null || F.setAttribute("aria-hidden", "true"), E(e), e.id) {
92
- case u.OPEN:
91
+ switch ((F = document.getElementById("root")) == null || F.setAttribute("aria-hidden", "true"), C(e), e.id) {
92
+ case a.OPEN:
93
93
  return c.length > 0 ? D(d[0]) : _({
94
- folder: i[0],
95
- folderId: i[0].id
94
+ folder: l[0],
95
+ folderId: l[0].id
96
96
  });
97
- case u.COPY:
97
+ case a.COPY:
98
98
  return ce();
99
- case u.MOVE:
99
+ case a.MOVE:
100
100
  return h("move");
101
- case u.PRINT:
101
+ case a.PRINT:
102
102
  return L();
103
- case u.DELETE:
103
+ case a.DELETE:
104
104
  return h("delete");
105
- case u.RESTORE:
105
+ case a.RESTORE:
106
106
  return await Y();
107
- case u.PUBLISH:
107
+ case a.PUBLISH:
108
108
  return h("publish");
109
- case u.UPD_PROPS:
109
+ case a.UPD_PROPS:
110
110
  case "edit":
111
111
  return ae();
112
112
  case "export":
113
113
  return c.length > 0 ? ie() : null;
114
- case u.SHARE:
114
+ case a.SHARE:
115
115
  return h("share");
116
116
  default:
117
117
  throw Error(`Unknown action: ${e.id}`);
118
118
  }
119
119
  }
120
120
  function H(e) {
121
- const F = c.length + r.length, C = c.length === 1 || r.length === 1, G = F === 1, A = r.length === 0;
121
+ const F = c.length + r.length, E = c.length === 1 || r.length === 1, G = F === 1, O = r.length === 0;
122
122
  switch (e.id) {
123
- case u.OPEN:
123
+ case a.OPEN:
124
124
  return G;
125
- case u.MANAGE:
126
- return C;
127
- case u.PUBLISH:
128
- return C && A;
129
- case u.UPD_PROPS:
130
- return C && A;
131
- case u.SHARE:
132
- return A && C;
125
+ case a.MANAGE:
126
+ return E;
127
+ case a.COPY:
128
+ return E && O;
129
+ case a.PUBLISH:
130
+ return E && O;
131
+ case a.UPD_PROPS:
132
+ return E && O;
133
+ case a.SHARE:
134
+ return O && E;
133
135
  case "export":
134
- return C && A;
135
- case u.PRINT:
136
- return C && A;
136
+ return E && O;
137
+ case a.PRINT:
138
+ return E && O;
137
139
  case "edit":
138
140
  return G;
139
141
  default:
@@ -157,19 +159,19 @@ function ee() {
157
159
  h("void"), s != null && s.id && ((e = document.getElementById(s == null ? void 0 : s.id)) == null || e.focus());
158
160
  }
159
161
  const p = (e) => () => {
160
- o === e && (S(), M(), P());
161
- }, w = p("move"), j = p("move"), I = p("delete"), v = p("delete"), l = p("publish"), z = p("publish"), V = p("edit_folder"), se = p("edit_folder"), te = p("edit_resource"), oe = p("edit_resource"), ne = p("share"), re = p("share");
162
+ o === e && (S(), P(), M());
163
+ }, w = p("move"), j = p("move"), v = p("delete"), A = p("delete"), u = p("publish"), z = p("publish"), V = p("edit_folder"), se = p("edit_folder"), te = p("edit_resource"), oe = p("edit_resource"), ne = p("share"), re = p("share");
162
164
  async function ce() {
163
165
  if (d && d.length > 0) {
164
166
  const e = d[0];
165
- await x.mutate(e), M(), P();
167
+ await x.mutate(e), P(), M();
166
168
  }
167
169
  }
168
170
  function ae() {
169
171
  if (c && c.length > 0) {
170
172
  const e = d[0].assetId;
171
173
  (f == null ? void 0 : f.app) == "scrapbook" ? Te({
172
- searchParams: O,
174
+ searchParams: I,
173
175
  assetId: e
174
176
  }) : h("edit_resource");
175
177
  } else
@@ -179,7 +181,7 @@ function ee() {
179
181
  if (c && c.length > 0) {
180
182
  const e = d[0].assetId;
181
183
  Be({
182
- searchParams: O,
184
+ searchParams: I,
183
185
  assetId: e
184
186
  });
185
187
  }
@@ -190,7 +192,7 @@ function ee() {
190
192
  return {
191
193
  onRestore: Y,
192
194
  actions: m ? f == null ? void 0 : f.trashActions : N,
193
- selectedElement: [...d, ...i],
195
+ selectedElement: [...d, ...l],
194
196
  currentFolderId: R == null ? void 0 : R.id,
195
197
  overrideLabel: le,
196
198
  handleClick: k,
@@ -200,11 +202,11 @@ function ee() {
200
202
  onMoveCancel: w,
201
203
  onMoveSuccess: j,
202
204
  isDeleteModalOpen: o === "delete",
203
- onDeleteCancel: v,
204
- onDeleteSuccess: I,
205
+ onDeleteCancel: A,
206
+ onDeleteSuccess: v,
205
207
  isPublishModalOpen: o === "publish",
206
208
  onPublishCancel: z,
207
- onPublishSuccess: l,
209
+ onPublishSuccess: u,
208
210
  isEditFolderOpen: o === "edit_folder",
209
211
  onEditFolderCancel: se,
210
212
  onEditFolderSuccess: V,
@@ -225,7 +227,7 @@ function _e({
225
227
  renderWhenForbidden: s
226
228
  }) {
227
229
  const {
228
- t: E
230
+ t: C
229
231
  } = X(), {
230
232
  overrideLabel: f
231
233
  } = ee(), {
@@ -237,9 +239,9 @@ function _e({
237
239
  }), {
238
240
  setResourceActionDisable: c
239
241
  } = W(), d = q();
240
- return R ? /* @__PURE__ */ a($, { children: h }) : s ? s() : d && !R ? /* @__PURE__ */ a(Q, { type: "button", color: "primary", variant: "filled", onClick: () => {
242
+ return R ? /* @__PURE__ */ i($, { children: h }) : s ? s() : d && !R ? /* @__PURE__ */ i(Q, { type: "button", color: "primary", variant: "filled", onClick: () => {
241
243
  c(!0);
242
- }, children: E(f(o)) }) : /* @__PURE__ */ a($, {});
244
+ }, children: C(f(o)) }) : /* @__PURE__ */ i($, {});
243
245
  }
244
246
  const Ne = /* @__PURE__ */ g(async () => await import("./PublishModal.js")), ke = /* @__PURE__ */ g(async () => await import("./ResourceModal.js")), He = /* @__PURE__ */ g(async () => await import("./DeleteModal.js")), Ue = /* @__PURE__ */ g(async () => await import("./MoveModal.js")), Ye = /* @__PURE__ */ g(async () => await import("./FolderModal.js"));
245
247
  function We() {
@@ -251,28 +253,28 @@ function We() {
251
253
  actions: o,
252
254
  selectedElement: h,
253
255
  isMoveModalOpen: s,
254
- isDeleteModalOpen: E,
256
+ isDeleteModalOpen: C,
255
257
  isPublishModalOpen: f,
256
258
  isActionBarOpen: R,
257
259
  isEditFolderOpen: c,
258
260
  overrideLabel: d,
259
- onEditFolderCancel: i,
261
+ onEditFolderCancel: l,
260
262
  onEditFolderSuccess: r,
261
263
  isEditResourceOpen: m,
262
264
  onEditResourceCancel: b,
263
265
  onEditResourceSuccess: y,
264
- isShareResourceOpen: O,
266
+ isShareResourceOpen: I,
265
267
  onShareResourceCancel: x,
266
268
  onShareResourceSuccess: D,
267
269
  onMoveCancel: L,
268
270
  onMoveSuccess: _,
269
- onDeleteCancel: M,
270
- onDeleteSuccess: P,
271
+ onDeleteCancel: P,
272
+ onDeleteSuccess: M,
271
273
  onPublishCancel: N,
272
274
  onPublishSuccess: k,
273
275
  isActivable: H,
274
276
  handleClick: U
275
- } = ee(), S = Z()[0], p = xe(n), w = De(n), j = Ce(R, {
277
+ } = ee(), S = Z()[0], p = xe(n), w = De(n), j = Ee(R, {
276
278
  from: {
277
279
  opacity: 0,
278
280
  transform: "translateY(100%)"
@@ -287,16 +289,16 @@ function We() {
287
289
  }
288
290
  });
289
291
  return /* @__PURE__ */ J($, { children: [
290
- j((I, v) => v && /* @__PURE__ */ a(be.div, { className: "position-fixed bottom-0 start-0 end-0 z-3", style: I, children: /* @__PURE__ */ a(he, { children: o == null ? void 0 : o.filter((l) => l.available && l.target === "actionbar").map((l) => H(l) && /* @__PURE__ */ a(_e, { resourceRights: h, roleExpected: l.right, action: l, children: /* @__PURE__ */ a(Q, { id: l.id, type: "button", color: "primary", variant: "filled", onClick: () => {
291
- U(l);
292
- }, children: t(d(l)) }, l.id) }, l.id)) }) })),
293
- /* @__PURE__ */ J(ue, { fallback: /* @__PURE__ */ a(fe, {}), children: [
294
- s && /* @__PURE__ */ a(Ue, { isOpen: s, onCancel: L, onSuccess: _ }),
295
- E && /* @__PURE__ */ a(He, { isOpen: E, onCancel: M, onSuccess: P }),
296
- f && S && /* @__PURE__ */ a(Ne, { isOpen: f, resourceId: S.assetId, onCancel: N, onSuccess: k }),
297
- c && /* @__PURE__ */ a(Ye, { edit: !0, isOpen: c, onCancel: i, onSuccess: r }),
298
- m && S && /* @__PURE__ */ a(ke, { mode: "update", isOpen: m, resourceId: S.assetId, updateResource: w, onCancel: b, onSuccess: y, children: (I, v, l, z, V) => n === "blog" && me("createPublic", o) && /* @__PURE__ */ a(Re, { appCode: n, isUpdating: v, resource: I, watch: l, setValue: z, register: V }) }),
299
- O && S && /* @__PURE__ */ a(Se, { isOpen: O, resourceId: S.assetId, shareResource: p, onCancel: x, onSuccess: D, children: n === "blog" ? /* @__PURE__ */ a(Ee, { resource: S, updateResource: w }) : null })
292
+ j((v, A) => A && /* @__PURE__ */ i(Oe.div, { className: "position-fixed bottom-0 start-0 end-0 z-3", style: v, children: /* @__PURE__ */ i(he, { children: o == null ? void 0 : o.filter((u) => u.available && u.target === "actionbar").map((u) => H(u) && /* @__PURE__ */ i(_e, { resourceRights: h, roleExpected: u.right, action: u, children: /* @__PURE__ */ i(Q, { id: u.id, type: "button", color: "primary", variant: "filled", onClick: () => {
293
+ U(u);
294
+ }, children: t(d(u)) }, u.id) }, u.id)) }) })),
295
+ /* @__PURE__ */ J(ue, { fallback: /* @__PURE__ */ i(fe, {}), children: [
296
+ s && /* @__PURE__ */ i(Ue, { isOpen: s, onCancel: L, onSuccess: _ }),
297
+ C && /* @__PURE__ */ i(He, { isOpen: C, onCancel: P, onSuccess: M }),
298
+ f && S && /* @__PURE__ */ i(Ne, { isOpen: f, resourceId: S.assetId, onCancel: N, onSuccess: k }),
299
+ c && /* @__PURE__ */ i(Ye, { edit: !0, isOpen: c, onCancel: l, onSuccess: r }),
300
+ m && S && /* @__PURE__ */ i(ke, { mode: "update", isOpen: m, resourceId: S.assetId, updateResource: w, onCancel: b, onSuccess: y, children: (v, A, u, z, V) => n === "blog" && me("createPublic", o) && /* @__PURE__ */ i(Re, { appCode: n, isUpdating: A, resource: v, watch: u, setValue: z, register: V }) }),
301
+ I && S && /* @__PURE__ */ i(Se, { isOpen: I, resourceId: S.assetId, shareResource: p, onCancel: x, onSuccess: D, children: n === "blog" ? /* @__PURE__ */ i(Ce, { resource: S, updateResource: w }) : null })
300
302
  ] })
301
303
  ] });
302
304
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ode-explorer",
3
- "version": "1.3.3-develop-pedago.202402271742",
3
+ "version": "1.3.3-develop-pedago.202402291533",
4
4
  "description": "Open Digital Education Explorer",
5
5
  "homepage": "https://github.com/opendigitaleducation/explorer#readme",
6
6
  "bugs": {