Skip to content

Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.

feat(cms): send pages to Framer from Send to CMS (#1331) (#1580)

Cihan6aa58bd7ff65
diff --git a/web/messages/en.json b/web/messages/en.json
index c37428bb7..d8d856886 100644
--- a/web/messages/en.json
+++ b/web/messages/en.json
@@ -3984,6 +3984,12 @@
"sent": "In WordPress as a draft post since {when}",
"failed": "The last send to WordPress failed, {when}",
"published": "Published {when}"
+ },
+ "framer": {
+ "queued": "Sending to Framer since {when}",
+ "sent": "In Framer as a draft item since {when}",
+ "failed": "The last send to Framer failed, {when}",
+ "published": "Published {when}"
}
},
"bulk": {
@@ -3997,6 +4003,7 @@
"description": "Each page goes to the brand's webhook as it is ready to publish, with the slug and meta of its last send, else the page's. Open a page in the editor to change them.",
"descriptionWebflow": "Each page goes to {collection} in Webflow as a draft item, as it is ready to publish, with the slug and meta of its last send, else the page's. Open a page in the editor to change them.",
"descriptionWordPress": "Each page goes to {site} in WordPress as a draft post, as it is ready to publish, with the slug and meta description (as its excerpt) of its last send, else the page's. Open a page in the editor to change them. A page whose post is already published or scheduled goes as a new draft post. The meta title and JSON-LD aren't sent: set them in your SEO plugin.",
+ "descriptionFramer": "Each page goes to {collection} in Framer as a draft item, as it is ready to publish, with the slug and meta of its last send, else the page's. Open a page in the editor to change them. A page whose item isn't a draft is updated there: the change goes live with your next publish of the site. Images aren't sent yet.",
"readFailed": "Couldn't read the pages. Try again.",
"retry": "Try again",
"notFound": "A page was archived or deleted since you picked it. Close this, pick the pages again and send.",
@@ -4028,6 +4035,7 @@
"skipped": "{count, plural, one {# page wasn't sent} other {# pages weren't sent}}: the workspace has sent 200 pages in the last 24 hours. Try again later.",
"inProgress": "A page is already on its way to Webflow. Wait for it, then send again.",
"inProgressWordPress": "A page is already on its way to WordPress. Wait for it, then send again.",
+ "inProgressFramer": "A page is already on its way to Framer. Wait for it, then send again.",
"close": "Close",
"cancel": "Cancel",
"send": "{count, plural, one {Send # page} other {Send # pages}}",
@@ -5120,11 +5128,12 @@
},
"send": {
"button": "Send to CMS",
- "hint": "Send the page to your CMS: Webflow, WordPress, or your workflow through the brand's webhook",
+ "hint": "Send the page to your CMS: Webflow, WordPress, Framer, or your workflow through the brand's webhook",
"title": "Send to CMS",
"description": "The page goes to the brand's webhook, for your workflow tool (Zapier, Make, n8n) to publish it in your CMS.",
"descriptionWebflow": "The page goes to {collection} in Webflow as a draft item, with its slug and meta. You publish it in Webflow.",
"descriptionWordPress": "The page goes to {site} in WordPress as a draft post, with its slug, and its meta description as the excerpt. The meta title isn't sent: set it in your SEO plugin. You publish it in WordPress.",
+ "descriptionFramer": "The page goes to {collection} in Framer as a draft item, with its slug and meta. Images aren't sent yet. You publish it in Framer.",
"descriptionReading": "The page goes to your CMS with its slug and meta, kept on the page.",
"target": {
"label": "Send to",
@@ -5139,12 +5148,19 @@
"hint": "A draft post on {site}",
"notReady": "Sign-in refused: connect WordPress again in Settings › Integrations"
},
+ "framer": {
+ "title": "Framer",
+ "hint": "A draft item in {collection}",
+ "collection": "your collection",
+ "notReady": "Not ready: connect it again or pick its collection and fields in Settings › Integrations"
+ },
"webhook": {
"title": "Your workflow",
"hint": "The brand's webhook (Zapier, Make, n8n)"
},
"unchecked": "Couldn't check Webflow just now, so this send goes to your workflow.",
"uncheckedWordPress": "Couldn't check WordPress just now, so this send goes to your workflow.",
+ "uncheckedFramer": "Couldn't check Framer just now, so this send goes to your workflow.",
"retry": "Try again"
},
"placeholders": "{count, plural, one {# placeholder is} other {# placeholders are}} still open. Fill {count, plural, one {it} other {them}} first: none goes to your CMS.",
@@ -5186,6 +5202,12 @@
"failed": "The last send to WordPress failed, {when}.",
"published": "Published {when}."
},
+ "lastFramer": {
+ "queued": "Last sent to Framer {when}, still on its way.",
+ "sent": "In Framer as a draft item since {when}.",
+ "failed": "The last send to Framer failed, {when}.",
+ "published": "Published {when}."
+ },
"errors": {
"no_webhook": "This brand has no webhook yet. Set one up in Webhook Settings on Content Opportunities.",
"webhook_not_subscribed": "The brand's webhook doesn't receive \"Content page sent\". Turn it on in Webhook Settings on Content Opportunities.",
@@ -5210,7 +5232,14 @@
"no_wordpress": "Connect WordPress in Settings › Integrations first.",
"wordpress_refused": "WordPress refused the sign-in. Connect it again in Settings › Integrations.",
"in_progressWordPress": "This page is already on its way to WordPress. Wait for it, then send again.",
- "no_webhookWordPress": "This brand's WordPress refused the sign-in, and it has no webhook. Connect WordPress again in Settings › Integrations."
+ "no_webhookWordPress": "This brand's WordPress refused the sign-in, and it has no webhook. Connect WordPress again in Settings › Integrations.",
+ "framerFailed": "Framer didn't take the page: {reason}",
+ "framer_not_configured": "Framer isn't set up on this server. Send to your workflow instead.",
+ "no_framer": "Connect Framer in Settings › Integrations first.",
+ "framer_refused": "Framer refused the brand's API key. Connect it again in Settings › Integrations.",
+ "framer_not_ready": "Pick the Framer collection and its fields in Settings › Integrations.",
+ "in_progressFramer": "This page is already on its way to Framer. Wait for it, then send again.",
+ "no_webhookFramer": "This brand's Framer isn't ready, and it has no webhook. Connect Framer again or pick its collection and fields in Settings › Integrations."
},
"cancel": "Cancel",
"send": "Send",
@@ -5222,7 +5251,11 @@
"sentWordPress": "Sent to WordPress as a draft post",
"sentWordPressUpdated": "Draft post updated in WordPress",
"wordpressLive": "Its post was already published or scheduled, so the page went as a new draft. Move the text over in WordPress; published as it is, its slug gets \"-2\".",
- "wordpressJsonLd": "JSON-LD left out: add schema with your SEO plugin."
+ "wordpressJsonLd": "JSON-LD left out: add schema with your SEO plugin.",
+ "sentFramer": "Sent to Framer as a draft item",
+ "sentFramerUpdated": "Updated in Framer",
+ "framerImages": "{images, plural, one {# image wasn't sent: add it in Framer.} other {# images weren't sent: add them in Framer.}}",
+ "framerLive": "The item isn't a draft in Framer, so the change goes live with your next publish of the site."
},
"rulesChip": "Rules {met}/{total}",
"rulesChipReading": "Rules · reading",
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/page.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/page.test.tsx
index d661c348f..7a67299dc 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/page.test.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/page.test.tsx
@@ -207,6 +207,10 @@ vi.mock('@/lib/webflow-client', () => ({
vi.mock('@/lib/wordpress-client', () => ({
readWordPress: async () => ({ ok: true, configured: false, connection: null }),
}));
+// Nor its Framer collection (00295).
+vi.mock('@/lib/framer-client', () => ({
+ readFramer: async () => ({ ok: true, configured: false, connection: null }),
+}));
(
globalThis as typeof globalThis & {
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/library/_bulk-send-dialog.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/library/_bulk-send-dialog.test.tsx
index 4b3fe20e0..8cbe3c37a 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/library/_bulk-send-dialog.test.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/library/_bulk-send-dialog.test.tsx
@@ -60,6 +60,31 @@ vi.mock('@/lib/wordpress-client', () => ({
: null,
}),
}));
+// And its Framer collection (00295): none unless a test gives one. Not
+// ready: connected, but no field for the page's title picked yet.
+const framer = vi.hoisted(() => ({ ready: false, notReady: false, failed: false }));
+vi.mock('@/lib/framer-client', () => ({
+ readFramer: async () => ({
+ ok: !framer.failed,
+ code: 'failed',
+ configured: true,
+ connection:
+ framer.ready || framer.notReady
+ ? {
+ status: 'connected',
+ projectId: 'p1',
+ projectName: 'Acme Site',
+ siteUrl: 'https://acme.framer.website',
+ account: 'Ada Lovelace',
+ collectionId: 'fc1',
+ collectionName: 'Articles',
+ fieldMap: framer.ready ? { title: 'f-title', body: 'f-body' } : { body: 'f-body' },
+ connectedAt: '2026-10-27T10:00:00Z',
+ updatedAt: '2026-10-27T10:00:00Z',
+ }
+ : null,
+ }),
+}));
// One request a page, so a test can refuse the second.
const oneByOne = vi.hoisted(() => ({ on: false }));
vi.mock('@/lib/content/cms-send', async (importOriginal) => {
@@ -132,6 +157,7 @@ beforeEach(() => {
oneByOne.on = false;
Object.assign(webflow, { ready: false, refused: false, failed: false });
Object.assign(wordpress, { ready: false, refused: false, failed: false });
+ Object.assign(framer, { ready: false, notReady: false, failed: false });
// The send target remembered per brand, in this browser.
const kept = new Map<string, string>();
vi.stubGlobal('localStorage', {
@@ -391,6 +417,106 @@ describe('BulkSendDialog', () => {
expect(sendPagesToCms.mock.calls[0]?.[2]).toBe('webhook');
});
+ it('sends the pages to the brand’s Framer collection as draft items', async () => {
+ vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout', 'Date'] });
+ framer.ready = true;
+ sendPagesToCms.mockResolvedValue({
+ ok: true,
+ skipped: 0,
+ deliveries: [
+ { id: 'x1', draftId: 'd1', status: 'queued' },
+ { id: 'x3', draftId: 'd3', status: 'queued' },
+ ],
+ });
+ readDeliveries.mockResolvedValue([
+ { id: 'x1', draftId: 'd1', status: 'sent', http_status: null, error: null },
+ { id: 'x3', draftId: 'd3', status: 'sent', http_status: null, error: null },
+ ]);
+ await render();
+ expect(dialog().textContent).toContain(
+ "Each page goes to Articles in Framer as a draft item, as it is ready to publish, with the slug and meta of its last send, else the page's. Open a page in the editor to change them.",
+ );
+ expect(dialog().textContent).toContain(
+ "A page whose item isn't a draft is updated there: the change goes live with your next publish of the site. Images aren't sent yet.",
+ );
+ const radios = [...dialog().querySelectorAll('[role="radio"]')];
+ expect(radios.map((r) => r.textContent)).toEqual([
+ 'FramerA draft item in Articles',
+ "Your workflowThe brand's webhook (Zapier, Make, n8n)",
+ ]);
+ expect(radios[0].getAttribute('aria-checked')).toBe('true');
+ await act(async () => button('Send 2 pages').click());
+ expect(sendPagesToCms.mock.calls[0]?.[2]).toBe('framer');
+ expect(localStorage.getItem('aeo:cms-target:brand-1')).toBe('framer');
+ await act(async () => void (await vi.advanceTimersByTimeAsync(2_000)));
+ expect(dialog().querySelector('[role="status"]')!.textContent).toBe('2 pages sent.');
+ });
+
+ it('offers all four, two by two, starting from the remembered Framer', async () => {
+ webflow.ready = true;
+ wordpress.ready = true;
+ framer.ready = true;
+ localStorage.setItem('aeo:cms-target:brand-1', 'framer');
+ sendPagesToCms.mockResolvedValue({ ok: false, code: 'in_progress', field: null });
+ await render();
+ const radios = [...dialog().querySelectorAll('[role="radio"]')];
+ expect(radios.map((r) => r.querySelector('span')?.textContent)).toEqual([
+ 'Webflow',
+ 'WordPress',
+ 'Framer',
+ 'Your workflow',
+ ]);
+ expect(dialog().querySelector('[role="radiogroup"]')!.className).toContain(
+ 'grid-cols-1 sm:grid-cols-2',
+ );
+ expect(radios.map((r) => r.getAttribute('aria-checked'))).toEqual([
+ 'false',
+ 'false',
+ 'true',
+ 'false',
+ ]);
+ await act(async () => button('Send 2 pages').click());
+ expect(sendPagesToCms.mock.calls[0]?.[2]).toBe('framer');
+ expect(dialog().querySelector('[role="alert"]')!.textContent).toBe(
+ 'A page is already on its way to Framer. Wait for it, then send again.',
+ );
+ });
+
+ it('says Framer isn’t ready when the brand has no webhook either', async () => {
+ framer.notReady = true;
+ localStorage.setItem('aeo:cms-target:brand-1', 'framer');
+ sendPagesToCms.mockResolvedValue({ ok: false, code: 'no_webhook', field: null });
+ await render();
+ const choice = [...dialog().querySelectorAll<HTMLButtonElement>('[role="radio"]')][0];
+ expect(choice.disabled).toBe(true);
+ expect(choice.textContent).toContain('Not ready: connect it again or pick its collection');
+ await act(async () => button('Send 2 pages').click());
+ expect(sendPagesToCms.mock.calls[0]?.[2]).toBe('webhook');
+ expect(dialog().querySelector('[role="alert"]')!.textContent).toBe(
+ "This brand's Framer isn't ready, and it has no webhook. Connect Framer again or pick its collection and fields in Settings › Integrations.",
+ );
+ });
+
+ it('sends to the webhook when Framer can’t be read, saying so to a person who sent there', async () => {
+ framer.failed = true;
+ localStorage.setItem('aeo:cms-target:brand-1', 'framer');
+ sendPagesToCms.mockResolvedValue({
+ ok: true,
+ skipped: 0,
+ deliveries: [
+ { id: 'x1', draftId: 'd1', status: 'sent' },
+ { id: 'x3', draftId: 'd3', status: 'sent' },
+ ],
+ });
+ await render();
+ expect(dialog().querySelector('[role="radio"]')).toBeNull();
+ expect(dialog().querySelector('[role="status"]')!.textContent).toContain(
+ "Couldn't check Framer just now, so this send goes to your workflow.",
+ );
+ await act(async () => button('Send 2 pages').click());
+ expect(sendPagesToCms.mock.calls[0]?.[2]).toBe('webhook');
+ });
+
it('says why nothing went, and keeps the pages to send again', async () => {
sendPagesToCms.mockResolvedValue({ ok: false, code: 'webhook_not_subscribed', field: null });
await render();
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/library/_bulk-send-dialog.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/library/_bulk-send-dialog.tsx
index fdbe54b5c..1e8e13e7d 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/library/_bulk-send-dialog.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/library/_bulk-send-dialog.tsx
@@ -118,6 +118,7 @@ export function BulkSendDialog({
const {
webflow,
wordpress,
+ framer,
target,
pick,
sent: keepTarget,
@@ -129,6 +130,9 @@ export function BulkSendDialog({
? webflow.collection || tEditor('send.target.webflow.collection')
: '';
const site = wordpress?.ready ? wordpress.site : '';
+ const framerCollection = framer?.ready
+ ? framer.collection || tEditor('send.target.framer.collection')
+ : '';
useEffect(() => {
let cancelled = false;
@@ -312,11 +316,20 @@ export function BulkSendDialog({
: tEditor('send.errors.invalidField', { field: named });
}
// No page named: any of them may be the one on its way.
- if (code === 'in_progress') return t(to === 'wordpress' ? 'inProgressWordPress' : 'inProgress');
+ if (code === 'in_progress') {
+ return t(
+ to === 'wordpress'
+ ? 'inProgressWordPress'
+ : to === 'framer'
+ ? 'inProgressFramer'
+ : 'inProgress',
+ );
+ }
// No CMS ready sent the pages to the webhook: what to fix is the one connected.
- if (code === 'no_webhook' && !webflow?.ready && !wordpress?.ready) {
+ if (code === 'no_webhook' && !webflow?.ready && !wordpress?.ready && !framer?.ready) {
if (webflow) return tEditor('send.errors.no_webhookWebflow');
if (wordpress) return tEditor('send.errors.no_webhookWordPress');
+ if (framer) return tEditor('send.errors.no_webhookFramer');
}
return tEditor(`send.errors.${code}`);
};
@@ -344,16 +357,19 @@ export function BulkSendDialog({
? t('descriptionWebflow', { collection })
: target === 'wordpress'
? t('descriptionWordPress', { site })
- : t('description')}
+ : target === 'framer'
+ ? t('descriptionFramer', { collection: framerCollection })
+ : t('description')}
</DialogDescription>
</DialogHeader>
- {/* Where the pages go, before they go: Webflow or WordPress once Settings has it ready. */}
- {(webflow || wordpress) && target && !after && (
+ {/* Where the pages go, before they go: a CMS once Settings has it ready. */}
+ {(webflow || wordpress || framer) && target && !after && (
<CmsTargetPicker
value={target}
webflow={webflow}
wordpress={wordpress}
+ framer={framer}
disabled={phase.kind === 'sending'}
onChange={(next) => {
pick(next);
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/library/_library-table.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/library/_library-table.tsx
index 897cd4f26..a28bf2345 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/library/_library-table.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/library/_library-table.tsx
@@ -387,9 +387,9 @@ function CmsStatusMark({ status }: { status: CmsStatus }) {
const format = useFormatter();
const when = format.dateTime(new Date(status.at), { dateStyle: 'medium', timeStyle: 'short' });
const live = status.status === 'published' ? status.publishedUrl : null;
- // A Webflow or WordPress send (#1331, phase 2) says so: sent, it's a draft item or post there.
+ // A send to a CMS (#1331, phase 2) says so: sent, it's a draft item or post there.
const label = t(
- status.target === 'webflow' || status.target === 'wordpress'
+ status.target === 'webflow' || status.target === 'wordpress' || status.target === 'framer'
? `${status.target}.${status.status}`
: status.status,
{ when },
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/library/page.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/library/page.test.tsx
index 16d22e8cd..9bb9f40eb 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/library/page.test.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/library/page.test.tsx
@@ -50,6 +50,7 @@ const readDraftCms = vi.hoisted(() => vi.fn());
const sendPagesToCms = vi.hoisted(() => vi.fn());
const refreshWebflowPublished = vi.hoisted(() => vi.fn());
const refreshWordPressPublished = vi.hoisted(() => vi.fn());
+const refreshFramerPublished = vi.hoisted(() => vi.fn());
// Mark published (CE-013).
const publishPage = vi.hoisted(() => vi.fn());
const readPublishAddress = vi.hoisted(() => vi.fn());
@@ -58,6 +59,7 @@ vi.mock('@/lib/content/cms-send-client', () => ({
readCmsStatuses,
refreshWebflowPublished,
refreshWordPressPublished,
+ refreshFramerPublished,
readDraftCms,
sendPagesToCms,
readKeptFields: vi.fn(async () => new Map()),
@@ -71,6 +73,10 @@ vi.mock('@/lib/webflow-client', () => ({
vi.mock('@/lib/wordpress-client', () => ({
readWordPress: async () => ({ ok: true, configured: false, connection: null }),
}));
+// Nor its Framer collection (00295).
+vi.mock('@/lib/framer-client', () => ({
+ readFramer: async () => ({ ok: true, configured: false, connection: null }),
+}));
vi.mock('@/lib/actions/content-authors', () => ({ getContentAuthors: vi.fn(async () => null) }));
// The workspace's plan: active unless a test says it's read-only.
const gate = vi.hoisted(() => ({ isLocked: false, openUpgrade: vi.fn() }));
@@ -170,6 +176,7 @@ beforeEach(() => {
getContentDrafts.mockReset();
refreshWebflowPublished.mockReset().mockResolvedValue([]);
refreshWordPressPublished.mockReset().mockResolvedValue([]);
+ refreshFramerPublished.mockReset().mockResolvedValue([]);
readPublishAddress.mockReset().mockResolvedValue('https://acme.example/pipeline-forecasting');
publishPage.mockReset().mockResolvedValue({
ok: true,
@@ -612,6 +619,7 @@ describe('Send to CMS from a Library row (#1331)', () => {
await renderPage();
expect(refreshWebflowPublished).not.toHaveBeenCalled();
expect(refreshWordPressPublished).not.toHaveBeenCalled();
+ expect(refreshFramerPublished).not.toHaveBeenCalled();
});
it('says a page sent to WordPress is a draft post there, and asks WordPress once', async () => {
@@ -667,6 +675,149 @@ describe('Send to CMS from a Library row (#1331)', () => {
expect(refreshWordPressPublished).toHaveBeenCalledTimes(1);
expect(refreshWebflowPublished).toHaveBeenCalledWith('brand-1');
expect(refreshWordPressPublished).toHaveBeenCalledWith('brand-1');
+ expect(refreshFramerPublished).not.toHaveBeenCalled();
+ });
+
+ it('says a page sent to Framer is a draft item there, and asks Framer once', async () => {
+ getContentDrafts.mockResolvedValue([
+ row({}),
+ row({ id: 'd2', title: 'Churn' }),
+ row({ id: 'd3', title: 'Pricing' }),
+ ]);
+ const sent = (status: string, error: string | null = null) => ({
+ status,
+ target: 'framer',
+ at: '2026-10-24T10:00:00Z',
+ httpStatus: null,
+ error,
+ publishedUrl: null,
+ });
+ readCmsStatuses.mockResolvedValue(
+ new Map([
+ ['d1', sent('sent')],
+ ['d2', sent('sent')],
+ // Its item deleted in Framer since (framer-status).
+ ['d3', sent('failed', 'Removed in Framer')],
+ ]),
+ );
+ refreshFramerPublished.mockResolvedValue(['d1']);
+ await renderPage();
+ await act(async () => {});
+ expect(
+ container.querySelectorAll('[aria-label^="In Framer as a draft item since Oct 24, 2026"]'),
+ ).toHaveLength(2);
+ // Framer says when an item goes live: asked once, the list read again as it marked one.
+ expect(refreshFramerPublished).toHaveBeenCalledTimes(1);
+ expect(refreshFramerPublished).toHaveBeenCalledWith('brand-1');
+ expect(getContentDrafts).toHaveBeenCalledTimes(2);
+ expect(refreshWebflowPublished).not.toHaveBeenCalled();
+ expect(refreshWordPressPublished).not.toHaveBeenCalled();
+
+ const mark = container.querySelector<HTMLElement>(
+ '[aria-label^="The last send to Framer failed, Oct 24, 2026"]',
+ )!;
+ await act(async () => {
+ mark.focus();
+ mark.dispatchEvent(new FocusEvent('focusin', { bubbles: true }));
+ });
+ await act(async () => new Promise((resolve) => setTimeout(resolve, 50)));
+ expect(document.body.textContent).toContain('Removed in Framer');
+ });
+
+ it('doesn’t ask Framer when none of its pages is in Framer as a draft item', async () => {
+ getContentDrafts.mockResolvedValue([
+ row({}),
+ row({ id: 'd2', title: 'Churn' }),
+ row({ id: 'd3', title: 'Pricing' }),
+ ]);
+ const last = (status: string) => ({
+ status,
+ target: 'framer',
+ at: '2026-10-24T10:00:00Z',
+ httpStatus: null,
+ error: null,
+ publishedUrl: null,
+ });
+ readCmsStatuses.mockResolvedValue(
+ new Map([
+ ['d1', last('queued')],
+ ['d2', last('failed')],
+ ['d3', last('published')],
+ ]),
+ );
+ await renderPage();
+ await act(async () => {});
+ expect(container.querySelector('[aria-label^="Sending to Framer since"]')).not.toBeNull();
+ expect(refreshFramerPublished).not.toHaveBeenCalled();
+ });
+
+ it('asks Framer again for another brand, once a brand per visit', async () => {
+ getContentDrafts.mockResolvedValue([row({})]);
+ readCmsStatuses.mockResolvedValue(
+ new Map([
+ [
+ 'd1',
+ {
+ status: 'sent',
+ target: 'framer',
+ at: '2026-10-24T10:00:00Z',
+ httpStatus: null,
+ error: null,
+ publishedUrl: null,
+ },
+ ],
+ ]),
+ );
+ await renderPage();
+ await act(async () => {});
+ expect(refreshFramerPublished).toHaveBeenCalledTimes(1);
+ expect(refreshFramerPublished).toHaveBeenLastCalledWith('brand-1');
+ brandState.activeBrandId = 'brand-2';
+ await renderPage();
+ await act(async () => {});
+ expect(refreshFramerPublished).toHaveBeenCalledTimes(2);
+ expect(refreshFramerPublished).toHaveBeenLastCalledWith('brand-2');
+ // Back to the first: read already on this visit.
+ brandState.activeBrandId = 'brand-1';
+ await renderPage();
+ await act(async () => {});
+ expect(refreshFramerPublished).toHaveBeenCalledTimes(2);
+ });
+
+ it('asks Webflow, WordPress and Framer once each when pages went to all three', async () => {
+ getContentDrafts.mockResolvedValue([
+ row({}),
+ row({ id: 'd2', title: 'Churn' }),
+ row({ id: 'd3', title: 'Pricing' }),
+ ]);
+ const sent = (target: string) => ({
+ status: 'sent',
+ target,
+ at: '2026-10-24T10:00:00Z',
+ httpStatus: null,
+ error: null,
+ publishedUrl: null,
+ });
+ readCmsStatuses.mockResolvedValue(
+ new Map([
+ ['d1', sent('webflow')],
+ ['d2', sent('wordpress')],
+ ['d3', sent('framer')],
+ ]),
+ );
+ refreshWebflowPublished.mockResolvedValue(['d1']);
+ refreshWordPressPublished.mockResolvedValue(['d2']);
+ refreshFramerPublished.mockResolvedValue(['d3']);
+ await renderPage();
+ await act(async () => {});
+ for (const refresh of [
+ refreshWebflowPublished,
+ refreshWordPressPublished,
+ refreshFramerPublished,
+ ]) {
+ expect(refresh).toHaveBeenCalledTimes(1);
+ expect(refresh).toHaveBeenCalledWith('brand-1');
+ }
});
it('says the workflow’s reason for a page its webhook took that then failed', async () => {
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/library/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/library/page.tsx
index 651beee6f..d6c23393b 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/library/page.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/library/page.tsx
@@ -39,6 +39,7 @@ import {
import { CMS_PAGES_PER_SEND, type CmsSource } from '@/lib/content/cms-send';
import {
readCmsStatuses,
+ refreshFramerPublished,
refreshWebflowPublished,
refreshWordPressPublished,
type CmsStatus,
@@ -210,16 +211,18 @@ export default function ContentLibraryPage() {
return () => clearTimeout(timer);
}, [cmsGoing, cms]);
- // Pages in Webflow as draft items, or in WordPress as draft posts: the CMS
- // says when one goes live, so the API reads them once as the Library opens
- // for the brand (and daily); the list is read again when it marked any
- // published.
+ // Pages in Webflow or Framer as draft items, or in WordPress as draft
+ // posts: the CMS says when one goes live, so the API reads them once as
+ // the Library opens for the brand (and daily); the list is read again when
+ // it marked any published.
const sentTo = (target: CmsStatus['target']) =>
[...cms.values()].some((status) => status.target === target && status.status === 'sent');
const inWebflow = sentTo('webflow');
const inWordPress = sentTo('wordpress');
+ const inFramer = sentTo('framer');
const webflowRead = useRef(new Set<string>());
const wordpressRead = useRef(new Set<string>());
+ const framerRead = useRef(new Set<string>());
useEffect(() => {
if (isLocked || !inWebflow || !activeBrandId || webflowRead.current.has(activeBrandId)) return;
webflowRead.current.add(activeBrandId);
@@ -239,6 +242,14 @@ export default function ContentLibraryPage() {
if (published.length) setAttempt((n) => n + 1);
});
}, [isLocked, inWordPress, activeBrandId]);
+ useEffect(() => {
+ if (isLocked || !inFramer || !activeBrandId || framerRead.current.has(activeBrandId)) return;
+ framerRead.current.add(activeBrandId);
+ // As Webflow's: not cancelled with the effect.
+ void refreshFramerPublished(activeBrandId).then((published) => {
+ if (published.length) setAttempt((n) => n + 1);
+ });
+ }, [isLocked, inFramer, activeBrandId]);
const reload = () => setAttempt((n) => n + 1);
const titleOf = (draft: ContentDraftListItem) => draft.title.trim() || t('untitled');
diff --git a/web/src/components/content/cms-target.tsx b/web/src/components/content/cms-target.tsx
index 3fc108c8c..73c8e66ca 100644
--- a/web/src/components/content/cms-target.tsx
+++ b/web/src/components/content/cms-target.tsx
@@ -6,23 +6,26 @@ import { Button } from '@/components/ui/button';
import { LoadingDots } from '@/components/ui/loading-dots';
import { cn } from '@/lib/utils';
import type { CmsTarget } from '@/lib/content/cms-send-client';
+import { readFramer } from '@/lib/framer-client';
import { readWebflow } from '@/lib/webflow-client';
import { readWordPress } from '@/lib/wordpress-client';
/**
* Where Send to CMS sends (#1331, phase 2): the brand's webhook, its
* Webflow collection once Settings › Integrations has it ready (connected,
- * a collection with a body field), or its WordPress site once connected
- * (00294; no collection or fields to pick there). The choice, picked or
- * sent to, is remembered per brand, in this browser; the first ready of
- * Webflow and WordPress is the first choice where none is remembered, or
- * the remembered one is no longer connected. One remembered and connected
- * but not ready leaves the webhook, as before: the page never goes to
- * another CMS than the one picked. A brand with one connected but not ready
- * sees it, off, so its pages don't go to the webhook unnoticed. A read that
- * fails (or an API without them)
- * leaves the webhook as it was before: a webhook send doesn't need them,
- * and a person who picked the one that couldn't be read is told so.
+ * a collection with a body field), its WordPress site once connected
+ * (00294; no collection or fields to pick there), or its Framer collection
+ * once ready (00295; connected, a collection with its title and body
+ * fields). The choice, picked or sent to, is remembered per brand, in this
+ * browser; the first ready of Webflow, WordPress and Framer is the first
+ * choice where none is remembered, or the remembered one is no longer
+ * connected. One remembered and connected but not ready leaves the
+ * webhook, as before: the page never goes to another CMS than the one
+ * picked. A brand with one connected but not ready sees it, off, so its
+ * pages don't go to the webhook unnoticed. A read that fails (or an API
+ * without them) leaves the webhook as it was before: a webhook send doesn't
+ * need them, and a person who picked the one that couldn't be read is told
+ * so.
*/
/** The targets a brand connects in Settings › Integrations. */
@@ -33,7 +36,9 @@ const storageKey = (brandId: string) => `aeo:cms-target:${brandId}`;
function remembered(brandId: string): CmsTarget | null {
try {
const value = localStorage.getItem(storageKey(brandId));
- return value === 'webhook' || value === 'webflow' || value === 'wordpress' ? value : null;
+ return value === 'webhook' || value === 'webflow' || value === 'wordpress' || value === 'framer'
+ ? value
+ : null;
} catch {
return null;
}
@@ -65,6 +70,15 @@ export type CmsWordPress =
/** Not connected, not set up on this server, or not read. */
| null;
+/** The brand's Framer, as Send to CMS reads it. */
+export type CmsFramer =
+ /** Ready: pages go to this collection as draft items (its name; empty when it has none). */
+ | { ready: true; collection: string }
+ /** Connected, but its API key refused, or no collection or title and body fields picked yet. */
+ | { ready: false }
+ /** Not connected, not set up on this server, or not read. */
+ | null;
+
function webflowOf(result: Awaited<ReturnType<typeof readWebflow>>): CmsWebflow {
const connection = result.ok && result.configured ? result.connection : null;
if (!connection) return null;
@@ -81,17 +95,29 @@ function wordpressOf(result: Awaited<ReturnType<typeof readWordPress>>): CmsWord
: { ready: false };
}
+function framerOf(result: Awaited<ReturnType<typeof readFramer>>): CmsFramer {
+ const connection = result.ok && result.configured ? result.connection : null;
+ if (!connection) return null;
+ return connection.status === 'connected' &&
+ connection.collectionId &&
+ connection.fieldMap.title &&
+ connection.fieldMap.body
+ ? { ready: true, collection: connection.collectionName ?? '' }
+ : { ready: false };
+}
+
/**
- * The brand's send target: undefined while its Webflow and WordPress
- * connections are read, then where pages go and how to change it. A failed
- * read leaves that one out; `unchecked` names it when the person picked it
- * before, and the page goes to the webhook, with `retry`.
+ * The brand's send target: undefined while its Webflow, WordPress and
+ * Framer connections are read, then where pages go and how to change it. A
+ * failed read leaves that one out; `unchecked` names it when the person
+ * picked it before, and the page goes to the webhook, with `retry`.
*/
export function useCmsTarget(brandId: string) {
const [read, setRead] = useState<{
key: string;
webflow: CmsWebflow;
wordpress: CmsWordPress;
+ framer: CmsFramer;
/** The connections that couldn't be read. */
failed: CmsLocal[];
} | null>(null);
@@ -101,18 +127,22 @@ export function useCmsTarget(brandId: string) {
useEffect(() => {
let cancelled = false;
- Promise.all([readWebflow(brandId), readWordPress(brandId)]).then(([webflow, wordpress]) => {
- if (cancelled) return;
- setRead({
- key,
- webflow: webflowOf(webflow),
- wordpress: wordpressOf(wordpress),
- failed: [
- ...(webflow.ok ? [] : ['webflow' as const]),
- ...(wordpress.ok ? [] : ['wordpress' as const]),
- ],
- });
- });
+ Promise.all([readWebflow(brandId), readWordPress(brandId), readFramer(brandId)]).then(
+ ([webflow, wordpress, framer]) => {
+ if (cancelled) return;
+ setRead({
+ key,
+ webflow: webflowOf(webflow),
+ wordpress: wordpressOf(wordpress),
+ framer: framerOf(framer),
+ failed: [
+ ...(webflow.ok ? [] : ['webflow' as const]),
+ ...(wordpress.ok ? [] : ['wordpress' as const]),
+ ...(framer.ok ? [] : ['framer' as const]),
+ ],
+ });
+ },
+ );
return () => {
cancelled = true;
};
@@ -121,12 +151,13 @@ export function useCmsTarget(brandId: string) {
const current = read?.key === key ? read : null;
const webflow = current ? current.webflow : undefined;
const wordpress = current ? current.wordpress : undefined;
+ const framer = current ? current.framer : undefined;
const chosen = picked?.brandId === brandId ? picked.target : remembered(brandId);
// Read again after a failure: the note stays, as trying, until the answer.
const failed = current ? current.failed : read?.key.startsWith(`${brandId}:`) ? read.failed : [];
const unchecked = chosen && chosen !== 'webhook' && failed.includes(chosen) ? chosen : null;
- const connectionOf = (to: CmsLocal) => (to === 'webflow' ? webflow : wordpress);
- // The choice stands while it's still connected; ready or not, it's never swapped for the other CMS.
+ const connectionOf = (to: CmsLocal) => ({ webflow, wordpress, framer })[to];
+ // The choice stands while it's still connected; ready or not, it's never swapped for another CMS.
const kept = chosen && (chosen === 'webhook' || connectionOf(chosen)) ? chosen : null;
const target: CmsTarget | undefined = !current
? undefined
@@ -140,13 +171,17 @@ export function useCmsTarget(brandId: string) {
? 'webflow'
: wordpress?.ready
? 'wordpress'
- : 'webhook';
+ : framer?.ready
+ ? 'framer'
+ : 'webhook';
return {
/** The brand's Webflow; undefined while read; null without one, or when it couldn't be read. */
webflow,
/** The brand's WordPress, as `webflow`. */
wordpress,
+ /** The brand's Framer, as `webflow`. */
+ framer,
target,
/**
* The target the person picked before that couldn't be read: the page
@@ -165,36 +200,36 @@ export function useCmsTarget(brandId: string) {
};
}
-const TARGETS = ['webflow', 'wordpress', 'webhook'] as const;
+const TARGETS = ['webflow', 'wordpress', 'framer', 'webhook'] as const;
/**
- * The targets the brand has, when it has Webflow or WordPress: the person
- * picks where pages go. The webhook is always one; a CMS connected but not
- * ready shows, off, with what to do. One tab stop, the picked card; the
- * arrow keys move to the next one and pick it, past one that's off.
+ * The targets the brand has, when it has Webflow, WordPress or Framer: the
+ * person picks where pages go. The webhook is always one; a CMS connected
+ * but not ready shows, off, with what to do. One tab stop, the picked card;
+ * the arrow keys move to the next one and pick it, past one that's off.
+ * Four cards go two by two.
*/
export function CmsTargetPicker({
value,
webflow,
wordpress,
+ framer,
onChange,
disabled,
}: {
value: CmsTarget;
webflow: CmsWebflow | undefined;
wordpress: CmsWordPress | undefined;
+ framer: CmsFramer | undefined;
onChange: (target: CmsTarget) => void;
disabled?: boolean;
}) {
const t = useTranslations('contentEditor.editor.send.target');
const cards = useRef<Partial<Record<CmsTarget, HTMLButtonElement | null>>>({});
- const shown = TARGETS.filter(
- (target) => target === 'webhook' || (target === 'webflow' ? webflow : wordpress),
- );
+ const connections = { webflow, wordpress, framer };
+ const shown = TARGETS.filter((target) => target === 'webhook' || connections[target]);
const off = (target: CmsTarget) =>
- disabled ||
- (target === 'webflow' && !webflow?.ready) ||
- (target === 'wordpress' && !wordpress?.ready);
+ disabled || (target !== 'webhook' && !connections[target]?.ready);
const onKey = (event: KeyboardEvent, i: number) => {
const step = ({ ArrowRight: 1, ArrowDown: 1, ArrowLeft: -1, ArrowUp: -1 } as const)[
event.key as 'ArrowRight'
@@ -217,9 +252,14 @@ export function CmsTargetPicker({
? t('webflow.hint', { collection: webflow.collection || t('webflow.collection') })
: t('webflow.notReady');
}
- return wordpress?.ready
- ? t('wordpress.hint', { site: wordpress.site })
- : t('wordpress.notReady');
+ if (target === 'wordpress') {
+ return wordpress?.ready
+ ? t('wordpress.hint', { site: wordpress.site })
+ : t('wordpress.notReady');
+ }
+ return framer?.ready
+ ? t('framer.hint', { collection: framer.collection || t('framer.collection') })
+ : t('framer.notReady');
};
return (
<div
@@ -227,7 +267,11 @@ export function CmsTargetPicker({
aria-label={t('label')}
className={cn(
'grid gap-2',
- shown.length === 3 ? 'grid-cols-1 sm:grid-cols-3' : 'grid-cols-2',
+ shown.length === 3
+ ? 'grid-cols-1 sm:grid-cols-3'
+ : shown.length === 4
+ ? 'grid-cols-1 sm:grid-cols-2'
+ : 'grid-cols-2',
)}
>
{shown.map((target, i) => (
@@ -280,7 +324,13 @@ export function CmsTargetUnchecked({
className="flex flex-wrap items-center gap-x-3 gap-y-1.5 text-sm text-muted-foreground"
>
<span className="min-w-0 flex-1">
- {t(target === 'wordpress' ? 'uncheckedWordPress' : 'unchecked')}
+ {t(
+ target === 'wordpress'
+ ? 'uncheckedWordPress'
+ : target === 'framer'
+ ? 'uncheckedFramer'
+ : 'unchecked',
+ )}
</span>
<Button
size="sm"
diff --git a/web/src/components/content/send-to-cms-dialog.test.tsx b/web/src/components/content/send-to-cms-dialog.test.tsx
index 1b78720be..6784483ed 100644
--- a/web/src/components/content/send-to-cms-dialog.test.tsx
+++ b/web/src/components/content/send-to-cms-dialog.test.tsx
@@ -17,6 +17,9 @@ vi.mock('@/lib/webflow-client', () => ({ readWebflow }));
// And its WordPress site (00294): none unless a test gives one.
const readWordPress = vi.hoisted(() => vi.fn());
vi.mock('@/lib/wordpress-client', () => ({ readWordPress }));
+// And its Framer collection (00295): none unless a test gives one.
+const readFramer = vi.hoisted(() => vi.fn());
+vi.mock('@/lib/framer-client', () => ({ readFramer }));
const { SendDialog } = await import('./send-to-cms-dialog');
@@ -79,6 +82,7 @@ beforeEach(() => {
readDraftCms.mockReset().mockResolvedValue(neverSent);
readWebflow.mockReset().mockResolvedValue({ ok: true, configured: false, connection: null });
readWordPress.mockReset().mockResolvedValue({ ok: true, configured: true, connection: null });
+ readFramer.mockReset().mockResolvedValue({ ok: true, configured: true, connection: null });
// The send target remembered per brand, in this browser.
const kept = new Map<string, string>();
vi.stubGlobal('localStorage', {
@@ -824,4 +828,406 @@ describe('SendDialog', () => {
expect(dialog().textContent).toContain('The last send to WordPress failed, Oct 24, 2026');
});
});
+
+ describe('to Framer (#1331, phase 2)', () => {
+ const connection = {
+ status: 'connected',
+ projectId: 'p1',
+ projectName: 'Acme Site',
+ siteUrl: 'https://acme.framer.website',
+ account: 'Ada Lovelace',
+ collectionId: 'fc1',
+ collectionName: 'Articles',
+ fieldMap: { title: 'f-title', body: 'f-body' },
+ connectedAt: '2026-10-27T10:00:00Z',
+ updatedAt: '2026-10-27T10:00:00Z',
+ };
+ const ready = { ok: true, configured: true, connection };
+ // Connected, its collection picked, but no field for the page's title yet.
+ const notReady = {
+ ok: true,
+ configured: true,
+ connection: { ...connection, fieldMap: { body: 'f-body' } },
+ };
+ const refused = {
+ ok: true,
+ configured: true,
+ connection: { ...connection, status: 'auth_failed' },
+ };
+ const webflowReady = {
+ ok: true,
+ configured: true,
+ connection: {
+ status: 'connected',
+ siteId: 's1',
+ siteName: 'Acme',
+ collectionId: 'c1',
+ collectionName: 'Blog Posts',
+ fieldMap: { body: 'post-body' },
+ connectedAt: '2026-10-25T10:00:00Z',
+ updatedAt: '2026-10-25T10:00:00Z',
+ },
+ };
+ const wordpressReady = {
+ ok: true,
+ configured: true,
+ connection: {
+ status: 'connected',
+ siteUrl: 'https://blog.acme.example',
+ siteName: 'Acme Blog',
+ account: 'ansvisor',
+ connectedAt: '2026-10-26T10:00:00Z',
+ updatedAt: '2026-10-26T10:00:00Z',
+ },
+ };
+ const radios = () => [...dialog().querySelectorAll<HTMLButtonElement>('[role="radio"]')];
+ const radio = (name: string) => radios().find((r) => r.textContent?.startsWith(name));
+ const sentWith = (over: object) =>
+ sendPagesToCms.mockResolvedValueOnce({
+ ok: true,
+ deliveries: [{ id: 'x1', draftId: 'd1', status: 'sent', ...over }],
+ });
+
+ it('sends to Framer first when it’s the brand’s only CMS', async () => {
+ readFramer.mockResolvedValue(ready);
+ await render();
+ expect(readFramer).toHaveBeenCalledWith('brand-1');
+ expect(radios().map((r) => r.textContent)).toEqual([
+ 'FramerA draft item in Articles',
+ "Your workflowThe brand's webhook (Zapier, Make, n8n)",
+ ]);
+ expect(dialog().querySelector('[role="radiogroup"]')!.className).toContain('grid-cols-2');
+ expect(radio('Framer')!.getAttribute('aria-checked')).toBe('true');
+ expect(dialog().textContent).toContain(
+ "The page goes to Articles in Framer as a draft item, with its slug and meta. Images aren't sent yet. You publish it in Framer.",
+ );
+ sentWith({ updated: false, live: false, changed: { images: 0 } });
+ await act(async () => button('Send').click());
+ expect(sendPagesToCms).toHaveBeenCalledWith('brand-1', expect.any(Array), 'framer');
+ expect(localStorage.getItem('aeo:cms-target:brand-1')).toBe('framer');
+ expect(toast.success).toHaveBeenCalledWith('Sent to Framer as a draft item', {
+ description: undefined,
+ });
+ expect(onClose).toHaveBeenCalled();
+ });
+
+ it('says “your collection” when the collection has no name', async () => {
+ readFramer.mockResolvedValue({
+ ...ready,
+ connection: { ...connection, collectionName: null },
+ });
+ await render();
+ expect(radio('Framer')!.textContent).toContain('A draft item in your collection');
+ expect(dialog().textContent).toContain('The page goes to your collection in Framer');
+ });
+
+ it('shows all four with Webflow, WordPress and Framer, two by two, starting from the remembered Framer', async () => {
+ localStorage.setItem('aeo:cms-target:brand-1', 'framer');
+ readWebflow.mockResolvedValue(webflowReady);
+ readWordPress.mockResolvedValue(wordpressReady);
+ readFramer.mockResolvedValue(ready);
+ await render();
+ expect(radios().map((r) => r.querySelector('span')?.textContent)).toEqual([
+ 'Webflow',
+ 'WordPress',
+ 'Framer',
+ 'Your workflow',
+ ]);
+ expect(dialog().querySelector('[role="radiogroup"]')!.className).toContain(
+ 'grid-cols-1 sm:grid-cols-2',
+ );
+ expect(radio('Framer')!.getAttribute('aria-checked')).toBe('true');
+ expect(radio('Framer')!.tabIndex).toBe(0);
+ await act(async () => button('Send').click());
+ expect(sendPagesToCms).toHaveBeenLastCalledWith('brand-1', expect.any(Array), 'framer');
+ });
+
+ it('lays three out in a row with Framer and one other CMS', async () => {
+ readWordPress.mockResolvedValue(wordpressReady);
+ readFramer.mockResolvedValue(ready);
+ await render();
+ expect(radios().map((r) => r.querySelector('span')?.textContent)).toEqual([
+ 'WordPress',
+ 'Framer',
+ 'Your workflow',
+ ]);
+ expect(dialog().querySelector('[role="radiogroup"]')!.className).toContain(
+ 'grid-cols-1 sm:grid-cols-3',
+ );
+ // WordPress before Framer when nothing is remembered.
+ expect(radio('WordPress')!.getAttribute('aria-checked')).toBe('true');
+ });
+
+ it('starts from Framer when it’s the only one ready and nothing is remembered', async () => {
+ readWebflow.mockResolvedValue({
+ ...webflowReady,
+ connection: { ...webflowReady.connection, status: 'auth_failed' },
+ });
+ readFramer.mockResolvedValue(ready);
+ await render();
+ expect(radio('Webflow')!.disabled).toBe(true);
+ expect(radio('Framer')!.getAttribute('aria-checked')).toBe('true');
+ });
+
+ it('keeps a remembered Framer that isn’t ready to the webhook, never another CMS in its place', async () => {
+ localStorage.setItem('aeo:cms-target:brand-1', 'framer');
+ readWebflow.mockResolvedValue(webflowReady);
+ readWordPress.mockResolvedValue(wordpressReady);
+ readFramer.mockResolvedValue(notReady);
+ await render();
+ expect(radio('Framer')!.disabled).toBe(true);
+ expect(radio('Framer')!.textContent).toContain(
+ 'Not ready: connect it again or pick its collection and fields in Settings › Integrations',
+ );
+ expect(radio('Webflow')!.getAttribute('aria-checked')).toBe('false');
+ expect(radio('WordPress')!.getAttribute('aria-checked')).toBe('false');
+ expect(radio('Your workflow')!.getAttribute('aria-checked')).toBe('true');
+ await act(async () => button('Send').click());
+ expect(sendPagesToCms).toHaveBeenLastCalledWith('brand-1', expect.any(Array), 'webhook');
+ });
+
+ it('keeps a remembered WordPress that isn’t ready to the webhook, never Framer in its place', async () => {
+ localStorage.setItem('aeo:cms-target:brand-1', 'wordpress');
+ readWordPress.mockResolvedValue({
+ ...wordpressReady,
+ connection: { ...wordpressReady.connection, status: 'auth_failed' },
+ });
+ readFramer.mockResolvedValue(ready);
+ await render();
+ expect(radio('Framer')!.getAttribute('aria-checked')).toBe('false');
+ expect(radio('Your workflow')!.getAttribute('aria-checked')).toBe('true');
+ });
+
+ it('counts Framer not ready without a collection, or a field for the page’s title or body', async () => {
+ for (const over of [
+ { collectionId: null },
+ { fieldMap: { title: 'f-title' } },
+ { fieldMap: { body: 'f-body' } },
+ ]) {
+ readFramer.mockResolvedValue({ ...ready, connection: { ...connection, ...over } });
+ await render();
+ expect(radio('Framer')!.disabled).toBe(true);
+ expect(radio('Framer')!.textContent).toContain(
+ 'Not ready: connect it again or pick its collection and fields in Settings › Integrations',
+ );
+ expect(radio('Your workflow')!.getAttribute('aria-checked')).toBe('true');
+ act(() => root.unmount());
+ root = createRoot(container);
+ }
+ });
+
+ it('sends to the webhook when the remembered Webflow or WordPress can’t be read, never Framer', async () => {
+ readFramer.mockResolvedValue(ready);
+ for (const [picked, note] of [
+ ['webflow', "Couldn't check Webflow just now, so this send goes to your workflow."],
+ ['wordpress', "Couldn't check WordPress just now, so this send goes to your workflow."],
+ ] as const) {
+ localStorage.setItem('aeo:cms-target:brand-1', picked);
+ const unread = { ok: false, code: 'failed' };
+ readWebflow.mockResolvedValue(picked === 'webflow' ? unread : webflowReady);
+ readWordPress.mockResolvedValue(picked === 'wordpress' ? unread : wordpressReady);
+ await render();
+ expect(dialog().querySelector('[role="status"]')!.textContent).toContain(note);
+ expect(radio('Framer')!.getAttribute('aria-checked')).toBe('false');
+ expect(radio('Your workflow')!.getAttribute('aria-checked')).toBe('true');
+ await act(async () => button('Send').click());
+ expect(sendPagesToCms).toHaveBeenLastCalledWith('brand-1', expect.any(Array), 'webhook');
+ act(() => root.unmount());
+ root = createRoot(container);
+ }
+ });
+
+ it('starts from the first ready when the remembered Framer is no longer connected', async () => {
+ localStorage.setItem('aeo:cms-target:brand-1', 'framer');
+ readWebflow.mockResolvedValue(webflowReady);
+ await render();
+ expect(radio('Framer')).toBeUndefined();
+ expect(radio('Webflow')!.getAttribute('aria-checked')).toBe('true');
+ });
+
+ it('moves through the four with the arrow keys, past one that’s off', async () => {
+ readWebflow.mockResolvedValue(webflowReady);
+ readWordPress.mockResolvedValue(wordpressReady);
+ readFramer.mockResolvedValue(ready);
+ await render();
+ await vi.waitFor(() => expect(dialog().contains(document.activeElement)).toBe(true));
+ const key = async (from: string, key: string) =>
+ act(async () => {
+ radio(from)!.dispatchEvent(new KeyboardEvent('keydown', { key, bubbles: true }));
+ });
+ await key('Webflow', 'ArrowRight');
+ await key('WordPress', 'ArrowRight');
+ expect(radio('Framer')!.getAttribute('aria-checked')).toBe('true');
+ expect(document.activeElement).toBe(radio('Framer'));
+ await key('Framer', 'ArrowDown');
+ expect(radio('Your workflow')!.getAttribute('aria-checked')).toBe('true');
+ await key('Your workflow', 'ArrowLeft');
+ expect(radio('Framer')!.getAttribute('aria-checked')).toBe('true');
+ expect(localStorage.getItem('aeo:cms-target:brand-1')).toBe('framer');
+
+ act(() => root.unmount());
+ root = createRoot(container);
+ localStorage.setItem('aeo:cms-target:brand-1', 'wordpress');
+ readFramer.mockResolvedValue(refused);
+ await render();
+ expect(radio('Framer')!.disabled).toBe(true);
+ await key('WordPress', 'ArrowRight');
+ // Framer, off, is passed over.
+ expect(radio('Your workflow')!.getAttribute('aria-checked')).toBe('true');
+ await key('Your workflow', 'ArrowLeft');
+ expect(radio('WordPress')!.getAttribute('aria-checked')).toBe('true');
+ });
+
+ it('shows Framer not ready, off, and says what to fix when the brand has no webhook', async () => {
+ localStorage.setItem('aeo:cms-target:brand-1', 'framer');
+ readFramer.mockResolvedValue(refused);
+ await render();
+ expect(radio('Framer')!.disabled).toBe(true);
+ expect(radio('Your workflow')!.getAttribute('aria-checked')).toBe('true');
+ sendPagesToCms.mockResolvedValueOnce({ ok: false, code: 'no_webhook', field: null });
+ await act(async () => button('Send').click());
+ expect(sendPagesToCms).toHaveBeenLastCalledWith('brand-1', expect.any(Array), 'webhook');
+ expect(alert()).toBe(
+ "This brand's Framer isn't ready, and it has no webhook. Connect Framer again or pick its collection and fields in Settings › Integrations.",
+ );
+ });
+
+ it('says only that the webhook is missing when a CMS is ready to pick instead', async () => {
+ localStorage.setItem('aeo:cms-target:brand-1', 'webhook');
+ readWordPress.mockResolvedValue(wordpressReady);
+ readFramer.mockResolvedValue(notReady);
+ sendPagesToCms.mockResolvedValueOnce({ ok: false, code: 'no_webhook', field: null });
+ await render();
+ await act(async () => button('Send').click());
+ expect(alert()).toBe(
+ 'This brand has no webhook yet. Set one up in Webhook Settings on Content Opportunities.',
+ );
+ });
+
+ it('says Framer couldn’t be checked to a person who picked it, and reads again', async () => {
+ localStorage.setItem('aeo:cms-target:brand-1', 'framer');
+ readWebflow.mockResolvedValue(webflowReady);
+ readFramer.mockResolvedValueOnce({ ok: false, code: 'failed' }).mockResolvedValue(ready);
+ await render();
+ expect(dialog().querySelector('[role="status"]')!.textContent).toContain(
+ "Couldn't check Framer just now, so this send goes to your workflow.",
+ );
+ // Not Webflow in its place: the webhook, as the note says.
+ expect(radio('Framer')).toBeUndefined();
+ expect(radio('Your workflow')!.getAttribute('aria-checked')).toBe('true');
+ await act(async () => button('Try again').click());
+ expect(readFramer).toHaveBeenCalledTimes(2);
+ expect(radio('Framer')!.getAttribute('aria-checked')).toBe('true');
+ expect(dialog().querySelector('[role="status"]')).toBeNull();
+ });
+
+ it('says nothing of a Framer it can’t read to a person who didn’t pick it', async () => {
+ readWebflow.mockResolvedValue(webflowReady);
+ readFramer.mockResolvedValue({ ok: false, code: 'failed' });
+ await render();
+ expect(dialog().querySelector('[role="status"]')).toBeNull();
+ expect(radio('Webflow')!.getAttribute('aria-checked')).toBe('true');
+ });
+
+ it('says the item was updated, its images left out, and when a published item goes live', async () => {
+ readFramer.mockResolvedValue(ready);
+ sentWith({ updated: true, live: false, changed: { images: 0 } });
+ await render();
+ await act(async () => button('Send').click());
+ expect(toast.success).toHaveBeenLastCalledWith('Updated in Framer', {
+ description: undefined,
+ });
+
+ // The dialog stays open here (onClose is the test's): sent again.
+ sentWith({ updated: true, live: true, changed: { images: 2 } });
+ await act(async () => button('Send').click());
+ expect(toast.success).toHaveBeenLastCalledWith('Updated in Framer', {
+ description:
+ "2 images weren't sent: add them in Framer. The item isn't a draft in Framer, so the change goes live with your next publish of the site.",
+ });
+
+ sentWith({ updated: false, live: false, changed: { images: 1 } });
+ await act(async () => button('Send').click());
+ expect(toast.success).toHaveBeenLastCalledWith('Sent to Framer as a draft item', {
+ description: "1 image wasn't sent: add it in Framer.",
+ });
+
+ sentWith({ updated: true, live: true });
+ await act(async () => button('Send').click());
+ expect(toast.success).toHaveBeenLastCalledWith('Updated in Framer', {
+ description:
+ "The item isn't a draft in Framer, so the change goes live with your next publish of the site.",
+ });
+
+ // Webflow's tables aren't Framer's: nothing said of them.
+ sentWith({ updated: false, changed: { tables: 3, images: 0 } });
+ await act(async () => button('Send').click());
+ expect(toast.success).toHaveBeenLastCalledWith('Sent to Framer as a draft item', {
+ description: undefined,
+ });
+ });
+
+ it('says why Framer didn’t take the page', async () => {
+ readFramer.mockResolvedValue(ready);
+ await render();
+ const said = async (result: object) => {
+ sendPagesToCms.mockResolvedValueOnce(result);
+ await act(async () => button('Send').click());
+ return alert();
+ };
+ expect(await said({ ok: false, code: 'no_framer', field: null })).toBe(
+ 'Connect Framer in Settings › Integrations first.',
+ );
+ expect(await said({ ok: false, code: 'framer_refused', field: null })).toBe(
+ "Framer refused the brand's API key. Connect it again in Settings › Integrations.",
+ );
+ expect(await said({ ok: false, code: 'framer_not_configured', field: null })).toBe(
+ "Framer isn't set up on this server. Send to your workflow instead.",
+ );
+ expect(await said({ ok: false, code: 'framer_not_ready', field: null })).toBe(
+ 'Pick the Framer collection and its fields in Settings › Integrations.',
+ );
+ expect(await said({ ok: false, code: 'in_progress', field: null })).toBe(
+ 'This page is already on its way to Framer. Wait for it, then send again.',
+ );
+ expect(
+ await said({
+ ok: true,
+ deliveries: [
+ {
+ id: 'x2',
+ draftId: 'd1',
+ status: 'failed',
+ error: 'Framer refused the item: a required field is empty',
+ },
+ ],
+ }),
+ ).toBe("Framer didn't take the page: Framer refused the item: a required field is empty");
+ expect(sendPagesToCms).toHaveBeenLastCalledWith('brand-1', expect.any(Array), 'framer');
+ expect(onClose).not.toHaveBeenCalled();
+ });
+
+ it('says the last send went to Framer', async () => {
+ readFramer.mockResolvedValue(ready);
+ readDraftCms.mockResolvedValue({
+ ...neverSent,
+ last: { status: 'sent', target: 'framer', at: '2026-10-24T10:00:00Z', error: null },
+ });
+ await render();
+ expect(dialog().textContent).toContain('In Framer as a draft item since Oct 24, 2026');
+ readDraftCms.mockResolvedValue({
+ ...neverSent,
+ last: {
+ status: 'failed',
+ target: 'framer',
+ at: '2026-10-24T10:00:00Z',
+ error: 'Removed in Framer',
+ },
+ });
+ act(() => root.unmount());
+ root = createRoot(container);
+ await render();
+ expect(dialog().textContent).toContain('The last send to Framer failed, Oct 24, 2026');
+ });
+ });
});
diff --git a/web/src/components/content/send-to-cms-dialog.tsx b/web/src/components/content/send-to-cms-dialog.tsx
index 7c4a3b440..031f2a2fc 100644
--- a/web/src/components/content/send-to-cms-dialog.tsx
+++ b/web/src/components/content/send-to-cms-dialog.tsx
@@ -40,9 +40,9 @@ import { CmsTargetPicker, CmsTargetUnchecked, useCmsTarget } from './cms-target'
/**
* Send to CMS (#1331): the page to the brand's webhook, for the workspace's
- * CMS or automation to publish, to its Webflow collection as a draft item,
- * or to its WordPress site as a draft post (phase 2, when Settings has them
- * ready). Its slug and meta are filled from the page,
+ * CMS or automation to publish, to its Webflow or Framer collection as a
+ * draft item, or to its WordPress site as a draft post (phase 2, when
+ * Settings has them ready). Its slug and meta are filled from the page,
* or what the draft kept, and editable; they stay on the draft. The page
* goes as Export makes it ready (CE-057): no placeholder goes, so they are
* filled first. From the editor's header and a Library row; rendered only
@@ -113,6 +113,7 @@ export function SendDialog({
const {
webflow,
wordpress,
+ framer,
target,
pick,
sent: keepTarget,
@@ -122,6 +123,7 @@ export function SendDialog({
} = useCmsTarget(brandId);
const collection = webflow?.ready ? webflow.collection || t('target.webflow.collection') : '';
const site = wordpress?.ready ? wordpress.site : '';
+ const framerCollection = framer?.ready ? framer.collection || t('target.framer.collection') : '';
useEffect(() => {
let cancelled = false;
@@ -230,6 +232,18 @@ export function SendDialog({
toast.success(delivery?.updated ? t('sentWordPressUpdated') : t('sentWordPress'), {
description: notes.length ? notes.join(' ') : undefined,
});
+ } else if (target === 'framer') {
+ // Images don't go to Framer's formatted text yet. An item updated that
+ // isn't a draft is published there: the change goes live with the
+ // site's next publish.
+ const images = delivery?.changed?.images ?? 0;
+ const notes = [
+ images ? t('framerImages', { images }) : null,
+ delivery?.live ? t('framerLive') : null,
+ ].filter((note) => note !== null);
+ toast.success(delivery?.updated ? t('sentFramerUpdated') : t('sentFramer'), {
+ description: notes.length ? notes.join(' ') : undefined,
+ });
} else {
toast.success(t('sent'));
}
@@ -242,6 +256,7 @@ export function SendDialog({
const failed = {
webflow: 'errors.webflowFailed',
wordpress: 'errors.wordpressFailed',
+ framer: 'errors.framerFailed',
webhook: 'errors.webhookFailed',
} as const;
return t(failed[shown.target], { reason: shown.failed });
@@ -251,13 +266,17 @@ export function SendDialog({
return tFailure(code);
}
// No CMS ready sent the page to the webhook: what to fix is the one connected.
- if (code === 'no_webhook' && !webflow?.ready && !wordpress?.ready) {
+ if (code === 'no_webhook' && !webflow?.ready && !wordpress?.ready && !framer?.ready) {
if (webflow) return t('errors.no_webhookWebflow');
if (wordpress) return t('errors.no_webhookWordPress');
+ if (framer) return t('errors.no_webhookFramer');
}
if (code === 'in_progress' && shown.target === 'wordpress') {
return t('errors.in_progressWordPress');
}
+ if (code === 'in_progress' && shown.target === 'framer') {
+ return t('errors.in_progressFramer');
+ }
// The server names the path ("pages.0.slug"); the field is its last part.
if (code === 'invalid' && field) {
return t('errors.invalidField', { field: field.split('.').pop() ?? 'other' });
@@ -283,15 +302,18 @@ export function SendDialog({
? t('descriptionWebflow', { collection })
: target === 'wordpress'
? t('descriptionWordPress', { site })
- : t('description')}
+ : target === 'framer'
+ ? t('descriptionFramer', { collection: framerCollection })
+ : t('description')}
</DialogDescription>
</DialogHeader>
- {(webflow || wordpress) && target && (
+ {(webflow || wordpress || framer) && target && (
<CmsTargetPicker
value={target}
webflow={webflow}
wordpress={wordpress}
+ framer={framer}
disabled={sending}
onChange={(next) => {
pick(next);
@@ -407,7 +429,9 @@ export function SendDialog({
? `lastWebflow.${last.status}`
: last.target === 'wordpress'
? `lastWordPress.${last.status}`
- : `last.${last.status}`,
+ : last.target === 'framer'
+ ? `lastFramer.${last.status}`
+ : `last.${last.status}`,
{
when: format.dateTime(new Date(last.at), {
dateStyle: 'medium',
diff --git a/web/src/lib/content/cms-send-client.test.ts b/web/src/lib/content/cms-send-client.test.ts
index c2b77fca0..6c6903b9a 100644
--- a/web/src/lib/content/cms-send-client.test.ts
+++ b/web/src/lib/content/cms-send-client.test.ts
@@ -44,6 +44,7 @@ const {
readDeliveries,
readDraftCms,
readKeptFields,
+ refreshFramerPublished,
refreshWebflowPublished,
refreshWordPressPublished,
sendPagesToCms,
@@ -122,6 +123,24 @@ describe('sendPagesToCms', () => {
expect(JSON.parse(fetchMock.mock.calls.at(-1)![1].body)).toMatchObject({
target: 'wordpress',
});
+ // To the brand's Framer collection (00295): its item live, its images left out.
+ answer(200, {
+ deliveries: [
+ {
+ id: 'x5',
+ draftId: 'd1',
+ status: 'sent',
+ updated: true,
+ live: true,
+ changed: { images: 2 },
+ },
+ ],
+ });
+ expect(await sendPagesToCms('brand-1', [page], 'framer')).toMatchObject({
+ ok: true,
+ deliveries: [{ updated: true, live: true, changed: { images: 2 } }],
+ });
+ expect(JSON.parse(fetchMock.mock.calls.at(-1)![1].body)).toMatchObject({ target: 'framer' });
});
it('gives the server’s reason, and the field a 400 names', async () => {
@@ -159,6 +178,16 @@ describe('sendPagesToCms', () => {
code,
});
}
+ for (const [status, code] of [
+ [503, 'framer_not_configured'],
+ [409, 'no_framer'],
+ [409, 'framer_refused'],
+ [409, 'framer_not_ready'],
+ [409, 'in_progress'],
+ ] as const) {
+ answer(status, { code });
+ expect(await sendPagesToCms('brand-1', [page], 'framer')).toMatchObject({ ok: false, code });
+ }
});
it('says when a request was more than the API’s proxy takes', async () => {
@@ -249,6 +278,35 @@ describe('refreshWordPressPublished', () => {
});
});
+describe('refreshFramerPublished', () => {
+ it('asks the API to read the brand’s Framer items, and gives the drafts it marked published', async () => {
+ answer(200, {
+ checked: 2,
+ published: [
+ { draftId: 'd1', url: 'https://acme.framer.website/blog/cold-brew' },
+ // A page deleted since: no draft to mark.
+ { draftId: null, url: 'https://acme.framer.website/blog/espresso' },
+ ],
+ });
+ expect(await refreshFramerPublished('brand-1')).toEqual(['d1']);
+ expect(fetchMock).toHaveBeenCalledWith('/api/aeo/api/content-drafts/framer-status', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json', Authorization: 'Bearer token-1' },
+ body: JSON.stringify({ brandId: 'brand-1' }),
+ });
+ // Read a moment ago, or not there (an API before 00295): none.
+ answer(200, { checked: 0, published: [], recent: true });
+ expect(await refreshFramerPublished('brand-1')).toEqual([]);
+ answer(404, {});
+ expect(await refreshFramerPublished('brand-1')).toEqual([]);
+ fetchMock.mockRejectedValueOnce(new Error('offline'));
+ expect(await refreshFramerPublished('brand-1')).toEqual([]);
+ session = null;
+ expect(await refreshFramerPublished('brand-1')).toEqual([]);
+ expect(fetchMock).toHaveBeenCalledTimes(4);
+ });
+});
+
describe('readDraftCms', () => {
it('gives the kept fields, where the page went live and its last send', async () => {
reads = {
@@ -305,6 +363,32 @@ describe('readDraftCms', () => {
});
});
+ it('says the last send went to Framer', async () => {
+ reads = {
+ content_drafts: {
+ data: { slug: null, meta_title: null, meta_description: null, published_url: null },
+ error: null,
+ },
+ content_draft_deliveries: {
+ data: {
+ status: 'sent',
+ target: 'framer',
+ created_at: '2026-10-24T10:00:00Z',
+ sent_at: '2026-10-24T10:00:02Z',
+ published_at: null,
+ error: null,
+ },
+ error: null,
+ },
+ };
+ expect((await readDraftCms('d1'))?.last).toEqual({
+ status: 'sent',
+ target: 'framer',
+ at: '2026-10-24T10:00:02Z',
+ error: null,
+ });
+ });
+
it('gives no last send when its read fails, and null when the draft’s does', async () => {
reads = {
content_drafts: {
@@ -423,6 +507,28 @@ describe('readCmsStatuses', () => {
expect(statuses.get('d2')).toMatchObject({ target: 'webhook' });
});
+ it('says which sends went to Framer, and one removed there since as failed', async () => {
+ statusReads = [
+ {
+ data: [
+ delivery('d1', 'sent', '2026-10-24T10:00:00Z', { target: 'framer' }),
+ delivery('d2', 'failed', '2026-10-24T10:00:00Z', {
+ target: 'framer',
+ error: 'Removed in Framer',
+ }),
+ ],
+ error: null,
+ },
+ ];
+ const statuses = await readCmsStatuses(['d1', 'd2']);
+ expect(statuses.get('d1')).toMatchObject({ status: 'sent', target: 'framer' });
+ expect(statuses.get('d2')).toMatchObject({
+ status: 'failed',
+ target: 'framer',
+ error: 'Removed in Framer',
+ });
+ });
+
it('leaves a read that fails with no sends, as before its table is there', async () => {
statusReads = [{ data: null, error: { message: 'relation does not exist' } }];
expect((await readCmsStatuses(['d1'])).size).toBe(0);
diff --git a/web/src/lib/content/cms-send-client.ts b/web/src/lib/content/cms-send-client.ts
index 731b12805..b31252ac8 100644
--- a/web/src/lib/content/cms-send-client.ts
+++ b/web/src/lib/content/cms-send-client.ts
@@ -10,10 +10,10 @@ import type { CmsFields, CmsPage } from '@/lib/content/cms-send';
*/
/**
- * Where pages go: the brand's webhook (phase 1), its Webflow collection or
- * its WordPress site (phase 2).
+ * Where pages go: the brand's webhook (phase 1), its Webflow collection, its
+ * WordPress site or its Framer collection (phase 2).
*/
-export type CmsTarget = 'webhook' | 'webflow' | 'wordpress';
+export type CmsTarget = 'webhook' | 'webflow' | 'wordpress' | 'framer';
/** Why a send didn't go, as the server names it. */
export type CmsSendError =
@@ -29,6 +29,12 @@ export type CmsSendError =
| 'wordpress_not_configured'
| 'no_wordpress'
| 'wordpress_refused'
+ // Framer (00295): not on this server, not connected, its API key refused,
+ // or no collection and fields picked.
+ | 'framer_not_configured'
+ | 'no_framer'
+ | 'framer_refused'
+ | 'framer_not_ready'
| 'in_progress'
| 'daily_limit'
| 'forbidden'
@@ -53,13 +59,17 @@ export interface CmsDelivery {
/** Why it failed, as the server wrote it ("The webhook could not be reached"). */
error?: string | null;
/**
- * Webflow or WordPress, one page: its item (or draft post) updated, not
- * made, and what of the page changed on the way: Webflow's tables and
- * images, WordPress's JSON-LD blocks left out.
+ * Webflow, WordPress or Framer, one page: its item (or draft post)
+ * updated, not made, and what of the page changed on the way: Webflow's
+ * tables and images, WordPress's JSON-LD blocks left out, Framer's images.
*/
updated?: boolean;
changed?: { tables?: number; images?: number; jsonLd?: number };
- /** WordPress: the page's post was live, so the page went as a new draft post. */
+ /**
+ * WordPress: the page's post was live, so the page went as a new draft
+ * post. Framer: the item updated isn't a draft, so the page goes live with
+ * the site's next publish.
+ */
live?: boolean;
}
@@ -79,6 +89,10 @@ const KNOWN: readonly CmsSendError[] = [
'wordpress_not_configured',
'no_wordpress',
'wordpress_refused',
+ 'framer_not_configured',
+ 'no_framer',
+ 'framer_refused',
+ 'framer_not_ready',
'in_progress',
'daily_limit',
'forbidden',
@@ -90,8 +104,9 @@ const KNOWN: readonly CmsSendError[] = [
const GENERAL: readonly CmsSendError[] = ['session', 'workspace', 'busy', 'subscription'];
/**
- * Sends pages of one brand to its webhook, its Webflow collection or its
- * WordPress site: one is sent before this answers, more go on.
+ * Sends pages of one brand to its webhook, its Webflow collection, its
+ * WordPress site or its Framer collection: one is sent before this answers,
+ * more go on.
*/
export async function sendPagesToCms(
brandId: string,
@@ -138,7 +153,7 @@ export async function sendPagesToCms(
*/
async function refreshPublished(
brandId: string,
- route: 'webflow-status' | 'wordpress-status',
+ route: 'webflow-status' | 'wordpress-status' | 'framer-status',
label: string,
): Promise<string[]> {
try {
@@ -175,10 +190,18 @@ export function refreshWordPressPublished(brandId: string): Promise<string[]> {
return refreshPublished(brandId, 'wordpress-status', 'WordPress');
}
+/** The brand's pages sent to Framer as draft items, published there since (00295). */
+export function refreshFramerPublished(brandId: string): Promise<string[]> {
+ return refreshPublished(brandId, 'framer-status', 'Framer');
+}
+
/** A draft's last send, as the Library shows it beside its status. */
export interface CmsStatus {
status: CmsDelivery['status'];
- /** Where it went: the webhook, Webflow (a draft item there once sent) or WordPress (a draft post). */
+ /**
+ * Where it went: the webhook, Webflow or Framer (a draft item there once
+ * sent) or WordPress (a draft post).
+ */
target: CmsTarget;
/** When it was published, sent or queued. */
at: string;
@@ -212,7 +235,10 @@ function lastSend(row: {
row.status === 'queued' && Date.parse(row.created_at) < Date.now() - INTERRUPTED_AFTER_MS;
return {
status: interrupted ? 'failed' : (row.status as CmsDelivery['status']),
- target: row.target === 'webflow' || row.target === 'wordpress' ? row.target : 'webhook',
+ target:
+ row.target === 'webflow' || row.target === 'wordpress' || row.target === 'framer'
+ ? row.target
+ : 'webhook',
at: row.published_at ?? row.sent_at ?? row.created_at,
error: interrupted ? 'Not sent: interrupted' : row.error,
};