@graphcommerce/docs 10.0.0-canary.67 → 10.0.0-canary.72
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 +10 -0
- package/framework/config.md +90 -172
- package/framework/icons.md +1 -1
- package/framework/theming.md +6 -6
- package/framework/typography.md +1 -1
- package/getting-started/graphcms-component.md +1 -1
- package/getting-started/readme.md +3 -3
- package/package.json +2 -2
- package/upgrading/graphcommerce-9-to-10.md +24 -0
- package/upgrading/readme.md +4 -0
package/CHANGELOG.md
CHANGED
package/framework/config.md
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<!-- Automatically generated from Config.graphqls -->
|
|
2
|
-
|
|
3
2
|
### DatalayerConfig
|
|
4
3
|
|
|
5
4
|
GoogleDatalayerConfig to allow enabling certain aspects of the datalayer
|
|
@@ -10,29 +9,20 @@ Enable core web vitals tracking for GraphCommerce
|
|
|
10
9
|
|
|
11
10
|
# GraphCommerce configuration system
|
|
12
11
|
|
|
13
|
-
Global GraphCommerce configuration can be configured in your
|
|
14
|
-
|
|
15
|
-
validated on startup.
|
|
12
|
+
Global GraphCommerce configuration can be configured in your `graphcommerce.config.js` file
|
|
13
|
+
in the root of your project and are automatically validated on startup.
|
|
16
14
|
|
|
17
15
|
## Configuring with the configuration file.
|
|
18
16
|
|
|
19
|
-
The configuration file is a javascript file that exports a `GraphCommerceConfig`
|
|
20
|
-
object. See graphcommerce.config.js.example for an example.
|
|
17
|
+
The configuration file is a javascript file that exports a `GraphCommerceConfig` object. See graphcommerce.config.js.example for an example.
|
|
21
18
|
|
|
22
19
|
## Using configuration
|
|
23
20
|
|
|
24
|
-
Configuration can be accessed in your project
|
|
25
|
-
`import.meta.graphCommerce` object.
|
|
21
|
+
Configuration can be accessed in your project by importing the config from `@graphcommerce/next-config/config`.
|
|
26
22
|
|
|
27
23
|
```tsx
|
|
24
|
+
import { storefrontAll, storefrontConfig, storefrontConfigDefault, useStorefrontConfig } from '@graphcommerce/next-ui'
|
|
28
25
|
import { cartDisplayPricesInclTax } from '@graphcommerce/next-config/config'
|
|
29
|
-
import {
|
|
30
|
-
storefrontAll,
|
|
31
|
-
storefrontConfig,
|
|
32
|
-
storefrontConfigDefault,
|
|
33
|
-
useStorefrontConfig,
|
|
34
|
-
} from '@graphcommerce/next-ui'
|
|
35
|
-
|
|
36
26
|
// Accessing a global value
|
|
37
27
|
const globalConf = cartDisplayPricesInclTax
|
|
38
28
|
|
|
@@ -60,28 +50,25 @@ endpoint: '{graphCommerce.magentoEndpoint}'
|
|
|
60
50
|
|
|
61
51
|
## Environment variables to override configuration
|
|
62
52
|
|
|
63
|
-
Configuration values can be overwriten by environment variables, with the
|
|
64
|
-
following rules:
|
|
65
|
-
|
|
53
|
+
Configuration values can be overwriten by environment variables, with the following rules:
|
|
66
54
|
- Convert from camelCase to `SCREAMING_SNAKE_CASE`
|
|
67
55
|
- Prefix with `GC_`
|
|
68
56
|
- Arrays can be indexed with `_0`, `_1`, `_2`, etc.
|
|
69
57
|
- Objects can be accessed with `_<key>`.
|
|
70
58
|
|
|
71
59
|
Examples:
|
|
72
|
-
|
|
73
60
|
- `limitSsg` -> `GC_LIMIT_SSG="1"`
|
|
74
61
|
- `storefront[0].locale` -> `GC_STOREFRONT_0_LOCALE="en"`
|
|
75
62
|
- `debug.pluginStatus` -> `GC_DEBUG_PLUGIN_STATUS="1"`
|
|
76
63
|
|
|
64
|
+
|
|
77
65
|
## Exporting current configuration to environment variables
|
|
78
66
|
|
|
79
67
|
You can export configuration by running `yarn graphcommerce export-config`
|
|
80
68
|
|
|
81
69
|
## Extending the configuration in your project
|
|
82
70
|
|
|
83
|
-
Create a graphql/Config.graphqls file in your project and extend the
|
|
84
|
-
GraphCommerceConfig, GraphCommerceStorefrontConfig inputs to add configuration.
|
|
71
|
+
Create a graphql/Config.graphqls file in your project and extend the GraphCommerceConfig, GraphCommerceStorefrontConfig inputs to add configuration.
|
|
85
72
|
|
|
86
73
|
```graphql
|
|
87
74
|
extend input GraphCommerceConfig {
|
|
@@ -103,26 +90,15 @@ Below is a list of all possible configurations that can be set by GraphCommerce.
|
|
|
103
90
|
The canonical base URL is used for SEO purposes.
|
|
104
91
|
|
|
105
92
|
Examples:
|
|
106
|
-
|
|
107
93
|
- https://example.com
|
|
108
94
|
- https://example.com/en
|
|
109
95
|
- https://example.com/en-US
|
|
110
96
|
|
|
111
|
-
#### hygraphEndpoint: string (required)
|
|
112
|
-
|
|
113
|
-
The Hygraph endpoint.
|
|
114
|
-
|
|
115
|
-
> Read-only endpoint that allows low latency and high read-throughput content
|
|
116
|
-
> delivery.
|
|
117
|
-
|
|
118
|
-
Project settings -> API Access -> High Performance Read-only Content API
|
|
119
|
-
|
|
120
97
|
#### magentoEndpoint: string (required)
|
|
121
98
|
|
|
122
99
|
GraphQL Magento endpoint.
|
|
123
100
|
|
|
124
101
|
Examples:
|
|
125
|
-
|
|
126
102
|
- https://magento2.test/graphql
|
|
127
103
|
|
|
128
104
|
#### magentoVersion: number (required)
|
|
@@ -141,8 +117,7 @@ Configuration for the SidebarGallery component
|
|
|
141
117
|
|
|
142
118
|
#### cartDisplayPricesInclTax: boolean
|
|
143
119
|
|
|
144
|
-
Due to a limitation of the GraphQL API it is not possible to determine if a cart
|
|
145
|
-
should be displayed including or excluding tax.
|
|
120
|
+
Due to a limitation of the GraphQL API it is not possible to determine if a cart should be displayed including or excluding tax.
|
|
146
121
|
|
|
147
122
|
When Magento's StoreConfig adds this value, this can be replaced.
|
|
148
123
|
|
|
@@ -152,30 +127,25 @@ Use compare functionality
|
|
|
152
127
|
|
|
153
128
|
#### compareVariant: CHECKBOX | ICON = `ICON`
|
|
154
129
|
|
|
155
|
-
By default the compare feature is denoted with a 'compare ICON' (2 arrows facing
|
|
156
|
-
|
|
157
|
-
also possible to present the compare feature as a CHECKBOX accompanied by the
|
|
158
|
-
'Compare' label
|
|
130
|
+
By default the compare feature is denoted with a 'compare ICON' (2 arrows facing one another).
|
|
131
|
+
This may be fine for experienced users, but for more clarity it's also possible to present the compare feature as a CHECKBOX accompanied by the 'Compare' label
|
|
159
132
|
|
|
160
133
|
#### configurableVariantForSimple: boolean = `false`
|
|
161
134
|
|
|
162
|
-
If a simple product is part of a Configurable product page, should the simple
|
|
163
|
-
|
|
135
|
+
If a simple product is part of a Configurable product page, should the simple product be
|
|
136
|
+
rendered as a configured option of the configurable product page?
|
|
164
137
|
|
|
165
138
|
How does this work:
|
|
166
139
|
|
|
167
|
-
When the `products(filters: { url_key: { eq: 'simple-product' } }) { ... }`
|
|
168
|
-
|
|
169
|
-
product the simple belongs to.
|
|
140
|
+
When the `products(filters: { url_key: { eq: 'simple-product' } }) { ... }` query is ran,
|
|
141
|
+
Magento also returns the Simple product and the Configurable product the simple belongs to.
|
|
170
142
|
|
|
171
|
-
If that is the case we render the configurable product page instead of the
|
|
172
|
-
|
|
173
|
-
pre-selected.
|
|
143
|
+
If that is the case we render the configurable product page instead of the simple product page but
|
|
144
|
+
the options to select the simple product are pre-selected.
|
|
174
145
|
|
|
175
146
|
#### configurableVariantValues: [MagentoConfigurableVariantValues](#MagentoConfigurableVariantValues) = `{ content: true, url: true }`
|
|
176
147
|
|
|
177
|
-
When a user selects a variant, it will switch the values on the configurable
|
|
178
|
-
page with the values of the configured variant.
|
|
148
|
+
When a user selects a variant, it will switch the values on the configurable page with the values of the configured variant.
|
|
179
149
|
|
|
180
150
|
Enabling options here will allow switching of those variants.
|
|
181
151
|
|
|
@@ -189,16 +159,13 @@ Configures the max width of the shell (header, footer, overlays, etc.)
|
|
|
189
159
|
|
|
190
160
|
#### crossSellsHideCartItems: boolean = `false`
|
|
191
161
|
|
|
192
|
-
Determines if cross sell items should be shown when the user already has the
|
|
193
|
-
product in their cart. This will result in a product will popping off the screen
|
|
194
|
-
when you add it to the cart.
|
|
162
|
+
Determines if cross sell items should be shown when the user already has the product in their cart. This will result in a product will popping off the screen when you add it to the cart.
|
|
195
163
|
|
|
196
164
|
Default: 'false'
|
|
197
165
|
|
|
198
166
|
#### crossSellsRedirectItems: boolean = `false`
|
|
199
167
|
|
|
200
|
-
Determines if, after adding a cross-sell item to the cart, the user should be
|
|
201
|
-
redirected to the cross-sell items of the product they just added.
|
|
168
|
+
Determines if, after adding a cross-sell item to the cart, the user should be redirected to the cross-sell items of the product they just added.
|
|
202
169
|
|
|
203
170
|
Default: 'false'
|
|
204
171
|
|
|
@@ -209,7 +176,6 @@ Enables the shipping notes field in the checkout
|
|
|
209
176
|
#### customerCompanyFieldsEnable: boolean
|
|
210
177
|
|
|
211
178
|
Enables company fields inside the checkout:
|
|
212
|
-
|
|
213
179
|
- Company name
|
|
214
180
|
- VAT ID
|
|
215
181
|
|
|
@@ -219,9 +185,7 @@ Enable customer account deletion through the account section
|
|
|
219
185
|
|
|
220
186
|
#### customerXMagentoCacheIdDisable: boolean
|
|
221
187
|
|
|
222
|
-
X-Magento-Cache-Id allows Varnish to cache requests that are made in the browser
|
|
223
|
-
while users are logged in. For example the products query can now be cached for
|
|
224
|
-
logged in users.
|
|
188
|
+
X-Magento-Cache-Id allows Varnish to cache requests that are made in the browser while users are logged in. For example the products query can now be cached for logged in users.
|
|
225
189
|
|
|
226
190
|
This can be disabled when Varnish is running out of available memory.
|
|
227
191
|
|
|
@@ -233,22 +197,13 @@ Datalayer config
|
|
|
233
197
|
|
|
234
198
|
Debug configuration for GraphCommerce
|
|
235
199
|
|
|
236
|
-
#### demoMode: boolean = `true`
|
|
237
|
-
|
|
238
|
-
Enables some demo specific code that is probably not useful for a project:
|
|
239
|
-
|
|
240
|
-
- Adds the "BY GC" to the product list items.
|
|
241
|
-
- Adds "dominant_color" attribute swatches to the product list items.
|
|
242
|
-
- Creates a big list items in the product list.
|
|
243
|
-
|
|
244
200
|
#### enableGuestCheckoutLogin: boolean
|
|
245
201
|
|
|
246
|
-
Enable Guest Checkout Login:
|
|
247
|
-
|
|
248
|
-
the sign-up form is shown instead.
|
|
202
|
+
Enable Guest Checkout Login:
|
|
203
|
+
During customer login, GraphCommerce queries Magento to determine whether
|
|
204
|
+
the customer account already exists or not. If not, the sign-up form is shown instead.
|
|
249
205
|
|
|
250
|
-
For Magento versions, 2.4.7, 2.4.6-p1 and up, 2.4.5-p3 and up, 2.4.4-p4 and up,
|
|
251
|
-
the following setting must be set to Yes
|
|
206
|
+
For Magento versions, 2.4.7, 2.4.6-p1 and up, 2.4.5-p3 and up, 2.4.4-p4 and up, the following setting must be set to Yes
|
|
252
207
|
|
|
253
208
|
`Stores -> Configuration -> Sales -> Checkout -> Checkout Options -> Enable Guest Checkout Login`
|
|
254
209
|
|
|
@@ -266,42 +221,38 @@ To create an assetlinks.json file for the Android app.
|
|
|
266
221
|
|
|
267
222
|
#### googleRecaptchaKey: string
|
|
268
223
|
|
|
269
|
-
Google reCAPTCHA site key.
|
|
270
|
-
you are configuring different values for each locale.
|
|
224
|
+
Google reCAPTCHA site key.
|
|
225
|
+
When using reCAPTCHA, this value is required, even if you are configuring different values for each locale.
|
|
271
226
|
|
|
272
|
-
Get a site key and a secret key from
|
|
273
|
-
https://developers.google.com/recaptcha/docs/v3
|
|
227
|
+
Get a site key and a secret key from https://developers.google.com/recaptcha/docs/v3
|
|
274
228
|
|
|
275
|
-
The secret key should be added in the Magento admin panel (Stores >
|
|
276
|
-
Configuration > Security > Google ReCAPTCHA Storefront >
|
|
277
|
-
ReCAPTCHA can then be enabled/disabled for the different forms, separately
|
|
278
|
-
(Stores > Configuration > Security > Google ReCAPTCHA Storefront > Storefront)
|
|
229
|
+
The secret key should be added in the Magento admin panel (Stores > Configuration > Security > Google ReCAPTCHA Storefront > reCAPTCHA v3 Invisible)
|
|
230
|
+
ReCAPTCHA can then be enabled/disabled for the different forms, separately (Stores > Configuration > Security > Google ReCAPTCHA Storefront > Storefront)
|
|
279
231
|
|
|
280
232
|
#### googleTagmanagerId: string
|
|
281
233
|
|
|
282
234
|
The Google Tagmanager ID to be used on the site.
|
|
283
235
|
|
|
284
|
-
This value is required even if you are configuring different values for each
|
|
285
|
-
locale.
|
|
236
|
+
This value is required even if you are configuring different values for each locale.
|
|
286
237
|
|
|
287
238
|
#### graphqlMeshEditMode: boolean = `false`
|
|
288
239
|
|
|
289
|
-
The GraphQL Mesh will be loaded once and any modifications to resolvers will be
|
|
290
|
-
|
|
240
|
+
The GraphQL Mesh will be loaded once and any modifications to resolvers will be ignored. When developing
|
|
241
|
+
new resolvers this should be set to true.
|
|
291
242
|
|
|
292
243
|
#### hygraphManagementApi: string
|
|
293
244
|
|
|
294
245
|
Hygraph Management API. **Only used for migrations.**
|
|
295
246
|
|
|
296
|
-
Optional: If the hygraphEndpoint is configured with the 'High Performance
|
|
297
|
-
|
|
247
|
+
Optional: If the hygraphEndpoint is configured with the 'High Performance Content
|
|
248
|
+
API', this field is not required.
|
|
298
249
|
|
|
299
250
|
#### hygraphProjectId: string
|
|
300
251
|
|
|
301
252
|
Hygraph Project ID. **Only used for migrations.**
|
|
302
253
|
|
|
303
|
-
Optional: If the hygraphEndpoint is configured with the 'High Performance
|
|
304
|
-
|
|
254
|
+
Optional: If the hygraphEndpoint is configured with the 'High Performance Content
|
|
255
|
+
API', this field is not required.
|
|
305
256
|
|
|
306
257
|
#### hygraphWriteAccessToken: string
|
|
307
258
|
|
|
@@ -309,28 +260,25 @@ Hygraph Management SDK Authorization Token. **Only used for migrations.**
|
|
|
309
260
|
|
|
310
261
|
Project settings -> API Access -> Permanent Auth Tokens
|
|
311
262
|
|
|
312
|
-
1. Click
|
|
313
|
-
Access Token' and keep stage on 'Published'.
|
|
263
|
+
1. Click 'Add token' and give it a name, something like 'GraphCommerce Write Access Token' and keep stage on 'Published'.
|
|
314
264
|
2. Under 'Management API', click 'Yes, Initialize defaults'
|
|
315
|
-
3. Click 'Edit Permissions' and enable: 'Update' and 'Delete' permissions for
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
- Update existing
|
|
319
|
-
- Delete existing
|
|
320
|
-
- Update existing
|
|
321
|
-
- Delete existing
|
|
322
|
-
- Update existing
|
|
323
|
-
- Delete existing
|
|
324
|
-
- Update
|
|
325
|
-
- Delete
|
|
326
|
-
-
|
|
327
|
-
-
|
|
328
|
-
-
|
|
329
|
-
-
|
|
330
|
-
-
|
|
331
|
-
-
|
|
332
|
-
- Delete public content views
|
|
333
|
-
- Can see schema view
|
|
265
|
+
3. Click 'Edit Permissions' and enable: 'Update' and 'Delete' permissions for 'models', 'enumerations', 'fields', 'components' and 'sources'
|
|
266
|
+
- Update existing models
|
|
267
|
+
- Delete existing models
|
|
268
|
+
- Update existing fields
|
|
269
|
+
- Delete existing fields
|
|
270
|
+
- Update existing enumerations
|
|
271
|
+
- Delete existing enumerations
|
|
272
|
+
- Update existing components
|
|
273
|
+
- Delete existing components
|
|
274
|
+
- Update remote sources
|
|
275
|
+
- Delete remote sources
|
|
276
|
+
- Read existing environments
|
|
277
|
+
- Read public content views
|
|
278
|
+
- Create public content views
|
|
279
|
+
- Update public content views
|
|
280
|
+
- Delete public content views
|
|
281
|
+
- Can see schema view
|
|
334
282
|
|
|
335
283
|
```bash
|
|
336
284
|
GC_HYGRAPH_WRITE_ACCESS_TOKEN="AccessTokenFromHygraph"
|
|
@@ -341,14 +289,11 @@ yarn graphcommerce hygraph-migrate
|
|
|
341
289
|
|
|
342
290
|
Limit the static generation of SSG when building.
|
|
343
291
|
|
|
344
|
-
By default GraphCommerce will statically generate all product and category pages
|
|
345
|
-
during build. This can take quite a long time, to skip this step set this value
|
|
346
|
-
to true.
|
|
292
|
+
By default GraphCommerce will statically generate all product and category pages during build. This can take quite a long time, to skip this step set this value to true.
|
|
347
293
|
|
|
348
294
|
#### permissions: [GraphCommercePermissions](#GraphCommercePermissions)
|
|
349
295
|
|
|
350
|
-
Allows the option to require login or completely disable certain sections of the
|
|
351
|
-
site, can be overriden per storeview with the storefrontConfig
|
|
296
|
+
Allows the option to require login or completely disable certain sections of the site, can be overriden per storeview with the storefrontConfig
|
|
352
297
|
|
|
353
298
|
#### previewSecret: string
|
|
354
299
|
|
|
@@ -356,9 +301,9 @@ To enable next.js' preview mode, configure the secret you'd like to use.
|
|
|
356
301
|
|
|
357
302
|
#### productFiltersLayout: DEFAULT | SIDEBAR = `DEFAULT`
|
|
358
303
|
|
|
359
|
-
Layout how the filters are rendered.
|
|
360
|
-
|
|
361
|
-
and horizontal chips on mobile
|
|
304
|
+
Layout how the filters are rendered.
|
|
305
|
+
DEFAULT: Will be rendered as horzontal chips on desktop and mobile
|
|
306
|
+
SIDEBAR: Will be rendered as a sidebar on desktop and horizontal chips on mobile
|
|
362
307
|
|
|
363
308
|
#### productFiltersPro: boolean
|
|
364
309
|
|
|
@@ -368,14 +313,15 @@ Product filters with better UI for mobile and desktop.
|
|
|
368
313
|
|
|
369
314
|
Pagination variant for the product listings.
|
|
370
315
|
|
|
371
|
-
COMPACT means: "< Page X of Y >"
|
|
316
|
+
COMPACT means: "< Page X of Y >"
|
|
317
|
+
EXTENDED means: "< 1 2 ... 4 [5] 6 ... 10 11 >"
|
|
372
318
|
|
|
373
319
|
#### productRoute: string
|
|
374
320
|
|
|
375
|
-
By default we route products to /p/[url] but you can change this to
|
|
376
|
-
/product/[url] if you wish.
|
|
321
|
+
By default we route products to /p/[url] but you can change this to /product/[url] if you wish.
|
|
377
322
|
|
|
378
|
-
Default: '/p/'
|
|
323
|
+
Default: '/p/'
|
|
324
|
+
Example: '/product/'
|
|
379
325
|
|
|
380
326
|
#### recentlyViewedProducts: [RecentlyViewedProductsConfig](#RecentlyViewedProductsConfig)
|
|
381
327
|
|
|
@@ -383,8 +329,8 @@ Settings for recently viewed products
|
|
|
383
329
|
|
|
384
330
|
#### robotsAllow: boolean
|
|
385
331
|
|
|
386
|
-
Allow the site to be indexed by search engines.
|
|
387
|
-
will be set to disallow all.
|
|
332
|
+
Allow the site to be indexed by search engines.
|
|
333
|
+
If false, the robots.txt file will be set to disallow all.
|
|
388
334
|
|
|
389
335
|
#### sidebarGallery: [SidebarGalleryConfig](#SidebarGalleryConfig)
|
|
390
336
|
|
|
@@ -416,27 +362,22 @@ Enable debugging interface to debug sessions
|
|
|
416
362
|
|
|
417
363
|
#### webpackCircularDependencyPlugin: boolean
|
|
418
364
|
|
|
419
|
-
Cyclic dependencies can cause memory issues and other strange bugs.
|
|
420
|
-
will warn you when it detects a cyclic dependency.
|
|
365
|
+
Cyclic dependencies can cause memory issues and other strange bugs.
|
|
366
|
+
This plugin will warn you when it detects a cyclic dependency.
|
|
421
367
|
|
|
422
368
|
When running into memory issues, it can be useful to enable this plugin.
|
|
423
369
|
|
|
424
370
|
#### webpackDuplicatesPlugin: boolean
|
|
425
371
|
|
|
426
|
-
When updating packages it can happen that the same package is included with
|
|
427
|
-
different versions in the same project.
|
|
372
|
+
When updating packages it can happen that the same package is included with different versions in the same project.
|
|
428
373
|
|
|
429
374
|
Issues that this can cause are:
|
|
430
|
-
|
|
431
|
-
- The
|
|
432
|
-
bundle size.
|
|
433
|
-
- The Typescript types of the package are not compatible with each other,
|
|
434
|
-
causing Typescript errors.
|
|
375
|
+
- The same package is included multiple times in the bundle, increasing the bundle size.
|
|
376
|
+
- The Typescript types of the package are not compatible with each other, causing Typescript errors.
|
|
435
377
|
|
|
436
378
|
### GraphCommerceGooglePlaystoreConfig
|
|
437
379
|
|
|
438
|
-
See
|
|
439
|
-
https://developer.android.com/training/app-links/verify-android-applinks#web-assoc
|
|
380
|
+
See https://developer.android.com/training/app-links/verify-android-applinks#web-assoc
|
|
440
381
|
|
|
441
382
|
#### packageName: string (required)
|
|
442
383
|
|
|
@@ -456,18 +397,15 @@ Allows customers to change their billing address or locks it down.
|
|
|
456
397
|
|
|
457
398
|
#### cart: CUSTOMER_ONLY | DISABLED | ENABLED
|
|
458
399
|
|
|
459
|
-
Changes the availability of the add to cart buttons and the cart page to either
|
|
460
|
-
customer only or completely disables it.
|
|
400
|
+
Changes the availability of the add to cart buttons and the cart page to either customer only or completely disables it.
|
|
461
401
|
|
|
462
402
|
#### checkout: CUSTOMER_ONLY | DISABLED | ENABLED
|
|
463
403
|
|
|
464
|
-
Changes the availability of the checkout to either customer only or completely
|
|
465
|
-
disables it.
|
|
404
|
+
Changes the availability of the checkout to either customer only or completely disables it.
|
|
466
405
|
|
|
467
406
|
#### customerAccount: DISABLED | DISABLE_REGISTRATION | ENABLED
|
|
468
407
|
|
|
469
|
-
Enables / disabled the account section of the website. DISABLE_REGISTRATION will
|
|
470
|
-
only disable the registration page.
|
|
408
|
+
Enables / disabled the account section of the website. DISABLE_REGISTRATION will only disable the registration page.
|
|
471
409
|
|
|
472
410
|
#### website: ENABLED
|
|
473
411
|
|
|
@@ -479,12 +417,9 @@ All storefront configuration for the project
|
|
|
479
417
|
|
|
480
418
|
#### locale: string (required)
|
|
481
419
|
|
|
482
|
-
Must be a
|
|
483
|
-
[locale string](https://www.unicode.org/reports/tr35/tr35-59/tr35.html#Identifiers)
|
|
484
|
-
for automatic redirects to work.
|
|
420
|
+
Must be a [locale string](https://www.unicode.org/reports/tr35/tr35-59/tr35.html#Identifiers) for automatic redirects to work.
|
|
485
421
|
|
|
486
|
-
This value can be used as a sub-path identifier only, make sure linguiLocale is
|
|
487
|
-
configured for each URL.
|
|
422
|
+
This value can be used as a sub-path identifier only, make sure linguiLocale is configured for each URL.
|
|
488
423
|
|
|
489
424
|
#### magentoStoreCode: string (required)
|
|
490
425
|
|
|
@@ -493,7 +428,6 @@ Magento store code.
|
|
|
493
428
|
Stores => All Stores => [Store View] => Store View Code
|
|
494
429
|
|
|
495
430
|
Examples:
|
|
496
|
-
|
|
497
431
|
- default
|
|
498
432
|
- en-us
|
|
499
433
|
- b2b-us
|
|
@@ -503,27 +437,23 @@ Examples:
|
|
|
503
437
|
The canonical base URL is used for SEO purposes.
|
|
504
438
|
|
|
505
439
|
Examples:
|
|
506
|
-
|
|
507
440
|
- https://example.com
|
|
508
441
|
- https://example.com/en
|
|
509
442
|
- https://example.com/en-US
|
|
510
443
|
|
|
511
444
|
#### cartDisplayPricesInclTax: boolean
|
|
512
445
|
|
|
513
|
-
Due to a limitation of the GraphQL API it is not possible to determine if a cart
|
|
514
|
-
should be displayed including or excluding tax.
|
|
446
|
+
Due to a limitation of the GraphQL API it is not possible to determine if a cart should be displayed including or excluding tax.
|
|
515
447
|
|
|
516
448
|
#### customerCompanyFieldsEnable: boolean
|
|
517
449
|
|
|
518
450
|
Enables company fields inside the checkout:
|
|
519
|
-
|
|
520
451
|
- Company name
|
|
521
452
|
- VAT ID
|
|
522
453
|
|
|
523
454
|
#### defaultLocale: boolean
|
|
524
455
|
|
|
525
456
|
There can only be one entry with defaultLocale set to true.
|
|
526
|
-
|
|
527
457
|
- If there are more, the first one is used.
|
|
528
458
|
- If there is none, the first entry is used.
|
|
529
459
|
|
|
@@ -545,46 +475,35 @@ Locale specific google reCAPTCHA key.
|
|
|
545
475
|
|
|
546
476
|
The Google Tagmanager ID to be used per locale.
|
|
547
477
|
|
|
548
|
-
#### hygraphLocales: string[]
|
|
549
|
-
|
|
550
|
-
Add a gcms-locales header to make sure queries return in a certain language, can
|
|
551
|
-
be an array to define fallbacks.
|
|
552
|
-
|
|
553
478
|
#### linguiLocale: string
|
|
554
479
|
|
|
555
|
-
Custom locale used to load the .po files. Must be a valid locale, also used for
|
|
556
|
-
Intl functions.
|
|
480
|
+
Custom locale used to load the .po files. Must be a valid locale, also used for Intl functions.
|
|
557
481
|
|
|
558
482
|
#### permissions: [GraphCommercePermissions](#GraphCommercePermissions)
|
|
559
483
|
|
|
560
|
-
Allows the option to require login or completely disable certain sections of the
|
|
561
|
-
site on a per store basis
|
|
484
|
+
Allows the option to require login or completely disable certain sections of the site on a per store basis
|
|
562
485
|
|
|
563
486
|
#### robotsAllow: boolean
|
|
564
487
|
|
|
565
|
-
Allow the site to be indexed by search engines.
|
|
566
|
-
will be set to disallow all.
|
|
488
|
+
Allow the site to be indexed by search engines.
|
|
489
|
+
If false, the robots.txt file will be set to disallow all.
|
|
567
490
|
|
|
568
491
|
### MagentoConfigurableVariantValues
|
|
569
492
|
|
|
570
|
-
Options to configure which values will be replaced when a variant is selected on
|
|
571
|
-
the product page.
|
|
493
|
+
Options to configure which values will be replaced when a variant is selected on the product page.
|
|
572
494
|
|
|
573
495
|
#### content: boolean
|
|
574
496
|
|
|
575
|
-
Use the name, description, short description and meta data from the configured
|
|
576
|
-
variant
|
|
497
|
+
Use the name, description, short description and meta data from the configured variant
|
|
577
498
|
|
|
578
499
|
#### gallery: boolean
|
|
579
500
|
|
|
580
|
-
This option enables the automatic update of product gallery images on the
|
|
581
|
-
|
|
582
|
-
the selected variant differ from the currently displayed images.
|
|
501
|
+
This option enables the automatic update of product gallery images on the product page when a variant is selected,
|
|
502
|
+
provided that the gallery images for the selected variant differ from the currently displayed images.
|
|
583
503
|
|
|
584
504
|
#### url: boolean
|
|
585
505
|
|
|
586
|
-
When a variant is selected the URL of the product will be changed in the address
|
|
587
|
-
bar.
|
|
506
|
+
When a variant is selected the URL of the product will be changed in the address bar.
|
|
588
507
|
|
|
589
508
|
This only happens when the actual variant is can be accessed by the URL.
|
|
590
509
|
|
|
@@ -602,9 +521,8 @@ Number of recently viewed products to be stored in localStorage
|
|
|
602
521
|
|
|
603
522
|
### SidebarGalleryConfig
|
|
604
523
|
|
|
605
|
-
SidebarGalleryConfig will contain all configuration values for the Sidebar
|
|
606
|
-
Gallery component.
|
|
524
|
+
SidebarGalleryConfig will contain all configuration values for the Sidebar Gallery component.
|
|
607
525
|
|
|
608
526
|
#### paginationVariant: DOTS | THUMBNAILS_BOTTOM
|
|
609
527
|
|
|
610
|
-
Variant used for the pagination
|
|
528
|
+
Variant used for the pagination
|
package/framework/icons.md
CHANGED
package/framework/theming.md
CHANGED
|
@@ -37,7 +37,7 @@ updated in real-time:
|
|
|
37
37
|
|
|
38
38
|
You can search through your codebase to discover which components will be
|
|
39
39
|
affected by your changes. For example, search for occurrences of
|
|
40
|
-
`theme.palette.primary.main`.
|
|
40
|
+
`theme.vars.palette.primary.main`.
|
|
41
41
|
|
|
42
42
|
### Best practices
|
|
43
43
|
|
|
@@ -84,7 +84,7 @@ property:
|
|
|
84
84
|
```tsx
|
|
85
85
|
sx={{
|
|
86
86
|
borderRadius: 2,
|
|
87
|
-
backgroundColor: (theme) => theme.palette.primary.main,
|
|
87
|
+
backgroundColor: (theme) => theme.vars.palette.primary.main,
|
|
88
88
|
}}
|
|
89
89
|
```
|
|
90
90
|
|
|
@@ -92,8 +92,8 @@ To use the theme object for multiple property's:
|
|
|
92
92
|
|
|
93
93
|
```tsx
|
|
94
94
|
sx={(theme) => ({
|
|
95
|
-
borderRadius: `1px solid ${theme.palette.divider}`,
|
|
96
|
-
backgroundColor: theme.palette.primary.main,
|
|
95
|
+
borderRadius: `1px solid ${theme.vars.palette.divider}`,
|
|
96
|
+
backgroundColor: theme.vars.palette.primary.main,
|
|
97
97
|
})}
|
|
98
98
|
```
|
|
99
99
|
|
|
@@ -110,10 +110,10 @@ const AnimatedButton = styled(Button, { name: 'animatedButton' })(
|
|
|
110
110
|
({ theme }) => ({
|
|
111
111
|
'@keyframes pulse': {
|
|
112
112
|
'0%': {
|
|
113
|
-
boxShadow: `0 0 0 0 ${theme.palette.primary.main}`,
|
|
113
|
+
boxShadow: `0 0 0 0 ${theme.vars.palette.primary.main}`,
|
|
114
114
|
},
|
|
115
115
|
'100%': {
|
|
116
|
-
boxShadow: `0 0 0 15px ${theme.palette.background.default}`,
|
|
116
|
+
boxShadow: `0 0 0 15px ${theme.vars.palette.background.default}`,
|
|
117
117
|
},
|
|
118
118
|
},
|
|
119
119
|
animation: 'pulse 1.5s infinite',
|
package/framework/typography.md
CHANGED
|
@@ -61,8 +61,8 @@ https://user-images.githubusercontent.com/1251986/227236765-503ccaac-6499-48df-b
|
|
|
61
61
|
## Page routing
|
|
62
62
|
|
|
63
63
|
GraphCommerce uses Next.js file-based
|
|
64
|
-
[page routing ↗](https://nextjs.org/docs/routing/introduction). The files
|
|
65
|
-
|
|
64
|
+
[page routing ↗](https://nextjs.org/docs/routing/introduction). The files inside
|
|
65
|
+
the `📁 /pages` directory handle routing. Modify these files to meet your
|
|
66
66
|
requirements or [build a custom page](./pages.md).
|
|
67
67
|
|
|
68
68
|
- Product pages: `📄 /p/[...url].tsx`
|
|
@@ -103,7 +103,7 @@ sx={{ '& .MuiBox-root': { background: 'blue' }}}
|
|
|
103
103
|
Pass the theme object to use global values
|
|
104
104
|
|
|
105
105
|
```tsx
|
|
106
|
-
sx={(theme)=>({ margin: theme.spacings.lg, color: theme.palette.text.secondary })}
|
|
106
|
+
sx={(theme)=>({ margin: theme.spacings.lg, color: theme.vars.palette.text.secondary })}
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
## Customization
|
package/package.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"name": "@graphcommerce/docs",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/docs",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce/docs",
|
|
5
|
-
"version": "10.0.0-canary.
|
|
5
|
+
"version": "10.0.0-canary.72",
|
|
6
6
|
"sideEffects": true,
|
|
7
7
|
"peerDependencies": {
|
|
8
|
-
"@graphcommerce/prettier-config-pwa": "^10.0.0-canary.
|
|
8
|
+
"@graphcommerce/prettier-config-pwa": "^10.0.0-canary.72"
|
|
9
9
|
},
|
|
10
10
|
"prettier": "@graphcommerce/prettier-config-pwa"
|
|
11
11
|
}
|
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
Depending on the amounts of customisations you've made, there are some manual
|
|
4
4
|
steps.
|
|
5
5
|
|
|
6
|
+
## Theme: Replace theme.palette with theme.vars.palette
|
|
7
|
+
|
|
8
|
+
To support CSS variables properly, replace `theme.palette` with
|
|
9
|
+
`theme.vars.palette` in your theme customizations:
|
|
10
|
+
|
|
11
|
+
```diff
|
|
12
|
+
- color: theme.palette.primary.main,
|
|
13
|
+
+ color: theme.vars.palette.primary.main,
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Theme: Replace dark mode checks with theme.applyStyles
|
|
17
|
+
|
|
18
|
+
Replace conditional dark mode checks with `theme.applyStyles('dark', ...)`:
|
|
19
|
+
|
|
20
|
+
```diff
|
|
21
|
+
- background: theme.palette.mode === 'dark'
|
|
22
|
+
- ? lighten(theme.palette.background.default, 0.15)
|
|
23
|
+
- : theme.palette.background.default,
|
|
24
|
+
+ background: theme.vars.palette.background.default,
|
|
25
|
+
+ ...theme.applyStyles('dark', {
|
|
26
|
+
+ background: theme.lighten(theme.vars.palette.background.default, 0.15),
|
|
27
|
+
+ }),
|
|
28
|
+
```
|
|
29
|
+
|
|
6
30
|
## Trans and t import replacements
|
|
7
31
|
|
|
8
32
|
```tsx
|
package/upgrading/readme.md
CHANGED
|
@@ -74,6 +74,7 @@ packages:
|
|
|
74
74
|
|
|
75
75
|
- `rm yarn.lock && yarn` Remove lock and install the dependencies
|
|
76
76
|
- `yarn codegen` Converts all .graphql files to typescript files
|
|
77
|
+
- `rm -r .next`
|
|
77
78
|
- `yarn dev` Run the app
|
|
78
79
|
|
|
79
80
|
### Resolving diff issues
|
|
@@ -106,6 +107,9 @@ After resolving the diff issues, manually process upgrade instructions:
|
|
|
106
107
|
|
|
107
108
|
- [Upgrading to GraphCommerce 5 to 6](../upgrading/graphcommerce-5-to-6.md)
|
|
108
109
|
- [Upgrading to GraphCommerce 6 to 7](../upgrading/graphcommerce-6-to-7.md)
|
|
110
|
+
- [Upgrading to GraphCommerce 7 to 8](../upgrading/graphcommerce-7-to-8.md)
|
|
111
|
+
- [Upgrading to GraphCommerce 8 to 9](../upgrading/graphcommerce-8-to-9.md)
|
|
112
|
+
- [Upgrading to GraphCommerce 9 to 10](../upgrading/graphcommerce-9-to-10.md)
|
|
109
113
|
|
|
110
114
|
Run and validate your local environment:
|
|
111
115
|
|