create-ailk 0.46.0 → 0.46.1
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 +193 -3
- package/component-catalog.md +8 -6
- package/package.json +3 -3
- package/templates/apps/web/CLAUDE.md +34 -1
- package/templates/apps/web/lib/__tests__/offerings-pricing.test.ts +272 -1
- package/templates/apps/web/lib/__tests__/pricing-page.test.ts +396 -1
- package/templates/apps/web/lib/offerings-pricing.ts +143 -14
- package/templates/apps/web/lib/pricing-page.ts +252 -20
- package/templates/apps/web/messages/en.json +1 -0
- package/versions.json +50 -50
|
@@ -17,12 +17,20 @@
|
|
|
17
17
|
* section that lists its own `offeringPlans` is a plan group (#12103 D2): it
|
|
18
18
|
* shows exactly those plans' Stripe cards, and none is removed.
|
|
19
19
|
*
|
|
20
|
+
* A section's `source` (#12140, spec
|
|
21
|
+
* docs/specs/12140-pricing-sections-bind-to-offerings-spec.md D2) says where
|
|
22
|
+
* its plans come from: `offerings` binds it to the shown set in the layout its
|
|
23
|
+
* own `variant` names; `written` keeps it as authored, never linking the
|
|
24
|
+
* Offerings checkout. A page with no `source` anywhere renders as before.
|
|
25
|
+
*
|
|
20
26
|
* Stripe text reaches markup only as React text through `offeringsPricing`,
|
|
21
27
|
* and JSON-LD only through renderPage's serializer (T4).
|
|
22
28
|
*
|
|
23
29
|
* Base tree: no paid import, no `oss: false`.
|
|
24
30
|
*/
|
|
25
31
|
import { offerings } from "@working-theory/api-client";
|
|
32
|
+
import type { DetailPage } from "@working-theory/site-pages/lib/route-family";
|
|
33
|
+
import { contactFormText } from "@working-theory/site-pages/pages/contact/contact-form-text";
|
|
26
34
|
import { ContactFallback } from "@working-theory/ui";
|
|
27
35
|
import {
|
|
28
36
|
LOOKUP_KEY_PLAN_PATTERN,
|
|
@@ -31,16 +39,15 @@ import {
|
|
|
31
39
|
import { getTranslations } from "next-intl/server";
|
|
32
40
|
import { createElement, type ReactNode } from "react";
|
|
33
41
|
|
|
34
|
-
import { contactFormText } from "@working-theory/site-pages/pages/contact/contact-form-text";
|
|
35
|
-
import { readSiteContactEmail } from "./site-contact-email";
|
|
36
|
-
|
|
37
42
|
import { browserApiOrigin } from "./api-origin.generated";
|
|
38
43
|
import {
|
|
44
|
+
OFFERINGS_CHECKOUT_PATH,
|
|
39
45
|
offeringsPricing,
|
|
40
46
|
type OfferingsPricing,
|
|
41
47
|
type OfferingsPricingLabels,
|
|
42
48
|
} from "./offerings-pricing";
|
|
43
|
-
import
|
|
49
|
+
import { readSiteContactEmail } from "./site-contact-email";
|
|
50
|
+
|
|
44
51
|
|
|
45
52
|
type PricingSection = Extract<PageSection, { type: "pricing" }>;
|
|
46
53
|
type PricingData = PricingSection["data"];
|
|
@@ -163,7 +170,9 @@ export async function offeringsCopy(locale: string): Promise<{
|
|
|
163
170
|
addonsHeadline: string;
|
|
164
171
|
}> {
|
|
165
172
|
const t = await getTranslations({ locale, namespace: "pricingOfferings" });
|
|
166
|
-
const period = (
|
|
173
|
+
const period = (
|
|
174
|
+
key: "monthly" | "annual" | "oneTime" | "billedYearly",
|
|
175
|
+
) => {
|
|
167
176
|
const phrase = t(key, KEEP_AMOUNT_PLACEHOLDER);
|
|
168
177
|
return (amount: string) => phrase.replace("{amount}", () => amount);
|
|
169
178
|
};
|
|
@@ -174,6 +183,7 @@ export async function offeringsCopy(locale: string): Promise<{
|
|
|
174
183
|
monthly: period("monthly"),
|
|
175
184
|
annual: period("annual"),
|
|
176
185
|
oneTime: period("oneTime"),
|
|
186
|
+
billedYearly: period("billedYearly"),
|
|
177
187
|
withRequired: (plan, required) =>
|
|
178
188
|
t("withRequired", KEEP_BUNDLE_PLACEHOLDERS)
|
|
179
189
|
.replace("{plan}", () => plan)
|
|
@@ -209,6 +219,9 @@ const AUTHORED_COPY_FIELDS = [
|
|
|
209
219
|
"surface",
|
|
210
220
|
"note",
|
|
211
221
|
"collapseFeaturesOnMobile",
|
|
222
|
+
// #12141 D9 — the plan bar's options, so a connected section keeps them.
|
|
223
|
+
"planBar",
|
|
224
|
+
"comparisonPlanBar",
|
|
212
225
|
] as const satisfies readonly (keyof PricingData)[];
|
|
213
226
|
|
|
214
227
|
function authoredCopy(
|
|
@@ -227,6 +240,132 @@ function isPricing(section: PageSection): section is PricingSection {
|
|
|
227
240
|
return section.type === "pricing";
|
|
228
241
|
}
|
|
229
242
|
|
|
243
|
+
/** A section bound to the workspace's Offerings (#12140 D1). */
|
|
244
|
+
function isBound(section: PageSection): section is PricingSection {
|
|
245
|
+
return isPricing(section) && section.data.source === "offerings";
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/** A section whose plans stay as written on a connected page (#12140 D1). */
|
|
249
|
+
function isWritten(section: PageSection): section is PricingSection {
|
|
250
|
+
return isPricing(section) && section.data.source === "written";
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/** A section with no `source` — every pricing section before #12140. */
|
|
254
|
+
function isUnbound(section: PageSection): section is PricingSection {
|
|
255
|
+
return isPricing(section) && section.data.source === undefined;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Whether `href` reaches the Offerings checkout route, read as a browser
|
|
260
|
+
* resolves it — a relative, absolute or dot-segment form alike, on any host,
|
|
261
|
+
* whatever the case (#12140 D2 rule 7). The path is read percent-decoded too,
|
|
262
|
+
* as the router decodes it, so `/api/%6Ffferings/checkout` is caught. An href
|
|
263
|
+
* no URL parser accepts is one a browser cannot follow either.
|
|
264
|
+
*/
|
|
265
|
+
function linksOfferingsCheckout(href: string | undefined): boolean {
|
|
266
|
+
if (href === undefined) return false;
|
|
267
|
+
const base = "https://site.invalid";
|
|
268
|
+
const reaches = (path: string) =>
|
|
269
|
+
path.toLowerCase().startsWith(OFFERINGS_CHECKOUT_PATH);
|
|
270
|
+
let path: string;
|
|
271
|
+
try {
|
|
272
|
+
path = new URL(href, base).pathname;
|
|
273
|
+
} catch {
|
|
274
|
+
return false;
|
|
275
|
+
}
|
|
276
|
+
if (reaches(path)) return true;
|
|
277
|
+
try {
|
|
278
|
+
return reaches(new URL(decodeURIComponent(path), base).pathname);
|
|
279
|
+
} catch {
|
|
280
|
+
return false;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
type PricingPlan = PricingData["plans"][number];
|
|
285
|
+
|
|
286
|
+
function sellsOfferings(plan: PricingPlan): boolean {
|
|
287
|
+
return (
|
|
288
|
+
linksOfferingsCheckout(plan.cta.href) ||
|
|
289
|
+
linksOfferingsCheckout(plan.annualCtaHref)
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
type ComparisonGroups = NonNullable<PricingData["comparisonGroups"]>;
|
|
294
|
+
|
|
295
|
+
/** Whether any comparison cell's `link` reaches the Offerings checkout. */
|
|
296
|
+
function cellsSellOfferings(groups: ComparisonGroups | undefined): boolean {
|
|
297
|
+
return (groups ?? []).some((group) =>
|
|
298
|
+
group.rows.some((row) =>
|
|
299
|
+
Object.values(row.values).some(
|
|
300
|
+
(value) =>
|
|
301
|
+
typeof value === "object" && linksOfferingsCheckout(value.link?.href),
|
|
302
|
+
),
|
|
303
|
+
),
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* A written section with every card, extra tier and add-on tile that links the
|
|
309
|
+
* Offerings checkout dropped, and every comparison cell's link that does
|
|
310
|
+
* (#12140 D2 rule 7), so a written price can never sell an Offerings Price;
|
|
311
|
+
* the section itself when nothing is dropped.
|
|
312
|
+
*/
|
|
313
|
+
function withoutCheckoutLinks(section: PricingSection): PricingSection {
|
|
314
|
+
const { extraTier, ...data } = section.data;
|
|
315
|
+
const plans = data.plans.filter((plan) => !sellsOfferings(plan));
|
|
316
|
+
const addons = data.addons?.filter(
|
|
317
|
+
(addon) => !linksOfferingsCheckout(addon.cta?.href),
|
|
318
|
+
);
|
|
319
|
+
const dropTier = extraTier !== undefined && sellsOfferings(extraTier);
|
|
320
|
+
const dropCells = cellsSellOfferings(data.comparisonGroups);
|
|
321
|
+
if (
|
|
322
|
+
plans.length === data.plans.length &&
|
|
323
|
+
addons?.length === data.addons?.length &&
|
|
324
|
+
!dropTier &&
|
|
325
|
+
!dropCells
|
|
326
|
+
)
|
|
327
|
+
return section;
|
|
328
|
+
return {
|
|
329
|
+
...section,
|
|
330
|
+
data: {
|
|
331
|
+
...data,
|
|
332
|
+
plans,
|
|
333
|
+
...(addons !== undefined ? { addons } : {}),
|
|
334
|
+
...(dropCells && data.comparisonGroups
|
|
335
|
+
? { comparisonGroups: withoutCellLinks(data.comparisonGroups, true) }
|
|
336
|
+
: {}),
|
|
337
|
+
...(extraTier !== undefined && !dropTier ? { extraTier } : {}),
|
|
338
|
+
},
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* The page's comparison grid with each object cell's `link` dropped (#12140
|
|
344
|
+
* D6): its cells are hand-written, so a bound section carries no authored href.
|
|
345
|
+
* With `checkoutOnly` (a written section, D2 rule 7), only a link that reaches
|
|
346
|
+
* the Offerings checkout is dropped.
|
|
347
|
+
*/
|
|
348
|
+
function withoutCellLinks(
|
|
349
|
+
groups: ComparisonGroups,
|
|
350
|
+
checkoutOnly = false,
|
|
351
|
+
): ComparisonGroups {
|
|
352
|
+
return groups.map((group) => ({
|
|
353
|
+
...group,
|
|
354
|
+
rows: group.rows.map((row) => ({
|
|
355
|
+
...row,
|
|
356
|
+
values: Object.fromEntries(
|
|
357
|
+
Object.entries(row.values).map(([key, value]) => {
|
|
358
|
+
if (typeof value !== "object") return [key, value];
|
|
359
|
+
if (checkoutOnly && !linksOfferingsCheckout(value.link?.href))
|
|
360
|
+
return [key, value];
|
|
361
|
+
const { link: _, ...cell } = value;
|
|
362
|
+
return [key, cell];
|
|
363
|
+
}),
|
|
364
|
+
),
|
|
365
|
+
})),
|
|
366
|
+
}));
|
|
367
|
+
}
|
|
368
|
+
|
|
230
369
|
/** Where a section with no slot goes: after a leading hero, else first. */
|
|
231
370
|
function insertionIndex(sections: PageSection[]): number {
|
|
232
371
|
return sections[0]?.type === "hero" ? 1 : 0;
|
|
@@ -250,6 +389,11 @@ export type OfferingsGroups = ReadonlyMap<PricingSection, PricingData | null>;
|
|
|
250
389
|
* — the page's `plans`, less every plan a group lists — for the unlisted plans
|
|
251
390
|
* slot and the add-ons slot. A page with no group maps exactly as before, with
|
|
252
391
|
* `groups` empty.
|
|
392
|
+
*
|
|
393
|
+
* Each bound section (#12140 D3, D7) is mapped alone into `groups` too, for
|
|
394
|
+
* its own `offeringPlans` else the page's `plans`: a plans section in the
|
|
395
|
+
* layout its `variant` names, an `addons` section to its add-on tiles. The
|
|
396
|
+
* plans a bound section lists are excluded from the page-level mapping.
|
|
253
397
|
*/
|
|
254
398
|
export function offeringsFragments(
|
|
255
399
|
declared: PageSection[],
|
|
@@ -263,10 +407,13 @@ export function offeringsFragments(
|
|
|
263
407
|
const { locale, labels, plans } = options;
|
|
264
408
|
const listed = declared.filter(
|
|
265
409
|
(s): s is PricingSection =>
|
|
266
|
-
isPlansSection(s) && s.data.offeringPlans !== undefined,
|
|
410
|
+
isUnbound(s) && isPlansSection(s) && s.data.offeringPlans !== undefined,
|
|
411
|
+
);
|
|
412
|
+
const bound = declared.filter(isBound);
|
|
413
|
+
const exclude = [...listed, ...bound].flatMap(
|
|
414
|
+
(s) => s.data.offeringPlans ?? [],
|
|
267
415
|
);
|
|
268
|
-
const
|
|
269
|
-
const groups = new Map(
|
|
416
|
+
const groups = new Map<PricingSection, PricingData | null>(
|
|
270
417
|
listed.map((section) => [
|
|
271
418
|
section,
|
|
272
419
|
offeringsPricing(shownSet, {
|
|
@@ -276,6 +423,19 @@ export function offeringsFragments(
|
|
|
276
423
|
})?.plans ?? null,
|
|
277
424
|
]),
|
|
278
425
|
);
|
|
426
|
+
for (const section of bound) {
|
|
427
|
+
const { variant, offeringPlans } = section.data;
|
|
428
|
+
const addons = variant === "addons";
|
|
429
|
+
const mapped = offeringsPricing(shownSet, {
|
|
430
|
+
locale,
|
|
431
|
+
labels,
|
|
432
|
+
plans: offeringPlans ?? plans,
|
|
433
|
+
...(variant === "addons"
|
|
434
|
+
? {}
|
|
435
|
+
: { layout: variant ?? "three-tiers-with-toggle" }),
|
|
436
|
+
});
|
|
437
|
+
groups.set(section, (addons ? mapped?.addons : mapped?.plans) ?? null);
|
|
438
|
+
}
|
|
279
439
|
const pricing = offeringsPricing(shownSet, {
|
|
280
440
|
locale,
|
|
281
441
|
labels,
|
|
@@ -285,11 +445,23 @@ export function offeringsFragments(
|
|
|
285
445
|
return { pricing, groups };
|
|
286
446
|
}
|
|
287
447
|
|
|
448
|
+
/** What a bound section keeps from the page beside its copy (#12140 D6). */
|
|
449
|
+
const BOUND_KEPT_FIELDS = [
|
|
450
|
+
"source",
|
|
451
|
+
"keyPointsPanel",
|
|
452
|
+
"narrative",
|
|
453
|
+
"bandSurface",
|
|
454
|
+
] as const satisfies readonly (keyof PricingData)[];
|
|
455
|
+
|
|
288
456
|
/**
|
|
289
457
|
* One Stripe plans section in `slot`'s place: the slot's authored copy, the
|
|
290
458
|
* mapper's fragment, the slot's own `cardLayout` over the mapper's (#12103
|
|
291
459
|
* D6; `billingToggle` stays the mapper's computed one), and a `?plan=`
|
|
292
460
|
* recommendation (#8842) — applied by each section to its own cards.
|
|
461
|
+
*
|
|
462
|
+
* A bound slot (#12140 D6) also keeps its `source`, its band parts, its
|
|
463
|
+
* comparison grid (cell links dropped) and its own `features` over the
|
|
464
|
+
* mapper's; never an authored plan, extra tier or comparison-cell link.
|
|
293
465
|
*/
|
|
294
466
|
function stripePlansSection(
|
|
295
467
|
slot: PricingSection | undefined,
|
|
@@ -297,13 +469,23 @@ function stripePlansSection(
|
|
|
297
469
|
recommend: string | undefined,
|
|
298
470
|
recommendedLabel: string,
|
|
299
471
|
): PricingSection {
|
|
472
|
+
const bound = slot !== undefined && isBound(slot);
|
|
473
|
+
const cardLayout = slot?.data.cardLayout ?? fragment.cardLayout;
|
|
474
|
+
const features = bound
|
|
475
|
+
? (slot.data.features ?? fragment.features)
|
|
476
|
+
: undefined;
|
|
477
|
+
const comparisonGroups = bound ? slot.data.comparisonGroups : undefined;
|
|
300
478
|
return {
|
|
301
479
|
id: slot?.id ?? "offerings-plans",
|
|
302
480
|
type: "pricing",
|
|
303
481
|
data: {
|
|
304
|
-
...authoredCopy(slot),
|
|
482
|
+
...authoredCopy(slot, bound ? BOUND_KEPT_FIELDS : []),
|
|
483
|
+
...(comparisonGroups
|
|
484
|
+
? { comparisonGroups: withoutCellLinks(comparisonGroups) }
|
|
485
|
+
: {}),
|
|
305
486
|
...fragment,
|
|
306
|
-
cardLayout
|
|
487
|
+
...(cardLayout !== undefined ? { cardLayout } : {}),
|
|
488
|
+
...(features !== undefined ? { features } : {}),
|
|
307
489
|
// A `?plan=` recommendation moves the mapper's highlight onto the named
|
|
308
490
|
// plan and wears `recommendedLabel` (#8842); the mapper's own
|
|
309
491
|
// "Recommended" pill label would ride along as a second label, so it is
|
|
@@ -335,6 +517,12 @@ function stripePlansSection(
|
|
|
335
517
|
* slot is inserted after a leading hero (the add-ons directly after the last
|
|
336
518
|
* plans section) — except the plans fragment on a page with plan groups, which
|
|
337
519
|
* has said what it shows and gets no inserted section. No other section moves.
|
|
520
|
+
*
|
|
521
|
+
* With `source` (#12140 D2): each bound section in `groups` is placed the same
|
|
522
|
+
* way, an `addons` one as add-on tiles; each written section stays where it
|
|
523
|
+
* is, without Offerings checkout links, taking a `{plan}`-grammar `?plan=`;
|
|
524
|
+
* the two slots are chosen among unbound sections only; and a page that
|
|
525
|
+
* declares a `source` gets no inserted section.
|
|
338
526
|
*/
|
|
339
527
|
export function withOfferings(
|
|
340
528
|
sections: PageSection[],
|
|
@@ -345,11 +533,15 @@ export function withOfferings(
|
|
|
345
533
|
groups?: OfferingsGroups,
|
|
346
534
|
): PageSection[] {
|
|
347
535
|
const grouped = groups !== undefined && groups.size > 0;
|
|
536
|
+
const declaresSource = sections.some(
|
|
537
|
+
(s) => isPricing(s) && s.data.source !== undefined,
|
|
538
|
+
);
|
|
348
539
|
const plansSlot = sections.find(
|
|
349
|
-
(s): s is PricingSection =>
|
|
540
|
+
(s): s is PricingSection =>
|
|
541
|
+
isUnbound(s) && isPlansSection(s) && !groups?.has(s),
|
|
350
542
|
);
|
|
351
543
|
const addonsSlot = sections.find(
|
|
352
|
-
(s): s is PricingSection =>
|
|
544
|
+
(s): s is PricingSection => isUnbound(s) && s.data.variant === "addons",
|
|
353
545
|
);
|
|
354
546
|
const recommend =
|
|
355
547
|
plan !== undefined && LOOKUP_KEY_PLAN_PATTERN.test(plan) ? plan : undefined;
|
|
@@ -373,7 +565,36 @@ export function withOfferings(
|
|
|
373
565
|
const stripePlans: PageSection[] = [];
|
|
374
566
|
for (const section of sections) {
|
|
375
567
|
if (!isPricing(section)) placed.push(section);
|
|
376
|
-
else if (
|
|
568
|
+
else if (section.data.source === "written") {
|
|
569
|
+
const written = withoutCheckoutLinks(section);
|
|
570
|
+
placed.push(
|
|
571
|
+
recommend === undefined
|
|
572
|
+
? written
|
|
573
|
+
: {
|
|
574
|
+
...written,
|
|
575
|
+
// Render-time fields the section reads (#8842), not authored ones.
|
|
576
|
+
data: {
|
|
577
|
+
...written.data,
|
|
578
|
+
recommended: recommend,
|
|
579
|
+
recommendedLabel,
|
|
580
|
+
} as PricingData,
|
|
581
|
+
},
|
|
582
|
+
);
|
|
583
|
+
} else if (
|
|
584
|
+
section.data.source === "offerings" &&
|
|
585
|
+
section.data.variant === "addons"
|
|
586
|
+
) {
|
|
587
|
+
const fragment = groups?.get(section);
|
|
588
|
+
if (fragment)
|
|
589
|
+
placed.push({
|
|
590
|
+
id: section.id,
|
|
591
|
+
type: "pricing",
|
|
592
|
+
data: {
|
|
593
|
+
...authoredCopy(section, ["addonLayout", "source"]),
|
|
594
|
+
...fragment,
|
|
595
|
+
} as PricingData,
|
|
596
|
+
});
|
|
597
|
+
} else if (groups?.has(section)) {
|
|
377
598
|
const fragment = groups.get(section);
|
|
378
599
|
if (fragment) {
|
|
379
600
|
const group = stripePlansSection(
|
|
@@ -391,11 +612,11 @@ export function withOfferings(
|
|
|
391
612
|
} else if (section === addonsSlot && addonsSection)
|
|
392
613
|
placed.push(addonsSection);
|
|
393
614
|
}
|
|
394
|
-
if (plansSection && !plansSlot && !grouped) {
|
|
615
|
+
if (plansSection && !plansSlot && !grouped && !declaresSource) {
|
|
395
616
|
placed.splice(insertionIndex(placed), 0, plansSection);
|
|
396
617
|
stripePlans.push(plansSection);
|
|
397
618
|
}
|
|
398
|
-
if (addonsSection && !addonsSlot) {
|
|
619
|
+
if (addonsSection && !addonsSlot && !declaresSource) {
|
|
399
620
|
const plansAt = Math.max(-1, ...stripePlans.map((s) => placed.indexOf(s)));
|
|
400
621
|
placed.splice(
|
|
401
622
|
plansAt >= 0 ? plansAt + 1 : insertionIndex(placed),
|
|
@@ -464,11 +685,16 @@ export function pagePlans(frontmatter: unknown): string[] | undefined {
|
|
|
464
685
|
* One Pricing page's sections in its Offerings state (#10044 D5): `/pricing`'s
|
|
465
686
|
* three-state choice with the page's own `plans` passed through.
|
|
466
687
|
* - `plans: []` → the written sections, no Stripe read;
|
|
688
|
+
* - every pricing section `source: written` (#12140 D2 rule 1) → the same,
|
|
689
|
+
* no read;
|
|
467
690
|
* - unconnected → the written sections (`?plan=` moving the recommendation);
|
|
468
691
|
* - shown → the page's Stripe cards in place of its `pricing` sections,
|
|
469
692
|
* when any of its plans is shown — each plan group's own plans in its
|
|
470
|
-
* place (#12103 D2);
|
|
693
|
+
* place (#12103 D2), each bound and written section in its place (#12140);
|
|
694
|
+
* a page whose only pricing left is written takes the contact email;
|
|
471
695
|
* - anything else → the contact email in their place.
|
|
696
|
+
* On the written states a `source: written` section never links the
|
|
697
|
+
* Offerings checkout (#12140 D2 rule 7).
|
|
472
698
|
*/
|
|
473
699
|
export async function pricingSections(
|
|
474
700
|
declared: PageSection[],
|
|
@@ -479,9 +705,13 @@ export async function pricingSections(
|
|
|
479
705
|
},
|
|
480
706
|
): Promise<PageSection[]> {
|
|
481
707
|
const { plans, plan, locale } = options;
|
|
482
|
-
const
|
|
483
|
-
|
|
708
|
+
const written = declared.some(isWritten)
|
|
709
|
+
? declared.map((s) => (isWritten(s) ? withoutCheckoutLinks(s) : s))
|
|
710
|
+
: declared;
|
|
711
|
+
const asWritten = () => (plan ? withRecommendedPlan(written, plan) : written);
|
|
484
712
|
if (plans !== undefined && plans.length === 0) return asWritten();
|
|
713
|
+
const priced = declared.filter(isPricing);
|
|
714
|
+
if (priced.length > 0 && priced.every(isWritten)) return asWritten();
|
|
485
715
|
|
|
486
716
|
const read = await readShownOfferings();
|
|
487
717
|
if (read.kind === "unconnected") return asWritten();
|
|
@@ -502,8 +732,10 @@ export async function pricingSections(
|
|
|
502
732
|
addonsHeadline,
|
|
503
733
|
groups,
|
|
504
734
|
);
|
|
505
|
-
// Every pricing section left is a Stripe one; none
|
|
506
|
-
|
|
735
|
+
// Every pricing section left but a written one is a Stripe one; none
|
|
736
|
+
// means nothing shown, and written prices never stand in for the
|
|
737
|
+
// catalogue (#12140 D2 rule 5).
|
|
738
|
+
if (placed.some((s) => isPricing(s) && !isWritten(s))) return placed;
|
|
507
739
|
}
|
|
508
740
|
}
|
|
509
741
|
return withContactFallback(declared);
|
|
@@ -140,6 +140,7 @@
|
|
|
140
140
|
"monthly": "{amount}/mo",
|
|
141
141
|
"annual": "{amount}/yr",
|
|
142
142
|
"oneTime": "{amount} one-time",
|
|
143
|
+
"billedYearly": "billed {amount} yearly",
|
|
143
144
|
"withRequired": "{plan} + {required}",
|
|
144
145
|
"depositNote": "{deposit} deposit due today; the balance is invoiced."
|
|
145
146
|
},
|
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.75.0",
|
|
3
|
+
"@working-theory/admin-ui": "0.75.0",
|
|
4
|
+
"@working-theory/aeo": "0.75.0",
|
|
5
|
+
"@working-theory/agent-context": "0.75.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.75.0",
|
|
10
|
+
"@working-theory/api": "0.75.0",
|
|
11
|
+
"@working-theory/api-client": "0.75.0",
|
|
12
|
+
"@working-theory/auth": "0.75.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.75.0",
|
|
15
|
+
"@working-theory/common": "0.75.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.75.0",
|
|
18
|
+
"@working-theory/content-projection": "0.75.0",
|
|
19
|
+
"@working-theory/email": "0.75.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.75.0",
|
|
22
|
+
"@working-theory/fumadocs-schema": "0.75.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.75.0",
|
|
25
|
+
"@working-theory/license": "0.75.0",
|
|
26
|
+
"@working-theory/mcp-server": "0.75.0",
|
|
27
|
+
"@working-theory/metadata": "0.75.0",
|
|
28
|
+
"@working-theory/observability": "0.75.0",
|
|
29
|
+
"@working-theory/page-renderer": "0.75.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.25.
|
|
45
|
-
"@working-theory/api-commerce": "0.2.
|
|
46
|
-
"@working-theory/api-content-write": "0.16.
|
|
47
|
-
"@working-theory/api-hub": "0.8.
|
|
48
|
-
"@working-theory/api-multi-tenant": "0.5.
|
|
49
|
-
"@working-theory/api-scheduling": "0.6.
|
|
50
|
-
"@working-theory/api-signal-collectors": "0.7.
|
|
51
|
-
"@working-theory/api-workspace": "0.18.
|
|
31
|
+
"@working-theory/schema": "0.75.0",
|
|
32
|
+
"@working-theory/schema-pack-registry": "0.75.0",
|
|
33
|
+
"@working-theory/schema-validator": "0.75.0",
|
|
34
|
+
"@working-theory/sections-registry": "0.75.0",
|
|
35
|
+
"@working-theory/site-config": "0.75.0",
|
|
36
|
+
"@working-theory/site-pages": "0.75.0",
|
|
37
|
+
"@working-theory/spoke-checkout": "0.7.31",
|
|
38
|
+
"@working-theory/stripe-client": "0.75.0",
|
|
39
|
+
"@working-theory/templates": "0.75.0",
|
|
40
|
+
"@working-theory/theme": "0.75.0",
|
|
41
|
+
"@working-theory/ui": "0.75.0",
|
|
42
|
+
"@working-theory/validation": "0.75.0",
|
|
43
|
+
"@working-theory/web-i18n": "0.75.0",
|
|
44
|
+
"@working-theory/admin": "0.25.1",
|
|
45
|
+
"@working-theory/api-commerce": "0.2.9",
|
|
46
|
+
"@working-theory/api-content-write": "0.16.1",
|
|
47
|
+
"@working-theory/api-hub": "0.8.1",
|
|
48
|
+
"@working-theory/api-multi-tenant": "0.5.1",
|
|
49
|
+
"@working-theory/api-scheduling": "0.6.14",
|
|
50
|
+
"@working-theory/api-signal-collectors": "0.7.4",
|
|
51
|
+
"@working-theory/api-workspace": "0.18.1",
|
|
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.16.
|
|
56
|
+
"@working-theory/mcp-scheduling": "0.4.16",
|
|
57
|
+
"@working-theory/mcp-signal-collectors": "0.2.29",
|
|
58
|
+
"@working-theory/mcp-workspace": "0.16.1",
|
|
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.75.0",
|
|
62
|
+
"@working-theory/ui-docs-blog": "0.75.0",
|
|
63
|
+
"@working-theory/ui-scheduling": "0.75.0",
|
|
64
|
+
"@working-theory/ui-signal-collectors": "0.75.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.75.0"
|
|
69
69
|
}
|