@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.
- package/dist/databuddy.cjs +105 -50
- package/dist/databuddy.js +99 -47
- package/dist/engine/compile.cjs +126 -0
- package/dist/engine/compile.js +89 -0
- package/dist/engine/runtime.cjs +379 -0
- package/dist/engine/runtime.js +345 -0
- package/dist/google-tag-manager.cjs +80 -96
- package/dist/google-tag-manager.js +74 -87
- package/dist/google-tag.cjs +88 -39
- package/dist/google-tag.js +82 -36
- package/dist/linkedin-insights.cjs +52 -41
- package/dist/linkedin-insights.js +45 -37
- package/dist/meta-pixel.cjs +92 -26
- package/dist/meta-pixel.js +86 -23
- package/dist/microsoft-uet.cjs +92 -52
- package/dist/microsoft-uet.js +86 -49
- package/dist/posthog.cjs +102 -53
- package/dist/posthog.js +96 -50
- package/dist/resolve.cjs +67 -0
- package/dist/resolve.js +33 -0
- package/dist/tiktok-pixel.cjs +93 -27
- package/dist/tiktok-pixel.js +86 -23
- package/dist/types.cjs +47 -0
- package/dist/types.js +7 -0
- package/dist/x-pixel.cjs +49 -19
- package/dist/x-pixel.js +42 -15
- package/dist-types/databuddy.d.ts +144 -0
- package/dist-types/engine/compile.d.ts +3 -0
- package/dist-types/engine/runtime.d.ts +3 -0
- package/dist-types/engine.test.d.ts +1 -0
- package/dist-types/google-tag-manager.d.ts +97 -0
- package/dist-types/google-tag.d.ts +96 -0
- package/dist-types/helpers.test.d.ts +1 -0
- package/dist-types/linkedin-insights.d.ts +79 -0
- package/{dist → dist-types}/meta-pixel.d.ts +61 -14
- package/dist-types/microsoft-uet.d.ts +94 -0
- package/dist-types/posthog.d.ts +112 -0
- package/dist-types/resolve.d.ts +9 -0
- package/dist-types/tiktok-pixel.d.ts +91 -0
- package/dist-types/types.d.ts +259 -0
- package/{dist → dist-types}/x-pixel.d.ts +38 -12
- package/package.json +46 -45
- package/LICENSE.md +0 -595
- package/dist/databuddy.d.ts +0 -104
- package/dist/databuddy.d.ts.map +0 -1
- package/dist/google-tag-manager.d.ts +0 -63
- package/dist/google-tag-manager.d.ts.map +0 -1
- package/dist/google-tag.d.ts +0 -38
- package/dist/google-tag.d.ts.map +0 -1
- package/dist/linkedin-insights.d.ts +0 -48
- package/dist/linkedin-insights.d.ts.map +0 -1
- package/dist/meta-pixel.d.ts.map +0 -1
- package/dist/microsoft-uet.d.ts +0 -40
- package/dist/microsoft-uet.d.ts.map +0 -1
- package/dist/posthog.d.ts +0 -54
- package/dist/posthog.d.ts.map +0 -1
- package/dist/tiktok-pixel.d.ts +0 -44
- package/dist/tiktok-pixel.d.ts.map +0 -1
- 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
|
-
|
|
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
|
|
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,
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
+
}
|