@aglyn/plugins-crm 1.0.0-beta.143
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/LICENSE +201 -0
- package/README.md +7 -0
- package/package.json +57 -0
- package/src/index.d.ts +21 -0
- package/src/index.js +29 -0
- package/src/index.js.map +1 -0
- package/src/lib/components/activity-list.d.ts +98 -0
- package/src/lib/components/activity-list.js +321 -0
- package/src/lib/components/activity-list.js.map +1 -0
- package/src/lib/components/activity-queries.d.ts +117 -0
- package/src/lib/components/activity-queries.js +198 -0
- package/src/lib/components/activity-queries.js.map +1 -0
- package/src/lib/components/add-to-list-button.d.ts +25 -0
- package/src/lib/components/add-to-list-button.js +64 -0
- package/src/lib/components/add-to-list-button.js.map +1 -0
- package/src/lib/components/add-to-list-dialog.d.ts +24 -0
- package/src/lib/components/add-to-list-dialog.js +327 -0
- package/src/lib/components/add-to-list-dialog.js.map +1 -0
- package/src/lib/components/assignment-rule-drawer.d.ts +43 -0
- package/src/lib/components/assignment-rule-drawer.js +293 -0
- package/src/lib/components/assignment-rule-drawer.js.map +1 -0
- package/src/lib/components/companies-bulk-bar.d.ts +29 -0
- package/src/lib/components/companies-bulk-bar.js +274 -0
- package/src/lib/components/companies-bulk-bar.js.map +1 -0
- package/src/lib/components/companies-section.d.ts +54 -0
- package/src/lib/components/companies-section.js +522 -0
- package/src/lib/components/companies-section.js.map +1 -0
- package/src/lib/components/company-contacts-card.d.ts +49 -0
- package/src/lib/components/company-contacts-card.js +435 -0
- package/src/lib/components/company-contacts-card.js.map +1 -0
- package/src/lib/components/company-deals-card.d.ts +20 -0
- package/src/lib/components/company-deals-card.js +38 -0
- package/src/lib/components/company-deals-card.js.map +1 -0
- package/src/lib/components/company-detail-page.d.ts +20 -0
- package/src/lib/components/company-detail-page.js +165 -0
- package/src/lib/components/company-detail-page.js.map +1 -0
- package/src/lib/components/company-edit-drawer.d.ts +65 -0
- package/src/lib/components/company-edit-drawer.js +433 -0
- package/src/lib/components/company-edit-drawer.js.map +1 -0
- package/src/lib/components/company-import-drawer.d.ts +42 -0
- package/src/lib/components/company-import-drawer.js +99 -0
- package/src/lib/components/company-import-drawer.js.map +1 -0
- package/src/lib/components/company-picker.d.ts +127 -0
- package/src/lib/components/company-picker.js +323 -0
- package/src/lib/components/company-picker.js.map +1 -0
- package/src/lib/components/company-properties-card.d.ts +47 -0
- package/src/lib/components/company-properties-card.js +289 -0
- package/src/lib/components/company-properties-card.js.map +1 -0
- package/src/lib/components/contact-address-fields.d.ts +29 -0
- package/src/lib/components/contact-address-fields.js +149 -0
- package/src/lib/components/contact-address-fields.js.map +1 -0
- package/src/lib/components/contact-associations-card.d.ts +72 -0
- package/src/lib/components/contact-associations-card.js +296 -0
- package/src/lib/components/contact-associations-card.js.map +1 -0
- package/src/lib/components/contact-custom-columns.d.ts +38 -0
- package/src/lib/components/contact-custom-columns.js +102 -0
- package/src/lib/components/contact-custom-columns.js.map +1 -0
- package/src/lib/components/contact-custom-fields-card.d.ts +39 -0
- package/src/lib/components/contact-custom-fields-card.js +204 -0
- package/src/lib/components/contact-custom-fields-card.js.map +1 -0
- package/src/lib/components/contact-deals-card.d.ts +20 -0
- package/src/lib/components/contact-deals-card.js +38 -0
- package/src/lib/components/contact-deals-card.js.map +1 -0
- package/src/lib/components/contact-detail-page.d.ts +46 -0
- package/src/lib/components/contact-detail-page.js +535 -0
- package/src/lib/components/contact-detail-page.js.map +1 -0
- package/src/lib/components/contact-duplicates-card.d.ts +42 -0
- package/src/lib/components/contact-duplicates-card.js +167 -0
- package/src/lib/components/contact-duplicates-card.js.map +1 -0
- package/src/lib/components/contact-field-drawer.d.ts +64 -0
- package/src/lib/components/contact-field-drawer.js +251 -0
- package/src/lib/components/contact-field-drawer.js.map +1 -0
- package/src/lib/components/contact-import-drawer.d.ts +46 -0
- package/src/lib/components/contact-import-drawer.js +149 -0
- package/src/lib/components/contact-import-drawer.js.map +1 -0
- package/src/lib/components/contact-known-by-card.d.ts +39 -0
- package/src/lib/components/contact-known-by-card.js +142 -0
- package/src/lib/components/contact-known-by-card.js.map +1 -0
- package/src/lib/components/contact-list-columns.d.ts +53 -0
- package/src/lib/components/contact-list-columns.js +288 -0
- package/src/lib/components/contact-list-columns.js.map +1 -0
- package/src/lib/components/contact-merge-dialog.d.ts +79 -0
- package/src/lib/components/contact-merge-dialog.js +405 -0
- package/src/lib/components/contact-merge-dialog.js.map +1 -0
- package/src/lib/components/contact-properties-card.d.ts +89 -0
- package/src/lib/components/contact-properties-card.js +492 -0
- package/src/lib/components/contact-properties-card.js.map +1 -0
- package/src/lib/components/contact-timeline-card.d.ts +68 -0
- package/src/lib/components/contact-timeline-card.js +435 -0
- package/src/lib/components/contact-timeline-card.js.map +1 -0
- package/src/lib/components/contacts-bulk-bar.d.ts +91 -0
- package/src/lib/components/contacts-bulk-bar.js +493 -0
- package/src/lib/components/contacts-bulk-bar.js.map +1 -0
- package/src/lib/components/contacts-section.d.ts +26 -0
- package/src/lib/components/contacts-section.js +1025 -0
- package/src/lib/components/contacts-section.js.map +1 -0
- package/src/lib/components/copy-capture-address-button.d.ts +33 -0
- package/src/lib/components/copy-capture-address-button.js +60 -0
- package/src/lib/components/copy-capture-address-button.js.map +1 -0
- package/src/lib/components/crm-attribution-zone.d.ts +38 -0
- package/src/lib/components/crm-attribution-zone.js +36 -0
- package/src/lib/components/crm-attribution-zone.js.map +1 -0
- package/src/lib/components/crm-booking-zone.d.ts +61 -0
- package/src/lib/components/crm-booking-zone.js +50 -0
- package/src/lib/components/crm-booking-zone.js.map +1 -0
- package/src/lib/components/crm-bulk-bar-frame.d.ts +47 -0
- package/src/lib/components/crm-bulk-bar-frame.js +137 -0
- package/src/lib/components/crm-bulk-bar-frame.js.map +1 -0
- package/src/lib/components/crm-call-actions.d.ts +65 -0
- package/src/lib/components/crm-call-actions.js +110 -0
- package/src/lib/components/crm-call-actions.js.map +1 -0
- package/src/lib/components/crm-column-menu.d.ts +21 -0
- package/src/lib/components/crm-column-menu.js +103 -0
- package/src/lib/components/crm-column-menu.js.map +1 -0
- package/src/lib/components/crm-console-page.d.ts +19 -0
- package/src/lib/components/crm-console-page.js +151 -0
- package/src/lib/components/crm-console-page.js.map +1 -0
- package/src/lib/components/crm-console-sections.d.ts +52 -0
- package/src/lib/components/crm-console-sections.js +83 -0
- package/src/lib/components/crm-console-sections.js.map +1 -0
- package/src/lib/components/crm-custom-field-control.d.ts +26 -0
- package/src/lib/components/crm-custom-field-control.js +131 -0
- package/src/lib/components/crm-custom-field-control.js.map +1 -0
- package/src/lib/components/crm-email-template-tools.d.ts +69 -0
- package/src/lib/components/crm-email-template-tools.js +240 -0
- package/src/lib/components/crm-email-template-tools.js.map +1 -0
- package/src/lib/components/crm-export-all-button.d.ts +39 -0
- package/src/lib/components/crm-export-all-button.js +98 -0
- package/src/lib/components/crm-export-all-button.js.map +1 -0
- package/src/lib/components/crm-filter-bar.d.ts +53 -0
- package/src/lib/components/crm-filter-bar.js +294 -0
- package/src/lib/components/crm-filter-bar.js.map +1 -0
- package/src/lib/components/crm-glance-card.d.ts +54 -0
- package/src/lib/components/crm-glance-card.js +219 -0
- package/src/lib/components/crm-glance-card.js.map +1 -0
- package/src/lib/components/crm-next-activity-column.d.ts +35 -0
- package/src/lib/components/crm-next-activity-column.js +100 -0
- package/src/lib/components/crm-next-activity-column.js.map +1 -0
- package/src/lib/components/crm-record-header.d.ts +97 -0
- package/src/lib/components/crm-record-header.js +160 -0
- package/src/lib/components/crm-record-header.js.map +1 -0
- package/src/lib/components/crm-record-insights-zone.d.ts +50 -0
- package/src/lib/components/crm-record-insights-zone.js +169 -0
- package/src/lib/components/crm-record-insights-zone.js.map +1 -0
- package/src/lib/components/crm-record-picker.d.ts +42 -0
- package/src/lib/components/crm-record-picker.js +104 -0
- package/src/lib/components/crm-record-picker.js.map +1 -0
- package/src/lib/components/crm-send-email-button.d.ts +39 -0
- package/src/lib/components/crm-send-email-button.js +81 -0
- package/src/lib/components/crm-send-email-button.js.map +1 -0
- package/src/lib/components/crm-send-email-dialog.d.ts +61 -0
- package/src/lib/components/crm-send-email-dialog.js +851 -0
- package/src/lib/components/crm-send-email-dialog.js.map +1 -0
- package/src/lib/components/crm-site-picker.d.ts +61 -0
- package/src/lib/components/crm-site-picker.js +99 -0
- package/src/lib/components/crm-site-picker.js.map +1 -0
- package/src/lib/components/crm-suite-lock.d.ts +29 -0
- package/src/lib/components/crm-suite-lock.js +114 -0
- package/src/lib/components/crm-suite-lock.js.map +1 -0
- package/src/lib/components/crm-tasks-due-card.d.ts +42 -0
- package/src/lib/components/crm-tasks-due-card.js +225 -0
- package/src/lib/components/crm-tasks-due-card.js.map +1 -0
- package/src/lib/components/crm-views-control.d.ts +65 -0
- package/src/lib/components/crm-views-control.js +518 -0
- package/src/lib/components/crm-views-control.js.map +1 -0
- package/src/lib/components/csv-import-drawer.d.ts +132 -0
- package/src/lib/components/csv-import-drawer.js +746 -0
- package/src/lib/components/csv-import-drawer.js.map +1 -0
- package/src/lib/components/deal-board.d.ts +70 -0
- package/src/lib/components/deal-board.js +478 -0
- package/src/lib/components/deal-board.js.map +1 -0
- package/src/lib/components/deal-detail-page.d.ts +18 -0
- package/src/lib/components/deal-detail-page.js +323 -0
- package/src/lib/components/deal-detail-page.js.map +1 -0
- package/src/lib/components/deal-edit-drawer.d.ts +59 -0
- package/src/lib/components/deal-edit-drawer.js +640 -0
- package/src/lib/components/deal-edit-drawer.js.map +1 -0
- package/src/lib/components/deal-import-drawer.d.ts +24 -0
- package/src/lib/components/deal-import-drawer.js +83 -0
- package/src/lib/components/deal-import-drawer.js.map +1 -0
- package/src/lib/components/deal-products-card.d.ts +48 -0
- package/src/lib/components/deal-products-card.js +614 -0
- package/src/lib/components/deal-products-card.js.map +1 -0
- package/src/lib/components/deal-properties-card.d.ts +29 -0
- package/src/lib/components/deal-properties-card.js +144 -0
- package/src/lib/components/deal-properties-card.js.map +1 -0
- package/src/lib/components/deal-stage-card.d.ts +24 -0
- package/src/lib/components/deal-stage-card.js +199 -0
- package/src/lib/components/deal-stage-card.js.map +1 -0
- package/src/lib/components/deals-bulk-bar.d.ts +31 -0
- package/src/lib/components/deals-bulk-bar.js +340 -0
- package/src/lib/components/deals-bulk-bar.js.map +1 -0
- package/src/lib/components/deals-section.d.ts +49 -0
- package/src/lib/components/deals-section.js +767 -0
- package/src/lib/components/deals-section.js.map +1 -0
- package/src/lib/components/email-capture-card.d.ts +42 -0
- package/src/lib/components/email-capture-card.js +134 -0
- package/src/lib/components/email-capture-card.js.map +1 -0
- package/src/lib/components/email-template-drawer.d.ts +33 -0
- package/src/lib/components/email-template-drawer.js +209 -0
- package/src/lib/components/email-template-drawer.js.map +1 -0
- package/src/lib/components/email-templates-card.d.ts +33 -0
- package/src/lib/components/email-templates-card.js +370 -0
- package/src/lib/components/email-templates-card.js.map +1 -0
- package/src/lib/components/erase-person-action.d.ts +92 -0
- package/src/lib/components/erase-person-action.js +261 -0
- package/src/lib/components/erase-person-action.js.map +1 -0
- package/src/lib/components/fields-section.d.ts +37 -0
- package/src/lib/components/fields-section.js +641 -0
- package/src/lib/components/fields-section.js.map +1 -0
- package/src/lib/components/form-contact-fields-card.d.ts +46 -0
- package/src/lib/components/form-contact-fields-card.js +253 -0
- package/src/lib/components/form-contact-fields-card.js.map +1 -0
- package/src/lib/components/insert-link-at-caret.d.ts +28 -0
- package/src/lib/components/insert-link-at-caret.js +37 -0
- package/src/lib/components/insert-link-at-caret.js.map +1 -0
- package/src/lib/components/lead-convert-dialog.d.ts +32 -0
- package/src/lib/components/lead-convert-dialog.js +493 -0
- package/src/lib/components/lead-convert-dialog.js.map +1 -0
- package/src/lib/components/lead-detail-page.d.ts +16 -0
- package/src/lib/components/lead-detail-page.js +163 -0
- package/src/lib/components/lead-detail-page.js.map +1 -0
- package/src/lib/components/lead-history-card.d.ts +32 -0
- package/src/lib/components/lead-history-card.js +165 -0
- package/src/lib/components/lead-history-card.js.map +1 -0
- package/src/lib/components/lead-import-drawer.d.ts +24 -0
- package/src/lib/components/lead-import-drawer.js +95 -0
- package/src/lib/components/lead-import-drawer.js.map +1 -0
- package/src/lib/components/lead-owner-select.d.ts +35 -0
- package/src/lib/components/lead-owner-select.js +91 -0
- package/src/lib/components/lead-owner-select.js.map +1 -0
- package/src/lib/components/lead-properties-card.d.ts +61 -0
- package/src/lib/components/lead-properties-card.js +395 -0
- package/src/lib/components/lead-properties-card.js.map +1 -0
- package/src/lib/components/lead-status-chip.d.ts +12 -0
- package/src/lib/components/lead-status-chip.js +43 -0
- package/src/lib/components/lead-status-chip.js.map +1 -0
- package/src/lib/components/lead-surfaces-note.d.ts +126 -0
- package/src/lib/components/lead-surfaces-note.js +262 -0
- package/src/lib/components/lead-surfaces-note.js.map +1 -0
- package/src/lib/components/lead-unqualify-dialog.d.ts +24 -0
- package/src/lib/components/lead-unqualify-dialog.js +125 -0
- package/src/lib/components/lead-unqualify-dialog.js.map +1 -0
- package/src/lib/components/leads-bulk-bar.d.ts +58 -0
- package/src/lib/components/leads-bulk-bar.js +307 -0
- package/src/lib/components/leads-bulk-bar.js.map +1 -0
- package/src/lib/components/leads-section.d.ts +23 -0
- package/src/lib/components/leads-section.js +664 -0
- package/src/lib/components/leads-section.js.map +1 -0
- package/src/lib/components/linked-deals-card.d.ts +32 -0
- package/src/lib/components/linked-deals-card.js +163 -0
- package/src/lib/components/linked-deals-card.js.map +1 -0
- package/src/lib/components/log-activity-dialog.d.ts +60 -0
- package/src/lib/components/log-activity-dialog.js +368 -0
- package/src/lib/components/log-activity-dialog.js.map +1 -0
- package/src/lib/components/lost-reason-dialog.d.ts +26 -0
- package/src/lib/components/lost-reason-dialog.js +95 -0
- package/src/lib/components/lost-reason-dialog.js.map +1 -0
- package/src/lib/components/new-contact-drawer.d.ts +78 -0
- package/src/lib/components/new-contact-drawer.js +343 -0
- package/src/lib/components/new-contact-drawer.js.map +1 -0
- package/src/lib/components/org-lead-surfaces-note.d.ts +57 -0
- package/src/lib/components/org-lead-surfaces-note.js +172 -0
- package/src/lib/components/org-lead-surfaces-note.js.map +1 -0
- package/src/lib/components/owner-avatar.d.ts +18 -0
- package/src/lib/components/owner-avatar.js +61 -0
- package/src/lib/components/owner-avatar.js.map +1 -0
- package/src/lib/components/pipeline-stages-dialog.d.ts +43 -0
- package/src/lib/components/pipeline-stages-dialog.js +339 -0
- package/src/lib/components/pipeline-stages-dialog.js.map +1 -0
- package/src/lib/components/pipelines-dialog.d.ts +55 -0
- package/src/lib/components/pipelines-dialog.js +517 -0
- package/src/lib/components/pipelines-dialog.js.map +1 -0
- package/src/lib/components/recent-activity-feed.d.ts +39 -0
- package/src/lib/components/recent-activity-feed.js +103 -0
- package/src/lib/components/recent-activity-feed.js.map +1 -0
- package/src/lib/components/recipes-card.d.ts +39 -0
- package/src/lib/components/recipes-card.js +485 -0
- package/src/lib/components/recipes-card.js.map +1 -0
- package/src/lib/components/record-activity-card.d.ts +26 -0
- package/src/lib/components/record-activity-card.js +121 -0
- package/src/lib/components/record-activity-card.js.map +1 -0
- package/src/lib/components/record-files-card.d.ts +67 -0
- package/src/lib/components/record-files-card.js +290 -0
- package/src/lib/components/record-files-card.js.map +1 -0
- package/src/lib/components/record-tasks-card.d.ts +32 -0
- package/src/lib/components/record-tasks-card.js +306 -0
- package/src/lib/components/record-tasks-card.js.map +1 -0
- package/src/lib/components/reports/activity-card.d.ts +57 -0
- package/src/lib/components/reports/activity-card.js +281 -0
- package/src/lib/components/reports/activity-card.js.map +1 -0
- package/src/lib/components/reports/closed-deals-card.d.ts +20 -0
- package/src/lib/components/reports/closed-deals-card.js +194 -0
- package/src/lib/components/reports/closed-deals-card.js.map +1 -0
- package/src/lib/components/reports/contacts-mix-card.d.ts +27 -0
- package/src/lib/components/reports/contacts-mix-card.js +161 -0
- package/src/lib/components/reports/contacts-mix-card.js.map +1 -0
- package/src/lib/components/reports/contacts-trend-card.d.ts +31 -0
- package/src/lib/components/reports/contacts-trend-card.js +144 -0
- package/src/lib/components/reports/contacts-trend-card.js.map +1 -0
- package/src/lib/components/reports/forecast-card.d.ts +22 -0
- package/src/lib/components/reports/forecast-card.js +251 -0
- package/src/lib/components/reports/forecast-card.js.map +1 -0
- package/src/lib/components/reports/lead-counts.d.ts +32 -0
- package/src/lib/components/reports/lead-counts.js +44 -0
- package/src/lib/components/reports/lead-counts.js.map +1 -0
- package/src/lib/components/reports/lead-funnel-card.d.ts +38 -0
- package/src/lib/components/reports/lead-funnel-card.js +375 -0
- package/src/lib/components/reports/lead-funnel-card.js.map +1 -0
- package/src/lib/components/reports/pipeline-card.d.ts +19 -0
- package/src/lib/components/reports/pipeline-card.js +338 -0
- package/src/lib/components/reports/pipeline-card.js.map +1 -0
- package/src/lib/components/reports/report-bar-chart.d.ts +39 -0
- package/src/lib/components/reports/report-bar-chart.js +133 -0
- package/src/lib/components/reports/report-bar-chart.js.map +1 -0
- package/src/lib/components/reports/report-breakdown.d.ts +32 -0
- package/src/lib/components/reports/report-breakdown.js +105 -0
- package/src/lib/components/reports/report-breakdown.js.map +1 -0
- package/src/lib/components/reports/report-export.d.ts +37 -0
- package/src/lib/components/reports/report-export.js +66 -0
- package/src/lib/components/reports/report-export.js.map +1 -0
- package/src/lib/components/reports/report-format.d.ts +36 -0
- package/src/lib/components/reports/report-format.js +43 -0
- package/src/lib/components/reports/report-format.js.map +1 -0
- package/src/lib/components/reports/report-scope.d.ts +81 -0
- package/src/lib/components/reports/report-scope.js +58 -0
- package/src/lib/components/reports/report-scope.js.map +1 -0
- package/src/lib/components/reports/report-stat-tile.d.ts +47 -0
- package/src/lib/components/reports/report-stat-tile.js +96 -0
- package/src/lib/components/reports/report-stat-tile.js.map +1 -0
- package/src/lib/components/reports/source-conversion-card.d.ts +28 -0
- package/src/lib/components/reports/source-conversion-card.js +205 -0
- package/src/lib/components/reports/source-conversion-card.js.map +1 -0
- package/src/lib/components/reports/tasks-card.d.ts +26 -0
- package/src/lib/components/reports/tasks-card.js +279 -0
- package/src/lib/components/reports/tasks-card.js.map +1 -0
- package/src/lib/components/reports/use-aggregate-read.d.ts +99 -0
- package/src/lib/components/reports/use-aggregate-read.js +195 -0
- package/src/lib/components/reports/use-aggregate-read.js.map +1 -0
- package/src/lib/components/reports/won-lost-by-owner-card.d.ts +30 -0
- package/src/lib/components/reports/won-lost-by-owner-card.js +168 -0
- package/src/lib/components/reports/won-lost-by-owner-card.js.map +1 -0
- package/src/lib/components/reports-section.d.ts +42 -0
- package/src/lib/components/reports-section.js +308 -0
- package/src/lib/components/reports-section.js.map +1 -0
- package/src/lib/components/sending-addresses-card.d.ts +49 -0
- package/src/lib/components/sending-addresses-card.js +262 -0
- package/src/lib/components/sending-addresses-card.js.map +1 -0
- package/src/lib/components/settings-section.d.ts +151 -0
- package/src/lib/components/settings-section.js +783 -0
- package/src/lib/components/settings-section.js.map +1 -0
- package/src/lib/components/task-cells.d.ts +51 -0
- package/src/lib/components/task-cells.js +139 -0
- package/src/lib/components/task-cells.js.map +1 -0
- package/src/lib/components/task-edit-drawer.d.ts +53 -0
- package/src/lib/components/task-edit-drawer.js +483 -0
- package/src/lib/components/task-edit-drawer.js.map +1 -0
- package/src/lib/components/task-import-drawer.d.ts +24 -0
- package/src/lib/components/task-import-drawer.js +82 -0
- package/src/lib/components/task-import-drawer.js.map +1 -0
- package/src/lib/components/task-snooze-menu.d.ts +65 -0
- package/src/lib/components/task-snooze-menu.js +207 -0
- package/src/lib/components/task-snooze-menu.js.map +1 -0
- package/src/lib/components/tasks-bulk-bar.d.ts +25 -0
- package/src/lib/components/tasks-bulk-bar.js +348 -0
- package/src/lib/components/tasks-bulk-bar.js.map +1 -0
- package/src/lib/components/tasks-calendar.d.ts +38 -0
- package/src/lib/components/tasks-calendar.js +228 -0
- package/src/lib/components/tasks-calendar.js.map +1 -0
- package/src/lib/components/tasks-section.d.ts +27 -0
- package/src/lib/components/tasks-section.js +579 -0
- package/src/lib/components/tasks-section.js.map +1 -0
- package/src/lib/components/use-contact-campaign-emails.d.ts +32 -0
- package/src/lib/components/use-contact-campaign-emails.js +83 -0
- package/src/lib/components/use-contact-campaign-emails.js.map +1 -0
- package/src/lib/components/use-crm-api.d.ts +44 -0
- package/src/lib/components/use-crm-api.js +84 -0
- package/src/lib/components/use-crm-api.js.map +1 -0
- package/src/lib/components/use-crm-inbound-address.d.ts +60 -0
- package/src/lib/components/use-crm-inbound-address.js +124 -0
- package/src/lib/components/use-crm-inbound-address.js.map +1 -0
- package/src/lib/components/use-emails-hub-path.d.ts +24 -0
- package/src/lib/components/use-emails-hub-path.js +59 -0
- package/src/lib/components/use-emails-hub-path.js.map +1 -0
- package/src/lib/components/use-member-email-aliases.d.ts +54 -0
- package/src/lib/components/use-member-email-aliases.js +186 -0
- package/src/lib/components/use-member-email-aliases.js.map +1 -0
- package/src/lib/components/use-org-members.d.ts +40 -0
- package/src/lib/components/use-org-members.js +100 -0
- package/src/lib/components/use-org-members.js.map +1 -0
- package/src/lib/constants/api-routes.d.ts +109 -0
- package/src/lib/constants/api-routes.js +74 -0
- package/src/lib/constants/api-routes.js.map +1 -0
- package/src/lib/constants/bundle-common.d.ts +14 -0
- package/src/lib/constants/bundle-common.js +14 -0
- package/src/lib/constants/bundle-common.js.map +1 -0
- package/src/lib/constants/company-filters.d.ts +18 -0
- package/src/lib/constants/company-filters.js +51 -0
- package/src/lib/constants/company-filters.js.map +1 -0
- package/src/lib/constants/contact-filters.d.ts +38 -0
- package/src/lib/constants/contact-filters.js +294 -0
- package/src/lib/constants/contact-filters.js.map +1 -0
- package/src/lib/hooks/use-contact-field-definitions.d.ts +48 -0
- package/src/lib/hooks/use-contact-field-definitions.js +72 -0
- package/src/lib/hooks/use-contact-field-definitions.js.map +1 -0
- package/src/lib/hooks/use-contact-update.d.ts +25 -0
- package/src/lib/hooks/use-contact-update.js +80 -0
- package/src/lib/hooks/use-contact-update.js.map +1 -0
- package/src/lib/hooks/use-crm-activity-logger.d.ts +73 -0
- package/src/lib/hooks/use-crm-activity-logger.js +101 -0
- package/src/lib/hooks/use-crm-activity-logger.js.map +1 -0
- package/src/lib/hooks/use-crm-bulk-apply.d.ts +52 -0
- package/src/lib/hooks/use-crm-bulk-apply.js +112 -0
- package/src/lib/hooks/use-crm-bulk-apply.js.map +1 -0
- package/src/lib/hooks/use-crm-default-view.d.ts +24 -0
- package/src/lib/hooks/use-crm-default-view.js +64 -0
- package/src/lib/hooks/use-crm-default-view.js.map +1 -0
- package/src/lib/hooks/use-crm-email-templates.d.ts +59 -0
- package/src/lib/hooks/use-crm-email-templates.js +103 -0
- package/src/lib/hooks/use-crm-email-templates.js.map +1 -0
- package/src/lib/hooks/use-crm-hub-path.d.ts +29 -0
- package/src/lib/hooks/use-crm-hub-path.js +41 -0
- package/src/lib/hooks/use-crm-hub-path.js.map +1 -0
- package/src/lib/hooks/use-crm-org-mount.d.ts +97 -0
- package/src/lib/hooks/use-crm-org-mount.js +215 -0
- package/src/lib/hooks/use-crm-org-mount.js.map +1 -0
- package/src/lib/hooks/use-crm-record-names.d.ts +52 -0
- package/src/lib/hooks/use-crm-record-names.js +126 -0
- package/src/lib/hooks/use-crm-record-names.js.map +1 -0
- package/src/lib/hooks/use-crm-records-quota.d.ts +68 -0
- package/src/lib/hooks/use-crm-records-quota.js +118 -0
- package/src/lib/hooks/use-crm-records-quota.js.map +1 -0
- package/src/lib/hooks/use-crm-saved-view.d.ts +96 -0
- package/src/lib/hooks/use-crm-saved-view.js +329 -0
- package/src/lib/hooks/use-crm-saved-view.js.map +1 -0
- package/src/lib/hooks/use-crm-scope.d.ts +117 -0
- package/src/lib/hooks/use-crm-scope.js +147 -0
- package/src/lib/hooks/use-crm-scope.js.map +1 -0
- package/src/lib/hooks/use-crm-tasks.d.ts +85 -0
- package/src/lib/hooks/use-crm-tasks.js +153 -0
- package/src/lib/hooks/use-crm-tasks.js.map +1 -0
- package/src/lib/hooks/use-crm-view-grid.d.ts +55 -0
- package/src/lib/hooks/use-crm-view-grid.js +170 -0
- package/src/lib/hooks/use-crm-view-grid.js.map +1 -0
- package/src/lib/hooks/use-crm-views.d.ts +42 -0
- package/src/lib/hooks/use-crm-views.js +84 -0
- package/src/lib/hooks/use-crm-views.js.map +1 -0
- package/src/lib/hooks/use-deal-stage-api.d.ts +69 -0
- package/src/lib/hooks/use-deal-stage-api.js +78 -0
- package/src/lib/hooks/use-deal-stage-api.js.map +1 -0
- package/src/lib/hooks/use-deals.d.ts +47 -0
- package/src/lib/hooks/use-deals.js +105 -0
- package/src/lib/hooks/use-deals.js.map +1 -0
- package/src/lib/hooks/use-org-leads.d.ts +53 -0
- package/src/lib/hooks/use-org-leads.js +114 -0
- package/src/lib/hooks/use-org-leads.js.map +1 -0
- package/src/lib/hooks/use-org-member-directory.d.ts +36 -0
- package/src/lib/hooks/use-org-member-directory.js +116 -0
- package/src/lib/hooks/use-org-member-directory.js.map +1 -0
- package/src/lib/hooks/use-org-member-options.d.ts +38 -0
- package/src/lib/hooks/use-org-member-options.js +131 -0
- package/src/lib/hooks/use-org-member-options.js.map +1 -0
- package/src/lib/hooks/use-pipeline.d.ts +71 -0
- package/src/lib/hooks/use-pipeline.js +159 -0
- package/src/lib/hooks/use-pipeline.js.map +1 -0
- package/src/lib/model/companies-bulk-writes.d.ts +40 -0
- package/src/lib/model/companies-bulk-writes.js +103 -0
- package/src/lib/model/companies-bulk-writes.js.map +1 -0
- package/src/lib/model/companies-csv.d.ts +36 -0
- package/src/lib/model/companies-csv.js +38 -0
- package/src/lib/model/companies-csv.js.map +1 -0
- package/src/lib/model/companies.d.ts +99 -0
- package/src/lib/model/companies.js +168 -0
- package/src/lib/model/companies.js.map +1 -0
- package/src/lib/model/company-delete-route.d.ts +43 -0
- package/src/lib/model/company-delete-route.js +31 -0
- package/src/lib/model/company-delete-route.js.map +1 -0
- package/src/lib/model/company-delete.d.ts +42 -0
- package/src/lib/model/company-delete.js +52 -0
- package/src/lib/model/company-delete.js.map +1 -0
- package/src/lib/model/contact-duplicates.d.ts +58 -0
- package/src/lib/model/contact-duplicates.js +67 -0
- package/src/lib/model/contact-duplicates.js.map +1 -0
- package/src/lib/model/contact-record.d.ts +113 -0
- package/src/lib/model/contact-record.js +70 -0
- package/src/lib/model/contact-record.js.map +1 -0
- package/src/lib/model/contact-update.d.ts +93 -0
- package/src/lib/model/contact-update.js +50 -0
- package/src/lib/model/contact-update.js.map +1 -0
- package/src/lib/model/contacts-bulk-writes.d.ts +173 -0
- package/src/lib/model/contacts-bulk-writes.js +196 -0
- package/src/lib/model/contacts-bulk-writes.js.map +1 -0
- package/src/lib/model/contacts-csv.d.ts +54 -0
- package/src/lib/model/contacts-csv.js +67 -0
- package/src/lib/model/contacts-csv.js.map +1 -0
- package/src/lib/model/contacts-list-seed.d.ts +51 -0
- package/src/lib/model/contacts-list-seed.js +63 -0
- package/src/lib/model/contacts-list-seed.js.map +1 -0
- package/src/lib/model/crm-activity-report.d.ts +27 -0
- package/src/lib/model/crm-activity-report.js +56 -0
- package/src/lib/model/crm-activity-report.js.map +1 -0
- package/src/lib/model/crm-api.d.ts +49 -0
- package/src/lib/model/crm-api.js +47 -0
- package/src/lib/model/crm-api.js.map +1 -0
- package/src/lib/model/crm-bulk-writes.d.ts +147 -0
- package/src/lib/model/crm-bulk-writes.js +207 -0
- package/src/lib/model/crm-bulk-writes.js.map +1 -0
- package/src/lib/model/crm-company-import.d.ts +154 -0
- package/src/lib/model/crm-company-import.js +331 -0
- package/src/lib/model/crm-company-import.js.map +1 -0
- package/src/lib/model/crm-custom-draft.d.ts +62 -0
- package/src/lib/model/crm-custom-draft.js +67 -0
- package/src/lib/model/crm-custom-draft.js.map +1 -0
- package/src/lib/model/crm-deal-import.d.ts +112 -0
- package/src/lib/model/crm-deal-import.js +263 -0
- package/src/lib/model/crm-deal-import.js.map +1 -0
- package/src/lib/model/crm-import.d.ts +244 -0
- package/src/lib/model/crm-import.js +466 -0
- package/src/lib/model/crm-import.js.map +1 -0
- package/src/lib/model/crm-lead-import.d.ts +105 -0
- package/src/lib/model/crm-lead-import.js +255 -0
- package/src/lib/model/crm-lead-import.js.map +1 -0
- package/src/lib/model/crm-record-routes.d.ts +21 -0
- package/src/lib/model/crm-record-routes.js +70 -0
- package/src/lib/model/crm-record-routes.js.map +1 -0
- package/src/lib/model/crm-routes.d.ts +101 -0
- package/src/lib/model/crm-routes.js +92 -0
- package/src/lib/model/crm-routes.js.map +1 -0
- package/src/lib/model/crm-task-import.d.ts +94 -0
- package/src/lib/model/crm-task-import.js +275 -0
- package/src/lib/model/crm-task-import.js.map +1 -0
- package/src/lib/model/crm-view-param.d.ts +43 -0
- package/src/lib/model/crm-view-param.js +49 -0
- package/src/lib/model/crm-view-param.js.map +1 -0
- package/src/lib/model/deal-board-model.d.ts +241 -0
- package/src/lib/model/deal-board-model.js +439 -0
- package/src/lib/model/deal-board-model.js.map +1 -0
- package/src/lib/model/deal-form-model.d.ts +114 -0
- package/src/lib/model/deal-form-model.js +218 -0
- package/src/lib/model/deal-form-model.js.map +1 -0
- package/src/lib/model/deals-csv.d.ts +32 -0
- package/src/lib/model/deals-csv.js +37 -0
- package/src/lib/model/deals-csv.js.map +1 -0
- package/src/lib/model/import-column-shapes.d.ts +36 -0
- package/src/lib/model/import-column-shapes.js +76 -0
- package/src/lib/model/import-column-shapes.js.map +1 -0
- package/src/lib/model/lead-company-suggestion.d.ts +61 -0
- package/src/lib/model/lead-company-suggestion.js +65 -0
- package/src/lib/model/lead-company-suggestion.js.map +1 -0
- package/src/lib/model/lead-filters.d.ts +29 -0
- package/src/lib/model/lead-filters.js +39 -0
- package/src/lib/model/lead-filters.js.map +1 -0
- package/src/lib/model/lead-surfaces.d.ts +58 -0
- package/src/lib/model/lead-surfaces.js +67 -0
- package/src/lib/model/lead-surfaces.js.map +1 -0
- package/src/lib/model/leads-csv.d.ts +40 -0
- package/src/lib/model/leads-csv.js +40 -0
- package/src/lib/model/leads-csv.js.map +1 -0
- package/src/lib/model/next-activity-api.d.ts +31 -0
- package/src/lib/model/next-activity-api.js +57 -0
- package/src/lib/model/next-activity-api.js.map +1 -0
- package/src/lib/model/next-activity.d.ts +64 -0
- package/src/lib/model/next-activity.js +47 -0
- package/src/lib/model/next-activity.js.map +1 -0
- package/src/lib/model/person-key-web.d.ts +43 -0
- package/src/lib/model/person-key-web.js +52 -0
- package/src/lib/model/person-key-web.js.map +1 -0
- package/src/lib/model/record-facts.d.ts +282 -0
- package/src/lib/model/record-facts.js +434 -0
- package/src/lib/model/record-facts.js.map +1 -0
- package/src/lib/model/task-api.d.ts +28 -0
- package/src/lib/model/task-api.js +57 -0
- package/src/lib/model/task-api.js.map +1 -0
- package/src/lib/model/task-calendar.d.ts +108 -0
- package/src/lib/model/task-calendar.js +139 -0
- package/src/lib/model/task-calendar.js.map +1 -0
- package/src/lib/model/task-routes.d.ts +177 -0
- package/src/lib/model/task-routes.js +197 -0
- package/src/lib/model/task-routes.js.map +1 -0
- package/src/lib/model/task-scope.d.ts +45 -0
- package/src/lib/model/task-scope.js +51 -0
- package/src/lib/model/task-scope.js.map +1 -0
- package/src/lib/model/task-views.d.ts +149 -0
- package/src/lib/model/task-views.js +286 -0
- package/src/lib/model/task-views.js.map +1 -0
- package/src/lib/model/tasks-csv.d.ts +28 -0
- package/src/lib/model/tasks-csv.js +28 -0
- package/src/lib/model/tasks-csv.js.map +1 -0
- package/src/lib/plugin.d.ts +32 -0
- package/src/lib/plugin.js +208 -0
- package/src/lib/plugin.js.map +1 -0
- package/src/lib/server/companies-import.d.ts +57 -0
- package/src/lib/server/companies-import.js +242 -0
- package/src/lib/server/companies-import.js.map +1 -0
- package/src/lib/server/company-delete.d.ts +59 -0
- package/src/lib/server/company-delete.js +146 -0
- package/src/lib/server/company-delete.js.map +1 -0
- package/src/lib/server/contact-email-history.d.ts +82 -0
- package/src/lib/server/contact-email-history.js +264 -0
- package/src/lib/server/contact-email-history.js.map +1 -0
- package/src/lib/server/contact-profile.d.ts +41 -0
- package/src/lib/server/contact-profile.js +45 -0
- package/src/lib/server/contact-profile.js.map +1 -0
- package/src/lib/server/contact-update.d.ts +92 -0
- package/src/lib/server/contact-update.js +512 -0
- package/src/lib/server/contact-update.js.map +1 -0
- package/src/lib/server/contacts-import.d.ts +73 -0
- package/src/lib/server/contacts-import.js +263 -0
- package/src/lib/server/contacts-import.js.map +1 -0
- package/src/lib/server/contacts-merge.d.ts +86 -0
- package/src/lib/server/contacts-merge.js +206 -0
- package/src/lib/server/contacts-merge.js.map +1 -0
- package/src/lib/server/deals-import.d.ts +76 -0
- package/src/lib/server/deals-import.js +246 -0
- package/src/lib/server/deals-import.js.map +1 -0
- package/src/lib/server/email-send.d.ts +119 -0
- package/src/lib/server/email-send.js +667 -0
- package/src/lib/server/email-send.js.map +1 -0
- package/src/lib/server/email-template-duplicate.d.ts +19 -0
- package/src/lib/server/email-template-duplicate.js +206 -0
- package/src/lib/server/email-template-duplicate.js.map +1 -0
- package/src/lib/server/erase-person.d.ts +108 -0
- package/src/lib/server/erase-person.js +309 -0
- package/src/lib/server/erase-person.js.map +1 -0
- package/src/lib/server/import-context.d.ts +85 -0
- package/src/lib/server/import-context.js +181 -0
- package/src/lib/server/import-context.js.map +1 -0
- package/src/lib/server/inbound-address.d.ts +61 -0
- package/src/lib/server/inbound-address.js +188 -0
- package/src/lib/server/inbound-address.js.map +1 -0
- package/src/lib/server/lead-convert.d.ts +78 -0
- package/src/lib/server/lead-convert.js +250 -0
- package/src/lib/server/lead-convert.js.map +1 -0
- package/src/lib/server/leads-import.d.ts +84 -0
- package/src/lib/server/leads-import.js +261 -0
- package/src/lib/server/leads-import.js.map +1 -0
- package/src/lib/server/next-activity-routes.d.ts +33 -0
- package/src/lib/server/next-activity-routes.js +110 -0
- package/src/lib/server/next-activity-routes.js.map +1 -0
- package/src/lib/server/org-activity.d.ts +61 -0
- package/src/lib/server/org-activity.js +120 -0
- package/src/lib/server/org-activity.js.map +1 -0
- package/src/lib/server/org-caller.d.ts +110 -0
- package/src/lib/server/org-caller.js +154 -0
- package/src/lib/server/org-caller.js.map +1 -0
- package/src/lib/server/recipe-routes.d.ts +75 -0
- package/src/lib/server/recipe-routes.js +442 -0
- package/src/lib/server/recipe-routes.js.map +1 -0
- package/src/lib/server/record-facts.d.ts +65 -0
- package/src/lib/server/record-facts.js +337 -0
- package/src/lib/server/record-facts.js.map +1 -0
- package/src/lib/server/record-timeline.d.ts +51 -0
- package/src/lib/server/record-timeline.js +215 -0
- package/src/lib/server/record-timeline.js.map +1 -0
- package/src/lib/server/suite-gate.d.ts +42 -0
- package/src/lib/server/suite-gate.js +87 -0
- package/src/lib/server/suite-gate.js.map +1 -0
- package/src/lib/server/task-routes.d.ts +132 -0
- package/src/lib/server/task-routes.js +699 -0
- package/src/lib/server/task-routes.js.map +1 -0
- package/src/lib/server/tasks-import.d.ts +54 -0
- package/src/lib/server/tasks-import.js +157 -0
- package/src/lib/server/tasks-import.js.map +1 -0
- package/src/lib/server-deal-stage.d.ts +88 -0
- package/src/lib/server-deal-stage.js +316 -0
- package/src/lib/server-deal-stage.js.map +1 -0
- package/src/lib/server.d.ts +149 -0
- package/src/lib/server.js +615 -0
- package/src/lib/server.js.map +1 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ 'use client';
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
|
+
import { pluginDocsHelp } from "@aglyn/aglyn";
|
|
19
|
+
import { mdiDeleteOutline, mdiPencilOutline } from "@aglyn/shared-data-mdi";
|
|
20
|
+
import { MdiIcon, useConfirmationContext } from "@aglyn/shared-ui-jsx";
|
|
21
|
+
import { useSnackbar } from "@aglyn/shared-ui-snackstack";
|
|
22
|
+
import { Button, Link, Stack, Typography } from "@mui/material";
|
|
23
|
+
import { useCallback, useState } from "react";
|
|
24
|
+
import { useContactFieldDefinitions } from "../hooks/use-contact-field-definitions.js";
|
|
25
|
+
import { useCrmActivityLogger } from "../hooks/use-crm-activity-logger.js";
|
|
26
|
+
import { COMPANY_DETACH_LIMIT } from "../model/companies.js";
|
|
27
|
+
import { companyDeleteFailureMessage, deleteCompanyThroughRoute } from "../model/company-delete.js";
|
|
28
|
+
import CompanyEditDrawer from "./company-edit-drawer.js";
|
|
29
|
+
import { formatContactCustomValue } from "./contact-custom-columns.js";
|
|
30
|
+
import { CrmCallButton, CrmPhoneLink } from "./crm-call-actions.js";
|
|
31
|
+
import { CrmRecordChip, CrmRecordHeader } from "./crm-record-header.js";
|
|
32
|
+
import { useCrmApi } from "./use-crm-api.js";
|
|
33
|
+
/** A postal address on one line, or nothing. */ function formatAddress(address) {
|
|
34
|
+
if (!address) return '';
|
|
35
|
+
return [
|
|
36
|
+
address.line1,
|
|
37
|
+
address.line2,
|
|
38
|
+
[
|
|
39
|
+
address.city,
|
|
40
|
+
address.state
|
|
41
|
+
].filter(Boolean).join(', '),
|
|
42
|
+
address.postalCode,
|
|
43
|
+
address.country
|
|
44
|
+
].map((part)=>String(part != null ? part : '').trim()).filter(Boolean).join(' · ');
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* WHAT A COMPANY IS: its fields, read off the one document the page holds,
|
|
48
|
+
* with the edit and the delete beside them (AGL-2597).
|
|
49
|
+
*
|
|
50
|
+
* ## Edit is the create drawer
|
|
51
|
+
*
|
|
52
|
+
* The same form the list creates with, opened on the record. One form means
|
|
53
|
+
* one set of refusals — a domain that is not a domain is refused the same
|
|
54
|
+
* way on day one and on a rename — and one place to add a field.
|
|
55
|
+
*
|
|
56
|
+
* ## Delete is a DETACH first
|
|
57
|
+
*
|
|
58
|
+
* `crm/company-delete` — the route the bulk bar calls per row as well —
|
|
59
|
+
* unlinks the contacts that name this company before removing it, bounded
|
|
60
|
+
* at {@link COMPANY_DETACH_LIMIT} per pass and honest past it: the company
|
|
61
|
+
* stands, and the person is told more remain. The unlink clears each
|
|
62
|
+
* holder's facet that named the company, which is the server's to write
|
|
63
|
+
* (AGL-2804). What this card adds is the confirm, the sentence for each
|
|
64
|
+
* outcome, and leaving the page once the record is gone.
|
|
65
|
+
*/ export function CompanyPropertiesCard(props) {
|
|
66
|
+
var _company_tags;
|
|
67
|
+
const { company, seed, hostId, org, crmScope, members, routes, onDeleted } = props;
|
|
68
|
+
const { scope } = crmScope;
|
|
69
|
+
const callCrm = useCrmApi(hostId);
|
|
70
|
+
const { confirm } = useConfirmationContext();
|
|
71
|
+
const { enqueueSnackbar } = useSnackbar();
|
|
72
|
+
// The feed the act is logged in, decided by the level it was performed
|
|
73
|
+
// at (AGL-2738): this site's under a site, the organization's at the org
|
|
74
|
+
// hub, where a client-direct append to the company's own site would face
|
|
75
|
+
// a gate the record write never had to pass.
|
|
76
|
+
const logActivity = useCrmActivityLogger(hostId);
|
|
77
|
+
const [editing, setEditing] = useState(false);
|
|
78
|
+
const [deleting, setDeleting] = useState(false);
|
|
79
|
+
// The org's company fields (AGL-2661): one row each under the fixed
|
|
80
|
+
// ones, read by type the way the list's columns read them.
|
|
81
|
+
const fields = useContactFieldDefinitions(crmScope.orgId, 'company');
|
|
82
|
+
const handleDelete = useCallback(async ()=>{
|
|
83
|
+
var _company_name;
|
|
84
|
+
if (!scope || deleting) return;
|
|
85
|
+
const name = String((_company_name = company.name) != null ? _company_name : company.$id);
|
|
86
|
+
const accepted = await confirm({
|
|
87
|
+
title: 'Delete this company?',
|
|
88
|
+
description: `"${name}" is removed from Companies and unlinked from every ` + 'contact at it. The contacts themselves are kept, and so is ' + 'anything else filed against the company.',
|
|
89
|
+
confirmationText: 'Delete company',
|
|
90
|
+
confirmationButtonProps: {
|
|
91
|
+
color: 'error'
|
|
92
|
+
}
|
|
93
|
+
})// `confirm` resolves with no value and REJECTS on cancel, so gating
|
|
94
|
+
// on the resolved value alone would make this always return.
|
|
95
|
+
.then(()=>true).catch(()=>false);
|
|
96
|
+
if (!accepted) return;
|
|
97
|
+
setDeleting(true);
|
|
98
|
+
try {
|
|
99
|
+
const outcome = await deleteCompanyThroughRoute(callCrm, company.$id);
|
|
100
|
+
if (!outcome.deleted) {
|
|
101
|
+
enqueueSnackbar(`${COMPANY_DETACH_LIMIT.toLocaleString()} contacts were unlinked ` + `from "${name}" and more remain. Delete again to continue.`, {
|
|
102
|
+
variant: 'warning'
|
|
103
|
+
});
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
// Setup → Activity shows CRM work (AGL-2622): the company is org
|
|
107
|
+
// data, but the act happened in this site's console and belongs in
|
|
108
|
+
// its feed.
|
|
109
|
+
logActivity('Deleted company', {
|
|
110
|
+
type: 'company',
|
|
111
|
+
id: company.$id,
|
|
112
|
+
name
|
|
113
|
+
});
|
|
114
|
+
enqueueSnackbar(outcome.detached ? `Company deleted and unlinked from ${outcome.detached.toLocaleString()} ` + `contact${outcome.detached === 1 ? '' : 's'}` : 'Company deleted', {
|
|
115
|
+
variant: 'success',
|
|
116
|
+
persist: false
|
|
117
|
+
});
|
|
118
|
+
onDeleted();
|
|
119
|
+
} catch (error) {
|
|
120
|
+
console.error(error);
|
|
121
|
+
enqueueSnackbar(companyDeleteFailureMessage(error), {
|
|
122
|
+
variant: 'error',
|
|
123
|
+
allowDuplicate: true
|
|
124
|
+
});
|
|
125
|
+
} finally{
|
|
126
|
+
setDeleting(false);
|
|
127
|
+
}
|
|
128
|
+
}, [
|
|
129
|
+
scope,
|
|
130
|
+
deleting,
|
|
131
|
+
company,
|
|
132
|
+
confirm,
|
|
133
|
+
callCrm,
|
|
134
|
+
logActivity,
|
|
135
|
+
enqueueSnackbar,
|
|
136
|
+
onDeleted
|
|
137
|
+
]);
|
|
138
|
+
const address = formatAddress(company.address);
|
|
139
|
+
// The domain, the industry and the owner read on the header — the
|
|
140
|
+
// subtitle and the chip row — so the rows list what is left.
|
|
141
|
+
const rows = [
|
|
142
|
+
{
|
|
143
|
+
label: 'Website',
|
|
144
|
+
value: company.website ? /*#__PURE__*/ _jsx(Link, {
|
|
145
|
+
href: company.website,
|
|
146
|
+
target: "_blank",
|
|
147
|
+
rel: "noreferrer noopener",
|
|
148
|
+
children: company.website
|
|
149
|
+
}) : null
|
|
150
|
+
},
|
|
151
|
+
// Callable in one tap (AGL-2661); plain text for a value no dialer takes.
|
|
152
|
+
{
|
|
153
|
+
label: 'Phone',
|
|
154
|
+
value: /*#__PURE__*/ _jsx(CrmPhoneLink, {
|
|
155
|
+
phone: company.phone
|
|
156
|
+
})
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
label: 'Address',
|
|
160
|
+
value: address
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
label: 'Tags',
|
|
164
|
+
value: ((_company_tags = company.tags) != null ? _company_tags : []).join(', ')
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
label: 'Notes',
|
|
168
|
+
value: company.notes
|
|
169
|
+
},
|
|
170
|
+
...fields.active.map((definition)=>{
|
|
171
|
+
var _company_custom;
|
|
172
|
+
const text = formatContactCustomValue(definition, (_company_custom = company.custom) == null ? void 0 : _company_custom[definition.key]);
|
|
173
|
+
return {
|
|
174
|
+
label: definition.label || definition.key,
|
|
175
|
+
value: text && definition.type === 'url' ? /*#__PURE__*/ _jsx(Link, {
|
|
176
|
+
href: text,
|
|
177
|
+
target: "_blank",
|
|
178
|
+
rel: "noreferrer noopener",
|
|
179
|
+
children: text
|
|
180
|
+
}) : text
|
|
181
|
+
};
|
|
182
|
+
})
|
|
183
|
+
];
|
|
184
|
+
return /*#__PURE__*/ _jsxs(CrmRecordHeader, {
|
|
185
|
+
kind: "Company",
|
|
186
|
+
title: String(company.name || company.$id),
|
|
187
|
+
subtitle: company.domain,
|
|
188
|
+
help: pluginDocsHelp('companies', {
|
|
189
|
+
anchor: '#a-companys-page'
|
|
190
|
+
}),
|
|
191
|
+
backHref: routes.section('companies'),
|
|
192
|
+
backLabel: "Back to companies",
|
|
193
|
+
actions: /*#__PURE__*/ _jsxs(_Fragment, {
|
|
194
|
+
children: [
|
|
195
|
+
/*#__PURE__*/ _jsx(CrmCallButton, {
|
|
196
|
+
hostId: hostId,
|
|
197
|
+
org: org,
|
|
198
|
+
link: {
|
|
199
|
+
companyId: company.$id
|
|
200
|
+
},
|
|
201
|
+
phone: company.phone
|
|
202
|
+
}),
|
|
203
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
204
|
+
size: "small",
|
|
205
|
+
color: "primary",
|
|
206
|
+
variant: "outlined",
|
|
207
|
+
startIcon: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
208
|
+
path: mdiPencilOutline.path,
|
|
209
|
+
size: 0.8
|
|
210
|
+
}),
|
|
211
|
+
onClick: ()=>setEditing(true),
|
|
212
|
+
children: 'Edit'
|
|
213
|
+
})
|
|
214
|
+
]
|
|
215
|
+
}),
|
|
216
|
+
menuItems: [
|
|
217
|
+
{
|
|
218
|
+
key: 'delete',
|
|
219
|
+
label: deleting ? 'Deleting…' : 'Delete company',
|
|
220
|
+
icon: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
221
|
+
path: mdiDeleteOutline.path,
|
|
222
|
+
size: 0.8
|
|
223
|
+
}),
|
|
224
|
+
destructive: true,
|
|
225
|
+
disabled: !scope || deleting,
|
|
226
|
+
disabledReason: deleting ? 'The company is being deleted' : 'The organization has not loaded',
|
|
227
|
+
onClick: ()=>void handleDelete()
|
|
228
|
+
}
|
|
229
|
+
],
|
|
230
|
+
chips: /*#__PURE__*/ _jsxs(_Fragment, {
|
|
231
|
+
children: [
|
|
232
|
+
/*#__PURE__*/ _jsx(CrmRecordChip, {
|
|
233
|
+
label: "Industry",
|
|
234
|
+
value: company.industry
|
|
235
|
+
}),
|
|
236
|
+
/*#__PURE__*/ _jsx(CrmRecordChip, {
|
|
237
|
+
label: "Owner",
|
|
238
|
+
value: company.ownerUid ? members.ready ? members.labelFor(company.ownerUid) : '…' : undefined
|
|
239
|
+
})
|
|
240
|
+
]
|
|
241
|
+
}),
|
|
242
|
+
children: [
|
|
243
|
+
/*#__PURE__*/ _jsx(Stack, {
|
|
244
|
+
spacing: 1,
|
|
245
|
+
children: rows.map((row)=>/*#__PURE__*/ _jsxs(Stack, {
|
|
246
|
+
direction: "row",
|
|
247
|
+
spacing: 2,
|
|
248
|
+
sx: {
|
|
249
|
+
alignItems: 'baseline'
|
|
250
|
+
},
|
|
251
|
+
children: [
|
|
252
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
253
|
+
variant: "caption",
|
|
254
|
+
color: "text.secondary",
|
|
255
|
+
sx: {
|
|
256
|
+
minWidth: 96,
|
|
257
|
+
flexShrink: 0
|
|
258
|
+
},
|
|
259
|
+
children: row.label
|
|
260
|
+
}),
|
|
261
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
262
|
+
variant: "body2",
|
|
263
|
+
color: row.value ? 'text.primary' : 'text.secondary',
|
|
264
|
+
sx: {
|
|
265
|
+
whiteSpace: 'pre-wrap',
|
|
266
|
+
overflowWrap: 'anywhere'
|
|
267
|
+
},
|
|
268
|
+
children: row.value || '—'
|
|
269
|
+
})
|
|
270
|
+
]
|
|
271
|
+
}, row.label))
|
|
272
|
+
}),
|
|
273
|
+
editing ? /*#__PURE__*/ _jsx(CompanyEditDrawer, {
|
|
274
|
+
open: true,
|
|
275
|
+
onClose: ()=>setEditing(false),
|
|
276
|
+
hostId: hostId,
|
|
277
|
+
org: org,
|
|
278
|
+
company: company,
|
|
279
|
+
seed: seed,
|
|
280
|
+
members: members,
|
|
281
|
+
onSaved: ()=>setEditing(false)
|
|
282
|
+
}) : null
|
|
283
|
+
]
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
CompanyPropertiesCard.displayName = 'CompanyPropertiesCard';
|
|
287
|
+
export default CompanyPropertiesCard;
|
|
288
|
+
|
|
289
|
+
//# sourceMappingURL=company-properties-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/company-properties-card.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport {\n type AglynOrgBilling,\n type AglynPostalAddress,\n type CrmCompany,\n pluginDocsHelp,\n} from '@aglyn/aglyn'\nimport { mdiDeleteOutline, mdiPencilOutline } from '@aglyn/shared-data-mdi'\nimport { MdiIcon, useConfirmationContext } from '@aglyn/shared-ui-jsx'\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport { Button, Link, Stack, Typography } from '@mui/material'\nimport { type ReactNode, useCallback, useState } from 'react'\nimport { useContactFieldDefinitions } from '../hooks/use-contact-field-definitions'\nimport { useCrmActivityLogger } from '../hooks/use-crm-activity-logger'\nimport type { CrmScope } from '../hooks/use-crm-scope'\nimport type { OrgMemberOptions } from '../hooks/use-org-member-options'\nimport { COMPANY_DETACH_LIMIT } from '../model/companies'\nimport {\n companyDeleteFailureMessage,\n deleteCompanyThroughRoute,\n} from '../model/company-delete'\nimport type { CrmRoutes } from '../model/crm-routes'\nimport CompanyEditDrawer from './company-edit-drawer'\nimport { formatContactCustomValue } from './contact-custom-columns'\nimport { CrmCallButton, CrmPhoneLink } from './crm-call-actions'\nimport { CrmRecordChip, CrmRecordHeader } from './crm-record-header'\nimport { useCrmApi } from './use-crm-api'\n\nexport interface CompanyPropertiesCardProps {\n company: Partial<CrmCompany> & { $id: string }\n /** Whether the document the card holds is server-confirmed. */\n seed: { fromCache: boolean; unreadable: boolean }\n /** The site the record is read under, or `null` at the organization level. */\n hostId: string | null\n org?: Partial<AglynOrgBilling>\n crmScope: CrmScope\n members: OrgMemberOptions\n routes: CrmRoutes\n /** Called once the record is gone, so the page can leave it. */\n onDeleted: () => void\n}\n\n/** A postal address on one line, or nothing. */\nfunction formatAddress(address: AglynPostalAddress | null | undefined): string {\n if (!address) return ''\n return [\n address.line1,\n address.line2,\n [address.city, address.state].filter(Boolean).join(', '),\n address.postalCode,\n address.country,\n ]\n .map((part) => String(part ?? '').trim())\n .filter(Boolean)\n .join(' · ')\n}\n\n/**\n * WHAT A COMPANY IS: its fields, read off the one document the page holds,\n * with the edit and the delete beside them (AGL-2597).\n *\n * ## Edit is the create drawer\n *\n * The same form the list creates with, opened on the record. One form means\n * one set of refusals — a domain that is not a domain is refused the same\n * way on day one and on a rename — and one place to add a field.\n *\n * ## Delete is a DETACH first\n *\n * `crm/company-delete` — the route the bulk bar calls per row as well —\n * unlinks the contacts that name this company before removing it, bounded\n * at {@link COMPANY_DETACH_LIMIT} per pass and honest past it: the company\n * stands, and the person is told more remain. The unlink clears each\n * holder's facet that named the company, which is the server's to write\n * (AGL-2804). What this card adds is the confirm, the sentence for each\n * outcome, and leaving the page once the record is gone.\n */\nexport function CompanyPropertiesCard(props: CompanyPropertiesCardProps) {\n const {\n company,\n seed,\n hostId,\n org,\n crmScope,\n members,\n routes,\n onDeleted,\n } = props\n const { scope } = crmScope\n const callCrm = useCrmApi(hostId)\n const { confirm } = useConfirmationContext()\n const { enqueueSnackbar } = useSnackbar()\n // The feed the act is logged in, decided by the level it was performed\n // at (AGL-2738): this site's under a site, the organization's at the org\n // hub, where a client-direct append to the company's own site would face\n // a gate the record write never had to pass.\n const logActivity = useCrmActivityLogger(hostId)\n const [editing, setEditing] = useState(false)\n const [deleting, setDeleting] = useState(false)\n // The org's company fields (AGL-2661): one row each under the fixed\n // ones, read by type the way the list's columns read them.\n const fields = useContactFieldDefinitions(crmScope.orgId, 'company')\n\n const handleDelete = useCallback(async () => {\n if (!scope || deleting) return\n const name = String(company.name ?? company.$id)\n const accepted = await confirm({\n title: 'Delete this company?',\n description:\n `\"${name}\" is removed from Companies and unlinked from every ` +\n 'contact at it. The contacts themselves are kept, and so is ' +\n 'anything else filed against the company.',\n confirmationText: 'Delete company',\n confirmationButtonProps: { color: 'error' },\n })\n // `confirm` resolves with no value and REJECTS on cancel, so gating\n // on the resolved value alone would make this always return.\n .then(() => true)\n .catch(() => false)\n if (!accepted) return\n setDeleting(true)\n try {\n const outcome = await deleteCompanyThroughRoute(callCrm, company.$id)\n if (!outcome.deleted) {\n enqueueSnackbar(\n `${COMPANY_DETACH_LIMIT.toLocaleString()} contacts were unlinked ` +\n `from \"${name}\" and more remain. Delete again to continue.`,\n { variant: 'warning' },\n )\n return\n }\n // Setup → Activity shows CRM work (AGL-2622): the company is org\n // data, but the act happened in this site's console and belongs in\n // its feed.\n logActivity('Deleted company', { type: 'company', id: company.$id, name })\n enqueueSnackbar(\n outcome.detached\n ? `Company deleted and unlinked from ${outcome.detached.toLocaleString()} ` +\n `contact${outcome.detached === 1 ? '' : 's'}`\n : 'Company deleted',\n { variant: 'success', persist: false },\n )\n onDeleted()\n } catch (error) {\n console.error(error)\n enqueueSnackbar(companyDeleteFailureMessage(error), {\n variant: 'error',\n allowDuplicate: true,\n })\n } finally {\n setDeleting(false)\n }\n }, [scope, deleting, company, confirm, callCrm, logActivity, enqueueSnackbar, onDeleted])\n\n const address = formatAddress(company.address)\n // The domain, the industry and the owner read on the header — the\n // subtitle and the chip row — so the rows list what is left.\n const rows: Array<{ label: string; value: ReactNode }> = [\n {\n label: 'Website',\n value: company.website ? (\n <Link href={company.website} target=\"_blank\" rel=\"noreferrer noopener\">\n {company.website}\n </Link>\n ) : null,\n },\n // Callable in one tap (AGL-2661); plain text for a value no dialer takes.\n { label: 'Phone', value: <CrmPhoneLink phone={company.phone} /> },\n { label: 'Address', value: address },\n { label: 'Tags', value: (company.tags ?? []).join(', ') },\n { label: 'Notes', value: company.notes },\n ...fields.active.map((definition) => {\n const text = formatContactCustomValue(definition, company.custom?.[definition.key])\n return {\n label: definition.label || definition.key,\n value:\n text && definition.type === 'url' ? (\n <Link href={text} target=\"_blank\" rel=\"noreferrer noopener\">\n {text}\n </Link>\n ) : (\n text\n ),\n }\n }),\n ]\n\n return (\n <CrmRecordHeader\n kind=\"Company\"\n title={String(company.name || company.$id)}\n subtitle={company.domain}\n help={pluginDocsHelp('companies', { anchor: '#a-companys-page' })}\n backHref={routes.section('companies')}\n backLabel=\"Back to companies\"\n actions={\n <>\n <CrmCallButton\n hostId={hostId}\n org={org}\n link={{ companyId: company.$id }}\n phone={company.phone}\n />\n <Button\n size=\"small\"\n color=\"primary\"\n variant=\"outlined\"\n startIcon={<MdiIcon path={mdiPencilOutline.path} size={0.8} />}\n onClick={() => setEditing(true)}\n >\n {'Edit'}\n </Button>\n </>\n }\n menuItems={[\n {\n key: 'delete',\n label: deleting ? 'Deleting…' : 'Delete company',\n icon: <MdiIcon path={mdiDeleteOutline.path} size={0.8} />,\n destructive: true,\n disabled: !scope || deleting,\n disabledReason: deleting ? 'The company is being deleted' : 'The organization has not loaded',\n onClick: () => void handleDelete(),\n },\n ]}\n chips={\n <>\n <CrmRecordChip label=\"Industry\" value={company.industry} />\n <CrmRecordChip\n label=\"Owner\"\n value={\n company.ownerUid\n ? members.ready\n ? members.labelFor(company.ownerUid)\n : '…'\n : undefined\n }\n />\n </>\n }\n >\n <Stack spacing={1}>\n {rows.map((row) => (\n <Stack\n key={row.label}\n direction=\"row\"\n spacing={2}\n sx={{ alignItems: 'baseline' }}\n >\n <Typography\n variant=\"caption\"\n color=\"text.secondary\"\n sx={{ minWidth: 96, flexShrink: 0 }}\n >\n {row.label}\n </Typography>\n <Typography\n variant=\"body2\"\n color={row.value ? 'text.primary' : 'text.secondary'}\n sx={{ whiteSpace: 'pre-wrap', overflowWrap: 'anywhere' }}\n >\n {row.value || '—'}\n </Typography>\n </Stack>\n ))}\n </Stack>\n {editing ? (\n <CompanyEditDrawer\n open\n onClose={() => setEditing(false)}\n hostId={hostId}\n org={org}\n company={company}\n seed={seed}\n members={members}\n onSaved={() => setEditing(false)}\n />\n ) : null}\n </CrmRecordHeader>\n )\n}\nCompanyPropertiesCard.displayName = 'CompanyPropertiesCard'\n\nexport default CompanyPropertiesCard\n"],"names":["pluginDocsHelp","mdiDeleteOutline","mdiPencilOutline","MdiIcon","useConfirmationContext","useSnackbar","Button","Link","Stack","Typography","useCallback","useState","useContactFieldDefinitions","useCrmActivityLogger","COMPANY_DETACH_LIMIT","companyDeleteFailureMessage","deleteCompanyThroughRoute","CompanyEditDrawer","formatContactCustomValue","CrmCallButton","CrmPhoneLink","CrmRecordChip","CrmRecordHeader","useCrmApi","formatAddress","address","line1","line2","city","state","filter","Boolean","join","postalCode","country","map","part","String","trim","CompanyPropertiesCard","props","company","seed","hostId","org","crmScope","members","routes","onDeleted","scope","callCrm","confirm","enqueueSnackbar","logActivity","editing","setEditing","deleting","setDeleting","fields","orgId","handleDelete","name","$id","accepted","title","description","confirmationText","confirmationButtonProps","color","then","catch","outcome","deleted","toLocaleString","variant","type","id","detached","persist","error","console","allowDuplicate","rows","label","value","website","href","target","rel","phone","tags","notes","active","definition","text","custom","key","kind","subtitle","domain","help","anchor","backHref","section","backLabel","actions","link","companyId","size","startIcon","path","onClick","menuItems","icon","destructive","disabled","disabledReason","chips","industry","ownerUid","ready","labelFor","undefined","spacing","row","direction","sx","alignItems","minWidth","flexShrink","whiteSpace","overflowWrap","open","onClose","onSaved","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAEA,SAIEA,cAAc,QACT,eAAc;AACrB,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,yBAAwB;AAC3E,SAASC,OAAO,EAAEC,sBAAsB,QAAQ,uBAAsB;AACtE,SAASC,WAAW,QAAQ,8BAA6B;AACzD,SAASC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAEC,UAAU,QAAQ,gBAAe;AAC/D,SAAyBC,WAAW,EAAEC,QAAQ,QAAQ,QAAO;AAC7D,SAASC,0BAA0B,QAAQ,4CAAwC;AACnF,SAASC,oBAAoB,QAAQ,sCAAkC;AAGvE,SAASC,oBAAoB,QAAQ,wBAAoB;AACzD,SACEC,2BAA2B,EAC3BC,yBAAyB,QACpB,6BAAyB;AAEhC,OAAOC,uBAAuB,2BAAuB;AACrD,SAASC,wBAAwB,QAAQ,8BAA0B;AACnE,SAASC,aAAa,EAAEC,YAAY,QAAQ,wBAAoB;AAChE,SAASC,aAAa,EAAEC,eAAe,QAAQ,yBAAqB;AACpE,SAASC,SAAS,QAAQ,mBAAe;AAgBzC,8CAA8C,GAC9C,SAASC,cAAcC,OAA8C;IACnE,IAAI,CAACA,SAAS,OAAO;IACrB,OAAO;QACLA,QAAQC,KAAK;QACbD,QAAQE,KAAK;QACb;YAACF,QAAQG,IAAI;YAAEH,QAAQI,KAAK;SAAC,CAACC,MAAM,CAACC,SAASC,IAAI,CAAC;QACnDP,QAAQQ,UAAU;QAClBR,QAAQS,OAAO;KAChB,CACEC,GAAG,CAAC,CAACC,OAASC,OAAOD,eAAAA,OAAQ,IAAIE,IAAI,IACrCR,MAAM,CAACC,SACPC,IAAI,CAAC;AACV;AAEA;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,SAASO,sBAAsBC,KAAiC;QA4F1CC;IA3F3B,MAAM,EACJA,OAAO,EACPC,IAAI,EACJC,MAAM,EACNC,GAAG,EACHC,QAAQ,EACRC,OAAO,EACPC,MAAM,EACNC,SAAS,EACV,GAAGR;IACJ,MAAM,EAAES,KAAK,EAAE,GAAGJ;IAClB,MAAMK,UAAU3B,UAAUoB;IAC1B,MAAM,EAAEQ,OAAO,EAAE,GAAG/C;IACpB,MAAM,EAAEgD,eAAe,EAAE,GAAG/C;IAC5B,uEAAuE;IACvE,yEAAyE;IACzE,yEAAyE;IACzE,6CAA6C;IAC7C,MAAMgD,cAAcxC,qBAAqB8B;IACzC,MAAM,CAACW,SAASC,WAAW,GAAG5C,SAAS;IACvC,MAAM,CAAC6C,UAAUC,YAAY,GAAG9C,SAAS;IACzC,oEAAoE;IACpE,2DAA2D;IAC3D,MAAM+C,SAAS9C,2BAA2BiC,SAASc,KAAK,EAAE;IAE1D,MAAMC,eAAelD,YAAY;YAEX+B;QADpB,IAAI,CAACQ,SAASO,UAAU;QACxB,MAAMK,OAAOxB,QAAOI,gBAAAA,QAAQoB,IAAI,YAAZpB,gBAAgBA,QAAQqB,GAAG;QAC/C,MAAMC,WAAW,MAAMZ,QAAQ;YAC7Ba,OAAO;YACPC,aACE,CAAC,CAAC,EAAEJ,KAAK,oDAAoD,CAAC,GAC9D,gEACA;YACFK,kBAAkB;YAClBC,yBAAyB;gBAAEC,OAAO;YAAQ;QAC5C,EACE,oEAAoE;QACpE,6DAA6D;SAC5DC,IAAI,CAAC,IAAM,MACXC,KAAK,CAAC,IAAM;QACf,IAAI,CAACP,UAAU;QACfN,YAAY;QACZ,IAAI;YACF,MAAMc,UAAU,MAAMvD,0BAA0BkC,SAAST,QAAQqB,GAAG;YACpE,IAAI,CAACS,QAAQC,OAAO,EAAE;gBACpBpB,gBACE,GAAGtC,qBAAqB2D,cAAc,GAAG,wBAAwB,CAAC,GAChE,CAAC,MAAM,EAAEZ,KAAK,4CAA4C,CAAC,EAC7D;oBAAEa,SAAS;gBAAU;gBAEvB;YACF;YACA,iEAAiE;YACjE,mEAAmE;YACnE,YAAY;YACZrB,YAAY,mBAAmB;gBAAEsB,MAAM;gBAAWC,IAAInC,QAAQqB,GAAG;gBAAED;YAAK;YACxET,gBACEmB,QAAQM,QAAQ,GACZ,CAAC,kCAAkC,EAAEN,QAAQM,QAAQ,CAACJ,cAAc,GAAG,CAAC,CAAC,GACvE,CAAC,OAAO,EAAEF,QAAQM,QAAQ,KAAK,IAAI,KAAK,KAAK,GAC/C,mBACJ;gBAAEH,SAAS;gBAAWI,SAAS;YAAM;YAEvC9B;QACF,EAAE,OAAO+B,OAAO;YACdC,QAAQD,KAAK,CAACA;YACd3B,gBAAgBrC,4BAA4BgE,QAAQ;gBAClDL,SAAS;gBACTO,gBAAgB;YAClB;QACF,SAAU;YACRxB,YAAY;QACd;IACF,GAAG;QAACR;QAAOO;QAAUf;QAASU;QAASD;QAASG;QAAaD;QAAiBJ;KAAU;IAExF,MAAMvB,UAAUD,cAAciB,QAAQhB,OAAO;IAC7C,kEAAkE;IAClE,6DAA6D;IAC7D,MAAMyD,OAAmD;QACvD;YACEC,OAAO;YACPC,OAAO3C,QAAQ4C,OAAO,iBACpB,KAAC9E;gBAAK+E,MAAM7C,QAAQ4C,OAAO;gBAAEE,QAAO;gBAASC,KAAI;0BAC9C/C,QAAQ4C,OAAO;iBAEhB;QACN;QACA,0EAA0E;QAC1E;YAAEF,OAAO;YAASC,qBAAO,KAAChE;gBAAaqE,OAAOhD,QAAQgD,KAAK;;QAAK;QAChE;YAAEN,OAAO;YAAWC,OAAO3D;QAAQ;QACnC;YAAE0D,OAAO;YAAQC,OAAO,EAAC3C,gBAAAA,QAAQiD,IAAI,YAAZjD,gBAAgB,EAAE,EAAET,IAAI,CAAC;QAAM;QACxD;YAAEmD,OAAO;YAASC,OAAO3C,QAAQkD,KAAK;QAAC;WACpCjC,OAAOkC,MAAM,CAACzD,GAAG,CAAC,CAAC0D;gBAC8BpD;YAAlD,MAAMqD,OAAO5E,yBAAyB2E,aAAYpD,kBAAAA,QAAQsD,MAAM,qBAAdtD,eAAgB,CAACoD,WAAWG,GAAG,CAAC;YAClF,OAAO;gBACLb,OAAOU,WAAWV,KAAK,IAAIU,WAAWG,GAAG;gBACzCZ,OACEU,QAAQD,WAAWlB,IAAI,KAAK,sBAC1B,KAACpE;oBAAK+E,MAAMQ;oBAAMP,QAAO;oBAASC,KAAI;8BACnCM;qBAGHA;YAEN;QACF;KACD;IAED,qBACE,MAACxE;QACC2E,MAAK;QACLjC,OAAO3B,OAAOI,QAAQoB,IAAI,IAAIpB,QAAQqB,GAAG;QACzCoC,UAAUzD,QAAQ0D,MAAM;QACxBC,MAAMpG,eAAe,aAAa;YAAEqG,QAAQ;QAAmB;QAC/DC,UAAUvD,OAAOwD,OAAO,CAAC;QACzBC,WAAU;QACVC,uBACE;;8BACE,KAACtF;oBACCwB,QAAQA;oBACRC,KAAKA;oBACL8D,MAAM;wBAAEC,WAAWlE,QAAQqB,GAAG;oBAAC;oBAC/B2B,OAAOhD,QAAQgD,KAAK;;8BAEtB,KAACnF;oBACCsG,MAAK;oBACLxC,OAAM;oBACNM,SAAQ;oBACRmC,yBAAW,KAAC1G;wBAAQ2G,MAAM5G,iBAAiB4G,IAAI;wBAAEF,MAAM;;oBACvDG,SAAS,IAAMxD,WAAW;8BAEzB;;;;QAIPyD,WAAW;YACT;gBACEhB,KAAK;gBACLb,OAAO3B,WAAW,cAAc;gBAChCyD,oBAAM,KAAC9G;oBAAQ2G,MAAM7G,iBAAiB6G,IAAI;oBAAEF,MAAM;;gBAClDM,aAAa;gBACbC,UAAU,CAAClE,SAASO;gBACpB4D,gBAAgB5D,WAAW,iCAAiC;gBAC5DuD,SAAS,IAAM,KAAKnD;YACtB;SACD;QACDyD,qBACE;;8BACE,KAAChG;oBAAc8D,OAAM;oBAAWC,OAAO3C,QAAQ6E,QAAQ;;8BACvD,KAACjG;oBACC8D,OAAM;oBACNC,OACE3C,QAAQ8E,QAAQ,GACZzE,QAAQ0E,KAAK,GACX1E,QAAQ2E,QAAQ,CAAChF,QAAQ8E,QAAQ,IACjC,MACFG;;;;;0BAMZ,KAAClH;gBAAMmH,SAAS;0BACbzC,KAAK/C,GAAG,CAAC,CAACyF,oBACT,MAACpH;wBAECqH,WAAU;wBACVF,SAAS;wBACTG,IAAI;4BAAEC,YAAY;wBAAW;;0CAE7B,KAACtH;gCACCiE,SAAQ;gCACRN,OAAM;gCACN0D,IAAI;oCAAEE,UAAU;oCAAIC,YAAY;gCAAE;0CAEjCL,IAAIzC,KAAK;;0CAEZ,KAAC1E;gCACCiE,SAAQ;gCACRN,OAAOwD,IAAIxC,KAAK,GAAG,iBAAiB;gCACpC0C,IAAI;oCAAEI,YAAY;oCAAYC,cAAc;gCAAW;0CAEtDP,IAAIxC,KAAK,IAAI;;;uBAjBXwC,IAAIzC,KAAK;;YAsBnB7B,wBACC,KAACrC;gBACCmH,IAAI;gBACJC,SAAS,IAAM9E,WAAW;gBAC1BZ,QAAQA;gBACRC,KAAKA;gBACLH,SAASA;gBACTC,MAAMA;gBACNI,SAASA;gBACTwF,SAAS,IAAM/E,WAAW;iBAE1B;;;AAGV;AACAhB,sBAAsBgG,WAAW,GAAG;AAEpC,eAAehG,sBAAqB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AglynPostalAddress } from '@aglyn/aglyn';
|
|
2
|
+
/** A postal address as a form holds it: every field a string, none absent. */
|
|
3
|
+
export interface AddressDraft {
|
|
4
|
+
line1: string;
|
|
5
|
+
line2: string;
|
|
6
|
+
city: string;
|
|
7
|
+
state: string;
|
|
8
|
+
postalCode: string;
|
|
9
|
+
country: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const EMPTY_ADDRESS: AddressDraft;
|
|
12
|
+
/** The stored address, or none, as a draft the fields can edit. */
|
|
13
|
+
export declare function addressDraftFrom(address: AglynPostalAddress | null | undefined): AddressDraft;
|
|
14
|
+
export interface ContactAddressFieldsProps {
|
|
15
|
+
value: AddressDraft;
|
|
16
|
+
onChange: (next: AddressDraft) => void;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The six fields of `AglynPostalAddress`, as one block (AGL-2596).
|
|
21
|
+
*
|
|
22
|
+
* Shared by the create drawer and the record page so a person's address is
|
|
23
|
+
* typed the same way in both, and normalized by `normalizeAddress` at the
|
|
24
|
+
* one place each of them writes — which is what drops a blank address
|
|
25
|
+
* rather than storing six empty strings, and upper-cases the country so
|
|
26
|
+
* the stored value is the alpha-2 code every validator expects.
|
|
27
|
+
*/
|
|
28
|
+
export declare function ContactAddressFields(props: ContactAddressFieldsProps): import("react").JSX.Element;
|
|
29
|
+
export default ContactAddressFields;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ 'use client';
|
|
17
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
import { Grid, TextField } from "@mui/material";
|
|
20
|
+
export const EMPTY_ADDRESS = {
|
|
21
|
+
line1: '',
|
|
22
|
+
line2: '',
|
|
23
|
+
city: '',
|
|
24
|
+
state: '',
|
|
25
|
+
postalCode: '',
|
|
26
|
+
country: ''
|
|
27
|
+
};
|
|
28
|
+
/** The stored address, or none, as a draft the fields can edit. */ export function addressDraftFrom(address) {
|
|
29
|
+
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
|
|
30
|
+
return {
|
|
31
|
+
line1: (_ref = address == null ? void 0 : address.line1) != null ? _ref : '',
|
|
32
|
+
line2: (_ref1 = address == null ? void 0 : address.line2) != null ? _ref1 : '',
|
|
33
|
+
city: (_ref2 = address == null ? void 0 : address.city) != null ? _ref2 : '',
|
|
34
|
+
state: (_ref3 = address == null ? void 0 : address.state) != null ? _ref3 : '',
|
|
35
|
+
postalCode: (_ref4 = address == null ? void 0 : address.postalCode) != null ? _ref4 : '',
|
|
36
|
+
country: (_ref5 = address == null ? void 0 : address.country) != null ? _ref5 : ''
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The six fields of `AglynPostalAddress`, as one block (AGL-2596).
|
|
41
|
+
*
|
|
42
|
+
* Shared by the create drawer and the record page so a person's address is
|
|
43
|
+
* typed the same way in both, and normalized by `normalizeAddress` at the
|
|
44
|
+
* one place each of them writes — which is what drops a blank address
|
|
45
|
+
* rather than storing six empty strings, and upper-cases the country so
|
|
46
|
+
* the stored value is the alpha-2 code every validator expects.
|
|
47
|
+
*/ export function ContactAddressFields(props) {
|
|
48
|
+
const { value, onChange, disabled } = props;
|
|
49
|
+
const field = (key)=>(event)=>onChange(_extends({}, value, {
|
|
50
|
+
[key]: event.target.value
|
|
51
|
+
}));
|
|
52
|
+
return /*#__PURE__*/ _jsxs(Grid, {
|
|
53
|
+
container: true,
|
|
54
|
+
spacing: 2,
|
|
55
|
+
children: [
|
|
56
|
+
/*#__PURE__*/ _jsx(Grid, {
|
|
57
|
+
size: {
|
|
58
|
+
xs: 12
|
|
59
|
+
},
|
|
60
|
+
children: /*#__PURE__*/ _jsx(TextField, {
|
|
61
|
+
size: "small",
|
|
62
|
+
label: "Address line 1",
|
|
63
|
+
value: value.line1,
|
|
64
|
+
onChange: field('line1'),
|
|
65
|
+
disabled: disabled,
|
|
66
|
+
fullWidth: true
|
|
67
|
+
})
|
|
68
|
+
}),
|
|
69
|
+
/*#__PURE__*/ _jsx(Grid, {
|
|
70
|
+
size: {
|
|
71
|
+
xs: 12
|
|
72
|
+
},
|
|
73
|
+
children: /*#__PURE__*/ _jsx(TextField, {
|
|
74
|
+
size: "small",
|
|
75
|
+
label: "Address line 2",
|
|
76
|
+
value: value.line2,
|
|
77
|
+
onChange: field('line2'),
|
|
78
|
+
disabled: disabled,
|
|
79
|
+
fullWidth: true
|
|
80
|
+
})
|
|
81
|
+
}),
|
|
82
|
+
/*#__PURE__*/ _jsx(Grid, {
|
|
83
|
+
size: {
|
|
84
|
+
xs: 12,
|
|
85
|
+
sm: 6
|
|
86
|
+
},
|
|
87
|
+
children: /*#__PURE__*/ _jsx(TextField, {
|
|
88
|
+
size: "small",
|
|
89
|
+
label: "City",
|
|
90
|
+
value: value.city,
|
|
91
|
+
onChange: field('city'),
|
|
92
|
+
disabled: disabled,
|
|
93
|
+
fullWidth: true
|
|
94
|
+
})
|
|
95
|
+
}),
|
|
96
|
+
/*#__PURE__*/ _jsx(Grid, {
|
|
97
|
+
size: {
|
|
98
|
+
xs: 12,
|
|
99
|
+
sm: 6
|
|
100
|
+
},
|
|
101
|
+
children: /*#__PURE__*/ _jsx(TextField, {
|
|
102
|
+
size: "small",
|
|
103
|
+
label: "State or region",
|
|
104
|
+
value: value.state,
|
|
105
|
+
onChange: field('state'),
|
|
106
|
+
disabled: disabled,
|
|
107
|
+
fullWidth: true
|
|
108
|
+
})
|
|
109
|
+
}),
|
|
110
|
+
/*#__PURE__*/ _jsx(Grid, {
|
|
111
|
+
size: {
|
|
112
|
+
xs: 12,
|
|
113
|
+
sm: 6
|
|
114
|
+
},
|
|
115
|
+
children: /*#__PURE__*/ _jsx(TextField, {
|
|
116
|
+
size: "small",
|
|
117
|
+
label: "Postal code",
|
|
118
|
+
value: value.postalCode,
|
|
119
|
+
onChange: field('postalCode'),
|
|
120
|
+
disabled: disabled,
|
|
121
|
+
fullWidth: true
|
|
122
|
+
})
|
|
123
|
+
}),
|
|
124
|
+
/*#__PURE__*/ _jsx(Grid, {
|
|
125
|
+
size: {
|
|
126
|
+
xs: 12,
|
|
127
|
+
sm: 6
|
|
128
|
+
},
|
|
129
|
+
children: /*#__PURE__*/ _jsx(TextField, {
|
|
130
|
+
size: "small",
|
|
131
|
+
label: "Country",
|
|
132
|
+
value: value.country,
|
|
133
|
+
onChange: field('country'),
|
|
134
|
+
disabled: disabled,
|
|
135
|
+
helperText: "Two-letter code, like US or GB",
|
|
136
|
+
slotProps: {
|
|
137
|
+
htmlInput: {
|
|
138
|
+
maxLength: 2
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
fullWidth: true
|
|
142
|
+
})
|
|
143
|
+
})
|
|
144
|
+
]
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
export default ContactAddressFields;
|
|
148
|
+
|
|
149
|
+
//# sourceMappingURL=contact-address-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/contact-address-fields.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport type { AglynPostalAddress } from '@aglyn/aglyn'\nimport { Grid, TextField } from '@mui/material'\n\n/** A postal address as a form holds it: every field a string, none absent. */\nexport interface AddressDraft {\n line1: string\n line2: string\n city: string\n state: string\n postalCode: string\n country: string\n}\n\nexport const EMPTY_ADDRESS: AddressDraft = {\n line1: '',\n line2: '',\n city: '',\n state: '',\n postalCode: '',\n country: '',\n}\n\n/** The stored address, or none, as a draft the fields can edit. */\nexport function addressDraftFrom(\n address: AglynPostalAddress | null | undefined,\n): AddressDraft {\n return {\n line1: address?.line1 ?? '',\n line2: address?.line2 ?? '',\n city: address?.city ?? '',\n state: address?.state ?? '',\n postalCode: address?.postalCode ?? '',\n country: address?.country ?? '',\n }\n}\n\nexport interface ContactAddressFieldsProps {\n value: AddressDraft\n onChange: (next: AddressDraft) => void\n disabled?: boolean\n}\n\n/**\n * The six fields of `AglynPostalAddress`, as one block (AGL-2596).\n *\n * Shared by the create drawer and the record page so a person's address is\n * typed the same way in both, and normalized by `normalizeAddress` at the\n * one place each of them writes — which is what drops a blank address\n * rather than storing six empty strings, and upper-cases the country so\n * the stored value is the alpha-2 code every validator expects.\n */\nexport function ContactAddressFields(props: ContactAddressFieldsProps) {\n const { value, onChange, disabled } = props\n const field =\n (key: keyof AddressDraft) =>\n (event: { target: { value: string } }) =>\n onChange({ ...value, [key]: event.target.value })\n return (\n <Grid container spacing={2}>\n <Grid size={{ xs: 12 }}>\n <TextField\n size=\"small\"\n label=\"Address line 1\"\n value={value.line1}\n onChange={field('line1')}\n disabled={disabled}\n fullWidth\n />\n </Grid>\n <Grid size={{ xs: 12 }}>\n <TextField\n size=\"small\"\n label=\"Address line 2\"\n value={value.line2}\n onChange={field('line2')}\n disabled={disabled}\n fullWidth\n />\n </Grid>\n <Grid size={{ xs: 12, sm: 6 }}>\n <TextField\n size=\"small\"\n label=\"City\"\n value={value.city}\n onChange={field('city')}\n disabled={disabled}\n fullWidth\n />\n </Grid>\n <Grid size={{ xs: 12, sm: 6 }}>\n <TextField\n size=\"small\"\n label=\"State or region\"\n value={value.state}\n onChange={field('state')}\n disabled={disabled}\n fullWidth\n />\n </Grid>\n <Grid size={{ xs: 12, sm: 6 }}>\n <TextField\n size=\"small\"\n label=\"Postal code\"\n value={value.postalCode}\n onChange={field('postalCode')}\n disabled={disabled}\n fullWidth\n />\n </Grid>\n <Grid size={{ xs: 12, sm: 6 }}>\n <TextField\n size=\"small\"\n label=\"Country\"\n value={value.country}\n onChange={field('country')}\n disabled={disabled}\n helperText=\"Two-letter code, like US or GB\"\n slotProps={{ htmlInput: { maxLength: 2 } }}\n fullWidth\n />\n </Grid>\n </Grid>\n )\n}\n\nexport default ContactAddressFields\n"],"names":["Grid","TextField","EMPTY_ADDRESS","line1","line2","city","state","postalCode","country","addressDraftFrom","address","ContactAddressFields","props","value","onChange","disabled","field","key","event","target","container","spacing","size","xs","label","fullWidth","sm","helperText","slotProps","htmlInput","maxLength"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAGA,SAASA,IAAI,EAAEC,SAAS,QAAQ,gBAAe;AAY/C,OAAO,MAAMC,gBAA8B;IACzCC,OAAO;IACPC,OAAO;IACPC,MAAM;IACNC,OAAO;IACPC,YAAY;IACZC,SAAS;AACX,EAAC;AAED,iEAAiE,GACjE,OAAO,SAASC,iBACdC,OAA8C;;IAE9C,OAAO;QACLP,KAAK,UAAEO,2BAAAA,QAASP,KAAK,mBAAI;QACzBC,KAAK,WAAEM,2BAAAA,QAASN,KAAK,oBAAI;QACzBC,IAAI,WAAEK,2BAAAA,QAASL,IAAI,oBAAI;QACvBC,KAAK,WAAEI,2BAAAA,QAASJ,KAAK,oBAAI;QACzBC,UAAU,WAAEG,2BAAAA,QAASH,UAAU,oBAAI;QACnCC,OAAO,WAAEE,2BAAAA,QAASF,OAAO,oBAAI;IAC/B;AACF;AAQA;;;;;;;;CAQC,GACD,OAAO,SAASG,qBAAqBC,KAAgC;IACnE,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,QAAQ,EAAE,GAAGH;IACtC,MAAMI,QACJ,CAACC,MACD,CAACC,QACCJ,SAAS,aAAKD;gBAAO,CAACI,IAAI,EAAEC,MAAMC,MAAM,CAACN,KAAK;;IAClD,qBACE,MAACb;QAAKoB,SAAS;QAACC,SAAS;;0BACvB,KAACrB;gBAAKsB,MAAM;oBAAEC,IAAI;gBAAG;0BACnB,cAAA,KAACtB;oBACCqB,MAAK;oBACLE,OAAM;oBACNX,OAAOA,MAAMV,KAAK;oBAClBW,UAAUE,MAAM;oBAChBD,UAAUA;oBACVU,SAAS;;;0BAGb,KAACzB;gBAAKsB,MAAM;oBAAEC,IAAI;gBAAG;0BACnB,cAAA,KAACtB;oBACCqB,MAAK;oBACLE,OAAM;oBACNX,OAAOA,MAAMT,KAAK;oBAClBU,UAAUE,MAAM;oBAChBD,UAAUA;oBACVU,SAAS;;;0BAGb,KAACzB;gBAAKsB,MAAM;oBAAEC,IAAI;oBAAIG,IAAI;gBAAE;0BAC1B,cAAA,KAACzB;oBACCqB,MAAK;oBACLE,OAAM;oBACNX,OAAOA,MAAMR,IAAI;oBACjBS,UAAUE,MAAM;oBAChBD,UAAUA;oBACVU,SAAS;;;0BAGb,KAACzB;gBAAKsB,MAAM;oBAAEC,IAAI;oBAAIG,IAAI;gBAAE;0BAC1B,cAAA,KAACzB;oBACCqB,MAAK;oBACLE,OAAM;oBACNX,OAAOA,MAAMP,KAAK;oBAClBQ,UAAUE,MAAM;oBAChBD,UAAUA;oBACVU,SAAS;;;0BAGb,KAACzB;gBAAKsB,MAAM;oBAAEC,IAAI;oBAAIG,IAAI;gBAAE;0BAC1B,cAAA,KAACzB;oBACCqB,MAAK;oBACLE,OAAM;oBACNX,OAAOA,MAAMN,UAAU;oBACvBO,UAAUE,MAAM;oBAChBD,UAAUA;oBACVU,SAAS;;;0BAGb,KAACzB;gBAAKsB,MAAM;oBAAEC,IAAI;oBAAIG,IAAI;gBAAE;0BAC1B,cAAA,KAACzB;oBACCqB,MAAK;oBACLE,OAAM;oBACNX,OAAOA,MAAML,OAAO;oBACpBM,UAAUE,MAAM;oBAChBD,UAAUA;oBACVY,YAAW;oBACXC,WAAW;wBAAEC,WAAW;4BAAEC,WAAW;wBAAE;oBAAE;oBACzCL,SAAS;;;;;AAKnB;AAEA,eAAed,qBAAoB"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type ConsentGroup } from '@aglyn/aglyn';
|
|
2
|
+
import type { ContactRecord } from '../model/contact-record';
|
|
3
|
+
export interface ContactAssociationsCardProps {
|
|
4
|
+
/**
|
|
5
|
+
* The site whose lead, campaigns and attribution are shown — the mounted
|
|
6
|
+
* site, or at the organization level the holder's own; `null` for a row
|
|
7
|
+
* no site has captured, when none of the three has an address.
|
|
8
|
+
*/
|
|
9
|
+
hostId: string | null;
|
|
10
|
+
/** The row, flattened through the viewing group's facet. */
|
|
11
|
+
record: ContactRecord;
|
|
12
|
+
/** The document as read, for the consent fields the projection leaves out. */
|
|
13
|
+
row: Record<string, unknown>;
|
|
14
|
+
consentGroup: ConsentGroup;
|
|
15
|
+
/** The listener's verdict on the row, for the stale-seed guard. */
|
|
16
|
+
seed: {
|
|
17
|
+
status: 'loading' | 'success' | 'error';
|
|
18
|
+
fromCache: boolean;
|
|
19
|
+
};
|
|
20
|
+
/** The hub's own path, for the link to this person's lead. */
|
|
21
|
+
basePath: string;
|
|
22
|
+
/**
|
|
23
|
+
* The site's Bookings page narrowed to this person's address (AGL-2660),
|
|
24
|
+
* or nothing where the site has no booking door — the page decides, and
|
|
25
|
+
* the row is simply not drawn.
|
|
26
|
+
*/
|
|
27
|
+
bookingsHref?: string | null;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* WHERE THIS PERSON CAME FROM AND WHAT THEY ARE FILED UNDER (AGL-2596).
|
|
31
|
+
*
|
|
32
|
+
* Four facts that were in the v1 drawer and are not properties of the
|
|
33
|
+
* person so much as of the RELATIONSHIP:
|
|
34
|
+
*
|
|
35
|
+
* - The SOURCES say which mechanism created the record — a form, a
|
|
36
|
+
* checkout, an import.
|
|
37
|
+
* - The ATTRIBUTION says which campaign led to it, recorded from the link
|
|
38
|
+
* they followed and never editable. One keyed read, paid on opening the
|
|
39
|
+
* page rather than per row of the list.
|
|
40
|
+
* - The CONSENT is the basis this controller holds for marketing email:
|
|
41
|
+
* opted in, opted out, or no record — three states that never collapse
|
|
42
|
+
* into two, because "no record" is the commonest and is not a refusal.
|
|
43
|
+
* - The FILING is which campaigns the team has PUT them in, a working set
|
|
44
|
+
* kept by hand. It adds nobody to a send: a campaign's audience is its
|
|
45
|
+
* lists and each email's own picker, and the helper says so where a
|
|
46
|
+
* reader would otherwise assume the opposite.
|
|
47
|
+
*
|
|
48
|
+
* The filing is the one editable thing here and has its own Save, through
|
|
49
|
+
* the same stale-seed guard the properties card uses: a campaign membership
|
|
50
|
+
* written over a cached read could revert somebody else's filing. The save
|
|
51
|
+
* goes to `crm/contact-update` (AGL-2804), because the filing is this
|
|
52
|
+
* holder's facet and a facet is the server's to write; like every field that
|
|
53
|
+
* route writes, it is refused to a plan without the CRM (AGL-2851).
|
|
54
|
+
*
|
|
55
|
+
* ## The lead (AGL-2612)
|
|
56
|
+
*
|
|
57
|
+
* A LEAD is the sales record a lead surface — a sign-up, a booking, a form
|
|
58
|
+
* with lead routing — files beside the contact, under the capturing site at
|
|
59
|
+
* `hosts/{hostId}/leads/{personKey}`. The lead's page links the contact
|
|
60
|
+
* once converted; nothing linked back, so the two halves of one person
|
|
61
|
+
* read as unrelated. One `getDoc` by the key the capture derives — the
|
|
62
|
+
* address, normalized and hashed, computed here on WebCrypto — is what
|
|
63
|
+
* answers "does this site hold a lead for this person", and it is a read
|
|
64
|
+
* this page pays because opening the record IS the ask. Absence is a fact
|
|
65
|
+
* too: a contact captured by an order or an import has no lead, and the
|
|
66
|
+
* chip is simply not there.
|
|
67
|
+
*/
|
|
68
|
+
export declare function ContactAssociationsCard(props: ContactAssociationsCardProps): import("react").JSX.Element;
|
|
69
|
+
export declare namespace ContactAssociationsCard {
|
|
70
|
+
var displayName: string;
|
|
71
|
+
}
|
|
72
|
+
export default ContactAssociationsCard;
|