@gradial/aci 0.1.52-rc.2 → 0.1.52-rc.21

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 (123) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +4 -4
  3. package/dist/astro/preview.js +2 -17
  4. package/dist/audience-data-models.d.ts +289 -16
  5. package/dist/audience-data-models.js +99 -2
  6. package/dist/cli/compile-registry.d.mts +5 -1
  7. package/dist/cli/compile-registry.mjs +25 -10
  8. package/dist/cli/validate-content.d.mts +31 -1
  9. package/dist/cli/validate-content.mjs +50 -12
  10. package/dist/collect/aci.js +1 -1
  11. package/dist/collect/aci.js.sha256 +1 -1
  12. package/dist/collect/api.d.ts +3 -7
  13. package/dist/collect/api.js +2 -8
  14. package/dist/collect/batcher.d.ts +6 -5
  15. package/dist/collect/batcher.js +6 -5
  16. package/dist/collect/index.js +1 -1
  17. package/dist/content/provider.d.ts +1 -0
  18. package/dist/content/resolve-slots.d.ts +9 -2
  19. package/dist/content/resolve-slots.js +5 -3
  20. package/dist/content/types.d.ts +2 -0
  21. package/dist/edge/expression-capabilities.v1.d.ts +106 -0
  22. package/dist/edge/expression-capabilities.v1.js +165 -0
  23. package/dist/internal/domain/edge/compose.d.ts +24 -0
  24. package/dist/internal/domain/edge/compose.js +89 -0
  25. package/dist/internal/domain/edge/identity.js +1 -1
  26. package/dist/internal/domain/edge/index.d.ts +2 -0
  27. package/dist/internal/domain/edge/index.js +2 -0
  28. package/dist/internal/domain/edge/mimic_token.d.ts +13 -0
  29. package/dist/internal/domain/edge/mimic_token.js +58 -0
  30. package/dist/internal/domain/edge/personalization-core.d.ts +69 -5
  31. package/dist/internal/domain/edge/personalization-core.js +693 -58
  32. package/dist/internal/domain/edge/record/codec.d.ts +5 -2
  33. package/dist/internal/domain/edge/record/codec.js +85 -12
  34. package/dist/internal/domain/edge/resolve.js +38 -18
  35. package/dist/internal/domain/edge/testdata/flat_only_validator_v1.d.ts +10 -0
  36. package/dist/internal/domain/edge/testdata/flat_only_validator_v1.js +253 -0
  37. package/dist/internal/domain/edge/types.d.ts +52 -9
  38. package/dist/internal/domain/edge/types.js +3 -3
  39. package/dist/mimic/core.d.ts +2 -0
  40. package/dist/mimic/core.js +31 -0
  41. package/dist/next/error-seat-payload.js +1 -1
  42. package/dist/next/hosted-page-target.d.ts +7 -0
  43. package/dist/next/hosted-page-target.js +39 -0
  44. package/dist/next/index.d.ts +0 -1
  45. package/dist/next/index.js +0 -1
  46. package/dist/next/page.d.ts +29 -6
  47. package/dist/next/page.js +47 -25
  48. package/dist/next/server.js +28 -1
  49. package/dist/next/vercel-edge-projection-v1.d.ts +0 -9
  50. package/dist/next/vercel-edge-projection-v1.js +9 -539
  51. package/dist/preview/core.d.ts +1 -0
  52. package/dist/preview/core.js +27 -0
  53. package/dist/providers/s3.js +4 -3
  54. package/dist/react/VideoPlayer.d.ts +1 -1
  55. package/dist/react/index.d.ts +1 -1
  56. package/dist/types/block-ref.d.ts +2 -0
  57. package/dist/types/block-ref.js +1 -0
  58. package/package.json +16 -7
  59. package/src/cli/compile-registry.mjs +24 -10
  60. package/src/cli/validate-content.mjs +52 -13
  61. package/src/types/block-ref.test.ts +45 -0
  62. package/src/types/block-ref.ts +2 -0
  63. package/templates/astro/starter-content/src/fixtures/atomicBlocks.ts +7 -6
  64. package/templates/astro/starter-content/src/fixtures/composition.ts +3 -2
  65. package/templates/astro/starter-content/src/fixtures/sections.ts +2 -1
  66. package/templates/astro/template/package.json.tmpl +1 -1
  67. package/templates/astro/template/src/layouts/SiteLayout.astro +2 -2
  68. package/templates/common/.agents/skills/aci/SKILL.md +6 -0
  69. package/templates/common/.agents/skills/authoring/SKILL.md +11 -3
  70. package/templates/common/.agents/skills/authoring/references/block-slots.md +3 -0
  71. package/templates/common/.agents/skills/dam-delivery/SKILL.md +228 -0
  72. package/templates/common/.agents/skills/dam-delivery/references/parameter-contract.md +107 -0
  73. package/templates/common/.agents/skills/dam-delivery/references/permalink-grammar.md +131 -0
  74. package/templates/common/.content/pages/{home/_index.json → _index.json} +10 -0
  75. package/templates/common/.content/schemas/site.schema.json +1 -1
  76. package/templates/common/.nvmrc +1 -1
  77. package/templates/common/starter-content/.content/.rules-baseline.json +8 -0
  78. package/templates/common/starter-content/.content/config/site.json +1 -1
  79. package/templates/common/starter-content/.content/content-rules/no-public-resource-paths.json +6 -0
  80. package/templates/common/starter-content/.content/fragments/navbar/_index.json +23 -20
  81. package/templates/common/starter-content/.content/fragments/site-footer/_index.json +59 -56
  82. package/templates/common/starter-content/.content/pages/404/_index.json +1 -0
  83. package/templates/common/starter-content/.content/pages/about/_index.json +3 -0
  84. package/templates/common/starter-content/.content/pages/error/_index.json +1 -0
  85. package/templates/common/starter-content/.content/pages/home/_index.json +9 -0
  86. package/templates/common/starter-content/.content/patterns/components/button.json +55 -0
  87. package/templates/common/starter-content/.content/patterns/components/container.json +62 -0
  88. package/templates/common/starter-content/.content/patterns/components/feature_card.json +30 -0
  89. package/templates/common/starter-content/.content/patterns/components/feature_grid.json +57 -0
  90. package/templates/common/starter-content/.content/patterns/components/home_hero.json +142 -0
  91. package/templates/common/starter-content/.content/patterns/components/personalization_choice.json +42 -0
  92. package/templates/common/starter-content/.content/patterns/components/site-footer.json +203 -0
  93. package/templates/common/starter-content/.content/patterns/components/site-navigation.json +115 -0
  94. package/templates/common/starter-content/.content/patterns/components/stats_bar.json +45 -0
  95. package/templates/common/starter-content/.content/patterns/layouts/default.json +14 -0
  96. package/templates/common/starter-content/.content/schemas/site.schema.json +1 -1
  97. package/templates/nextjs/template/.aci.yaml +10 -0
  98. package/templates/nextjs/template/package.json.tmpl +4 -3
  99. package/templates/nextjs/template/src/app/_components/c15t-bridge.ts +30 -0
  100. package/templates/nextjs/template/src/app/_components/c15t-consent-ui.tsx +37 -0
  101. package/templates/nextjs/template/src/app/_components/consent-manager.css +63 -0
  102. package/templates/nextjs/template/src/app/_components/consent-manager.tsx +76 -0
  103. package/templates/nextjs/template/src/app/layout.tsx +2 -0
  104. package/dist/edge/personalization-core.d.ts +0 -11
  105. package/dist/edge/personalization-core.js +0 -269
  106. package/dist/next/collect-route.d.ts +0 -19
  107. package/dist/next/collect-route.js +0 -459
  108. package/dist/next/envelope-digest.d.ts +0 -21
  109. package/dist/next/envelope-digest.js +0 -58
  110. package/dist/next/middleware.d.ts +0 -40
  111. package/dist/next/middleware.js +0 -475
  112. package/dist/next/personalization-host.d.ts +0 -134
  113. package/dist/next/personalization-host.js +0 -270
  114. package/dist/next/root-layout.d.ts +0 -4
  115. package/dist/next/root-layout.js +0 -5
  116. package/dist/next/vercel-collect-sdk-route.d.ts +0 -27
  117. package/dist/next/vercel-collect-sdk-route.js +0 -181
  118. package/dist/next/vercel-personalization.d.ts +0 -4
  119. package/dist/next/vercel-personalization.js +0 -4
  120. package/dist/next/vercel-s3-personalization.d.ts +0 -79
  121. package/dist/next/vercel-s3-personalization.js +0 -570
  122. /package/templates/common/.content/overlays/audience/preference-blue/pages/{home/_index.json → _index.json} +0 -0
  123. /package/templates/common/.content/overlays/audience/preference-red/pages/{home/_index.json → _index.json} +0 -0
@@ -0,0 +1,203 @@
1
+ {
2
+ "$type": "componentPattern",
3
+ "buildId": "codebuild_01a017ed-c52f-703a-a6b4-a0943c057d31",
4
+ "codeDigest": "sha256:119dd8414ca342ca67f4dd4703dcb504630220bbdca9130b1501ee7b25693134",
5
+ "name": "site-footer",
6
+ "schema": {
7
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
8
+ "title": "site-footer",
9
+ "type": "object",
10
+ "properties": {
11
+ "brandHref": {
12
+ "type": "string",
13
+ "minLength": 1
14
+ },
15
+ "brandLabel": {
16
+ "type": "string",
17
+ "minLength": 1
18
+ },
19
+ "brandLogo": {
20
+ "anyOf": [
21
+ {
22
+ "type": "object",
23
+ "properties": {
24
+ "src": {
25
+ "type": "string"
26
+ },
27
+ "alt": {
28
+ "type": "string"
29
+ }
30
+ },
31
+ "required": [
32
+ "src",
33
+ "alt"
34
+ ],
35
+ "additionalProperties": false
36
+ },
37
+ {
38
+ "type": "null"
39
+ }
40
+ ]
41
+ },
42
+ "columns": {
43
+ "type": "array",
44
+ "items": {
45
+ "type": "object",
46
+ "properties": {
47
+ "id": {
48
+ "type": "string",
49
+ "minLength": 1
50
+ },
51
+ "title": {
52
+ "type": "string"
53
+ },
54
+ "links": {
55
+ "type": "array",
56
+ "items": {
57
+ "type": "object",
58
+ "properties": {
59
+ "id": {
60
+ "type": "string",
61
+ "minLength": 1
62
+ },
63
+ "label": {
64
+ "type": "string",
65
+ "minLength": 1
66
+ },
67
+ "href": {
68
+ "type": "string",
69
+ "minLength": 1
70
+ }
71
+ },
72
+ "required": [
73
+ "id",
74
+ "label",
75
+ "href"
76
+ ],
77
+ "additionalProperties": false
78
+ }
79
+ },
80
+ "groups": {
81
+ "type": "array",
82
+ "items": {
83
+ "type": "object",
84
+ "properties": {
85
+ "id": {
86
+ "type": "string",
87
+ "minLength": 1
88
+ },
89
+ "title": {
90
+ "type": "string"
91
+ },
92
+ "links": {
93
+ "type": "array",
94
+ "items": {
95
+ "type": "object",
96
+ "properties": {
97
+ "id": {
98
+ "type": "string",
99
+ "minLength": 1
100
+ },
101
+ "label": {
102
+ "type": "string",
103
+ "minLength": 1
104
+ },
105
+ "href": {
106
+ "type": "string",
107
+ "minLength": 1
108
+ }
109
+ },
110
+ "required": [
111
+ "id",
112
+ "label",
113
+ "href"
114
+ ],
115
+ "additionalProperties": false
116
+ }
117
+ }
118
+ },
119
+ "required": [
120
+ "id",
121
+ "title",
122
+ "links"
123
+ ],
124
+ "additionalProperties": false
125
+ }
126
+ }
127
+ },
128
+ "required": [
129
+ "id"
130
+ ],
131
+ "additionalProperties": false
132
+ }
133
+ },
134
+ "social": {
135
+ "type": "array",
136
+ "items": {
137
+ "type": "object",
138
+ "properties": {
139
+ "id": {
140
+ "type": "string",
141
+ "minLength": 1
142
+ },
143
+ "label": {
144
+ "type": "string",
145
+ "minLength": 1
146
+ },
147
+ "href": {
148
+ "type": "string",
149
+ "minLength": 1
150
+ },
151
+ "icon": {
152
+ "type": "string"
153
+ }
154
+ },
155
+ "required": [
156
+ "id",
157
+ "label",
158
+ "href"
159
+ ],
160
+ "additionalProperties": false
161
+ }
162
+ },
163
+ "legalLinks": {
164
+ "type": "array",
165
+ "items": {
166
+ "type": "object",
167
+ "properties": {
168
+ "id": {
169
+ "type": "string",
170
+ "minLength": 1
171
+ },
172
+ "label": {
173
+ "type": "string",
174
+ "minLength": 1
175
+ },
176
+ "href": {
177
+ "type": "string",
178
+ "minLength": 1
179
+ }
180
+ },
181
+ "required": [
182
+ "id",
183
+ "label",
184
+ "href"
185
+ ],
186
+ "additionalProperties": false
187
+ }
188
+ },
189
+ "copyright": {
190
+ "type": "string"
191
+ }
192
+ },
193
+ "required": [
194
+ "brandHref",
195
+ "brandLabel",
196
+ "columns"
197
+ ],
198
+ "additionalProperties": false
199
+ },
200
+ "imageSlots": {},
201
+ "notes": "",
202
+ "skills": []
203
+ }
@@ -0,0 +1,115 @@
1
+ {
2
+ "$type": "componentPattern",
3
+ "buildId": "codebuild_01a017ed-c52f-703a-a6b4-a0943c057d31",
4
+ "codeDigest": "sha256:119dd8414ca342ca67f4dd4703dcb504630220bbdca9130b1501ee7b25693134",
5
+ "name": "site-navigation",
6
+ "schema": {
7
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
8
+ "title": "site-navigation",
9
+ "type": "object",
10
+ "properties": {
11
+ "brandHref": {
12
+ "type": "string",
13
+ "minLength": 1
14
+ },
15
+ "brandLabel": {
16
+ "type": "string",
17
+ "minLength": 1
18
+ },
19
+ "brandLogo": {
20
+ "anyOf": [
21
+ {
22
+ "type": "object",
23
+ "properties": {
24
+ "src": {
25
+ "type": "string"
26
+ },
27
+ "alt": {
28
+ "type": "string"
29
+ }
30
+ },
31
+ "required": [
32
+ "src",
33
+ "alt"
34
+ ],
35
+ "additionalProperties": false
36
+ },
37
+ {
38
+ "type": "null"
39
+ }
40
+ ]
41
+ },
42
+ "navigation": {
43
+ "type": "array",
44
+ "items": {
45
+ "type": "object",
46
+ "properties": {
47
+ "id": {
48
+ "type": "string",
49
+ "minLength": 1
50
+ },
51
+ "label": {
52
+ "type": "string",
53
+ "minLength": 1
54
+ },
55
+ "href": {
56
+ "type": "string",
57
+ "minLength": 1
58
+ }
59
+ },
60
+ "required": [
61
+ "id",
62
+ "label",
63
+ "href"
64
+ ],
65
+ "additionalProperties": false
66
+ }
67
+ },
68
+ "utilities": {
69
+ "type": "array",
70
+ "items": {
71
+ "type": "object",
72
+ "properties": {
73
+ "id": {
74
+ "type": "string",
75
+ "minLength": 1
76
+ },
77
+ "label": {
78
+ "type": "string",
79
+ "minLength": 1
80
+ },
81
+ "href": {
82
+ "type": "string",
83
+ "minLength": 1
84
+ },
85
+ "variant": {
86
+ "type": "string",
87
+ "enum": [
88
+ "primary",
89
+ "secondary",
90
+ "tertiary",
91
+ "outline",
92
+ "ghost"
93
+ ]
94
+ }
95
+ },
96
+ "required": [
97
+ "id",
98
+ "label",
99
+ "href"
100
+ ],
101
+ "additionalProperties": false
102
+ }
103
+ }
104
+ },
105
+ "required": [
106
+ "brandHref",
107
+ "brandLabel",
108
+ "navigation"
109
+ ],
110
+ "additionalProperties": false
111
+ },
112
+ "imageSlots": {},
113
+ "notes": "",
114
+ "skills": []
115
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "$type": "componentPattern",
3
+ "buildId": "codebuild_01a017ed-c52f-703a-a6b4-a0943c057d31",
4
+ "codeDigest": "sha256:119dd8414ca342ca67f4dd4703dcb504630220bbdca9130b1501ee7b25693134",
5
+ "name": "stats_bar",
6
+ "schema": {
7
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
8
+ "title": "stats_bar",
9
+ "type": "object",
10
+ "properties": {
11
+ "stats": {
12
+ "minItems": 1,
13
+ "type": "array",
14
+ "items": {
15
+ "type": "object",
16
+ "properties": {
17
+ "label": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "value": {
22
+ "type": "string",
23
+ "minLength": 1
24
+ },
25
+ "suffix": {
26
+ "type": "string"
27
+ }
28
+ },
29
+ "required": [
30
+ "label",
31
+ "value"
32
+ ],
33
+ "additionalProperties": false
34
+ }
35
+ }
36
+ },
37
+ "required": [
38
+ "stats"
39
+ ],
40
+ "additionalProperties": false
41
+ },
42
+ "imageSlots": {},
43
+ "notes": "",
44
+ "skills": []
45
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$type": "layoutPattern",
3
+ "buildId": "codebuild_01a017ed-c52f-703a-a6b4-a0943c057d31",
4
+ "codeDigest": "sha256:119dd8414ca342ca67f4dd4703dcb504630220bbdca9130b1501ee7b25693134",
5
+ "name": "default",
6
+ "slots": [
7
+ "header",
8
+ "main",
9
+ "footer"
10
+ ],
11
+ "default": false,
12
+ "notes": "",
13
+ "skills": []
14
+ }
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "overlayResolution": {
29
29
  "type": "array",
30
- "items": { "enum": ["locale", "audience"] }
30
+ "items": { "enum": ["locale", "audience", "segment", "experiment", "experimentArm"] }
31
31
  },
32
32
  "brandHref": { "type": "string" },
33
33
  "brandLogo": {
@@ -0,0 +1,10 @@
1
+ version: "1"
2
+ siteId: "starter-nextjs"
3
+ framework: next
4
+ source:
5
+ root: "./"
6
+ componentRegistry: "src/cms/registry.ts"
7
+ layoutRegistry: "src/app/layout.tsx"
8
+ routes:
9
+ cmsManaged: "/[...slug]"
10
+ rendererProtocol: stdio-json
@@ -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
+ }
@@ -1,6 +1,7 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import { Inter, Space_Grotesk } from 'next/font/google';
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
7
  const inter = Inter({
@@ -22,6 +23,7 @@ export default function Layout({ children }: { children: ReactNode }) {
22
23
  <html lang="en" className={`${inter.variable} ${spaceGrotesk.variable}`}>
23
24
  <body>
24
25
  {children}
26
+ <ConsentManager />
25
27
  <DevRefresh />
26
28
  </body>
27
29
  </html>
@@ -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
- };