@digigov/nextjs 0.6.3 → 0.6.4-alpha
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/.eslintrc.js +3 -0
- package/.prettierrc.js +3 -0
- package/.rush/temp/package-deps_build.json +21 -0
- package/.rush/temp/shrinkwrap-deps.json +334 -0
- package/CHANGELOG.json +935 -0
- package/{App.js → dist/App.js} +12 -0
- package/dist/CHANGELOG.md +255 -0
- package/{Document.js → dist/Document.js} +5 -47
- package/{Image.js → dist/Image.js} +0 -0
- package/{LICENSE → dist/LICENSE} +0 -0
- package/{Link.js → dist/Link.js} +0 -0
- package/dist/README.md +52 -0
- package/{es → dist/es}/App.js +12 -0
- package/{es → dist/es}/Document.js +5 -45
- package/{es → dist/es}/Image.js +0 -0
- package/{es → dist/es}/Link.js +0 -0
- package/{es → dist/es}/hooks.js +0 -0
- package/{es → dist/es}/i18n.js +0 -0
- package/{es → dist/es}/index.js +0 -0
- package/{esm → dist/esm}/App.js +12 -0
- package/{esm → dist/esm}/Document.js +5 -45
- package/{esm → dist/esm}/Image.js +0 -0
- package/{esm → dist/esm}/Link.js +0 -0
- package/{esm → dist/esm}/hooks.js +0 -0
- package/{esm → dist/esm}/i18n.js +0 -0
- package/{esm → dist/esm}/index.js +1 -1
- package/{hooks.js → dist/hooks.js} +0 -0
- package/{i18n.js → dist/i18n.js} +0 -0
- package/{index.js → dist/index.js} +0 -0
- package/{libs → dist/libs}/nextjs/src/App.d.ts +0 -0
- package/{libs → dist/libs}/nextjs/src/Document.d.ts +0 -0
- package/{libs → dist/libs}/nextjs/src/Image.d.ts +0 -0
- package/{libs → dist/libs}/nextjs/src/Link.d.ts +0 -0
- package/{libs → dist/libs}/nextjs/src/hooks.d.ts +0 -0
- package/{libs → dist/libs}/nextjs/src/i18n.d.ts +0 -0
- package/{libs → dist/libs}/nextjs/src/index.d.ts +0 -0
- package/{libs → dist/libs}/ui/src/app/App.d.ts +0 -0
- package/{libs → dist/libs}/ui/src/app/i18n.d.ts +0 -0
- package/{libs → dist/libs}/ui/src/core/Link/index.d.ts +0 -0
- package/{libs → dist/libs}/ui/src/locales/el.d.ts +0 -0
- package/{libs-ui → dist/libs-ui}/react-core/src/Base/index.d.ts +0 -0
- package/{libs-ui → dist/libs-ui}/react-core/src/Link/index.d.ts +0 -0
- package/dist/package.json +26 -0
- package/nextjs.build.log +17 -0
- package/package.json +38 -25
- package/src/App.tsx +61 -0
- package/src/Document.tsx +73 -0
- package/src/Image.tsx +10 -0
- package/src/Link.tsx +33 -0
- package/src/hooks.ts +6 -0
- package/src/i18n.tsx +18 -0
- package/src/index.ts +0 -0
- package/tsconfig.json +14 -0
package/{App.js → dist/App.js}
RENAMED
|
@@ -75,6 +75,18 @@ var DigiGOVNextApp = /*#__PURE__*/function (_App) {
|
|
|
75
75
|
if (jssStyles && jssStyles.parentElement) {
|
|
76
76
|
jssStyles.parentElement.removeChild(jssStyles);
|
|
77
77
|
}
|
|
78
|
+
|
|
79
|
+
this.updateHtmlLang();
|
|
80
|
+
}
|
|
81
|
+
}, {
|
|
82
|
+
key: "componentDidUpdate",
|
|
83
|
+
value: function componentDidUpdate() {
|
|
84
|
+
this.updateHtmlLang();
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
key: "updateHtmlLang",
|
|
88
|
+
value: function updateHtmlLang() {
|
|
89
|
+
document.documentElement.lang = this.props.i18n.language;
|
|
78
90
|
}
|
|
79
91
|
}, {
|
|
80
92
|
key: "render",
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
# Change Log - @digigov/nextjs
|
|
2
|
+
|
|
3
|
+
This log was last generated on Tue, 27 Sep 2022 10:00:49 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.6.3
|
|
6
|
+
Tue, 27 Sep 2022 10:00:49 GMT
|
|
7
|
+
|
|
8
|
+
### Patches
|
|
9
|
+
|
|
10
|
+
- increase the range of accepted react version specified in peerDependencies
|
|
11
|
+
|
|
12
|
+
## 0.6.2
|
|
13
|
+
Tue, 06 Sep 2022 08:27:15 GMT
|
|
14
|
+
|
|
15
|
+
### Patches
|
|
16
|
+
|
|
17
|
+
- remove theme material-ui from App.tsx
|
|
18
|
+
|
|
19
|
+
## 0.6.1
|
|
20
|
+
Wed, 31 Aug 2022 16:10:12 GMT
|
|
21
|
+
|
|
22
|
+
_Version update only_
|
|
23
|
+
|
|
24
|
+
## 0.6.0
|
|
25
|
+
Tue, 16 Aug 2022 14:59:01 GMT
|
|
26
|
+
|
|
27
|
+
### Minor changes
|
|
28
|
+
|
|
29
|
+
- add new Image wrapper with built-in basePath support
|
|
30
|
+
|
|
31
|
+
## 0.5.4
|
|
32
|
+
Wed, 08 Jun 2022 13:32:34 GMT
|
|
33
|
+
|
|
34
|
+
### Patches
|
|
35
|
+
|
|
36
|
+
- Fix i18NProvider string interpolation support
|
|
37
|
+
|
|
38
|
+
## 0.5.3
|
|
39
|
+
Tue, 17 May 2022 11:04:22 GMT
|
|
40
|
+
|
|
41
|
+
_Version update only_
|
|
42
|
+
|
|
43
|
+
## 0.5.2
|
|
44
|
+
Mon, 16 May 2022 14:42:45 GMT
|
|
45
|
+
|
|
46
|
+
### Patches
|
|
47
|
+
|
|
48
|
+
- Change MIT License to BSD-2-Clause
|
|
49
|
+
|
|
50
|
+
## 0.5.1
|
|
51
|
+
Tue, 19 Apr 2022 12:17:34 GMT
|
|
52
|
+
|
|
53
|
+
### Patches
|
|
54
|
+
|
|
55
|
+
- Fix a bug where using target=_blank would not open the link at all. Now it opens in a new window using our CoreLink.
|
|
56
|
+
|
|
57
|
+
## 0.5.0
|
|
58
|
+
Mon, 18 Apr 2022 13:00:33 GMT
|
|
59
|
+
|
|
60
|
+
### Minor changes
|
|
61
|
+
|
|
62
|
+
- Upgrade @types/node version
|
|
63
|
+
|
|
64
|
+
## 0.4.6
|
|
65
|
+
Thu, 14 Apr 2022 12:32:51 GMT
|
|
66
|
+
|
|
67
|
+
_Version update only_
|
|
68
|
+
|
|
69
|
+
## 0.4.5
|
|
70
|
+
Wed, 30 Mar 2022 13:17:56 GMT
|
|
71
|
+
|
|
72
|
+
### Patches
|
|
73
|
+
|
|
74
|
+
- incorrect regex pattern was causing build failure
|
|
75
|
+
|
|
76
|
+
## 0.4.4
|
|
77
|
+
Wed, 30 Mar 2022 12:28:30 GMT
|
|
78
|
+
|
|
79
|
+
### Patches
|
|
80
|
+
|
|
81
|
+
- allow file links to be used with internal Nextjs router
|
|
82
|
+
|
|
83
|
+
## 0.4.2
|
|
84
|
+
Thu, 24 Feb 2022 14:51:06 GMT
|
|
85
|
+
|
|
86
|
+
_Version update only_
|
|
87
|
+
|
|
88
|
+
## 0.4.1
|
|
89
|
+
Wed, 16 Feb 2022 12:49:28 GMT
|
|
90
|
+
|
|
91
|
+
_Version update only_
|
|
92
|
+
|
|
93
|
+
## 0.4.0
|
|
94
|
+
Mon, 14 Feb 2022 09:56:29 GMT
|
|
95
|
+
|
|
96
|
+
### Minor changes
|
|
97
|
+
|
|
98
|
+
- Replace <a> with Link from @digigov/react-core
|
|
99
|
+
|
|
100
|
+
## 0.3.6
|
|
101
|
+
Thu, 10 Feb 2022 13:45:56 GMT
|
|
102
|
+
|
|
103
|
+
_Version update only_
|
|
104
|
+
|
|
105
|
+
## 0.3.5
|
|
106
|
+
Tue, 08 Feb 2022 15:21:11 GMT
|
|
107
|
+
|
|
108
|
+
_Version update only_
|
|
109
|
+
|
|
110
|
+
## 0.3.4
|
|
111
|
+
Thu, 03 Feb 2022 15:47:05 GMT
|
|
112
|
+
|
|
113
|
+
_Version update only_
|
|
114
|
+
|
|
115
|
+
## 0.3.3
|
|
116
|
+
Wed, 02 Feb 2022 15:44:29 GMT
|
|
117
|
+
|
|
118
|
+
### Patches
|
|
119
|
+
|
|
120
|
+
- fix package.json inconsistencies by running cli-lab verify-and-update-local-package-versions
|
|
121
|
+
|
|
122
|
+
## 0.3.2
|
|
123
|
+
Thu, 30 Dec 2021 12:54:03 GMT
|
|
124
|
+
|
|
125
|
+
_Version update only_
|
|
126
|
+
|
|
127
|
+
## 0.3.1
|
|
128
|
+
Tue, 02 Nov 2021 13:03:39 GMT
|
|
129
|
+
|
|
130
|
+
_Version update only_
|
|
131
|
+
|
|
132
|
+
## 0.3.0
|
|
133
|
+
Tue, 12 Oct 2021 09:13:08 GMT
|
|
134
|
+
|
|
135
|
+
### Minor changes
|
|
136
|
+
|
|
137
|
+
- Warn if browser is IE
|
|
138
|
+
|
|
139
|
+
## 0.2.27
|
|
140
|
+
Wed, 22 Sep 2021 10:15:42 GMT
|
|
141
|
+
|
|
142
|
+
### Patches
|
|
143
|
+
|
|
144
|
+
- Add missing props to the Link component
|
|
145
|
+
|
|
146
|
+
## 0.2.26
|
|
147
|
+
Thu, 12 Aug 2021 08:56:35 GMT
|
|
148
|
+
|
|
149
|
+
_Version update only_
|
|
150
|
+
|
|
151
|
+
## 0.2.25
|
|
152
|
+
Thu, 12 Aug 2021 06:18:14 GMT
|
|
153
|
+
|
|
154
|
+
_Version update only_
|
|
155
|
+
|
|
156
|
+
## 0.2.24
|
|
157
|
+
Tue, 03 Aug 2021 12:09:02 GMT
|
|
158
|
+
|
|
159
|
+
_Version update only_
|
|
160
|
+
|
|
161
|
+
## 0.2.23
|
|
162
|
+
Tue, 03 Aug 2021 10:22:51 GMT
|
|
163
|
+
|
|
164
|
+
_Version update only_
|
|
165
|
+
|
|
166
|
+
## 0.2.22
|
|
167
|
+
Fri, 30 Jul 2021 13:01:30 GMT
|
|
168
|
+
|
|
169
|
+
_Version update only_
|
|
170
|
+
|
|
171
|
+
## 0.2.21
|
|
172
|
+
Fri, 30 Jul 2021 11:35:29 GMT
|
|
173
|
+
|
|
174
|
+
_Version update only_
|
|
175
|
+
|
|
176
|
+
## 0.2.20
|
|
177
|
+
Fri, 30 Jul 2021 10:46:37 GMT
|
|
178
|
+
|
|
179
|
+
_Version update only_
|
|
180
|
+
|
|
181
|
+
## 0.2.19
|
|
182
|
+
Fri, 30 Jul 2021 08:49:46 GMT
|
|
183
|
+
|
|
184
|
+
_Version update only_
|
|
185
|
+
|
|
186
|
+
## 0.2.18
|
|
187
|
+
Fri, 30 Jul 2021 07:46:24 GMT
|
|
188
|
+
|
|
189
|
+
_Version update only_
|
|
190
|
+
|
|
191
|
+
## 0.2.17
|
|
192
|
+
Tue, 27 Jul 2021 10:14:43 GMT
|
|
193
|
+
|
|
194
|
+
_Version update only_
|
|
195
|
+
|
|
196
|
+
## 0.2.16
|
|
197
|
+
Thu, 15 Jul 2021 11:16:22 GMT
|
|
198
|
+
|
|
199
|
+
_Version update only_
|
|
200
|
+
|
|
201
|
+
## 0.2.15
|
|
202
|
+
Fri, 09 Jul 2021 08:59:32 GMT
|
|
203
|
+
|
|
204
|
+
_Version update only_
|
|
205
|
+
|
|
206
|
+
## 0.2.14
|
|
207
|
+
Thu, 08 Jul 2021 15:08:50 GMT
|
|
208
|
+
|
|
209
|
+
_Version update only_
|
|
210
|
+
|
|
211
|
+
## 0.2.13
|
|
212
|
+
Wed, 30 Jun 2021 12:09:21 GMT
|
|
213
|
+
|
|
214
|
+
_Version update only_
|
|
215
|
+
|
|
216
|
+
## 0.2.12
|
|
217
|
+
Wed, 23 Jun 2021 13:04:19 GMT
|
|
218
|
+
|
|
219
|
+
_Version update only_
|
|
220
|
+
|
|
221
|
+
## 0.2.11
|
|
222
|
+
Wed, 02 Jun 2021 12:04:27 GMT
|
|
223
|
+
|
|
224
|
+
_Version update only_
|
|
225
|
+
|
|
226
|
+
## 0.2.10
|
|
227
|
+
Wed, 02 Jun 2021 08:33:44 GMT
|
|
228
|
+
|
|
229
|
+
_Version update only_
|
|
230
|
+
|
|
231
|
+
## 0.2.9
|
|
232
|
+
Wed, 05 May 2021 14:11:41 GMT
|
|
233
|
+
|
|
234
|
+
_Version update only_
|
|
235
|
+
|
|
236
|
+
## 0.2.8
|
|
237
|
+
Thu, 22 Apr 2021 15:04:42 GMT
|
|
238
|
+
|
|
239
|
+
_Version update only_
|
|
240
|
+
|
|
241
|
+
## 0.2.7
|
|
242
|
+
Thu, 22 Apr 2021 14:39:18 GMT
|
|
243
|
+
|
|
244
|
+
_Version update only_
|
|
245
|
+
|
|
246
|
+
## 0.2.6
|
|
247
|
+
Thu, 22 Apr 2021 14:06:40 GMT
|
|
248
|
+
|
|
249
|
+
_Version update only_
|
|
250
|
+
|
|
251
|
+
## 0.2.5
|
|
252
|
+
Thu, 22 Apr 2021 12:56:25 GMT
|
|
253
|
+
|
|
254
|
+
_Initial release_
|
|
255
|
+
|
|
@@ -10,8 +10,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
10
10
|
exports.Fonts = Fonts;
|
|
11
11
|
exports["default"] = void 0;
|
|
12
12
|
|
|
13
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
14
|
-
|
|
15
13
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
16
14
|
|
|
17
15
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
@@ -30,8 +28,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
30
28
|
|
|
31
29
|
var _document = _interopRequireWildcard(require("next/document"));
|
|
32
30
|
|
|
33
|
-
var _styles = require("@material-ui/core/styles");
|
|
34
|
-
|
|
35
31
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
36
32
|
|
|
37
33
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -88,57 +84,19 @@ exports["default"] = DigiGOVDocument;
|
|
|
88
84
|
|
|
89
85
|
DigiGOVDocument.getInitialProps = /*#__PURE__*/function () {
|
|
90
86
|
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(ctx) {
|
|
91
|
-
var
|
|
87
|
+
var initialProps;
|
|
92
88
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
93
89
|
while (1) {
|
|
94
90
|
switch (_context.prev = _context.next) {
|
|
95
91
|
case 0:
|
|
96
|
-
|
|
97
|
-
//
|
|
98
|
-
// On the server:
|
|
99
|
-
// 1. app.getInitialProps
|
|
100
|
-
// 2. page.getInitialProps
|
|
101
|
-
// 3. document.getInitialProps
|
|
102
|
-
// 4. app.render
|
|
103
|
-
// 5. page.render
|
|
104
|
-
// 6. document.render
|
|
105
|
-
//
|
|
106
|
-
// On the server with error:
|
|
107
|
-
// 1. document.getInitialProps
|
|
108
|
-
// 2. app.render
|
|
109
|
-
// 3. page.render
|
|
110
|
-
// 4. document.render
|
|
111
|
-
//
|
|
112
|
-
// On the client
|
|
113
|
-
// 1. app.getInitialProps
|
|
114
|
-
// 2. page.getInitialProps
|
|
115
|
-
// 3. app.render
|
|
116
|
-
// 4. page.render
|
|
117
|
-
// Render app and page and get the context of the page with collected side effects.
|
|
118
|
-
sheets = new _styles.ServerStyleSheets();
|
|
119
|
-
originalRenderPage = ctx.renderPage;
|
|
120
|
-
|
|
121
|
-
ctx.renderPage = function () {
|
|
122
|
-
return originalRenderPage({
|
|
123
|
-
enhanceApp: function enhanceApp(App) {
|
|
124
|
-
return function (props) {
|
|
125
|
-
return sheets.collect( /*#__PURE__*/_react["default"].createElement(App, props));
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
_context.next = 5;
|
|
92
|
+
_context.next = 2;
|
|
132
93
|
return _document["default"].getInitialProps(ctx);
|
|
133
94
|
|
|
134
|
-
case
|
|
95
|
+
case 2:
|
|
135
96
|
initialProps = _context.sent;
|
|
136
|
-
return _context.abrupt("return", (0, _extends2["default"])({}, initialProps
|
|
137
|
-
// Styles fragment is rendered after the app and page rendering finish.
|
|
138
|
-
styles: [].concat((0, _toConsumableArray2["default"])(_react["default"].Children.toArray(initialProps.styles)), [sheets.getStyleElement()])
|
|
139
|
-
}));
|
|
97
|
+
return _context.abrupt("return", (0, _extends2["default"])({}, initialProps));
|
|
140
98
|
|
|
141
|
-
case
|
|
99
|
+
case 4:
|
|
142
100
|
case "end":
|
|
143
101
|
return _context.stop();
|
|
144
102
|
}
|
|
File without changes
|
package/{LICENSE → dist/LICENSE}
RENAMED
|
File without changes
|
package/{Link.js → dist/Link.js}
RENAMED
|
File without changes
|
package/dist/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# @digigov/nextjs
|
|
2
|
+
|
|
3
|
+
Next.js utilities for @digigov projects.
|
|
4
|
+
|
|
5
|
+
Included,
|
|
6
|
+
|
|
7
|
+
* common `_app` and `_document` components with support for,
|
|
8
|
+
- SSR style handling.
|
|
9
|
+
- `@digigov/ui/app/App` component.
|
|
10
|
+
- use `@digigov/ui/core/Link/LinkProvider` to set `next/Link` as the default
|
|
11
|
+
Link component across app.
|
|
12
|
+
|
|
13
|
+
* react-i18next initializer
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```shell
|
|
19
|
+
$ yarn add @digigov/nextjs
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Create `_app` and `_document` components,
|
|
23
|
+
|
|
24
|
+
**pages/_app.js**
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import initI18n from '@digigov/nextjs/i18n';
|
|
28
|
+
import el from '../locales/el';
|
|
29
|
+
initI18n({
|
|
30
|
+
el: {
|
|
31
|
+
translation: el
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
import App from '@digigov/nextjs/App';
|
|
36
|
+
export default App;
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**pages/_document.js**
|
|
40
|
+
```js
|
|
41
|
+
import Document from '@digigov/nextjs/Document';
|
|
42
|
+
export default Document;
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## Drawbacks
|
|
47
|
+
|
|
48
|
+
`next.js` spawns two transpilation processes for SSR and client code using
|
|
49
|
+
different configuration options. `_app`, `_doc` are provided as raw `.tsx`
|
|
50
|
+
modules to prevent transpilation conflicts. You need to modify `next.js`
|
|
51
|
+
webpack configuration to include `@digigov/nextjs` components as though they
|
|
52
|
+
where located in locally in your project.
|
package/{es → dist/es}/App.js
RENAMED
|
@@ -47,6 +47,18 @@ var DigiGOVNextApp = /*#__PURE__*/function (_App) {
|
|
|
47
47
|
if (jssStyles && jssStyles.parentElement) {
|
|
48
48
|
jssStyles.parentElement.removeChild(jssStyles);
|
|
49
49
|
}
|
|
50
|
+
|
|
51
|
+
this.updateHtmlLang();
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
key: "componentDidUpdate",
|
|
55
|
+
value: function componentDidUpdate() {
|
|
56
|
+
this.updateHtmlLang();
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
key: "updateHtmlLang",
|
|
60
|
+
value: function updateHtmlLang() {
|
|
61
|
+
document.documentElement.lang = this.props.i18n.language;
|
|
50
62
|
}
|
|
51
63
|
}, {
|
|
52
64
|
key: "render",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
5
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
@@ -17,7 +16,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
17
16
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
18
17
|
import React from 'react';
|
|
19
18
|
import Document, { Html, Head, Main, NextScript } from 'next/document';
|
|
20
|
-
import { ServerStyleSheets } from '@material-ui/core/styles';
|
|
21
19
|
|
|
22
20
|
var _ref = /*#__PURE__*/React.createElement("link", {
|
|
23
21
|
rel: "stylesheet",
|
|
@@ -67,57 +65,19 @@ export { DigiGOVDocument as default };
|
|
|
67
65
|
|
|
68
66
|
DigiGOVDocument.getInitialProps = /*#__PURE__*/function () {
|
|
69
67
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(ctx) {
|
|
70
|
-
var
|
|
68
|
+
var initialProps;
|
|
71
69
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
72
70
|
while (1) {
|
|
73
71
|
switch (_context.prev = _context.next) {
|
|
74
72
|
case 0:
|
|
75
|
-
|
|
76
|
-
//
|
|
77
|
-
// On the server:
|
|
78
|
-
// 1. app.getInitialProps
|
|
79
|
-
// 2. page.getInitialProps
|
|
80
|
-
// 3. document.getInitialProps
|
|
81
|
-
// 4. app.render
|
|
82
|
-
// 5. page.render
|
|
83
|
-
// 6. document.render
|
|
84
|
-
//
|
|
85
|
-
// On the server with error:
|
|
86
|
-
// 1. document.getInitialProps
|
|
87
|
-
// 2. app.render
|
|
88
|
-
// 3. page.render
|
|
89
|
-
// 4. document.render
|
|
90
|
-
//
|
|
91
|
-
// On the client
|
|
92
|
-
// 1. app.getInitialProps
|
|
93
|
-
// 2. page.getInitialProps
|
|
94
|
-
// 3. app.render
|
|
95
|
-
// 4. page.render
|
|
96
|
-
// Render app and page and get the context of the page with collected side effects.
|
|
97
|
-
sheets = new ServerStyleSheets();
|
|
98
|
-
originalRenderPage = ctx.renderPage;
|
|
99
|
-
|
|
100
|
-
ctx.renderPage = function () {
|
|
101
|
-
return originalRenderPage({
|
|
102
|
-
enhanceApp: function enhanceApp(App) {
|
|
103
|
-
return function (props) {
|
|
104
|
-
return sheets.collect( /*#__PURE__*/React.createElement(App, props));
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
_context.next = 5;
|
|
73
|
+
_context.next = 2;
|
|
111
74
|
return Document.getInitialProps(ctx);
|
|
112
75
|
|
|
113
|
-
case
|
|
76
|
+
case 2:
|
|
114
77
|
initialProps = _context.sent;
|
|
115
|
-
return _context.abrupt("return", _extends({}, initialProps
|
|
116
|
-
// Styles fragment is rendered after the app and page rendering finish.
|
|
117
|
-
styles: [].concat(_toConsumableArray(React.Children.toArray(initialProps.styles)), [sheets.getStyleElement()])
|
|
118
|
-
}));
|
|
78
|
+
return _context.abrupt("return", _extends({}, initialProps));
|
|
119
79
|
|
|
120
|
-
case
|
|
80
|
+
case 4:
|
|
121
81
|
case "end":
|
|
122
82
|
return _context.stop();
|
|
123
83
|
}
|
package/{es → dist/es}/Image.js
RENAMED
|
File without changes
|
package/{es → dist/es}/Link.js
RENAMED
|
File without changes
|
package/{es → dist/es}/hooks.js
RENAMED
|
File without changes
|
package/{es → dist/es}/i18n.js
RENAMED
|
File without changes
|
package/{es → dist/es}/index.js
RENAMED
|
File without changes
|
package/{esm → dist/esm}/App.js
RENAMED
|
@@ -47,6 +47,18 @@ var DigiGOVNextApp = /*#__PURE__*/function (_App) {
|
|
|
47
47
|
if (jssStyles && jssStyles.parentElement) {
|
|
48
48
|
jssStyles.parentElement.removeChild(jssStyles);
|
|
49
49
|
}
|
|
50
|
+
|
|
51
|
+
this.updateHtmlLang();
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
key: "componentDidUpdate",
|
|
55
|
+
value: function componentDidUpdate() {
|
|
56
|
+
this.updateHtmlLang();
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
key: "updateHtmlLang",
|
|
60
|
+
value: function updateHtmlLang() {
|
|
61
|
+
document.documentElement.lang = this.props.i18n.language;
|
|
50
62
|
}
|
|
51
63
|
}, {
|
|
52
64
|
key: "render",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
5
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
@@ -17,7 +16,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
17
16
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
18
17
|
import React from 'react';
|
|
19
18
|
import Document, { Html, Head, Main, NextScript } from 'next/document';
|
|
20
|
-
import { ServerStyleSheets } from '@material-ui/core/styles';
|
|
21
19
|
|
|
22
20
|
var _ref = /*#__PURE__*/React.createElement("link", {
|
|
23
21
|
rel: "stylesheet",
|
|
@@ -67,57 +65,19 @@ export { DigiGOVDocument as default };
|
|
|
67
65
|
|
|
68
66
|
DigiGOVDocument.getInitialProps = /*#__PURE__*/function () {
|
|
69
67
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(ctx) {
|
|
70
|
-
var
|
|
68
|
+
var initialProps;
|
|
71
69
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
72
70
|
while (1) {
|
|
73
71
|
switch (_context.prev = _context.next) {
|
|
74
72
|
case 0:
|
|
75
|
-
|
|
76
|
-
//
|
|
77
|
-
// On the server:
|
|
78
|
-
// 1. app.getInitialProps
|
|
79
|
-
// 2. page.getInitialProps
|
|
80
|
-
// 3. document.getInitialProps
|
|
81
|
-
// 4. app.render
|
|
82
|
-
// 5. page.render
|
|
83
|
-
// 6. document.render
|
|
84
|
-
//
|
|
85
|
-
// On the server with error:
|
|
86
|
-
// 1. document.getInitialProps
|
|
87
|
-
// 2. app.render
|
|
88
|
-
// 3. page.render
|
|
89
|
-
// 4. document.render
|
|
90
|
-
//
|
|
91
|
-
// On the client
|
|
92
|
-
// 1. app.getInitialProps
|
|
93
|
-
// 2. page.getInitialProps
|
|
94
|
-
// 3. app.render
|
|
95
|
-
// 4. page.render
|
|
96
|
-
// Render app and page and get the context of the page with collected side effects.
|
|
97
|
-
sheets = new ServerStyleSheets();
|
|
98
|
-
originalRenderPage = ctx.renderPage;
|
|
99
|
-
|
|
100
|
-
ctx.renderPage = function () {
|
|
101
|
-
return originalRenderPage({
|
|
102
|
-
enhanceApp: function enhanceApp(App) {
|
|
103
|
-
return function (props) {
|
|
104
|
-
return sheets.collect( /*#__PURE__*/React.createElement(App, props));
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
_context.next = 5;
|
|
73
|
+
_context.next = 2;
|
|
111
74
|
return Document.getInitialProps(ctx);
|
|
112
75
|
|
|
113
|
-
case
|
|
76
|
+
case 2:
|
|
114
77
|
initialProps = _context.sent;
|
|
115
|
-
return _context.abrupt("return", _extends({}, initialProps
|
|
116
|
-
// Styles fragment is rendered after the app and page rendering finish.
|
|
117
|
-
styles: [].concat(_toConsumableArray(React.Children.toArray(initialProps.styles)), [sheets.getStyleElement()])
|
|
118
|
-
}));
|
|
78
|
+
return _context.abrupt("return", _extends({}, initialProps));
|
|
119
79
|
|
|
120
|
-
case
|
|
80
|
+
case 4:
|
|
121
81
|
case "end":
|
|
122
82
|
return _context.stop();
|
|
123
83
|
}
|
|
File without changes
|
package/{esm → dist/esm}/Link.js
RENAMED
|
File without changes
|
|
File without changes
|
package/{esm → dist/esm}/i18n.js
RENAMED
|
File without changes
|
|
File without changes
|
package/{i18n.js → dist/i18n.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|