@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 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/crm-glance-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 { money } from '@aglyn/shared-ui-email-campaigns/components/report-figures'\nimport { AppLink, CardDisplay } from '@aglyn/shared-ui-jsx'\nimport { Button, Stack, Typography } from '@mui/material'\nimport {\n getAggregateFromServer,\n getCountFromServer,\n query,\n sum,\n Timestamp,\n where,\n} from 'firebase/firestore'\nimport { useMemo } from 'react'\nimport {\n useConsoleHostRoute,\n useFirestore,\n useOrgDataScope,\n useOrgPlan,\n} from '@aglyn/tenant-feature-instance'\nimport { useCrmOrgMount } from '../hooks/use-crm-org-mount'\nimport { crmRoutes } from '../model/crm-routes'\nimport { openLeadsAcrossSites } from './reports/lead-counts'\nimport { scopedCollection, visibleToClause } from './reports/report-scope'\nimport { ReportStatTile } from './reports/report-stat-tile'\nimport { useAggregateRead } from './reports/use-aggregate-read'\n\nconst WEEK_MS = 7 * 24 * 60 * 60 * 1000\n\ninterface GlanceFigures {\n contacts: number\n newThisWeek: number\n pipelineCents: number\n tasksDue: number\n /** Open leads — new or being worked — on this site, or across the org's sites. */\n leadsToWork: number\n}\n\nexport interface CrmGlanceCardProps {\n /**\n * The site the card is on the dashboard of, or `null` beneath the org\n * hub's mount (AGL-2634), where the figures total every site: the\n * org-wide reads carry no scope clause, and the lead figure fans out\n * over the mount's site list.\n */\n hostId: string | null\n /** The org hub's own path, for the links when there is no site to derive them from. */\n basePath?: string\n}\n\n/**\n * CRM at a glance (AGL-2604): a `hostDashboard` widget with five numbers —\n * contacts, new this week, open pipeline value, tasks due today or overdue,\n * and leads still to work (AGL-2624) — each a link into the section that\n * explains it.\n *\n * Server aggregates and nothing else: a dashboard card mounts on every\n * visit to the site's front page, so it is the one surface on which a\n * bounded read of a thousand rows would be a cost paid for nothing. Each\n * number is a count or a sum the server takes over the same `visibleTo`\n * predicate the hub's sections query with, so the card never shows a figure\n * the section behind the link would not.\n *\n * The lead figure is two counts and a subtraction — every lead on the site,\n * less the closed ones — because a lead nobody has touched carries no status\n * field and Firestore cannot select on a field's absence; see\n * `openLeadsFromCounts`. Leads are host-scoped by path rather than by\n * `visibleTo`, so those two counts run on `hosts/{hostId}/leads` under the\n * site's own rules, the way the Leads section reads it.\n *\n * The widget is handed a host doc id and nothing else, so the org — needed\n * for the consent group whose tokens scope the reads — comes from\n * `useOrgPlan`, and the link base from `useConsoleHostRoute`, the way the\n * commerce glance card builds its store link. Nothing is read until the org\n * has settled: a first round of aggregates against the solo group, replaced\n * by a second against the real one, would be two reads for one answer.\n *\n * ## The organization level (AGL-2634)\n *\n * Mounted with no site beneath the org hub's mount, the card totals the\n * organization: the reads carry no scope clause — the rules admit an\n * org-wide member to every row — and the lead figure is the same two\n * counts per site, over every site the mount lists, summed. Nothing is\n * read until that list has settled, for the reason nothing is read under\n * a site until the org has. The org's dashboard has no widget slot yet, so\n * the mount is a capability rather than a page; what it needs from the\n * shell is a slot and the hub's `basePath`.\n */\nexport function CrmGlanceCard(props: CrmGlanceCardProps) {\n const { hostId, basePath } = props\n const mount = useCrmOrgMount()\n const consoleRoute = useConsoleHostRoute(hostId)\n const { org, ready: planReady } = useOrgPlan(hostId ?? undefined)\n const { scope } = useOrgDataScope(hostId ? { hostId } : { orgId: mount?.orgId })\n const firestore = useFirestore()\n // Under a site, the site's group's tokens once the org has settled; at\n // the org level `null` — no clause — once the site list has.\n const tokens = useMemo(() => {\n if (!hostId) return null\n if (!planReady) return undefined\n const group = Aglyn.consentGroupForHost(org ?? null, hostId)\n return [\n Aglyn.ORG_SCOPE_TOKEN,\n ...group.hostIds.map((id) => Aglyn.hostScopeToken(id)),\n ].slice(0, Aglyn.MAX_SCOPE_HOSTS)\n }, [org, planReady, hostId])\n const leadSites = useMemo(\n () =>\n hostId\n ? [hostId]\n : mount?.hostsReady\n ? mount.hosts.map((host) => host.id)\n : null,\n [hostId, mount],\n )\n const leadSitesKey = leadSites?.join('\\n') ?? ''\n // Anchored once per mount so the queries are stable across renders.\n const nowMs = useMemo(() => Date.now(), [])\n\n const figures = useAggregateRead<GlanceFigures>(() => {\n if (!scope || tokens === undefined || !leadSites) return null\n const contacts = scopedCollection(firestore, scope, 'contacts')\n const deals = scopedCollection(firestore, scope, Aglyn.CRM_COLLECTIONS.deals)\n const tasks = scopedCollection(firestore, scope, Aglyn.CRM_COLLECTIONS.tasks)\n const day = Aglyn.localDayBounds(nowMs)\n const countOf = (target: ReturnType<typeof query>) =>\n getCountFromServer(target).then((snapshot) => snapshot.data().count)\n return Promise.all([\n countOf(query(contacts, ...visibleToClause(tokens))),\n countOf(\n query(\n contacts,\n ...visibleToClause(tokens),\n where('createdAt', '>=', Timestamp.fromMillis(nowMs - WEEK_MS)),\n ),\n ),\n getAggregateFromServer(\n query(deals, ...visibleToClause(tokens), where('status', '==', 'open')),\n { amountCents: sum('amountCents') },\n ).then((snapshot) => Number(snapshot.data().amountCents ?? 0)),\n // Due today OR overdue: everything open that is due before the day ends.\n countOf(\n query(\n tasks,\n ...visibleToClause(tokens),\n where('status', '==', 'open'),\n where('dueAtMs', '<', day.end),\n ),\n ),\n openLeadsAcrossSites(firestore, leadSites),\n ]).then(([contacts, newThisWeek, pipelineCents, tasksDue, leadsToWork]) => ({\n contacts,\n newThisWeek,\n pipelineCents,\n tasksDue,\n leadsToWork,\n }))\n }, [firestore, scope, tokens, nowMs, leadSitesKey])\n\n const routes = useMemo(\n () =>\n hostId\n ? consoleRoute.base\n ? crmRoutes(`${consoleRoute.base}/crm`)\n : null\n : basePath\n ? crmRoutes(basePath)\n : null,\n [hostId, consoleRoute.base, basePath],\n )\n const hubHref = hostId\n ? consoleRoute.base\n ? `${consoleRoute.base}/crm`\n : undefined\n : basePath\n const value = figures.value\n\n return (\n <CardDisplay\n header={'CRM at a glance'}\n help={Aglyn.pluginDocsHelp('crmReports', {\n anchor: '#crm-at-a-glance',\n excerpt:\n 'Contacts, new contacts this week, the value of every open deal, ' +\n 'the tasks due today or overdue, and the leads still to work — ' +\n 'each counted on the server and each a link into the CRM.',\n })}\n contentGutterX\n contentGutterY\n HeaderProps={{\n action: (\n <Button\n component={AppLink as any}\n {...({ componentVariant: 'naked', nativeButton: false } as any)}\n href={hubHref}\n size=\"small\"\n color=\"primary\"\n >\n {'Open CRM'}\n </Button>\n ),\n }}\n >\n <Stack spacing={1.5}>\n <Stack direction=\"row\" spacing={3} sx={{ flexWrap: 'wrap' }}>\n <ReportStatTile\n label={'Contacts'}\n value={value ? value.contacts.toLocaleString() : null}\n href={routes?.section('contacts')}\n />\n <ReportStatTile\n label={'New this week'}\n value={value ? value.newThisWeek.toLocaleString() : null}\n href={routes?.section('contacts')}\n />\n <ReportStatTile\n label={'Open pipeline'}\n value={value ? money(value.pipelineCents, 'usd') : null}\n href={routes?.section('deals')}\n />\n <ReportStatTile\n label={'Tasks due'}\n value={value ? value.tasksDue.toLocaleString() : null}\n note={'today or overdue'}\n color={value?.tasksDue ? 'warning.main' : undefined}\n href={routes?.section('tasks')}\n />\n <ReportStatTile\n label={'Leads to work'}\n value={value ? value.leadsToWork.toLocaleString() : null}\n note={hostId ? 'open on this site' : 'open across every site'}\n href={routes?.section('leads')}\n />\n </Stack>\n {figures.status === 'error' ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'The CRM figures could not be read. Open the CRM for the full picture.'}\n </Typography>\n ) : null}\n </Stack>\n </CardDisplay>\n )\n}\nCrmGlanceCard.displayName = 'CrmGlanceCard'\n\nexport default CrmGlanceCard\n"],"names":["Aglyn","money","AppLink","CardDisplay","Button","Stack","Typography","getAggregateFromServer","getCountFromServer","query","sum","Timestamp","where","useMemo","useConsoleHostRoute","useFirestore","useOrgDataScope","useOrgPlan","useCrmOrgMount","crmRoutes","openLeadsAcrossSites","scopedCollection","visibleToClause","ReportStatTile","useAggregateRead","WEEK_MS","CrmGlanceCard","props","hostId","basePath","mount","consoleRoute","org","ready","planReady","undefined","scope","orgId","firestore","tokens","group","consentGroupForHost","ORG_SCOPE_TOKEN","hostIds","map","id","hostScopeToken","slice","MAX_SCOPE_HOSTS","leadSites","hostsReady","hosts","host","leadSitesKey","join","nowMs","Date","now","figures","contacts","deals","CRM_COLLECTIONS","tasks","day","localDayBounds","countOf","target","then","snapshot","data","count","Promise","all","fromMillis","amountCents","Number","end","newThisWeek","pipelineCents","tasksDue","leadsToWork","routes","base","hubHref","value","header","help","pluginDocsHelp","anchor","excerpt","contentGutterX","contentGutterY","HeaderProps","action","component","componentVariant","nativeButton","href","size","color","spacing","direction","sx","flexWrap","label","toLocaleString","section","note","status","variant","displayName"],"mappings":"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"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type CrmViewFilterClause } from '@aglyn/aglyn';
|
|
2
|
+
import type { GridColDef } from '@mui/x-data-grid';
|
|
3
|
+
/**
|
|
4
|
+
* The "Next activity" column the contacts, companies and deals lists share
|
|
5
|
+
* (AGL-2661): when the record's earliest open task is due, off the
|
|
6
|
+
* `nextTaskAtMs` every server-side task writer keeps on the row.
|
|
7
|
+
*
|
|
8
|
+
* Drawn the way the tasks list draws a due date — overdue in the warning
|
|
9
|
+
* color, today emphasized — because it IS that date, seen from the record.
|
|
10
|
+
* A dash for a record with nothing scheduled, and the same dash for one
|
|
11
|
+
* written before the field existed: the reader's question is "is anything
|
|
12
|
+
* planned", and to both the answer is no. Sorting and filtering are off
|
|
13
|
+
* for the same reason the custom columns' are — the value is on the row,
|
|
14
|
+
* and a sort over the loaded window would look like a sort over the
|
|
15
|
+
* collection; the "No next activity" toggle is the filter, and it says
|
|
16
|
+
* what it narrows.
|
|
17
|
+
*/
|
|
18
|
+
export declare function nextActivityColumn(nowMs: number): GridColDef;
|
|
19
|
+
export interface NoNextActivityToggleProps {
|
|
20
|
+
/** The view's clauses; the toggle reads its own state off them. */
|
|
21
|
+
filters: readonly CrmViewFilterClause[];
|
|
22
|
+
onChange: (filters: CrmViewFilterClause[]) => void;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The "No next activity" filter as one chip beside the view control: on,
|
|
27
|
+
* the list keeps only the records with nothing scheduled. It is a clause
|
|
28
|
+
* on the SAVED VIEW — `withNoNextActivity` — so a view saved with it on
|
|
29
|
+
* reopens with it on, and the clause survives the other filters a list
|
|
30
|
+
* sets around it.
|
|
31
|
+
*/
|
|
32
|
+
export declare function NoNextActivityToggle(props: NoNextActivityToggleProps): import("react").JSX.Element;
|
|
33
|
+
export declare namespace NoNextActivityToggle {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
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 { CRM_NEXT_ACTIVITY_FIELD, isNoNextActivityClause, readNextTaskAtMs, withNoNextActivity } from "@aglyn/aglyn";
|
|
19
|
+
import { Chip, Tooltip, Typography } from "@mui/material";
|
|
20
|
+
import { TaskDueText } from "./task-cells.js";
|
|
21
|
+
/**
|
|
22
|
+
* The "Next activity" column the contacts, companies and deals lists share
|
|
23
|
+
* (AGL-2661): when the record's earliest open task is due, off the
|
|
24
|
+
* `nextTaskAtMs` every server-side task writer keeps on the row.
|
|
25
|
+
*
|
|
26
|
+
* Drawn the way the tasks list draws a due date — overdue in the warning
|
|
27
|
+
* color, today emphasized — because it IS that date, seen from the record.
|
|
28
|
+
* A dash for a record with nothing scheduled, and the same dash for one
|
|
29
|
+
* written before the field existed: the reader's question is "is anything
|
|
30
|
+
* planned", and to both the answer is no. Sorting and filtering are off
|
|
31
|
+
* for the same reason the custom columns' are — the value is on the row,
|
|
32
|
+
* and a sort over the loaded window would look like a sort over the
|
|
33
|
+
* collection; the "No next activity" toggle is the filter, and it says
|
|
34
|
+
* what it narrows.
|
|
35
|
+
*/ export function nextActivityColumn(nowMs) {
|
|
36
|
+
return {
|
|
37
|
+
field: CRM_NEXT_ACTIVITY_FIELD,
|
|
38
|
+
headerName: 'Next activity',
|
|
39
|
+
flex: 0.8,
|
|
40
|
+
minWidth: 140,
|
|
41
|
+
type: 'date',
|
|
42
|
+
sortable: false,
|
|
43
|
+
filterable: false,
|
|
44
|
+
valueGetter: (_value, row)=>{
|
|
45
|
+
const at = readNextTaskAtMs(row);
|
|
46
|
+
return at === null ? null : new Date(at);
|
|
47
|
+
},
|
|
48
|
+
renderCell: ({ row })=>{
|
|
49
|
+
const at = readNextTaskAtMs(row);
|
|
50
|
+
if (at === null) {
|
|
51
|
+
return /*#__PURE__*/ _jsx(Typography, {
|
|
52
|
+
variant: "caption",
|
|
53
|
+
color: "text.secondary",
|
|
54
|
+
children: '—'
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return /*#__PURE__*/ _jsx(Tooltip, {
|
|
58
|
+
title: new Date(at).toLocaleString(),
|
|
59
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
60
|
+
children: /*#__PURE__*/ _jsx(TaskDueText, {
|
|
61
|
+
task: {
|
|
62
|
+
status: 'open',
|
|
63
|
+
dueAtMs: at
|
|
64
|
+
},
|
|
65
|
+
nowMs: nowMs,
|
|
66
|
+
variant: "caption"
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The "No next activity" filter as one chip beside the view control: on,
|
|
75
|
+
* the list keeps only the records with nothing scheduled. It is a clause
|
|
76
|
+
* on the SAVED VIEW — `withNoNextActivity` — so a view saved with it on
|
|
77
|
+
* reopens with it on, and the clause survives the other filters a list
|
|
78
|
+
* sets around it.
|
|
79
|
+
*/ export function NoNextActivityToggle(props) {
|
|
80
|
+
const { filters, onChange, disabled } = props;
|
|
81
|
+
const on = filters.some(isNoNextActivityClause);
|
|
82
|
+
return /*#__PURE__*/ _jsx(Tooltip, {
|
|
83
|
+
title: on ? 'Showing records with nothing scheduled' : 'Only records with nothing scheduled',
|
|
84
|
+
// Describes rather than names: the chip's label is what a reader — and
|
|
85
|
+
// a saved view's caption — calls the filter.
|
|
86
|
+
describeChild: true,
|
|
87
|
+
children: /*#__PURE__*/ _jsx(Chip, {
|
|
88
|
+
size: "small",
|
|
89
|
+
label: "No next activity",
|
|
90
|
+
variant: on ? 'filled' : 'outlined',
|
|
91
|
+
color: on ? 'primary' : 'default',
|
|
92
|
+
disabled: disabled,
|
|
93
|
+
onClick: ()=>onChange(withNoNextActivity(filters, !on)),
|
|
94
|
+
"aria-pressed": on
|
|
95
|
+
})
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
NoNextActivityToggle.displayName = 'NoNextActivityToggle';
|
|
99
|
+
|
|
100
|
+
//# sourceMappingURL=crm-next-activity-column.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/crm-next-activity-column.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 CRM_NEXT_ACTIVITY_FIELD,\n type CrmViewFilterClause,\n isNoNextActivityClause,\n readNextTaskAtMs,\n withNoNextActivity,\n} from '@aglyn/aglyn'\nimport { Chip, Tooltip, Typography } from '@mui/material'\nimport type { GridColDef } from '@mui/x-data-grid'\nimport { TaskDueText } from './task-cells'\n\n/**\n * The \"Next activity\" column the contacts, companies and deals lists share\n * (AGL-2661): when the record's earliest open task is due, off the\n * `nextTaskAtMs` every server-side task writer keeps on the row.\n *\n * Drawn the way the tasks list draws a due date — overdue in the warning\n * color, today emphasized — because it IS that date, seen from the record.\n * A dash for a record with nothing scheduled, and the same dash for one\n * written before the field existed: the reader's question is \"is anything\n * planned\", and to both the answer is no. Sorting and filtering are off\n * for the same reason the custom columns' are — the value is on the row,\n * and a sort over the loaded window would look like a sort over the\n * collection; the \"No next activity\" toggle is the filter, and it says\n * what it narrows.\n */\nexport function nextActivityColumn(nowMs: number): GridColDef {\n return {\n field: CRM_NEXT_ACTIVITY_FIELD,\n headerName: 'Next activity',\n flex: 0.8,\n minWidth: 140,\n type: 'date',\n sortable: false,\n filterable: false,\n valueGetter: (_value: unknown, row: { nextTaskAtMs?: unknown }) => {\n const at = readNextTaskAtMs(row)\n return at === null ? null : new Date(at)\n },\n renderCell: ({ row }: { row: { nextTaskAtMs?: unknown } }) => {\n const at = readNextTaskAtMs(row)\n if (at === null) {\n return (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'—'}\n </Typography>\n )\n }\n return (\n <Tooltip title={new Date(at).toLocaleString()}>\n <span>\n <TaskDueText task={{ status: 'open', dueAtMs: at }} nowMs={nowMs} variant=\"caption\" />\n </span>\n </Tooltip>\n )\n },\n }\n}\n\nexport interface NoNextActivityToggleProps {\n /** The view's clauses; the toggle reads its own state off them. */\n filters: readonly CrmViewFilterClause[]\n onChange: (filters: CrmViewFilterClause[]) => void\n disabled?: boolean\n}\n\n/**\n * The \"No next activity\" filter as one chip beside the view control: on,\n * the list keeps only the records with nothing scheduled. It is a clause\n * on the SAVED VIEW — `withNoNextActivity` — so a view saved with it on\n * reopens with it on, and the clause survives the other filters a list\n * sets around it.\n */\nexport function NoNextActivityToggle(props: NoNextActivityToggleProps) {\n const { filters, onChange, disabled } = props\n const on = filters.some(isNoNextActivityClause)\n return (\n <Tooltip\n title={on ? 'Showing records with nothing scheduled' : 'Only records with nothing scheduled'}\n // Describes rather than names: the chip's label is what a reader — and\n // a saved view's caption — calls the filter.\n describeChild\n >\n <Chip\n size=\"small\"\n label=\"No next activity\"\n variant={on ? 'filled' : 'outlined'}\n color={on ? 'primary' : 'default'}\n disabled={disabled}\n onClick={() => onChange(withNoNextActivity(filters, !on))}\n aria-pressed={on}\n />\n </Tooltip>\n )\n}\nNoNextActivityToggle.displayName = 'NoNextActivityToggle'\n"],"names":["CRM_NEXT_ACTIVITY_FIELD","isNoNextActivityClause","readNextTaskAtMs","withNoNextActivity","Chip","Tooltip","Typography","TaskDueText","nextActivityColumn","nowMs","field","headerName","flex","minWidth","type","sortable","filterable","valueGetter","_value","row","at","Date","renderCell","variant","color","title","toLocaleString","span","task","status","dueAtMs","NoNextActivityToggle","props","filters","onChange","disabled","on","some","describeChild","size","label","onClick","aria-pressed","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAEA,SACEA,uBAAuB,EAEvBC,sBAAsB,EACtBC,gBAAgB,EAChBC,kBAAkB,QACb,eAAc;AACrB,SAASC,IAAI,EAAEC,OAAO,EAAEC,UAAU,QAAQ,gBAAe;AAEzD,SAASC,WAAW,QAAQ,kBAAc;AAE1C;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASC,mBAAmBC,KAAa;IAC9C,OAAO;QACLC,OAAOV;QACPW,YAAY;QACZC,MAAM;QACNC,UAAU;QACVC,MAAM;QACNC,UAAU;QACVC,YAAY;QACZC,aAAa,CAACC,QAAiBC;YAC7B,MAAMC,KAAKlB,iBAAiBiB;YAC5B,OAAOC,OAAO,OAAO,OAAO,IAAIC,KAAKD;QACvC;QACAE,YAAY,CAAC,EAAEH,GAAG,EAAuC;YACvD,MAAMC,KAAKlB,iBAAiBiB;YAC5B,IAAIC,OAAO,MAAM;gBACf,qBACE,KAACd;oBAAWiB,SAAQ;oBAAUC,OAAM;8BACjC;;YAGP;YACA,qBACE,KAACnB;gBAAQoB,OAAO,IAAIJ,KAAKD,IAAIM,cAAc;0BACzC,cAAA,KAACC;8BACC,cAAA,KAACpB;wBAAYqB,MAAM;4BAAEC,QAAQ;4BAAQC,SAASV;wBAAG;wBAAGX,OAAOA;wBAAOc,SAAQ;;;;QAIlF;IACF;AACF;AASA;;;;;;CAMC,GACD,OAAO,SAASQ,qBAAqBC,KAAgC;IACnE,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,QAAQ,EAAE,GAAGH;IACxC,MAAMI,KAAKH,QAAQI,IAAI,CAACpC;IACxB,qBACE,KAACI;QACCoB,OAAOW,KAAK,2CAA2C;QACvD,uEAAuE;QACvE,6CAA6C;QAC7CE,aAAa;kBAEb,cAAA,KAAClC;YACCmC,MAAK;YACLC,OAAM;YACNjB,SAASa,KAAK,WAAW;YACzBZ,OAAOY,KAAK,YAAY;YACxBD,UAAUA;YACVM,SAAS,IAAMP,SAAS/B,mBAAmB8B,SAAS,CAACG;YACrDM,gBAAcN;;;AAItB;AACAL,qBAAqBY,WAAW,GAAG"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { type CardDisplayProps } from '@aglyn/shared-ui-jsx';
|
|
2
|
+
import { type RowActionsMenuItem } from '@aglyn/shared-ui-jsx/components/row-actions-menu.component';
|
|
3
|
+
import { type ChipProps } from '@mui/material';
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
5
|
+
import { type CrmRecordBookingZoneProps } from './crm-booking-zone';
|
|
6
|
+
export interface CrmRecordHeaderProps {
|
|
7
|
+
/** What the record is — the lead card's heading: Contact, Company, Deal, Lead. */
|
|
8
|
+
kind: string;
|
|
9
|
+
/**
|
|
10
|
+
* The record's own name, published to the page heading and the trail.
|
|
11
|
+
* Undefined until it has loaded, so the route's heading stands meanwhile.
|
|
12
|
+
*/
|
|
13
|
+
title: string | undefined;
|
|
14
|
+
/** The one line under the heading — an address, a domain, a pipeline and stage. */
|
|
15
|
+
subtitle?: ReactNode;
|
|
16
|
+
/** The record's facts as chips: a stage, a status, an owner. */
|
|
17
|
+
chips?: ReactNode;
|
|
18
|
+
/** The way back to the section the record lives in. */
|
|
19
|
+
backHref: string;
|
|
20
|
+
backLabel: string;
|
|
21
|
+
/** The primary controls, beside the menu. */
|
|
22
|
+
actions?: ReactNode;
|
|
23
|
+
/** Everything else, behind the overflow — the destructive act lives here. */
|
|
24
|
+
menuItems?: RowActionsMenuItem[];
|
|
25
|
+
help?: CardDisplayProps['help'];
|
|
26
|
+
/** The record is still on its way; the chip row says so rather than sitting empty. */
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
/** What the card holds under the chips — a properties list, or a refusal. */
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* The **Book a meeting** action (AGL-2660), for a contact, a lead or a
|
|
32
|
+
* deal: the record the link carries, and the site whose services are
|
|
33
|
+
* offered. Drawn beside the primary controls, and only where the site has
|
|
34
|
+
* a booking door — the action renders nothing otherwise.
|
|
35
|
+
*/
|
|
36
|
+
booking?: CrmRecordBookingZoneProps;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* THE HEADER EVERY CRM RECORD PAGE OPENS ON (AGL-2614).
|
|
40
|
+
*
|
|
41
|
+
* A contact, a company, a deal and a lead each had a lead card of their own
|
|
42
|
+
* and no two agreed: one kept its controls in the card header and one at the
|
|
43
|
+
* card's foot, one put the way back in a caption under the properties, one
|
|
44
|
+
* offered Delete as a red button beside Edit and one behind a menu, and the
|
|
45
|
+
* page heading was published by the page on three of them and never on the
|
|
46
|
+
* fourth. A reader moving between the four records of one sale was reading
|
|
47
|
+
* four products.
|
|
48
|
+
*
|
|
49
|
+
* ## The grammar
|
|
50
|
+
*
|
|
51
|
+
* ```
|
|
52
|
+
* [ page heading and trail: the record's name ]
|
|
53
|
+
* Kind [ Back to … ] [ primary ] [ ⋮ ]
|
|
54
|
+
* subtitle line
|
|
55
|
+
* [ chip ] [ chip ] [ chip ]
|
|
56
|
+
* children
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* The page heading is the record's NAME — published from here, once, by
|
|
60
|
+
* whichever component loaded the record, so the shell's heading and the
|
|
61
|
+
* card read one document. The card is then free to say what the record IS
|
|
62
|
+
* (`kind`) rather than repeating the name, and its subtitle carries the one
|
|
63
|
+
* fact that identifies the record beyond its name: the address, the domain,
|
|
64
|
+
* the pipeline and stage.
|
|
65
|
+
*
|
|
66
|
+
* Controls sit in the card HEADER, never at its foot: the header is where a
|
|
67
|
+
* reader looks for what they can do to the thing they just opened, and a
|
|
68
|
+
* foot of controls scrolls away under a long properties list. The way back
|
|
69
|
+
* leads, because the record is the trail's last crumb and the crumb is not a
|
|
70
|
+
* link. The primary act — Edit, Convert, Add to list — is a button; every
|
|
71
|
+
* other act, and the destructive one in particular, is a menu item, so that
|
|
72
|
+
* a delete is never one mis-click from the button beside it.
|
|
73
|
+
*/
|
|
74
|
+
export declare function CrmRecordHeader(props: CrmRecordHeaderProps): import("react").JSX.Element;
|
|
75
|
+
export declare namespace CrmRecordHeader {
|
|
76
|
+
var displayName: string;
|
|
77
|
+
}
|
|
78
|
+
export interface CrmRecordChipProps {
|
|
79
|
+
/** What the fact is — Owner, Industry, Amount. */
|
|
80
|
+
label: string;
|
|
81
|
+
/** The fact. Nothing is rendered without one, so a caller can pass it blindly. */
|
|
82
|
+
value?: ReactNode;
|
|
83
|
+
color?: ChipProps['color'];
|
|
84
|
+
variant?: ChipProps['variant'];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* One fact on the chip row, in the `Label: value` form every record uses.
|
|
88
|
+
*
|
|
89
|
+
* A chip with no value renders nothing rather than a bare label, so a
|
|
90
|
+
* record page lists every fact it might have and the row shows the ones
|
|
91
|
+
* this record does.
|
|
92
|
+
*/
|
|
93
|
+
export declare function CrmRecordChip(props: CrmRecordChipProps): import("react").JSX.Element;
|
|
94
|
+
export declare namespace CrmRecordChip {
|
|
95
|
+
var displayName: string;
|
|
96
|
+
}
|
|
97
|
+
export default CrmRecordHeader;
|
|
@@ -0,0 +1,160 @@
|
|
|
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 { PageHeaderRecord } from "@aglyn/aglyn";
|
|
20
|
+
import { AppLink, CardDisplay } from "@aglyn/shared-ui-jsx";
|
|
21
|
+
import RowActionsMenu from "@aglyn/shared-ui-jsx/components/row-actions-menu.component";
|
|
22
|
+
import { Button, Chip, Stack, Typography } from "@mui/material";
|
|
23
|
+
import { CrmRecordBookingZone } from "./crm-booking-zone.js";
|
|
24
|
+
/**
|
|
25
|
+
* THE HEADER EVERY CRM RECORD PAGE OPENS ON (AGL-2614).
|
|
26
|
+
*
|
|
27
|
+
* A contact, a company, a deal and a lead each had a lead card of their own
|
|
28
|
+
* and no two agreed: one kept its controls in the card header and one at the
|
|
29
|
+
* card's foot, one put the way back in a caption under the properties, one
|
|
30
|
+
* offered Delete as a red button beside Edit and one behind a menu, and the
|
|
31
|
+
* page heading was published by the page on three of them and never on the
|
|
32
|
+
* fourth. A reader moving between the four records of one sale was reading
|
|
33
|
+
* four products.
|
|
34
|
+
*
|
|
35
|
+
* ## The grammar
|
|
36
|
+
*
|
|
37
|
+
* ```
|
|
38
|
+
* [ page heading and trail: the record's name ]
|
|
39
|
+
* Kind [ Back to … ] [ primary ] [ ⋮ ]
|
|
40
|
+
* subtitle line
|
|
41
|
+
* [ chip ] [ chip ] [ chip ]
|
|
42
|
+
* children
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* The page heading is the record's NAME — published from here, once, by
|
|
46
|
+
* whichever component loaded the record, so the shell's heading and the
|
|
47
|
+
* card read one document. The card is then free to say what the record IS
|
|
48
|
+
* (`kind`) rather than repeating the name, and its subtitle carries the one
|
|
49
|
+
* fact that identifies the record beyond its name: the address, the domain,
|
|
50
|
+
* the pipeline and stage.
|
|
51
|
+
*
|
|
52
|
+
* Controls sit in the card HEADER, never at its foot: the header is where a
|
|
53
|
+
* reader looks for what they can do to the thing they just opened, and a
|
|
54
|
+
* foot of controls scrolls away under a long properties list. The way back
|
|
55
|
+
* leads, because the record is the trail's last crumb and the crumb is not a
|
|
56
|
+
* link. The primary act — Edit, Convert, Add to list — is a button; every
|
|
57
|
+
* other act, and the destructive one in particular, is a menu item, so that
|
|
58
|
+
* a delete is never one mis-click from the button beside it.
|
|
59
|
+
*/ export function CrmRecordHeader(props) {
|
|
60
|
+
const { kind, title, subtitle, chips, backHref, backLabel, actions, menuItems, help, loading, children, booking } = props;
|
|
61
|
+
const hasChipRow = Boolean(chips) || Boolean(loading);
|
|
62
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
63
|
+
children: [
|
|
64
|
+
/*#__PURE__*/ _jsx(PageHeaderRecord, {
|
|
65
|
+
title: title
|
|
66
|
+
}),
|
|
67
|
+
/*#__PURE__*/ _jsx(CardDisplay, {
|
|
68
|
+
header: kind,
|
|
69
|
+
subheader: subtitle,
|
|
70
|
+
help: help,
|
|
71
|
+
contentGutterX: true,
|
|
72
|
+
contentGutterY: true,
|
|
73
|
+
HeaderProps: {
|
|
74
|
+
action: /*#__PURE__*/ _jsxs(Stack, {
|
|
75
|
+
direction: "row",
|
|
76
|
+
spacing: 1,
|
|
77
|
+
sx: {
|
|
78
|
+
alignItems: 'center',
|
|
79
|
+
flexWrap: 'wrap',
|
|
80
|
+
rowGap: 1
|
|
81
|
+
},
|
|
82
|
+
children: [
|
|
83
|
+
/*#__PURE__*/ _jsx(Button, _extends({
|
|
84
|
+
component: AppLink
|
|
85
|
+
}, {
|
|
86
|
+
componentVariant: 'naked',
|
|
87
|
+
nativeButton: false
|
|
88
|
+
}, {
|
|
89
|
+
href: backHref,
|
|
90
|
+
size: "small",
|
|
91
|
+
color: "primary",
|
|
92
|
+
children: backLabel
|
|
93
|
+
})),
|
|
94
|
+
actions,
|
|
95
|
+
booking ? /*#__PURE__*/ _jsx(CrmRecordBookingZone, _extends({}, booking)) : null,
|
|
96
|
+
(menuItems == null ? void 0 : menuItems.length) ? /*#__PURE__*/ _jsx(RowActionsMenu, {
|
|
97
|
+
label: title || kind,
|
|
98
|
+
items: menuItems
|
|
99
|
+
}) : null
|
|
100
|
+
]
|
|
101
|
+
})
|
|
102
|
+
},
|
|
103
|
+
children: hasChipRow || children ? /*#__PURE__*/ _jsxs(Stack, {
|
|
104
|
+
spacing: 2,
|
|
105
|
+
children: [
|
|
106
|
+
hasChipRow ? /*#__PURE__*/ _jsxs(Stack, {
|
|
107
|
+
direction: "row",
|
|
108
|
+
spacing: 1,
|
|
109
|
+
sx: {
|
|
110
|
+
alignItems: 'center',
|
|
111
|
+
flexWrap: 'wrap',
|
|
112
|
+
rowGap: 1
|
|
113
|
+
},
|
|
114
|
+
children: [
|
|
115
|
+
chips,
|
|
116
|
+
loading ? /*#__PURE__*/ _jsx(Typography, {
|
|
117
|
+
variant: "body2",
|
|
118
|
+
color: "text.secondary",
|
|
119
|
+
children: 'Loading…'
|
|
120
|
+
}) : null
|
|
121
|
+
]
|
|
122
|
+
}) : null,
|
|
123
|
+
children
|
|
124
|
+
]
|
|
125
|
+
}) : null
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
CrmRecordHeader.displayName = 'CrmRecordHeader';
|
|
131
|
+
/**
|
|
132
|
+
* One fact on the chip row, in the `Label: value` form every record uses.
|
|
133
|
+
*
|
|
134
|
+
* A chip with no value renders nothing rather than a bare label, so a
|
|
135
|
+
* record page lists every fact it might have and the row shows the ones
|
|
136
|
+
* this record does.
|
|
137
|
+
*/ export function CrmRecordChip(props) {
|
|
138
|
+
const { label, value, color, variant = 'outlined' } = props;
|
|
139
|
+
if (value === null || value === undefined || value === '') return null;
|
|
140
|
+
return /*#__PURE__*/ _jsx(Chip, {
|
|
141
|
+
size: "small",
|
|
142
|
+
variant: variant,
|
|
143
|
+
color: color,
|
|
144
|
+
label: /*#__PURE__*/ _jsxs(_Fragment, {
|
|
145
|
+
children: [
|
|
146
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
147
|
+
component: "span",
|
|
148
|
+
variant: "inherit",
|
|
149
|
+
color: "text.secondary",
|
|
150
|
+
children: `${label}: `
|
|
151
|
+
}),
|
|
152
|
+
value
|
|
153
|
+
]
|
|
154
|
+
})
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
CrmRecordChip.displayName = 'CrmRecordChip';
|
|
158
|
+
export default CrmRecordHeader;
|
|
159
|
+
|
|
160
|
+
//# sourceMappingURL=crm-record-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/crm-record-header.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 { PageHeaderRecord } from '@aglyn/aglyn'\nimport { AppLink, CardDisplay, type CardDisplayProps } from '@aglyn/shared-ui-jsx'\nimport RowActionsMenu, {\n type RowActionsMenuItem,\n} from '@aglyn/shared-ui-jsx/components/row-actions-menu.component'\nimport { Button, Chip, type ChipProps, Stack, Typography } from '@mui/material'\nimport type { ReactNode } from 'react'\nimport {\n CrmRecordBookingZone,\n type CrmRecordBookingZoneProps,\n} from './crm-booking-zone'\n\nexport interface CrmRecordHeaderProps {\n /** What the record is — the lead card's heading: Contact, Company, Deal, Lead. */\n kind: string\n /**\n * The record's own name, published to the page heading and the trail.\n * Undefined until it has loaded, so the route's heading stands meanwhile.\n */\n title: string | undefined\n /** The one line under the heading — an address, a domain, a pipeline and stage. */\n subtitle?: ReactNode\n /** The record's facts as chips: a stage, a status, an owner. */\n chips?: ReactNode\n /** The way back to the section the record lives in. */\n backHref: string\n backLabel: string\n /** The primary controls, beside the menu. */\n actions?: ReactNode\n /** Everything else, behind the overflow — the destructive act lives here. */\n menuItems?: RowActionsMenuItem[]\n help?: CardDisplayProps['help']\n /** The record is still on its way; the chip row says so rather than sitting empty. */\n loading?: boolean\n /** What the card holds under the chips — a properties list, or a refusal. */\n children?: ReactNode\n /**\n * The **Book a meeting** action (AGL-2660), for a contact, a lead or a\n * deal: the record the link carries, and the site whose services are\n * offered. Drawn beside the primary controls, and only where the site has\n * a booking door — the action renders nothing otherwise.\n */\n booking?: CrmRecordBookingZoneProps\n}\n\n/**\n * THE HEADER EVERY CRM RECORD PAGE OPENS ON (AGL-2614).\n *\n * A contact, a company, a deal and a lead each had a lead card of their own\n * and no two agreed: one kept its controls in the card header and one at the\n * card's foot, one put the way back in a caption under the properties, one\n * offered Delete as a red button beside Edit and one behind a menu, and the\n * page heading was published by the page on three of them and never on the\n * fourth. A reader moving between the four records of one sale was reading\n * four products.\n *\n * ## The grammar\n *\n * ```\n * [ page heading and trail: the record's name ]\n * Kind [ Back to … ] [ primary ] [ ⋮ ]\n * subtitle line\n * [ chip ] [ chip ] [ chip ]\n * children\n * ```\n *\n * The page heading is the record's NAME — published from here, once, by\n * whichever component loaded the record, so the shell's heading and the\n * card read one document. The card is then free to say what the record IS\n * (`kind`) rather than repeating the name, and its subtitle carries the one\n * fact that identifies the record beyond its name: the address, the domain,\n * the pipeline and stage.\n *\n * Controls sit in the card HEADER, never at its foot: the header is where a\n * reader looks for what they can do to the thing they just opened, and a\n * foot of controls scrolls away under a long properties list. The way back\n * leads, because the record is the trail's last crumb and the crumb is not a\n * link. The primary act — Edit, Convert, Add to list — is a button; every\n * other act, and the destructive one in particular, is a menu item, so that\n * a delete is never one mis-click from the button beside it.\n */\nexport function CrmRecordHeader(props: CrmRecordHeaderProps) {\n const {\n kind,\n title,\n subtitle,\n chips,\n backHref,\n backLabel,\n actions,\n menuItems,\n help,\n loading,\n children,\n booking,\n } = props\n const hasChipRow = Boolean(chips) || Boolean(loading)\n return (\n <>\n <PageHeaderRecord title={title} />\n <CardDisplay\n header={kind}\n subheader={subtitle}\n help={help}\n contentGutterX\n contentGutterY\n HeaderProps={{\n action: (\n <Stack\n direction=\"row\"\n spacing={1}\n sx={{ alignItems: 'center', flexWrap: 'wrap', rowGap: 1 }}\n >\n <Button\n component={AppLink as any}\n {...({ componentVariant: 'naked', nativeButton: false } as any)}\n href={backHref}\n size=\"small\"\n color=\"primary\"\n >\n {backLabel}\n </Button>\n {actions}\n {booking ? <CrmRecordBookingZone {...booking} /> : null}\n {menuItems?.length ? (\n <RowActionsMenu label={title || kind} items={menuItems} />\n ) : null}\n </Stack>\n ),\n }}\n >\n {hasChipRow || children ? (\n <Stack spacing={2}>\n {hasChipRow ? (\n <Stack\n direction=\"row\"\n spacing={1}\n sx={{ alignItems: 'center', flexWrap: 'wrap', rowGap: 1 }}\n >\n {chips}\n {loading ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Loading…'}\n </Typography>\n ) : null}\n </Stack>\n ) : null}\n {children}\n </Stack>\n ) : null}\n </CardDisplay>\n </>\n )\n}\nCrmRecordHeader.displayName = 'CrmRecordHeader'\n\nexport interface CrmRecordChipProps {\n /** What the fact is — Owner, Industry, Amount. */\n label: string\n /** The fact. Nothing is rendered without one, so a caller can pass it blindly. */\n value?: ReactNode\n color?: ChipProps['color']\n variant?: ChipProps['variant']\n}\n\n/**\n * One fact on the chip row, in the `Label: value` form every record uses.\n *\n * A chip with no value renders nothing rather than a bare label, so a\n * record page lists every fact it might have and the row shows the ones\n * this record does.\n */\nexport function CrmRecordChip(props: CrmRecordChipProps) {\n const { label, value, color, variant = 'outlined' } = props\n if (value === null || value === undefined || value === '') return null\n return (\n <Chip\n size=\"small\"\n variant={variant}\n color={color}\n label={\n <>\n <Typography component=\"span\" variant=\"inherit\" color=\"text.secondary\">\n {`${label}: `}\n </Typography>\n {value}\n </>\n }\n />\n )\n}\nCrmRecordChip.displayName = 'CrmRecordChip'\n\nexport default CrmRecordHeader\n"],"names":["PageHeaderRecord","AppLink","CardDisplay","RowActionsMenu","Button","Chip","Stack","Typography","CrmRecordBookingZone","CrmRecordHeader","props","kind","title","subtitle","chips","backHref","backLabel","actions","menuItems","help","loading","children","booking","hasChipRow","Boolean","header","subheader","contentGutterX","contentGutterY","HeaderProps","action","direction","spacing","sx","alignItems","flexWrap","rowGap","component","componentVariant","nativeButton","href","size","color","length","label","items","variant","displayName","CrmRecordChip","value","undefined"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAEA,SAASA,gBAAgB,QAAQ,eAAc;AAC/C,SAASC,OAAO,EAAEC,WAAW,QAA+B,uBAAsB;AAClF,OAAOC,oBAEA,6DAA4D;AACnE,SAASC,MAAM,EAAEC,IAAI,EAAkBC,KAAK,EAAEC,UAAU,QAAQ,gBAAe;AAE/E,SACEC,oBAAoB,QAEf,wBAAoB;AAmC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCC,GACD,OAAO,SAASC,gBAAgBC,KAA2B;IACzD,MAAM,EACJC,IAAI,EACJC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACLC,QAAQ,EACRC,SAAS,EACTC,OAAO,EACPC,SAAS,EACTC,IAAI,EACJC,OAAO,EACPC,QAAQ,EACRC,OAAO,EACR,GAAGZ;IACJ,MAAMa,aAAaC,QAAQV,UAAUU,QAAQJ;IAC7C,qBACE;;0BACE,KAACpB;gBAAiBY,OAAOA;;0BACzB,KAACV;gBACCuB,QAAQd;gBACRe,WAAWb;gBACXM,MAAMA;gBACNQ,cAAc;gBACdC,cAAc;gBACdC,aAAa;oBACXC,sBACE,MAACxB;wBACCyB,WAAU;wBACVC,SAAS;wBACTC,IAAI;4BAAEC,YAAY;4BAAUC,UAAU;4BAAQC,QAAQ;wBAAE;;0CAExD,KAAChC;gCACCiC,WAAWpC;+BACN;gCAAEqC,kBAAkB;gCAASC,cAAc;4BAAM;gCACtDC,MAAMzB;gCACN0B,MAAK;gCACLC,OAAM;0CAEL1B;;4BAEFC;4BACAK,wBAAU,KAACd,mCAAyBc,YAAc;4BAClDJ,CAAAA,6BAAAA,UAAWyB,MAAM,kBAChB,KAACxC;gCAAeyC,OAAOhC,SAASD;gCAAMkC,OAAO3B;iCAC3C;;;gBAGV;0BAECK,cAAcF,yBACb,MAACf;oBAAM0B,SAAS;;wBACbT,2BACC,MAACjB;4BACCyB,WAAU;4BACVC,SAAS;4BACTC,IAAI;gCAAEC,YAAY;gCAAUC,UAAU;gCAAQC,QAAQ;4BAAE;;gCAEvDtB;gCACAM,wBACC,KAACb;oCAAWuC,SAAQ;oCAAQJ,OAAM;8CAC/B;qCAED;;6BAEJ;wBACHrB;;qBAED;;;;AAIZ;AACAZ,gBAAgBsC,WAAW,GAAG;AAW9B;;;;;;CAMC,GACD,OAAO,SAASC,cAActC,KAAyB;IACrD,MAAM,EAAEkC,KAAK,EAAEK,KAAK,EAAEP,KAAK,EAAEI,UAAU,UAAU,EAAE,GAAGpC;IACtD,IAAIuC,UAAU,QAAQA,UAAUC,aAAaD,UAAU,IAAI,OAAO;IAClE,qBACE,KAAC5C;QACCoC,MAAK;QACLK,SAASA;QACTJ,OAAOA;QACPE,qBACE;;8BACE,KAACrC;oBAAW8B,WAAU;oBAAOS,SAAQ;oBAAUJ,OAAM;8BAClD,GAAGE,MAAM,EAAE,CAAC;;gBAEdK;;;;AAKX;AACAD,cAAcD,WAAW,GAAG;AAE5B,eAAetC,gBAAe"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ConsoleProposedTask } from '@aglyn/aglyn/plugin-manager/record-zone-props';
|
|
2
|
+
import type { DealStageApi, DealStageRef } from '../hooks/use-deal-stage-api';
|
|
3
|
+
import { type PipelineDoc } from '../model/deal-board-model';
|
|
4
|
+
import type { CrmTaskFields } from '../model/task-routes';
|
|
5
|
+
/** The record links a task proposed on a record's page is filed under. */
|
|
6
|
+
export type CrmRecordTaskLink = Pick<Partial<CrmTaskFields>, 'contactId' | 'companyId' | 'dealId'>;
|
|
7
|
+
export interface CrmRecordInsightsZoneProps {
|
|
8
|
+
/** The site the page is under, or `null` at the organization level; a lead's own site on a lead's page. */
|
|
9
|
+
hostId: string | null;
|
|
10
|
+
org?: Record<string, unknown> | null;
|
|
11
|
+
kind: 'contact' | 'company' | 'deal' | 'lead';
|
|
12
|
+
recordId: string;
|
|
13
|
+
/** The record's name as the page shows it. */
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* The links a proposed next step is filed under. Absent for a lead, which a
|
|
17
|
+
* task cannot name, so the zone offers no task there.
|
|
18
|
+
*/
|
|
19
|
+
taskLink?: CrmRecordTaskLink;
|
|
20
|
+
/** A deal's stage controls: its pipeline, the deal as the stage route names it, and the route. */
|
|
21
|
+
deal?: {
|
|
22
|
+
pipeline: PipelineDoc | null;
|
|
23
|
+
ref: DealStageRef;
|
|
24
|
+
stageId: string;
|
|
25
|
+
status: string;
|
|
26
|
+
api: DealStageApi;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/** The due time a proposed task opens the form with: the end of the working day, `days` from today. */
|
|
30
|
+
export declare function crmProposedDueAtMs(dueInDays: number, nowMs?: number): number;
|
|
31
|
+
/** A proposed next step as the task form's fields, linked to the record. */
|
|
32
|
+
export declare function crmProposedTaskFields(task: ConsoleProposedTask, link: CrmRecordTaskLink, nowMs?: number): Partial<CrmTaskFields>;
|
|
33
|
+
/**
|
|
34
|
+
* The `recordInsights` zone on a CRM record's page (AGL-2917), hosted through
|
|
35
|
+
* the renderer the console shell hands down, as the product editor hosts
|
|
36
|
+
* `seoFields`: outside the shell it renders nothing, and inside it every gate
|
|
37
|
+
* a console page's slot applies applies here.
|
|
38
|
+
*
|
|
39
|
+
* A widget proposes; this page writes. A proposed task opens the CRM's own
|
|
40
|
+
* task form with the proposal filled in, and the form's Save is the write,
|
|
41
|
+
* through `crm/task-save`. A proposed stage is confirmed first and then moved
|
|
42
|
+
* through `crm/deal-stage`, the one writer of a deal's stage, so the move
|
|
43
|
+
* emits the event every automation listens for. Only an open stage is
|
|
44
|
+
* accepted: winning or losing a deal is a decision the stage card takes.
|
|
45
|
+
*/
|
|
46
|
+
export declare function CrmRecordInsightsZone(props: CrmRecordInsightsZoneProps): import("react").JSX.Element;
|
|
47
|
+
export declare namespace CrmRecordInsightsZone {
|
|
48
|
+
var displayName: string;
|
|
49
|
+
}
|
|
50
|
+
export default CrmRecordInsightsZone;
|