@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,296 @@
|
|
|
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 * as Aglyn from "@aglyn/aglyn";
|
|
20
|
+
import { CONTACT_SOURCE_LABELS, MARKETING_BASIS_LABELS, readMarketingBasis } from "@aglyn/aglyn";
|
|
21
|
+
import { personKeyInBrowser } from "../model/person-key-web.js";
|
|
22
|
+
/*
|
|
23
|
+
* The component path and NOT the marketing barrel: that barrel is the entry
|
|
24
|
+
* point the tenant's loader imports to activate the plugin's SITE half, so a
|
|
25
|
+
* console card named there ships to every published page.
|
|
26
|
+
*/ import { CrmRecordAttributionZone } from "./crm-attribution-zone.js";
|
|
27
|
+
import CampaignPicker from "@aglyn/shared-ui-email-campaigns/components/campaign-picker.component";
|
|
28
|
+
import { AppLink, CardDisplay } from "@aglyn/shared-ui-jsx";
|
|
29
|
+
import { useSnackbar } from "@aglyn/shared-ui-snackstack";
|
|
30
|
+
import { useFirestore, useHostCampaigns, writeGuardedBySeed } from "@aglyn/tenant-feature-instance";
|
|
31
|
+
import { Button, Chip, Divider, Stack, Typography } from "@mui/material";
|
|
32
|
+
import { doc, getDoc } from "firebase/firestore";
|
|
33
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
34
|
+
import { useContactUpdate } from "../hooks/use-contact-update.js";
|
|
35
|
+
import { crmRoutes } from "../model/crm-routes.js";
|
|
36
|
+
/**
|
|
37
|
+
* WHERE THIS PERSON CAME FROM AND WHAT THEY ARE FILED UNDER (AGL-2596).
|
|
38
|
+
*
|
|
39
|
+
* Four facts that were in the v1 drawer and are not properties of the
|
|
40
|
+
* person so much as of the RELATIONSHIP:
|
|
41
|
+
*
|
|
42
|
+
* - The SOURCES say which mechanism created the record — a form, a
|
|
43
|
+
* checkout, an import.
|
|
44
|
+
* - The ATTRIBUTION says which campaign led to it, recorded from the link
|
|
45
|
+
* they followed and never editable. One keyed read, paid on opening the
|
|
46
|
+
* page rather than per row of the list.
|
|
47
|
+
* - The CONSENT is the basis this controller holds for marketing email:
|
|
48
|
+
* opted in, opted out, or no record — three states that never collapse
|
|
49
|
+
* into two, because "no record" is the commonest and is not a refusal.
|
|
50
|
+
* - The FILING is which campaigns the team has PUT them in, a working set
|
|
51
|
+
* kept by hand. It adds nobody to a send: a campaign's audience is its
|
|
52
|
+
* lists and each email's own picker, and the helper says so where a
|
|
53
|
+
* reader would otherwise assume the opposite.
|
|
54
|
+
*
|
|
55
|
+
* The filing is the one editable thing here and has its own Save, through
|
|
56
|
+
* the same stale-seed guard the properties card uses: a campaign membership
|
|
57
|
+
* written over a cached read could revert somebody else's filing. The save
|
|
58
|
+
* goes to `crm/contact-update` (AGL-2804), because the filing is this
|
|
59
|
+
* holder's facet and a facet is the server's to write; like every field that
|
|
60
|
+
* route writes, it is refused to a plan without the CRM (AGL-2851).
|
|
61
|
+
*
|
|
62
|
+
* ## The lead (AGL-2612)
|
|
63
|
+
*
|
|
64
|
+
* A LEAD is the sales record a lead surface — a sign-up, a booking, a form
|
|
65
|
+
* with lead routing — files beside the contact, under the capturing site at
|
|
66
|
+
* `hosts/{hostId}/leads/{personKey}`. The lead's page links the contact
|
|
67
|
+
* once converted; nothing linked back, so the two halves of one person
|
|
68
|
+
* read as unrelated. One `getDoc` by the key the capture derives — the
|
|
69
|
+
* address, normalized and hashed, computed here on WebCrypto — is what
|
|
70
|
+
* answers "does this site hold a lead for this person", and it is a read
|
|
71
|
+
* this page pays because opening the record IS the ask. Absence is a fact
|
|
72
|
+
* too: a contact captured by an order or an import has no lead, and the
|
|
73
|
+
* chip is simply not there.
|
|
74
|
+
*/ export function ContactAssociationsCard(props) {
|
|
75
|
+
var _record_sources;
|
|
76
|
+
const { hostId, record, row, consentGroup, seed, basePath, bookingsHref } = props;
|
|
77
|
+
const firestore = useFirestore();
|
|
78
|
+
const { enqueueSnackbar } = useSnackbar();
|
|
79
|
+
const contactUpdate = useContactUpdate(hostId);
|
|
80
|
+
const routes = crmRoutes(basePath);
|
|
81
|
+
const [leadKey, setLeadKey] = useState(null);
|
|
82
|
+
const email = record.email;
|
|
83
|
+
useEffect(()=>{
|
|
84
|
+
let active = true;
|
|
85
|
+
setLeadKey(null);
|
|
86
|
+
if (!hostId) return undefined;
|
|
87
|
+
void (async ()=>{
|
|
88
|
+
const key = await personKeyInBrowser(email);
|
|
89
|
+
if (!key || !active) return;
|
|
90
|
+
const snapshot = await getDoc(doc(firestore, 'hosts', hostId, 'leads', key)).catch(()=>null);
|
|
91
|
+
if (active && (snapshot == null ? void 0 : snapshot.exists())) setLeadKey(key);
|
|
92
|
+
})().catch(()=>undefined);
|
|
93
|
+
return ()=>{
|
|
94
|
+
active = false;
|
|
95
|
+
};
|
|
96
|
+
}, [
|
|
97
|
+
firestore,
|
|
98
|
+
hostId,
|
|
99
|
+
email
|
|
100
|
+
]);
|
|
101
|
+
const [campaigns, setCampaigns] = useState(record.campaignIds);
|
|
102
|
+
const [saving, setSaving] = useState(false);
|
|
103
|
+
const recordId = record.$id;
|
|
104
|
+
useEffect(()=>{
|
|
105
|
+
setCampaigns(record.campaignIds);
|
|
106
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
107
|
+
}, [
|
|
108
|
+
recordId
|
|
109
|
+
]);
|
|
110
|
+
/*
|
|
111
|
+
* The site's campaigns, read because this page IS the ask: one picker on
|
|
112
|
+
* one record, and nothing in the list ever paid for the campaign list.
|
|
113
|
+
*/ const siteCampaigns = useHostCampaigns(hostId != null ? hostId : undefined, {
|
|
114
|
+
enabled: Boolean(hostId)
|
|
115
|
+
});
|
|
116
|
+
const consent = useMemo(()=>readMarketingBasis(row, consentGroup), [
|
|
117
|
+
row,
|
|
118
|
+
consentGroup
|
|
119
|
+
]);
|
|
120
|
+
const handleSaveFiling = useCallback(async ()=>{
|
|
121
|
+
setSaving(true);
|
|
122
|
+
try {
|
|
123
|
+
const verdict = await writeGuardedBySeed({
|
|
124
|
+
subject: 'contact',
|
|
125
|
+
unreadable: seed.status === 'error',
|
|
126
|
+
fromCache: seed.fromCache
|
|
127
|
+
}, // An empty selection is sent as an empty list rather than left out,
|
|
128
|
+
// so "filed under no campaign" has one shape here and in the pass
|
|
129
|
+
// that detaches a deleted campaign.
|
|
130
|
+
()=>contactUpdate.updateOne(record.$id, {
|
|
131
|
+
campaignIds: Aglyn.campaignMembershipValue(campaigns)
|
|
132
|
+
}));
|
|
133
|
+
if (!verdict.ok) {
|
|
134
|
+
return void enqueueSnackbar(verdict.message, {
|
|
135
|
+
variant: 'warning',
|
|
136
|
+
persist: false
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
enqueueSnackbar('Filing saved', {
|
|
140
|
+
variant: 'success',
|
|
141
|
+
persist: false
|
|
142
|
+
});
|
|
143
|
+
} catch (error) {
|
|
144
|
+
console.error(error);
|
|
145
|
+
enqueueSnackbar(error instanceof Error && error.message ? error.message : 'An error has occurred', {
|
|
146
|
+
variant: 'error',
|
|
147
|
+
allowDuplicate: true
|
|
148
|
+
});
|
|
149
|
+
} finally{
|
|
150
|
+
setSaving(false);
|
|
151
|
+
}
|
|
152
|
+
}, [
|
|
153
|
+
campaigns,
|
|
154
|
+
contactUpdate,
|
|
155
|
+
enqueueSnackbar,
|
|
156
|
+
record.$id,
|
|
157
|
+
seed.fromCache,
|
|
158
|
+
seed.status
|
|
159
|
+
]);
|
|
160
|
+
const sources = Object.keys((_record_sources = record.sources) != null ? _record_sources : {});
|
|
161
|
+
const consentDetail = [
|
|
162
|
+
consent.basisAtMs ? `recorded ${new Date(consent.basisAtMs).toLocaleDateString()}` : null,
|
|
163
|
+
consent.assertedBy === 'operator' ? 'entered by your team' : null,
|
|
164
|
+
consent.otherGrant === 'other-host' ? 'opted in to another site in this workspace' : null
|
|
165
|
+
].filter(Boolean);
|
|
166
|
+
return /*#__PURE__*/ _jsx(CardDisplay, {
|
|
167
|
+
header: 'Relationship',
|
|
168
|
+
help: Aglyn.pluginDocsHelp('contactRecord', {
|
|
169
|
+
anchor: '#what-each-site-keeps-to-itself'
|
|
170
|
+
}),
|
|
171
|
+
contentGutterX: true,
|
|
172
|
+
contentGutterY: true,
|
|
173
|
+
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
174
|
+
spacing: 2,
|
|
175
|
+
children: [
|
|
176
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
177
|
+
spacing: 0.5,
|
|
178
|
+
children: [
|
|
179
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
180
|
+
variant: "subtitle2",
|
|
181
|
+
children: 'Sources'
|
|
182
|
+
}),
|
|
183
|
+
sources.length || leadKey ? /*#__PURE__*/ _jsxs(Stack, {
|
|
184
|
+
direction: "row",
|
|
185
|
+
spacing: 0.5,
|
|
186
|
+
sx: {
|
|
187
|
+
flexWrap: 'wrap',
|
|
188
|
+
rowGap: 0.5
|
|
189
|
+
},
|
|
190
|
+
children: [
|
|
191
|
+
sources.map((source)=>{
|
|
192
|
+
var _CONTACT_SOURCE_LABELS_source;
|
|
193
|
+
return /*#__PURE__*/ _jsx(Chip, {
|
|
194
|
+
label: (_CONTACT_SOURCE_LABELS_source = CONTACT_SOURCE_LABELS[source]) != null ? _CONTACT_SOURCE_LABELS_source : source,
|
|
195
|
+
size: "small"
|
|
196
|
+
}, source);
|
|
197
|
+
}),
|
|
198
|
+
leadKey ? /*#__PURE__*/ _jsx(Button, _extends({
|
|
199
|
+
component: AppLink
|
|
200
|
+
}, {
|
|
201
|
+
componentVariant: 'naked',
|
|
202
|
+
nativeButton: false
|
|
203
|
+
}, {
|
|
204
|
+
href: routes.lead(leadKey),
|
|
205
|
+
size: "small",
|
|
206
|
+
variant: "outlined",
|
|
207
|
+
sx: {
|
|
208
|
+
py: 0,
|
|
209
|
+
minHeight: 24,
|
|
210
|
+
lineHeight: 1.5
|
|
211
|
+
},
|
|
212
|
+
children: 'Lead on this site'
|
|
213
|
+
})) : null
|
|
214
|
+
]
|
|
215
|
+
}) : /*#__PURE__*/ _jsx(Typography, {
|
|
216
|
+
variant: "body2",
|
|
217
|
+
color: "text.secondary",
|
|
218
|
+
children: 'No capture recorded.'
|
|
219
|
+
})
|
|
220
|
+
]
|
|
221
|
+
}),
|
|
222
|
+
bookingsHref ? /*#__PURE__*/ _jsxs(Stack, {
|
|
223
|
+
spacing: 0.5,
|
|
224
|
+
children: [
|
|
225
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
226
|
+
variant: "subtitle2",
|
|
227
|
+
children: 'Bookings'
|
|
228
|
+
}),
|
|
229
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
230
|
+
variant: "body2",
|
|
231
|
+
children: /*#__PURE__*/ _jsx(AppLink, {
|
|
232
|
+
href: bookingsHref,
|
|
233
|
+
children: 'Bookings on this site'
|
|
234
|
+
})
|
|
235
|
+
}),
|
|
236
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
237
|
+
variant: "caption",
|
|
238
|
+
color: "text.secondary",
|
|
239
|
+
children: 'Every booking made with this address, upcoming and past.'
|
|
240
|
+
})
|
|
241
|
+
]
|
|
242
|
+
}) : null,
|
|
243
|
+
hostId ? /*#__PURE__*/ _jsx(CrmRecordAttributionZone, {
|
|
244
|
+
hostId: hostId,
|
|
245
|
+
recordKind: "contact",
|
|
246
|
+
recordId: record.$id
|
|
247
|
+
}) : null,
|
|
248
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
249
|
+
spacing: 0.5,
|
|
250
|
+
children: [
|
|
251
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
252
|
+
variant: "subtitle2",
|
|
253
|
+
children: 'Marketing email'
|
|
254
|
+
}),
|
|
255
|
+
/*#__PURE__*/ _jsxs(Typography, {
|
|
256
|
+
variant: "body2",
|
|
257
|
+
children: [
|
|
258
|
+
MARKETING_BASIS_LABELS[consent.basis],
|
|
259
|
+
consentDetail.length ? ` · ${consentDetail.join(' · ')}` : ''
|
|
260
|
+
]
|
|
261
|
+
}),
|
|
262
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
263
|
+
variant: "caption",
|
|
264
|
+
color: "text.secondary",
|
|
265
|
+
children: consent.basis === 'unrecorded' ? 'Nothing was recorded either way — not a refusal, and not permission.' : `The basis this ${consentGroup.declared ? 'group' : 'site'} holds. Other sites in the workspace keep their own.`
|
|
266
|
+
})
|
|
267
|
+
]
|
|
268
|
+
}),
|
|
269
|
+
/*#__PURE__*/ _jsx(Divider, {}),
|
|
270
|
+
/*#__PURE__*/ _jsx(CampaignPicker, {
|
|
271
|
+
options: siteCampaigns.options,
|
|
272
|
+
value: campaigns,
|
|
273
|
+
onChange: setCampaigns,
|
|
274
|
+
label: "Filed under campaigns",
|
|
275
|
+
helperText: "Your own filing. It never adds anyone to a send — a campaign mails its lists.",
|
|
276
|
+
empty: siteCampaigns.ready && !siteCampaigns.options.length,
|
|
277
|
+
emptyText: "This site has no campaigns yet."
|
|
278
|
+
}),
|
|
279
|
+
/*#__PURE__*/ _jsx(Stack, {
|
|
280
|
+
direction: "row",
|
|
281
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
282
|
+
size: "small",
|
|
283
|
+
variant: "outlined",
|
|
284
|
+
disabled: saving || siteCampaigns.ready && !siteCampaigns.options.length,
|
|
285
|
+
onClick: ()=>void handleSaveFiling(),
|
|
286
|
+
children: saving ? 'Saving…' : 'Save filing'
|
|
287
|
+
})
|
|
288
|
+
})
|
|
289
|
+
]
|
|
290
|
+
})
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
ContactAssociationsCard.displayName = 'ContactAssociationsCard';
|
|
294
|
+
export default ContactAssociationsCard;
|
|
295
|
+
|
|
296
|
+
//# sourceMappingURL=contact-associations-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/contact-associations-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 * as Aglyn from '@aglyn/aglyn'\nimport {\n CONTACT_SOURCE_LABELS,\n type ConsentGroup,\n type ContactSource,\n MARKETING_BASIS_LABELS,\n readMarketingBasis,\n} from '@aglyn/aglyn'\nimport { personKeyInBrowser } from '../model/person-key-web'\n/*\n * The component path and NOT the marketing barrel: that barrel is the entry\n * point the tenant's loader imports to activate the plugin's SITE half, so a\n * console card named there ships to every published page.\n */\nimport { CrmRecordAttributionZone } from './crm-attribution-zone'\nimport CampaignPicker from '@aglyn/shared-ui-email-campaigns/components/campaign-picker.component'\nimport { AppLink, CardDisplay } from '@aglyn/shared-ui-jsx'\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport {\n useFirestore,\n useHostCampaigns,\n writeGuardedBySeed,\n} from '@aglyn/tenant-feature-instance'\nimport { Button, Chip, Divider, Stack, Typography } from '@mui/material'\nimport { doc, getDoc } from 'firebase/firestore'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\nimport { useContactUpdate } from '../hooks/use-contact-update'\nimport type { ContactRecord } from '../model/contact-record'\nimport { crmRoutes } from '../model/crm-routes'\n\nexport interface ContactAssociationsCardProps {\n /**\n * The site whose lead, campaigns and attribution are shown — the mounted\n * site, or at the organization level the holder's own; `null` for a row\n * no site has captured, when none of the three has an address.\n */\n hostId: string | null\n /** The row, flattened through the viewing group's facet. */\n record: ContactRecord\n /** The document as read, for the consent fields the projection leaves out. */\n row: Record<string, unknown>\n consentGroup: ConsentGroup\n /** The listener's verdict on the row, for the stale-seed guard. */\n seed: { status: 'loading' | 'success' | 'error'; fromCache: boolean }\n /** The hub's own path, for the link to this person's lead. */\n basePath: string\n /**\n * The site's Bookings page narrowed to this person's address (AGL-2660),\n * or nothing where the site has no booking door — the page decides, and\n * the row is simply not drawn.\n */\n bookingsHref?: string | null\n}\n\n/**\n * WHERE THIS PERSON CAME FROM AND WHAT THEY ARE FILED UNDER (AGL-2596).\n *\n * Four facts that were in the v1 drawer and are not properties of the\n * person so much as of the RELATIONSHIP:\n *\n * - The SOURCES say which mechanism created the record — a form, a\n * checkout, an import.\n * - The ATTRIBUTION says which campaign led to it, recorded from the link\n * they followed and never editable. One keyed read, paid on opening the\n * page rather than per row of the list.\n * - The CONSENT is the basis this controller holds for marketing email:\n * opted in, opted out, or no record — three states that never collapse\n * into two, because \"no record\" is the commonest and is not a refusal.\n * - The FILING is which campaigns the team has PUT them in, a working set\n * kept by hand. It adds nobody to a send: a campaign's audience is its\n * lists and each email's own picker, and the helper says so where a\n * reader would otherwise assume the opposite.\n *\n * The filing is the one editable thing here and has its own Save, through\n * the same stale-seed guard the properties card uses: a campaign membership\n * written over a cached read could revert somebody else's filing. The save\n * goes to `crm/contact-update` (AGL-2804), because the filing is this\n * holder's facet and a facet is the server's to write; like every field that\n * route writes, it is refused to a plan without the CRM (AGL-2851).\n *\n * ## The lead (AGL-2612)\n *\n * A LEAD is the sales record a lead surface — a sign-up, a booking, a form\n * with lead routing — files beside the contact, under the capturing site at\n * `hosts/{hostId}/leads/{personKey}`. The lead's page links the contact\n * once converted; nothing linked back, so the two halves of one person\n * read as unrelated. One `getDoc` by the key the capture derives — the\n * address, normalized and hashed, computed here on WebCrypto — is what\n * answers \"does this site hold a lead for this person\", and it is a read\n * this page pays because opening the record IS the ask. Absence is a fact\n * too: a contact captured by an order or an import has no lead, and the\n * chip is simply not there.\n */\nexport function ContactAssociationsCard(props: ContactAssociationsCardProps) {\n const { hostId, record, row, consentGroup, seed, basePath, bookingsHref } = props\n const firestore = useFirestore()\n const { enqueueSnackbar } = useSnackbar()\n const contactUpdate = useContactUpdate(hostId)\n const routes = crmRoutes(basePath)\n\n const [leadKey, setLeadKey] = useState<string | null>(null)\n const email = record.email\n useEffect(() => {\n let active = true\n setLeadKey(null)\n if (!hostId) return undefined\n void (async () => {\n const key = await personKeyInBrowser(email)\n if (!key || !active) return\n const snapshot = await getDoc(\n doc(firestore, 'hosts', hostId, 'leads', key),\n ).catch(() => null)\n if (active && snapshot?.exists()) setLeadKey(key)\n })().catch(() => undefined)\n return () => {\n active = false\n }\n }, [firestore, hostId, email])\n\n const [campaigns, setCampaigns] = useState<string[]>(record.campaignIds)\n const [saving, setSaving] = useState(false)\n const recordId = record.$id\n useEffect(() => {\n setCampaigns(record.campaignIds)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [recordId])\n\n /*\n * The site's campaigns, read because this page IS the ask: one picker on\n * one record, and nothing in the list ever paid for the campaign list.\n */\n const siteCampaigns = useHostCampaigns(hostId ?? undefined, { enabled: Boolean(hostId) })\n\n const consent = useMemo(\n () => readMarketingBasis(row, consentGroup),\n [row, consentGroup],\n )\n\n const handleSaveFiling = useCallback(async () => {\n setSaving(true)\n try {\n const verdict = await writeGuardedBySeed(\n {\n subject: 'contact',\n unreadable: seed.status === 'error',\n fromCache: seed.fromCache,\n },\n // An empty selection is sent as an empty list rather than left out,\n // so \"filed under no campaign\" has one shape here and in the pass\n // that detaches a deleted campaign.\n () =>\n contactUpdate.updateOne(record.$id, {\n campaignIds: Aglyn.campaignMembershipValue(campaigns),\n }),\n )\n if (!verdict.ok) {\n return void enqueueSnackbar(verdict.message, {\n variant: 'warning',\n persist: false,\n })\n }\n enqueueSnackbar('Filing saved', { variant: 'success', persist: false })\n } catch (error) {\n console.error(error)\n enqueueSnackbar(\n error instanceof Error && error.message ? error.message : 'An error has occurred',\n { variant: 'error', allowDuplicate: true },\n )\n } finally {\n setSaving(false)\n }\n }, [campaigns, contactUpdate, enqueueSnackbar, record.$id, seed.fromCache, seed.status])\n\n const sources = Object.keys(record.sources ?? {}) as ContactSource[]\n const consentDetail = [\n consent.basisAtMs\n ? `recorded ${new Date(consent.basisAtMs).toLocaleDateString()}`\n : null,\n consent.assertedBy === 'operator' ? 'entered by your team' : null,\n consent.otherGrant === 'other-host'\n ? 'opted in to another site in this workspace'\n : null,\n ].filter(Boolean)\n\n return (\n <CardDisplay\n header={'Relationship'}\n help={Aglyn.pluginDocsHelp('contactRecord', { anchor: '#what-each-site-keeps-to-itself' })}\n contentGutterX\n contentGutterY\n >\n <Stack spacing={2}>\n <Stack spacing={0.5}>\n <Typography variant=\"subtitle2\">{'Sources'}</Typography>\n {sources.length || leadKey ? (\n <Stack direction=\"row\" spacing={0.5} sx={{ flexWrap: 'wrap', rowGap: 0.5 }}>\n {sources.map((source) => (\n <Chip\n key={source}\n label={CONTACT_SOURCE_LABELS[source] ?? source}\n size=\"small\"\n />\n ))}\n {/*\n This site's lead for the person, when it holds one — a link,\n in the shape the lead's page uses to point back here.\n */}\n {leadKey ? (\n <Button\n component={AppLink as any}\n {...({ componentVariant: 'naked', nativeButton: false } as any)}\n href={routes.lead(leadKey)}\n size=\"small\"\n variant=\"outlined\"\n sx={{ py: 0, minHeight: 24, lineHeight: 1.5 }}\n >\n {'Lead on this site'}\n </Button>\n ) : null}\n </Stack>\n ) : (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'No capture recorded.'}\n </Typography>\n )}\n </Stack>\n {/*\n The person's bookings on this site (AGL-2660): every booking\n taken with their address, past ones too, on the Bookings page —\n the appointments are that page's records, and this card only\n points at them.\n */}\n {bookingsHref ? (\n <Stack spacing={0.5}>\n <Typography variant=\"subtitle2\">{'Bookings'}</Typography>\n <Typography variant=\"body2\">\n <AppLink href={bookingsHref}>{'Bookings on this site'}</AppLink>\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'Every booking made with this address, upcoming and past.'}\n </Typography>\n </Stack>\n ) : null}\n {hostId ? (\n <CrmRecordAttributionZone\n hostId={hostId}\n recordKind=\"contact\"\n recordId={record.$id}\n />\n ) : null}\n <Stack spacing={0.5}>\n <Typography variant=\"subtitle2\">{'Marketing email'}</Typography>\n <Typography variant=\"body2\">\n {MARKETING_BASIS_LABELS[consent.basis]}\n {consentDetail.length ? ` · ${consentDetail.join(' · ')}` : ''}\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {consent.basis === 'unrecorded'\n ? 'Nothing was recorded either way — not a refusal, and not permission.'\n : `The basis this ${\n consentGroup.declared ? 'group' : 'site'\n } holds. Other sites in the workspace keep their own.`}\n </Typography>\n </Stack>\n <Divider />\n <CampaignPicker\n options={siteCampaigns.options}\n value={campaigns}\n onChange={setCampaigns}\n label=\"Filed under campaigns\"\n helperText=\"Your own filing. It never adds anyone to a send — a campaign mails its lists.\"\n empty={siteCampaigns.ready && !siteCampaigns.options.length}\n emptyText=\"This site has no campaigns yet.\"\n />\n <Stack direction=\"row\">\n <Button\n size=\"small\"\n variant=\"outlined\"\n disabled={saving || (siteCampaigns.ready && !siteCampaigns.options.length)}\n onClick={() => void handleSaveFiling()}\n >\n {saving ? 'Saving…' : 'Save filing'}\n </Button>\n </Stack>\n </Stack>\n </CardDisplay>\n )\n}\nContactAssociationsCard.displayName = 'ContactAssociationsCard'\n\nexport default ContactAssociationsCard\n"],"names":["Aglyn","CONTACT_SOURCE_LABELS","MARKETING_BASIS_LABELS","readMarketingBasis","personKeyInBrowser","CrmRecordAttributionZone","CampaignPicker","AppLink","CardDisplay","useSnackbar","useFirestore","useHostCampaigns","writeGuardedBySeed","Button","Chip","Divider","Stack","Typography","doc","getDoc","useCallback","useEffect","useMemo","useState","useContactUpdate","crmRoutes","ContactAssociationsCard","props","record","hostId","row","consentGroup","seed","basePath","bookingsHref","firestore","enqueueSnackbar","contactUpdate","routes","leadKey","setLeadKey","email","active","undefined","key","snapshot","catch","exists","campaigns","setCampaigns","campaignIds","saving","setSaving","recordId","$id","siteCampaigns","enabled","Boolean","consent","handleSaveFiling","verdict","subject","unreadable","status","fromCache","updateOne","campaignMembershipValue","ok","message","variant","persist","error","console","Error","allowDuplicate","sources","Object","keys","consentDetail","basisAtMs","Date","toLocaleDateString","assertedBy","otherGrant","filter","header","help","pluginDocsHelp","anchor","contentGutterX","contentGutterY","spacing","length","direction","sx","flexWrap","rowGap","map","source","label","size","component","componentVariant","nativeButton","href","lead","py","minHeight","lineHeight","color","recordKind","basis","join","declared","options","value","onChange","helperText","empty","ready","emptyText","disabled","onClick","displayName"],"mappings":"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"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ContactCustomValue, type ContactFieldDefinition } from '@aglyn/aglyn';
|
|
2
|
+
import type { GridColDef } from '@mui/x-data-grid';
|
|
3
|
+
/**
|
|
4
|
+
* The column `field` a definition's key is listed under — namespaced so a
|
|
5
|
+
* key can never collide with a built-in column, and the shared contract
|
|
6
|
+
* since AGL-2617 so a saved view's filter clause and its column list name
|
|
7
|
+
* the field the same way.
|
|
8
|
+
*/
|
|
9
|
+
export declare const customFieldColumnId: (key: string) => string;
|
|
10
|
+
/**
|
|
11
|
+
* One stored value, as the list shows it.
|
|
12
|
+
*
|
|
13
|
+
* A checkbox reads as Yes or an em dash rather than `true`/`false`; a date
|
|
14
|
+
* as the local day rather than the ISO stamp it is stored as; a link as an
|
|
15
|
+
* anchor. Everything else is the value itself, and nothing is `null` on
|
|
16
|
+
* screen — a cleared value and an absent one look the same, because to the
|
|
17
|
+
* reader of a list they are.
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatContactCustomValue(definition: Pick<ContactFieldDefinition, 'type'>, value: ContactCustomValue | undefined): string;
|
|
20
|
+
/**
|
|
21
|
+
* A CRM list's columns for the org's custom fields (AGL-2601), one per
|
|
22
|
+
* ACTIVE definition in `order` — the contacts list's, and since AGL-2661
|
|
23
|
+
* the companies list's and the deals table's, each handed the definitions
|
|
24
|
+
* of its own object.
|
|
25
|
+
*
|
|
26
|
+
* The value is read off `row.custom`: on a contact the list projects it
|
|
27
|
+
* from THIS holder's facet — the same projection that puts `tags` and
|
|
28
|
+
* `notes` on the row — so a column can never show another holder's value;
|
|
29
|
+
* on a company or a deal it is the document's own map. Sorting and
|
|
30
|
+
* filtering are off: the value lives under a map no index covers, and a
|
|
31
|
+
* column that sorted the loaded window would look like it sorted the
|
|
32
|
+
* collection.
|
|
33
|
+
*
|
|
34
|
+
* Retired definitions get no column. Their values are still on the rows,
|
|
35
|
+
* and an export can still read them; a column for a field the merchant
|
|
36
|
+
* retired would be the field refusing to go away.
|
|
37
|
+
*/
|
|
38
|
+
export declare function customFieldColumns(definitions: readonly ContactFieldDefinition[]): GridColDef[];
|
|
@@ -0,0 +1,102 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
18
|
+
import { crmContactCustomColumn } from "@aglyn/aglyn";
|
|
19
|
+
import { Link, Typography } from "@mui/material";
|
|
20
|
+
/**
|
|
21
|
+
* The column `field` a definition's key is listed under — namespaced so a
|
|
22
|
+
* key can never collide with a built-in column, and the shared contract
|
|
23
|
+
* since AGL-2617 so a saved view's filter clause and its column list name
|
|
24
|
+
* the field the same way.
|
|
25
|
+
*/ export const customFieldColumnId = crmContactCustomColumn;
|
|
26
|
+
/**
|
|
27
|
+
* One stored value, as the list shows it.
|
|
28
|
+
*
|
|
29
|
+
* A checkbox reads as Yes or an em dash rather than `true`/`false`; a date
|
|
30
|
+
* as the local day rather than the ISO stamp it is stored as; a link as an
|
|
31
|
+
* anchor. Everything else is the value itself, and nothing is `null` on
|
|
32
|
+
* screen — a cleared value and an absent one look the same, because to the
|
|
33
|
+
* reader of a list they are.
|
|
34
|
+
*/ export function formatContactCustomValue(definition, value) {
|
|
35
|
+
if (value === undefined || value === null || value === '') return '';
|
|
36
|
+
switch(definition.type){
|
|
37
|
+
case 'checkbox':
|
|
38
|
+
return value === true ? 'Yes' : value === false ? 'No' : String(value);
|
|
39
|
+
case 'date':
|
|
40
|
+
{
|
|
41
|
+
const ms = typeof value === 'string' ? Date.parse(value) : Number(value);
|
|
42
|
+
return Number.isFinite(ms) ? new Date(ms).toLocaleDateString() : String(value);
|
|
43
|
+
}
|
|
44
|
+
case 'number':
|
|
45
|
+
return typeof value === 'number' ? value.toLocaleString() : String(value);
|
|
46
|
+
default:
|
|
47
|
+
return String(value);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A CRM list's columns for the org's custom fields (AGL-2601), one per
|
|
52
|
+
* ACTIVE definition in `order` — the contacts list's, and since AGL-2661
|
|
53
|
+
* the companies list's and the deals table's, each handed the definitions
|
|
54
|
+
* of its own object.
|
|
55
|
+
*
|
|
56
|
+
* The value is read off `row.custom`: on a contact the list projects it
|
|
57
|
+
* from THIS holder's facet — the same projection that puts `tags` and
|
|
58
|
+
* `notes` on the row — so a column can never show another holder's value;
|
|
59
|
+
* on a company or a deal it is the document's own map. Sorting and
|
|
60
|
+
* filtering are off: the value lives under a map no index covers, and a
|
|
61
|
+
* column that sorted the loaded window would look like it sorted the
|
|
62
|
+
* collection.
|
|
63
|
+
*
|
|
64
|
+
* Retired definitions get no column. Their values are still on the rows,
|
|
65
|
+
* and an export can still read them; a column for a field the merchant
|
|
66
|
+
* retired would be the field refusing to go away.
|
|
67
|
+
*/ export function customFieldColumns(definitions) {
|
|
68
|
+
return definitions.filter((definition)=>!definition.retiredAt).map((definition)=>({
|
|
69
|
+
field: customFieldColumnId(definition.key),
|
|
70
|
+
headerName: definition.label,
|
|
71
|
+
flex: 0.8,
|
|
72
|
+
minWidth: 140,
|
|
73
|
+
sortable: false,
|
|
74
|
+
filterable: false,
|
|
75
|
+
valueGetter: (_value, row)=>{
|
|
76
|
+
var _row_custom;
|
|
77
|
+
return formatContactCustomValue(definition, (_row_custom = row.custom) == null ? void 0 : _row_custom[definition.key]);
|
|
78
|
+
},
|
|
79
|
+
renderCell: ({ row })=>{
|
|
80
|
+
var _row_custom;
|
|
81
|
+
const raw = (_row_custom = row.custom) == null ? void 0 : _row_custom[definition.key];
|
|
82
|
+
const text = formatContactCustomValue(definition, raw);
|
|
83
|
+
if (!text) return null;
|
|
84
|
+
if (definition.type === 'url') {
|
|
85
|
+
return /*#__PURE__*/ _jsx(Link, {
|
|
86
|
+
href: text,
|
|
87
|
+
target: "_blank",
|
|
88
|
+
rel: "noopener noreferrer",
|
|
89
|
+
variant: "body2",
|
|
90
|
+
onClick: (event)=>event.stopPropagation(),
|
|
91
|
+
children: text
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return /*#__PURE__*/ _jsx(Typography, {
|
|
95
|
+
variant: "body2",
|
|
96
|
+
children: text
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=contact-custom-columns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/contact-custom-columns.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 ContactCustomValue,\n type ContactFieldDefinition,\n crmContactCustomColumn,\n} from '@aglyn/aglyn'\nimport { Link, Typography } from '@mui/material'\nimport type { GridColDef } from '@mui/x-data-grid'\n\n/**\n * The column `field` a definition's key is listed under — namespaced so a\n * key can never collide with a built-in column, and the shared contract\n * since AGL-2617 so a saved view's filter clause and its column list name\n * the field the same way.\n */\nexport const customFieldColumnId = crmContactCustomColumn\n\n/**\n * One stored value, as the list shows it.\n *\n * A checkbox reads as Yes or an em dash rather than `true`/`false`; a date\n * as the local day rather than the ISO stamp it is stored as; a link as an\n * anchor. Everything else is the value itself, and nothing is `null` on\n * screen — a cleared value and an absent one look the same, because to the\n * reader of a list they are.\n */\nexport function formatContactCustomValue(\n definition: Pick<ContactFieldDefinition, 'type'>,\n value: ContactCustomValue | undefined,\n): string {\n if (value === undefined || value === null || value === '') return ''\n switch (definition.type) {\n case 'checkbox':\n return value === true ? 'Yes' : value === false ? 'No' : String(value)\n case 'date': {\n const ms = typeof value === 'string' ? Date.parse(value) : Number(value)\n return Number.isFinite(ms) ? new Date(ms).toLocaleDateString() : String(value)\n }\n case 'number':\n return typeof value === 'number' ? value.toLocaleString() : String(value)\n default:\n return String(value)\n }\n}\n\n/**\n * A CRM list's columns for the org's custom fields (AGL-2601), one per\n * ACTIVE definition in `order` — the contacts list's, and since AGL-2661\n * the companies list's and the deals table's, each handed the definitions\n * of its own object.\n *\n * The value is read off `row.custom`: on a contact the list projects it\n * from THIS holder's facet — the same projection that puts `tags` and\n * `notes` on the row — so a column can never show another holder's value;\n * on a company or a deal it is the document's own map. Sorting and\n * filtering are off: the value lives under a map no index covers, and a\n * column that sorted the loaded window would look like it sorted the\n * collection.\n *\n * Retired definitions get no column. Their values are still on the rows,\n * and an export can still read them; a column for a field the merchant\n * retired would be the field refusing to go away.\n */\nexport function customFieldColumns(\n definitions: readonly ContactFieldDefinition[],\n): GridColDef[] {\n return definitions\n .filter((definition) => !definition.retiredAt)\n .map((definition) => ({\n field: customFieldColumnId(definition.key),\n headerName: definition.label,\n flex: 0.8,\n minWidth: 140,\n sortable: false,\n filterable: false,\n valueGetter: (_value: unknown, row: { custom?: Record<string, ContactCustomValue> }) =>\n formatContactCustomValue(definition, row.custom?.[definition.key]),\n renderCell: ({ row }: { row: { custom?: Record<string, ContactCustomValue> } }) => {\n const raw = row.custom?.[definition.key]\n const text = formatContactCustomValue(definition, raw)\n if (!text) return null\n if (definition.type === 'url') {\n return (\n <Link\n href={text}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n variant=\"body2\"\n onClick={(event) => event.stopPropagation()}\n >\n {text}\n </Link>\n )\n }\n return <Typography variant=\"body2\">{text}</Typography>\n },\n }))\n}\n"],"names":["crmContactCustomColumn","Link","Typography","customFieldColumnId","formatContactCustomValue","definition","value","undefined","type","String","ms","Date","parse","Number","isFinite","toLocaleDateString","toLocaleString","customFieldColumns","definitions","filter","retiredAt","map","field","key","headerName","label","flex","minWidth","sortable","filterable","valueGetter","_value","row","custom","renderCell","raw","text","href","target","rel","variant","onClick","event","stopPropagation"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAEA,SAGEA,sBAAsB,QACjB,eAAc;AACrB,SAASC,IAAI,EAAEC,UAAU,QAAQ,gBAAe;AAGhD;;;;;CAKC,GACD,OAAO,MAAMC,sBAAsBH,uBAAsB;AAEzD;;;;;;;;CAQC,GACD,OAAO,SAASI,yBACdC,UAAgD,EAChDC,KAAqC;IAErC,IAAIA,UAAUC,aAAaD,UAAU,QAAQA,UAAU,IAAI,OAAO;IAClE,OAAQD,WAAWG,IAAI;QACrB,KAAK;YACH,OAAOF,UAAU,OAAO,QAAQA,UAAU,QAAQ,OAAOG,OAAOH;QAClE,KAAK;YAAQ;gBACX,MAAMI,KAAK,OAAOJ,UAAU,WAAWK,KAAKC,KAAK,CAACN,SAASO,OAAOP;gBAClE,OAAOO,OAAOC,QAAQ,CAACJ,MAAM,IAAIC,KAAKD,IAAIK,kBAAkB,KAAKN,OAAOH;YAC1E;QACA,KAAK;YACH,OAAO,OAAOA,UAAU,WAAWA,MAAMU,cAAc,KAAKP,OAAOH;QACrE;YACE,OAAOG,OAAOH;IAClB;AACF;AAEA;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,SAASW,mBACdC,WAA8C;IAE9C,OAAOA,YACJC,MAAM,CAAC,CAACd,aAAe,CAACA,WAAWe,SAAS,EAC5CC,GAAG,CAAC,CAAChB,aAAgB,CAAA;YACpBiB,OAAOnB,oBAAoBE,WAAWkB,GAAG;YACzCC,YAAYnB,WAAWoB,KAAK;YAC5BC,MAAM;YACNC,UAAU;YACVC,UAAU;YACVC,YAAY;YACZC,aAAa,CAACC,QAAiBC;oBACQA;uBAArC5B,yBAAyBC,aAAY2B,cAAAA,IAAIC,MAAM,qBAAVD,WAAY,CAAC3B,WAAWkB,GAAG,CAAC;;YACnEW,YAAY,CAAC,EAAEF,GAAG,EAA4D;oBAChEA;gBAAZ,MAAMG,OAAMH,cAAAA,IAAIC,MAAM,qBAAVD,WAAY,CAAC3B,WAAWkB,GAAG,CAAC;gBACxC,MAAMa,OAAOhC,yBAAyBC,YAAY8B;gBAClD,IAAI,CAACC,MAAM,OAAO;gBAClB,IAAI/B,WAAWG,IAAI,KAAK,OAAO;oBAC7B,qBACE,KAACP;wBACCoC,MAAMD;wBACNE,QAAO;wBACPC,KAAI;wBACJC,SAAQ;wBACRC,SAAS,CAACC,QAAUA,MAAMC,eAAe;kCAExCP;;gBAGP;gBACA,qBAAO,KAAClC;oBAAWsC,SAAQ;8BAASJ;;YACtC;QACF,CAAA;AACJ"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type ConsolePluginPageProps } from '@aglyn/aglyn';
|
|
2
|
+
export interface ContactCustomFieldsCardProps extends Pick<ConsolePluginPageProps, 'hostId' | 'org'> {
|
|
3
|
+
contactId: string;
|
|
4
|
+
/** The CRM surface's own path, for the link to the Fields section. */
|
|
5
|
+
basePath?: string;
|
|
6
|
+
/**
|
|
7
|
+
* The contact document, facets and all, when the page already holds it.
|
|
8
|
+
*
|
|
9
|
+
* Omit it and the card reads the document once itself — the shape the
|
|
10
|
+
* record stub mounts it in. A page that passes it pays no second read,
|
|
11
|
+
* and owns the seed discipline for it: the card's own guard covers only
|
|
12
|
+
* the read the card made.
|
|
13
|
+
*/
|
|
14
|
+
contact?: Record<string, unknown> | null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The custom fields on one contact, as THIS holder's values (AGL-2601).
|
|
18
|
+
*
|
|
19
|
+
* Every active definition draws the control its type calls for, seeded
|
|
20
|
+
* from the viewing group's facet — `facets.{group}.custom.{key}` — and
|
|
21
|
+
* never from another holder's, because a value is one business's knowledge
|
|
22
|
+
* of a person.
|
|
23
|
+
*
|
|
24
|
+
* Save sends ONLY the keys that changed to `crm/contact-update` (AGL-2804):
|
|
25
|
+
* the values are the holder's facet, which the server writes, judging each
|
|
26
|
+
* against its definition and writing it at its own dotted path — a nested
|
|
27
|
+
* `custom` object would replace the map and take every key this card did
|
|
28
|
+
* not touch out with it — and refusing a plan without the CRM. A
|
|
29
|
+
* refusal is shown in the route's own words, with the draft kept.
|
|
30
|
+
*
|
|
31
|
+
* A cleared control sends `null`, the explicit "cleared" the model keeps the
|
|
32
|
+
* key present with, rather than deleting the field: a `where` on the key can
|
|
33
|
+
* still find the contact, and an export still shows the column.
|
|
34
|
+
*/
|
|
35
|
+
export declare function ContactCustomFieldsCard(props: ContactCustomFieldsCardProps): import("react").JSX.Element;
|
|
36
|
+
export declare namespace ContactCustomFieldsCard {
|
|
37
|
+
var displayName: string;
|
|
38
|
+
}
|
|
39
|
+
export default ContactCustomFieldsCard;
|