@gem-sdk/components 2.0.0-dev.277 → 2.0.0-dev.278

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.
Files changed (20) hide show
  1. package/dist/cjs/post-purchase/callout-banner/components/CalloutText.js +1 -2
  2. package/dist/cjs/post-purchase/callout-banner/components/common/getClasses.js +2 -5
  3. package/dist/cjs/post-purchase/callout-banner/components/common/getStyles.js +4 -2
  4. package/dist/cjs/post-purchase/callout-banner/setting/config/callout-text/setting.js +11 -1
  5. package/dist/cjs/post-purchase/product/hooks/product-image/useListCarousel.js +1 -1
  6. package/dist/cjs/post-purchase/product/hooks/product-image/useProductImagePostPurchase.js +4 -1
  7. package/dist/cjs/post-purchase/product/settings/product-image/setting-v2.js +15 -2
  8. package/dist/cjs/post-purchase/product/settings/product-image/uiV2.js +3 -1
  9. package/dist/cjs/post-purchase/utils/constants.js +1 -1
  10. package/dist/esm/post-purchase/callout-banner/components/CalloutText.js +1 -2
  11. package/dist/esm/post-purchase/callout-banner/components/common/getClasses.js +2 -5
  12. package/dist/esm/post-purchase/callout-banner/components/common/getStyles.js +4 -2
  13. package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/setting.js +11 -1
  14. package/dist/esm/post-purchase/product/hooks/product-image/useListCarousel.js +1 -1
  15. package/dist/esm/post-purchase/product/hooks/product-image/useProductImagePostPurchase.js +4 -1
  16. package/dist/esm/post-purchase/product/settings/product-image/setting-v2.js +15 -2
  17. package/dist/esm/post-purchase/product/settings/product-image/uiV2.js +3 -1
  18. package/dist/esm/post-purchase/utils/constants.js +1 -1
  19. package/dist/types/index.d.ts +1 -1
  20. package/package.json +1 -1
@@ -15,7 +15,6 @@ const CalloutText = ({ setting = {}, styles = {}, style, builderAttrs, builderPr
15
15
  const { message } = setting;
16
16
  const wrapperClasses = system.createClass({
17
17
  ...getClasses.getCalloutTextWrapperClasses({
18
- align,
19
18
  builderProps
20
19
  })
21
20
  });
@@ -25,7 +24,7 @@ const CalloutText = ({ setting = {}, styles = {}, style, builderAttrs, builderPr
25
24
  const textStyles = {
26
25
  ...getStyles.getTextStyles(styles)
27
26
  };
28
- const wrapperStyles = system.createStyle(getStyles.getCalloutTextStyle(style));
27
+ const wrapperStyles = system.createStyle(getStyles.getCalloutTextStyle(style, align));
29
28
  const wrapperAttrs = system.createAttr({
30
29
  ...builderAttrs
31
30
  });
@@ -2,14 +2,11 @@
2
2
 
3
3
  var core = require('@gem-sdk/core');
4
4
 
5
- const getCalloutTextWrapperClasses = ({ align, builderProps })=>{
5
+ const getCalloutTextWrapperClasses = ({ builderProps })=>{
6
6
  let classList = 'gp-flex gp-w-full';
7
7
  if (builderProps?.uid) classList += `${builderProps?.uid}`;
8
8
  return {
9
- ...core.composeClasses(classList),
10
- 'gp-justify-start': align === 'left',
11
- 'gp-justify-end': align === 'right',
12
- 'gp-justify-center': align === 'center'
9
+ ...core.composeClasses(classList)
13
10
  };
14
11
  };
15
12
  const getCalloutBoxWrapperClasses = (styles)=>{
@@ -1,10 +1,12 @@
1
1
  'use strict';
2
2
 
3
+ var core = require('@gem-sdk/core');
3
4
  var helpers = require('../../../../helpers.js');
4
5
 
5
- const getCalloutTextStyle = (style)=>{
6
+ const getCalloutTextStyle = (style, align)=>{
6
7
  return helpers.filterTruthyStyles({
7
- ...style
8
+ ...style,
9
+ ...core.makeStyleResponsive('jc', align)
8
10
  });
9
11
  };
10
12
  const getTextStyles = (styles)=>{
@@ -164,7 +164,17 @@ const CalloutTextSettings = [
164
164
  iconName: 'gp-align-right'
165
165
  }
166
166
  ],
167
- default: 'left'
167
+ devices: {
168
+ desktop: {
169
+ default: 'left'
170
+ },
171
+ tablet: {
172
+ default: 'left'
173
+ },
174
+ mobile: {
175
+ default: 'left'
176
+ }
177
+ }
168
178
  }
169
179
  ]
170
180
  }
@@ -25,7 +25,7 @@ const useListCarousel = (props)=>{
25
25
  Array.from({
26
26
  length: itemPerRow - listItem.length
27
27
  }).forEach(()=>{
28
- temp.push({});
28
+ temp.push(null);
29
29
  });
30
30
  return temp;
31
31
  }
@@ -41,7 +41,10 @@ const useProductImagePostPurchase = (props)=>{
41
41
  ratioLayoutRight
42
42
  ]);
43
43
  const isImageListCarousel = React.useMemo(()=>{
44
- return layoutType !== 'two-col' && ([
44
+ return ![
45
+ 'two-col',
46
+ 'one-col'
47
+ ].includes(layoutType) && ([
45
48
  'left',
46
49
  'right'
47
50
  ].includes(layoutType) || displayType === 'slider');
@@ -202,13 +202,26 @@ const SettingV2 = [
202
202
  },
203
203
  {
204
204
  id: 'ftWidth',
205
- type: 'input:unit',
205
+ type: 'dropdown:input',
206
206
  label: 'Width',
207
- min: 0,
208
207
  units: [
209
208
  'px',
210
209
  '%'
211
210
  ],
211
+ hideUnit: false,
212
+ inputType: 'number',
213
+ displayOptions: [
214
+ {
215
+ label: 'Full',
216
+ value: '100%',
217
+ showValue: true
218
+ },
219
+ {
220
+ label: 'Default',
221
+ value: '1200px',
222
+ showValue: true
223
+ }
224
+ ],
212
225
  devices: {
213
226
  desktop: {
214
227
  default: '100%'
@@ -224,7 +224,9 @@ const SettingUIV2 = [
224
224
  id: 'align'
225
225
  },
226
226
  options: {
227
- labelVariant: 'primary'
227
+ labelVariant: 'primary',
228
+ fullWidth: true,
229
+ disableMessage: `Horizontal alignment is disabled when the width is set to 100% or greater`
228
230
  },
229
231
  conditionEnable: '!(parseInt(ftWidth) >= 100 && ftWidth?.includes("%"))'
230
232
  }
@@ -15,7 +15,7 @@ const postPurchaseSpacing = [
15
15
  },
16
16
  {
17
17
  label: 'Default',
18
- value: undefined,
18
+ value: 'none',
19
19
  displayValue: '14px',
20
20
  showValue: true
21
21
  },
@@ -11,7 +11,6 @@ const CalloutText = ({ setting = {}, styles = {}, style, builderAttrs, builderPr
11
11
  const { message } = setting;
12
12
  const wrapperClasses = createClass({
13
13
  ...getCalloutTextWrapperClasses({
14
- align,
15
14
  builderProps
16
15
  })
17
16
  });
@@ -21,7 +20,7 @@ const CalloutText = ({ setting = {}, styles = {}, style, builderAttrs, builderPr
21
20
  const textStyles = {
22
21
  ...getTextStyles(styles)
23
22
  };
24
- const wrapperStyles = createStyle(getCalloutTextStyle(style));
23
+ const wrapperStyles = createStyle(getCalloutTextStyle(style, align));
25
24
  const wrapperAttrs = createAttr({
26
25
  ...builderAttrs
27
26
  });
@@ -1,13 +1,10 @@
1
1
  import { composeClasses } from '@gem-sdk/core';
2
2
 
3
- const getCalloutTextWrapperClasses = ({ align, builderProps })=>{
3
+ const getCalloutTextWrapperClasses = ({ builderProps })=>{
4
4
  let classList = 'gp-flex gp-w-full';
5
5
  if (builderProps?.uid) classList += `${builderProps?.uid}`;
6
6
  return {
7
- ...composeClasses(classList),
8
- 'gp-justify-start': align === 'left',
9
- 'gp-justify-end': align === 'right',
10
- 'gp-justify-center': align === 'center'
7
+ ...composeClasses(classList)
11
8
  };
12
9
  };
13
10
  const getCalloutBoxWrapperClasses = (styles)=>{
@@ -1,8 +1,10 @@
1
+ import { makeStyleResponsive } from '@gem-sdk/core';
1
2
  import { filterTruthyStyles } from '../../../../helpers.js';
2
3
 
3
- const getCalloutTextStyle = (style)=>{
4
+ const getCalloutTextStyle = (style, align)=>{
4
5
  return filterTruthyStyles({
5
- ...style
6
+ ...style,
7
+ ...makeStyleResponsive('jc', align)
6
8
  });
7
9
  };
8
10
  const getTextStyles = (styles)=>{
@@ -162,7 +162,17 @@ const CalloutTextSettings = [
162
162
  iconName: 'gp-align-right'
163
163
  }
164
164
  ],
165
- default: 'left'
165
+ devices: {
166
+ desktop: {
167
+ default: 'left'
168
+ },
169
+ tablet: {
170
+ default: 'left'
171
+ },
172
+ mobile: {
173
+ default: 'left'
174
+ }
175
+ }
166
176
  }
167
177
  ]
168
178
  }
@@ -23,7 +23,7 @@ const useListCarousel = (props)=>{
23
23
  Array.from({
24
24
  length: itemPerRow - listItem.length
25
25
  }).forEach(()=>{
26
- temp.push({});
26
+ temp.push(null);
27
27
  });
28
28
  return temp;
29
29
  }
@@ -39,7 +39,10 @@ const useProductImagePostPurchase = (props)=>{
39
39
  ratioLayoutRight
40
40
  ]);
41
41
  const isImageListCarousel = useMemo(()=>{
42
- return layoutType !== 'two-col' && ([
42
+ return ![
43
+ 'two-col',
44
+ 'one-col'
45
+ ].includes(layoutType) && ([
43
46
  'left',
44
47
  'right'
45
48
  ].includes(layoutType) || displayType === 'slider');
@@ -200,13 +200,26 @@ const SettingV2 = [
200
200
  },
201
201
  {
202
202
  id: 'ftWidth',
203
- type: 'input:unit',
203
+ type: 'dropdown:input',
204
204
  label: 'Width',
205
- min: 0,
206
205
  units: [
207
206
  'px',
208
207
  '%'
209
208
  ],
209
+ hideUnit: false,
210
+ inputType: 'number',
211
+ displayOptions: [
212
+ {
213
+ label: 'Full',
214
+ value: '100%',
215
+ showValue: true
216
+ },
217
+ {
218
+ label: 'Default',
219
+ value: '1200px',
220
+ showValue: true
221
+ }
222
+ ],
210
223
  devices: {
211
224
  desktop: {
212
225
  default: '100%'
@@ -222,7 +222,9 @@ const SettingUIV2 = [
222
222
  id: 'align'
223
223
  },
224
224
  options: {
225
- labelVariant: 'primary'
225
+ labelVariant: 'primary',
226
+ fullWidth: true,
227
+ disableMessage: `Horizontal alignment is disabled when the width is set to 100% or greater`
226
228
  },
227
229
  conditionEnable: '!(parseInt(ftWidth) >= 100 && ftWidth?.includes("%"))'
228
230
  }
@@ -13,7 +13,7 @@ const postPurchaseSpacing = [
13
13
  },
14
14
  {
15
15
  label: 'Default',
16
- value: undefined,
16
+ value: 'none',
17
17
  displayValue: '14px',
18
18
  showValue: true
19
19
  },
@@ -4874,7 +4874,7 @@ type CalloutTextStyles = {
4874
4874
  typo?: PostPurchaseTypo;
4875
4875
  width?: ObjectDevices<string>;
4876
4876
  textAlign?: 'left' | 'center' | 'right' | 'justify';
4877
- align?: 'left' | 'right' | 'center';
4877
+ align?: ObjectDevices<'left' | 'right' | 'center'>;
4878
4878
  direction?: 'ltr' | 'rtl';
4879
4879
  };
4880
4880
  type CalloutTextProps = BasePropsWrap<CalloutTextSettings, CalloutTextStyles> & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.277",
3
+ "version": "2.0.0-dev.278",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",