@edifice.io/collect-frontend 1.0.11 → 1.0.12-develop.2.20261109161908

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 (116) hide show
  1. package/lib/AppHeaderCollection-BPHwd0pS.js +205 -0
  2. package/lib/CXEL7IU7-bSp8E8Ma.js +42 -0
  3. package/lib/Collection-C6ys5-Bv.js +506 -0
  4. package/lib/CollectionsLayout-B66EiXm4.js +100 -0
  5. package/lib/CollectionsList-BRBbyb-s.js +324 -0
  6. package/lib/DeleteCollectionModal-Cw-IZLvp.js +71 -0
  7. package/lib/DropdownActionTable-BoodZZI9.js +84 -0
  8. package/lib/FormEdit-Di-Y4r45.js +111 -0
  9. package/lib/HASRA6WW-CE5UWlEo.js +9093 -0
  10. package/lib/I3HPI4QX-DcsxmYEr.js +33 -0
  11. package/lib/MembersEdit-WFk8DkwB.js +81 -0
  12. package/lib/MineSubmission-DfAVKzBY.js +27 -0
  13. package/lib/Root-B_xgOphI.js +20 -0
  14. package/lib/SearchBarCollect-DBKaVVDV.js +23 -0
  15. package/lib/Submission-pY2ZvgER.js +337 -0
  16. package/lib/SubmissionList-ZKL__RHu.js +204 -0
  17. package/lib/emptyscreen-list-collection-CWGxO4Ss.js +4 -0
  18. package/lib/index-D-6KhgeS.js +3856 -0
  19. package/lib/index.d.ts +1 -14
  20. package/lib/index.js +19 -15071
  21. package/lib/{components → src/components}/AppHeaderCollection.d.ts +1 -1
  22. package/lib/{features → src/features}/collect-form/components/CollectForm.d.ts +1 -1
  23. package/lib/{features → src/features}/collect-form/components/index.d.ts +1 -1
  24. package/lib/{features → src/features}/collect-form/hooks/useCreateCollectionForm.d.ts +1 -1
  25. package/lib/{features → src/features}/creation-wizard/components/FormCreate.d.ts +1 -1
  26. package/lib/{features → src/features}/creation-wizard/components/Members.d.ts +1 -1
  27. package/lib/{features → src/features}/creation-wizard/components/WizardContext.d.ts +1 -1
  28. package/lib/{features → src/features}/menu/store/menuStore.d.ts +1 -1
  29. package/lib/{hooks → src/hooks}/useSearch.d.ts +1 -1
  30. package/lib/{hooks → src/hooks}/useWizard.d.ts +1 -1
  31. package/lib/src/index.d.ts +14 -0
  32. package/lib/submission.queries-Dt5NuCXz.js +147 -0
  33. package/lib/useGetStatusSubmission-DxHmLPxr.js +57 -0
  34. package/package.json +5 -5
  35. /package/lib/{components → src/components}/AppActionHeader.d.ts +0 -0
  36. /package/lib/{components → src/components}/AppActionHeaderContext.d.ts +0 -0
  37. /package/lib/{components → src/components}/CollectApp/CollectApp.d.ts +0 -0
  38. /package/lib/{components → src/components}/CollectApp/CollectAppContext.d.ts +0 -0
  39. /package/lib/{components → src/components}/CollectAppActionHeader.d.ts +0 -0
  40. /package/lib/{components → src/components}/InstructionCard.d.ts +0 -0
  41. /package/lib/{components → src/components}/SearchBarCollect.d.ts +0 -0
  42. /package/lib/{components → src/components}/SubmissionCard.d.ts +0 -0
  43. /package/lib/{config → src/config}/constants.d.ts +0 -0
  44. /package/lib/{features → src/features}/collect-form/hooks/index.d.ts +0 -0
  45. /package/lib/{features → src/features}/collect-form/index.d.ts +0 -0
  46. /package/lib/{features → src/features}/collection-actions/components/CollectionActions.d.ts +0 -0
  47. /package/lib/{features → src/features}/collection-list/components/CollectionListTable.d.ts +0 -0
  48. /package/lib/{features → src/features}/collection-list/components/CollectionListTableBody.d.ts +0 -0
  49. /package/lib/{features → src/features}/collection-list/components/CollectionListTableFooter.d.ts +0 -0
  50. /package/lib/{features → src/features}/collection-list/components/CollectionListTableHead.d.ts +0 -0
  51. /package/lib/{features → src/features}/collection-list/hooks/useCollectionListTableBody.d.ts +0 -0
  52. /package/lib/{features → src/features}/collection-list/hooks/useCollectionListTableHead.d.ts +0 -0
  53. /package/lib/{features → src/features}/collection-list/hooks/useCollectionPagination.d.ts +0 -0
  54. /package/lib/{features → src/features}/collection-list/store/collectionListStore.d.ts +0 -0
  55. /package/lib/{features → src/features}/collection-submissions-list/components/CollectionSubmissionsList.d.ts +0 -0
  56. /package/lib/{features → src/features}/collection-submissions-list/components/CollectionSubmissionsListMobile.d.ts +0 -0
  57. /package/lib/{features → src/features}/collection-submissions-list/components/CollectionSubmissionsListTr.d.ts +0 -0
  58. /package/lib/{features → src/features}/collection-submissions-list/components/CollectionSubmissionsListView.d.ts +0 -0
  59. /package/lib/{features → src/features}/collection-submissions-list/components/CollectionSubmissionsRender.d.ts +0 -0
  60. /package/lib/{features → src/features}/collection-submissions-list/hooks/useCollectionSubmissionsList.d.ts +0 -0
  61. /package/lib/{features → src/features}/collection-submissions-list/store/collectionSubmissionListStore.d.ts +0 -0
  62. /package/lib/{features → src/features}/creation-wizard/CreationWizard.d.ts +0 -0
  63. /package/lib/{features → src/features}/creation-wizard/components/WizardHeader.d.ts +0 -0
  64. /package/lib/{features → src/features}/creation-wizard/components/WizardLayout.d.ts +0 -0
  65. /package/lib/{features → src/features}/creation-wizard/hooks/useAddMember.d.ts +0 -0
  66. /package/lib/{features → src/features}/creation-wizard/sharing.utils.d.ts +0 -0
  67. /package/lib/{features → src/features}/creation-wizard/store/wizardStore.d.ts +0 -0
  68. /package/lib/{features → src/features}/dropdown-actions/components/DropdownActionTable.d.ts +0 -0
  69. /package/lib/{features → src/features}/dropdown-actions/hooks/useDropdownActionTable.d.ts +0 -0
  70. /package/lib/{features → src/features}/menu/components/CollectMenu.d.ts +0 -0
  71. /package/lib/{features → src/features}/menu/components/DesktopMenu.d.ts +0 -0
  72. /package/lib/{features → src/features}/menu/components/MenuContext.d.ts +0 -0
  73. /package/lib/{features → src/features}/menu/components/MobileMenu.d.ts +0 -0
  74. /package/lib/{features → src/features}/modal/components/DeleteCollectionModal.d.ts +0 -0
  75. /package/lib/{features → src/features}/modal/components/InstructionModal.d.ts +0 -0
  76. /package/lib/{features → src/features}/modal/components/UpdateSubmissionModal.d.ts +0 -0
  77. /package/lib/{features → src/features}/modal/hooks/useDeleteCollectionModal.d.ts +0 -0
  78. /package/lib/{features → src/features}/submission/components/SubmissionEdit.d.ts +0 -0
  79. /package/lib/{features → src/features}/submission/components/SubmissionView.d.ts +0 -0
  80. /package/lib/{features → src/features}/submission-actions/components/SubmissionActions.d.ts +0 -0
  81. /package/lib/{features → src/features}/submission-list/components/SubmissionFilter.d.ts +0 -0
  82. /package/lib/{features → src/features}/submission-list/components/SubmissionsListView.d.ts +0 -0
  83. /package/lib/{features → src/features}/submission-list/hooks/useSubmissionPagination.d.ts +0 -0
  84. /package/lib/{features → src/features}/submission-list/store/submissionListStore.d.ts +0 -0
  85. /package/lib/{hooks → src/hooks}/useGetStatusSubmission.d.ts +0 -0
  86. /package/lib/{hooks → src/hooks}/useStepNavigations.d.ts +0 -0
  87. /package/lib/{hooks → src/hooks}/useSubmissionForm.d.ts +0 -0
  88. /package/lib/{i18n.d.ts → src/i18n.d.ts} +0 -0
  89. /package/lib/{main.d.ts → src/main.d.ts} +0 -0
  90. /package/lib/{models → src/models}/collect.d.ts +0 -0
  91. /package/lib/{models → src/models}/menu.d.ts +0 -0
  92. /package/lib/{pages → src/pages}/Collection.d.ts +0 -0
  93. /package/lib/{pages → src/pages}/CollectionsLayout.d.ts +0 -0
  94. /package/lib/{pages → src/pages}/CollectionsList.d.ts +0 -0
  95. /package/lib/{pages → src/pages}/FormEdit.d.ts +0 -0
  96. /package/lib/{pages → src/pages}/MembersEdit.d.ts +0 -0
  97. /package/lib/{pages → src/pages}/MineSubmission.d.ts +0 -0
  98. /package/lib/{pages → src/pages}/NotFound.d.ts +0 -0
  99. /package/lib/{pages → src/pages}/PageError.d.ts +0 -0
  100. /package/lib/{pages → src/pages}/Root.d.ts +0 -0
  101. /package/lib/{pages → src/pages}/Submission.d.ts +0 -0
  102. /package/lib/{pages → src/pages}/SubmissionList.d.ts +0 -0
  103. /package/lib/{providers → src/providers}/index.d.ts +0 -0
  104. /package/lib/{routes → src/routes}/wizard/wizard.d.ts +0 -0
  105. /package/lib/{services → src/services}/api/collection.service.d.ts +0 -0
  106. /package/lib/{services → src/services}/api/submission.services.d.ts +0 -0
  107. /package/lib/{services → src/services}/api/user.service.d.ts +0 -0
  108. /package/lib/{services → src/services}/queries/collection.queries.d.ts +0 -0
  109. /package/lib/{services → src/services}/queries/index.d.ts +0 -0
  110. /package/lib/{services → src/services}/queries/submission.queries.d.ts +0 -0
  111. /package/lib/{services → src/services}/queries/user.queries.d.ts +0 -0
  112. /package/lib/{store → src/store}/collectionActionStore.d.ts +0 -0
  113. /package/lib/{store → src/store}/createSelectors.d.ts +0 -0
  114. /package/lib/{store → src/store}/userActionStore.d.ts +0 -0
  115. /package/lib/{utils → src/utils}/attachment.d.ts +0 -0
  116. /package/lib/{utils → src/utils}/deadline.d.ts +0 -0
@@ -1,5 +1,5 @@
1
1
  import { CollectionDto, ContribSubmissionStatus } from '@edifice.io/collect-client-rest';
2
- import { CollectionContext } from '../models/collect';
2
+ import { CollectionContext } from '../../models/collect';
3
3
  interface AppHeaderCollectProps {
4
4
  collection: CollectionDto;
5
5
  context: CollectionContext.COLLECTION | CollectionContext.SUBMISSION;
@@ -1,5 +1,5 @@
1
1
  import { CollectionDto } from '@edifice.io/collect-client-rest';
2
- import { WizardData } from '../../../models/collect';
2
+ import { WizardData } from '../../../../models/collect';
3
3
  /**
4
4
  * Reusable collection creation form component.
5
5
  * This component can be used by other applications (e.g., community) to embed a collection creation form
@@ -1,3 +1,3 @@
1
1
  export { default as CollectForm } from './CollectForm';
2
2
  export type { CollectFormProps } from './CollectForm';
3
- export type { WizardData } from '../../../models/collect';
3
+ export type { WizardData } from '../../../../models/collect';
@@ -1,5 +1,5 @@
1
1
  import { CollectionDto } from '@edifice.io/collect-client-rest';
2
- import { WizardData } from '../../../models/collect';
2
+ import { WizardData } from '../../../../models/collect';
3
3
  export interface UseCreateCollectionFormReturn {
4
4
  formData: WizardData;
5
5
  updateFormData: (updates: Partial<WizardData>) => void;
@@ -1,5 +1,5 @@
1
1
  import { CollectionDto } from '@edifice.io/collect-client-rest';
2
- import { WizardData } from '../../../models/collect';
2
+ import { WizardData } from '../../../../models/collect';
3
3
  export declare const FormCreate: ({ wizardData, updateWizardData, collection, onRemoveAttachment, }: {
4
4
  wizardData?: WizardData;
5
5
  updateWizardData?: (data: WizardData) => void;
@@ -1,6 +1,6 @@
1
1
  import { CollectionDto } from '@edifice.io/collect-client-rest';
2
2
  import { SharingItem } from '@edifice.io/react';
3
- import { WizardData } from '../../../models/collect';
3
+ import { WizardData } from '../../../../models/collect';
4
4
  export default function Members({ wizardData, updateWizardData, collection, onSharingsChange, }: {
5
5
  wizardData?: WizardData;
6
6
  updateWizardData?: (updates: Partial<WizardData>) => void;
@@ -1,4 +1,4 @@
1
- import { useWizardProps } from '../../../hooks/useWizard';
1
+ import { useWizardProps } from '../../../../hooks/useWizard';
2
2
  type OmittedProps = Omit<useWizardProps, "triggerRef" | "menuRef">;
3
3
  export interface WizardContextProps extends OmittedProps {
4
4
  block?: boolean;
@@ -1,4 +1,4 @@
1
- import { MenuFilter } from '../../../models/menu';
1
+ import { MenuFilter } from '../../../../models/menu';
2
2
  interface MenuState {
3
3
  mobileMenuOpen: boolean;
4
4
  setMobileMenuOpen: (open: boolean) => void;
@@ -1,6 +1,6 @@
1
1
  import { ChangeEvent } from 'react';
2
2
  import { BookmarkInput, OptionListItemType, SharingItem } from '@edifice.io/react';
3
- import { Visible } from '../services/queries/user.queries';
3
+ import { Visible } from '../../services/queries/user.queries';
4
4
  export declare const useSearch: () => {
5
5
  state: {
6
6
  searchInputValue: string;
@@ -1,4 +1,4 @@
1
- import { WizardData } from '../models/collect';
1
+ import { WizardData } from '../../models/collect';
2
2
  export interface useWizardProps {
3
3
  wizardData: WizardData;
4
4
  updateWizardData: (updates: Partial<WizardData>) => void;
@@ -0,0 +1,14 @@
1
+ export { AppActionHeader } from './components/AppActionHeader';
2
+ export { AppActionHeaderContext, AppActionHeaderProvider, useAppActionHeaderContext, } from './components/AppActionHeaderContext';
3
+ export { default as CollectApp } from './components/CollectApp/CollectApp';
4
+ export type { CollectAppProps } from './components/CollectApp/CollectApp';
5
+ export { CollectAppActionHeader } from './components/CollectAppActionHeader';
6
+ export { CollectMenu } from './features/menu/components/CollectMenu';
7
+ export { MenuContext, MenuProvider, useMenuContext, } from './features/menu/components/MenuContext';
8
+ export { basename, router } from './routes';
9
+ export { Providers, queryClient } from './providers';
10
+ export * from './features/collect-form';
11
+ export type * from './features/collect-form';
12
+ export * as queries from './services/queries';
13
+ export * from '@edifice.io/collect-client-rest';
14
+ export type * from '@edifice.io/collect-client-rest';
@@ -0,0 +1,147 @@
1
+ import { useQuery as b, useQueryClient as a, useMutation as m, useInfiniteQuery as d } from "@tanstack/react-query";
2
+ import { y } from "./index-D-6KhgeS.js";
3
+ import { odeServices as c } from "@edifice.io/client";
4
+ import { SubmissionClient as l } from "@edifice.io/collect-client-rest";
5
+ const S = "/collect/api", u = new l({
6
+ httpService: c.http(),
7
+ baseUrl: S
8
+ }), n = {
9
+ getSubmissions: (e, s) => u.getSubmissions(e, s),
10
+ getSubmission: (e, s) => u.getSubmission(e, s),
11
+ updateSubmission: (e, s, t) => u.updateSubmission(e, s, t),
12
+ addAttachments: async (e, s, t) => {
13
+ const i = new FormData();
14
+ return t.files.forEach((r) => {
15
+ i.append("files", r);
16
+ }), c.http().postFile(
17
+ `${S}/collections/${e}/submissions/${s}/attachments`,
18
+ i,
19
+ { headers: { "Content-Type": "multipart/form-data" } }
20
+ );
21
+ },
22
+ updateSubmissionStatus: (e, s, t) => u.updateSubmissionStatus(e, s, t),
23
+ deleteAttachment: (e, s, t) => u.removeAttachments(
24
+ e,
25
+ s,
26
+ t
27
+ )
28
+ }, o = {
29
+ base: ["submissions"]
30
+ }, p = (e, s) => ({
31
+ queryKey: [...o.base, e, s],
32
+ queryFn: ({ pageParam: t = 1 }) => n.getSubmissions(e, {
33
+ ...s,
34
+ size: y,
35
+ page: t
36
+ }),
37
+ staleTime: 5e3,
38
+ initialPageParam: 1,
39
+ refetchOnMount: !0,
40
+ getNextPageParam: (t) => {
41
+ const { currentPage: i, totalPages: r } = t.meta || {};
42
+ return i < r ? i + 1 : void 0;
43
+ }
44
+ }), A = (e, s) => d(p(e, s)), f = (e, s) => ({
45
+ queryKey: ["submission", s, e],
46
+ queryFn: () => n.getSubmission(e, s),
47
+ staleTime: 0
48
+ }), C = (e, s) => b({
49
+ ...f(e, s),
50
+ enabled: !!s
51
+ }), K = () => {
52
+ const e = a();
53
+ return m({
54
+ mutationFn: ({
55
+ collectionId: s,
56
+ submissionId: t,
57
+ data: i
58
+ }) => n.updateSubmission(s, t, i),
59
+ onSuccess: () => {
60
+ e.invalidateQueries({
61
+ queryKey: [
62
+ ...o.base,
63
+ "submission",
64
+ "collectionsToSubmit"
65
+ ]
66
+ });
67
+ }
68
+ });
69
+ }, F = () => {
70
+ const e = a();
71
+ return m({
72
+ mutationFn: ({
73
+ collectionId: s,
74
+ submissionId: t,
75
+ data: i
76
+ }) => n.updateSubmissionStatus(
77
+ s,
78
+ t,
79
+ i
80
+ ),
81
+ onSuccess: (s, t) => {
82
+ e.invalidateQueries({
83
+ queryKey: o.base
84
+ }), t && e.invalidateQueries({
85
+ queryKey: [
86
+ "submission",
87
+ t.submissionId,
88
+ t.collectionId
89
+ ]
90
+ });
91
+ }
92
+ });
93
+ }, I = () => {
94
+ const e = a();
95
+ return m({
96
+ mutationFn: ({
97
+ collectionId: s,
98
+ submissionId: t,
99
+ files: i
100
+ }) => n.addAttachments(s, t, i),
101
+ onSuccess: (s, t) => {
102
+ e.invalidateQueries({
103
+ queryKey: o.base
104
+ }), t && e.invalidateQueries({
105
+ queryKey: [
106
+ "submission",
107
+ t.submissionId,
108
+ t.collectionId
109
+ ]
110
+ });
111
+ }
112
+ });
113
+ }, O = () => {
114
+ const e = a();
115
+ return m({
116
+ mutationFn: ({
117
+ collectionId: s,
118
+ submissionId: t,
119
+ attachmentId: i
120
+ }) => n.deleteAttachment(
121
+ s,
122
+ t,
123
+ i
124
+ ),
125
+ onSuccess: (s, t) => {
126
+ e.invalidateQueries({
127
+ queryKey: o.base
128
+ }), t && e.invalidateQueries({
129
+ queryKey: [
130
+ "submission",
131
+ t.submissionId,
132
+ t.collectionId
133
+ ]
134
+ });
135
+ }
136
+ });
137
+ };
138
+ export {
139
+ F as a,
140
+ K as b,
141
+ I as c,
142
+ O as d,
143
+ C as e,
144
+ f,
145
+ p as s,
146
+ A as u
147
+ };
@@ -0,0 +1,57 @@
1
+ import { SubmissionStatus as n } from "@edifice.io/collect-client-rest";
2
+ import { useEdificeClient as a } from "@edifice.io/react";
3
+ import { useTranslation as r } from "react-i18next";
4
+ function f() {
5
+ const { appCode: u } = a(), { t } = r(u), s = (o) => ({
6
+ background: !0,
7
+ level: o,
8
+ type: "content"
9
+ }), c = () => ({
10
+ level: "success",
11
+ type: "notification"
12
+ });
13
+ return {
14
+ getSubmissionStatus: ({
15
+ status: o,
16
+ isPastDeadline: i,
17
+ isSubmissionCard: e = !1
18
+ }) => {
19
+ switch (o) {
20
+ case n.SUBMITTED:
21
+ return {
22
+ text: t("collection.submission.status.submitted"),
23
+ variant: s("success")
24
+ };
25
+ case n.EMPTY:
26
+ return {
27
+ text: t(
28
+ i ? "Non rendu" : "collection.submission.status.toSubmit"
29
+ ),
30
+ variant: s(i ? "danger" : "warning")
31
+ };
32
+ case n.DRAFT:
33
+ return {
34
+ text: t(
35
+ i ? "collection.submission.status.submitted" : "collection.submission.status.toSubmit"
36
+ ),
37
+ variant: s(i ? "success" : "warning")
38
+ };
39
+ case n.VERIFIED:
40
+ return {
41
+ text: t(
42
+ e ? "collection.submission.status.submitted" : "collection.submission.status.verified"
43
+ ),
44
+ variant: e ? s("success") : c()
45
+ };
46
+ default:
47
+ return {
48
+ text: t("collection.submissionsList.status.toSubmit"),
49
+ variant: s("warning")
50
+ };
51
+ }
52
+ }
53
+ };
54
+ }
55
+ export {
56
+ f as u
57
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/collect-frontend",
3
- "version": "1.0.11",
3
+ "version": "1.0.12-develop.2.20261109161908",
4
4
  "private": false,
5
5
  "license": "GPL-3.0",
6
6
  "author": "Edifice",
@@ -17,7 +17,7 @@
17
17
  "react-pdf": "10.2.0",
18
18
  "react-router-dom": "6.30.3",
19
19
  "zustand": "4.5.7",
20
- "@edifice.io/collect-client-rest": "1.0.11"
20
+ "@edifice.io/collect-client-rest": "1.0.12-develop.2.20261109161849"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "@edifice.io/bootstrap": "*",
@@ -30,9 +30,9 @@
30
30
  },
31
31
  "devDependencies": {
32
32
  "@axe-core/react": "4.10.2",
33
- "@edifice.io/bootstrap": "2.6.9",
34
- "@edifice.io/client": "2.6.9",
35
- "@edifice.io/react": "2.6.9",
33
+ "@edifice.io/bootstrap": "develop",
34
+ "@edifice.io/client": "develop",
35
+ "@edifice.io/react": "develop",
36
36
  "@tanstack/react-query": "5.81.5",
37
37
  "@tanstack/react-query-devtools": "5.81.5",
38
38
  "@testing-library/jest-dom": "6.5.0",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes