gatsby-core-theme 44.4.52 → 44.5.0-poc.2

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 (33) hide show
  1. package/.ci.yml +26 -0
  2. package/CHANGELOG.md +30 -126
  3. package/gatsby-browser.js +100 -48
  4. package/gatsby-node.mjs +21 -25
  5. package/package.json +1 -1
  6. package/release.config.js +5 -0
  7. package/src/components/atoms/author/index.js +5 -6
  8. package/src/components/atoms/collapse/collapse.test.js +26 -113
  9. package/src/components/atoms/collapse/index.js +1 -23
  10. package/src/components/molecules/comment/comment.module.scss +57 -7
  11. package/src/components/molecules/comment/index.js +79 -5
  12. package/src/components/molecules/header/variants/operator/template-one-two/index.js +3 -4
  13. package/src/components/molecules/header/variants/operator/template-one-two/template-one-two.stories.js +3 -4
  14. package/src/components/molecules/header/variants/slot/template-one/index.js +3 -4
  15. package/src/components/molecules/header/variants/slot/template-one/template-one.stories.js +3 -4
  16. package/src/components/molecules/leave-comment-form/index.js +0 -1
  17. package/src/components/organisms/anchor/template-one/anchor.module.scss +11 -19
  18. package/src/components/organisms/archive/index.js +2 -5
  19. package/src/components/organisms/comments/comment-tree/index.js +7 -8
  20. package/src/components/organisms/comments/index.js +24 -13
  21. package/src/components/organisms/cookie-consent/index.js +34 -48
  22. package/src/components/organisms/form/fields/fields.module.scss +2 -5
  23. package/src/components/organisms/form/fields/index.js +4 -2
  24. package/src/components/organisms/form/form.module.scss +39 -76
  25. package/src/components/organisms/form/index.js +1 -0
  26. package/src/constants/forms.js +1 -1
  27. package/src/helpers/tracker.mjs +2 -2
  28. package/src/resolver/redirect.mjs +0 -23
  29. package/src/resolver/redirect.test.js +1 -65
  30. package/src/components/atoms/comment-votes/comment-votes.module.scss +0 -34
  31. package/src/components/atoms/comment-votes/index.js +0 -92
  32. package/src/components/organisms/comments/comment-tree/comment-tree.module.scss +0 -47
  33. package/src/context/VotesProvider.js +0 -49
package/.ci.yml CHANGED
@@ -49,6 +49,8 @@ Theme Beta Publish:
49
49
  tags:
50
50
  - gatsby-runner-dev-docker
51
51
  before_script:
52
+ - echo "@gigmedia:registry=https://registry.npmjs.org/" >> ~/.npmrc
53
+ - echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" >> ~/.npmrc
52
54
  - git config --global http.sslverify false
53
55
  - git config --global user.email "floyd@gig.com"
54
56
  - git config --global user.name "floyd"
@@ -64,3 +66,27 @@ Theme Beta Publish:
64
66
  - beta
65
67
  variables:
66
68
  - $PIPELINE != "content-trigger"
69
+
70
+ Theme POC Publish:
71
+ image: node:18.17.0
72
+ stage: publish-poc
73
+ tags:
74
+ - gatsby-runner-dev-docker
75
+ before_script:
76
+ - echo "@gigmedia:registry=https://registry.npmjs.org/" >> ~/.npmrc
77
+ - echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" >> ~/.npmrc
78
+ - git config --global http.sslverify false
79
+ - git config --global user.email "floyd@gig.com"
80
+ - git config --global user.name "floyd"
81
+ script:
82
+ - export HUSKY=0
83
+ - yarn config set cache-folder .yarn
84
+ - yarn
85
+ - cd gatsby-theme/
86
+ - npx semantic-release@22.0.0
87
+ when: manual
88
+ only:
89
+ refs:
90
+ - poc
91
+ variables:
92
+ - $PIPELINE != "content-trigger"
package/CHANGELOG.md CHANGED
@@ -1,153 +1,57 @@
1
- ## [44.4.52](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.51...v44.4.52) (2025-09-02)
1
+ # [44.5.0-poc.2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.5.0-poc.1...v44.5.0-poc.2) (2025-09-05)
2
2
 
3
3
 
4
- ### Bug Fixes
5
-
6
- * revert gtm changes ([4f05ce2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/4f05ce26a89137acb82d638f9ffceb29168127a8))
7
-
8
- ## [44.4.51](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.50...v44.4.51) (2025-09-02)
9
-
10
-
11
- ### Bug Fixes
12
-
13
- * testing gtm scripts ([9fc6ffb](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/9fc6ffbcd00472155df82315dffa42a093a0cec7))
14
-
15
- ## [44.4.50](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.49...v44.4.50) (2025-09-02)
16
-
17
-
18
- ### Bug Fixes
19
-
20
- * testing INP ([397a9cd](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/397a9cda61065a81b9d596a07679a722e534d788))
21
-
22
- ## [44.4.49](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.48...v44.4.49) (2025-09-02)
23
-
24
-
25
- ### Bug Fixes
26
-
27
- * updated gtm inclusion ([b7f0360](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b7f03605d1984351042fa06a1cd67812d39e435e))
28
-
29
- ## [44.4.48](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.47...v44.4.48) (2025-09-02)
30
-
31
-
32
- ### Bug Fixes
33
-
34
- * add lazy for comoponents ([732fdf7](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/732fdf7c10c3bbd1e46ca1d2f4bef04d879c8409))
35
-
36
-
37
- * Merge branch 'en-8-cwv-unused-js' into 'master' ([bcc5448](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/bcc5448cfce871e8189c7fbd42493c6f1d4c477e))
38
-
39
- ## [44.4.47](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.46...v44.4.47) (2025-09-01)
40
-
41
-
42
- ### Bug Fixes
43
-
44
- * checkbox issue ([dac5349](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/dac5349111ebd0c38bf1d84f05a35f34280dfe31))
45
-
46
- ## [44.4.46](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.45...v44.4.46) (2025-09-01)
47
-
48
-
49
- ### Bug Fixes
50
-
51
- * comment vote logic ([a09a3bd](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/a09a3bd5ef047976362b12099fb37e84c682cb69))
52
-
53
- ## [44.4.45](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.44...v44.4.45) (2025-08-29)
54
-
55
-
56
- ### Bug Fixes
57
-
58
- * voting logic ([15a7af0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/15a7af00ac73f71837d083c913d83fb9d6c95ca9))
59
-
60
- ## [44.4.44](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.43...v44.4.44) (2025-08-29)
61
-
62
-
63
- ### Bug Fixes
64
-
65
- * bug ([47ff70b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/47ff70b136bbcbd7efe441637dbd28d5ff0a3818))
66
- * bug ([2c76971](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/2c76971d6dca396f1c793786e9907d84f7b8fc15))
67
- * styling fixes ([da45e7d](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/da45e7d745c79953f5f2d830d0c7c86c8a72f4a6))
68
-
69
- ## [44.4.43](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.42...v44.4.43) (2025-08-29)
70
-
71
-
72
- ### Bug Fixes
73
-
74
- * voting ([2c38c8f](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/2c38c8ff3e2ee8b9aadeceb2e2318b47359d11b5))
75
-
76
- ## [44.4.42](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.41...v44.4.42) (2025-08-29)
77
-
78
-
79
- ### Bug Fixes
80
-
81
- * outside click ([8b88022](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/8b88022dafe14a4c7c7d3d8efe08207a76659724))
82
- * test collapse ([a5dc747](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/a5dc7471eae5df4ab4b3eda3e91856a2e728476c))
83
- * test coverage ([bbd1138](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/bbd1138c1c668e745923917ddc5b08c5d994f64d))
84
- * test outside click ([c616f66](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c616f66192927bc53366f5ede49827614dcdf847))
85
- * voting ([2f2eb5c](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/2f2eb5c696d96c591af536a81f45bc7d4484e632))
86
-
87
-
88
- * Merge branch 'collapse-outside-click' into 'master' ([ade0483](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/ade0483aef0a470638e1b3132e11c850db0662b2))
89
-
90
- ## [44.4.41](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.40...v44.4.41) (2025-08-28)
91
-
92
-
93
- ### Bug Fixes
94
-
95
- * removed logs ([8930faa](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/8930faa83e1561dfb9c9bbb993fc167a2527363a))
96
-
97
- ## [44.4.40](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.39...v44.4.40) (2025-08-28)
98
-
99
-
100
- ### Bug Fixes
4
+ ### Features
101
5
 
102
- * changed limit of chars ([c1649bf](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c1649bf408e3f14bbb070f2988306d5e84ba15a2))
103
- * test ([0d6646b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/0d6646be600d5c977b8f0c4ee90ab4326f604eed))
104
- * update env ([849fc61](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/849fc61d6f0f33b2be2c2336061344b4a39c6f91))
6
+ * yield before event push ([58f1f6d](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/58f1f6daea0e6a39a329869e9acd506928343714))
105
7
 
106
- ## [44.4.39](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.38...v44.4.39) (2025-08-26)
8
+ # [44.5.0-poc.1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.35-poc.2...v44.5.0-poc.1) (2025-09-04)
107
9
 
108
10
 
109
11
  ### Bug Fixes
110
12
 
111
- * env handling ([149b8f2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/149b8f2de79af7532ce434223d12ef9249ba2047))
112
-
113
- ## [44.4.38](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.37...v44.4.38) (2025-08-26)
114
-
115
-
116
- ### Bug Fixes
13
+ * deploy fix ([42e33b3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/42e33b3a434cde10e899afef41852dff49fe9700))
14
+ * gtm id ([52c86e7](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/52c86e77884fc12da1db4f1aea6ef739d44d224b))
15
+ * test deploy ([fa38562](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/fa3856257c8149dc84bf72e57e0fcc5ece8839af))
16
+ * test deploy ([6d649ce](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/6d649ce3343a61792522be16a792fcc2c7aa158d))
17
+ * yield only on one place ([52acd92](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/52acd92131461b781f1b8e60e9f366239878ca3e))
117
18
 
118
- * redirect logic for affiliates ([f88bc07](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/f88bc07ac8e48f90cc25c57ddecb75eed774a284))
119
- * redirects ([c6ba3a0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c6ba3a00e7a794e7d7d816611bc72ae4531bf4ce))
120
- * redirects ([c8358be](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c8358be986550b149677e7ec0eee484db913120e))
121
- * tests ([9e90c50](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/9e90c50ef0a77ae246033225f111a3ecc6d5f302))
122
19
 
123
- ## [44.4.37](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.36...v44.4.37) (2025-08-25)
20
+ * Merge branch 'poc' of gitlab.com:g2m-gentoo/team-floyd/themes/gatsby-themes into poc ([cb72402](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/cb72402d1e34e427742f6ae335f77bbb9ad77785))
21
+ * Merge branch 'revert-2a55f352' into 'poc' ([eb0069c](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/eb0069cd14b7a01c85e911cf6bf4abf8b4bb0fce))
22
+ * Revert "fix: remove multiple templates" ([0e1a8ca](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/0e1a8ca0d1f7d21d059eff734aa040ef02f0e9b9))
124
23
 
125
24
 
126
- ### Bug Fixes
25
+ ### Features
127
26
 
128
- * added x robots tag ([e549a5e](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/e549a5ebfd8e42ae32f6c283be4059b4c06d888f))
129
- * test ([7630b92](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/7630b92b621e6117c400af243d2b4c300422a833))
130
- * test ([385538b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/385538b233d94cb8416f31eedd5f509efa1d1c1e))
27
+ * yield scripts and gtm crossOrigin ([88858d5](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/88858d558d516f267cce68056a43513c18248ba6))
131
28
 
132
- ## [44.4.36](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.35...v44.4.36) (2025-08-25)
29
+ ## [44.4.35-poc.2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.35-poc.1...v44.4.35-poc.2) (2025-09-01)
133
30
 
134
31
 
135
32
  ### Bug Fixes
136
33
 
137
- * add load more translation based on type of module cards ([0bf050c](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/0bf050cdb0fb0d43605ab6bc93478aaf0b46378e))
138
- * added env var to enable server redirects instead of splash screens ([c67368f](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c67368f1f11184ba52d2a32ea35e78e53e79b1a4))
139
- * updated env ([dde7f3b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/dde7f3b11987fa88f018bd69b96b8ca4db1765d8))
140
-
141
-
142
- * Merge branch 'tm-5657-redirect-logic' into 'master' ([04f2c5b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/04f2c5b863246c0889f232d65a7c375ea8e417d4))
143
- * Merge branch 'tm-5331-load-more-archive' into 'master' ([22da05c](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/22da05cf57b9bc77fe5f37bb5fc955ad7ec9351e))
34
+ * remove multiple templates ([2a55f35](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/2a55f3521f55a51f11200b098abec0e978f7ecfa))
144
35
 
145
- ## [44.4.35](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.34...v44.4.35) (2025-08-21)
36
+ ## [44.4.35-poc.1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.34...v44.4.35-poc.1) (2025-08-22)
146
37
 
147
38
 
148
39
  ### Bug Fixes
149
40
 
41
+ * added commit pipelines ([0d583de](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/0d583de2d5683794918c6bb89e59a2a7ab88848f))
42
+ * added stage ci cd ([9fa7040](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/9fa7040c89379832385b0d0a0fb4830c093601fa))
43
+ * added utils to publush script ([2c78e6e](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/2c78e6e276e034739b8fb08228ad637cf8a96122))
150
44
  * added validation to comments ([64cd409](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/64cd40908393328d83fa10d933b834b74b418894))
45
+ * ci cd ([86d0f72](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/86d0f725b51853c019d4c492136e525b29d50285))
46
+ * deploy pm2 name ([0574aa7](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/0574aa77c25be5eda6a8f5131965ad36680d3152))
47
+ * deploy pm2 name ([70fbbe7](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/70fbbe7026b584967bffcb9b3d169150e834a9fd))
48
+ * deploy pm2 name ([e937f5f](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/e937f5f9183d9f050211079a65b6c22b8e3c7f32))
49
+ * deploy pm2 name ([a384b54](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/a384b545c3112742c9d9126cac655aa20a2aadbc))
50
+ * deploy pm2 name ([ef636b1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/ef636b125cccc81158298bd0a2ca3f3c2e9be2ed))
51
+ * deploy pm2 name ([24662d5](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/24662d5464dd6227da04c25c9a4a07ce2ab4fbfc))
52
+ * pm2 name ([9c26e31](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/9c26e3103a4f01313a2aa67812eaa699e6fb6ddd))
53
+ * poc stages added ([502f386](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/502f386fe8f7a9444daab822e798db48a5873a1b))
54
+ * semantic release ([ccc3375](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/ccc3375e46d8c563cd62f6268c61c6d6394f6676))
151
55
  * tnc validation ([f4bb891](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/f4bb8914e4f73e8f33952df2209f212ca677cafb))
152
56
 
153
57
  ## [44.4.34](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.33...v44.4.34) (2025-08-21)
package/gatsby-browser.js CHANGED
@@ -9,42 +9,58 @@
9
9
  /* eslint-disable prefer-destructuring */
10
10
 
11
11
  // Main Vars
12
- require('./src/styles/utils/variables/_colors.scss');
13
- require('./src/styles/utils/variables/_main.scss');
14
- require('./src/styles/base/_typography.scss');
15
- require('./src/styles/base/_reset.scss');
16
- require('./src/styles/base/_spacing.scss');
17
- require('./src/styles/layouts/_grid.scss');
12
+ require("./src/styles/utils/variables/_colors.scss");
13
+ require("./src/styles/utils/variables/_main.scss");
14
+ require("./src/styles/base/_typography.scss");
15
+ require("./src/styles/base/_reset.scss");
16
+ require("./src/styles/base/_spacing.scss");
17
+ require("./src/styles/layouts/_grid.scss");
18
+
19
+ async function yieldToMain() {
20
+ if (globalThis.scheduler?.yield) {
21
+ return scheduler.yield();
22
+ }
23
+
24
+ // Fall back to yielding with setTimeout.
25
+ return new Promise((resolve) => {
26
+ setTimeout(resolve, 0);
27
+ });
28
+ }
18
29
 
19
30
  function initGTM() {
20
- if (window.loadGTM === false || window.gtmDidInit || process.env.DISABLE_GTM === 'true') {
31
+ if (
32
+ window.loadGTM === false ||
33
+ window.gtmDidInit ||
34
+ process.env.DISABLE_GTM === "true"
35
+ ) {
21
36
  return false;
22
37
  }
23
38
 
24
39
  window.gtmDidInit = true; // flag to ensure script does not get added to DOM more than once.
25
40
  const trackingLink = `https://www.googletagmanager.com/gtm.js?id=${process.env.GA_TRACKING_ID}`;
26
41
 
27
- const script = document.createElement('script');
28
- script.type = 'text/javascript';
42
+ const script = document.createElement("script");
43
+ script.type = "text/javascript";
29
44
  script.async = true;
45
+ script.crossOrigin = "anonymous";
30
46
  script.src = trackingLink;
31
47
 
32
48
  script.onload = () => {
33
49
  // eslint-disable-next-line no-undef
34
50
  dataLayer.push({
35
51
  // ensure PageViews are always tracked
36
- event: 'gtm.js',
37
- 'gtm.start': new Date().getTime(),
38
- 'gtm.uniqueEventId': 0,
52
+ event: "gtm.js",
53
+ "gtm.start": new Date().getTime(),
54
+ "gtm.uniqueEventId": 0,
39
55
  });
40
56
  };
41
57
  document.head.appendChild(script);
42
58
 
43
- const noscript = document.createElement('noscript');
44
- const iframe = document.createElement('iframe');
59
+ const noscript = document.createElement("noscript");
60
+ const iframe = document.createElement("iframe");
45
61
  iframe.src = trackingLink;
46
- iframe.style.display = 'none';
47
- iframe.style.visibility = 'hidden';
62
+ iframe.style.display = "none";
63
+ iframe.style.visibility = "hidden";
48
64
  iframe.height = 0;
49
65
  iframe.width = 0;
50
66
  noscript.innerHTML += iframe.outerHTML;
@@ -52,16 +68,15 @@ function initGTM() {
52
68
  }
53
69
 
54
70
  function optinMonster() {
55
- const script = document.createElement('script');
56
- script.id = 'optin-monstr';
57
- script.setAttribute('data-user', process.env.OPTINMONSTR_USER);
58
- script.setAttribute('data-account', process.env.OPTINMONSTR_ACC);
59
- script.src = 'https://a.omappapi.com/app/js/api.min.js';
71
+ const script = document.createElement("script");
72
+ script.id = "optin-monstr";
73
+ script.setAttribute("data-user", process.env.OPTINMONSTR_USER);
74
+ script.setAttribute("data-account", process.env.OPTINMONSTR_ACC);
75
+ script.src = "https://a.omappapi.com/app/js/api.min.js";
60
76
  script.async = true;
61
77
  document.head.appendChild(script);
62
78
  }
63
79
 
64
-
65
80
  const loadFacebookPixel = () => {
66
81
  !(function (f, b, e, v, n, t, s) {
67
82
  // eslint-disable-next-line no-multi-assign
@@ -75,15 +90,20 @@ const loadFacebookPixel = () => {
75
90
  if (!f._fbq) f._fbq = n;
76
91
  n.push = n;
77
92
  n.loaded = !0;
78
- n.version = '2.0';
93
+ n.version = "2.0";
79
94
  n.queue = [];
80
95
  t = b.createElement(e);
81
96
  t.async = !0;
82
- t.id = 'pixel-code';
97
+ t.id = "pixel-code";
83
98
  t.src = v;
84
99
  s = b.getElementsByTagName(e)[0];
85
100
  s.parentNode.insertBefore(t, s);
86
- })(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js');
101
+ })(
102
+ window,
103
+ document,
104
+ "script",
105
+ "https://connect.facebook.net/en_US/fbevents.js"
106
+ );
87
107
  };
88
108
 
89
109
  const microsoftAdvertising = () => {
@@ -91,73 +111,105 @@ const microsoftAdvertising = () => {
91
111
  var f, n, i;
92
112
  (w[u] = w[u] || []),
93
113
  (f = function () {
94
- var o = { ti: '187106455', enableAutoSpaTracking: true };
95
- (o.q = w[u]), (w[u] = new UET(o)), w[u].push('pageLoad');
114
+ var o = { ti: "187106455", enableAutoSpaTracking: true };
115
+ (o.q = w[u]), (w[u] = new UET(o)), w[u].push("pageLoad");
96
116
  }),
97
117
  (n = d.createElement(t)),
98
118
  (n.src = r),
99
119
  (n.async = 1),
100
- (n.id = 'microsoft-code'),
120
+ (n.id = "microsoft-code"),
101
121
  (n.onload = n.onreadystatechange =
102
122
  function () {
103
123
  var s = this.readyState;
104
- (s && s !== 'loaded' && s !== 'complete') ||
124
+ (s && s !== "loaded" && s !== "complete") ||
105
125
  (f(), (n.onload = n.onreadystatechange = null));
106
126
  }),
107
127
  (i = d.getElementsByTagName(t)[0]),
108
128
  i.parentNode.insertBefore(n, i);
109
- })(window, document, 'script', '//bat.bing.com/bat.js', 'uetq');
129
+ })(window, document, "script", "//bat.bing.com/bat.js", "uetq");
110
130
  };
111
131
 
112
- const piguard = () =>{
132
+ const piguard = () => {
113
133
  if (window.loadGTM === false) {
114
134
  return false;
115
135
  }
116
136
 
117
- const script = document.createElement('script');
118
- script.id = 'piguard';
137
+ const script = document.createElement("script");
138
+ script.id = "piguard";
119
139
  script.src = `https://pg.${process.env.GATSBY_SITE_NAME}/analytics.js?tid=PP-${process.env.PIGUARD_ID}`;
120
140
  script.async = true;
121
141
  document.head.appendChild(script);
122
- }
142
+ };
123
143
 
124
- function scrollEvent(event) {
144
+ async function scrollEvent(event) {
145
+ await yieldToMain();
125
146
  initGTM();
126
-
127
- if (!document.getElementById('piguard') && process.env.ENABLE_PIGUARD === 'true') {
147
+ if (
148
+ !document.getElementById("piguard") &&
149
+ process.env.ENABLE_PIGUARD === "true"
150
+ ) {
128
151
  piguard();
129
152
  }
130
153
 
131
- if (process.env.ENABLE_MICROSOFT === 'true' && !document.getElementById('microsoft-code'))
154
+ if (
155
+ process.env.ENABLE_MICROSOFT === "true" &&
156
+ !document.getElementById("microsoft-code")
157
+ )
132
158
  microsoftAdvertising();
133
159
 
134
- if (process.env.ENABLE_OPTINMONSTR === 'true' && !document.getElementById('optin-monstr'))
160
+ if (
161
+ process.env.ENABLE_OPTINMONSTR === "true" &&
162
+ !document.getElementById("optin-monstr")
163
+ )
135
164
  optinMonster();
136
- if (process.env.ENABLE_PIXEL === 'true' && !document.getElementById('pixel-code')) {
165
+ if (
166
+ process.env.ENABLE_PIXEL === "true" &&
167
+ !document.getElementById("pixel-code")
168
+ ) {
137
169
  if (
138
- typeof window !== 'undefined' &&
170
+ typeof window !== "undefined" &&
139
171
  window.location.pathname !== process.env.PAGE_EXCLUDE_PIXEL
140
172
  ) {
141
173
  loadFacebookPixel();
142
174
 
143
- fbq('init', process.env.PIXEL_ID);
175
+ fbq("init", process.env.PIXEL_ID);
144
176
 
145
177
  // Initialize and track the PageView event
146
- fbq('track', 'PageView');
178
+ fbq("track", "PageView");
147
179
  }
148
180
  }
149
181
 
150
182
  if (event) {
151
- event.currentTarget.removeEventListener(event.type, scrollEvent); // remove the event listener that got triggered
183
+ event.currentTarget?.removeEventListener(event.type, scrollEvent); // remove the event listener that got triggered
152
184
  }
153
185
  }
154
186
 
155
187
  exports.onClientEntry = () => {
156
- if (process.env.PPC === 'true') {
188
+ if (process.env.PPC === "true") {
157
189
  scrollEvent(null);
158
190
  } else {
159
- document.addEventListener('scroll', scrollEvent, { passive: true });
160
- document.addEventListener('mousemove', scrollEvent, { passive: true });
161
- document.addEventListener('touchstart', scrollEvent, { passive: true });
191
+ // detect if is mobile
192
+ if (
193
+ /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
194
+ navigator.userAgent
195
+ )
196
+ ) {
197
+ scrollEvent(null);
198
+ return;
199
+ }
200
+
201
+ document.addEventListener("scroll", scrollEvent);
202
+ document.addEventListener("mousemove", scrollEvent);
203
+ document.addEventListener("touchstart", scrollEvent, { passive: true });
204
+ }
205
+ if (window.dataLayer && typeof window.dataLayer.push === "function") {
206
+ const originalPush = window.dataLayer.push.bind(window.dataLayer);
207
+
208
+ window.dataLayer.push = function (...args) {
209
+ (async () => {
210
+ await yieldToMain();
211
+ originalPush(...args);
212
+ })();
213
+ };
162
214
  }
163
215
  };
package/gatsby-node.mjs CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  clean,
24
24
  removeUnwantedSections,
25
25
  } from "./src/resolver/common.mjs";
26
- import { generateRedirects, generatePrettyLinkRedirects } from "./src/resolver/redirect.mjs";
26
+ import { generateRedirects } from "./src/resolver/redirect.mjs";
27
27
  import { translate, is404Page } from "./src/helpers/getters.mjs";
28
28
  import { getArchivePages, hasArchiveModule } from "./src/resolver/archive.mjs";
29
29
 
@@ -71,10 +71,12 @@ const relations = {};
71
71
 
72
72
  // eslint-disable-next-line import/prefer-default-export
73
73
  export const createPages = async (
74
- { actions: { createPage, createRedirect } },
74
+ { actions: { createPage } },
75
75
  themeOptions
76
76
  ) => {
77
77
  process.env.GATSBY_SITE_NAME = String(themeOptions.siteName);
78
+
79
+ generateRedirects(siteSettingsData);
78
80
  preconnectLinks = themeOptions.preconnectLinks || [];
79
81
  console.log(chalk.magenta("info") + chalk.whiteBright(" starting processor"));
80
82
 
@@ -124,8 +126,6 @@ export const createPages = async (
124
126
  streamRobotsTxt.write(robotsTxtContent);
125
127
  streamRobotsTxt.end();
126
128
 
127
- generateRedirects(siteSettingsData);
128
-
129
129
  // create every single page
130
130
  Object.keys(processed.site_markets).forEach((siteMarket) => {
131
131
  if (!processed.pages[siteMarket]["page"]) {
@@ -282,27 +282,23 @@ export const createPages = async (
282
282
  }
283
283
  });
284
284
 
285
- if(process.env.DISABLE_SPLASH_SCREEN === 'true'){
286
- generatePrettyLinkRedirects( trackingPages )
287
- }else{
288
- trackingPages.forEach(({ path, page, operator }) => {
289
- createPage({
290
- path,
291
- component: `${__dirname}/src/components/${
292
- process.env.IS_TRACKING_SSR === "true"
293
- ? "app-tracker-ssr.js"
294
- : "app-tracker.js"
295
- }`,
296
- context: {
297
- page,
298
- siteGeneralData,
299
- operator,
300
- isTracker: true,
301
- isLiveStreamProvider: false,
302
- },
303
- });
304
- })
305
- }
285
+ trackingPages.forEach(({ path, page, operator }) => {
286
+ createPage({
287
+ path,
288
+ component: `${__dirname}/src/components/${
289
+ process.env.IS_TRACKING_SSR === "true"
290
+ ? "app-tracker-ssr.js"
291
+ : "app-tracker.js"
292
+ }`,
293
+ context: {
294
+ page,
295
+ siteGeneralData,
296
+ operator,
297
+ isTracker: true,
298
+ isLiveStreamProvider: false,
299
+ },
300
+ });
301
+ });
306
302
  };
307
303
 
308
304
  export const onCreatePage = async ({ page, actions }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "44.4.52",
3
+ "version": "44.5.0-poc.2",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
package/release.config.js CHANGED
@@ -92,6 +92,11 @@ module.exports = {
92
92
 
93
93
  '@semantic-release/git',
94
94
  ],
95
+ branches: [
96
+ 'master',
97
+ { name: 'beta', prerelease: true },
98
+ { name: 'poc', prerelease: true }
99
+ ],
95
100
  release: {
96
101
  extends: '@semantic-release/gitlab-config',
97
102
  prepare: [
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable react-hooks/rules-of-hooks */
2
2
  /* eslint-disable arrow-body-style */
3
- import React, { lazy, Suspense } from 'react';
3
+ import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
 
6
6
  import { formatDate } from '~helpers/date-time';
@@ -8,11 +8,10 @@ import { imagePrettyUrl } from '~helpers/getters';
8
8
  import Link from '~hooks/link';
9
9
  import LazyImage from '~hooks/lazy-image';
10
10
  import useTranslate from '~hooks/useTranslate/useTranslate';
11
+ import Verify from '~images/icons/verify';
12
+ import Clock from '~images/icons/clock';
11
13
  import styles from './author.module.scss';
12
14
 
13
- const VerifyIcon = lazy(() => import('~images/icons/verify'));
14
- const ClockIcon = lazy(() => import('~images/icons/clock'));
15
-
16
15
  const Author = ({
17
16
  name,
18
17
  date,
@@ -27,11 +26,11 @@ const Author = ({
27
26
  isCardsAuthor = false,
28
27
  hasAuthorBox = false,
29
28
  reviewer,
30
- clock = <Suspense fallback={null}><ClockIcon /></Suspense>,
29
+ clock = <Clock />,
31
30
  authorImageWidth = 30,
32
31
  authorImageHeight = 30,
33
32
  showVerification = false,
34
- verifyIcon = <Suspense fallback={null}><VerifyIcon /></Suspense>,
33
+ verifyIcon = <Verify />,
35
34
  }) => {
36
35
  const prefixstyle = !link || !authorImg;
37
36