@powerhousedao/contributor-billing 0.0.1

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 (282) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +22 -0
  3. package/dist/document-models/index.d.ts +2 -0
  4. package/dist/document-models/index.d.ts.map +1 -0
  5. package/dist/document-models/index.js +1 -0
  6. package/dist/document-models/invoice/gen/actions.d.ts +8 -0
  7. package/dist/document-models/invoice/gen/actions.d.ts.map +1 -0
  8. package/dist/document-models/invoice/gen/actions.js +3 -0
  9. package/dist/document-models/invoice/gen/creators.d.ts +4 -0
  10. package/dist/document-models/invoice/gen/creators.d.ts.map +1 -0
  11. package/dist/document-models/invoice/gen/creators.js +3 -0
  12. package/dist/document-models/invoice/gen/document-model.d.ts +3 -0
  13. package/dist/document-models/invoice/gen/document-model.d.ts.map +1 -0
  14. package/dist/document-models/invoice/gen/document-model.js +227 -0
  15. package/dist/document-models/invoice/gen/general/actions.d.ts +10 -0
  16. package/dist/document-models/invoice/gen/general/actions.d.ts.map +1 -0
  17. package/dist/document-models/invoice/gen/general/actions.js +1 -0
  18. package/dist/document-models/invoice/gen/general/creators.d.ts +9 -0
  19. package/dist/document-models/invoice/gen/general/creators.d.ts.map +1 -0
  20. package/dist/document-models/invoice/gen/general/creators.js +8 -0
  21. package/dist/document-models/invoice/gen/general/error.d.ts +2 -0
  22. package/dist/document-models/invoice/gen/general/error.d.ts.map +1 -0
  23. package/dist/document-models/invoice/gen/general/error.js +1 -0
  24. package/dist/document-models/invoice/gen/general/object.d.ts +12 -0
  25. package/dist/document-models/invoice/gen/general/object.d.ts.map +1 -0
  26. package/dist/document-models/invoice/gen/general/object.js +22 -0
  27. package/dist/document-models/invoice/gen/general/operations.d.ts +12 -0
  28. package/dist/document-models/invoice/gen/general/operations.d.ts.map +1 -0
  29. package/dist/document-models/invoice/gen/general/operations.js +1 -0
  30. package/dist/document-models/invoice/gen/index.d.ts +6 -0
  31. package/dist/document-models/invoice/gen/index.d.ts.map +1 -0
  32. package/dist/document-models/invoice/gen/index.js +5 -0
  33. package/dist/document-models/invoice/gen/items/actions.d.ts +8 -0
  34. package/dist/document-models/invoice/gen/items/actions.d.ts.map +1 -0
  35. package/dist/document-models/invoice/gen/items/actions.js +1 -0
  36. package/dist/document-models/invoice/gen/items/creators.d.ts +7 -0
  37. package/dist/document-models/invoice/gen/items/creators.d.ts.map +1 -0
  38. package/dist/document-models/invoice/gen/items/creators.js +6 -0
  39. package/dist/document-models/invoice/gen/items/error.d.ts +2 -0
  40. package/dist/document-models/invoice/gen/items/error.d.ts.map +1 -0
  41. package/dist/document-models/invoice/gen/items/error.js +1 -0
  42. package/dist/document-models/invoice/gen/items/object.d.ts +10 -0
  43. package/dist/document-models/invoice/gen/items/object.d.ts.map +1 -0
  44. package/dist/document-models/invoice/gen/items/object.js +16 -0
  45. package/dist/document-models/invoice/gen/items/operations.d.ts +10 -0
  46. package/dist/document-models/invoice/gen/items/operations.d.ts.map +1 -0
  47. package/dist/document-models/invoice/gen/items/operations.js +1 -0
  48. package/dist/document-models/invoice/gen/object.d.ts +20 -0
  49. package/dist/document-models/invoice/gen/object.d.ts.map +1 -0
  50. package/dist/document-models/invoice/gen/object.js +29 -0
  51. package/dist/document-models/invoice/gen/parties/actions.d.ts +10 -0
  52. package/dist/document-models/invoice/gen/parties/actions.d.ts.map +1 -0
  53. package/dist/document-models/invoice/gen/parties/actions.js +1 -0
  54. package/dist/document-models/invoice/gen/parties/creators.d.ts +9 -0
  55. package/dist/document-models/invoice/gen/parties/creators.d.ts.map +1 -0
  56. package/dist/document-models/invoice/gen/parties/creators.js +8 -0
  57. package/dist/document-models/invoice/gen/parties/error.d.ts +2 -0
  58. package/dist/document-models/invoice/gen/parties/error.d.ts.map +1 -0
  59. package/dist/document-models/invoice/gen/parties/error.js +1 -0
  60. package/dist/document-models/invoice/gen/parties/object.d.ts +12 -0
  61. package/dist/document-models/invoice/gen/parties/object.d.ts.map +1 -0
  62. package/dist/document-models/invoice/gen/parties/object.js +22 -0
  63. package/dist/document-models/invoice/gen/parties/operations.d.ts +12 -0
  64. package/dist/document-models/invoice/gen/parties/operations.d.ts.map +1 -0
  65. package/dist/document-models/invoice/gen/parties/operations.js +1 -0
  66. package/dist/document-models/invoice/gen/reducer.d.ts +3 -0
  67. package/dist/document-models/invoice/gen/reducer.d.ts.map +1 -0
  68. package/dist/document-models/invoice/gen/reducer.js +79 -0
  69. package/dist/document-models/invoice/gen/schema/index.d.ts +3 -0
  70. package/dist/document-models/invoice/gen/schema/index.d.ts.map +1 -0
  71. package/dist/document-models/invoice/gen/schema/index.js +2 -0
  72. package/dist/document-models/invoice/gen/schema/types.d.ts +390 -0
  73. package/dist/document-models/invoice/gen/schema/types.d.ts.map +1 -0
  74. package/dist/document-models/invoice/gen/schema/types.js +1 -0
  75. package/dist/document-models/invoice/gen/schema/zod.d.ts +56 -0
  76. package/dist/document-models/invoice/gen/schema/zod.d.ts.map +1 -0
  77. package/dist/document-models/invoice/gen/schema/zod.js +362 -0
  78. package/dist/document-models/invoice/gen/types.d.ts +10 -0
  79. package/dist/document-models/invoice/gen/types.d.ts.map +1 -0
  80. package/dist/document-models/invoice/gen/types.js +1 -0
  81. package/dist/document-models/invoice/gen/utils.d.ts +7 -0
  82. package/dist/document-models/invoice/gen/utils.d.ts.map +1 -0
  83. package/dist/document-models/invoice/gen/utils.js +166 -0
  84. package/dist/document-models/invoice/index.d.ts +41 -0
  85. package/dist/document-models/invoice/index.d.ts.map +1 -0
  86. package/dist/document-models/invoice/index.js +21 -0
  87. package/dist/document-models/invoice/src/reducers/general.d.ts +8 -0
  88. package/dist/document-models/invoice/src/reducers/general.d.ts.map +1 -0
  89. package/dist/document-models/invoice/src/reducers/general.js +79 -0
  90. package/dist/document-models/invoice/src/reducers/items.d.ts +8 -0
  91. package/dist/document-models/invoice/src/reducers/items.d.ts.map +1 -0
  92. package/dist/document-models/invoice/src/reducers/items.js +108 -0
  93. package/dist/document-models/invoice/src/reducers/parties.d.ts +8 -0
  94. package/dist/document-models/invoice/src/reducers/parties.d.ts.map +1 -0
  95. package/dist/document-models/invoice/src/reducers/parties.js +266 -0
  96. package/dist/document-models/invoice/src/tests/document-model.test.d.ts +6 -0
  97. package/dist/document-models/invoice/src/tests/document-model.test.d.ts.map +1 -0
  98. package/dist/document-models/invoice/src/tests/document-model.test.js +17 -0
  99. package/dist/document-models/invoice/src/tests/general.test.d.ts +6 -0
  100. package/dist/document-models/invoice/src/tests/general.test.d.ts.map +1 -0
  101. package/dist/document-models/invoice/src/tests/general.test.js +75 -0
  102. package/dist/document-models/invoice/src/tests/items.test.d.ts +6 -0
  103. package/dist/document-models/invoice/src/tests/items.test.d.ts.map +1 -0
  104. package/dist/document-models/invoice/src/tests/items.test.js +45 -0
  105. package/dist/document-models/invoice/src/tests/parties.test.d.ts +6 -0
  106. package/dist/document-models/invoice/src/tests/parties.test.d.ts.map +1 -0
  107. package/dist/document-models/invoice/src/tests/parties.test.js +75 -0
  108. package/dist/document-models/invoice/src/utils.d.ts +2 -0
  109. package/dist/document-models/invoice/src/utils.d.ts.map +1 -0
  110. package/dist/document-models/invoice/src/utils.js +1 -0
  111. package/dist/editors/contributor-billing/components/CreateDocument.d.ts +8 -0
  112. package/dist/editors/contributor-billing/components/CreateDocument.d.ts.map +1 -0
  113. package/dist/editors/contributor-billing/components/CreateDocument.js +14 -0
  114. package/dist/editors/contributor-billing/components/DocumentDispatch.d.ts +12 -0
  115. package/dist/editors/contributor-billing/components/DocumentDispatch.d.ts.map +1 -0
  116. package/dist/editors/contributor-billing/components/DocumentDispatch.js +20 -0
  117. package/dist/editors/contributor-billing/components/DriveExplorer.d.ts +17 -0
  118. package/dist/editors/contributor-billing/components/DriveExplorer.d.ts.map +1 -0
  119. package/dist/editors/contributor-billing/components/DriveExplorer.js +112 -0
  120. package/dist/editors/contributor-billing/components/EditorContainer.d.ts +14 -0
  121. package/dist/editors/contributor-billing/components/EditorContainer.d.ts.map +1 -0
  122. package/dist/editors/contributor-billing/components/EditorContainer.js +28 -0
  123. package/dist/editors/contributor-billing/components/FileItemsGrid.d.ts +12 -0
  124. package/dist/editors/contributor-billing/components/FileItemsGrid.d.ts.map +1 -0
  125. package/dist/editors/contributor-billing/components/FileItemsGrid.js +7 -0
  126. package/dist/editors/contributor-billing/components/FolderItemsGrid.d.ts +17 -0
  127. package/dist/editors/contributor-billing/components/FolderItemsGrid.d.ts.map +1 -0
  128. package/dist/editors/contributor-billing/components/FolderItemsGrid.js +14 -0
  129. package/dist/editors/contributor-billing/components/FolderTree.d.ts +9 -0
  130. package/dist/editors/contributor-billing/components/FolderTree.d.ts.map +1 -0
  131. package/dist/editors/contributor-billing/components/FolderTree.js +31 -0
  132. package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.d.ts +16 -0
  133. package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.d.ts.map +1 -0
  134. package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.js +16 -0
  135. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts +21 -0
  136. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +1 -0
  137. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.js +45 -0
  138. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts +12 -0
  139. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts.map +1 -0
  140. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.js +12 -0
  141. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts +7 -0
  142. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts.map +1 -0
  143. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.js +7 -0
  144. package/dist/editors/contributor-billing/components/InvoiceTable/RowActionMenu.d.ts +8 -0
  145. package/dist/editors/contributor-billing/components/InvoiceTable/RowActionMenu.d.ts.map +1 -0
  146. package/dist/editors/contributor-billing/components/InvoiceTable/RowActionMenu.js +2 -0
  147. package/dist/editors/contributor-billing/editor.d.ts +6 -0
  148. package/dist/editors/contributor-billing/editor.d.ts.map +1 -0
  149. package/dist/editors/contributor-billing/editor.js +48 -0
  150. package/dist/editors/contributor-billing/hooks/useDispatchMap.d.ts +9 -0
  151. package/dist/editors/contributor-billing/hooks/useDispatchMap.d.ts.map +1 -0
  152. package/dist/editors/contributor-billing/hooks/useDispatchMap.js +21 -0
  153. package/dist/editors/contributor-billing/hooks/useDrop.d.ts +22 -0
  154. package/dist/editors/contributor-billing/hooks/useDrop.d.ts.map +1 -0
  155. package/dist/editors/contributor-billing/hooks/useDrop.js +57 -0
  156. package/dist/editors/contributor-billing/hooks/useSelectedFolderChildren.d.ts +8 -0
  157. package/dist/editors/contributor-billing/hooks/useSelectedFolderChildren.d.ts.map +1 -0
  158. package/dist/editors/contributor-billing/hooks/useSelectedFolderChildren.js +19 -0
  159. package/dist/editors/contributor-billing/hooks/useTransformedNodes.d.ts +4 -0
  160. package/dist/editors/contributor-billing/hooks/useTransformedNodes.d.ts.map +1 -0
  161. package/dist/editors/contributor-billing/hooks/useTransformedNodes.js +32 -0
  162. package/dist/editors/contributor-billing/index.d.ts +5 -0
  163. package/dist/editors/contributor-billing/index.d.ts.map +1 -0
  164. package/dist/editors/contributor-billing/index.js +12 -0
  165. package/dist/editors/index.d.ts +3 -0
  166. package/dist/editors/index.d.ts.map +1 -0
  167. package/dist/editors/index.js +2 -0
  168. package/dist/editors/invoice/InvoicePDF.d.ts +8 -0
  169. package/dist/editors/invoice/InvoicePDF.d.ts.map +1 -0
  170. package/dist/editors/invoice/InvoicePDF.js +359 -0
  171. package/dist/editors/invoice/assets/custom.d.ts +4 -0
  172. package/dist/editors/invoice/assets/powerhouseLogo.png +0 -0
  173. package/dist/editors/invoice/components/countryForm.d.ts +12 -0
  174. package/dist/editors/invoice/components/countryForm.d.ts.map +1 -0
  175. package/dist/editors/invoice/components/countryForm.js +28 -0
  176. package/dist/editors/invoice/components/currencyForm.d.ts +13 -0
  177. package/dist/editors/invoice/components/currencyForm.d.ts.map +1 -0
  178. package/dist/editors/invoice/components/currencyForm.js +26 -0
  179. package/dist/editors/invoice/components/datePicker.d.ts +11 -0
  180. package/dist/editors/invoice/components/datePicker.d.ts.map +1 -0
  181. package/dist/editors/invoice/components/datePicker.js +8 -0
  182. package/dist/editors/invoice/components/inputField.d.ts +14 -0
  183. package/dist/editors/invoice/components/inputField.d.ts.map +1 -0
  184. package/dist/editors/invoice/components/inputField.js +25 -0
  185. package/dist/editors/invoice/components/numberForm.d.ts +11 -0
  186. package/dist/editors/invoice/components/numberForm.d.ts.map +1 -0
  187. package/dist/editors/invoice/components/numberForm.js +7 -0
  188. package/dist/editors/invoice/components/selectField.d.ts +8 -0
  189. package/dist/editors/invoice/components/selectField.d.ts.map +1 -0
  190. package/dist/editors/invoice/components/selectField.js +323 -0
  191. package/dist/editors/invoice/editor.d.ts +5 -0
  192. package/dist/editors/invoice/editor.d.ts.map +1 -0
  193. package/dist/editors/invoice/editor.js +377 -0
  194. package/dist/editors/invoice/exportUBL.d.ts +85 -0
  195. package/dist/editors/invoice/exportUBL.d.ts.map +1 -0
  196. package/dist/editors/invoice/exportUBL.js +382 -0
  197. package/dist/editors/invoice/index.d.ts +5 -0
  198. package/dist/editors/invoice/index.d.ts.map +1 -0
  199. package/dist/editors/invoice/index.js +12 -0
  200. package/dist/editors/invoice/ingestPDF.d.ts +12 -0
  201. package/dist/editors/invoice/ingestPDF.d.ts.map +1 -0
  202. package/dist/editors/invoice/ingestPDF.js +193 -0
  203. package/dist/editors/invoice/ingestUBL.d.ts +21 -0
  204. package/dist/editors/invoice/ingestUBL.d.ts.map +1 -0
  205. package/dist/editors/invoice/ingestUBL.js +169 -0
  206. package/dist/editors/invoice/invoiceToGnosis.d.ts +7 -0
  207. package/dist/editors/invoice/invoiceToGnosis.d.ts.map +1 -0
  208. package/dist/editors/invoice/invoiceToGnosis.js +139 -0
  209. package/dist/editors/invoice/legalEntity/bankSection.d.ts +14 -0
  210. package/dist/editors/invoice/legalEntity/bankSection.d.ts.map +1 -0
  211. package/dist/editors/invoice/legalEntity/bankSection.js +156 -0
  212. package/dist/editors/invoice/legalEntity/common.d.ts +6 -0
  213. package/dist/editors/invoice/legalEntity/common.d.ts.map +1 -0
  214. package/dist/editors/invoice/legalEntity/common.js +6 -0
  215. package/dist/editors/invoice/legalEntity/legalEntity.d.ts +40 -0
  216. package/dist/editors/invoice/legalEntity/legalEntity.d.ts.map +1 -0
  217. package/dist/editors/invoice/legalEntity/legalEntity.js +63 -0
  218. package/dist/editors/invoice/legalEntity/walletSection.d.ts +13 -0
  219. package/dist/editors/invoice/legalEntity/walletSection.d.ts.map +1 -0
  220. package/dist/editors/invoice/legalEntity/walletSection.js +55 -0
  221. package/dist/editors/invoice/lineItems.d.ts +23 -0
  222. package/dist/editors/invoice/lineItems.d.ts.map +1 -0
  223. package/dist/editors/invoice/lineItems.js +157 -0
  224. package/dist/editors/invoice/requestFinance.d.ts +7 -0
  225. package/dist/editors/invoice/requestFinance.d.ts.map +1 -0
  226. package/dist/editors/invoice/requestFinance.js +155 -0
  227. package/dist/editors/invoice/uploadPdfChunked.d.ts +10 -0
  228. package/dist/editors/invoice/uploadPdfChunked.d.ts.map +1 -0
  229. package/dist/editors/invoice/uploadPdfChunked.js +79 -0
  230. package/dist/editors/invoice/utils/utils.d.ts +2 -0
  231. package/dist/editors/invoice/utils/utils.d.ts.map +1 -0
  232. package/dist/editors/invoice/utils/utils.js +54 -0
  233. package/dist/editors/invoice/validation/validationManager.d.ts +28 -0
  234. package/dist/editors/invoice/validation/validationManager.d.ts.map +1 -0
  235. package/dist/editors/invoice/validation/validationManager.js +65 -0
  236. package/dist/editors/invoice/validation/validationRules.d.ts +14 -0
  237. package/dist/editors/invoice/validation/validationRules.d.ts.map +1 -0
  238. package/dist/editors/invoice/validation/validationRules.js +334 -0
  239. package/dist/index.d.ts +5 -0
  240. package/dist/index.d.ts.map +1 -0
  241. package/dist/index.js +6 -0
  242. package/dist/powerhouse.manifest.json +31 -0
  243. package/dist/processors/index.d.ts +2 -0
  244. package/dist/processors/index.d.ts.map +1 -0
  245. package/dist/processors/index.js +1 -0
  246. package/dist/scripts/invoice/exampleBatchTxn.d.ts +2 -0
  247. package/dist/scripts/invoice/exampleBatchTxn.d.ts.map +1 -0
  248. package/dist/scripts/invoice/exampleBatchTxn.js +44 -0
  249. package/dist/scripts/invoice/gnosisTransactionBuilder.d.ts +28 -0
  250. package/dist/scripts/invoice/gnosisTransactionBuilder.d.ts.map +1 -0
  251. package/dist/scripts/invoice/gnosisTransactionBuilder.js +74 -0
  252. package/dist/scripts/invoice/pdfToDocumentAi.d.ts +5 -0
  253. package/dist/scripts/invoice/pdfToDocumentAi.d.ts.map +1 -0
  254. package/dist/scripts/invoice/pdfToDocumentAi.js +659 -0
  255. package/dist/scripts/invoice/requestFinance.d.ts +2 -0
  256. package/dist/scripts/invoice/requestFinance.d.ts.map +1 -0
  257. package/dist/scripts/invoice/requestFinance.js +38 -0
  258. package/dist/style.css +6463 -0
  259. package/dist/subgraphs/index.d.ts +2 -0
  260. package/dist/subgraphs/index.d.ts.map +1 -0
  261. package/dist/subgraphs/index.js +1 -0
  262. package/dist/subgraphs/invoice/customResolvers.d.ts +50 -0
  263. package/dist/subgraphs/invoice/customResolvers.d.ts.map +1 -0
  264. package/dist/subgraphs/invoice/customResolvers.js +327 -0
  265. package/dist/subgraphs/invoice/index.d.ts +10 -0
  266. package/dist/subgraphs/invoice/index.d.ts.map +1 -0
  267. package/dist/subgraphs/invoice/index.js +30 -0
  268. package/dist/subgraphs/invoice/resolvers.d.ts +3 -0
  269. package/dist/subgraphs/invoice/resolvers.d.ts.map +1 -0
  270. package/dist/subgraphs/invoice/resolvers.js +184 -0
  271. package/dist/subgraphs/invoice/schema.d.ts +3 -0
  272. package/dist/subgraphs/invoice/schema.d.ts.map +1 -0
  273. package/dist/subgraphs/invoice/schema.js +460 -0
  274. package/dist/tailwind.config.d.ts +13 -0
  275. package/dist/tailwind.config.d.ts.map +1 -0
  276. package/dist/tailwind.config.js +15 -0
  277. package/dist/vitest.config.d.ts +3 -0
  278. package/dist/vitest.config.d.ts.map +1 -0
  279. package/dist/vitest.config.js +8 -0
  280. package/editors/invoice/assets/custom.d.ts +4 -0
  281. package/editors/invoice/assets/powerhouseLogo.png +0 -0
  282. package/package.json +117 -0
@@ -0,0 +1,45 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { HeaderControls } from "./HeaderControls.js";
4
+ import { InvoiceTableSection } from "./InvoiceTableSection.js";
5
+ import { InvoiceTableRow } from "./InvoiceTableRow.js";
6
+ const statusOptions = [
7
+ { label: "Awaiting Approval", value: "AWAITINGAPPROVAL" },
8
+ { label: "Awaiting Payment", value: "AWAITINGPAYMENT" },
9
+ { label: "Payment Received", value: "PAYMENTRECEIVED" },
10
+ { label: "Rejected", value: "REJECTED" },
11
+ ];
12
+ export const InvoiceTable = ({ files, state, setActiveDocumentId, getDispatch, selected, setSelected, onBatchAction, }) => {
13
+ const [selectedStatuses, setSelectedStatuses] = useState([]);
14
+ const getMenuOptions = () => {
15
+ return [
16
+ { label: "View Invoice", value: "view-invoice" },
17
+ // { label: "View Payment Transaction", value: "view-payment" },
18
+ ];
19
+ };
20
+ const handleStatusChange = (value) => {
21
+ setSelectedStatuses(Array.isArray(value) ? value : [value]);
22
+ };
23
+ const shouldShowSection = (status) => {
24
+ return selectedStatuses.length === 0 || selectedStatuses.includes(status);
25
+ };
26
+ const getInvoicesByStatus = (status) => {
27
+ return Object.entries(state)
28
+ .filter(([_, doc]) => doc.documentType === "powerhouse/invoice" &&
29
+ doc.global.status === status)
30
+ .map(([id, doc]) => ({
31
+ id,
32
+ issuer: doc.global.issuer?.name || "Unknown",
33
+ invoiceNo: doc.global.invoiceNo,
34
+ issueDate: doc.global.dateIssued,
35
+ dueDate: doc.global.dateDue,
36
+ currency: doc.global.currency,
37
+ amount: doc.global.totalPriceTaxIncl?.toString() ?? "",
38
+ }));
39
+ };
40
+ const awaitingApproval = getInvoicesByStatus("ISSUED");
41
+ const awaitingPayment = getInvoicesByStatus("AWAITINGPAYMENT");
42
+ const paid = getInvoicesByStatus("PAYMENTRECEIVED");
43
+ const rejected = getInvoicesByStatus("REJECTED");
44
+ return (_jsxs("div", { className: "w-full h-full bg-white rounded-lg p-4 border border-gray-200 shadow-md overflow-y-auto max-h-[500px] mt-4", children: [_jsx(HeaderControls, { statusOptions: statusOptions, onStatusChange: handleStatusChange, onBatchAction: onBatchAction }), shouldShowSection("AWAITINGAPPROVAL") && (_jsx(InvoiceTableSection, { title: "Awaiting Approval", count: awaitingApproval.length, children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-left", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Amount" }), _jsx("th", { className: "px-2 py-2 w-8" })] }) }), _jsx("tbody", { children: awaitingApproval.map((row) => (_jsx(InvoiceTableRow, { row: row, isSelected: !!selected[row.id], onSelect: (checked) => setSelected((prev) => ({ ...prev, [row.id]: checked })), menuOptions: getMenuOptions(), onMenuAction: (action) => { }, setActiveDocumentId: setActiveDocumentId }, row.id))) })] }) })), shouldShowSection("AWAITINGPAYMENT") && (_jsx(InvoiceTableSection, { title: "Awaiting Payment", count: awaitingPayment.length, color: "bg-yellow-100 text-yellow-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-left", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Amount" }), _jsx("th", { className: "px-2 py-2 w-8" })] }) }), _jsx("tbody", { children: awaitingPayment.map((row) => (_jsx(InvoiceTableRow, { row: row, isSelected: !!selected[row.id], onSelect: (checked) => setSelected((prev) => ({ ...prev, [row.id]: checked })), menuOptions: getMenuOptions(), onMenuAction: (action) => { }, setActiveDocumentId: setActiveDocumentId }, row.id))) })] }) })), shouldShowSection("PAYMENTRECEIVED") && (_jsx(InvoiceTableSection, { title: "Payment Received", count: paid.length, color: "bg-green-100 text-green-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-left", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Amount" }), _jsx("th", { className: "px-2 py-2 w-8" })] }) }), _jsx("tbody", { children: paid.map((row) => (_jsx(InvoiceTableRow, { row: row, isSelected: !!selected[row.id], onSelect: (checked) => setSelected((prev) => ({ ...prev, [row.id]: checked })), menuOptions: getMenuOptions(), onMenuAction: (action) => { }, setActiveDocumentId: setActiveDocumentId }, row.id))) })] }) })), shouldShowSection("REJECTED") && (_jsx(InvoiceTableSection, { title: "Rejected", count: rejected.length, color: "bg-red-500 text-black-600", children: _jsxs("table", { className: "w-full text-sm border-separate border-spacing-0 border border-gray-400", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "px-2 py-2 w-8" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Issuer" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Invoice No." }), _jsx("th", { className: "px-2 py-2 text-left", children: "Issue Date" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Due Date" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Currency" }), _jsx("th", { className: "px-2 py-2 text-left", children: "Amount" }), _jsx("th", { className: "px-2 py-2 w-8" })] }) }), _jsx("tbody", { children: rejected.map((row) => (_jsx(InvoiceTableRow, { row: row, isSelected: !!selected[row.id], onSelect: (checked) => setSelected((prev) => ({ ...prev, [row.id]: checked })), menuOptions: getMenuOptions(), onMenuAction: (action) => { }, setActiveDocumentId: setActiveDocumentId }, row.id))) })] }) }))] }));
45
+ };
@@ -0,0 +1,12 @@
1
+ export declare const InvoiceTableRow: ({ row, isSelected, onSelect, menuOptions, onMenuAction, setActiveDocumentId }: {
2
+ row: any;
3
+ isSelected: boolean;
4
+ onSelect: (checked: boolean) => void;
5
+ menuOptions: {
6
+ label: string;
7
+ value: string;
8
+ }[];
9
+ onMenuAction: (action: string) => void;
10
+ setActiveDocumentId: (id: string) => void;
11
+ }) => import("react/jsx-runtime").JSX.Element;
12
+ //# sourceMappingURL=InvoiceTableRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvoiceTableRow.d.ts","sourceRoot":"","sources":["../../../../../editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,GAAI,+EAO7B;IACD,GAAG,EAAE,GAAG,CAAC;IACT,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAChD,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,4CAiDA,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useRef } from "react";
3
+ import { RowActionMenu } from "./RowActionMenu.js";
4
+ export const InvoiceTableRow = ({ row, isSelected, onSelect, menuOptions, onMenuAction, setActiveDocumentId }) => {
5
+ const [menuOpen, setMenuOpen] = useState(false);
6
+ const menuRef = useRef(null);
7
+ return (_jsxs("tr", { className: "hover:bg-gray-50", children: [_jsx("td", { className: "px-2 py-2", children: _jsx("input", { type: "checkbox", checked: isSelected, onChange: e => onSelect(e.target.checked), className: "size-4 rounded border-gray-300 text-blue-600 focus:ring-2 focus:ring-blue-500" }) }), _jsx("td", { className: "px-2 py-2", children: row.issuer }), _jsx("td", { className: "px-2 py-2", children: row.invoiceNo }), _jsx("td", { className: "px-2 py-2", children: row.issueDate }), _jsx("td", { className: "px-2 py-2", children: row.dueDate }), _jsx("td", { className: "px-2 py-2", children: row.currency }), _jsx("td", { className: "px-2 py-2", children: row.amount }), _jsx("td", { className: "px-2 py-2 text-right relative", ref: menuRef, children: _jsxs("div", { className: "relative inline-block", children: [_jsx("button", { className: "px-2 py-1 hover:bg-gray-200 rounded", onClick: () => setMenuOpen(v => !v), children: "\u2026" }), menuOpen && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40", onClick: () => setMenuOpen(false) }), _jsx(RowActionMenu, { options: menuOptions, onAction: action => {
8
+ onMenuAction(action);
9
+ setMenuOpen(false);
10
+ setActiveDocumentId(row.id);
11
+ } })] }))] }) })] }));
12
+ };
@@ -0,0 +1,7 @@
1
+ export declare const InvoiceTableSection: ({ title, count, children, color, }: {
2
+ title: string;
3
+ count: number;
4
+ children: React.ReactNode;
5
+ color?: string;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=InvoiceTableSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvoiceTableSection.d.ts","sourceRoot":"","sources":["../../../../../editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,GAAI,oCAKjC;IACD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,4CA8BA,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { ChevronDown, ChevronRight } from "lucide-react";
4
+ export const InvoiceTableSection = ({ title, count, children, color = "bg-blue-100 text-blue-600", }) => {
5
+ const [isExpanded, setIsExpanded] = useState(true);
6
+ return (_jsxs("div", { className: "mb-2", children: [_jsxs("button", { onClick: () => setIsExpanded(!isExpanded), className: "w-full flex items-center gap-2 hover:opacity-80 transition-opacity", children: [_jsx("span", { className: "font-medium", children: title }), _jsx("span", { className: `inline-flex items-center justify-center rounded-full text-xs font-bold px-2 ${color}`, children: count }), isExpanded ? (_jsx(ChevronDown, { className: "w-4 h-4 text-gray-900" })) : (_jsx(ChevronRight, { className: "w-4 h-4 text-gray-900" }))] }), isExpanded && (_jsx("div", { className: "mt-2", children: children }))] }));
7
+ };
@@ -0,0 +1,8 @@
1
+ export declare const RowActionMenu: ({ options, onAction }: {
2
+ options: {
3
+ label: string;
4
+ value: string;
5
+ }[];
6
+ onAction: (action: string) => void;
7
+ }) => import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=RowActionMenu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RowActionMenu.d.ts","sourceRoot":"","sources":["../../../../../editors/contributor-billing/components/InvoiceTable/RowActionMenu.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,GAAI,uBAG3B;IACD,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,4CAiBA,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export const RowActionMenu = ({ options, onAction }) => (_jsx("div", { className: "absolute right-0 mt-2 w-[200px] rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 z-50", onClick: e => e.stopPropagation(), children: _jsx("div", { className: "py-1", children: options.map(opt => (_jsx("button", { className: "block w-full text-left px-4 py-2 text-sm hover:bg-gray-100", onClick: () => onAction(opt.value), children: opt.label }, opt.value))) }) }));
@@ -0,0 +1,6 @@
1
+ import { type DriveEditorProps } from "@powerhousedao/reactor-browser";
2
+ import { type DocumentDriveDocument } from "document-drive";
3
+ export type IProps = DriveEditorProps<DocumentDriveDocument>;
4
+ export declare function BaseEditor(props: IProps): import("react/jsx-runtime").JSX.Element;
5
+ export default function Editor(props: IProps): import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/contributor-billing/editor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,OAAO,EACL,KAAK,qBAAqB,EAM3B,MAAM,gBAAgB,CAAC;AAMxB,MAAM,MAAM,MAAM,GAAG,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;AAE7D,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,2CAgFvC;AAED,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,2CAQ3C"}
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { DriveContextProvider } from "@powerhousedao/reactor-browser/hooks/useDriveContext";
3
+ import { addFolder, deleteNode, updateNode, generateNodesCopy, copyNode, } from "document-drive";
4
+ import { WagmiContext } from "@powerhousedao/design-system";
5
+ import { DriveExplorer } from "./components/DriveExplorer.js";
6
+ import { useCallback, useState, useEffect } from "react";
7
+ import { generateId } from "document-model";
8
+ export function BaseEditor(props) {
9
+ const { dispatch, context } = props;
10
+ // Use state for nodes
11
+ const [nodes, setNodes] = useState(props.document.state.global.nodes);
12
+ // Keep nodes in sync with props (in case of external updates)
13
+ useEffect(() => {
14
+ setNodes(props.document.state.global.nodes);
15
+ }, [props.document.state.global.nodes]);
16
+ const onAddFolder = useCallback((name, parentFolder) => {
17
+ dispatch(addFolder({
18
+ id: generateId(),
19
+ name,
20
+ parentFolder,
21
+ }));
22
+ }, [dispatch]);
23
+ const onDeleteNode = useCallback((nodeId) => {
24
+ dispatch(deleteNode({ id: nodeId }));
25
+ setNodes([...props.document.state.global.nodes]);
26
+ }, [dispatch, props.document.state.global.nodes]);
27
+ const renameNode = useCallback((nodeId, name) => {
28
+ dispatch(updateNode({ id: nodeId, name }));
29
+ }, [dispatch]);
30
+ const onCopyNode = useCallback((nodeId, targetName, parentId) => {
31
+ const generateIdWrapper = (prevId) => generateId();
32
+ const copyNodesInput = generateNodesCopy({
33
+ srcId: nodeId,
34
+ targetParentFolder: parentId,
35
+ targetName,
36
+ }, generateIdWrapper, props.document.state.global.nodes);
37
+ const copyNodesAction = copyNodesInput.map((input) => {
38
+ return copyNode(input);
39
+ });
40
+ for (const copyNodeAction of copyNodesAction) {
41
+ dispatch(copyNodeAction);
42
+ }
43
+ }, [dispatch, props.document.state.global.nodes]);
44
+ return (_jsx("div", { className: "new-drive-explorer", style: { height: "100%" }, children: _jsx(DriveExplorer, { driveId: props.document.state.global.id, nodes: nodes, onAddFolder: onAddFolder, onDeleteNode: onDeleteNode, renameNode: renameNode, onCopyNode: onCopyNode, context: context, document: props.document, dispatch: dispatch }, nodes.length) }));
45
+ }
46
+ export default function Editor(props) {
47
+ return (_jsx(DriveContextProvider, { value: props.context, children: _jsx(WagmiContext, { children: _jsx(BaseEditor, { ...props }) }) }));
48
+ }
@@ -0,0 +1,9 @@
1
+ import { type DriveEditorContext } from "@powerhousedao/reactor-browser";
2
+ import { type Node } from "document-drive";
3
+ export declare const useDispatchMap: (nodes: Node[], driveId: string, documentModelModule: any, context: DriveEditorContext) => {
4
+ dispatchMap: {
5
+ [id: string]: (action: any) => void;
6
+ };
7
+ handleDispatchReady: (nodeId: string, dispatch: (action: any) => void) => void;
8
+ };
9
+ //# sourceMappingURL=useDispatchMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDispatchMap.d.ts","sourceRoot":"","sources":["../../../../editors/contributor-billing/hooks/useDispatchMap.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,eAAO,MAAM,cAAc,GACzB,OAAO,IAAI,EAAE,EACb,SAAS,MAAM,EACf,qBAAqB,GAAG,EACxB,SAAS,kBAAkB;;+BAE6C,GAAG,KAAK,IAAI;;kCAGnC,MAAM,YAAY,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI;CAiBzF,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { useState, useCallback } from 'react';
2
+ export const useDispatchMap = (nodes, driveId, documentModelModule, context) => {
3
+ const [dispatchMap, setDispatchMap] = useState({});
4
+ // Update dispatch map when a new dispatch is ready
5
+ const handleDispatchReady = useCallback((nodeId, dispatch) => {
6
+ setDispatchMap(prev => {
7
+ // Only update if the dispatch is different
8
+ if (prev[nodeId] === dispatch) {
9
+ return prev;
10
+ }
11
+ return {
12
+ ...prev,
13
+ [nodeId]: dispatch
14
+ };
15
+ });
16
+ }, []);
17
+ return {
18
+ dispatchMap,
19
+ handleDispatchReady
20
+ };
21
+ };
@@ -0,0 +1,22 @@
1
+ import { UiNode } from "@powerhousedao/design-system";
2
+ import { type DragEvent } from "react";
3
+ type Props = {
4
+ uiNode: UiNode | null;
5
+ onAddFile: (file: File, parentNode: UiNode | null) => Promise<void>;
6
+ onMoveNode: (uiNode: UiNode, targetNode: UiNode) => Promise<void>;
7
+ onCopyNode: (uiNode: UiNode, targetNode: UiNode) => Promise<void>;
8
+ };
9
+ export declare function useDrop(props: Props): {
10
+ isDropTarget: boolean;
11
+ dropProps: {
12
+ onDragOver: (event: DragEvent<HTMLDivElement>) => void;
13
+ onDragLeave: () => void;
14
+ onDrop: (event: DragEvent<HTMLDivElement>) => Promise<void>;
15
+ } | {
16
+ onDragOver: undefined;
17
+ onDragLeave: undefined;
18
+ onDrop: undefined;
19
+ };
20
+ };
21
+ export {};
22
+ //# sourceMappingURL=useDrop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDrop.d.ts","sourceRoot":"","sources":["../../../../editors/contributor-billing/hooks/useDrop.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,KAAK,SAAS,EAAkC,MAAM,OAAO,CAAC;AAEvE,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACnE,CAAC;AACF,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK;;;4BAKK,SAAS,CAAC,cAAc,CAAC;;wBAUhD,SAAS,CAAC,cAAc,CAAC;;;;;;EA2C1C"}
@@ -0,0 +1,57 @@
1
+ import { FILE, UI_NODE } from "@powerhousedao/design-system";
2
+ import { useCallback, useMemo, useState } from "react";
3
+ export function useDrop(props) {
4
+ const { uiNode, onAddFile, onCopyNode, onMoveNode } = props;
5
+ const [isDropTarget, setIsDropTarget] = useState(false);
6
+ const allowedToBeDropTarget = !uiNode || uiNode.kind !== FILE;
7
+ const onDragOver = useCallback((event) => {
8
+ event.preventDefault();
9
+ setIsDropTarget(true);
10
+ }, []);
11
+ const onDragLeave = useCallback(() => {
12
+ setIsDropTarget(false);
13
+ }, []);
14
+ const onDrop = useCallback(async (event) => {
15
+ event.preventDefault();
16
+ event.stopPropagation();
17
+ const droppedFiles = getDroppedFiles(event.dataTransfer.items).filter(Boolean);
18
+ if (droppedFiles.length) {
19
+ for (const file of droppedFiles) {
20
+ if (file) {
21
+ await onAddFile(file, uiNode);
22
+ }
23
+ }
24
+ }
25
+ else if (uiNode) {
26
+ const altOrOptionKeyPressed = event.getModifierState("Alt");
27
+ const data = event.dataTransfer.getData(UI_NODE);
28
+ const droppedNode = JSON.parse(data);
29
+ if (altOrOptionKeyPressed) {
30
+ await onCopyNode(droppedNode, uiNode);
31
+ }
32
+ else {
33
+ await onMoveNode(droppedNode, uiNode);
34
+ }
35
+ }
36
+ setIsDropTarget(false);
37
+ }, [onAddFile, onCopyNode, onMoveNode, uiNode]);
38
+ return useMemo(() => {
39
+ const dropProps = allowedToBeDropTarget
40
+ ? { onDragOver, onDragLeave, onDrop }
41
+ : {
42
+ onDragOver: undefined,
43
+ onDragLeave: undefined,
44
+ onDrop: undefined,
45
+ };
46
+ return {
47
+ isDropTarget,
48
+ dropProps,
49
+ };
50
+ }, [allowedToBeDropTarget, isDropTarget, onDragLeave, onDragOver, onDrop]);
51
+ }
52
+ function getDroppedFiles(items) {
53
+ const droppedFiles = Array.from(items)
54
+ .map((item) => (item.kind === "file" ? item.getAsFile() : null))
55
+ .filter(Boolean);
56
+ return droppedFiles;
57
+ }
@@ -0,0 +1,8 @@
1
+ import type { UiFileNode, UiFolderNode } from "@powerhousedao/design-system";
2
+ interface SelectedFolderChildren {
3
+ folders: UiFolderNode[];
4
+ files: UiFileNode[];
5
+ }
6
+ export declare function useSelectedFolderChildren(selectedNodeId: string | undefined, folders: UiFolderNode[], files: UiFileNode[]): SelectedFolderChildren;
7
+ export {};
8
+ //# sourceMappingURL=useSelectedFolderChildren.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSelectedFolderChildren.d.ts","sourceRoot":"","sources":["../../../../editors/contributor-billing/hooks/useSelectedFolderChildren.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE7E,UAAU,sBAAsB;IAC9B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAED,wBAAgB,yBAAyB,CACvC,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,OAAO,EAAE,YAAY,EAAE,EACvB,KAAK,EAAE,UAAU,EAAE,GAClB,sBAAsB,CAkBxB"}
@@ -0,0 +1,19 @@
1
+ import { useMemo } from "react";
2
+ export function useSelectedFolderChildren(selectedNodeId, folders, files) {
3
+ return useMemo(() => {
4
+ if (!selectedNodeId) {
5
+ // Show root-level items when no folder is selected
6
+ return {
7
+ folders: folders.filter((f) => !f.parentFolder),
8
+ files: files.filter((f) => !f.parentFolder),
9
+ };
10
+ }
11
+ const selectedFolder = folders.find((f) => f.id === selectedNodeId);
12
+ if (!selectedFolder)
13
+ return { folders: [], files: [] };
14
+ return {
15
+ folders: folders.filter((f) => f.parentFolder === selectedFolder.id),
16
+ files: files.filter((f) => f.parentFolder === selectedFolder.id),
17
+ };
18
+ }, [selectedNodeId, folders, files]);
19
+ }
@@ -0,0 +1,4 @@
1
+ import type { Node } from "document-drive";
2
+ import type { UiFileNode, UiFolderNode } from "@powerhousedao/design-system";
3
+ export declare function useTransformedNodes(nodes: Node[], driveId: string): (UiFileNode | UiFolderNode)[];
4
+ //# sourceMappingURL=useTransformedNodes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTransformedNodes.d.ts","sourceRoot":"","sources":["../../../../editors/contributor-billing/hooks/useTransformedNodes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAY,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE7E,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,iCA8BjE"}
@@ -0,0 +1,32 @@
1
+ import { useMemo } from "react";
2
+ export function useTransformedNodes(nodes, driveId) {
3
+ return useMemo(() => {
4
+ return nodes
5
+ .map((node) => {
6
+ const isFolder = "kind" in node && node.kind === "folder";
7
+ if (isFolder) {
8
+ return {
9
+ id: node.id,
10
+ name: node.name,
11
+ kind: "FOLDER",
12
+ parentFolder: node.parentFolder || "",
13
+ driveId,
14
+ children: nodes
15
+ .filter((n) => n.parentFolder === node.id)
16
+ .map((n) => n.id),
17
+ };
18
+ }
19
+ else {
20
+ return {
21
+ id: node.id,
22
+ name: node.name,
23
+ kind: "FILE",
24
+ parentFolder: node.parentFolder || "",
25
+ driveId,
26
+ documentType: node.documentType,
27
+ };
28
+ }
29
+ })
30
+ .filter(Boolean);
31
+ }, [nodes, driveId]);
32
+ }
@@ -0,0 +1,5 @@
1
+ import { type DriveEditorModule } from "@powerhousedao/reactor-browser";
2
+ import { type DocumentDriveDocument } from "document-drive";
3
+ export declare const module: DriveEditorModule<DocumentDriveDocument>;
4
+ export default module;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../editors/contributor-billing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAG5D,eAAO,MAAM,MAAM,EAAE,iBAAiB,CAAC,qBAAqB,CAS3D,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,12 @@
1
+ import Editor from "./editor.js";
2
+ export const module = {
3
+ Component: Editor,
4
+ documentTypes: ["powerhouse/document-drive"],
5
+ config: {
6
+ id: "contributor-billing",
7
+ disableExternalControls: true,
8
+ documentToolbarEnabled: true,
9
+ showSwitchboardLink: true,
10
+ },
11
+ };
12
+ export default module;
@@ -0,0 +1,3 @@
1
+ export { module as Invoice } from "./invoice/index.js";
2
+ export { module as ContributorBilling } from "./contributor-billing/index.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../editors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,MAAM,IAAI,kBAAkB,EAAE,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { module as Invoice } from "./invoice/index.js";
2
+ export { module as ContributorBilling } from "./contributor-billing/index.js";
@@ -0,0 +1,8 @@
1
+ import { InvoiceState } from "../../document-models/invoice/index.js";
2
+ interface InvoicePDFProps {
3
+ invoice: InvoiceState;
4
+ fiatMode: boolean;
5
+ }
6
+ export declare const InvoicePDF: React.FC<InvoicePDFProps>;
7
+ export {};
8
+ //# sourceMappingURL=InvoicePDF.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvoicePDF.d.ts","sourceRoot":"","sources":["../../../editors/invoice/InvoicePDF.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAA+D,MAAM,wCAAwC,CAAC;AAsSnI,UAAU,eAAe;IACvB,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyRhD,CAAC"}