@aglyn/plugins-marketing 1.0.0-beta.143 → 1.0.0-beta.145

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.
Files changed (2) hide show
  1. package/README.md +66 -6
  2. package/package.json +15 -15
package/README.md CHANGED
@@ -1,7 +1,67 @@
1
- # @aglyn/plugins-ui-data
1
+ # @aglyn/plugins-marketing
2
2
 
3
- The Data feature plugin (AGL-313) — the reference
4
- implementation of the console+UI feature-plugin pair (AGL-277). The
5
- `event-list` component moved here from `plugins-ui-mui`; legacy screen
6
- nodes persisted with pluginId `mui` keep rendering because resolution is
7
- by componentId.
3
+ The Marketing plugin for Aglyn: announcement bars and popups (overlays), A/B experiments, and email campaigns, with the console section that manages them, the runtime that shows them on a published site, and the server routes behind both. Install it if you run the Aglyn console and tenant runtime and want these features; it is a first-party plugin, not a standalone library.
4
+
5
+ > Beta. Published from the Aglyn monorepo under the `beta` dist-tag; APIs can change between beta releases.
6
+
7
+ ## Install
8
+
9
+ npm install @aglyn/plugins-marketing@beta
10
+
11
+ Peer dependencies: `react`, `next`, `@mui/material`, `@mui/x-data-grid`, `firebase`, and `firebase-admin` for the server entry.
12
+
13
+ ## What's in it
14
+
15
+ The plugin declares four registrars in `plugins.config.json`, plus a `site` module so a published page can load the site half alone.
16
+
17
+ **On a published site** (`registerMarketingPlugin`, the `site` registrar, exported from `@aglyn/plugins-marketing/site`). It registers one site runtime, `marketing-site-runtime`, with `registerSiteRuntime`. The runtime is not a canvas element: the tenant page renders it generically, and it draws the active announcement bars and popups, applies experiment variants and runs the page's client automations from the data the server enricher wrote. In the editor's Preview, where no enricher runs, it rebuilds that data on the client through a deferred import.
18
+
19
+ **Console** (`registerMarketingConsole`, the `console` registrar):
20
+
21
+ - A `Marketing` nav item at `/marketing` with the sections Overview, Campaigns, Conversions, Overlays and A/B testing. Each section is a route; the page is code-split.
22
+ - Campaigns end to end. The plugin owns the campaign composer, test sends, scheduling, reports and recipients. The individual messages are listed on the Emails page, but that page belongs to the email plugin, which hosts an `emailMessages` zone; this plugin fills it with the message list, one message's page and its composer. It also fills `emailTemplateRecipients` (who received the sends built from a template).
23
+ - Widgets in other hosts' slots: the "Last campaign" card on the site dashboard (`hostDashboard`), the campaigns card in the Inbox (`inboxCampaigns`), and campaign attribution on a record's page (`crmRecordAttribution`, `inboxRecordAttribution`).
24
+ - Zones this plugin hosts for other plugins to fill, registered with `registerPluginZone`: two on the A/B testing card (beside the variants, and below a test's results), and five bare zones in the campaign composer and on a message's page for whichever plugin keeps the mail itself: the topic picker, the topic options, the add-a-sender editor, the design creator and the sent-design preview.
25
+ - A record route for `campaign`, so another plugin can link to a campaign without knowing this plugin's URLs.
26
+
27
+ **Server**, exported from `@aglyn/plugins-marketing/server`:
28
+
29
+ - `registerMarketingApi` (the `tenantApi` registrar): the `experiments/track` beacon, which counts exposures and conversions for a running experiment and can finish a test whose auto-winner rule is met, and a site page enricher (`registerSitePageEnricher`) that adds overlays, automations and experiments to a page's data.
30
+ - `registerMarketingConsoleApi` (the `consoleApi` registrar): `campaigns/send`, `campaigns/manage`, `campaigns/recipients`, `campaigns/process-scheduled`, `lists/materialize`, and the delivery events webhook at `email/events`. It also registers the campaign draft writer on the core's resource-drafts seam and figure readers for campaign and experiment results.
31
+
32
+ **Exports from `.`**
33
+
34
+ - `registerMarketingConsole`, `registerMarketingPlugin`, `BUNDLE_ID`.
35
+ - Overlays: `HostOverlay`, `resolveActiveOverlays`, `overlayMatchesPath`, `overlayActiveAt`, `popupSuppressed`.
36
+ - Experiments: `HostExperiment`, `ExperimentVariant`, `assignExperimentVariant`, `validateExperiment`, `compareVariants`, `evaluateAutoWinner`.
37
+ - The site contract types (`AnnouncementBarData`, `PopupData`, `ScreenExperiment`, `ClientAutomation`), `compileClientAutomations`, and the campaign figures helpers (`campaignFormsRollup`, `campaignFormTotals`).
38
+
39
+ ## Usage
40
+
41
+ The plugin is loaded through Aglyn's plugin manager: the generated loader manifests import the package and call the registrars named in `plugins.config.json`, and a published page loads the site half only where the site runs the feature. An app that wires plugins by hand calls them once at startup:
42
+
43
+ ```ts
44
+ // published site, client side: the site half alone
45
+ import { registerMarketingPlugin } from '@aglyn/plugins-marketing/site'
46
+ registerMarketingPlugin()
47
+
48
+ // console, client side
49
+ import { registerMarketingConsole } from '@aglyn/plugins-marketing'
50
+ registerMarketingConsole()
51
+
52
+ // server side: tenant runtime and console
53
+ import {
54
+ registerMarketingApi,
55
+ registerMarketingConsoleApi,
56
+ } from '@aglyn/plugins-marketing/server'
57
+ ```
58
+
59
+ Import the site half from `./site`, not from the root: the root entry also carries the console registrar and its pages.
60
+
61
+ ## How it fits
62
+
63
+ A plugin package (`scope:plugin`). It depends on the core (`@aglyn/aglyn`), the tenant packages (`@aglyn/tenant-runtime`, `@aglyn/tenant-data-admin`, `@aglyn/tenant-feature-instance`) and generic `@aglyn/shared-*` packages. It imports no other plugin. Everything it shares with the email, CRM, Inbox, commerce and AI plugins crosses through core seams: console zones and slots, record routes, resource drafts and figure readers. The core never imports this package.
64
+
65
+ ## License
66
+
67
+ Apache-2.0. Source: https://github.com/aglyn/aglyn/tree/main/libs/plugins/marketing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aglyn/plugins-marketing",
3
- "version": "1.0.0-beta.143",
3
+ "version": "1.0.0-beta.145",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://aglyn.com",
6
6
  "repository": {
@@ -25,20 +25,20 @@
25
25
  "./package.json": "./package.json"
26
26
  },
27
27
  "dependencies": {
28
- "@aglyn/aglyn": "1.0.0-beta.143",
29
- "@aglyn/shared-data-enums": "1.0.0-beta.143",
30
- "@aglyn/shared-data-mdi": "1.0.0-beta.143",
31
- "@aglyn/shared-ui-email-campaigns": "1.0.0-beta.143",
32
- "@aglyn/shared-ui-jsx": "1.0.0-beta.143",
33
- "@aglyn/shared-ui-jsx-forms": "1.0.0-beta.143",
34
- "@aglyn/shared-ui-next": "1.0.0-beta.143",
35
- "@aglyn/shared-ui-snackstack": "1.0.0-beta.143",
36
- "@aglyn/shared-util-email": "1.0.0-beta.143",
37
- "@aglyn/shared-util-http": "1.0.0-beta.143",
38
- "@aglyn/shared-util-timestamp": "1.0.0-beta.143",
39
- "@aglyn/tenant-data-admin": "1.0.0-beta.143",
40
- "@aglyn/tenant-feature-instance": "1.0.0-beta.143",
41
- "@aglyn/tenant-runtime": "1.0.0-beta.143",
28
+ "@aglyn/aglyn": "1.0.0-beta.145",
29
+ "@aglyn/shared-data-enums": "1.0.0-beta.145",
30
+ "@aglyn/shared-data-mdi": "1.0.0-beta.145",
31
+ "@aglyn/shared-ui-email-campaigns": "1.0.0-beta.145",
32
+ "@aglyn/shared-ui-jsx": "1.0.0-beta.145",
33
+ "@aglyn/shared-ui-jsx-forms": "1.0.0-beta.145",
34
+ "@aglyn/shared-ui-next": "1.0.0-beta.145",
35
+ "@aglyn/shared-ui-snackstack": "1.0.0-beta.145",
36
+ "@aglyn/shared-util-email": "1.0.0-beta.145",
37
+ "@aglyn/shared-util-http": "1.0.0-beta.145",
38
+ "@aglyn/shared-util-timestamp": "1.0.0-beta.145",
39
+ "@aglyn/tenant-data-admin": "1.0.0-beta.145",
40
+ "@aglyn/tenant-feature-instance": "1.0.0-beta.145",
41
+ "@aglyn/tenant-runtime": "1.0.0-beta.145",
42
42
  "@swc/helpers": "0.5.23"
43
43
  },
44
44
  "peerDependencies": {