@gem-sdk/components 2.0.0-dev.410 → 2.0.0-dev.412
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/button/setting/configs/settings.js +1 -2
- package/dist/cjs/grid/row/commons/getClass.js +1 -1
- package/dist/cjs/grid/row/hooks/useRowSetting.js +1 -1
- package/dist/cjs/grid/row/setting/configs/settings.js +2 -16
- package/dist/cjs/grid/section/setting/configs/settings.js +16 -0
- package/dist/cjs/product/components/ProductProperties/ProductProperties.js +5 -1
- package/dist/cjs/product/components/ProductQuantity/common/getAttrs.js +1 -1
- package/dist/cjs/product/components/ProductQuantity/common/getClasses.js +3 -5
- package/dist/cjs/product/components/ProductQuantity/index.js +0 -1
- package/dist/cjs/product/components/ProductQuantity/index.liquid.js +0 -1
- package/dist/cjs/product/setting/product-properties/configs/settingsV2.js +4 -10
- package/dist/cjs/product/setting/product-quantity/configs/uiV2.js +1 -0
- package/dist/esm/button/setting/configs/settings.js +1 -2
- package/dist/esm/grid/row/commons/getClass.js +1 -1
- package/dist/esm/grid/row/hooks/useRowSetting.js +2 -2
- package/dist/esm/grid/row/setting/configs/settings.js +2 -16
- package/dist/esm/grid/section/setting/configs/settings.js +16 -0
- package/dist/esm/product/components/ProductProperties/ProductProperties.js +5 -1
- package/dist/esm/product/components/ProductQuantity/common/getAttrs.js +1 -1
- package/dist/esm/product/components/ProductQuantity/common/getClasses.js +3 -5
- package/dist/esm/product/components/ProductQuantity/index.js +0 -1
- package/dist/esm/product/components/ProductQuantity/index.liquid.js +0 -1
- package/dist/esm/product/setting/product-properties/configs/settingsV2.js +4 -10
- package/dist/esm/product/setting/product-quantity/configs/uiV2.js +1 -0
- package/package.json +2 -2
|
@@ -26,7 +26,7 @@ const getClass = (props)=>{
|
|
|
26
26
|
'gp-mx-auto gp-max-w-full [&_*]:gp-max-w-full': true
|
|
27
27
|
});
|
|
28
28
|
const wrapperYoutubeClasses = system.createClass({
|
|
29
|
-
'gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none': true
|
|
29
|
+
'gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none gp-background-article': true
|
|
30
30
|
});
|
|
31
31
|
const iframeYoutubeClasses = system.createClass({
|
|
32
32
|
'!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]': true
|
|
@@ -13,7 +13,7 @@ const useRowSettings = (rowProps)=>{
|
|
|
13
13
|
const [cacheHeightOutViewport, setCacheHeightOutViewport] = React.useState(500);
|
|
14
14
|
const mode = core.useEditorMode();
|
|
15
15
|
const pageType = core.usePageType();
|
|
16
|
-
const bgVideo = core.
|
|
16
|
+
const bgVideo = core.getBgVideoByDevice(background, currentDevice);
|
|
17
17
|
const isRowEmpty = React.useMemo(()=>{
|
|
18
18
|
return core.isEmptyChildren(children);
|
|
19
19
|
}, [
|
|
@@ -223,6 +223,7 @@ const RowSettings = [
|
|
|
223
223
|
units: [
|
|
224
224
|
'%'
|
|
225
225
|
],
|
|
226
|
+
showDefaultUnit: true,
|
|
226
227
|
devices: {
|
|
227
228
|
desktop: {
|
|
228
229
|
default: '1%'
|
|
@@ -236,22 +237,7 @@ const RowSettings = [
|
|
|
236
237
|
showVideo: true,
|
|
237
238
|
devices: {
|
|
238
239
|
desktop: {
|
|
239
|
-
default:
|
|
240
|
-
type: 'color',
|
|
241
|
-
color: 'transparent',
|
|
242
|
-
image: {
|
|
243
|
-
src: '',
|
|
244
|
-
width: 0,
|
|
245
|
-
height: 0
|
|
246
|
-
},
|
|
247
|
-
size: 'cover',
|
|
248
|
-
position: {
|
|
249
|
-
x: 50,
|
|
250
|
-
y: 50
|
|
251
|
-
},
|
|
252
|
-
repeat: 'no-repeat',
|
|
253
|
-
attachment: 'scroll'
|
|
254
|
-
}
|
|
240
|
+
default: undefined
|
|
255
241
|
}
|
|
256
242
|
},
|
|
257
243
|
compoDefaultValue: {
|
|
@@ -218,6 +218,22 @@ const SectionSettings = [
|
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
},
|
|
221
|
+
{
|
|
222
|
+
id: 'columnGap',
|
|
223
|
+
type: 'input:slider',
|
|
224
|
+
min: 0,
|
|
225
|
+
max: 100,
|
|
226
|
+
step: 1,
|
|
227
|
+
units: [
|
|
228
|
+
'%'
|
|
229
|
+
],
|
|
230
|
+
showDefaultUnit: true,
|
|
231
|
+
devices: {
|
|
232
|
+
desktop: {
|
|
233
|
+
default: '0%'
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
},
|
|
221
237
|
{
|
|
222
238
|
id: 'background',
|
|
223
239
|
type: 'background-media',
|
|
@@ -92,6 +92,9 @@ const ProductProperties = ({ setting, styles, builderProps })=>{
|
|
|
92
92
|
]);
|
|
93
93
|
const checkLength = React.useCallback((value)=>{
|
|
94
94
|
const length = value?.length ?? 0;
|
|
95
|
+
if (!required && length === 0) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
95
98
|
if (numberOnly) {
|
|
96
99
|
return (Number(minNumber) || 0) <= Number(value) && Number(length) <= (Number(maxNumber) || 0);
|
|
97
100
|
}
|
|
@@ -101,7 +104,8 @@ const ProductProperties = ({ setting, styles, builderProps })=>{
|
|
|
101
104
|
maxNumber,
|
|
102
105
|
minChar,
|
|
103
106
|
minNumber,
|
|
104
|
-
numberOnly
|
|
107
|
+
numberOnly,
|
|
108
|
+
required
|
|
105
109
|
]);
|
|
106
110
|
const checkInput = React.useCallback((value)=>{
|
|
107
111
|
if (required && !value) {
|
|
@@ -26,7 +26,7 @@ const getInputAttr = ({ isDisabled = true, isLiquid, qtyStyle, quantity, current
|
|
|
26
26
|
inputMode: 'numeric',
|
|
27
27
|
quantity: isLiquid ? 'current_variant.quantity' : quantity ?? 0,
|
|
28
28
|
autocomplete: 'off',
|
|
29
|
-
value: defaultQty ?? 1,
|
|
29
|
+
value: quantity ?? defaultQty ?? 1,
|
|
30
30
|
...attrs
|
|
31
31
|
};
|
|
32
32
|
};
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var core = require('@gem-sdk/core');
|
|
4
4
|
|
|
5
|
-
const getInputClasses = ({ styles,
|
|
6
|
-
let classList = 'gp-flex gp-w-full gp-min-w-[45px] gp-shrink-[99999] gp-appearance-none gp-items-center gp-text-center gp-outline-none gp-transition-all gp-duration-150 hover:gp-text-black disabled:gp-cursor-not-allowed';
|
|
5
|
+
const getInputClasses = ({ styles, borderBtn, inputBackgroundColor, textColor })=>{
|
|
6
|
+
let classList = 'gp-flex gp-w-full gp-px-1 gp-min-w-[45px] gp-shrink-[99999] gp-appearance-none gp-items-center gp-text-center gp-outline-none gp-transition-all gp-duration-150 hover:gp-text-black disabled:gp-cursor-not-allowed';
|
|
7
7
|
const appendTypoClass = core.composeTypographyClassName(styles?.typo, styles?.typography);
|
|
8
8
|
const buttonColor = core.handleConvertClassColor(borderBtn);
|
|
9
9
|
const bgColorState = core.getGlobalColorStateClass('bg', inputBackgroundColor);
|
|
@@ -13,9 +13,7 @@ const getInputClasses = ({ styles, qtyStyle, borderBtn, inputBackgroundColor, te
|
|
|
13
13
|
if (bgColorState) classList += ` ${bgColorState} `;
|
|
14
14
|
if (textColorState) classList += ` ${textColorState} `;
|
|
15
15
|
return {
|
|
16
|
-
...core.composeClasses(classList)
|
|
17
|
-
'gp-px-4': qtyStyle === 'standard',
|
|
18
|
-
'gp-px-1': qtyStyle === 'minimalist'
|
|
16
|
+
...core.composeClasses(classList)
|
|
19
17
|
};
|
|
20
18
|
};
|
|
21
19
|
const getButtonClass = ({ borderBtn, buttonBackgroundColor, iconColor, buttonSide })=>{
|
|
@@ -353,9 +353,7 @@ const ProductPropertiesSettingsV2 = [
|
|
|
353
353
|
type: 'color-picker-v2',
|
|
354
354
|
label: 'Text Color',
|
|
355
355
|
default: {
|
|
356
|
-
normal: 'text-1'
|
|
357
|
-
focus: 'transparent',
|
|
358
|
-
hover: 'transparent'
|
|
356
|
+
normal: 'text-1'
|
|
359
357
|
},
|
|
360
358
|
state: {
|
|
361
359
|
normal: true,
|
|
@@ -368,9 +366,7 @@ const ProductPropertiesSettingsV2 = [
|
|
|
368
366
|
type: 'color-picker-v2',
|
|
369
367
|
label: 'Text Color',
|
|
370
368
|
default: {
|
|
371
|
-
normal: 'text-1'
|
|
372
|
-
hover: 'transparent',
|
|
373
|
-
active: 'transparent'
|
|
369
|
+
normal: 'text-1'
|
|
374
370
|
},
|
|
375
371
|
state: {
|
|
376
372
|
normal: true,
|
|
@@ -443,8 +439,7 @@ const ProductPropertiesSettingsV2 = [
|
|
|
443
439
|
desktop: {
|
|
444
440
|
default: {
|
|
445
441
|
normal: '#FFFFFF',
|
|
446
|
-
hover: '#DDDDDD'
|
|
447
|
-
focus: 'transparent'
|
|
442
|
+
hover: '#DDDDDD'
|
|
448
443
|
}
|
|
449
444
|
}
|
|
450
445
|
},
|
|
@@ -452,8 +447,7 @@ const ProductPropertiesSettingsV2 = [
|
|
|
452
447
|
desktop: {
|
|
453
448
|
default: {
|
|
454
449
|
normal: '#FFFFFF',
|
|
455
|
-
hover: '#DDDDDD'
|
|
456
|
-
focus: 'transparent'
|
|
450
|
+
hover: '#DDDDDD'
|
|
457
451
|
}
|
|
458
452
|
}
|
|
459
453
|
},
|
|
@@ -24,7 +24,7 @@ const getClass = (props)=>{
|
|
|
24
24
|
'gp-mx-auto gp-max-w-full [&_*]:gp-max-w-full': true
|
|
25
25
|
});
|
|
26
26
|
const wrapperYoutubeClasses = createClass({
|
|
27
|
-
'gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none': true
|
|
27
|
+
'gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none gp-background-article': true
|
|
28
28
|
});
|
|
29
29
|
const iframeYoutubeClasses = createClass({
|
|
30
30
|
'!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]': true
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useMemo } from 'react';
|
|
2
|
-
import { useCurrentDevice, useEditorMode, usePageType,
|
|
2
|
+
import { useCurrentDevice, useEditorMode, usePageType, getBgVideoByDevice, isEmptyChildren, getResponsiveValue } from '@gem-sdk/core';
|
|
3
3
|
import { createClass } from '@gem-sdk/system';
|
|
4
4
|
import { useInView } from '../../../intersection-observer/useInView.js';
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@ const useRowSettings = (rowProps)=>{
|
|
|
11
11
|
const [cacheHeightOutViewport, setCacheHeightOutViewport] = useState(500);
|
|
12
12
|
const mode = useEditorMode();
|
|
13
13
|
const pageType = usePageType();
|
|
14
|
-
const bgVideo =
|
|
14
|
+
const bgVideo = getBgVideoByDevice(background, currentDevice);
|
|
15
15
|
const isRowEmpty = useMemo(()=>{
|
|
16
16
|
return isEmptyChildren(children);
|
|
17
17
|
}, [
|
|
@@ -221,6 +221,7 @@ const RowSettings = [
|
|
|
221
221
|
units: [
|
|
222
222
|
'%'
|
|
223
223
|
],
|
|
224
|
+
showDefaultUnit: true,
|
|
224
225
|
devices: {
|
|
225
226
|
desktop: {
|
|
226
227
|
default: '1%'
|
|
@@ -234,22 +235,7 @@ const RowSettings = [
|
|
|
234
235
|
showVideo: true,
|
|
235
236
|
devices: {
|
|
236
237
|
desktop: {
|
|
237
|
-
default:
|
|
238
|
-
type: 'color',
|
|
239
|
-
color: 'transparent',
|
|
240
|
-
image: {
|
|
241
|
-
src: '',
|
|
242
|
-
width: 0,
|
|
243
|
-
height: 0
|
|
244
|
-
},
|
|
245
|
-
size: 'cover',
|
|
246
|
-
position: {
|
|
247
|
-
x: 50,
|
|
248
|
-
y: 50
|
|
249
|
-
},
|
|
250
|
-
repeat: 'no-repeat',
|
|
251
|
-
attachment: 'scroll'
|
|
252
|
-
}
|
|
238
|
+
default: undefined
|
|
253
239
|
}
|
|
254
240
|
},
|
|
255
241
|
compoDefaultValue: {
|
|
@@ -216,6 +216,22 @@ const SectionSettings = [
|
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
},
|
|
219
|
+
{
|
|
220
|
+
id: 'columnGap',
|
|
221
|
+
type: 'input:slider',
|
|
222
|
+
min: 0,
|
|
223
|
+
max: 100,
|
|
224
|
+
step: 1,
|
|
225
|
+
units: [
|
|
226
|
+
'%'
|
|
227
|
+
],
|
|
228
|
+
showDefaultUnit: true,
|
|
229
|
+
devices: {
|
|
230
|
+
desktop: {
|
|
231
|
+
default: '0%'
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
219
235
|
{
|
|
220
236
|
id: 'background',
|
|
221
237
|
type: 'background-media',
|
|
@@ -88,6 +88,9 @@ const ProductProperties = ({ setting, styles, builderProps })=>{
|
|
|
88
88
|
]);
|
|
89
89
|
const checkLength = useCallback((value)=>{
|
|
90
90
|
const length = value?.length ?? 0;
|
|
91
|
+
if (!required && length === 0) {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
91
94
|
if (numberOnly) {
|
|
92
95
|
return (Number(minNumber) || 0) <= Number(value) && Number(length) <= (Number(maxNumber) || 0);
|
|
93
96
|
}
|
|
@@ -97,7 +100,8 @@ const ProductProperties = ({ setting, styles, builderProps })=>{
|
|
|
97
100
|
maxNumber,
|
|
98
101
|
minChar,
|
|
99
102
|
minNumber,
|
|
100
|
-
numberOnly
|
|
103
|
+
numberOnly,
|
|
104
|
+
required
|
|
101
105
|
]);
|
|
102
106
|
const checkInput = useCallback((value)=>{
|
|
103
107
|
if (required && !value) {
|
|
@@ -24,7 +24,7 @@ const getInputAttr = ({ isDisabled = true, isLiquid, qtyStyle, quantity, current
|
|
|
24
24
|
inputMode: 'numeric',
|
|
25
25
|
quantity: isLiquid ? 'current_variant.quantity' : quantity ?? 0,
|
|
26
26
|
autocomplete: 'off',
|
|
27
|
-
value: defaultQty ?? 1,
|
|
27
|
+
value: quantity ?? defaultQty ?? 1,
|
|
28
28
|
...attrs
|
|
29
29
|
};
|
|
30
30
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { composeTypographyClassName, handleConvertClassColor, getGlobalColorStateClass, composeClasses } from '@gem-sdk/core';
|
|
2
2
|
|
|
3
|
-
const getInputClasses = ({ styles,
|
|
4
|
-
let classList = 'gp-flex gp-w-full gp-min-w-[45px] gp-shrink-[99999] gp-appearance-none gp-items-center gp-text-center gp-outline-none gp-transition-all gp-duration-150 hover:gp-text-black disabled:gp-cursor-not-allowed';
|
|
3
|
+
const getInputClasses = ({ styles, borderBtn, inputBackgroundColor, textColor })=>{
|
|
4
|
+
let classList = 'gp-flex gp-w-full gp-px-1 gp-min-w-[45px] gp-shrink-[99999] gp-appearance-none gp-items-center gp-text-center gp-outline-none gp-transition-all gp-duration-150 hover:gp-text-black disabled:gp-cursor-not-allowed';
|
|
5
5
|
const appendTypoClass = composeTypographyClassName(styles?.typo, styles?.typography);
|
|
6
6
|
const buttonColor = handleConvertClassColor(borderBtn);
|
|
7
7
|
const bgColorState = getGlobalColorStateClass('bg', inputBackgroundColor);
|
|
@@ -11,9 +11,7 @@ const getInputClasses = ({ styles, qtyStyle, borderBtn, inputBackgroundColor, te
|
|
|
11
11
|
if (bgColorState) classList += ` ${bgColorState} `;
|
|
12
12
|
if (textColorState) classList += ` ${textColorState} `;
|
|
13
13
|
return {
|
|
14
|
-
...composeClasses(classList)
|
|
15
|
-
'gp-px-4': qtyStyle === 'standard',
|
|
16
|
-
'gp-px-1': qtyStyle === 'minimalist'
|
|
14
|
+
...composeClasses(classList)
|
|
17
15
|
};
|
|
18
16
|
};
|
|
19
17
|
const getButtonClass = ({ borderBtn, buttonBackgroundColor, iconColor, buttonSide })=>{
|
|
@@ -351,9 +351,7 @@ const ProductPropertiesSettingsV2 = [
|
|
|
351
351
|
type: 'color-picker-v2',
|
|
352
352
|
label: 'Text Color',
|
|
353
353
|
default: {
|
|
354
|
-
normal: 'text-1'
|
|
355
|
-
focus: 'transparent',
|
|
356
|
-
hover: 'transparent'
|
|
354
|
+
normal: 'text-1'
|
|
357
355
|
},
|
|
358
356
|
state: {
|
|
359
357
|
normal: true,
|
|
@@ -366,9 +364,7 @@ const ProductPropertiesSettingsV2 = [
|
|
|
366
364
|
type: 'color-picker-v2',
|
|
367
365
|
label: 'Text Color',
|
|
368
366
|
default: {
|
|
369
|
-
normal: 'text-1'
|
|
370
|
-
hover: 'transparent',
|
|
371
|
-
active: 'transparent'
|
|
367
|
+
normal: 'text-1'
|
|
372
368
|
},
|
|
373
369
|
state: {
|
|
374
370
|
normal: true,
|
|
@@ -441,8 +437,7 @@ const ProductPropertiesSettingsV2 = [
|
|
|
441
437
|
desktop: {
|
|
442
438
|
default: {
|
|
443
439
|
normal: '#FFFFFF',
|
|
444
|
-
hover: '#DDDDDD'
|
|
445
|
-
focus: 'transparent'
|
|
440
|
+
hover: '#DDDDDD'
|
|
446
441
|
}
|
|
447
442
|
}
|
|
448
443
|
},
|
|
@@ -450,8 +445,7 @@ const ProductPropertiesSettingsV2 = [
|
|
|
450
445
|
desktop: {
|
|
451
446
|
default: {
|
|
452
447
|
normal: '#FFFFFF',
|
|
453
|
-
hover: '#DDDDDD'
|
|
454
|
-
focus: 'transparent'
|
|
448
|
+
hover: '#DDDDDD'
|
|
455
449
|
}
|
|
456
450
|
}
|
|
457
451
|
},
|
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.412",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"update-img-src-3rd": "node ./scripts/update-img-src-3rd.js"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@gem-sdk/core": "2.0.0-dev.
|
|
26
|
+
"@gem-sdk/core": "2.0.0-dev.412",
|
|
27
27
|
"@gem-sdk/styles": "2.0.0-dev.381",
|
|
28
28
|
"@gem-sdk/system": "2.0.0-dev.371",
|
|
29
29
|
"@types/react-transition-group": "^4.4.5"
|