@gem-sdk/components 2.0.0-dev.422 → 2.0.0-dev.424

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.
@@ -28,7 +28,8 @@ const HeroBanner = (props)=>{
28
28
  contentPosition2Col: styles?.contentPosition2Col,
29
29
  aspectRatio: setting?.aspectRatio,
30
30
  target: urlData?.target ?? '_blank',
31
- href: urlData?.href ?? ''
31
+ href: urlData?.href ?? '',
32
+ linkType: link?.type ?? ''
32
33
  });
33
34
  const hasLinkCover = !!link?.link;
34
35
  const attrs = system.createAttr({
@@ -45,8 +45,11 @@ const getRowClasses = (styles, setting)=>{
45
45
  const fitContentClass = common.getClassForContentByFitContent(sizeSetting, background);
46
46
  const stretchContentClass = common.getClassForStretchContent(verticalAlign);
47
47
  const layoutClass = common.getClassSpaceBetween(setting?.layout || {}, styles?.contentPosition1Col || {}, styles?.contentPosition2Col || {});
48
- const classList = `gp-hero-banner-row gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-transition-all gp-duration-300 group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))] ${fitContentClass} ${stretchContentClass} ${layoutClass}`;
49
- return composeClasses(classList.trim());
48
+ const classList = `gp-hero-banner-row gp-transition-all gp-duration-300 group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))] ${fitContentClass} ${stretchContentClass}`;
49
+ return {
50
+ ...composeClasses(classList),
51
+ ...layoutClass
52
+ };
50
53
  };
51
54
  const getAdaptiveClasses = ()=>{
52
55
  const classList = `adaptive-hero-banner`;
@@ -164,6 +164,7 @@ const SettingsV2 = [
164
164
  label: 'Speed',
165
165
  useOnlyUnitInit: true,
166
166
  hideUnit: true,
167
+ isNumber: true,
167
168
  min: 0,
168
169
  max: 1,
169
170
  step: 0.1,
@@ -670,9 +671,6 @@ const SettingsV2 = [
670
671
  id: 'overlayColor',
671
672
  label: 'Color',
672
673
  type: 'color-picker-v2',
673
- default: {
674
- normal: '#121212'
675
- },
676
674
  state: {
677
675
  normal: true,
678
676
  hover: true
@@ -104,36 +104,41 @@ const SettingUIV2 = [
104
104
  id: 'background'
105
105
  },
106
106
  layout: 'vertical'
107
- },
108
- {
109
- label: {
110
- en: 'Overlay'
111
- },
112
- type: 'combo',
113
- comboType: 'color',
114
- getValueFromSettingID: 'overlayColor.normal',
115
- controls: [
116
- {
117
- setting: {
118
- id: 'overlayColor',
119
- state: 'normal'
120
- },
121
- label: {
122
- en: 'Color'
123
- }
107
+ }
108
+ ],
109
+ moreSettings: {
110
+ type: 'collapse',
111
+ controls: [
112
+ {
113
+ label: {
114
+ en: 'Overlay'
124
115
  },
125
- {
126
- setting: {
127
- id: 'overlayOpacity',
128
- state: 'normal'
116
+ type: 'combo',
117
+ comboType: 'color',
118
+ getValueFromSettingID: 'overlayColor.normal',
119
+ controls: [
120
+ {
121
+ setting: {
122
+ id: 'overlayColor',
123
+ state: 'normal'
124
+ },
125
+ label: {
126
+ en: 'Color'
127
+ }
129
128
  },
130
- label: {
131
- en: 'Opacity'
129
+ {
130
+ setting: {
131
+ id: 'overlayOpacity',
132
+ state: 'normal'
133
+ },
134
+ label: {
135
+ en: 'Opacity'
136
+ }
132
137
  }
133
- }
134
- ]
135
- }
136
- ]
138
+ ]
139
+ }
140
+ ]
141
+ }
137
142
  },
138
143
  {
139
144
  label: {
@@ -247,7 +252,7 @@ const SettingUIV2 = [
247
252
  {
248
253
  type: 'combo',
249
254
  fixedValue: 'Effect',
250
- iconName: 'polaris-star',
255
+ iconName: 'polaris-check-clicked',
251
256
  label: {
252
257
  en: 'Hover'
253
258
  },
@@ -311,7 +316,7 @@ const SettingUIV2 = [
311
316
  label: {
312
317
  en: 'Parallax scroll'
313
318
  },
314
- iconName: 'polaris-star',
319
+ iconName: 'polaris-parallax-effect',
315
320
  getValueFromSettingID: 'speedParallax',
316
321
  defaultValueWhenClear: 0,
317
322
  controls: [
@@ -16,7 +16,7 @@ const getDotStyle = (props, componentType)=>{
16
16
  devices.forEach((device)=>{
17
17
  const dotStyleSetting = core.getResponsiveValueByScreen(style, device);
18
18
  const deviceType = device === 'desktop' ? '' : `${device}`;
19
- result[`d${deviceType.length === 0 ? '' : '-' + deviceType}`] = dotStyleSetting && dotStyleSetting !== 'none' ? 'flex' : 'none';
19
+ result[`--d${deviceType.length === 0 ? '' : '-' + deviceType}`] = dotStyleSetting && dotStyleSetting !== 'none' ? 'flex' : 'none';
20
20
  });
21
21
  return result;
22
22
  };
@@ -49,6 +49,14 @@ const getDisplayStyle = (fnCondition, defaultValue)=>{
49
49
  });
50
50
  return result;
51
51
  };
52
+ const checkAddOverFlowClass = (style)=>{
53
+ const radius = style?.['--radius'];
54
+ const bblr = style?.['--bblr'] || '0px';
55
+ const bbrr = style?.['--bbrr'] || '0px';
56
+ const btlr = style?.['--btlr'] || '0px';
57
+ const btrr = style?.['--btrr'] || '0px';
58
+ return radius && !radius.toString().includes('none') && radius.toString() !== '0' || bblr !== '0px' || bbrr !== '0px' || btlr !== '0px' || btrr !== '0px';
59
+ };
52
60
  const getAspectRatio = (shape)=>{
53
61
  let result = {};
54
62
  const DEVICES = [
@@ -357,6 +365,7 @@ const getPaddingBottomByShapeSetting = (shapeSetting)=>{
357
365
  return result;
358
366
  };
359
367
 
368
+ exports.checkAddOverFlowClass = checkAddOverFlowClass;
360
369
  exports.convertSpacing = convertSpacing;
361
370
  exports.convertSpacingForIndisdeLayout = convertSpacingForIndisdeLayout;
362
371
  exports.convertUnitToNumber = convertUnitToNumber;
@@ -8,9 +8,10 @@ function composeClasses(classList) {
8
8
  return acc;
9
9
  }, {});
10
10
  }
11
- const getWrapperClasses = ({ extraClass })=>{
12
- let classList = 'gp-relative gp-overflow-hidden';
11
+ const getWrapperClasses = ({ extraClass, isAddOverFlowClass = false })=>{
12
+ let classList = 'gp-relative gp-w-full';
13
13
  if (extraClass) classList += ` ${extraClass}`;
14
+ if (isAddOverFlowClass) classList += ` gp-overflow-hidden`;
14
15
  return composeClasses(classList);
15
16
  };
16
17
  const getGalleryWrapperClasses = ({ extraClass })=>{
@@ -71,7 +72,7 @@ const getFeaturedImageGalleryClasses = ({ settings, extraClass })=>{
71
72
  return composeClasses(classList);
72
73
  };
73
74
  const getGalleryItemClasses = ({ extraClass })=>{
74
- let classList = `gp-image-item gem-slider-item gp-group gp-relative gp-overflow-hidden gp-cursor-pointer data-[outline=deactive]:after:!gp-border-transparent data-[outline=deactive]:after:!gp-border-transparent`;
75
+ let classList = `gp-image-item gp-flex gp-items-center gp-justify-center gp-group gp-relative gp-overflow-hidden gp-cursor-pointer data-[outline=deactive]:after:!gp-border-transparent data-[outline=deactive]:after:!gp-border-transparent`;
75
76
  if (extraClass) classList += ` ${extraClass}`;
76
77
  return composeClasses(classList);
77
78
  };
@@ -5,12 +5,13 @@ var getClasses = require('../common/getClasses.js');
5
5
  var common = require('../common/common.js');
6
6
 
7
7
  const getProductImagesClassName = (props)=>{
8
- const { setting } = props;
8
+ const { setting, style } = props;
9
9
  const productImagesProps = common.setDefaultWhenUndefineSetting(props);
10
10
  const { builderProps, advanced } = productImagesProps;
11
11
  const extraClass = advanced?.cssClass;
12
12
  const wrapperClasses = system.createClass(getClasses.getWrapperClasses({
13
- extraClass: `${builderProps?.uid} ${extraClass ?? ''} `
13
+ extraClass: `${builderProps?.uid} ${extraClass ?? ''} `,
14
+ isAddOverFlowClass: common.checkAddOverFlowClass(style)
14
15
  }));
15
16
  const productImagesGalleryClasses = system.createClass(getClasses.getGalleryWrapperClasses({}));
16
17
  const galleryGridWrapperClasses = system.createClass(getClasses.getGalleryGridWrapperClasses({}));
@@ -24,7 +24,8 @@ const HeroBanner = (props)=>{
24
24
  contentPosition2Col: styles?.contentPosition2Col,
25
25
  aspectRatio: setting?.aspectRatio,
26
26
  target: urlData?.target ?? '_blank',
27
- href: urlData?.href ?? ''
27
+ href: urlData?.href ?? '',
28
+ linkType: link?.type ?? ''
28
29
  });
29
30
  const hasLinkCover = !!link?.link;
30
31
  const attrs = createAttr({
@@ -43,8 +43,11 @@ const getRowClasses = (styles, setting)=>{
43
43
  const fitContentClass = getClassForContentByFitContent(sizeSetting, background);
44
44
  const stretchContentClass = getClassForStretchContent(verticalAlign);
45
45
  const layoutClass = getClassSpaceBetween(setting?.layout || {}, styles?.contentPosition1Col || {}, styles?.contentPosition2Col || {});
46
- const classList = `gp-hero-banner-row gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-transition-all gp-duration-300 group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))] ${fitContentClass} ${stretchContentClass} ${layoutClass}`;
47
- return composeClasses(classList.trim());
46
+ const classList = `gp-hero-banner-row gp-transition-all gp-duration-300 group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))] ${fitContentClass} ${stretchContentClass}`;
47
+ return {
48
+ ...composeClasses(classList),
49
+ ...layoutClass
50
+ };
48
51
  };
49
52
  const getAdaptiveClasses = ()=>{
50
53
  const classList = `adaptive-hero-banner`;
@@ -162,6 +162,7 @@ const SettingsV2 = [
162
162
  label: 'Speed',
163
163
  useOnlyUnitInit: true,
164
164
  hideUnit: true,
165
+ isNumber: true,
165
166
  min: 0,
166
167
  max: 1,
167
168
  step: 0.1,
@@ -668,9 +669,6 @@ const SettingsV2 = [
668
669
  id: 'overlayColor',
669
670
  label: 'Color',
670
671
  type: 'color-picker-v2',
671
- default: {
672
- normal: '#121212'
673
- },
674
672
  state: {
675
673
  normal: true,
676
674
  hover: true
@@ -102,36 +102,41 @@ const SettingUIV2 = [
102
102
  id: 'background'
103
103
  },
104
104
  layout: 'vertical'
105
- },
106
- {
107
- label: {
108
- en: 'Overlay'
109
- },
110
- type: 'combo',
111
- comboType: 'color',
112
- getValueFromSettingID: 'overlayColor.normal',
113
- controls: [
114
- {
115
- setting: {
116
- id: 'overlayColor',
117
- state: 'normal'
118
- },
119
- label: {
120
- en: 'Color'
121
- }
105
+ }
106
+ ],
107
+ moreSettings: {
108
+ type: 'collapse',
109
+ controls: [
110
+ {
111
+ label: {
112
+ en: 'Overlay'
122
113
  },
123
- {
124
- setting: {
125
- id: 'overlayOpacity',
126
- state: 'normal'
114
+ type: 'combo',
115
+ comboType: 'color',
116
+ getValueFromSettingID: 'overlayColor.normal',
117
+ controls: [
118
+ {
119
+ setting: {
120
+ id: 'overlayColor',
121
+ state: 'normal'
122
+ },
123
+ label: {
124
+ en: 'Color'
125
+ }
127
126
  },
128
- label: {
129
- en: 'Opacity'
127
+ {
128
+ setting: {
129
+ id: 'overlayOpacity',
130
+ state: 'normal'
131
+ },
132
+ label: {
133
+ en: 'Opacity'
134
+ }
130
135
  }
131
- }
132
- ]
133
- }
134
- ]
136
+ ]
137
+ }
138
+ ]
139
+ }
135
140
  },
136
141
  {
137
142
  label: {
@@ -245,7 +250,7 @@ const SettingUIV2 = [
245
250
  {
246
251
  type: 'combo',
247
252
  fixedValue: 'Effect',
248
- iconName: 'polaris-star',
253
+ iconName: 'polaris-check-clicked',
249
254
  label: {
250
255
  en: 'Hover'
251
256
  },
@@ -309,7 +314,7 @@ const SettingUIV2 = [
309
314
  label: {
310
315
  en: 'Parallax scroll'
311
316
  },
312
- iconName: 'polaris-star',
317
+ iconName: 'polaris-parallax-effect',
313
318
  getValueFromSettingID: 'speedParallax',
314
319
  defaultValueWhenClear: 0,
315
320
  controls: [
@@ -14,7 +14,7 @@ const getDotStyle = (props, componentType)=>{
14
14
  devices.forEach((device)=>{
15
15
  const dotStyleSetting = getResponsiveValueByScreen(style, device);
16
16
  const deviceType = device === 'desktop' ? '' : `${device}`;
17
- result[`d${deviceType.length === 0 ? '' : '-' + deviceType}`] = dotStyleSetting && dotStyleSetting !== 'none' ? 'flex' : 'none';
17
+ result[`--d${deviceType.length === 0 ? '' : '-' + deviceType}`] = dotStyleSetting && dotStyleSetting !== 'none' ? 'flex' : 'none';
18
18
  });
19
19
  return result;
20
20
  };
@@ -47,6 +47,14 @@ const getDisplayStyle = (fnCondition, defaultValue)=>{
47
47
  });
48
48
  return result;
49
49
  };
50
+ const checkAddOverFlowClass = (style)=>{
51
+ const radius = style?.['--radius'];
52
+ const bblr = style?.['--bblr'] || '0px';
53
+ const bbrr = style?.['--bbrr'] || '0px';
54
+ const btlr = style?.['--btlr'] || '0px';
55
+ const btrr = style?.['--btrr'] || '0px';
56
+ return radius && !radius.toString().includes('none') && radius.toString() !== '0' || bblr !== '0px' || bbrr !== '0px' || btlr !== '0px' || btrr !== '0px';
57
+ };
50
58
  const getAspectRatio = (shape)=>{
51
59
  let result = {};
52
60
  const DEVICES = [
@@ -355,4 +363,4 @@ const getPaddingBottomByShapeSetting = (shapeSetting)=>{
355
363
  return result;
356
364
  };
357
365
 
358
- export { convertSpacing, convertSpacingForIndisdeLayout, convertUnitToNumber, getAspectRatio, getConditionRenderGalleryImages, getDisplayStyle, getPaddingBottomByShapeSetting, getSrcImage, getStyleGridLayout, getStyleGridOrderForFeature, getStyleGridOrderForGallery, getStyleInsideLayout, getTypeWidthDevice, setDefaultWhenUndefineSetting };
366
+ export { checkAddOverFlowClass, convertSpacing, convertSpacingForIndisdeLayout, convertUnitToNumber, getAspectRatio, getConditionRenderGalleryImages, getDisplayStyle, getPaddingBottomByShapeSetting, getSrcImage, getStyleGridLayout, getStyleGridOrderForFeature, getStyleGridOrderForGallery, getStyleInsideLayout, getTypeWidthDevice, setDefaultWhenUndefineSetting };
@@ -6,9 +6,10 @@ function composeClasses(classList) {
6
6
  return acc;
7
7
  }, {});
8
8
  }
9
- const getWrapperClasses = ({ extraClass })=>{
10
- let classList = 'gp-relative gp-overflow-hidden';
9
+ const getWrapperClasses = ({ extraClass, isAddOverFlowClass = false })=>{
10
+ let classList = 'gp-relative gp-w-full';
11
11
  if (extraClass) classList += ` ${extraClass}`;
12
+ if (isAddOverFlowClass) classList += ` gp-overflow-hidden`;
12
13
  return composeClasses(classList);
13
14
  };
14
15
  const getGalleryWrapperClasses = ({ extraClass })=>{
@@ -69,7 +70,7 @@ const getFeaturedImageGalleryClasses = ({ settings, extraClass })=>{
69
70
  return composeClasses(classList);
70
71
  };
71
72
  const getGalleryItemClasses = ({ extraClass })=>{
72
- let classList = `gp-image-item gem-slider-item gp-group gp-relative gp-overflow-hidden gp-cursor-pointer data-[outline=deactive]:after:!gp-border-transparent data-[outline=deactive]:after:!gp-border-transparent`;
73
+ let classList = `gp-image-item gp-flex gp-items-center gp-justify-center gp-group gp-relative gp-overflow-hidden gp-cursor-pointer data-[outline=deactive]:after:!gp-border-transparent data-[outline=deactive]:after:!gp-border-transparent`;
73
74
  if (extraClass) classList += ` ${extraClass}`;
74
75
  return composeClasses(classList);
75
76
  };
@@ -1,14 +1,15 @@
1
1
  import { createClass } from '@gem-sdk/system';
2
2
  import { getWrapperClasses, getGalleryWrapperClasses, getGalleryGridWrapperClasses, getFtImageWithGalleryClasses, getImageGalleryWrapperClasses, getFeaturedImageCarouselClasses, getFeaturedImageGalleryClasses, getFeaturedImageClasses, getGalleryItemClasses, getFeaturedCarouselItemClasses } from '../common/getClasses.js';
3
- import { setDefaultWhenUndefineSetting } from '../common/common.js';
3
+ import { checkAddOverFlowClass, setDefaultWhenUndefineSetting } from '../common/common.js';
4
4
 
5
5
  const getProductImagesClassName = (props)=>{
6
- const { setting } = props;
6
+ const { setting, style } = props;
7
7
  const productImagesProps = setDefaultWhenUndefineSetting(props);
8
8
  const { builderProps, advanced } = productImagesProps;
9
9
  const extraClass = advanced?.cssClass;
10
10
  const wrapperClasses = createClass(getWrapperClasses({
11
- extraClass: `${builderProps?.uid} ${extraClass ?? ''} `
11
+ extraClass: `${builderProps?.uid} ${extraClass ?? ''} `,
12
+ isAddOverFlowClass: checkAddOverFlowClass(style)
12
13
  }));
13
14
  const productImagesGalleryClasses = createClass(getGalleryWrapperClasses({}));
14
15
  const galleryGridWrapperClasses = createClass(getGalleryGridWrapperClasses({}));
@@ -700,6 +700,7 @@ type Setting$4 = {
700
700
  link?: {
701
701
  link?: string;
702
702
  target?: string;
703
+ type?: string;
703
704
  };
704
705
  preload?: boolean;
705
706
  order?: ObjectDevices$1<number>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.422",
3
+ "version": "2.0.0-dev.424",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",