@blaze-cms/nextjs-tools 0.146.0-node18-tooltips.37 → 0.146.0-node18-core-styles-tooltips.46

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/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
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
- # [0.146.0-node18-tooltips.37](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.36...v0.146.0-node18-tooltips.37) (2026-01-08)
6
+ # [0.146.0-node18-core-styles-tooltips.46](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.45...v0.146.0-node18-core-styles-tooltips.46) (2026-01-16)
7
7
 
8
8
  **Note:** Version bump only for package @blaze-cms/nextjs-tools
9
9
 
@@ -11,7 +11,32 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- # [0.146.0-node18-tooltips.35](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.34...v0.146.0-node18-tooltips.35) (2025-12-17)
14
+ # [0.146.0-node18-core-styles-tooltips.45](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.44...v0.146.0-node18-core-styles-tooltips.45) (2026-01-15)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * changed plugin logic ([451b8af](https://github.com/thebyte9/blaze/commit/451b8afd47fade28b0143c128cf645fe90557424))
20
+ * snapshots ([2283a3d](https://github.com/thebyte9/blaze/commit/2283a3da71117b93fc3f52d8ddb6373fd10fa2eb))
21
+
22
+
23
+ ### Features
24
+
25
+ * set html lang attribute from default language env var ([17da6a8](https://github.com/thebyte9/blaze/commit/17da6a83e120e04785b04d6d5b8dcba6eff183f2))
26
+
27
+
28
+
29
+
30
+
31
+ # [0.146.0-node18-core-styles-tooltips.44](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.43...v0.146.0-node18-core-styles-tooltips.44) (2026-01-02)
32
+
33
+ **Note:** Version bump only for package @blaze-cms/nextjs-tools
34
+
35
+
36
+
37
+
38
+
39
+ # [0.146.0-node18-core-styles-tooltips.43](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.42...v0.146.0-node18-core-styles-tooltips.43) (2025-12-17)
15
40
 
16
41
  **Note:** Version bump only for package @blaze-cms/nextjs-tools
17
42
 
@@ -19,7 +44,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
19
44
 
20
45
 
21
46
 
22
- # [0.146.0-node18-tooltips.34](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.33...v0.146.0-node18-tooltips.34) (2025-12-17)
47
+ # [0.146.0-node18-core-styles-tooltips.42](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.41...v0.146.0-node18-core-styles-tooltips.42) (2025-12-17)
23
48
 
24
49
  **Note:** Version bump only for package @blaze-cms/nextjs-tools
25
50
 
@@ -27,7 +52,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
27
52
 
28
53
 
29
54
 
30
- # [0.146.0-node18-tooltips.33](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.32...v0.146.0-node18-tooltips.33) (2025-12-15)
55
+ # [0.146.0-node18-core-styles-tooltips.41](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.40...v0.146.0-node18-core-styles-tooltips.41) (2025-12-15)
31
56
 
32
57
 
33
58
  ### Features
@@ -38,7 +63,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
38
63
 
39
64
 
40
65
 
41
- # [0.146.0-node18-tooltips.32](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.31...v0.146.0-node18-tooltips.32) (2025-12-15)
66
+ # [0.146.0-node18-core-styles-tooltips.38](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.37...v0.146.0-node18-core-styles-tooltips.38) (2025-12-04)
42
67
 
43
68
  **Note:** Version bump only for package @blaze-cms/nextjs-tools
44
69
 
@@ -46,7 +71,39 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
46
71
 
47
72
 
48
73
 
49
- # [0.146.0-node18-tooltips.30](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.29...v0.146.0-node18-tooltips.30) (2025-11-17)
74
+ # [0.146.0-node18-core-styles-tooltips.34](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.33...v0.146.0-node18-core-styles-tooltips.34) (2025-11-27)
75
+
76
+ **Note:** Version bump only for package @blaze-cms/nextjs-tools
77
+
78
+
79
+
80
+
81
+
82
+ # [0.146.0-node18-core-styles-tooltips.32](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.31...v0.146.0-node18-core-styles-tooltips.32) (2025-11-26)
83
+
84
+ **Note:** Version bump only for package @blaze-cms/nextjs-tools
85
+
86
+
87
+
88
+
89
+
90
+ # [0.146.0-node18-core-styles-tooltips.31](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.30...v0.146.0-node18-core-styles-tooltips.31) (2025-11-26)
91
+
92
+ **Note:** Version bump only for package @blaze-cms/nextjs-tools
93
+
94
+
95
+
96
+
97
+
98
+ # [0.146.0-node18-core-styles-tooltips.30](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.29...v0.146.0-node18-core-styles-tooltips.30) (2025-11-25)
99
+
100
+ **Note:** Version bump only for package @blaze-cms/nextjs-tools
101
+
102
+
103
+
104
+
105
+
106
+ # [0.146.0-node18-core-styles-tooltips.29](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.28...v0.146.0-node18-core-styles-tooltips.29) (2025-11-17)
50
107
 
51
108
 
52
109
  ### Features
@@ -57,7 +114,15 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
57
114
 
58
115
 
59
116
 
60
- # [0.146.0-node18-tooltips.28](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.27...v0.146.0-node18-tooltips.28) (2025-11-10)
117
+ # [0.146.0-node18-core-styles-tooltips.27](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.26...v0.146.0-node18-core-styles-tooltips.27) (2025-11-13)
118
+
119
+ **Note:** Version bump only for package @blaze-cms/nextjs-tools
120
+
121
+
122
+
123
+
124
+
125
+ # [0.146.0-node18-core-styles-tooltips.26](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.25...v0.146.0-node18-core-styles-tooltips.26) (2025-11-12)
61
126
 
62
127
  **Note:** Version bump only for package @blaze-cms/nextjs-tools
63
128
 
@@ -65,7 +130,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
65
130
 
66
131
 
67
132
 
68
- # [0.146.0-node18-tooltips.27](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.26...v0.146.0-node18-tooltips.27) (2025-11-06)
133
+ # [0.146.0-node18-core-styles-tooltips.25](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.24...v0.146.0-node18-core-styles-tooltips.25) (2025-11-07)
69
134
 
70
135
  **Note:** Version bump only for package @blaze-cms/nextjs-tools
71
136
 
@@ -73,7 +138,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
73
138
 
74
139
 
75
140
 
76
- # [0.146.0-node18-tooltips.26](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.25...v0.146.0-node18-tooltips.26) (2025-10-29)
141
+ # [0.146.0-node18-core-styles-tooltips.24](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.23...v0.146.0-node18-core-styles-tooltips.24) (2025-11-03)
77
142
 
78
143
 
79
144
  ### Bug Fixes
@@ -89,7 +154,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
89
154
 
90
155
 
91
156
 
92
- # [0.146.0-node18-tooltips.25](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.24...v0.146.0-node18-tooltips.25) (2025-10-28)
157
+ # [0.146.0-node18-core-styles-tooltips.23](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.22...v0.146.0-node18-core-styles-tooltips.23) (2025-10-27)
93
158
 
94
159
  **Note:** Version bump only for package @blaze-cms/nextjs-tools
95
160
 
@@ -97,7 +162,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
97
162
 
98
163
 
99
164
 
100
- # [0.146.0-node18-tooltips.24](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.23...v0.146.0-node18-tooltips.24) (2025-10-27)
165
+ # [0.146.0-node18-core-styles-tooltips.22](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.21...v0.146.0-node18-core-styles-tooltips.22) (2025-10-20)
101
166
 
102
167
  **Note:** Version bump only for package @blaze-cms/nextjs-tools
103
168
 
@@ -105,7 +170,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
105
170
 
106
171
 
107
172
 
108
- # [0.146.0-node18-tooltips.23](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.22...v0.146.0-node18-tooltips.23) (2025-10-20)
173
+ # [0.146.0-node18-core-styles-tooltips.21](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.20...v0.146.0-node18-core-styles-tooltips.21) (2025-10-07)
109
174
 
110
175
  **Note:** Version bump only for package @blaze-cms/nextjs-tools
111
176
 
@@ -113,7 +178,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
113
178
 
114
179
 
115
180
 
116
- # [0.146.0-node18-tooltips.22](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.21...v0.146.0-node18-tooltips.22) (2025-10-17)
181
+ # [0.146.0-node18-core-styles-tooltips.20](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.19...v0.146.0-node18-core-styles-tooltips.20) (2025-10-03)
117
182
 
118
183
  **Note:** Version bump only for package @blaze-cms/nextjs-tools
119
184
 
@@ -121,7 +186,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
121
186
 
122
187
 
123
188
 
124
- # [0.146.0-node18-tooltips.21](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.20...v0.146.0-node18-tooltips.21) (2025-10-14)
189
+ # [0.146.0-node18-core-styles-tooltips.19](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.18...v0.146.0-node18-core-styles-tooltips.19) (2025-10-01)
125
190
 
126
191
  **Note:** Version bump only for package @blaze-cms/nextjs-tools
127
192
 
@@ -129,7 +194,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
129
194
 
130
195
 
131
196
 
132
- # [0.146.0-node18-tooltips.19](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.18...v0.146.0-node18-tooltips.19) (2025-10-10)
197
+ # [0.146.0-node18-core-styles-tooltips.18](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.17...v0.146.0-node18-core-styles-tooltips.18) (2025-09-29)
133
198
 
134
199
  **Note:** Version bump only for package @blaze-cms/nextjs-tools
135
200
 
@@ -137,7 +202,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
137
202
 
138
203
 
139
204
 
140
- # [0.146.0-node18-tooltips.18](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.17...v0.146.0-node18-tooltips.18) (2025-10-07)
205
+ # [0.146.0-node18-core-styles-tooltips.15](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.14...v0.146.0-node18-core-styles-tooltips.15) (2025-09-23)
141
206
 
142
207
  **Note:** Version bump only for package @blaze-cms/nextjs-tools
143
208
 
@@ -145,15 +210,18 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
145
210
 
146
211
 
147
212
 
148
- # [0.146.0-node18-tooltips.13](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.12...v0.146.0-node18-tooltips.13) (2025-10-02)
213
+ # [0.146.0-node18-core-styles-tooltips.14](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.13...v0.146.0-node18-core-styles-tooltips.14) (2025-09-18)
149
214
 
150
- **Note:** Version bump only for package @blaze-cms/nextjs-tools
151
215
 
216
+ ### Bug Fixes
217
+
218
+ * force debug link to open in new tab ([#4907](https://github.com/thebyte9/blaze/issues/4907)) ([59abc33](https://github.com/thebyte9/blaze/commit/59abc3356636f5f8eb6ff911101947c878dbd213))
152
219
 
153
220
 
154
221
 
155
222
 
156
- # [0.146.0-node18-tooltips.11](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.10...v0.146.0-node18-tooltips.11) (2025-10-01)
223
+
224
+ # [0.146.0-node18-core-styles-tooltips.13](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.12...v0.146.0-node18-core-styles-tooltips.13) (2025-09-15)
157
225
 
158
226
  **Note:** Version bump only for package @blaze-cms/nextjs-tools
159
227
 
@@ -161,7 +229,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
161
229
 
162
230
 
163
231
 
164
- # [0.146.0-node18-tooltips.8](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.7...v0.146.0-node18-tooltips.8) (2025-09-24)
232
+ # [0.146.0-node18-core-styles-tooltips.12](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.11...v0.146.0-node18-core-styles-tooltips.12) (2025-08-27)
165
233
 
166
234
  **Note:** Version bump only for package @blaze-cms/nextjs-tools
167
235
 
@@ -169,26 +237,30 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
169
237
 
170
238
 
171
239
 
172
- # [0.146.0-node18-tooltips.4](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.3...v0.146.0-node18-tooltips.4) (2025-09-22)
240
+ # [0.146.0-node18-core-styles-tooltips.11](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.10...v0.146.0-node18-core-styles-tooltips.11) (2025-08-27)
173
241
 
174
- **Note:** Version bump only for package @blaze-cms/nextjs-tools
175
242
 
243
+ ### Features
244
+
245
+ * add support for custom 404 page using custom error 404 slug and fallback rendering ([#4839](https://github.com/thebyte9/blaze/issues/4839)) ([67554a3](https://github.com/thebyte9/blaze/commit/67554a3febc2871d73bd127753edf3b918a1a0b7))
246
+ * chart component ([#4846](https://github.com/thebyte9/blaze/issues/4846)) ([f74bd5a](https://github.com/thebyte9/blaze/commit/f74bd5aecc6078e725f92c523d8da0916a612d88))
176
247
 
177
248
 
178
249
 
179
250
 
180
- # [0.146.0-node18-tooltips.3](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.2...v0.146.0-node18-tooltips.3) (2025-09-18)
251
+
252
+ # [0.146.0-node18-core-styles-tooltips.8](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.7...v0.146.0-node18-core-styles-tooltips.8) (2025-07-25)
181
253
 
182
254
 
183
255
  ### Bug Fixes
184
256
 
185
- * force debug link to open in new tab ([#4907](https://github.com/thebyte9/blaze/issues/4907)) ([59abc33](https://github.com/thebyte9/blaze/commit/59abc3356636f5f8eb6ff911101947c878dbd213))
257
+ * restore favion loading in the frontend ([#4851](https://github.com/thebyte9/blaze/issues/4851)) ([f1c31bb](https://github.com/thebyte9/blaze/commit/f1c31bb2213f79b1d4b6b1ae6e5d5bd2b150fdf8))
186
258
 
187
259
 
188
260
 
189
261
 
190
262
 
191
- # [0.146.0-node18-tooltips.2](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.1...v0.146.0-node18-tooltips.2) (2025-09-17)
263
+ # [0.146.0-node18-core-styles-tooltips.5](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.4...v0.146.0-node18-core-styles-tooltips.5) (2025-07-18)
192
264
 
193
265
  **Note:** Version bump only for package @blaze-cms/nextjs-tools
194
266
 
@@ -196,7 +268,18 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
196
268
 
197
269
 
198
270
 
199
- # [0.146.0-node18-tooltips.1](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.0...v0.146.0-node18-tooltips.1) (2025-09-10)
271
+ # [0.146.0-node18-core-styles-tooltips.4](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.3...v0.146.0-node18-core-styles-tooltips.4) (2025-07-10)
272
+
273
+
274
+ ### Bug Fixes
275
+
276
+ * respond to live blog item size changes for laze loaded image, live blog title and global light box fix ([#4730](https://github.com/thebyte9/blaze/issues/4730)) ([5dd38d8](https://github.com/thebyte9/blaze/commit/5dd38d8d9e5983c55d3053d440eb7ab618688920))
277
+
278
+
279
+
280
+
281
+
282
+ # [0.146.0-node18-core-styles-tooltips.2](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.1...v0.146.0-node18-core-styles-tooltips.2) (2025-06-20)
200
283
 
201
284
  **Note:** Version bump only for package @blaze-cms/nextjs-tools
202
285
 
@@ -204,24 +287,34 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
204
287
 
205
288
 
206
289
 
207
- # [0.146.0-node18-tooltips.0](https://github.com/thebyte9/blaze/compare/v0.145.0...v0.146.0-node18-tooltips.0) (2025-09-09)
290
+ # [0.146.0-node18-core-styles-tooltips.1](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.0...v0.146.0-node18-core-styles-tooltips.1) (2025-06-20)
291
+
292
+
293
+ ### Features
294
+
295
+ * added frontend links for editor mode ([#4801](https://github.com/thebyte9/blaze/issues/4801)) ([d5de370](https://github.com/thebyte9/blaze/commit/d5de370203abf467fcc3819d06c7375f4a6c1eb9))
296
+
297
+
298
+
299
+
300
+
301
+ # [0.146.0-node18-core-styles-tooltips.0](https://github.com/thebyte9/blaze/compare/v0.145.0...v0.146.0-node18-core-styles-tooltips.0) (2025-06-18)
208
302
 
209
303
 
210
304
  ### Bug Fixes
211
305
 
306
+ * adds default root selector to readme ([cfb5095](https://github.com/thebyte9/blaze/commit/cfb50956d95df485fe4486f632d32400b46806f7))
212
307
  * bumped apollo versions ([b371dc7](https://github.com/thebyte9/blaze/commit/b371dc7e7bbe814a0cc4d57af2b959ab5e1b1bfd))
213
308
  * fixed breaking tests, updated next to 14 ([fecb0e1](https://github.com/thebyte9/blaze/commit/fecb0e1d822bd69ebbaa084072a219f0fddd23f1))
214
309
  * fixed more tests ([46a2fb9](https://github.com/thebyte9/blaze/commit/46a2fb9467f9f3c9cf320c9caf36c66503cc1f49))
215
310
  * fixed remaining failing tests ([8a5963f](https://github.com/thebyte9/blaze/commit/8a5963ff8a0bf615a2ced9fb77b8986a9b05d80c))
311
+ * fixes readme layout ([9dbdd8e](https://github.com/thebyte9/blaze/commit/9dbdd8ee96cb4a716e1e42c224939ac22ac6af0d))
216
312
  * lint errors for reegex ([daaf750](https://github.com/thebyte9/blaze/commit/daaf7506d22f9578072c71f5557d0b6bf6185018))
217
313
  * linting fix for reading return values from promise executor functions ([7edb563](https://github.com/thebyte9/blaze/commit/7edb563a4cbfa37188f26c1ae709ffe8ed837d69))
218
314
  * linting fixed automatically ([73135b9](https://github.com/thebyte9/blaze/commit/73135b9b8b0d5407e2e1dfba42ab2381f290607f))
219
315
  * only do parent redirect when there are graphql errors ([#4697](https://github.com/thebyte9/blaze/issues/4697)) ([1ec63ba](https://github.com/thebyte9/blaze/commit/1ec63ba95c21c11d41721f07346945742d7237ae))
220
316
  * prevent 404 error when no data is returned from and improve redi… ([#4688](https://github.com/thebyte9/blaze/issues/4688)) ([3a5af3d](https://github.com/thebyte9/blaze/commit/3a5af3ddf65d67456971d2d75525235c30965633))
221
- * respond to live blog item size changes for laze loaded image, live blog title and global light box fix ([#4730](https://github.com/thebyte9/blaze/issues/4730)) ([5dd38d8](https://github.com/thebyte9/blaze/commit/5dd38d8d9e5983c55d3053d440eb7ab618688920))
222
- * restore favion loading in the frontend ([#4851](https://github.com/thebyte9/blaze/issues/4851)) ([f1c31bb](https://github.com/thebyte9/blaze/commit/f1c31bb2213f79b1d4b6b1ae6e5d5bd2b150fdf8))
223
317
  * set blank cache-control header to override nextjs default of 0 ([#4783](https://github.com/thebyte9/blaze/issues/4783)) ([2f1653e](https://github.com/thebyte9/blaze/commit/2f1653ed3756a90575c48f8a2253776958c6c0ff))
224
- * show pagebuilder tabs when no components added ([#4844](https://github.com/thebyte9/blaze/issues/4844)) ([2cbb24d](https://github.com/thebyte9/blaze/commit/2cbb24df95b38d4c8f4575814daadebd74ba04d4))
225
318
  * udpated yarn lock ([0cd4fa4](https://github.com/thebyte9/blaze/commit/0cd4fa4a185fca4b80b57e472badb771dd649ec2))
226
319
  * updated with dev ([90f545f](https://github.com/thebyte9/blaze/commit/90f545f1beabb35e26ba6fb2b45a7a0dfd072927))
227
320
  * updated with dev ([729bb6e](https://github.com/thebyte9/blaze/commit/729bb6ee7e87946081d51564a4ab45538f7be1e7))
@@ -232,10 +325,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
232
325
 
233
326
  ### Features
234
327
 
235
- * add support for custom 404 page using custom error 404 slug and fallback rendering ([#4839](https://github.com/thebyte9/blaze/issues/4839)) ([67554a3](https://github.com/thebyte9/blaze/commit/67554a3febc2871d73bd127753edf3b918a1a0b7))
236
- * added frontend links for editor mode ([#4801](https://github.com/thebyte9/blaze/issues/4801)) ([d5de370](https://github.com/thebyte9/blaze/commit/d5de370203abf467fcc3819d06c7375f4a6c1eb9))
237
328
  * allow . (dot) character in route regex ([#4552](https://github.com/thebyte9/blaze/issues/4552)) ([9be0fe0](https://github.com/thebyte9/blaze/commit/9be0fe0dd0dac2e0891c2d965a20c6b2e02165cc))
238
- * chart component ([#4846](https://github.com/thebyte9/blaze/issues/4846)) ([f74bd5a](https://github.com/thebyte9/blaze/commit/f74bd5aecc6078e725f92c523d8da0916a612d88))
239
329
  * debug sidebar now shows on error if enabled ([#4667](https://github.com/thebyte9/blaze/issues/4667)) ([01d43e1](https://github.com/thebyte9/blaze/commit/01d43e19c160980cfc8259c1a951ab70ebe70eb0))
240
330
  * open frontend debug toolbar with a url param ([#4771](https://github.com/thebyte9/blaze/issues/4771)) ([37b8ea5](https://github.com/thebyte9/blaze/commit/37b8ea59a5ed4be0912465717adeb079fd6b3a89))
241
331
  * updated react to 18 ([9335f84](https://github.com/thebyte9/blaze/commit/9335f8432b376494501abb9c3deef1ddaa9b35a8))
package/README.md CHANGED
@@ -90,16 +90,15 @@ If is possible to create a custom error page by adding a page with the slug "cus
90
90
  ## Environment variables
91
91
 
92
92
  | Name | Description | Type | Default |
93
- |---|---|---|
93
+ |---|---|---|---|
94
94
  | BLAZE_FRONTEND_HOST | Frontend host (used to identify host) | String | |
95
- | BLAZE_ROUTE_REGEX | Override default route regex | /^\/[a-z0-9€*\/]+(?:[-\/\.]{1,2}[a-z0-9\/€*\/]+)*$|^\/$/ |
95
+ | BLAZE_ROUTE_REGEX | Override default route regex | Regex | /^\/[a-z0-9€_\/]+(?:[-\/\.]{1,2}[a-z0-9\/€_\/]+)*$|^\/$/ |
96
96
  | BLAZE_CACHE_CONTROL_HEADER | Cache-Control header to set on page requests | String | "" |
97
- | BLAZE_STATIC_ROUTE_STORE_KEY | Override store for static file routes | default |
98
- | BLAZE_ROUTE_PATTERN_SITEMAP | Override sitemap route | /sitemap.xml |
97
+ | BLAZE_STATIC_ROUTE_STORE_KEY | Override store for static file routes | String | default |
98
+ | BLAZE_ROUTE_PATTERN_SITEMAP | Override sitemap route | String | /sitemap.xml |
99
99
  | BLAZE_CONTENT_SITEMAP_URL_PREFIX | Prefix for sitemap URL, used in frontend static route e.g. /sitemap/sitemap-0.xml. This needs to match the value set in the API app. | String | |
100
- | BLAZE_ROOT_SELECTOR_CLASSES_LIMIT | The number of root-selector classes to display. 0 or unset will show noe | String | |
101
- | BLAZE_BUILD_ENV_PREFIX_REGEX | '\|' separated list of allowed environment variable prefixes. Any environment variable that matches this prefix pattern will be dynamically added to the next environment config and will be available in code for use. If the environment variable has a "BUILD_" prefix, then this prefix will be removed from the next environment variable name before assigning it. i.e. BUILD_THIRD_PARTY_ENV will become THIRD_PARTY_ENV in the build. Prefixes BLAZE\|GOOGLE\|JWPLAYER\|DFP are added for backward compatibility and will be deprecated. We recommend to use new and change existing environment variables with "BUILD_" prefix. | BLAZE\|GOOGLE\|JWPLAYER\|DFP\|BUILD |
102
- | BLAZE_CONTENT_SITEMAP_URL_PREFIX | Prefix for sitemap URL, used in frontend static route e.g. /sitemap/sitemap-0.xml. This needs to match value set in API app. | String | |
100
+ | BLAZE_ROOT_SELECTOR_CLASSES_LIMIT | The number of root-selector classes to display. If the variable is not set, it defaults to 1, displaying only the highest-level parent class. | String | 1 |
101
+ | BLAZE_BUILD_ENV_PREFIX_REGEX | '\|' separated list of allowed environment variable prefixes. Any environment variable that matches this prefix pattern will be dynamically added to the next environment config and will be available in code for use. If the environment variable has a "BUILD_" prefix, then this prefix will be removed from the next environment variable name before assigning it. i.e. BUILD_THIRD_PARTY_ENV will become THIRD_PARTY_ENV in the build. Prefixes BLAZE\|GOOGLE\|JWPLAYER\|DFP are added for backward compatibility and will be deprecated. We recommend to use new and change existing environment variables with "BUILD_" prefix. | String | BLAZE\|GOOGLE\|JWPLAYER\|DFP\|BUILD |
103
102
  | BLAZE_DISABLE_REDIRECT_WITH_QUERY | Do not add query string to redirects | String | |
104
103
 
105
104
  ## Events emitted
@@ -206,7 +205,7 @@ When checking new code or build configs make sure to check the [following things
206
205
 
207
206
  ## Root selector classes
208
207
 
209
- To make styling of sections of a site simpler, it is possible to enable setting root selector classes at the top of the Resolver page structure that are generated based on the url hierarchy.
208
+ To make styling of sections of a site simpler, it is possible to enable setting root selector classes at the top of the Resolver page structure that are generated based on the url hierarchy. If the variable is not set, it defaults to 1, displaying only the highest-level parent class.
210
209
 
211
210
  For example the following url, `/parent/child/article-123` might be broken into the following classes
212
211
 
package/example.env CHANGED
@@ -3,6 +3,6 @@ BLAZE_FRONTEND_HOST=thisisblaze.com
3
3
  BLAZE_ROUTE_PATTERN_SITEMAP="/sitemap.xml"
4
4
  BLAZE_CONTENT_SITEMAP_URL_PREFIX="sitemap"
5
5
  #BLAZE_ROUTE_REGEX="^\/[a-z0-9€_\/]+(?:[-\/]{1,2}[a-z0-9\/€_\/]+)*$|^\/$"
6
- BLAZE_ROOT_SELECTOR_CLASSES_LIMIT="2"
6
+ BLAZE_ROOT_SELECTOR_CLASSES_LIMIT="1"
7
7
  BLAZE_CACHE_CONTROL_HEADER="max-age=0"
8
8
  BLAZE_DISABLE_REDIRECT_WITH_QUERY=""
@@ -18,7 +18,9 @@ var _pluginGoogleMapsFe = _interopRequireDefault(require("@blaze-cms/plugin-goog
18
18
  var _pluginPreviewFe = _interopRequireDefault(require("@blaze-cms/plugin-preview-fe"));
19
19
  var _pluginAuthFe = _interopRequireDefault(require("@blaze-cms/plugin-auth-fe"));
20
20
  var _pluginStructuredDataFe = _interopRequireDefault(require("@blaze-cms/plugin-structured-data-fe"));
21
+ var _pluginTranslationFe = _interopRequireDefault(require("@blaze-cms/plugin-translation-fe"));
21
22
  var plugins = new Map();
23
+ plugins.set(_pluginTranslationFe["default"], {});
22
24
  plugins.set(_pluginPageBuilderFe["default"], {});
23
25
  plugins.set(_pluginGtmFe["default"], {});
24
26
  plugins.set(_pluginChart["default"], {});
@@ -1 +1 @@
1
- {"version":3,"file":"blaze.config.js","names":["_pluginPageBuilderFe","_interopRequireDefault","require","_pluginGtmFe","_pluginChart","_pluginGoogleMapsFe","_pluginPreviewFe","_pluginAuthFe","_pluginStructuredDataFe","plugins","Map","set","pageBuilder","gtm","chart","googleMaps","previewFe","authFe","structuredDataFe","authenticatedBotHeaders","apollo","uri","process","env","BLAZE_GRAPHQL_URI","loadEntitiesInBrowser","_default","exports"],"sources":["../src/blaze.config.js"],"sourcesContent":["import pageBuilder from '@blaze-cms/plugin-page-builder-fe';\nimport gtm from '@blaze-cms/plugin-gtm-fe';\nimport chart from '@blaze-cms/plugin-chart';\nimport googleMaps from '@blaze-cms/plugin-google-maps-fe';\nimport previewFe from '@blaze-cms/plugin-preview-fe';\nimport authFe from '@blaze-cms/plugin-auth-fe';\nimport structuredDataFe from '@blaze-cms/plugin-structured-data-fe';\n\nconst plugins = new Map();\n\nplugins.set(pageBuilder, {});\nplugins.set(gtm, {});\nplugins.set(chart, {});\nplugins.set(googleMaps, {});\nplugins.set(previewFe, {});\nplugins.set(authFe, {});\nplugins.set(structuredDataFe, {\n authenticatedBotHeaders: ['x-amzn-waf-googlebot']\n});\n\nconst apollo = {\n uri: process.env.BLAZE_GRAPHQL_URI,\n loadEntitiesInBrowser: false\n};\n\nexport default { plugins, apollo };\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,oBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,mBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,gBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,aAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,uBAAA,GAAAP,sBAAA,CAAAC,OAAA;AAEA,IAAMO,OAAO,GAAG,IAAIC,GAAG,CAAC,CAAC;AAEzBD,OAAO,CAACE,GAAG,CAACC,+BAAW,EAAE,CAAC,CAAC,CAAC;AAC5BH,OAAO,CAACE,GAAG,CAACE,uBAAG,EAAE,CAAC,CAAC,CAAC;AACpBJ,OAAO,CAACE,GAAG,CAACG,uBAAK,EAAE,CAAC,CAAC,CAAC;AACtBL,OAAO,CAACE,GAAG,CAACI,8BAAU,EAAE,CAAC,CAAC,CAAC;AAC3BN,OAAO,CAACE,GAAG,CAACK,2BAAS,EAAE,CAAC,CAAC,CAAC;AAC1BP,OAAO,CAACE,GAAG,CAACM,wBAAM,EAAE,CAAC,CAAC,CAAC;AACvBR,OAAO,CAACE,GAAG,CAACO,kCAAgB,EAAE;EAC5BC,uBAAuB,EAAE,CAAC,sBAAsB;AAClD,CAAC,CAAC;AAEF,IAAMC,MAAM,GAAG;EACbC,GAAG,EAAEC,OAAO,CAACC,GAAG,CAACC,iBAAiB;EAClCC,qBAAqB,EAAE;AACzB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEa;EAAElB,OAAO,EAAPA,OAAO;EAAEW,MAAM,EAANA;AAAO,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"blaze.config.js","names":["_pluginPageBuilderFe","_interopRequireDefault","require","_pluginGtmFe","_pluginChart","_pluginGoogleMapsFe","_pluginPreviewFe","_pluginAuthFe","_pluginStructuredDataFe","_pluginTranslationFe","plugins","Map","set","translationFe","pageBuilder","gtm","chart","googleMaps","previewFe","authFe","structuredDataFe","authenticatedBotHeaders","apollo","uri","process","env","BLAZE_GRAPHQL_URI","loadEntitiesInBrowser","_default","exports"],"sources":["../src/blaze.config.js"],"sourcesContent":["import pageBuilder from '@blaze-cms/plugin-page-builder-fe';\nimport gtm from '@blaze-cms/plugin-gtm-fe';\nimport chart from '@blaze-cms/plugin-chart';\nimport googleMaps from '@blaze-cms/plugin-google-maps-fe';\nimport previewFe from '@blaze-cms/plugin-preview-fe';\nimport authFe from '@blaze-cms/plugin-auth-fe';\nimport structuredDataFe from '@blaze-cms/plugin-structured-data-fe';\nimport translationFe from '@blaze-cms/plugin-translation-fe';\n\nconst plugins = new Map();\nplugins.set(translationFe, {});\nplugins.set(pageBuilder, {});\nplugins.set(gtm, {});\nplugins.set(chart, {});\nplugins.set(googleMaps, {});\nplugins.set(previewFe, {});\nplugins.set(authFe, {});\n\nplugins.set(structuredDataFe, {\n authenticatedBotHeaders: ['x-amzn-waf-googlebot']\n});\n\nconst apollo = {\n uri: process.env.BLAZE_GRAPHQL_URI,\n loadEntitiesInBrowser: false\n};\n\nexport default { plugins, apollo };\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,oBAAA,GAAAC,sBAAA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ys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
35
35
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
36
36
  var getRootClassesLimit = function getRootClassesLimit() {
37
- return Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT);
37
+ return Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT || 1);
38
38
  };
39
39
  var checkUrl = /*#__PURE__*/function () {
40
40
  var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"check-url.js","names":["_queryString","require","_reactPageBuilder","_coreAuthUi","_constants","_query","_checkParent","_interopRequireDefault","_checkPreviewUrl","_handleStaticRoutes","_getPageData","_getRootSelectorClasses","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","getRootClassesLimit","Number","process","env","BLAZE_ROOT_SELECTOR_CLASSES_LIMIT","checkUrl","_ref","_asyncToGenerator2","_regenerator","mark","_callee","props","asPath","apolloClient","res","req","query","blazeApp","disableSsr","fullUrl","_parseUrl","url","handler","previewData","urlCheckOptions","result","wrap","_callee$","_context","prev","next","getFullUrl","parseUrl","BLAZE_STATUS_URL","abrupt","isStatusPage","handleStaticRoutes","getHandler","setHeader","BLAZE_X_FRAME_OPTIONS","BLAZE_X_FRAME_OPTIONS_DEFAULT","getHeader","BLAZE_CACHE_CONTROL_HEADER","checkPreviewUrl","checkAccessToken","cache","extract","getPreviewData","doUrlCheck","handle404Error","sent","stop","_x","_ref2","_callee2","_result$pageData","_result$pageData2","rootSelectorClasses","_callee2$","_context2","getPageData","pageData","getRootSelectorClasses","isPreview","_x2","_x3","getHost","_ref3","_ref3$headers","headers","BLAZE_FRONTEND_HOST","host","concat","HTTPS","_window","window","_window$location","location","protocol","hostname","port","urlPort","COLON","DOUBLE_SLASH","_ref4","_callee3","args","_args$errorCheckCode","errorCheckCode","_yield$apolloClient$q","_yield$apolloClient$q2","_yield$apolloClient$q3","_yield$apolloClient$q4","_yield$apolloClient$q5","itemId","itemEntity","urlTo","_yield$apolloClient$q6","_callee3$","_context3","ROUTE_REGEX","test","Error","checkUrlQuery","variables","data","setCustomCacheControlHeaders","handleRedirect","events","emit","message","statusCode","getUnpublishedEntityName","t0","handleUrlError","_x4","handleError","err","error","networkError","writeHead","write","end","graphQLErrors","NOT_FOUND_STATUS_CODE","errorCode","_ref5","errorMessage","customError","redirectUrl","BLAZE_DISABLE_REDIRECT_WITH_QUERY","queryString","split","doRedirect","_ref6","_ref6$cacheControlMax","cacheControlMaxAge","Location","href","redirecting","_x5","_x6","_handleUrlError","_callee4","parentUrl","parentPATH","_callee4$","_context4","ERROR_URLS","custom404","checkParent","_default","exports"],"sources":["../../src/helpers/check-url.js"],"sourcesContent":["import { parseUrl } from 'query-string';\nimport { getUnpublishedEntityName } from '@blaze-cms/react-page-builder';\nimport { checkAccessToken } from '@blaze-cms/core-auth-ui';\nimport {\n HTTPS,\n DOUBLE_SLASH,\n COLON,\n NOT_FOUND_STATUS_CODE,\n BLAZE_X_FRAME_OPTIONS_DEFAULT,\n ROUTE_REGEX,\n ERROR_URLS\n} from '../constants';\nimport { checkUrlQuery } from '../application/query';\nimport checkParent from './check-parent';\nimport checkPreviewUrl from './check-preview-url';\nimport handleStaticRoutes from './handle-static-routes';\nimport getPageData from './get-page-data';\nimport getRootSelectorClasses from './get-root-selector-classes';\n\nconst getRootClassesLimit = () => Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT);\n\nconst checkUrl = async props => {\n const { asPath, apolloClient, res, req, query, blazeApp, disableSsr } = props;\n const fullUrl = getFullUrl(req, asPath);\n const { url } = parseUrl(asPath);\n\n if (process.env.BLAZE_STATUS_URL && url === process.env.BLAZE_STATUS_URL) {\n return { isStatusPage: true };\n }\n\n if (res) {\n const handler = handleStaticRoutes.getHandler(asPath);\n\n res.setHeader(\n 'X-Frame-Options',\n process.env.BLAZE_X_FRAME_OPTIONS || BLAZE_X_FRAME_OPTIONS_DEFAULT\n );\n\n if (!res.getHeader('Cache-Control')) {\n res.setHeader('Cache-Control', process.env.BLAZE_CACHE_CONTROL_HEADER || ' ');\n }\n\n if (handler) {\n return handler(props);\n }\n }\n\n const previewData = checkPreviewUrl(url, query);\n\n if (!previewData && disableSsr) return { disableSsr: true };\n\n await checkAccessToken(apolloClient, {\n ...props,\n disableSsr: !Object.keys(apolloClient.cache.extract()).length // empty cache means SSR was disabled\n });\n\n if (previewData) return getPreviewData(previewData, apolloClient);\n const urlCheckOptions = { asPath, url, apolloClient, res };\n const result = await doUrlCheck({\n ...urlCheckOptions,\n handle404Error: true,\n blazeApp\n });\n return { ...result, fullUrl } || {};\n};\n\nconst getPreviewData = async (previewData, apolloClient) => {\n const result = await getPageData({ ...previewData, apolloClient });\n const { pageData: { url } = {} } = result;\n const rootSelectorClasses = getRootSelectorClasses(url, getRootClassesLimit());\n return { ...previewData, rootSelectorClasses, ...result, isPreview: true };\n};\n\nconst getHost = ({ headers = {} }) =>\n process.env.BLAZE_FRONTEND_HOST ||\n headers['x-request-host'] ||\n headers['x-forwarded-host'] ||\n headers.host;\n\nconst getFullUrl = (req, asPath) => {\n if (req) {\n return `${HTTPS}${getHost(req)}${asPath}`;\n }\n const {\n location: { protocol, hostname, port }\n } = window;\n const urlPort = port ? `${COLON}${port}` : '';\n\n return `${protocol}${DOUBLE_SLASH}${hostname}${urlPort}${asPath}`;\n};\n\nconst doUrlCheck = async args => {\n const { asPath, url, apolloClient, res, blazeApp, errorCheckCode = false } = args;\n try {\n if (!ROUTE_REGEX.test(url)) {\n throw Error('Invalid URL');\n }\n const { data: { checkUrl: { itemId, itemEntity, urlTo, pageData = {} } = {} } = {} } =\n await apolloClient.query({\n query: checkUrlQuery,\n variables: { url }\n });\n\n setCustomCacheControlHeaders(pageData, res);\n\n if (urlTo && (urlTo !== url || errorCheckCode)) {\n return handleRedirect({ errorCheckCode, url, urlTo, asPath, res });\n }\n const rootSelectorClasses = getRootSelectorClasses(url, getRootClassesLimit());\n\n if (errorCheckCode) {\n blazeApp.events.emit('monitor:log', { message: `Serving custom ${errorCheckCode} page` });\n if (res) res.statusCode = errorCheckCode;\n }\n\n return {\n pageData,\n rootSelectorClasses,\n itemId,\n itemEntity: getUnpublishedEntityName(itemEntity)\n };\n } catch (err) {\n return handleUrlError(err, args);\n }\n};\n\nconst handleError = (err, res, handle404Error, blazeApp) => {\n blazeApp.events.emit('monitor:log', { error: err });\n if (!res) return {};\n if (err.networkError) {\n res.writeHead(500, { 'Content-Type': 'text/plain' });\n res.write('500 Internal Server Error\\n');\n res.end();\n } else if (handle404Error && err.graphQLErrors && err.graphQLErrors.length) {\n res.statusCode = NOT_FOUND_STATUS_CODE;\n return { errorCode: NOT_FOUND_STATUS_CODE };\n }\n\n return {};\n};\n\nfunction handleRedirect({ errorCheckCode, url, urlTo, asPath, res }) {\n if (errorCheckCode) {\n const errorMessage = `Cannot redirect ${url}`;\n const customError = new Error(errorMessage);\n customError.graphQLErrors = [errorMessage];\n throw customError;\n }\n let redirectUrl = urlTo;\n if (process.env.BLAZE_DISABLE_REDIRECT_WITH_QUERY !== 'true') {\n const queryString = asPath.split('?')[1];\n redirectUrl = queryString ? `${urlTo}?${queryString}` : urlTo;\n }\n\n return doRedirect(res, redirectUrl);\n}\n\nfunction setCustomCacheControlHeaders(pageData, res) {\n const { cacheControlMaxAge = null } = pageData || {};\n\n if (res && cacheControlMaxAge !== null && cacheControlMaxAge >= 0) {\n res.setHeader('Cache-Control', `max-age=${cacheControlMaxAge}`);\n }\n}\n\nfunction doRedirect(res, redirectUrl) {\n if (res) {\n res.writeHead(301, { Location: redirectUrl });\n res.end();\n } else {\n window.location.href = redirectUrl;\n }\n\n return { redirecting: true };\n}\n\nasync function handleUrlError(err, args) {\n const { asPath, res, handle404Error, blazeApp, errorCheckCode } = args;\n if (!err.graphQLErrors || !err.graphQLErrors.length) {\n return handleError(err, res, handle404Error, blazeApp);\n }\n\n if (!errorCheckCode) {\n const result = await doUrlCheck({\n ...args,\n url: ERROR_URLS.custom404,\n errorCheckCode: NOT_FOUND_STATUS_CODE\n });\n\n if (handle404Error) {\n const parentUrl = checkParent(asPath);\n if (parentUrl) {\n return doRedirect(res, parentUrl);\n }\n }\n return result;\n }\n\n const parentPATH = checkParent(asPath);\n if (handle404Error && parentPATH) {\n return doRedirect(res, parentPATH);\n }\n\n return handleError(err, res, handle404Error, blazeApp);\n}\n\nexport default checkUrl;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AASA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,gBAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,mBAAA,GAAAF,sBAAA,CAAAN,OAAA;AACA,IAAAS,YAAA,GAAAH,sBAAA,CAAAN,OAAA;AACA,IAAAU,uBAAA,GAAAJ,sBAAA,CAAAN,OAAA;AAAiE,SAAAW,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA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IAAA;UAAA,KAMRD,cAAc;YAAAkG,SAAA,CAAArH,IAAA;YAAA;UAAA;UACVkH,SAAS,GAAG,IAAAM,uBAAW,EAAC1I,MAAM,CAAC;UAAA,KACjCoI,SAAS;YAAAG,SAAA,CAAArH,IAAA;YAAA;UAAA;UAAA,OAAAqH,SAAA,CAAAjH,MAAA,WACJmG,UAAU,CAACvH,GAAG,EAAEkI,SAAS,CAAC;QAAA;UAAA,OAAAG,SAAA,CAAAjH,MAAA,WAG9BT,MAAM;QAAA;UAGTwH,UAAU,GAAG,IAAAK,uBAAW,EAAC1I,MAAM,CAAC;UAAA,MAClCqC,cAAc,IAAIgG,UAAU;YAAAE,SAAA,CAAArH,IAAA;YAAA;UAAA;UAAA,OAAAqH,SAAA,CAAAjH,MAAA,WACvBmG,UAAU,CAACvH,GAAG,EAAEmI,UAAU,CAAC;QAAA;UAAA,OAAAE,SAAA,CAAAjH,MAAA,WAG7BkF,WAAW,CAACC,GAAG,EAAEvG,GAAG,EAAEmC,cAAc,EAAEhC,QAAQ,CAAC;QAAA;QAAA;UAAA,OAAAkI,SAAA,CAAAhG,IAAA;MAAA;IAAA,GAAA4F,QAAA;EAAA,CACvD;EAAA,OAAAD,eAAA,CAAAvJ,KAAA,OAAAE,SAAA;AAAA;AAAA,IAAA8J,QAAA,GAAAC,OAAA,cAEcnJ,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"check-url.js","names":["_queryString","require","_reactPageBuilder","_coreAuthUi","_constants","_query","_checkParent","_interopRequireDefault","_checkPreviewUrl","_handleStaticRoutes","_getPageData","_getRootSelectorClasses","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","getRootClassesLimit","Number","process","env","BLAZE_ROOT_SELECTOR_CLASSES_LIMIT","checkUrl","_ref","_asyncToGenerator2","_regenerator","mark","_callee","props","asPath","apolloClient","res","req","query","blazeApp","disableSsr","fullUrl","_parseUrl","url","handler","previewData","urlCheckOptions","result","wrap","_callee$","_context","prev","next","getFullUrl","parseUrl","BLAZE_STATUS_URL","abrupt","isStatusPage","handleStaticRoutes","getHandler","setHeader","BLAZE_X_FRAME_OPTIONS","BLAZE_X_FRAME_OPTIONS_DEFAULT","getHeader","BLAZE_CACHE_CONTROL_HEADER","checkPreviewUrl","checkAccessToken","cache","extract","getPreviewData","doUrlCheck","handle404Error","sent","stop","_x","_ref2","_callee2","_result$pageData","_result$pageData2","rootSelectorClasses","_callee2$","_context2","getPageData","pageData","getRootSelectorClasses","isPreview","_x2","_x3","getHost","_ref3","_ref3$headers","headers","BLAZE_FRONTEND_HOST","host","concat","HTTPS","_window","window","_window$location","location","protocol","hostname","port","urlPort","COLON","DOUBLE_SLASH","_ref4","_callee3","args","_args$errorCheckCode","errorCheckCode","_yield$apolloClient$q","_yield$apolloClient$q2","_yield$apolloClient$q3","_yield$apolloClient$q4","_yield$apolloClient$q5","itemId","itemEntity","urlTo","_yield$apolloClient$q6","_callee3$","_context3","ROUTE_REGEX","test","Error","checkUrlQuery","variables","data","setCustomCacheControlHeaders","handleRedirect","events","emit","message","statusCode","getUnpublishedEntityName","t0","handleUrlError","_x4","handleError","err","error","networkError","writeHead","write","end","graphQLErrors","NOT_FOUND_STATUS_CODE","errorCode","_ref5","errorMessage","customError","redirectUrl","BLAZE_DISABLE_REDIRECT_WITH_QUERY","queryString","split","doRedirect","_ref6","_ref6$cacheControlMax","cacheControlMaxAge","Location","href","redirecting","_x5","_x6","_handleUrlError","_callee4","parentUrl","parentPATH","_callee4$","_context4","ERROR_URLS","custom404","checkParent","_default","exports"],"sources":["../../src/helpers/check-url.js"],"sourcesContent":["import { parseUrl } from 'query-string';\nimport { getUnpublishedEntityName } from '@blaze-cms/react-page-builder';\nimport { checkAccessToken } from '@blaze-cms/core-auth-ui';\nimport {\n HTTPS,\n DOUBLE_SLASH,\n COLON,\n NOT_FOUND_STATUS_CODE,\n BLAZE_X_FRAME_OPTIONS_DEFAULT,\n ROUTE_REGEX,\n ERROR_URLS\n} from '../constants';\nimport { checkUrlQuery } from '../application/query';\nimport checkParent from './check-parent';\nimport checkPreviewUrl from './check-preview-url';\nimport handleStaticRoutes from './handle-static-routes';\nimport getPageData from './get-page-data';\nimport getRootSelectorClasses from './get-root-selector-classes';\n\nconst getRootClassesLimit = () => Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT || 1);\n\nconst checkUrl = async props => {\n const { asPath, apolloClient, res, req, query, blazeApp, disableSsr } = props;\n const fullUrl = getFullUrl(req, asPath);\n const { url } = parseUrl(asPath);\n\n if (process.env.BLAZE_STATUS_URL && url === process.env.BLAZE_STATUS_URL) {\n return { isStatusPage: true };\n }\n\n if (res) {\n const handler = handleStaticRoutes.getHandler(asPath);\n\n res.setHeader(\n 'X-Frame-Options',\n process.env.BLAZE_X_FRAME_OPTIONS || BLAZE_X_FRAME_OPTIONS_DEFAULT\n );\n\n if (!res.getHeader('Cache-Control')) {\n res.setHeader('Cache-Control', process.env.BLAZE_CACHE_CONTROL_HEADER || ' ');\n }\n\n if (handler) {\n return handler(props);\n }\n }\n\n const previewData = checkPreviewUrl(url, query);\n\n if (!previewData && disableSsr) return { disableSsr: true };\n\n await checkAccessToken(apolloClient, {\n ...props,\n disableSsr: !Object.keys(apolloClient.cache.extract()).length // empty cache means SSR was disabled\n });\n\n if (previewData) return getPreviewData(previewData, apolloClient);\n const urlCheckOptions = { asPath, url, apolloClient, res };\n const result = await doUrlCheck({\n ...urlCheckOptions,\n handle404Error: true,\n blazeApp\n });\n return { ...result, fullUrl } || {};\n};\n\nconst getPreviewData = async (previewData, apolloClient) => {\n const result = await getPageData({ ...previewData, apolloClient });\n const { pageData: { url } = {} } = result;\n const rootSelectorClasses = getRootSelectorClasses(url, getRootClassesLimit());\n return { ...previewData, rootSelectorClasses, ...result, isPreview: true };\n};\n\nconst getHost = ({ headers = {} }) =>\n process.env.BLAZE_FRONTEND_HOST ||\n headers['x-request-host'] ||\n headers['x-forwarded-host'] ||\n headers.host;\n\nconst getFullUrl = (req, asPath) => {\n if (req) {\n return `${HTTPS}${getHost(req)}${asPath}`;\n }\n const {\n location: { protocol, hostname, port }\n } = window;\n const urlPort = port ? `${COLON}${port}` : '';\n\n return `${protocol}${DOUBLE_SLASH}${hostname}${urlPort}${asPath}`;\n};\n\nconst doUrlCheck = async args => {\n const { asPath, url, apolloClient, res, blazeApp, errorCheckCode = false } = args;\n try {\n if (!ROUTE_REGEX.test(url)) {\n throw Error('Invalid URL');\n }\n const { data: { checkUrl: { itemId, itemEntity, urlTo, pageData = {} } = {} } = {} } =\n await apolloClient.query({\n query: checkUrlQuery,\n variables: { url }\n });\n\n setCustomCacheControlHeaders(pageData, res);\n\n if (urlTo && (urlTo !== url || errorCheckCode)) {\n return handleRedirect({ errorCheckCode, url, urlTo, asPath, res });\n }\n const rootSelectorClasses = getRootSelectorClasses(url, getRootClassesLimit());\n\n if (errorCheckCode) {\n blazeApp.events.emit('monitor:log', { message: `Serving custom ${errorCheckCode} page` });\n if (res) res.statusCode = errorCheckCode;\n }\n\n return {\n pageData,\n rootSelectorClasses,\n itemId,\n itemEntity: getUnpublishedEntityName(itemEntity)\n };\n } catch (err) {\n return handleUrlError(err, args);\n }\n};\n\nconst handleError = (err, res, handle404Error, blazeApp) => {\n blazeApp.events.emit('monitor:log', { error: err });\n if (!res) return {};\n if (err.networkError) {\n res.writeHead(500, { 'Content-Type': 'text/plain' });\n res.write('500 Internal Server Error\\n');\n res.end();\n } else if (handle404Error && err.graphQLErrors && err.graphQLErrors.length) {\n res.statusCode = NOT_FOUND_STATUS_CODE;\n return { errorCode: NOT_FOUND_STATUS_CODE };\n }\n\n return {};\n};\n\nfunction handleRedirect({ errorCheckCode, url, urlTo, asPath, res }) {\n if (errorCheckCode) {\n const errorMessage = `Cannot redirect ${url}`;\n const customError = new Error(errorMessage);\n customError.graphQLErrors = [errorMessage];\n throw customError;\n }\n let redirectUrl = urlTo;\n if (process.env.BLAZE_DISABLE_REDIRECT_WITH_QUERY !== 'true') {\n const queryString = asPath.split('?')[1];\n redirectUrl = queryString ? `${urlTo}?${queryString}` : urlTo;\n }\n\n return doRedirect(res, redirectUrl);\n}\n\nfunction setCustomCacheControlHeaders(pageData, res) {\n const { cacheControlMaxAge = null } = pageData || {};\n\n if (res && cacheControlMaxAge !== null && cacheControlMaxAge >= 0) {\n res.setHeader('Cache-Control', `max-age=${cacheControlMaxAge}`);\n }\n}\n\nfunction doRedirect(res, redirectUrl) {\n if (res) {\n res.writeHead(301, { Location: redirectUrl });\n res.end();\n } else {\n window.location.href = redirectUrl;\n }\n\n return { redirecting: true };\n}\n\nasync function handleUrlError(err, args) {\n const { asPath, res, handle404Error, blazeApp, errorCheckCode } = args;\n if (!err.graphQLErrors || !err.graphQLErrors.length) {\n return handleError(err, res, handle404Error, blazeApp);\n }\n\n if (!errorCheckCode) {\n const result = await doUrlCheck({\n ...args,\n url: ERROR_URLS.custom404,\n errorCheckCode: NOT_FOUND_STATUS_CODE\n });\n\n if (handle404Error) {\n const parentUrl = checkParent(asPath);\n if (parentUrl) {\n return doRedirect(res, parentUrl);\n }\n }\n return result;\n }\n\n const parentPATH = checkParent(asPath);\n if (handle404Error && parentPATH) {\n return doRedirect(res, parentPATH);\n }\n\n return handleError(err, res, handle404Error, blazeApp);\n}\n\nexport default checkUrl;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AASA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,gBAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,mBAAA,GAAAF,sBAAA,CAAAN,OAAA;AACA,IAAAS,YAAA,GAAAH,sB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AA,OACIkB,UAAU,CAAAxD,aAAA,CAAAA,aAAA,KAC1B8F,IAAI;YACPjE,GAAG,EAAE+H,qBAAU,CAACC,SAAS;YACzB7D,cAAc,EAAEoC;UAAqB,EACtC,CAAC;QAAA;UAJInG,MAAM,GAAA0H,SAAA,CAAAjG,IAAA;UAAA,KAMRD,cAAc;YAAAkG,SAAA,CAAArH,IAAA;YAAA;UAAA;UACVkH,SAAS,GAAG,IAAAM,uBAAW,EAAC1I,MAAM,CAAC;UAAA,KACjCoI,SAAS;YAAAG,SAAA,CAAArH,IAAA;YAAA;UAAA;UAAA,OAAAqH,SAAA,CAAAjH,MAAA,WACJmG,UAAU,CAACvH,GAAG,EAAEkI,SAAS,CAAC;QAAA;UAAA,OAAAG,SAAA,CAAAjH,MAAA,WAG9BT,MAAM;QAAA;UAGTwH,UAAU,GAAG,IAAAK,uBAAW,EAAC1I,MAAM,CAAC;UAAA,MAClCqC,cAAc,IAAIgG,UAAU;YAAAE,SAAA,CAAArH,IAAA;YAAA;UAAA;UAAA,OAAAqH,SAAA,CAAAjH,MAAA,WACvBmG,UAAU,CAACvH,GAAG,EAAEmI,UAAU,CAAC;QAAA;UAAA,OAAAE,SAAA,CAAAjH,MAAA,WAG7BkF,WAAW,CAACC,GAAG,EAAEvG,GAAG,EAAEmC,cAAc,EAAEhC,QAAQ,CAAC;QAAA;QAAA;UAAA,OAAAkI,SAAA,CAAAhG,IAAA;MAAA;IAAA,GAAA4F,QAAA;EAAA,CACvD;EAAA,OAAAD,eAAA,CAAAvJ,KAAA,OAAAE,SAAA;AAAA;AAAA,IAAA8J,QAAA,GAAAC,OAAA,cAEcnJ,QAAQ","ignoreList":[]}
@@ -13,6 +13,8 @@ Object.defineProperty(exports, "__esModule", {
13
13
  value: true
14
14
  });
15
15
  exports["default"] = void 0;
16
+ require("core-js/modules/es.regexp.exec.js");
17
+ require("core-js/modules/es.string.replace.js");
16
18
  var _react = _interopRequireDefault(require("react"));
17
19
  var _propTypes = _interopRequireDefault(require("prop-types"));
18
20
  var _document = _interopRequireWildcard(require("next/document"));
@@ -20,10 +22,13 @@ var _DocumentBody = _interopRequireDefault(require("./DocumentBody"));
20
22
  var _helpers = require("../../helpers");
21
23
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
22
24
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
25
+ var DEFAULT_LANG = (process.env.BLAZE_TRANSLATION_LANGUAGE || 'en').replace('_', '-');
23
26
  var BlazeDocument = function BlazeDocument(_ref) {
24
- var children = _ref.children;
27
+ var children = _ref.children,
28
+ _ref$lang = _ref.lang,
29
+ lang = _ref$lang === void 0 ? DEFAULT_LANG : _ref$lang;
25
30
  return /*#__PURE__*/_react["default"].createElement(_document.Html, {
26
- lang: "en"
31
+ lang: lang
27
32
  }, /*#__PURE__*/_react["default"].createElement(_document.Head, null, /*#__PURE__*/_react["default"].createElement("link", {
28
33
  rel: "icon",
29
34
  href: "/static/img/favicon.png",
@@ -33,7 +38,11 @@ var BlazeDocument = function BlazeDocument(_ref) {
33
38
  BlazeDocument.Document = _document["default"];
34
39
  BlazeDocument.Body = _DocumentBody["default"];
35
40
  BlazeDocument.propTypes = {
36
- children: _propTypes["default"].object.isRequired
41
+ children: _propTypes["default"].object.isRequired,
42
+ lang: _propTypes["default"].string
43
+ };
44
+ BlazeDocument.defaultProps = {
45
+ lang: DEFAULT_LANG
37
46
  };
38
47
  var _default = exports["default"] = BlazeDocument;
39
48
  //# sourceMappingURL=_document.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_document.js","names":["_react","_interopRequireDefault","require","_propTypes","_document","_interopRequireWildcard","_DocumentBody","_helpers","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","BlazeDocument","_ref","children","createElement","Html","lang","Head","rel","href","type","renderAppleTags","Document","Body","DocumentBody","propTypes","PropTypes","object","isRequired","_default","exports"],"sources":["../../../src/pages/document/_document.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Document, { Html, Head } from 'next/document';\nimport DocumentBody from './DocumentBody';\nimport { renderAppleTags } from '../../helpers';\n\nconst BlazeDocument = ({ children }) => (\n <Html lang=\"en\">\n <Head>\n <link rel=\"icon\" href=\"/static/img/favicon.png\" type=\"image/x-icon\" />\n {renderAppleTags()}\n </Head>\n {children}\n </Html>\n);\n\nBlazeDocument.Document = Document;\nBlazeDocument.Body = DocumentBody;\n\nBlazeDocument.propTypes = {\n children: PropTypes.object.isRequired\n};\n\nexport default BlazeDocument;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAAgD,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,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R,QACG,CAAC;AAAA,CACR;AAEDF,aAAa,CAACW,QAAQ,GAAGA,oBAAQ;AACjCX,aAAa,CAACY,IAAI,GAAGC,wBAAY;AAEjCb,aAAa,CAACc,SAAS,GAAG;EACxBZ,QAAQ,EAAEa,qBAAS,CAACC,MAAM,CAACC;AAC7B,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEanB,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"_document.js","names":["_react","_interopRequireDefault","require","_propTypes","_document","_interopRequireWildcard","_DocumentBody","_helpers","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","DEFAULT_LANG","process","env","BLAZE_TRANSLATION_LANGUAGE","replace","BlazeDocument","_ref","children","_ref$lang","lang","createElement","Html","Head","rel","href","type","renderAppleTags","Document","Body","DocumentBody","propTypes","PropTypes","object","isRequired","string","defaultProps","_default","exports"],"sources":["../../../src/pages/document/_document.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Document, { Html, Head } from 'next/document';\nimport DocumentBody from './DocumentBody';\nimport { renderAppleTags } from '../../helpers';\n\nconst DEFAULT_LANG = (process.env.BLAZE_TRANSLATION_LANGUAGE || 'en').replace('_', '-');\n\nconst BlazeDocument = ({ children, lang = DEFAULT_LANG }) => (\n <Html lang={lang}>\n <Head>\n <link rel=\"icon\" href=\"/static/img/favicon.png\" type=\"image/x-icon\" />\n {renderAppleTags()}\n </Head>\n {children}\n </Html>\n);\n\nBlazeDocument.Document = Document;\nBlazeDocument.Body = DocumentBody;\n\nBlazeDocument.propTypes = {\n children: PropTypes.object.isRequired,\n lang: PropTypes.string\n};\n\nBlazeDocument.defaultProps = {\n lang: DEFAULT_LANG\n};\n\nexport default BlazeDocument;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA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YAAY,GAAG,CAACC,OAAO,CAACC,GAAG,CAACC,0BAA0B,IAAI,IAAI,EAAEC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;AAEvF,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,CAAAC,IAAA;EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAAC,SAAA,GAAAF,IAAA,CAAEG,IAAI;IAAJA,IAAI,GAAAD,SAAA,cAAGR,YAAY,GAAAQ,SAAA;EAAA,oBACpDpC,MAAA,YAAAsC,aAAA,CAAClC,SAAA,CAAAmC,IAAI;IAACF,IAAI,EAAEA;EAAK,gBACfrC,MAAA,YAAAsC,aAAA,CAAClC,SAAA,CAAAoC,IAAI,qBACHxC,MAAA,YAAAsC,aAAA;IAAMG,GAAG,EAAC,MAAM;IAACC,IAAI,EAAC,yBAAyB;IAACC,IAAI,EAAC;EAAc,CAAE,CAAC,EACrE,IAAAC,wBAAe,EAAC,CACb,CAAC,EACNT,QACG,CAAC;AAAA,CACR;AAEDF,aAAa,CAACY,QAAQ,GAAGA,oBAAQ;AACjCZ,aAAa,CAACa,IAAI,GAAGC,wBAAY;AAEjCd,aAAa,CAACe,SAAS,GAAG;EACxBb,QAAQ,EAAEc,qBAAS,CAACC,MAAM,CAACC,UAAU;EACrCd,IAAI,EAAEY,qBAAS,CAACG;AAClB,CAAC;AAEDnB,aAAa,CAACoB,YAAY,GAAG;EAC3BhB,IAAI,EAAET;AACR,CAAC;AAAC,IAAA0B,QAAA,GAAAC,OAAA,cAEatB,aAAa","ignoreList":[]}
@@ -5,7 +5,9 @@ import googleMaps from '@blaze-cms/plugin-google-maps-fe';
5
5
  import previewFe from '@blaze-cms/plugin-preview-fe';
6
6
  import authFe from '@blaze-cms/plugin-auth-fe';
7
7
  import structuredDataFe from '@blaze-cms/plugin-structured-data-fe';
8
+ import translationFe from '@blaze-cms/plugin-translation-fe';
8
9
  const plugins = new Map();
10
+ plugins.set(translationFe, {});
9
11
  plugins.set(pageBuilder, {});
10
12
  plugins.set(gtm, {});
11
13
  plugins.set(chart, {});
@@ -1 +1 @@
1
- {"version":3,"file":"blaze.config.js","names":["pageBuilder","gtm","chart","googleMaps","previewFe","authFe","structuredDataFe","plugins","Map","set","authenticatedBotHeaders","apollo","uri","process","env","BLAZE_GRAPHQL_URI","loadEntitiesInBrowser"],"sources":["../src/blaze.config.js"],"sourcesContent":["import pageBuilder from '@blaze-cms/plugin-page-builder-fe';\nimport gtm from '@blaze-cms/plugin-gtm-fe';\nimport chart from '@blaze-cms/plugin-chart';\nimport googleMaps from '@blaze-cms/plugin-google-maps-fe';\nimport previewFe from '@blaze-cms/plugin-preview-fe';\nimport authFe from '@blaze-cms/plugin-auth-fe';\nimport structuredDataFe from '@blaze-cms/plugin-structured-data-fe';\n\nconst plugins = new Map();\n\nplugins.set(pageBuilder, {});\nplugins.set(gtm, {});\nplugins.set(chart, {});\nplugins.set(googleMaps, {});\nplugins.set(previewFe, {});\nplugins.set(authFe, {});\nplugins.set(structuredDataFe, {\n authenticatedBotHeaders: ['x-amzn-waf-googlebot']\n});\n\nconst apollo = {\n uri: process.env.BLAZE_GRAPHQL_URI,\n loadEntitiesInBrowser: false\n};\n\nexport default { plugins, apollo };\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,mCAAmC;AAC3D,OAAOC,GAAG,MAAM,0BAA0B;AAC1C,OAAOC,KAAK,MAAM,yBAAyB;AAC3C,OAAOC,UAAU,MAAM,kCAAkC;AACzD,OAAOC,SAAS,MAAM,8BAA8B;AACpD,OAAOC,MAAM,MAAM,2BAA2B;AAC9C,OAAOC,gBAAgB,MAAM,sCAAsC;AAEnE,MAAMC,OAAO,GAAG,IAAIC,GAAG,CAAC,CAAC;AAEzBD,OAAO,CAACE,GAAG,CAACT,WAAW,EAAE,CAAC,CAAC,CAAC;AAC5BO,OAAO,CAACE,GAAG,CAACR,GAAG,EAAE,CAAC,CAAC,CAAC;AACpBM,OAAO,CAACE,GAAG,CAACP,KAAK,EAAE,CAAC,CAAC,CAAC;AACtBK,OAAO,CAACE,GAAG,CAACN,UAAU,EAAE,CAAC,CAAC,CAAC;AAC3BI,OAAO,CAACE,GAAG,CAACL,SAAS,EAAE,CAAC,CAAC,CAAC;AAC1BG,OAAO,CAACE,GAAG,CAACJ,MAAM,EAAE,CAAC,CAAC,CAAC;AACvBE,OAAO,CAACE,GAAG,CAACH,gBAAgB,EAAE;EAC5BI,uBAAuB,EAAE,CAAC,sBAAsB;AAClD,CAAC,CAAC;AAEF,MAAMC,MAAM,GAAG;EACbC,GAAG,EAAEC,OAAO,CAACC,GAAG,CAACC,iBAAiB;EAClCC,qBAAqB,EAAE;AACzB,CAAC;AAED,eAAe;EAAET,OAAO;EAAEI;AAAO,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"blaze.config.js","names":["pageBuilder","gtm","chart","googleMaps","previewFe","authFe","structuredDataFe","translationFe","plugins","Map","set","authenticatedBotHeaders","apollo","uri","process","env","BLAZE_GRAPHQL_URI","loadEntitiesInBrowser"],"sources":["../src/blaze.config.js"],"sourcesContent":["import pageBuilder from '@blaze-cms/plugin-page-builder-fe';\nimport gtm from '@blaze-cms/plugin-gtm-fe';\nimport chart from '@blaze-cms/plugin-chart';\nimport googleMaps from '@blaze-cms/plugin-google-maps-fe';\nimport previewFe from '@blaze-cms/plugin-preview-fe';\nimport authFe from '@blaze-cms/plugin-auth-fe';\nimport structuredDataFe from '@blaze-cms/plugin-structured-data-fe';\nimport translationFe from '@blaze-cms/plugin-translation-fe';\n\nconst plugins = new Map();\nplugins.set(translationFe, {});\nplugins.set(pageBuilder, {});\nplugins.set(gtm, {});\nplugins.set(chart, {});\nplugins.set(googleMaps, {});\nplugins.set(previewFe, {});\nplugins.set(authFe, {});\n\nplugins.set(structuredDataFe, {\n authenticatedBotHeaders: ['x-amzn-waf-googlebot']\n});\n\nconst apollo = {\n uri: process.env.BLAZE_GRAPHQL_URI,\n loadEntitiesInBrowser: false\n};\n\nexport default { plugins, apollo };\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,mCAAmC;AAC3D,OAAOC,GAAG,MAAM,0BAA0B;AAC1C,OAAOC,KAAK,MAAM,yBAAyB;AAC3C,OAAOC,UAAU,MAAM,kCAAkC;AACzD,OAAOC,SAAS,MAAM,8BAA8B;AACpD,OAAOC,MAAM,MAAM,2BAA2B;AAC9C,OAAOC,gBAAgB,MAAM,sCAAsC;AACnE,OAAOC,aAAa,MAAM,kCAAkC;AAE5D,MAAMC,OAAO,GAAG,IAAIC,GAAG,CAAC,CAAC;AACzBD,OAAO,CAACE,GAAG,CAACH,aAAa,EAAE,CAAC,CAAC,CAAC;AAC9BC,OAAO,CAACE,GAAG,CAACV,WAAW,EAAE,CAAC,CAAC,CAAC;AAC5BQ,OAAO,CAACE,GAAG,CAACT,GAAG,EAAE,CAAC,CAAC,CAAC;AACpBO,OAAO,CAACE,GAAG,CAACR,KAAK,EAAE,CAAC,CAAC,CAAC;AACtBM,OAAO,CAACE,GAAG,CAACP,UAAU,EAAE,CAAC,CAAC,CAAC;AAC3BK,OAAO,CAACE,GAAG,CAACN,SAAS,EAAE,CAAC,CAAC,CAAC;AAC1BI,OAAO,CAACE,GAAG,CAACL,MAAM,EAAE,CAAC,CAAC,CAAC;AAEvBG,OAAO,CAACE,GAAG,CAACJ,gBAAgB,EAAE;EAC5BK,uBAAuB,EAAE,CAAC,sBAAsB;AAClD,CAAC,CAAC;AAEF,MAAMC,MAAM,GAAG;EACbC,GAAG,EAAEC,OAAO,CAACC,GAAG,CAACC,iBAAiB;EAClCC,qBAAqB,EAAE;AACzB,CAAC;AAED,eAAe;EAAET,OAAO;EAAEI;AAAO,CAAC","ignoreList":[]}
@@ -11,7 +11,7 @@ import checkPreviewUrl from './check-preview-url';
11
11
  import handleStaticRoutes from './handle-static-routes';
12
12
  import getPageData from './get-page-data';
13
13
  import getRootSelectorClasses from './get-root-selector-classes';
14
- const getRootClassesLimit = () => Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT);
14
+ const getRootClassesLimit = () => Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT || 1);
15
15
  const checkUrl = async props => {
16
16
  const {
17
17
  asPath,
@@ -1 +1 @@
1
- {"version":3,"file":"check-url.js","names":["parseUrl","getUnpublishedEntityName","checkAccessToken","HTTPS","DOUBLE_SLASH","COLON","NOT_FOUND_STATUS_CODE","BLAZE_X_FRAME_OPTIONS_DEFAULT","ROUTE_REGEX","ERROR_URLS","checkUrlQuery","checkParent","checkPreviewUrl","handleStaticRoutes","getPageData","getRootSelectorClasses","getRootClassesLimit","Number","process","env","BLAZE_ROOT_SELECTOR_CLASSES_LIMIT","checkUrl","props","asPath","apolloClient","res","req","query","blazeApp","disableSsr","fullUrl","getFullUrl","url","BLAZE_STATUS_URL","isStatusPage","handler","getHandler","setHeader","BLAZE_X_FRAME_OPTIONS","getHeader","BLAZE_CACHE_CONTROL_HEADER","previewData","_objectSpread","Object","keys","cache","extract","length","getPreviewData","urlCheckOptions","result","doUrlCheck","handle404Error","pageData","rootSelectorClasses","isPreview","getHost","headers","BLAZE_FRONTEND_HOST","host","location","protocol","hostname","port","window","urlPort","args","errorCheckCode","test","Error","data","itemId","itemEntity","urlTo","variables","setCustomCacheControlHeaders","handleRedirect","events","emit","message","statusCode","err","handleUrlError","handleError","error","networkError","writeHead","write","end","graphQLErrors","errorCode","errorMessage","customError","redirectUrl","BLAZE_DISABLE_REDIRECT_WITH_QUERY","queryString","split","doRedirect","cacheControlMaxAge","Location","href","redirecting","custom404","parentUrl","parentPATH"],"sources":["../../src/helpers/check-url.js"],"sourcesContent":["import { parseUrl } from 'query-string';\nimport { getUnpublishedEntityName } from '@blaze-cms/react-page-builder';\nimport { checkAccessToken } from '@blaze-cms/core-auth-ui';\nimport {\n HTTPS,\n DOUBLE_SLASH,\n COLON,\n NOT_FOUND_STATUS_CODE,\n BLAZE_X_FRAME_OPTIONS_DEFAULT,\n ROUTE_REGEX,\n ERROR_URLS\n} from '../constants';\nimport { checkUrlQuery } from '../application/query';\nimport checkParent from './check-parent';\nimport checkPreviewUrl from './check-preview-url';\nimport handleStaticRoutes from './handle-static-routes';\nimport getPageData from './get-page-data';\nimport getRootSelectorClasses from './get-root-selector-classes';\n\nconst getRootClassesLimit = () => Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT);\n\nconst checkUrl = async props => {\n const { asPath, apolloClient, res, req, query, blazeApp, disableSsr } = props;\n const fullUrl = getFullUrl(req, asPath);\n const { url } = parseUrl(asPath);\n\n if (process.env.BLAZE_STATUS_URL && url === process.env.BLAZE_STATUS_URL) {\n return { isStatusPage: true };\n }\n\n if (res) {\n const handler = handleStaticRoutes.getHandler(asPath);\n\n res.setHeader(\n 'X-Frame-Options',\n process.env.BLAZE_X_FRAME_OPTIONS || BLAZE_X_FRAME_OPTIONS_DEFAULT\n );\n\n if (!res.getHeader('Cache-Control')) {\n res.setHeader('Cache-Control', process.env.BLAZE_CACHE_CONTROL_HEADER || ' ');\n }\n\n if (handler) {\n return handler(props);\n }\n }\n\n const previewData = checkPreviewUrl(url, query);\n\n if (!previewData && disableSsr) return { disableSsr: true };\n\n await checkAccessToken(apolloClient, {\n ...props,\n disableSsr: !Object.keys(apolloClient.cache.extract()).length // empty cache means SSR was disabled\n });\n\n if (previewData) return getPreviewData(previewData, apolloClient);\n const urlCheckOptions = { asPath, url, apolloClient, res };\n const result = await doUrlCheck({\n ...urlCheckOptions,\n handle404Error: true,\n blazeApp\n });\n return { ...result, fullUrl } || {};\n};\n\nconst getPreviewData = async (previewData, apolloClient) => {\n const result = await getPageData({ ...previewData, apolloClient });\n const { pageData: { url } = {} } = result;\n const rootSelectorClasses = getRootSelectorClasses(url, getRootClassesLimit());\n return { ...previewData, rootSelectorClasses, ...result, isPreview: true };\n};\n\nconst getHost = ({ headers = {} }) =>\n process.env.BLAZE_FRONTEND_HOST ||\n headers['x-request-host'] ||\n headers['x-forwarded-host'] ||\n headers.host;\n\nconst getFullUrl = (req, asPath) => {\n if (req) {\n return `${HTTPS}${getHost(req)}${asPath}`;\n }\n const {\n location: { protocol, hostname, port }\n } = window;\n const urlPort = port ? `${COLON}${port}` : '';\n\n return `${protocol}${DOUBLE_SLASH}${hostname}${urlPort}${asPath}`;\n};\n\nconst doUrlCheck = async args => {\n const { asPath, url, apolloClient, res, blazeApp, errorCheckCode = false } = args;\n try {\n if (!ROUTE_REGEX.test(url)) {\n throw Error('Invalid URL');\n }\n const { data: { checkUrl: { itemId, itemEntity, urlTo, pageData = {} } = {} } = {} } =\n await apolloClient.query({\n query: checkUrlQuery,\n variables: { url }\n });\n\n setCustomCacheControlHeaders(pageData, res);\n\n if (urlTo && (urlTo !== url || errorCheckCode)) {\n return handleRedirect({ errorCheckCode, url, urlTo, asPath, res });\n }\n const rootSelectorClasses = getRootSelectorClasses(url, getRootClassesLimit());\n\n if (errorCheckCode) {\n blazeApp.events.emit('monitor:log', { message: `Serving custom ${errorCheckCode} page` });\n if (res) res.statusCode = errorCheckCode;\n }\n\n return {\n pageData,\n rootSelectorClasses,\n itemId,\n itemEntity: getUnpublishedEntityName(itemEntity)\n };\n } catch (err) {\n return handleUrlError(err, args);\n }\n};\n\nconst handleError = (err, res, handle404Error, blazeApp) => {\n blazeApp.events.emit('monitor:log', { error: err });\n if (!res) return {};\n if (err.networkError) {\n res.writeHead(500, { 'Content-Type': 'text/plain' });\n res.write('500 Internal Server Error\\n');\n res.end();\n } else if (handle404Error && err.graphQLErrors && err.graphQLErrors.length) {\n res.statusCode = NOT_FOUND_STATUS_CODE;\n return { errorCode: NOT_FOUND_STATUS_CODE };\n }\n\n return {};\n};\n\nfunction handleRedirect({ errorCheckCode, url, urlTo, asPath, res }) {\n if (errorCheckCode) {\n const errorMessage = `Cannot redirect ${url}`;\n const customError = new Error(errorMessage);\n customError.graphQLErrors = [errorMessage];\n throw customError;\n }\n let redirectUrl = urlTo;\n if (process.env.BLAZE_DISABLE_REDIRECT_WITH_QUERY !== 'true') {\n const queryString = asPath.split('?')[1];\n redirectUrl = queryString ? `${urlTo}?${queryString}` : urlTo;\n }\n\n return doRedirect(res, redirectUrl);\n}\n\nfunction setCustomCacheControlHeaders(pageData, res) {\n const { cacheControlMaxAge = null } = pageData || {};\n\n if (res && cacheControlMaxAge !== null && cacheControlMaxAge >= 0) {\n res.setHeader('Cache-Control', `max-age=${cacheControlMaxAge}`);\n }\n}\n\nfunction doRedirect(res, redirectUrl) {\n if (res) {\n res.writeHead(301, { Location: redirectUrl });\n res.end();\n } else {\n window.location.href = redirectUrl;\n }\n\n return { redirecting: true };\n}\n\nasync function handleUrlError(err, args) {\n const { asPath, res, handle404Error, blazeApp, errorCheckCode } = args;\n if (!err.graphQLErrors || !err.graphQLErrors.length) {\n return handleError(err, res, handle404Error, blazeApp);\n }\n\n if (!errorCheckCode) {\n const result = await doUrlCheck({\n ...args,\n url: ERROR_URLS.custom404,\n errorCheckCode: NOT_FOUND_STATUS_CODE\n });\n\n if (handle404Error) {\n const parentUrl = checkParent(asPath);\n if (parentUrl) {\n return doRedirect(res, parentUrl);\n }\n }\n return result;\n }\n\n const parentPATH = checkParent(asPath);\n if (handle404Error && parentPATH) {\n return doRedirect(res, parentPATH);\n }\n\n return handleError(err, res, handle404Error, blazeApp);\n}\n\nexport default checkUrl;\n"],"mappings":";;;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,wBAAwB,QAAQ,+BAA+B;AACxE,SAASC,gBAAgB,QAAQ,yBAAyB;AAC1D,SACEC,KAAK,EACLC,YAAY,EACZC,KAAK,EACLC,qBAAqB,EACrBC,6BAA6B,EAC7BC,WAAW,EACXC,UAAU,QACL,cAAc;AACrB,SAASC,aAAa,QAAQ,sBAAsB;AACpD,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,eAAe,MAAM,qBAAqB;AACjD,OAAOC,kBAAkB,MAAM,wBAAwB;AACvD,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,sBAAsB,MAAM,6BAA6B;AAEhE,MAAMC,mBA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AAK,CAAC;AAC9B;AAEA,eAAenB,cAAcA,CAACD,GAAG,EAAEf,IAAI,EAAE;EACvC,MAAM;IAAE3C,MAAM;IAAEE,GAAG;IAAE2B,cAAc;IAAExB,QAAQ;IAAEuC;EAAe,CAAC,GAAGD,IAAI;EACtE,IAAI,CAACe,GAAG,CAACQ,aAAa,IAAI,CAACR,GAAG,CAACQ,aAAa,CAAC1C,MAAM,EAAE;IACnD,OAAOoC,WAAW,CAACF,GAAG,EAAExD,GAAG,EAAE2B,cAAc,EAAExB,QAAQ,CAAC;EACxD;EAEA,IAAI,CAACuC,cAAc,EAAE;IACnB,MAAMjB,MAAM,GAAG,MAAMC,UAAU,CAAAT,aAAA,CAAAA,aAAA,KAC1BwB,IAAI;MACPlC,GAAG,EAAEvB,UAAU,CAAC6F,SAAS;MACzBnC,cAAc,EAAE7D;IAAqB,EACtC,CAAC;IAEF,IAAI8C,cAAc,EAAE;MAClB,MAAMmD,SAAS,GAAG5F,WAAW,CAACY,MAAM,CAAC;MACrC,IAAIgF,SAAS,EAAE;QACb,OAAON,UAAU,CAACxE,GAAG,EAAE8E,SAAS,CAAC;MACnC;IACF;IACA,OAAOrD,MAAM;EACf;EAEA,MAAMsD,UAAU,GAAG7F,WAAW,CAACY,MAAM,CAAC;EACtC,IAAI6B,cAAc,IAAIoD,UAAU,EAAE;IAChC,OAAOP,UAAU,CAACxE,GAAG,EAAE+E,UAAU,CAAC;EACpC;EAEA,OAAOrB,WAAW,CAACF,GAAG,EAAExD,GAAG,EAAE2B,cAAc,EAAExB,QAAQ,CAAC;AACxD;AAEA,eAAeP,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"check-url.js","names":["parseUrl","getUnpublishedEntityName","checkAccessToken","HTTPS","DOUBLE_SLASH","COLON","NOT_FOUND_STATUS_CODE","BLAZE_X_FRAME_OPTIONS_DEFAULT","ROUTE_REGEX","ERROR_URLS","checkUrlQuery","checkParent","checkPreviewUrl","handleStaticRoutes","getPageData","getRootSelectorClasses","getRootClassesLimit","Number","process","env","BLAZE_ROOT_SELECTOR_CLASSES_LIMIT","checkUrl","props","asPath","apolloClient","res","req","query","blazeApp","disableSsr","fullUrl","getFullUrl","url","BLAZE_STATUS_URL","isStatusPage","handler","getHandler","setHeader","BLAZE_X_FRAME_OPTIONS","getHeader","BLAZE_CACHE_CONTROL_HEADER","previewData","_objectSpread","Object","keys","cache","extract","length","getPreviewData","urlCheckOptions","result","doUrlCheck","handle404Error","pageData","rootSelectorClasses","isPreview","getHost","headers","BLAZE_FRONTEND_HOST","host","location","protocol","hostname","port","window","urlPort","args","errorCheckCode","test","Error","data","itemId","itemEntity","urlTo","variables","setCustomCacheControlHeaders","handleRedirect","events","emit","message","statusCode","err","handleUrlError","handleError","error","networkError","writeHead","write","end","graphQLErrors","errorCode","errorMessage","customError","redirectUrl","BLAZE_DISABLE_REDIRECT_WITH_QUERY","queryString","split","doRedirect","cacheControlMaxAge","Location","href","redirecting","custom404","parentUrl","parentPATH"],"sources":["../../src/helpers/check-url.js"],"sourcesContent":["import { parseUrl } from 'query-string';\nimport { getUnpublishedEntityName } from '@blaze-cms/react-page-builder';\nimport { checkAccessToken } from '@blaze-cms/core-auth-ui';\nimport {\n HTTPS,\n DOUBLE_SLASH,\n COLON,\n NOT_FOUND_STATUS_CODE,\n BLAZE_X_FRAME_OPTIONS_DEFAULT,\n ROUTE_REGEX,\n ERROR_URLS\n} from '../constants';\nimport { checkUrlQuery } from '../application/query';\nimport checkParent from './check-parent';\nimport checkPreviewUrl from './check-preview-url';\nimport handleStaticRoutes from './handle-static-routes';\nimport getPageData from './get-page-data';\nimport getRootSelectorClasses from './get-root-selector-classes';\n\nconst getRootClassesLimit = () => Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT || 1);\n\nconst checkUrl = async props => {\n const { asPath, apolloClient, res, req, query, blazeApp, disableSsr } = props;\n const fullUrl = getFullUrl(req, asPath);\n const { url } = parseUrl(asPath);\n\n if (process.env.BLAZE_STATUS_URL && url === process.env.BLAZE_STATUS_URL) {\n return { isStatusPage: true };\n }\n\n if (res) {\n const handler = handleStaticRoutes.getHandler(asPath);\n\n res.setHeader(\n 'X-Frame-Options',\n process.env.BLAZE_X_FRAME_OPTIONS || BLAZE_X_FRAME_OPTIONS_DEFAULT\n );\n\n if (!res.getHeader('Cache-Control')) {\n res.setHeader('Cache-Control', process.env.BLAZE_CACHE_CONTROL_HEADER || ' ');\n }\n\n if (handler) {\n return handler(props);\n }\n }\n\n const previewData = checkPreviewUrl(url, query);\n\n if (!previewData && disableSsr) return { disableSsr: true };\n\n await checkAccessToken(apolloClient, {\n ...props,\n disableSsr: !Object.keys(apolloClient.cache.extract()).length // empty cache means SSR was disabled\n });\n\n if (previewData) return getPreviewData(previewData, apolloClient);\n const urlCheckOptions = { asPath, url, apolloClient, res };\n const result = await doUrlCheck({\n ...urlCheckOptions,\n handle404Error: true,\n blazeApp\n });\n return { ...result, fullUrl } || {};\n};\n\nconst getPreviewData = async (previewData, apolloClient) => {\n const result = await getPageData({ ...previewData, apolloClient });\n const { pageData: { url } = {} } = result;\n const rootSelectorClasses = getRootSelectorClasses(url, getRootClassesLimit());\n return { ...previewData, rootSelectorClasses, ...result, isPreview: true };\n};\n\nconst getHost = ({ headers = {} }) =>\n process.env.BLAZE_FRONTEND_HOST ||\n headers['x-request-host'] ||\n headers['x-forwarded-host'] ||\n headers.host;\n\nconst getFullUrl = (req, asPath) => {\n if (req) {\n return `${HTTPS}${getHost(req)}${asPath}`;\n }\n const {\n location: { protocol, hostname, port }\n } = window;\n const urlPort = port ? `${COLON}${port}` : '';\n\n return `${protocol}${DOUBLE_SLASH}${hostname}${urlPort}${asPath}`;\n};\n\nconst doUrlCheck = async args => {\n const { asPath, url, apolloClient, res, blazeApp, errorCheckCode = false } = args;\n try {\n if (!ROUTE_REGEX.test(url)) {\n throw Error('Invalid URL');\n }\n const { data: { checkUrl: { itemId, itemEntity, urlTo, pageData = {} } = {} } = {} } =\n await apolloClient.query({\n query: checkUrlQuery,\n variables: { url }\n });\n\n setCustomCacheControlHeaders(pageData, res);\n\n if (urlTo && (urlTo !== url || errorCheckCode)) {\n return handleRedirect({ errorCheckCode, url, urlTo, asPath, res });\n }\n const rootSelectorClasses = getRootSelectorClasses(url, getRootClassesLimit());\n\n if (errorCheckCode) {\n blazeApp.events.emit('monitor:log', { message: `Serving custom ${errorCheckCode} page` });\n if (res) res.statusCode = errorCheckCode;\n }\n\n return {\n pageData,\n rootSelectorClasses,\n itemId,\n itemEntity: getUnpublishedEntityName(itemEntity)\n };\n } catch (err) {\n return handleUrlError(err, args);\n }\n};\n\nconst handleError = (err, res, handle404Error, blazeApp) => {\n blazeApp.events.emit('monitor:log', { error: err });\n if (!res) return {};\n if (err.networkError) {\n res.writeHead(500, { 'Content-Type': 'text/plain' });\n res.write('500 Internal Server Error\\n');\n res.end();\n } else if (handle404Error && err.graphQLErrors && err.graphQLErrors.length) {\n res.statusCode = NOT_FOUND_STATUS_CODE;\n return { errorCode: NOT_FOUND_STATUS_CODE };\n }\n\n return {};\n};\n\nfunction handleRedirect({ errorCheckCode, url, urlTo, asPath, res }) {\n if (errorCheckCode) {\n const errorMessage = `Cannot redirect ${url}`;\n const customError = new Error(errorMessage);\n customError.graphQLErrors = [errorMessage];\n throw customError;\n }\n let redirectUrl = urlTo;\n if (process.env.BLAZE_DISABLE_REDIRECT_WITH_QUERY !== 'true') {\n const queryString = asPath.split('?')[1];\n redirectUrl = queryString ? `${urlTo}?${queryString}` : urlTo;\n }\n\n return doRedirect(res, redirectUrl);\n}\n\nfunction setCustomCacheControlHeaders(pageData, res) {\n const { cacheControlMaxAge = null } = pageData || {};\n\n if (res && cacheControlMaxAge !== null && cacheControlMaxAge >= 0) {\n res.setHeader('Cache-Control', `max-age=${cacheControlMaxAge}`);\n }\n}\n\nfunction doRedirect(res, redirectUrl) {\n if (res) {\n res.writeHead(301, { Location: redirectUrl });\n res.end();\n } else {\n window.location.href = redirectUrl;\n }\n\n return { redirecting: true };\n}\n\nasync function handleUrlError(err, args) {\n const { asPath, res, handle404Error, blazeApp, errorCheckCode } = args;\n if (!err.graphQLErrors || !err.graphQLErrors.length) {\n return handleError(err, res, handle404Error, blazeApp);\n }\n\n if (!errorCheckCode) {\n const result = await doUrlCheck({\n ...args,\n url: ERROR_URLS.custom404,\n errorCheckCode: NOT_FOUND_STATUS_CODE\n });\n\n if (handle404Error) {\n const parentUrl = checkParent(asPath);\n if (parentUrl) {\n return doRedirect(res, parentUrl);\n }\n }\n return result;\n }\n\n const parentPATH = checkParent(asPath);\n if (handle404Error && parentPATH) {\n return doRedirect(res, parentPATH);\n }\n\n return handleError(err, res, handle404Error, blazeApp);\n}\n\nexport default checkUrl;\n"],"mappings":";;;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,wBAAwB,QAAQ,+BAA+B;AACxE,SAASC,gBAAgB,QAAQ,yBAAyB;AAC1D,SACEC,KAAK,EACLC,YAAY,EACZC,KAAK,EACLC,qBAAqB,EACrBC,6BAA6B,EAC7BC,WAAW,EACXC,UAAU,QACL,cAAc;AACrB,SAASC,aAAa,QAAQ,sBAAsB;AACpD,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,eAAe,MAAM,qBAAqB;AACjD,OAAOC,kBAAkB,MAAM,wBAAwB;AACvD,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,sBAAsB,MAAM,6BAA6B;AAEhE,MAAMC,mBAAmB,GAAGA,CAAA,KAAMC,MAAM,CAACC,OAAO,CAACC,GAAG,CAACC,iCAAiC,IAAI,CAAC,CAAC;AAE5F,MAAMC,QAAQ,GAAG,MAAMC,KAAK,IAAI;EAC9B,MAAM;IAAEC,MAAM;IAAEC,YAAY;IAAEC,GAAG;IAAEC,GAAG;IAAEC,KAAK;IAAEC,QAAQ;IAAEC;EAAW,CAAC,GAAGP,KAAK;EAC7E,MAAMQ,OAAO,GAAGC,UAAU,CAACL,GAAG,EAAEH,MAAM,CAAC;EACvC,MAAM;IAAES;EA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CAAC;EACxD;EAEA,IAAI,CAACuC,cAAc,EAAE;IACnB,MAAMjB,MAAM,GAAG,MAAMC,UAAU,CAAAT,aAAA,CAAAA,aAAA,KAC1BwB,IAAI;MACPlC,GAAG,EAAEvB,UAAU,CAAC6F,SAAS;MACzBnC,cAAc,EAAE7D;IAAqB,EACtC,CAAC;IAEF,IAAI8C,cAAc,EAAE;MAClB,MAAMmD,SAAS,GAAG5F,WAAW,CAACY,MAAM,CAAC;MACrC,IAAIgF,SAAS,EAAE;QACb,OAAON,UAAU,CAACxE,GAAG,EAAE8E,SAAS,CAAC;MACnC;IACF;IACA,OAAOrD,MAAM;EACf;EAEA,MAAMsD,UAAU,GAAG7F,WAAW,CAACY,MAAM,CAAC;EACtC,IAAI6B,cAAc,IAAIoD,UAAU,EAAE;IAChC,OAAOP,UAAU,CAACxE,GAAG,EAAE+E,UAAU,CAAC;EACpC;EAEA,OAAOrB,WAAW,CAACF,GAAG,EAAExD,GAAG,EAAE2B,cAAc,EAAExB,QAAQ,CAAC;AACxD;AAEA,eAAeP,QAAQ","ignoreList":[]}
@@ -3,10 +3,12 @@ import PropTypes from 'prop-types';
3
3
  import Document, { Html, Head } from 'next/document';
4
4
  import DocumentBody from './DocumentBody';
5
5
  import { renderAppleTags } from '../../helpers';
6
+ const DEFAULT_LANG = (process.env.BLAZE_TRANSLATION_LANGUAGE || 'en').replace('_', '-');
6
7
  const BlazeDocument = ({
7
- children
8
+ children,
9
+ lang = DEFAULT_LANG
8
10
  }) => /*#__PURE__*/React.createElement(Html, {
9
- lang: "en"
11
+ lang: lang
10
12
  }, /*#__PURE__*/React.createElement(Head, null, /*#__PURE__*/React.createElement("link", {
11
13
  rel: "icon",
12
14
  href: "/static/img/favicon.png",
@@ -15,7 +17,11 @@ const BlazeDocument = ({
15
17
  BlazeDocument.Document = Document;
16
18
  BlazeDocument.Body = DocumentBody;
17
19
  BlazeDocument.propTypes = {
18
- children: PropTypes.object.isRequired
20
+ children: PropTypes.object.isRequired,
21
+ lang: PropTypes.string
22
+ };
23
+ BlazeDocument.defaultProps = {
24
+ lang: DEFAULT_LANG
19
25
  };
20
26
  export default BlazeDocument;
21
27
  //# sourceMappingURL=_document.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_document.js","names":["React","PropTypes","Document","Html","Head","DocumentBody","renderAppleTags","BlazeDocument","children","createElement","lang","rel","href","type","Body","propTypes","object","isRequired"],"sources":["../../../src/pages/document/_document.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Document, { Html, Head } from 'next/document';\nimport DocumentBody from './DocumentBody';\nimport { renderAppleTags } from '../../helpers';\n\nconst BlazeDocument = ({ children }) => (\n <Html lang=\"en\">\n <Head>\n <link rel=\"icon\" href=\"/static/img/favicon.png\" type=\"image/x-icon\" />\n {renderAppleTags()}\n </Head>\n {children}\n </Html>\n);\n\nBlazeDocument.Document = Document;\nBlazeDocument.Body = DocumentBody;\n\nBlazeDocument.propTypes = {\n children: PropTypes.object.isRequired\n};\n\nexport default BlazeDocument;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,QAAQ,IAAIC,IAAI,EAAEC,IAAI,QAAQ,eAAe;AACpD,OAAOC,YAAY,MAAM,gBAAgB;AACzC,SAASC,eAAe,QAAQ,eAAe;AAE/C,MAAMC,aAAa,GAAGA,CAAC;EAAEC;AAAS,CAAC,kBACjCR,KAAA,CAAAS,aAAA,CAACN,IAAI;EAACO,IAAI,EAAC;AAAI,gBACbV,KAAA,CAAAS,aAAA,CAACL,IAAI,qBACHJ,KAAA,CAAAS,aAAA;EAAME,GAAG,EAAC,MAAM;EAACC,IAAI,EAAC,yBAAyB;EAACC,IAAI,EAAC;AAAc,CAAE,CAAC,EACrEP,eAAe,CAAC,CACb,CAAC,EACNE,QACG,CACP;AAEDD,aAAa,CAACL,QAAQ,GAAGA,QAAQ;AACjCK,aAAa,CAACO,IAAI,GAAGT,YAAY;AAEjCE,aAAa,CAACQ,SAAS,GAAG;EACxBP,QAAQ,EAAEP,SAAS,CAACe,MAAM,CAACC;AAC7B,CAAC;AAED,eAAeV,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"_document.js","names":["React","PropTypes","Document","Html","Head","DocumentBody","renderAppleTags","DEFAULT_LANG","process","env","BLAZE_TRANSLATION_LANGUAGE","replace","BlazeDocument","children","lang","createElement","rel","href","type","Body","propTypes","object","isRequired","string","defaultProps"],"sources":["../../../src/pages/document/_document.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Document, { Html, Head } from 'next/document';\nimport DocumentBody from './DocumentBody';\nimport { renderAppleTags } from '../../helpers';\n\nconst DEFAULT_LANG = (process.env.BLAZE_TRANSLATION_LANGUAGE || 'en').replace('_', '-');\n\nconst BlazeDocument = ({ children, lang = DEFAULT_LANG }) => (\n <Html lang={lang}>\n <Head>\n <link rel=\"icon\" href=\"/static/img/favicon.png\" type=\"image/x-icon\" />\n {renderAppleTags()}\n </Head>\n {children}\n </Html>\n);\n\nBlazeDocument.Document = Document;\nBlazeDocument.Body = DocumentBody;\n\nBlazeDocument.propTypes = {\n children: PropTypes.object.isRequired,\n lang: PropTypes.string\n};\n\nBlazeDocument.defaultProps = {\n lang: DEFAULT_LANG\n};\n\nexport default BlazeDocument;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,QAAQ,IAAIC,IAAI,EAAEC,IAAI,QAAQ,eAAe;AACpD,OAAOC,YAAY,MAAM,gBAAgB;AACzC,SAASC,eAAe,QAAQ,eAAe;AAE/C,MAAMC,YAAY,GAAG,CAACC,OAAO,CAACC,GAAG,CAACC,0BAA0B,IAAI,IAAI,EAAEC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;AAEvF,MAAMC,aAAa,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,IAAI,GAAGP;AAAa,CAAC,kBACtDP,KAAA,CAAAe,aAAA,CAACZ,IAAI;EAACW,IAAI,EAAEA;AAAK,gBACfd,KAAA,CAAAe,aAAA,CAACX,IAAI,qBACHJ,KAAA,CAAAe,aAAA;EAAMC,GAAG,EAAC,MAAM;EAACC,IAAI,EAAC,yBAAyB;EAACC,IAAI,EAAC;AAAc,CAAE,CAAC,EACrEZ,eAAe,CAAC,CACb,CAAC,EACNO,QACG,CACP;AAEDD,aAAa,CAACV,QAAQ,GAAGA,QAAQ;AACjCU,aAAa,CAACO,IAAI,GAAGd,YAAY;AAEjCO,aAAa,CAACQ,SAAS,GAAG;EACxBP,QAAQ,EAAEZ,SAAS,CAACoB,MAAM,CAACC,UAAU;EACrCR,IAAI,EAAEb,SAAS,CAACsB;AAClB,CAAC;AAEDX,aAAa,CAACY,YAAY,GAAG;EAC3BV,IAAI,EAAEP;AACR,CAAC;AAED,eAAeK,aAAa","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaze-cms/nextjs-tools",
3
- "version": "0.146.0-node18-tooltips.37",
3
+ "version": "0.146.0-node18-core-styles-tooltips.46",
4
4
  "description": "Blaze nextjs tools",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-es/index.js",
@@ -28,22 +28,23 @@
28
28
  "license": "GPL-3.0",
29
29
  "dependencies": {
30
30
  "@apollo/client": "3.13.8",
31
- "@blaze-cms/core-auth-ui": "0.146.0-node18-tooltips.32",
32
- "@blaze-cms/core-errors": "0.146.0-node18-tooltips.0",
33
- "@blaze-cms/core-errors-ui": "0.146.0-node18-tooltips.0",
34
- "@blaze-cms/core-ui": "0.146.0-node18-tooltips.32",
35
- "@blaze-cms/nextjs-components": "0.146.0-node18-tooltips.32",
36
- "@blaze-cms/plugin-auth-fe": "0.146.0-node18-tooltips.32",
37
- "@blaze-cms/plugin-auth-local-fe": "0.146.0-node18-tooltips.32",
38
- "@blaze-cms/plugin-chart": "0.146.0-node18-tooltips.19",
39
- "@blaze-cms/plugin-google-maps-fe": "0.146.0-node18-tooltips.37",
40
- "@blaze-cms/plugin-gtm-fe": "0.146.0-node18-tooltips.37",
41
- "@blaze-cms/plugin-page-builder-fe": "0.146.0-node18-tooltips.37",
42
- "@blaze-cms/plugin-preview-fe": "0.146.0-node18-tooltips.32",
43
- "@blaze-cms/plugin-search-ui": "0.146.0-node18-tooltips.37",
44
- "@blaze-cms/plugin-structured-data-fe": "0.146.0-node18-tooltips.25",
45
- "@blaze-cms/react-page-builder": "0.146.0-node18-tooltips.37",
46
- "@blaze-cms/setup-ui": "0.146.0-node18-tooltips.0",
31
+ "@blaze-cms/core-auth-ui": "0.146.0-node18-core-styles-tooltips.46",
32
+ "@blaze-cms/core-errors": "0.146.0-node18-core-styles-tooltips.46",
33
+ "@blaze-cms/core-errors-ui": "0.146.0-node18-core-styles-tooltips.46",
34
+ "@blaze-cms/core-ui": "0.146.0-node18-core-styles-tooltips.46",
35
+ "@blaze-cms/nextjs-components": "0.146.0-node18-core-styles-tooltips.46",
36
+ "@blaze-cms/plugin-auth-fe": "0.146.0-node18-core-styles-tooltips.46",
37
+ "@blaze-cms/plugin-auth-local-fe": "0.146.0-node18-core-styles-tooltips.46",
38
+ "@blaze-cms/plugin-chart": "0.146.0-node18-core-styles-tooltips.46",
39
+ "@blaze-cms/plugin-google-maps-fe": "0.146.0-node18-core-styles-tooltips.46",
40
+ "@blaze-cms/plugin-gtm-fe": "0.146.0-node18-core-styles-tooltips.46",
41
+ "@blaze-cms/plugin-page-builder-fe": "0.146.0-node18-core-styles-tooltips.46",
42
+ "@blaze-cms/plugin-preview-fe": "0.146.0-node18-core-styles-tooltips.46",
43
+ "@blaze-cms/plugin-search-ui": "0.146.0-node18-core-styles-tooltips.46",
44
+ "@blaze-cms/plugin-structured-data-fe": "0.146.0-node18-core-styles-tooltips.46",
45
+ "@blaze-cms/plugin-translation-fe": "0.146.0-node18-core-styles-tooltips.46",
46
+ "@blaze-cms/react-page-builder": "0.146.0-node18-core-styles-tooltips.46",
47
+ "@blaze-cms/setup-ui": "0.146.0-node18-core-styles-tooltips.46",
47
48
  "@blaze-react/switches": "0.8.0-alpha.112",
48
49
  "autoprefixer": "^10.2.3",
49
50
  "core-js": "^3.2.1",
@@ -71,5 +72,5 @@
71
72
  "lib/*",
72
73
  "lib-es/*"
73
74
  ],
74
- "gitHead": "e1ee3c1f0f1a39f2815b751d434342d767d8c99d"
75
+ "gitHead": "424c3c1f446e3cfa3a50106bdb98f4f5eeaed800"
75
76
  }
@@ -5,15 +5,17 @@ import googleMaps from '@blaze-cms/plugin-google-maps-fe';
5
5
  import previewFe from '@blaze-cms/plugin-preview-fe';
6
6
  import authFe from '@blaze-cms/plugin-auth-fe';
7
7
  import structuredDataFe from '@blaze-cms/plugin-structured-data-fe';
8
+ import translationFe from '@blaze-cms/plugin-translation-fe';
8
9
 
9
10
  const plugins = new Map();
10
-
11
+ plugins.set(translationFe, {});
11
12
  plugins.set(pageBuilder, {});
12
13
  plugins.set(gtm, {});
13
14
  plugins.set(chart, {});
14
15
  plugins.set(googleMaps, {});
15
16
  plugins.set(previewFe, {});
16
17
  plugins.set(authFe, {});
18
+
17
19
  plugins.set(structuredDataFe, {
18
20
  authenticatedBotHeaders: ['x-amzn-waf-googlebot']
19
21
  });
@@ -17,7 +17,7 @@ import handleStaticRoutes from './handle-static-routes';
17
17
  import getPageData from './get-page-data';
18
18
  import getRootSelectorClasses from './get-root-selector-classes';
19
19
 
20
- const getRootClassesLimit = () => Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT);
20
+ const getRootClassesLimit = () => Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT || 1);
21
21
 
22
22
  const checkUrl = async props => {
23
23
  const { asPath, apolloClient, res, req, query, blazeApp, disableSsr } = props;
@@ -4,8 +4,10 @@ import Document, { Html, Head } from 'next/document';
4
4
  import DocumentBody from './DocumentBody';
5
5
  import { renderAppleTags } from '../../helpers';
6
6
 
7
- const BlazeDocument = ({ children }) => (
8
- <Html lang="en">
7
+ const DEFAULT_LANG = (process.env.BLAZE_TRANSLATION_LANGUAGE || 'en').replace('_', '-');
8
+
9
+ const BlazeDocument = ({ children, lang = DEFAULT_LANG }) => (
10
+ <Html lang={lang}>
9
11
  <Head>
10
12
  <link rel="icon" href="/static/img/favicon.png" type="image/x-icon" />
11
13
  {renderAppleTags()}
@@ -18,7 +20,12 @@ BlazeDocument.Document = Document;
18
20
  BlazeDocument.Body = DocumentBody;
19
21
 
20
22
  BlazeDocument.propTypes = {
21
- children: PropTypes.object.isRequired
23
+ children: PropTypes.object.isRequired,
24
+ lang: PropTypes.string
25
+ };
26
+
27
+ BlazeDocument.defaultProps = {
28
+ lang: DEFAULT_LANG
22
29
  };
23
30
 
24
31
  export default BlazeDocument;
@@ -4,6 +4,7 @@ exports[`Application query should get check url query 1`] = `
4
4
  Object {
5
5
  "definitions": Array [
6
6
  Object {
7
+ "description": undefined,
7
8
  "directives": Array [],
8
9
  "kind": "OperationDefinition",
9
10
  "name": Object {
@@ -385,6 +386,7 @@ Object {
385
386
  "variableDefinitions": Array [
386
387
  Object {
387
388
  "defaultValue": undefined,
389
+ "description": undefined,
388
390
  "directives": Array [],
389
391
  "kind": "VariableDefinition",
390
392
  "type": Object {
@@ -420,6 +422,7 @@ exports[`Application query should get page query 1`] = `
420
422
  Object {
421
423
  "definitions": Array [
422
424
  Object {
425
+ "description": undefined,
423
426
  "directives": Array [],
424
427
  "kind": "OperationDefinition",
425
428
  "name": Object {
@@ -748,6 +751,7 @@ Object {
748
751
  "variableDefinitions": Array [
749
752
  Object {
750
753
  "defaultValue": undefined,
754
+ "description": undefined,
751
755
  "directives": Array [],
752
756
  "kind": "VariableDefinition",
753
757
  "type": Object {
@@ -783,6 +787,7 @@ exports[`Application query should match get entity schema 1`] = `
783
787
  Object {
784
788
  "definitions": Array [
785
789
  Object {
790
+ "description": undefined,
786
791
  "directives": Array [],
787
792
  "kind": "OperationDefinition",
788
793
  "name": Object {
@@ -864,6 +869,7 @@ Object {
864
869
  "variableDefinitions": Array [
865
870
  Object {
866
871
  "defaultValue": undefined,
872
+ "description": undefined,
867
873
  "directives": Array [],
868
874
  "kind": "VariableDefinition",
869
875
  "type": Object {
@@ -5,6 +5,7 @@ Object {
5
5
  "fileQuery": Object {
6
6
  "definitions": Array [
7
7
  Object {
8
+ "description": undefined,
8
9
  "directives": Array [],
9
10
  "kind": "OperationDefinition",
10
11
  "name": Object {
@@ -86,6 +87,7 @@ Object {
86
87
  "variableDefinitions": Array [
87
88
  Object {
88
89
  "defaultValue": undefined,
90
+ "description": undefined,
89
91
  "directives": Array [],
90
92
  "kind": "VariableDefinition",
91
93
  "type": Object {
@@ -5,6 +5,7 @@ Object {
5
5
  "fileQuery": Object {
6
6
  "definitions": Array [
7
7
  Object {
8
+ "description": undefined,
8
9
  "directives": Array [],
9
10
  "kind": "OperationDefinition",
10
11
  "name": undefined,
@@ -5,6 +5,7 @@ Object {
5
5
  "fileQuery": Object {
6
6
  "definitions": Array [
7
7
  Object {
8
+ "description": undefined,
8
9
  "directives": Array [],
9
10
  "kind": "OperationDefinition",
10
11
  "name": undefined,
@@ -5,6 +5,7 @@ Object {
5
5
  "fileQuery": Object {
6
6
  "definitions": Array [
7
7
  Object {
8
+ "description": undefined,
8
9
  "directives": Array [],
9
10
  "kind": "OperationDefinition",
10
11
  "name": Object {
@@ -127,6 +128,7 @@ Object {
127
128
  "variableDefinitions": Array [
128
129
  Object {
129
130
  "defaultValue": undefined,
131
+ "description": undefined,
130
132
  "directives": Array [],
131
133
  "kind": "VariableDefinition",
132
134
  "type": Object {
@@ -5,6 +5,7 @@ Object {
5
5
  "fileQuery": Object {
6
6
  "definitions": Array [
7
7
  Object {
8
+ "description": undefined,
8
9
  "directives": Array [],
9
10
  "kind": "OperationDefinition",
10
11
  "name": undefined,