@c15t/browser 3.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/AGENTS.md +64 -0
  2. package/CHANGELOG.md +27 -0
  3. package/README.md +128 -0
  4. package/dist/861.js +1079 -0
  5. package/dist/925.js +649 -0
  6. package/dist/c15t.css +213 -0
  7. package/dist/c15t.devtools.js +1 -0
  8. package/dist/c15t.headless.js +1 -0
  9. package/dist/c15t.iab.css +190 -0
  10. package/dist/c15t.iab.js +221 -0
  11. package/dist/c15t.js +30 -0
  12. package/dist/devtools.js +11 -0
  13. package/dist/headless.js +17 -0
  14. package/dist/iab.js +784 -0
  15. package/dist/index.js +17 -0
  16. package/dist-types/auto-init.d.ts +42 -0
  17. package/dist-types/client.d.ts +51 -0
  18. package/dist-types/deferred.d.ts +13 -0
  19. package/dist-types/devtools.d.ts +32 -0
  20. package/dist-types/entries/cdn-devtools.d.ts +13 -0
  21. package/dist-types/entries/cdn-headless.d.ts +8 -0
  22. package/dist-types/entries/cdn-iab.d.ts +1 -0
  23. package/dist-types/entries/cdn.d.ts +8 -0
  24. package/dist-types/gated-scripts.d.ts +35 -0
  25. package/dist-types/generated/iab-styles.d.ts +144 -0
  26. package/dist-types/generated/styles.d.ts +137 -0
  27. package/dist-types/global.d.ts +112 -0
  28. package/dist-types/headless.d.ts +41 -0
  29. package/dist-types/iab/mount.d.ts +8 -0
  30. package/dist-types/iab/preferences.d.ts +9 -0
  31. package/dist-types/iab/styles.d.ts +2 -0
  32. package/dist-types/iab/surface.d.ts +4 -0
  33. package/dist-types/iab/vendor-disclosures.d.ts +14 -0
  34. package/dist-types/iab.d.ts +20 -0
  35. package/dist-types/index.d.ts +43 -0
  36. package/dist-types/transports/manifest.d.ts +62 -0
  37. package/dist-types/transports/offline.d.ts +18 -0
  38. package/dist-types/types.d.ts +290 -0
  39. package/dist-types/ui/actions.d.ts +29 -0
  40. package/dist-types/ui/banner.d.ts +13 -0
  41. package/dist-types/ui/branding.d.ts +25 -0
  42. package/dist-types/ui/copy.d.ts +28 -0
  43. package/dist-types/ui/dialog.d.ts +14 -0
  44. package/dist-types/ui/dom.d.ts +48 -0
  45. package/dist-types/ui/mount.d.ts +27 -0
  46. package/dist-types/ui/surface.d.ts +43 -0
  47. package/dist-types/ui/trigger.d.ts +14 -0
  48. package/dist-types/ui/widget.d.ts +27 -0
  49. package/dist-types/version.d.ts +1 -0
  50. package/docs/README.md +64 -0
  51. package/docs/frameworks/javascript/script-loader.md +47 -0
  52. package/docs/frameworks/javascript/script-tag.md +375 -0
  53. package/docs/integrations/adobe-analytics.md +294 -0
  54. package/docs/integrations/ahrefs-analytics.md +291 -0
  55. package/docs/integrations/amplitude.md +292 -0
  56. package/docs/integrations/building-integrations.md +47 -0
  57. package/docs/integrations/clearbit.md +291 -0
  58. package/docs/integrations/cloudflare-web-analytics.md +292 -0
  59. package/docs/integrations/crisp.md +294 -0
  60. package/docs/integrations/databuddy.md +311 -0
  61. package/docs/integrations/fathom-analytics.md +293 -0
  62. package/docs/integrations/google-maps.md +384 -0
  63. package/docs/integrations/google-tag-manager.md +306 -0
  64. package/docs/integrations/google-tag.md +305 -0
  65. package/docs/integrations/heap.md +292 -0
  66. package/docs/integrations/hightouch.md +293 -0
  67. package/docs/integrations/hotjar.md +292 -0
  68. package/docs/integrations/intercom.md +285 -0
  69. package/docs/integrations/linkedin-insights.md +291 -0
  70. package/docs/integrations/logrocket.md +293 -0
  71. package/docs/integrations/matomo-analytics.md +316 -0
  72. package/docs/integrations/meta-pixel.md +285 -0
  73. package/docs/integrations/microsoft-clarity.md +292 -0
  74. package/docs/integrations/microsoft-uet.md +291 -0
  75. package/docs/integrations/mixpanel-analytics.md +295 -0
  76. package/docs/integrations/openai-pixel.md +441 -0
  77. package/docs/integrations/overview.md +111 -0
  78. package/docs/integrations/pirsch.md +295 -0
  79. package/docs/integrations/plausible-analytics.md +295 -0
  80. package/docs/integrations/posthog.md +397 -0
  81. package/docs/integrations/promptwatch.md +291 -0
  82. package/docs/integrations/reddit-pixel.md +294 -0
  83. package/docs/integrations/rudderstack.md +328 -0
  84. package/docs/integrations/rybbit-analytics.md +296 -0
  85. package/docs/integrations/segment.md +292 -0
  86. package/docs/integrations/snapchat-pixel.md +293 -0
  87. package/docs/integrations/tiktok-pixel.md +291 -0
  88. package/docs/integrations/umami-analytics.md +295 -0
  89. package/docs/integrations/vercel-analytics.md +293 -0
  90. package/docs/integrations/x-pixel.md +291 -0
  91. package/docs/integrations/youtube.md +405 -0
  92. package/package.json +117 -0
  93. package/readme.json +44 -0
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ import { client_createConsentClient } from "./925.js";
2
+ import { mountConsentUI as mount_mountConsentUI } from "./861.js";
3
+ const PKG = '@c15t/browser';
4
+ const src_createConsentClient = function(options = {}) {
5
+ return client_createConsentClient(options, {
6
+ mountUI: mount_mountConsentUI,
7
+ pkg: PKG
8
+ });
9
+ };
10
+ const src_init = function(options = {}) {
11
+ const client = src_createConsentClient(options);
12
+ client.start();
13
+ return client;
14
+ };
15
+ export { ACTION_ATTRIBUTE, ACTIVATED_ATTRIBUTE, CATEGORY_ATTRIBUTE, PREFERENCES_HASH, activateGatedScripts, custom, hosted, manifest, manifestNeedsLocation, offline, resolveRules, version } from "./925.js";
16
+ export { mountConsentUI } from "./861.js";
17
+ export { src_createConsentClient as createConsentClient, src_init as init };
@@ -0,0 +1,42 @@
1
+ import type { ConsentClientOptions } from './types';
2
+ /** Attribute that turns auto-init off so the page calls `c15t.init()`. */
3
+ export declare const MANUAL_ATTRIBUTE = "data-manual";
4
+ /**
5
+ * Read client options from a `<script>` tag's `data-*` attributes.
6
+ *
7
+ * ```html
8
+ * <script src="https://cdn.jsdelivr.net/npm/@c15t/browser/dist/c15t.js"
9
+ * data-backend-url="https://your-instance.c15t.dev"
10
+ * data-categories="measurement,marketing"
11
+ * data-color-scheme="dark"
12
+ * data-privacy-policy-url="/privacy"
13
+ * defer></script>
14
+ * ```
15
+ *
16
+ * @param element - The script element, or `null` outside a classic script.
17
+ * @returns Options for `init()`.
18
+ */
19
+ export declare const readScriptOptions: (element: Element | null) => ConsentClientOptions;
20
+ /**
21
+ * Layer one options object over another. `ui` and its banner/dialog
22
+ * option objects merge, so a queued `config` can change the branding
23
+ * without discarding the script tag's legal links. Booleans replace
24
+ * the corresponding UI or surface configuration.
25
+ *
26
+ * @param base - The options underneath.
27
+ * @param override - The options on top.
28
+ * @returns The merged options.
29
+ */
30
+ export declare const mergeClientOptions: (base: ConsentClientOptions, override: ConsentClientOptions) => ConsentClientOptions;
31
+ /**
32
+ * Resolve the page's options: the script tag's attributes first, then each
33
+ * queued `config` call on top, in order.
34
+ *
35
+ * @param script - The current script element.
36
+ * @param configs - Options queued as `['config', options]` before load.
37
+ * @returns Options and whether the page asked to init itself.
38
+ */
39
+ export declare const readPageOptions: (script: Element | null, configs?: ConsentClientOptions[]) => {
40
+ options: ConsentClientOptions;
41
+ manual: boolean;
42
+ };
@@ -0,0 +1,51 @@
1
+ import { custom, hosted } from '@c15t/core';
2
+ import type { PolicyRule, Unsubscribe } from '@c15t/core';
3
+ import type { ConsentRuntimeIABFactory } from '@c15t/core/runtime';
4
+ import type { ConsentClient, ConsentClientOptions, ConsentUIMounter } from './types';
5
+ export { custom, hosted };
6
+ /** Attribute a page element can carry to drive the client on click. */
7
+ export declare const ACTION_ATTRIBUTE = "data-c15t-action";
8
+ /** Link fragment that opens the preference centre, matching `@c15t/astro`. */
9
+ export declare const PREFERENCES_HASH = "#c15t-preferences";
10
+ /** Values `data-c15t-action` accepts. */
11
+ export type PageAction = 'accept' | 'reject' | 'customize' | 'dismiss' | 'close' | 'banner';
12
+ /** Extra wiring the entry points hand to the client. */
13
+ export interface CreateConsentClientContext {
14
+ /** Install entry-specific globals before runtime initialization. */
15
+ onStart?: (options: ConsentClientOptions) => () => void;
16
+ /** Optional CMP factory supplied exclusively by the IAB entry. */
17
+ createIAB?: ConsentRuntimeIABFactory;
18
+ /** Mounts the prebuilt UI. Absent in the headless build. */
19
+ mountUI?: ConsentUIMounter;
20
+ /** Package name reported on `window.c15t`. */
21
+ pkg?: string;
22
+ }
23
+ /**
24
+ * Turn preset names into policy rules.
25
+ *
26
+ * @param policyRules - Rules, preset names, or a mix.
27
+ * @returns Rules only, or `undefined` when none were given.
28
+ * @throws {Error} On a name `policyRulePresets` does not export.
29
+ */
30
+ export declare const resolveRules: (policyRules: ConsentClientOptions['policyRules']) => PolicyRule[] | undefined;
31
+ /**
32
+ * Create the page's consent client without starting it.
33
+ *
34
+ * Construction has no DOM or storage effects. Call {@link ConsentClient.start}
35
+ * to hydrate stored records, resolve the policy and mount the UI.
36
+ *
37
+ * @param options - Client options.
38
+ * @param context - Entry-point wiring.
39
+ * @returns The client.
40
+ * @throws {Error} When the mode cannot be resolved from the options.
41
+ */
42
+ export declare const createConsentClient: (options?: ConsentClientOptions, context?: CreateConsentClientContext) => ConsentClient;
43
+ /**
44
+ * Create and start a client in one call.
45
+ *
46
+ * @param options - Client options.
47
+ * @param context - Entry-point wiring.
48
+ * @returns The started client.
49
+ */
50
+ export declare const initConsentClient: (options?: ConsentClientOptions, context?: CreateConsentClientContext) => ConsentClient;
51
+ export type { Unsubscribe };
@@ -0,0 +1,13 @@
1
+ /** A promise plus the functions that settle it. */
2
+ export interface Deferred<Value> {
3
+ promise: Promise<Value>;
4
+ resolve: (value: Value) => void;
5
+ reject: (reason: unknown) => void;
6
+ }
7
+ /**
8
+ * Create a promise that something else settles later, such as a kernel
9
+ * event. `Promise.withResolvers` where the browser has it.
10
+ *
11
+ * @returns The deferred.
12
+ */
13
+ export declare const createDeferred: <Value>() => Deferred<Value>;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * `@c15t/browser/devtools` — the c15t DevTools panel for the script-tag
3
+ * client, the way `@c15t/react/devtools` mounts it for a React provider.
4
+ *
5
+ * The panel inspects consents, scripts, policy and events, and its
6
+ * Location tab changes country, region, language and GPC and re-runs
7
+ * init, so a geo-keyed policy can be tried without spoofing headers.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * import { init } from '@c15t/browser';
12
+ * import { mountDevTools } from '@c15t/browser/devtools';
13
+ *
14
+ * const client = init({ backendURL: 'https://your-instance.c15t.dev' });
15
+ * if (import.meta.env.DEV) {
16
+ * mountDevTools(client, { defaultOpen: true, defaultTab: 'location' });
17
+ * }
18
+ * ```
19
+ */
20
+ import type { DevToolsInstance, DevToolsOptions } from '@c15t/dev-tools';
21
+ import type { ConsentClient } from './types';
22
+ /** Presentation options; the kernel and categories come from the client. */
23
+ export type BrowserDevToolsOptions = Omit<DevToolsOptions, 'getConsentCategories' | 'kernel'>;
24
+ /**
25
+ * Mount the DevTools panel against a client.
26
+ *
27
+ * @param client - The page's client.
28
+ * @param options - Panel placement and initial state.
29
+ * @returns The panel; call `destroy()` to remove it.
30
+ */
31
+ export declare const mountDevTools: (client: ConsentClient, options?: BrowserDevToolsOptions) => DevToolsInstance;
32
+ export type { DevToolsActions, DevToolsInstance, DevToolsPosition, DevToolsTab, } from '@c15t/dev-tools';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * `dist/c15t.devtools.js` — the DevTools panel as a second script tag.
3
+ *
4
+ * ```html
5
+ * <script src=".../c15t.js" data-backend-url="..." defer></script>
6
+ * <script src=".../c15t.devtools.js" data-open data-tab="location" defer></script>
7
+ * ```
8
+ *
9
+ * Order does not matter: loaded first, it queues itself on `window.c15t`
10
+ * the way any pre-load call does and mounts once the client initialises.
11
+ * The panel lands on `window.c15t.devtools`.
12
+ */
13
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * `dist/c15t.headless.js` — the runtime with no UI or CSS.
3
+ *
4
+ * Installs `window.c15t` and initialises from the script tag unless it
5
+ * carries `data-manual`. The page renders its own banner against the
6
+ * client's events and `data-c15t-action` buttons.
7
+ */
8
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * `dist/c15t.js` — the one-tag install.
3
+ *
4
+ * Installs `window.c15t`, then initialises from the script tag's `data-*`
5
+ * attributes and any queued `config` calls unless the tag carries
6
+ * `data-manual`.
7
+ */
8
+ export {};
@@ -0,0 +1,35 @@
1
+ import type { ConsentSnapshot } from '@c15t/core';
2
+ /** Attribute that names the category an inert `<script>` waits on. */
3
+ export declare const CATEGORY_ATTRIBUTE = "data-c15t-category";
4
+ /** Set once a gated script has been activated (or rejected as invalid). */
5
+ export declare const ACTIVATED_ATTRIBUTE = "data-c15t-activated";
6
+ /** A client's script queue, cancelled when that client is disposed. */
7
+ interface GatedScriptActivator {
8
+ scan: () => number;
9
+ dispose: () => void;
10
+ }
11
+ /**
12
+ * Own activation ordering without retaining a client outside its lifecycle.
13
+ *
14
+ * @param getSnapshot - Read current consent before each activation.
15
+ * @param root - Where to look. Defaults to the document when scanning.
16
+ * @returns A scanner and its disposal function.
17
+ * @internal
18
+ */
19
+ export declare const createGatedScriptActivator: (getSnapshot: () => ConsentSnapshot, root?: ParentNode) => GatedScriptActivator;
20
+ /**
21
+ * Run inert `<script type="text/plain" data-c15t-category="…">` tags whose
22
+ * categories the snapshot grants. Non-async scripts run in document order,
23
+ * waiting for each external script to load or fail before continuing.
24
+ *
25
+ * Call again when consent changes so waiting scripts use the latest snapshot.
26
+ * Each script runs at most once; withdrawing consent after activation requires
27
+ * vendor cleanup or a page reload.
28
+ *
29
+ * @param snapshot - The kernel snapshot.
30
+ * @param root - Where to look. Defaults to the document.
31
+ * @returns How many scripts were activated immediately. Others may be waiting
32
+ * for an earlier external script.
33
+ */
34
+ export declare const activateGatedScripts: (snapshot: ConsentSnapshot, root?: ParentNode) => number;
35
+ export {};
@@ -0,0 +1,144 @@
1
+ export declare const stylesheet: string;
2
+ export declare const classes: {
3
+ readonly banner: {
4
+ readonly root: "c15t-ui-root-wCtZ2";
5
+ readonly bannerVisible: "c15t-ui-bannerVisible-uqQdb";
6
+ readonly bannerHidden: "c15t-ui-bannerHidden-KVkXf";
7
+ readonly cardShell: "c15t-ui-cardShell-pmM71";
8
+ readonly card: "c15t-ui-card-lJZdN";
9
+ readonly header: "c15t-ui-header-WMRYy";
10
+ readonly title: "c15t-ui-title-iMdl2";
11
+ readonly description: "c15t-ui-description-_ZLiC";
12
+ readonly partnersLink: "c15t-ui-partnersLink-yKsgB";
13
+ readonly purposeList: "c15t-ui-purposeList-Qz2Eo";
14
+ readonly purposeMore: "c15t-ui-purposeMore-aANSf";
15
+ readonly legitimateInterestNotice: "c15t-ui-legitimateInterestNotice-QtcwV";
16
+ readonly privacyLink: "c15t-ui-privacyLink-RYh_l";
17
+ readonly footer: "c15t-ui-footer-danOO";
18
+ readonly overlay: "c15t-ui-overlay-OPamO";
19
+ readonly overlayVisible: "c15t-ui-overlayVisible-JAO1l";
20
+ readonly overlayHidden: "c15t-ui-overlayHidden-zfbJA";
21
+ };
22
+ readonly dialog: {
23
+ readonly root: "c15t-ui-root-pWvoN";
24
+ readonly dialogVisible: "c15t-ui-dialogVisible-ZcQux";
25
+ readonly dialogHidden: "c15t-ui-dialogHidden-QOLab";
26
+ readonly contentVisible: "c15t-ui-contentVisible-oIYEE";
27
+ readonly contentHidden: "c15t-ui-contentHidden-dppgu";
28
+ readonly overlay: "c15t-ui-overlay-LyBwJ";
29
+ readonly overlayVisible: "c15t-ui-overlayVisible-HyYf_";
30
+ readonly overlayHidden: "c15t-ui-overlayHidden-G8kpl";
31
+ readonly card: "c15t-ui-card-DTFr5";
32
+ readonly header: "c15t-ui-header-wVNlq";
33
+ readonly headerContent: "c15t-ui-headerContent-djclo";
34
+ readonly title: "c15t-ui-title-PNS3O";
35
+ readonly description: "c15t-ui-description-kGL5G";
36
+ readonly closeButton: "c15t-ui-closeButton-LDT86";
37
+ readonly body: "c15t-ui-body-IFzVC";
38
+ readonly tabsContainer: "c15t-ui-tabsContainer-CGMHA";
39
+ readonly tabsList: "c15t-ui-tabsList-w5OMX";
40
+ readonly tabButton: "c15t-ui-tabButton-TaxQK";
41
+ readonly tabIndicator: "c15t-ui-tabIndicator-ipeu4";
42
+ readonly content: "c15t-ui-content-tpKyG";
43
+ readonly purposeItem: "c15t-ui-purposeItem-ycHg8";
44
+ readonly purposeHeader: "c15t-ui-purposeHeader-dtjf3";
45
+ readonly purposeTrigger: "c15t-ui-purposeTrigger-RYEFG";
46
+ readonly purposeArrow: "c15t-ui-purposeArrow-O8n8H";
47
+ readonly purposeInfo: "c15t-ui-purposeInfo-wahTP";
48
+ readonly purposeName: "c15t-ui-purposeName-QJMF_";
49
+ readonly lockIcon: "c15t-ui-lockIcon-i8SD3";
50
+ readonly purposeMeta: "c15t-ui-purposeMeta-OC9IY";
51
+ readonly legitimateInterestBadge: "c15t-ui-legitimateInterestBadge-t0cqx";
52
+ readonly legitimateInterestIcon: "c15t-ui-legitimateInterestIcon-Pvt34";
53
+ readonly srOnly: "c15t-ui-srOnly-n1PBG";
54
+ readonly purposeContent: "c15t-ui-purposeContent-teoEc";
55
+ readonly purposeDescription: "c15t-ui-purposeDescription-eLaj6";
56
+ readonly examplesToggle: "c15t-ui-examplesToggle-UKJ4l";
57
+ readonly examplesList: "c15t-ui-examplesList-Jgu0V";
58
+ readonly vendorsToggle: "c15t-ui-vendorsToggle-iiROe";
59
+ readonly vendorSection: "c15t-ui-vendorSection-Xotxt";
60
+ readonly vendorSectionTitle: "c15t-ui-vendorSectionTitle-fDzFC";
61
+ readonly vendorSectionTitleLi: "c15t-ui-vendorSectionTitleLi-_EU2B";
62
+ readonly vendorRow: "c15t-ui-vendorRow-MdJwv";
63
+ readonly vendorRowLi: "c15t-ui-vendorRowLi-TR3to";
64
+ readonly vendorInfo: "c15t-ui-vendorInfo-cLXjo";
65
+ readonly vendorName: "c15t-ui-vendorName-U5tbA";
66
+ readonly customVendorIcon: "c15t-ui-customVendorIcon-xE8uf";
67
+ readonly vendorDetails: "c15t-ui-vendorDetails-nJLMH";
68
+ readonly vendorDetail: "c15t-ui-vendorDetail-qWyPR";
69
+ readonly vendorDetailLi: "c15t-ui-vendorDetailLi-HiywZ";
70
+ readonly stackItem: "c15t-ui-stackItem-Z6dCC";
71
+ readonly stackHeader: "c15t-ui-stackHeader-TkNdL";
72
+ readonly stackTrigger: "c15t-ui-stackTrigger-Kqeyy";
73
+ readonly stackInfo: "c15t-ui-stackInfo-JH0ue";
74
+ readonly stackName: "c15t-ui-stackName-yNHhd";
75
+ readonly stackMeta: "c15t-ui-stackMeta-Il_rX";
76
+ readonly stackControls: "c15t-ui-stackControls-kBZON";
77
+ readonly partialIndicator: "c15t-ui-partialIndicator-U9dt6";
78
+ readonly stackDescription: "c15t-ui-stackDescription-occgV";
79
+ readonly stackContent: "c15t-ui-stackContent-wu6FF";
80
+ readonly specialPurposesSection: "c15t-ui-specialPurposesSection-y9Pqu";
81
+ readonly specialPurposesHeader: "c15t-ui-specialPurposesHeader-Rq1Tg";
82
+ readonly specialPurposesTitle: "c15t-ui-specialPurposesTitle-tcftu";
83
+ readonly infoIcon: "c15t-ui-infoIcon-Egw87";
84
+ readonly tooltip: "c15t-ui-tooltip-XjaZq";
85
+ readonly tooltipVisible: "c15t-ui-tooltipVisible-saaoQ";
86
+ readonly vendorListHeader: "c15t-ui-vendorListHeader-Hfxxu";
87
+ readonly searchContainer: "c15t-ui-searchContainer-uyKJB";
88
+ readonly searchIcon: "c15t-ui-searchIcon-NhyW4";
89
+ readonly searchInput: "c15t-ui-searchInput-cLLuO";
90
+ readonly vendorCount: "c15t-ui-vendorCount-s4d6i";
91
+ readonly selectedVendorBanner: "c15t-ui-selectedVendorBanner-S6KCv";
92
+ readonly selectedVendorText: "c15t-ui-selectedVendorText-jjIQi";
93
+ readonly clearSelectionButton: "c15t-ui-clearSelectionButton-yz3Zx";
94
+ readonly clearIcon: "c15t-ui-clearIcon-sTZC2";
95
+ readonly vendorListItem: "c15t-ui-vendorListItem-NwBiX";
96
+ readonly vendorListItemHeader: "c15t-ui-vendorListItemHeader-fBe_O";
97
+ readonly vendorConsentControl: "c15t-ui-vendorConsentControl-VC70A";
98
+ readonly vendorConsentSwitch: "c15t-ui-vendorConsentSwitch-wEFf8";
99
+ readonly vendorListTrigger: "c15t-ui-vendorListTrigger-TG_0F";
100
+ readonly vendorListInfo: "c15t-ui-vendorListInfo-BSgBB";
101
+ readonly vendorListName: "c15t-ui-vendorListName-II_BV";
102
+ readonly vendorListMeta: "c15t-ui-vendorListMeta-wa6UC";
103
+ readonly vendorListMetaText: "c15t-ui-vendorListMetaText-MS_cF";
104
+ readonly vendorListLiBadge: "c15t-ui-vendorListLiBadge-_Uq0L";
105
+ readonly vendorListContent: "c15t-ui-vendorListContent-CtRTw";
106
+ readonly vendorLinks: "c15t-ui-vendorLinks-pxq9Z";
107
+ readonly tabPanel: "c15t-ui-tabPanel-PJKhk";
108
+ readonly vendorLink: "c15t-ui-vendorLink-htHQn";
109
+ readonly vendorLinkIcon: "c15t-ui-vendorLinkIcon-UjIy5";
110
+ readonly vendorBadges: "c15t-ui-vendorBadges-SED5E";
111
+ readonly vendorBadge: "c15t-ui-vendorBadge-Pu0Hs";
112
+ readonly vendorPurposesList: "c15t-ui-vendorPurposesList-CtEFC";
113
+ readonly vendorPurposesTitle: "c15t-ui-vendorPurposesTitle-2hGY4";
114
+ readonly vendorPurposesItems: "c15t-ui-vendorPurposesItems-VKo31";
115
+ readonly vendorPurposeItem: "c15t-ui-vendorPurposeItem-TmnWw";
116
+ readonly vendorPurposeItemLi: "c15t-ui-vendorPurposeItemLi-rO_6B";
117
+ readonly vendorRetention: "c15t-ui-vendorRetention-TTJ2U";
118
+ readonly footer: "c15t-ui-footer-YF32K";
119
+ readonly consentNotice: "c15t-ui-consentNotice-PEEG3";
120
+ readonly consentNoticeText: "c15t-ui-consentNoticeText-MhMCM";
121
+ readonly loadingContainer: "c15t-ui-loadingContainer-iW124";
122
+ readonly loadingSpinner: "c15t-ui-loadingSpinner-W8iiY";
123
+ readonly loadingText: "c15t-ui-loadingText-o2XqJ";
124
+ readonly emptyState: "c15t-ui-emptyState-nmTzy";
125
+ readonly emptyStateText: "c15t-ui-emptyStateText-HuJtF";
126
+ readonly vendorSectionHeading: "c15t-ui-vendorSectionHeading-s4i73";
127
+ readonly vendorSectionIcon: "c15t-ui-vendorSectionIcon-Cc99v";
128
+ readonly iabVendorSectionHeader: "c15t-ui-iabVendorSectionHeader-YsNA5";
129
+ readonly iabVendorNotice: "c15t-ui-iabVendorNotice-WnMMx";
130
+ readonly customVendorSectionHeader: "c15t-ui-customVendorSectionHeader-Sy8yM";
131
+ readonly customVendorNotice: "c15t-ui-customVendorNotice-NgBsE";
132
+ readonly customVendorItem: "c15t-ui-customVendorItem-QF5C7";
133
+ readonly customVendorPurposeSection: "c15t-ui-customVendorPurposeSection-zFEUM";
134
+ readonly vendorSectionTitleCustom: "c15t-ui-vendorSectionTitleCustom-JjHzO";
135
+ readonly objectButton: "c15t-ui-objectButton-S0x1H";
136
+ readonly objectButtonActive: "c15t-ui-objectButtonActive-AlNLv";
137
+ readonly liExplanation: "c15t-ui-liExplanation-_r6Zx";
138
+ readonly vendorLiSection: "c15t-ui-vendorLiSection-sqzvi";
139
+ readonly vendorLiSectionHeader: "c15t-ui-vendorLiSectionHeader-fsKUh";
140
+ readonly purposeLiSection: "c15t-ui-purposeLiSection-YbwuC";
141
+ readonly purposeLiSectionHeader: "c15t-ui-purposeLiSectionHeader-cSbP3";
142
+ readonly purposeLiInfo: "c15t-ui-purposeLiInfo-Rpryr";
143
+ };
144
+ };
@@ -0,0 +1,137 @@
1
+ export declare const stylesheet: string;
2
+ export declare const classes: {
3
+ readonly accordion: {
4
+ readonly list: "c15t-ui-list-T3EU0";
5
+ readonly item: "c15t-ui-item-Jgm_X";
6
+ readonly triggerRow: "c15t-ui-triggerRow-xXdTH";
7
+ readonly trigger: "c15t-ui-trigger-KT5J_";
8
+ readonly content: "c15t-ui-content-qdPhy";
9
+ readonly arrow: "c15t-ui-arrow-JFKgd";
10
+ readonly header: "c15t-ui-header-ogZie";
11
+ readonly title: "c15t-ui-title-vmC1f";
12
+ readonly control: "c15t-ui-control-dy7nh";
13
+ readonly restriction: "c15t-ui-restriction-bXiI7";
14
+ readonly contentViewport: "c15t-ui-contentViewport-O2Kny";
15
+ readonly contentInner: "c15t-ui-contentInner-b3ykf";
16
+ };
17
+ readonly actions: {
18
+ readonly actionRoot: "c15t-ui-actionRoot-hYTak";
19
+ readonly actionGroup: "c15t-ui-actionGroup-GmX6v";
20
+ };
21
+ readonly banner: {
22
+ readonly root: "c15t-ui-root-p7SV0";
23
+ readonly bannerEnterActive: "c15t-ui-bannerEnterActive-IytGL";
24
+ readonly bannerLeaveActive: "c15t-ui-bannerLeaveActive-C7qrk";
25
+ readonly bannerEnterFrom: "c15t-ui-bannerEnterFrom-BJMc7";
26
+ readonly bannerLeaveTo: "c15t-ui-bannerLeaveTo-dXNcB";
27
+ readonly bannerEnterTo: "c15t-ui-bannerEnterTo-yatsy";
28
+ readonly bannerLeaveFrom: "c15t-ui-bannerLeaveFrom-RVGoD";
29
+ readonly bannerVisible: "c15t-ui-bannerVisible-AFth0";
30
+ readonly bannerHidden: "c15t-ui-bannerHidden-R0_3M";
31
+ readonly cardShell: "c15t-ui-cardShell-djyPy";
32
+ readonly card: "c15t-ui-card-lgjVq";
33
+ readonly footer: "c15t-ui-footer-JhJAe";
34
+ readonly rights: "c15t-ui-rights-wZg5K";
35
+ readonly rightLink: "c15t-ui-rightLink-IXsSJ";
36
+ readonly header: "c15t-ui-header-S6GiJ";
37
+ readonly title: "c15t-ui-title-vm8nL";
38
+ readonly description: "c15t-ui-description-s8Qhg";
39
+ readonly overlay: "c15t-ui-overlay-DoHh4";
40
+ readonly overlayEnterActive: "c15t-ui-overlayEnterActive-YGn_8";
41
+ readonly overlayLeaveActive: "c15t-ui-overlayLeaveActive-FvP5W";
42
+ readonly overlayEnterFrom: "c15t-ui-overlayEnterFrom-OtDqj";
43
+ readonly overlayLeaveTo: "c15t-ui-overlayLeaveTo-V7aI7";
44
+ readonly overlayEnterTo: "c15t-ui-overlayEnterTo-jcvNq";
45
+ readonly overlayLeaveFrom: "c15t-ui-overlayLeaveFrom-EYTMT";
46
+ readonly overlayVisible: "c15t-ui-overlayVisible-ywHQp";
47
+ readonly overlayHidden: "c15t-ui-overlayHidden-WgrJC";
48
+ };
49
+ readonly branding: {
50
+ readonly branding: "c15t-ui-branding-yf52E";
51
+ readonly brandingCopy: "c15t-ui-brandingCopy-ktA4u";
52
+ readonly brandingText: "c15t-ui-brandingText-ls0cn";
53
+ readonly brandingBy: "c15t-ui-brandingBy-CWN3T";
54
+ readonly brandingWordmarkLabel: "c15t-ui-brandingWordmarkLabel-FxCKX";
55
+ readonly brandingC15T: "c15t-ui-brandingC15T-GVCPl";
56
+ readonly brandingWordmark: "c15t-ui-brandingWordmark-yqSW2";
57
+ readonly brandingC15TMark: "c15t-ui-brandingC15TMark-VvBd_";
58
+ readonly brandingInth: "c15t-ui-brandingInth-bviD3";
59
+ readonly brandingTag: "c15t-ui-brandingTag-V3N0M";
60
+ readonly brandingContent: "c15t-ui-brandingContent-Z9PVI";
61
+ readonly brandingTagBanner: "c15t-ui-brandingTagBanner-zFtcX";
62
+ readonly brandingTagDialog: "c15t-ui-brandingTagDialog-Iv_a_";
63
+ readonly brandingFooter: "c15t-ui-brandingFooter-QIudR";
64
+ };
65
+ readonly button: {
66
+ readonly button: "c15t-ui-button-IiSDl";
67
+ readonly buttonIcon: "c15t-ui-buttonIcon-QgScm";
68
+ };
69
+ readonly dialog: {
70
+ readonly root: "c15t-ui-root-I07nx";
71
+ readonly overlay: "c15t-ui-overlay-c1WEk";
72
+ readonly "consent-dialog-fade-in": "c15t-ui-consent-dialog-fade-in-I04Yp";
73
+ readonly consentDialogFadeIn: "c15t-ui-consent-dialog-fade-in-I04Yp";
74
+ readonly "consent-dialog-fade-out": "c15t-ui-consent-dialog-fade-out-t5_x2";
75
+ readonly consentDialogFadeOut: "c15t-ui-consent-dialog-fade-out-t5_x2";
76
+ readonly container: "c15t-ui-container-KTZOT";
77
+ readonly enter: "c15t-ui-enter-vWVet";
78
+ readonly exit: "c15t-ui-exit-ioDiW";
79
+ readonly card: "c15t-ui-card-ve6qQ";
80
+ readonly "consent-dialog-slide-in-left": "c15t-ui-consent-dialog-slide-in-left-N9bgJ";
81
+ readonly consentDialogSlideInLeft: "c15t-ui-consent-dialog-slide-in-left-N9bgJ";
82
+ readonly "consent-dialog-slide-out-left": "c15t-ui-consent-dialog-slide-out-left-hkcUP";
83
+ readonly consentDialogSlideOutLeft: "c15t-ui-consent-dialog-slide-out-left-hkcUP";
84
+ readonly "consent-dialog-slide-in-right": "c15t-ui-consent-dialog-slide-in-right-L40wh";
85
+ readonly consentDialogSlideInRight: "c15t-ui-consent-dialog-slide-in-right-L40wh";
86
+ readonly "consent-dialog-slide-out-right": "c15t-ui-consent-dialog-slide-out-right-GjtEq";
87
+ readonly consentDialogSlideOutRight: "c15t-ui-consent-dialog-slide-out-right-GjtEq";
88
+ readonly dialogVisible: "c15t-ui-dialogVisible-dkX4M";
89
+ readonly dialogHidden: "c15t-ui-dialogHidden-uBU9W";
90
+ readonly contentVisible: "c15t-ui-contentVisible-KxAWb";
91
+ readonly contentHidden: "c15t-ui-contentHidden-LflgF";
92
+ readonly headerWrapper: "c15t-ui-headerWrapper-DQg3z";
93
+ readonly closeButton: "c15t-ui-closeButton-uPYIe";
94
+ readonly footer: "c15t-ui-footer-PeM4f";
95
+ readonly overlayVisible: "c15t-ui-overlayVisible-gG3jJ";
96
+ readonly overlayHidden: "c15t-ui-overlayHidden-eY362";
97
+ readonly header: "c15t-ui-header-VbAnL";
98
+ readonly title: "c15t-ui-title-ErzRZ";
99
+ readonly description: "c15t-ui-description-OQyBx";
100
+ readonly content: "c15t-ui-content-Y_5Ie";
101
+ };
102
+ readonly legalLinks: {
103
+ readonly legalLinks: "c15t-ui-legalLinks-h6W20";
104
+ readonly legalLink: "c15t-ui-legalLink-bBp6b";
105
+ };
106
+ readonly manager: {
107
+ readonly manager: "c15t-ui-manager-VznZW";
108
+ readonly footer: "c15t-ui-footer-fl3dz";
109
+ };
110
+ readonly switch: {
111
+ readonly root: "c15t-ui-root-LX1QP";
112
+ readonly track: "c15t-ui-track-TjViT";
113
+ readonly thumb: "c15t-ui-thumb-Uunnr";
114
+ readonly rootSmall: "c15t-ui-rootSmall-wI5cb";
115
+ readonly trackSmall: "c15t-ui-trackSmall-tAU5X";
116
+ readonly thumbSmall: "c15t-ui-thumbSmall-IrKfB";
117
+ };
118
+ readonly trigger: {
119
+ readonly trigger: "c15t-ui-trigger-Hjg5y";
120
+ readonly dragging: "c15t-ui-dragging-R4Cm2";
121
+ readonly sm: "c15t-ui-sm-sud0y";
122
+ readonly md: "c15t-ui-md-CZrWA";
123
+ readonly lg: "c15t-ui-lg-fGzix";
124
+ readonly icon: "c15t-ui-icon-dD5R6";
125
+ readonly text: "c15t-ui-text-Garil";
126
+ readonly bottomRight: "c15t-ui-bottomRight-RqjMF";
127
+ readonly bottomLeft: "c15t-ui-bottomLeft-J3DsX";
128
+ readonly topRight: "c15t-ui-topRight-Ln04J";
129
+ readonly topLeft: "c15t-ui-topLeft-tpeaf";
130
+ readonly snapping: "c15t-ui-snapping-YupfG";
131
+ readonly hidden: "c15t-ui-hidden-tV2GK";
132
+ readonly toolbar: "c15t-ui-toolbar-gCKkL";
133
+ readonly toolbarVertical: "c15t-ui-toolbarVertical-MQ8bT";
134
+ readonly toolbarItem: "c15t-ui-toolbarItem-OO8Dy";
135
+ readonly toolbarIcon: "c15t-ui-toolbarIcon-FpHKR";
136
+ };
137
+ };
@@ -0,0 +1,112 @@
1
+ import { custom, hosted } from '@c15t/core';
2
+ import type { AllConsentNames, ConsentSnapshot, HasCondition, KernelUser, Unsubscribe } from '@c15t/core';
3
+ import type { DevToolsInstance } from '@c15t/dev-tools';
4
+ import type { CreateConsentClientContext } from './client';
5
+ import { manifest } from './transports/manifest';
6
+ import { offline } from './transports/offline';
7
+ import type { ConsentClient, ConsentClientEventMap, ConsentClientOptions, ConsentUIHandle, ConsentUIOptions } from './types';
8
+ /** The name the script-tag build installs itself under. */
9
+ export declare const GLOBAL_NAME = "c15t";
10
+ /** A call queued before the script loaded: `[method, ...args]`. */
11
+ export type QueuedCall = [method: string, ...args: unknown[]];
12
+ /**
13
+ * `window.c15t`, the one global the script-tag builds use.
14
+ *
15
+ * Before the tag loads it is a plain array of queued calls:
16
+ *
17
+ * ```html
18
+ * <script>
19
+ * window.c15t = window.c15t || [];
20
+ * c15t.push(['config', { consentCategories: ['measurement'] }]);
21
+ * c15t.push(['on', 'consent', (snapshot) => console.log(snapshot)]);
22
+ * </script>
23
+ * ```
24
+ *
25
+ * The tag replaces it with this object and replays the queue in order.
26
+ * Before `init()` the read methods throw and `on()`/`ready()` wait; after
27
+ * it everything proxies to the page's client. `version`, `pkg` and `mode`
28
+ * keep the shape `@c15t/core` installs for devtools.
29
+ */
30
+ export interface C15tGlobal {
31
+ /** Package version. */
32
+ readonly version: string;
33
+ /** Package name. */
34
+ readonly pkg: string;
35
+ /** Transport kind, once initialised. */
36
+ readonly mode: string | null;
37
+ /** The page's client, once initialised. */
38
+ readonly client: ConsentClient | null;
39
+ /**
40
+ * Add options before `init()`. Later calls win over earlier ones, and
41
+ * all of them win over the tag's `data-*` attributes. After `init()`
42
+ * it warns and does nothing.
43
+ *
44
+ * @param options - Client options to layer on.
45
+ */
46
+ config: (options: ConsentClientOptions) => void;
47
+ /**
48
+ * Create and start the page's client. A second call returns the
49
+ * existing one.
50
+ *
51
+ * @param options - Client options layered over the tag's attributes and
52
+ * every queued `config`.
53
+ * @returns The page's client.
54
+ */
55
+ init: (options?: ConsentClientOptions) => ConsentClient;
56
+ /**
57
+ * Run once the client exists, immediately if it already does. Safe to
58
+ * call before `init()`; `c15t.devtools.js` mounts through this.
59
+ *
60
+ * @param listener - Called with the client.
61
+ * @returns A function that cancels the call if it has not run yet.
62
+ */
63
+ onInit: (listener: (client: ConsentClient) => void) => Unsubscribe;
64
+ /** The DevTools panel, once `c15t.devtools.js` has mounted it. */
65
+ devtools: DevToolsInstance | null;
66
+ /** Resolves once the policy is resolved. Safe to call before `init()`. */
67
+ ready: () => Promise<ConsentSnapshot>;
68
+ /** Listen for a client event. Safe to call before `init()`. */
69
+ on: <EventName extends keyof ConsentClientEventMap>(event: EventName, listener: (payload: ConsentClientEventMap[EventName]) => void) => Unsubscribe;
70
+ getSnapshot: () => ConsentSnapshot;
71
+ subscribe: (listener: (snapshot: ConsentSnapshot) => void) => Unsubscribe;
72
+ has: (condition: HasCondition<AllConsentNames>) => boolean;
73
+ hasConsented: () => boolean;
74
+ acceptAll: ConsentClient['acceptAll'];
75
+ rejectAll: ConsentClient['rejectAll'];
76
+ save: ConsentClient['save'];
77
+ saveIAB: ConsentClient['saveIAB'];
78
+ dismissNotice: ConsentClient['dismissNotice'];
79
+ showBanner: () => void;
80
+ openDialog: () => void;
81
+ closeDialog: () => void;
82
+ setLanguage: (code: string) => void;
83
+ identify: (user: KernelUser) => Promise<void>;
84
+ mountUI: (options?: ConsentUIOptions) => ConsentUIHandle;
85
+ dispose: () => void;
86
+ /** Transport factories, for `init({ mode: c15t.hosted({ url }) })`. */
87
+ hosted: typeof hosted;
88
+ offline: typeof offline;
89
+ custom: typeof custom;
90
+ manifest: typeof manifest;
91
+ }
92
+ /**
93
+ * Put the API on `window.c15t`, replaying in order any calls a page queued
94
+ * on the array that was there before the script loaded.
95
+ *
96
+ * @param api - The API object.
97
+ */
98
+ export declare const installGlobal: (api: C15tGlobal) => C15tGlobal;
99
+ /**
100
+ * Build the global API object.
101
+ *
102
+ * @param context - Entry-point wiring (UI mounter, package name).
103
+ * @returns The API, not yet installed on `window`.
104
+ */
105
+ export declare const createGlobal: (context: CreateConsentClientContext) => C15tGlobal;
106
+ /**
107
+ * Initialise from the script tag unless the page opted out.
108
+ *
109
+ * @param api - The installed API.
110
+ * @returns The client, or `null` when the page asked to init itself.
111
+ */
112
+ export declare const autoInit: (api: C15tGlobal) => ConsentClient | null;