@gem-sdk/components 2.0.0-dev.639 → 2.0.0-dev.642

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 (37) hide show
  1. package/dist/cjs/carousel/arrow/Arrow.js +9 -10
  2. package/dist/cjs/carousel/arrow/common/getClass.js +1 -1
  3. package/dist/cjs/carousel/carousel-item/common/getClass.js +1 -1
  4. package/dist/cjs/carousel/root/Carousel.js +3 -2
  5. package/dist/cjs/carousel/setting/configs/uiV2.js +1 -0
  6. package/dist/cjs/coupon/common/index.js +2 -2
  7. package/dist/cjs/coupon/common/styles.js +1 -1
  8. package/dist/cjs/coupon/setting/config/settings.js +14 -1
  9. package/dist/cjs/coupon/setting/config/uiV2.js +10 -3
  10. package/dist/cjs/modal/components/Modal.js +26 -5
  11. package/dist/cjs/product/components/ProductButton/common/styles.js +26 -68
  12. package/dist/cjs/product/components/ProductImagesV2/common/getStyle.js +1 -1
  13. package/dist/cjs/product/components/ProductImagesV2/components/gallery-grid/GalleryGrid.liquid.js +4 -1
  14. package/dist/cjs/product/components/ProductImagesV2/components/lightbox/ProductImagesLightBox.js +12 -8
  15. package/dist/cjs/product/setting/product-button/configs/uiV2.js +0 -9
  16. package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/ProductFeatureImage.js +1 -1
  17. package/dist/cjs/third-party-slot/setting/ThirdPartySlot.js +3 -1
  18. package/dist/cjs/third-party-slot/setting/uiV2.js +1 -7
  19. package/dist/esm/carousel/arrow/Arrow.js +10 -11
  20. package/dist/esm/carousel/arrow/common/getClass.js +1 -1
  21. package/dist/esm/carousel/carousel-item/common/getClass.js +1 -1
  22. package/dist/esm/carousel/root/Carousel.js +3 -2
  23. package/dist/esm/carousel/setting/configs/uiV2.js +1 -0
  24. package/dist/esm/coupon/common/index.js +2 -2
  25. package/dist/esm/coupon/common/styles.js +1 -1
  26. package/dist/esm/coupon/setting/config/settings.js +14 -1
  27. package/dist/esm/coupon/setting/config/uiV2.js +10 -3
  28. package/dist/esm/modal/components/Modal.js +26 -5
  29. package/dist/esm/product/components/ProductButton/common/styles.js +26 -68
  30. package/dist/esm/product/components/ProductImagesV2/common/getStyle.js +1 -1
  31. package/dist/esm/product/components/ProductImagesV2/components/gallery-grid/GalleryGrid.liquid.js +4 -1
  32. package/dist/esm/product/components/ProductImagesV2/components/lightbox/ProductImagesLightBox.js +12 -8
  33. package/dist/esm/product/setting/product-button/configs/uiV2.js +0 -9
  34. package/dist/esm/product/setting/product-image-v2/configs/setting-v2/ProductFeatureImage.js +1 -1
  35. package/dist/esm/third-party-slot/setting/ThirdPartySlot.js +3 -1
  36. package/dist/esm/third-party-slot/setting/uiV2.js +1 -7
  37. package/package.json +2 -2
@@ -14,16 +14,15 @@ const Arrow = (props)=>{
14
14
  const { isRenderCustomIcon } = common.getData(props);
15
15
  const { buttonClass, buttonContentClass } = getClass.getClass(props);
16
16
  const { buttonStyle, buttonContentStyle, innerBorderCss } = getStyle.getStyle(props, 'react');
17
- const customIcon = system.If(isRenderCustomIcon, custom ?? '', /*#__PURE__*/ jsxRuntime.jsx("svg", {
18
- height: "100%",
19
- width: "100%",
20
- xmlns: "http://www.w3.org/2000/svg",
21
- viewBox: "0 0 24 24",
22
- fill: "currentColor",
23
- children: /*#__PURE__*/ jsxRuntime.jsx("path", {
24
- d: "M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z"
25
- })
26
- }));
17
+ const customIcon = system.If(isRenderCustomIcon, custom ?? '', `<svg
18
+ height="100%"
19
+ width="100%"
20
+ xmlns="http://www.w3.org/2000/svg"
21
+ viewBox="0 0 24 24"
22
+ fill="currentColor"
23
+ >
24
+ <path d="M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z" />
25
+ </svg>`);
27
26
  const buttonContent = /*#__PURE__*/ jsxRuntime.jsx("div", {
28
27
  className: buttonContentClass,
29
28
  style: buttonContentStyle,
@@ -28,7 +28,7 @@ const getClass = (props)=>{
28
28
  [classAction]: true
29
29
  },
30
30
  ...{
31
- hidden: isHiddenWhenDisabled && disabled,
31
+ 'gp-invisible': isHiddenWhenDisabled && disabled,
32
32
  'gp-cursor-default gp-text-gray-300': disabled,
33
33
  'gp-cursor-pointer gp-text-gray-500': !disabled,
34
34
  '!gp-invisible group-hover/carousel:!gp-visible': showWhenHover,
@@ -18,7 +18,7 @@ const getClass = (props)=>{
18
18
  }
19
19
  });
20
20
  const carouselItemInnerClass = system.createClass({
21
- 'gp-h-full gp-w-full': true
21
+ 'gp-w-full': true
22
22
  });
23
23
  return {
24
24
  carouselItemClass,
@@ -23,7 +23,7 @@ const Carousel = /*#__PURE__*/ React.forwardRef((props, ref)=>{
23
23
  setting
24
24
  };
25
25
  const { arrowButtonSize, arrowBackgroundColor, arrowGapToEachSide = '16', roundedArrow, arrowIconSize, arrowCustomColor, arrowBorder, arrowShadow, showWhenHover } = setting ?? {};
26
- const { totalSlideItem, isInfinity, slider, currentSlide, localRef, showNavigation, isRenderDots, handleDotClick, getItemsPerPage, sliderRef, handleNextAndPrevSlide, dispatchEventSelectSlide, getNumberOfFullWidthShow } = useCarousel.useCarousel(renderData, ref);
26
+ const { totalSlideItem, isInfinity, slider, currentSlide, localRef, showNavigation, isRenderDots, slideMaxIndex, handleDotClick, getItemsPerPage, sliderRef, handleNextAndPrevSlide, dispatchEventSelectSlide, getNumberOfFullWidthShow } = useCarousel.useCarousel(renderData, ref);
27
27
  const { loopConfig, arrowShowConfig } = getData.getData(renderData);
28
28
  const { rootClassRender, wrapperClassRender, wrapperInnerClass, sliderClass } = getClass.getClass(renderData);
29
29
  const { rootStyleRender, wrapperStyleRender, wrapperInnerStyle } = getStyle.getStyle(renderData);
@@ -32,6 +32,7 @@ const Carousel = /*#__PURE__*/ React.forwardRef((props, ref)=>{
32
32
  const enabledSneakPeak = setting?.sneakPeak?.[currentDevice];
33
33
  const renderArrow = (position)=>{
34
34
  const isNext = position === 'next';
35
+ const isDisable = isNext ? !isInfinity && slider?.track?.details?.abs === slideMaxIndex : !isInfinity && slider?.track?.details?.abs === 0;
35
36
  return /*#__PURE__*/ jsxRuntime.jsx(Arrow.default, {
36
37
  uid: builderProps?.uid,
37
38
  custom: setting?.arrowCustom ?? '',
@@ -50,7 +51,7 @@ const Carousel = /*#__PURE__*/ React.forwardRef((props, ref)=>{
50
51
  handleNextAndPrevSlide(position);
51
52
  },
52
53
  left: !isNext,
53
- disabled: !isInfinity && slider?.track?.details?.abs === 0,
54
+ disabled: isDisable,
54
55
  vertical: setting?.vertical,
55
56
  isHiddenWhenDisabled: isHiddenArrowWhenDisabled,
56
57
  rootId: props?.parentClass
@@ -61,6 +61,7 @@ const carouselNavigationSettings = {
61
61
  },
62
62
  fixedValue: 'Edit',
63
63
  iconName: 'polaris-measurement-size',
64
+ isHideClear: true,
64
65
  controls: [
65
66
  {
66
67
  setting: {
@@ -1,14 +1,14 @@
1
1
  'use strict';
2
2
 
3
3
  const getButtonSetting = ({ setting, htmlType, label, styles })=>{
4
- const { iconSvg, iconAlign, couponLayout, translate, shouldClearSpace, iconVisible } = setting ?? {};
4
+ const { iconSvg, iconAlign, translate, shouldClearSpace, iconVisible } = setting ?? {};
5
5
  const labelConvert = styles?.enableTextStyle ? label : '';
6
6
  return {
7
7
  label: labelConvert,
8
8
  htmlType,
9
9
  iconAlign,
10
10
  iconSvg,
11
- iconVisible: couponLayout === 'icon' && iconVisible,
11
+ iconVisible,
12
12
  translate,
13
13
  shouldClearSpace
14
14
  };
@@ -5,7 +5,7 @@ var core = require('@gem-sdk/core');
5
5
  const getButtonStyles = (styles)=>{
6
6
  return {
7
7
  ...styles,
8
- enableTextStyle: styles?.enableTextStyle !== undefined ? styles.enableTextStyle : true
8
+ enableTextStyle: true
9
9
  };
10
10
  };
11
11
  const getButtonStyle = (style, styles)=>{
@@ -219,7 +219,20 @@ const CouponSettings = [
219
219
  },
220
220
  {
221
221
  id: 'textColorHover',
222
- type: 'color-picker-v2'
222
+ type: 'color-picker-v2',
223
+ devices: {
224
+ desktop: {
225
+ default: {}
226
+ }
227
+ },
228
+ compoDefaultValue: {
229
+ desktop: {
230
+ default: {
231
+ hover: 'text-3',
232
+ active: 'text-3'
233
+ }
234
+ }
235
+ }
223
236
  },
224
237
  {
225
238
  id: 'align',
@@ -240,7 +240,7 @@ const SettingUIV2 = [
240
240
  }
241
241
  },
242
242
  {
243
- conditionDisplay: 'couponLayout == "icon" && iconVisible == true',
243
+ conditionDisplay: 'iconVisible == true',
244
244
  type: 'control',
245
245
  setting: {
246
246
  id: 'iconSvg'
@@ -250,7 +250,7 @@ const SettingUIV2 = [
250
250
  }
251
251
  },
252
252
  {
253
- conditionDisplay: 'couponLayout == "icon" && iconVisible == true',
253
+ conditionDisplay: 'iconVisible == true',
254
254
  type: 'control',
255
255
  label: {
256
256
  en: 'Position'
@@ -260,7 +260,7 @@ const SettingUIV2 = [
260
260
  }
261
261
  },
262
262
  {
263
- conditionDisplay: 'couponLayout == "icon" && iconVisible == true',
263
+ conditionDisplay: 'iconVisible == true',
264
264
  type: 'control',
265
265
  label: {
266
266
  en: 'Gap'
@@ -396,6 +396,13 @@ const SettingUIV2 = [
396
396
  setting: {
397
397
  id: 'textColorHover',
398
398
  state: 'hover'
399
+ },
400
+ compoDefaultValue: {
401
+ desktop: {
402
+ default: {
403
+ normal: '#121212'
404
+ }
405
+ }
399
406
  }
400
407
  }
401
408
  ]
@@ -14,6 +14,7 @@ const Modal = ({ setting, styles, children, willUnmount, closeOnEscape, onKeypre
14
14
  const { open } = setting ?? {};
15
15
  const container = useModalContainer.default();
16
16
  const overlay = React.useRef(null);
17
+ const closeButton = React.useRef(null);
17
18
  const keyboardClose = React.useCallback((event)=>{
18
19
  const keyCode = event.code;
19
20
  const isKeyCodeEscape = keyCode === 'Escape';
@@ -38,7 +39,8 @@ const Modal = ({ setting, styles, children, willUnmount, closeOnEscape, onKeypre
38
39
  ]);
39
40
  const handleClickOverlay = React.useCallback((e)=>{
40
41
  const isClickOutside = e.target === overlay.current;
41
- if (closeOnClickOutside && isClickOutside) {
42
+ const isClickCloseButton = e.target === closeButton.current;
43
+ if (closeOnClickOutside && isClickOutside || isClickCloseButton) {
42
44
  window?.parent?.postMessage?.(JSON.stringify({
43
45
  type: 'active-modal',
44
46
  value: false
@@ -77,7 +79,7 @@ const Modal = ({ setting, styles, children, willUnmount, closeOnEscape, onKeypre
77
79
  /*#__PURE__*/ jsxRuntime.jsx("span", {
78
80
  className: "gp-inline-block gp-h-screen gp-align-middle"
79
81
  }),
80
- /*#__PURE__*/ jsxRuntime.jsx("div", {
82
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
81
83
  className: core.cls('gp-relative gp-my-8 gp-inline-block gp-w-full gp-overflow-hidden gp-rounded gp-bg-white gp-p-6 gp-text-left gp-align-middle gp-shadow-xl gp-transition-all gp-duration-100', {
82
84
  'gp-max-w-2xl': !styles?.width,
83
85
  'gp-scale-100 gp-opacity-100': open,
@@ -86,9 +88,28 @@ const Modal = ({ setting, styles, children, willUnmount, closeOnEscape, onKeypre
86
88
  style: {
87
89
  width: styles?.width
88
90
  },
89
- children: /*#__PURE__*/ jsxRuntime.jsx("div", {
90
- children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : children
91
- })
91
+ children: [
92
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
93
+ className: "gp-absolute gp-right-[16px] gp-top-[16px] gp-z-10 gp-cursor-pointer",
94
+ onClick: handleClickOverlay,
95
+ "aria-hidden": "true",
96
+ children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
97
+ ref: closeButton,
98
+ width: "16",
99
+ height: "16",
100
+ viewBox: "0 0 16 16",
101
+ fill: "none",
102
+ xmlns: "http://www.w3.org/2000/svg",
103
+ children: /*#__PURE__*/ jsxRuntime.jsx("path", {
104
+ d: "M11.1758 12.0241C11.4101 12.2584 11.79 12.2584 12.0243 12.0241C12.2586 11.7898 12.2586 11.4099 12.0243 11.1755L8.84858 7.9998L12.0243 4.82407C12.2586 4.58975 12.2586 4.20986 12.0243 3.97554C11.79 3.74123 11.4101 3.74123 11.1758 3.97554L8.00005 7.15128L4.82431 3.97554C4.59 3.74123 4.2101 3.74123 3.97578 3.97554C3.74147 4.20986 3.74147 4.58975 3.97578 4.82407L7.15152 7.9998L3.97579 11.1755C3.74147 11.4099 3.74147 11.7898 3.97579 12.0241C4.2101 12.2584 4.59 12.2584 4.82431 12.0241L8.00005 8.84833L11.1758 12.0241Z",
105
+ fill: "#676767"
106
+ })
107
+ })
108
+ }),
109
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
110
+ children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : children
111
+ })
112
+ ]
92
113
  })
93
114
  ]
94
115
  })
@@ -25,12 +25,11 @@ const getAddToCartButtonStyles = (styles)=>{
25
25
  };
26
26
  const getSoldOutButtonStyles = (styles)=>{
27
27
  const { isCustomOutOfStock, oosBorder, oosShadow, oosRounded, oosBorderV2, oosShadowV2, oosTextColor, oosRoundedV2, oosBackground, oosTextColorV2, oosBackgroundV2, oosEnableShadow, ...buttonStyles } = styles ?? {};
28
- let buttonSoldOutStyles = {
28
+ const buttonSoldOutStyles = {
29
29
  ...buttonStyles
30
30
  };
31
31
  if (isCustomOutOfStock) {
32
- buttonSoldOutStyles = {
33
- ...buttonStyles,
32
+ Object.assign(buttonSoldOutStyles, {
34
33
  backgroundColor: {
35
34
  normal: oosBackground
36
35
  },
@@ -47,75 +46,34 @@ const getSoldOutButtonStyles = (styles)=>{
47
46
  roundedBtn: {
48
47
  normal: oosRounded
49
48
  }
50
- };
49
+ });
51
50
  }
52
- if (oosBackgroundV2) {
53
- buttonSoldOutStyles.backgroundColorV2 = {
54
- desktop: {
55
- normal: oosBackgroundV2?.desktop?.normal,
56
- hover: buttonSoldOutStyles.backgroundColorV2?.desktop?.hover
57
- },
58
- tablet: {
59
- normal: oosBackgroundV2?.tablet?.normal,
60
- hover: buttonSoldOutStyles.backgroundColorV2?.tablet?.hover
61
- },
62
- mobile: {
63
- normal: oosBackgroundV2?.mobile?.normal,
64
- hover: buttonSoldOutStyles.backgroundColorV2?.mobile?.hover
65
- }
66
- };
67
- }
68
- if (oosShadowV2) {
69
- buttonSoldOutStyles.boxShadowBtnV2 = {
70
- desktop: {
71
- normal: oosShadowV2?.desktop?.normal
72
- },
73
- tablet: {
74
- normal: oosShadowV2?.tablet?.normal
75
- },
76
- mobile: {
77
- normal: oosShadowV2?.mobile?.normal
78
- }
79
- };
80
- }
81
- if (oosRoundedV2) {
82
- buttonSoldOutStyles.roundedBtnV2 = {
83
- desktop: {
84
- normal: oosRoundedV2?.desktop?.normal
85
- },
86
- tablet: {
87
- normal: oosRoundedV2?.tablet?.normal
88
- },
89
- mobile: {
90
- normal: oosRoundedV2?.mobile?.normal
91
- }
92
- };
93
- }
94
- if (oosBorderV2) {
95
- buttonSoldOutStyles.borderBtnV2 = {
96
- desktop: {
97
- normal: oosBorderV2?.desktop?.normal
98
- },
99
- tablet: {
100
- normal: oosBorderV2?.tablet?.normal
101
- },
102
- mobile: {
103
- normal: oosBorderV2?.mobile?.normal
104
- }
105
- };
106
- }
107
- if (oosTextColorV2) {
108
- buttonSoldOutStyles.typo = buttonSoldOutStyles.typo ?? {};
109
- buttonSoldOutStyles.typo.attrs = buttonSoldOutStyles.typo.attrs ?? {};
110
- if (oosTextColorV2.desktop?.normal) {
111
- buttonSoldOutStyles.typo = {
112
- ...buttonSoldOutStyles.typo,
113
- attrs: {
114
- ...buttonSoldOutStyles.typo.attrs,
115
- color: oosTextColorV2.desktop.normal
51
+ const mapStylesByDevice = (target, key, value)=>{
52
+ if (value) {
53
+ target[key] = {
54
+ desktop: {
55
+ normal: value.desktop?.normal,
56
+ hover: target[key]?.desktop?.hover
57
+ },
58
+ tablet: {
59
+ normal: value.tablet?.normal,
60
+ hover: target[key]?.tablet?.hover
61
+ },
62
+ mobile: {
63
+ normal: value.mobile?.normal,
64
+ hover: target[key]?.mobile?.hover
116
65
  }
117
66
  };
118
67
  }
68
+ };
69
+ mapStylesByDevice(buttonSoldOutStyles, 'backgroundColorV2', oosBackgroundV2);
70
+ mapStylesByDevice(buttonSoldOutStyles, 'boxShadowBtnV2', oosShadowV2);
71
+ mapStylesByDevice(buttonSoldOutStyles, 'roundedBtnV2', oosRoundedV2);
72
+ mapStylesByDevice(buttonSoldOutStyles, 'borderBtnV2', oosBorderV2);
73
+ if (oosTextColorV2?.desktop?.normal) {
74
+ buttonSoldOutStyles.typo = buttonSoldOutStyles.typo ?? {};
75
+ buttonSoldOutStyles.typo.attrs = buttonSoldOutStyles.typo.attrs ?? {};
76
+ buttonSoldOutStyles.typo.attrs.color = oosTextColorV2.desktop.normal;
119
77
  }
120
78
  return {
121
79
  ...getButtonBaseStyles(),
@@ -190,7 +190,7 @@ const getGalleryCarouselStyle = (setting)=>{
190
190
  const getWidthByLayoutForCarouselByDevice = (device)=>{
191
191
  const layout = core.getResponsiveValueByScreen(setting?.position, device);
192
192
  const isLayoutBottom = layout === 'bottom-center' || layout === 'inside-bottom';
193
- const isInsideLayout = layout === 'inside-left' || layout === 'inside-right';
193
+ const isInsideLayout = layout === 'inside-left' || layout === 'inside-right' || layout === 'left' || layout === 'right';
194
194
  const shapeSetting = core.getResponsiveValueByScreen(shapeByLayout, device);
195
195
  return isLayoutBottom || isInsideLayout || !shapeSetting?.width ? '100%' : shapeSetting.width;
196
196
  };
@@ -140,7 +140,10 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
140
140
  layout: setting?.layout,
141
141
  qualityType: setting?.qualityType,
142
142
  qualityPercent: setting?.qualityPercent
143
- }, {})}
143
+ }, {
144
+ width: '100%',
145
+ height: '100%'
146
+ })}
144
147
 
145
148
  <div class="gp-absolute gp-inset-0 gp-flex gp-cursor-pointer gp-items-center gp-justify-center gp-bg-black/50 gp-opacity-0 gp-transition-opacity gp-duration-100 group-hover:gp-opacity-100"
146
149
  style="${_function.getStyleOfObject(productGallery.getZoomDisplay(setting?.clickOpenLightBox))}" >
@@ -24,7 +24,7 @@ const ProductImagesLightBox = ({ builderPropUID, productImages, open, imageRatio
24
24
  productImages,
25
25
  featuredImageGlobal
26
26
  ]);
27
- const showControl = {
27
+ const navigationEnable = {
28
28
  desktop: productImages && productImages.length > 1,
29
29
  mobile: productImages && productImages?.length > 1,
30
30
  tablet: productImages && productImages?.length > 1
@@ -47,7 +47,10 @@ const ProductImagesLightBox = ({ builderPropUID, productImages, open, imageRatio
47
47
  width: '80%'
48
48
  },
49
49
  closeOnClickOutside: true,
50
- onClose: ()=>onHandleClose(),
50
+ onClose: ()=>{
51
+ onHandleClose();
52
+ console.log('onHandleClose');
53
+ },
51
54
  disableIframeClickEvent: true,
52
55
  contentClass: "mobile:!gp-w-[100%] gp-px-2 gp-pb-10",
53
56
  children: /*#__PURE__*/ jsxRuntime.jsx(Carousel.default, {
@@ -79,17 +82,18 @@ const ProductImagesLightBox = ({ builderPropUID, productImages, open, imageRatio
79
82
  mobile: '#121212',
80
83
  tablet: '#121212'
81
84
  },
82
- controlOverContent: {
83
- desktop: true,
84
- mobile: true,
85
- tablet: true
86
- },
87
- arrow: showControl,
88
85
  dotSize: {
89
86
  desktop: 12
90
87
  },
91
88
  dotGapToCarousel: {
92
89
  desktop: 12
90
+ },
91
+ navigationEnable,
92
+ navigationStyle: {
93
+ desktop: 'outside'
94
+ },
95
+ arrowIconSize: {
96
+ desktop: 24
93
97
  }
94
98
  },
95
99
  styles: {
@@ -960,15 +960,6 @@ const SettingUIV2 = [
960
960
  id: 'variantSelectionRequiredMessage'
961
961
  }
962
962
  },
963
- {
964
- label: {
965
- en: 'Content'
966
- },
967
- conditionDisplay: "errorType !== 'custom'",
968
- setting: {
969
- id: 'errorMessage'
970
- }
971
- },
972
963
  {
973
964
  layout: 'vertical',
974
965
  setting: {
@@ -154,7 +154,7 @@ const productFeatureImageSetting = [
154
154
  {
155
155
  id: 'ftLoop',
156
156
  type: 'toggle',
157
- devices: getDefaultResponsive(false)
157
+ devices: getDefaultResponsive(true)
158
158
  },
159
159
  {
160
160
  id: 'ftPauseOnHover',
@@ -25,8 +25,10 @@ const config = {
25
25
  controls: [
26
26
  {
27
27
  id: 'setupGuide',
28
- label: 'Setup guide',
28
+ label: '',
29
+ title: 'Setup in Shopify',
29
30
  type: 'steps-guide',
31
+ info: 'You can integrate your store with Shopify Apps using this element',
30
32
  steps: [
31
33
  {
32
34
  label: 'Publish this page',
@@ -3,18 +3,12 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const SettingUIV2 = [
6
- {
7
- messageConfig: {
8
- type: 'info',
9
- message: `You can integrate your store with any Shopify apps using this element`
10
- }
11
- },
12
6
  {
13
7
  controls: [
14
8
  {
15
9
  type: 'control',
16
10
  label: {
17
- en: 'Setup guides'
11
+ en: ''
18
12
  },
19
13
  layout: 'vertical',
20
14
  setting: {
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { getClass } from './common/getClass.js';
4
4
  import { getStyle } from './common/getStyle.js';
5
5
  import { getData } from './common/common.js';
@@ -10,16 +10,15 @@ const Arrow = (props)=>{
10
10
  const { isRenderCustomIcon } = getData(props);
11
11
  const { buttonClass, buttonContentClass } = getClass(props);
12
12
  const { buttonStyle, buttonContentStyle, innerBorderCss } = getStyle(props, 'react');
13
- const customIcon = If(isRenderCustomIcon, custom ?? '', /*#__PURE__*/ jsx("svg", {
14
- height: "100%",
15
- width: "100%",
16
- xmlns: "http://www.w3.org/2000/svg",
17
- viewBox: "0 0 24 24",
18
- fill: "currentColor",
19
- children: /*#__PURE__*/ jsx("path", {
20
- d: "M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z"
21
- })
22
- }));
13
+ const customIcon = If(isRenderCustomIcon, custom ?? '', `<svg
14
+ height="100%"
15
+ width="100%"
16
+ xmlns="http://www.w3.org/2000/svg"
17
+ viewBox="0 0 24 24"
18
+ fill="currentColor"
19
+ >
20
+ <path d="M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z" />
21
+ </svg>`);
23
22
  const buttonContent = /*#__PURE__*/ jsx("div", {
24
23
  className: buttonContentClass,
25
24
  style: buttonContentStyle,
@@ -26,7 +26,7 @@ const getClass = (props)=>{
26
26
  [classAction]: true
27
27
  },
28
28
  ...{
29
- hidden: isHiddenWhenDisabled && disabled,
29
+ 'gp-invisible': isHiddenWhenDisabled && disabled,
30
30
  'gp-cursor-default gp-text-gray-300': disabled,
31
31
  'gp-cursor-pointer gp-text-gray-500': !disabled,
32
32
  '!gp-invisible group-hover/carousel:!gp-visible': showWhenHover,
@@ -16,7 +16,7 @@ const getClass = (props)=>{
16
16
  }
17
17
  });
18
18
  const carouselItemInnerClass = createClass({
19
- 'gp-h-full gp-w-full': true
19
+ 'gp-w-full': true
20
20
  });
21
21
  return {
22
22
  carouselItemClass,
@@ -19,7 +19,7 @@ const Carousel = /*#__PURE__*/ forwardRef((props, ref)=>{
19
19
  setting
20
20
  };
21
21
  const { arrowButtonSize, arrowBackgroundColor, arrowGapToEachSide = '16', roundedArrow, arrowIconSize, arrowCustomColor, arrowBorder, arrowShadow, showWhenHover } = setting ?? {};
22
- const { totalSlideItem, isInfinity, slider, currentSlide, localRef, showNavigation, isRenderDots, handleDotClick, getItemsPerPage, sliderRef, handleNextAndPrevSlide, dispatchEventSelectSlide, getNumberOfFullWidthShow } = useCarousel(renderData, ref);
22
+ const { totalSlideItem, isInfinity, slider, currentSlide, localRef, showNavigation, isRenderDots, slideMaxIndex, handleDotClick, getItemsPerPage, sliderRef, handleNextAndPrevSlide, dispatchEventSelectSlide, getNumberOfFullWidthShow } = useCarousel(renderData, ref);
23
23
  const { loopConfig, arrowShowConfig } = getData(renderData);
24
24
  const { rootClassRender, wrapperClassRender, wrapperInnerClass, sliderClass } = getClass(renderData);
25
25
  const { rootStyleRender, wrapperStyleRender, wrapperInnerStyle } = getStyle(renderData);
@@ -28,6 +28,7 @@ const Carousel = /*#__PURE__*/ forwardRef((props, ref)=>{
28
28
  const enabledSneakPeak = setting?.sneakPeak?.[currentDevice];
29
29
  const renderArrow = (position)=>{
30
30
  const isNext = position === 'next';
31
+ const isDisable = isNext ? !isInfinity && slider?.track?.details?.abs === slideMaxIndex : !isInfinity && slider?.track?.details?.abs === 0;
31
32
  return /*#__PURE__*/ jsx(Arrow, {
32
33
  uid: builderProps?.uid,
33
34
  custom: setting?.arrowCustom ?? '',
@@ -46,7 +47,7 @@ const Carousel = /*#__PURE__*/ forwardRef((props, ref)=>{
46
47
  handleNextAndPrevSlide(position);
47
48
  },
48
49
  left: !isNext,
49
- disabled: !isInfinity && slider?.track?.details?.abs === 0,
50
+ disabled: isDisable,
50
51
  vertical: setting?.vertical,
51
52
  isHiddenWhenDisabled: isHiddenArrowWhenDisabled,
52
53
  rootId: props?.parentClass
@@ -59,6 +59,7 @@ const carouselNavigationSettings = {
59
59
  },
60
60
  fixedValue: 'Edit',
61
61
  iconName: 'polaris-measurement-size',
62
+ isHideClear: true,
62
63
  controls: [
63
64
  {
64
65
  setting: {
@@ -1,12 +1,12 @@
1
1
  const getButtonSetting = ({ setting, htmlType, label, styles })=>{
2
- const { iconSvg, iconAlign, couponLayout, translate, shouldClearSpace, iconVisible } = setting ?? {};
2
+ const { iconSvg, iconAlign, translate, shouldClearSpace, iconVisible } = setting ?? {};
3
3
  const labelConvert = styles?.enableTextStyle ? label : '';
4
4
  return {
5
5
  label: labelConvert,
6
6
  htmlType,
7
7
  iconAlign,
8
8
  iconSvg,
9
- iconVisible: couponLayout === 'icon' && iconVisible,
9
+ iconVisible,
10
10
  translate,
11
11
  shouldClearSpace
12
12
  };
@@ -3,7 +3,7 @@ import { makeStyleResponsive, composeBorderCss, composeCornerCss, getStyleShadow
3
3
  const getButtonStyles = (styles)=>{
4
4
  return {
5
5
  ...styles,
6
- enableTextStyle: styles?.enableTextStyle !== undefined ? styles.enableTextStyle : true
6
+ enableTextStyle: true
7
7
  };
8
8
  };
9
9
  const getButtonStyle = (style, styles)=>{
@@ -217,7 +217,20 @@ const CouponSettings = [
217
217
  },
218
218
  {
219
219
  id: 'textColorHover',
220
- type: 'color-picker-v2'
220
+ type: 'color-picker-v2',
221
+ devices: {
222
+ desktop: {
223
+ default: {}
224
+ }
225
+ },
226
+ compoDefaultValue: {
227
+ desktop: {
228
+ default: {
229
+ hover: 'text-3',
230
+ active: 'text-3'
231
+ }
232
+ }
233
+ }
221
234
  },
222
235
  {
223
236
  id: 'align',
@@ -238,7 +238,7 @@ const SettingUIV2 = [
238
238
  }
239
239
  },
240
240
  {
241
- conditionDisplay: 'couponLayout == "icon" && iconVisible == true',
241
+ conditionDisplay: 'iconVisible == true',
242
242
  type: 'control',
243
243
  setting: {
244
244
  id: 'iconSvg'
@@ -248,7 +248,7 @@ const SettingUIV2 = [
248
248
  }
249
249
  },
250
250
  {
251
- conditionDisplay: 'couponLayout == "icon" && iconVisible == true',
251
+ conditionDisplay: 'iconVisible == true',
252
252
  type: 'control',
253
253
  label: {
254
254
  en: 'Position'
@@ -258,7 +258,7 @@ const SettingUIV2 = [
258
258
  }
259
259
  },
260
260
  {
261
- conditionDisplay: 'couponLayout == "icon" && iconVisible == true',
261
+ conditionDisplay: 'iconVisible == true',
262
262
  type: 'control',
263
263
  label: {
264
264
  en: 'Gap'
@@ -394,6 +394,13 @@ const SettingUIV2 = [
394
394
  setting: {
395
395
  id: 'textColorHover',
396
396
  state: 'hover'
397
+ },
398
+ compoDefaultValue: {
399
+ desktop: {
400
+ default: {
401
+ normal: '#121212'
402
+ }
403
+ }
397
404
  }
398
405
  }
399
406
  ]
@@ -10,6 +10,7 @@ const Modal = ({ setting, styles, children, willUnmount, closeOnEscape, onKeypre
10
10
  const { open } = setting ?? {};
11
11
  const container = useModalContainer();
12
12
  const overlay = useRef(null);
13
+ const closeButton = useRef(null);
13
14
  const keyboardClose = useCallback((event)=>{
14
15
  const keyCode = event.code;
15
16
  const isKeyCodeEscape = keyCode === 'Escape';
@@ -34,7 +35,8 @@ const Modal = ({ setting, styles, children, willUnmount, closeOnEscape, onKeypre
34
35
  ]);
35
36
  const handleClickOverlay = useCallback((e)=>{
36
37
  const isClickOutside = e.target === overlay.current;
37
- if (closeOnClickOutside && isClickOutside) {
38
+ const isClickCloseButton = e.target === closeButton.current;
39
+ if (closeOnClickOutside && isClickOutside || isClickCloseButton) {
38
40
  window?.parent?.postMessage?.(JSON.stringify({
39
41
  type: 'active-modal',
40
42
  value: false
@@ -73,7 +75,7 @@ const Modal = ({ setting, styles, children, willUnmount, closeOnEscape, onKeypre
73
75
  /*#__PURE__*/ jsx("span", {
74
76
  className: "gp-inline-block gp-h-screen gp-align-middle"
75
77
  }),
76
- /*#__PURE__*/ jsx("div", {
78
+ /*#__PURE__*/ jsxs("div", {
77
79
  className: cls('gp-relative gp-my-8 gp-inline-block gp-w-full gp-overflow-hidden gp-rounded gp-bg-white gp-p-6 gp-text-left gp-align-middle gp-shadow-xl gp-transition-all gp-duration-100', {
78
80
  'gp-max-w-2xl': !styles?.width,
79
81
  'gp-scale-100 gp-opacity-100': open,
@@ -82,9 +84,28 @@ const Modal = ({ setting, styles, children, willUnmount, closeOnEscape, onKeypre
82
84
  style: {
83
85
  width: styles?.width
84
86
  },
85
- children: /*#__PURE__*/ jsx("div", {
86
- children: isEmptyChildren(children) ? /*#__PURE__*/ jsx(ChildrenDroppable, {}) : children
87
- })
87
+ children: [
88
+ /*#__PURE__*/ jsx("div", {
89
+ className: "gp-absolute gp-right-[16px] gp-top-[16px] gp-z-10 gp-cursor-pointer",
90
+ onClick: handleClickOverlay,
91
+ "aria-hidden": "true",
92
+ children: /*#__PURE__*/ jsx("svg", {
93
+ ref: closeButton,
94
+ width: "16",
95
+ height: "16",
96
+ viewBox: "0 0 16 16",
97
+ fill: "none",
98
+ xmlns: "http://www.w3.org/2000/svg",
99
+ children: /*#__PURE__*/ jsx("path", {
100
+ d: "M11.1758 12.0241C11.4101 12.2584 11.79 12.2584 12.0243 12.0241C12.2586 11.7898 12.2586 11.4099 12.0243 11.1755L8.84858 7.9998L12.0243 4.82407C12.2586 4.58975 12.2586 4.20986 12.0243 3.97554C11.79 3.74123 11.4101 3.74123 11.1758 3.97554L8.00005 7.15128L4.82431 3.97554C4.59 3.74123 4.2101 3.74123 3.97578 3.97554C3.74147 4.20986 3.74147 4.58975 3.97578 4.82407L7.15152 7.9998L3.97579 11.1755C3.74147 11.4099 3.74147 11.7898 3.97579 12.0241C4.2101 12.2584 4.59 12.2584 4.82431 12.0241L8.00005 8.84833L11.1758 12.0241Z",
101
+ fill: "#676767"
102
+ })
103
+ })
104
+ }),
105
+ /*#__PURE__*/ jsx("div", {
106
+ children: isEmptyChildren(children) ? /*#__PURE__*/ jsx(ChildrenDroppable, {}) : children
107
+ })
108
+ ]
88
109
  })
89
110
  ]
90
111
  })
@@ -23,12 +23,11 @@ const getAddToCartButtonStyles = (styles)=>{
23
23
  };
24
24
  const getSoldOutButtonStyles = (styles)=>{
25
25
  const { isCustomOutOfStock, oosBorder, oosShadow, oosRounded, oosBorderV2, oosShadowV2, oosTextColor, oosRoundedV2, oosBackground, oosTextColorV2, oosBackgroundV2, oosEnableShadow, ...buttonStyles } = styles ?? {};
26
- let buttonSoldOutStyles = {
26
+ const buttonSoldOutStyles = {
27
27
  ...buttonStyles
28
28
  };
29
29
  if (isCustomOutOfStock) {
30
- buttonSoldOutStyles = {
31
- ...buttonStyles,
30
+ Object.assign(buttonSoldOutStyles, {
32
31
  backgroundColor: {
33
32
  normal: oosBackground
34
33
  },
@@ -45,75 +44,34 @@ const getSoldOutButtonStyles = (styles)=>{
45
44
  roundedBtn: {
46
45
  normal: oosRounded
47
46
  }
48
- };
47
+ });
49
48
  }
50
- if (oosBackgroundV2) {
51
- buttonSoldOutStyles.backgroundColorV2 = {
52
- desktop: {
53
- normal: oosBackgroundV2?.desktop?.normal,
54
- hover: buttonSoldOutStyles.backgroundColorV2?.desktop?.hover
55
- },
56
- tablet: {
57
- normal: oosBackgroundV2?.tablet?.normal,
58
- hover: buttonSoldOutStyles.backgroundColorV2?.tablet?.hover
59
- },
60
- mobile: {
61
- normal: oosBackgroundV2?.mobile?.normal,
62
- hover: buttonSoldOutStyles.backgroundColorV2?.mobile?.hover
63
- }
64
- };
65
- }
66
- if (oosShadowV2) {
67
- buttonSoldOutStyles.boxShadowBtnV2 = {
68
- desktop: {
69
- normal: oosShadowV2?.desktop?.normal
70
- },
71
- tablet: {
72
- normal: oosShadowV2?.tablet?.normal
73
- },
74
- mobile: {
75
- normal: oosShadowV2?.mobile?.normal
76
- }
77
- };
78
- }
79
- if (oosRoundedV2) {
80
- buttonSoldOutStyles.roundedBtnV2 = {
81
- desktop: {
82
- normal: oosRoundedV2?.desktop?.normal
83
- },
84
- tablet: {
85
- normal: oosRoundedV2?.tablet?.normal
86
- },
87
- mobile: {
88
- normal: oosRoundedV2?.mobile?.normal
89
- }
90
- };
91
- }
92
- if (oosBorderV2) {
93
- buttonSoldOutStyles.borderBtnV2 = {
94
- desktop: {
95
- normal: oosBorderV2?.desktop?.normal
96
- },
97
- tablet: {
98
- normal: oosBorderV2?.tablet?.normal
99
- },
100
- mobile: {
101
- normal: oosBorderV2?.mobile?.normal
102
- }
103
- };
104
- }
105
- if (oosTextColorV2) {
106
- buttonSoldOutStyles.typo = buttonSoldOutStyles.typo ?? {};
107
- buttonSoldOutStyles.typo.attrs = buttonSoldOutStyles.typo.attrs ?? {};
108
- if (oosTextColorV2.desktop?.normal) {
109
- buttonSoldOutStyles.typo = {
110
- ...buttonSoldOutStyles.typo,
111
- attrs: {
112
- ...buttonSoldOutStyles.typo.attrs,
113
- color: oosTextColorV2.desktop.normal
49
+ const mapStylesByDevice = (target, key, value)=>{
50
+ if (value) {
51
+ target[key] = {
52
+ desktop: {
53
+ normal: value.desktop?.normal,
54
+ hover: target[key]?.desktop?.hover
55
+ },
56
+ tablet: {
57
+ normal: value.tablet?.normal,
58
+ hover: target[key]?.tablet?.hover
59
+ },
60
+ mobile: {
61
+ normal: value.mobile?.normal,
62
+ hover: target[key]?.mobile?.hover
114
63
  }
115
64
  };
116
65
  }
66
+ };
67
+ mapStylesByDevice(buttonSoldOutStyles, 'backgroundColorV2', oosBackgroundV2);
68
+ mapStylesByDevice(buttonSoldOutStyles, 'boxShadowBtnV2', oosShadowV2);
69
+ mapStylesByDevice(buttonSoldOutStyles, 'roundedBtnV2', oosRoundedV2);
70
+ mapStylesByDevice(buttonSoldOutStyles, 'borderBtnV2', oosBorderV2);
71
+ if (oosTextColorV2?.desktop?.normal) {
72
+ buttonSoldOutStyles.typo = buttonSoldOutStyles.typo ?? {};
73
+ buttonSoldOutStyles.typo.attrs = buttonSoldOutStyles.typo.attrs ?? {};
74
+ buttonSoldOutStyles.typo.attrs.color = oosTextColorV2.desktop.normal;
117
75
  }
118
76
  return {
119
77
  ...getButtonBaseStyles(),
@@ -188,7 +188,7 @@ const getGalleryCarouselStyle = (setting)=>{
188
188
  const getWidthByLayoutForCarouselByDevice = (device)=>{
189
189
  const layout = getResponsiveValueByScreen(setting?.position, device);
190
190
  const isLayoutBottom = layout === 'bottom-center' || layout === 'inside-bottom';
191
- const isInsideLayout = layout === 'inside-left' || layout === 'inside-right';
191
+ const isInsideLayout = layout === 'inside-left' || layout === 'inside-right' || layout === 'left' || layout === 'right';
192
192
  const shapeSetting = getResponsiveValueByScreen(shapeByLayout, device);
193
193
  return isLayoutBottom || isInsideLayout || !shapeSetting?.width ? '100%' : shapeSetting.width;
194
194
  };
@@ -136,7 +136,10 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
136
136
  layout: setting?.layout,
137
137
  qualityType: setting?.qualityType,
138
138
  qualityPercent: setting?.qualityPercent
139
- }, {})}
139
+ }, {
140
+ width: '100%',
141
+ height: '100%'
142
+ })}
140
143
 
141
144
  <div class="gp-absolute gp-inset-0 gp-flex gp-cursor-pointer gp-items-center gp-justify-center gp-bg-black/50 gp-opacity-0 gp-transition-opacity gp-duration-100 group-hover:gp-opacity-100"
142
145
  style="${getStyleOfObject(getZoomDisplay(setting?.clickOpenLightBox))}" >
@@ -20,7 +20,7 @@ const ProductImagesLightBox = ({ builderPropUID, productImages, open, imageRatio
20
20
  productImages,
21
21
  featuredImageGlobal
22
22
  ]);
23
- const showControl = {
23
+ const navigationEnable = {
24
24
  desktop: productImages && productImages.length > 1,
25
25
  mobile: productImages && productImages?.length > 1,
26
26
  tablet: productImages && productImages?.length > 1
@@ -43,7 +43,10 @@ const ProductImagesLightBox = ({ builderPropUID, productImages, open, imageRatio
43
43
  width: '80%'
44
44
  },
45
45
  closeOnClickOutside: true,
46
- onClose: ()=>onHandleClose(),
46
+ onClose: ()=>{
47
+ onHandleClose();
48
+ console.log('onHandleClose');
49
+ },
47
50
  disableIframeClickEvent: true,
48
51
  contentClass: "mobile:!gp-w-[100%] gp-px-2 gp-pb-10",
49
52
  children: /*#__PURE__*/ jsx(Carousel, {
@@ -75,17 +78,18 @@ const ProductImagesLightBox = ({ builderPropUID, productImages, open, imageRatio
75
78
  mobile: '#121212',
76
79
  tablet: '#121212'
77
80
  },
78
- controlOverContent: {
79
- desktop: true,
80
- mobile: true,
81
- tablet: true
82
- },
83
- arrow: showControl,
84
81
  dotSize: {
85
82
  desktop: 12
86
83
  },
87
84
  dotGapToCarousel: {
88
85
  desktop: 12
86
+ },
87
+ navigationEnable,
88
+ navigationStyle: {
89
+ desktop: 'outside'
90
+ },
91
+ arrowIconSize: {
92
+ desktop: 24
89
93
  }
90
94
  },
91
95
  styles: {
@@ -958,15 +958,6 @@ const SettingUIV2 = [
958
958
  id: 'variantSelectionRequiredMessage'
959
959
  }
960
960
  },
961
- {
962
- label: {
963
- en: 'Content'
964
- },
965
- conditionDisplay: "errorType !== 'custom'",
966
- setting: {
967
- id: 'errorMessage'
968
- }
969
- },
970
961
  {
971
962
  layout: 'vertical',
972
963
  setting: {
@@ -152,7 +152,7 @@ const productFeatureImageSetting = [
152
152
  {
153
153
  id: 'ftLoop',
154
154
  type: 'toggle',
155
- devices: getDefaultResponsive(false)
155
+ devices: getDefaultResponsive(true)
156
156
  },
157
157
  {
158
158
  id: 'ftPauseOnHover',
@@ -21,8 +21,10 @@ const config = {
21
21
  controls: [
22
22
  {
23
23
  id: 'setupGuide',
24
- label: 'Setup guide',
24
+ label: '',
25
+ title: 'Setup in Shopify',
25
26
  type: 'steps-guide',
27
+ info: 'You can integrate your store with Shopify Apps using this element',
26
28
  steps: [
27
29
  {
28
30
  label: 'Publish this page',
@@ -1,16 +1,10 @@
1
1
  const SettingUIV2 = [
2
- {
3
- messageConfig: {
4
- type: 'info',
5
- message: `You can integrate your store with any Shopify apps using this element`
6
- }
7
- },
8
2
  {
9
3
  controls: [
10
4
  {
11
5
  type: 'control',
12
6
  label: {
13
- en: 'Setup guides'
7
+ en: ''
14
8
  },
15
9
  layout: 'vertical',
16
10
  setting: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.639",
3
+ "version": "2.0.0-dev.642",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -25,7 +25,7 @@
25
25
  "scan-all-text": "node ./scripts/scan-all-text.js"
26
26
  },
27
27
  "devDependencies": {
28
- "@gem-sdk/core": "2.0.0-dev.636",
28
+ "@gem-sdk/core": "2.0.0-dev.641",
29
29
  "@gem-sdk/styles": "2.0.0-dev.571",
30
30
  "@gem-sdk/system": "2.0.0-dev.504",
31
31
  "@types/react-transition-group": "^4.4.5",