@gem-sdk/components 2.0.0-dev.303 → 2.0.0-dev.304

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.
@@ -42,6 +42,20 @@ const heroBanner1Col = {
42
42
  contentWidth: {
43
43
  desktop: '1200px'
44
44
  },
45
+ sizeSetting: {
46
+ desktop: {
47
+ shape: 'custom',
48
+ widthHeightLinked: false,
49
+ width: '100%',
50
+ height: '600px'
51
+ },
52
+ mobile: {
53
+ shape: 'custom',
54
+ widthHeightLinked: false,
55
+ width: '1200px',
56
+ height: '600px'
57
+ }
58
+ },
45
59
  background: {
46
60
  desktop: {
47
61
  image: {
@@ -48,6 +48,19 @@ const heroBannerContentLeft = {
48
48
  contentWidth: {
49
49
  desktop: '1200px'
50
50
  },
51
+ sizeSetting: {
52
+ desktop: {
53
+ shape: 'original',
54
+ widthHeightLinked: true,
55
+ width: '100%'
56
+ },
57
+ mobile: {
58
+ shape: 'custom',
59
+ widthHeightLinked: false,
60
+ width: '100%',
61
+ height: 'auto'
62
+ }
63
+ },
51
64
  background: {
52
65
  desktop: {
53
66
  image: {
@@ -57,6 +57,18 @@ const heroBannerContentRight = {
57
57
  contentWidth: {
58
58
  desktop: '1200px'
59
59
  },
60
+ sizeSetting: {
61
+ desktop: {
62
+ shape: 'original',
63
+ widthHeightLinked: true,
64
+ width: '100%'
65
+ },
66
+ mobile: {
67
+ shape: 'original',
68
+ widthHeightLinked: true,
69
+ width: '100%'
70
+ }
71
+ },
60
72
  background: {
61
73
  desktop: {
62
74
  image: {
@@ -42,6 +42,20 @@ const heroBannerParallax = {
42
42
  contentWidth: {
43
43
  desktop: '1200px'
44
44
  },
45
+ sizeSetting: {
46
+ desktop: {
47
+ shape: 'custom',
48
+ widthHeightLinked: false,
49
+ width: '100%',
50
+ height: '600px'
51
+ },
52
+ mobile: {
53
+ shape: 'custom',
54
+ widthHeightLinked: false,
55
+ width: '1200px',
56
+ height: '600px'
57
+ }
58
+ },
45
59
  background: {
46
60
  desktop: {
47
61
  image: {
@@ -402,16 +402,18 @@ const SettingsV1 = [
402
402
  devices: {
403
403
  desktop: {
404
404
  default: {
405
- shape: 'original',
405
+ shape: 'custom',
406
406
  widthHeightLinked: false,
407
- width: '100%'
407
+ width: '100%',
408
+ height: '600px'
408
409
  }
409
410
  },
410
411
  mobile: {
411
412
  default: {
412
413
  shape: 'custom',
413
- height: '500px',
414
- width: '100%'
414
+ widthHeightLinked: false,
415
+ width: '1200px',
416
+ height: '600px'
415
417
  }
416
418
  }
417
419
  },
@@ -783,20 +785,6 @@ const SettingsV1 = [
783
785
  hover: true
784
786
  }
785
787
  },
786
- {
787
- id: 'borderBg',
788
- type: 'border',
789
- label: 'Border',
790
- default: {
791
- borderType: 'style-1',
792
- border: 'solid',
793
- width: '0px 0px 0px 0px',
794
- position: 'all',
795
- borderWidth: '0px',
796
- color: '#000000',
797
- isCustom: true
798
- }
799
- },
800
788
  {
801
789
  id: 'cornerBg',
802
790
  type: 'radius-preset',
@@ -412,8 +412,7 @@ const SettingUIV1 = [
412
412
  },
413
413
  setting: {
414
414
  id: 'speedParallax'
415
- },
416
- condition: 'enableParallax == true'
415
+ }
417
416
  }
418
417
  ]
419
418
  },
@@ -102,10 +102,10 @@ const SettingUIV2 = [
102
102
  type: 'padding-v2',
103
103
  compoDefaultValue: {
104
104
  default: {
105
- top: '4px',
106
- right: '16px',
107
- bottom: '4px',
108
- left: '16px',
105
+ top: '80px',
106
+ right: '0px',
107
+ bottom: '80px',
108
+ left: '0px',
109
109
  linked: false
110
110
  }
111
111
  }
@@ -198,7 +198,6 @@ const SettingUIV2 = [
198
198
  },
199
199
  iconName: 'polaris-star',
200
200
  getValueFromSettingID: 'speedParallax',
201
- isHideClear: true,
202
201
  controls: [
203
202
  {
204
203
  layout: 'vertical',
@@ -175,6 +175,18 @@ const SettingUIV2 = [
175
175
  type: 'border-v2',
176
176
  linkWithSetting: {
177
177
  name: 'wrapperBorder'
178
+ },
179
+ compoDefaultValue: {
180
+ desktop: {
181
+ default: {
182
+ normal: {
183
+ border: 'solid',
184
+ color: '#121212',
185
+ width: '1px',
186
+ borderWidth: '1px'
187
+ }
188
+ }
189
+ }
178
190
  }
179
191
  }
180
192
  },
@@ -21,9 +21,17 @@ const ProductTag = ({ setting, styles, builderProps, ...passProps })=>{
21
21
  const mode = core.useEditorMode();
22
22
  const product = core.useProduct();
23
23
  const currentVariant = core.useCurrentVariant();
24
+ const { quantity, hasUpdatePrice } = core.useQuantity();
25
+ const quantityProduct = React.useMemo(()=>{
26
+ return hasUpdatePrice && customContent?.unit !== 'percentage' ? quantity || 1 : 1;
27
+ }, [
28
+ hasUpdatePrice,
29
+ customContent?.unit,
30
+ quantity
31
+ ]);
24
32
  const price = currentVariant?.price ?? 0;
25
33
  const salePrice = currentVariant?.salePrice ?? 0;
26
- const priceSave = salePrice - price;
34
+ const priceSave = (salePrice - price) * quantityProduct;
27
35
  const moneyFormatted = core.useFormatMoney(priceSave < 0 ? 0 : priceSave, setting?.moneyWithCurrentFormat || false);
28
36
  const customDisplayWithUnit = React.useMemo(()=>{
29
37
  if (!salePrice && salePrice !== 0 || !price && price !== 0) return `${customContent?.unit === 'percentage' ? '0%' : moneyFormatted}`;
@@ -40,6 +40,20 @@ const heroBanner1Col = {
40
40
  contentWidth: {
41
41
  desktop: '1200px'
42
42
  },
43
+ sizeSetting: {
44
+ desktop: {
45
+ shape: 'custom',
46
+ widthHeightLinked: false,
47
+ width: '100%',
48
+ height: '600px'
49
+ },
50
+ mobile: {
51
+ shape: 'custom',
52
+ widthHeightLinked: false,
53
+ width: '1200px',
54
+ height: '600px'
55
+ }
56
+ },
43
57
  background: {
44
58
  desktop: {
45
59
  image: {
@@ -46,6 +46,19 @@ const heroBannerContentLeft = {
46
46
  contentWidth: {
47
47
  desktop: '1200px'
48
48
  },
49
+ sizeSetting: {
50
+ desktop: {
51
+ shape: 'original',
52
+ widthHeightLinked: true,
53
+ width: '100%'
54
+ },
55
+ mobile: {
56
+ shape: 'custom',
57
+ widthHeightLinked: false,
58
+ width: '100%',
59
+ height: 'auto'
60
+ }
61
+ },
49
62
  background: {
50
63
  desktop: {
51
64
  image: {
@@ -55,6 +55,18 @@ const heroBannerContentRight = {
55
55
  contentWidth: {
56
56
  desktop: '1200px'
57
57
  },
58
+ sizeSetting: {
59
+ desktop: {
60
+ shape: 'original',
61
+ widthHeightLinked: true,
62
+ width: '100%'
63
+ },
64
+ mobile: {
65
+ shape: 'original',
66
+ widthHeightLinked: true,
67
+ width: '100%'
68
+ }
69
+ },
58
70
  background: {
59
71
  desktop: {
60
72
  image: {
@@ -40,6 +40,20 @@ const heroBannerParallax = {
40
40
  contentWidth: {
41
41
  desktop: '1200px'
42
42
  },
43
+ sizeSetting: {
44
+ desktop: {
45
+ shape: 'custom',
46
+ widthHeightLinked: false,
47
+ width: '100%',
48
+ height: '600px'
49
+ },
50
+ mobile: {
51
+ shape: 'custom',
52
+ widthHeightLinked: false,
53
+ width: '1200px',
54
+ height: '600px'
55
+ }
56
+ },
43
57
  background: {
44
58
  desktop: {
45
59
  image: {
@@ -400,16 +400,18 @@ const SettingsV1 = [
400
400
  devices: {
401
401
  desktop: {
402
402
  default: {
403
- shape: 'original',
403
+ shape: 'custom',
404
404
  widthHeightLinked: false,
405
- width: '100%'
405
+ width: '100%',
406
+ height: '600px'
406
407
  }
407
408
  },
408
409
  mobile: {
409
410
  default: {
410
411
  shape: 'custom',
411
- height: '500px',
412
- width: '100%'
412
+ widthHeightLinked: false,
413
+ width: '1200px',
414
+ height: '600px'
413
415
  }
414
416
  }
415
417
  },
@@ -781,20 +783,6 @@ const SettingsV1 = [
781
783
  hover: true
782
784
  }
783
785
  },
784
- {
785
- id: 'borderBg',
786
- type: 'border',
787
- label: 'Border',
788
- default: {
789
- borderType: 'style-1',
790
- border: 'solid',
791
- width: '0px 0px 0px 0px',
792
- position: 'all',
793
- borderWidth: '0px',
794
- color: '#000000',
795
- isCustom: true
796
- }
797
- },
798
786
  {
799
787
  id: 'cornerBg',
800
788
  type: 'radius-preset',
@@ -410,8 +410,7 @@ const SettingUIV1 = [
410
410
  },
411
411
  setting: {
412
412
  id: 'speedParallax'
413
- },
414
- condition: 'enableParallax == true'
413
+ }
415
414
  }
416
415
  ]
417
416
  },
@@ -100,10 +100,10 @@ const SettingUIV2 = [
100
100
  type: 'padding-v2',
101
101
  compoDefaultValue: {
102
102
  default: {
103
- top: '4px',
104
- right: '16px',
105
- bottom: '4px',
106
- left: '16px',
103
+ top: '80px',
104
+ right: '0px',
105
+ bottom: '80px',
106
+ left: '0px',
107
107
  linked: false
108
108
  }
109
109
  }
@@ -196,7 +196,6 @@ const SettingUIV2 = [
196
196
  },
197
197
  iconName: 'polaris-star',
198
198
  getValueFromSettingID: 'speedParallax',
199
- isHideClear: true,
200
199
  controls: [
201
200
  {
202
201
  layout: 'vertical',
@@ -173,6 +173,18 @@ const SettingUIV2 = [
173
173
  type: 'border-v2',
174
174
  linkWithSetting: {
175
175
  name: 'wrapperBorder'
176
+ },
177
+ compoDefaultValue: {
178
+ desktop: {
179
+ default: {
180
+ normal: {
181
+ border: 'solid',
182
+ color: '#121212',
183
+ width: '1px',
184
+ borderWidth: '1px'
185
+ }
186
+ }
187
+ }
176
188
  }
177
189
  }
178
190
  },
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
- import { useMoneyFormat, makeGlobalSize, useEditorMode, useProduct, useCurrentVariant, useFormatMoney, useProductBundleDiscount, formatMoney, getGlobalColorClass, cls, makeStyleResponsive, makeStyle, getRadiusCSSFromGlobal, getCustomRadius } from '@gem-sdk/core';
3
+ import { useMoneyFormat, makeGlobalSize, useEditorMode, useProduct, useCurrentVariant, useQuantity, useFormatMoney, useProductBundleDiscount, formatMoney, getGlobalColorClass, cls, makeStyleResponsive, makeStyle, getRadiusCSSFromGlobal, getCustomRadius } from '@gem-sdk/core';
4
4
  import { useMemo } from 'react';
5
5
  import Text from '../../text/components/Text.js';
6
6
  import { DiscountType } from './constants/product-bundle.js';
@@ -17,9 +17,17 @@ const ProductTag = ({ setting, styles, builderProps, ...passProps })=>{
17
17
  const mode = useEditorMode();
18
18
  const product = useProduct();
19
19
  const currentVariant = useCurrentVariant();
20
+ const { quantity, hasUpdatePrice } = useQuantity();
21
+ const quantityProduct = useMemo(()=>{
22
+ return hasUpdatePrice && customContent?.unit !== 'percentage' ? quantity || 1 : 1;
23
+ }, [
24
+ hasUpdatePrice,
25
+ customContent?.unit,
26
+ quantity
27
+ ]);
20
28
  const price = currentVariant?.price ?? 0;
21
29
  const salePrice = currentVariant?.salePrice ?? 0;
22
- const priceSave = salePrice - price;
30
+ const priceSave = (salePrice - price) * quantityProduct;
23
31
  const moneyFormatted = useFormatMoney(priceSave < 0 ? 0 : priceSave, setting?.moneyWithCurrentFormat || false);
24
32
  const customDisplayWithUnit = useMemo(()=>{
25
33
  if (!salePrice && salePrice !== 0 || !price && price !== 0) return `${customContent?.unit === 'percentage' ? '0%' : moneyFormatted}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.303",
3
+ "version": "2.0.0-dev.304",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",