gatsby-theme-carbon 4.3.22 → 4.3.24
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 +6 -0
- package/gatsby-node.mjs +11 -1
- package/package.json +2 -2
- package/src/util/hooks/useOnClickOutside.js +14 -12
- package/src/util/hooks/useScrollPosition.js +14 -12
package/gatsby-config.mjs
CHANGED
|
@@ -139,6 +139,12 @@ export default (themeOptions) => {
|
|
|
139
139
|
options: {
|
|
140
140
|
sassOptions: {
|
|
141
141
|
includePaths: [path.resolve(__dirname, 'node_modules')],
|
|
142
|
+
api: 'modern',
|
|
143
|
+
silenceDeprecations: [
|
|
144
|
+
'legacy-js-api',
|
|
145
|
+
'global-builtin',
|
|
146
|
+
'if-function',
|
|
147
|
+
],
|
|
142
148
|
},
|
|
143
149
|
},
|
|
144
150
|
},
|
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.24",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"author": "vpicone <vp@vincepic.one> (@vpicone)",
|
|
6
6
|
"repository": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"beautiful-react-hooks": "^5.0.3",
|
|
40
40
|
"classnames": "^2.5.1",
|
|
41
41
|
"copy-to-clipboard": "^3.3.3",
|
|
42
|
-
"focus-trap-react": "^
|
|
42
|
+
"focus-trap-react": "^11.0.4",
|
|
43
43
|
"gatsby-plugin-catch-links": "^5.15.0",
|
|
44
44
|
"gatsby-plugin-local-search": "^2.0.1",
|
|
45
45
|
"gatsby-plugin-manifest": "^5.15.0",
|
|
@@ -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 = () => {
|