@aglyn/plugins-marketing 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 +56 -0
- package/src/index.d.ts +19 -0
- package/src/index.js +20 -0
- package/src/index.js.map +1 -0
- package/src/lib/components/announcement-bar-card.component.d.ts +20 -0
- package/src/lib/components/announcement-bar-card.component.js +292 -0
- package/src/lib/components/announcement-bar-card.component.js.map +1 -0
- package/src/lib/components/campaign-composer.d.ts +84 -0
- package/src/lib/components/campaign-composer.js +1643 -0
- package/src/lib/components/campaign-composer.js.map +1 -0
- package/src/lib/components/campaign-conversions-card.d.ts +22 -0
- package/src/lib/components/campaign-conversions-card.js +642 -0
- package/src/lib/components/campaign-conversions-card.js.map +1 -0
- package/src/lib/components/campaign-detail-card.d.ts +55 -0
- package/src/lib/components/campaign-detail-card.js +771 -0
- package/src/lib/components/campaign-detail-card.js.map +1 -0
- package/src/lib/components/campaign-edit-drawer.d.ts +60 -0
- package/src/lib/components/campaign-edit-drawer.js +252 -0
- package/src/lib/components/campaign-edit-drawer.js.map +1 -0
- package/src/lib/components/campaign-email-zones.d.ts +111 -0
- package/src/lib/components/campaign-email-zones.js +54 -0
- package/src/lib/components/campaign-email-zones.js.map +1 -0
- package/src/lib/components/campaign-glance-card.component.d.ts +18 -0
- package/src/lib/components/campaign-glance-card.component.js +151 -0
- package/src/lib/components/campaign-glance-card.component.js.map +1 -0
- package/src/lib/components/campaign-members-section.d.ts +87 -0
- package/src/lib/components/campaign-members-section.js +499 -0
- package/src/lib/components/campaign-members-section.js.map +1 -0
- package/src/lib/components/campaign-reach-sections.d.ts +137 -0
- package/src/lib/components/campaign-reach-sections.js +694 -0
- package/src/lib/components/campaign-reach-sections.js.map +1 -0
- package/src/lib/components/campaign-report-card.d.ts +91 -0
- package/src/lib/components/campaign-report-card.js +667 -0
- package/src/lib/components/campaign-report-card.js.map +1 -0
- package/src/lib/components/campaign-test-send-drawer.d.ts +45 -0
- package/src/lib/components/campaign-test-send-drawer.js +238 -0
- package/src/lib/components/campaign-test-send-drawer.js.map +1 -0
- package/src/lib/components/campaigns-card.d.ts +31 -0
- package/src/lib/components/campaigns-card.js +667 -0
- package/src/lib/components/campaigns-card.js.map +1 -0
- package/src/lib/components/conversion-attribution.component.d.ts +62 -0
- package/src/lib/components/conversion-attribution.component.js +127 -0
- package/src/lib/components/conversion-attribution.component.js.map +1 -0
- package/src/lib/components/email-compose-card.d.ts +12 -0
- package/src/lib/components/email-compose-card.js +157 -0
- package/src/lib/components/email-compose-card.js.map +1 -0
- package/src/lib/components/email-detail.d.ts +40 -0
- package/src/lib/components/email-detail.js +1180 -0
- package/src/lib/components/email-detail.js.map +1 -0
- package/src/lib/components/email-edit-drawer.d.ts +54 -0
- package/src/lib/components/email-edit-drawer.js +172 -0
- package/src/lib/components/email-edit-drawer.js.map +1 -0
- package/src/lib/components/email-messages-widget.d.ts +22 -0
- package/src/lib/components/email-messages-widget.js +49 -0
- package/src/lib/components/email-messages-widget.js.map +1 -0
- package/src/lib/components/email-recipients-card.d.ts +50 -0
- package/src/lib/components/email-recipients-card.js +338 -0
- package/src/lib/components/email-recipients-card.js.map +1 -0
- package/src/lib/components/emails-list-card.d.ts +36 -0
- package/src/lib/components/emails-list-card.js +544 -0
- package/src/lib/components/emails-list-card.js.map +1 -0
- package/src/lib/components/experiment-zones.d.ts +78 -0
- package/src/lib/components/experiment-zones.js +65 -0
- package/src/lib/components/experiment-zones.js.map +1 -0
- package/src/lib/components/host-experiments-card.component.d.ts +17 -0
- package/src/lib/components/host-experiments-card.component.js +887 -0
- package/src/lib/components/host-experiments-card.component.js.map +1 -0
- package/src/lib/components/host-marketing-summary-card.component.d.ts +15 -0
- package/src/lib/components/host-marketing-summary-card.component.js +161 -0
- package/src/lib/components/host-marketing-summary-card.component.js.map +1 -0
- package/src/lib/components/host-overlays-card.component.d.ts +19 -0
- package/src/lib/components/host-overlays-card.component.js +783 -0
- package/src/lib/components/host-overlays-card.component.js.map +1 -0
- package/src/lib/components/marketing-console-page.d.ts +28 -0
- package/src/lib/components/marketing-console-page.js +166 -0
- package/src/lib/components/marketing-console-page.js.map +1 -0
- package/src/lib/components/marketing-console-sections.d.ts +34 -0
- package/src/lib/components/marketing-console-sections.js +77 -0
- package/src/lib/components/marketing-console-sections.js.map +1 -0
- package/src/lib/components/overlay-stats-row.component.d.ts +15 -0
- package/src/lib/components/overlay-stats-row.component.js +78 -0
- package/src/lib/components/overlay-stats-row.component.js.map +1 -0
- package/src/lib/components/popup-card.component.d.ts +18 -0
- package/src/lib/components/popup-card.component.js +462 -0
- package/src/lib/components/popup-card.component.js.map +1 -0
- package/src/lib/components/record-attribution-widget.d.ts +35 -0
- package/src/lib/components/record-attribution-widget.js +33 -0
- package/src/lib/components/record-attribution-widget.js.map +1 -0
- package/src/lib/components/site-runtime.d.ts +9 -0
- package/src/lib/components/site-runtime.js +1081 -0
- package/src/lib/components/site-runtime.js.map +1 -0
- package/src/lib/components/use-campaign-send-api.d.ts +35 -0
- package/src/lib/components/use-campaign-send-api.js +99 -0
- package/src/lib/components/use-campaign-send-api.js.map +1 -0
- package/src/lib/components/use-campaign-topic-options.d.ts +20 -0
- package/src/lib/components/use-campaign-topic-options.js +44 -0
- package/src/lib/components/use-campaign-topic-options.js.map +1 -0
- package/src/lib/components/use-emails-hub-path.d.ts +39 -0
- package/src/lib/components/use-emails-hub-path.js +70 -0
- package/src/lib/components/use-emails-hub-path.js.map +1 -0
- package/src/lib/components/use-marketing-hub-path.d.ts +21 -0
- package/src/lib/components/use-marketing-hub-path.js +50 -0
- package/src/lib/components/use-marketing-hub-path.js.map +1 -0
- package/src/lib/components/use-overlay-copy-editor.d.ts +79 -0
- package/src/lib/components/use-overlay-copy-editor.js +110 -0
- package/src/lib/components/use-overlay-copy-editor.js.map +1 -0
- package/src/lib/constants/bundle-common.d.ts +8 -0
- package/src/lib/constants/bundle-common.js +9 -0
- package/src/lib/constants/bundle-common.js.map +1 -0
- package/src/lib/model/campaign-membership-figures.d.ts +109 -0
- package/src/lib/model/campaign-membership-figures.js +113 -0
- package/src/lib/model/campaign-membership-figures.js.map +1 -0
- package/src/lib/model/compile-client-automations.d.ts +65 -0
- package/src/lib/model/compile-client-automations.js +95 -0
- package/src/lib/model/compile-client-automations.js.map +1 -0
- package/src/lib/model/experiments.d.ts +130 -0
- package/src/lib/model/experiments.js +186 -0
- package/src/lib/model/experiments.js.map +1 -0
- package/src/lib/model/index.d.ts +26 -0
- package/src/lib/model/index.js +26 -0
- package/src/lib/model/index.js.map +1 -0
- package/src/lib/model/marketing-record-routes.d.ts +6 -0
- package/src/lib/model/marketing-record-routes.js +46 -0
- package/src/lib/model/marketing-record-routes.js.map +1 -0
- package/src/lib/model/overlay-copy.d.ts +62 -0
- package/src/lib/model/overlay-copy.js +78 -0
- package/src/lib/model/overlay-copy.js.map +1 -0
- package/src/lib/model/overlays.d.ts +113 -0
- package/src/lib/model/overlays.js +93 -0
- package/src/lib/model/overlays.js.map +1 -0
- package/src/lib/model/site-contract.d.ts +100 -0
- package/src/lib/model/site-contract.js +23 -0
- package/src/lib/model/site-contract.js.map +1 -0
- package/src/lib/plugin.d.ts +27 -0
- package/src/lib/plugin.js +168 -0
- package/src/lib/plugin.js.map +1 -0
- package/src/lib/preview-props.d.ts +31 -0
- package/src/lib/preview-props.js +54 -0
- package/src/lib/preview-props.js.map +1 -0
- package/src/lib/server/campaign-manage.d.ts +62 -0
- package/src/lib/server/campaign-manage.js +829 -0
- package/src/lib/server/campaign-manage.js.map +1 -0
- package/src/lib/server/campaign-process-scheduled.d.ts +26 -0
- package/src/lib/server/campaign-process-scheduled.js +198 -0
- package/src/lib/server/campaign-process-scheduled.js.map +1 -0
- package/src/lib/server/campaign-recipients.d.ts +55 -0
- package/src/lib/server/campaign-recipients.js +219 -0
- package/src/lib/server/campaign-recipients.js.map +1 -0
- package/src/lib/server/campaign-send.d.ts +487 -0
- package/src/lib/server/campaign-send.js +3157 -0
- package/src/lib/server/campaign-send.js.map +1 -0
- package/src/lib/server/email-campaign-reach.d.ts +174 -0
- package/src/lib/server/email-campaign-reach.js +254 -0
- package/src/lib/server/email-campaign-reach.js.map +1 -0
- package/src/lib/server/email-events.d.ts +27 -0
- package/src/lib/server/email-events.js +714 -0
- package/src/lib/server/email-events.js.map +1 -0
- package/src/lib/server/get-client-automations.d.ts +60 -0
- package/src/lib/server/get-client-automations.js +87 -0
- package/src/lib/server/get-client-automations.js.map +1 -0
- package/src/lib/server/get-overlays.d.ts +28 -0
- package/src/lib/server/get-overlays.js +65 -0
- package/src/lib/server/get-overlays.js.map +1 -0
- package/src/lib/server/get-screen-experiments.d.ts +42 -0
- package/src/lib/server/get-screen-experiments.js +82 -0
- package/src/lib/server/get-screen-experiments.js.map +1 -0
- package/src/lib/server/lists-materialize.d.ts +18 -0
- package/src/lib/server/lists-materialize.js +130 -0
- package/src/lib/server/lists-materialize.js.map +1 -0
- package/src/lib/server/marketing-figures.d.ts +37 -0
- package/src/lib/server/marketing-figures.js +248 -0
- package/src/lib/server/marketing-figures.js.map +1 -0
- package/src/lib/server/site-page-enricher.d.ts +26 -0
- package/src/lib/server/site-page-enricher.js +210 -0
- package/src/lib/server/site-page-enricher.js.map +1 -0
- package/src/lib/server.d.ts +20 -0
- package/src/lib/server.js +152 -0
- package/src/lib/server.js.map +1 -0
- package/src/lib/site.d.ts +22 -0
- package/src/lib/site.js +48 -0
- package/src/lib/site.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/marketing/src/lib/components/campaign-report-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 { PageHeaderRecord, pluginDocsHelp } from '@aglyn/aglyn'\nimport { AppLink, CardDisplay } from '@aglyn/shared-ui-jsx'\nimport { ScrollTable } from '@aglyn/shared-ui-jsx/components/scroll-table.component'\nimport {\n Alert,\n Box,\n Button,\n Chip,\n Divider,\n Stack,\n TableBody,\n TableCell,\n TableHead,\n TableRow,\n Typography,\n} from '@mui/material'\nimport { doc } from 'firebase/firestore'\nimport { useFirestore, useFirestoreDoc } from '@aglyn/tenant-feature-instance'\nimport {\n campaignLinkReport,\n campaignReport,\n type CampaignLinkRollup,\n type CampaignStats,\n} from '@aglyn/shared-ui-email-campaigns/model/campaign-report'\nimport {\n campaignRevenueReport,\n type CampaignRevenueRollup,\n} from '@aglyn/shared-ui-email-campaigns/model/campaign-revenue'\nimport {\n campaignConversionsReport,\n type CampaignConversionsRollup,\n} from '@aglyn/shared-ui-email-campaigns/model/campaign-conversions'\n/*\n * The three renderers every email report shares. Imported rather than kept\n * here, so \"a rate prints its denominator\" is one implementation and not a\n * convention each new card has to remember.\n */\nimport {\n Figure,\n MoneyFigure,\n MoneyPerMessageRow,\n percent,\n RateRow,\n Section,\n} from '@aglyn/shared-ui-email-campaigns/components/report-figures'\nimport {\n emailSendTimeMs,\n} from '@aglyn/shared-ui-email-campaigns/model/email-record'\nimport {\n campaignSendDisplay,\n campaignSendProgress,\n} from '@aglyn/shared-ui-email-campaigns/model/campaign-container'\nimport { useEmailsHubPath } from './use-emails-hub-path'\n\n/**\n * The help affordance, hoisted so BOTH headers carry it.\n *\n * The unreadable-campaign branch below renders its own `CardDisplay`, and a\n * header without help is a header a reader has no way out of — which is\n * exactly the state that branch describes.\n */\nconst reportDocsHelp = pluginDocsHelp('emailCampaigns', {\n anchor: '#the-campaign-report',\n excerpt:\n 'What one campaign did: delivery, opens, clicks, bounces, complaints, ' +\n 'unsubscribes and the revenue it was credited with, each with the ' +\n 'population it is measured against.',\n})\n\nexport interface CampaignReportCardProps {\n hostId: string\n campaignId: string\n /** The marketing hub URL, for the way back to the campaigns list. */\n basePath: string\n}\n\n/**\n * ONE CAMPAIGN, MEASURED — and every denominator on screen.\n *\n * ## What was missing\n *\n * Opens and clicks have been recorded on the campaign document since AGL-268\n * and displayed as two words in a history row: `12 opens · 3 clicks`. Nothing\n * anywhere showed a rate, a delivery count, a bounce, a complaint or an\n * unsubscribe, and the populations the send itself measured — how large the\n * audience was, how many the consent rule refused, how many were already\n * suppressed — were computed on every send and written nowhere.\n *\n * ## The rule this screen is built around\n *\n * **Every rate names its denominator, in the same breath as the number.**\n *\n * That is not decoration. An open rate over `sent` and an open rate over\n * `delivered` are different numbers that share a label, and the difference\n * between them is exactly the mail that bounced — so a report that showed one\n * while the reader assumed the other would be wrong by however bad the\n * address list is, which is the case where being wrong matters most. Worse,\n * \"click rate\" is used in the wild for two unrelated quantities — clicks over\n * delivered, and clicks over openers — and they differ by a factor of three\n * or four on ordinary mail.\n *\n * So the arithmetic is not done here at all. `campaign-report.ts` returns\n * each rate as a triple carrying `denominatorLabel`, this file renders that\n * label, and a rate whose denominator is zero or unrecorded comes back `null`\n * and is drawn as \"—\" with a caveat naming the reason. There is no path\n * through this component that prints a percentage without saying what it is a\n * percentage of.\n *\n * ## What the page is about comes before how the mail did\n *\n * A campaign of one email is the ordinary shape, and this card is the page it\n * gets: the URL names a send, so there is no container above it and no list of\n * emails to draw. That collapse is honest, but it decided what the page was\n * ABOUT — delivery, engagement and rates are mechanics of a message, and a\n * page that led with them at length read as a mail report wearing the word\n * campaign.\n *\n * So the outcomes lead: what it caused, what it earned, where it sent people.\n * Two of those headings are the ones `campaign-reach-sections.tsx` puts at the\n * top of a campaign holding SEVERAL emails, and they are the same words here\n * deliberately — a merchant who opens a campaign of one and a campaign of six\n * is asking the same question and should not have to learn two vocabularies to\n * find the answer. The email's own figures follow, under a row that names the\n * message they belong to.\n *\n * Nothing about the reads changed with the order. The conversions, revenue and\n * destination figures were already on this page and already came from the four\n * documents below; they were simply underneath the mail.\n *\n * ## Three documents, whatever the campaign's size\n *\n * The whole screen is one campaign document plus one link-rollup document\n * plus one revenue-rollup document. All three are single-document listens, so\n * the cost does not move with the audience — a report over a 50,000-recipient\n * send reads the same three documents as one over ten. Aggregating the\n * per-recipient delivery log on mount would have been the obvious\n * implementation and would have read one document per recipient, every time\n * anybody opened the page; joining orders to campaigns at read time would\n * have been the same mistake one collection along, which is why the join is\n * done once at the sale and stored.\n *\n * ## No per-recipient view here, deliberately\n *\n * Every number on this screen is an aggregate that carries no address, and\n * that is what makes it three single-document reads. A per-recipient list is a\n * different read and a different question, so it lives where it is asked:\n * the design report's recipients table, which resolves the campaigns from the\n * design on a server that has already checked the reader's site role, and\n * returns only rows tagged with that site.\n *\n * The other per-recipient view — the staff delivery log on the user detail\n * page — spans every site on the install and is behind a staff claim that\n * records who looked. Neither reaches this card: adding a recipient list here\n * would put an unbounded read behind a widget whose whole cost model is that\n * it has none.\n */\nexport function CampaignReportCard(props: CampaignReportCardProps) {\n const { hostId, campaignId, basePath } = props\n // The sibling hub: the message's own page belongs to the Emails console.\n const emailsHub = useEmailsHubPath()\n const firestore = useFirestore()\n\n const { data: campaign } = useFirestoreDoc<\n Record<string, unknown> & { stats?: CampaignStats }\n >(\n () => doc(firestore, 'hosts', hostId, 'campaigns', campaignId),\n [firestore, hostId, campaignId],\n )\n /*\n * The link rollup, its own document rather than a field on the campaign.\n *\n * A map of destinations grows with the campaign's content and a campaign\n * document is read by the history list, the glance widget and the send\n * path; putting an unbounded map on it would make every one of those reads\n * larger. Split, the rollup is read by exactly the screen that renders it.\n */\n const { data: links } = useFirestoreDoc<CampaignLinkRollup>(\n () => doc(firestore, 'hosts', hostId, 'campaigns', campaignId, 'reports', 'links'),\n [firestore, hostId, campaignId],\n )\n /*\n * The revenue rollup, a third single-document listen.\n *\n * Its own document beside the link rollup rather than a field on the\n * campaign, for the reason the link rollup is: the campaign document is\n * read by the history list, the glance widget and the send path, and a map\n * that grows with the campaign's sales would enlarge every one of those\n * reads. The cost model in this file's header is unchanged in the way that\n * matters — the page still reads a fixed number of documents whatever the\n * audience, and no per-order or per-recipient read exists anywhere on it.\n */\n const { data: revenue } = useFirestoreDoc<CampaignRevenueRollup>(\n () =>\n doc(\n firestore,\n 'hosts',\n hostId,\n 'campaigns',\n campaignId,\n 'reports',\n 'revenue',\n ),\n [firestore, hostId, campaignId],\n )\n\n /*\n * The conversions rollup, a fourth single-document listen.\n *\n * Beside `reports/revenue` and read the same way, because it is the same\n * join answering the other half of the question: revenue is what a campaign\n * EARNED from people who named themselves at checkout, and this is what it\n * CAUSED among people who were anonymous until the moment they submitted,\n * signed up or booked. The cost model in this file's header is unchanged in\n * the way that matters — a fixed number of documents whatever the audience,\n * and no per-conversion read anywhere on the page.\n */\n const { data: conversions } = useFirestoreDoc<CampaignConversionsRollup>(\n () =>\n doc(\n firestore,\n 'hosts',\n hostId,\n 'campaigns',\n campaignId,\n 'reports',\n 'conversions',\n ),\n [firestore, hostId, campaignId],\n )\n\n const report = campaignReport(campaign?.stats)\n const linkReport = campaignLinkReport(links)\n const revenueReport = campaignRevenueReport({\n rollup: revenue,\n /*\n * The DENOMINATOR, handed over from the same document read at the same\n * instant rather than re-read here. `report.delivered` is `null` when no\n * delivery event was ever recorded, and it is passed as `null` so the\n * revenue figures over it are withheld for exactly the reason every other\n * rate over it is.\n */\n delivered: report.delivered,\n midFlight: campaign\n ? campaignSendProgress(campaign as never).state === 'sending'\n : false,\n })\n /*\n * No denominator is handed in, unlike the revenue report. A conversion RATE\n * over delivered messages would repeat the defect the revenue section\n * refuses for orders — one visitor can submit two forms, so the quotient\n * passes 100% without anything being wrong — and counting distinct people\n * instead needs a document per person per campaign, which is the\n * per-recipient read this screen's cost model exists to refuse.\n */\n const conversionsReport = campaignConversionsReport({ rollup: conversions })\n const subject = String(campaign?.subject ?? 'Campaign')\n const sendTimeMs = campaign ? emailSendTimeMs(campaign) : 0\n\n const backButton = (\n <Button\n component={AppLink as any}\n {...({ componentVariant: 'naked', nativeButton: false } as any)}\n href={`${basePath}/campaigns`}\n size=\"small\"\n color=\"primary\"\n >\n {'All campaigns'}\n </Button>\n )\n\n if (!campaign) {\n return (\n <CardDisplay\n header={'Campaign report'}\n help={reportDocsHelp}\n contentGutterX\n contentGutterY\n HeaderProps={{ action: backButton }}\n >\n {/*\n * Not \"no data\". A campaign that cannot be read is a different\n * situation from one with no engagement, and rendering an empty\n * report for the first is how somebody comes to believe a campaign\n * they sent reached nobody.\n */}\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'This campaign could not be loaded. It may have been deleted.'}\n </Typography>\n </CardDisplay>\n )\n }\n\n /* The card, named so the page chrome above it is a plain list of\n what this surface publishes upward. */\n const card = (\n <CardDisplay\n header={'Campaign report'}\n help={reportDocsHelp}\n contentGutterX\n contentGutterY\n HeaderProps={{ action: backButton }}\n >\n <Stack spacing={3}>\n {report.caveats.map((caveat) => (\n <Alert key={caveat.id} severity=\"info\">\n {caveat.message}\n </Alert>\n ))}\n\n {/*==========================================\n * WHAT THIS CAMPAIGN CAUSED — the page's first section, and the\n * heading a campaign of several emails leads with too.\n *\n * The same join as the revenue below, credited under the same rule,\n * answering it for people who were anonymous until the moment being\n * counted: they arrived from a campaign link, browsed, and only\n * became somebody when they submitted a form, signed up or booked.\n *\n * THE FOUR FIGURES ARE NEVER ADDED. One person filling in one form\n * writes a submission, a contact and a lead, so a total would count\n * that visit three times — and it would look like a bigger version\n * of a real number, which is why the model carries no total for this\n * JSX to reach for and the caveat says so in words above them.\n *\n * They are laid out in a row of independent `Figure`s rather than in\n * a table with a footer, because a footer row is where a reader\n * expects the sum to be.\n *=========================================*/}\n <Section title=\"What it caused\">\n {conversionsReport.caveats.map((caveat) => (\n <Alert key={caveat.id} severity=\"info\">\n {caveat.message}\n </Alert>\n ))}\n {conversionsReport.any ? (\n <Stack spacing={1}>\n <Stack\n direction=\"row\"\n spacing={4}\n useFlexGap\n sx={{ flexWrap: 'wrap' }}\n >\n {conversionsReport.kinds.map((entry) => (\n <Figure\n key={entry.kind}\n label={entry.label}\n value={entry.value}\n note={entry.note}\n />\n ))}\n </Stack>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {`Credited ${conversionsReport.model === 'last-click' ? 'to the last campaign whose link the visitor clicked' : `under the ${conversionsReport.model} model`}, ` +\n `within ${conversionsReport.windowDays} days of that click. ` +\n 'Somebody who converted without ever following a campaign ' +\n 'link is credited to no campaign at all — nothing is ' +\n 'inferred from a referrer — so these are a floor rather ' +\n 'than everything this campaign influenced. The ones ' +\n 'credited to nobody are counted under Conversions in the ' +\n 'marketing console.'}\n </Typography>\n {/*\n THE RECORDS BEHIND THE FIGURES. The rollup says how many; the\n list says which, and it is the only place the uncredited half\n is counted. A link rather than a table here — the records are\n a paged read and this page's whole cost model is a fixed\n number of documents whatever the audience.\n */}\n <Box>\n <Button\n component={AppLink as any}\n {...({\n componentVariant: 'naked',\n nativeButton: false,\n } as any)}\n href={`${basePath}/conversions/${campaignId}`}\n size=\"small\"\n color=\"primary\"\n >\n {'See these conversions'}\n </Button>\n </Box>\n </Stack>\n ) : (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {conversionsReport.recorded\n ? 'Nothing has been credited to this campaign yet.'\n : 'No conversions have been attributed to this campaign. A ' +\n 'form submission, lead, contact or booking is credited to ' +\n 'the last campaign whose link the visitor clicked, within ' +\n `${conversionsReport.windowDays} days — a campaign sent ` +\n 'before that was recorded will never show a figure here.'}\n </Typography>\n )}\n </Section>\n\n <Divider />\n\n {/*==========================================\n * WHAT THIS CAMPAIGN EARNED.\n *\n * The merchant's second question, and the one every compared\n * product answers by reconstructing revenue probabilistically\n * because it does not own the order. Here it is a join: the click\n * and the order are rows in one database, so there is no tracking\n * script, no catalog sync and nothing estimated except the model.\n *\n * THE MODEL IS ON SCREEN, in a sentence, above the money. A revenue\n * figure whose rule the reader cannot state is worse than no\n * figure, because they will use it anyway — and the two things they\n * have to know to use it are which campaign gets the credit when\n * several touched the buyer, and how long a click stays creditable.\n *\n * NET LEADS. Gross and refunded are both shown beside it, because\n * \"this campaign made $4,000\" and \"this campaign made $4,000 of\n * which $3,100 came back\" are different facts about whether to send\n * another one.\n *=========================================*/}\n <Section title=\"Revenue\">\n {revenueReport.caveats.map((caveat) => (\n <Alert key={caveat.id} severity=\"info\">\n {caveat.message}\n </Alert>\n ))}\n {revenueReport.currencies.length ? (\n <Stack spacing={3}>\n {revenueReport.currencies.map((entry) => (\n <Stack key={entry.currency} spacing={1}>\n {/*\n * The currency is a HEADING when there is more than one,\n * and absent when there is one. A per-currency label on a\n * report that only ever shows dollars is noise; the moment\n * there are two, the reader has to be able to see at a\n * glance that the blocks are not addable — which is also\n * what the caveat above says in words.\n */}\n {revenueReport.multiCurrency ? (\n <Typography variant=\"subtitle2\">\n {entry.currency.toUpperCase()}\n </Typography>\n ) : null}\n <Stack\n direction=\"row\"\n spacing={4}\n useFlexGap\n sx={{ flexWrap: 'wrap' }}\n >\n <MoneyFigure\n label=\"Net revenue\"\n cents={entry.netCents}\n currency={entry.currency}\n note=\"after refunds\"\n />\n <MoneyFigure\n label=\"Gross revenue\"\n cents={entry.grossCents}\n currency={entry.currency}\n note=\"as charged\"\n />\n <MoneyFigure\n label=\"Refunded\"\n cents={entry.refundedCents}\n currency={entry.currency}\n note=\"handed back\"\n />\n <Figure\n label=\"Orders\"\n value={entry.orders}\n note=\"credited to this campaign\"\n />\n <Figure\n label=\"Fully refunded\"\n value={entry.refundedOrders}\n note=\"of those orders\"\n />\n </Stack>\n <MoneyPerMessageRow\n label=\"Net revenue per delivered message\"\n figure={entry.netPerDelivered}\n />\n </Stack>\n ))}\n {/*\n * NO CONVERSION RATE, and this is where a reader would look\n * for one. Orders over delivered is not a rate: one buyer can\n * place two orders, so the quotient passes 100% without\n * anything being wrong — the same defect that keeps `opens`\n * out of the open-rate numerator two sections above. Counting\n * distinct buyers instead would need a document per person per\n * campaign, which is the per-recipient read this screen's cost\n * model exists to refuse. The order count is shown as a count.\n */}\n <Typography variant=\"caption\" color=\"text.secondary\">\n {`Credited ${revenueReport.model === 'last-click' ? 'to the last campaign whose link the buyer clicked' : `under the ${revenueReport.model} model`}, ` +\n `within ${revenueReport.windowDays} days of that click. ` +\n 'Clicks only — an open is not treated as evidence that ' +\n 'anybody read the email. An order placed by somebody who ' +\n 'never clicked, or who checked out without giving an ' +\n 'address, is credited to no campaign, so this is a floor ' +\n 'rather than every sale this campaign influenced.'}\n </Typography>\n </Stack>\n ) : (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {revenueReport.recorded\n ? 'No orders have been credited to this campaign.'\n : 'No revenue has been attributed to this campaign. Orders ' +\n 'are credited to the last campaign whose link the buyer ' +\n `clicked, within ${revenueReport.windowDays} days — a ` +\n 'campaign sent before that was recorded, or one on a site ' +\n 'with no store, will never show a figure here.'}\n </Typography>\n )}\n </Section>\n\n <Divider />\n\n <Section title=\"Where it sent people\">\n {/*\n The heading a campaign of several emails carries over the same\n question, so the two shapes of campaign page read alike. A\n campaign owns no page — this is where its mail was actually\n followed to, which is the only account of it the data holds.\n */}\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'The pages this campaign’s links were followed to.'}\n </Typography>\n {linkReport.rows.length ? (\n <>\n <ScrollTable size=\"small\">\n <TableHead>\n <TableRow>\n <TableCell>{'Destination'}</TableCell>\n <TableCell align=\"right\">{'Clicks'}</TableCell>\n <TableCell align=\"right\">{'Share'}</TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {linkReport.rows.map((row) => (\n <TableRow key={row.url}>\n <TableCell sx={{ wordBreak: 'break-all' }}>\n {row.url}\n </TableCell>\n <TableCell align=\"right\" sx={{ fontWeight: 'bold' }}>\n {row.clicks.toLocaleString()}\n </TableCell>\n <TableCell align=\"right\">\n {row.share\n ? `${percent(row.share.value)} of ${row.share.denominator.toLocaleString()} ${row.share.denominatorLabel}`\n : '—'}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </ScrollTable>\n {/*\n * The normalisation, stated rather than left for somebody to\n * discover from a total that does not add up. Two links to the\n * same page distinguished only by their UTM tags are one row\n * here, and a merchant comparing this table with the campaign\n * they built has to be told that before they conclude a link\n * is missing.\n */}\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'Counted by address and path — query strings are dropped, so ' +\n 'two links to the same page with different tracking ' +\n 'parameters count as one row.'}\n </Typography>\n {linkReport.unattributedClicks ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {`${linkReport.unattributedClicks.toLocaleString()} clicks ` +\n 'arrived without a destination and are not in this table.'}\n </Typography>\n ) : null}\n {linkReport.overflowClicks ? (\n <Alert severity=\"info\">\n {`This campaign has more distinct destinations than the ` +\n `rollup keeps. ${linkReport.overflowClicks.toLocaleString()} ` +\n 'clicks landed on links past that limit and are counted ' +\n 'in the click total above but not in this table.'}\n </Alert>\n ) : null}\n </>\n ) : (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {report.clicks\n ? 'Clicks were recorded for this campaign, but none of them ' +\n 'carried a destination, so there is nothing to break down ' +\n 'by link.'\n : 'No link clicks have been recorded for this campaign.'}\n </Typography>\n )}\n </Section>\n\n <Divider />\n\n {/*==========================================\n * THE EMAIL THE FIGURES BELOW CAME FROM — and the hinge between the\n * two halves of this page.\n *\n * This screen is reached at `/marketing/campaigns/{sendId}`, which\n * is a CAMPAIGN url resolving to a send — the fall-through that keeps\n * every unsubscribe footer and every pasted report link working. So\n * a reader arrives from the campaigns table, where the row carries a\n * \"Single send\" chip, and everything under this row is a fact about\n * a message rather than about the campaign.\n *\n * Figures with no visible source read as a campaign holding no\n * emails while reporting real numbers, which is a contradiction\n * rather than a shortage of detail. Naming the one email — and\n * saying it IS the campaign, which is what the chip already claims\n * and what `campaignListRows` already does at read time — is what\n * makes the page answer the question it raises.\n *\n * One row, from the document this card already read: no query, no\n * second listen, and the two-document cost the header describes is\n * unchanged.\n *=========================================*/}\n <Section title=\"The email in this campaign\">\n <Stack spacing={1}>\n <Stack\n direction=\"row\"\n spacing={1}\n useFlexGap\n sx={{ alignItems: 'center', flexWrap: 'wrap' }}\n >\n {/*\n The MESSAGE's own page, which the Emails console owns — hence\n the sibling hub rather than this surface's `basePath`. Plain\n text until that hub resolves: a link with no destination is\n worse than none, and the subject is what the reader came for\n either way.\n */}\n {emailsHub ? (\n <AppLink href={`${emailsHub}/messages/${campaignId}`}>\n {subject}\n </AppLink>\n ) : (\n <Typography variant=\"body2\">{subject}</Typography>\n )}\n {/*\n What the email is DOING, not the field it stores. One\n delivering an audience larger than one batch is written back\n as `scheduled` between runs, so a chip rendering the status\n said \"Scheduled\" at the head of a report of five hundred\n deliveries.\n */}\n <Chip\n size=\"small\"\n label={campaignSendDisplay(campaign as never).label}\n />\n <Chip\n size=\"small\"\n variant=\"outlined\"\n label=\"Single send\"\n title={\n 'One email, sent on its own rather than as part of a ' +\n 'campaign of several. Its report and its unsubscribe links ' +\n 'are unchanged.'\n }\n />\n <Typography variant=\"caption\" color=\"text.secondary\">\n {sendTimeMs\n ? new Date(sendTimeMs).toLocaleString()\n : 'not recorded'}\n </Typography>\n </Stack>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'This campaign is one email, so the sections above are what ' +\n 'that one email caused. What follows is the mail itself — ' +\n 'how it was delivered and how it was read. Open the message ' +\n 'for its body and the people it reached.'}\n </Typography>\n </Stack>\n </Section>\n\n <Divider />\n\n {/*==========================================\n * WHAT HAPPENED TO THE MAIL.\n *\n * Counts first and rates second, in that order and not the other\n * way round, because a rate is only readable once you know what it\n * was taken over — and because the counts are the part that is\n * always true. Every rate below can be absent; none of these can.\n *=========================================*/}\n <Section title=\"Delivery\">\n <Stack direction=\"row\" spacing={4} useFlexGap sx={{ flexWrap: 'wrap' }}>\n <Figure\n label=\"Addressed\"\n value={report.recipients}\n note=\"after the per-send cap\"\n />\n <Figure\n label=\"Sent\"\n value={report.sent}\n note=\"accepted by the provider\"\n />\n <Figure\n label=\"Delivered\"\n value={report.delivered}\n note=\"accepted by the receiving server\"\n />\n <Figure label=\"Bounced\" value={report.bounced} note=\"of sent\" />\n <Figure\n label=\"Marked as spam\"\n value={report.complained}\n note=\"of delivered\"\n />\n </Stack>\n </Section>\n\n <Divider />\n\n <Section title=\"Engagement\">\n {/*\n * BOTH the event count and the distinct count, side by side.\n *\n * `Opens` is every open event — one reader opening four times is\n * four — and it is the number this product has always shown. It\n * cannot be a rate numerator: divided by anything it exceeds 100%\n * the moment somebody reads an email twice. `Readers who opened`\n * is the distinct count, and it is what the rate below divides.\n * Showing only one of them would either hide activity or invite a\n * rate nobody can defend, so both are here with different names.\n */}\n <Stack direction=\"row\" spacing={4} useFlexGap sx={{ flexWrap: 'wrap' }}>\n <Figure\n label=\"Opens\"\n value={report.opens}\n note=\"every open, repeats included\"\n />\n <Figure\n label=\"Readers who opened\"\n value={report.uniqueOpens}\n note=\"distinct recipients\"\n />\n <Figure\n label=\"Clicks\"\n value={report.clicks}\n note=\"every click, repeats included\"\n />\n <Figure\n label=\"Readers who clicked\"\n value={report.uniqueClicks}\n note=\"distinct recipients\"\n />\n <Figure\n label=\"Unsubscribed\"\n value={report.unsubscribes}\n note=\"through this campaign's link\"\n />\n </Stack>\n </Section>\n\n <Divider />\n\n <Section title=\"Rates\">\n <Stack spacing={1}>\n <RateRow label=\"Delivery rate\" rate={report.rates.delivery} />\n <RateRow label=\"Open rate\" rate={report.rates.open} />\n <RateRow label=\"Click rate\" rate={report.rates.click} />\n <RateRow\n label=\"Click-to-open rate\"\n rate={report.rates.clickToOpen}\n />\n <RateRow label=\"Bounce rate\" rate={report.rates.bounce} />\n <RateRow label=\"Complaint rate\" rate={report.rates.complaint} />\n <RateRow\n label=\"Unsubscribe rate\"\n rate={report.rates.unsubscribe}\n />\n </Stack>\n </Section>\n\n {report.populations.length ? (\n <>\n <Divider />\n <Section title=\"Who this went to\">\n {/*\n * The populations the SEND measured, recorded at send time.\n *\n * Not recomputed here, and the note under the heading says so:\n * consent records change and addresses get suppressed, so\n * asking the list today produces a number that is true of the\n * list and false of the campaign.\n */}\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Measured when this campaign was sent, and stored as it was ' +\n 'then. These figures describe the send, not the audience ' +\n 'as it stands today.'}\n </Typography>\n <ScrollTable size=\"small\">\n <TableBody>\n {report.populations.map((population) => (\n <TableRow key={population.id}>\n <TableCell>{population.label}</TableCell>\n <TableCell align=\"right\" sx={{ fontWeight: 'bold' }}>\n {population.count.toLocaleString()}\n </TableCell>\n <TableCell align=\"right\">\n <Typography variant=\"caption\" color=\"text.secondary\">\n {`of ${population.of.toLocaleString()} ${population.ofLabel}`}\n </Typography>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </ScrollTable>\n </Section>\n </>\n ) : null}\n </Stack>\n </CardDisplay>\n )\n\n return (\n <>\n {/* The page heading and the trail name the send; this card is\n then free to say what it holds rather than repeating the title. */}\n <PageHeaderRecord\n title={\n campaign ? String(campaign.subject || '') || campaignId : undefined\n }\n />\n {card}\n </>\n )\n}\nCampaignReportCard.displayName = 'CampaignReportCard'\n\nexport default CampaignReportCard\n"],"names":["PageHeaderRecord","pluginDocsHelp","AppLink","CardDisplay","ScrollTable","Alert","Box","Button","Chip","Divider","Stack","TableBody","TableCell","TableHead","TableRow","Typography","doc","useFirestore","useFirestoreDoc","campaignLinkReport","campaignReport","campaignRevenueReport","campaignConversionsReport","Figure","MoneyFigure","MoneyPerMessageRow","percent","RateRow","Section","emailSendTimeMs","campaignSendDisplay","campaignSendProgress","useEmailsHubPath","reportDocsHelp","anchor","excerpt","CampaignReportCard","props","hostId","campaignId","basePath","emailsHub","firestore","data","campaign","links","revenue","conversions","report","stats","linkReport","revenueReport","rollup","delivered","midFlight","state","conversionsReport","subject","String","sendTimeMs","backButton","component","componentVariant","nativeButton","href","size","color","header","help","contentGutterX","contentGutterY","HeaderProps","action","variant","card","spacing","caveats","map","caveat","severity","message","id","title","any","direction","useFlexGap","sx","flexWrap","kinds","entry","label","value","note","kind","model","windowDays","recorded","currencies","length","multiCurrency","currency","toUpperCase","cents","netCents","grossCents","refundedCents","orders","refundedOrders","figure","netPerDelivered","rows","align","row","wordBreak","url","fontWeight","clicks","toLocaleString","share","denominator","denominatorLabel","unattributedClicks","overflowClicks","alignItems","Date","recipients","sent","bounced","complained","opens","uniqueOpens","uniqueClicks","unsubscribes","rate","rates","delivery","open","click","clickToOpen","bounce","complaint","unsubscribe","populations","population","count","of","ofLabel","undefined","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAEA,SAASA,gBAAgB,EAAEC,cAAc,QAAQ,eAAc;AAC/D,SAASC,OAAO,EAAEC,WAAW,QAAQ,uBAAsB;AAC3D,SAASC,WAAW,QAAQ,yDAAwD;AACpF,SACEC,KAAK,EACLC,GAAG,EACHC,MAAM,EACNC,IAAI,EACJC,OAAO,EACPC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,UAAU,QACL,gBAAe;AACtB,SAASC,GAAG,QAAQ,qBAAoB;AACxC,SAASC,YAAY,EAAEC,eAAe,QAAQ,iCAAgC;AAC9E,SACEC,kBAAkB,EAClBC,cAAc,QAGT,yDAAwD;AAC/D,SACEC,qBAAqB,QAEhB,0DAAyD;AAChE,SACEC,yBAAyB,QAEpB,8DAA6D;AACpE;;;;CAIC,GACD,SACEC,MAAM,EACNC,WAAW,EACXC,kBAAkB,EAClBC,OAAO,EACPC,OAAO,EACPC,OAAO,QACF,6DAA4D;AACnE,SACEC,eAAe,QACV,sDAAqD;AAC5D,SACEC,mBAAmB,EACnBC,oBAAoB,QACf,4DAA2D;AAClE,SAASC,gBAAgB,QAAQ,2BAAuB;AAExD;;;;;;CAMC,GACD,MAAMC,iBAAiBhC,eAAe,kBAAkB;IACtDiC,QAAQ;IACRC,SACE,0EACA,sEACA;AACJ;AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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DAAUP,OAAM;sEACjC,CAAC,GAAG,EAAE6E,WAAWE,EAAE,CAAC5B,cAAc,GAAG,CAAC,EAAE0B,WAAWG,OAAO,EAAE;;;;+CAPpDH,WAAW9D,EAAE;;;;;;qBAgBpC;;;;IAKV,qBACE;;0BAGE,KAACjF;gBACCkF,OACEtC,WAAWc,OAAOd,SAASa,OAAO,IAAI,OAAOlB,aAAa4G;;YAG7DzE;;;AAGP;AACAtC,mBAAmBgH,WAAW,GAAG;AAEjC,eAAehH,mBAAkB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { CampaignSendApiResult } from './use-campaign-send-api';
|
|
2
|
+
export interface CampaignTestSendDrawerProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
/** The one authorized POST to the campaign API. */
|
|
6
|
+
post: (payload: Record<string, unknown>) => Promise<CampaignSendApiResult>;
|
|
7
|
+
/** Everything about the message, so the test mails what is composed. */
|
|
8
|
+
message: Record<string, unknown>;
|
|
9
|
+
/** What the composer says this send will leave as, for the summary. */
|
|
10
|
+
identity: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* PROOF ONE EMAIL — as somebody, to somebody, from an identity.
|
|
14
|
+
*
|
|
15
|
+
* ## The two pickers are different kinds of thing, and the screen says so
|
|
16
|
+
*
|
|
17
|
+
* The whole risk in this drawer is a person reading the persona picker as an
|
|
18
|
+
* address book. Choosing a contact fills the merge tags with THEIR data and
|
|
19
|
+
* mails them nothing; the only address anything is delivered to is the one in
|
|
20
|
+
* the second field. Those two facts are stated next to the controls rather
|
|
21
|
+
* than in help text, and the summary at the bottom restates both in one
|
|
22
|
+
* sentence before the button.
|
|
23
|
+
*
|
|
24
|
+
* ## Why the recipient is a list and not a text box
|
|
25
|
+
*
|
|
26
|
+
* A test send is exempt from the marketing-consent rule, so the server only
|
|
27
|
+
* accepts an address belonging to an account on this workspace. Offering a
|
|
28
|
+
* free-text box would mean every other address a person could type is a
|
|
29
|
+
* refusal they had no way to predict — the rule is the same either way, and a
|
|
30
|
+
* picker is the honest way to show it.
|
|
31
|
+
*
|
|
32
|
+
* ## What a test does not do
|
|
33
|
+
*
|
|
34
|
+
* It writes no campaign record, moves no counter, and joins no reach record,
|
|
35
|
+
* so proofing an email six times does not make its report say seven. It still
|
|
36
|
+
* runs both suppression lists and still refuses an address with a recorded
|
|
37
|
+
* opt-out: neither of those is relaxed for a test, because a suppressed
|
|
38
|
+
* address is suppressed for a reason that has nothing to do with who is
|
|
39
|
+
* asking.
|
|
40
|
+
*/
|
|
41
|
+
export declare function CampaignTestSendDrawer(props: CampaignTestSendDrawerProps): import("react").JSX.Element;
|
|
42
|
+
export declare namespace CampaignTestSendDrawer {
|
|
43
|
+
var displayName: string;
|
|
44
|
+
}
|
|
45
|
+
export default CampaignTestSendDrawer;
|
|
@@ -0,0 +1,238 @@
|
|
|
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 { ICON_VARIANT_CLOSE } from "@aglyn/shared-data-enums";
|
|
20
|
+
import { Container, MdiIcon, SrOnly } from "@aglyn/shared-ui-jsx";
|
|
21
|
+
import { NavigationDrawerComponent } from "@aglyn/shared-ui-jsx/components/navigation-drawer.component";
|
|
22
|
+
import { Alert, Button, Divider, IconButton, MenuItem, Stack, TextField, Typography } from "@mui/material";
|
|
23
|
+
import { useCallback, useEffect, useState } from "react";
|
|
24
|
+
const SOURCE_LABEL = {
|
|
25
|
+
lead: 'Lead',
|
|
26
|
+
member: 'Site user',
|
|
27
|
+
contact: 'Contact'
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* PROOF ONE EMAIL — as somebody, to somebody, from an identity.
|
|
31
|
+
*
|
|
32
|
+
* ## The two pickers are different kinds of thing, and the screen says so
|
|
33
|
+
*
|
|
34
|
+
* The whole risk in this drawer is a person reading the persona picker as an
|
|
35
|
+
* address book. Choosing a contact fills the merge tags with THEIR data and
|
|
36
|
+
* mails them nothing; the only address anything is delivered to is the one in
|
|
37
|
+
* the second field. Those two facts are stated next to the controls rather
|
|
38
|
+
* than in help text, and the summary at the bottom restates both in one
|
|
39
|
+
* sentence before the button.
|
|
40
|
+
*
|
|
41
|
+
* ## Why the recipient is a list and not a text box
|
|
42
|
+
*
|
|
43
|
+
* A test send is exempt from the marketing-consent rule, so the server only
|
|
44
|
+
* accepts an address belonging to an account on this workspace. Offering a
|
|
45
|
+
* free-text box would mean every other address a person could type is a
|
|
46
|
+
* refusal they had no way to predict — the rule is the same either way, and a
|
|
47
|
+
* picker is the honest way to show it.
|
|
48
|
+
*
|
|
49
|
+
* ## What a test does not do
|
|
50
|
+
*
|
|
51
|
+
* It writes no campaign record, moves no counter, and joins no reach record,
|
|
52
|
+
* so proofing an email six times does not make its report say seven. It still
|
|
53
|
+
* runs both suppression lists and still refuses an address with a recorded
|
|
54
|
+
* opt-out: neither of those is relaxed for a test, because a suppressed
|
|
55
|
+
* address is suppressed for a reason that has nothing to do with who is
|
|
56
|
+
* asking.
|
|
57
|
+
*/ export function CampaignTestSendDrawer(props) {
|
|
58
|
+
const { open, onClose, post, message, identity } = props;
|
|
59
|
+
const [recipients, setRecipients] = useState(null);
|
|
60
|
+
const [personas, setPersonas] = useState([]);
|
|
61
|
+
const [to, setTo] = useState('');
|
|
62
|
+
const [personaEmail, setPersonaEmail] = useState('');
|
|
63
|
+
const [busy, setBusy] = useState(false);
|
|
64
|
+
const [error, setError] = useState('');
|
|
65
|
+
const [sentTo, setSentTo] = useState('');
|
|
66
|
+
/*
|
|
67
|
+
* ASKED ON OPEN, not on mount.
|
|
68
|
+
*
|
|
69
|
+
* The composer mounts on every campaign page; this drawer is opened
|
|
70
|
+
* deliberately. Loading the roster and an audience sample behind the
|
|
71
|
+
* composer would spend those reads for everybody who never proofs anything,
|
|
72
|
+
* which is most people most of the time.
|
|
73
|
+
*/ useEffect(()=>{
|
|
74
|
+
if (!open) return;
|
|
75
|
+
let active = true;
|
|
76
|
+
setError('');
|
|
77
|
+
setSentTo('');
|
|
78
|
+
void (async ()=>{
|
|
79
|
+
var _ref, _ref1;
|
|
80
|
+
const { response, payload } = await post({
|
|
81
|
+
action: 'proofOptions'
|
|
82
|
+
});
|
|
83
|
+
if (!active) return;
|
|
84
|
+
if (!response.ok) {
|
|
85
|
+
var _ref2;
|
|
86
|
+
setRecipients([]);
|
|
87
|
+
return setError((_ref2 = payload == null ? void 0 : payload.error) != null ? _ref2 : 'Could not load who a test can go to');
|
|
88
|
+
}
|
|
89
|
+
const list = (_ref = payload == null ? void 0 : payload.recipients) != null ? _ref : [];
|
|
90
|
+
setRecipients(list);
|
|
91
|
+
setPersonas((_ref1 = payload == null ? void 0 : payload.personas) != null ? _ref1 : []);
|
|
92
|
+
// Yourself, because that is the answer nine times in ten and it is the
|
|
93
|
+
// one choice that needs no thought.
|
|
94
|
+
setTo((current)=>{
|
|
95
|
+
var _list_find;
|
|
96
|
+
return current || ((_list_find = list.find((one)=>one.self)) == null ? void 0 : _list_find.email) || '';
|
|
97
|
+
});
|
|
98
|
+
})().catch(()=>{
|
|
99
|
+
if (active) setError('Could not load who a test can go to');
|
|
100
|
+
});
|
|
101
|
+
return ()=>{
|
|
102
|
+
active = false;
|
|
103
|
+
};
|
|
104
|
+
}, [
|
|
105
|
+
open,
|
|
106
|
+
post
|
|
107
|
+
]);
|
|
108
|
+
const handleSend = useCallback(async ()=>{
|
|
109
|
+
var _ref;
|
|
110
|
+
if (busy || !to) return;
|
|
111
|
+
setBusy(true);
|
|
112
|
+
setError('');
|
|
113
|
+
const { response, payload } = await post(_extends({}, message, {
|
|
114
|
+
action: 'test',
|
|
115
|
+
to
|
|
116
|
+
}, personaEmail ? {
|
|
117
|
+
personaEmail
|
|
118
|
+
} : {}));
|
|
119
|
+
setBusy(false);
|
|
120
|
+
if (!response.ok) {
|
|
121
|
+
var _ref1;
|
|
122
|
+
return setError((_ref1 = payload == null ? void 0 : payload.error) != null ? _ref1 : 'The test send was refused');
|
|
123
|
+
}
|
|
124
|
+
setSentTo(String((_ref = payload == null ? void 0 : payload.to) != null ? _ref : to));
|
|
125
|
+
}, [
|
|
126
|
+
busy,
|
|
127
|
+
post,
|
|
128
|
+
message,
|
|
129
|
+
to,
|
|
130
|
+
personaEmail
|
|
131
|
+
]);
|
|
132
|
+
const persona = personas.find((one)=>one.email === personaEmail);
|
|
133
|
+
return /*#__PURE__*/ _jsx(NavigationDrawerComponent, {
|
|
134
|
+
open: open,
|
|
135
|
+
anchor: "right",
|
|
136
|
+
variant: "temporary",
|
|
137
|
+
onClose: onClose,
|
|
138
|
+
AppBarProps: {
|
|
139
|
+
color: 'surface'
|
|
140
|
+
},
|
|
141
|
+
appBarLeft: /*#__PURE__*/ _jsxs(_Fragment, {
|
|
142
|
+
children: [
|
|
143
|
+
/*#__PURE__*/ _jsxs(IconButton, {
|
|
144
|
+
color: "inherit",
|
|
145
|
+
edge: "start",
|
|
146
|
+
onClick: onClose,
|
|
147
|
+
sx: {
|
|
148
|
+
mr: 2
|
|
149
|
+
},
|
|
150
|
+
children: [
|
|
151
|
+
/*#__PURE__*/ _jsx(MdiIcon, {
|
|
152
|
+
path: ICON_VARIANT_CLOSE.path
|
|
153
|
+
}),
|
|
154
|
+
/*#__PURE__*/ _jsx(SrOnly, {
|
|
155
|
+
children: "close drawer"
|
|
156
|
+
})
|
|
157
|
+
]
|
|
158
|
+
}),
|
|
159
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
160
|
+
variant: "h6",
|
|
161
|
+
component: "div",
|
|
162
|
+
children: 'Send a test'
|
|
163
|
+
})
|
|
164
|
+
]
|
|
165
|
+
}),
|
|
166
|
+
children: /*#__PURE__*/ _jsx(Container, {
|
|
167
|
+
gutterY: true,
|
|
168
|
+
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
169
|
+
spacing: 2,
|
|
170
|
+
children: [
|
|
171
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
172
|
+
variant: "body2",
|
|
173
|
+
color: "text.secondary",
|
|
174
|
+
children: 'A test mails one copy of this email and records nothing — no ' + 'recipient count, no report figures, and nobody is marked as ' + 'having received it.'
|
|
175
|
+
}),
|
|
176
|
+
/*#__PURE__*/ _jsxs(TextField, {
|
|
177
|
+
select: true,
|
|
178
|
+
label: "Fill the merge tags with",
|
|
179
|
+
value: personaEmail,
|
|
180
|
+
onChange: (event)=>setPersonaEmail(event.target.value),
|
|
181
|
+
size: "small",
|
|
182
|
+
disabled: busy,
|
|
183
|
+
helperText: persona ? `The email will read as if addressed to ${persona.name || persona.email}. ${persona.email} is not sent anything.` : 'Leave this alone to see the fallbacks — {{firstName|there}} and the rest — as somebody with no stored name would.',
|
|
184
|
+
children: [
|
|
185
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
186
|
+
value: "",
|
|
187
|
+
children: 'Nobody in particular'
|
|
188
|
+
}),
|
|
189
|
+
personas.map((one)=>/*#__PURE__*/ _jsx(MenuItem, {
|
|
190
|
+
value: one.email,
|
|
191
|
+
children: `${one.name || one.email} · ${SOURCE_LABEL[one.source]}`
|
|
192
|
+
}, one.email))
|
|
193
|
+
]
|
|
194
|
+
}),
|
|
195
|
+
/*#__PURE__*/ _jsx(Divider, {}),
|
|
196
|
+
/*#__PURE__*/ _jsx(TextField, {
|
|
197
|
+
select: true,
|
|
198
|
+
label: "Deliver it to",
|
|
199
|
+
value: to,
|
|
200
|
+
onChange: (event)=>setTo(event.target.value),
|
|
201
|
+
size: "small",
|
|
202
|
+
disabled: busy || !(recipients == null ? void 0 : recipients.length),
|
|
203
|
+
helperText: 'The only address this test is sent to. A test can go to you or ' + 'to someone with an account on this workspace — never to a ' + 'contact, who has not agreed to receive it.',
|
|
204
|
+
children: (recipients != null ? recipients : []).map((one)=>/*#__PURE__*/ _jsx(MenuItem, {
|
|
205
|
+
value: one.email,
|
|
206
|
+
children: one.self ? `${one.email} (you)` : `${one.label} · ${one.email}`
|
|
207
|
+
}, one.email))
|
|
208
|
+
}),
|
|
209
|
+
/*#__PURE__*/ _jsx(Alert, {
|
|
210
|
+
severity: "info",
|
|
211
|
+
children: /*#__PURE__*/ _jsx(Typography, {
|
|
212
|
+
variant: "body2",
|
|
213
|
+
children: to ? `We will send one copy to ${to}, from ${identity || 'this site’s sending address'}${persona ? `, written as if it were going to ${persona.name || persona.email}` : ''}.` : 'Choose an address to send the test to.'
|
|
214
|
+
})
|
|
215
|
+
}),
|
|
216
|
+
error ? /*#__PURE__*/ _jsx(Alert, {
|
|
217
|
+
severity: "warning",
|
|
218
|
+
children: error
|
|
219
|
+
}) : null,
|
|
220
|
+
sentTo ? /*#__PURE__*/ _jsx(Alert, {
|
|
221
|
+
severity: "success",
|
|
222
|
+
children: `Sent to ${sentTo}.`
|
|
223
|
+
}) : null,
|
|
224
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
225
|
+
variant: "contained",
|
|
226
|
+
disabled: busy || !to,
|
|
227
|
+
onClick: ()=>void handleSend(),
|
|
228
|
+
children: busy ? 'Sending…' : 'Send test'
|
|
229
|
+
})
|
|
230
|
+
]
|
|
231
|
+
})
|
|
232
|
+
})
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
CampaignTestSendDrawer.displayName = 'CampaignTestSendDrawer';
|
|
236
|
+
export default CampaignTestSendDrawer;
|
|
237
|
+
|
|
238
|
+
//# sourceMappingURL=campaign-test-send-drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/marketing/src/lib/components/campaign-test-send-drawer.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 { ICON_VARIANT_CLOSE } from '@aglyn/shared-data-enums'\nimport { Container, MdiIcon, SrOnly } from '@aglyn/shared-ui-jsx'\nimport { NavigationDrawerComponent } from '@aglyn/shared-ui-jsx/components/navigation-drawer.component'\nimport {\n Alert,\n Button,\n Divider,\n IconButton,\n MenuItem,\n Stack,\n TextField,\n Typography,\n} from '@mui/material'\nimport { useCallback, useEffect, useState } from 'react'\nimport type { CampaignSendApiResult } from './use-campaign-send-api'\n\n/** One address a test may be delivered to, as the route reports it. */\ninterface ProofRecipient {\n email: string\n label: string\n self: boolean\n}\n\n/** One person a test may be RENDERED as. Receives nothing. */\ninterface ProofPersona {\n email: string\n name: string\n source: 'lead' | 'member' | 'contact'\n}\n\nconst SOURCE_LABEL: Record<ProofPersona['source'], string> = {\n lead: 'Lead',\n member: 'Site user',\n contact: 'Contact',\n}\n\nexport interface CampaignTestSendDrawerProps {\n open: boolean\n onClose: () => void\n /** The one authorized POST to the campaign API. */\n post: (payload: Record<string, unknown>) => Promise<CampaignSendApiResult>\n /** Everything about the message, so the test mails what is composed. */\n message: Record<string, unknown>\n /** What the composer says this send will leave as, for the summary. */\n identity: string\n}\n\n/**\n * PROOF ONE EMAIL — as somebody, to somebody, from an identity.\n *\n * ## The two pickers are different kinds of thing, and the screen says so\n *\n * The whole risk in this drawer is a person reading the persona picker as an\n * address book. Choosing a contact fills the merge tags with THEIR data and\n * mails them nothing; the only address anything is delivered to is the one in\n * the second field. Those two facts are stated next to the controls rather\n * than in help text, and the summary at the bottom restates both in one\n * sentence before the button.\n *\n * ## Why the recipient is a list and not a text box\n *\n * A test send is exempt from the marketing-consent rule, so the server only\n * accepts an address belonging to an account on this workspace. Offering a\n * free-text box would mean every other address a person could type is a\n * refusal they had no way to predict — the rule is the same either way, and a\n * picker is the honest way to show it.\n *\n * ## What a test does not do\n *\n * It writes no campaign record, moves no counter, and joins no reach record,\n * so proofing an email six times does not make its report say seven. It still\n * runs both suppression lists and still refuses an address with a recorded\n * opt-out: neither of those is relaxed for a test, because a suppressed\n * address is suppressed for a reason that has nothing to do with who is\n * asking.\n */\nexport function CampaignTestSendDrawer(props: CampaignTestSendDrawerProps) {\n const { open, onClose, post, message, identity } = props\n\n const [recipients, setRecipients] = useState<ProofRecipient[] | null>(null)\n const [personas, setPersonas] = useState<ProofPersona[]>([])\n const [to, setTo] = useState('')\n const [personaEmail, setPersonaEmail] = useState('')\n const [busy, setBusy] = useState(false)\n const [error, setError] = useState('')\n const [sentTo, setSentTo] = useState('')\n\n /*\n * ASKED ON OPEN, not on mount.\n *\n * The composer mounts on every campaign page; this drawer is opened\n * deliberately. Loading the roster and an audience sample behind the\n * composer would spend those reads for everybody who never proofs anything,\n * which is most people most of the time.\n */\n useEffect(() => {\n if (!open) return\n let active = true\n setError('')\n setSentTo('')\n void (async () => {\n const { response, payload } = await post({ action: 'proofOptions' })\n if (!active) return\n if (!response.ok) {\n setRecipients([])\n return setError(payload?.error ?? 'Could not load who a test can go to')\n }\n const list = (payload?.recipients ?? []) as ProofRecipient[]\n setRecipients(list)\n setPersonas((payload?.personas ?? []) as ProofPersona[])\n // Yourself, because that is the answer nine times in ten and it is the\n // one choice that needs no thought.\n setTo((current) => current || list.find((one) => one.self)?.email || '')\n })().catch(() => {\n if (active) setError('Could not load who a test can go to')\n })\n return () => {\n active = false\n }\n }, [open, post])\n\n const handleSend = useCallback(async () => {\n if (busy || !to) return\n setBusy(true)\n setError('')\n const { response, payload } = await post({\n ...message,\n action: 'test',\n to,\n ...(personaEmail ? { personaEmail } : {}),\n })\n setBusy(false)\n if (!response.ok) {\n return setError(payload?.error ?? 'The test send was refused')\n }\n setSentTo(String(payload?.to ?? to))\n }, [busy, post, message, to, personaEmail])\n\n const persona = personas.find((one) => one.email === personaEmail)\n\n return (\n <NavigationDrawerComponent\n open={open}\n anchor=\"right\"\n variant=\"temporary\"\n onClose={onClose}\n AppBarProps={{ color: 'surface' }}\n appBarLeft={\n <>\n <IconButton color=\"inherit\" edge=\"start\" onClick={onClose} sx={{ mr: 2 }}>\n <MdiIcon path={ICON_VARIANT_CLOSE.path} />\n <SrOnly>close drawer</SrOnly>\n </IconButton>\n <Typography variant=\"h6\" component=\"div\">\n {'Send a test'}\n </Typography>\n </>\n }\n >\n <Container gutterY>\n <Stack spacing={2}>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'A test mails one copy of this email and records nothing — no ' +\n 'recipient count, no report figures, and nobody is marked as ' +\n 'having received it.'}\n </Typography>\n\n <TextField\n select\n label=\"Fill the merge tags with\"\n value={personaEmail}\n onChange={(event) => setPersonaEmail(event.target.value)}\n size=\"small\"\n disabled={busy}\n helperText={\n persona\n ? `The email will read as if addressed to ${\n persona.name || persona.email\n }. ${persona.email} is not sent anything.`\n : 'Leave this alone to see the fallbacks — {{firstName|there}} and the rest — as somebody with no stored name would.'\n }\n >\n <MenuItem value=\"\">{'Nobody in particular'}</MenuItem>\n {personas.map((one) => (\n <MenuItem key={one.email} value={one.email}>\n {`${one.name || one.email} · ${SOURCE_LABEL[one.source]}`}\n </MenuItem>\n ))}\n </TextField>\n\n <Divider />\n\n <TextField\n select\n label=\"Deliver it to\"\n value={to}\n onChange={(event) => setTo(event.target.value)}\n size=\"small\"\n disabled={busy || !recipients?.length}\n helperText={\n 'The only address this test is sent to. A test can go to you or ' +\n 'to someone with an account on this workspace — never to a ' +\n 'contact, who has not agreed to receive it.'\n }\n >\n {(recipients ?? []).map((one) => (\n <MenuItem key={one.email} value={one.email}>\n {one.self ? `${one.email} (you)` : `${one.label} · ${one.email}`}\n </MenuItem>\n ))}\n </TextField>\n\n {/*\n THE SUMMARY, before the button that mails something.\n\n Three facts in one sentence, because the whole failure this drawer\n could produce is somebody believing the first field addresses the\n email. Restating it here means the last thing read before the\n click is the correct reading.\n */}\n <Alert severity=\"info\">\n <Typography variant=\"body2\">\n {to\n ? `We will send one copy to ${to}, from ${identity || 'this site’s sending address'}${\n persona\n ? `, written as if it were going to ${persona.name || persona.email}`\n : ''\n }.`\n : 'Choose an address to send the test to.'}\n </Typography>\n </Alert>\n\n {error ? <Alert severity=\"warning\">{error}</Alert> : null}\n {sentTo ? (\n <Alert severity=\"success\">{`Sent to ${sentTo}.`}</Alert>\n ) : null}\n\n <Button\n variant=\"contained\"\n disabled={busy || !to}\n onClick={() => void handleSend()}\n >\n {busy ? 'Sending…' : 'Send test'}\n </Button>\n </Stack>\n </Container>\n </NavigationDrawerComponent>\n )\n}\nCampaignTestSendDrawer.displayName = 'CampaignTestSendDrawer'\n\nexport default CampaignTestSendDrawer\n"],"names":["ICON_VARIANT_CLOSE","Container","MdiIcon","SrOnly","NavigationDrawerComponent","Alert","Button","Divider","IconButton","MenuItem","Stack","TextField","Typography","useCallback","useEffect","useState","SOURCE_LABEL","lead","member","contact","CampaignTestSendDrawer","props","open","onClose","post","message","identity","recipients","setRecipients","personas","setPersonas","to","setTo","personaEmail","setPersonaEmail","busy","setBusy","error","setError","sentTo","setSentTo","active","response","payload","action","ok","list","current","find","one","self","email","catch","handleSend","String","persona","anchor","variant","AppBarProps","color","appBarLeft","edge","onClick","sx","mr","path","component","gutterY","spacing","select","label","value","onChange","event","target","size","disabled","helperText","name","map","source","length","severity","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAEA,SAASA,kBAAkB,QAAQ,2BAA0B;AAC7D,SAASC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,uBAAsB;AACjE,SAASC,yBAAyB,QAAQ,8DAA6D;AACvG,SACEC,KAAK,EACLC,MAAM,EACNC,OAAO,EACPC,UAAU,EACVC,QAAQ,EACRC,KAAK,EACLC,SAAS,EACTC,UAAU,QACL,gBAAe;AACtB,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAiBxD,MAAMC,eAAuD;IAC3DC,MAAM;IACNC,QAAQ;IACRC,SAAS;AACX;AAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BC,GACD,OAAO,SAASC,uBAAuBC,KAAkC;IACvE,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGL;IAEnD,MAAM,CAACM,YAAYC,cAAc,GAAGb,SAAkC;IACtE,MAAM,CAACc,UAAUC,YAAY,GAAGf,SAAyB,EAAE;IAC3D,MAAM,CAACgB,IAAIC,MAAM,GAAGjB,SAAS;IAC7B,MAAM,CAACkB,cAAcC,gBAAgB,GAAGnB,SAAS;IACjD,MAAM,CAACoB,MAAMC,QAAQ,GAAGrB,SAAS;IACjC,MAAM,CAACsB,OAAOC,SAAS,GAAGvB,SAAS;IACnC,MAAM,CAACwB,QAAQC,UAAU,GAAGzB,SAAS;IAErC;;;;;;;GAOC,GACDD,UAAU;QACR,IAAI,CAACQ,MAAM;QACX,IAAImB,SAAS;QACbH,SAAS;QACTE,UAAU;QACV,KAAK,AAAC,CAAA;;YACJ,MAAM,EAAEE,QAAQ,EAAEC,OAAO,EAAE,GAAG,MAAMnB,KAAK;gBAAEoB,QAAQ;YAAe;YAClE,IAAI,CAACH,QAAQ;YACb,IAAI,CAACC,SAASG,EAAE,EAA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AAK,CAAC,GAAG,EAAErB,IAAIE,KAAK,EAAE;+BADnDF,IAAIE,KAAK;;kCAc5B,KAAC9C;wBAAM6E,UAAS;kCACd,cAAA,KAACtE;4BAAW6C,SAAQ;sCACjB1B,KACG,CAAC,yBAAyB,EAAEA,GAAG,OAAO,EAAEL,YAAY,gCAClD6B,UACI,CAAC,iCAAiC,EAAEA,QAAQuB,IAAI,IAAIvB,QAAQJ,KAAK,EAAE,GACnE,GACL,CAAC,CAAC,GACH;;;oBAIPd,sBAAQ,KAAChC;wBAAM6E,UAAS;kCAAW7C;yBAAiB;oBACpDE,uBACC,KAAClC;wBAAM6E,UAAS;kCAAW,CAAC,QAAQ,EAAE3C,OAAO,CAAC,CAAC;yBAC7C;kCAEJ,KAACjC;wBACCmD,SAAQ;wBACRmB,UAAUzC,QAAQ,CAACJ;wBACnB+B,SAAS,IAAM,KAAKT;kCAEnBlB,OAAO,aAAa;;;;;;AAMjC;AACAf,uBAAuB+D,WAAW,GAAG;AAErC,eAAe/D,uBAAsB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE CAMPAIGNS LIST.
|
|
3
|
+
*
|
|
4
|
+
* A campaign is a container — a name, a window, the lists it is aimed at, and
|
|
5
|
+
* the emails sent inside it — so this is a table of campaigns and not of
|
|
6
|
+
* messages. Composing is not here: a message belongs to a campaign, and the
|
|
7
|
+
* campaign's own page is where one is written.
|
|
8
|
+
*
|
|
9
|
+
* The rows come from two collections, and the second is why this reads
|
|
10
|
+
* without a migration. `emailCampaigns` holds the containers.
|
|
11
|
+
* `campaigns` holds every send, including thousands written before containers
|
|
12
|
+
* existed; those carry no container id, and `campaignListRows` presents each
|
|
13
|
+
* as a campaign of one rather than dropping it. Nothing is rewritten, so no
|
|
14
|
+
* unsubscribe link and no pasted report URL stops resolving.
|
|
15
|
+
*/
|
|
16
|
+
export declare function HostCampaignsCard(props: {
|
|
17
|
+
hostId: string;
|
|
18
|
+
/**
|
|
19
|
+
* The marketing hub URL, when the caller already has it.
|
|
20
|
+
*
|
|
21
|
+
* Resolved from the host route when it does not: the inbox console page
|
|
22
|
+
* embeds this card on a tab of its own, and its `basePath` names the INBOX
|
|
23
|
+
* hub. Deriving one hub's URL from another's by string surgery is the kind
|
|
24
|
+
* of link that breaks silently when a surface moves.
|
|
25
|
+
*/
|
|
26
|
+
basePath?: string;
|
|
27
|
+
}): import("react").JSX.Element;
|
|
28
|
+
export declare namespace HostCampaignsCard {
|
|
29
|
+
var displayName: string;
|
|
30
|
+
}
|
|
31
|
+
export default HostCampaignsCard;
|