gatsby-core-theme 39.0.34 → 40.0.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/CHANGELOG.md +33 -0
- package/gatsby-browser.js +19 -0
- package/jest.config.js +1 -0
- package/package.json +1 -1
- package/src/components/atoms/disquss/index.js +36 -0
- package/src/components/molecules/content/index.js +3 -3
- package/src/components/molecules/main/index.js +13 -1
- package/src/helpers/replaceMedia.js +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
|
+
## [40.0.1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v40.0.0...v40.0.1) (2024-10-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* disquss url ([4469bd3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/4469bd3a5061b836fd5bab62938a7107498785b6))
|
|
7
|
+
|
|
8
|
+
# [40.0.0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v39.0.34...v40.0.0) (2024-10-10)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* added disquss ([c7998bf](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c7998bf0379eaaac218b27411056a0fc0f7a0539))
|
|
14
|
+
* added disquss ([f2dcba8](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/f2dcba8b310a61f298ab31875e76ac3647a96f22))
|
|
15
|
+
* props update ([dcd8dde](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/dcd8ddeea790d5d6fa84de2b5586448d17b5043a))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Code Refactoring
|
|
19
|
+
|
|
20
|
+
* add class to cta in content module ([acc6d23](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/acc6d23d2e7a860a5ff161a2bcd0eacc5d90f39a))
|
|
21
|
+
* remove temp ([ad0b882](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/ad0b882c0c9dcf431c67d43f3859b8fef9611a4e))
|
|
22
|
+
* temp ([db0d2a0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/db0d2a0013b7efda7629f8c6c2d968a71a130a0d))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
* Merge branch 'tm-4853-disquss' into 'master' ([6c35492](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/6c35492994e40e30d2a009b56e828636bf4e4dcc))
|
|
26
|
+
* Merge branch 'tm-4851-content-cta' into 'master' ([3674785](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/36747852f09fc03b31b6dbefb3f5c957dcf9f8be))
|
|
27
|
+
* Merge branch 'master' into tm-4851-content-cta ([78f3323](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/78f3323db3cd299783ef2a89d7a0f8a2783ba7ed))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Tests
|
|
31
|
+
|
|
32
|
+
* fix test ([6b7b000](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/6b7b0008f1b8b09e1852dd43f4141b58cea2538c))
|
|
33
|
+
|
|
1
34
|
## [39.0.34](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v39.0.33...v39.0.34) (2024-10-10)
|
|
2
35
|
|
|
3
36
|
|
package/gatsby-browser.js
CHANGED
|
@@ -124,6 +124,21 @@ const piguard = () =>{
|
|
|
124
124
|
document.head.appendChild(script);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
const disquss = () =>{
|
|
128
|
+
// eslint-disable-next-line no-unused-vars, func-names, camelcase
|
|
129
|
+
var disqus_config = function () {
|
|
130
|
+
this.page.url = window.location.href;
|
|
131
|
+
this.page.identifier = window.location.pathname; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
var d = document,
|
|
135
|
+
s = d.createElement('script');
|
|
136
|
+
s.src = `${process.env.DISQUSS_URL}`;
|
|
137
|
+
s.id = 'disquss-code';
|
|
138
|
+
s.setAttribute('data-timestamp', +new Date());
|
|
139
|
+
(d.head || d.body).appendChild(s);
|
|
140
|
+
}
|
|
141
|
+
|
|
127
142
|
function scrollEvent(event) {
|
|
128
143
|
initGTM();
|
|
129
144
|
|
|
@@ -131,6 +146,10 @@ function scrollEvent(event) {
|
|
|
131
146
|
piguard();
|
|
132
147
|
}
|
|
133
148
|
|
|
149
|
+
if (!document.getElementById('disquss-code') && process.env.ENABLE_DISQUSS === 'true') {
|
|
150
|
+
disquss();
|
|
151
|
+
}
|
|
152
|
+
|
|
134
153
|
if (process.env.ENABLE_MICROSOFT === 'true' && !document.getElementById('microsoft-code'))
|
|
135
154
|
microsoftAdvertising();
|
|
136
155
|
|
package/jest.config.js
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
2
|
+
/* eslint-disable react/no-this-in-sfc */
|
|
3
|
+
/* eslint-disable no-undef */
|
|
4
|
+
import React, { useEffect } from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
|
|
7
|
+
import { getUrl } from '~helpers/getters';
|
|
8
|
+
|
|
9
|
+
const Disquss = ({page}) => {
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (typeof DISQUS !== 'undefined') {
|
|
12
|
+
DISQUS.reset({
|
|
13
|
+
reload: true,
|
|
14
|
+
config() {
|
|
15
|
+
this.page.title = page.title;
|
|
16
|
+
this.page.url = getUrl(page.path);
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}, []);
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<div className="module">
|
|
24
|
+
<div id="disqus_thread" />
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
Disquss.propTypes = {
|
|
30
|
+
page: PropTypes.shape({
|
|
31
|
+
title: PropTypes.string,
|
|
32
|
+
path: PropTypes.string
|
|
33
|
+
})
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default Disquss;
|
|
@@ -17,7 +17,7 @@ const Content = ({
|
|
|
17
17
|
isModuleIntroduction = '',
|
|
18
18
|
page,
|
|
19
19
|
moduleName = 'content',
|
|
20
|
-
isContentCollapsible =
|
|
20
|
+
isContentCollapsible = false,
|
|
21
21
|
icon = <IoIosArrowDown />,
|
|
22
22
|
moduleWidth = 960,
|
|
23
23
|
modulePosition,
|
|
@@ -59,7 +59,7 @@ const Content = ({
|
|
|
59
59
|
>
|
|
60
60
|
{parse(content, {
|
|
61
61
|
replace: (node) =>
|
|
62
|
-
replaceMedia(node, moduleWidth, moduleName, pageTemplate, modulePosition)
|
|
62
|
+
replaceMedia(node, moduleWidth, moduleName, pageTemplate, modulePosition, styles)
|
|
63
63
|
})}
|
|
64
64
|
</div>
|
|
65
65
|
)
|
|
@@ -84,7 +84,7 @@ const Content = ({
|
|
|
84
84
|
`}
|
|
85
85
|
>
|
|
86
86
|
{parse(content, {
|
|
87
|
-
replace: (node) => replaceMedia(node, page, {}, moduleWidth)
|
|
87
|
+
replace: (node) => replaceMedia(node, page, {}, moduleWidth, styles)
|
|
88
88
|
})}
|
|
89
89
|
</div>
|
|
90
90
|
)
|
|
@@ -37,6 +37,10 @@ const Main = ({
|
|
|
37
37
|
const NotFound = page?.path?.includes("404")
|
|
38
38
|
? lazy(() => import(`~atoms/not-found`))
|
|
39
39
|
: null;
|
|
40
|
+
|
|
41
|
+
const Disquss =
|
|
42
|
+
page.type === "operator" && process.env.ENABLE_DISQUSS === 'true' ? lazy(() => import(`~atoms/disquss`)) : null;
|
|
43
|
+
|
|
40
44
|
const Newsletter = showNewsletter
|
|
41
45
|
? lazy(() => import("~molecules/newsletter"))
|
|
42
46
|
: null;
|
|
@@ -49,7 +53,8 @@ const Main = ({
|
|
|
49
53
|
|
|
50
54
|
return (
|
|
51
55
|
<main className={styles.modulePage || ""}>
|
|
52
|
-
{section &&
|
|
56
|
+
{section &&
|
|
57
|
+
section.modules &&
|
|
53
58
|
section.modules.map((module, index) => (
|
|
54
59
|
<Module
|
|
55
60
|
key={keygen()}
|
|
@@ -61,6 +66,13 @@ const Main = ({
|
|
|
61
66
|
modulePosition={index + 1}
|
|
62
67
|
/>
|
|
63
68
|
))}
|
|
69
|
+
|
|
70
|
+
{Disquss && (
|
|
71
|
+
<Suspense fallback={<></>}>
|
|
72
|
+
<Disquss page={pageContext.page} />
|
|
73
|
+
</Suspense>
|
|
74
|
+
)}
|
|
75
|
+
|
|
64
76
|
{NotFound && (
|
|
65
77
|
<Suspense fallback={<></>}>
|
|
66
78
|
<NotFound pageContext={pageContext} />
|
|
@@ -5,7 +5,12 @@ import { isTrackerLink } from 'gatsby-core-theme/src/helpers/tracker.mjs'
|
|
|
5
5
|
import processImageNode from './processImageNode.js'
|
|
6
6
|
import PrettyLink from '~atoms/pretty-link'
|
|
7
7
|
|
|
8
|
-
export default (node, moduleWidth = 960, moduleName, pageTemplate, modulePosition) => {
|
|
8
|
+
export default (node, moduleWidth = 960, moduleName, pageTemplate, modulePosition, styles) => {
|
|
9
|
+
|
|
10
|
+
if (node.name === 'a' && node?.attribs?.class) {
|
|
11
|
+
node.attribs.class = styles && styles[node?.attribs?.class];
|
|
12
|
+
}
|
|
13
|
+
|
|
9
14
|
if (node.name === 'iframe') {
|
|
10
15
|
return <Iframe src={node.attribs.src} />
|
|
11
16
|
}
|