@c15t/react 3.0.0-alpha.1 → 3.0.0-alpha.11
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 +97 -70
- package/README.md +21 -17
- package/SKILL.md +34 -0
- package/dist/aggregate-components.js +1 -1
- package/dist/chunk-warming.js +1 -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/component-hooks/use-panel-trigger.js +1 -1
- package/dist/components/consent-gate/atoms.js +1 -0
- package/dist/components/consent-gate/consent-gate.js +2 -0
- package/dist/components/consent-gate/frame.js +2 -0
- package/dist/components/consent-gate/index.js +2 -0
- package/dist/components/consent-preferences-link/consent-preferences-link.js +1 -1
- package/dist/components/iab-panel/atoms/card.js +1 -1
- package/dist/components/iab-panel/atoms/feature-item.js +2 -0
- package/dist/components/iab-panel/atoms/header.js +1 -1
- package/dist/components/iab-panel/atoms/purpose-item.js +1 -1
- package/dist/components/iab-panel/atoms/root.js +1 -1
- package/dist/components/iab-panel/atoms/stack-item.js +1 -1
- package/dist/components/iab-panel/atoms/vendor-list.js +1 -1
- package/dist/components/iab-panel/hooks/use-gvl-data.js +1 -1
- package/dist/components/iab-panel/iab-panel.js +1 -1
- package/dist/components/iab-panel/index.js +1 -1
- package/dist/components/iab-prompt/atoms/overlay.js +1 -1
- package/dist/components/iab-prompt/atoms/root.js +1 -1
- package/dist/components/iab-prompt/iab-prompt.js +1 -1
- package/dist/components/panel/atoms/card.js +1 -1
- package/dist/components/panel/atoms/overlay.js +1 -1
- package/dist/components/panel/atoms/root.js +1 -1
- package/dist/components/panel/panel.js +1 -1
- package/dist/components/panel-trigger/atoms/button.js +1 -1
- package/dist/components/panel-trigger/atoms/icon.js +1 -1
- package/dist/components/panel-trigger/atoms/root.js +1 -1
- package/dist/components/panel-trigger/atoms/toolbar.js +1 -1
- package/dist/components/panel-trigger/atoms/trigger-icons.js +1 -0
- package/dist/components/panel-trigger/panel-trigger-toolbar.js +1 -1
- package/dist/components/panel-trigger/panel-trigger.js +1 -1
- package/dist/components/panel-trigger/toolbar-loader.js +2 -0
- package/dist/components/preferences/atoms/accordion.js +1 -1
- package/dist/components/preferences/atoms/root.js +1 -1
- package/dist/components/preferences/atoms/vendor-list.js +1 -0
- package/dist/components/preferences/index.js +1 -1
- package/dist/components/prompt/atoms/early-tap-script.js +2 -0
- package/dist/components/prompt/atoms/overlay.js +1 -1
- package/dist/components/prompt/atoms/root.js +1 -1
- package/dist/components/prompt/components.js +1 -1
- package/dist/components/prompt/policy-actions.js +1 -1
- package/dist/components/prompt/prompt.js +1 -1
- package/dist/components/shared/dialog-sheets.js +1 -0
- package/dist/components/shared/first-paint-sheets.js +1 -0
- package/dist/components/shared/iab-dialog-sheets.js +1 -0
- package/dist/components/shared/iab-first-paint-sheets.js +1 -0
- package/dist/components/shared/libs/compose-refs.js +1 -0
- package/dist/components/shared/libs/slot.js +1 -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/streamed-surface.js +2 -0
- package/dist/components/shared/surface-styles.js +2 -0
- package/dist/components/shared/ui/dialog/dialog.js +1 -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 +1 -1
- package/dist/consent-gate.js +2 -0
- package/dist/consent-theme.js +1 -0
- package/dist/context/consent-tracking-context.js +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context.js +1 -1
- package/dist/devtools-launcher.js +2 -0
- package/dist/devtools.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/headless.js +1 -1
- package/dist/hooks/use-color-scheme.js +1 -1
- package/dist/hooks/use-committed-ref.js +2 -0
- package/dist/hooks/use-focus-trap.js +1 -1
- package/dist/hooks/use-headless-iab-consent-ui.js +1 -1
- package/dist/hooks/use-iab-policy-guard.js +1 -0
- package/dist/hooks/use-late-entry.js +2 -0
- package/dist/hooks.js +1 -1
- package/dist/iab/styles.tw3.css +5 -45
- package/dist/iab-context.js +1 -1
- package/dist/iab-dialog-deferred.js +2 -0
- package/dist/iab.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/frame.js +1 -0
- package/dist/index-parts/hooks.js +1 -0
- package/dist/index-parts/hosted.js +1 -0
- package/dist/index-parts/module-hooks.js +1 -0
- package/dist/index-parts/offline.js +1 -0
- package/dist/index-parts/presets.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 -0
- package/dist/modes.js +1 -0
- package/dist/module-hooks/iframe-blocker.js +1 -1
- package/dist/module-hooks/network-blocker.js +1 -1
- package/dist/module-hooks/network-hold.js +2 -0
- package/dist/module-hooks/persistence.js +1 -1
- package/dist/panel-link.js +1 -1
- package/dist/panel-trigger.js +1 -1
- package/dist/panel.js +1 -1
- package/dist/postcss-tailwind3.js +1 -0
- package/dist/preferences.js +1 -2
- package/dist/provider.js +1 -1
- package/dist/server/fetch-ssr-data.js +1 -1
- package/dist/server/headers.js +1 -1
- package/dist/server/normalize-url.js +1 -1
- package/dist/styles.tw3.css +33 -51
- package/dist/transports/hosted.js +1 -0
- package/dist/transports/manifest.js +1 -0
- package/dist/transports/offline.js +1 -1
- package/dist/utils/deferred-module.js +2 -0
- package/dist/utils/merge-slot-props.js +1 -1
- package/dist/utils/theme-utils.js +1 -1
- package/dist/version.js +1 -1
- package/dist-types/aggregate-components.d.ts +2 -2
- package/dist-types/chunk-warming.d.ts +42 -8
- package/dist-types/component-hooks/use-headless-consent-ui.d.ts +5 -5
- package/dist-types/component-hooks/use-headless-iab-consent-ui.d.ts +2 -2
- package/dist-types/components/consent-gate/atoms.d.ts +11 -0
- package/dist-types/components/consent-gate/consent-gate.d.ts +2 -0
- package/dist-types/components/consent-gate/frame.d.ts +19 -0
- package/dist-types/components/consent-gate/index.d.ts +25 -0
- package/dist-types/components/{frame → consent-gate}/types.d.ts +7 -7
- package/dist-types/components/consent-preferences-link/consent-preferences-link.d.ts +1 -1
- package/dist-types/components/consent-preferences-link/index.d.ts +1 -1
- package/dist-types/components/iab-panel/atoms/feature-item.d.ts +28 -0
- package/dist-types/components/iab-panel/atoms/purpose-item.d.ts +5 -2
- package/dist-types/components/iab-panel/atoms/stack-item.d.ts +7 -2
- package/dist-types/components/iab-panel/atoms/vendor-list.d.ts +1 -1
- package/dist-types/components/iab-panel/iab-panel.d.ts +3 -3
- package/dist-types/components/iab-panel/index.d.ts +29 -26
- package/dist-types/components/iab-panel/use-iab-translations.d.ts +4 -0
- package/dist-types/components/iab-prompt/iab-prompt.d.ts +3 -3
- package/dist-types/components/iab-prompt/index.d.ts +19 -19
- package/dist-types/components/panel/atoms/card.d.ts +5 -4
- package/dist-types/components/panel/atoms/overlay.d.ts +1 -1
- package/dist-types/components/panel/index.d.ts +8 -8
- package/dist-types/components/panel/panel.d.ts +3 -3
- package/dist-types/components/panel-link/index.d.ts +1 -1
- package/dist-types/components/panel-trigger/atoms/button.d.ts +1 -1
- package/dist-types/components/panel-trigger/atoms/icon.d.ts +1 -1
- package/dist-types/components/panel-trigger/atoms/root.d.ts +2 -2
- package/dist-types/components/panel-trigger/atoms/toolbar.d.ts +2 -2
- package/dist-types/components/panel-trigger/atoms/trigger-icons.d.ts +25 -0
- package/dist-types/components/panel-trigger/index.d.ts +4 -4
- package/dist-types/components/panel-trigger/panel-trigger-toolbar.d.ts +1 -1
- package/dist-types/components/panel-trigger/panel-trigger.d.ts +9 -17
- package/dist-types/components/panel-trigger/toolbar-loader.d.ts +34 -0
- package/dist-types/components/panel-trigger/types.d.ts +1 -1
- package/dist-types/components/preferences/atoms/accordion.d.ts +6 -4
- package/dist-types/components/preferences/atoms/button.d.ts +1 -1
- package/dist-types/components/preferences/atoms/footer.d.ts +1 -1
- package/dist-types/components/preferences/atoms/root.d.ts +1 -1
- package/dist-types/components/preferences/atoms/vendor-list.d.ts +23 -0
- package/dist-types/components/preferences/index.d.ts +14 -12
- package/dist-types/components/preferences/policy-actions.d.ts +2 -2
- package/dist-types/components/preferences/preferences.d.ts +1 -1
- package/dist-types/components/preferences/types.d.ts +1 -1
- package/dist-types/components/prompt/atoms/early-tap-script.d.ts +17 -0
- package/dist-types/components/prompt/atoms/root.d.ts +4 -0
- package/dist-types/components/prompt/components.d.ts +9 -3
- package/dist-types/components/prompt/index.d.ts +12 -12
- package/dist-types/components/prompt/policy-actions.d.ts +2 -2
- package/dist-types/components/prompt/prompt.d.ts +5 -1
- package/dist-types/components/shared/dialog-sheets.d.ts +9 -0
- package/dist-types/components/shared/first-paint-sheets.d.ts +8 -0
- package/dist-types/components/shared/iab-dialog-sheets.d.ts +3 -0
- package/dist-types/components/shared/iab-first-paint-sheets.d.ts +3 -0
- package/dist-types/components/shared/libs/compose-refs.d.ts +20 -0
- package/dist-types/components/shared/policy-actions.d.ts +2 -2
- package/dist-types/components/shared/primitives/box.d.ts +1 -1
- package/dist-types/components/shared/primitives/button.d.ts +2 -2
- package/dist-types/components/shared/primitives/button.types.d.ts +1 -1
- package/dist-types/components/shared/streamed-surface.d.ts +23 -0
- package/dist-types/components/shared/surface-styles.d.ts +60 -0
- package/dist-types/components/shared/ui/accordion/accordion.d.ts +2 -2
- package/dist-types/components/shared/ui/accordion/index.d.ts +2 -2
- package/dist-types/components/shared/ui/animated-collapse/index.d.ts +2 -2
- package/dist-types/components/shared/ui/branding.d.ts +1 -1
- package/dist-types/components/shared/ui/button/button.d.ts +1 -1
- package/dist-types/components/shared/ui/button/index.d.ts +2 -2
- package/dist-types/components/shared/ui/collapsible/index.d.ts +1 -1
- package/dist-types/components/shared/ui/dialog/index.d.ts +1 -1
- package/dist-types/components/shared/ui/icon.d.ts +2 -1
- package/dist-types/components/shared/ui/logo.d.ts +0 -10
- package/dist-types/components/shared/ui/preference-item/index.d.ts +1 -1
- package/dist-types/components/shared/ui/preference-item/preference-item.d.ts +13 -0
- package/dist-types/components/shared/ui/switch/index.d.ts +2 -2
- package/dist-types/components/shared/ui/switch/switch.d.ts +1 -1
- package/dist-types/components/shared/ui/tabs/index.d.ts +1 -1
- package/dist-types/consent-gate.d.ts +1 -0
- package/dist-types/consent-theme.d.ts +38 -0
- package/dist-types/context/consent-tracking-context.d.ts +10 -0
- package/dist-types/context/index.d.ts +3 -3
- package/dist-types/context/theme-context.d.ts +3 -3
- package/dist-types/context.d.ts +25 -1
- package/dist-types/devtools-launcher.d.ts +29 -0
- package/dist-types/devtools.d.ts +13 -2
- package/dist-types/draft-context.d.ts +31 -0
- package/dist-types/draft.d.ts +81 -9
- package/dist-types/gpp.d.ts +27 -0
- package/dist-types/headless.d.ts +6 -7
- package/dist-types/hooks/use-committed-ref.d.ts +24 -0
- package/dist-types/hooks/use-focus-trap.d.ts +3 -1
- package/dist-types/hooks/use-headless-iab-consent-ui.d.ts +1 -1
- package/dist-types/hooks/use-iab-manager.d.ts +5 -5
- package/dist-types/hooks/use-iab-policy-guard.d.ts +35 -0
- package/dist-types/hooks/use-late-entry.d.ts +14 -0
- package/dist-types/hooks/use-theme.d.ts +1 -1
- package/dist-types/hooks.d.ts +106 -11
- package/dist-types/iab-dialog-deferred.d.ts +36 -0
- package/dist-types/iab.d.ts +8 -7
- 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 +7 -0
- package/dist-types/index-parts/draft.d.ts +7 -0
- package/dist-types/index-parts/frame.d.ts +7 -0
- package/dist-types/index-parts/hooks.d.ts +7 -0
- package/dist-types/index-parts/hosted.d.ts +7 -0
- package/dist-types/index-parts/module-hooks.d.ts +7 -0
- package/dist-types/index-parts/offline.d.ts +7 -0
- package/dist-types/index-parts/presets.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 +32 -28
- package/dist-types/kernel-selector.d.ts +68 -0
- package/dist-types/modes.d.ts +26 -0
- package/dist-types/module-hooks/iframe-blocker.d.ts +33 -1
- package/dist-types/module-hooks/network-blocker.d.ts +23 -0
- package/dist-types/module-hooks/network-hold.d.ts +47 -0
- package/dist-types/module-hooks.d.ts +4 -4
- package/dist-types/panel-link.d.ts +1 -1
- package/dist-types/panel-trigger.d.ts +1 -1
- package/dist-types/panel.d.ts +13 -1
- package/dist-types/postcss-tailwind3.d.ts +21 -0
- package/dist-types/preferences.d.ts +12 -1
- package/dist-types/primitives/accordion.d.ts +1 -1
- package/dist-types/primitives/button.d.ts +1 -1
- package/dist-types/primitives/collapsible.d.ts +1 -1
- package/dist-types/primitives/dialog.d.ts +1 -1
- package/dist-types/primitives/preference-item.d.ts +1 -1
- package/dist-types/primitives/switch.d.ts +1 -1
- package/dist-types/primitives/tabs.d.ts +1 -1
- package/dist-types/primitives.d.ts +7 -7
- package/dist-types/prompt.d.ts +1 -1
- package/dist-types/provider.d.ts +169 -28
- package/dist-types/server/fetch-ssr-data.d.ts +1 -1
- package/dist-types/server/headers.d.ts +14 -4
- package/dist-types/server/index.d.ts +5 -5
- package/dist-types/server/normalize-url.d.ts +14 -7
- package/dist-types/server/types.d.ts +12 -1
- package/dist-types/theme-provider.d.ts +2 -2
- package/dist-types/transports/hosted.d.ts +36 -0
- package/dist-types/transports/manifest.d.ts +48 -0
- package/dist-types/transports/offline.d.ts +7 -16
- package/dist-types/types/index.d.ts +3 -3
- package/dist-types/types/manager.d.ts +1 -1
- package/dist-types/types/theme/index.d.ts +1 -1
- package/dist-types/ui-config-context.d.ts +14 -2
- package/dist-types/utils/deferred-module.d.ts +13 -0
- package/dist-types/utils/index.d.ts +4 -4
- package/dist-types/utils/merge-slot-props.d.ts +17 -3
- package/dist-types/utils/merge-styles.d.ts +1 -1
- package/dist-types/utils/theme-utils.d.ts +18 -3
- package/dist-types/version.d.ts +1 -1
- package/docs/README.md +97 -70
- package/docs/assets/v3/bottom-bar.png +0 -0
- package/docs/assets/v3/brand-card.png +0 -0
- package/docs/assets/v3/brand-preferences.png +0 -0
- package/docs/assets/v3/choice-wall.png +0 -0
- package/docs/assets/v3/headless-bar-html.png +0 -0
- package/docs/assets/v3/headless-bar-mobile.png +0 -0
- package/docs/assets/v3/headless-bar.png +0 -0
- package/docs/assets/v3/slim-bar.png +0 -0
- package/docs/concepts/choose-your-setup.md +141 -0
- package/docs/concepts/consent-categories.md +84 -0
- package/docs/concepts/consent-state.md +421 -0
- package/docs/concepts/data-fetching.md +284 -0
- package/docs/concepts/how-consent-works.md +123 -0
- package/docs/concepts/modes.md +281 -0
- package/docs/{frameworks/react/concepts/policy-presets.md → concepts/policies.md} +8 -60
- package/docs/customization/class-names.md +202 -0
- package/docs/customization/dark-mode.md +157 -0
- package/docs/customization/motion.md +128 -0
- package/docs/customization/overview.md +68 -33
- package/docs/customization/recipes.md +838 -47
- package/docs/customization/slots.md +217 -35
- package/docs/customization/stylesheets.md +248 -0
- package/docs/customization/tailwind.md +863 -0
- package/docs/customization/tokens.md +167 -36
- package/docs/customization/translations.md +87 -3
- package/docs/frameworks/react/callbacks.md +118 -0
- package/docs/frameworks/react/clear-on-revocation.md +106 -0
- package/docs/frameworks/react/components/consent-banner.md +48 -27
- package/docs/frameworks/react/components/consent-dialog-link.md +13 -11
- package/docs/frameworks/react/components/consent-dialog-trigger.md +86 -76
- package/docs/frameworks/react/components/consent-dialog.md +111 -58
- package/docs/frameworks/react/components/{frame.md → consent-gate.md} +70 -49
- package/docs/frameworks/react/components/consent-provider.md +143 -0
- package/docs/frameworks/react/components/consent-widget.md +69 -24
- package/docs/frameworks/react/components/dev-tools.md +76 -85
- package/docs/frameworks/react/components.md +113 -0
- package/docs/frameworks/react/compose.md +354 -0
- package/docs/frameworks/react/content-security-policy.md +149 -0
- package/docs/frameworks/react/customize.md +258 -0
- package/docs/frameworks/react/embeds.md +89 -0
- package/docs/frameworks/react/gpp.md +163 -0
- package/docs/frameworks/react/headless.md +4 -4
- package/docs/frameworks/react/hooks.md +70 -0
- package/docs/frameworks/react/iab.md +278 -0
- package/docs/frameworks/react/network-blocker.md +140 -0
- package/docs/frameworks/react/quickstart.md +171 -107
- package/docs/frameworks/react/rendering.md +285 -0
- package/docs/frameworks/react/scripts.md +114 -0
- package/docs/frameworks/react/translations.md +155 -0
- package/docs/frameworks/react/troubleshooting.md +189 -61
- package/docs/frameworks/react/upgrade-v3.md +652 -0
- package/docs/frameworks/react/vendor-consent.md +188 -0
- package/docs/guides/banner-experiments.md +688 -0
- package/docs/guides/troubleshooting.md +192 -54
- package/docs/guides/verify-consent.md +96 -49
- package/docs/integrations/adobe-analytics.md +177 -183
- package/docs/integrations/ahrefs-analytics.md +162 -178
- package/docs/integrations/amplitude.md +172 -180
- package/docs/integrations/building-integrations.md +137 -33
- package/docs/integrations/clearbit.md +164 -178
- package/docs/integrations/cloudflare-web-analytics.md +166 -180
- package/docs/integrations/cloudflare-zaraz.md +333 -0
- package/docs/integrations/crisp.md +174 -182
- package/docs/integrations/databuddy.md +167 -197
- package/docs/integrations/fathom-analytics.md +168 -180
- package/docs/integrations/front-chat.md +308 -0
- package/docs/integrations/google-maps.md +142 -108
- package/docs/integrations/google-tag-manager.md +258 -185
- package/docs/integrations/google-tag.md +226 -182
- package/docs/integrations/heap.md +173 -179
- package/docs/integrations/hightouch.md +171 -181
- package/docs/integrations/hotjar.md +169 -179
- package/docs/integrations/intercom.md +193 -177
- package/docs/integrations/klaviyo.md +473 -0
- package/docs/integrations/linkedin-insights.md +184 -174
- package/docs/integrations/logrocket.md +170 -180
- package/docs/integrations/matomo-analytics.md +198 -202
- package/docs/integrations/meta-pixel.md +198 -174
- package/docs/integrations/microsoft-clarity.md +173 -179
- package/docs/integrations/microsoft-uet.md +158 -178
- package/docs/integrations/mixpanel-analytics.md +165 -184
- package/docs/integrations/one-dollar-stats.md +292 -0
- package/docs/integrations/openai-pixel.md +214 -325
- package/docs/integrations/overview.md +153 -83
- package/docs/integrations/pinterest-tag.md +315 -0
- package/docs/integrations/pirsch.md +179 -183
- package/docs/integrations/plausible-analytics.md +182 -182
- package/docs/integrations/posthog.md +323 -264
- package/docs/integrations/promptwatch.md +164 -178
- package/docs/integrations/reddit-pixel.md +195 -181
- package/docs/integrations/rudderstack.md +211 -210
- package/docs/integrations/rybbit-analytics.md +181 -184
- package/docs/integrations/segment.md +192 -178
- package/docs/integrations/sentry.md +402 -0
- package/docs/integrations/snapchat-pixel.md +196 -180
- package/docs/integrations/tiktok-pixel.md +181 -174
- package/docs/integrations/umami-analytics.md +173 -182
- package/docs/integrations/vercel-analytics.md +176 -181
- package/docs/integrations/vercel-speed-insights.md +306 -0
- package/docs/integrations/x-pixel.md +186 -174
- package/docs/integrations/youtube.md +150 -111
- package/package.json +48 -17
- package/dist/component-hooks/use-manager.js +0 -2
- package/dist/components/frame/atoms.js +0 -1
- package/dist/components/frame/frame.js +0 -2
- package/dist/components/frame/index.js +0 -2
- package/dist/frame.js +0 -2
- package/dist/ui-save.js +0 -1
- package/dist-types/component-hooks/use-manager.d.ts +0 -40
- package/dist-types/components/frame/atoms.d.ts +0 -11
- package/dist-types/components/frame/frame.d.ts +0 -2
- package/dist-types/components/frame/index.d.ts +0 -24
- package/dist-types/frame.d.ts +0 -1
- package/dist-types/ui-save.d.ts +0 -5
- package/docs/assets/v3/brand-bar.png +0 -0
- package/docs/assets/v3/mobile-card.png +0 -0
- package/docs/assets/v3/preferences.png +0 -0
- package/docs/frameworks/react/components/consent-manager-provider.md +0 -71
- package/docs/frameworks/react/concepts/consent-categories.md +0 -33
- package/docs/frameworks/react/hooks/use-consent-manager/overview.md +0 -58
- package/docs/frameworks/react/iab/overview.md +0 -53
- package/docs/frameworks/react/script-loader.md +0 -63
- package/docs/frameworks/react/styling/overview.md +0 -217
- package/docs/guides/consent-state.md +0 -60
- package/docs/guides/data-fetching.md +0 -163
- package/docs/guides/deployment-modes.md +0 -63
- package/docs/integrations/clear-on-revocation.md +0 -167
- package/docs/upgrade-v3.md +0 -334
- package/readme.json +0 -48
- package/src/iab/styles.css +0 -11
- package/src/styles.css +0 -10
- /package/dist/components/{frame → consent-gate}/types.js +0 -0
|
@@ -2,18 +2,22 @@
|
|
|
2
2
|
title: YouTube
|
|
3
3
|
description: Gate YouTube embeds with c15t v3 in Next.js, TanStack Start, React,
|
|
4
4
|
Nuxt, Vue, Astro, Svelte, SvelteKit or JavaScript.
|
|
5
|
+
icon: youtube
|
|
5
6
|
group: integrations
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
## Configure the video
|
|
9
10
|
|
|
10
11
|
Use the ID of an embeddable video and the category matching its purpose in your
|
|
11
|
-
policy.
|
|
12
|
+
policy. This page uses `marketing` because the YouTube player can set
|
|
13
|
+
advertising identifiers. The framework quickstarts gate their demo video on
|
|
14
|
+
`measurement` instead; either works if your policy says so. The current v3 adapters use consent-gated iframes rather than the v2
|
|
12
15
|
`YouTubeEmbed` convenience component.
|
|
13
16
|
|
|
14
17
|
```ts title="src/embed-config.ts"
|
|
15
18
|
export const embedCategory = 'marketing' as const;
|
|
16
|
-
export const embedURL =
|
|
19
|
+
export const embedURL =
|
|
20
|
+
'https://www.youtube-nocookie.com/embed/VIDEO_ID?playsinline=1';
|
|
17
21
|
export const embedTitle = 'Product walkthrough';
|
|
18
22
|
export const embedAspectRatio = '16 / 9';
|
|
19
23
|
```
|
|
@@ -23,7 +27,7 @@ Replace `VIDEO_ID` before running the example.
|
|
|
23
27
|
## Add the embed to your framework
|
|
24
28
|
|
|
25
29
|
Create `src/embed-config.ts` using the configuration on this page, then select
|
|
26
|
-
your framework. Keep the existing [consent setup](https://c15t.com/docs/frameworks), its policy
|
|
30
|
+
your framework. Keep the existing [consent setup](https://v3.c15t.com/docs/frameworks), its policy
|
|
27
31
|
and preferences UI. These examples do not create a second consent provider.
|
|
28
32
|
|
|
29
33
|
**Next.js**
|
|
@@ -33,12 +37,12 @@ Render this component inside your existing consent boundary or provider.
|
|
|
33
37
|
```tsx title="src/consent-embed.tsx"
|
|
34
38
|
'use client';
|
|
35
39
|
|
|
36
|
-
import {
|
|
40
|
+
import { ConsentGate } from 'c15t/next';
|
|
37
41
|
import { embedCategory, embedURL, embedTitle, embedAspectRatio } from './embed-config';
|
|
38
42
|
|
|
39
43
|
export function ConsentEmbed() {
|
|
40
44
|
return (
|
|
41
|
-
<
|
|
45
|
+
<ConsentGate category={embedCategory}>
|
|
42
46
|
<iframe
|
|
43
47
|
src={embedURL}
|
|
44
48
|
title={embedTitle}
|
|
@@ -46,12 +50,12 @@ export function ConsentEmbed() {
|
|
|
46
50
|
allowFullScreen
|
|
47
51
|
style={{ width: '100%', aspectRatio: embedAspectRatio, minHeight: 200, border: 0 }}
|
|
48
52
|
/>
|
|
49
|
-
</
|
|
53
|
+
</ConsentGate>
|
|
50
54
|
);
|
|
51
55
|
}
|
|
52
56
|
```
|
|
53
57
|
|
|
54
|
-
`
|
|
58
|
+
`ConsentGate` keeps the iframe absent while permission is denied and removes it
|
|
55
59
|
on revocation. Keep your existing consent styles and preferences dialog.
|
|
56
60
|
|
|
57
61
|
**TanStack Start**
|
|
@@ -59,12 +63,12 @@ on revocation. Keep your existing consent styles and preferences dialog.
|
|
|
59
63
|
Render this component inside your existing consent boundary or provider.
|
|
60
64
|
|
|
61
65
|
```tsx title="src/consent-embed.tsx"
|
|
62
|
-
import {
|
|
66
|
+
import { ConsentGate } from 'c15t/tanstack-start';
|
|
63
67
|
import { embedCategory, embedURL, embedTitle, embedAspectRatio } from './embed-config';
|
|
64
68
|
|
|
65
69
|
export function ConsentEmbed() {
|
|
66
70
|
return (
|
|
67
|
-
<
|
|
71
|
+
<ConsentGate category={embedCategory}>
|
|
68
72
|
<iframe
|
|
69
73
|
src={embedURL}
|
|
70
74
|
title={embedTitle}
|
|
@@ -72,12 +76,12 @@ export function ConsentEmbed() {
|
|
|
72
76
|
allowFullScreen
|
|
73
77
|
style={{ width: '100%', aspectRatio: embedAspectRatio, minHeight: 200, border: 0 }}
|
|
74
78
|
/>
|
|
75
|
-
</
|
|
79
|
+
</ConsentGate>
|
|
76
80
|
);
|
|
77
81
|
}
|
|
78
82
|
```
|
|
79
83
|
|
|
80
|
-
`
|
|
84
|
+
`ConsentGate` keeps the iframe absent while permission is denied and removes it
|
|
81
85
|
on revocation. Keep your existing consent styles and preferences dialog.
|
|
82
86
|
|
|
83
87
|
**React**
|
|
@@ -85,12 +89,12 @@ on revocation. Keep your existing consent styles and preferences dialog.
|
|
|
85
89
|
Render this component inside your existing consent boundary or provider.
|
|
86
90
|
|
|
87
91
|
```tsx title="src/consent-embed.tsx"
|
|
88
|
-
import {
|
|
92
|
+
import { ConsentGate } from 'c15t/react';
|
|
89
93
|
import { embedCategory, embedURL, embedTitle, embedAspectRatio } from './embed-config';
|
|
90
94
|
|
|
91
95
|
export function ConsentEmbed() {
|
|
92
96
|
return (
|
|
93
|
-
<
|
|
97
|
+
<ConsentGate category={embedCategory}>
|
|
94
98
|
<iframe
|
|
95
99
|
src={embedURL}
|
|
96
100
|
title={embedTitle}
|
|
@@ -98,74 +102,75 @@ export function ConsentEmbed() {
|
|
|
98
102
|
allowFullScreen
|
|
99
103
|
style={{ width: '100%', aspectRatio: embedAspectRatio, minHeight: 200, border: 0 }}
|
|
100
104
|
/>
|
|
101
|
-
</
|
|
105
|
+
</ConsentGate>
|
|
102
106
|
);
|
|
103
107
|
}
|
|
104
108
|
```
|
|
105
109
|
|
|
106
|
-
`
|
|
110
|
+
`ConsentGate` keeps the iframe absent while permission is denied and removes it
|
|
107
111
|
on revocation. Keep your existing consent styles and preferences dialog.
|
|
108
112
|
|
|
109
113
|
**Nuxt**
|
|
110
114
|
|
|
111
|
-
|
|
115
|
+
The Nuxt module registers `ConsentGate` and `ConsentDialogLink`, so
|
|
116
|
+
this component imports only the embed configuration.
|
|
112
117
|
|
|
113
118
|
```vue title="app/components/ConsentEmbed.vue"
|
|
114
119
|
<script setup lang="ts">
|
|
115
120
|
import { embedCategory, embedURL, embedTitle, embedAspectRatio } from '../../src/embed-config';
|
|
116
|
-
|
|
117
|
-
const snapshot = useConsentSnapshot();
|
|
118
|
-
const activeUI = useConsentActiveUI();
|
|
119
121
|
</script>
|
|
120
122
|
|
|
121
123
|
<template>
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
124
|
+
<ConsentGate :category="embedCategory">
|
|
125
|
+
<iframe
|
|
126
|
+
:src="embedURL"
|
|
127
|
+
:title="embedTitle"
|
|
128
|
+
loading="lazy"
|
|
129
|
+
allowfullscreen
|
|
130
|
+
:style="{ width: '100%', aspectRatio: embedAspectRatio, minHeight: '200px', border: 0 }"
|
|
131
|
+
/>
|
|
132
|
+
<template #placeholder>
|
|
133
|
+
<p>Allow {{ embedCategory }} to load this content.</p>
|
|
134
|
+
<ConsentDialogLink>Open privacy settings</ConsentDialogLink>
|
|
135
|
+
</template>
|
|
136
|
+
</ConsentGate>
|
|
133
137
|
</template>
|
|
134
138
|
```
|
|
135
139
|
|
|
136
|
-
|
|
137
|
-
|
|
140
|
+
`ConsentGate` keeps the iframe out of the server HTML and the DOM while
|
|
141
|
+
permission is denied, and removes it on revocation. See
|
|
142
|
+
[Nuxt scripts and embeds](https://v3.c15t.com/docs/frameworks/nuxt/scripts).
|
|
138
143
|
|
|
139
144
|
**Vue**
|
|
140
145
|
|
|
141
|
-
|
|
146
|
+
Render this component inside the app that installed the c15t Vue plugin.
|
|
142
147
|
|
|
143
148
|
```vue title="src/ConsentEmbed.vue"
|
|
144
149
|
<script setup lang="ts">
|
|
145
|
-
import {
|
|
150
|
+
import { ConsentDialogLink, ConsentGate } from 'c15t/vue/vue-plugin';
|
|
146
151
|
import { embedCategory, embedURL, embedTitle, embedAspectRatio } from './embed-config';
|
|
147
|
-
|
|
148
|
-
const snapshot = useConsentSnapshot();
|
|
149
|
-
const activeUI = useConsentActiveUI();
|
|
150
152
|
</script>
|
|
151
153
|
|
|
152
154
|
<template>
|
|
153
|
-
<
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
155
|
+
<ConsentGate :category="embedCategory">
|
|
156
|
+
<iframe
|
|
157
|
+
:src="embedURL"
|
|
158
|
+
:title="embedTitle"
|
|
159
|
+
loading="lazy"
|
|
160
|
+
allowfullscreen
|
|
161
|
+
:style="{ width: '100%', aspectRatio: embedAspectRatio, minHeight: '200px', border: 0 }"
|
|
162
|
+
/>
|
|
163
|
+
<template #placeholder>
|
|
164
|
+
<p>Allow {{ embedCategory }} to load this content.</p>
|
|
165
|
+
<ConsentDialogLink>Open privacy settings</ConsentDialogLink>
|
|
166
|
+
</template>
|
|
167
|
+
</ConsentGate>
|
|
164
168
|
</template>
|
|
165
169
|
```
|
|
166
170
|
|
|
167
|
-
|
|
168
|
-
|
|
171
|
+
`ConsentGate` keeps the iframe out of the DOM while permission is denied,
|
|
172
|
+
and removes it on revocation. See
|
|
173
|
+
[Vue scripts and embeds](https://v3.c15t.com/docs/frameworks/vue/scripts).
|
|
169
174
|
|
|
170
175
|
**Astro**
|
|
171
176
|
|
|
@@ -176,7 +181,7 @@ Add this component to pages using your consent-enabled base layout:
|
|
|
176
181
|
<c15t-consent-embed style="display: block"></c15t-consent-embed>
|
|
177
182
|
|
|
178
183
|
<script>
|
|
179
|
-
import { getConsentClient } from '
|
|
184
|
+
import { getConsentClient } from 'c15t/astro/client';
|
|
180
185
|
import { mountConsentEmbed } from '../consent-embed';
|
|
181
186
|
|
|
182
187
|
class ConsentEmbed extends HTMLElement {
|
|
@@ -218,16 +223,16 @@ runtime for this embed.
|
|
|
218
223
|
|
|
219
224
|
**Svelte**
|
|
220
225
|
|
|
221
|
-
Render this component inside the existing `
|
|
226
|
+
Render this component inside the existing `ConsentProvider`.
|
|
222
227
|
The provider from your quickstart supplies its consent state.
|
|
223
228
|
|
|
224
229
|
```svelte title="src/ConsentEmbed.svelte"
|
|
225
230
|
<script lang="ts">
|
|
226
|
-
import {
|
|
231
|
+
import { ConsentGate } from '@c15t/svelte';
|
|
227
232
|
import { embedCategory, embedURL, embedTitle, embedAspectRatio } from './embed-config';
|
|
228
233
|
</script>
|
|
229
234
|
|
|
230
|
-
<
|
|
235
|
+
<ConsentGate category={embedCategory}>
|
|
231
236
|
<iframe
|
|
232
237
|
src={embedURL}
|
|
233
238
|
title={embedTitle}
|
|
@@ -238,25 +243,25 @@ The provider from your quickstart supplies its consent state.
|
|
|
238
243
|
style:min-height="200px"
|
|
239
244
|
style:border="0"
|
|
240
245
|
></iframe>
|
|
241
|
-
</
|
|
246
|
+
</ConsentGate>
|
|
242
247
|
```
|
|
243
248
|
|
|
244
|
-
The Svelte `
|
|
249
|
+
The Svelte `ConsentGate` waits until the browser is mounted and the category is
|
|
245
250
|
allowed. Its default placeholder opens preferences. Revocation removes the
|
|
246
251
|
iframe.
|
|
247
252
|
|
|
248
253
|
**SvelteKit**
|
|
249
254
|
|
|
250
|
-
Render this component inside the existing `
|
|
251
|
-
Keep the SvelteKit root
|
|
255
|
+
Render this component inside the existing `ConsentRoot`.
|
|
256
|
+
Keep the SvelteKit root and its server-resolved state unchanged.
|
|
252
257
|
|
|
253
258
|
```svelte title="src/lib/ConsentEmbed.svelte"
|
|
254
259
|
<script lang="ts">
|
|
255
|
-
import {
|
|
260
|
+
import { ConsentGate } from '@c15t/svelte';
|
|
256
261
|
import { embedCategory, embedURL, embedTitle, embedAspectRatio } from '../embed-config';
|
|
257
262
|
</script>
|
|
258
263
|
|
|
259
|
-
<
|
|
264
|
+
<ConsentGate category={embedCategory}>
|
|
260
265
|
<iframe
|
|
261
266
|
src={embedURL}
|
|
262
267
|
title={embedTitle}
|
|
@@ -267,23 +272,44 @@ Keep the SvelteKit root provider and its server prefetch unchanged.
|
|
|
267
272
|
style:min-height="200px"
|
|
268
273
|
style:border="0"
|
|
269
274
|
></iframe>
|
|
270
|
-
</
|
|
275
|
+
</ConsentGate>
|
|
271
276
|
```
|
|
272
277
|
|
|
273
|
-
The Svelte `
|
|
278
|
+
The Svelte `ConsentGate` waits until the browser is mounted and the category is
|
|
274
279
|
allowed. Its default placeholder opens preferences. Revocation removes the
|
|
275
280
|
iframe.
|
|
276
281
|
|
|
282
|
+
**HTML**
|
|
283
|
+
|
|
284
|
+
The c15t script tag gates iframes that name a category. Put the embed's URL
|
|
285
|
+
in `data-src` instead of `src`, using the values from the configuration on
|
|
286
|
+
this page:
|
|
287
|
+
|
|
288
|
+
```html
|
|
289
|
+
<iframe
|
|
290
|
+
data-src="https://www.youtube-nocookie.com/embed/VIDEO_ID?playsinline=1"
|
|
291
|
+
data-category="measurement"
|
|
292
|
+
title="Product video"
|
|
293
|
+
loading="lazy"
|
|
294
|
+
allowfullscreen
|
|
295
|
+
></iframe>
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
c15t sets `src` once the category is allowed and removes it on revocation.
|
|
299
|
+
Without `src` the iframe loads nothing, so hide it with CSS and show a link
|
|
300
|
+
to `#c15t-preferences` in its place. See
|
|
301
|
+
[HTML embeds](https://v3.c15t.com/docs/frameworks/html/embeds).
|
|
302
|
+
|
|
277
303
|
**JavaScript**
|
|
278
304
|
|
|
279
|
-
Use the shared browser helper below with your existing
|
|
305
|
+
Use the shared browser helper below with your existing client. Put an
|
|
280
306
|
empty container where the embed should appear:
|
|
281
307
|
|
|
282
308
|
```html
|
|
283
309
|
<div id="consent-embed"></div>
|
|
284
310
|
```
|
|
285
311
|
|
|
286
|
-
In your browser entry point, after
|
|
312
|
+
In your browser entry point, after `init()`:
|
|
287
313
|
|
|
288
314
|
```ts
|
|
289
315
|
import { mountConsentEmbed } from './consent-embed';
|
|
@@ -291,13 +317,16 @@ import { mountConsentEmbed } from './consent-embed';
|
|
|
291
317
|
const container = document.querySelector<HTMLElement>('#consent-embed');
|
|
292
318
|
if (!container) throw new Error('Missing consent embed container');
|
|
293
319
|
|
|
294
|
-
const disposeEmbed = mountConsentEmbed(container, kernel,
|
|
320
|
+
const disposeEmbed = mountConsentEmbed(container, consent.kernel, () =>
|
|
321
|
+
consent.openDialog(),
|
|
322
|
+
);
|
|
295
323
|
```
|
|
296
324
|
|
|
297
|
-
`
|
|
298
|
-
|
|
299
|
-
`disposeEmbed()` when the page or component is
|
|
300
|
-
|
|
325
|
+
`consent` is the client from `init()` in your quickstart. With
|
|
326
|
+
`createConsentRuntime`, pass `runtime.kernel` and your own function that
|
|
327
|
+
opens preferences. Call `disposeEmbed()` when the page or component is
|
|
328
|
+
destroyed. Iframe markup with `data-src` and `data-category` also works
|
|
329
|
+
without the helper, because both setups gate iframes by default.
|
|
301
330
|
|
|
302
331
|
## Browser helper for Astro and JavaScript
|
|
303
332
|
|
|
@@ -306,51 +335,56 @@ when permission allows it, keeps an existing player mounted across unrelated
|
|
|
306
335
|
snapshot updates, and removes it on revocation.
|
|
307
336
|
|
|
308
337
|
```ts title="src/consent-embed.ts"
|
|
309
|
-
import {
|
|
338
|
+
import {
|
|
339
|
+
embedCategory,
|
|
340
|
+
embedURL,
|
|
341
|
+
embedTitle,
|
|
342
|
+
embedAspectRatio,
|
|
343
|
+
} from './embed-config';
|
|
310
344
|
|
|
311
345
|
type EmbedKernel = {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
346
|
+
getSnapshot: () => {
|
|
347
|
+
effectivePermissions: Record<typeof embedCategory, boolean>;
|
|
348
|
+
};
|
|
349
|
+
subscribe: (listener: () => void) => () => void;
|
|
316
350
|
};
|
|
317
351
|
|
|
318
352
|
export function mountConsentEmbed(
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
353
|
+
container: HTMLElement,
|
|
354
|
+
kernel: EmbedKernel,
|
|
355
|
+
openPreferences: () => void
|
|
322
356
|
) {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
357
|
+
const render = () => {
|
|
358
|
+
if (kernel.getSnapshot().effectivePermissions[embedCategory]) {
|
|
359
|
+
if (container.querySelector('iframe')) return;
|
|
360
|
+
const frame = document.createElement('iframe');
|
|
361
|
+
frame.src = embedURL;
|
|
362
|
+
frame.title = embedTitle;
|
|
363
|
+
frame.loading = 'lazy';
|
|
364
|
+
frame.allowFullscreen = true;
|
|
365
|
+
Object.assign(frame.style, {
|
|
366
|
+
width: '100%',
|
|
367
|
+
aspectRatio: embedAspectRatio,
|
|
368
|
+
minHeight: '200px',
|
|
369
|
+
border: '0',
|
|
370
|
+
});
|
|
371
|
+
container.replaceChildren(frame);
|
|
372
|
+
} else {
|
|
373
|
+
if (container.querySelector('button')) return;
|
|
374
|
+
const button = document.createElement('button');
|
|
375
|
+
button.type = 'button';
|
|
376
|
+
button.textContent = 'Open privacy settings to view this content';
|
|
377
|
+
button.onclick = openPreferences;
|
|
378
|
+
container.replaceChildren(button);
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
render();
|
|
383
|
+
const unsubscribe = kernel.subscribe(render);
|
|
384
|
+
return () => {
|
|
385
|
+
unsubscribe();
|
|
386
|
+
container.replaceChildren();
|
|
387
|
+
};
|
|
354
388
|
}
|
|
355
389
|
```
|
|
356
390
|
|
|
@@ -380,14 +414,19 @@ Set playback options in the iframe URL. For example, append `start=36` to begin
|
|
|
380
414
|
[YouTube player parameters](https://developers.google.com/youtube/player_parameters)
|
|
381
415
|
and reserve at least a 200-by-200-pixel player area.
|
|
382
416
|
|
|
383
|
-
React and Svelte `
|
|
384
|
-
consent action. Their `placeholder` APIs differ
|
|
385
|
-
takes a snippet. Keep a clear way to reopen preferences when customizing them.
|
|
417
|
+
React and Svelte `ConsentGate` components provide a blocked-state placeholder and
|
|
418
|
+
consent action. Their `placeholder` APIs differ. React takes a node, and
|
|
419
|
+
Svelte takes a snippet. Keep a clear way to reopen preferences when customizing them.
|
|
386
420
|
The Vue and browser examples show that action explicitly. `loading="lazy"` delays an
|
|
387
421
|
allowed iframe for performance; it does not implement consent gating.
|
|
388
422
|
|
|
389
423
|
## Consent behavior
|
|
390
424
|
|
|
425
|
+
Add `data-vendor="youtube"` next to `data-category` and declare a `youtube`
|
|
426
|
+
vendor in the runtime's `vendors` option or the backend manifest to let visitors
|
|
427
|
+
turn YouTube off while keeping the rest of the category on. See
|
|
428
|
+
[vendor consent for your framework](./overview.md#vendor-switches-and-cookie-cleanup).
|
|
429
|
+
|
|
391
430
|
Each example keeps the iframe absent until the category is allowed. After
|
|
392
431
|
permission, the iframe can load. Revoking permission removes the iframe and its
|
|
393
432
|
embedded document. Requests already sent cannot be recalled.
|
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.11",
|
|
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",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"dist",
|
|
47
47
|
"dist-types",
|
|
48
48
|
"AGENTS.md",
|
|
49
|
+
"SKILL.md",
|
|
49
50
|
"docs",
|
|
50
51
|
"styles.css",
|
|
51
52
|
"styles.tw3.css",
|
|
@@ -66,6 +67,11 @@
|
|
|
66
67
|
"import": "./dist/index.js",
|
|
67
68
|
"default": "./dist/index.js"
|
|
68
69
|
},
|
|
70
|
+
"./modes": {
|
|
71
|
+
"types": "./dist-types/modes.d.ts",
|
|
72
|
+
"import": "./dist/modes.js",
|
|
73
|
+
"default": "./dist/modes.js"
|
|
74
|
+
},
|
|
69
75
|
"./provider": {
|
|
70
76
|
"types": "./dist-types/provider.d.ts",
|
|
71
77
|
"import": "./dist/provider.js",
|
|
@@ -81,6 +87,11 @@
|
|
|
81
87
|
"import": "./dist/draft.js",
|
|
82
88
|
"default": "./dist/draft.js"
|
|
83
89
|
},
|
|
90
|
+
"./theme": {
|
|
91
|
+
"types": "./dist-types/index-parts/theme.d.ts",
|
|
92
|
+
"import": "./dist/index-parts/theme.js",
|
|
93
|
+
"default": "./dist/index-parts/theme.js"
|
|
94
|
+
},
|
|
84
95
|
"./module-hooks": {
|
|
85
96
|
"types": "./dist-types/module-hooks.d.ts",
|
|
86
97
|
"import": "./dist/module-hooks.js",
|
|
@@ -131,20 +142,35 @@
|
|
|
131
142
|
"import": "./dist/panel-trigger.js",
|
|
132
143
|
"default": "./dist/panel-trigger.js"
|
|
133
144
|
},
|
|
145
|
+
"./consent-gate": {
|
|
146
|
+
"types": "./dist-types/consent-gate.d.ts",
|
|
147
|
+
"import": "./dist/consent-gate.js",
|
|
148
|
+
"default": "./dist/consent-gate.js"
|
|
149
|
+
},
|
|
134
150
|
"./frame": {
|
|
135
|
-
"types": "./dist-types/
|
|
136
|
-
"import": "./dist/
|
|
137
|
-
"default": "./dist/
|
|
151
|
+
"types": "./dist-types/consent-gate.d.ts",
|
|
152
|
+
"import": "./dist/consent-gate.js",
|
|
153
|
+
"default": "./dist/consent-gate.js"
|
|
138
154
|
},
|
|
139
155
|
"./iab": {
|
|
140
156
|
"types": "./dist-types/iab.d.ts",
|
|
141
157
|
"import": "./dist/iab.js",
|
|
142
158
|
"default": "./dist/iab.js"
|
|
143
159
|
},
|
|
160
|
+
"./gpp": {
|
|
161
|
+
"types": "./dist-types/gpp.d.ts",
|
|
162
|
+
"import": "./dist/gpp.js",
|
|
163
|
+
"default": "./dist/gpp.js"
|
|
164
|
+
},
|
|
144
165
|
"./styles.css": "./dist/styles.css",
|
|
145
166
|
"./styles.tw3.css": "./dist/styles.tw3.css",
|
|
146
167
|
"./iab/styles.css": "./dist/iab/styles.css",
|
|
147
168
|
"./iab/styles.tw3.css": "./dist/iab/styles.tw3.css",
|
|
169
|
+
"./postcss-tailwind3": {
|
|
170
|
+
"types": "./dist-types/postcss-tailwind3.d.ts",
|
|
171
|
+
"import": "./dist/postcss-tailwind3.js",
|
|
172
|
+
"default": "./dist/postcss-tailwind3.js"
|
|
173
|
+
},
|
|
148
174
|
"./primitives": {
|
|
149
175
|
"types": "./dist-types/primitives.d.ts",
|
|
150
176
|
"import": "./dist/primitives.js",
|
|
@@ -190,10 +216,15 @@
|
|
|
190
216
|
"import": "./dist/components/preferences/index.js",
|
|
191
217
|
"default": "./dist/components/preferences/index.js"
|
|
192
218
|
},
|
|
219
|
+
"./components/consent-gate": {
|
|
220
|
+
"types": "./dist-types/components/consent-gate/index.d.ts",
|
|
221
|
+
"import": "./dist/components/consent-gate/index.js",
|
|
222
|
+
"default": "./dist/components/consent-gate/index.js"
|
|
223
|
+
},
|
|
193
224
|
"./components/frame": {
|
|
194
|
-
"types": "./dist-types/components/
|
|
195
|
-
"import": "./dist/components/
|
|
196
|
-
"default": "./dist/components/
|
|
225
|
+
"types": "./dist-types/components/consent-gate/index.d.ts",
|
|
226
|
+
"import": "./dist/components/consent-gate/index.js",
|
|
227
|
+
"default": "./dist/components/consent-gate/index.js"
|
|
197
228
|
},
|
|
198
229
|
"./context": {
|
|
199
230
|
"types": "./dist-types/context/index.d.ts",
|
|
@@ -233,27 +264,27 @@
|
|
|
233
264
|
"test:watch": "bun prebuild && vitest"
|
|
234
265
|
},
|
|
235
266
|
"dependencies": {
|
|
236
|
-
"@c15t/core": "3.0.0-alpha.
|
|
237
|
-
"@c15t/dev-tools": "3.0.0-alpha.
|
|
238
|
-
"@c15t/iab": "3.0.0-alpha.
|
|
239
|
-
"@c15t/schema": "3.0.0-alpha.
|
|
240
|
-
"@c15t/translations": "3.0.0-alpha.
|
|
241
|
-
"@c15t/ui": "3.0.0-alpha.
|
|
267
|
+
"@c15t/core": "3.0.0-alpha.11",
|
|
268
|
+
"@c15t/dev-tools": "3.0.0-alpha.11",
|
|
269
|
+
"@c15t/iab": "3.0.0-alpha.11",
|
|
270
|
+
"@c15t/schema": "3.0.0-alpha.9",
|
|
271
|
+
"@c15t/translations": "3.0.0-alpha.6",
|
|
272
|
+
"@c15t/ui": "3.0.0-alpha.11",
|
|
242
273
|
"@types/google.maps": "3.65.3"
|
|
243
274
|
},
|
|
244
275
|
"devDependencies": {
|
|
245
|
-
"@c15t/backend": "3.0.0-alpha.
|
|
276
|
+
"@c15t/backend": "3.0.0-alpha.11",
|
|
246
277
|
"@c15t/conformance": "0.0.1",
|
|
247
278
|
"@c15t/typescript-config": "0.0.1",
|
|
248
279
|
"@c15t/vitest-config": "1.0.0",
|
|
249
|
-
"@iabtechlabtcf/core": "^1.5.
|
|
280
|
+
"@iabtechlabtcf/core": "^1.5.22",
|
|
250
281
|
"genversion": "3.2.0",
|
|
251
282
|
"msw": "^2.14.6",
|
|
252
283
|
"typescript": "7.0.2"
|
|
253
284
|
},
|
|
254
285
|
"peerDependencies": {
|
|
255
|
-
"react": "^
|
|
256
|
-
"react-dom": "^
|
|
286
|
+
"react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
287
|
+
"react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
257
288
|
},
|
|
258
289
|
"peerDependenciesMeta": {
|
|
259
290
|
"react": {
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{evaluateConsent as e}from"@c15t/core";import{useCallback as t,useContext as a,useMemo as i}from"react";import{ProviderServicesContext as n}from"../context.js";import{useConsentManagerDraft as s}from"../draft.js";import{useActiveUI as r,useBranding as o,useConsents as l,useModel as p,usePolicyCategories as c,usePolicyScopeMode as u,usePreferencesPresentation as m,usePromptPresentation as d,useSetActiveUI as f,useSnapshot as y,useSubscribeToConsentChanges as g,useTranslations as v}from"../hooks.js";import{defaultTranslationConfig as C}from"../utils/default-translation-config.js";let T={},b=[{defaultValue:!0,description:"Required for basic site functionality",disabled:!0,display:!0,gdprType:1,name:"necessary"},{defaultValue:!1,description:"Enables enhanced features",display:!0,gdprType:2,name:"functionality"},{defaultValue:!1,description:"Analytics and performance measurement",display:!0,gdprType:4,name:"measurement"},{defaultValue:!1,description:"Improves your experience",display:!0,gdprType:3,name:"experience"},{defaultValue:!1,description:"Advertising and marketing",display:!0,gdprType:5,name:"marketing"}],x=function(){let x=y(),D=a(n),h=l(),R=r(),S=o(),V=p(),j=d(),k=c(),q=m(),w=u(),{draft:I,save:A}=s(),M=f(),O=g(),P=v(),_=i(()=>P?{...C,defaultLanguage:P.language,translations:{...C.translations,[P.language]:P.translations}}:C,[P]),B=i(()=>["necessary",...k],[k]),E=i(()=>[...D?.getConsentCategories()??B],[D,B]),L=t(()=>{let e=new Set(E);return b.filter(t=>e.has(t.name)).map(e=>({...e,display:!0}))},[E]),U=t(t=>e({category:t},x),[x]),z=t(e=>{M(e)},[M]),F=t(async(e,t)=>{"custom"===e?await A():await A("all"===e?"all":"none")},[A]),G=t((e,t)=>{E.includes(e)&&I.set(e,t)},[I,E]),H=t(e=>{},[]),J=t(e=>O(e),[O]);return{activeUI:R??"none",branding:S??"c15t",consentCategories:E,consentTypes:L(),consents:h,draftIsStale:I.isStale,effectivePermissions:x.effectivePermissions,explicitChoice:x.explicitChoice,getDisplayedConsents:L,has:U,iab:x.iab,manager:null,model:V??"opt-in",noticeDismissal:x.noticeDismissal,optOutDirectives:x.optOutDirectives,policyBanner:j??T,policyCategories:B,policyDialog:q??T,policyRule:x.policyRule,policyScopeMode:w,privacySignals:x.privacySignals,promptRequirement:x.promptRequirement,resetDraft:I.reset,resolution:x.resolution,restrictions:x.restrictions,saveConsents:F,selectedConsentTypes:I.values,selectedConsents:I.values,setActiveUI:z,setSelectedConsent:G,subscribeToConsentChanges:J,translationConfig:_,updateConsentCategories:H}};export{x as useConsentManager};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import t from"@c15t/ui/styles/components/frame";import{forwardRef as r}from"react";import{useTranslations as a}from"../../component-hooks/use-translations.js";import{Box as o}from"../shared/primitives/box.js";import{ConsentButton as i}from"../shared/primitives/button.js";let m=r(({children:r,...a},i)=>e(o,{ref:i,baseClassName:t.placeholder,"data-testid":"frame-placeholder",...a,children:r})),l=r(({children:r,category:i,...m},l)=>{let{frame:s,consentTypes:n}=a(),p=i&&s?.title?s.title.replace("{category}",n?.[i]?.title??i):void 0;return e(o,{ref:l,baseClassName:t.title,...m,children:r??p})}),s=r(({children:t,category:r,...o},m)=>{let{frame:l,consentTypes:s}=a(),n=s?.[r]?.title??r,p=l?.actionButton?.replace("{category}",n);return e(i,{mode:"stroke",size:"small",variant:"primary",...o,ref:m,action:"open-consent-dialog",category:r,"data-testid":"frame-open-dialog",children:t??p})});m.displayName="FrameRoot",l.displayName="FrameTitle",s.displayName="FrameButton";export{s as FrameButton,m as FrameRoot,l as FrameTitle};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{forwardRef as r,useEffect as t}from"react";import{useConsentManager as i}from"../../component-hooks/use-manager.js";import{useTranslations as l}from"../../component-hooks/use-translations.js";import{FrameButton as n,FrameRoot as s,FrameTitle as c}from"./atoms.js";let a=({category:r,policyBlocked:t,policyBlockedMessage:i})=>o(s,{children:[e(c,{category:r,children:t?i??"This content is unavailable under your region's consent policy.":void 0}),t?null:e(n,{category:r})]}),m=r(({children:o,category:r,placeholder:n,noStyle:s,className:c,theme:m,...d},p)=>{let{has:y,updateConsentCategories:u,consentCategories:h,policyCategories:g,policyScopeMode:f}=i(),{frame:k}=l(),j=y(r),v=Array.isArray(g)&&g.length>0&&!g.includes("*")&&!g.includes(r);return t(()=>{h.includes(r)||u([...h,r])},[r,h,u]),e("div",{ref:p,className:c,...d,children:j?o:n||e(a,{category:r,policyBlocked:"strict"===f&&v,policyBlockedMessage:k?.policyBlocked})})});m.displayName="Frame";let d=m;export{d as Frame};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{Frame as t}from"./frame.js";import*as e from"./atoms.js";let r=Object.assign(t,{Button:e.FrameButton,Root:e.FrameRoot,Title:e.FrameTitle});var a=e.FrameButton,m=e.FrameRoot,o=e.FrameTitle;export{a as FrameButton,m as FrameRoot,o as FrameTitle,r as Frame};
|
package/dist/frame.js
DELETED
package/dist/ui-save.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e=new WeakMap,t=t=>{e.set(t,{})},n=async(n,a,i)=>{let o={};e.set(n,o);let l="dialog"===n.getSnapshot().activeUI,s=a();l&&e.get(n)===o&&n.set.activeUI("dialog");let g=n.subscribe(a=>{l&&"dialog"!==a.activeUI&&e.get(n)===o&&t(n)});try{let t=await s;if(t.ok&&i()&&l&&e.get(n)===o){let e=n.getSnapshot();n.set.activeUI(e.policyPending||"failed"===e.resolution.status||"none"===e.promptRequirement.kind?"none":"banner")}return t}finally{g()}};export{t as invalidateConsentUIAction,n as saveConsentUI};
|