@gem-sdk/components 2.0.11 → 2.0.12

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.
@@ -89,7 +89,7 @@ const AccordionItem = ({ accordions, index, rawChildren, builderProps, title, pa
89
89
  }
90
90
  .gp-accordion-item .gp-accordion-item-${parentUid}-${index}:hover .gp-collapsible-icon.gp-accordion-item-active, .gp-accordion-item .gp-accordion-item-${parentUid}-${index}:hover .gp-icon.gp-accordion-item-active
91
91
  {
92
- color: ${iconColor?.active} !important
92
+ color: ${color?.active} !important
93
93
  }
94
94
  </style>
95
95
  <div class="gp-overflow-clip" style="${{
@@ -45,6 +45,11 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
45
45
  parentStyle,
46
46
  passProps.style
47
47
  ]);
48
+ const itemShadowStyle = core.getStyleShadow({
49
+ value: parentStyle?.carouselShadow,
50
+ styleAppliedFor: 'box-shadow',
51
+ isEnableShadow: parentStyle?.hasActiveShadow
52
+ });
48
53
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
49
54
  ...builderAttrs,
50
55
  ...passProps,
@@ -68,7 +73,12 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
68
73
  },
69
74
  onClick: onClickItem,
70
75
  "aria-hidden": true,
71
- children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : children
76
+ children: /*#__PURE__*/ jsxRuntime.jsx("div", {
77
+ style: {
78
+ ...itemShadowStyle
79
+ },
80
+ children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : children
81
+ })
72
82
  });
73
83
  };
74
84
 
@@ -35,6 +35,11 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
35
35
  })
36
36
  };
37
37
  };
38
+ const itemShadowStyle = core.getStyleShadow({
39
+ value: parentStyle?.carouselShadow,
40
+ styleAppliedFor: 'box-shadow',
41
+ isEnableShadow: parentStyle?.hasActiveShadow
42
+ });
38
43
  return core.template`
39
44
  <div
40
45
  media-type="{{media.media_type}}"
@@ -79,7 +84,13 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
79
84
  class="${core.cls(`gem-slider-item gp-w-full gem-slider-item-${parentId || ''} gp-child-item-${parentUid}`, builderProps?.uid, className)}"
80
85
  data-index="${index}"
81
86
  >
87
+ <div
88
+ style="${{
89
+ ...itemShadowStyle
90
+ }}"
91
+ >
82
92
  ${children}
93
+ </div>
83
94
  </div>
84
95
  `;
85
96
  };
@@ -7,6 +7,7 @@ var React = require('react');
7
7
  var commonStyles = require('../constants/commonStyles.js');
8
8
  var core = require('@gem-sdk/core');
9
9
  var helpers = require('../../image/components/helpers.js');
10
+ var helpers$1 = require('./common/helpers.js');
10
11
 
11
12
  const CompareImage = (props)=>{
12
13
  const { handle = null, handleSize = 40, hover = false, leftImage, leftImageAlt = '', leftImageTitle = '', leftImageCss = {}, leftImageLabel = null, onSliderPositionChange, rightImage, rightImageAlt = '', rightImageTitle = '', rightImageCss = {}, rightImageLabel = null, sliderLineColor = '#ffffff', sliderLineWidth = 2, sliderPositionPercentage = 0.5, vertical = false, enableLabel = false, componentUid, styles = {}, builderData, preload } = props;
@@ -448,10 +449,7 @@ const CompareImage = (props)=>{
448
449
  title: "",
449
450
  width: tempImage?.width,
450
451
  height: tempImage?.height,
451
- style: {
452
- position: 'static',
453
- opacity: 0
454
- }
452
+ style: helpers$1.styleLazyPlaceholder(aspectRatio)
455
453
  }),
456
454
  /*#__PURE__*/ jsxRuntime.jsx("img", {
457
455
  onLoad: ()=>setRightImgLoaded(true),
@@ -5,9 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var core = require('@gem-sdk/core');
6
6
  var Label_liquid = require('./Label.liquid.js');
7
7
  var NextImage_liquid = require('../../image/components/NextImage.liquid.js');
8
- var helpers$1 = require('../../image/components/helpers.js');
8
+ var helpers$2 = require('../../image/components/helpers.js');
9
9
  var getSrcSet = require('../../image/helpers/getSrcSet.js');
10
- var helpers = require('../../helpers.js');
10
+ var helpers$1 = require('../../helpers.js');
11
+ var helpers = require('./common/helpers.js');
11
12
 
12
13
  const CompareImage = (props)=>{
13
14
  const { handle = null, handleSize = 40, hover = false, leftImage, leftImageAlt = '', leftImageTitle = '', leftImageCss = {}, leftImageLabel = null, onSliderPositionChange, rightImage, rightImageAlt = '', rightImageTitle = '', rightImageCss = {}, rightImageLabel = null, sliderLineColor = '#ffffff', sliderLineWidth = 2, sliderPositionPercentage = 0.5, vertical = false, enableLabel = false, componentUid = '', styles, advanced, builderData, preload = false, pageContext, translate } = props;
@@ -19,19 +20,19 @@ const CompareImage = (props)=>{
19
20
  const rightSrcImage = getSrcSet.getImageSrc(rightImage);
20
21
  const leftSrcImage = getSrcSet.getImageSrc(leftImage);
21
22
  const aspectRatio = {
22
- desktop: helpers$1.composeAspectRatio({
23
+ desktop: helpers$2.composeAspectRatio({
23
24
  device: 'desktop',
24
25
  aspect: styles?.aspectRatio,
25
26
  auto: baseRatioImage,
26
27
  custom: styles?.customAspectRadio
27
28
  }) ?? defaultRatio,
28
- tablet: helpers$1.composeAspectRatio({
29
+ tablet: helpers$2.composeAspectRatio({
29
30
  device: 'tablet',
30
31
  aspect: styles?.aspectRatio,
31
32
  auto: baseRatioImage,
32
33
  custom: styles?.customAspectRadio
33
34
  }),
34
- mobile: helpers$1.composeAspectRatio({
35
+ mobile: helpers$2.composeAspectRatio({
35
36
  device: 'mobile',
36
37
  aspect: styles?.aspectRatio,
37
38
  auto: baseRatioImage,
@@ -254,10 +255,7 @@ const CompareImage = (props)=>{
254
255
  title=""
255
256
  width="${tempImage?.width}"
256
257
  height="${tempImage?.height}"
257
- style="${{
258
- position: 'static',
259
- opacity: 0
260
- }}"
258
+ style="${helpers.styleLazyPlaceholder(aspectRatio)}"
261
259
  />
262
260
  ${NextImage_liquid.default({
263
261
  customAttrs: {
@@ -343,7 +341,7 @@ const CompareImage = (props)=>{
343
341
  }) : ''}
344
342
  </div></div>
345
343
  </gp-image-comparison>
346
- ${core.RenderIf(core.isLocalEnv, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-image-comparison.js' | asset_url }}" defer="defer"></script>`, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="${core.baseAssetURL}/assets-v2/gp-image-comparison.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
344
+ ${core.RenderIf(core.isLocalEnv, `<script ${helpers$1.getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-image-comparison.js' | asset_url }}" defer="defer"></script>`, `<script ${helpers$1.getSettingPreloadData('class="gps-link" delay', 'src')}="${core.baseAssetURL}/assets-v2/gp-image-comparison.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
347
345
  `;
348
346
  };
349
347
 
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var core = require('@gem-sdk/core');
4
+
5
+ const styleLazyPlaceholder = (aspectRatio)=>{
6
+ return {
7
+ '--pos': 'static',
8
+ '--op': 0,
9
+ ...core.makeStyleResponsive('aspect', aspectRatio)
10
+ };
11
+ };
12
+
13
+ exports.styleLazyPlaceholder = styleLazyPlaceholder;
@@ -99,7 +99,7 @@ const DynamicCheckout = ({ builderProps, styles, advanced, setting, pageContext
99
99
  })}
100
100
  ${composeSpacing('desktop')}
101
101
  ${core.composeCornerCss(styles?.roundedBtn?.normal, true)}
102
- ${composeSize(composeGlobalSize.width.desktop ?? 'auto', composeGlobalSize.height.desktop ?? 'auto', false)}
102
+ ${composeSize(undefined, composeGlobalSize.height.desktop ?? 'auto', false)}
103
103
  }
104
104
  .wrap__button--unbranded__${builderProps?.uid} .shopify-payment-button .shopify-payment-button__button--unbranded::before {
105
105
  content: "";
@@ -19,7 +19,7 @@ const config = {
19
19
  controls: [
20
20
  {
21
21
  id: 'textContent',
22
- type: 'input',
22
+ type: 'textarea',
23
23
  default: 'Click or drop your image to upload (Max 10MB)'
24
24
  },
25
25
  {
@@ -865,14 +865,29 @@ const config = {
865
865
  ]
866
866
  },
867
867
  {
868
- type: 'control',
868
+ type: 'group',
869
869
  label: {
870
870
  en: 'Text'
871
871
  },
872
- setting: {
873
- id: 'typo'
874
- },
875
- layout: 'vertical'
872
+ controls: [
873
+ {
874
+ type: 'control',
875
+ label: {
876
+ en: 'Content'
877
+ },
878
+ layout: 'horizontal',
879
+ setting: {
880
+ id: 'textContent'
881
+ }
882
+ },
883
+ {
884
+ type: 'control',
885
+ setting: {
886
+ id: 'typo'
887
+ },
888
+ layout: 'vertical'
889
+ }
890
+ ]
876
891
  },
877
892
  {
878
893
  type: 'group',
@@ -85,7 +85,7 @@ const AccordionItem = ({ accordions, index, rawChildren, builderProps, title, pa
85
85
  }
86
86
  .gp-accordion-item .gp-accordion-item-${parentUid}-${index}:hover .gp-collapsible-icon.gp-accordion-item-active, .gp-accordion-item .gp-accordion-item-${parentUid}-${index}:hover .gp-icon.gp-accordion-item-active
87
87
  {
88
- color: ${iconColor?.active} !important
88
+ color: ${color?.active} !important
89
89
  }
90
90
  </style>
91
91
  <div class="gp-overflow-clip" style="${{
@@ -41,6 +41,11 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
41
41
  parentStyle,
42
42
  passProps.style
43
43
  ]);
44
+ const itemShadowStyle = getStyleShadow({
45
+ value: parentStyle?.carouselShadow,
46
+ styleAppliedFor: 'box-shadow',
47
+ isEnableShadow: parentStyle?.hasActiveShadow
48
+ });
44
49
  return /*#__PURE__*/ jsx("div", {
45
50
  ...builderAttrs,
46
51
  ...passProps,
@@ -64,7 +69,12 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
64
69
  },
65
70
  onClick: onClickItem,
66
71
  "aria-hidden": true,
67
- children: isEmptyChildren(children) ? /*#__PURE__*/ jsx(ChildrenDroppable, {}) : children
72
+ children: /*#__PURE__*/ jsx("div", {
73
+ style: {
74
+ ...itemShadowStyle
75
+ },
76
+ children: isEmptyChildren(children) ? /*#__PURE__*/ jsx(ChildrenDroppable, {}) : children
77
+ })
68
78
  });
69
79
  };
70
80
 
@@ -1,4 +1,4 @@
1
- import { template, getStyleBackgroundByDevice, makeStyleResponsive, cls, makeStyle, getSingleColorVariable, getStyleShadow, getRadiusStyleActiveState } from '@gem-sdk/core';
1
+ import { getStyleShadow, template, getStyleBackgroundByDevice, makeStyleResponsive, cls, makeStyle, getSingleColorVariable, getRadiusStyleActiveState } from '@gem-sdk/core';
2
2
  import { getInitialWidthForCarouselItem, getCarouselSneakPeakTranslate } from './common/carousel.js';
3
3
 
4
4
  const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, builderProps, style, className, parentId, parentStyle, parentSettings, background, index, customStyle, parentUid, contentType = 'normalItem', ...passProps })=>{
@@ -31,6 +31,11 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
31
31
  })
32
32
  };
33
33
  };
34
+ const itemShadowStyle = getStyleShadow({
35
+ value: parentStyle?.carouselShadow,
36
+ styleAppliedFor: 'box-shadow',
37
+ isEnableShadow: parentStyle?.hasActiveShadow
38
+ });
34
39
  return template`
35
40
  <div
36
41
  media-type="{{media.media_type}}"
@@ -75,7 +80,13 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
75
80
  class="${cls(`gem-slider-item gp-w-full gem-slider-item-${parentId || ''} gp-child-item-${parentUid}`, builderProps?.uid, className)}"
76
81
  data-index="${index}"
77
82
  >
83
+ <div
84
+ style="${{
85
+ ...itemShadowStyle
86
+ }}"
87
+ >
78
88
  ${children}
89
+ </div>
79
90
  </div>
80
91
  `;
81
92
  };
@@ -3,6 +3,7 @@ import { useState, useRef, useMemo, useEffect, useCallback } from 'react';
3
3
  import styles from '../constants/commonStyles.js';
4
4
  import { useEditorMode, usePageType, getResponsiveValueByScreen, composeBorderCss, composeCornerCss, composeTypographyClassName, composeTypographyStyle, cls, makeStyle, makeStyleResponsive, makeWidth, getCornerCSSFromGlobal } from '@gem-sdk/core';
5
5
  import { composeAspectRatio } from '../../image/components/helpers.js';
6
+ import { styleLazyPlaceholder } from './common/helpers.js';
6
7
 
7
8
  const CompareImage = (props)=>{
8
9
  const { handle = null, handleSize = 40, hover = false, leftImage, leftImageAlt = '', leftImageTitle = '', leftImageCss = {}, leftImageLabel = null, onSliderPositionChange, rightImage, rightImageAlt = '', rightImageTitle = '', rightImageCss = {}, rightImageLabel = null, sliderLineColor = '#ffffff', sliderLineWidth = 2, sliderPositionPercentage = 0.5, vertical = false, enableLabel = false, componentUid, styles: styles$1 = {}, builderData, preload } = props;
@@ -444,10 +445,7 @@ const CompareImage = (props)=>{
444
445
  title: "",
445
446
  width: tempImage?.width,
446
447
  height: tempImage?.height,
447
- style: {
448
- position: 'static',
449
- opacity: 0
450
- }
448
+ style: styleLazyPlaceholder(aspectRatio)
451
449
  }),
452
450
  /*#__PURE__*/ jsx("img", {
453
451
  onLoad: ()=>setRightImgLoaded(true),
@@ -4,6 +4,7 @@ import NextImage from '../../image/components/NextImage.liquid.js';
4
4
  import { composeAspectRatio } from '../../image/components/helpers.js';
5
5
  import { getImageSrc } from '../../image/helpers/getSrcSet.js';
6
6
  import { getSettingPreloadData } from '../../helpers.js';
7
+ import { styleLazyPlaceholder } from './common/helpers.js';
7
8
 
8
9
  const CompareImage = (props)=>{
9
10
  const { handle = null, handleSize = 40, hover = false, leftImage, leftImageAlt = '', leftImageTitle = '', leftImageCss = {}, leftImageLabel = null, onSliderPositionChange, rightImage, rightImageAlt = '', rightImageTitle = '', rightImageCss = {}, rightImageLabel = null, sliderLineColor = '#ffffff', sliderLineWidth = 2, sliderPositionPercentage = 0.5, vertical = false, enableLabel = false, componentUid = '', styles, advanced, builderData, preload = false, pageContext, translate } = props;
@@ -250,10 +251,7 @@ const CompareImage = (props)=>{
250
251
  title=""
251
252
  width="${tempImage?.width}"
252
253
  height="${tempImage?.height}"
253
- style="${{
254
- position: 'static',
255
- opacity: 0
256
- }}"
254
+ style="${styleLazyPlaceholder(aspectRatio)}"
257
255
  />
258
256
  ${NextImage({
259
257
  customAttrs: {
@@ -0,0 +1,11 @@
1
+ import { makeStyleResponsive } from '@gem-sdk/core';
2
+
3
+ const styleLazyPlaceholder = (aspectRatio)=>{
4
+ return {
5
+ '--pos': 'static',
6
+ '--op': 0,
7
+ ...makeStyleResponsive('aspect', aspectRatio)
8
+ };
9
+ };
10
+
11
+ export { styleLazyPlaceholder };
@@ -95,7 +95,7 @@ const DynamicCheckout = ({ builderProps, styles, advanced, setting, pageContext
95
95
  })}
96
96
  ${composeSpacing('desktop')}
97
97
  ${composeCornerCss(styles?.roundedBtn?.normal, true)}
98
- ${composeSize(composeGlobalSize.width.desktop ?? 'auto', composeGlobalSize.height.desktop ?? 'auto', false)}
98
+ ${composeSize(undefined, composeGlobalSize.height.desktop ?? 'auto', false)}
99
99
  }
100
100
  .wrap__button--unbranded__${builderProps?.uid} .shopify-payment-button .shopify-payment-button__button--unbranded::before {
101
101
  content: "";
@@ -15,7 +15,7 @@ const config = {
15
15
  controls: [
16
16
  {
17
17
  id: 'textContent',
18
- type: 'input',
18
+ type: 'textarea',
19
19
  default: 'Click or drop your image to upload (Max 10MB)'
20
20
  },
21
21
  {
@@ -861,14 +861,29 @@ const config = {
861
861
  ]
862
862
  },
863
863
  {
864
- type: 'control',
864
+ type: 'group',
865
865
  label: {
866
866
  en: 'Text'
867
867
  },
868
- setting: {
869
- id: 'typo'
870
- },
871
- layout: 'vertical'
868
+ controls: [
869
+ {
870
+ type: 'control',
871
+ label: {
872
+ en: 'Content'
873
+ },
874
+ layout: 'horizontal',
875
+ setting: {
876
+ id: 'textContent'
877
+ }
878
+ },
879
+ {
880
+ type: 'control',
881
+ setting: {
882
+ id: 'typo'
883
+ },
884
+ layout: 'vertical'
885
+ }
886
+ ]
872
887
  },
873
888
  {
874
889
  type: 'group',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.11",
3
+ "version": "2.0.12",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",