@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
@@ -0,0 +1,205 @@
1
+ import { jsxs as d, jsx as n } from "react/jsx-runtime";
2
+ import { useEdificeClient as p, Flex as m, Button as u, IconButton as f, useBreakpoint as g, useDate as O, Badge as y } from "@edifice.io/react";
3
+ import { IconPinOn as D, IconOptions as T, IconSave as L, IconSend as N, IconArrowLeft as v, IconCalendarLight as M } from "@edifice.io/react/icons";
4
+ import { useTranslation as h } from "react-i18next";
5
+ import { u as A, D as H } from "./DropdownActionTable-BoodZZI9.js";
6
+ import { ContribSubmissionStatus as w } from "@edifice.io/collect-client-rest";
7
+ import { create as x } from "zustand";
8
+ import { c as P, m as U } from "./index-D-6KhgeS.js";
9
+ const B = ({
10
+ collection: s
11
+ }) => {
12
+ const { appCode: t } = p(), { t: e } = h(t), i = A.use.onOpenInstructionModal();
13
+ return /* @__PURE__ */ d(m, { gap: "16", justify: "end", children: [
14
+ /* @__PURE__ */ n(
15
+ u,
16
+ {
17
+ "data-testid": "collect-collection-actions-button-instruction",
18
+ variant: "outline",
19
+ color: "primary",
20
+ leftIcon: /* @__PURE__ */ n(D, {}),
21
+ onClick: i,
22
+ children: e("collection.appHeaderCollection.collection.button.instruction")
23
+ }
24
+ ),
25
+ /* @__PURE__ */ n(H, { collectionId: s.id, isCollection: !0, children: (o) => /* @__PURE__ */ n(
26
+ f,
27
+ {
28
+ ...o,
29
+ className: "icon-button-hover-no-transition bg-white",
30
+ type: "button",
31
+ "aria-label": "label",
32
+ "data-testid": "collect-collection-actions-button-options",
33
+ color: "primary",
34
+ variant: "outline",
35
+ icon: /* @__PURE__ */ n(T, {})
36
+ }
37
+ ) })
38
+ ] });
39
+ }, k = x((s) => ({
40
+ submissionId: null,
41
+ submissionUpdatedAt: null,
42
+ submissionContent: "",
43
+ isUpdateSubmissionModalOpen: !1,
44
+ submissionHasContent: !1,
45
+ submissionAttachments: [],
46
+ submissionPersistedAttachmentIds: [],
47
+ submissionAttachmentIdsToDelete: [],
48
+ submissionIsLoading: !1,
49
+ onOpenUpdateSubmissionModal: () => s({ isUpdateSubmissionModalOpen: !0 }),
50
+ onCloseUpdateSubmissionModal: () => s({ isUpdateSubmissionModalOpen: !1 }),
51
+ setSubmissionContent: (t, e) => s({
52
+ submissionContent: t,
53
+ submissionHasContent: e
54
+ }),
55
+ setSubmissionAttachments: (t) => s({ submissionAttachments: t }),
56
+ resetSubmissionAttachments: () => s({ submissionAttachments: [] }),
57
+ setSubmissionPersistedAttachmentIds: (t) => s({ submissionPersistedAttachmentIds: t }),
58
+ addSubmissionAttachmentIdToDelete: (t) => s((e) => ({
59
+ submissionAttachmentIdsToDelete: e.submissionAttachmentIdsToDelete.includes(t) ? e.submissionAttachmentIdsToDelete : [...e.submissionAttachmentIdsToDelete, t]
60
+ })),
61
+ resetSubmissionAttachmentIdsToDelete: () => s({ submissionAttachmentIdsToDelete: [] }),
62
+ setSubmissionIsLoading: (t) => s({ submissionIsLoading: t }),
63
+ hydrateSubmissionContent: (t) => s((e) => {
64
+ if (e.submissionId === t.id && e.submissionUpdatedAt === t.updatedAt)
65
+ return e;
66
+ const i = t.content || "";
67
+ return {
68
+ submissionId: t.id,
69
+ submissionUpdatedAt: t.updatedAt,
70
+ submissionContent: i,
71
+ submissionHasContent: !!i.trim(),
72
+ submissionAttachments: U(t == null ? void 0 : t.attachments) ?? [],
73
+ submissionPersistedAttachmentIds: (t.attachments ?? []).map(
74
+ (o) => o.id
75
+ ),
76
+ submissionAttachmentIdsToDelete: []
77
+ };
78
+ })
79
+ })), $ = P(
80
+ k
81
+ ), j = ({
82
+ handleUpdateSubmission: s
83
+ }) => {
84
+ const { appCode: t } = p(), { t: e } = h(t), i = A.use.isPastDeadline(), {
85
+ submissionHasContent: o,
86
+ submissionAttachments: r,
87
+ submissionPersistedAttachmentIds: c,
88
+ submissionIsLoading: l,
89
+ onOpenUpdateSubmissionModal: b
90
+ } = $((a) => ({
91
+ onOpenUpdateSubmissionModal: a.onOpenUpdateSubmissionModal,
92
+ submissionHasContent: a.submissionHasContent,
93
+ submissionAttachments: a.submissionAttachments,
94
+ submissionPersistedAttachmentIds: a.submissionPersistedAttachmentIds,
95
+ submissionIsLoading: a.submissionIsLoading
96
+ })), S = r.some((a) => {
97
+ const I = Number(a.id);
98
+ return !Number.isSafeInteger(I) || !c.includes(I);
99
+ });
100
+ return /* @__PURE__ */ d(m, { gap: "16", justify: "end", children: [
101
+ /* @__PURE__ */ n(
102
+ u,
103
+ {
104
+ "data-testid": "collect-submission-app-header-actions-draft-button",
105
+ variant: "outline",
106
+ color: "primary",
107
+ leftIcon: /* @__PURE__ */ n(L, {}),
108
+ disabled: i,
109
+ isLoading: l,
110
+ onClick: () => s == null ? void 0 : s({
111
+ status: w.DRAFT
112
+ }),
113
+ children: e("collection.appHeaderSubmission.submission.button.draft")
114
+ }
115
+ ),
116
+ /* @__PURE__ */ n(
117
+ u,
118
+ {
119
+ "data-testid": "collect-submission-app-header-actions-send-button",
120
+ variant: "filled",
121
+ color: "primary",
122
+ leftIcon: /* @__PURE__ */ n(N, {}),
123
+ disabled: i || !(o || S),
124
+ onClick: () => b(),
125
+ children: e("collection.appHeaderSubmission.submission.button.send")
126
+ }
127
+ )
128
+ ] });
129
+ };
130
+ var C = /* @__PURE__ */ ((s) => (s.COLLECTION = "COLLECTION", s.SUBMISSION = "SUBMISSION", s))(C || {});
131
+ const K = ({
132
+ collection: s,
133
+ onClickBack: t,
134
+ context: e,
135
+ handleUpdateSubmission: i
136
+ }) => {
137
+ const { appCode: o } = p(), { t: r } = h(o), { lg: c, md: l } = g(), { formatDate: b } = O();
138
+ return /* @__PURE__ */ d("div", { className: `py-16 border-bottom bg-white ${l ? "px-48" : "px-16"}`, children: [
139
+ /* @__PURE__ */ n(m, { align: "center", gap: "8", children: /* @__PURE__ */ n(
140
+ u,
141
+ {
142
+ "data-testid": "collect-submission-app-header-button-back",
143
+ className: "text-gray-700",
144
+ color: "tertiary",
145
+ leftIcon: /* @__PURE__ */ n(v, { width: 20, height: 20 }),
146
+ type: "button",
147
+ variant: "ghost",
148
+ size: "sm",
149
+ onClick: t,
150
+ children: r("collection.back")
151
+ }
152
+ ) }),
153
+ /* @__PURE__ */ d(
154
+ m,
155
+ {
156
+ className: "w-100 mt-24",
157
+ justify: "between",
158
+ align: c ? "center" : "end",
159
+ gap: "12",
160
+ direction: c ? "row" : "column",
161
+ children: [
162
+ /* @__PURE__ */ d(
163
+ "div",
164
+ {
165
+ className: `${l && "d-flex"} ${!c && "w-100"}`,
166
+ style: { maxWidth: c ? "70%" : "100%" },
167
+ children: [
168
+ /* @__PURE__ */ n(
169
+ "h2",
170
+ {
171
+ "data-testid": "collect-submission-app-header-title",
172
+ className: `text-truncate ${l ? "me-12" : "mb-12 text-truncate-2"}`,
173
+ children: s.name
174
+ }
175
+ ),
176
+ /* @__PURE__ */ n(
177
+ y,
178
+ {
179
+ "data-testid": "collect-submission-app-header-badge-deadline",
180
+ className: "lh-base",
181
+ style: { height: "3rem" },
182
+ variant: {
183
+ level: "info",
184
+ type: "notification"
185
+ },
186
+ children: /* @__PURE__ */ d(m, { align: "center", gap: "8", children: [
187
+ /* @__PURE__ */ n(M, { height: 20, width: 20 }),
188
+ `${r("collection.appHeaderCollection.deadline")} ${b(s.deadline)}`
189
+ ] })
190
+ }
191
+ )
192
+ ]
193
+ }
194
+ ),
195
+ e === C.COLLECTION ? /* @__PURE__ */ n(B, { collection: s }) : /* @__PURE__ */ n(j, { handleUpdateSubmission: i })
196
+ ]
197
+ }
198
+ )
199
+ ] });
200
+ };
201
+ export {
202
+ K as A,
203
+ C,
204
+ $ as u
205
+ };
@@ -0,0 +1,42 @@
1
+ import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./HASRA6WW-CE5UWlEo.js";
2
+ import { z as v, B as C, D as e } from "./index-D-6KhgeS.js";
3
+ var h = (t) => {
4
+ const [r, o] = s({
5
+ prefix: "TanstackQueryDevtools"
6
+ }), a = v(), l = C(() => {
7
+ const n = r.theme_preference || c;
8
+ return n !== "system" ? n : a();
9
+ });
10
+ return e(d.Provider, {
11
+ value: t,
12
+ get children() {
13
+ return e(u, {
14
+ disabled: !0,
15
+ localStore: r,
16
+ setLocalStore: o,
17
+ get children() {
18
+ return e(i.Provider, {
19
+ value: l,
20
+ get children() {
21
+ return e(m, {
22
+ get children() {
23
+ return e(P, {
24
+ localStore: r,
25
+ setLocalStore: o,
26
+ get onClose() {
27
+ return t.onClose;
28
+ },
29
+ showPanelViewOnly: !0
30
+ });
31
+ }
32
+ });
33
+ }
34
+ });
35
+ }
36
+ });
37
+ }
38
+ });
39
+ }, p = h;
40
+ export {
41
+ p as default
42
+ };