@gem-sdk/components 2.0.0-dev.722 → 2.0.0-dev.724
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/dist/cjs/carousel/setting/configs/uiV2.js +15 -0
- package/dist/cjs/product/components/ProductVariants/hooks/useGpVariants.js +3 -2
- package/dist/cjs/product/components/ProductWrap/hook/useProductSetting.js +2 -1
- package/dist/cjs/product/setting/product/configs/product-presets/product-2-col.js +4 -2
- package/dist/cjs/product/setting/product/configs/product-presets/product-default.js +4 -2
- package/dist/cjs/product/setting/product/configs/uiV2.js +2 -2
- package/dist/cjs/product/setting/product-variant/configs/uiV2.js +1 -10
- package/dist/esm/carousel/setting/configs/uiV2.js +15 -0
- package/dist/esm/product/components/ProductVariants/hooks/useGpVariants.js +3 -2
- package/dist/esm/product/components/ProductWrap/hook/useProductSetting.js +2 -1
- package/dist/esm/product/setting/product/configs/product-presets/product-2-col.js +4 -2
- package/dist/esm/product/setting/product/configs/product-presets/product-default.js +4 -2
- package/dist/esm/product/setting/product/configs/uiV2.js +2 -2
- package/dist/esm/product/setting/product-variant/configs/uiV2.js +1 -10
- package/dist/types/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -173,6 +173,9 @@ const carouselDotsSettings = {
|
|
|
173
173
|
},
|
|
174
174
|
setting: {
|
|
175
175
|
id: 'dotStyle'
|
|
176
|
+
},
|
|
177
|
+
options: {
|
|
178
|
+
hiddenSwitchDeviceIcon: true
|
|
176
179
|
}
|
|
177
180
|
},
|
|
178
181
|
{
|
|
@@ -182,6 +185,9 @@ const carouselDotsSettings = {
|
|
|
182
185
|
},
|
|
183
186
|
setting: {
|
|
184
187
|
id: 'dotActiveColor'
|
|
188
|
+
},
|
|
189
|
+
options: {
|
|
190
|
+
hiddenSwitchDeviceIcon: true
|
|
185
191
|
}
|
|
186
192
|
},
|
|
187
193
|
{
|
|
@@ -191,6 +197,9 @@ const carouselDotsSettings = {
|
|
|
191
197
|
},
|
|
192
198
|
setting: {
|
|
193
199
|
id: 'dotColor'
|
|
200
|
+
},
|
|
201
|
+
options: {
|
|
202
|
+
hiddenSwitchDeviceIcon: true
|
|
194
203
|
}
|
|
195
204
|
}
|
|
196
205
|
],
|
|
@@ -203,6 +212,9 @@ const carouselDotsSettings = {
|
|
|
203
212
|
},
|
|
204
213
|
setting: {
|
|
205
214
|
id: 'dotSize'
|
|
215
|
+
},
|
|
216
|
+
options: {
|
|
217
|
+
hiddenSwitchDeviceIcon: true
|
|
206
218
|
}
|
|
207
219
|
},
|
|
208
220
|
{
|
|
@@ -212,6 +224,9 @@ const carouselDotsSettings = {
|
|
|
212
224
|
},
|
|
213
225
|
setting: {
|
|
214
226
|
id: 'dotGapToCarousel'
|
|
227
|
+
},
|
|
228
|
+
options: {
|
|
229
|
+
hiddenSwitchDeviceIcon: true
|
|
215
230
|
}
|
|
216
231
|
}
|
|
217
232
|
]
|
|
@@ -22,14 +22,15 @@ const useGpVariants = (props, variants)=>{
|
|
|
22
22
|
});
|
|
23
23
|
const mode = core.useEditorMode();
|
|
24
24
|
const { selectedOptions, setSelectedOption, forceSelectedOption } = core.useSelectedOption();
|
|
25
|
-
const { setHasPreSelected } = core.useHasPreSelected();
|
|
25
|
+
const { setHasPreSelected, hasPreSelected: productHasPreSelected } = core.useHasPreSelected();
|
|
26
26
|
const [variantId, setVariantId] = React.useState('');
|
|
27
27
|
React.useEffect(()=>{
|
|
28
28
|
const url = new URL(window.location.href);
|
|
29
29
|
const variantParam = url.searchParams.get(VARIANT_PARAM_PATH);
|
|
30
|
-
setHasPreSelected(hasPreSelected || !!variantParam);
|
|
30
|
+
if (productHasPreSelected === undefined) setHasPreSelected(hasPreSelected || !!variantParam);
|
|
31
31
|
}, [
|
|
32
32
|
hasPreSelected,
|
|
33
|
+
productHasPreSelected,
|
|
33
34
|
setHasPreSelected
|
|
34
35
|
]);
|
|
35
36
|
React.useEffect(()=>{
|
|
@@ -33,7 +33,8 @@ const useProductSetting = (props)=>{
|
|
|
33
33
|
quantity,
|
|
34
34
|
readOnly,
|
|
35
35
|
isSyncProduct,
|
|
36
|
-
key: `uid-${product?.id}-${initialVariantId ?? ''}
|
|
36
|
+
key: `uid-${product?.id}-${initialVariantId ?? ''}`,
|
|
37
|
+
hasPreSelected: productSetting?.hasPreSelected
|
|
37
38
|
}), [
|
|
38
39
|
initialVariantId,
|
|
39
40
|
isSyncProduct,
|
|
@@ -33,7 +33,8 @@ const product2Col = {
|
|
|
33
33
|
mobile: {
|
|
34
34
|
cols: [
|
|
35
35
|
12
|
|
36
|
-
]
|
|
36
|
+
],
|
|
37
|
+
display: 'fill'
|
|
37
38
|
}
|
|
38
39
|
},
|
|
39
40
|
productSetting: {
|
|
@@ -286,7 +287,8 @@ const product2ColProductPage = {
|
|
|
286
287
|
mobile: {
|
|
287
288
|
cols: [
|
|
288
289
|
12
|
|
289
|
-
]
|
|
290
|
+
],
|
|
291
|
+
display: 'fill'
|
|
290
292
|
}
|
|
291
293
|
},
|
|
292
294
|
productSetting: {
|
|
@@ -34,7 +34,8 @@ const productDefault = {
|
|
|
34
34
|
mobile: {
|
|
35
35
|
cols: [
|
|
36
36
|
12
|
|
37
|
-
]
|
|
37
|
+
],
|
|
38
|
+
display: 'fill'
|
|
38
39
|
}
|
|
39
40
|
},
|
|
40
41
|
productSetting: {
|
|
@@ -288,7 +289,8 @@ const productDynamicProductPage = {
|
|
|
288
289
|
mobile: {
|
|
289
290
|
cols: [
|
|
290
291
|
12
|
|
291
|
-
]
|
|
292
|
+
],
|
|
293
|
+
display: 'fill'
|
|
292
294
|
}
|
|
293
295
|
},
|
|
294
296
|
productSetting: {
|
|
@@ -249,7 +249,7 @@ const SettingUIV2 = [
|
|
|
249
249
|
label: {
|
|
250
250
|
en: 'Align'
|
|
251
251
|
},
|
|
252
|
-
conditionDisplay: `pageType != "POST_PURCHASE" && (layout.display
|
|
252
|
+
conditionDisplay: `pageType != "POST_PURCHASE" && (layout.display === 'fit' || (!!layout.cols && layout.cols.length > 1))`,
|
|
253
253
|
controls: [
|
|
254
254
|
{
|
|
255
255
|
id: 'verticalAlign',
|
|
@@ -269,7 +269,7 @@ const SettingUIV2 = [
|
|
|
269
269
|
setting: {
|
|
270
270
|
id: 'horizontalAlign'
|
|
271
271
|
},
|
|
272
|
-
conditionDisplay: `layout.display
|
|
272
|
+
conditionDisplay: `layout.display == 'fit'`,
|
|
273
273
|
options: {
|
|
274
274
|
disableMessage: `Horizontal Align is available when layout is "Fit to content"`
|
|
275
275
|
}
|
|
@@ -487,22 +487,13 @@ const SettingUIV2 = [
|
|
|
487
487
|
}
|
|
488
488
|
},
|
|
489
489
|
{
|
|
490
|
-
label: {
|
|
491
|
-
en: 'Default option'
|
|
492
|
-
},
|
|
493
|
-
setting: {
|
|
494
|
-
id: 'hasPreSelected'
|
|
495
|
-
}
|
|
496
|
-
},
|
|
497
|
-
{
|
|
498
|
-
conditionDisplay: 'hasPreSelected == true',
|
|
499
490
|
layout: 'vertical',
|
|
500
491
|
setting: {
|
|
501
492
|
id: 'selectVariantDefault'
|
|
502
493
|
}
|
|
503
494
|
},
|
|
504
495
|
{
|
|
505
|
-
conditionDisplay: 'hasPreSelected == false',
|
|
496
|
+
conditionDisplay: 'productSetting?.hasPreSelected === false || (productSetting?.hasPreSelected === undefined && hasPreSelected == false)',
|
|
506
497
|
label: {
|
|
507
498
|
en: 'Blank option text'
|
|
508
499
|
},
|
|
@@ -171,6 +171,9 @@ const carouselDotsSettings = {
|
|
|
171
171
|
},
|
|
172
172
|
setting: {
|
|
173
173
|
id: 'dotStyle'
|
|
174
|
+
},
|
|
175
|
+
options: {
|
|
176
|
+
hiddenSwitchDeviceIcon: true
|
|
174
177
|
}
|
|
175
178
|
},
|
|
176
179
|
{
|
|
@@ -180,6 +183,9 @@ const carouselDotsSettings = {
|
|
|
180
183
|
},
|
|
181
184
|
setting: {
|
|
182
185
|
id: 'dotActiveColor'
|
|
186
|
+
},
|
|
187
|
+
options: {
|
|
188
|
+
hiddenSwitchDeviceIcon: true
|
|
183
189
|
}
|
|
184
190
|
},
|
|
185
191
|
{
|
|
@@ -189,6 +195,9 @@ const carouselDotsSettings = {
|
|
|
189
195
|
},
|
|
190
196
|
setting: {
|
|
191
197
|
id: 'dotColor'
|
|
198
|
+
},
|
|
199
|
+
options: {
|
|
200
|
+
hiddenSwitchDeviceIcon: true
|
|
192
201
|
}
|
|
193
202
|
}
|
|
194
203
|
],
|
|
@@ -201,6 +210,9 @@ const carouselDotsSettings = {
|
|
|
201
210
|
},
|
|
202
211
|
setting: {
|
|
203
212
|
id: 'dotSize'
|
|
213
|
+
},
|
|
214
|
+
options: {
|
|
215
|
+
hiddenSwitchDeviceIcon: true
|
|
204
216
|
}
|
|
205
217
|
},
|
|
206
218
|
{
|
|
@@ -210,6 +222,9 @@ const carouselDotsSettings = {
|
|
|
210
222
|
},
|
|
211
223
|
setting: {
|
|
212
224
|
id: 'dotGapToCarousel'
|
|
225
|
+
},
|
|
226
|
+
options: {
|
|
227
|
+
hiddenSwitchDeviceIcon: true
|
|
213
228
|
}
|
|
214
229
|
}
|
|
215
230
|
]
|
|
@@ -20,14 +20,15 @@ const useGpVariants = (props, variants)=>{
|
|
|
20
20
|
});
|
|
21
21
|
const mode = useEditorMode();
|
|
22
22
|
const { selectedOptions, setSelectedOption, forceSelectedOption } = useSelectedOption();
|
|
23
|
-
const { setHasPreSelected } = useHasPreSelected();
|
|
23
|
+
const { setHasPreSelected, hasPreSelected: productHasPreSelected } = useHasPreSelected();
|
|
24
24
|
const [variantId, setVariantId] = useState('');
|
|
25
25
|
useEffect(()=>{
|
|
26
26
|
const url = new URL(window.location.href);
|
|
27
27
|
const variantParam = url.searchParams.get(VARIANT_PARAM_PATH);
|
|
28
|
-
setHasPreSelected(hasPreSelected || !!variantParam);
|
|
28
|
+
if (productHasPreSelected === undefined) setHasPreSelected(hasPreSelected || !!variantParam);
|
|
29
29
|
}, [
|
|
30
30
|
hasPreSelected,
|
|
31
|
+
productHasPreSelected,
|
|
31
32
|
setHasPreSelected
|
|
32
33
|
]);
|
|
33
34
|
useEffect(()=>{
|
|
@@ -31,7 +31,8 @@ const useProductSetting = (props)=>{
|
|
|
31
31
|
quantity,
|
|
32
32
|
readOnly,
|
|
33
33
|
isSyncProduct,
|
|
34
|
-
key: `uid-${product?.id}-${initialVariantId ?? ''}
|
|
34
|
+
key: `uid-${product?.id}-${initialVariantId ?? ''}`,
|
|
35
|
+
hasPreSelected: productSetting?.hasPreSelected
|
|
35
36
|
}), [
|
|
36
37
|
initialVariantId,
|
|
37
38
|
isSyncProduct,
|
|
@@ -31,7 +31,8 @@ const product2Col = {
|
|
|
31
31
|
mobile: {
|
|
32
32
|
cols: [
|
|
33
33
|
12
|
|
34
|
-
]
|
|
34
|
+
],
|
|
35
|
+
display: 'fill'
|
|
35
36
|
}
|
|
36
37
|
},
|
|
37
38
|
productSetting: {
|
|
@@ -284,7 +285,8 @@ const product2ColProductPage = {
|
|
|
284
285
|
mobile: {
|
|
285
286
|
cols: [
|
|
286
287
|
12
|
|
287
|
-
]
|
|
288
|
+
],
|
|
289
|
+
display: 'fill'
|
|
288
290
|
}
|
|
289
291
|
},
|
|
290
292
|
productSetting: {
|
|
@@ -32,7 +32,8 @@ const productDefault = {
|
|
|
32
32
|
mobile: {
|
|
33
33
|
cols: [
|
|
34
34
|
12
|
|
35
|
-
]
|
|
35
|
+
],
|
|
36
|
+
display: 'fill'
|
|
36
37
|
}
|
|
37
38
|
},
|
|
38
39
|
productSetting: {
|
|
@@ -286,7 +287,8 @@ const productDynamicProductPage = {
|
|
|
286
287
|
mobile: {
|
|
287
288
|
cols: [
|
|
288
289
|
12
|
|
289
|
-
]
|
|
290
|
+
],
|
|
291
|
+
display: 'fill'
|
|
290
292
|
}
|
|
291
293
|
},
|
|
292
294
|
productSetting: {
|
|
@@ -247,7 +247,7 @@ const SettingUIV2 = [
|
|
|
247
247
|
label: {
|
|
248
248
|
en: 'Align'
|
|
249
249
|
},
|
|
250
|
-
conditionDisplay: `pageType != "POST_PURCHASE" && (layout.display
|
|
250
|
+
conditionDisplay: `pageType != "POST_PURCHASE" && (layout.display === 'fit' || (!!layout.cols && layout.cols.length > 1))`,
|
|
251
251
|
controls: [
|
|
252
252
|
{
|
|
253
253
|
id: 'verticalAlign',
|
|
@@ -267,7 +267,7 @@ const SettingUIV2 = [
|
|
|
267
267
|
setting: {
|
|
268
268
|
id: 'horizontalAlign'
|
|
269
269
|
},
|
|
270
|
-
conditionDisplay: `layout.display
|
|
270
|
+
conditionDisplay: `layout.display == 'fit'`,
|
|
271
271
|
options: {
|
|
272
272
|
disableMessage: `Horizontal Align is available when layout is "Fit to content"`
|
|
273
273
|
}
|
|
@@ -485,22 +485,13 @@ const SettingUIV2 = [
|
|
|
485
485
|
}
|
|
486
486
|
},
|
|
487
487
|
{
|
|
488
|
-
label: {
|
|
489
|
-
en: 'Default option'
|
|
490
|
-
},
|
|
491
|
-
setting: {
|
|
492
|
-
id: 'hasPreSelected'
|
|
493
|
-
}
|
|
494
|
-
},
|
|
495
|
-
{
|
|
496
|
-
conditionDisplay: 'hasPreSelected == true',
|
|
497
488
|
layout: 'vertical',
|
|
498
489
|
setting: {
|
|
499
490
|
id: 'selectVariantDefault'
|
|
500
491
|
}
|
|
501
492
|
},
|
|
502
493
|
{
|
|
503
|
-
conditionDisplay: 'hasPreSelected == false',
|
|
494
|
+
conditionDisplay: 'productSetting?.hasPreSelected === false || (productSetting?.hasPreSelected === undefined && hasPreSelected == false)',
|
|
504
495
|
label: {
|
|
505
496
|
en: 'Blank option text'
|
|
506
497
|
},
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.724",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"scan-all-text": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/scan-all-text && node ./scripts/scan-all-text"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@gem-sdk/core": "2.0.0-dev.
|
|
28
|
+
"@gem-sdk/core": "2.0.0-dev.724",
|
|
29
29
|
"@gem-sdk/styles": "2.0.0-dev.703",
|
|
30
30
|
"@gem-sdk/system": "2.0.0-dev.695",
|
|
31
31
|
"@types/react-transition-group": "^4.4.5",
|