@powerhousedao/contributor-billing 0.1.29 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +165 -8
- package/dist/document-models/billing-statement/actions.d.ts +1 -0
- package/dist/document-models/billing-statement/actions.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/document-model.js +58 -47
- package/dist/document-models/billing-statement/gen/document-schema.d.ts +38 -38
- package/dist/document-models/billing-statement/gen/document-schema.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/line-items/actions.d.ts +6 -2
- package/dist/document-models/billing-statement/gen/line-items/actions.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/line-items/creators.d.ts +3 -2
- package/dist/document-models/billing-statement/gen/line-items/creators.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/line-items/creators.js +2 -1
- package/dist/document-models/billing-statement/gen/line-items/operations.d.ts +2 -1
- package/dist/document-models/billing-statement/gen/line-items/operations.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/ph-factories.js +1 -1
- package/dist/document-models/billing-statement/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/reducer.js +5 -1
- package/dist/document-models/billing-statement/gen/schema/types.d.ts +3 -0
- package/dist/document-models/billing-statement/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/schema/zod.d.ts +2 -1
- package/dist/document-models/billing-statement/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/schema/zod.js +5 -0
- package/dist/document-models/billing-statement/gen/utils.js +2 -2
- package/dist/document-models/billing-statement/src/reducers/general.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/reducers/general.js +5 -4
- package/dist/document-models/billing-statement/src/reducers/line-items.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/reducers/line-items.js +7 -2
- package/dist/document-models/billing-statement/src/reducers/tags.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/reducers/tags.js +1 -1
- package/dist/document-models/billing-statement/src/tests/document-model.test.d.ts +4 -0
- package/dist/document-models/billing-statement/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/tests/document-model.test.js +94 -7
- package/dist/document-models/billing-statement/src/tests/general.test.d.ts +2 -1
- package/dist/document-models/billing-statement/src/tests/general.test.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/tests/general.test.js +33 -88
- package/dist/document-models/billing-statement/src/tests/line-items.test.js +22 -125
- package/dist/document-models/billing-statement/src/tests/tags.test.js +13 -47
- package/dist/document-models/document-models.js +2 -2
- package/dist/document-models/expense-report/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/document-model.js +48 -48
- package/dist/document-models/expense-report/gen/document-schema.d.ts +6 -6
- package/dist/document-models/expense-report/gen/utils.js +1 -1
- package/dist/document-models/expense-report/src/tests/document-model.test.d.ts +4 -0
- package/dist/document-models/expense-report/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/expense-report/src/tests/document-model.test.js +94 -8
- package/dist/document-models/expense-report/src/tests/wallet.test.js +145 -10
- package/dist/document-models/index.d.ts +2 -6
- package/dist/document-models/index.d.ts.map +1 -1
- package/dist/document-models/index.js +2 -6
- package/dist/document-models/integrations/gen/document-model.js +33 -33
- package/dist/document-models/integrations/gen/document-schema.d.ts +6 -6
- package/dist/document-models/integrations/gen/utils.js +1 -1
- package/dist/document-models/integrations/src/reducers/integrations.d.ts.map +1 -1
- package/dist/document-models/integrations/src/reducers/integrations.js +9 -32
- package/dist/document-models/integrations/src/tests/document-model.test.d.ts +4 -0
- package/dist/document-models/integrations/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/integrations/src/tests/document-model.test.js +91 -5
- package/dist/document-models/integrations/src/tests/integrations.test.js +21 -46
- package/dist/document-models/invoice/gen/document-model.js +147 -147
- package/dist/document-models/invoice/gen/document-schema.d.ts +127 -127
- package/dist/document-models/invoice/gen/document-schema.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/ph-factories.js +16 -122
- package/dist/document-models/invoice/gen/schema/types.d.ts +4 -4
- package/dist/document-models/invoice/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/schema/zod.js +4 -4
- package/dist/document-models/invoice/gen/utils.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/utils.js +17 -123
- package/dist/document-models/invoice/src/reducers/general.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/general.js +34 -10
- package/dist/document-models/invoice/src/reducers/items.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/items.js +7 -7
- package/dist/document-models/invoice/src/reducers/parties.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/parties.js +96 -50
- package/dist/document-models/invoice/src/reducers/transitions.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/transitions.js +69 -53
- package/dist/document-models/invoice/src/tests/document-model.test.d.ts +4 -0
- package/dist/document-models/invoice/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/invoice/src/tests/document-model.test.js +91 -4
- package/dist/document-models/invoice/src/tests/general.test.js +24 -26
- package/dist/document-models/invoice/src/tests/items.test.js +37 -17
- package/dist/document-models/invoice/src/tests/parties.test.js +32 -26
- package/dist/document-models/invoice/src/tests/transitions.test.js +52 -500
- package/dist/document-models/invoice/utils/statusTransitions.d.ts.map +1 -1
- package/dist/document-models/invoice/utils/statusTransitions.js +10 -10
- package/dist/editors/billing-statement/components/lineItemsTable.d.ts.map +1 -1
- package/dist/editors/billing-statement/components/lineItemsTable.js +32 -23
- package/dist/editors/billing-statement/components/objectSetTable.d.ts.map +1 -1
- package/dist/editors/billing-statement/components/objectSetTable.js +1 -2
- package/dist/editors/billing-statement/editor.d.ts +4 -0
- package/dist/editors/billing-statement/editor.d.ts.map +1 -1
- package/dist/editors/billing-statement/editor.js +34 -16
- package/dist/editors/billing-statement/lineItemTags/lineItemTags.d.ts.map +1 -1
- package/dist/editors/billing-statement/lineItemTags/lineItemTags.js +36 -37
- package/dist/editors/billing-statement/lineItemTags/tagMapping.d.ts.map +1 -1
- package/dist/editors/billing-statement/lineItemTags/tagMapping.js +28 -10
- package/dist/editors/clean-new-editor/components/CreateDocument.d.ts +6 -0
- package/dist/editors/clean-new-editor/components/CreateDocument.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/CreateDocument.js +18 -0
- package/dist/editors/clean-new-editor/components/DriveContents.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/DriveContents.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/DriveContents.js +10 -0
- package/dist/editors/clean-new-editor/components/DriveExplorer.d.ts +7 -0
- package/dist/editors/clean-new-editor/components/DriveExplorer.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/DriveExplorer.js +16 -0
- package/dist/editors/clean-new-editor/components/EmptyState.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/EmptyState.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/EmptyState.js +10 -0
- package/dist/editors/clean-new-editor/components/Files.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/Files.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/Files.js +12 -0
- package/dist/editors/clean-new-editor/components/FolderTree.d.ts +6 -0
- package/dist/editors/clean-new-editor/components/FolderTree.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/FolderTree.js +65 -0
- package/dist/editors/clean-new-editor/components/Folders.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/Folders.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/Folders.js +12 -0
- package/dist/editors/clean-new-editor/components/NavigationBreadcrumbs.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/NavigationBreadcrumbs.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/NavigationBreadcrumbs.js +6 -0
- package/dist/editors/clean-new-editor/config.d.ts +4 -0
- package/dist/editors/clean-new-editor/config.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/config.js +5 -0
- package/dist/editors/clean-new-editor/editor.d.ts +4 -0
- package/dist/editors/clean-new-editor/editor.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/editor.js +11 -0
- package/dist/editors/clean-new-editor/module.d.ts +3 -0
- package/dist/editors/clean-new-editor/module.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/module.js +10 -0
- package/dist/editors/contributor-billing/components/ConfirmationModal.d.ts +14 -0
- package/dist/editors/contributor-billing/components/ConfirmationModal.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/ConfirmationModal.js +6 -0
- package/dist/editors/contributor-billing/components/CreateDocument.d.ts +6 -0
- package/dist/editors/contributor-billing/components/CreateDocument.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/CreateDocument.js +18 -0
- package/dist/editors/contributor-billing/components/DriveContents.d.ts +3 -0
- package/dist/editors/contributor-billing/components/DriveContents.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/DriveContents.js +10 -0
- package/dist/editors/contributor-billing/components/DriveExplorer.d.ts +3 -3
- package/dist/editors/contributor-billing/components/DriveExplorer.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/DriveExplorer.js +13 -180
- package/dist/editors/contributor-billing/components/EmptyState.d.ts +3 -0
- package/dist/editors/contributor-billing/components/EmptyState.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/EmptyState.js +10 -0
- package/dist/editors/contributor-billing/components/Files.d.ts +3 -0
- package/dist/editors/contributor-billing/components/Files.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/Files.js +12 -0
- package/dist/editors/contributor-billing/components/FolderTree.d.ts +6 -0
- package/dist/editors/contributor-billing/components/FolderTree.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/FolderTree.js +65 -0
- package/dist/editors/contributor-billing/components/Folders.d.ts +3 -0
- package/dist/editors/contributor-billing/components/Folders.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/Folders.js +12 -0
- package/dist/editors/contributor-billing/components/HeaderControls.d.ts +38 -0
- package/dist/editors/contributor-billing/components/HeaderControls.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/HeaderControls.js +124 -0
- package/dist/editors/contributor-billing/components/HeaderStats.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/{InvoiceTable/HeaderStats.js → HeaderStats.js} +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable.d.ts +22 -0
- package/dist/editors/contributor-billing/components/InvoiceTable.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/InvoiceTable.js +399 -0
- package/dist/editors/contributor-billing/components/InvoiceTableContainer.d.ts +6 -0
- package/dist/editors/contributor-billing/components/InvoiceTableContainer.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/InvoiceTableContainer.js +111 -0
- package/dist/editors/contributor-billing/components/InvoiceTableRow.d.ts +32 -0
- package/dist/editors/contributor-billing/components/InvoiceTableRow.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/InvoiceTableRow.js +55 -0
- package/dist/editors/contributor-billing/components/InvoiceTableSection.d.ts +13 -0
- package/dist/editors/contributor-billing/components/InvoiceTableSection.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/InvoiceTableSection.js +16 -0
- package/dist/editors/contributor-billing/components/NavigationBreadcrumbs.d.ts +3 -0
- package/dist/editors/contributor-billing/components/NavigationBreadcrumbs.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/NavigationBreadcrumbs.js +6 -0
- package/dist/editors/contributor-billing/config.d.ts +1 -0
- package/dist/editors/contributor-billing/config.d.ts.map +1 -1
- package/dist/editors/contributor-billing/config.js +4 -1
- package/dist/editors/contributor-billing/editor.d.ts +1 -0
- package/dist/editors/contributor-billing/editor.d.ts.map +1 -1
- package/dist/editors/contributor-billing/editor.js +4 -1
- package/dist/editors/contributor-billing/module.d.ts +1 -1
- package/dist/editors/contributor-billing/module.d.ts.map +1 -1
- package/dist/editors/contributor-billing/module.js +3 -2
- package/dist/editors/contributor-billing/utils/exchangeRate.d.ts +15 -0
- package/dist/editors/contributor-billing/utils/exchangeRate.d.ts.map +1 -0
- package/dist/editors/contributor-billing/utils/exchangeRate.js +122 -0
- package/dist/editors/editors.js +2 -2
- package/dist/editors/expense-report/components/AddBillingStatementModal.d.ts.map +1 -1
- package/dist/editors/expense-report/editor.js +8 -8
- package/dist/editors/index.d.ts +2 -2
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +2 -2
- package/dist/editors/integrations/components/EditName.d.ts +3 -0
- package/dist/editors/integrations/components/EditName.d.ts.map +1 -0
- package/dist/editors/integrations/components/EditName.js +31 -0
- package/dist/editors/integrations/editor.d.ts +2 -4
- package/dist/editors/integrations/editor.d.ts.map +1 -1
- package/dist/editors/integrations/editor.js +5 -132
- package/dist/editors/integrations/module.d.ts +1 -0
- package/dist/editors/integrations/module.d.ts.map +1 -1
- package/dist/editors/integrations/module.js +3 -2
- package/dist/editors/invoice/components/confirmationModal.js +1 -1
- package/dist/editors/invoice/components/countryForm.d.ts.map +1 -1
- package/dist/editors/invoice/components/countryForm.js +1 -1
- package/dist/editors/invoice/components/currencyForm.d.ts.map +1 -1
- package/dist/editors/invoice/components/currencyForm.js +1 -1
- package/dist/editors/invoice/components/datePicker.d.ts +1 -1
- package/dist/editors/invoice/components/datePicker.d.ts.map +1 -1
- package/dist/editors/invoice/components/datePicker.js +1 -1
- package/dist/editors/invoice/components/inputField.d.ts.map +1 -1
- package/dist/editors/invoice/components/inputField.js +3 -2
- package/dist/editors/invoice/components/lineItemMobileModal.d.ts.map +1 -1
- package/dist/editors/invoice/components/lineItemMobileModal.js +1 -1
- package/dist/editors/invoice/components/numberForm.d.ts.map +1 -1
- package/dist/editors/invoice/components/selectField.js +7 -7
- package/dist/editors/invoice/components/statusModalComponents.d.ts.map +1 -1
- package/dist/editors/invoice/components/statusModalComponents.js +27 -3
- package/dist/editors/invoice/editor.d.ts +1 -4
- package/dist/editors/invoice/editor.d.ts.map +1 -1
- package/dist/editors/invoice/editor.js +102 -40
- package/dist/editors/invoice/exportUBL.d.ts.map +1 -1
- package/dist/editors/invoice/exportUBL.js +35 -18
- package/dist/editors/invoice/ingestPDF.d.ts.map +1 -1
- package/dist/editors/invoice/ingestPDF.js +15 -9
- package/dist/editors/invoice/invoiceToGnosis.js +3 -3
- package/dist/editors/invoice/legalEntity/bankSection.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/legalEntity.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/walletSection.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/walletSection.js +3 -3
- package/dist/editors/invoice/lineItemTags/lineItemTags.d.ts.map +1 -1
- package/dist/editors/invoice/lineItemTags/lineItemTags.js +1 -1
- package/dist/editors/invoice/lineItemTags/tagMobileModal.d.ts.map +1 -1
- package/dist/editors/invoice/lineItemTags/tagMobileModal.js +4 -3
- package/dist/editors/invoice/lineItems.d.ts.map +1 -1
- package/dist/editors/invoice/module.d.ts +1 -0
- package/dist/editors/invoice/module.d.ts.map +1 -1
- package/dist/editors/invoice/module.js +2 -1
- package/dist/editors/invoice/requestFinance.js +4 -4
- package/dist/editors/invoice/uploadPdfChunked.d.ts.map +1 -1
- package/dist/editors/invoice/uploadPdfChunked.js +5 -4
- package/dist/editors/invoice/utils/utils.d.ts.map +1 -1
- package/dist/editors/invoice/utils/utils.js +5 -4
- package/dist/editors/invoice/validation/validationHandler.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationHandler.js +11 -5
- package/dist/editors/invoice/validation/validationManager.d.ts +2 -2
- package/dist/editors/invoice/validation/validationManager.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationManager.js +5 -5
- package/dist/editors/invoice/validation/validationRules.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationRules.js +178 -178
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/old-contributor-billing/components/DriveExplorer.d.ts +7 -0
- package/dist/old-contributor-billing/components/DriveExplorer.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/DriveExplorer.js +184 -0
- package/dist/old-contributor-billing/components/InvoiceTable/HeaderControls.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/HeaderStats.d.ts +2 -0
- package/dist/old-contributor-billing/components/InvoiceTable/HeaderStats.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/HeaderStats.js +73 -0
- package/dist/old-contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts.map +1 -0
- package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableSection.js +1 -1
- package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/RowActionMenu.d.ts +1 -1
- package/dist/old-contributor-billing/components/InvoiceTable/RowActionMenu.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/RowActionMenu.js +2 -0
- package/dist/old-contributor-billing/config.d.ts +3 -0
- package/dist/old-contributor-billing/config.d.ts.map +1 -0
- package/dist/old-contributor-billing/config.js +4 -0
- package/dist/old-contributor-billing/editor.d.ts +3 -0
- package/dist/old-contributor-billing/editor.d.ts.map +1 -0
- package/dist/old-contributor-billing/editor.js +8 -0
- package/dist/old-contributor-billing/module.d.ts +3 -0
- package/dist/old-contributor-billing/module.d.ts.map +1 -0
- package/dist/old-contributor-billing/module.js +9 -0
- package/dist/old-contributor-billing/util.d.ts.map +1 -0
- package/dist/{editors/contributor-billing → old-contributor-billing}/util.js +11 -9
- package/dist/powerhouse.manifest.json +6 -41
- package/dist/processors/index.d.ts +1 -6
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/index.js +1 -18
- package/dist/scripts/contributor-billing/createExpenseReportCsv.d.ts.map +1 -1
- package/dist/scripts/contributor-billing/createExpenseReportCsv.js +24 -24
- package/dist/scripts/contributor-billing/createXeroCsv.d.ts.map +1 -1
- package/dist/scripts/contributor-billing/createXeroCsv.js +52 -46
- package/dist/scripts/invoice/autoTagging.d.ts +1 -1
- package/dist/scripts/invoice/autoTagging.d.ts.map +1 -1
- package/dist/scripts/invoice/autoTagging.js +168 -138
- package/dist/scripts/invoice/exampleBatchTxn.js +16 -16
- package/dist/scripts/invoice/gnosisTransactionBuilder.d.ts.map +1 -1
- package/dist/scripts/invoice/gnosisTransactionBuilder.js +32 -25
- package/dist/scripts/invoice/pdfToClaudeAI.d.ts.map +1 -1
- package/dist/scripts/invoice/pdfToClaudeAI.js +36 -30
- package/dist/scripts/invoice/requestFinance.d.ts.map +1 -1
- package/dist/scripts/invoice/requestFinance.js +13 -13
- package/dist/style.css +407 -13659
- package/dist/subgraphs/billing-statement/resolvers.d.ts +1 -1
- package/dist/subgraphs/billing-statement/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/billing-statement/resolvers.js +16 -5
- package/dist/subgraphs/billing-statement/schema.d.ts.map +1 -1
- package/dist/subgraphs/billing-statement/schema.js +12 -67
- package/dist/subgraphs/expense-report/resolvers.d.ts +1 -1
- package/dist/subgraphs/expense-report/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/expense-report/resolvers.js +4 -5
- package/dist/subgraphs/expense-report/schema.d.ts.map +1 -1
- package/dist/subgraphs/expense-report/schema.js +5 -48
- package/dist/subgraphs/index.d.ts +1 -0
- package/dist/subgraphs/index.d.ts.map +1 -1
- package/dist/subgraphs/index.js +1 -0
- package/dist/subgraphs/integrations/resolvers.d.ts +1 -1
- package/dist/subgraphs/integrations/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/integrations/resolvers.js +4 -5
- package/dist/subgraphs/integrations/schema.d.ts.map +1 -1
- package/dist/subgraphs/integrations/schema.js +3 -43
- package/dist/subgraphs/invoice/index.d.ts.map +1 -1
- package/dist/subgraphs/invoice/index.js +1 -20
- package/dist/subgraphs/invoice/resolvers.d.ts +1 -1
- package/dist/subgraphs/invoice/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/invoice/resolvers.js +4 -9
- package/dist/subgraphs/invoice/schema.d.ts.map +1 -1
- package/dist/subgraphs/invoice/schema.js +14 -232
- package/dist/subgraphs/{invoice → invoice-addon}/customResolvers.d.ts +1 -1
- package/dist/subgraphs/invoice-addon/customResolvers.d.ts.map +1 -0
- package/dist/subgraphs/{invoice → invoice-addon}/customResolvers.js +38 -34
- package/dist/subgraphs/invoice-addon/index.d.ts +11 -0
- package/dist/subgraphs/invoice-addon/index.d.ts.map +1 -0
- package/dist/subgraphs/invoice-addon/index.js +11 -0
- package/dist/subgraphs/invoice-addon/resolvers.d.ts +3 -0
- package/dist/subgraphs/invoice-addon/resolvers.d.ts.map +1 -0
- package/dist/subgraphs/invoice-addon/resolvers.js +12 -0
- package/dist/subgraphs/invoice-addon/schema.d.ts +3 -0
- package/dist/subgraphs/invoice-addon/schema.d.ts.map +1 -0
- package/dist/subgraphs/invoice-addon/schema.js +52 -0
- package/package.json +9 -20
- package/dist/document-models/expense-report/gen/expense-report/actions.d.ts +0 -8
- package/dist/document-models/expense-report/gen/expense-report/actions.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/expense-report/actions.js +0 -1
- package/dist/document-models/expense-report/gen/expense-report/creators.d.ts +0 -4
- package/dist/document-models/expense-report/gen/expense-report/creators.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/expense-report/creators.js +0 -3
- package/dist/document-models/expense-report/gen/expense-report/error.d.ts +0 -2
- package/dist/document-models/expense-report/gen/expense-report/error.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/expense-report/error.js +0 -1
- package/dist/document-models/expense-report/gen/expense-report/operations.d.ts +0 -7
- package/dist/document-models/expense-report/gen/expense-report/operations.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/expense-report/operations.js +0 -3
- package/dist/document-models/expense-report/src/tests/expense-report.test.d.ts +0 -6
- package/dist/document-models/expense-report/src/tests/expense-report.test.d.ts.map +0 -1
- package/dist/document-models/expense-report/src/tests/expense-report.test.js +0 -24
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderStats.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/RowActionMenu.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/RowActionMenu.js +0 -2
- package/dist/editors/contributor-billing/util.d.ts.map +0 -1
- package/dist/editors/hooks/useBillingStatementDocument.d.ts +0 -4
- package/dist/editors/hooks/useBillingStatementDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useBillingStatementDocument.js +0 -8
- package/dist/editors/hooks/useExpenseReportDocument.d.ts +0 -4
- package/dist/editors/hooks/useExpenseReportDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useExpenseReportDocument.js +0 -8
- package/dist/editors/hooks/useIntegrationsDocument.d.ts +0 -4
- package/dist/editors/hooks/useIntegrationsDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useIntegrationsDocument.js +0 -8
- package/dist/editors/hooks/useInvoiceDocument.d.ts +0 -4
- package/dist/editors/hooks/useInvoiceDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useInvoiceDocument.js +0 -8
- package/dist/editors/integrations/config.d.ts +0 -3
- package/dist/editors/integrations/config.d.ts.map +0 -1
- package/dist/editors/integrations/config.js +0 -3
- package/dist/editors/invoice/exportSAFTPT.d.ts +0 -184
- package/dist/editors/invoice/exportSAFTPT.d.ts.map +0 -1
- package/dist/editors/invoice/exportSAFTPT.js +0 -548
- package/dist/processors/line-item-processor/index.d.ts +0 -11
- package/dist/processors/line-item-processor/index.d.ts.map +0 -1
- package/dist/processors/line-item-processor/index.js +0 -36
- package/dist/subgraphs/invoice/customResolvers.d.ts.map +0 -1
- package/editors/invoice/assets/custom.d.ts +0 -4
- package/editors/invoice/assets/powerhouseLogo.png +0 -0
- /package/dist/editors/contributor-billing/components/{InvoiceTable/HeaderStats.d.ts → HeaderStats.d.ts} +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/HeaderControls.d.ts +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/HeaderControls.js +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTable.d.ts +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTable.js +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableRow.d.ts +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableRow.js +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableSection.d.ts +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/util.d.ts +0 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Sidebar, SidebarProvider, } from "@powerhousedao/document-engineering";
|
|
3
|
+
import { setSelectedNode, useNodesInSelectedDrive, useSelectedDrive, useSelectedNode, } from "@powerhousedao/reactor-browser";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
function buildSidebarNodes(nodes, parentId) {
|
|
6
|
+
return nodes
|
|
7
|
+
.filter((n) => {
|
|
8
|
+
if (parentId == null) {
|
|
9
|
+
return n.parentFolder == null;
|
|
10
|
+
}
|
|
11
|
+
return n.parentFolder === parentId;
|
|
12
|
+
})
|
|
13
|
+
.map((node) => {
|
|
14
|
+
if (node.kind === "folder") {
|
|
15
|
+
return {
|
|
16
|
+
id: node.id,
|
|
17
|
+
title: node.name,
|
|
18
|
+
icon: "FolderClose",
|
|
19
|
+
expandedIcon: "FolderOpen",
|
|
20
|
+
children: buildSidebarNodes(nodes, node.id),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
id: node.id,
|
|
25
|
+
title: node.name,
|
|
26
|
+
icon: "File",
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function transformNodesToSidebarNodes(nodes, driveName) {
|
|
31
|
+
return [
|
|
32
|
+
{
|
|
33
|
+
id: "root",
|
|
34
|
+
title: driveName,
|
|
35
|
+
icon: "Drive",
|
|
36
|
+
children: buildSidebarNodes(nodes, null),
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Hierarchical folder tree navigation component using Sidebar from document-engineering.
|
|
42
|
+
* Displays folders and files in a tree structure with expand/collapse functionality, search, and resize support.
|
|
43
|
+
*/
|
|
44
|
+
export function FolderTree() {
|
|
45
|
+
const [selectedDrive] = useSelectedDrive();
|
|
46
|
+
const nodes = useNodesInSelectedDrive();
|
|
47
|
+
const selectedNode = useSelectedNode();
|
|
48
|
+
const driveName = selectedDrive.header.name;
|
|
49
|
+
// Transform Node[] to hierarchical SidebarNode structure
|
|
50
|
+
const sidebarNodes = useMemo(() => transformNodesToSidebarNodes(nodes || [], driveName), [nodes, driveName]);
|
|
51
|
+
const handleActiveNodeChange = (node) => {
|
|
52
|
+
// If root node is selected, pass undefined to match existing behavior
|
|
53
|
+
if (node.id === "root") {
|
|
54
|
+
setSelectedNode(undefined);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
setSelectedNode(node.id);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
// Map selectedNodeId to activeNodeId (use "root" when undefined)
|
|
61
|
+
const activeNodeId = !selectedNode || selectedNode.id === selectedDrive.header.id
|
|
62
|
+
? "root"
|
|
63
|
+
: selectedNode.id;
|
|
64
|
+
return (_jsx(SidebarProvider, { nodes: sidebarNodes, children: _jsx(Sidebar, { className: "pt-1", nodes: sidebarNodes, activeNodeId: activeNodeId, onActiveNodeChange: handleActiveNodeChange, sidebarTitle: "Drive Explorer", showSearchBar: true, resizable: true, allowPinning: false, showStatusFilter: false, initialWidth: 256, defaultLevel: 2 }) }));
|
|
65
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Folders.d.ts","sourceRoot":"","sources":["../../../../editors/clean-new-editor/components/Folders.tsx"],"names":[],"mappings":"AAMA,wDAAwD;AACxD,wBAAgB,OAAO,mDAgBtB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FolderItem } from "@powerhousedao/design-system/connect";
|
|
3
|
+
import { useNodesInSelectedDriveOrFolder, isFolderNodeKind, } from "@powerhousedao/reactor-browser";
|
|
4
|
+
/** Shows the folders in the selected drive or folder */
|
|
5
|
+
export function Folders() {
|
|
6
|
+
const nodes = useNodesInSelectedDriveOrFolder();
|
|
7
|
+
const folderNodes = nodes.filter((n) => isFolderNodeKind(n));
|
|
8
|
+
const hasFolders = folderNodes.length > 0;
|
|
9
|
+
if (!hasFolders)
|
|
10
|
+
return null;
|
|
11
|
+
return (_jsxs("div", { children: [_jsx("h3", { className: "mb-2 text-sm font-bold text-gray-600", children: "Folders" }), _jsx("div", { className: "flex flex-wrap gap-4", children: folderNodes.map((folderNode) => (_jsx(FolderItem, { folderNode: folderNode }, folderNode.id))) })] }));
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationBreadcrumbs.d.ts","sourceRoot":"","sources":["../../../../editors/clean-new-editor/components/NavigationBreadcrumbs.tsx"],"names":[],"mappings":"AAEA,wEAAwE;AACxE,wBAAgB,qBAAqB,4CAMpC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Breadcrumbs } from "@powerhousedao/design-system/connect";
|
|
3
|
+
/** Shows the navigation breadcrumbs for the selected drive or folder */
|
|
4
|
+
export function NavigationBreadcrumbs() {
|
|
5
|
+
return (_jsx("div", { className: "border-b border-gray-200 pb-3 space-y-3", children: _jsx(Breadcrumbs, {}) }));
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../editors/clean-new-editor/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,2CAA2C;AAC3C,eAAO,MAAM,YAAY,EAAE,mBAG1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/clean-new-editor/editor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,2DAA2D;AAC3D,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,2CAKhD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useSetPHDriveEditorConfig } from "@powerhousedao/reactor-browser";
|
|
3
|
+
import { DriveExplorer } from "./components/DriveExplorer.js";
|
|
4
|
+
import { editorConfig } from "./config.js";
|
|
5
|
+
/** Editor component for the CleanNewEditor drive editor */
|
|
6
|
+
export default function Editor(props) {
|
|
7
|
+
// set the config for this drive editor
|
|
8
|
+
// you can update these configs in `./config.ts`
|
|
9
|
+
useSetPHDriveEditorConfig(editorConfig);
|
|
10
|
+
return _jsx(DriveExplorer, { ...props });
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../editors/clean-new-editor/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,eAAO,MAAM,cAAc,EAAE,YAO5B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from "document-model";
|
|
2
|
+
import { lazy } from "react";
|
|
3
|
+
export const CleanNewEditor = {
|
|
4
|
+
Component: lazy(() => import("./editor.js")),
|
|
5
|
+
documentTypes: ["powerhouse/document-drive"],
|
|
6
|
+
config: {
|
|
7
|
+
id: "clean-new-editor",
|
|
8
|
+
name: "clean-new-editor",
|
|
9
|
+
},
|
|
10
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
interface ConfirmationModalProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
header: React.ReactNode;
|
|
5
|
+
onCancel: () => void;
|
|
6
|
+
onContinue: () => void;
|
|
7
|
+
cancelLabel?: string;
|
|
8
|
+
continueLabel?: string;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
continueDisabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const ConfirmationModal: React.FC<ConfirmationModalProps>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=ConfirmationModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmationModal.d.ts","sourceRoot":"","sources":["../../../../editors/contributor-billing/components/ConfirmationModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,UAAU,sBAAsB;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA2C9D,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const ConfirmationModal = ({ open, header, onCancel, onContinue, cancelLabel = "Cancel", continueLabel = "Continue", children, continueDisabled = false, }) => {
|
|
3
|
+
if (!open)
|
|
4
|
+
return null;
|
|
5
|
+
return (_jsx("div", { className: "contributor-billing-modal fixed inset-0 z-50 flex items-center justify-center bg-black/10 backdrop-blur-sm", children: _jsxs("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-md p-6", children: [_jsx("div", { className: "border-b border-slate-100 pb-3 text-xl font-semibold text-gray-800", children: header }), _jsx("div", { className: "my-5 rounded-lg bg-slate-50 p-4 text-center flex flex-col items-center justify-center min-h-[64px]", children: children }), _jsxs("div", { className: "mt-6 flex justify-between gap-3", children: [_jsx("button", { type: "button", onClick: onCancel, className: "flex-1 min-h-[44px] min-w-[120px] text-sm font-medium py-2.5 px-5 rounded-lg outline-none active:opacity-75 hover:bg-slate-100 transition-colors bg-slate-50 text-slate-700", children: cancelLabel }), _jsx("button", { type: "button", onClick: onContinue, disabled: continueDisabled, className: `flex-1 min-h-[44px] min-w-[120px] text-sm font-medium py-2.5 px-5 rounded-lg outline-none active:opacity-75 transition-colors bg-gray-800 text-white hover:bg-gray-700 ${continueDisabled ? "opacity-50 cursor-not-allowed" : ""}`, children: continueLabel })] })] }) }));
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateDocument.d.ts","sourceRoot":"","sources":["../../../../editors/contributor-billing/components/CreateDocument.tsx"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAgB,cAAc,4CAsB7B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { showCreateDocumentModal, useAllowedDocumentModelModules, } from "@powerhousedao/reactor-browser";
|
|
3
|
+
/**
|
|
4
|
+
* Document creation UI component.
|
|
5
|
+
* Displays available document types as clickable buttons.
|
|
6
|
+
*/
|
|
7
|
+
export function CreateDocument() {
|
|
8
|
+
const allowedDocumentModelModules = useAllowedDocumentModelModules();
|
|
9
|
+
return (_jsxs("div", { children: [_jsx("h3", { className: "mb-3 mt-4 text-sm font-bold text-gray-600", children: "Create document" }), _jsx("div", { className: "flex w-full flex-wrap gap-4", children: allowedDocumentModelModules?.map((documentModelModule) => {
|
|
10
|
+
return (_jsx(CreateDocumentButton, { documentModelModule: documentModelModule }, documentModelModule.documentModel.global.id));
|
|
11
|
+
}) })] }));
|
|
12
|
+
}
|
|
13
|
+
function CreateDocumentButton({ documentModelModule }) {
|
|
14
|
+
const documentType = documentModelModule.documentModel.global.id;
|
|
15
|
+
const documentModelName = documentModelModule.documentModel.global.name || documentType;
|
|
16
|
+
const documentModelDescription = documentModelModule.documentModel.global.description;
|
|
17
|
+
return (_jsx("button", { className: "cursor-pointer rounded-md bg-gray-200 py-2 px-3 hover:bg-gray-300", title: documentModelName, "aria-description": documentModelDescription, onClick: () => showCreateDocumentModal(documentType), children: documentModelName }));
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DriveContents.d.ts","sourceRoot":"","sources":["../../../../editors/contributor-billing/components/DriveContents.tsx"],"names":[],"mappings":"AAMA,4DAA4D;AAC5D,wBAAgB,aAAa,4CAU5B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CreateDocument } from "./CreateDocument.js";
|
|
3
|
+
import { EmptyState } from "./EmptyState.js";
|
|
4
|
+
import { Files } from "./Files.js";
|
|
5
|
+
import { Folders } from "./Folders.js";
|
|
6
|
+
import { NavigationBreadcrumbs } from "./NavigationBreadcrumbs.js";
|
|
7
|
+
/** Shows the documents and folders in the selected drive */
|
|
8
|
+
export function DriveContents() {
|
|
9
|
+
return (_jsxs("div", { className: "space-y-6 px-6", children: [_jsx(NavigationBreadcrumbs, {}), _jsx(Folders, {}), _jsx(Files, {}), _jsx(EmptyState, {}), _jsx(CreateDocument, {})] }));
|
|
10
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EditorProps } from "document-model";
|
|
2
2
|
/**
|
|
3
|
-
* Main drive explorer component
|
|
4
|
-
*
|
|
3
|
+
* Main drive explorer component for Contributor Billing.
|
|
4
|
+
* Displays an operational hub with invoice management and billing statement generation.
|
|
5
5
|
*/
|
|
6
|
-
export declare function DriveExplorer(
|
|
6
|
+
export declare function DriveExplorer({ children }: EditorProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
//# sourceMappingURL=DriveExplorer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DriveExplorer.d.ts","sourceRoot":"","sources":["../../../../editors/contributor-billing/components/DriveExplorer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DriveExplorer.d.ts","sourceRoot":"","sources":["../../../../editors/contributor-billing/components/DriveExplorer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKlD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,WAAW,2CAiCtD"}
|
|
@@ -1,184 +1,17 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
6
|
-
import { InvoiceTable } from "./InvoiceTable/InvoiceTable.js";
|
|
7
|
-
import { HeaderStats } from "./InvoiceTable/HeaderStats.js";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ToastContainer } from "@powerhousedao/design-system/connect";
|
|
3
|
+
import { HeaderStats } from "./HeaderStats.js";
|
|
4
|
+
import { InvoiceTableContainer } from "./InvoiceTableContainer.js";
|
|
8
5
|
/**
|
|
9
|
-
* Main drive explorer component
|
|
10
|
-
*
|
|
6
|
+
* Main drive explorer component for Contributor Billing.
|
|
7
|
+
* Displays an operational hub with invoice management and billing statement generation.
|
|
11
8
|
*/
|
|
12
|
-
export function DriveExplorer(
|
|
13
|
-
|
|
14
|
-
const [selected, setSelected] = useState({});
|
|
15
|
-
const [selectedStatuses, setSelectedStatuses] = useState([]);
|
|
16
|
-
const reactor = useReactor();
|
|
17
|
-
// Handler for status filter changes
|
|
18
|
-
const handleStatusChange = useCallback((value) => {
|
|
19
|
-
setSelectedStatuses(Array.isArray(value) ? value : [value]);
|
|
20
|
-
}, []);
|
|
21
|
-
// === DOCUMENT EDITOR STATE ===
|
|
22
|
-
// Customize document opening/closing behavior here
|
|
23
|
-
const [openModal, setOpenModal] = useState(false);
|
|
24
|
-
const selectedDocumentModel = useRef(null);
|
|
25
|
-
const editorModules = useEditorModules();
|
|
26
|
-
// === STATE MANAGEMENT HOOKS ===
|
|
27
|
-
// Core state hooks for drive navigation
|
|
28
|
-
const [selectedDrive] = useSelectedDrive(); // Currently selected drive
|
|
29
|
-
const selectedFolder = useSelectedFolder(); // Currently selected folder
|
|
30
|
-
const fileChildren = useFileNodesInSelectedDrive();
|
|
31
|
-
// All document states
|
|
32
|
-
const allDocuments = useDocumentsInSelectedDrive();
|
|
33
|
-
// Handler for row selection (does not affect status filter display)
|
|
34
|
-
const handleRowSelection = useCallback((rowId, checked, rowStatus) => {
|
|
35
|
-
setSelected((prev) => ({
|
|
36
|
-
...prev,
|
|
37
|
-
[rowId]: checked,
|
|
38
|
-
}));
|
|
39
|
-
}, []);
|
|
40
|
-
// Determine if CSV export should be enabled based on selected rows
|
|
41
|
-
const canExportSelectedRows = useCallback(() => {
|
|
42
|
-
const allowedStatuses = [
|
|
43
|
-
"ACCEPTED",
|
|
44
|
-
"AWAITINGPAYMENT",
|
|
45
|
-
"PAYMENTSCHEDULED",
|
|
46
|
-
"PAYMENTSENT",
|
|
47
|
-
"PAYMENTRECEIVED",
|
|
48
|
-
"PAYMENTCLOSED",
|
|
49
|
-
];
|
|
50
|
-
// Get all selected row IDs
|
|
51
|
-
const selectedRowIds = Object.keys(selected).filter((id) => selected[id]);
|
|
52
|
-
if (selectedRowIds.length === 0)
|
|
53
|
-
return false;
|
|
54
|
-
// Check if all selected rows have allowed statuses
|
|
55
|
-
const selectedRows = allDocuments?.filter((doc) => selectedRowIds.includes(doc.header.id)) ||
|
|
56
|
-
[];
|
|
57
|
-
return selectedRows.every((row) => allowedStatuses.includes(row.state.global
|
|
58
|
-
.status));
|
|
59
|
-
}, [selected, allDocuments]);
|
|
60
|
-
// Create a stable dispatcher map using useRef only (no useState to avoid re-renders)
|
|
61
|
-
const dispatchersRef = useRef(new Map());
|
|
62
|
-
// Create a working dispatch function that uses the existing reactor system
|
|
63
|
-
const createDispatchFunction = useCallback((docId) => {
|
|
64
|
-
return async (action) => {
|
|
65
|
-
try {
|
|
66
|
-
console.log(`Dispatching action for document ${docId}:`, action);
|
|
67
|
-
// Since we can't use GraphQL mutations, we need to find another way
|
|
68
|
-
// The key insight is that the existing useDocumentById hook already works
|
|
69
|
-
// We need to create a dispatch function that can handle actions
|
|
70
|
-
// Try to access the reactor instance through the global window object
|
|
71
|
-
// This is a common pattern in React applications
|
|
72
|
-
if (reactor) {
|
|
73
|
-
const result = await reactor.addAction(docId, action);
|
|
74
|
-
if (result.status !== "SUCCESS") {
|
|
75
|
-
throw new Error(result.error?.message ?? "Failed to dispatch action");
|
|
76
|
-
}
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
// Fallback: Use a custom event system
|
|
80
|
-
// This allows the reactor system to listen for actions
|
|
81
|
-
const actionEvent = new CustomEvent("reactor-action", {
|
|
82
|
-
detail: {
|
|
83
|
-
docId,
|
|
84
|
-
action,
|
|
85
|
-
timestamp: Date.now(),
|
|
86
|
-
},
|
|
87
|
-
});
|
|
88
|
-
window.dispatchEvent(actionEvent);
|
|
89
|
-
// For now, we'll just log the action to maintain the interface
|
|
90
|
-
// The InvoiceTable will still work, but actions won't be persisted
|
|
91
|
-
console.warn(`Action dispatched via event system for document ${docId}. Make sure the reactor system is listening for 'reactor-action' events.`);
|
|
92
|
-
}
|
|
93
|
-
catch (error) {
|
|
94
|
-
console.error(`Failed to dispatch action for document ${docId}:`, error);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
}, []);
|
|
98
|
-
// Update dispatchers when state changes - use a more stable approach
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
// Only update if the document IDs have actually changed
|
|
101
|
-
const currentDocIds = allDocuments?.map((doc) => doc.header.id) || [];
|
|
102
|
-
const previousDocIds = Array.from(dispatchersRef.current.keys());
|
|
103
|
-
// Check if the document list has actually changed
|
|
104
|
-
const hasChanged = currentDocIds.length !== previousDocIds.length ||
|
|
105
|
-
!currentDocIds.every((id) => previousDocIds.includes(id));
|
|
106
|
-
if (!hasChanged) {
|
|
107
|
-
// Just update the document states without recreating dispatchers
|
|
108
|
-
allDocuments?.forEach((doc) => {
|
|
109
|
-
const docId = doc.header.id;
|
|
110
|
-
if (dispatchersRef.current.has(docId)) {
|
|
111
|
-
const [, dispatchFunction] = dispatchersRef.current.get(docId);
|
|
112
|
-
dispatchersRef.current.set(docId, [doc, dispatchFunction]);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
// Only recreate dispatchers when the document list actually changes
|
|
118
|
-
const newDispatchers = new Map();
|
|
119
|
-
allDocuments?.forEach((doc) => {
|
|
120
|
-
const docId = doc.header.id;
|
|
121
|
-
// Check if we already have a dispatcher for this document
|
|
122
|
-
if (dispatchersRef.current.has(docId)) {
|
|
123
|
-
// Update the document state but keep the same dispatch function
|
|
124
|
-
const [, dispatchFunction] = dispatchersRef.current.get(docId);
|
|
125
|
-
newDispatchers.set(docId, [doc, dispatchFunction]);
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
// Create a new dispatcher for this document
|
|
129
|
-
const dispatchFunction = createDispatchFunction(docId);
|
|
130
|
-
newDispatchers.set(docId, [doc, dispatchFunction]);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
// Clean up dispatchers for documents that no longer exist
|
|
134
|
-
for (const [docId] of dispatchersRef.current) {
|
|
135
|
-
if (!currentDocIds.includes(docId)) {
|
|
136
|
-
dispatchersRef.current.delete(docId);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
// Update the ref
|
|
140
|
-
dispatchersRef.current = newDispatchers;
|
|
141
|
-
}, [allDocuments, createDispatchFunction]);
|
|
142
|
-
const getDocDispatcher = (id) => {
|
|
143
|
-
return dispatchersRef.current.get(id) || null;
|
|
144
|
-
};
|
|
145
|
-
// Handle document creation from modal
|
|
146
|
-
const onCreateDocument = useCallback(async (fileName) => {
|
|
147
|
-
setOpenModal(false);
|
|
148
|
-
const documentModel = selectedDocumentModel.current;
|
|
149
|
-
if (!documentModel || !selectedDrive?.header.id)
|
|
150
|
-
return;
|
|
151
|
-
let editorType = "integrations-editor";
|
|
152
|
-
if (documentModel.id === "powerhouse/invoice") {
|
|
153
|
-
editorType = "powerhouse-invoice-editor";
|
|
154
|
-
}
|
|
155
|
-
else if (documentModel.id === "powerhouse/expense-report") {
|
|
156
|
-
editorType = "powerhouse-expense-report-editor";
|
|
157
|
-
}
|
|
158
|
-
try {
|
|
159
|
-
const node = await addDocument(selectedDrive.header.id, fileName, documentModel.id, selectedFolder?.id, undefined, undefined, editorType);
|
|
160
|
-
selectedDocumentModel.current = null;
|
|
161
|
-
if (node) {
|
|
162
|
-
// Customize: Auto-open created document by uncommenting below
|
|
163
|
-
// setActiveDocumentId(node.id);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
catch (error) {
|
|
167
|
-
console.error("Failed to create document:", error);
|
|
168
|
-
}
|
|
169
|
-
}, [addDocument, editorModules, selectedDrive?.header.id, selectedFolder?.id]);
|
|
170
|
-
const onSelectDocumentModel = useCallback((documentModel) => {
|
|
171
|
-
selectedDocumentModel.current = documentModel;
|
|
172
|
-
setOpenModal(true);
|
|
173
|
-
}, []);
|
|
174
|
-
// === DOCUMENT EDITOR DATA ===
|
|
175
|
-
// Filter available document types here if needed
|
|
176
|
-
const documentModelModules = useDocumentModelModules();
|
|
177
|
-
// Get active document and its editor components
|
|
178
|
-
// if a document is selected then it's editor will be passed as children
|
|
9
|
+
export function DriveExplorer({ children }) {
|
|
10
|
+
// if a document is selected then its editor will be passed as children
|
|
179
11
|
const showDocumentEditor = !!children;
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
12
|
+
return (_jsxs("div", { className: "contributor-billing-explorer h-full overflow-y-auto", children: [_jsx(ToastContainer, { position: "bottom-right", autoClose: 5000, hideProgressBar: false, newestOnTop: false, closeOnClick: false, rtl: false, pauseOnFocusLoss: true, draggable: true, pauseOnHover: true, theme: "light" }), showDocumentEditor ? (
|
|
13
|
+
/* Document editor view */
|
|
14
|
+
children) : (
|
|
15
|
+
/* Operational Hub view */
|
|
16
|
+
_jsxs("div", { className: "container mx-auto p-4 space-y-4", children: [_jsx(HeaderStats, {}), _jsx(InvoiceTableContainer, {})] }))] }));
|
|
184
17
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../../editors/contributor-billing/components/EmptyState.tsx"],"names":[],"mappings":"AAEA,iEAAiE;AACjE,wBAAgB,UAAU,mDAWzB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useNodesInSelectedDriveOrFolder } from "@powerhousedao/reactor-browser";
|
|
3
|
+
/** Shows a message when the selected drive or folder is empty */
|
|
4
|
+
export function EmptyState() {
|
|
5
|
+
const nodes = useNodesInSelectedDriveOrFolder();
|
|
6
|
+
const hasNodes = nodes.length > 0;
|
|
7
|
+
if (hasNodes)
|
|
8
|
+
return null;
|
|
9
|
+
return (_jsxs("div", { className: "py-12 text-center text-gray-500", children: [_jsx("p", { className: "text-lg", children: "This folder is empty" }), _jsx("p", { className: "mt-2 text-sm", children: "Create your first document or folder below" })] }));
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Files.d.ts","sourceRoot":"","sources":["../../../../editors/contributor-billing/components/Files.tsx"],"names":[],"mappings":"AAMA,sDAAsD;AACtD,wBAAgB,KAAK,mDAiBpB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FileItem } from "@powerhousedao/design-system/connect";
|
|
3
|
+
import { useNodesInSelectedDriveOrFolder, isFileNodeKind, } from "@powerhousedao/reactor-browser";
|
|
4
|
+
/** Shows the files in the selected drive or folder */
|
|
5
|
+
export function Files() {
|
|
6
|
+
const nodes = useNodesInSelectedDriveOrFolder();
|
|
7
|
+
const fileNodes = nodes.filter((n) => isFileNodeKind(n));
|
|
8
|
+
const hasFiles = fileNodes.length > 0;
|
|
9
|
+
if (!hasFiles)
|
|
10
|
+
return null;
|
|
11
|
+
return (_jsxs("div", { children: [_jsx("h3", { className: "mb-2 text-sm font-semibold text-gray-600", children: "Documents" }), _jsx("div", { className: "flex flex-wrap gap-4", children: fileNodes.map((fileNode) => (_jsx(FileItem, { fileNode: fileNode }, fileNode.id))) })] }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hierarchical folder tree navigation component using Sidebar from document-engineering.
|
|
3
|
+
* Displays folders and files in a tree structure with expand/collapse functionality, search, and resize support.
|
|
4
|
+
*/
|
|
5
|
+
export declare function FolderTree(): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=FolderTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FolderTree.d.ts","sourceRoot":"","sources":["../../../../editors/contributor-billing/components/FolderTree.tsx"],"names":[],"mappings":"AAyDA;;;GAGG;AACH,wBAAgB,UAAU,4CA0CzB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Sidebar, SidebarProvider, } from "@powerhousedao/document-engineering";
|
|
3
|
+
import { setSelectedNode, useNodesInSelectedDrive, useSelectedDrive, useSelectedNode, } from "@powerhousedao/reactor-browser";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
function buildSidebarNodes(nodes, parentId) {
|
|
6
|
+
return nodes
|
|
7
|
+
.filter((n) => {
|
|
8
|
+
if (parentId == null) {
|
|
9
|
+
return n.parentFolder == null;
|
|
10
|
+
}
|
|
11
|
+
return n.parentFolder === parentId;
|
|
12
|
+
})
|
|
13
|
+
.map((node) => {
|
|
14
|
+
if (node.kind === "folder") {
|
|
15
|
+
return {
|
|
16
|
+
id: node.id,
|
|
17
|
+
title: node.name,
|
|
18
|
+
icon: "FolderClose",
|
|
19
|
+
expandedIcon: "FolderOpen",
|
|
20
|
+
children: buildSidebarNodes(nodes, node.id),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
id: node.id,
|
|
25
|
+
title: node.name,
|
|
26
|
+
icon: "File",
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function transformNodesToSidebarNodes(nodes, driveName) {
|
|
31
|
+
return [
|
|
32
|
+
{
|
|
33
|
+
id: "root",
|
|
34
|
+
title: driveName,
|
|
35
|
+
icon: "Drive",
|
|
36
|
+
children: buildSidebarNodes(nodes, null),
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Hierarchical folder tree navigation component using Sidebar from document-engineering.
|
|
42
|
+
* Displays folders and files in a tree structure with expand/collapse functionality, search, and resize support.
|
|
43
|
+
*/
|
|
44
|
+
export function FolderTree() {
|
|
45
|
+
const [selectedDrive] = useSelectedDrive();
|
|
46
|
+
const nodes = useNodesInSelectedDrive();
|
|
47
|
+
const selectedNode = useSelectedNode();
|
|
48
|
+
const driveName = selectedDrive.header.name;
|
|
49
|
+
// Transform Node[] to hierarchical SidebarNode structure
|
|
50
|
+
const sidebarNodes = useMemo(() => transformNodesToSidebarNodes(nodes || [], driveName), [nodes, driveName]);
|
|
51
|
+
const handleActiveNodeChange = (node) => {
|
|
52
|
+
// If root node is selected, pass undefined to match existing behavior
|
|
53
|
+
if (node.id === "root") {
|
|
54
|
+
setSelectedNode(undefined);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
setSelectedNode(node.id);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
// Map selectedNodeId to activeNodeId (use "root" when undefined)
|
|
61
|
+
const activeNodeId = !selectedNode || selectedNode.id === selectedDrive.header.id
|
|
62
|
+
? "root"
|
|
63
|
+
: selectedNode.id;
|
|
64
|
+
return (_jsx(SidebarProvider, { nodes: sidebarNodes, children: _jsx(Sidebar, { className: "pt-1", nodes: sidebarNodes, activeNodeId: activeNodeId, onActiveNodeChange: handleActiveNodeChange, sidebarTitle: "Drive Explorer", showSearchBar: true, resizable: true, allowPinning: false, showStatusFilter: false, initialWidth: 256, defaultLevel: 2 }) }));
|
|
65
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Folders.d.ts","sourceRoot":"","sources":["../../../../editors/contributor-billing/components/Folders.tsx"],"names":[],"mappings":"AAMA,wDAAwD;AACxD,wBAAgB,OAAO,mDAgBtB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FolderItem } from "@powerhousedao/design-system/connect";
|
|
3
|
+
import { useNodesInSelectedDriveOrFolder, isFolderNodeKind, } from "@powerhousedao/reactor-browser";
|
|
4
|
+
/** Shows the folders in the selected drive or folder */
|
|
5
|
+
export function Folders() {
|
|
6
|
+
const nodes = useNodesInSelectedDriveOrFolder();
|
|
7
|
+
const folderNodes = nodes.filter((n) => isFolderNodeKind(n));
|
|
8
|
+
const hasFolders = folderNodes.length > 0;
|
|
9
|
+
if (!hasFolders)
|
|
10
|
+
return null;
|
|
11
|
+
return (_jsxs("div", { children: [_jsx("h3", { className: "mb-2 text-sm font-bold text-gray-600", children: "Folders" }), _jsx("div", { className: "flex flex-wrap gap-4", children: folderNodes.map((folderNode) => (_jsx(FolderItem, { folderNode: folderNode }, folderNode.id))) })] }));
|
|
12
|
+
}
|