@blaze-cms/nextjs-tools 0.146.0-core-styles.44 → 0.146.0-node18.1
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 +17 -179
- package/README.md +9 -8
- package/example.env +1 -1
- package/lib/components/DebugSidebar/index.js +1 -1
- package/lib/components/DebugSidebar/index.js.map +1 -1
- package/lib/containers/ContentContainer.js +1 -1
- package/lib/containers/ContentContainer.js.map +1 -1
- package/lib/helpers/check-for-gtm.js +3 -3
- package/lib/helpers/check-for-gtm.js.map +1 -1
- package/lib/helpers/check-url.js +23 -16
- package/lib/helpers/check-url.js.map +1 -1
- package/lib/helpers/get-page-data.js +1 -1
- package/lib/helpers/get-page-data.js.map +1 -1
- package/lib/helpers/get-search-filter.js +3 -3
- package/lib/helpers/get-search-filter.js.map +1 -1
- package/lib/helpers/handle-static-routes.js +3 -3
- package/lib/helpers/handle-static-routes.js.map +1 -1
- package/lib/helpers/render-apple-tags.js +1 -0
- package/lib/helpers/render-apple-tags.js.map +1 -1
- package/lib/helpers/set-blaze-debug.js.map +1 -1
- package/lib/helpers/static-route-handlers/generic-file-handler.js +1 -1
- package/lib/helpers/static-route-handlers/generic-file-handler.js.map +1 -1
- package/lib/helpers/static-route-handlers/index.js +1 -1
- package/lib/helpers/static-route-handlers/index.js.map +1 -1
- package/lib/hoc/withBlaze.js +6 -7
- package/lib/hoc/withBlaze.js.map +1 -1
- package/lib/index.js +1 -8
- package/lib/index.js.map +1 -1
- package/lib/pages/Resolver.js +2 -2
- package/lib/pages/Resolver.js.map +1 -1
- package/lib/pages/document/_document.js +4 -6
- package/lib/pages/document/_document.js.map +1 -1
- package/lib/server/index.js +8 -7
- package/lib/server/index.js.map +1 -1
- package/lib-es/application/query/index.js.map +1 -1
- package/lib-es/components/DebugSidebar/index.js.map +1 -1
- package/lib-es/constants.js.map +1 -1
- package/lib-es/helpers/build-admin-href.js.map +1 -1
- package/lib-es/helpers/check-url.js +5 -2
- package/lib-es/helpers/check-url.js.map +1 -1
- package/lib-es/helpers/get-root-selector-classes.js.map +1 -1
- package/lib-es/helpers/static-route-handlers/robots-txt.js.map +1 -1
- package/lib-es/helpers/static-route-handlers/sitemap-file.js.map +1 -1
- package/lib-es/helpers/static-route-handlers/sitemap.js.map +1 -1
- package/lib-es/hoc/withBlaze.js +1 -1
- package/lib-es/hoc/withBlaze.js.map +1 -1
- package/lib-es/index.js +1 -1
- package/lib-es/index.js.map +1 -1
- package/lib-es/pages/Resolver.js.map +1 -1
- package/lib-es/pages/document/_document.js +2 -5
- package/lib-es/pages/document/_document.js.map +1 -1
- package/lib-es/server/index.js +5 -4
- package/lib-es/server/index.js.map +1 -1
- package/package.json +26 -26
- package/src/components/DebugSidebar/index.js +5 -8
- package/src/helpers/check-url.js +6 -4
- package/src/index.js +1 -1
- package/src/pages/Resolver.js +1 -1
- package/src/pages/document/_document.js +2 -1
- package/src/server/index.js +5 -4
- package/tests/helpers/tests/static-file-handler-tests.js +7 -11
- package/tests/unit/src/components/DebugSidebar/__snapshots__/DebugSidebar.test.js.snap +3 -0
- package/tests/unit/src/helpers/handle-static-routes.test.js +1 -1
- package/tests/unit/src/hoc/withBlaze.test.js +6 -6
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-
|
|
6
|
+
# [0.146.0-node18.1](https://github.com/thebyte9/blaze/compare/v0.146.0-node18.0...v0.146.0-node18.1) (2025-03-25)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
9
9
|
|
|
@@ -11,192 +11,30 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
# [0.146.0-
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# [0.146.0-core-styles.42](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.41...v0.146.0-core-styles.42) (2025-01-06)
|
|
23
|
-
|
|
24
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
# [0.146.0-core-styles.41](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.40...v0.146.0-core-styles.41) (2024-12-16)
|
|
31
|
-
|
|
32
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
# [0.146.0-core-styles.40](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.39...v0.146.0-core-styles.40) (2024-12-13)
|
|
39
|
-
|
|
40
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
# [0.146.0-core-styles.38](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.37...v0.146.0-core-styles.38) (2024-11-20)
|
|
47
|
-
|
|
48
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
# [0.146.0-core-styles.37](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.36...v0.146.0-core-styles.37) (2024-11-12)
|
|
55
|
-
|
|
56
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
# [0.146.0-core-styles.36](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.35...v0.146.0-core-styles.36) (2024-11-07)
|
|
63
|
-
|
|
64
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
# [0.146.0-core-styles.35](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.34...v0.146.0-core-styles.35) (2024-11-06)
|
|
71
|
-
|
|
72
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
73
|
-
|
|
74
|
-
|
|
14
|
+
# [0.146.0-node18.0](https://github.com/thebyte9/blaze/compare/v0.145.0...v0.146.0-node18.0) (2025-03-12)
|
|
75
15
|
|
|
76
16
|
|
|
17
|
+
### Bug Fixes
|
|
77
18
|
|
|
78
|
-
|
|
19
|
+
* bumped apollo versions ([b371dc7](https://github.com/thebyte9/blaze/commit/b371dc7e7bbe814a0cc4d57af2b959ab5e1b1bfd))
|
|
20
|
+
* fixed breaking tests, updated next to 14 ([fecb0e1](https://github.com/thebyte9/blaze/commit/fecb0e1d822bd69ebbaa084072a219f0fddd23f1))
|
|
21
|
+
* fixed more tests ([46a2fb9](https://github.com/thebyte9/blaze/commit/46a2fb9467f9f3c9cf320c9caf36c66503cc1f49))
|
|
22
|
+
* fixed remaining failing tests ([8a5963f](https://github.com/thebyte9/blaze/commit/8a5963ff8a0bf615a2ced9fb77b8986a9b05d80c))
|
|
23
|
+
* lint errors for reegex ([daaf750](https://github.com/thebyte9/blaze/commit/daaf7506d22f9578072c71f5557d0b6bf6185018))
|
|
24
|
+
* linting fix for reading return values from promise executor functions ([7edb563](https://github.com/thebyte9/blaze/commit/7edb563a4cbfa37188f26c1ae709ffe8ed837d69))
|
|
25
|
+
* linting fixed automatically ([73135b9](https://github.com/thebyte9/blaze/commit/73135b9b8b0d5407e2e1dfba42ab2381f290607f))
|
|
26
|
+
* udpated yarn lock ([0cd4fa4](https://github.com/thebyte9/blaze/commit/0cd4fa4a185fca4b80b57e472badb771dd649ec2))
|
|
27
|
+
* updated with dev ([90f545f](https://github.com/thebyte9/blaze/commit/90f545f1beabb35e26ba6fb2b45a7a0dfd072927))
|
|
28
|
+
* updated with dev ([729bb6e](https://github.com/thebyte9/blaze/commit/729bb6ee7e87946081d51564a4ab45538f7be1e7))
|
|
29
|
+
* updated with latest ([21cde6f](https://github.com/thebyte9/blaze/commit/21cde6f157c9279ed1eccb326870547821bc3dde))
|
|
30
|
+
* wip ([a2b7b30](https://github.com/thebyte9/blaze/commit/a2b7b304f1871b372b3c8f105205ecc6e2ef8f01))
|
|
31
|
+
* wip ([48ea1ee](https://github.com/thebyte9/blaze/commit/48ea1ee2bff03b04bfeca7e1e2fe13bd7b316ad1))
|
|
79
32
|
|
|
80
33
|
|
|
81
34
|
### Features
|
|
82
35
|
|
|
83
36
|
* allow . (dot) character in route regex ([#4552](https://github.com/thebyte9/blaze/issues/4552)) ([9be0fe0](https://github.com/thebyte9/blaze/commit/9be0fe0dd0dac2e0891c2d965a20c6b2e02165cc))
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
# [0.146.0-core-styles.32](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.31...v0.146.0-core-styles.32) (2024-10-31)
|
|
90
|
-
|
|
91
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
# [0.146.0-core-styles.28](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.27...v0.146.0-core-styles.28) (2024-10-29)
|
|
98
|
-
|
|
99
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
# [0.146.0-core-styles.26](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.25...v0.146.0-core-styles.26) (2024-10-28)
|
|
106
|
-
|
|
107
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
# [0.146.0-core-styles.25](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.24...v0.146.0-core-styles.25) (2024-10-25)
|
|
114
|
-
|
|
115
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
# [0.146.0-core-styles.23](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.22...v0.146.0-core-styles.23) (2024-10-23)
|
|
122
|
-
|
|
123
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
# [0.146.0-core-styles.21](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.20...v0.146.0-core-styles.21) (2024-10-18)
|
|
130
|
-
|
|
131
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
# [0.146.0-core-styles.11](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.10...v0.146.0-core-styles.11) (2024-10-01)
|
|
138
|
-
|
|
139
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
# [0.146.0-core-styles.10](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.9...v0.146.0-core-styles.10) (2024-09-25)
|
|
146
|
-
|
|
147
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
# [0.146.0-core-styles.8](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.7...v0.146.0-core-styles.8) (2024-09-24)
|
|
154
|
-
|
|
155
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
# [0.146.0-core-styles.7](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.6...v0.146.0-core-styles.7) (2024-09-20)
|
|
162
|
-
|
|
163
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
# [0.146.0-core-styles.6](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.5...v0.146.0-core-styles.6) (2024-09-20)
|
|
170
|
-
|
|
171
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
# [0.146.0-core-styles.3](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.2...v0.146.0-core-styles.3) (2024-09-18)
|
|
178
|
-
|
|
179
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
# [0.146.0-core-styles.0](https://github.com/thebyte9/blaze/compare/v0.145.1-core-styles.1...v0.146.0-core-styles.0) (2024-09-03)
|
|
186
|
-
|
|
187
|
-
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
## [0.145.1-core-styles.0](https://github.com/thebyte9/blaze/compare/v0.145.0...v0.145.1-core-styles.0) (2024-08-22)
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
### Bug Fixes
|
|
197
|
-
|
|
198
|
-
* adds default root selector to readme ([cfb5095](https://github.com/thebyte9/blaze/commit/cfb50956d95df485fe4486f632d32400b46806f7))
|
|
199
|
-
* fixes readme layout ([9dbdd8e](https://github.com/thebyte9/blaze/commit/9dbdd8ee96cb4a716e1e42c224939ac22ac6af0d))
|
|
37
|
+
* updated react to 18 ([9335f84](https://github.com/thebyte9/blaze/commit/9335f8432b376494501abb9c3deef1ddaa9b35a8))
|
|
200
38
|
|
|
201
39
|
|
|
202
40
|
|
package/README.md
CHANGED
|
@@ -84,15 +84,16 @@ If you want to make it stricter or more open you can override the default with t
|
|
|
84
84
|
## Environment variables
|
|
85
85
|
|
|
86
86
|
| Name | Description | Type | Default |
|
|
87
|
-
|
|
87
|
+
|---|---|---|
|
|
88
88
|
| BLAZE_FRONTEND_HOST | Frontend host (used to identify host) | String | |
|
|
89
|
-
| BLAZE_ROUTE_REGEX | Override default route regex |
|
|
89
|
+
| BLAZE_ROUTE_REGEX | Override default route regex | /^\/[a-z0-9€*\/]+(?:[-\/\.]{1,2}[a-z0-9\/€*\/]+)*$|^\/$/ |
|
|
90
90
|
| BLAZE_CACHE_CONTROL_HEADER | Cache-Control header to set on page requests | String | "" |
|
|
91
|
-
| BLAZE_STATIC_ROUTE_STORE_KEY | Override store for static file routes |
|
|
92
|
-
| BLAZE_ROUTE_PATTERN_SITEMAP | Override sitemap route |
|
|
91
|
+
| BLAZE_STATIC_ROUTE_STORE_KEY | Override store for static file routes | default |
|
|
92
|
+
| BLAZE_ROUTE_PATTERN_SITEMAP | Override sitemap route | /sitemap.xml |
|
|
93
93
|
| 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 | |
|
|
94
|
-
| BLAZE_ROOT_SELECTOR_CLASSES_LIMIT | The number of root-selector classes to display.
|
|
95
|
-
| 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. |
|
|
94
|
+
| BLAZE_ROOT_SELECTOR_CLASSES_LIMIT | The number of root-selector classes to display. 0 or unset will show noe | String | |
|
|
95
|
+
| 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 |
|
|
96
|
+
| 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 | |
|
|
96
97
|
| BLAZE_DISABLE_REDIRECT_WITH_QUERY | Do not add query string to redirects | String | |
|
|
97
98
|
|
|
98
99
|
## Events emitted
|
|
@@ -115,7 +116,7 @@ For more information about specific package events go to package README.
|
|
|
115
116
|
|
|
116
117
|
```sh
|
|
117
118
|
cd packages/frontend/
|
|
118
|
-
|
|
119
|
+
npm install tailwindcss@latest postcss@latest autoprefixer@latest --save
|
|
119
120
|
```
|
|
120
121
|
|
|
121
122
|
3. Add **tailwind.config.js** file in packages/frontend with following content
|
|
@@ -199,7 +200,7 @@ When checking new code or build configs make sure to check the [following things
|
|
|
199
200
|
|
|
200
201
|
## Root selector classes
|
|
201
202
|
|
|
202
|
-
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.
|
|
203
|
+
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.
|
|
203
204
|
|
|
204
205
|
For example the following url, `/parent/child/article-123` might be broken into the following classes
|
|
205
206
|
|
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="
|
|
6
|
+
BLAZE_ROOT_SELECTOR_CLASSES_LIMIT="2"
|
|
7
7
|
BLAZE_CACHE_CONTROL_HEADER="max-age=0"
|
|
8
8
|
BLAZE_DISABLE_REDIRECT_WITH_QUERY=""
|
|
@@ -22,7 +22,7 @@ var _md = require("react-icons/md");
|
|
|
22
22
|
var _helpers = require("../../helpers");
|
|
23
23
|
var _constants = require("../../constants");
|
|
24
24
|
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); }
|
|
25
|
-
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 &&
|
|
25
|
+
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; }
|
|
26
26
|
var DebugSidebar = function DebugSidebar(_ref) {
|
|
27
27
|
var itemEntity = _ref.itemEntity,
|
|
28
28
|
itemId = _ref.itemId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_classnames","_nextjsComponents","_md","_helpers","_constants","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_classnames","_nextjsComponents","_md","_helpers","_constants","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","DebugSidebar","_ref","itemEntity","itemId","debugMode","_useState","useState","_useState2","_slicedToArray2","isDebugMode","setIsDebugMode","_useState3","_useState4","isOpen","setIsOpen","useEffect","setBlazeDebug","divClass","classnames","href","buildAdminHref","createElement","Fragment","className","Link","src","DEBUG_LOGO","SRC","alt","ALT","role","id","onClick","MdKeyboardArrowLeft","propTypes","PropTypes","string","bool","defaultProps","_default","exports"],"sources":["../../../src/components/DebugSidebar/index.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport { Link } from '@blaze-cms/nextjs-components';\nimport { MdKeyboardArrowLeft } from 'react-icons/md';\nimport { buildAdminHref, setBlazeDebug } from '../../helpers';\nimport { DEBUG_LOGO } from '../../constants';\n\nconst DebugSidebar = ({ itemEntity, itemId, debugMode }) => {\n const [isDebugMode, setIsDebugMode] = useState(debugMode);\n const [isOpen, setIsOpen] = useState(true);\n\n useEffect(() => {\n if (debugMode === true) {\n setIsDebugMode(debugMode);\n } else setBlazeDebug(setIsDebugMode);\n }, [debugMode]);\n\n const divClass = classnames('debug-sidebar', {\n 'debug-sidebar--open': isOpen,\n 'debug-sidebar--close': !isOpen\n });\n\n const href = buildAdminHref({ itemEntity, itemId });\n\n return (\n <>\n {isDebugMode ? (\n <div className={divClass} data-testid=\"debug-sidebar\">\n <Link href={href}>\n <img src={DEBUG_LOGO.SRC} alt={DEBUG_LOGO.ALT} />\n <span>Blaze admin</span>\n </Link>\n <div\n role=\"button\"\n className=\"debug-sidebar__button open\"\n data-testid=\"debug-sidebar-button\"\n id=\"debug-sidebar-button\"\n onClick={() => setIsOpen(!isOpen)}>\n <i>\n <MdKeyboardArrowLeft />\n </i>\n </div>\n </div>\n ) : null}\n </>\n );\n};\n\nDebugSidebar.propTypes = {\n itemEntity: PropTypes.string,\n itemId: PropTypes.string,\n debugMode: PropTypes.bool\n};\n\nDebugSidebar.defaultProps = {\n itemEntity: '',\n itemId: '',\n debugMode: false\n};\n\nexport default DebugSidebar;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,GAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AAA6C,SAAAQ,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,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,I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E,CACrB,CACA,CACF,CAAC,GACJ,IACJ,CAAC;AAEP,CAAC;AAEDjC,YAAY,CAACkC,SAAS,GAAG;EACvBhC,UAAU,EAAEiC,qBAAS,CAACC,MAAM;EAC5BjC,MAAM,EAAEgC,qBAAS,CAACC,MAAM;EACxBhC,SAAS,EAAE+B,qBAAS,CAACE;AACvB,CAAC;AAEDrC,YAAY,CAACsC,YAAY,GAAG;EAC1BpC,UAAU,EAAE,EAAE;EACdC,MAAM,EAAE,EAAE;EACVC,SAAS,EAAE;AACb,CAAC;AAAC,IAAAmC,QAAA,GAAAC,OAAA,cAEaxC,YAAY","ignoreList":[]}
|
|
@@ -31,7 +31,7 @@ var _helpers = require("../helpers");
|
|
|
31
31
|
var _constants = require("../constants");
|
|
32
32
|
var _excluded = ["category", "tags", "preparedPageBuilderComponents"];
|
|
33
33
|
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); }
|
|
34
|
-
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 &&
|
|
34
|
+
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; }
|
|
35
35
|
function ownKeys(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; }
|
|
36
36
|
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; }
|
|
37
37
|
var ContentContainer = function ContentContainer(_ref) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentContainer.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_pluginPageBuilderFe","_nextjsComponents","_helpers","_constants","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","
|
|
1
|
+
{"version":3,"file":"ContentContainer.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_pluginPageBuilderFe","_nextjsComponents","_helpers","_constants","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","ContentContainer","_ref","fullUrl","pageData","isPreview","itemId","itemEntity","_useState","useState","_useState2","_slicedToArray2","open","setOpen","_useState3","_useState4","selectedImage","setSelectedImage","toggleModal","useEffect","category","tags","preparedPageBuilderComponents","metaProps","_objectWithoutProperties2","pageBuilder","options","parent","searchFilterItems","getSearchFilter","defaultSearchFilter","settings","url","searchFilter","allSearchFilters","lightboxImages","getLightboxImages","hasGTM","checkForGtm","GlobalLigthBoxProps","buildPBComponentsOptions","createElement","MainContextProvider","value","Header","className","PREVIEW_MODE","buildPBComponents","propTypes","PropTypes","string","isRequired","object","bool","_default","exports"],"sources":["../../src/containers/ContentContainer.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { buildPBComponents, getLightboxImages } from '@blaze-cms/plugin-page-builder-fe';\nimport { Header, MainContextProvider } from '@blaze-cms/nextjs-components';\nimport { getSearchFilter, checkForGtm } from '../helpers';\nimport { PREVIEW_MODE } from '../constants';\n\nconst ContentContainer = ({ fullUrl, pageData, isPreview, itemId, itemEntity }) => {\n const [open, setOpen] = useState(false);\n const [selectedImage, setSelectedImage] = useState(0);\n const toggleModal = () => setOpen(!open);\n\n useEffect(\n () => {\n if (open) setOpen(false);\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [fullUrl]\n );\n\n const { category, tags, preparedPageBuilderComponents, ...metaProps } = pageData;\n const pageBuilder = preparedPageBuilderComponents || [];\n const options = { parent: { itemId, itemEntity, category, tags } };\n const searchFilterItems = getSearchFilter(pageBuilder);\n const defaultSearchFilter = searchFilterItems[0];\n // TODO check if this can be removed\n if (defaultSearchFilter && !defaultSearchFilter.settings.url) {\n options.searchFilter = defaultSearchFilter;\n }\n options.allSearchFilters = searchFilterItems;\n const lightboxImages = getLightboxImages(pageBuilder);\n const hasGTM = checkForGtm(pageBuilder);\n const GlobalLigthBoxProps = {\n open,\n setOpen,\n toggleModal,\n selectedImage,\n lightboxImages,\n setSelectedImage\n };\n const buildPBComponentsOptions = {\n ...options,\n ...metaProps,\n ...GlobalLigthBoxProps,\n hasGTM\n };\n\n return (\n <MainContextProvider value={{ fullUrl, isPreview, itemId, hasGTM }}>\n <Header {...metaProps} />\n {isPreview && <div className=\"preview-header\">{PREVIEW_MODE}</div>}\n {!!pageBuilder.length && buildPBComponents(pageBuilder, buildPBComponentsOptions, true)}\n </MainContextProvider>\n );\n};\n\nContentContainer.propTypes = {\n fullUrl: PropTypes.string.isRequired,\n pageData: PropTypes.object.isRequired,\n isPreview: PropTypes.bool.isRequired,\n itemId: PropTypes.string.isRequired,\n itemEntity: PropTypes.string.isRequired\n};\n\nexport default ContentContainer;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAA4C,IAAAO,SAAA;AAAA,SAAAC,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,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,C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AAiB,EAACtB,WAAW,EAAEe,wBAAwB,EAAE,IAAI,CACnE,CAAC;AAE1B,CAAC;AAEDvC,gBAAgB,CAAC+C,SAAS,GAAG;EAC3B7C,OAAO,EAAE8C,qBAAS,CAACC,MAAM,CAACC,UAAU;EACpC/C,QAAQ,EAAE6C,qBAAS,CAACG,MAAM,CAACD,UAAU;EACrC9C,SAAS,EAAE4C,qBAAS,CAACI,IAAI,CAACF,UAAU;EACpC7C,MAAM,EAAE2C,qBAAS,CAACC,MAAM,CAACC,UAAU;EACnC5C,UAAU,EAAE0C,qBAAS,CAACC,MAAM,CAACC;AAC/B,CAAC;AAAC,IAAAG,QAAA,GAAAC,OAAA,cAEatD,gBAAgB","ignoreList":[]}
|
|
@@ -10,15 +10,15 @@ require("core-js/modules/es.array.includes.js");
|
|
|
10
10
|
require("core-js/modules/es.object.to-string.js");
|
|
11
11
|
require("core-js/modules/es.string.includes.js");
|
|
12
12
|
var _constants = require("../constants");
|
|
13
|
-
var
|
|
13
|
+
var _checkForGTM = function checkForGTM() {
|
|
14
14
|
var components = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
15
15
|
return !!components.find(function (_ref) {
|
|
16
16
|
var type = _ref.type,
|
|
17
17
|
items = _ref.items;
|
|
18
18
|
if (type && type.includes(_constants.GTM_STRING)) return true;
|
|
19
|
-
if (items && items.length) return
|
|
19
|
+
if (items && items.length) return _checkForGTM(items);
|
|
20
20
|
return false;
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
|
-
var _default = exports["default"] =
|
|
23
|
+
var _default = exports["default"] = _checkForGTM;
|
|
24
24
|
//# sourceMappingURL=check-for-gtm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-for-gtm.js","names":["_constants","require","checkForGTM","components","arguments","length","undefined","find","_ref","type","items","includes","GTM_STRING","_default","exports"],"sources":["../../src/helpers/check-for-gtm.js"],"sourcesContent":["import { GTM_STRING } from '../constants';\n\nconst checkForGTM = (components = []) =>\n !!components.find(({ type, items }) => {\n if (type && type.includes(GTM_STRING)) return true;\n if (items && items.length) return checkForGTM(items);\n return false;\n });\n\nexport default checkForGTM;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAMC,
|
|
1
|
+
{"version":3,"file":"check-for-gtm.js","names":["_constants","require","checkForGTM","components","arguments","length","undefined","find","_ref","type","items","includes","GTM_STRING","_default","exports"],"sources":["../../src/helpers/check-for-gtm.js"],"sourcesContent":["import { GTM_STRING } from '../constants';\n\nconst checkForGTM = (components = []) =>\n !!components.find(({ type, items }) => {\n if (type && type.includes(GTM_STRING)) return true;\n if (items && items.length) return checkForGTM(items);\n return false;\n });\n\nexport default checkForGTM;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAMC,YAAW,GAAG,SAAdA,WAAWA,CAAA;EAAA,IAAIC,UAAU,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAAA,OAClC,CAAC,CAACD,UAAU,CAACI,IAAI,CAAC,UAAAC,IAAA,EAAqB;IAAA,IAAlBC,IAAI,GAAAD,IAAA,CAAJC,IAAI;MAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAC9B,IAAID,IAAI,IAAIA,IAAI,CAACE,QAAQ,CAACC,qBAAU,CAAC,EAAE,OAAO,IAAI;IAClD,IAAIF,KAAK,IAAIA,KAAK,CAACL,MAAM,EAAE,OAAOH,YAAW,CAACQ,KAAK,CAAC;IACpD,OAAO,KAAK;EACd,CAAC,CAAC;AAAA;AAAC,IAAAG,QAAA,GAAAC,OAAA,cAEUZ,YAAW","ignoreList":[]}
|
package/lib/helpers/check-url.js
CHANGED
|
@@ -20,6 +20,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
20
20
|
require("core-js/modules/es.array.concat.js");
|
|
21
21
|
require("core-js/modules/es.number.constructor.js");
|
|
22
22
|
require("core-js/modules/es.object.keys.js");
|
|
23
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
23
24
|
var _queryString = require("query-string");
|
|
24
25
|
var _reactPageBuilder = require("@blaze-cms/react-page-builder");
|
|
25
26
|
var _coreAuthUi = require("@blaze-cms/core-auth-ui");
|
|
@@ -33,10 +34,10 @@ var _getRootSelectorClasses = _interopRequireDefault(require("./get-root-selecto
|
|
|
33
34
|
function ownKeys(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; }
|
|
34
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; }
|
|
35
36
|
var getRootClassesLimit = function getRootClassesLimit() {
|
|
36
|
-
return Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT
|
|
37
|
+
return Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT);
|
|
37
38
|
};
|
|
38
39
|
var checkUrl = /*#__PURE__*/function () {
|
|
39
|
-
var _ref = (0, _asyncToGenerator2["default"])(
|
|
40
|
+
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(props) {
|
|
40
41
|
var asPath, apolloClient, res, req, query, blazeApp, disableSsr, fullUrl, _parseUrl, url, handler, previewData, urlCheckOptions, result;
|
|
41
42
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
42
43
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -114,7 +115,7 @@ var checkUrl = /*#__PURE__*/function () {
|
|
|
114
115
|
};
|
|
115
116
|
}();
|
|
116
117
|
var getPreviewData = /*#__PURE__*/function () {
|
|
117
|
-
var _ref2 = (0, _asyncToGenerator2["default"])(
|
|
118
|
+
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(previewData, apolloClient) {
|
|
118
119
|
var result, _result$pageData, _result$pageData2, url, rootSelectorClasses;
|
|
119
120
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
120
121
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -160,21 +161,27 @@ var getFullUrl = function getFullUrl(req, asPath) {
|
|
|
160
161
|
return "".concat(protocol).concat(_constants.DOUBLE_SLASH).concat(hostname).concat(urlPort).concat(asPath);
|
|
161
162
|
};
|
|
162
163
|
var doUrlCheck = /*#__PURE__*/function () {
|
|
163
|
-
var _ref5 = (0, _asyncToGenerator2["default"])(
|
|
164
|
+
var _ref5 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(_ref4) {
|
|
164
165
|
var asPath, url, apolloClient, res, handle404Error, blazeApp, _yield$apolloClient$q, _yield$apolloClient$q2, itemId, itemEntity, urlTo, _yield$apolloClient$q3, pageData, _ref6, _ref6$cacheControlMax, cacheControlMaxAge, redirectUrl, queryString, rootSelectorClasses, parentPATH;
|
|
165
166
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
166
167
|
while (1) switch (_context3.prev = _context3.next) {
|
|
167
168
|
case 0:
|
|
168
169
|
asPath = _ref4.asPath, url = _ref4.url, apolloClient = _ref4.apolloClient, res = _ref4.res, handle404Error = _ref4.handle404Error, blazeApp = _ref4.blazeApp;
|
|
169
170
|
_context3.prev = 1;
|
|
170
|
-
|
|
171
|
+
if (_constants.ROUTE_REGEX.test(url)) {
|
|
172
|
+
_context3.next = 4;
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
throw Error('Invalid URL');
|
|
176
|
+
case 4:
|
|
177
|
+
_context3.next = 6;
|
|
171
178
|
return apolloClient.query({
|
|
172
179
|
query: _query.checkUrlQuery,
|
|
173
180
|
variables: {
|
|
174
181
|
url: url
|
|
175
182
|
}
|
|
176
183
|
});
|
|
177
|
-
case
|
|
184
|
+
case 6:
|
|
178
185
|
_yield$apolloClient$q = _context3.sent;
|
|
179
186
|
_yield$apolloClient$q2 = _yield$apolloClient$q.data.checkUrl;
|
|
180
187
|
itemId = _yield$apolloClient$q2.itemId;
|
|
@@ -187,7 +194,7 @@ var doUrlCheck = /*#__PURE__*/function () {
|
|
|
187
194
|
res.setHeader('Cache-Control', "max-age=".concat(cacheControlMaxAge));
|
|
188
195
|
}
|
|
189
196
|
if (!(urlTo && urlTo !== url)) {
|
|
190
|
-
_context3.next =
|
|
197
|
+
_context3.next = 20;
|
|
191
198
|
break;
|
|
192
199
|
}
|
|
193
200
|
redirectUrl = urlTo;
|
|
@@ -199,7 +206,7 @@ var doUrlCheck = /*#__PURE__*/function () {
|
|
|
199
206
|
return _context3.abrupt("return", {
|
|
200
207
|
redirecting: true
|
|
201
208
|
});
|
|
202
|
-
case
|
|
209
|
+
case 20:
|
|
203
210
|
rootSelectorClasses = (0, _getRootSelectorClasses["default"])(url, getRootClassesLimit());
|
|
204
211
|
return _context3.abrupt("return", {
|
|
205
212
|
pageData: pageData,
|
|
@@ -207,26 +214,26 @@ var doUrlCheck = /*#__PURE__*/function () {
|
|
|
207
214
|
itemId: itemId,
|
|
208
215
|
itemEntity: (0, _reactPageBuilder.getUnpublishedEntityName)(itemEntity)
|
|
209
216
|
});
|
|
210
|
-
case
|
|
211
|
-
_context3.prev =
|
|
217
|
+
case 24:
|
|
218
|
+
_context3.prev = 24;
|
|
212
219
|
_context3.t0 = _context3["catch"](1);
|
|
213
220
|
parentPATH = (0, _checkParent["default"])(url);
|
|
214
221
|
if (!(handle404Error && parentPATH)) {
|
|
215
|
-
_context3.next =
|
|
222
|
+
_context3.next = 31;
|
|
216
223
|
break;
|
|
217
224
|
}
|
|
218
225
|
doRedirect(res, parentPATH);
|
|
219
|
-
_context3.next =
|
|
226
|
+
_context3.next = 32;
|
|
220
227
|
break;
|
|
221
|
-
case
|
|
228
|
+
case 31:
|
|
222
229
|
return _context3.abrupt("return", handleError(_context3.t0, res, handle404Error, blazeApp));
|
|
223
|
-
case
|
|
230
|
+
case 32:
|
|
224
231
|
return _context3.abrupt("return", handle404Error ? {} : null);
|
|
225
|
-
case
|
|
232
|
+
case 33:
|
|
226
233
|
case "end":
|
|
227
234
|
return _context3.stop();
|
|
228
235
|
}
|
|
229
|
-
}, _callee3, null, [[1,
|
|
236
|
+
}, _callee3, null, [[1, 24]]);
|
|
230
237
|
}));
|
|
231
238
|
return function doUrlCheck(_x4) {
|
|
232
239
|
return _ref5.apply(this, arguments);
|
|
@@ -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","_ref5","_callee3","_ref4","_yield$apolloClient$q","_yield$apolloClient$q2","itemId","itemEntity","urlTo","_yield$apolloClient$q3","_ref6","_ref6$cacheControlMax","cacheControlMaxAge","redirectUrl","queryString","parentPATH","_callee3$","_context3","checkUrlQuery","variables","data","BLAZE_DISABLE_REDIRECT_WITH_QUERY","split","doRedirect","redirecting","getUnpublishedEntityName","t0","checkParent","handleError","_x4","err","events","emit","error","networkError","writeHead","write","end","graphQLErrors","statusCode","NOT_FOUND_STATUS_CODE","errorCode","Location","href","_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} 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 ({ asPath, url, apolloClient, res, handle404Error, blazeApp }) => {\n try {\n const {\n data: {\n checkUrl: { itemId, itemEntity, urlTo, pageData = {} }\n }\n } = await apolloClient.query({\n query: checkUrlQuery,\n variables: {\n url\n }\n });\n\n const { cacheControlMaxAge = null } = pageData || {}; // pageData can be null when there is no page\n if (res && cacheControlMaxAge !== null && cacheControlMaxAge >= 0) {\n res.setHeader('Cache-Control', `max-age=${cacheControlMaxAge}`);\n }\n\n if (urlTo && urlTo !== url) {\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 doRedirect(res, redirectUrl);\n return { redirecting: true };\n }\n const rootSelectorClasses = getRootSelectorClasses(url, getRootClassesLimit());\n return {\n pageData,\n rootSelectorClasses,\n itemId,\n itemEntity: getUnpublishedEntityName(itemEntity)\n };\n } catch (err) {\n const parentPATH = checkParent(url);\n if (handle404Error && parentPATH) {\n doRedirect(res, parentPATH);\n } else {\n return handleError(err, res, handle404Error, blazeApp);\n }\n\n return handle404Error ? {} : null;\n }\n};\n\nconst handleError = (err, res, handle404Error, blazeApp) => {\n blazeApp.events.emit('monitor:log', { error: err });\n\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 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\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;AAOA,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,IAA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tC,OAAO;MAAEC,SAAS,EAAED;IAAsB,CAAC;EAC7C;EAEA,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAASjB,UAAUA,CAAC5F,GAAG,EAAEkF,WAAW,EAAE;EACpC,IAAIlF,GAAG,EAAE;IACPA,GAAG,CAACwG,SAAS,CAAC,GAAG,EAAE;MAAEO,QAAQ,EAAE7B;IAAY,CAAC,CAAC;IAC7ClF,GAAG,CAAC0G,GAAG,CAAC,CAAC;EACX,CAAC,MAAM;IACL7C,MAAM,CAACE,QAAQ,CAACiD,IAAI,GAAG9B,WAAW;EACpC;AACF;AAAC,IAAA+B,QAAA,GAAAC,OAAA,cAEc3H,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","_ref5","_callee3","_ref4","_yield$apolloClient$q","_yield$apolloClient$q2","itemId","itemEntity","urlTo","_yield$apolloClient$q3","_ref6","_ref6$cacheControlMax","cacheControlMaxAge","redirectUrl","queryString","parentPATH","_callee3$","_context3","ROUTE_REGEX","test","Error","checkUrlQuery","variables","data","BLAZE_DISABLE_REDIRECT_WITH_QUERY","split","doRedirect","redirecting","getUnpublishedEntityName","t0","checkParent","handleError","_x4","err","events","emit","error","networkError","writeHead","write","end","graphQLErrors","statusCode","NOT_FOUND_STATUS_CODE","errorCode","Location","href","_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} 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 ({ asPath, url, apolloClient, res, handle404Error, blazeApp }) => {\n try {\n if (!ROUTE_REGEX.test(url)) {\n throw Error('Invalid URL');\n }\n const {\n data: {\n checkUrl: { itemId, itemEntity, urlTo, pageData = {} }\n }\n } = await apolloClient.query({\n query: checkUrlQuery,\n variables: {\n url\n }\n });\n const { cacheControlMaxAge = null } = pageData || {}; // pageData can be null when there is no page\n if (res && cacheControlMaxAge !== null && cacheControlMaxAge >= 0) {\n res.setHeader('Cache-Control', `max-age=${cacheControlMaxAge}`);\n }\n\n if (urlTo && urlTo !== url) {\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 doRedirect(res, redirectUrl);\n return { redirecting: true };\n }\n const rootSelectorClasses = getRootSelectorClasses(url, getRootClassesLimit());\n return {\n pageData,\n rootSelectorClasses,\n itemId,\n itemEntity: getUnpublishedEntityName(itemEntity)\n };\n } catch (err) {\n const parentPATH = checkParent(url);\n if (handle404Error && parentPATH) {\n doRedirect(res, parentPATH);\n } else {\n return handleError(err, res, handle404Error, blazeApp);\n }\n\n return handle404Error ? {} : null;\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 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\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;AAQA,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,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Q,aAAa,IAAIR,GAAG,CAACQ,aAAa,CAAClI,MAAM,EAAE;IAC1EoB,GAAG,CAAC+G,UAAU,GAAGC,gCAAqB;IACtC,OAAO;MAAEC,SAAS,EAAED;IAAsB,CAAC;EAC7C;EAEA,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAASjB,UAAUA,CAAC/F,GAAG,EAAEkF,WAAW,EAAE;EACpC,IAAIlF,GAAG,EAAE;IACPA,GAAG,CAAC2G,SAAS,CAAC,GAAG,EAAE;MAAEO,QAAQ,EAAEhC;IAAY,CAAC,CAAC;IAC7ClF,GAAG,CAAC6G,GAAG,CAAC,CAAC;EACX,CAAC,MAAM;IACLhD,MAAM,CAACE,QAAQ,CAACoD,IAAI,GAAGjC,WAAW;EACpC;AACF;AAAC,IAAAkC,QAAA,GAAAC,OAAA,cAEc9H,QAAQ","ignoreList":[]}
|
|
@@ -23,7 +23,7 @@ var _getErrorMessage = _interopRequireDefault(require("./get-error-message"));
|
|
|
23
23
|
function ownKeys(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; }
|
|
24
24
|
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; }
|
|
25
25
|
var getPageData = /*#__PURE__*/function () {
|
|
26
|
-
var _ref2 = (0, _asyncToGenerator2["default"])(
|
|
26
|
+
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(_ref) {
|
|
27
27
|
var apolloClient, itemId, itemEntity, _ref$isPreview, isPreview, _yield$apolloClient$q, entitySchema, _yield$apolloClient$q2, data;
|
|
28
28
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
29
29
|
while (1) switch (_context.prev = _context.next) {
|