@walkeros/web-source-cmp-cookiefirst 3.0.2 → 3.1.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.
- package/dist/dev.d.mts +25 -16
- package/dist/dev.d.ts +25 -16
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/examples/index.d.mts +23 -15
- package/dist/examples/index.d.ts +23 -15
- package/dist/examples/index.js +33 -6
- package/dist/examples/index.mjs +30 -4
- package/dist/index.browser.js +1 -1
- package/dist/index.d.mts +24 -17
- package/dist/index.d.ts +24 -17
- package/dist/index.es5.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/walkerOS.json +23 -6
- package/package.json +6 -4
package/dist/examples/index.js
CHANGED
|
@@ -25,6 +25,7 @@ __export(examples_exports, {
|
|
|
25
25
|
createMockCookieFirstAPI: () => createMockCookieFirstAPI,
|
|
26
26
|
createMockElbFn: () => createMockElbFn,
|
|
27
27
|
createMockWindow: () => createMockWindow,
|
|
28
|
+
createTrigger: () => createTrigger,
|
|
28
29
|
fullConsent: () => fullConsent,
|
|
29
30
|
fullConsentMapped: () => fullConsentMapped,
|
|
30
31
|
marketingOnlyConsent: () => marketingOnlyConsent,
|
|
@@ -36,8 +37,8 @@ __export(examples_exports, {
|
|
|
36
37
|
noopLogger: () => noopLogger,
|
|
37
38
|
partialConsent: () => partialConsent,
|
|
38
39
|
partialConsentMapped: () => partialConsentMapped,
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
step: () => step_exports,
|
|
41
|
+
trigger: () => trigger
|
|
41
42
|
});
|
|
42
43
|
module.exports = __toCommonJS(examples_exports);
|
|
43
44
|
|
|
@@ -154,6 +155,7 @@ __export(step_exports, {
|
|
|
154
155
|
partialConsent: () => partialConsent2
|
|
155
156
|
});
|
|
156
157
|
var fullConsent2 = {
|
|
158
|
+
trigger: { type: "consent" },
|
|
157
159
|
in: {
|
|
158
160
|
necessary: true,
|
|
159
161
|
functional: true,
|
|
@@ -167,6 +169,7 @@ var fullConsent2 = {
|
|
|
167
169
|
}
|
|
168
170
|
};
|
|
169
171
|
var partialConsent2 = {
|
|
172
|
+
trigger: { type: "consent" },
|
|
170
173
|
in: {
|
|
171
174
|
necessary: true,
|
|
172
175
|
functional: true,
|
|
@@ -181,6 +184,7 @@ var partialConsent2 = {
|
|
|
181
184
|
};
|
|
182
185
|
var categoryMapOverride = {
|
|
183
186
|
description: "Custom categoryMap remaps performance to statistics instead of analytics",
|
|
187
|
+
trigger: { type: "consent" },
|
|
184
188
|
in: {
|
|
185
189
|
necessary: true,
|
|
186
190
|
functional: false,
|
|
@@ -202,6 +206,7 @@ var categoryMapOverride = {
|
|
|
202
206
|
};
|
|
203
207
|
var cfInitDetection = {
|
|
204
208
|
description: "CMP detected via cf_init CustomEvent (primary detection path)",
|
|
209
|
+
trigger: { type: "consent" },
|
|
205
210
|
in: {
|
|
206
211
|
necessary: true,
|
|
207
212
|
functional: false,
|
|
@@ -215,8 +220,29 @@ var cfInitDetection = {
|
|
|
215
220
|
}
|
|
216
221
|
};
|
|
217
222
|
|
|
218
|
-
// src/examples/
|
|
219
|
-
var
|
|
223
|
+
// src/examples/trigger.ts
|
|
224
|
+
var import_collector = require("@walkeros/collector");
|
|
225
|
+
var createTrigger = async (config) => {
|
|
226
|
+
let flow;
|
|
227
|
+
const trigger2 = () => async (content) => {
|
|
228
|
+
var _a;
|
|
229
|
+
window.CookieFirst = {
|
|
230
|
+
consent: content
|
|
231
|
+
};
|
|
232
|
+
if (!flow) {
|
|
233
|
+
const result = await (0, import_collector.startFlow)({ ...config, run: (_a = config.run) != null ? _a : true });
|
|
234
|
+
flow = { collector: result.collector, elb: result.elb };
|
|
235
|
+
}
|
|
236
|
+
window.dispatchEvent(new Event("cf_init"));
|
|
237
|
+
};
|
|
238
|
+
return {
|
|
239
|
+
get flow() {
|
|
240
|
+
return flow;
|
|
241
|
+
},
|
|
242
|
+
trigger: trigger2
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
var trigger = (input, env) => {
|
|
220
246
|
if (!input || typeof input !== "object") return;
|
|
221
247
|
env.window.CookieFirst = { consent: input };
|
|
222
248
|
};
|
|
@@ -227,6 +253,7 @@ var setup = (input, env) => {
|
|
|
227
253
|
createMockCookieFirstAPI,
|
|
228
254
|
createMockElbFn,
|
|
229
255
|
createMockWindow,
|
|
256
|
+
createTrigger,
|
|
230
257
|
fullConsent,
|
|
231
258
|
fullConsentMapped,
|
|
232
259
|
marketingOnlyConsent,
|
|
@@ -238,6 +265,6 @@ var setup = (input, env) => {
|
|
|
238
265
|
noopLogger,
|
|
239
266
|
partialConsent,
|
|
240
267
|
partialConsentMapped,
|
|
241
|
-
|
|
242
|
-
|
|
268
|
+
step,
|
|
269
|
+
trigger
|
|
243
270
|
});
|
package/dist/examples/index.mjs
CHANGED
|
@@ -117,6 +117,7 @@ __export(step_exports, {
|
|
|
117
117
|
partialConsent: () => partialConsent2
|
|
118
118
|
});
|
|
119
119
|
var fullConsent2 = {
|
|
120
|
+
trigger: { type: "consent" },
|
|
120
121
|
in: {
|
|
121
122
|
necessary: true,
|
|
122
123
|
functional: true,
|
|
@@ -130,6 +131,7 @@ var fullConsent2 = {
|
|
|
130
131
|
}
|
|
131
132
|
};
|
|
132
133
|
var partialConsent2 = {
|
|
134
|
+
trigger: { type: "consent" },
|
|
133
135
|
in: {
|
|
134
136
|
necessary: true,
|
|
135
137
|
functional: true,
|
|
@@ -144,6 +146,7 @@ var partialConsent2 = {
|
|
|
144
146
|
};
|
|
145
147
|
var categoryMapOverride = {
|
|
146
148
|
description: "Custom categoryMap remaps performance to statistics instead of analytics",
|
|
149
|
+
trigger: { type: "consent" },
|
|
147
150
|
in: {
|
|
148
151
|
necessary: true,
|
|
149
152
|
functional: false,
|
|
@@ -165,6 +168,7 @@ var categoryMapOverride = {
|
|
|
165
168
|
};
|
|
166
169
|
var cfInitDetection = {
|
|
167
170
|
description: "CMP detected via cf_init CustomEvent (primary detection path)",
|
|
171
|
+
trigger: { type: "consent" },
|
|
168
172
|
in: {
|
|
169
173
|
necessary: true,
|
|
170
174
|
functional: false,
|
|
@@ -178,8 +182,29 @@ var cfInitDetection = {
|
|
|
178
182
|
}
|
|
179
183
|
};
|
|
180
184
|
|
|
181
|
-
// src/examples/
|
|
182
|
-
|
|
185
|
+
// src/examples/trigger.ts
|
|
186
|
+
import { startFlow } from "@walkeros/collector";
|
|
187
|
+
var createTrigger = async (config) => {
|
|
188
|
+
let flow;
|
|
189
|
+
const trigger2 = () => async (content) => {
|
|
190
|
+
var _a;
|
|
191
|
+
window.CookieFirst = {
|
|
192
|
+
consent: content
|
|
193
|
+
};
|
|
194
|
+
if (!flow) {
|
|
195
|
+
const result = await startFlow({ ...config, run: (_a = config.run) != null ? _a : true });
|
|
196
|
+
flow = { collector: result.collector, elb: result.elb };
|
|
197
|
+
}
|
|
198
|
+
window.dispatchEvent(new Event("cf_init"));
|
|
199
|
+
};
|
|
200
|
+
return {
|
|
201
|
+
get flow() {
|
|
202
|
+
return flow;
|
|
203
|
+
},
|
|
204
|
+
trigger: trigger2
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
var trigger = (input, env) => {
|
|
183
208
|
if (!input || typeof input !== "object") return;
|
|
184
209
|
env.window.CookieFirst = { consent: input };
|
|
185
210
|
};
|
|
@@ -189,6 +214,7 @@ export {
|
|
|
189
214
|
createMockCookieFirstAPI,
|
|
190
215
|
createMockElbFn,
|
|
191
216
|
createMockWindow,
|
|
217
|
+
createTrigger,
|
|
192
218
|
fullConsent,
|
|
193
219
|
fullConsentMapped,
|
|
194
220
|
marketingOnlyConsent,
|
|
@@ -200,6 +226,6 @@ export {
|
|
|
200
226
|
noopLogger,
|
|
201
227
|
partialConsent,
|
|
202
228
|
partialConsentMapped,
|
|
203
|
-
|
|
204
|
-
|
|
229
|
+
step_exports as step,
|
|
230
|
+
trigger
|
|
205
231
|
};
|