gatsby-theme-carbon 4.3.22 → 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 CHANGED
@@ -139,6 +139,8 @@ export default (themeOptions) => {
139
139
  options: {
140
140
  sassOptions: {
141
141
  includePaths: [path.resolve(__dirname, 'node_modules')],
142
+ api: 'modern',
143
+ silenceDeprecations: ['legacy-js-api'],
142
144
  },
143
145
  },
144
146
  },
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.22",
3
+ "version": "4.3.23",
4
4
  "main": "index.js",
5
5
  "author": "vpicone <vp@vincepic.one> (@vpicone)",
6
6
  "repository": {
@@ -2,18 +2,20 @@ import { useEffect } from 'react';
2
2
 
3
3
  let passiveListenerSupported;
4
4
 
5
- try {
6
- const opts = Object.defineProperty({}, 'passive', {
7
- // eslint-disable-next-line getter-return
8
- get() {
9
- passiveListenerSupported = true;
10
- },
11
- });
12
- window.addEventListener('testPassive', null, opts);
13
- window.removeEventListener('testPassive', null, opts);
14
- } catch (e) {
15
- console.warn(e);
16
- passiveListenerSupported = false;
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
- 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;
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 = () => {