@c15t/scripts 1.0.1 → 1.1.0-rc.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.
Files changed (59) hide show
  1. package/dist/databuddy.cjs +105 -50
  2. package/dist/databuddy.js +99 -47
  3. package/dist/engine/compile.cjs +126 -0
  4. package/dist/engine/compile.js +89 -0
  5. package/dist/engine/runtime.cjs +379 -0
  6. package/dist/engine/runtime.js +345 -0
  7. package/dist/google-tag-manager.cjs +80 -96
  8. package/dist/google-tag-manager.js +74 -87
  9. package/dist/google-tag.cjs +88 -39
  10. package/dist/google-tag.js +82 -36
  11. package/dist/linkedin-insights.cjs +52 -41
  12. package/dist/linkedin-insights.js +45 -37
  13. package/dist/meta-pixel.cjs +92 -26
  14. package/dist/meta-pixel.js +86 -23
  15. package/dist/microsoft-uet.cjs +92 -52
  16. package/dist/microsoft-uet.js +86 -49
  17. package/dist/posthog.cjs +102 -53
  18. package/dist/posthog.js +96 -50
  19. package/dist/resolve.cjs +67 -0
  20. package/dist/resolve.js +33 -0
  21. package/dist/tiktok-pixel.cjs +93 -27
  22. package/dist/tiktok-pixel.js +86 -23
  23. package/dist/types.cjs +47 -0
  24. package/dist/types.js +7 -0
  25. package/dist/x-pixel.cjs +49 -19
  26. package/dist/x-pixel.js +42 -15
  27. package/dist-types/databuddy.d.ts +144 -0
  28. package/dist-types/engine/compile.d.ts +3 -0
  29. package/dist-types/engine/runtime.d.ts +3 -0
  30. package/dist-types/engine.test.d.ts +1 -0
  31. package/dist-types/google-tag-manager.d.ts +97 -0
  32. package/dist-types/google-tag.d.ts +96 -0
  33. package/dist-types/helpers.test.d.ts +1 -0
  34. package/dist-types/linkedin-insights.d.ts +79 -0
  35. package/{dist → dist-types}/meta-pixel.d.ts +61 -14
  36. package/dist-types/microsoft-uet.d.ts +94 -0
  37. package/dist-types/posthog.d.ts +112 -0
  38. package/dist-types/resolve.d.ts +9 -0
  39. package/dist-types/tiktok-pixel.d.ts +91 -0
  40. package/dist-types/types.d.ts +259 -0
  41. package/{dist → dist-types}/x-pixel.d.ts +38 -12
  42. package/package.json +46 -45
  43. package/LICENSE.md +0 -595
  44. package/dist/databuddy.d.ts +0 -104
  45. package/dist/databuddy.d.ts.map +0 -1
  46. package/dist/google-tag-manager.d.ts +0 -63
  47. package/dist/google-tag-manager.d.ts.map +0 -1
  48. package/dist/google-tag.d.ts +0 -38
  49. package/dist/google-tag.d.ts.map +0 -1
  50. package/dist/linkedin-insights.d.ts +0 -48
  51. package/dist/linkedin-insights.d.ts.map +0 -1
  52. package/dist/meta-pixel.d.ts.map +0 -1
  53. package/dist/microsoft-uet.d.ts +0 -40
  54. package/dist/microsoft-uet.d.ts.map +0 -1
  55. package/dist/posthog.d.ts +0 -54
  56. package/dist/posthog.d.ts.map +0 -1
  57. package/dist/tiktok-pixel.d.ts +0 -44
  58. package/dist/tiktok-pixel.d.ts.map +0 -1
  59. package/dist/x-pixel.d.ts.map +0 -1
@@ -84,25 +84,52 @@ declare global {
84
84
  twq?: (event: string, ...args: unknown[]) => void;
85
85
  }
86
86
  }
87
+ /**
88
+ * X (Twitter) Pixel vendor manifest.
89
+ *
90
+ * Uses structured startup steps to load the X tracking pixel.
91
+ * No consent API — the script simply loads or doesn't based on consent.
92
+ */
93
+ export declare const xPixelManifest: {
94
+ readonly vendor: "x-pixel";
95
+ readonly category: "marketing";
96
+ readonly bootstrap: [{
97
+ readonly type: "defineStubFunction";
98
+ readonly name: "twq";
99
+ readonly queue: {
100
+ readonly property: "queue";
101
+ };
102
+ readonly dispatchProperty: "exe";
103
+ readonly properties: {
104
+ readonly version: "1.1";
105
+ };
106
+ readonly ifUndefined: true;
107
+ }];
108
+ readonly install: [{
109
+ readonly type: "callGlobal";
110
+ readonly global: "twq";
111
+ readonly args: ["config", "{{pixelId}}"];
112
+ }, {
113
+ readonly type: "loadScript";
114
+ readonly src: "{{scriptSrc}}";
115
+ readonly async: true;
116
+ }];
117
+ readonly kind: "c15t.vendor-manifest";
118
+ readonly schemaVersion: 1;
119
+ };
87
120
  export interface XPixelOptions {
88
121
  /**
89
122
  * Your X Pixel ID
90
123
  * @example `123456789012345`
91
124
  */
92
125
  pixelId: string;
93
- /**
94
- * Override or extend the default script values.
95
- *
96
- * Default values:
97
- * - `id`: 'x-pixel'
98
- * - `src`: `https://static.ads-twitter.com/uwt.js`
99
- * - `category`: 'marketing'
100
- */
101
- script?: Partial<Script>;
126
+ /** X Pixel loader URL. */
127
+ scriptSrc?: string;
102
128
  }
103
129
  /**
104
130
  * Creates an X Pixel script.
105
- * This script is persistent after consent is revoked because it has built-in functionality to opt into and out of tracking based on consent, which allows us to not need to load the script again when consent is revoked.
131
+ * This script loads only when consent is granted.
132
+ * X Pixel does not expose a consent update API, so c15t treats it as a standard consent-gated loader.
106
133
  *
107
134
  * @param options - The options for the X Pixel script
108
135
  * @returns The X Pixel script configuration
@@ -116,7 +143,7 @@ export interface XPixelOptions {
116
143
  *
117
144
  * @see {@link https://ads.twitter.com/help/article/x-pixel} X Pixel documentation
118
145
  */
119
- export declare function xPixel({ pixelId, script }: XPixelOptions): Script;
146
+ export declare function xPixel({ pixelId, scriptSrc }: XPixelOptions): Script;
120
147
  /**
121
148
  * @param eventId - The event ID to track
122
149
  * @example 'tw-xxxx-xxxx'
@@ -137,4 +164,3 @@ export declare function xPixel({ pixelId, script }: XPixelOptions): Script;
137
164
  * @see {@link https://business.x.com/en/help/campaign-measurement-and-analytics/conversion-tracking-for-websites#event-types-and-parameters}
138
165
  */
139
166
  export declare const xPixelEvent: (eventId: string, metadata?: XPixelEvent) => void | undefined;
140
- //# sourceMappingURL=x-pixel.d.ts.map
package/package.json CHANGED
@@ -1,46 +1,47 @@
1
1
  {
2
- "name": "@c15t/scripts",
3
- "version": "1.0.1",
4
- "description": "Pre-built scripts of popular tools for c15t's script loader.",
5
- "homepage": "https://c15t.com/docs/frameworks/javascript/script-loader",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/c15t/c15t.git",
9
- "directory": "packages/scripts"
10
- },
11
- "license": "GPL-3.0-only",
12
- "sideEffects": false,
13
- "type": "module",
14
- "exports": {
15
- "./*": {
16
- "types": "./dist/*.d.ts",
17
- "import": "./dist/*.js",
18
- "require": "./dist/*.cjs"
19
- }
20
- },
21
- "files": [
22
- "dist"
23
- ],
24
- "browserslist": [
25
- ">0.2%",
26
- "not dead",
27
- "not op_mini all"
28
- ],
29
- "devDependencies": {
30
- "@c15t/typescript-config": "0.0.1-beta.1",
31
- "@c15t/vitest-config": "1.0.0",
32
- "c15t": "1.8.0"
33
- },
34
- "publishConfig": {
35
- "access": "public"
36
- },
37
- "scripts": {
38
- "build": "rslib build",
39
- "check-types": "tsc --noEmit",
40
- "dev": "rslib build --watch",
41
- "fmt": "pnpm biome format --write . && biome check --formatter-enabled=false --linter-enabled=false --write",
42
- "lint": "pnpm biome lint ./src",
43
- "test": "vitest run --passWithNoTests",
44
- "test:watch": "vitest"
45
- }
46
- }
2
+ "name": "@c15t/scripts",
3
+ "version": "1.1.0-rc.1",
4
+ "description": "Pre-built scripts of popular tools for c15t's script loader.",
5
+ "homepage": "https://c15t.com/docs/frameworks/javascript/script-loader",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/c15t/c15t.git",
9
+ "directory": "packages/scripts"
10
+ },
11
+ "license": "GPL-3.0-only",
12
+ "sideEffects": false,
13
+ "type": "module",
14
+ "exports": {
15
+ "./*": {
16
+ "types": "./dist-types/*.d.ts",
17
+ "import": "./dist/*.js",
18
+ "require": "./dist/*.cjs"
19
+ }
20
+ },
21
+ "files": [
22
+ "dist",
23
+ "dist-types"
24
+ ],
25
+ "scripts": {
26
+ "build": "rslib build && bun ../../scripts/normalize-dist-types.mjs",
27
+ "check-types": "tsc --noEmit",
28
+ "dev": "rslib build --watch",
29
+ "fmt": "bun biome format --write . && bun biome check --formatter-enabled=false --linter-enabled=false --write",
30
+ "lint": "bun biome lint ./src",
31
+ "test": "vitest run --passWithNoTests",
32
+ "test:watch": "vitest"
33
+ },
34
+ "browserslist": [
35
+ ">0.2%",
36
+ "not dead",
37
+ "not op_mini all"
38
+ ],
39
+ "devDependencies": {
40
+ "@c15t/typescript-config": "0.0.1-beta.1",
41
+ "@c15t/vitest-config": "1.0.0",
42
+ "c15t": "2.0.0-rc.8"
43
+ },
44
+ "publishConfig": {
45
+ "access": "public"
46
+ }
47
+ }