@tilli-pro/cookieconsent-plugin 0.7.91 → 0.7.92

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 (44) hide show
  1. package/.cache/tsbuildinfo.json +1 -1
  2. package/demos/demo.html +2 -2
  3. package/demos/demo.min.html +1 -1
  4. package/demos/demo.styles.dark.html +2 -2
  5. package/demos/demo.styles.dark.min.html +1 -1
  6. package/demos/demo.styles.nudge-website.dark.html +2 -2
  7. package/demos/demo.styles.nudge-website.dark.min.html +1 -1
  8. package/demos/demo.styles.nudge-website.light.html +2 -2
  9. package/demos/demo.styles.nudge-website.light.min.html +1 -1
  10. package/demos/demo.styles.nudge.dark.html +2 -2
  11. package/demos/demo.styles.nudge.dark.min.html +1 -1
  12. package/demos/demo.styles.nudge.light.html +2 -2
  13. package/demos/demo.styles.nudge.light.min.html +1 -1
  14. package/demos/demo.styles.tenant_con-edison.dark.html +2 -2
  15. package/demos/demo.styles.tenant_con-edison.dark.min.html +1 -1
  16. package/demos/demo.styles.tenant_con-edison.light.html +2 -2
  17. package/demos/demo.styles.tenant_con-edison.light.min.html +1 -1
  18. package/demos/demo.styles.tenant_freeman.dark.html +2 -2
  19. package/demos/demo.styles.tenant_freeman.dark.min.html +1 -1
  20. package/demos/demo.styles.tenant_freeman.light.html +2 -2
  21. package/demos/demo.styles.tenant_freeman.light.min.html +1 -1
  22. package/demos/demo.styles.tenant_frontier.dark.html +2 -2
  23. package/demos/demo.styles.tenant_frontier.dark.min.html +1 -1
  24. package/demos/demo.styles.tenant_frontier.light.html +2 -2
  25. package/demos/demo.styles.tenant_frontier.light.min.html +1 -1
  26. package/demos/demo.styles.tenant_oru.dark.html +2 -2
  27. package/demos/demo.styles.tenant_oru.dark.min.html +1 -1
  28. package/demos/demo.styles.tenant_oru.light.html +2 -2
  29. package/demos/demo.styles.tenant_oru.light.min.html +1 -1
  30. package/demos/demo.styles.tilli-pay.dark.html +2 -2
  31. package/demos/demo.styles.tilli-pay.dark.min.html +1 -1
  32. package/demos/demo.styles.tilli-pay.light.html +2 -2
  33. package/demos/demo.styles.tilli-pay.light.min.html +1 -1
  34. package/demos/demo.styles.tilli-website.dark.html +2 -2
  35. package/demos/demo.styles.tilli-website.dark.min.html +1 -1
  36. package/demos/demo.styles.tilli-website.light.html +2 -2
  37. package/demos/demo.styles.tilli-website.light.min.html +1 -1
  38. package/dist/config/gui-options/scripts/injectUTM.d.ts.map +1 -1
  39. package/dist/config/gui-options/scripts/injectUTM.js +6 -3
  40. package/dist/init.d.ts +1 -1
  41. package/dist/init.js +2 -2
  42. package/package.json +1 -1
  43. package/src/config/gui-options/scripts/injectUTM.ts +13 -8
  44. package/src/init.ts +2 -2
@@ -54,7 +54,10 @@ const A_TAG_IDS_TO_INJECT_UTM_PARAMETERS = [
54
54
  "tilli-cc-privacy-policy-link-preferences",
55
55
  ];
56
56
 
57
- export const injectUTMParametersIntoATags = (maxAttempts = 30, attempt = 1) => {
57
+ export const injectUTMParametersIntoATags = (
58
+ maxAttempts = Infinity, // handle edge case where the a tags are not yet loaded (e.g., for the preferences modal)
59
+ attempt = 1,
60
+ ) => {
58
61
  const _preferences = {
59
62
  ...DEFAULT_UTM_PARAMETERS,
60
63
  source: new URL(window.location.href).hostname, // use the hostname of the current page as the source
@@ -80,7 +83,7 @@ export const injectUTMParametersIntoATags = (maxAttempts = 30, attempt = 1) => {
80
83
  setTimeout(
81
84
  () => injectUTMParametersIntoATags(maxAttempts, attempt + 1),
82
85
  1_000,
83
- ); // retry up to 3 times, handles edge case where the a tags are not yet loaded (e.g., for the preferences modal)
86
+ );
84
87
  };
85
88
 
86
89
  /**
@@ -101,12 +104,14 @@ export const addUTMParameters = (
101
104
  );
102
105
 
103
106
  // add new parameters
104
- Object.entries(parameters).forEach(
105
- ([key, value]) =>
106
- !!value &&
107
- value !== "unknown" &&
108
- url.searchParams.set(`utm_${key}`, value),
109
- );
107
+ Object.entries(parameters)
108
+ .sort((a, b) => a[0].localeCompare(b[0])) // sort alphabetically by key (to ensure consistent order)
109
+ .forEach(
110
+ ([key, value]) =>
111
+ !!value &&
112
+ value !== "unknown" &&
113
+ url.searchParams.set(`utm_${key}`, value),
114
+ );
110
115
 
111
116
  return url;
112
117
  };
package/src/init.ts CHANGED
@@ -1,4 +1,4 @@
1
- import "https://cdn.jsdelivr.net/gh/tilli-pro/cookieconsent@709b2aa2f29196fec1e1e4576d12dc78f56e1088/dist/cookieconsent.umd.js";
1
+ import "https://cdn.jsdelivr.net/gh/tilli-pro/cookieconsent@db17994543047dd69ff56e082568e7eb83316061/dist/cookieconsent.umd.js";
2
2
 
3
3
  import type * as _CookieConsent from "@tilli-pro/cookieconsent";
4
4
  import type { CookieConsentConfig } from "@tilli-pro/cookieconsent";
@@ -18,7 +18,7 @@ declare global {
18
18
  }
19
19
  }
20
20
 
21
- const GIT_SHA = "709b2aa2f29196fec1e1e4576d12dc78f56e1088";
21
+ const GIT_SHA = "db17994543047dd69ff56e082568e7eb83316061";
22
22
  const GIT_REPO = "tilli-pro/cookieconsent";
23
23
  const GIT_CDN_BASE_URL = "https://cdn.jsdelivr.net/gh";
24
24
  const GIT_CDN_URL = `${GIT_CDN_BASE_URL}/${GIT_REPO}@${GIT_SHA}`;