@edifice.io/collect-frontend 0.2.2-develop-pedago.3.20260521162853 → 0.2.2-develop-pedago.3.20260526091524

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 (111) hide show
  1. package/lib/{AppHeaderCollection-Bygtf6Y6.js → AppHeaderCollection-CVS41o0x.js} +2 -2
  2. package/lib/{CXEL7IU7-BKtWvZQ9.js → CXEL7IU7-DGwZXEEO.js} +2 -2
  3. package/lib/{Collection-DFCXwjG4.js → Collection-CwJ2-eta.js} +11 -11
  4. package/lib/{CollectionsLayout-DkuoQwnL.js → CollectionsLayout-CGSL1zDw.js} +8 -8
  5. package/lib/{CollectionsList-CIPOZguU.js → CollectionsList-0EEvHkfa.js} +12 -12
  6. package/lib/{DeleteCollectionModal-DJ5U_vxr.js → DeleteCollectionModal-DcQZJAlS.js} +2 -2
  7. package/lib/{DropdownActionTable-CLcP31Zb.js → DropdownActionTable-Cqi6ajMq.js} +1 -1
  8. package/lib/FormEdit-CFLeOQIk.js +96 -0
  9. package/lib/{HASRA6WW-IVT7aVB1.js → HASRA6WW-Dq1d39CD.js} +140 -140
  10. package/lib/{I3HPI4QX-DhHwoOYv.js → I3HPI4QX-Bv0ymSgu.js} +4 -4
  11. package/lib/{MembersEdit-WslwlZ3C.js → MembersEdit-Bl84dDL-.js} +21 -21
  12. package/lib/{Root--yna-atv.js → Root-D0E_3sg9.js} +1 -1
  13. package/lib/{Submission-C1nocg2H.js → Submission-DvJZ5tnL.js} +38 -39
  14. package/lib/{SubmissionList-DZaBauC6.js → SubmissionList-D4yhmhL7.js} +13 -13
  15. package/lib/index-CK70UFQg.js +3479 -0
  16. package/lib/index.d.ts +1 -14
  17. package/lib/index.js +12 -16
  18. package/lib/{submission.queries-DPbD0xwf.js → submission.queries-BlhqB-Xp.js} +1 -1
  19. package/package.json +2 -3
  20. package/lib/FormEdit-zvCSJJJG.js +0 -102
  21. package/lib/components/AppActionHeader.d.ts +0 -1
  22. package/lib/components/AppActionHeaderContext.d.ts +0 -11
  23. package/lib/components/AppHeaderCollection.d.ts +0 -12
  24. package/lib/components/CollectApp/CollectApp.d.ts +0 -26
  25. package/lib/components/CollectApp/CollectAppContext.d.ts +0 -13
  26. package/lib/components/CollectAppActionHeader.d.ts +0 -4
  27. package/lib/components/InstructionCard.d.ts +0 -5
  28. package/lib/components/SearchBarCollect.d.ts +0 -3
  29. package/lib/components/SubmissionCard.d.ts +0 -7
  30. package/lib/config/constants.d.ts +0 -6
  31. package/lib/features/collect-form/components/CollectForm.d.ts +0 -24
  32. package/lib/features/collect-form/components/index.d.ts +0 -3
  33. package/lib/features/collect-form/hooks/index.d.ts +0 -2
  34. package/lib/features/collect-form/hooks/useCreateCollectionForm.d.ts +0 -20
  35. package/lib/features/collect-form/index.d.ts +0 -3
  36. package/lib/features/collection-actions/components/CollectionActions.d.ts +0 -4
  37. package/lib/features/collection-list/components/CollectionListTable.d.ts +0 -1
  38. package/lib/features/collection-list/components/CollectionListTableBody.d.ts +0 -4
  39. package/lib/features/collection-list/components/CollectionListTableFooter.d.ts +0 -12
  40. package/lib/features/collection-list/components/CollectionListTableHead.d.ts +0 -1
  41. package/lib/features/collection-list/hooks/useCollectionListTableBody.d.ts +0 -7
  42. package/lib/features/collection-list/hooks/useCollectionListTableHead.d.ts +0 -12
  43. package/lib/features/collection-list/hooks/useCollectionPagination.d.ts +0 -11
  44. package/lib/features/collection-list/store/collectionListStore.d.ts +0 -26
  45. package/lib/features/collection-submissions-list/components/CollectionSubmissionsList.d.ts +0 -4
  46. package/lib/features/collection-submissions-list/components/CollectionSubmissionsListMobile.d.ts +0 -4
  47. package/lib/features/collection-submissions-list/components/CollectionSubmissionsListTr.d.ts +0 -4
  48. package/lib/features/collection-submissions-list/components/CollectionSubmissionsListView.d.ts +0 -4
  49. package/lib/features/collection-submissions-list/components/CollectionSubmissionsRender.d.ts +0 -3
  50. package/lib/features/collection-submissions-list/hooks/useCollectionSubmissionsList.d.ts +0 -10
  51. package/lib/features/collection-submissions-list/store/collectionSubmissionListStore.d.ts +0 -16
  52. package/lib/features/creation-wizard/CreationWizard.d.ts +0 -2
  53. package/lib/features/creation-wizard/components/FormCreate.d.ts +0 -7
  54. package/lib/features/creation-wizard/components/Members.d.ts +0 -9
  55. package/lib/features/creation-wizard/components/WizardContext.d.ts +0 -8
  56. package/lib/features/creation-wizard/components/WizardHeader.d.ts +0 -3
  57. package/lib/features/creation-wizard/components/WizardLayout.d.ts +0 -3
  58. package/lib/features/creation-wizard/hooks/useAddMember.d.ts +0 -15
  59. package/lib/features/creation-wizard/sharing.utils.d.ts +0 -12
  60. package/lib/features/creation-wizard/store/wizardStore.d.ts +0 -15
  61. package/lib/features/dropdown-actions/components/DropdownActionTable.d.ts +0 -7
  62. package/lib/features/dropdown-actions/hooks/useDropdownActionTable.d.ts +0 -13
  63. package/lib/features/menu/components/CollectMenu.d.ts +0 -5
  64. package/lib/features/menu/components/DesktopMenu.d.ts +0 -1
  65. package/lib/features/menu/components/MenuContext.d.ts +0 -13
  66. package/lib/features/menu/components/MobileMenu.d.ts +0 -1
  67. package/lib/features/menu/store/menuStore.d.ts +0 -20
  68. package/lib/features/modal/components/DeleteCollectionModal.d.ts +0 -3
  69. package/lib/features/modal/components/InstructionModal.d.ts +0 -4
  70. package/lib/features/modal/components/UpdateSubmissionModal.d.ts +0 -9
  71. package/lib/features/modal/hooks/useDeleteCollectionModal.d.ts +0 -5
  72. package/lib/features/submission/components/SubmissionEdit.d.ts +0 -4
  73. package/lib/features/submission/components/SubmissionView.d.ts +0 -5
  74. package/lib/features/submission-actions/components/SubmissionActions.d.ts +0 -6
  75. package/lib/features/submission-list/components/SubmissionFilter.d.ts +0 -1
  76. package/lib/features/submission-list/components/SubmissionsListView.d.ts +0 -1
  77. package/lib/features/submission-list/hooks/useSubmissionPagination.d.ts +0 -7
  78. package/lib/features/submission-list/store/submissionListStore.d.ts +0 -24
  79. package/lib/hooks/useGetStatusSubmission.d.ts +0 -12
  80. package/lib/hooks/useSearch.d.ts +0 -18
  81. package/lib/hooks/useStepNavigations.d.ts +0 -5
  82. package/lib/hooks/useSubmissionForm.d.ts +0 -12
  83. package/lib/hooks/useWizard.d.ts +0 -13
  84. package/lib/i18n.d.ts +0 -2
  85. package/lib/index-D4Qm52OH.js +0 -3767
  86. package/lib/main.d.ts +0 -0
  87. package/lib/models/collect.d.ts +0 -12
  88. package/lib/models/menu.d.ts +0 -5
  89. package/lib/pages/Collection.d.ts +0 -4
  90. package/lib/pages/CollectionsLayout.d.ts +0 -2
  91. package/lib/pages/CollectionsList.d.ts +0 -3
  92. package/lib/pages/FormEdit.d.ts +0 -4
  93. package/lib/pages/MembersEdit.d.ts +0 -4
  94. package/lib/pages/NotFound.d.ts +0 -1
  95. package/lib/pages/PageError.d.ts +0 -1
  96. package/lib/pages/Root.d.ts +0 -2
  97. package/lib/pages/Submission.d.ts +0 -4
  98. package/lib/pages/SubmissionList.d.ts +0 -3
  99. package/lib/providers/index.d.ts +0 -6
  100. package/lib/routes/wizard/wizard.d.ts +0 -2
  101. package/lib/services/api/collection.service.d.ts +0 -14
  102. package/lib/services/api/submission.services.d.ts +0 -8
  103. package/lib/services/api/user.service.d.ts +0 -77
  104. package/lib/services/queries/collection.queries.d.ts +0 -76
  105. package/lib/services/queries/index.d.ts +0 -1
  106. package/lib/services/queries/submission.queries.d.ts +0 -36
  107. package/lib/services/queries/user.queries.d.ts +0 -76
  108. package/lib/store/collectionActionStore.d.ts +0 -29
  109. package/lib/store/createSelectors.d.ts +0 -10
  110. package/lib/store/submissionActionStore.d.ts +0 -32
  111. package/lib/store/userActionStore.d.ts +0 -26
@@ -2,10 +2,10 @@ import { jsxs as c, jsx as n } from "react/jsx-runtime";
2
2
  import { useEdificeClient as m, Flex as r, Button as u, IconButton as I, useBreakpoint as f, useDate as g, Badge as S } from "@edifice.io/react";
3
3
  import { IconPinOn as O, IconOptions as y, IconSave as L, IconSend as v, IconArrowLeft as M, IconCalendarLight as N } from "@edifice.io/react/icons";
4
4
  import { useTranslation as p } from "react-i18next";
5
- import { u as b, D as w } from "./DropdownActionTable-CLcP31Zb.js";
5
+ import { u as b, D as w } from "./DropdownActionTable-Cqi6ajMq.js";
6
6
  import { ContribSubmissionStatus as x } from "@edifice.io/collect-client-rest";
7
7
  import { create as A } from "zustand";
8
- import { K as H } from "./index-D4Qm52OH.js";
8
+ import { J as H } from "./index-CK70UFQg.js";
9
9
  const D = ({
10
10
  collection: o
11
11
  }) => {
@@ -1,5 +1,5 @@
1
- import { c as s, T as c, a as u, b as i, P as m, C as P, Q as d } from "./HASRA6WW-IVT7aVB1.js";
2
- import { U as v, G as C, y as e } from "./index-D4Qm52OH.js";
1
+ import { c as s, T as c, a as u, b as i, P as m, C as P, Q as d } from "./HASRA6WW-Dq1d39CD.js";
2
+ import { T as v, E as C, x as e } from "./index-CK70UFQg.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,17 +1,17 @@
1
1
  import { jsxs as l, jsx as e, Fragment as Q } from "react/jsx-runtime";
2
2
  import { SubmissionStatus as f, ManagerSubmissionStatus as M, WORKFLOW_RIGHTS as z } from "@edifice.io/collect-client-rest";
3
- import { useDirectory as R, Flex as u, Avatar as P, Badge as v, useEdificeClient as w, Heading as O, Table as C, Button as x, LoadingScreen as T, Modal as I, Dropdown as N, useToast as G, useBreakpoint as j, useDate as K, EmptyScreen as _, Checkbox as Y, Grid as L, useHasWorkflow as J } from "@edifice.io/react";
3
+ import { useDirectory as R, Flex as u, Avatar as P, Badge as v, useEdificeClient as w, Heading as O, Table as C, Button as x, LoadingScreen as T, Modal as I, Dropdown as N, useToast as G, useBreakpoint as j, useDate as _, EmptyScreen as J, Checkbox as K, Grid as L, useHasWorkflow as Y } from "@edifice.io/react";
4
4
  import { useNavigate as $, useParams as X } from "react-router-dom";
5
5
  import { useState as A, useEffect as k } from "react";
6
- import { A as Z, C as q } from "./AppHeaderCollection-Bygtf6Y6.js";
6
+ import { A as Z, C as q } from "./AppHeaderCollection-CVS41o0x.js";
7
7
  import { IconUsers as ee, IconRafterDown as U, IconEdit as te, IconTextPage as se, IconCalendarLight as ne } from "@edifice.io/react/icons";
8
8
  import { useTranslation as D } from "react-i18next";
9
- import { b as ie, d as oe, a as ae } from "./submission.queries-DPbD0xwf.js";
9
+ import { b as ie, d as oe, a as ae } from "./submission.queries-BlhqB-Xp.js";
10
10
  import { create as ce } from "zustand";
11
- import { K as le, ak as re, P as de, u as ue } from "./index-D4Qm52OH.js";
11
+ import { J as le, ai as re, P as de, t as ue } from "./index-CK70UFQg.js";
12
12
  import { u as F } from "./useGetStatusSubmission-DxHmLPxr.js";
13
- import { u as E } from "./DropdownActionTable-CLcP31Zb.js";
14
- import { D as me } from "./DeleteCollectionModal-DJ5U_vxr.js";
13
+ import { u as E } from "./DropdownActionTable-Cqi6ajMq.js";
14
+ import { D as me } from "./DeleteCollectionModal-DcQZJAlS.js";
15
15
  import { Editor as H } from "@edifice.io/react/editor";
16
16
  import { E as he } from "./emptyscreen-list-collection-CWGxO4Ss.js";
17
17
  const W = (t) => {
@@ -300,7 +300,7 @@ const W = (t) => {
300
300
  }, ye = ({
301
301
  collectionId: t
302
302
  }) => {
303
- const { appCode: o } = w(), { t: s } = D(o), r = G(), { lg: c } = j(), [a, g] = A(!1), { selectedSubmissionListMenu: i, setSelectedSubmissionListMenu: b } = B(), h = (i == null ? void 0 : i.status) === f.VERIFIED, { formatDate: n } = K(), y = oe(), m = async (p) => {
303
+ const { appCode: o } = w(), { t: s } = D(o), r = G(), { lg: c } = j(), [a, g] = A(!1), { selectedSubmissionListMenu: i, setSelectedSubmissionListMenu: b } = B(), h = (i == null ? void 0 : i.status) === f.VERIFIED, { formatDate: n } = _(), y = oe(), m = async (p) => {
304
304
  if (i)
305
305
  try {
306
306
  g(!0), await y.mutateAsync({
@@ -379,7 +379,7 @@ const W = (t) => {
379
379
  }
380
380
  ),
381
381
  i.status === f.EMPTY ? /* @__PURE__ */ e(
382
- _,
382
+ J,
383
383
  {
384
384
  imageSrc: he,
385
385
  title: s("collection.collectionList.emptyScreen.title"),
@@ -390,7 +390,7 @@ const W = (t) => {
390
390
  {
391
391
  className: `border rounded p-8 ${h ? "bg-secondary-200 border-secondary" : ""}`,
392
392
  children: /* @__PURE__ */ e(
393
- Y,
393
+ K,
394
394
  {
395
395
  "data-testid": "collect-collection-submissions-list-checkbox-validate",
396
396
  checked: h,
@@ -422,7 +422,7 @@ const W = (t) => {
422
422
  {
423
423
  collection: t,
424
424
  context: q.COLLECTION,
425
- onClickBack: () => o(-1)
425
+ onClickBack: () => o("/list-collections")
426
426
  }
427
427
  ),
428
428
  /* @__PURE__ */ l(L, { className: "flex-grow-1 m-16 gap-24", children: [
@@ -469,7 +469,7 @@ const W = (t) => {
469
469
  ae(s)
470
470
  ), null;
471
471
  }, $e = () => {
472
- const t = X(), o = J(z.COLLECTION_CREATE), { data: s, isLoading: r } = re(
472
+ const t = X(), o = Y(z.COLLECTION_CREATE), { data: s, isLoading: r } = re(
473
473
  Number(t.collectionId)
474
474
  );
475
475
  return r ? /* @__PURE__ */ e(T, {}) : !o || !s ? /* @__PURE__ */ e(de, {}) : /* @__PURE__ */ e(Se, { collection: s });
@@ -1,13 +1,13 @@
1
1
  import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
2
  import { WORKFLOW_RIGHTS as u } from "@edifice.io/collect-client-rest";
3
- import { useEdificeClient as f, useHasWorkflow as C, useBreakpoint as h, Flex as L, AppHeader as S, Breadcrumb as g, Grid as r, LoadingScreen as x } from "@edifice.io/react";
3
+ import { useEdificeClient as f, useHasWorkflow as h, useBreakpoint as C, Flex as L, AppHeader as S, Breadcrumb as g, Grid as r, LoadingScreen as x } from "@edifice.io/react";
4
4
  import { Suspense as N } from "react";
5
5
  import { useLocation as I, Navigate as O, Outlet as A } from "react-router-dom";
6
- import { aj as E, M as a, A as T, e as w } from "./index-D4Qm52OH.js";
7
- const j = async () => null, B = () => {
8
- const { currentApp: l } = f(), { pathname: s } = I(), n = C(u.COLLECTION_CREATE), { header: c, showMenu: i } = E(), { lg: m } = h(), d = c !== !1, o = i !== !1, p = s === "/" || s === `/${a.LIST_COLLECTIONS}`;
6
+ import { ah as E, M as a, A as T, d as w } from "./index-CK70UFQg.js";
7
+ const B = async () => null, F = () => {
8
+ const { currentApp: l } = f(), { pathname: s } = I(), n = h(u.COLLECTION_CREATE), { header: c, showMenu: i } = E(), { lg: d } = C(), m = c !== !1, o = i !== !1, p = s === "/" || s === `/${a.LIST_COLLECTIONS}`;
9
9
  return n !== void 0 && !n && p ? /* @__PURE__ */ e(O, { to: `/${a.LIST_SUBMISSIONS}`, replace: !0 }) : /* @__PURE__ */ t(L, { direction: "column", className: "flex-grow-1", children: [
10
- d && /* @__PURE__ */ e(S, { render: () => /* @__PURE__ */ e(T, {}), children: /* @__PURE__ */ e(g, { app: l }) }),
10
+ m && /* @__PURE__ */ e(S, { render: () => /* @__PURE__ */ e(T, {}), children: /* @__PURE__ */ e(g, { app: l }) }),
11
11
  /* @__PURE__ */ t(r, { className: "flex-grow-1", children: [
12
12
  o && /* @__PURE__ */ e(
13
13
  r.Col,
@@ -28,7 +28,7 @@ const j = async () => null, B = () => {
28
28
  md: "8",
29
29
  lg: o ? "6" : "12",
30
30
  xl: o ? "9" : "12",
31
- className: `${o && m ? "cancel-gap" : ""}`,
31
+ className: `${o && d ? "cancel-gap" : ""}`,
32
32
  children: /* @__PURE__ */ e(N, { fallback: /* @__PURE__ */ e(x, {}), children: /* @__PURE__ */ e(A, {}) })
33
33
  }
34
34
  )
@@ -36,6 +36,6 @@ const j = async () => null, B = () => {
36
36
  ] });
37
37
  };
38
38
  export {
39
- B as Component,
40
- j as loader
39
+ F as Component,
40
+ B as loader
41
41
  };
@@ -1,17 +1,17 @@
1
1
  import { jsx as e, Fragment as T, jsxs as u } from "react/jsx-runtime";
2
2
  import { useState as D, useMemo as L, useCallback as B, useEffect as E } from "react";
3
3
  import { S as A } from "./SearchBarCollect-DBKaVVDV.js";
4
- import { K as F, al as M, W as O, v as R } from "./index-D4Qm52OH.js";
4
+ import { J as F, aj as M, W as O, u as R } from "./index-CK70UFQg.js";
5
5
  import { useDate as $, Table as m, Flex as I, Badge as k, IconButton as S, useEdificeClient as v, EmptyScreen as G, LoadingScreen as j } from "@edifice.io/react";
6
6
  import { useTranslation as N } from "react-i18next";
7
7
  import { E as Q } from "./emptyscreen-list-collection-CWGxO4Ss.js";
8
- import { D as W } from "./DeleteCollectionModal-DJ5U_vxr.js";
8
+ import { D as W } from "./DeleteCollectionModal-DcQZJAlS.js";
9
9
  import { SortDirection as b, CollectionSortField as y } from "@edifice.io/collect-client-rest";
10
10
  import { create as _ } from "zustand";
11
- import { IconOptions as H, IconRafterLeft as K, IconRafterRight as z, IconListOrder as U, IconArrowUp as Y, IconArrowDown as Z } from "@edifice.io/react/icons";
12
- import { t as q } from "i18next";
13
- import { useNavigate as J } from "react-router-dom";
14
- import { D as V } from "./DropdownActionTable-CLcP31Zb.js";
11
+ import { IconOptions as H, IconRafterLeft as z, IconRafterRight as J, IconListOrder as K, IconArrowUp as U, IconArrowDown as Y } from "@edifice.io/react/icons";
12
+ import { t as Z } from "i18next";
13
+ import { useNavigate as q } from "react-router-dom";
14
+ import { D as V } from "./DropdownActionTable-Cqi6ajMq.js";
15
15
  const X = {
16
16
  search: "",
17
17
  sortBy: y.DEADLINE,
@@ -80,7 +80,7 @@ const X = {
80
80
  }, oe = ({
81
81
  collections: n
82
82
  }) => {
83
- const { fromNow: o, formatDate: a } = $(), r = J(), {
83
+ const { fromNow: o, formatDate: a } = $(), r = q(), {
84
84
  isHovered: d,
85
85
  setHoveredCollectionId: s,
86
86
  getBgColor: i,
@@ -145,7 +145,7 @@ const X = {
145
145
  "data-testid": "collect-collection-list-row-action-button",
146
146
  className: "icon-button-hover-no-transition bg-white",
147
147
  type: "button",
148
- "aria-label": q("collection.table.th.action"),
148
+ "aria-label": Z("collection.table.th.action"),
149
149
  color: "tertiary",
150
150
  variant: "filled",
151
151
  icon: /* @__PURE__ */ e(H, {}),
@@ -176,7 +176,7 @@ const X = {
176
176
  {
177
177
  variant: "ghost",
178
178
  color: "tertiary",
179
- icon: /* @__PURE__ */ e(K, {}),
179
+ icon: /* @__PURE__ */ e(z, {}),
180
180
  disabled: !a || d,
181
181
  onClick: i
182
182
  }
@@ -191,7 +191,7 @@ const X = {
191
191
  {
192
192
  variant: "ghost",
193
193
  color: "tertiary",
194
- icon: /* @__PURE__ */ e(z, {}),
194
+ icon: /* @__PURE__ */ e(J, {}),
195
195
  disabled: !r || d || s,
196
196
  onClick: g
197
197
  }
@@ -222,8 +222,8 @@ const X = {
222
222
  label: o("collection.table.th.action")
223
223
  }
224
224
  ], i = (l) => l.sortField && l.sortField === a, g = (l) => {
225
- let c = /* @__PURE__ */ e(U, { width: 16, height: 16 });
226
- return i(l) && (r === b.ASC ? c = /* @__PURE__ */ e(Y, {}) : c = /* @__PURE__ */ e(Z, {})), c;
225
+ let c = /* @__PURE__ */ e(K, { width: 16, height: 16 });
226
+ return i(l) && (r === b.ASC ? c = /* @__PURE__ */ e(U, {}) : c = /* @__PURE__ */ e(Y, {})), c;
227
227
  }, t = B(
228
228
  (l) => {
229
229
  let c = b.ASC;
@@ -2,8 +2,8 @@ import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
2
  import { useEdificeClient as m, useToast as f, Modal as d, Button as C } from "@edifice.io/react";
3
3
  import { IconDelete as h } from "@edifice.io/react/icons";
4
4
  import { useTranslation as p } from "react-i18next";
5
- import { ap as M } from "./index-D4Qm52OH.js";
6
- import { u as D } from "./DropdownActionTable-CLcP31Zb.js";
5
+ import { al as M } from "./index-CK70UFQg.js";
6
+ import { u as D } from "./DropdownActionTable-Cqi6ajMq.js";
7
7
  const y = () => {
8
8
  const { appCode: r } = m(), { t: n } = p(r), e = f(), a = M(), { isDeleteModalOpen: l, onCloseDeleteModal: c, deleteCollectionId: i } = D((o) => ({
9
9
  isDeleteModalOpen: o.isDeleteModalOpen,
@@ -6,7 +6,7 @@ import { IconExternalLink as I, IconEdit as O, IconShare as h, IconDelete as w }
6
6
  import { useTranslation as D } from "react-i18next";
7
7
  import { useNavigate as C } from "react-router-dom";
8
8
  import { create as b } from "zustand";
9
- import { K as M } from "./index-D4Qm52OH.js";
9
+ import { J as M } from "./index-CK70UFQg.js";
10
10
  const T = b((e) => ({
11
11
  isDeleteModalOpen: !1,
12
12
  deleteCollectionId: null,
@@ -0,0 +1,96 @@
1
+ import { jsx as t, jsxs as m } from "react/jsx-runtime";
2
+ import { WORKFLOW_RIGHTS as N } from "@edifice.io/collect-client-rest";
3
+ import { useEdificeClient as x, useBreakpoint as I, useToast as w, useHasWorkflow as E, LoadingScreen as L, Grid as g, Flex as h, Button as C } from "@edifice.io/react";
4
+ import { useState as O } from "react";
5
+ import { useTranslation as F } from "react-i18next";
6
+ import { useParams as P, useNavigate as T } from "react-router-dom";
7
+ import { ap as k, ai as Q, P as R, e as W, t as j } from "./index-CK70UFQg.js";
8
+ import { a as S } from "./submission.queries-BlhqB-Xp.js";
9
+ const K = (n) => async ({ params: i }) => {
10
+ const s = Number(i.collectionId);
11
+ return await n.ensureQueryData(j(s)), await n.prefetchInfiniteQuery(
12
+ S(s)
13
+ ), null;
14
+ }, J = () => {
15
+ const { appCode: n } = x(), { t: i } = F(n), { lg: s } = I(), r = P(), d = T(), u = w(), f = E(N.COLLECTION_CREATE), p = k(), [e, y] = O(void 0), { data: o, isLoading: a } = Q(
16
+ Number(r.collectionId)
17
+ );
18
+ if (a)
19
+ return /* @__PURE__ */ t(L, {});
20
+ if (!f || !o) return /* @__PURE__ */ t(R, {});
21
+ const b = async () => {
22
+ const c = Number(r.collectionId);
23
+ if (!c) return;
24
+ const l = {
25
+ title: (e == null ? void 0 : e.title) ?? o.name ?? "",
26
+ description: (e == null ? void 0 : e.description) ?? o.content ?? "",
27
+ deadline: (e == null ? void 0 : e.deadline) ?? (o.deadline ? new Date(o.deadline) : void 0),
28
+ attachments: (e == null ? void 0 : e.attachments) ?? [],
29
+ sharings: (e == null ? void 0 : e.sharings) ?? []
30
+ };
31
+ try {
32
+ await p.mutateAsync({
33
+ id: c,
34
+ data: {
35
+ name: l.title,
36
+ content: l.description,
37
+ deadline: l.deadline ?? /* @__PURE__ */ new Date()
38
+ }
39
+ }), u.success(i("collection.toast.success.collection.update"), {
40
+ duration: 1e4,
41
+ isDismissible: !0
42
+ }), d(`/list-collections/id/${c}`);
43
+ } catch (v) {
44
+ u.error(i("collection.toast.error.collection.update"), {
45
+ duration: 1e4,
46
+ isDismissible: !0
47
+ }), console.log(v);
48
+ }
49
+ };
50
+ return /* @__PURE__ */ m("div", { className: "w-100", children: [
51
+ /* @__PURE__ */ t(g, { className: "flex-grow-1 gap-64 px-md-8 px-lg-48 position-relative", children: /* @__PURE__ */ t(g.Col, { sm: "4", md: "8", xl: "12", className: `${s && "ms-64"}`, children: /* @__PURE__ */ t(
52
+ h,
53
+ {
54
+ direction: "column",
55
+ gap: "16",
56
+ className: "h-100 py-24 pb-lg-48 pt-lg-32",
57
+ children: /* @__PURE__ */ t(
58
+ W,
59
+ {
60
+ collection: o,
61
+ updateWizardData: y
62
+ }
63
+ )
64
+ }
65
+ ) }) }),
66
+ /* @__PURE__ */ m(h, { justify: "end", className: "mt-auto px-48 pb-64 gap-16", children: [
67
+ /* @__PURE__ */ t(
68
+ C,
69
+ {
70
+ variant: "outline",
71
+ color: "primary",
72
+ isLoading: a,
73
+ onClick: () => d(-1),
74
+ "data-testid": "collect-cancel-sharings-button",
75
+ children: i("collection.cancel")
76
+ }
77
+ ),
78
+ /* @__PURE__ */ t(
79
+ C,
80
+ {
81
+ variant: "filled",
82
+ color: "primary",
83
+ isLoading: a || p.isPending,
84
+ loadingPosition: "right",
85
+ onClick: b,
86
+ "data-testid": "collect-save-sharings-button",
87
+ children: i("collection.form.edit.save")
88
+ }
89
+ )
90
+ ] })
91
+ ] });
92
+ };
93
+ export {
94
+ J as FormEdit,
95
+ K as loader
96
+ };