@c15t/react 2.2.1 → 3.0.0-alpha.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/AGENTS.md +89 -141
- package/README.md +2 -2
- package/dist/aggregate-components.js +2 -0
- package/dist/chunk-warming.js +1 -0
- package/dist/component-hooks/use-headless-consent-ui.js +2 -0
- package/dist/component-hooks/use-headless-iab-consent-ui.js +2 -0
- package/dist/component-hooks/use-manager.js +2 -0
- package/dist/component-hooks/use-panel-trigger.js +2 -0
- package/dist/component-hooks/use-translations.js +2 -0
- package/dist/components/consent-preferences-link/consent-preferences-link.js +2 -1
- package/dist/components/consent-preferences-link/index.js +1 -0
- package/dist/components/frame/atoms.js +1 -1
- package/dist/components/frame/frame.js +2 -1
- package/dist/components/frame/index.js +2 -1
- package/dist/components/iab-panel/atoms/card.js +2 -0
- package/dist/components/iab-panel/atoms/content.js +2 -0
- package/dist/components/iab-panel/atoms/footer.js +2 -0
- package/dist/components/iab-panel/atoms/header.js +2 -0
- package/dist/components/iab-panel/atoms/overlay.js +2 -0
- package/dist/components/iab-panel/atoms/purpose-item.js +2 -0
- package/dist/components/iab-panel/atoms/root.js +2 -0
- package/dist/components/iab-panel/atoms/stack-item.js +2 -0
- package/dist/components/iab-panel/atoms/tabs.js +2 -0
- package/dist/components/iab-panel/atoms/vendor-list.js +2 -0
- package/dist/components/iab-panel/hooks/use-display-model.js +2 -0
- package/dist/components/iab-panel/hooks/use-gvl-data.js +2 -0
- package/dist/components/iab-panel/iab-panel.js +2 -0
- package/dist/components/iab-panel/index.js +2 -0
- package/dist/components/iab-panel/use-iab-translations.js +1 -0
- package/dist/components/iab-prompt/atoms/button-group.js +2 -0
- package/dist/components/iab-prompt/atoms/card.js +2 -0
- package/dist/components/iab-prompt/atoms/description.js +2 -0
- package/dist/components/iab-prompt/atoms/footer.js +2 -0
- package/dist/components/iab-prompt/atoms/header.js +2 -0
- package/dist/components/iab-prompt/atoms/overlay.js +2 -0
- package/dist/components/iab-prompt/atoms/root.js +2 -0
- package/dist/components/iab-prompt/atoms/title.js +2 -0
- package/dist/components/iab-prompt/iab-prompt.js +2 -0
- package/dist/components/iab-prompt/index.js +2 -0
- package/dist/components/panel/atoms/card.js +2 -0
- package/dist/components/panel/atoms/overlay.js +1 -0
- package/dist/components/panel/atoms/root.js +2 -0
- package/dist/components/panel/index.js +2 -0
- package/dist/components/panel/panel.js +2 -0
- package/dist/components/{consent-dialog-link → panel-link}/index.js +1 -0
- package/dist/components/panel-trigger/atoms/button.js +2 -0
- package/dist/components/panel-trigger/atoms/icon.js +2 -0
- package/dist/components/panel-trigger/atoms/root.js +2 -0
- package/dist/components/panel-trigger/atoms/text.js +2 -0
- package/dist/components/panel-trigger/atoms/toolbar.js +2 -0
- package/dist/components/panel-trigger/index.js +2 -0
- package/dist/components/panel-trigger/panel-trigger-toolbar.js +2 -0
- package/dist/components/panel-trigger/panel-trigger.js +2 -0
- package/dist/components/panel-trigger/use-draggable.js +2 -0
- package/dist/components/preferences/atoms/accordion.js +1 -0
- package/dist/components/preferences/atoms/button.js +1 -0
- package/dist/components/preferences/atoms/footer.js +1 -0
- package/dist/components/preferences/atoms/root.js +2 -0
- package/dist/components/preferences/index.js +2 -0
- package/dist/components/preferences/policy-actions.js +2 -0
- package/dist/components/preferences/preferences.js +2 -0
- package/dist/components/prompt/atoms/overlay.js +1 -0
- package/dist/components/prompt/atoms/root.js +2 -0
- package/dist/components/prompt/components.js +1 -0
- package/dist/components/prompt/error-boundary.js +2 -0
- package/dist/components/prompt/index.js +2 -0
- package/dist/components/prompt/policy-actions.js +2 -0
- package/dist/components/prompt/prompt.js +2 -0
- package/dist/components/prompt/resolve-banner-primary-actions.js +1 -0
- package/dist/components/prompt/surface-context.js +2 -0
- package/dist/components/prompt/use-banner-copy.js +2 -0
- package/dist/components/shared/libs/recursive-clone-children.js +1 -1
- package/dist/components/shared/libs/slot.js +1 -1
- package/dist/components/shared/libs/use-controllable-state.js +1 -1
- package/dist/components/shared/policy-actions.js +2 -1
- package/dist/components/shared/primitives/box.js +2 -1
- package/dist/components/shared/primitives/button.js +1 -1
- package/dist/components/shared/primitives/legal-links/index.js +1 -1
- package/dist/components/shared/ui/accordion/accordion.js +2 -1
- package/dist/components/shared/ui/animated-collapse/animated-collapse.js +2 -1
- package/dist/components/shared/ui/branding.js +1 -1
- package/dist/components/shared/ui/button/button.js +1 -1
- package/dist/components/shared/ui/collapsible/collapsible.js +2 -1
- package/dist/components/shared/ui/dialog/dialog.js +2 -1
- package/dist/components/shared/ui/icon.js +1 -1
- package/dist/components/shared/ui/logo.js +1 -1
- package/dist/components/shared/ui/preference-item/preference-item.js +2 -1
- package/dist/components/shared/ui/switch/switch.js +1 -1
- package/dist/components/shared/ui/tabs/tabs.js +2 -1
- package/dist/context/consent-tracking-context.js +1 -0
- package/dist/context/iab-context-value.js +1 -0
- package/dist/context/index.js +1 -0
- package/dist/context/theme-context.js +2 -1
- package/dist/context.js +1 -0
- package/dist/devtools.js +2 -0
- package/dist/draft.js +2 -0
- package/dist/external-iab-context.js +2 -0
- package/dist/frame.js +2 -0
- package/dist/headless.js +1 -1
- package/dist/hooks/use-color-scheme.js +2 -1
- package/dist/hooks/use-component-config.js +2 -1
- package/dist/hooks/use-focus-trap.js +2 -1
- package/dist/hooks/use-headless-iab-consent-ui.js +2 -1
- package/dist/hooks/use-iab-manager.js +2 -0
- package/dist/hooks/use-is-hydrated.js +2 -0
- package/dist/hooks/use-reduced-motion.js +2 -1
- package/dist/hooks/use-scroll-lock.js +2 -1
- package/dist/hooks/use-text-direction.js +2 -1
- package/dist/hooks/use-theme.js +2 -1
- package/dist/hooks.js +1 -0
- package/dist/iab/styles.css +1 -1
- package/dist/iab/styles.tw3.css +27 -19
- package/dist/iab-context.js +2 -0
- package/dist/iab.js +1 -1
- package/dist/index.js +1 -1
- package/dist/module-hooks/iframe-blocker.js +2 -0
- package/dist/module-hooks/network-blocker.js +2 -0
- package/dist/module-hooks/persistence.js +2 -0
- package/dist/module-hooks/script-loader.js +2 -0
- package/dist/module-hooks/shared.js +2 -0
- package/dist/module-hooks.js +2 -0
- package/dist/panel-link.js +2 -0
- package/dist/panel-trigger.js +2 -0
- package/dist/panel.js +2 -0
- package/dist/preferences.js +2 -0
- package/dist/primitives.js +1 -1
- package/dist/prompt.js +2 -0
- package/dist/provider.js +2 -0
- package/dist/server/fetch-ssr-data.js +1 -1
- package/dist/server/headers.js +1 -1
- package/dist/server/init-cache-key.js +1 -1
- package/dist/server/normalize-url.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.tw3.css +67 -29
- package/dist/theme-provider.js +2 -0
- package/dist/transports/offline.js +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/theme/index.js +1 -1
- package/dist/types/theme/style-types.js +1 -1
- package/dist/ui-config-context.js +2 -0
- package/dist/ui-save.js +1 -0
- package/dist/utils/cn.js +1 -1
- package/dist/utils/default-translation-config.js +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/merge-slot-props.js +1 -0
- package/dist/utils/merge-styles.js +1 -1
- package/dist/utils/theme-utils.js +1 -1
- package/dist/version.js +1 -1
- package/dist-types/aggregate-components.d.ts +4 -0
- package/dist-types/chunk-warming.d.ts +19 -0
- package/dist-types/component-hooks/use-headless-consent-ui.d.ts +68 -0
- package/dist-types/component-hooks/use-headless-iab-consent-ui.d.ts +22 -0
- package/dist-types/component-hooks/use-manager.d.ts +40 -0
- package/dist-types/component-hooks/use-panel-trigger.d.ts +20 -0
- package/dist-types/component-hooks/use-translations.d.ts +2 -0
- package/dist-types/components/consent-preferences-link/consent-preferences-link.d.ts +1 -1
- package/dist-types/components/frame/atoms.d.ts +5 -5
- package/dist-types/components/frame/types.d.ts +3 -2
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/card.d.ts +2 -1
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/content.d.ts +1 -1
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/footer.d.ts +1 -1
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/header.d.ts +1 -1
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/overlay.d.ts +1 -1
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/purpose-item.d.ts +7 -1
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/root.d.ts +3 -2
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/stack-item.d.ts +1 -1
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/tabs.d.ts +1 -1
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/vendor-list.d.ts +2 -3
- package/dist-types/components/iab-panel/hooks/use-display-model.d.ts +18 -0
- package/dist-types/components/iab-panel/hooks/use-gvl-data.d.ts +17 -0
- package/dist-types/components/{iab-consent-dialog/iab-consent-dialog.d.ts → iab-panel/iab-panel.d.ts} +10 -3
- package/dist-types/components/{iab-consent-dialog → iab-panel}/index.d.ts +3 -2
- package/dist-types/components/iab-panel/types.d.ts +1 -0
- package/dist-types/components/{iab-consent-dialog → iab-panel}/use-iab-translations.d.ts +3 -1
- package/dist-types/components/{iab-consent-banner → iab-prompt}/atoms/button-group.d.ts +1 -1
- package/dist-types/components/{iab-consent-banner → iab-prompt}/atoms/card.d.ts +2 -1
- package/dist-types/components/{iab-consent-banner → iab-prompt}/atoms/description.d.ts +1 -1
- package/dist-types/components/{iab-consent-banner → iab-prompt}/atoms/footer.d.ts +2 -1
- package/dist-types/components/{iab-consent-banner → iab-prompt}/atoms/header.d.ts +2 -1
- package/dist-types/components/{iab-consent-banner → iab-prompt}/atoms/overlay.d.ts +1 -1
- package/dist-types/components/{iab-consent-banner → iab-prompt}/atoms/root.d.ts +3 -2
- package/dist-types/components/{iab-consent-banner → iab-prompt}/atoms/title.d.ts +1 -1
- package/dist-types/components/{iab-consent-banner/iab-consent-banner.d.ts → iab-prompt/iab-prompt.d.ts} +10 -4
- package/dist-types/components/{iab-consent-banner → iab-prompt}/index.d.ts +1 -1
- package/dist-types/components/{consent-dialog → panel}/atoms/card.d.ts +15 -15
- package/dist-types/components/{consent-dialog → panel}/atoms/overlay.d.ts +24 -8
- package/dist-types/components/{consent-dialog → panel}/atoms/root.d.ts +4 -3
- package/dist-types/components/{consent-dialog → panel}/index.d.ts +13 -8
- package/dist-types/components/{consent-dialog/consent-dialog.d.ts → panel/panel.d.ts} +6 -5
- package/dist-types/components/{consent-dialog-trigger → panel-trigger}/atoms/button.d.ts +2 -1
- package/dist-types/components/{consent-dialog-trigger → panel-trigger}/atoms/icon.d.ts +1 -16
- package/dist-types/components/{consent-dialog-trigger → panel-trigger}/atoms/root.d.ts +11 -23
- package/dist-types/components/{consent-dialog-trigger → panel-trigger}/atoms/text.d.ts +0 -11
- package/dist-types/components/{consent-dialog-trigger → panel-trigger}/atoms/toolbar.d.ts +15 -4
- package/dist-types/components/{consent-dialog-trigger → panel-trigger}/index.d.ts +2 -2
- package/dist-types/components/{consent-dialog-trigger/consent-dialog-trigger-toolbar.d.ts → panel-trigger/panel-trigger-toolbar.d.ts} +0 -23
- package/dist-types/components/{consent-dialog-trigger/consent-dialog-trigger.d.ts → panel-trigger/panel-trigger.d.ts} +8 -4
- package/dist-types/components/{consent-dialog-trigger → panel-trigger}/types.d.ts +16 -7
- package/dist-types/components/{consent-dialog-trigger → panel-trigger}/use-draggable.d.ts +2 -9
- package/dist-types/components/{consent-widget → preferences}/atoms/accordion.d.ts +5 -5
- package/dist-types/components/{consent-widget → preferences}/atoms/footer.d.ts +3 -3
- package/dist-types/components/{consent-widget → preferences}/atoms/root.d.ts +1 -1
- package/dist-types/components/{consent-widget → preferences}/index.d.ts +11 -9
- package/dist-types/components/preferences/policy-actions.d.ts +10 -0
- package/dist-types/components/{consent-banner → prompt}/atoms/overlay.d.ts +1 -1
- package/dist-types/components/prompt/atoms/root.d.ts +78 -0
- package/dist-types/components/{consent-banner → prompt}/components.d.ts +99 -14
- package/dist-types/components/{consent-banner → prompt}/error-boundary.d.ts +3 -1
- package/dist-types/components/{consent-banner → prompt}/index.d.ts +18 -10
- package/dist-types/components/prompt/policy-actions.d.ts +12 -0
- package/dist-types/components/{consent-banner/consent-banner.d.ts → prompt/prompt.d.ts} +36 -10
- package/dist-types/components/prompt/resolve-banner-primary-actions.d.ts +14 -0
- package/dist-types/components/prompt/surface-context.d.ts +45 -0
- package/dist-types/components/prompt/use-banner-copy.d.ts +16 -0
- package/dist-types/components/shared/libs/polymorphic.d.ts +2 -2
- package/dist-types/components/shared/libs/recursive-clone-children.d.ts +2 -2
- package/dist-types/components/shared/libs/slot.d.ts +1 -1
- package/dist-types/components/shared/libs/use-controllable-state.d.ts +1 -1
- package/dist-types/components/shared/policy-actions.d.ts +8 -3
- package/dist-types/components/shared/primitives/box.d.ts +3 -1
- package/dist-types/components/shared/primitives/button.d.ts +4 -37
- package/dist-types/components/shared/primitives/button.types.d.ts +3 -1
- package/dist-types/components/shared/primitives/legal-links/index.d.ts +7 -11
- package/dist-types/components/shared/ui/accordion/accordion.d.ts +45 -12
- package/dist-types/components/shared/ui/accordion/accordion.types.d.ts +1 -1
- package/dist-types/components/shared/ui/animated-collapse/animated-collapse.d.ts +1 -1
- package/dist-types/components/shared/ui/branding.d.ts +12 -12
- package/dist-types/components/shared/ui/button/button.d.ts +19 -25
- package/dist-types/components/shared/ui/button/button.types.d.ts +2 -2
- package/dist-types/components/shared/ui/collapsible/collapsible.d.ts +18 -1
- package/dist-types/components/shared/ui/dialog/dialog.d.ts +6 -6
- package/dist-types/components/shared/ui/icon.d.ts +1 -1
- package/dist-types/components/shared/ui/logo.d.ts +0 -21
- package/dist-types/components/shared/ui/preference-item/preference-item.d.ts +46 -2
- package/dist-types/components/shared/ui/switch/switch.d.ts +19 -8
- package/dist-types/components/shared/ui/tabs/tabs.d.ts +19 -2
- package/dist-types/context/iab-context-value.d.ts +37 -0
- package/dist-types/context/index.d.ts +3 -0
- package/dist-types/context/theme-context.d.ts +2 -2
- package/dist-types/context.d.ts +17 -0
- package/dist-types/devtools.d.ts +54 -0
- package/dist-types/draft.d.ts +31 -0
- package/dist-types/external-iab-context.d.ts +29 -0
- package/dist-types/frame.d.ts +1 -0
- package/dist-types/headless.d.ts +12 -8
- package/dist-types/hooks/use-color-scheme.d.ts +1 -1
- package/dist-types/hooks/use-component-config.d.ts +2 -2
- package/dist-types/hooks/use-focus-trap.d.ts +2 -2
- package/dist-types/hooks/use-headless-iab-consent-ui.d.ts +7 -8
- package/dist-types/hooks/use-iab-manager.d.ts +52 -0
- package/dist-types/hooks/use-is-hydrated.d.ts +8 -0
- package/dist-types/hooks/use-reduced-motion.d.ts +1 -1
- package/dist-types/hooks/use-scroll-lock.d.ts +1 -1
- package/dist-types/hooks/use-text-direction.d.ts +1 -1
- package/dist-types/hooks/use-theme.d.ts +2 -1
- package/dist-types/hooks.d.ts +148 -0
- package/dist-types/iab-context.d.ts +28 -0
- package/dist-types/iab.d.ts +14 -8
- package/dist-types/index.d.ts +61 -22
- package/dist-types/module-hooks/iframe-blocker.d.ts +6 -0
- package/dist-types/module-hooks/network-blocker.d.ts +9 -0
- package/dist-types/module-hooks/persistence.d.ts +4 -0
- package/dist-types/module-hooks/script-loader.d.ts +6 -0
- package/dist-types/module-hooks/shared.d.ts +2 -0
- package/dist-types/module-hooks.d.ts +4 -0
- package/dist-types/panel-link.d.ts +1 -0
- package/dist-types/panel-trigger.d.ts +1 -0
- package/dist-types/panel.d.ts +1 -0
- package/dist-types/preferences.d.ts +1 -0
- package/dist-types/prompt.d.ts +1 -0
- package/dist-types/provider.d.ts +149 -0
- package/dist-types/server/fetch-ssr-data.d.ts +2 -2
- package/dist-types/server/headers.d.ts +3 -3
- package/dist-types/server/init-cache-key.d.ts +3 -3
- package/dist-types/server/normalize-url.d.ts +2 -2
- package/dist-types/server/types.d.ts +1 -1
- package/dist-types/theme-provider.d.ts +10 -0
- package/dist-types/transports/offline.d.ts +18 -0
- package/dist-types/types/index.d.ts +3 -0
- package/dist-types/types/manager.d.ts +15 -0
- package/dist-types/types/slots.d.ts +5 -0
- package/dist-types/types/theme/index.d.ts +0 -1
- package/dist-types/types/theme/style-types.d.ts +3 -9
- package/dist-types/ui-config-context.d.ts +9 -0
- package/dist-types/ui-save.d.ts +5 -0
- package/dist-types/utils/cn.d.ts +1 -1
- package/dist-types/utils/default-translation-config.d.ts +6 -0
- package/dist-types/utils/index.d.ts +4 -0
- package/dist-types/utils/merge-slot-props.d.ts +14 -0
- package/dist-types/utils/merge-styles.d.ts +1 -1
- package/dist-types/utils/theme-utils.d.ts +2 -2
- package/dist-types/version.d.ts +1 -1
- package/docs/README.md +89 -141
- package/docs/assets/v3/brand-bar.png +0 -0
- package/docs/assets/v3/brand-card.png +0 -0
- package/docs/assets/v3/choice-wall.png +0 -0
- package/docs/assets/v3/mobile-card.png +0 -0
- package/docs/assets/v3/preferences.png +0 -0
- package/docs/customization/overview.md +45 -0
- package/docs/customization/recipes.md +79 -0
- package/docs/customization/slots.md +55 -0
- package/docs/customization/tokens.md +76 -0
- package/docs/customization/translations.md +49 -0
- package/docs/frameworks/react/components/consent-banner.md +219 -202
- package/docs/frameworks/react/components/consent-dialog-link.md +88 -35
- package/docs/frameworks/react/components/consent-dialog-trigger.md +74 -134
- package/docs/frameworks/react/components/consent-dialog.md +170 -135
- package/docs/frameworks/react/components/consent-manager-provider.md +57 -256
- package/docs/frameworks/react/components/consent-widget.md +154 -118
- package/docs/frameworks/react/components/dev-tools.md +198 -33
- package/docs/frameworks/react/components/frame.md +120 -42
- package/docs/frameworks/react/concepts/consent-categories.md +24 -89
- package/docs/frameworks/react/concepts/policy-presets.md +123 -0
- package/docs/frameworks/react/headless.md +91 -185
- package/docs/frameworks/react/hooks/use-consent-manager/overview.md +39 -153
- package/docs/frameworks/react/iab/overview.md +33 -108
- package/docs/frameworks/react/quickstart.md +116 -112
- package/docs/frameworks/react/script-loader.md +41 -533
- package/docs/frameworks/react/styling/overview.md +168 -253
- package/docs/frameworks/react/troubleshooting.md +47 -119
- package/docs/guides/consent-state.md +60 -0
- package/docs/guides/data-fetching.md +163 -0
- package/docs/guides/deployment-modes.md +63 -0
- package/docs/guides/troubleshooting.md +68 -0
- package/docs/guides/verify-consent.md +62 -0
- package/docs/integrations/adobe-analytics.md +239 -105
- package/docs/integrations/ahrefs-analytics.md +238 -104
- package/docs/integrations/amplitude.md +219 -157
- package/docs/integrations/building-integrations.md +32 -224
- package/docs/integrations/clear-on-revocation.md +167 -0
- package/docs/integrations/clearbit.md +247 -86
- package/docs/integrations/cloudflare-web-analytics.md +250 -84
- package/docs/integrations/crisp.md +251 -97
- package/docs/integrations/databuddy.md +259 -153
- package/docs/integrations/fathom-analytics.md +239 -96
- package/docs/integrations/google-maps.md +328 -207
- package/docs/integrations/google-tag-manager.md +248 -96
- package/docs/integrations/google-tag.md +261 -90
- package/docs/integrations/heap.md +222 -149
- package/docs/integrations/hightouch.md +225 -131
- package/docs/integrations/hotjar.md +239 -90
- package/docs/integrations/intercom.md +239 -98
- package/docs/integrations/linkedin-insights.md +243 -113
- package/docs/integrations/logrocket.md +241 -123
- package/docs/integrations/matomo-analytics.md +256 -111
- package/docs/integrations/meta-pixel.md +197 -324
- package/docs/integrations/microsoft-clarity.md +233 -114
- package/docs/integrations/microsoft-uet.md +245 -110
- package/docs/integrations/mixpanel-analytics.md +252 -87
- package/docs/integrations/openai-pixel.md +441 -0
- package/docs/integrations/overview.md +95 -133
- package/docs/integrations/pirsch.md +249 -96
- package/docs/integrations/plausible-analytics.md +241 -100
- package/docs/integrations/posthog.md +353 -214
- package/docs/integrations/promptwatch.md +251 -81
- package/docs/integrations/reddit-pixel.md +226 -173
- package/docs/integrations/rudderstack.md +244 -187
- package/docs/integrations/rybbit-analytics.md +244 -91
- package/docs/integrations/segment.md +238 -92
- package/docs/integrations/snapchat-pixel.md +240 -110
- package/docs/integrations/tiktok-pixel.md +249 -81
- package/docs/integrations/umami-analytics.md +242 -95
- package/docs/integrations/vercel-analytics.md +242 -90
- package/docs/integrations/x-pixel.md +238 -104
- package/docs/integrations/youtube.md +354 -142
- package/docs/upgrade-v3.md +334 -0
- package/iab/styles.css +1 -1
- package/iab/styles.tw3.css +1 -1
- package/package.json +187 -102
- package/readme.json +1 -1
- package/src/iab/styles.css +1 -1
- package/src/iab/styles.tw3.css +1 -1
- package/src/styles.css +1 -1
- package/src/styles.tw3.css +1 -1
- package/styles.css +1 -1
- package/styles.tw3.css +1 -1
- package/client/components/consent-banner.js +0 -4
- package/client/components/consent-dialog-link.js +0 -3
- package/client/components/consent-dialog-trigger.js +0 -3
- package/client/components/consent-dialog.js +0 -4
- package/client/components/consent-widget.js +0 -4
- package/client/components/frame.js +0 -3
- package/client/components/integrations.js +0 -3
- package/dist/components/consent-banner/atoms/overlay.cjs +0 -1
- package/dist/components/consent-banner/atoms/overlay.js +0 -1
- package/dist/components/consent-banner/atoms/root.cjs +0 -1
- package/dist/components/consent-banner/atoms/root.js +0 -1
- package/dist/components/consent-banner/components.cjs +0 -1
- package/dist/components/consent-banner/components.js +0 -1
- package/dist/components/consent-banner/consent-banner.cjs +0 -1
- package/dist/components/consent-banner/consent-banner.js +0 -1
- package/dist/components/consent-banner/error-boundary.cjs +0 -1
- package/dist/components/consent-banner/error-boundary.js +0 -1
- package/dist/components/consent-banner/index.cjs +0 -1
- package/dist/components/consent-banner/index.js +0 -1
- package/dist/components/consent-banner/policy-actions.cjs +0 -1
- package/dist/components/consent-banner/policy-actions.js +0 -1
- package/dist/components/consent-dialog/atoms/card.cjs +0 -1
- package/dist/components/consent-dialog/atoms/card.js +0 -1
- package/dist/components/consent-dialog/atoms/overlay.cjs +0 -1
- package/dist/components/consent-dialog/atoms/overlay.js +0 -1
- package/dist/components/consent-dialog/atoms/root.cjs +0 -1
- package/dist/components/consent-dialog/atoms/root.js +0 -1
- package/dist/components/consent-dialog/consent-dialog.cjs +0 -1
- package/dist/components/consent-dialog/consent-dialog.js +0 -1
- package/dist/components/consent-dialog/index.cjs +0 -1
- package/dist/components/consent-dialog/index.js +0 -1
- package/dist/components/consent-dialog-link/index.cjs +0 -1
- package/dist/components/consent-dialog-trigger/atoms/button.cjs +0 -1
- package/dist/components/consent-dialog-trigger/atoms/button.js +0 -1
- package/dist/components/consent-dialog-trigger/atoms/icon.cjs +0 -1
- package/dist/components/consent-dialog-trigger/atoms/icon.js +0 -1
- package/dist/components/consent-dialog-trigger/atoms/root.cjs +0 -1
- package/dist/components/consent-dialog-trigger/atoms/root.js +0 -1
- package/dist/components/consent-dialog-trigger/atoms/text.cjs +0 -1
- package/dist/components/consent-dialog-trigger/atoms/text.js +0 -1
- package/dist/components/consent-dialog-trigger/atoms/toolbar.cjs +0 -1
- package/dist/components/consent-dialog-trigger/atoms/toolbar.js +0 -1
- package/dist/components/consent-dialog-trigger/consent-dialog-trigger-toolbar.cjs +0 -1
- package/dist/components/consent-dialog-trigger/consent-dialog-trigger-toolbar.js +0 -1
- package/dist/components/consent-dialog-trigger/consent-dialog-trigger.cjs +0 -1
- package/dist/components/consent-dialog-trigger/consent-dialog-trigger.js +0 -1
- package/dist/components/consent-dialog-trigger/index.cjs +0 -1
- package/dist/components/consent-dialog-trigger/index.js +0 -1
- package/dist/components/consent-dialog-trigger/types.cjs +0 -1
- package/dist/components/consent-dialog-trigger/use-draggable.cjs +0 -1
- package/dist/components/consent-dialog-trigger/use-draggable.js +0 -1
- package/dist/components/consent-preferences-link/consent-preferences-link.cjs +0 -1
- package/dist/components/consent-preferences-link/index.cjs +0 -1
- package/dist/components/consent-widget/atoms/accordion.cjs +0 -1
- package/dist/components/consent-widget/atoms/accordion.js +0 -1
- package/dist/components/consent-widget/atoms/button.cjs +0 -1
- package/dist/components/consent-widget/atoms/button.js +0 -1
- package/dist/components/consent-widget/atoms/footer.cjs +0 -1
- package/dist/components/consent-widget/atoms/footer.js +0 -1
- package/dist/components/consent-widget/atoms/root.cjs +0 -1
- package/dist/components/consent-widget/atoms/root.js +0 -1
- package/dist/components/consent-widget/consent-widget.cjs +0 -1
- package/dist/components/consent-widget/consent-widget.js +0 -1
- package/dist/components/consent-widget/index.cjs +0 -1
- package/dist/components/consent-widget/index.js +0 -1
- package/dist/components/consent-widget/policy-actions.cjs +0 -1
- package/dist/components/consent-widget/policy-actions.js +0 -1
- package/dist/components/consent-widget/types.cjs +0 -1
- package/dist/components/frame/atoms.cjs +0 -1
- package/dist/components/frame/frame.cjs +0 -1
- package/dist/components/frame/index.cjs +0 -1
- package/dist/components/frame/types.cjs +0 -1
- package/dist/components/iab-consent-banner/atoms/button-group.cjs +0 -1
- package/dist/components/iab-consent-banner/atoms/button-group.js +0 -1
- package/dist/components/iab-consent-banner/atoms/card.cjs +0 -1
- package/dist/components/iab-consent-banner/atoms/card.js +0 -1
- package/dist/components/iab-consent-banner/atoms/description.cjs +0 -1
- package/dist/components/iab-consent-banner/atoms/description.js +0 -1
- package/dist/components/iab-consent-banner/atoms/footer.cjs +0 -1
- package/dist/components/iab-consent-banner/atoms/footer.js +0 -1
- package/dist/components/iab-consent-banner/atoms/header.cjs +0 -1
- package/dist/components/iab-consent-banner/atoms/header.js +0 -1
- package/dist/components/iab-consent-banner/atoms/overlay.cjs +0 -1
- package/dist/components/iab-consent-banner/atoms/overlay.js +0 -1
- package/dist/components/iab-consent-banner/atoms/root.cjs +0 -1
- package/dist/components/iab-consent-banner/atoms/root.js +0 -1
- package/dist/components/iab-consent-banner/atoms/title.cjs +0 -1
- package/dist/components/iab-consent-banner/atoms/title.js +0 -1
- package/dist/components/iab-consent-banner/iab-consent-banner.cjs +0 -1
- package/dist/components/iab-consent-banner/iab-consent-banner.js +0 -1
- package/dist/components/iab-consent-banner/index.cjs +0 -1
- package/dist/components/iab-consent-banner/index.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/card.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/card.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/content.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/content.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/footer.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/footer.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/header.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/header.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/overlay.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/overlay.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/purpose-item.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/purpose-item.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/root.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/root.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/stack-item.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/stack-item.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/tabs.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/tabs.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/vendor-list.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/vendor-list.js +0 -1
- package/dist/components/iab-consent-dialog/hooks/use-gvl-data.cjs +0 -1
- package/dist/components/iab-consent-dialog/hooks/use-gvl-data.js +0 -1
- package/dist/components/iab-consent-dialog/iab-consent-dialog.cjs +0 -1
- package/dist/components/iab-consent-dialog/iab-consent-dialog.js +0 -1
- package/dist/components/iab-consent-dialog/index.cjs +0 -1
- package/dist/components/iab-consent-dialog/index.js +0 -1
- package/dist/components/iab-consent-dialog/types.cjs +0 -1
- package/dist/components/iab-consent-dialog/use-iab-translations.cjs +0 -1
- package/dist/components/iab-consent-dialog/use-iab-translations.js +0 -1
- package/dist/components/integrations/google-map.cjs +0 -1
- package/dist/components/integrations/google-map.js +0 -1
- package/dist/components/integrations/index.cjs +0 -1
- package/dist/components/integrations/index.js +0 -1
- package/dist/components/integrations/shared.cjs +0 -1
- package/dist/components/integrations/shared.js +0 -1
- package/dist/components/integrations/youtube-embed.cjs +0 -1
- package/dist/components/integrations/youtube-embed.js +0 -1
- package/dist/components/shared/libs/polymorphic.cjs +0 -1
- package/dist/components/shared/libs/recursive-clone-children.cjs +0 -1
- package/dist/components/shared/libs/slot.cjs +0 -1
- package/dist/components/shared/libs/use-controllable-state.cjs +0 -1
- package/dist/components/shared/policy-actions.cjs +0 -1
- package/dist/components/shared/primitives/box.cjs +0 -1
- package/dist/components/shared/primitives/button.cjs +0 -1
- package/dist/components/shared/primitives/button.types.cjs +0 -1
- package/dist/components/shared/primitives/legal-links/index.cjs +0 -1
- package/dist/components/shared/ui/accordion/accordion.cjs +0 -1
- package/dist/components/shared/ui/accordion/accordion.types.cjs +0 -1
- package/dist/components/shared/ui/accordion/index.cjs +0 -1
- package/dist/components/shared/ui/animated-collapse/animated-collapse.cjs +0 -1
- package/dist/components/shared/ui/animated-collapse/index.cjs +0 -1
- package/dist/components/shared/ui/branding.cjs +0 -1
- package/dist/components/shared/ui/button/button.cjs +0 -1
- package/dist/components/shared/ui/button/button.types.cjs +0 -1
- package/dist/components/shared/ui/button/index.cjs +0 -1
- package/dist/components/shared/ui/collapsible/collapsible.cjs +0 -1
- package/dist/components/shared/ui/collapsible/index.cjs +0 -1
- package/dist/components/shared/ui/dialog/dialog.cjs +0 -1
- package/dist/components/shared/ui/dialog/index.cjs +0 -1
- package/dist/components/shared/ui/icon.cjs +0 -1
- package/dist/components/shared/ui/logo.cjs +0 -1
- package/dist/components/shared/ui/preference-item/index.cjs +0 -1
- package/dist/components/shared/ui/preference-item/preference-item.cjs +0 -1
- package/dist/components/shared/ui/switch/index.cjs +0 -1
- package/dist/components/shared/ui/switch/switch.cjs +0 -1
- package/dist/components/shared/ui/switch/switch.types.cjs +0 -1
- package/dist/components/shared/ui/tabs/index.cjs +0 -1
- package/dist/components/shared/ui/tabs/tabs.cjs +0 -1
- package/dist/context/consent-manager-context.cjs +0 -1
- package/dist/context/consent-manager-context.js +0 -1
- package/dist/context/consent-tracking-context.cjs +0 -1
- package/dist/context/theme-context.cjs +0 -1
- package/dist/headless.cjs +0 -1
- package/dist/hooks/index.cjs +0 -1
- package/dist/hooks/index.js +0 -1
- package/dist/hooks/use-color-scheme.cjs +0 -1
- package/dist/hooks/use-component-config.cjs +0 -1
- package/dist/hooks/use-consent-dialog-trigger.cjs +0 -1
- package/dist/hooks/use-consent-dialog-trigger.js +0 -1
- package/dist/hooks/use-consent-manager.cjs +0 -1
- package/dist/hooks/use-consent-manager.js +0 -1
- package/dist/hooks/use-consent-script.cjs +0 -1
- package/dist/hooks/use-consent-script.js +0 -1
- package/dist/hooks/use-focus-trap.cjs +0 -1
- package/dist/hooks/use-headless-consent-ui.cjs +0 -1
- package/dist/hooks/use-headless-consent-ui.js +0 -1
- package/dist/hooks/use-headless-iab-consent-ui.cjs +0 -1
- package/dist/hooks/use-reduced-motion.cjs +0 -1
- package/dist/hooks/use-scroll-lock.cjs +0 -1
- package/dist/hooks/use-ssr-status.cjs +0 -1
- package/dist/hooks/use-ssr-status.js +0 -1
- package/dist/hooks/use-styles.cjs +0 -1
- package/dist/hooks/use-styles.js +0 -1
- package/dist/hooks/use-text-direction.cjs +0 -1
- package/dist/hooks/use-theme.cjs +0 -1
- package/dist/hooks/use-translations.cjs +0 -1
- package/dist/hooks/use-translations.js +0 -1
- package/dist/iab.cjs +0 -1
- package/dist/index.cjs +0 -1
- package/dist/primitives/accordion.cjs +0 -1
- package/dist/primitives/button.cjs +0 -1
- package/dist/primitives/collapsible.cjs +0 -1
- package/dist/primitives/dialog.cjs +0 -1
- package/dist/primitives/preference-item.cjs +0 -1
- package/dist/primitives/switch.cjs +0 -1
- package/dist/primitives/tabs.cjs +0 -1
- package/dist/primitives.cjs +0 -1
- package/dist/providers/consent-manager-provider.cjs +0 -1
- package/dist/providers/consent-manager-provider.js +0 -1
- package/dist/server/fetch-ssr-data.cjs +0 -1
- package/dist/server/headers.cjs +0 -1
- package/dist/server/index.cjs +0 -1
- package/dist/server/init-cache-key.cjs +0 -1
- package/dist/server/normalize-url.cjs +0 -1
- package/dist/server/types.cjs +0 -1
- package/dist/types/consent-manager.cjs +0 -1
- package/dist/types/theme/index.cjs +0 -1
- package/dist/types/theme/style-keys.cjs +0 -1
- package/dist/types/theme/style-types.cjs +0 -1
- package/dist/utils/cn.cjs +0 -1
- package/dist/utils/merge-styles.cjs +0 -1
- package/dist/utils/test-helpers.cjs +0 -1
- package/dist/utils/test-helpers.js +0 -1
- package/dist/utils/theme-utils.cjs +0 -1
- package/dist/version.cjs +0 -1
- package/dist-types/components/consent-banner/atoms/root.d.ts +0 -126
- package/dist-types/components/consent-banner/policy-actions.d.ts +0 -11
- package/dist-types/components/consent-widget/policy-actions.d.ts +0 -11
- package/dist-types/components/iab-consent-dialog/hooks/use-gvl-data.d.ts +0 -27
- package/dist-types/components/iab-consent-dialog/types.d.ts +0 -72
- package/dist-types/components/integrations/google-map.d.ts +0 -82
- package/dist-types/components/integrations/index.d.ts +0 -2
- package/dist-types/components/integrations/shared.d.ts +0 -12
- package/dist-types/components/integrations/youtube-embed.d.ts +0 -95
- package/dist-types/context/consent-manager-context.d.ts +0 -31
- package/dist-types/hooks/index.d.ts +0 -12
- package/dist-types/hooks/use-consent-dialog-trigger.d.ts +0 -10
- package/dist-types/hooks/use-consent-manager.d.ts +0 -27
- package/dist-types/hooks/use-consent-script.d.ts +0 -80
- package/dist-types/hooks/use-headless-consent-ui.d.ts +0 -46
- package/dist-types/hooks/use-ssr-status.d.ts +0 -57
- package/dist-types/hooks/use-styles.d.ts +0 -21
- package/dist-types/hooks/use-translations.d.ts +0 -28
- package/dist-types/providers/consent-manager-provider.d.ts +0 -40
- package/dist-types/types/consent-manager.d.ts +0 -39
- package/dist-types/types/theme/style-keys.d.ts +0 -1
- package/dist-types/utils/test-helpers.d.ts +0 -31
- package/docs/frameworks/react/building-headless-components.md +0 -370
- package/docs/frameworks/react/callbacks.md +0 -186
- package/docs/frameworks/react/concepts/client-modes.md +0 -177
- package/docs/frameworks/react/concepts/consent-models.md +0 -113
- package/docs/frameworks/react/concepts/cookie-management.md +0 -122
- package/docs/frameworks/react/concepts/glossary.md +0 -24
- package/docs/frameworks/react/concepts/initialization-flow.md +0 -149
- package/docs/frameworks/react/concepts/policy-packs.md +0 -228
- package/docs/frameworks/react/hooks/use-color-scheme.md +0 -41
- package/docs/frameworks/react/hooks/use-consent-manager/checking-consent.md +0 -96
- package/docs/frameworks/react/hooks/use-consent-manager/location-info.md +0 -97
- package/docs/frameworks/react/hooks/use-consent-manager/setting-consent.md +0 -94
- package/docs/frameworks/react/hooks/use-draggable.md +0 -59
- package/docs/frameworks/react/hooks/use-focus-trap.md +0 -42
- package/docs/frameworks/react/hooks/use-reduced-motion.md +0 -37
- package/docs/frameworks/react/hooks/use-ssr-status.md +0 -32
- package/docs/frameworks/react/hooks/use-text-direction.md +0 -50
- package/docs/frameworks/react/hooks/use-translations.md +0 -55
- package/docs/frameworks/react/iab/consent-banner.md +0 -91
- package/docs/frameworks/react/iab/consent-dialog.md +0 -129
- package/docs/frameworks/react/iab/use-gvl-data.md +0 -21
- package/docs/frameworks/react/iframe-blocking.md +0 -106
- package/docs/frameworks/react/internationalization.md +0 -207
- package/docs/frameworks/react/network-blocker.md +0 -140
- package/docs/frameworks/react/optimization.md +0 -148
- package/docs/frameworks/react/policy-packs.md +0 -242
- package/docs/frameworks/react/server-side.md +0 -158
- package/docs/frameworks/react/styling/classnames.md +0 -94
- package/docs/frameworks/react/styling/color-scheme.md +0 -84
- package/docs/frameworks/react/styling/css-variables.md +0 -53
- package/docs/frameworks/react/styling/slots.md +0 -94
- package/docs/frameworks/react/styling/tailwind.md +0 -119
- package/docs/frameworks/react/styling/tokens.md +0 -156
- package/docs/shared/concepts/client-modes.md +0 -103
- package/docs/shared/concepts/consent-categories.md +0 -41
- package/docs/shared/concepts/consent-models.md +0 -72
- package/docs/shared/concepts/cookie-management.md +0 -88
- package/docs/shared/concepts/glossary.md +0 -24
- package/docs/shared/concepts/initialization-flow.md +0 -105
- package/docs/shared/concepts/policy-packs.md +0 -225
- package/docs/shared/react/components/consent-banner.md +0 -242
- package/docs/shared/react/components/consent-dialog-link.md +0 -45
- package/docs/shared/react/components/consent-dialog-trigger.md +0 -185
- package/docs/shared/react/components/consent-dialog.md +0 -119
- package/docs/shared/react/components/consent-manager-provider.md +0 -225
- package/docs/shared/react/components/consent-widget.md +0 -121
- package/docs/shared/react/components/dev-tools.md +0 -81
- package/docs/shared/react/components/frame.md +0 -52
- package/docs/shared/react/guides/building-headless-components.md +0 -110
- package/docs/shared/react/guides/callbacks.md +0 -89
- package/docs/shared/react/guides/headless.md +0 -31
- package/docs/shared/react/guides/iframe-blocking.md +0 -65
- package/docs/shared/react/guides/internationalization.md +0 -123
- package/docs/shared/react/guides/network-blocker.md +0 -72
- package/docs/shared/react/guides/optimization.md +0 -44
- package/docs/shared/react/guides/policy-packs.md +0 -173
- package/docs/shared/react/guides/script-loader.md +0 -311
- package/docs/shared/react/hooks/use-color-scheme.md +0 -31
- package/docs/shared/react/hooks/use-consent-manager/checking-consent.md +0 -95
- package/docs/shared/react/hooks/use-consent-manager/location-info.md +0 -96
- package/docs/shared/react/hooks/use-consent-manager/overview.md +0 -74
- package/docs/shared/react/hooks/use-consent-manager/setting-consent.md +0 -93
- package/docs/shared/react/hooks/use-draggable.md +0 -30
- package/docs/shared/react/hooks/use-focus-trap.md +0 -20
- package/docs/shared/react/hooks/use-reduced-motion.md +0 -33
- package/docs/shared/react/hooks/use-ssr-status.md +0 -16
- package/docs/shared/react/hooks/use-text-direction.md +0 -38
- package/docs/shared/react/hooks/use-translations.md +0 -15
- package/docs/shared/react/iab/consent-banner.md +0 -60
- package/docs/shared/react/iab/consent-dialog.md +0 -76
- package/docs/shared/react/iab/overview.md +0 -80
- package/docs/shared/react/iab/use-gvl-data.md +0 -21
- package/docs/shared/react/styling/classnames.md +0 -93
- package/docs/shared/react/styling/color-scheme.md +0 -35
- package/docs/shared/react/styling/css-variables.md +0 -53
- package/docs/shared/react/styling/overview.md +0 -261
- package/docs/shared/react/styling/slots.md +0 -93
- package/docs/shared/react/styling/stylesheet-entrypoint.md +0 -8
- package/docs/shared/react/styling/tailwind.md +0 -88
- package/docs/shared/react/styling/tokens.md +0 -155
- package/docs/shared/troubleshooting.md +0 -82
- /package/dist/components/{consent-dialog-trigger → iab-panel}/types.js +0 -0
- /package/dist/components/{consent-widget → panel-trigger}/types.js +0 -0
- /package/dist/components/{iab-consent-dialog → preferences}/types.js +0 -0
- /package/dist/types/{consent-manager.js → manager.js} +0 -0
- /package/dist/types/{theme/style-keys.js → slots.js} +0 -0
- /package/dist-types/components/{consent-dialog-link → panel-link}/index.d.ts +0 -0
- /package/dist-types/components/{consent-widget → preferences}/atoms/button.d.ts +0 -0
- /package/dist-types/components/{consent-widget/consent-widget.d.ts → preferences/preferences.d.ts} +0 -0
- /package/dist-types/components/{consent-widget → preferences}/types.d.ts +0 -0
|
@@ -4,61 +4,227 @@ description: A development tool for inspecting consent state, geolocation,
|
|
|
4
4
|
loaded scripts, and consent events in real time.
|
|
5
5
|
group: frameworks
|
|
6
6
|
---
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
`DevTools` is a floating panel for the c15t v3 kernel. Use it during development to inspect consent values, scripts, location, the resolved policy, IAB state, events, and consent actions. The framework adapter reads the kernel from the nearest v3 provider. It never discovers a store through a window global.
|
|
8
9
|
|
|
9
10
|
> ⚠️ **Warning:**
|
|
10
|
-
> DevTools
|
|
11
|
+
> Load DevTools only in development. A conditional JSX expression stops it from mounting in production, but a static import can still add DevTools to the production bundle. Use a development-only dynamic import as shown below. The component renders nothing into the React tree and mounts its panel in document.body.
|
|
11
12
|
|
|
12
13
|
## Installation
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
```
|
|
15
|
+
No extra package is required for a framework adapter. The adapter and its
|
|
16
|
+
engine are included with the `c15t` package and the dedicated
|
|
17
|
+
`@c15t/svelte` adapter. Install `@c15t/dev-tools` directly only
|
|
18
|
+
when you need the imperative `createDevTools({ kernel })` API.
|
|
19
19
|
|
|
20
20
|
## Usage
|
|
21
21
|
|
|
22
|
+
This example uses Vite's `import.meta.env.DEV` build-time flag. For another
|
|
23
|
+
bundler, use its development flag instead. For example, webpack projects can
|
|
24
|
+
use a configured `process.env.NODE_ENV === 'development'` replacement;
|
|
25
|
+
`process` is not a browser global.
|
|
26
|
+
|
|
22
27
|
```tsx
|
|
23
|
-
import { type ReactNode } from 'react';
|
|
24
|
-
import {
|
|
25
|
-
|
|
28
|
+
import { lazy, Suspense, type ReactNode } from 'react';
|
|
29
|
+
import { ConsentProvider, hosted } from 'c15t/react';
|
|
30
|
+
|
|
31
|
+
const DevTools =
|
|
32
|
+
import.meta.env.DEV
|
|
33
|
+
? lazy(() =>
|
|
34
|
+
import('c15t/react/devtools').then(({ DevTools }) => ({ default: DevTools })),
|
|
35
|
+
)
|
|
36
|
+
: () => null;
|
|
26
37
|
|
|
27
38
|
export function ConsentManager({ children }: { children: ReactNode }) {
|
|
28
39
|
return (
|
|
29
|
-
<
|
|
40
|
+
<ConsentProvider options={{ mode: hosted({ url: 'https://your-instance.c15t.dev' }) }}>
|
|
30
41
|
{children}
|
|
31
|
-
|
|
32
|
-
|
|
42
|
+
<Suspense fallback={null}>
|
|
43
|
+
<DevTools />
|
|
44
|
+
</Suspense>
|
|
45
|
+
</ConsentProvider>
|
|
33
46
|
);
|
|
34
47
|
}
|
|
35
48
|
```
|
|
36
49
|
|
|
50
|
+
Import the adapter from `c15t/react/devtools` when you use the umbrella package, or `c15t/react/devtools` when you install the React package directly. `@c15t/dev-tools` exports the imperative engine, not the React component.
|
|
51
|
+
|
|
52
|
+
If the CLI cannot identify your bundler's development flag, it generates
|
|
53
|
+
`const DevTools = false` with a setup comment. Replace `false` with your
|
|
54
|
+
configured build-time development flag to enable the panel. The fallback keeps
|
|
55
|
+
DevTools disabled instead of assuming browser globals or loading it in production.
|
|
56
|
+
|
|
37
57
|
## Configuration
|
|
38
58
|
|
|
39
59
|
```tsx
|
|
40
60
|
<DevTools
|
|
41
|
-
position="bottom-right"
|
|
42
|
-
defaultOpen={false}
|
|
43
|
-
|
|
44
|
-
|
|
61
|
+
position="bottom-right"
|
|
62
|
+
defaultOpen={false}
|
|
63
|
+
defaultTab="consents"
|
|
64
|
+
maxEvents={100}
|
|
65
|
+
disabled={false}
|
|
45
66
|
/>
|
|
46
67
|
```
|
|
47
68
|
|
|
69
|
+
`position` accepts any corner: `top-left`, `top-right`, `bottom-left`, or
|
|
70
|
+
`bottom-right`. Set `defaultOpen` to open the initial panel and `defaultTab`
|
|
71
|
+
to choose that panel. `maxEvents` limits captured kernel and script events.
|
|
72
|
+
Set `disabled` to prevent mounting without removing the component.
|
|
73
|
+
|
|
48
74
|
## Panels
|
|
49
75
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
76
|
+
Accept and reject apply only to categories displayed by the provider, leaving
|
|
77
|
+
hidden consent values unchanged. `necessary` always remains enabled. Svelte
|
|
78
|
+
and Vue adapters use their provider's displayed categories; the kernel and
|
|
79
|
+
React adapter use the current policy categories by default.
|
|
80
|
+
|
|
81
|
+
For an imperative integration with a narrower UI, pass
|
|
82
|
+
`getConsentCategories: () => ['necessary', 'measurement']` to
|
|
83
|
+
`createDevTools`. The getter is read again when an action runs. Headless UI
|
|
84
|
+
actions can use `kernel.commands.save('all', { categories: displayed })` or
|
|
85
|
+
`kernel.commands.save('none', { categories: displayed })`. These scoped bulk
|
|
86
|
+
saves use a `custom` transport action when they cover only part of the policy.
|
|
87
|
+
Actions covering the whole policy retain `all` or `necessary`. Without an
|
|
88
|
+
explicit scope or policy categories, bulk saves cover all known categories.
|
|
89
|
+
|
|
90
|
+
| Panel | What it shows |
|
|
91
|
+
| ------------ | -------------------------------------------------------------------------------------------- |
|
|
92
|
+
| **Consents** | Inspect and save categories, accept all, or reject optional categories |
|
|
93
|
+
| **Scripts** | Configured scripts, loading status, search, and external page resources |
|
|
94
|
+
| **Location** | Detected jurisdiction, country, region, and consent model |
|
|
95
|
+
| **Policy** | Resolved policy and UI configuration |
|
|
96
|
+
| **IAB** | Edit vendors, purposes, legitimate interests, and special features; save and copy TC strings |
|
|
97
|
+
| **Events** | Timeline of consent changes, kernel events, and script lifecycle events |
|
|
98
|
+
| **Actions** | Show the banner, open preferences, hide consent UI, or refresh consent data |
|
|
99
|
+
|
|
100
|
+
### Script inspection
|
|
101
|
+
|
|
102
|
+
Set `defaultTab="scripts"` to open script inspection first. It reads all script
|
|
103
|
+
loaders attached to the current provider's kernel, including loaders created
|
|
104
|
+
before DevTools mounts. Search by script ID, category, URL, or status, then
|
|
105
|
+
expand a script to inspect its configuration and latest lifecycle event.
|
|
106
|
+
|
|
107
|
+
`loading` means an external script was inserted; `loaded` means its browser
|
|
108
|
+
load event fired, or an inline script or callback-only integration mounted.
|
|
109
|
+
`error` reports a loader error. `blocked` means consent requirements were not
|
|
110
|
+
met, and `pending` means an eligible script has not mounted. `present` means
|
|
111
|
+
the loader reused an element without a confirmed load result. `retained`
|
|
112
|
+
means consent was revoked but `persistAfterConsentRevoked` kept the element.
|
|
113
|
+
Retained scripts still receive `onConsentChange` with `hasConsent: false`, so
|
|
114
|
+
their integrations can send the vendor's consent-revocation command.
|
|
115
|
+
`alwaysLoad` bypasses the loading gate, not consent: callbacks receive the
|
|
116
|
+
actual consent state and updates across categories for integrations such as
|
|
117
|
+
Google Consent Mode.
|
|
118
|
+
|
|
119
|
+
Script details distinguish `allowedToLoad` from `consentGranted`. An
|
|
120
|
+
`alwaysLoad` integration can be allowed to load while its consent is denied.
|
|
121
|
+
Diagnostics expose these as `eligible` and `hasConsent`, respectively.
|
|
122
|
+
|
|
123
|
+
Lifecycle diagnostics work even when legacy debug forwarding is disabled.
|
|
124
|
+
The page scan lists external scripts and iframes present in the
|
|
125
|
+
DOM; it does not prove that they loaded successfully or were consent-gated.
|
|
126
|
+
|
|
127
|
+
For custom inspection tools, import `getScriptDiagnostics(kernel)` and
|
|
128
|
+
`subscribeScriptDiagnostics(kernel, listener)` from
|
|
129
|
+
`c15t/modules/script-loader`. The subscription reports loader
|
|
130
|
+
registration, updates, disposal, and lifecycle events. Read a fresh snapshot
|
|
131
|
+
after changes and call the returned unsubscribe function during cleanup.
|
|
132
|
+
|
|
133
|
+
### IAB editing
|
|
134
|
+
|
|
135
|
+
Under an IAB policy, the Consents tab is read-only. Edit and save vendors
|
|
136
|
+
and purposes in the IAB tab so the derived categories and TC string stay
|
|
137
|
+
consistent.
|
|
138
|
+
|
|
139
|
+
The IAB panel connects to the existing `@c15t/iab` module attached to the
|
|
140
|
+
provider's kernel. It does not create a second CMP or replace `__tcfapi`.
|
|
141
|
+
Controls become available after initialization, when the current policy uses
|
|
142
|
+
IAB and the vendor list is loaded.
|
|
143
|
+
|
|
144
|
+
Choose Vendors, Purposes, or Special features, then search by name or ID.
|
|
145
|
+
Vendors include the provider's custom vendors. Long lists show 20 entries per
|
|
146
|
+
page. Legitimate-interest controls appear for declared legitimate interests.
|
|
147
|
+
Search only filters the view; Accept all IAB and Reject all IAB apply to the
|
|
148
|
+
configured choices, including custom vendors.
|
|
149
|
+
|
|
150
|
+
Toggles update live IAB state and script gating immediately. Use Save IAB
|
|
151
|
+
consent to generate a fresh TC string and run the configured save transport.
|
|
152
|
+
The panel displays the last generated string; unsaved edits are not represented
|
|
153
|
+
in it. Copy TC string confirms success or reports clipboard failures. Raw IAB
|
|
154
|
+
data remains available in an expandable section.
|
|
155
|
+
|
|
156
|
+
IAB saves normally write the TC string to its standard cookie and localStorage.
|
|
157
|
+
For an in-memory playground, set `persistence: false` in the IAB module options
|
|
158
|
+
as well as disabling the provider's core persistence. The IAB option prevents
|
|
159
|
+
TC-string storage writes; it does not disable the configured save transport
|
|
160
|
+
or remove previously stored values.
|
|
161
|
+
|
|
162
|
+
Save and refresh actions show pending, success, and failure feedback. Controls
|
|
163
|
+
are disabled while a request is pending. A failed save does not roll back the
|
|
164
|
+
live choices; retry to record them.
|
|
165
|
+
|
|
166
|
+
For custom inspection tools, `getIABControls(kernel)` and
|
|
167
|
+
`subscribeIABControls(kernel, listener)` are exported from `c15t`.
|
|
168
|
+
The getter returns undefined before module initialization and after disposal.
|
|
169
|
+
A snapshot without an attached IAB module is read-only in DevTools.
|
|
170
|
+
|
|
171
|
+
## Vue and Svelte
|
|
172
|
+
|
|
173
|
+
Vue imports `ConsentDevTools` from `c15t/vue/devtools`.
|
|
174
|
+
Render it in the app where the c15t plugin provides
|
|
175
|
+
the kernel. In Nuxt, the configured c15t module provides that context.
|
|
176
|
+
|
|
177
|
+
```vue
|
|
178
|
+
<script setup lang="ts">
|
|
179
|
+
import { defineAsyncComponent } from 'vue';
|
|
180
|
+
|
|
181
|
+
const DevTools = import.meta.env.DEV
|
|
182
|
+
? defineAsyncComponent(() => import('c15t/vue/devtools'))
|
|
183
|
+
: null;
|
|
184
|
+
</script>
|
|
185
|
+
|
|
186
|
+
<template>
|
|
187
|
+
<DevTools v-if="DevTools" position="bottom-right" />
|
|
188
|
+
</template>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
In Nuxt, use `import.meta.dev` instead of `import.meta.env.DEV`.
|
|
192
|
+
Svelte imports the adapter from `@c15t/svelte/devtools` and renders it
|
|
193
|
+
inside `ConsentManagerProvider`.
|
|
194
|
+
|
|
195
|
+
```svelte
|
|
196
|
+
<script lang="ts">
|
|
197
|
+
import { ConsentManagerProvider, offline } from '@c15t/svelte';
|
|
198
|
+
|
|
199
|
+
const devTools = import.meta.env.DEV
|
|
200
|
+
? import('@c15t/svelte/devtools')
|
|
201
|
+
: null;
|
|
202
|
+
</script>
|
|
203
|
+
|
|
204
|
+
<ConsentManagerProvider options={{ mode: offline() }}>
|
|
205
|
+
{#if devTools}
|
|
206
|
+
{#await devTools then { ConsentDevTools }}
|
|
207
|
+
<ConsentDevTools position="bottom-right" />
|
|
208
|
+
{/await}
|
|
209
|
+
{/if}
|
|
210
|
+
</ConsentManagerProvider>
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Both adapters accept `position`, `defaultOpen`, `defaultTab`, `maxEvents`,
|
|
214
|
+
`shadow` (`false` renders into the page instead of a shadow root),
|
|
215
|
+
and `getConsentCategories`. Changing these presentation options recreates
|
|
216
|
+
the panel and clears its event history. They do not accept React's `disabled`
|
|
217
|
+
prop; conditionally render them instead. Unmounting removes the panel and
|
|
218
|
+
subscriptions without changing consent.
|
|
58
219
|
|
|
59
220
|
## TanStack Devtools
|
|
60
221
|
|
|
61
|
-
|
|
222
|
+
Each embedded panel owns its event history and subscriptions. Unmounting it
|
|
223
|
+
destroys the instance; remounting starts a new history. If you need to capture
|
|
224
|
+
events while switching plugins, keep the c15t panel mounted. This differs from
|
|
225
|
+
the old globally shared DevTools store.
|
|
226
|
+
|
|
227
|
+
The React v3 DevTools adapter exports a panel component and plugin factory that match TanStack Devtools' plugin API:
|
|
62
228
|
|
|
63
229
|
```tsx
|
|
64
230
|
import * as React from 'react';
|
|
@@ -66,7 +232,7 @@ import { useRouter } from '@tanstack/react-router';
|
|
|
66
232
|
import { TanStackDevtools } from '@tanstack/react-devtools';
|
|
67
233
|
import { ReactQueryDevtoolsPanel } from '@tanstack/react-query-devtools';
|
|
68
234
|
import { TanStackRouterDevtoolsPanel } from '@tanstack/react-router-devtools';
|
|
69
|
-
import { c15tDevtools } from '
|
|
235
|
+
import { c15tDevtools } from 'c15t/react/devtools';
|
|
70
236
|
|
|
71
237
|
export function AppDevtools() {
|
|
72
238
|
const router = useRouter();
|
|
@@ -89,11 +255,10 @@ export function AppDevtools() {
|
|
|
89
255
|
}
|
|
90
256
|
```
|
|
91
257
|
|
|
92
|
-
|
|
258
|
+
In a Next.js app, import `c15tDevtools` from `c15t/next/devtools` instead. Scoped installs use `@c15t/react/devtools` and `@c15t/nextjs/devtools`.
|
|
93
259
|
|
|
94
|
-
|
|
95
|
-
|:--|:--|
|
|
96
|
-
|Type Name|\`C15TDevToolsProps\`|
|
|
97
|
-
|Source Path|\`./packages/dev-tools/src/react.ts\`|
|
|
260
|
+
## Props
|
|
98
261
|
|
|
99
|
-
|
|
262
|
+
| Property | Type | Description | Default | Required |
|
|
263
|
+
| :------- | :------------------ | :------------------------------------------ | :------ | :------: |
|
|
264
|
+
| disabled | boolean \|undefined | Prevents the DevTools engine from mounting. | false | Optional |
|
|
@@ -1,72 +1,150 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Frame
|
|
3
|
-
description:
|
|
4
|
-
|
|
3
|
+
description: Gate a YouTube or map iframe behind consent with Frame in React,
|
|
4
|
+
showing a placeholder that opens the preference center until the category is
|
|
5
|
+
allowed.
|
|
5
6
|
group: frameworks
|
|
6
7
|
---
|
|
7
|
-
`Frame` conditionally renders its children based on consent state. When consent for the specified category is not granted, a placeholder is shown instead. Children are not mounted at all until consent is given, preventing any network requests or script execution.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Gate an embed behind consent
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
`Frame` mounts its children only while the effective permission for one
|
|
12
|
+
consent category is granted, and shows a placeholder otherwise. Wrap any
|
|
13
|
+
iframe or third-party widget that would set cookies or contact a vendor on
|
|
14
|
+
load. Render it anywhere inside the `ConsentProvider` from your
|
|
15
|
+
[quickstart](../quickstart.md), which also mounts the `ConsentDialog` the
|
|
16
|
+
placeholder button opens.
|
|
17
|
+
|
|
18
|
+
```tsx title="src/product-video.tsx"
|
|
19
|
+
import { Frame } from 'c15t/react';
|
|
13
20
|
|
|
14
|
-
function
|
|
21
|
+
export function ProductVideo() {
|
|
15
22
|
return (
|
|
16
|
-
<Frame category="marketing">
|
|
23
|
+
<Frame category="marketing" className="video-frame">
|
|
17
24
|
<iframe
|
|
18
|
-
src="https://www.youtube.com/embed/dQw4w9WgXcQ"
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ"
|
|
26
|
+
title="Product tour"
|
|
27
|
+
loading="lazy"
|
|
21
28
|
allowFullScreen
|
|
29
|
+
style={{ width: '100%', aspectRatio: '16 / 9', border: 0 }}
|
|
22
30
|
/>
|
|
23
31
|
</Frame>
|
|
24
32
|
);
|
|
25
33
|
}
|
|
26
34
|
```
|
|
27
35
|
|
|
28
|
-
|
|
36
|
+
`marketing` must be in your policy scope. If you set a non-empty
|
|
37
|
+
`options.consentCategories` list on `ConsentProvider`, include `marketing`
|
|
38
|
+
there too so the preference center can display and save it. `Frame` does
|
|
39
|
+
not add categories to that list.
|
|
40
|
+
|
|
41
|
+
The placeholder names the category using its title from your translations. Set `className` or `style`
|
|
42
|
+
on `Frame` to reserve the embed's space, so the page does not shift when the
|
|
43
|
+
placeholder is replaced.
|
|
44
|
+
|
|
45
|
+
## Props
|
|
46
|
+
|
|
47
|
+
| Prop | Type | Default | Description |
|
|
48
|
+
| ------------- | ----------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
49
|
+
| `category` | `AllConsentNames` | required | The consent category whose effective permission gates the children, for example `'marketing'` or `'functionality'`. |
|
|
50
|
+
| `children` | `ReactNode` | required | The embed. It is not mounted until the category is allowed, so it makes no requests before permission. |
|
|
51
|
+
| `placeholder` | `ReactNode` | built-in placeholder | Replaces the built-in title and button while the category is not allowed. Falsy values such as `null`, `false`, `0` and an empty string use the built-in placeholder. Pass an empty fragment, `<></>`, to render no placeholder content. |
|
|
52
|
+
|
|
53
|
+
Other `div` attributes such as `className`, `style` and `ref` apply to the
|
|
54
|
+
wrapper element that stays in the page in both states. `FrameProps` also
|
|
55
|
+
declares `noStyle` and `theme`, but the component does not apply them yet;
|
|
56
|
+
style the wrapper with `className` and theme the placeholder through the
|
|
57
|
+
provider `theme` option.
|
|
58
|
+
|
|
59
|
+
## Behavior
|
|
60
|
+
|
|
61
|
+
`Frame` renders a `div` wrapper. Inside it, when the effective permission for
|
|
62
|
+
`category` is granted, it renders the children; otherwise it renders the
|
|
63
|
+
placeholder. Permission is the same value `useConsent(category)` returns,
|
|
64
|
+
so it can be granted under an opt-out rule before the visitor records a
|
|
65
|
+
choice, and a recorded grant can be overridden by a privacy signal.
|
|
66
|
+
|
|
67
|
+
While effective permission is denied, the children are absent from the DOM,
|
|
68
|
+
so an iframe or a third-party widget inside `Frame` sends no requests. When the visitor later revokes it, the
|
|
69
|
+
children unmount and the embed disappears. `Frame` does not depend on the
|
|
70
|
+
network blocker or the iframe blocker modules; use those for markup you
|
|
71
|
+
cannot wrap in a component.
|
|
72
|
+
|
|
73
|
+
The built-in placeholder shows the title `frame.title`, "Accept {category}
|
|
74
|
+
consent to view this content.", with `{category}` replaced by
|
|
75
|
+
`consentTypes.<category>.title`, and a button labelled `frame.actionButton`,
|
|
76
|
+
"Enable {category} consent". The button opens the preference center; it
|
|
77
|
+
does not grant the category by itself, because the visitor still has to
|
|
78
|
+
save. Mount a `ConsentDialog` in the same provider so the button has
|
|
79
|
+
something to open.
|
|
80
|
+
|
|
81
|
+
Under a policy with `scopeMode: 'strict'`, a category outside the rule's
|
|
82
|
+
scope cannot be granted. The built-in placeholder then shows `frame.policyBlocked`,
|
|
83
|
+
"This content is unavailable under your region's consent policy.", without
|
|
84
|
+
the button, and a stored grant for that category stays blocked.
|
|
29
85
|
|
|
30
|
-
|
|
86
|
+
When the provider starts from a snapshot prefetched on the server, the
|
|
87
|
+
server renders the children or placeholder according to effective permission.
|
|
88
|
+
A grant in the request cookie allows the embed only when policy and privacy
|
|
89
|
+
signals permit it. Browser privacy signals detected during hydration can
|
|
90
|
+
withdraw that permission. In a browser-only setup the
|
|
91
|
+
provider has no permission until it resolves policy on the client, so
|
|
92
|
+
`Frame` shows the placeholder first and swaps in the embed after resolution
|
|
93
|
+
when the category is already granted.
|
|
94
|
+
|
|
95
|
+
`Frame` is one component on this page; the per-vendor embed guides for
|
|
96
|
+
[YouTube](../../../integrations/youtube.md) and
|
|
97
|
+
[Google Maps](../../../integrations/google-maps.md) show a complete embed
|
|
98
|
+
configuration with sizing, titles and the same `Frame` usage across
|
|
99
|
+
frameworks.
|
|
100
|
+
|
|
101
|
+
To read the same permission in your own components, use `useConsent` from
|
|
102
|
+
`c15t/react`; the `useIframeBlocker` and `useNetworkBlocker` module hooks
|
|
103
|
+
also import from there.
|
|
104
|
+
|
|
105
|
+
## Composition
|
|
106
|
+
|
|
107
|
+
The placeholder parts are available as `Frame.Root`, `Frame.Title` and
|
|
108
|
+
`Frame.Button` for a custom placeholder that keeps the built-in copy and
|
|
109
|
+
behavior. `Frame.Title` and `Frame.Button` accept `category` and fill in the
|
|
110
|
+
translated text; pass children to either to replace it.
|
|
31
111
|
|
|
32
112
|
```tsx
|
|
33
113
|
<Frame
|
|
34
|
-
category="
|
|
114
|
+
category="marketing"
|
|
35
115
|
placeholder={
|
|
36
|
-
<
|
|
37
|
-
<
|
|
38
|
-
<p>
|
|
39
|
-
|
|
116
|
+
<Frame.Root>
|
|
117
|
+
<Frame.Title category="marketing" />
|
|
118
|
+
<p>The video is also available on our channel.</p>
|
|
119
|
+
<Frame.Button category="marketing">Choose cookies</Frame.Button>
|
|
120
|
+
</Frame.Root>
|
|
40
121
|
}
|
|
41
122
|
>
|
|
42
|
-
<
|
|
123
|
+
<iframe src="https://www.youtube-nocookie.com/embed/..." title="Product tour" />
|
|
43
124
|
</Frame>
|
|
44
125
|
```
|
|
45
126
|
|
|
46
|
-
|
|
127
|
+
The built-in placeholder carries `data-testid="frame-placeholder"` and its
|
|
128
|
+
button `data-testid="frame-open-dialog"`.
|
|
47
129
|
|
|
48
|
-
|
|
130
|
+
## Accessibility
|
|
49
131
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
* `Frame.Root` - Container with default placeholder styling
|
|
58
|
-
* `Frame.Title` - Displays a consent-request message with the category name
|
|
59
|
-
* `Frame.Button` - Button that opens the consent dialog for the specified category
|
|
60
|
-
|
|
61
|
-
## Automatic Category Registration
|
|
62
|
-
|
|
63
|
-
When `Frame` mounts, it automatically adds its `category` to the active `consentCategories` list. This means you don't need to explicitly list the category in your provider's `consentCategories` option - if a `Frame` component uses it, it will be registered.
|
|
64
|
-
|
|
65
|
-
## Props
|
|
132
|
+
The placeholder is plain text and a `button`, so it is readable and
|
|
133
|
+
operable without the embed. Give the iframe a descriptive `title`, and keep a
|
|
134
|
+
transcript, address or link outside the `Frame` for visitors who decline
|
|
135
|
+
the category. A denied category may be fixed by policy, so opening the
|
|
136
|
+
preference center does not guarantee that the visitor can grant it.
|
|
66
137
|
|
|
67
|
-
|
|
68
|
-
|:--|:--|
|
|
69
|
-
|Type Name|\`FrameProps\`|
|
|
70
|
-
|Source Path|\`./packages/react/src/components/frame/types.ts\`|
|
|
138
|
+
## Verify
|
|
71
139
|
|
|
72
|
-
|
|
140
|
+
Use an optional in-scope category that is available in the preference
|
|
141
|
+
center and is not restricted by policy or privacy signals such as GPC.
|
|
142
|
+
Load the page with the category denied. The placeholder text names the
|
|
143
|
+
category and the network panel shows no request to the embed's host. With a
|
|
144
|
+
prefetched snapshot, the server HTML contains the placeholder for a denied
|
|
145
|
+
category or the embed for a granted category. Browser-only initialization
|
|
146
|
+
shows the placeholder before policy resolves, then replaces it with the
|
|
147
|
+
embed if the category is granted. After policy resolves, activate the
|
|
148
|
+
placeholder button: the preference center opens. Turn the category on and
|
|
149
|
+
Save: the placeholder is replaced by the embed and its requests start. Reject the
|
|
150
|
+
category again from the preference center: the embed disappears.
|
|
@@ -1,98 +1,33 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Consent
|
|
3
|
-
description:
|
|
2
|
+
title: Consent categories
|
|
3
|
+
description: Assign optional features to categories and understand how policy
|
|
4
|
+
scope affects permission.
|
|
4
5
|
group: frameworks
|
|
5
6
|
---
|
|
6
|
-
c15t organizes tracking technologies into five consent categories that align with GDPR and ePrivacy Directive requirements. Rather than asking users to approve or deny individual cookies or scripts, each category groups related tracking purposes together so users can make meaningful, informed choices about how their data is used.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
> Why categories, not cookie lists? Many consent banners list individual cookie names like \_ga, \_gid, or \_fbp. This is counterproductive:Technical names are meaningless to users — nobody knows what \_gid does by reading its name.Information overload drives "accept all" — a wall of cookie names pushes users toward dismissing the banner as fast as possible, which is the opposite of informed consent.Purpose is what matters — privacy regulations (GDPR, ePrivacy) require clear information about the purposes of data processing, not a cookie-by-cookie inventory.Cookie lists go stale — third-party scripts change their cookie names across versions, creating a maintenance burden that provides no real transparency.c15t's category-based approach — "measurement", "marketing", "experience" — communicates purpose directly. Users understand why data is collected, not how it is stored.
|
|
8
|
+
## Choose categories by purpose
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
| Category | Purpose |
|
|
11
|
+
| --------------- | ---------------------------------------------- |
|
|
12
|
+
| `necessary` | Functionality required for the site to operate |
|
|
13
|
+
| `functionality` | Optional features such as support widgets |
|
|
14
|
+
| `measurement` | Analytics and usage measurement |
|
|
15
|
+
| `experience` | Optional personalization |
|
|
16
|
+
| `marketing` | Advertising and marketing |
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
`necessary` is always permitted. Assign categories based on what an integration
|
|
19
|
+
does in your application; renaming analytics to necessary does not change its
|
|
20
|
+
purpose. The provider's displayed categories and the resolved policy scope must
|
|
21
|
+
agree.
|
|
16
22
|
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<ConsentManagerProvider
|
|
20
|
-
options={{
|
|
21
|
-
mode: 'hosted',
|
|
22
|
-
backendURL: 'https://your-instance.c15t.dev',
|
|
23
|
-
consentCategories: ['necessary', 'measurement', 'marketing'],
|
|
24
|
-
}}
|
|
25
|
-
>
|
|
26
|
-
{children}
|
|
27
|
-
</ConsentManagerProvider>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
```
|
|
23
|
+
## Respect policy scope
|
|
31
24
|
|
|
32
|
-
|
|
25
|
+
A strict scope denies categories outside the rule. A permissive scope can allow
|
|
26
|
+
out-of-scope categories unless another restriction applies. When a rule selects
|
|
27
|
+
only some optional categories, set `scopeMode` explicitly. An omitted scope,
|
|
28
|
+
`['*']`, or a list containing only `necessary` expands to the default optional
|
|
29
|
+
categories; a necessary-only list is not a shortcut for disabling all tracking.
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|`functionality`|`false`|Yes|Basic interactions and functionalities|
|
|
38
|
-
|`experience`|`false`|Yes|Improve quality of user experience|
|
|
39
|
-
|`measurement`|`false`|Yes|Measure traffic and analyze behavior|
|
|
40
|
-
|`marketing`|`false`|Yes|Deliver personalized ads or marketing content|
|
|
41
|
-
|
|
42
|
-
The `necessary` category has `disabled: true` set internally, which prevents the user from toggling it off in the consent UI. All other categories can be freely toggled by the user.
|
|
43
|
-
|
|
44
|
-
Note that all categories except `necessary` have `display: false` by default. A category appears in the consent UI only if you include it in `consentCategories`. Categories not listed are hidden from the UI, but they still exist in consent state and may be affected by model-level behavior (for example, auto-grant in `opt-out` or `null` model flows).
|
|
45
|
-
|
|
46
|
-
Check if a specific category has consent using the `has()` method:
|
|
47
|
-
|
|
48
|
-
```tsx
|
|
49
|
-
import { useConsentManager } from '@c15t/react';
|
|
50
|
-
|
|
51
|
-
function AnalyticsLoader() {
|
|
52
|
-
const { has } = useConsentManager();
|
|
53
|
-
|
|
54
|
-
if (has('measurement')) {
|
|
55
|
-
// Safe to load analytics scripts
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Configuring Categories
|
|
63
|
-
|
|
64
|
-
The `consentCategories` array controls which consent categories are presented to the user in the consent UI. Only categories you list in this array will appear as toggleable options in the consent banner or modal.
|
|
65
|
-
|
|
66
|
-
The `necessary` category is always implicitly included even if you do not add it to the array. You never need to worry about accidentally omitting it -- c15t ensures it is always present and always enabled.
|
|
67
|
-
|
|
68
|
-
For example, if you set:
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
consentCategories: ['necessary', 'measurement', 'marketing']
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
then only those three categories will show toggles in the consent UI. The `functionality` and `experience` categories will not appear as user-configurable toggles.
|
|
75
|
-
|
|
76
|
-
In `opt-in`/`iab` flows, hidden categories usually remain `false` unless you explicitly set them. In `opt-out`/`null` flows, categories may be auto-granted even when hidden.
|
|
77
|
-
|
|
78
|
-
This gives you precise control over which consent choices to present to your users. A simple blog that only runs an analytics script might only need `measurement`. A media site with ad integrations would include `marketing`. A SaaS application with personalization features might add `experience` and `functionality` as well. You choose what is relevant to your site and c15t handles the rest - storing consent state, exposing it through hooks, and ensuring the right categories are active based on the user's choices.
|
|
79
|
-
|
|
80
|
-
You can dynamically update which categories are active:
|
|
81
|
-
|
|
82
|
-
```tsx
|
|
83
|
-
import { useConsentManager } from '@c15t/react';
|
|
84
|
-
|
|
85
|
-
function CategoryManager() {
|
|
86
|
-
const { consentCategories, setConsentCategories } = useConsentManager();
|
|
87
|
-
|
|
88
|
-
const addExperienceCategory = () => {
|
|
89
|
-
setConsentCategories([...consentCategories, 'experience']);
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
return (
|
|
93
|
-
<button onClick={addExperienceCategory}>
|
|
94
|
-
Enable experience features
|
|
95
|
-
</button>
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
```
|
|
31
|
+
Use effective permissions to gate work and explicit choices to inspect what the
|
|
32
|
+
visitor confirmed. Read [consent state](../../../guides/consent-state.md) for that
|
|
33
|
+
distinction and [migration](../../../upgrade-v3.md) for v3 policy configuration.
|