@c15t/react 3.0.0-alpha.4 → 3.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +2 -1
- package/dist/component-hooks/use-headless-consent-ui.js +1 -1
- package/dist/component-hooks/use-headless-iab-consent-ui.js +1 -1
- package/dist/components/preferences/atoms/accordion.js +1 -1
- package/dist/components/shared/primitives/button.js +1 -1
- package/dist/draft-context.js +2 -0
- package/dist/draft.js +1 -1
- package/dist/external-iab-context.js +1 -1
- package/dist/gpp.js +2 -0
- package/dist/hooks/use-color-scheme.js +1 -1
- package/dist/hooks.js +1 -1
- package/dist/index-parts/consent-banner.js +1 -0
- package/dist/index-parts/consent-dialog-link.js +1 -0
- package/dist/index-parts/consent-dialog-trigger.js +1 -0
- package/dist/index-parts/consent-dialog.js +1 -0
- package/dist/index-parts/consent-gate.js +1 -0
- package/dist/index-parts/core.js +1 -0
- package/dist/index-parts/draft.js +1 -0
- package/dist/index-parts/hooks.js +1 -0
- package/dist/index-parts/module-hooks.js +1 -0
- package/dist/index-parts/provider.js +1 -0
- package/dist/index-parts/theme.js +1 -0
- package/dist/index-parts/translations.js +1 -0
- package/dist/index.js +1 -1
- package/dist/kernel-selector.js +1 -1
- package/dist/module-hooks/iframe-blocker.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/version.js +1 -1
- package/dist-types/draft-context.d.ts +31 -0
- package/dist-types/draft.d.ts +13 -36
- package/dist-types/gpp.d.ts +27 -0
- package/dist-types/hooks.d.ts +3 -0
- package/dist-types/index-parts/consent-banner.d.ts +7 -0
- package/dist-types/index-parts/consent-dialog-link.d.ts +7 -0
- package/dist-types/index-parts/consent-dialog-trigger.d.ts +7 -0
- package/dist-types/index-parts/consent-dialog.d.ts +7 -0
- package/dist-types/index-parts/consent-gate.d.ts +7 -0
- package/dist-types/index-parts/core.d.ts +8 -0
- package/dist-types/index-parts/draft.d.ts +7 -0
- package/dist-types/index-parts/hooks.d.ts +7 -0
- package/dist-types/index-parts/module-hooks.d.ts +7 -0
- package/dist-types/index-parts/provider.d.ts +7 -0
- package/dist-types/index-parts/theme.d.ts +8 -0
- package/dist-types/index-parts/translations.d.ts +7 -0
- package/dist-types/index.d.ts +14 -15
- package/dist-types/kernel-selector.d.ts +0 -8
- package/dist-types/module-hooks/iframe-blocker.d.ts +12 -7
- package/dist-types/provider.d.ts +36 -13
- package/dist-types/version.d.ts +1 -1
- package/docs/README.md +2 -1
- package/docs/concepts/consent-state.md +19 -5
- package/docs/customization/translations.md +1 -2
- package/docs/frameworks/react/components/consent-provider.md +6 -2
- package/docs/frameworks/react/components/dev-tools.md +1 -1
- package/docs/frameworks/react/gpp.md +163 -0
- package/docs/integrations/posthog.md +99 -11
- package/docs/upgrade-v3.md +22 -1
- package/package.json +12 -7
- package/dist/ui-save.js +0 -1
- package/dist-types/ui-save.d.ts +0 -25
package/docs/upgrade-v3.md
CHANGED
|
@@ -431,10 +431,31 @@ npx @c15t/cli@alpha self-host migrate --config ./c15t-backend.config.ts --apply
|
|
|
431
431
|
```
|
|
432
432
|
|
|
433
433
|
The migrator recognizes the v2 schema, adopts it, and adds the v3 tables and
|
|
434
|
-
columns.
|
|
434
|
+
columns. Apply it before the v3 backend serves traffic: v3 records policy
|
|
435
|
+
decisions without the v2 `jurisdiction` label, which the migration makes
|
|
436
|
+
nullable. [Database setup](https://c15t.com/docs/self-host/guides/database-setup#upgrade-a-v2-backend)
|
|
435
437
|
covers the details, and the [backend quickstart](https://c15t.com/docs/self-host/quickstart)
|
|
436
438
|
shows a complete v3 config and route.
|
|
437
439
|
|
|
440
|
+
### Remove `disableGeoLocation`
|
|
441
|
+
|
|
442
|
+
v3 removes the `disableGeoLocation` manifest option. Policy rules decide by
|
|
443
|
+
country and region. To show every visitor the same banner, configure one rule
|
|
444
|
+
with `match: { isDefault: true }`. It applies wherever the visitor is, so the
|
|
445
|
+
browser can resolve it without asking the backend for a location.
|
|
446
|
+
|
|
447
|
+
To test one region's rule from anywhere, set the country in the client's
|
|
448
|
+
`overrides`, for example `overrides: { country: 'US' }`. See
|
|
449
|
+
[runtime options](https://c15t.com/docs/frameworks/javascript/api/runtime).
|
|
450
|
+
|
|
451
|
+
### Stop reading `jurisdiction`
|
|
452
|
+
|
|
453
|
+
`/init` responses, session reports and `sessions.onReport` no longer carry a
|
|
454
|
+
`jurisdiction` label such as `GDPR`. Read the matched policy from
|
|
455
|
+
`policyResolution` instead, or the report's `policy`, `country` and `region`.
|
|
456
|
+
The backend still accepts `jurisdiction` in a v2 client's save request and
|
|
457
|
+
ignores it.
|
|
458
|
+
|
|
438
459
|
## Update the Node.js SDK
|
|
439
460
|
|
|
440
461
|
Install `@c15t/node-sdk@alpha`. The v2 client is gone: create one with
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c15t/react",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.5",
|
|
4
4
|
"description": "React cookie banner, consent manager, preference center, and headless CMP components with IAB TCF and Consent Mode support.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ccpa",
|
|
@@ -147,6 +147,11 @@
|
|
|
147
147
|
"import": "./dist/iab.js",
|
|
148
148
|
"default": "./dist/iab.js"
|
|
149
149
|
},
|
|
150
|
+
"./gpp": {
|
|
151
|
+
"types": "./dist-types/gpp.d.ts",
|
|
152
|
+
"import": "./dist/gpp.js",
|
|
153
|
+
"default": "./dist/gpp.js"
|
|
154
|
+
},
|
|
150
155
|
"./styles.css": "./dist/styles.css",
|
|
151
156
|
"./styles.tw3.css": "./dist/styles.tw3.css",
|
|
152
157
|
"./iab/styles.css": "./dist/iab/styles.css",
|
|
@@ -249,16 +254,16 @@
|
|
|
249
254
|
"test:watch": "bun prebuild && vitest"
|
|
250
255
|
},
|
|
251
256
|
"dependencies": {
|
|
252
|
-
"@c15t/core": "3.0.0-alpha.
|
|
253
|
-
"@c15t/dev-tools": "3.0.0-alpha.
|
|
254
|
-
"@c15t/iab": "3.0.0-alpha.
|
|
255
|
-
"@c15t/schema": "3.0.0-alpha.
|
|
257
|
+
"@c15t/core": "3.0.0-alpha.5",
|
|
258
|
+
"@c15t/dev-tools": "3.0.0-alpha.5",
|
|
259
|
+
"@c15t/iab": "3.0.0-alpha.5",
|
|
260
|
+
"@c15t/schema": "3.0.0-alpha.4",
|
|
256
261
|
"@c15t/translations": "3.0.0-alpha.4",
|
|
257
|
-
"@c15t/ui": "3.0.0-alpha.
|
|
262
|
+
"@c15t/ui": "3.0.0-alpha.5",
|
|
258
263
|
"@types/google.maps": "3.65.3"
|
|
259
264
|
},
|
|
260
265
|
"devDependencies": {
|
|
261
|
-
"@c15t/backend": "3.0.0-alpha.
|
|
266
|
+
"@c15t/backend": "3.0.0-alpha.5",
|
|
262
267
|
"@c15t/conformance": "0.0.1",
|
|
263
268
|
"@c15t/typescript-config": "0.0.1",
|
|
264
269
|
"@c15t/vitest-config": "1.0.0",
|
package/dist/ui-save.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e=new WeakMap,t=t=>{e.set(t,{})},n=e=>e.policyPending||"failed"===e.resolution.status||"none"===e.promptRequirement.kind?"none":"banner",i=(t,i,a)=>{let o={};e.set(t,o);let s=t.getSnapshot(),c="dialog"===s.activeUI,l=i();if(!c)return l;let r=t.getSnapshot();return r.explicitChoice!==s.explicitChoice||r.vendorChoice!==s.vendorChoice||r.noticeDismissal!==s.noticeDismissal?(e.get(t)===o&&t.set.activeUI(n(r)),l):l.then(i=>(i.ok&&a()&&e.get(t)===o&&"dialog"===t.getSnapshot().activeUI&&t.set.activeUI(n(t.getSnapshot())),i))},a=async(t,n)=>{let i={};e.set(t,i);let a=t.getSnapshot(),o=a.activeUI;"none"!==o&&t.set.activeUI("none");try{await n()}finally{let n=t.getSnapshot();"none"!==o&&n.iab?.authority===a.iab?.authority&&"none"===n.activeUI&&e.get(t)===i&&t.set.activeUI(o)}};export{t as invalidateConsentUIAction,i as saveConsentUI,a as saveIABConsentUI};
|
package/dist-types/ui-save.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ConsentKernel, SaveResult } from '@c15t/core';
|
|
2
|
-
/** Explicit navigation supersedes a pending UI action, even to the same dialog. */
|
|
3
|
-
export declare const invalidateConsentUIAction: (kernel: ConsentKernel) => void;
|
|
4
|
-
/**
|
|
5
|
-
* Close the preferences dialog as soon as its choice is recorded locally.
|
|
6
|
-
*
|
|
7
|
-
* The kernel commits the receipt and updates permissions synchronously, so
|
|
8
|
-
* the dialog closes in the task that handled the click. Storage is written
|
|
9
|
-
* one task later, still ahead of the request, and the request runs after:
|
|
10
|
-
* its outcome never reopens the dialog, and a failed request stays queued
|
|
11
|
-
* for replay by the kernel. A save that recorded nothing (an unchanged
|
|
12
|
-
* selection) closes when it resolves successfully, unless explicit
|
|
13
|
-
* navigation or a newer action came first.
|
|
14
|
-
*/
|
|
15
|
-
export declare const saveConsentUI: (kernel: ConsentKernel, save: () => Promise<SaveResult>, canClose: () => boolean) => Promise<SaveResult>;
|
|
16
|
-
/**
|
|
17
|
-
* Close an IAB surface in the task that handled the click.
|
|
18
|
-
*
|
|
19
|
-
* An IAB choice commits once its TC string is encoded, which can wait on the
|
|
20
|
-
* TCF library chunk but never on the backend. The surface closes first and
|
|
21
|
-
* comes back only when that local step recorded nothing (the vendor list
|
|
22
|
-
* failed to load, or the policy changed underneath), so the visitor can try
|
|
23
|
-
* again. A failed backend request never reopens it.
|
|
24
|
-
*/
|
|
25
|
-
export declare const saveIABConsentUI: (kernel: ConsentKernel, save: () => Promise<void> | void) => Promise<void>;
|