@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/announcement-bar-card.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport {\n type AglynOrgBilling,\n checkEntitlement,\n type HostAnnouncementBar,\n pluginDocsHelp,\n} from '@aglyn/aglyn'\nimport { CardDisplay, useLoading } from '@aglyn/shared-ui-jsx'\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport {\n Alert,\n Box,\n Button,\n Stack,\n Switch,\n TextField,\n Typography,\n} from '@mui/material'\nimport { doc, updateDoc } from 'firebase/firestore'\nimport { useEffect, useState } from 'react'\nimport {\n useFirestore,\n useFirestoreDoc,\n useHostActivityLogger,\n writeGuardedBySeed,\n} from '@aglyn/tenant-feature-instance'\nimport OverlayStatsRow from './overlay-stats-row.component'\nimport {\n OVERLAY_COPY_HELPER_TEXT,\n shownAsTypedHelperText,\n useOverlayCopyEditor,\n} from './use-overlay-copy-editor'\n\nexport interface AnnouncementBarCardProps {\n hostId: string\n /** Resolved entitlement source (AGL-395). */\n org?: Partial<AglynOrgBilling>\n}\n\n/**\n * Announcement bar editor (AGL-195): site-wide banner config persisted on\n * the host doc; the tenant render gates on the marketingOverlays\n * entitlement and resolves the text through `resolveOverlayCopy`. A typed\n * `{{name}}` is stored as its variable's id token, the only variable form\n * that resolves, and a token that would still show as typed is flagged\n * under the field (AGL-2885). Starter+ (locked-state upsell below),\n * dark-launched for plan-less workspaces like the other AGL-99 gates.\n */\nexport function AnnouncementBarCard(props: AnnouncementBarCardProps) {\n const { hostId } = props\n const firestore = useFirestore()\n const { org } = props\n const { enqueueSnackbar } = useSnackbar()\n const { queueLoading } = useLoading()\n const logActivity = useHostActivityLogger(hostId)\n const {\n data: host,\n status: hostStatus,\n /**\n * The host doc this form is seeded from is unconfirmed by the server\n * (AGL-1358). The save writes the whole `announcementBar` map — a nested\n * map value REPLACES atomically, so `updateDoc` protects only the host\n * doc's other fields, never the bar's own — and every field of it comes\n * off this seed. Against a cached read, editing the text reinstates the\n * colours, link and `enabled` flag from that snapshot on a banner shown\n * on every page of a published site.\n */\n fromCache: hostFromCache,\n } = useFirestoreDoc<any>(\n () => doc(firestore, 'hosts', hostId),\n [firestore, hostId],\n { idField: '$id' },\n )\n const entitled = checkEntitlement(org, 'marketingOverlays')\n\n const saved = (host?.announcementBar ?? {}) as HostAnnouncementBar\n const [draft, setDraft] = useState<HostAnnouncementBar>(saved)\n // Re-seed the form when another session edits the host doc.\n const savedKey = JSON.stringify(saved)\n useEffect(() => {\n setDraft(JSON.parse(savedKey))\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [savedKey])\n\n // `draft.text` is held in its stored form; the field shows it as typed.\n const copy = useOverlayCopyEditor({\n hostId,\n host,\n usesTokens:\n entitled &&\n [saved.text, draft.text].some((text) => text?.includes('{{')),\n })\n // Compared as it would be stored, so a name typed before the variables\n // arrived still counts as the change it becomes on save.\n const dirty =\n JSON.stringify({ ...draft, text: copy.stored(draft.text) }) !== savedKey\n const patch = (partial: Partial<HostAnnouncementBar>) =>\n setDraft((previous) => ({ ...previous, ...partial }))\n const textShownAsTyped = copy.shownAsTyped(draft.text)\n\n const handleSave = async () => {\n const dequeue = queueLoading()\n try {\n /**\n * Refuse a save whose seed the server never confirmed (AGL-1358).\n *\n * There is no create path to exempt, and that is the point: unlike a\n * new row at a fresh uid, this writes a FIXED document path, so the\n * blank `draft` that `host?.announcementBar ?? {}` yields when the\n * cache has never seen a bar is not harmless — it replaces whatever\n * bar the server really holds with an empty, disabled one.\n *\n * The activity log rides inside the guard: a logged \"Updated\n * announcement bar\" whose write never happened leaves the history\n * disagreeing with the bar it claims to explain.\n *\n * The guard WRAPS the write — an early return is a shape you can keep\n * while losing the protection.\n */\n const verdict = await writeGuardedBySeed(\n {\n subject: 'announcement bar',\n unreadable: hostStatus === 'error',\n fromCache: hostFromCache,\n },\n async () => {\n await updateDoc(doc(firestore, 'hosts', hostId), {\n announcementBar: {\n enabled: Boolean(draft.enabled),\n text: copy.storedWithin(draft.text, 300),\n href: (draft.href ?? '').trim(),\n backgroundColor: (draft.backgroundColor ?? '').trim(),\n textColor: (draft.textColor ?? '').trim(),\n dismissible: draft.dismissible !== false,\n },\n })\n logActivity('Updated announcement bar', { type: 'host', id: hostId })\n },\n )\n // A refusal leaves every typed value on screen. A save that silently\n // does nothing sends the user back to retype a form that will be\n // refused again just as quietly.\n if (!verdict.ok) {\n return void enqueueSnackbar(verdict.message, {\n variant: 'warning',\n persist: false,\n })\n }\n enqueueSnackbar('Announcement bar saved', {\n variant: 'success',\n persist: false,\n })\n } catch (error) {\n console.error(error)\n enqueueSnackbar('An error has occurred', {\n variant: 'error',\n allowDuplicate: true,\n })\n } finally {\n dequeue()\n }\n }\n\n return (\n <CardDisplay\n header=\"Announcement bar\"\n help={pluginDocsHelp('marketingOverlays', {\n anchor: '#announcement-bar',\n })}\n contentGutterX\n contentGutterY\n >\n {!entitled ? (\n <Alert severity=\"info\">\n {'Announcement bars and popups are included from the Starter ' +\n 'plan — see Billing to upgrade.'}\n </Alert>\n ) : (\n <Stack spacing={2}>\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'center' }}>\n <Switch\n checked={Boolean(draft.enabled)}\n onChange={(event) => patch({ enabled: event.target.checked })}\n />\n <Typography variant=\"body2\">\n {draft.enabled\n ? 'Shown on every page of your published site'\n : 'Hidden'}\n </Typography>\n </Stack>\n <TextField\n label=\"Text\"\n size=\"small\"\n value={copy.editable(draft.text)}\n onChange={(event) =>\n patch({ text: copy.stored(event.target.value) })\n }\n error={textShownAsTyped.length > 0}\n helperText={\n shownAsTypedHelperText(textShownAsTyped) ?? OVERLAY_COPY_HELPER_TEXT\n }\n multiline\n fullWidth\n />\n <Stack direction=\"row\" spacing={1} sx={{ flexWrap: 'wrap', rowGap: 1 }}>\n <TextField\n label=\"Link (optional)\"\n size=\"small\"\n placeholder=\"/sale or https://…\"\n value={draft.href ?? ''}\n onChange={(event) => patch({ href: event.target.value })}\n sx={{ flex: 1, minWidth: 200 }}\n />\n <TextField\n label=\"Background\"\n size=\"small\"\n placeholder=\"#111827\"\n value={draft.backgroundColor ?? ''}\n onChange={(event) =>\n patch({ backgroundColor: event.target.value })\n }\n sx={{ width: 120 }}\n />\n <TextField\n label=\"Text color\"\n size=\"small\"\n placeholder=\"#ffffff\"\n value={draft.textColor ?? ''}\n onChange={(event) => patch({ textColor: event.target.value })}\n sx={{ width: 120 }}\n />\n </Stack>\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'center' }}>\n <Switch\n checked={draft.dismissible !== false}\n onChange={(event) =>\n patch({ dismissible: event.target.checked })\n }\n />\n <Typography variant=\"body2\">\n {'Visitors can dismiss it (re-shown when the text changes)'}\n </Typography>\n </Stack>\n {draft.text ? (\n <Box\n sx={{\n px: 2,\n py: 1,\n borderRadius: 1,\n textAlign: 'center',\n fontSize: 14,\n color: draft.textColor || '#fff',\n backgroundColor: draft.backgroundColor || '#111827',\n }}\n >\n {copy.preview(draft.text)}\n </Box>\n ) : null}\n <Button\n variant=\"contained\"\n color=\"primary\"\n disabled={\n !dirty ||\n (Boolean(draft.enabled) && !draft.text?.trim()) ||\n copy.pending(draft.text)\n }\n onClick={handleSave}\n sx={{ alignSelf: 'flex-start' }}\n >\n {'Save'}\n </Button>\n <OverlayStatsRow\n hostId={hostId}\n actionKey=\"barClick\"\n actionLabel=\"clicks\"\n />\n </Stack>\n )}\n </CardDisplay>\n )\n}\nAnnouncementBarCard.displayName = 'AnnouncementBarCard'\n\nexport default AnnouncementBarCard\n"],"names":["checkEntitlement","pluginDocsHelp","CardDisplay","useLoading","useSnackbar","Alert","Box","Button","Stack","Switch","TextField","Typography","doc","updateDoc","useEffect","useState","useFirestore","useFirestoreDoc","useHostActivityLogger","writeGuardedBySeed","OverlayStatsRow","OVERLAY_COPY_HELPER_TEXT","shownAsTypedHelperText","useOverlayCopyEditor","AnnouncementBarCard","props","draft","hostId","firestore","org","enqueueSnackbar","queueLoading","logActivity","data","host","status","hostStatus","fromCache","hostFromCache","idField","entitled","saved","announcementBar","setDraft","savedKey","JSON","stringify","parse","copy","usesTokens","text","some","includes","dirty","stored","patch","partial","previous","textShownAsTyped","shownAsTyped","handleSave","dequeue","verdict","subject","unreadable","enabled","Boolean","storedWithin","href","trim","backgroundColor","textColor","dismissible","type","id","ok","message","variant","persist","error","console","allowDuplicate","header","help","anchor","contentGutterX","contentGutterY","severity","spacing","direction","sx","alignItems","checked","onChange","event","target","label","size","value","editable","length","helperText","multiline","fullWidth","flexWrap","rowGap","placeholder","flex","minWidth","width","px","py","borderRadius","textAlign","fontSize","color","preview","disabled","pending","onClick","alignSelf","actionKey","actionLabel","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAEA,SAEEA,gBAAgB,EAEhBC,cAAc,QACT,eAAc;AACrB,SAASC,WAAW,EAAEC,UAAU,QAAQ,uBAAsB;AAC9D,SAASC,WAAW,QAAQ,8BAA6B;AACzD,SACEC,KAAK,EACLC,GAAG,EACHC,MAAM,EACNC,KAAK,EACLC,MAAM,EACNC,SAAS,EACTC,UAAU,QACL,gBAAe;AACtB,SAASC,GAAG,EAAEC,SAAS,QAAQ,qBAAoB;AACnD,SAASC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAC3C,SACEC,YAAY,EACZC,eAAe,EACfC,qBAAqB,EACrBC,kBAAkB,QACb,iCAAgC;AACvC,OAAOC,qBAAqB,mCAA+B;AAC3D,SACEC,wBAAwB,EACxBC,sBAAsB,EACtBC,oBAAoB,QACf,+BAA2B;AAQlC;;;;;;;;CAQC,GACD,OAAO,SAASC,oBAAoBC,KAA+B;cAuJrDH,yBAUOI,aAQAA,wBAUAA;QAoCqBA;IAtNxC,MAAM,EAAEC,MAAM,EAAE,GAAGF;IACnB,MAAMG,YAAYZ;IAClB,MAAM,EAAEa,GAAG,EAAE,GAAGJ;IAChB,MAAM,EAAEK,eAAe,EAAE,GAAG1B;IAC5B,MAAM,EAAE2B,YAAY,EAAE,GAAG5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AI;;;;8BAGrB,MAACrG;oBAAMiF,WAAU;oBAAMD,SAAS;oBAAGE,IAAI;wBAAEC,YAAY;oBAAS;;sCAC5D,KAAClF;4BACCmF,SAASlE,MAAM8C,WAAW,KAAK;4BAC/BqB,UAAU,CAACC,QACTvC,MAAM;oCAAEiB,aAAasB,MAAMC,MAAM,CAACH,OAAO;gCAAC;;sCAG9C,KAACjF;4BAAWkE,SAAQ;sCACjB;;;;gBAGJnD,MAAMwB,IAAI,iBACT,KAAC5C;oBACCoF,IAAI;wBACFoB,IAAI;wBACJC,IAAI;wBACJC,cAAc;wBACdC,WAAW;wBACXC,UAAU;wBACVC,OAAOzF,MAAM6C,SAAS,IAAI;wBAC1BD,iBAAiB5C,MAAM4C,eAAe,IAAI;oBAC5C;8BAECtB,KAAKoE,OAAO,CAAC1F,MAAMwB,IAAI;qBAExB;8BACJ,KAAC3C;oBACCsE,SAAQ;oBACRsC,OAAM;oBACNE,UACE,CAAChE,SACAa,QAAQxC,MAAMuC,OAAO,KAAK,GAACvC,cAAAA,MAAMwB,IAAI,qBAAVxB,YAAY2C,IAAI,OAC5CrB,KAAKsE,OAAO,CAAC5F,MAAMwB,IAAI;oBAEzBqE,SAAS3D;oBACT8B,IAAI;wBAAE8B,WAAW;oBAAa;8BAE7B;;8BAEH,KAACpG;oBACCO,QAAQA;oBACR8F,WAAU;oBACVC,aAAY;;;;;AAMxB;AACAlG,oBAAoBmG,WAAW,GAAG;AAElC,eAAenG,oBAAmB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export interface CampaignComposerProps {
|
|
2
|
+
hostId: string;
|
|
3
|
+
/**
|
|
4
|
+
* The campaign this send joins. Every send composed here carries it, so the
|
|
5
|
+
* campaign's rollup covers the send without anything re-scanning.
|
|
6
|
+
*/
|
|
7
|
+
emailCampaignId?: string;
|
|
8
|
+
/** The campaign's lists — the audience picker opens on the first of them. */
|
|
9
|
+
campaignListIds?: string[];
|
|
10
|
+
/**
|
|
11
|
+
* The campaign's topic, which its emails open on.
|
|
12
|
+
*
|
|
13
|
+
* A default and not a constraint: the topic is a property of the MESSAGE —
|
|
14
|
+
* it decides who this send skips, what the preference page highlights, and
|
|
15
|
+
* which stream a resulting opt-out is recorded against — and one campaign
|
|
16
|
+
* may legitimately carry a newsletter and a promotion.
|
|
17
|
+
*/
|
|
18
|
+
campaignTopicId?: string;
|
|
19
|
+
/**
|
|
20
|
+
* What the merchant called this email when they created it, for the record
|
|
21
|
+
* rather than for the recipient.
|
|
22
|
+
*
|
|
23
|
+
* Collected by the create drawer on the Emails list, which asks for a name
|
|
24
|
+
* the way every other create in the console does. It is NOT the subject: an
|
|
25
|
+
* email's subject is written for the person opening it and gets edited
|
|
26
|
+
* until the moment it sends, and a merchant looking for "the one with the
|
|
27
|
+
* discount code" months later has nothing else to look for.
|
|
28
|
+
*/
|
|
29
|
+
displayName?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The email record this composer is writing, when it is editing one.
|
|
32
|
+
*
|
|
33
|
+
* Present on an email's own page and absent nowhere else that matters: it
|
|
34
|
+
* is what makes Save, Schedule and Send land on the record the reader
|
|
35
|
+
* already has open rather than minting a second one. The id is the email's
|
|
36
|
+
* identity for its whole life — `performCampaignSend` adopts it, so the URL
|
|
37
|
+
* a merchant has open is the URL the sent email keeps, and the `cid=`
|
|
38
|
+
* inside every unsubscribe link it later mints names this same document.
|
|
39
|
+
*/
|
|
40
|
+
campaignId?: string;
|
|
41
|
+
/**
|
|
42
|
+
* What the record already holds, for a composer opened on an existing
|
|
43
|
+
* email.
|
|
44
|
+
*
|
|
45
|
+
* Passed down rather than read here: the email's page has the document
|
|
46
|
+
* open already, and a second listen on it would be a second read of the
|
|
47
|
+
* same thing on every mount of this component.
|
|
48
|
+
*/
|
|
49
|
+
initial?: {
|
|
50
|
+
subject?: string;
|
|
51
|
+
body?: string;
|
|
52
|
+
fromName?: string;
|
|
53
|
+
replyTo?: string;
|
|
54
|
+
preheader?: string;
|
|
55
|
+
audience?: string;
|
|
56
|
+
listId?: string;
|
|
57
|
+
segmentId?: string;
|
|
58
|
+
topicId?: string;
|
|
59
|
+
templateScreenId?: string;
|
|
60
|
+
/** The author's own plain-text part; absent means generated. */
|
|
61
|
+
plainText?: string;
|
|
62
|
+
/** The design version that part was written against. */
|
|
63
|
+
plainTextVersionId?: string;
|
|
64
|
+
sendAtMs?: number;
|
|
65
|
+
/** `platform`, or absent for the site's standing selection. */
|
|
66
|
+
sendingIdentity?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Which of the site's senders this email is set to go out as, or absent
|
|
69
|
+
* for the site's default.
|
|
70
|
+
*
|
|
71
|
+
* Read back so a draft reopens on the sender it was saved with, and so a
|
|
72
|
+
* scheduled email that is edited does not silently move onto whichever
|
|
73
|
+
* sender has become the default since.
|
|
74
|
+
*/
|
|
75
|
+
senderId?: string;
|
|
76
|
+
};
|
|
77
|
+
/** Called once a send or a schedule lands. */
|
|
78
|
+
onSent?: () => void;
|
|
79
|
+
}
|
|
80
|
+
export declare function CampaignComposer(props: CampaignComposerProps): import("react").JSX.Element;
|
|
81
|
+
export declare namespace CampaignComposer {
|
|
82
|
+
var displayName: string;
|
|
83
|
+
}
|
|
84
|
+
export default CampaignComposer;
|