gatsby-theme-carbon 4.3.21 → 4.3.23
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/gatsby-config.mjs +2 -0
- package/gatsby-node.mjs +11 -1
- package/package.json +6 -6
- package/src/util/hooks/useOnClickOutside.js +14 -12
- package/src/util/hooks/useScrollPosition.js +14 -12
package/gatsby-config.mjs
CHANGED
package/gatsby-node.mjs
CHANGED
|
@@ -4,8 +4,18 @@ import * as mkdirp from 'mkdirp';
|
|
|
4
4
|
import startCase from 'lodash.startcase';
|
|
5
5
|
import FilterWarningsPlugin from 'webpack-filter-warnings-plugin';
|
|
6
6
|
|
|
7
|
-
export const onCreateWebpackConfig = ({ actions }) => {
|
|
7
|
+
export const onCreateWebpackConfig = ({ stage, loaders, actions }) => {
|
|
8
8
|
actions.setWebpackConfig({
|
|
9
|
+
module: {
|
|
10
|
+
rules: [
|
|
11
|
+
stage === 'build-html' || stage === 'develop-html'
|
|
12
|
+
? {
|
|
13
|
+
test: /smooth-scroll/,
|
|
14
|
+
use: loaders.null(),
|
|
15
|
+
}
|
|
16
|
+
: null,
|
|
17
|
+
].filter(Boolean),
|
|
18
|
+
},
|
|
9
19
|
plugins: [
|
|
10
20
|
new FilterWarningsPlugin({
|
|
11
21
|
exclude:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-theme-carbon",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.23",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"author": "vpicone <vp@vincepic.one> (@vpicone)",
|
|
6
6
|
"repository": {
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"@babel/core": "^7.28.5",
|
|
27
27
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
28
28
|
"@babel/plugin-syntax-jsx": "^7.27.1",
|
|
29
|
-
"@carbon/elements": "^11.
|
|
30
|
-
"@carbon/grid": "^11.
|
|
31
|
-
"@carbon/pictograms-react": "^11.
|
|
32
|
-
"@carbon/react": "^1.
|
|
33
|
-
"@carbon/themes": "^11.
|
|
29
|
+
"@carbon/elements": "^11.80.0",
|
|
30
|
+
"@carbon/grid": "^11.46.0",
|
|
31
|
+
"@carbon/pictograms-react": "^11.91.0",
|
|
32
|
+
"@carbon/react": "^1.97.0",
|
|
33
|
+
"@carbon/themes": "^11.64.0",
|
|
34
34
|
"@garcia-enterprise/gatsby-plugin-sass-resources": "^4.0.2",
|
|
35
35
|
"@mdx-js/mdx": "^3.1.1",
|
|
36
36
|
"@mdx-js/react": "^3.1.1",
|
|
@@ -2,18 +2,20 @@ import { useEffect } from 'react';
|
|
|
2
2
|
|
|
3
3
|
let passiveListenerSupported;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
if (typeof window !== 'undefined') {
|
|
6
|
+
try {
|
|
7
|
+
const opts = Object.defineProperty({}, 'passive', {
|
|
8
|
+
// eslint-disable-next-line getter-return
|
|
9
|
+
get() {
|
|
10
|
+
passiveListenerSupported = true;
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
window.addEventListener('testPassive', null, opts);
|
|
14
|
+
window.removeEventListener('testPassive', null, opts);
|
|
15
|
+
} catch (e) {
|
|
16
|
+
console.warn(e);
|
|
17
|
+
passiveListenerSupported = false;
|
|
18
|
+
}
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
function useOnClickOutside(ref, handler) {
|
|
@@ -3,18 +3,20 @@ import _throttle from 'lodash.throttle';
|
|
|
3
3
|
|
|
4
4
|
let passiveListenerSupported;
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
if (typeof window !== 'undefined') {
|
|
7
|
+
try {
|
|
8
|
+
const opts = Object.defineProperty({}, 'passive', {
|
|
9
|
+
// eslint-disable-next-line getter-return
|
|
10
|
+
get() {
|
|
11
|
+
passiveListenerSupported = true;
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
window.addEventListener('testPassive', null, opts);
|
|
15
|
+
window.removeEventListener('testPassive', null, opts);
|
|
16
|
+
} catch (e) {
|
|
17
|
+
console.warn(e);
|
|
18
|
+
passiveListenerSupported = false;
|
|
19
|
+
}
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
const getPosition = () => {
|