gatsby-theme-q3 2.2.2 → 2.3.4
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +41 -0
- package/gatsby-config.js +3 -3
- package/lib/components/LocaleBundles.js +42 -0
- package/lib/components/Wrapper.js +10 -7
- package/package.json +4 -2
- package/src/components/LocaleBundles.jsx +37 -0
- package/src/components/Wrapper.jsx +8 -7
- package/lib/plugins/gatsby-local-top-layout/gatsby-browser.js +0 -13
- package/lib/plugins/gatsby-local-top-layout/gatsby-ssr.js +0 -72
- package/lib/plugins/gatsby-local-top-layout/index.js +0 -2
- package/lib/plugins/gatsby-local-top-layout/package.json +0 -5
- package/src/plugins/gatsby-local-top-layout/gatsby-browser.js +0 -1
- package/src/plugins/gatsby-local-top-layout/gatsby-ssr.js +0 -67
- package/src/plugins/gatsby-local-top-layout/index.js +0 -1
- package/src/plugins/gatsby-local-top-layout/package.json +0 -5
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,47 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [2.3.4](https://github.com/3merge/q/compare/v2.3.3...v2.3.4) (2021-12-10)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* notistack ([4e40fa1](https://github.com/3merge/q/commit/4e40fa10a8c05ad07978b0f9dfcdb9317f67e712))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
## [2.3.2](https://github.com/3merge/q/compare/v2.3.1...v2.3.2) (2021-12-09)
|
18
|
+
|
19
|
+
**Note:** Version bump only for package gatsby-theme-q3
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
## [2.3.1](https://github.com/3merge/q/compare/v2.3.0...v2.3.1) (2021-12-09)
|
26
|
+
|
27
|
+
|
28
|
+
### Bug Fixes
|
29
|
+
|
30
|
+
* forward all config ([c4c512d](https://github.com/3merge/q/commit/c4c512da530866327940d56dba3976764cf53293))
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
# [2.3.0](https://github.com/3merge/q/compare/v2.2.2...v2.3.0) (2021-12-09)
|
37
|
+
|
38
|
+
|
39
|
+
### Features
|
40
|
+
|
41
|
+
* theme for prevent unstyled load ([#361](https://github.com/3merge/q/issues/361)) ([a1f1535](https://github.com/3merge/q/commit/a1f15358262b40829d3e1312864a1c0d08c778dc))
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
6
47
|
## [2.2.2](https://github.com/3merge/q/compare/v2.2.1...v2.2.2) (2021-12-09)
|
7
48
|
|
8
49
|
**Note:** Version bump only for package gatsby-theme-q3
|
package/gatsby-config.js
CHANGED
@@ -12,12 +12,12 @@ module.exports = ({
|
|
12
12
|
brandingColor,
|
13
13
|
icon,
|
14
14
|
netlify,
|
15
|
+
...options
|
15
16
|
}) => {
|
16
17
|
const plugins = [
|
17
18
|
{
|
18
|
-
resolve:
|
19
|
-
|
20
|
-
),
|
19
|
+
resolve: 'gatsby-theme-q3-mui',
|
20
|
+
options,
|
21
21
|
},
|
22
22
|
'gatsby-plugin-material-ui',
|
23
23
|
'gatsby-plugin-force-trailing-slashes',
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _q3UiLocale = require("q3-ui-locale");
|
9
|
+
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
const registeri18ResourceBundles = contentData => {
|
15
|
+
if (!contentData || !('en' in contentData)) return;
|
16
|
+
Object.entries(contentData).forEach(([key, bundle]) => {
|
17
|
+
Object.entries(bundle).forEach(([namespace, data]) => {
|
18
|
+
_q3UiLocale.i18n.addResourceBundle(key, namespace, data, true, true);
|
19
|
+
});
|
20
|
+
});
|
21
|
+
};
|
22
|
+
|
23
|
+
const LocaleBundles = ({
|
24
|
+
children,
|
25
|
+
locale
|
26
|
+
}) => {
|
27
|
+
registeri18ResourceBundles(locale);
|
28
|
+
return children;
|
29
|
+
};
|
30
|
+
|
31
|
+
LocaleBundles.defaultProps = {
|
32
|
+
children: null,
|
33
|
+
locale: {}
|
34
|
+
};
|
35
|
+
LocaleBundles.propTypes = {
|
36
|
+
// eslint-disable-next-line
|
37
|
+
children: _propTypes.default.any,
|
38
|
+
// eslint-disable-next-line
|
39
|
+
locale: _propTypes.default.object
|
40
|
+
};
|
41
|
+
var _default = LocaleBundles;
|
42
|
+
exports.default = _default;
|
@@ -11,10 +11,10 @@ var _axios = _interopRequireDefault(require("axios"));
|
|
11
11
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
13
13
|
|
14
|
-
var _q3UiForms = _interopRequireDefault(require("q3-ui-forms"));
|
15
|
-
|
16
14
|
var _q3UiPermissions = _interopRequireDefault(require("q3-ui-permissions"));
|
17
15
|
|
16
|
+
var _LocaleBundles = _interopRequireDefault(require("./LocaleBundles"));
|
17
|
+
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
19
|
|
20
20
|
/* eslint-disable import/no-extraneous-dependencies */
|
@@ -24,13 +24,14 @@ const setBaseUrlForRest = (baseURL = process.env.GATSBY_APP_BASE_URL || 'http://
|
|
24
24
|
};
|
25
25
|
|
26
26
|
const Wrapper = ({
|
27
|
+
baseURL,
|
27
28
|
children,
|
28
|
-
|
29
|
+
locale
|
29
30
|
}) => {
|
30
31
|
setBaseUrlForRest(baseURL);
|
31
|
-
return /*#__PURE__*/_react.default.createElement(
|
32
|
-
|
33
|
-
}, children));
|
32
|
+
return /*#__PURE__*/_react.default.createElement(_LocaleBundles.default, {
|
33
|
+
locale: locale
|
34
|
+
}, /*#__PURE__*/_react.default.createElement(_q3UiPermissions.default, null, children));
|
34
35
|
};
|
35
36
|
|
36
37
|
Wrapper.defaultProps = {
|
@@ -38,7 +39,9 @@ Wrapper.defaultProps = {
|
|
38
39
|
};
|
39
40
|
Wrapper.propTypes = {
|
40
41
|
baseURL: _propTypes.default.string,
|
41
|
-
children: _propTypes.default.node.isRequired
|
42
|
+
children: _propTypes.default.node.isRequired,
|
43
|
+
// eslint-disable-next-line
|
44
|
+
locale: _propTypes.default.object.isRequired
|
42
45
|
};
|
43
46
|
var _default = Wrapper;
|
44
47
|
exports.default = _default;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "gatsby-theme-q3",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.3.4",
|
4
4
|
"main": "index.js",
|
5
5
|
"license": "MIT",
|
6
6
|
"peerDependencies": {
|
@@ -29,15 +29,17 @@
|
|
29
29
|
"gatsby-plugin-sharp": "^4.2.0",
|
30
30
|
"gatsby-plugin-sitemap": "^5.2.0",
|
31
31
|
"gatsby-source-contentful": "^7.0.0",
|
32
|
+
"gatsby-theme-q3-mui": "^2.3.4",
|
32
33
|
"gatsby-transformer-sharp": "^4.2.0",
|
33
34
|
"lodash": "^4.17.20",
|
34
35
|
"process": "^0.11.10",
|
35
36
|
"prop-types": "^15.7.2",
|
37
|
+
"q3-ui-locale": "^2.3.2",
|
36
38
|
"query-string": "^7.0.1",
|
37
39
|
"react-share": "^4.3.1",
|
38
40
|
"slugify": "^1.6.3",
|
39
41
|
"transform-loader": "^0.2.4",
|
40
42
|
"yarn": "^1.22.17"
|
41
43
|
},
|
42
|
-
"gitHead": "
|
44
|
+
"gitHead": "93a43d911ce0af48809ba3142404363c70932573"
|
43
45
|
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { i18n } from 'q3-ui-locale';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
|
4
|
+
const registeri18ResourceBundles = (contentData) => {
|
5
|
+
if (!contentData || !('en' in contentData)) return;
|
6
|
+
|
7
|
+
Object.entries(contentData).forEach(([key, bundle]) => {
|
8
|
+
Object.entries(bundle).forEach(([namespace, data]) => {
|
9
|
+
i18n.addResourceBundle(
|
10
|
+
key,
|
11
|
+
namespace,
|
12
|
+
data,
|
13
|
+
true,
|
14
|
+
true,
|
15
|
+
);
|
16
|
+
});
|
17
|
+
});
|
18
|
+
};
|
19
|
+
|
20
|
+
const LocaleBundles = ({ children, locale }) => {
|
21
|
+
registeri18ResourceBundles(locale);
|
22
|
+
return children;
|
23
|
+
};
|
24
|
+
|
25
|
+
LocaleBundles.defaultProps = {
|
26
|
+
children: null,
|
27
|
+
locale: {},
|
28
|
+
};
|
29
|
+
|
30
|
+
LocaleBundles.propTypes = {
|
31
|
+
// eslint-disable-next-line
|
32
|
+
children: PropTypes.any,
|
33
|
+
// eslint-disable-next-line
|
34
|
+
locale: PropTypes.object,
|
35
|
+
};
|
36
|
+
|
37
|
+
export default LocaleBundles;
|
@@ -2,8 +2,8 @@
|
|
2
2
|
import React from 'react';
|
3
3
|
import axios from 'axios';
|
4
4
|
import PropTypes from 'prop-types';
|
5
|
-
import FormProviders from 'q3-ui-forms';
|
6
5
|
import AuthProvider from 'q3-ui-permissions';
|
6
|
+
import LocaleBundles from './LocaleBundles';
|
7
7
|
|
8
8
|
const setBaseUrlForRest = (
|
9
9
|
baseURL = process.env.GATSBY_APP_BASE_URL ||
|
@@ -13,15 +13,13 @@ const setBaseUrlForRest = (
|
|
13
13
|
return axios.defaults;
|
14
14
|
};
|
15
15
|
|
16
|
-
const Wrapper = ({ children,
|
16
|
+
const Wrapper = ({ baseURL, children, locale }) => {
|
17
17
|
setBaseUrlForRest(baseURL);
|
18
18
|
|
19
19
|
return (
|
20
|
-
<
|
21
|
-
<
|
22
|
-
|
23
|
-
</FormProviders>
|
24
|
-
</AuthProvider>
|
20
|
+
<LocaleBundles locale={locale}>
|
21
|
+
<AuthProvider>{children}</AuthProvider>
|
22
|
+
</LocaleBundles>
|
25
23
|
);
|
26
24
|
};
|
27
25
|
|
@@ -32,6 +30,9 @@ Wrapper.defaultProps = {
|
|
32
30
|
Wrapper.propTypes = {
|
33
31
|
baseURL: PropTypes.string,
|
34
32
|
children: PropTypes.node.isRequired,
|
33
|
+
|
34
|
+
// eslint-disable-next-line
|
35
|
+
locale: PropTypes.object.isRequired,
|
35
36
|
};
|
36
37
|
|
37
38
|
export default Wrapper;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
Object.defineProperty(exports, "wrapRootElement", {
|
7
|
-
enumerable: true,
|
8
|
-
get: function () {
|
9
|
-
return _gatsbySsr.wrapRootElement;
|
10
|
-
}
|
11
|
-
});
|
12
|
-
|
13
|
-
var _gatsbySsr = require("./gatsby-ssr");
|
@@ -1,72 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.wrapRootElement = void 0;
|
7
|
-
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
9
|
-
|
10
|
-
var _q3Ui = _interopRequireDefault(require("q3-ui"));
|
11
|
-
|
12
|
-
var _q3UiLocale = require("q3-ui-locale");
|
13
|
-
|
14
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
15
|
-
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
|
-
|
18
|
-
/* eslint-disable import/prefer-default-export, import/no-extraneous-dependencies, react/prop-types, react/jsx-filename-extension */
|
19
|
-
const registeri18ResourceBundles = contentData => {
|
20
|
-
if (!contentData || !('en' in contentData)) return;
|
21
|
-
Object.entries(contentData).forEach(([key, bundle]) => {
|
22
|
-
Object.entries(bundle).forEach(([namespace, data]) => {
|
23
|
-
_q3UiLocale.i18n.addResourceBundle(key, namespace, data, true, true);
|
24
|
-
});
|
25
|
-
});
|
26
|
-
};
|
27
|
-
|
28
|
-
const LocaleBundles = ({
|
29
|
-
children,
|
30
|
-
locale
|
31
|
-
}) => {
|
32
|
-
registeri18ResourceBundles(locale);
|
33
|
-
return children;
|
34
|
-
};
|
35
|
-
|
36
|
-
LocaleBundles.defaultProps = {
|
37
|
-
children: null,
|
38
|
-
locale: {}
|
39
|
-
};
|
40
|
-
LocaleBundles.propTypes = {
|
41
|
-
// eslint-disable-next-line
|
42
|
-
children: _propTypes.default.any,
|
43
|
-
// eslint-disable-next-line
|
44
|
-
locale: _propTypes.default.object
|
45
|
-
};
|
46
|
-
|
47
|
-
const Wrapper = ({
|
48
|
-
children,
|
49
|
-
locale,
|
50
|
-
...providerProps
|
51
|
-
}) => /*#__PURE__*/_react.default.createElement(_q3Ui.default, providerProps, /*#__PURE__*/_react.default.createElement(LocaleBundles, {
|
52
|
-
locale: locale
|
53
|
-
}, children));
|
54
|
-
|
55
|
-
Wrapper.propTypes = {
|
56
|
-
children: _propTypes.default.node.isRequired,
|
57
|
-
// eslint-disable-next-line
|
58
|
-
locale: _propTypes.default.object.isRequired,
|
59
|
-
// eslint-disable-next-line
|
60
|
-
theme: _propTypes.default.object.isRequired
|
61
|
-
};
|
62
|
-
|
63
|
-
const wrapRootElement = ({
|
64
|
-
element
|
65
|
-
}, {
|
66
|
-
locale,
|
67
|
-
...providerProps
|
68
|
-
}) => /*#__PURE__*/_react.default.createElement(_q3Ui.default, providerProps, /*#__PURE__*/_react.default.createElement(LocaleBundles, {
|
69
|
-
locale: locale
|
70
|
-
}, element));
|
71
|
-
|
72
|
-
exports.wrapRootElement = wrapRootElement;
|
@@ -1 +0,0 @@
|
|
1
|
-
export { wrapRootElement } from './gatsby-ssr';
|
@@ -1,67 +0,0 @@
|
|
1
|
-
/* eslint-disable import/prefer-default-export, import/no-extraneous-dependencies, react/prop-types, react/jsx-filename-extension */
|
2
|
-
import React from 'react';
|
3
|
-
import Provider from 'q3-ui';
|
4
|
-
import { i18n } from 'q3-ui-locale';
|
5
|
-
import PropTypes from 'prop-types';
|
6
|
-
|
7
|
-
const registeri18ResourceBundles = (contentData) => {
|
8
|
-
if (!contentData || !('en' in contentData)) return;
|
9
|
-
|
10
|
-
Object.entries(contentData).forEach(([key, bundle]) => {
|
11
|
-
Object.entries(bundle).forEach(([namespace, data]) => {
|
12
|
-
i18n.addResourceBundle(
|
13
|
-
key,
|
14
|
-
namespace,
|
15
|
-
data,
|
16
|
-
true,
|
17
|
-
true,
|
18
|
-
);
|
19
|
-
});
|
20
|
-
});
|
21
|
-
};
|
22
|
-
|
23
|
-
const LocaleBundles = ({ children, locale }) => {
|
24
|
-
registeri18ResourceBundles(locale);
|
25
|
-
return children;
|
26
|
-
};
|
27
|
-
|
28
|
-
LocaleBundles.defaultProps = {
|
29
|
-
children: null,
|
30
|
-
locale: {},
|
31
|
-
};
|
32
|
-
|
33
|
-
LocaleBundles.propTypes = {
|
34
|
-
// eslint-disable-next-line
|
35
|
-
children: PropTypes.any,
|
36
|
-
// eslint-disable-next-line
|
37
|
-
locale: PropTypes.object,
|
38
|
-
};
|
39
|
-
|
40
|
-
const Wrapper = ({
|
41
|
-
children,
|
42
|
-
locale,
|
43
|
-
...providerProps
|
44
|
-
}) => (
|
45
|
-
<Provider {...providerProps}>
|
46
|
-
<LocaleBundles locale={locale}>
|
47
|
-
{children}
|
48
|
-
</LocaleBundles>
|
49
|
-
</Provider>
|
50
|
-
);
|
51
|
-
|
52
|
-
Wrapper.propTypes = {
|
53
|
-
children: PropTypes.node.isRequired,
|
54
|
-
// eslint-disable-next-line
|
55
|
-
locale: PropTypes.object.isRequired,
|
56
|
-
// eslint-disable-next-line
|
57
|
-
theme: PropTypes.object.isRequired,
|
58
|
-
};
|
59
|
-
|
60
|
-
export const wrapRootElement = (
|
61
|
-
{ element },
|
62
|
-
{ locale, ...providerProps },
|
63
|
-
) => (
|
64
|
-
<Provider {...providerProps}>
|
65
|
-
<LocaleBundles locale={locale}>{element}</LocaleBundles>
|
66
|
-
</Provider>
|
67
|
-
);
|
@@ -1 +0,0 @@
|
|
1
|
-
// noop
|