@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,204 @@
|
|
|
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, Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
+
import * as Aglyn from "@aglyn/aglyn";
|
|
20
|
+
import { pluginDocsHelp } from "@aglyn/aglyn";
|
|
21
|
+
import { AppLink, CardDisplay } from "@aglyn/shared-ui-jsx";
|
|
22
|
+
import EmptyStateComponent from "@aglyn/shared-ui-jsx/components/empty-state.component";
|
|
23
|
+
import { useSnackbar } from "@aglyn/shared-ui-snackstack";
|
|
24
|
+
import { useFirestore, useFirestoreDoc, writeGuardedBySeed } from "@aglyn/tenant-feature-instance";
|
|
25
|
+
import { Button, Stack, Typography } from "@mui/material";
|
|
26
|
+
import { doc } from "firebase/firestore";
|
|
27
|
+
import { useCallback, useMemo, useState } from "react";
|
|
28
|
+
import { useContactFieldDefinitions } from "../hooks/use-contact-field-definitions.js";
|
|
29
|
+
import { useContactUpdate } from "../hooks/use-contact-update.js";
|
|
30
|
+
import { useCrmScope } from "../hooks/use-crm-scope.js";
|
|
31
|
+
import { contactPrimaryGroup } from "../model/contact-record.js";
|
|
32
|
+
import { crmCustomDraftChanges, crmCustomDraftMissingRequired, crmCustomDraftValue } from "../model/crm-custom-draft.js";
|
|
33
|
+
import { crmRoutes } from "../model/crm-routes.js";
|
|
34
|
+
import { CrmCustomFieldControl } from "./crm-custom-field-control.js";
|
|
35
|
+
/**
|
|
36
|
+
* The custom fields on one contact, as THIS holder's values (AGL-2601).
|
|
37
|
+
*
|
|
38
|
+
* Every active definition draws the control its type calls for, seeded
|
|
39
|
+
* from the viewing group's facet — `facets.{group}.custom.{key}` — and
|
|
40
|
+
* never from another holder's, because a value is one business's knowledge
|
|
41
|
+
* of a person.
|
|
42
|
+
*
|
|
43
|
+
* Save sends ONLY the keys that changed to `crm/contact-update` (AGL-2804):
|
|
44
|
+
* the values are the holder's facet, which the server writes, judging each
|
|
45
|
+
* against its definition and writing it at its own dotted path — a nested
|
|
46
|
+
* `custom` object would replace the map and take every key this card did
|
|
47
|
+
* not touch out with it — and refusing a plan without the CRM. A
|
|
48
|
+
* refusal is shown in the route's own words, with the draft kept.
|
|
49
|
+
*
|
|
50
|
+
* A cleared control sends `null`, the explicit "cleared" the model keeps the
|
|
51
|
+
* key present with, rather than deleting the field: a `where` on the key can
|
|
52
|
+
* still find the contact, and an export still shows the column.
|
|
53
|
+
*/ export function ContactCustomFieldsCard(props) {
|
|
54
|
+
var _ref, _ownRead_data;
|
|
55
|
+
const { hostId, org, contactId, contact, basePath } = props;
|
|
56
|
+
const firestore = useFirestore();
|
|
57
|
+
const { enqueueSnackbar } = useSnackbar();
|
|
58
|
+
const contactUpdate = useContactUpdate(hostId != null ? hostId : null);
|
|
59
|
+
const { scope, consentGroup: viewingGroup } = useCrmScope({
|
|
60
|
+
hostId,
|
|
61
|
+
org
|
|
62
|
+
});
|
|
63
|
+
const orgId = (_ref = scope == null ? void 0 : scope[1]) != null ? _ref : null;
|
|
64
|
+
const { active, ready } = useContactFieldDefinitions(orgId);
|
|
65
|
+
// The record, read here only when the page did not hand one over.
|
|
66
|
+
const ownRead = useFirestoreDoc(()=>contact === undefined && scope ? doc(firestore, scope[0], scope[1], 'contacts', contactId) : null, [
|
|
67
|
+
firestore,
|
|
68
|
+
scope,
|
|
69
|
+
contactId,
|
|
70
|
+
contact === undefined
|
|
71
|
+
]);
|
|
72
|
+
const record = contact === undefined ? (_ownRead_data = ownRead.data) != null ? _ownRead_data : null : contact;
|
|
73
|
+
// The facet the values live on: the viewing group's under a site, the
|
|
74
|
+
// person's own primary holder's at the organization level (AGL-2630).
|
|
75
|
+
const consentGroup = useMemo(()=>viewingGroup != null ? viewingGroup : contactPrimaryGroup(record, org), [
|
|
76
|
+
viewingGroup,
|
|
77
|
+
record,
|
|
78
|
+
org
|
|
79
|
+
]);
|
|
80
|
+
const stored = useMemo(()=>{
|
|
81
|
+
var _Aglyn_readContactFacet_custom;
|
|
82
|
+
return (_Aglyn_readContactFacet_custom = Aglyn.readContactFacet(record, consentGroup.groupId).custom) != null ? _Aglyn_readContactFacet_custom : {};
|
|
83
|
+
}, [
|
|
84
|
+
record,
|
|
85
|
+
consentGroup.groupId
|
|
86
|
+
]);
|
|
87
|
+
/** Only the keys the reader touched; everything else reads from `stored` — see `crm-custom-draft`. */ const [draft, setDraft] = useState({});
|
|
88
|
+
const [saving, setSaving] = useState(false);
|
|
89
|
+
const setValue = useCallback((key, value)=>{
|
|
90
|
+
setDraft((current)=>_extends({}, current, {
|
|
91
|
+
[key]: value
|
|
92
|
+
}));
|
|
93
|
+
}, []);
|
|
94
|
+
/** The keys whose draft differs from what is stored — what Save sends. */ const changed = useMemo(()=>crmCustomDraftChanges(stored, draft), [
|
|
95
|
+
draft,
|
|
96
|
+
stored
|
|
97
|
+
]);
|
|
98
|
+
const clearingRequired = crmCustomDraftMissingRequired(active, stored, draft, 'edit').length > 0;
|
|
99
|
+
const handleSave = useCallback(async ()=>{
|
|
100
|
+
if (!scope || !changed.length || clearingRequired) return;
|
|
101
|
+
setSaving(true);
|
|
102
|
+
try {
|
|
103
|
+
const verdict = await writeGuardedBySeed({
|
|
104
|
+
subject: 'contact',
|
|
105
|
+
unreadable: contact === undefined && ownRead.status === 'error',
|
|
106
|
+
fromCache: contact === undefined && ownRead.fromCache
|
|
107
|
+
}, ()=>contactUpdate.updateOne(contactId, {
|
|
108
|
+
custom: Object.fromEntries(changed)
|
|
109
|
+
}));
|
|
110
|
+
if (!verdict.ok) {
|
|
111
|
+
return void enqueueSnackbar(verdict.message, {
|
|
112
|
+
variant: 'warning',
|
|
113
|
+
persist: false
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
setDraft({});
|
|
117
|
+
enqueueSnackbar('Contact saved', {
|
|
118
|
+
variant: 'success',
|
|
119
|
+
persist: false
|
|
120
|
+
});
|
|
121
|
+
} catch (error) {
|
|
122
|
+
console.error(error);
|
|
123
|
+
enqueueSnackbar(error instanceof Error && error.message ? error.message : 'An error has occurred', {
|
|
124
|
+
variant: 'error',
|
|
125
|
+
allowDuplicate: true
|
|
126
|
+
});
|
|
127
|
+
} finally{
|
|
128
|
+
setSaving(false);
|
|
129
|
+
}
|
|
130
|
+
}, [
|
|
131
|
+
scope,
|
|
132
|
+
changed,
|
|
133
|
+
clearingRequired,
|
|
134
|
+
contact,
|
|
135
|
+
ownRead.status,
|
|
136
|
+
ownRead.fromCache,
|
|
137
|
+
contactUpdate,
|
|
138
|
+
contactId,
|
|
139
|
+
enqueueSnackbar
|
|
140
|
+
]);
|
|
141
|
+
return /*#__PURE__*/ _jsx(CardDisplay, {
|
|
142
|
+
header: 'Custom fields',
|
|
143
|
+
help: pluginDocsHelp('contactFields', {
|
|
144
|
+
anchor: '#where-values-show'
|
|
145
|
+
}),
|
|
146
|
+
contentGutterX: true,
|
|
147
|
+
contentGutterY: true,
|
|
148
|
+
children: /*#__PURE__*/ _jsx(Stack, {
|
|
149
|
+
spacing: 2,
|
|
150
|
+
children: !ready ? null : active.length === 0 ? /*#__PURE__*/ _jsx(EmptyStateComponent, {
|
|
151
|
+
compact: true,
|
|
152
|
+
label: 'No custom fields yet',
|
|
153
|
+
description: 'A field defined under Fields is kept on every contact and shows here.',
|
|
154
|
+
action: basePath ? /*#__PURE__*/ _jsx(Button, _extends({
|
|
155
|
+
component: AppLink
|
|
156
|
+
}, {
|
|
157
|
+
componentVariant: 'naked',
|
|
158
|
+
nativeButton: false
|
|
159
|
+
}, {
|
|
160
|
+
href: crmRoutes(basePath).section('fields'),
|
|
161
|
+
size: "small",
|
|
162
|
+
variant: "contained",
|
|
163
|
+
color: "primary",
|
|
164
|
+
children: 'New field'
|
|
165
|
+
})) : undefined
|
|
166
|
+
}) : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
167
|
+
children: [
|
|
168
|
+
active.map((definition)=>/*#__PURE__*/ _jsx(CrmCustomFieldControl, {
|
|
169
|
+
definition: definition,
|
|
170
|
+
value: crmCustomDraftValue(stored, draft, definition.key),
|
|
171
|
+
onChange: (value)=>setValue(definition.key, value)
|
|
172
|
+
}, definition.$id)),
|
|
173
|
+
clearingRequired ? /*#__PURE__*/ _jsx(Typography, {
|
|
174
|
+
variant: "caption",
|
|
175
|
+
color: "error",
|
|
176
|
+
children: 'A required field cannot be left empty.'
|
|
177
|
+
}) : null,
|
|
178
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
179
|
+
direction: "row",
|
|
180
|
+
spacing: 1,
|
|
181
|
+
children: [
|
|
182
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
183
|
+
variant: "contained",
|
|
184
|
+
color: "primary",
|
|
185
|
+
disabled: !changed.length || clearingRequired || saving || !scope,
|
|
186
|
+
onClick: handleSave,
|
|
187
|
+
children: 'Save'
|
|
188
|
+
}),
|
|
189
|
+
changed.length ? /*#__PURE__*/ _jsx(Button, {
|
|
190
|
+
onClick: ()=>setDraft({}),
|
|
191
|
+
disabled: saving,
|
|
192
|
+
children: 'Discard'
|
|
193
|
+
}) : null
|
|
194
|
+
]
|
|
195
|
+
})
|
|
196
|
+
]
|
|
197
|
+
})
|
|
198
|
+
})
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
ContactCustomFieldsCard.displayName = 'ContactCustomFieldsCard';
|
|
202
|
+
export default ContactCustomFieldsCard;
|
|
203
|
+
|
|
204
|
+
//# sourceMappingURL=contact-custom-fields-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/contact-custom-fields-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 { type ConsolePluginPageProps, type ContactCustomValue, pluginDocsHelp } from '@aglyn/aglyn'\nimport { AppLink, CardDisplay } from '@aglyn/shared-ui-jsx'\nimport EmptyStateComponent from '@aglyn/shared-ui-jsx/components/empty-state.component'\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport {\n useFirestore,\n useFirestoreDoc,\n writeGuardedBySeed,\n} from '@aglyn/tenant-feature-instance'\nimport { Button, Stack, Typography } from '@mui/material'\nimport { doc } from 'firebase/firestore'\nimport { useCallback, useMemo, useState } from 'react'\nimport { useContactFieldDefinitions } from '../hooks/use-contact-field-definitions'\nimport { useContactUpdate } from '../hooks/use-contact-update'\nimport { useCrmScope } from '../hooks/use-crm-scope'\nimport { contactPrimaryGroup } from '../model/contact-record'\nimport {\n type CrmCustomDraft,\n crmCustomDraftChanges,\n crmCustomDraftMissingRequired,\n crmCustomDraftValue,\n} from '../model/crm-custom-draft'\nimport { crmRoutes } from '../model/crm-routes'\nimport { CrmCustomFieldControl } from './crm-custom-field-control'\n\nexport interface ContactCustomFieldsCardProps\n extends Pick<ConsolePluginPageProps, 'hostId' | 'org'> {\n contactId: string\n /** The CRM surface's own path, for the link to the Fields section. */\n basePath?: string\n /**\n * The contact document, facets and all, when the page already holds it.\n *\n * Omit it and the card reads the document once itself — the shape the\n * record stub mounts it in. A page that passes it pays no second read,\n * and owns the seed discipline for it: the card's own guard covers only\n * the read the card made.\n */\n contact?: Record<string, unknown> | null\n}\n\n/**\n * The custom fields on one contact, as THIS holder's values (AGL-2601).\n *\n * Every active definition draws the control its type calls for, seeded\n * from the viewing group's facet — `facets.{group}.custom.{key}` — and\n * never from another holder's, because a value is one business's knowledge\n * of a person.\n *\n * Save sends ONLY the keys that changed to `crm/contact-update` (AGL-2804):\n * the values are the holder's facet, which the server writes, judging each\n * against its definition and writing it at its own dotted path — a nested\n * `custom` object would replace the map and take every key this card did\n * not touch out with it — and refusing a plan without the CRM. A\n * refusal is shown in the route's own words, with the draft kept.\n *\n * A cleared control sends `null`, the explicit \"cleared\" the model keeps the\n * key present with, rather than deleting the field: a `where` on the key can\n * still find the contact, and an export still shows the column.\n */\nexport function ContactCustomFieldsCard(props: ContactCustomFieldsCardProps) {\n const { hostId, org, contactId, contact, basePath } = props\n const firestore = useFirestore()\n const { enqueueSnackbar } = useSnackbar()\n const contactUpdate = useContactUpdate(hostId ?? null)\n const { scope, consentGroup: viewingGroup } = useCrmScope({ hostId, org })\n const orgId = scope?.[1] ?? null\n const { active, ready } = useContactFieldDefinitions(orgId)\n\n // The record, read here only when the page did not hand one over.\n const ownRead = useFirestoreDoc<Record<string, unknown>>(\n () =>\n contact === undefined && scope\n ? doc(firestore, scope[0], scope[1], 'contacts', contactId)\n : null,\n [firestore, scope, contactId, contact === undefined],\n )\n const record = contact === undefined ? (ownRead.data ?? null) : contact\n // The facet the values live on: the viewing group's under a site, the\n // person's own primary holder's at the organization level (AGL-2630).\n const consentGroup = useMemo(\n () => viewingGroup ?? contactPrimaryGroup(record, org as Record<string, unknown>),\n [viewingGroup, record, org],\n )\n const stored = useMemo(\n () => Aglyn.readContactFacet(record, consentGroup.groupId).custom ?? {},\n [record, consentGroup.groupId],\n )\n\n /** Only the keys the reader touched; everything else reads from `stored` — see `crm-custom-draft`. */\n const [draft, setDraft] = useState<CrmCustomDraft>({})\n const [saving, setSaving] = useState(false)\n const setValue = useCallback((key: string, value: ContactCustomValue) => {\n setDraft((current) => ({ ...current, [key]: value }))\n }, [])\n\n /** The keys whose draft differs from what is stored — what Save sends. */\n const changed = useMemo(() => crmCustomDraftChanges(stored, draft), [draft, stored])\n const clearingRequired =\n crmCustomDraftMissingRequired(active, stored, draft, 'edit').length > 0\n\n const handleSave = useCallback(async () => {\n if (!scope || !changed.length || clearingRequired) return\n setSaving(true)\n try {\n const verdict = await writeGuardedBySeed(\n {\n subject: 'contact',\n unreadable: contact === undefined && ownRead.status === 'error',\n fromCache: contact === undefined && ownRead.fromCache,\n },\n () => contactUpdate.updateOne(contactId, { custom: Object.fromEntries(changed) }),\n )\n if (!verdict.ok) {\n return void enqueueSnackbar(verdict.message, { variant: 'warning', persist: false })\n }\n setDraft({})\n enqueueSnackbar('Contact 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 }, [\n scope,\n changed,\n clearingRequired,\n contact,\n ownRead.status,\n ownRead.fromCache,\n contactUpdate,\n contactId,\n enqueueSnackbar,\n ])\n\n return (\n <CardDisplay\n header={'Custom fields'}\n help={pluginDocsHelp('contactFields', { anchor: '#where-values-show' })}\n contentGutterX\n contentGutterY\n >\n <Stack spacing={2}>\n {!ready ? null : active.length === 0 ? (\n <EmptyStateComponent\n compact\n label={'No custom fields yet'}\n description={'A field defined under Fields is kept on every contact and shows here.'}\n action={\n basePath ? (\n <Button\n component={AppLink as any}\n {...({ componentVariant: 'naked', nativeButton: false } as any)}\n href={crmRoutes(basePath).section('fields')}\n size=\"small\"\n variant=\"contained\"\n color=\"primary\"\n >\n {'New field'}\n </Button>\n ) : undefined\n }\n />\n ) : (\n <>\n {active.map((definition) => (\n <CrmCustomFieldControl\n key={definition.$id}\n definition={definition}\n value={crmCustomDraftValue(stored, draft, definition.key)}\n onChange={(value) => setValue(definition.key, value)}\n />\n ))}\n {clearingRequired ? (\n <Typography variant=\"caption\" color=\"error\">\n {'A required field cannot be left empty.'}\n </Typography>\n ) : null}\n <Stack direction=\"row\" spacing={1}>\n <Button\n variant=\"contained\"\n color=\"primary\"\n disabled={!changed.length || clearingRequired || saving || !scope}\n onClick={handleSave}\n >\n {'Save'}\n </Button>\n {changed.length ? (\n <Button onClick={() => setDraft({})} disabled={saving}>\n {'Discard'}\n </Button>\n ) : null}\n </Stack>\n </>\n )}\n </Stack>\n </CardDisplay>\n )\n}\nContactCustomFieldsCard.displayName = 'ContactCustomFieldsCard'\n\nexport default ContactCustomFieldsCard\n"],"names":["Aglyn","pluginDocsHelp","AppLink","CardDisplay","EmptyStateComponent","useSnackbar","useFirestore","useFirestoreDoc","writeGuardedBySeed","Button","Stack","Typography","doc","useCallback","useMemo","useState","useContactFieldDefinitions","useContactUpdate","useCrmScope","contactPrimaryGroup","crmCustomDraftChanges","crmCustomDraftMissingRequired","crmCustomDraftValue","crmRoutes","CrmCustomFieldControl","ContactCustomFieldsCard","props","ownRead","hostId","org","contactId","contact","basePath","firestore","enqueueSnackbar","contactUpdate","scope","consentGroup","viewingGroup","orgId","active","ready","undefined","record","data","stored","readContactFacet","groupId","custom","draft","setDraft","saving","setSaving","setValue","key","value","current","changed","clearingRequired","length","handleSave","verdict","subject","unreadable","status","fromCache","updateOne","Object","fromEntries","ok","message","variant","persist","error","console","Error","allowDuplicate","header","help","anchor","contentGutterX","contentGutterY","spacing","compact","label","description","action","component","componentVariant","nativeButton","href","section","size","color","map","definition","onChange","$id","direction","disabled","onClick","displayName"],"mappings":"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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CrmOrgDoc } from '../hooks/use-crm-scope';
|
|
2
|
+
export interface ContactDealsCardProps {
|
|
3
|
+
/** The site the record is read under, or `null` at the organization level. */
|
|
4
|
+
hostId: string | null;
|
|
5
|
+
org: CrmOrgDoc;
|
|
6
|
+
basePath: string;
|
|
7
|
+
contactId: string;
|
|
8
|
+
/** The name the drawer preselects with; the id is the link either way. */
|
|
9
|
+
contactName?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The deals a contact is party to, on the contact's page (AGL-2598) —
|
|
13
|
+
* `orgs/{orgId}/deals` where `contactId ==` this person, with a "New deal"
|
|
14
|
+
* that starts one already linked to them.
|
|
15
|
+
*/
|
|
16
|
+
export declare function ContactDealsCard(props: ContactDealsCardProps): import("react").JSX.Element;
|
|
17
|
+
export declare namespace ContactDealsCard {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
20
|
+
export default ContactDealsCard;
|
|
@@ -0,0 +1,38 @@
|
|
|
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 { LinkedDealsCard } from "./linked-deals-card.js";
|
|
19
|
+
/**
|
|
20
|
+
* The deals a contact is party to, on the contact's page (AGL-2598) —
|
|
21
|
+
* `orgs/{orgId}/deals` where `contactId ==` this person, with a "New deal"
|
|
22
|
+
* that starts one already linked to them.
|
|
23
|
+
*/ export function ContactDealsCard(props) {
|
|
24
|
+
const { hostId, org, basePath, contactId, contactName } = props;
|
|
25
|
+
return /*#__PURE__*/ _jsx(LinkedDealsCard, {
|
|
26
|
+
hostId: hostId,
|
|
27
|
+
org: org,
|
|
28
|
+
basePath: basePath,
|
|
29
|
+
link: {
|
|
30
|
+
contactId,
|
|
31
|
+
contactName
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
ContactDealsCard.displayName = 'ContactDealsCard';
|
|
36
|
+
export default ContactDealsCard;
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=contact-deals-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/contact-deals-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 type { CrmOrgDoc } from '../hooks/use-crm-scope'\nimport { LinkedDealsCard } from './linked-deals-card'\n\nexport interface ContactDealsCardProps {\n /** The site the record is read under, or `null` at the organization level. */\n hostId: string | null\n org: CrmOrgDoc\n basePath: string\n contactId: string\n /** The name the drawer preselects with; the id is the link either way. */\n contactName?: string\n}\n\n/**\n * The deals a contact is party to, on the contact's page (AGL-2598) —\n * `orgs/{orgId}/deals` where `contactId ==` this person, with a \"New deal\"\n * that starts one already linked to them.\n */\nexport function ContactDealsCard(props: ContactDealsCardProps) {\n const { hostId, org, basePath, contactId, contactName } = props\n return (\n <LinkedDealsCard\n hostId={hostId}\n org={org}\n basePath={basePath}\n link={{ contactId, contactName }}\n />\n )\n}\nContactDealsCard.displayName = 'ContactDealsCard'\n\nexport default ContactDealsCard\n"],"names":["LinkedDealsCard","ContactDealsCard","props","hostId","org","basePath","contactId","contactName","link","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAGA,SAASA,eAAe,QAAQ,yBAAqB;AAYrD;;;;CAIC,GACD,OAAO,SAASC,iBAAiBC,KAA4B;IAC3D,MAAM,EAAEC,MAAM,EAAEC,GAAG,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,EAAE,GAAGL;IAC1D,qBACE,KAACF;QACCG,QAAQA;QACRC,KAAKA;QACLC,UAAUA;QACVG,MAAM;YAAEF;YAAWC;QAAY;;AAGrC;AACAN,iBAAiBQ,WAAW,GAAG;AAE/B,eAAeR,iBAAgB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type CrmDetailPageProps } from '../model/crm-routes';
|
|
2
|
+
/**
|
|
3
|
+
* `/crm/contacts/{contactId}` — one person (AGL-2596).
|
|
4
|
+
*
|
|
5
|
+
* A ROUTE rather than the v1 drawer, because a person is the thing every
|
|
6
|
+
* other CRM record points at: a deal, a task and an activity all name a
|
|
7
|
+
* contact, and a link that opens a drawer on top of a list is not a link
|
|
8
|
+
* anybody can paste.
|
|
9
|
+
*
|
|
10
|
+
* ## What this page reads
|
|
11
|
+
*
|
|
12
|
+
* ONE document, by id, through the scoped rules — a single-document get is
|
|
13
|
+
* judged on that document's own `visibleTo`, so no `array-contains-any`
|
|
14
|
+
* filter is needed here the way it is on the list. The row is then flattened
|
|
15
|
+
* through the viewing group's facet ONCE (`contactRecordFromDoc`) and the
|
|
16
|
+
* cards below read the flat record: none of them reaches into
|
|
17
|
+
* `facets.{groupId}` for itself, which is what keeps a card from ever
|
|
18
|
+
* showing another holder's notes.
|
|
19
|
+
*
|
|
20
|
+
* Beyond the document: the team roster (one request, for the owner picker)
|
|
21
|
+
* and the site's campaigns (one listen, for the filing picker) — both paid
|
|
22
|
+
* here because opening a record IS the ask for them, and neither is paid by
|
|
23
|
+
* the list.
|
|
24
|
+
*
|
|
25
|
+
* ## The cards
|
|
26
|
+
*
|
|
27
|
+
* Each in its own file, so a card can grow without this page growing:
|
|
28
|
+
* properties (the editable profile), the relationship (sources, attribution,
|
|
29
|
+
* consent, campaign filing) and the timeline. Other CRM sections add a card
|
|
30
|
+
* here by inserting one import and one line.
|
|
31
|
+
*
|
|
32
|
+
* ## Delete is a detach
|
|
33
|
+
*
|
|
34
|
+
* The row is shared by every site that has captured this person, so the
|
|
35
|
+
* action in the overflow menu drops THIS group's facet, consent, attribution
|
|
36
|
+
* and scope tokens, and deletes the document only when nobody else is left
|
|
37
|
+
* holding it — `planContactDetach` does the counting off `visibleTo`, which
|
|
38
|
+
* is what both enforcement layers evaluate, and the rules refuse a delete by
|
|
39
|
+
* a caller who is not the sole holder. Not the erasure path: a privacy
|
|
40
|
+
* erasure removes the person regardless of who else holds them.
|
|
41
|
+
*/
|
|
42
|
+
export declare function ContactDetailPage(props: CrmDetailPageProps): import("react").JSX.Element;
|
|
43
|
+
export declare namespace ContactDetailPage {
|
|
44
|
+
var displayName: string;
|
|
45
|
+
}
|
|
46
|
+
export default ContactDetailPage;
|