create-ailk 0.46.4 → 0.46.5
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/component-catalog.json +9 -1
- package/package.json +3 -3
- package/templates/apps/web/CLAUDE.md +16 -4
- package/templates/apps/web/app/[locale]/layout.tsx +4 -0
- package/templates/apps/web/lib/__tests__/in-page-blocks.test.ts +261 -0
- package/templates/apps/web/lib/__tests__/offerings-pricing.test.ts +89 -2
- package/templates/apps/web/lib/__tests__/structured-data.test.tsx +18 -1
- package/templates/apps/web/lib/in-page-blocks.ts +175 -0
- package/templates/apps/web/lib/offerings-pricing.ts +12 -1
- package/templates/apps/web/messages/en.json +14 -0
- package/versions.json +50 -50
package/component-catalog.json
CHANGED
|
@@ -11834,6 +11834,13 @@
|
|
|
11834
11834
|
"full",
|
|
11835
11835
|
"clamp"
|
|
11836
11836
|
]
|
|
11837
|
+
},
|
|
11838
|
+
"yesMark": {
|
|
11839
|
+
"type": "string",
|
|
11840
|
+
"enum": [
|
|
11841
|
+
"muted",
|
|
11842
|
+
"ink"
|
|
11843
|
+
]
|
|
11837
11844
|
}
|
|
11838
11845
|
},
|
|
11839
11846
|
"required": [
|
|
@@ -11847,7 +11854,8 @@
|
|
|
11847
11854
|
"variant",
|
|
11848
11855
|
"headlineSize",
|
|
11849
11856
|
"checkStyle",
|
|
11850
|
-
"longCells"
|
|
11857
|
+
"longCells",
|
|
11858
|
+
"yesMark"
|
|
11851
11859
|
]
|
|
11852
11860
|
},
|
|
11853
11861
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-ailk",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.5",
|
|
4
4
|
"description": "Scaffolder for AI Launch Kit — `pnpm create ailk@latest <dir>` produces a starter repo consuming @working-theory/* from npm (per ADR 0007).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"tar": "^7.5.21"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@working-theory/schema": "0.
|
|
32
|
-
"@working-theory/templates": "0.
|
|
31
|
+
"@working-theory/schema": "0.79.0",
|
|
32
|
+
"@working-theory/templates": "0.79.0"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
|
@@ -822,7 +822,10 @@ key), so the page names none. It renders one of three pages:
|
|
|
822
822
|
another one `requires`) gets the render-time `offering` that
|
|
823
823
|
`offeringsPlanColumns` builds from the card `planCard` / `bundleCard` would
|
|
824
824
|
give it — its title (`ailk_name ?? name`), price, checkout link and the
|
|
825
|
-
shown set's Recommended — whatever the page's `plans` lists. A
|
|
825
|
+
shown set's Recommended — whatever the page's `plans` lists. A product with
|
|
826
|
+
a Stripe unit label gives its column the card's amount and unit joined by a
|
|
827
|
+
space (`$17 /mo/seat`), so the header and the phone picker read as the card
|
|
828
|
+
does; with none, the column keeps the card's one-string phrase (#12280). A table with a
|
|
826
829
|
plan column takes the render-time `billingPeriod` its page's cards open on:
|
|
827
830
|
`?billing=`, else `pricingOpensOn` for a first plans section in the toggle
|
|
828
831
|
layout (annual with a shown or hidden toggle), else monthly — the only
|
|
@@ -830,7 +833,9 @@ key), so the page names none. It renders one of three pages:
|
|
|
830
833
|
`withoutRenderTimeFields` strips both first. The plan bar's `price` and `button` (off by default) show a
|
|
831
834
|
plan column's price and checkout button in its header cell and nothing in
|
|
832
835
|
a typed one's; a toggle on any pricing section of the page announces each
|
|
833
|
-
choice as the `ailk:billing-period` window event, which the table
|
|
836
|
+
choice as the `ailk:billing-period` window event, which the table, and every
|
|
837
|
+
pricing section with a shown or hidden toggle, follows — so two pricing
|
|
838
|
+
sections on one page always show one period (#12281).
|
|
834
839
|
A plan column the page cannot resolve — not shown, the contact path, an
|
|
835
840
|
unconnected site, a page that is not a Pricing page — renders its typed
|
|
836
841
|
name or its slug, and the hub's page report carries a
|
|
@@ -859,7 +864,12 @@ key), so the page names none. It renders one of three pages:
|
|
|
859
864
|
`messages/site/<locale>.json`: `pricingOfferings` is the one namespace where
|
|
860
865
|
the locale's OWN overlay replaces the catalog's strings (`i18n/request.ts`'s
|
|
861
866
|
`SITE_OVERRIDE_NAMESPACES`; the English fallback stays add-only), and
|
|
862
|
-
`create-ailk update` keeps that file.
|
|
867
|
+
`create-ailk update` keeps that file. The billing toggle's words are three keys
|
|
868
|
+
of that namespace — `billingToggleMonthly` ("Monthly"), `billingToggleAnnual`
|
|
869
|
+
("Annually") and `billingToggleName` ("Billing period", its accessible name) —
|
|
870
|
+
which `renderPage` places as the render-time `billingToggleLabels` on every
|
|
871
|
+
pricing section of every page, so one site key rewords every switch (#12284).
|
|
872
|
+
A site rewording a period rewords
|
|
863
873
|
`perMonth` for the card's unit and `monthly` for every one-string surface (the
|
|
864
874
|
plan bars, compact blocks, select details). A bound section picks the line
|
|
865
875
|
under a yearly price with `annualPriceLine` — `billed` (the default),
|
|
@@ -1114,7 +1124,9 @@ A list page whose frontmatter sets `navOnly: true` (valid on a registry list typ
|
|
|
1114
1124
|
- Don't reach into `apps/api` or `apps/mcp` from `apps/web`. They're peer apps — talk via HTTP/MCP.
|
|
1115
1125
|
- Don't commit images to `screenshots/` — only the `.gitkeep` is tracked.
|
|
1116
1126
|
|
|
1117
|
-
Last updated: 2026-11-
|
|
1127
|
+
Last updated: 2026-11-24 — § Pricing page: the billing toggle's three `pricingOfferings` keys, placed on every pricing section by `renderPage` (#12284) — verified against `messages/en.json` and `packages/page-renderer/src/{index.tsx,billing-toggle-labels.ts}`; 2026-11-24 — § Pricing page: every pricing section with a shown or hidden billing toggle follows the `ailk:billing-period` event, so two sections on one page show one period (#12281) — verified against `packages/ui/src/sections/Pricing.tsx`; 2026-11-24 — § Pricing page: a plan column's price carries the product's Stripe unit label, as its card's does (#12280) — verified against `lib/offerings-pricing.ts` and `packages/ui/src/blocks/PlanBar.tsx`.
|
|
1128
|
+
|
|
1129
|
+
Prior: 2026-11-23 — § Pricing page: a comparison table's plan columns — the plan column, `withPlanColumns`, `offeringsPlanColumns`, the start period and the billing event, the unresolved column and its advisory finding, the checkout cell-link rule — and the retired `with-comparison-table` read as a pricing section and a comparison table (#12246) — verified against `lib/pricing-page.ts`, `lib/offerings-pricing.ts`, `packages/validation/src/schemas/{page-sections,offerings}.ts`, `packages/ui/src/blocks/PlanBar.tsx` and `packages/ui/src/sections/ComparisonTable.tsx`.
|
|
1118
1130
|
|
|
1119
1131
|
Prior: 2026-11-23 — § Pricing page: one card for plans and add-ons — the retired tile and split card, the `addons` section as the toggle layout, the `loneCard` rule, the wide card's toggle, `levelSwitchDetail`, `featureDetails` / `featureRowStyle`, `wideSide` and the `ailk_detail` and `ailk_images` keys (#12241) — verified against `lib/offerings-pricing.ts`, `lib/pricing-page.ts`, `packages/ui/src/sections/Pricing.tsx` and `packages/api/src/services/offerings/catalog.ts`.
|
|
1120
1132
|
|
|
@@ -83,6 +83,10 @@ import {
|
|
|
83
83
|
readCaptureStatus,
|
|
84
84
|
readServedMagnet,
|
|
85
85
|
} from "../../lib/in-page-magnet";
|
|
86
|
+
// #12222 D13 — a body's Offer and Grid block lines. Importing this module
|
|
87
|
+
// registers the site's block renderer with page-renderer at module load, as
|
|
88
|
+
// importing `in-page-magnet` registers the magnet section renderer.
|
|
89
|
+
import "../../lib/in-page-blocks";
|
|
86
90
|
// #8687 D5 — the per-page deck opt-in. Importing this module registers the
|
|
87
91
|
// deck-page seam with page-renderer at module load (D3), the same
|
|
88
92
|
// precedent as `../../lib/site-identity` and `../../lib/listings` below.
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lib/in-page-blocks.ts — the site's renderer for a body's block lines
|
|
3
|
+
* (#12222, spec docs/specs/12222-capabilities-and-alternatives-what-a-spec.md
|
|
4
|
+
* D13, D18; B4 #12293): AC-13, AC-14.
|
|
5
|
+
*
|
|
6
|
+
* The grid read is mocked at `@working-theory/api-client`, the locale's words
|
|
7
|
+
* at `next-intl/server`, and `pricingSections` (the shared Pricing render,
|
|
8
|
+
* whose own suite covers it) at `../pricing-page`, so this suite pins what the
|
|
9
|
+
* renderer asks for and draws.
|
|
10
|
+
*/
|
|
11
|
+
import type { GridAnswer, PageSection } from "@working-theory/validation";
|
|
12
|
+
import { renderToStaticMarkup } from "react-dom/server";
|
|
13
|
+
|
|
14
|
+
jest.mock("@working-theory/api-client", () => ({
|
|
15
|
+
content: { grid: jest.fn() },
|
|
16
|
+
flows: { get: jest.fn() },
|
|
17
|
+
leads: { captureStatus: jest.fn() },
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
jest.mock("@working-theory/site-pages/pages/contact/contact.actions", () => ({
|
|
21
|
+
captureLeadAction: jest.fn(),
|
|
22
|
+
}));
|
|
23
|
+
// eslint-disable-next-line no-restricted-syntax -- test-seam mock: a "use server" boundary the module only binds
|
|
24
|
+
jest.mock("../newsletter.actions", () => ({
|
|
25
|
+
subscribeNewsletterAction: jest.fn(),
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
/** The `grids` messages; a case may replace one word. */
|
|
29
|
+
const mockGrids: Record<string, string> = {
|
|
30
|
+
fromLevel: "From {level}",
|
|
31
|
+
addon: "Add-on",
|
|
32
|
+
ourAssessment: "Our assessment",
|
|
33
|
+
checked: "Checked {date}",
|
|
34
|
+
factsAsOf: "Facts as of {date}",
|
|
35
|
+
countOf: "{yes} of {of}",
|
|
36
|
+
capabilities: "Capabilities",
|
|
37
|
+
labelHeader: "What you get",
|
|
38
|
+
planPicker: "Plan",
|
|
39
|
+
};
|
|
40
|
+
jest.mock("next-intl/server", () => ({
|
|
41
|
+
getTranslations: jest.fn(async () => (key: string, values: Record<string, unknown> = {}) =>
|
|
42
|
+
Object.entries(values).reduce(
|
|
43
|
+
(text, [name, value]) => text.replace(`{${name}}`, String(value)),
|
|
44
|
+
mockGrids[key] ?? key,
|
|
45
|
+
),
|
|
46
|
+
),
|
|
47
|
+
}));
|
|
48
|
+
|
|
49
|
+
const mockPricingSections = jest.fn();
|
|
50
|
+
// eslint-disable-next-line no-restricted-syntax -- the shared Pricing render is its own suite's subject; this suite pins only what the renderer hands it
|
|
51
|
+
jest.mock("../pricing-page", () => ({
|
|
52
|
+
pricingSections: (...args: unknown[]) => mockPricingSections(...args),
|
|
53
|
+
}));
|
|
54
|
+
|
|
55
|
+
import { content } from "@working-theory/api-client";
|
|
56
|
+
import { parseBlockLine, type BlockLine } from "@working-theory/validation";
|
|
57
|
+
|
|
58
|
+
import { renderBodyBlock, renderGrid } from "../in-page-blocks";
|
|
59
|
+
|
|
60
|
+
const grid = jest.mocked(content.grid);
|
|
61
|
+
|
|
62
|
+
const line = (text: string): BlockLine => {
|
|
63
|
+
const parsed = parseBlockLine(text);
|
|
64
|
+
if (parsed === null) throw new Error(`not a block line: ${text}`);
|
|
65
|
+
return parsed;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** `publicGrid`'s answer for `R` and `S` on Website platform, by feature. */
|
|
69
|
+
const ANSWER: GridAnswer = {
|
|
70
|
+
kind: "alternatives",
|
|
71
|
+
columns: [
|
|
72
|
+
{ key: "ours", ours: true, name: "Growth Hub" },
|
|
73
|
+
{ key: "wix", ours: false, name: "Wix", what: "A website builder", source: { url: "https://wix.com/pricing" }, checkedOn: "2026-11-01" },
|
|
74
|
+
],
|
|
75
|
+
groups: [
|
|
76
|
+
{
|
|
77
|
+
id: "build",
|
|
78
|
+
name: "Build",
|
|
79
|
+
rows: [
|
|
80
|
+
{ id: "r1", name: "Pages", cells: { ours: { verdict: "yes" }, wix: { verdict: "yes" } } },
|
|
81
|
+
{
|
|
82
|
+
id: "r2",
|
|
83
|
+
name: "Drafts",
|
|
84
|
+
cells: {
|
|
85
|
+
ours: { verdict: "yes", note: { code: "from-level", level: "Pro Plus" } },
|
|
86
|
+
wix: { verdict: "partial", words: "Blog only" },
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
summaries: {},
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
factsAsOf: "2026-11-01",
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
let keySeq = 0;
|
|
97
|
+
|
|
98
|
+
beforeEach(() => {
|
|
99
|
+
grid.mockReset();
|
|
100
|
+
mockPricingSections.mockReset();
|
|
101
|
+
mockGrids.fromLevel = "From {level}";
|
|
102
|
+
mockGrids.labelHeader = "What you get";
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
/** Each case reads a line no other case read, so the 15 s share never answers from another case. */
|
|
106
|
+
function uniqueGridLine(): string {
|
|
107
|
+
keySeq += 1;
|
|
108
|
+
return `<Grid kind="alternatives" category="website-platform-${keySeq}" show="features" />`;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
async function html(text: string, locale = "en"): Promise<string | null> {
|
|
112
|
+
const node = await renderBodyBlock({ block: line(text), locale });
|
|
113
|
+
return node === null || node === undefined ? null : renderToStaticMarkup(node as React.ReactElement);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
describe("a grid block renders the published answer through the comparison table (AC-14)", () => {
|
|
117
|
+
it("reads the grid once, by kind and slug, and draws its rows and columns", async () => {
|
|
118
|
+
grid.mockResolvedValue({ ok: true, body: ANSWER });
|
|
119
|
+
const text = uniqueGridLine();
|
|
120
|
+
const out = await html(text);
|
|
121
|
+
expect(grid).toHaveBeenCalledTimes(1);
|
|
122
|
+
expect(grid.mock.calls[0]![0]).toEqual({
|
|
123
|
+
kind: "alternatives",
|
|
124
|
+
slug: `website-platform-${keySeq}`,
|
|
125
|
+
show: "features",
|
|
126
|
+
locale: "en",
|
|
127
|
+
});
|
|
128
|
+
expect(out).toContain("Pages");
|
|
129
|
+
expect(out).toContain("Drafts");
|
|
130
|
+
expect(out).toContain("Wix");
|
|
131
|
+
expect(out).toContain("Blog only");
|
|
132
|
+
expect(out).toContain("From Pro Plus");
|
|
133
|
+
// A grid without price or button needs no shown-set read.
|
|
134
|
+
expect(mockPricingSections).not.toHaveBeenCalled();
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it("draws an alternative's Yes in dark ink and its Partial mid grey, so the column scans (#12222 decision 3)", async () => {
|
|
138
|
+
grid.mockResolvedValue({ ok: true, body: ANSWER });
|
|
139
|
+
const out = (await html(uniqueGridLine())) ?? "";
|
|
140
|
+
const marks = (label: string) =>
|
|
141
|
+
(out.match(/<svg[^>]*>/g) ?? []).filter((tag) => tag.includes(`aria-label="${label}"`) && !tag.includes("lucide-check"));
|
|
142
|
+
// Wix's Yes on Pages: the circle-dot, in the foreground ink.
|
|
143
|
+
expect(marks("Included").length).toBeGreaterThan(0);
|
|
144
|
+
for (const tag of marks("Included")) expect(tag).toContain("text-(--color-fg)");
|
|
145
|
+
// Wix's Partial on Drafts stays muted.
|
|
146
|
+
expect(marks("Partially included").length).toBeGreaterThan(0);
|
|
147
|
+
for (const tag of marks("Partially included")) expect(tag).toContain("text-(--color-text-muted)");
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
it("words every fixed word from the locale's messages: fromLevel \"Ab {level}\" reads \"Ab Pro Plus\"", async () => {
|
|
151
|
+
mockGrids.fromLevel = "Ab {level}";
|
|
152
|
+
grid.mockResolvedValue({ ok: true, body: ANSWER });
|
|
153
|
+
const out = await html(uniqueGridLine(), "de");
|
|
154
|
+
expect(out).toContain("Ab Pro Plus");
|
|
155
|
+
expect(out).not.toContain("From Pro Plus");
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it("names the row-name column from the locale's messages, never the table's English default (D18)", async () => {
|
|
159
|
+
mockGrids.labelHeader = "Was Sie bekommen";
|
|
160
|
+
grid.mockResolvedValue({ ok: true, body: ANSWER });
|
|
161
|
+
const out = await html(uniqueGridLine(), "de");
|
|
162
|
+
expect(out).toContain("Was Sie bekommen");
|
|
163
|
+
expect(out).not.toContain("Capability");
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
it.each<[string, () => void]>([
|
|
167
|
+
["a refusal", () => grid.mockResolvedValue({ ok: false, status: 400, body: {} })],
|
|
168
|
+
["a throw", () => grid.mockRejectedValue(new Error("hub down"))],
|
|
169
|
+
["an answer that does not parse", () => grid.mockResolvedValue({ ok: true, body: { kind: "alternatives" } as never })],
|
|
170
|
+
[
|
|
171
|
+
"an empty grid",
|
|
172
|
+
() => grid.mockResolvedValue({ ok: true, body: { kind: "alternatives", columns: [], groups: [], factsAsOf: null } }),
|
|
173
|
+
],
|
|
174
|
+
])("renders nothing for %s", async (_label, stub) => {
|
|
175
|
+
stub();
|
|
176
|
+
await expect(html(uniqueGridLine())).resolves.toBeNull();
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
it("refuses an answer whose own note carries free text (GridAnswerSchema)", async () => {
|
|
180
|
+
const free: { groups: Array<{ rows: Array<{ cells: Record<string, unknown> }> }> } = structuredClone(ANSWER);
|
|
181
|
+
free.groups[0]!.rows[1]!.cells.ours = { verdict: "yes", note: { code: "from-level", level: "Pro", text: "Ab Pro" } };
|
|
182
|
+
grid.mockResolvedValue({ ok: true, body: free as never });
|
|
183
|
+
await expect(html(uniqueGridLine())).resolves.toBeNull();
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
it("with price on a Capabilities grid, resolves its plan columns beside a bound pricing section it never draws", async () => {
|
|
187
|
+
grid.mockResolvedValue({
|
|
188
|
+
ok: true,
|
|
189
|
+
body: {
|
|
190
|
+
kind: "capabilities",
|
|
191
|
+
columns: [
|
|
192
|
+
{ key: "pro", ours: true, plan: "pro", name: "Pro" },
|
|
193
|
+
{ key: "pro-plus", ours: true, plan: "pro-plus", name: "Pro Plus" },
|
|
194
|
+
],
|
|
195
|
+
groups: [{ id: "site", name: "Site", rows: [{ id: "pages", name: "Pages", cells: { pro: true, "pro-plus": true } }], summaries: {} }],
|
|
196
|
+
factsAsOf: null,
|
|
197
|
+
},
|
|
198
|
+
});
|
|
199
|
+
// The shared render places a Stripe card in the bound section, as a connected site would.
|
|
200
|
+
mockPricingSections.mockImplementation(async (sections: PageSection[]) =>
|
|
201
|
+
sections.map((section) =>
|
|
202
|
+
section.type === "pricing"
|
|
203
|
+
? ({
|
|
204
|
+
...section,
|
|
205
|
+
data: {
|
|
206
|
+
...section.data,
|
|
207
|
+
plans: [{ name: "Growth", price: { monthly: "$49" }, features: [], cta: { label: "Buy", href: "/buy" } }],
|
|
208
|
+
},
|
|
209
|
+
} as PageSection)
|
|
210
|
+
: section,
|
|
211
|
+
),
|
|
212
|
+
);
|
|
213
|
+
const block = line(`<Grid kind="capabilities" products="growth-hub-${(keySeq += 1)}" show="features" price="true" />`);
|
|
214
|
+
if (block.tag !== "Grid") throw new Error("not a grid");
|
|
215
|
+
const node = await renderGrid(block.block, "en");
|
|
216
|
+
const [sections] = mockPricingSections.mock.calls[0] as [PageSection[]];
|
|
217
|
+
expect(sections.map((s) => s.type)).toEqual(["pricing", "comparison-table"]);
|
|
218
|
+
expect((sections[0]!.data as { offeringPlans: string[] }).offeringPlans).toEqual(["pro", "pro-plus"]);
|
|
219
|
+
const out = renderToStaticMarkup(node!);
|
|
220
|
+
expect(out).toContain("Pages");
|
|
221
|
+
// The pricing section is read for the plan columns, never drawn.
|
|
222
|
+
expect(out).not.toContain("pricing-tier-card");
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
describe("an offer block renders today's Stripe cards (AC-13)", () => {
|
|
227
|
+
// eslint-disable-next-line no-restricted-syntax -- a minimal placed Stripe card; the full PricingPlan shape is pricingSections' own suite's subject
|
|
228
|
+
const cards = { type: "pricing", id: "x", data: { plans: [{ name: "Growth", price: "$49", features: [] }] } } as unknown as PageSection;
|
|
229
|
+
|
|
230
|
+
it("one plan: a bound section for that plan, the page's ?plan= left alone", async () => {
|
|
231
|
+
mockPricingSections.mockResolvedValue([cards]);
|
|
232
|
+
await html('<Offer slug="growth" />');
|
|
233
|
+
const [sections, options] = mockPricingSections.mock.calls[0] as [PageSection[], Record<string, unknown>];
|
|
234
|
+
expect(sections).toEqual([
|
|
235
|
+
{ type: "pricing", id: "offer-growth", data: { plans: [], source: "offerings", offeringPlans: ["growth"] } },
|
|
236
|
+
]);
|
|
237
|
+
expect(options).toEqual({ plans: undefined, plan: undefined, locale: "en" });
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
it("several plans: one bound section, yearly as its toggle, recommended as the page's ?plan=", async () => {
|
|
241
|
+
mockPricingSections.mockResolvedValue([cards]);
|
|
242
|
+
await html('<Offer plans="essentials growth scale" yearly="true" recommended="growth" />');
|
|
243
|
+
const [sections, options] = mockPricingSections.mock.calls[0] as [PageSection[], Record<string, unknown>];
|
|
244
|
+
expect(sections).toHaveLength(1);
|
|
245
|
+
expect(sections[0]!.data).toEqual({
|
|
246
|
+
plans: [],
|
|
247
|
+
source: "offerings",
|
|
248
|
+
offeringPlans: ["essentials", "growth", "scale"],
|
|
249
|
+
billingToggle: true,
|
|
250
|
+
});
|
|
251
|
+
expect(options).toMatchObject({ plan: "growth" });
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
it("renders nothing when the shown set gives no Stripe cards (the contact path, an unconnected site)", async () => {
|
|
255
|
+
mockPricingSections.mockResolvedValue([
|
|
256
|
+
{ type: "contact-form", id: "offerings-contact", data: { fields: [] } },
|
|
257
|
+
{ type: "pricing", id: "offer-growth", data: { plans: [] } },
|
|
258
|
+
]);
|
|
259
|
+
await expect(html('<Offer slug="growth" />')).resolves.toBeNull();
|
|
260
|
+
});
|
|
261
|
+
});
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* or price order, so a sort fails AC-1. The labels are sentinels (`⟪`), so
|
|
8
8
|
* any copy the mapper invents shows up in AC-7.
|
|
9
9
|
*/
|
|
10
|
-
import { render } from "@testing-library/react";
|
|
11
|
-
import { Pricing } from "@working-theory/ui/sections";
|
|
10
|
+
import { fireEvent, render, within } from "@testing-library/react";
|
|
11
|
+
import { Pricing, SectionRenderer } from "@working-theory/ui/sections";
|
|
12
12
|
import {
|
|
13
13
|
parseLookupKey,
|
|
14
14
|
PricingSectionDataSchema,
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
workspaceShownSetSchema,
|
|
17
17
|
type OfferingsPrice,
|
|
18
18
|
type OfferingsProduct,
|
|
19
|
+
type PageSection,
|
|
19
20
|
type WorkspaceShownSet,
|
|
20
21
|
} from "@working-theory/validation";
|
|
21
22
|
import React from "react";
|
|
@@ -2511,4 +2512,90 @@ describe("price parts (#12242)", () => {
|
|
|
2511
2512
|
for (const block of blocks) expect(block).not.toHaveProperty("priceParts");
|
|
2512
2513
|
expect(PricingSectionDataSchema.safeParse(offeringsPricing(setOf(SEAT), OPTIONS)!.plans).success).toBe(true);
|
|
2513
2514
|
});
|
|
2515
|
+
|
|
2516
|
+
describe("offeringsPlanColumns — the header price carries the unit (#12280)", () => {
|
|
2517
|
+
const columnsOf = (offerings: OfferingsProduct[], slug: string, labels: OfferingsPricingLabels = ENGLISH) =>
|
|
2518
|
+
offeringsPlanColumns(setOf(...offerings), [slug], { locale: "en-US", labels }).get(slug);
|
|
2519
|
+
|
|
2520
|
+
it("AC-1 — a unit label's column reads the card's amount and unit, joined as the card joins them", () => {
|
|
2521
|
+
expect(columnsOf([SEAT], "positionary")!.price).toEqual({ monthly: "$20 /mo/seat", annual: "$17 /mo/seat" });
|
|
2522
|
+
expect(columnsOf([SEAT], "positionary", { ...ENGLISH, unitWithLabel: (p, l) => p + " per " + l })!.price).toEqual({
|
|
2523
|
+
monthly: "$20 /mo per seat",
|
|
2524
|
+
annual: "$17 /mo per seat",
|
|
2525
|
+
});
|
|
2526
|
+
const yearly = columnsOf([YEARLY_ONLY], "positionary")!.price;
|
|
2527
|
+
expect(yearly.annual).toBe("$200 /yr/seat");
|
|
2528
|
+
const card = partsOf(one(YEARLY_ONLY, { labels: ENGLISH }))!.annual!;
|
|
2529
|
+
expect(yearly.annual).toBe(`${card["amount"]} ${card["unit"]}`);
|
|
2530
|
+
});
|
|
2531
|
+
|
|
2532
|
+
it("AC-2 — no unit label keeps today's header, word for word", () => {
|
|
2533
|
+
expect(columnsOf([BARE], "bare")!.price).toEqual({ monthly: "$20/mo", annual: "$17/mo" });
|
|
2534
|
+
expect(columnsOf([BARE], "bare")!.price).toEqual(one(BARE, { labels: ENGLISH }).price);
|
|
2535
|
+
expect(columnsOf([BARE], "bare", { ...ENGLISH, monthly: (a) => a + " per month" })!.price.monthly).toBe("$20 per month");
|
|
2536
|
+
expect(columnsOf([seat(20000, { unitLabel: "\u200B" })], "positionary")!.price).toEqual({
|
|
2537
|
+
monthly: "$20/mo",
|
|
2538
|
+
annual: "$17/mo",
|
|
2539
|
+
});
|
|
2540
|
+
const setup = product("setup", "plan", [price("setup", "once", 50000, "usd")], {
|
|
2541
|
+
requires: "retainer",
|
|
2542
|
+
unitLabel: "seat",
|
|
2543
|
+
});
|
|
2544
|
+
const retainer = product("retainer", "plan", [price("retainer", "monthly", 10000, "usd")], { unitLabel: "seat" });
|
|
2545
|
+
const bundle = cardsOf([setup, retainer], { labels: ENGLISH }).find((c) => c.key === "setup")!;
|
|
2546
|
+
expect(columnsOf([setup, retainer], "setup")!.price).toEqual({ custom: bundle.price.custom });
|
|
2547
|
+
});
|
|
2548
|
+
|
|
2549
|
+
describe.each(["monthly", "annual"] as const)("AC-1, AC-3 — the rendered card and table (%s)", (period) => {
|
|
2550
|
+
const expected = period === "monthly" ? "$20 /mo/seat" : "$17 /mo/seat";
|
|
2551
|
+
function renderBoth() {
|
|
2552
|
+
const plans = offeringsPricing(setOf(SEAT), { ...OPTIONS, labels: ENGLISH })!.plans!;
|
|
2553
|
+
const card = render(
|
|
2554
|
+
React.createElement(Pricing, {
|
|
2555
|
+
sectionName: "pricing",
|
|
2556
|
+
data: { ...plans, billingPeriod: period },
|
|
2557
|
+
} as Parameters<typeof Pricing>[0]),
|
|
2558
|
+
);
|
|
2559
|
+
const cardLine = card.getByTestId("tier-price-unit").parentElement!.textContent;
|
|
2560
|
+
card.unmount();
|
|
2561
|
+
const offering = columnsOf([SEAT], "positionary")!;
|
|
2562
|
+
// `offering` and `billingPeriod` are render-time fields, as `withPlanColumns` sets them.
|
|
2563
|
+
const section: PageSection = {
|
|
2564
|
+
type: "comparison-table",
|
|
2565
|
+
id: "compare",
|
|
2566
|
+
data: {
|
|
2567
|
+
columns: [
|
|
2568
|
+
{ key: "us", name: "Us" },
|
|
2569
|
+
{ key: "positionary", plan: "positionary", offering },
|
|
2570
|
+
],
|
|
2571
|
+
groups: [{ groupName: "Basics", rows: [{ featureName: "Seats", values: { us: true, positionary: true } }] }],
|
|
2572
|
+
planBar: { pickerLabel: "Plans", price: true },
|
|
2573
|
+
billingPeriod: period,
|
|
2574
|
+
} as Extract<PageSection, { type: "comparison-table" }>["data"],
|
|
2575
|
+
};
|
|
2576
|
+
const table = render(React.createElement(SectionRenderer, { sections: [section] }));
|
|
2577
|
+
return { cardLine, table };
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2580
|
+
it("the desktop header and the phone picker read the card's price line", () => {
|
|
2581
|
+
const { cardLine, table } = renderBoth();
|
|
2582
|
+
expect(cardLine).toBe(expected);
|
|
2583
|
+
const cell = table.getByTestId("plan-bar-cell-positionary");
|
|
2584
|
+
expect(within(cell).getByText(expected).tagName).toBe("SPAN");
|
|
2585
|
+
expect(table.queryByTestId("plan-bar-summary")).toBeNull();
|
|
2586
|
+
const picker = table.getByTestId("plan-bar-picker");
|
|
2587
|
+
fireEvent.click(within(picker).getByRole("radio", { name: "Positionary" }));
|
|
2588
|
+
expect(table.getByTestId("plan-bar-summary").textContent).toBe(cardLine);
|
|
2589
|
+
});
|
|
2590
|
+
|
|
2591
|
+
it("a typed column still shows no price", () => {
|
|
2592
|
+
const { table } = renderBoth();
|
|
2593
|
+
expect(table.getByTestId("plan-bar-cell-us").textContent).toBe("Us");
|
|
2594
|
+
const row = table.getByTestId("plan-bar-row");
|
|
2595
|
+
const seats = within(row).getAllByText(/seat/);
|
|
2596
|
+
const cell = table.getByTestId("plan-bar-cell-positionary");
|
|
2597
|
+
for (const el of seats) expect(cell).toContainElement(el);
|
|
2598
|
+
});
|
|
2599
|
+
});
|
|
2600
|
+
});
|
|
2514
2601
|
});
|
|
@@ -529,6 +529,15 @@ const NO_STRUCTURED_DATA_ROUTES: ReadonlyArray<{
|
|
|
529
529
|
route: "how-to",
|
|
530
530
|
reason: "hand-composed listing; no HowTo list type exists",
|
|
531
531
|
},
|
|
532
|
+
// #12204 D6 — the three-or-more-segment catch-all serves only a magnet's
|
|
533
|
+
// children at an owner-chosen address (its walk, verify and results pages)
|
|
534
|
+
// through `site.magnetAddress`, and reads no content. Keyed on that call, so
|
|
535
|
+
// a page that renders content here is checked like any other.
|
|
536
|
+
{
|
|
537
|
+
route: "[slug]/[detail]/[...rest]",
|
|
538
|
+
reason: "a magnet's children at its owner-chosen address (#12204 D6), served through site.magnetAddress; no content page behind it",
|
|
539
|
+
requires: ["site.magnetAddress.pageAt"],
|
|
540
|
+
},
|
|
532
541
|
{
|
|
533
542
|
route: "careers/[slug]/[action]",
|
|
534
543
|
reason: "the Free apply form for a posting; noindex, no JSON-LD (#8849 D7)",
|
|
@@ -1051,9 +1060,17 @@ describe("structured data — exemption(route, src) keys the generated checkout
|
|
|
1051
1060
|
expect(exemption("about", GENERATED_SRC)).toBeUndefined();
|
|
1052
1061
|
});
|
|
1053
1062
|
|
|
1063
|
+
it("exempts the magnet-address catch-all only while its page serves through site.magnetAddress (#12204 D6)", () => {
|
|
1064
|
+
const route = "[slug]/[detail]/[...rest]";
|
|
1065
|
+
const served = "const magnet = await site.magnetAddress.pageAt(\n [slug, detail, ...rest],";
|
|
1066
|
+
expect(exemption(route, served)).toContain("#12204 D6");
|
|
1067
|
+
expect(exemption(route, "")).toBeUndefined();
|
|
1068
|
+
expect(exemption(route, 'return renderPage({ type: "LandingPage", slug });')).toBeUndefined();
|
|
1069
|
+
});
|
|
1070
|
+
|
|
1054
1071
|
it("every pre-existing entry still returns its reason for its own route with any src, subtree entries included", () => {
|
|
1055
1072
|
for (const entry of NO_STRUCTURED_DATA_ROUTES) {
|
|
1056
|
-
if (entry.requires !== undefined) continue; //
|
|
1073
|
+
if (entry.requires !== undefined) continue; // a conditional entry keys on its file; see its own case
|
|
1057
1074
|
expect(exemption(entry.route, "")).toBe(entry.reason);
|
|
1058
1075
|
if (entry.subtree === true) {
|
|
1059
1076
|
expect(exemption(`${entry.route}/child`, "")).toBe(entry.reason);
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* in-page-blocks.ts — the site's renderer for a page body's block lines
|
|
3
|
+
* (#12222, spec docs/specs/12222-capabilities-and-alternatives-what-a-spec.md
|
|
4
|
+
* D13, D18; B4 #12293).
|
|
5
|
+
*
|
|
6
|
+
* `@working-theory/page-renderer` finds each `<Offer … />` or `<Grid … />`
|
|
7
|
+
* line in a prose or mdx-body page (`resolveBodyBlocks`, the one grammar
|
|
8
|
+
* `parseBlockLine`) and asks the renderer registered here, at module load,
|
|
9
|
+
* for its node. The locale layout imports this module, as it imports
|
|
10
|
+
* `in-page-magnet`, so every page render has it.
|
|
11
|
+
*
|
|
12
|
+
* - **Offer.** One `pricing` section bound to the shown set
|
|
13
|
+
* (`source: "offerings"`, `offeringPlans`, `billingToggle` from `yearly`),
|
|
14
|
+
* run through `pricingSections` with `recommended` as the page's `?plan=`,
|
|
15
|
+
* so the cards are today's Stripe cards. Anything but Stripe cards — an
|
|
16
|
+
* unconnected site, an expired set, plans not shown — renders nothing.
|
|
17
|
+
* - **Grid.** The public read, `GET /v1/content/grids/:kind/:slug`, through
|
|
18
|
+
* api-client `content.grid`, shared per instance for 15 s
|
|
19
|
+
* (`sharedHubRead`), parsed by `GridAnswerSchema` and worded by
|
|
20
|
+
* `gridSection` with the page locale's `grids` messages — no English
|
|
21
|
+
* default reaches a page (D18). With `price` or `button`, the table's plan
|
|
22
|
+
* columns take their price and button from the shown set through
|
|
23
|
+
* `pricingSections`' plan-column resolver. Drawn through `SectionRenderer`.
|
|
24
|
+
*
|
|
25
|
+
* A read that fails, an answer that does not parse, an empty grid or a throw
|
|
26
|
+
* renders nothing (`null`), so a page never breaks on a block; page-renderer
|
|
27
|
+
* adds its own 3,000 ms backstop. The grid's data is never written anywhere:
|
|
28
|
+
* every render reads the published facts and Stripe's features afresh.
|
|
29
|
+
*/
|
|
30
|
+
import { content } from "@working-theory/api-client";
|
|
31
|
+
import { setBodyBlockRenderer, type BodyBlockRenderer } from "@working-theory/page-renderer";
|
|
32
|
+
import { SectionRenderer } from "@working-theory/ui";
|
|
33
|
+
import {
|
|
34
|
+
GridAnswerSchema,
|
|
35
|
+
gridSection,
|
|
36
|
+
writeBlockLine,
|
|
37
|
+
type GridAnswer,
|
|
38
|
+
type GridBlock,
|
|
39
|
+
type GridLabels,
|
|
40
|
+
type OfferBlock,
|
|
41
|
+
type PageSection,
|
|
42
|
+
} from "@working-theory/validation";
|
|
43
|
+
import { unstable_rethrow } from "next/navigation";
|
|
44
|
+
import { getTranslations } from "next-intl/server";
|
|
45
|
+
import { createElement, type ReactElement } from "react";
|
|
46
|
+
|
|
47
|
+
import { sharedHubRead } from "./in-page-magnet";
|
|
48
|
+
import { pricingSections } from "./pricing-page";
|
|
49
|
+
|
|
50
|
+
type Sections = PageSection[];
|
|
51
|
+
|
|
52
|
+
/** The section list as `SectionRenderer` draws it, or `null` when there is none. */
|
|
53
|
+
function drawn(sections: Sections, locale: string): ReactElement | null {
|
|
54
|
+
return sections.length === 0 ? null : createElement(SectionRenderer, { sections, locale });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** A bound pricing section for `plans` (#12140 D1), the one shape both blocks hand `pricingSections`. */
|
|
58
|
+
function boundPlans(id: string, plans: readonly string[], billingToggle: boolean): PageSection {
|
|
59
|
+
return {
|
|
60
|
+
type: "pricing",
|
|
61
|
+
id,
|
|
62
|
+
data: {
|
|
63
|
+
plans: [],
|
|
64
|
+
source: "offerings",
|
|
65
|
+
offeringPlans: [...plans],
|
|
66
|
+
...(billingToggle ? { billingToggle: true } : {}),
|
|
67
|
+
},
|
|
68
|
+
} as PageSection;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** A pricing section that carries Stripe cards: bound, with plans placed. */
|
|
72
|
+
function carriesCards(section: PageSection): boolean {
|
|
73
|
+
if (section.type !== "pricing") return false;
|
|
74
|
+
const data = section.data as { plans?: unknown[] };
|
|
75
|
+
return Array.isArray(data.plans) && data.plans.length > 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// ── Offer ──────────────────────────────────────────────────────────
|
|
79
|
+
|
|
80
|
+
export async function renderOffer(block: OfferBlock, locale: string): Promise<ReactElement | null> {
|
|
81
|
+
// The grammar holds one of the two: a slug, or 2–6 plans.
|
|
82
|
+
const plans = block.plans ?? [block.slug!];
|
|
83
|
+
const sections = await pricingSections([boundPlans(`offer-${plans.join("-")}`, plans, block.yearly === true)], {
|
|
84
|
+
plans: undefined,
|
|
85
|
+
plan: block.recommended,
|
|
86
|
+
locale,
|
|
87
|
+
});
|
|
88
|
+
return drawn(sections.filter(carriesCards), locale);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// ── Grid ───────────────────────────────────────────────────────────
|
|
92
|
+
|
|
93
|
+
/** The grid read, or `null` for any failed read or an answer that does not parse. */
|
|
94
|
+
export function readGrid(block: GridBlock, locale: string): Promise<GridAnswer | null> {
|
|
95
|
+
const key = `grid:${locale}:${writeBlockLine({ tag: "Grid", block })}`;
|
|
96
|
+
return sharedHubRead(key, async () => {
|
|
97
|
+
try {
|
|
98
|
+
const res = await content.grid({
|
|
99
|
+
kind: block.kind,
|
|
100
|
+
slug: block.kind === "capabilities" ? block.products.join(" ") : block.category,
|
|
101
|
+
show: block.show,
|
|
102
|
+
...(block.kind === "capabilities" && block.levels !== undefined ? { levels: block.levels.join(" ") } : {}),
|
|
103
|
+
...(block.kind === "alternatives" && block.ours !== undefined ? { ours: block.ours } : {}),
|
|
104
|
+
...(block.kind === "alternatives" && block.columns !== undefined ? { columns: block.columns.join(" ") } : {}),
|
|
105
|
+
locale,
|
|
106
|
+
});
|
|
107
|
+
if (!res.ok) return null;
|
|
108
|
+
const parsed = GridAnswerSchema.safeParse(res.body);
|
|
109
|
+
return parsed.success ? parsed.data : null;
|
|
110
|
+
} catch {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** The page locale's `grids` words (D18): every fixed word a grid shows. */
|
|
117
|
+
export async function gridLabels(locale: string): Promise<GridLabels> {
|
|
118
|
+
const t = await getTranslations({ locale, namespace: "grids" });
|
|
119
|
+
const dates = new Intl.DateTimeFormat(locale, { dateStyle: "medium", timeZone: "UTC" });
|
|
120
|
+
return {
|
|
121
|
+
fromLevel: (level) => t("fromLevel", { level }),
|
|
122
|
+
addon: t("addon"),
|
|
123
|
+
ourAssessment: t("ourAssessment"),
|
|
124
|
+
checked: (date) => t("checked", { date }),
|
|
125
|
+
factsAsOf: (date) => t("factsAsOf", { date }),
|
|
126
|
+
countOf: (yes, of) => t("countOf", { yes, of }),
|
|
127
|
+
capabilities: t("capabilities"),
|
|
128
|
+
labelHeader: t("labelHeader"),
|
|
129
|
+
planPicker: t("planPicker"),
|
|
130
|
+
formatDate: (isoDate) => dates.format(new Date(`${isoDate}T00:00:00Z`)),
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export async function renderGrid(block: GridBlock, locale: string): Promise<ReactElement | null> {
|
|
135
|
+
const answer = await readGrid(block, locale);
|
|
136
|
+
if (answer === null) return null;
|
|
137
|
+
const options =
|
|
138
|
+
block.kind === "capabilities" ? { price: block.price, button: block.button } : { source: block.source };
|
|
139
|
+
const data = gridSection(answer, await gridLabels(locale), options);
|
|
140
|
+
if (data === null) return null;
|
|
141
|
+
const table = {
|
|
142
|
+
type: "comparison-table",
|
|
143
|
+
id: `grid-${block.kind}-${block.kind === "capabilities" ? block.products.join("-") : block.category}`,
|
|
144
|
+
data,
|
|
145
|
+
} as PageSection;
|
|
146
|
+
const plans = answer.columns.flatMap((column) => (column.ours && column.plan !== undefined ? [column.plan] : []));
|
|
147
|
+
if (block.kind !== "capabilities" || (block.price !== true && block.button !== true) || plans.length === 0) {
|
|
148
|
+
return drawn([table], locale);
|
|
149
|
+
}
|
|
150
|
+
// The plan bar's price and button come from the shown set: `pricingSections`
|
|
151
|
+
// resolves a table's plan columns beside a bound pricing section, which is
|
|
152
|
+
// read for that and never drawn.
|
|
153
|
+
const resolved = await pricingSections([boundPlans(`${table.id}-plans`, plans, false), table], {
|
|
154
|
+
plans: undefined,
|
|
155
|
+
plan: undefined,
|
|
156
|
+
locale,
|
|
157
|
+
});
|
|
158
|
+
return drawn(
|
|
159
|
+
resolved.filter((section) => section.type === "comparison-table"),
|
|
160
|
+
locale,
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** The renderer page-renderer asks for each block line (D13). */
|
|
165
|
+
export const renderBodyBlock: BodyBlockRenderer = async ({ block, locale }) => {
|
|
166
|
+
try {
|
|
167
|
+
return block.tag === "Offer" ? await renderOffer(block.block, locale) : await renderGrid(block.block, locale);
|
|
168
|
+
} catch (err) {
|
|
169
|
+
unstable_rethrow(err);
|
|
170
|
+
console.warn("[body-blocks] render failed; the block is left out");
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
setBodyBlockRenderer(renderBodyBlock);
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
* #12246 — `offeringsPlanColumns` resolves a comparison table's plan columns
|
|
49
49
|
* from the same shown set: each slug's name, price, checkout link and
|
|
50
50
|
* Recommended flag, from the card `planCard` / `bundleCard` builds for it.
|
|
51
|
+
* #12280 — a column's price carries the product's unit, as its card does.
|
|
51
52
|
*/
|
|
52
53
|
import {
|
|
53
54
|
PRICING_SEGMENT_LEVELS_MAX,
|
|
@@ -1187,6 +1188,11 @@ export function offeringsPricing(
|
|
|
1187
1188
|
};
|
|
1188
1189
|
}
|
|
1189
1190
|
|
|
1191
|
+
/** A side's amount and unit as the card draws them, joined by its space (#12280 D2); else `phrase`. */
|
|
1192
|
+
function joinedPrice(part: PriceParts["monthly"], phrase: string | undefined): string | undefined {
|
|
1193
|
+
return part ? `${part.amount} ${part.unit}` : phrase;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1190
1196
|
/**
|
|
1191
1197
|
* Each of `slugs` the shown set shows as a plan column (#12246 D3), by slug:
|
|
1192
1198
|
* a slug `planColumnSlugs` holds, as the card its point product would get —
|
|
@@ -1218,7 +1224,12 @@ export function offeringsPlanColumns(
|
|
|
1218
1224
|
// card's footnote link (`siteOrigin`) and display options never matter here.
|
|
1219
1225
|
const card = point && ownCard(point, shown, false, locale, labels, undefined);
|
|
1220
1226
|
if (!product || !card) continue;
|
|
1221
|
-
|
|
1227
|
+
// #12280 D2, D4 — with a unit noun, a side reads the card's amount and
|
|
1228
|
+
// unit, joined by the card's own space; else the card's phrase, unchanged.
|
|
1229
|
+
const parts = card.priceUnit ? card.priceParts : undefined;
|
|
1230
|
+
const monthly = joinedPrice(parts?.monthly, card.price.monthly);
|
|
1231
|
+
const annual = joinedPrice(parts?.annual, card.price.annual);
|
|
1232
|
+
const { custom } = card.price;
|
|
1222
1233
|
columns.set(slug, {
|
|
1223
1234
|
name: card.name,
|
|
1224
1235
|
price: {
|
|
@@ -132,11 +132,25 @@
|
|
|
132
132
|
"heading": "Pricing",
|
|
133
133
|
"emptyState": "Pricing page content coming soon."
|
|
134
134
|
},
|
|
135
|
+
"grids": {
|
|
136
|
+
"fromLevel": "From {level}",
|
|
137
|
+
"addon": "Add-on",
|
|
138
|
+
"ourAssessment": "Our assessment",
|
|
139
|
+
"checked": "Checked {date}",
|
|
140
|
+
"factsAsOf": "Facts as of {date}",
|
|
141
|
+
"countOf": "{yes} of {of}",
|
|
142
|
+
"capabilities": "Capabilities",
|
|
143
|
+
"labelHeader": "What you get",
|
|
144
|
+
"planPicker": "Plan"
|
|
145
|
+
},
|
|
135
146
|
"pricingOfferings": {
|
|
136
147
|
"cta": "Get started",
|
|
137
148
|
"recommended": "Recommended",
|
|
138
149
|
"recommendedForYou": "Recommended for you",
|
|
139
150
|
"addonsHeadline": "Add-ons",
|
|
151
|
+
"billingToggleMonthly": "Monthly",
|
|
152
|
+
"billingToggleAnnual": "Annually",
|
|
153
|
+
"billingToggleName": "Billing period",
|
|
140
154
|
"monthly": "{amount}/mo",
|
|
141
155
|
"annual": "{amount}/yr",
|
|
142
156
|
"oneTime": "{amount} one-time",
|
package/versions.json
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
{
|
|
2
|
-
"@working-theory/account": "0.
|
|
3
|
-
"@working-theory/admin-ui": "0.
|
|
4
|
-
"@working-theory/aeo": "0.
|
|
5
|
-
"@working-theory/agent-context": "0.
|
|
2
|
+
"@working-theory/account": "0.79.0",
|
|
3
|
+
"@working-theory/admin-ui": "0.79.0",
|
|
4
|
+
"@working-theory/aeo": "0.79.0",
|
|
5
|
+
"@working-theory/agent-context": "0.79.0",
|
|
6
6
|
"@working-theory/agent-contract": "0.1.0",
|
|
7
7
|
"@working-theory/agent-memory": "0.0.0",
|
|
8
8
|
"@working-theory/ai": "0.1.0",
|
|
9
|
-
"@working-theory/analytics": "0.
|
|
10
|
-
"@working-theory/api": "0.
|
|
11
|
-
"@working-theory/api-client": "0.
|
|
12
|
-
"@working-theory/auth": "0.
|
|
9
|
+
"@working-theory/analytics": "0.79.0",
|
|
10
|
+
"@working-theory/api": "0.79.0",
|
|
11
|
+
"@working-theory/api-client": "0.79.0",
|
|
12
|
+
"@working-theory/auth": "0.79.0",
|
|
13
13
|
"@working-theory/cda-filesystem": "0.0.0",
|
|
14
|
-
"@working-theory/cli": "0.
|
|
15
|
-
"@working-theory/common": "0.
|
|
14
|
+
"@working-theory/cli": "0.79.0",
|
|
15
|
+
"@working-theory/common": "0.79.0",
|
|
16
16
|
"@working-theory/consent": "0.1.0",
|
|
17
|
-
"@working-theory/content-adapters": "0.
|
|
18
|
-
"@working-theory/content-projection": "0.
|
|
19
|
-
"@working-theory/email": "0.
|
|
17
|
+
"@working-theory/content-adapters": "0.79.0",
|
|
18
|
+
"@working-theory/content-projection": "0.79.0",
|
|
19
|
+
"@working-theory/email": "0.79.0",
|
|
20
20
|
"@working-theory/env": "0.0.0",
|
|
21
|
-
"@working-theory/eslint-config": "0.
|
|
22
|
-
"@working-theory/fumadocs-schema": "0.
|
|
21
|
+
"@working-theory/eslint-config": "0.79.0",
|
|
22
|
+
"@working-theory/fumadocs-schema": "0.79.0",
|
|
23
23
|
"@working-theory/ids": "0.23.0",
|
|
24
|
-
"@working-theory/jsonld": "0.
|
|
25
|
-
"@working-theory/license": "0.
|
|
26
|
-
"@working-theory/mcp-server": "0.
|
|
27
|
-
"@working-theory/metadata": "0.
|
|
28
|
-
"@working-theory/observability": "0.
|
|
29
|
-
"@working-theory/page-renderer": "0.
|
|
24
|
+
"@working-theory/jsonld": "0.79.0",
|
|
25
|
+
"@working-theory/license": "0.79.0",
|
|
26
|
+
"@working-theory/mcp-server": "0.79.0",
|
|
27
|
+
"@working-theory/metadata": "0.79.0",
|
|
28
|
+
"@working-theory/observability": "0.79.0",
|
|
29
|
+
"@working-theory/page-renderer": "0.79.0",
|
|
30
30
|
"@working-theory/plugin-mcp": "0.1.3",
|
|
31
|
-
"@working-theory/schema": "0.
|
|
32
|
-
"@working-theory/schema-pack-registry": "0.
|
|
33
|
-
"@working-theory/schema-validator": "0.
|
|
34
|
-
"@working-theory/sections-registry": "0.
|
|
35
|
-
"@working-theory/site-config": "0.
|
|
36
|
-
"@working-theory/site-pages": "0.
|
|
37
|
-
"@working-theory/spoke-checkout": "0.7.
|
|
38
|
-
"@working-theory/stripe-client": "0.
|
|
39
|
-
"@working-theory/templates": "0.
|
|
40
|
-
"@working-theory/theme": "0.
|
|
41
|
-
"@working-theory/ui": "0.
|
|
42
|
-
"@working-theory/validation": "0.
|
|
43
|
-
"@working-theory/web-i18n": "0.
|
|
44
|
-
"@working-theory/admin": "0.
|
|
45
|
-
"@working-theory/api-commerce": "0.2.
|
|
46
|
-
"@working-theory/api-content-write": "0.18.
|
|
47
|
-
"@working-theory/api-hub": "0.9.
|
|
48
|
-
"@working-theory/api-multi-tenant": "0.5.
|
|
49
|
-
"@working-theory/api-scheduling": "0.6.
|
|
50
|
-
"@working-theory/api-signal-collectors": "0.
|
|
51
|
-
"@working-theory/api-workspace": "0.
|
|
31
|
+
"@working-theory/schema": "0.79.0",
|
|
32
|
+
"@working-theory/schema-pack-registry": "0.79.0",
|
|
33
|
+
"@working-theory/schema-validator": "0.79.0",
|
|
34
|
+
"@working-theory/sections-registry": "0.79.0",
|
|
35
|
+
"@working-theory/site-config": "0.79.0",
|
|
36
|
+
"@working-theory/site-pages": "0.79.0",
|
|
37
|
+
"@working-theory/spoke-checkout": "0.7.36",
|
|
38
|
+
"@working-theory/stripe-client": "0.79.0",
|
|
39
|
+
"@working-theory/templates": "0.79.0",
|
|
40
|
+
"@working-theory/theme": "0.79.0",
|
|
41
|
+
"@working-theory/ui": "0.79.0",
|
|
42
|
+
"@working-theory/validation": "0.79.0",
|
|
43
|
+
"@working-theory/web-i18n": "0.79.0",
|
|
44
|
+
"@working-theory/admin": "0.27.0",
|
|
45
|
+
"@working-theory/api-commerce": "0.2.14",
|
|
46
|
+
"@working-theory/api-content-write": "0.18.1",
|
|
47
|
+
"@working-theory/api-hub": "0.9.4",
|
|
48
|
+
"@working-theory/api-multi-tenant": "0.5.6",
|
|
49
|
+
"@working-theory/api-scheduling": "0.6.19",
|
|
50
|
+
"@working-theory/api-signal-collectors": "0.9.0",
|
|
51
|
+
"@working-theory/api-workspace": "0.19.0",
|
|
52
52
|
"@working-theory/billing-client": "0.0.0",
|
|
53
53
|
"@working-theory/branding": "0.0.0",
|
|
54
54
|
"@working-theory/license-client": "0.0.0",
|
|
55
55
|
"@working-theory/license-manifest": "0.0.0",
|
|
56
|
-
"@working-theory/mcp-scheduling": "0.4.
|
|
57
|
-
"@working-theory/mcp-signal-collectors": "0.2.
|
|
58
|
-
"@working-theory/mcp-workspace": "0.
|
|
56
|
+
"@working-theory/mcp-scheduling": "0.4.21",
|
|
57
|
+
"@working-theory/mcp-signal-collectors": "0.2.34",
|
|
58
|
+
"@working-theory/mcp-workspace": "0.17.0",
|
|
59
59
|
"@working-theory/partner-session": "0.0.0",
|
|
60
60
|
"@working-theory/preview-protocol": "0.0.0",
|
|
61
|
-
"@working-theory/ui-commerce": "0.
|
|
62
|
-
"@working-theory/ui-docs-blog": "0.
|
|
63
|
-
"@working-theory/ui-scheduling": "0.
|
|
64
|
-
"@working-theory/ui-signal-collectors": "0.
|
|
61
|
+
"@working-theory/ui-commerce": "0.79.0",
|
|
62
|
+
"@working-theory/ui-docs-blog": "0.79.0",
|
|
63
|
+
"@working-theory/ui-scheduling": "0.79.0",
|
|
64
|
+
"@working-theory/ui-signal-collectors": "0.79.0",
|
|
65
65
|
"@working-theory/web": "0.0.0",
|
|
66
66
|
"@working-theory/app-api": "1.0.0",
|
|
67
67
|
"@working-theory/mcp": "0.0.0",
|
|
68
|
-
"@working-theory/database": "0.
|
|
68
|
+
"@working-theory/database": "0.79.0"
|
|
69
69
|
}
|