@gradial/aci 0.1.52-rc.8 → 0.1.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/README.md +86 -5
  3. package/dist/astro/error-page.js +1 -0
  4. package/dist/astro/index.js +4 -0
  5. package/dist/astro/page.d.ts +5 -2
  6. package/dist/astro/page.js +35 -23
  7. package/dist/astro/preview.js +2 -17
  8. package/dist/audience-data-models.d.ts +308 -197
  9. package/dist/audience-data-models.js +313 -51
  10. package/dist/cli/compile-registry.mjs +6 -34
  11. package/dist/cli/mintlify-render.mjs +8 -0
  12. package/dist/collect/aci.js +1 -1
  13. package/dist/collect/aci.js.sha256 +1 -1
  14. package/dist/collect/api.d.ts +6 -7
  15. package/dist/collect/api.js +21 -8
  16. package/dist/collect/assignments.d.ts +7 -9
  17. package/dist/collect/assignments.js +23 -32
  18. package/dist/collect/batcher.d.ts +9 -7
  19. package/dist/collect/batcher.js +6 -5
  20. package/dist/collect/consent/envelope.d.ts +7 -1
  21. package/dist/collect/consent/envelope.js +3 -1
  22. package/dist/collect/consent/mapping.d.ts +2 -0
  23. package/dist/collect/consent/mapping.js +1 -0
  24. package/dist/collect/consenthold.d.ts +38 -0
  25. package/dist/collect/consenthold.js +82 -0
  26. package/dist/collect/declarative.js +7 -5
  27. package/dist/collect/gapbuffer.d.ts +13 -4
  28. package/dist/collect/gapbuffer.js +21 -10
  29. package/dist/collect/index.js +78 -21
  30. package/dist/collect/pageviews.d.ts +11 -11
  31. package/dist/collect/pageviews.js +27 -22
  32. package/dist/consent-banner/index.d.ts +17 -0
  33. package/dist/consent-banner/index.js +23 -0
  34. package/dist/content/index.d.ts +2 -1
  35. package/dist/content/index.js +4 -1
  36. package/dist/content/provider.d.ts +16 -2
  37. package/dist/content/provider.js +5 -1
  38. package/dist/content/resolve-slots.d.ts +24 -2
  39. package/dist/content/resolve-slots.js +127 -21
  40. package/dist/content/types.d.ts +5 -1
  41. package/dist/edge/expression-capabilities.v1.d.ts +106 -0
  42. package/dist/edge/expression-capabilities.v1.js +165 -0
  43. package/dist/index.d.ts +1 -2
  44. package/dist/index.js +0 -1
  45. package/dist/internal/domain/edge/identity.d.ts +47 -4
  46. package/dist/internal/domain/edge/identity.js +130 -26
  47. package/dist/internal/domain/edge/index.d.ts +1 -1
  48. package/dist/internal/domain/edge/index.js +1 -1
  49. package/dist/internal/domain/edge/mimic_token.d.ts +14 -0
  50. package/dist/internal/domain/edge/mimic_token.js +125 -0
  51. package/dist/internal/domain/edge/personalization-core.d.ts +61 -22
  52. package/dist/internal/domain/edge/personalization-core.js +790 -200
  53. package/dist/internal/domain/edge/personalization_index.d.ts +17 -0
  54. package/dist/internal/domain/edge/personalization_index.js +55 -0
  55. package/dist/internal/domain/edge/resolve.js +76 -39
  56. package/dist/internal/domain/edge/testdata/flat_only_validator_v1.d.ts +10 -0
  57. package/dist/internal/domain/edge/testdata/flat_only_validator_v1.js +253 -0
  58. package/dist/internal/domain/edge/types.d.ts +82 -78
  59. package/dist/internal/domain/edge/types.js +3 -3
  60. package/dist/internal/domain/edge/variant_key.d.ts +4 -0
  61. package/dist/internal/domain/edge/variant_key.js +56 -0
  62. package/dist/internal/platform/collectionstore/errors.d.ts +24 -0
  63. package/dist/internal/platform/collectionstore/errors.js +48 -0
  64. package/dist/mintlify/blocks.d.ts +6 -0
  65. package/dist/mintlify/blocks.js +201 -0
  66. package/dist/mintlify/config.d.ts +3 -0
  67. package/dist/mintlify/config.js +77 -0
  68. package/dist/mintlify/index.d.ts +3 -0
  69. package/dist/mintlify/index.js +2 -0
  70. package/dist/mintlify/json.d.ts +8 -0
  71. package/dist/mintlify/json.js +37 -0
  72. package/dist/mintlify/materialize.d.ts +14 -0
  73. package/dist/mintlify/materialize.js +254 -0
  74. package/dist/mintlify/types.d.ts +74 -0
  75. package/dist/mintlify/types.js +1 -0
  76. package/dist/mintlify/validate.d.ts +7 -0
  77. package/dist/mintlify/validate.js +256 -0
  78. package/dist/next/assignments-navigation.d.ts +4 -0
  79. package/dist/next/assignments-navigation.js +18 -0
  80. package/dist/next/assignments-script.d.ts +3 -2
  81. package/dist/next/assignments-script.js +5 -5
  82. package/dist/next/error-pages.d.ts +4 -0
  83. package/dist/next/error-pages.js +4 -0
  84. package/dist/next/error-seat-payload.d.ts +2 -1
  85. package/dist/next/error-seat-payload.js +14 -24
  86. package/dist/next/error-seat.js +7 -2
  87. package/dist/next/index.d.ts +1 -1
  88. package/dist/next/index.js +3 -1
  89. package/dist/next/page.d.ts +2 -1
  90. package/dist/next/page.js +15 -4
  91. package/dist/next/release-context.d.ts +30 -0
  92. package/dist/next/release-context.js +56 -0
  93. package/dist/next/render.d.ts +1 -1
  94. package/dist/next/render.js +15 -5
  95. package/dist/next/server.d.ts +9 -3
  96. package/dist/next/server.js +17 -32
  97. package/dist/preview/core.d.ts +1 -0
  98. package/dist/preview/core.js +27 -0
  99. package/dist/react/VideoPlayer.d.ts +3 -3
  100. package/dist/react/index.d.ts +3 -3
  101. package/dist/registry.d.ts +4 -2
  102. package/dist/testing/conformance/checks.d.ts +2 -2
  103. package/dist/testing/conformance/checks.js +2 -0
  104. package/dist/testing/conformance/index.d.ts +1 -0
  105. package/dist/testing/conformance/index.js +1 -0
  106. package/dist/testing/conformance/next-stubs.d.ts +6 -0
  107. package/dist/testing/conformance/next-stubs.js +9 -0
  108. package/dist/testing/conformance/preset.d.ts +3 -2
  109. package/dist/testing/conformance/preset.js +15 -8
  110. package/dist/testing/conformance/root-identity.d.ts +31 -0
  111. package/dist/testing/conformance/root-identity.js +361 -0
  112. package/dist/testing/conformance/stubs/next-image.d.ts +7 -0
  113. package/dist/testing/conformance/stubs/next-image.js +5 -0
  114. package/dist/testing/conformance/stubs/next-link.d.ts +7 -0
  115. package/dist/testing/conformance/stubs/next-link.js +4 -0
  116. package/dist/testing/conformance/types.d.ts +5 -2
  117. package/dist/testing/index.d.ts +1 -1
  118. package/dist/testing/index.js +4 -3
  119. package/dist/types/block-ref.js +2 -2
  120. package/dist/types/component.d.ts +9 -0
  121. package/dist/types/config.d.ts +0 -1
  122. package/dist/types/index.d.ts +0 -1
  123. package/dist/types/index.js +0 -1
  124. package/dist/types/page.d.ts +0 -1
  125. package/migrations/conformance-registry.md +22 -0
  126. package/migrations/experiment-goal-ids.md +43 -0
  127. package/package.json +21 -7
  128. package/src/cli/compile-registry.mjs +6 -30
  129. package/src/cli/mintlify-render.mjs +9 -0
  130. package/src/types/block-ref.test.ts +16 -1
  131. package/src/types/block-ref.ts +2 -2
  132. package/src/types/component.ts +10 -0
  133. package/src/types/config.ts +0 -1
  134. package/src/types/index.ts +0 -1
  135. package/src/types/page.ts +0 -1
  136. package/templates/astro/starter-content/src/components/chrome/Footer.astro +5 -3
  137. package/templates/astro/starter-content/src/components/chrome/Header.astro +5 -3
  138. package/templates/astro/starter-content/src/components/elements/Button.astro +5 -2
  139. package/templates/astro/starter-content/src/components/elements/ButtonBlock.astro +5 -3
  140. package/templates/astro/starter-content/src/components/sections/ContainerSection.astro +4 -3
  141. package/templates/astro/starter-content/src/components/sections/FeatureCard.astro +4 -3
  142. package/templates/astro/starter-content/src/components/sections/FeatureGrid.astro +4 -3
  143. package/templates/astro/starter-content/src/components/sections/HomeHero.astro +5 -3
  144. package/templates/astro/starter-content/src/components/sections/PersonalizationChoice.astro +4 -3
  145. package/templates/astro/starter-content/src/components/sections/StatsBar.astro +4 -3
  146. package/templates/astro/starter-content/src/fixtures/sections.ts +1 -1
  147. package/templates/astro/starter-content/src/stories/CompositionStoryFrame.astro +7 -2
  148. package/templates/astro/template/.aci.yaml.tmpl +0 -1
  149. package/templates/astro/template/package.json.tmpl +5 -5
  150. package/templates/astro/template/src/layouts/SiteLayout.astro +2 -2
  151. package/templates/common/.agents/skills/aci/SKILL.md +58 -1
  152. package/templates/common/.agents/skills/authoring/SKILL.md +194 -42
  153. package/templates/common/.agents/skills/authoring/references/block-registry.md +19 -3
  154. package/templates/common/.agents/skills/authoring/references/contracts.md +9 -30
  155. package/templates/common/.agents/skills/authoring/references/repo-structure.md +5 -4
  156. package/templates/common/.agents/skills/authoring/references/sdk-server-functions.md +3 -3
  157. package/templates/common/.agents/skills/dam-delivery/SKILL.md +216 -0
  158. package/templates/common/.agents/skills/dam-delivery/references/permalink-grammar.md +167 -0
  159. package/templates/common/.agents/skills/migration/references/canon-migration.md +18 -67
  160. package/templates/common/.agents/skills/migration/references/selector-map.md +1 -1
  161. package/templates/common/.content/fragments/navbar/_index.json +24 -0
  162. package/templates/common/.content/fragments/site-footer/_index.json +61 -0
  163. package/templates/common/.content/pages/404/_index.json +4 -2
  164. package/templates/common/.content/pages/_index.json +0 -1
  165. package/templates/common/.content/pages/error/_index.json +4 -2
  166. package/templates/common/.content/schemas/site.schema.json +11 -1
  167. package/templates/common/.content/templates/error.json +24 -0
  168. package/templates/common/.content/templates/home.json +28 -0
  169. package/templates/common/.content/templates/site.json +8 -0
  170. package/templates/common/.content/templates/standard.json +24 -0
  171. package/templates/common/.nvmrc +1 -1
  172. package/templates/common/starter-content/.content/config/site.json +1 -1
  173. package/templates/common/starter-content/.content/dam/README.md +74 -0
  174. package/templates/common/starter-content/.content/dam/folders/seed/{ast_site_about_hero → 000000000000000000000000101}/asset.json +1 -1
  175. package/templates/common/starter-content/.content/dam/folders/seed/{ast_site_home_hero → 000000000000000000000000102}/asset.json +1 -1
  176. package/templates/common/starter-content/.content/pages/404/_index.json +1 -2
  177. package/templates/common/starter-content/.content/pages/{home/_index.json → _index.json} +14 -3
  178. package/templates/common/starter-content/.content/pages/about/_index.json +2 -2
  179. package/templates/common/starter-content/.content/pages/error/_index.json +1 -2
  180. package/templates/common/starter-content/.content/patterns/components/button.json +2 -2
  181. package/templates/common/starter-content/.content/patterns/components/container.json +8 -3
  182. package/templates/common/starter-content/.content/patterns/components/feature_card.json +2 -2
  183. package/templates/common/starter-content/.content/patterns/components/feature_grid.json +5 -3
  184. package/templates/common/starter-content/.content/patterns/components/home_hero.json +2 -2
  185. package/templates/common/starter-content/.content/patterns/components/personalization_choice.json +2 -2
  186. package/templates/common/starter-content/.content/patterns/components/site-footer.json +2 -2
  187. package/templates/common/starter-content/.content/patterns/components/site-navigation.json +2 -2
  188. package/templates/common/starter-content/.content/patterns/components/stats_bar.json +2 -2
  189. package/templates/common/starter-content/.content/schemas/site.schema.json +11 -1
  190. package/templates/nextjs/starter-content/src/components/chrome/Footer.tsx +4 -3
  191. package/templates/nextjs/starter-content/src/components/chrome/Header.tsx +4 -3
  192. package/templates/nextjs/starter-content/src/components/elements/Button.tsx +4 -3
  193. package/templates/nextjs/starter-content/src/components/elements/ButtonBlock.tsx +4 -3
  194. package/templates/nextjs/starter-content/src/components/sections/ContainerSection.tsx +4 -2
  195. package/templates/nextjs/starter-content/src/components/sections/FeatureCard.tsx +4 -3
  196. package/templates/nextjs/starter-content/src/components/sections/FeatureGrid.tsx +4 -2
  197. package/templates/nextjs/starter-content/src/components/sections/HomeHero.tsx +4 -3
  198. package/templates/nextjs/starter-content/src/components/sections/PersonalizationChoice.tsx +4 -2
  199. package/templates/nextjs/starter-content/src/components/sections/StatsBar.tsx +4 -3
  200. package/templates/nextjs/template/.aci.yaml +0 -1
  201. package/templates/nextjs/template/.aci.yaml.tmpl +0 -1
  202. package/templates/nextjs/template/package.json.tmpl +4 -3
  203. package/templates/nextjs/template/src/app/_components/c15t-bridge.ts +30 -0
  204. package/templates/nextjs/template/src/app/_components/c15t-consent-ui.tsx +37 -0
  205. package/templates/nextjs/template/src/app/_components/consent-manager.css +63 -0
  206. package/templates/nextjs/template/src/app/_components/consent-manager.tsx +76 -0
  207. package/templates/nextjs/template/src/app/fonts/inter/OFL.txt +93 -0
  208. package/templates/nextjs/template/src/app/fonts/inter/inter-latin.woff2 +0 -0
  209. package/templates/nextjs/template/src/app/fonts/space-grotesk/OFL.txt +93 -0
  210. package/templates/nextjs/template/src/app/fonts/space-grotesk/space-grotesk-latin.woff2 +0 -0
  211. package/templates/nextjs/template/src/app/layout.tsx +12 -7
  212. package/templates/nextjs/template/tests/conformance.test.ts.tmpl +1 -0
  213. package/dist/define-layout.d.ts +0 -6
  214. package/dist/define-layout.js +0 -14
  215. package/dist/edge/personalization-core.d.ts +0 -11
  216. package/dist/edge/personalization-core.js +0 -269
  217. package/dist/internal/domain/edge/compose.d.ts +0 -24
  218. package/dist/internal/domain/edge/compose.js +0 -89
  219. package/dist/internal/domain/edge/record/codec.d.ts +0 -71
  220. package/dist/internal/domain/edge/record/codec.js +0 -401
  221. package/dist/next/collect-route.d.ts +0 -19
  222. package/dist/next/collect-route.js +0 -459
  223. package/dist/next/edge-config.d.ts +0 -1
  224. package/dist/next/edge-config.js +0 -92
  225. package/dist/next/envelope-digest.d.ts +0 -21
  226. package/dist/next/envelope-digest.js +0 -58
  227. package/dist/next/middleware.d.ts +0 -40
  228. package/dist/next/middleware.js +0 -475
  229. package/dist/next/personalization-host.d.ts +0 -134
  230. package/dist/next/personalization-host.js +0 -270
  231. package/dist/next/root-layout.d.ts +0 -4
  232. package/dist/next/root-layout.js +0 -5
  233. package/dist/next/vercel-collect-sdk-route.d.ts +0 -27
  234. package/dist/next/vercel-collect-sdk-route.js +0 -181
  235. package/dist/next/vercel-edge-projection-v1.d.ts +0 -24
  236. package/dist/next/vercel-edge-projection-v1.js +0 -880
  237. package/dist/next/vercel-personalization.d.ts +0 -4
  238. package/dist/next/vercel-personalization.js +0 -4
  239. package/dist/next/vercel-s3-personalization.d.ts +0 -79
  240. package/dist/next/vercel-s3-personalization.js +0 -570
  241. package/dist/types/layout.d.ts +0 -24
  242. package/src/types/layout.ts +0 -29
  243. package/templates/astro/starter-content/src/render/RenderPage.astro +0 -67
  244. package/templates/astro/template/src/cms/contracts/layouts/index.ts +0 -18
  245. package/templates/common/starter-content/.content/patterns/layouts/default.json +0 -14
  246. package/templates/nextjs/starter-content/src/components/elements/AtomicBlock.tsx +0 -13
  247. package/templates/nextjs/template/src/cms/contracts/layouts/index.ts +0 -16
  248. /package/dist/{types/layout.js → cli/mintlify-render.d.mts} +0 -0
  249. /package/templates/common/starter-content/.content/dam/folders/seed/{ast_site_home_hero → 000000000000000000000000101}/editorial.json +0 -0
  250. /package/templates/common/starter-content/.content/dam/folders/seed/{ast_site_about_hero → 000000000000000000000000101}/governance.json +0 -0
  251. /package/templates/common/starter-content/.content/dam/folders/seed/{ast_site_home_hero → 000000000000000000000000101}/versions/v0001.json +0 -0
  252. /package/templates/common/starter-content/.content/dam/folders/seed/{ast_site_about_hero → 000000000000000000000000102}/editorial.json +0 -0
  253. /package/templates/common/starter-content/.content/dam/folders/seed/{ast_site_home_hero → 000000000000000000000000102}/governance.json +0 -0
  254. /package/templates/common/starter-content/.content/dam/folders/seed/{ast_site_about_hero → 000000000000000000000000102}/versions/v0001.json +0 -0
@@ -1,18 +1,19 @@
1
1
  import { Button } from '@/components/elements/Button';
2
2
  import { Container } from '@/components/elements/Container';
3
- import { primaryImageSource } from '@gradial/aci';
3
+ import { primaryImageSource, type RootIdentityProps } from '@gradial/aci';
4
4
  import type { ContentProps } from '@/cms/contracts/components/homeHero.contract';
5
5
 
6
6
  type HeroImage = NonNullable<ContentProps['image']>;
7
7
 
8
- export type HomeHeroProps = Omit<ContentProps, 'image'> & { image?: HeroImage };
8
+ export type HomeHeroProps = Omit<ContentProps, 'image'> & { image?: HeroImage } & RootIdentityProps;
9
9
 
10
- export function HomeHero({ eyebrow = '', headline = '', description = '', ctaLabel = '', ctaHref = '#', image }: HomeHeroProps) {
10
+ export function HomeHero({ eyebrow = '', headline = '', description = '', ctaLabel = '', ctaHref = '#', image, ...root }: HomeHeroProps) {
11
11
  const imageSrc = heroImageSrc(image);
12
12
  const imageAlt = image?.alt || headline;
13
13
 
14
14
  return (
15
15
  <section
16
+ {...root}
16
17
  className="theme-light relative flex min-h-[var(--height-hero-min)] items-center bg-cover bg-center"
17
18
  aria-label={imageAlt}
18
19
  style={{
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { useEffect, useState } from 'react';
4
+ import type { RootIdentityProps } from '@gradial/aci';
4
5
  import type { ContentProps } from '@/cms/contracts/components/personalizationChoice.contract';
5
6
 
6
7
  type AciWindow = Window & { aci?: (command: string, value: unknown) => void };
@@ -15,7 +16,8 @@ export function PersonalizationChoice({
15
16
  redLabel,
16
17
  blueLabel,
17
18
  refreshLabel,
18
- }: ContentProps) {
19
+ ...root
20
+ }: ContentProps & RootIdentityProps) {
19
21
  const [consent, setConsent] = useState(false);
20
22
  const [marker, setMarker] = useState(false);
21
23
 
@@ -30,7 +32,7 @@ export function PersonalizationChoice({
30
32
  }, []);
31
33
 
32
34
  return (
33
- <section className="border-y border-[var(--color-border)] bg-[var(--color-surface)] py-[var(--spacing-section-y)]">
35
+ <section className="border-y border-[var(--color-border)] bg-[var(--color-surface)] py-[var(--spacing-section-y)]" {...root}>
34
36
  <div className="mx-auto max-w-[var(--layout-content-max)] px-[var(--layout-gutter)] text-center">
35
37
  <h2 className="text-[length:var(--text-h2)] font-[var(--font-weight-semibold)] text-[var(--color-fg)]">{title}</h2>
36
38
  {description ? <p className="mx-auto mt-3 max-w-2xl text-[var(--color-fg-muted)]">{description}</p> : null}
@@ -1,11 +1,12 @@
1
1
  import { Container } from '@/components/elements/Container';
2
+ import type { RootIdentityProps } from '@gradial/aci';
2
3
  import type { ContentProps } from '@/cms/contracts/components/statsBar.contract';
3
4
 
4
- export type StatsBarProps = ContentProps;
5
+ export type StatsBarProps = ContentProps & RootIdentityProps;
5
6
 
6
- export function StatsBar({ stats = [] }: StatsBarProps) {
7
+ export function StatsBar({ stats = [], ...root }: StatsBarProps) {
7
8
  return (
8
- <section className="theme-light relative border-y border-[var(--color-border-default)] bg-[var(--color-surface-100)] py-[var(--spacing-section-y)]">
9
+ <section {...root} className="theme-light relative border-y border-[var(--color-border-default)] bg-[var(--color-surface-100)] py-[var(--spacing-section-y)]">
9
10
  <div className="pointer-events-none absolute inset-0 bg-[image:var(--gradient-hero-base)] opacity-40" />
10
11
  <Container className="relative">
11
12
  <div className="grid gap-10 sm:grid-cols-2 lg:grid-cols-4">
@@ -4,7 +4,6 @@ framework: next
4
4
  source:
5
5
  root: "./"
6
6
  componentRegistry: "src/cms/registry.ts"
7
- layoutRegistry: "src/app/layout.tsx"
8
7
  routes:
9
8
  cmsManaged: "/[...slug]"
10
9
  rendererProtocol: stdio-json
@@ -7,7 +7,6 @@ source:
7
7
  root: "./"
8
8
 
9
9
  componentRegistry: ./src/cms/contracts/components/index.ts
10
- layoutRegistry: ./src/cms/contracts/layouts/index.ts
11
10
 
12
11
  routes:
13
12
  cmsManaged: "/[...slug]"
@@ -15,12 +15,13 @@
15
15
  "build:storybook": "storybook build"
16
16
  },
17
17
  "engines": {
18
- "node": ">=22",
18
+ "node": ">=24",
19
19
  "npm": ">=10"
20
20
  },
21
21
  "dependencies": {
22
+ "@c15t/nextjs": "^2.2.1",
22
23
  "@gradial/aci": "{{aciVersion}}",
23
- "next": "^15.1.6",
24
+ "next": "15.5.24",
24
25
  "react": "^19.0.0",
25
26
  "react-dom": "^19.0.0"
26
27
  },
@@ -31,7 +32,7 @@
31
32
  "@eslint/compat": "^1.2.0",
32
33
  "@eslint/eslintrc": "^3.2.0",
33
34
  "eslint": "^9.18.0",
34
- "eslint-config-next": "^15.1.6",
35
+ "eslint-config-next": "15.5.24",
35
36
  "eslint-plugin-import": "^2.29.1",
36
37
  "tailwindcss": "^4.2.4",
37
38
  "@tailwindcss/postcss": "^4.2.4",
@@ -0,0 +1,30 @@
1
+ export type Consents = Record<string, boolean>;
2
+ export type ConsentListener = (payload: { consents: Consents }) => void;
3
+
4
+ export interface C15tBridgeTarget {
5
+ c15t?: {
6
+ consents?: Consents;
7
+ onConsentChange?: (listener: ConsentListener) => void;
8
+ };
9
+ }
10
+
11
+ const listenersByTarget = new WeakMap<object, Set<ConsentListener>>();
12
+
13
+ // Install the discovery/subscription surface immediately. Consent values stay
14
+ // absent until publish is called with a real visitor decision, but a collector
15
+ // that subscribes before that decision remains connected indefinitely.
16
+ export function installC15tBridge(target: C15tBridgeTarget): (consents: Consents) => void {
17
+ let listeners = listenersByTarget.get(target);
18
+ if (!listeners) {
19
+ listeners = new Set<ConsentListener>();
20
+ listenersByTarget.set(target, listeners);
21
+ }
22
+ const bridge = (target.c15t ??= {});
23
+ bridge.onConsentChange ??= (listener) => {
24
+ listeners.add(listener);
25
+ };
26
+ return (consents) => {
27
+ bridge.consents = consents;
28
+ for (const listener of [...listeners]) listener({ consents });
29
+ };
30
+ }
@@ -0,0 +1,37 @@
1
+ 'use client';
2
+
3
+ // Themed c15t UI, loaded lazily via next/dynamic from consent-manager.tsx.
4
+ // Keeping the provider, banner, dialog, and their stylesheet in this separate
5
+ // chunk keeps them out of the self-contained error pages (REQ-14's 150 KiB
6
+ // budget) — error routes share the root layout but never carry the collect
7
+ // tag, so this chunk is never loaded there.
8
+
9
+ import {
10
+ ConsentBanner,
11
+ ConsentDialog,
12
+ ConsentManagerProvider,
13
+ } from '@c15t/nextjs';
14
+ import './consent-manager.css';
15
+
16
+ export default function C15tConsentUI() {
17
+ const backendURL = process.env.NEXT_PUBLIC_C15T_BACKEND_URL;
18
+ return (
19
+ <ConsentManagerProvider
20
+ options={
21
+ backendURL
22
+ ? {
23
+ mode: 'hosted',
24
+ backendURL,
25
+ consentCategories: ['necessary', 'measurement', 'marketing'],
26
+ }
27
+ : {
28
+ mode: 'offline',
29
+ consentCategories: ['necessary', 'measurement', 'marketing'],
30
+ }
31
+ }
32
+ >
33
+ <ConsentBanner />
34
+ <ConsentDialog />
35
+ </ConsentManagerProvider>
36
+ );
37
+ }
@@ -0,0 +1,63 @@
1
+ @import "@c15t/nextjs/styles.css";
2
+
3
+ /* c15t consent surfaces (banner + dialog) mapped onto Meridian tokens.
4
+ * `:root:root` because ConsentManagerProvider injects <style id="c15t-theme">
5
+ * with c15t's defaults on `:root` into <body> at runtime — after the head
6
+ * stylesheet — so a plain `:root` rule here would lose on source order.
7
+ * c15t's `-dark` component variables reference the same base tokens, so both
8
+ * color schemes stay on the Meridian light palette. */
9
+ :root:root {
10
+ /* Typography — Inter everywhere, on the Meridian scale. */
11
+ --c15t-font-family: var(--font-family-base);
12
+ --c15t-font-size-xs: var(--text-size-caption);
13
+ --c15t-font-size-sm: var(--text-size-body-small);
14
+ --c15t-font-size-md: var(--text-size-body);
15
+ --c15t-font-size-base: var(--text-size-body);
16
+ --c15t-font-size-lg: var(--text-size-body-large);
17
+ --c15t-font-weight-normal: var(--font-weight-regular);
18
+ --c15t-font-weight-regular: var(--font-weight-regular);
19
+ --c15t-font-weight-medium: var(--font-weight-medium);
20
+ --c15t-font-weight-semibold: var(--font-weight-semibold);
21
+ --c15t-line-height-tight: var(--leading-snug);
22
+ --c15t-line-height-normal: var(--leading-body);
23
+ --c15t-line-height-relaxed: var(--leading-relaxed);
24
+
25
+ /* Color — Meridian palette. */
26
+ --c15t-primary: var(--color-accent-primary);
27
+ --c15t-primary-hover: var(--color-brand-500);
28
+ --c15t-surface: var(--color-white);
29
+ --c15t-surface-hover: var(--color-surface-100);
30
+ --c15t-border: var(--color-border-default);
31
+ --c15t-text: var(--color-text-primary);
32
+ --c15t-text-muted: var(--color-text-secondary);
33
+ --c15t-text-on-primary: var(--color-white);
34
+ --c15t-overlay: color-mix(in srgb, var(--color-surface-900) 45%, transparent);
35
+ --c15t-switch-track: var(--color-surface-300);
36
+ --c15t-switch-track-active: var(--color-accent-primary);
37
+ --c15t-switch-thumb: var(--color-white);
38
+
39
+ /* Shape + depth — Meridian card treatment. */
40
+ --c15t-radius-md: var(--radius-button);
41
+ --c15t-radius-lg: var(--radius-card);
42
+ --c15t-shadow-md: var(--shadow-card);
43
+ --c15t-shadow-lg: var(--shadow-elevated);
44
+
45
+ /* c15t hardcodes these component values instead of deriving them from the
46
+ * base tokens; re-point the ones the banner + dialog actually render. */
47
+ --legal-links-color: var(--color-accent-primary);
48
+ --legal-links-focus-color: var(--color-accent-primary);
49
+ --legal-links-focus-color-dark: var(--color-accent-primary);
50
+ --consent-dialog-card-shadow: var(--shadow-elevated);
51
+ }
52
+
53
+ /* Stack the banner/dialog action buttons on narrow viewports. c15t only
54
+ * stacks via its `direction: column` config; the default row layout squeezes
55
+ * 2–3 buttons onto a phone. The attribute selectors match c15t's stable
56
+ * class-name prefixes (the hashed suffixes change between c15t releases). */
57
+ @media (width < 640px) {
58
+ [class*="c15t-ui-footer-"],
59
+ [class*="c15t-ui-footerSubGroup-"] {
60
+ flex-direction: column;
61
+ width: 100%;
62
+ }
63
+ }
@@ -0,0 +1,76 @@
1
+ 'use client';
2
+
3
+ // c15t consent manager (personalization-onboarding ANTI-3: CMP-less sites are
4
+ // pointed at c15t via the starter kits). Offline mode by default; set
5
+ // NEXT_PUBLIC_C15T_BACKEND_URL to use a hosted or self-hosted c15t backend.
6
+ //
7
+ // The component gates itself on the collect tag in the document: the tag is
8
+ // the only per-site configuration surface, emitted by createPage from the
9
+ // site config's personalization block, so the consent surface appears exactly
10
+ // when the tag says data-aci-consent="c15t" — and never on pages without the
11
+ // tag (error pages, custom routes). This keeps the root layout free of
12
+ // server-side config loading.
13
+ //
14
+ // The ACI collect SDK's c15t preset reads window.c15t = { consents,
15
+ // onConsentChange }, but c15t publishes its store as window.c15tStore. The
16
+ // bridge below exposes the subscription shape immediately, while publishing
17
+ // consent values only after a real visitor decision (consentInfo set), so
18
+ // pre-decision defaults never read as a withdrawal.
19
+
20
+ import dynamic from 'next/dynamic';
21
+ import { useEffect, useState } from 'react';
22
+ import { installC15tBridge, type Consents } from './c15t-bridge';
23
+
24
+ // Lazy so the c15t bundle + stylesheet stay out of the self-contained error
25
+ // pages (REQ-14 budget): those routes never carry the collect tag, so this
26
+ // chunk is never requested there.
27
+ const C15tConsentUI = dynamic(() => import('./c15t-consent-ui'), {
28
+ ssr: false,
29
+ });
30
+
31
+ interface ConsentStoreState {
32
+ consents?: Consents;
33
+ consentInfo?: unknown;
34
+ }
35
+
36
+ interface ConsentStoreLike {
37
+ getState(): ConsentStoreState;
38
+ subscribe(listener: (state: ConsentStoreState) => void): () => void;
39
+ }
40
+
41
+ export function ConsentManager() {
42
+ const [enabled, setEnabled] = useState(false);
43
+
44
+ useEffect(() => {
45
+ const tag = document.querySelector('script[data-aci-consent]');
46
+ setEnabled(tag?.getAttribute('data-aci-consent') === 'c15t');
47
+ }, []);
48
+
49
+ useEffect(() => {
50
+ if (!enabled) return;
51
+ const w = window as typeof window & {
52
+ c15t?: { consents?: Consents; onConsentChange?: (cb: (payload: { consents: Consents }) => void) => void };
53
+ c15tStore?: ConsentStoreLike;
54
+ };
55
+ const publish = installC15tBridge(w);
56
+ const onState = (state: ConsentStoreState): void => {
57
+ if (state.consentInfo && state.consents) publish(state.consents);
58
+ };
59
+ let unsubscribe: (() => void) | undefined;
60
+ let remaining = 40; // same bounded poll the collect SDK uses for window.c15t
61
+ const poll = (): void => {
62
+ if (w.c15tStore) {
63
+ onState(w.c15tStore.getState());
64
+ unsubscribe = w.c15tStore.subscribe(onState);
65
+ return;
66
+ }
67
+ remaining -= 1;
68
+ if (remaining > 0) window.setTimeout(poll, 250);
69
+ };
70
+ poll();
71
+ return () => unsubscribe?.();
72
+ }, [enabled]);
73
+
74
+ if (!enabled) return null;
75
+ return <C15tConsentUI />;
76
+ }
@@ -0,0 +1,93 @@
1
+ Copyright 2020 The Inter Project Authors (https://github.com/rsms/inter)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ https://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,93 @@
1
+ Copyright 2020 The Space Grotesk Project Authors (https://github.com/floriankarsten/space-grotesk)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -1,20 +1,24 @@
1
1
  import type { ReactNode } from 'react';
2
- import { Inter, Space_Grotesk } from 'next/font/google';
2
+ import localFont from 'next/font/local';
3
3
  import { DevRefresh } from '@gradial/aci/next';
4
+ import { ConsentManager } from './_components/consent-manager';
4
5
  import '@/design-system/styles.css';
5
6
 
6
- const inter = Inter({
7
- subsets: ['latin'],
7
+ // Fonts ship with the site so `next build` never fetches from Google Fonts.
8
+ // Each file is the Google Fonts latin-subset variable woff2 (one file covers
9
+ // weights 400-700); the SIL OFL 1.1 license sits beside it.
10
+ const inter = localFont({
11
+ src: './fonts/inter/inter-latin.woff2',
8
12
  variable: '--font-inter',
9
13
  display: 'swap',
10
- weight: ['400', '500', '600', '700'],
14
+ weight: '400 700',
11
15
  });
12
16
 
13
- const spaceGrotesk = Space_Grotesk({
14
- subsets: ['latin'],
17
+ const spaceGrotesk = localFont({
18
+ src: './fonts/space-grotesk/space-grotesk-latin.woff2',
15
19
  variable: '--font-space-grotesk',
16
20
  display: 'swap',
17
- weight: ['400', '500', '600', '700'],
21
+ weight: '400 700',
18
22
  });
19
23
 
20
24
  export default function Layout({ children }: { children: ReactNode }) {
@@ -22,6 +26,7 @@ export default function Layout({ children }: { children: ReactNode }) {
22
26
  <html lang="en" className={`${inter.variable} ${spaceGrotesk.variable}`}>
23
27
  <body>
24
28
  {children}
29
+ <ConsentManager />
25
30
  <DevRefresh />
26
31
  </body>
27
32
  </html>
@@ -8,6 +8,7 @@ import { conformancePreset } from '@gradial/aci/testing';
8
8
 
9
9
  conformancePreset({
10
10
  framework: 'next',
11
+ registry: 'src/cms/registry.ts',
11
12
  siteId: '{{siteName}}',
12
13
  });
13
14
 
@@ -1,6 +0,0 @@
1
- import type { LayoutContract, LayoutDefinition, LayoutSlot } from './types/layout.js';
2
- import type { FragmentRefNode } from './types/page.js';
3
- export declare function defineLayout(definition: LayoutDefinition): LayoutContract;
4
- export declare const defineLayoutContract: typeof defineLayout;
5
- export declare function slot(name: string, required?: boolean): LayoutSlot;
6
- export declare function fragmentDefault(fragmentId: string): FragmentRefNode;
@@ -1,14 +0,0 @@
1
- export function defineLayout(definition) {
2
- return {
3
- name: definition.name,
4
- slots: definition.slots,
5
- defaults: definition.defaults,
6
- };
7
- }
8
- export const defineLayoutContract = defineLayout;
9
- export function slot(name, required = false) {
10
- return { name, required };
11
- }
12
- export function fragmentDefault(fragmentId) {
13
- return { kind: 'fragment-ref', fragmentId, inline: true };
14
- }
@@ -1,11 +0,0 @@
1
- export function selectPersonalizationVariant(request: any, route: any, claims: any, experiments: any, identity: any): any;
2
- export function resolvePersonalizationDecision(request: any, route: any, claims: any, experiments: any, identity: any): {
3
- variant: any;
4
- experiment: {
5
- experimentId: any;
6
- armId: any;
7
- allocationVersion: string;
8
- variantKey: any;
9
- bucket: number;
10
- } | null;
11
- };