@gem-sdk/components 2.0.0-dev.617 → 2.0.0-dev.620

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 (39) hide show
  1. package/dist/cjs/banner/components/HeroBanner.js +3 -1
  2. package/dist/cjs/banner/components/HeroBanner.liquid.js +2 -1
  3. package/dist/cjs/banner/components/common/common.js +12 -0
  4. package/dist/cjs/banner/setting/presets/heroBanner1ColPreSalesPage.js +1 -3
  5. package/dist/cjs/banner/setting/presets/heroBannerContentLeftPreSalesPage.js +1 -3
  6. package/dist/cjs/banner/setting/presets/heroBannerContentRightPreSalesPage.js +1 -3
  7. package/dist/cjs/banner/setting/presets/heroBannerParallaxPreSalesPage.js +1 -3
  8. package/dist/cjs/banner/setting/presets/heroBannerVideoPreSalesPage.js +1 -3
  9. package/dist/cjs/button/components/Button.liquid.js +4 -0
  10. package/dist/cjs/button/components/ButtonLabel.liquid.js +2 -1
  11. package/dist/cjs/button/components/common/helpers.js +9 -2
  12. package/dist/cjs/button/components/common/styles.js +2 -2
  13. package/dist/cjs/button/setting/Button.js +2 -6
  14. package/dist/cjs/estimate-delivery/setting/configs/uiV2.js +1 -0
  15. package/dist/cjs/image/components/common/attributes.js +9 -0
  16. package/dist/cjs/image/setting/configs/presets.js +2 -6
  17. package/dist/cjs/image-comparison/components/common/styles.js +0 -1
  18. package/dist/cjs/product/setting/product-button/configs/settings.js +2 -4
  19. package/dist/cjs/product/setting/product-view-more/configs/settings.js +6 -2
  20. package/dist/esm/banner/components/HeroBanner.js +3 -1
  21. package/dist/esm/banner/components/HeroBanner.liquid.js +3 -2
  22. package/dist/esm/banner/components/common/common.js +12 -1
  23. package/dist/esm/banner/setting/presets/heroBanner1ColPreSalesPage.js +1 -3
  24. package/dist/esm/banner/setting/presets/heroBannerContentLeftPreSalesPage.js +1 -3
  25. package/dist/esm/banner/setting/presets/heroBannerContentRightPreSalesPage.js +1 -3
  26. package/dist/esm/banner/setting/presets/heroBannerParallaxPreSalesPage.js +1 -3
  27. package/dist/esm/banner/setting/presets/heroBannerVideoPreSalesPage.js +1 -3
  28. package/dist/esm/button/components/Button.liquid.js +5 -1
  29. package/dist/esm/button/components/ButtonLabel.liquid.js +2 -1
  30. package/dist/esm/button/components/common/helpers.js +9 -2
  31. package/dist/esm/button/components/common/styles.js +2 -2
  32. package/dist/esm/button/setting/Button.js +2 -6
  33. package/dist/esm/estimate-delivery/setting/configs/uiV2.js +1 -0
  34. package/dist/esm/image/components/common/attributes.js +9 -0
  35. package/dist/esm/image/setting/configs/presets.js +2 -6
  36. package/dist/esm/image-comparison/components/common/styles.js +0 -1
  37. package/dist/esm/product/setting/product-button/configs/settings.js +2 -4
  38. package/dist/esm/product/setting/product-view-more/configs/settings.js +6 -2
  39. package/package.json +1 -1
@@ -11,11 +11,13 @@ var getClasses = require('./common/getClasses.js');
11
11
  var system = require('@gem-sdk/system');
12
12
  var core = require('@gem-sdk/core');
13
13
  var useHeroBanner = require('./hooks/useHeroBanner.js');
14
+ var common = require('./common/common.js');
14
15
 
15
16
  const HeroBanner = (props)=>{
16
17
  const { builderAttrs, builderProps, setting, styles, style, children, advanced, enableLazyloadImage = true } = props;
17
18
  const mode = core.useEditorMode();
18
- const { link, enableLink } = setting ?? {};
19
+ const { enableLink } = setting ?? {};
20
+ const link = common.getBannerLink(setting);
19
21
  const { cssClass } = advanced ?? {};
20
22
  const currentDevice = core.useCurrentDevice();
21
23
  const { elementRef, transform, onMouseEnterParallax, onMouseLeaveParallax, dataVideo, bgRef, isShowVideoHtml5, openLinkBanner, layoutResponsive } = useHeroBanner.useHeroBanner(styles, setting, currentDevice);
@@ -13,7 +13,8 @@ var common = require('./common/common.js');
13
13
 
14
14
  const HeroBanner = (props)=>{
15
15
  const { builderAttrs, builderProps, setting, styles, style, children, advanced, enableLazyloadImage = true } = props;
16
- const { link, enableLink } = setting ?? {};
16
+ const { enableLink } = setting ?? {};
17
+ const link = common.getBannerLink(setting);
17
18
  const { cssClass } = advanced ?? {};
18
19
  const { urlData } = helpers.getInsertLinkData('', link);
19
20
  const stateDataHeroBanner = system.createStateOrContext({
@@ -456,6 +456,17 @@ function debounce(func, wait) {
456
456
  };
457
457
  }
458
458
  const fallbackImg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+';
459
+ const getBannerLink = (setting)=>{
460
+ const link = setting?.link;
461
+ if (link?.type === 'go-to-sales-page') {
462
+ return {
463
+ type: 'go-to-sales-page',
464
+ link: '{{ page.metafields.sales_funnel.sales_page_url }}',
465
+ target: '_self'
466
+ };
467
+ }
468
+ return link;
469
+ };
459
470
 
460
471
  exports.bgiEnableByDevice = bgiEnableByDevice;
461
472
  exports.debounce = debounce;
@@ -463,6 +474,7 @@ exports.fallbackImg = fallbackImg;
463
474
  exports.getAspectRatioSettings = getAspectRatioSettings;
464
475
  exports.getAttachmentDevice = getAttachmentDevice;
465
476
  exports.getBackgroundImageHeroBanner = getBackgroundImageHeroBanner;
477
+ exports.getBannerLink = getBannerLink;
466
478
  exports.getBgImage = getBgImage;
467
479
  exports.getClassAlignBanner = getClassAlignBanner;
468
480
  exports.getClassContentPosition = getClassContentPosition;
@@ -38,9 +38,7 @@ const heroBanner1ColPreSalesPage = {
38
38
  }
39
39
  },
40
40
  link: {
41
- type: 'go-to-sales-page',
42
- link: '{{ page.metafields.sales_funnel.sales_page_url }}',
43
- target: '_self'
41
+ type: 'go-to-sales-page'
44
42
  }
45
43
  },
46
44
  styles: {
@@ -44,9 +44,7 @@ const heroBannerContentLeftPreSalesPage = {
44
44
  }
45
45
  },
46
46
  link: {
47
- type: 'go-to-sales-page',
48
- link: '{{ page.metafields.sales_funnel.sales_page_url }}',
49
- target: '_self'
47
+ type: 'go-to-sales-page'
50
48
  }
51
49
  },
52
50
  styles: {
@@ -53,9 +53,7 @@ const heroBannerContentRightPreSalesPage = {
53
53
  }
54
54
  },
55
55
  link: {
56
- type: 'go-to-sales-page',
57
- link: '{{ page.metafields.sales_funnel.sales_page_url }}',
58
- target: '_self'
56
+ type: 'go-to-sales-page'
59
57
  }
60
58
  },
61
59
  styles: {
@@ -38,9 +38,7 @@ const heroBannerParallaxPreSalesPage = {
38
38
  enableParallax: true,
39
39
  speedParallax: 0.6,
40
40
  link: {
41
- type: 'go-to-sales-page',
42
- link: '{{ page.metafields.sales_funnel.sales_page_url }}',
43
- target: '_self'
41
+ type: 'go-to-sales-page'
44
42
  }
45
43
  },
46
44
  styles: {
@@ -35,9 +35,7 @@ const heroBannerVideoPreSalesPage = {
35
35
  }
36
36
  },
37
37
  link: {
38
- type: 'go-to-sales-page',
39
- link: '{{ page.metafields.sales_funnel.sales_page_url }}',
40
- target: '_self'
38
+ type: 'go-to-sales-page'
41
39
  }
42
40
  },
43
41
  styles: {
@@ -29,6 +29,9 @@ const Button = (props)=>{
29
29
  const buttonStyles = system.createStyle({
30
30
  ...styles.getButtonStyles(styles$1)
31
31
  });
32
+ const buttonLabelStyles = system.createStyle({
33
+ ...styles.getTypoStyles(styles$1)
34
+ });
32
35
  const buttonIconStyles = system.createStyle({
33
36
  ...styles.getButtonIconStyles(styles$1, setting)
34
37
  });
@@ -112,6 +115,7 @@ const Button = (props)=>{
112
115
  label: getLabelToDisplay({
113
116
  isLiquid: true
114
117
  }),
118
+ styles: buttonLabelStyles,
115
119
  classes: buttonLabelClasses
116
120
  }))}
117
121
  </div>
@@ -4,10 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var core = require('@gem-sdk/core');
6
6
 
7
- const ButtonLabel = ({ label, classes })=>{
7
+ const ButtonLabel = ({ label, styles, classes })=>{
8
8
  return core.template`
9
9
  <span
10
10
  data-gp-text
11
+ style="${styles}"
11
12
  class="${classes}"
12
13
  >
13
14
  ${label}
@@ -88,7 +88,8 @@ const getInsertLinkData = ({ setting, htmlType, defaultTag, enableBtnLink, isLiq
88
88
  if (URL_START_WITH.find((el)=>urlHref.startsWith(el))) return true;
89
89
  return false;
90
90
  };
91
- const shouldRenderLink = enableBtnLink ? isDomain || isShopifyDomain || isLink() || isHomePageHref || helpers.isLinkedToSalesPage(setting?.type) : false;
91
+ const linkedToSalesPage = helpers.isLinkedToSalesPage(setting?.type);
92
+ const shouldRenderLink = enableBtnLink ? isDomain || isShopifyDomain || isLink() || isHomePageHref || linkedToSalesPage : false;
92
93
  let transformedUrl = urlHref;
93
94
  if (isLiquid && (isShopifyDomain || isHomePageHref)) {
94
95
  transformedUrl = setting?.isTranslate ? '$locationOrigin' + urlHref : "{{ request.origin }}{{ routes.root_url | split: '/' | join: '/' }}" + urlHref;
@@ -101,12 +102,18 @@ const getInsertLinkData = ({ setting, htmlType, defaultTag, enableBtnLink, isLiq
101
102
  rel: 'nofollow'
102
103
  }
103
104
  };
104
- const urlData = shouldRenderLink ? baseUrlData : isHyperlink ? {
105
+ let urlData = shouldRenderLink ? baseUrlData : isHyperlink ? {
105
106
  ...baseUrlData,
106
107
  type: htmlType
107
108
  } : {
108
109
  type: htmlType
109
110
  };
111
+ if (linkedToSalesPage) {
112
+ urlData = {
113
+ href: '{{ page.metafields.sales_funnel.sales_page_url }}',
114
+ target: '_self'
115
+ };
116
+ }
110
117
  return {
111
118
  HTMLTag,
112
119
  urlData,
@@ -63,8 +63,8 @@ const getTypographyStyles = (styles)=>{
63
63
  delete otherProps['--c'];
64
64
  return {
65
65
  textColorStyle: {
66
- ...colorObj,
67
- ...core.makeStyleResponsiveState('c', processResponsiveHoverColors(styles?.textColorHover))
66
+ ...core.makeStyleResponsiveState('c', processResponsiveHoverColors(styles?.textColorHover)),
67
+ ...colorObj
68
68
  },
69
69
  withoutTextColorStyles: otherProps
70
70
  };
@@ -121,9 +121,7 @@ const config = {
121
121
  },
122
122
  settings: {
123
123
  btnLink: {
124
- type: 'go-to-sales-page',
125
- link: '{{ page.metafields.sales_funnel.sales_page_url }}',
126
- target: '_self'
124
+ type: 'go-to-sales-page'
127
125
  },
128
126
  enableBtnLink: true
129
127
  }
@@ -152,9 +150,7 @@ const config = {
152
150
  iconAlign: 'left',
153
151
  iconSvg: '<svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg" className="w-6 h-6" viewBox="0 0 512 512" fill="currentColor"> <path fill="currentColor" strokeLinecap="round" strokeLinejoin="round" fill="currentColor" d="M115.584 494.176c-12.352 6.336 -26.368 -4.768 -23.872 -18.944l26.56 -151.36L5.536 216.48c-10.528 -10.048 -5.056 -28.416 9.056 -30.4l156.736 -22.272L241.216 25.344c6.304 -12.48 23.36 -12.48 29.664 0l69.888 138.464 156.736 22.272c14.112 1.984 19.584 20.352 9.024 30.4l-112.704 107.392 26.56 151.36c2.496 14.176 -11.52 25.28 -23.872 18.944L256 421.984l-140.448 72.192z" /></svg>',
154
152
  btnLink: {
155
- type: 'go-to-sales-page',
156
- link: '{{ page.metafields.sales_funnel.sales_page_url }}',
157
- target: '_self'
153
+ type: 'go-to-sales-page'
158
154
  },
159
155
  enableBtnLink: true
160
156
  },
@@ -148,6 +148,7 @@ const SettingUIV2 = [
148
148
  fixedValue: 'Estimate delivery between',
149
149
  getValueFromSettingID: 'customText',
150
150
  isHideClear: true,
151
+ compoDefaultValue: 'Estimate delivery between',
151
152
  conditionDisplay: 'enableCustomText === true',
152
153
  controls: [
153
154
  {
@@ -22,6 +22,15 @@ const getLinkWrapperAttrs = ({ urlData, imageLink, title, isLiquid = false })=>{
22
22
  setting: urlData,
23
23
  title
24
24
  };
25
+ if (imageLink?.type === 'go-to-sales-page') {
26
+ return {
27
+ ...attributes,
28
+ setting: {
29
+ href: '{{ page.metafields.sales_funnel.sales_page_url }}',
30
+ target: '_self'
31
+ }
32
+ };
33
+ }
25
34
  return imageLink?.link ? attributes : {};
26
35
  };
27
36
  const getImageLiquidAttrs = ({ pageContext, enableLazyLoadImage = false })=>{
@@ -185,9 +185,7 @@ const ImagePreset = [
185
185
  },
186
186
  settings: {
187
187
  imageLink: {
188
- type: 'go-to-sales-page',
189
- link: '{{ page.metafields.sales_funnel.sales_page_url }}',
190
- target: '_self'
188
+ type: 'go-to-sales-page'
191
189
  }
192
190
  }
193
191
  }
@@ -245,9 +243,7 @@ const ImagePreset = [
245
243
  settings: {
246
244
  imageStyle: 'circle',
247
245
  imageLink: {
248
- type: 'go-to-sales-page',
249
- link: '{{ page.metafields.sales_funnel.sales_page_url }}',
250
- target: '_self'
246
+ type: 'go-to-sales-page'
251
247
  }
252
248
  },
253
249
  styles: {
@@ -74,7 +74,6 @@ const getLabelStyles = ({ type, styles, isHorizontal })=>{
74
74
  }),
75
75
  ...core.makeStyleResponsive('bg', styles?.labelBackgroundColor),
76
76
  ...core.makeStyle({
77
- tt: styles?.transform,
78
77
  c: styles?.labelTextColor ?? '#F9F9F9'
79
78
  })
80
79
  };
@@ -77,8 +77,7 @@ const ProductButtonSettings = [
77
77
  },
78
78
  hiddenSetting: {
79
79
  color: true,
80
- textAlign: true,
81
- transform: true
80
+ textAlign: true
82
81
  },
83
82
  ignoreReRender: true
84
83
  },
@@ -93,8 +92,7 @@ const ProductButtonSettings = [
93
92
  },
94
93
  hiddenSetting: {
95
94
  color: true,
96
- textAlign: true,
97
- transform: true
95
+ textAlign: true
98
96
  },
99
97
  ignoreReRender: true
100
98
  }
@@ -350,12 +350,16 @@ const ProductViewMoreSettings = [
350
350
  type: 'color-picker-v2',
351
351
  devices: {
352
352
  desktop: {
353
- default: {}
353
+ default: {
354
+ hover: 'text-3'
355
+ }
354
356
  }
355
357
  },
356
358
  compoDefaultValue: {
357
359
  desktop: {
358
- default: {}
360
+ default: {
361
+ hover: 'text-3'
362
+ }
359
363
  }
360
364
  }
361
365
  },
@@ -7,11 +7,13 @@ import { getClasses, getLinkClasses } from './common/getClasses.js';
7
7
  import { createAttr, createStyle, createClass, If } from '@gem-sdk/system';
8
8
  import { useEditorMode, useCurrentDevice, filterToolbarPreview } from '@gem-sdk/core';
9
9
  import { useHeroBanner } from './hooks/useHeroBanner.js';
10
+ import { getBannerLink } from './common/common.js';
10
11
 
11
12
  const HeroBanner = (props)=>{
12
13
  const { builderAttrs, builderProps, setting, styles, style, children, advanced, enableLazyloadImage = true } = props;
13
14
  const mode = useEditorMode();
14
- const { link, enableLink } = setting ?? {};
15
+ const { enableLink } = setting ?? {};
16
+ const link = getBannerLink(setting);
15
17
  const { cssClass } = advanced ?? {};
16
18
  const currentDevice = useCurrentDevice();
17
19
  const { elementRef, transform, onMouseEnterParallax, onMouseLeaveParallax, dataVideo, bgRef, isShowVideoHtml5, openLinkBanner, layoutResponsive } = useHeroBanner(styles, setting, currentDevice);
@@ -5,11 +5,12 @@ import { getClasses, getLinkClasses } from './common/getClasses.js';
5
5
  import { createStateOrContext, createAttr, createStyle, createClass, If } from '@gem-sdk/system';
6
6
  import { template, dataStringify, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
7
7
  import { getInsertLinkData, getSettingPreloadData } from '../../helpers.js';
8
- import { getResponsiveSetting } from './common/common.js';
8
+ import { getResponsiveSetting, getBannerLink } from './common/common.js';
9
9
 
10
10
  const HeroBanner = (props)=>{
11
11
  const { builderAttrs, builderProps, setting, styles, style, children, advanced, enableLazyloadImage = true } = props;
12
- const { link, enableLink } = setting ?? {};
12
+ const { enableLink } = setting ?? {};
13
+ const link = getBannerLink(setting);
13
14
  const { cssClass } = advanced ?? {};
14
15
  const { urlData } = getInsertLinkData('', link);
15
16
  const stateDataHeroBanner = createStateOrContext({
@@ -454,5 +454,16 @@ function debounce(func, wait) {
454
454
  };
455
455
  }
456
456
  const fallbackImg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+';
457
+ const getBannerLink = (setting)=>{
458
+ const link = setting?.link;
459
+ if (link?.type === 'go-to-sales-page') {
460
+ return {
461
+ type: 'go-to-sales-page',
462
+ link: '{{ page.metafields.sales_funnel.sales_page_url }}',
463
+ target: '_self'
464
+ };
465
+ }
466
+ return link;
467
+ };
457
468
 
458
- export { bgiEnableByDevice, debounce, fallbackImg, getAspectRatioSettings, getAttachmentDevice, getBackgroundImageHeroBanner, getBgImage, getClassAlignBanner, getClassContentPosition, getClassForContentByFitContent, getClassForStretchContent, getClassSpaceBetween, getClipPath, getContentPosition, getDataVideoHeroBannerResponsive, getDisplayStyleByFitContent, getEnableBgImageByDevice, getPercentageVisible, getResponsiveSetting, getStyleAspectRatioHeroBannerCustom, getStyleHeroBannerBg, getVisibilityStyle, getWidth, horizontalAlign, imagePlaceholder, isScaleImage, mapContentPositionToHorizontal, scrollToContentBanner, showVideoType };
469
+ export { bgiEnableByDevice, debounce, fallbackImg, getAspectRatioSettings, getAttachmentDevice, getBackgroundImageHeroBanner, getBannerLink, getBgImage, getClassAlignBanner, getClassContentPosition, getClassForContentByFitContent, getClassForStretchContent, getClassSpaceBetween, getClipPath, getContentPosition, getDataVideoHeroBannerResponsive, getDisplayStyleByFitContent, getEnableBgImageByDevice, getPercentageVisible, getResponsiveSetting, getStyleAspectRatioHeroBannerCustom, getStyleHeroBannerBg, getVisibilityStyle, getWidth, horizontalAlign, imagePlaceholder, isScaleImage, mapContentPositionToHorizontal, scrollToContentBanner, showVideoType };
@@ -36,9 +36,7 @@ const heroBanner1ColPreSalesPage = {
36
36
  }
37
37
  },
38
38
  link: {
39
- type: 'go-to-sales-page',
40
- link: '{{ page.metafields.sales_funnel.sales_page_url }}',
41
- target: '_self'
39
+ type: 'go-to-sales-page'
42
40
  }
43
41
  },
44
42
  styles: {
@@ -42,9 +42,7 @@ const heroBannerContentLeftPreSalesPage = {
42
42
  }
43
43
  },
44
44
  link: {
45
- type: 'go-to-sales-page',
46
- link: '{{ page.metafields.sales_funnel.sales_page_url }}',
47
- target: '_self'
45
+ type: 'go-to-sales-page'
48
46
  }
49
47
  },
50
48
  styles: {
@@ -51,9 +51,7 @@ const heroBannerContentRightPreSalesPage = {
51
51
  }
52
52
  },
53
53
  link: {
54
- type: 'go-to-sales-page',
55
- link: '{{ page.metafields.sales_funnel.sales_page_url }}',
56
- target: '_self'
54
+ type: 'go-to-sales-page'
57
55
  }
58
56
  },
59
57
  styles: {
@@ -36,9 +36,7 @@ const heroBannerParallaxPreSalesPage = {
36
36
  enableParallax: true,
37
37
  speedParallax: 0.6,
38
38
  link: {
39
- type: 'go-to-sales-page',
40
- link: '{{ page.metafields.sales_funnel.sales_page_url }}',
41
- target: '_self'
39
+ type: 'go-to-sales-page'
42
40
  }
43
41
  },
44
42
  styles: {
@@ -33,9 +33,7 @@ const heroBannerVideoPreSalesPage = {
33
33
  }
34
34
  },
35
35
  link: {
36
- type: 'go-to-sales-page',
37
- link: '{{ page.metafields.sales_funnel.sales_page_url }}',
38
- target: '_self'
36
+ type: 'go-to-sales-page'
39
37
  }
40
38
  },
41
39
  styles: {
@@ -1,7 +1,7 @@
1
1
  import { template, dataStringify, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
2
2
  import { createStyle, createClass, createAttr, createStateOrContext, Liquid, If } from '@gem-sdk/system';
3
3
  import { getButtonAttributes } from './common/attributes.js';
4
- import { getButtonStyles, getButtonIconStyles, getButtonWrapperStyles } from './common/styles.js';
4
+ import { getButtonStyles, getTypoStyles, getButtonIconStyles, getButtonWrapperStyles } from './common/styles.js';
5
5
  import { getButtonClasses, getButtonIconClasses, getButtonLabelClasses, getButtonWrapperClasses, getButtonContentWrapperClasses } from './common/classes.js';
6
6
  import { getSettingPreloadData } from '../../helpers.js';
7
7
  import ButtonIcon from './ButtonIcon.liquid.js';
@@ -25,6 +25,9 @@ const Button = (props)=>{
25
25
  const buttonStyles = createStyle({
26
26
  ...getButtonStyles(styles)
27
27
  });
28
+ const buttonLabelStyles = createStyle({
29
+ ...getTypoStyles(styles)
30
+ });
28
31
  const buttonIconStyles = createStyle({
29
32
  ...getButtonIconStyles(styles, setting)
30
33
  });
@@ -108,6 +111,7 @@ const Button = (props)=>{
108
111
  label: getLabelToDisplay({
109
112
  isLiquid: true
110
113
  }),
114
+ styles: buttonLabelStyles,
111
115
  classes: buttonLabelClasses
112
116
  }))}
113
117
  </div>
@@ -1,9 +1,10 @@
1
1
  import { template } from '@gem-sdk/core';
2
2
 
3
- const ButtonLabel = ({ label, classes })=>{
3
+ const ButtonLabel = ({ label, styles, classes })=>{
4
4
  return template`
5
5
  <span
6
6
  data-gp-text
7
+ style="${styles}"
7
8
  class="${classes}"
8
9
  >
9
10
  ${label}
@@ -86,7 +86,8 @@ const getInsertLinkData = ({ setting, htmlType, defaultTag, enableBtnLink, isLiq
86
86
  if (URL_START_WITH.find((el)=>urlHref.startsWith(el))) return true;
87
87
  return false;
88
88
  };
89
- const shouldRenderLink = enableBtnLink ? isDomain || isShopifyDomain || isLink() || isHomePageHref || isLinkedToSalesPage(setting?.type) : false;
89
+ const linkedToSalesPage = isLinkedToSalesPage(setting?.type);
90
+ const shouldRenderLink = enableBtnLink ? isDomain || isShopifyDomain || isLink() || isHomePageHref || linkedToSalesPage : false;
90
91
  let transformedUrl = urlHref;
91
92
  if (isLiquid && (isShopifyDomain || isHomePageHref)) {
92
93
  transformedUrl = setting?.isTranslate ? '$locationOrigin' + urlHref : "{{ request.origin }}{{ routes.root_url | split: '/' | join: '/' }}" + urlHref;
@@ -99,12 +100,18 @@ const getInsertLinkData = ({ setting, htmlType, defaultTag, enableBtnLink, isLiq
99
100
  rel: 'nofollow'
100
101
  }
101
102
  };
102
- const urlData = shouldRenderLink ? baseUrlData : isHyperlink ? {
103
+ let urlData = shouldRenderLink ? baseUrlData : isHyperlink ? {
103
104
  ...baseUrlData,
104
105
  type: htmlType
105
106
  } : {
106
107
  type: htmlType
107
108
  };
109
+ if (linkedToSalesPage) {
110
+ urlData = {
111
+ href: '{{ page.metafields.sales_funnel.sales_page_url }}',
112
+ target: '_self'
113
+ };
114
+ }
108
115
  return {
109
116
  HTMLTag,
110
117
  urlData,
@@ -61,8 +61,8 @@ const getTypographyStyles = (styles)=>{
61
61
  delete otherProps['--c'];
62
62
  return {
63
63
  textColorStyle: {
64
- ...colorObj,
65
- ...makeStyleResponsiveState('c', processResponsiveHoverColors(styles?.textColorHover))
64
+ ...makeStyleResponsiveState('c', processResponsiveHoverColors(styles?.textColorHover)),
65
+ ...colorObj
66
66
  },
67
67
  withoutTextColorStyles: otherProps
68
68
  };
@@ -117,9 +117,7 @@ const config = {
117
117
  },
118
118
  settings: {
119
119
  btnLink: {
120
- type: 'go-to-sales-page',
121
- link: '{{ page.metafields.sales_funnel.sales_page_url }}',
122
- target: '_self'
120
+ type: 'go-to-sales-page'
123
121
  },
124
122
  enableBtnLink: true
125
123
  }
@@ -148,9 +146,7 @@ const config = {
148
146
  iconAlign: 'left',
149
147
  iconSvg: '<svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg" className="w-6 h-6" viewBox="0 0 512 512" fill="currentColor"> <path fill="currentColor" strokeLinecap="round" strokeLinejoin="round" fill="currentColor" d="M115.584 494.176c-12.352 6.336 -26.368 -4.768 -23.872 -18.944l26.56 -151.36L5.536 216.48c-10.528 -10.048 -5.056 -28.416 9.056 -30.4l156.736 -22.272L241.216 25.344c6.304 -12.48 23.36 -12.48 29.664 0l69.888 138.464 156.736 22.272c14.112 1.984 19.584 20.352 9.024 30.4l-112.704 107.392 26.56 151.36c2.496 14.176 -11.52 25.28 -23.872 18.944L256 421.984l-140.448 72.192z" /></svg>',
150
148
  btnLink: {
151
- type: 'go-to-sales-page',
152
- link: '{{ page.metafields.sales_funnel.sales_page_url }}',
153
- target: '_self'
149
+ type: 'go-to-sales-page'
154
150
  },
155
151
  enableBtnLink: true
156
152
  },
@@ -146,6 +146,7 @@ const SettingUIV2 = [
146
146
  fixedValue: 'Estimate delivery between',
147
147
  getValueFromSettingID: 'customText',
148
148
  isHideClear: true,
149
+ compoDefaultValue: 'Estimate delivery between',
149
150
  conditionDisplay: 'enableCustomText === true',
150
151
  controls: [
151
152
  {
@@ -20,6 +20,15 @@ const getLinkWrapperAttrs = ({ urlData, imageLink, title, isLiquid = false })=>{
20
20
  setting: urlData,
21
21
  title
22
22
  };
23
+ if (imageLink?.type === 'go-to-sales-page') {
24
+ return {
25
+ ...attributes,
26
+ setting: {
27
+ href: '{{ page.metafields.sales_funnel.sales_page_url }}',
28
+ target: '_self'
29
+ }
30
+ };
31
+ }
23
32
  return imageLink?.link ? attributes : {};
24
33
  };
25
34
  const getImageLiquidAttrs = ({ pageContext, enableLazyLoadImage = false })=>{
@@ -183,9 +183,7 @@ const ImagePreset = [
183
183
  },
184
184
  settings: {
185
185
  imageLink: {
186
- type: 'go-to-sales-page',
187
- link: '{{ page.metafields.sales_funnel.sales_page_url }}',
188
- target: '_self'
186
+ type: 'go-to-sales-page'
189
187
  }
190
188
  }
191
189
  }
@@ -243,9 +241,7 @@ const ImagePreset = [
243
241
  settings: {
244
242
  imageStyle: 'circle',
245
243
  imageLink: {
246
- type: 'go-to-sales-page',
247
- link: '{{ page.metafields.sales_funnel.sales_page_url }}',
248
- target: '_self'
244
+ type: 'go-to-sales-page'
249
245
  }
250
246
  },
251
247
  styles: {
@@ -72,7 +72,6 @@ const getLabelStyles = ({ type, styles, isHorizontal })=>{
72
72
  }),
73
73
  ...makeStyleResponsive('bg', styles?.labelBackgroundColor),
74
74
  ...makeStyle({
75
- tt: styles?.transform,
76
75
  c: styles?.labelTextColor ?? '#F9F9F9'
77
76
  })
78
77
  };
@@ -75,8 +75,7 @@ const ProductButtonSettings = [
75
75
  },
76
76
  hiddenSetting: {
77
77
  color: true,
78
- textAlign: true,
79
- transform: true
78
+ textAlign: true
80
79
  },
81
80
  ignoreReRender: true
82
81
  },
@@ -91,8 +90,7 @@ const ProductButtonSettings = [
91
90
  },
92
91
  hiddenSetting: {
93
92
  color: true,
94
- textAlign: true,
95
- transform: true
93
+ textAlign: true
96
94
  },
97
95
  ignoreReRender: true
98
96
  }
@@ -348,12 +348,16 @@ const ProductViewMoreSettings = [
348
348
  type: 'color-picker-v2',
349
349
  devices: {
350
350
  desktop: {
351
- default: {}
351
+ default: {
352
+ hover: 'text-3'
353
+ }
352
354
  }
353
355
  },
354
356
  compoDefaultValue: {
355
357
  desktop: {
356
- default: {}
358
+ default: {
359
+ hover: 'text-3'
360
+ }
357
361
  }
358
362
  }
359
363
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.617",
3
+ "version": "2.0.0-dev.620",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",