@gem-sdk/components 2.1.27-staging.5 → 2.1.28

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 (64) hide show
  1. package/dist/cjs/article/components/ArticleImage.js +1 -2
  2. package/dist/cjs/banner/components/hero-banner/index.liquid.js +7 -4
  3. package/dist/cjs/carousel/components/Carousel.liquid.js +2 -3
  4. package/dist/cjs/common/const.js +1 -1
  5. package/dist/cjs/helpers.js +4 -26
  6. package/dist/cjs/image/components/AdaptiveImage.liquid.js +5 -6
  7. package/dist/cjs/image/components/Image.js +2 -22
  8. package/dist/cjs/image/components/Image.liquid.js +4 -6
  9. package/dist/cjs/image/components/NextImage.liquid.js +3 -4
  10. package/dist/cjs/image-comparison/components/CompareImage.liquid.js +3 -7
  11. package/dist/cjs/index.js +0 -2
  12. package/dist/cjs/product/components/Product.liquid.js +2 -3
  13. package/dist/cjs/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js +5 -6
  14. package/dist/cjs/product/components/ProductImagesV2/liquid/ProductGalleryCarousel.liquid.js +2 -2
  15. package/dist/cjs/product/components/ProductImagesV2/liquid/ProductGalleryGrid.liquid.js +4 -4
  16. package/dist/cjs/product/components/ProductImagesV2/liquid/ProductImages.liquid.js +4 -4
  17. package/dist/cjs/product/components/ProductVariants/index.liquid.js +18 -11
  18. package/dist/cjs/product/components/ProductVariants/variants/Base.liquid.js +0 -1
  19. package/dist/cjs/product/components/ProductVariants/variants/Dropdown.liquid.js +12 -26
  20. package/dist/cjs/product/components/ProductVariants/variants/DropdownGroup.liquid.js +37 -4
  21. package/dist/cjs/tab/hooks/useTabInteraction.js +9 -13
  22. package/dist/cjs/text/components/Text.js +2 -2
  23. package/dist/cjs/text/components/Text.liquid.js +2 -2
  24. package/dist/cjs/third-party/components/RechargeSubscriptions.liquid.js +1 -1
  25. package/dist/cjs/third-party/setting/RechargeSubscriptions.js +2 -5
  26. package/dist/cjs/video/components/HTML5Embed.js +2 -2
  27. package/dist/cjs/video/components/HTML5Embed.liquid.js +3 -6
  28. package/dist/cjs/video/components/LiteYouTubeEmbed.liquid.js +3 -5
  29. package/dist/esm/article/components/ArticleImage.js +1 -2
  30. package/dist/esm/banner/components/hero-banner/index.liquid.js +7 -4
  31. package/dist/esm/carousel/components/Carousel.liquid.js +2 -3
  32. package/dist/esm/common/const.js +1 -1
  33. package/dist/esm/helpers.js +5 -25
  34. package/dist/esm/image/components/AdaptiveImage.liquid.js +5 -6
  35. package/dist/esm/image/components/Image.js +3 -23
  36. package/dist/esm/image/components/Image.liquid.js +4 -6
  37. package/dist/esm/image/components/NextImage.liquid.js +3 -4
  38. package/dist/esm/image-comparison/components/CompareImage.liquid.js +3 -7
  39. package/dist/esm/index.js +1 -1
  40. package/dist/esm/product/components/Product.liquid.js +2 -3
  41. package/dist/esm/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js +5 -6
  42. package/dist/esm/product/components/ProductImagesV2/liquid/ProductGalleryCarousel.liquid.js +2 -2
  43. package/dist/esm/product/components/ProductImagesV2/liquid/ProductGalleryGrid.liquid.js +4 -4
  44. package/dist/esm/product/components/ProductImagesV2/liquid/ProductImages.liquid.js +4 -4
  45. package/dist/esm/product/components/ProductVariants/index.liquid.js +19 -12
  46. package/dist/esm/product/components/ProductVariants/variants/Base.liquid.js +0 -1
  47. package/dist/esm/product/components/ProductVariants/variants/Dropdown.liquid.js +12 -26
  48. package/dist/esm/product/components/ProductVariants/variants/DropdownGroup.liquid.js +37 -4
  49. package/dist/esm/tab/hooks/useTabInteraction.js +10 -14
  50. package/dist/esm/text/components/Text.js +2 -2
  51. package/dist/esm/text/components/Text.liquid.js +2 -2
  52. package/dist/esm/third-party/components/RechargeSubscriptions.liquid.js +1 -1
  53. package/dist/esm/third-party/setting/RechargeSubscriptions.js +2 -5
  54. package/dist/esm/video/components/HTML5Embed.js +2 -2
  55. package/dist/esm/video/components/HTML5Embed.liquid.js +3 -6
  56. package/dist/esm/video/components/LiteYouTubeEmbed.liquid.js +3 -5
  57. package/dist/types/index.d.ts +8 -27
  58. package/package.json +3 -3
  59. package/dist/cjs/image/components/NoDataImage.js +0 -133
  60. package/dist/cjs/product/components/ProductVariants/variants/combine/index.js +0 -47
  61. package/dist/cjs/text/components/common.js +0 -14
  62. package/dist/esm/image/components/NoDataImage.js +0 -129
  63. package/dist/esm/product/components/ProductVariants/variants/combine/index.js +0 -44
  64. package/dist/esm/text/components/common.js +0 -12
@@ -7,7 +7,7 @@ import { getSettingPreloadData } from '../../helpers.js';
7
7
  import { styleLazyPlaceholder } from './common/helpers.js';
8
8
 
9
9
  const CompareImage = (props)=>{
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, enableLazyLoadImage, pageContext, translate } = props;
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;
11
11
  const horizontal = !vertical;
12
12
  const leftRatio = (leftImage?.width ?? 0) / (leftImage?.height ?? 1);
13
13
  const rightRatio = (rightImage?.width ?? 0) / (rightImage?.height ?? 1);
@@ -267,9 +267,7 @@ const CompareImage = (props)=>{
267
267
  style: {
268
268
  ...initStyles.rightImage,
269
269
  ...makeStyleResponsive('objf', styles?.imageScale)
270
- },
271
- enableLazyLoadImage,
272
- pageContext
270
+ }
273
271
  })}
274
272
  ${NextImage({
275
273
  customAttrs: {
@@ -285,9 +283,7 @@ const CompareImage = (props)=>{
285
283
  style: {
286
284
  ...initStyles.rightImage,
287
285
  ...makeStyleResponsive('objf', styles?.imageScale)
288
- },
289
- enableLazyLoadImage,
290
- pageContext
286
+ }
291
287
  })}
292
288
  <div id="image-comparison-slider-${componentUid}" style="${{
293
289
  ...initStyles.slider
package/dist/esm/index.js CHANGED
@@ -307,7 +307,7 @@ export { index_liquid as liquidComponents };
307
307
  export { default as builderComponent } from './builder.js';
308
308
  import 'react/jsx-runtime';
309
309
  export { ELEMENT_Z_INDEX } from './common/const.js';
310
- export { getAllHrefFromString, getDynamicSourceLocales, getInsertLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isTransparentColor, isTransparentRGBA, replaceAllHrefFromString, replaceLinkData, youtubeShortsRegex } from './helpers.js';
310
+ export { getDynamicSourceLocales, getInsertLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isTransparentColor, isTransparentRGBA, replaceLinkData, youtubeShortsRegex } from './helpers.js';
311
311
  export { default as postPurchaseTextSetting } from './post-purchase/text/setting/index.js';
312
312
  export { default as PostPurchaseText } from './post-purchase/text/Text.js';
313
313
  export { convertSizeToWidth, transformHighlighTag, transformNumberTag } from './stock-counter/helpers.js';
@@ -5,7 +5,6 @@ import { getStaticLocale, getSettingPreloadData } from '../../helpers.js';
5
5
  const PRODUCT_ID_LATEST = 'latest';
6
6
  const PREFIX_PRODUCT_ID = 'gid://shopify/Product/';
7
7
  const PREFIX_PRODUCT_VARIANT_ID = 'gid://shopify/ProductVariant/';
8
- const PREFIX_PRODUCT_OPTION_VALUE_ID = 'gid://shopify/ProductOptionValue/';
9
8
  const STATIC_PRODUCT_STATUS = 'static';
10
9
  const DYNAMIC_PRODUCT_STATUS = 'dynamic';
11
10
  const Product = ({ children, setting, styles, style, builderProps, rawChildren, advanced })=>{
@@ -21,8 +20,8 @@ const Product = ({ children, setting, styles, style, builderProps, rawChildren,
21
20
  const formatProductId = productSetting?.productId?.replace(PREFIX_PRODUCT_ID, '').toLowerCase() || PRODUCT_ID_LATEST;
22
21
  const formatVariantId = initVariantId?.replace(PREFIX_PRODUCT_VARIANT_ID, '') || '';
23
22
  const productStatus = productSetting?.productStatus ?? STATIC_PRODUCT_STATUS;
24
- const preSelectedOptionIds = productSetting?.selectedOptions?.map((option)=>option?.valueBaseID?.replace(PREFIX_PRODUCT_OPTION_VALUE_ID, ''));
25
23
  return template /* liquid */ `
24
+
26
25
  {%- assign gpBkProduct = product -%}
27
26
  ${productStatus !== DYNAMIC_PRODUCT_STATUS ? `
28
27
  {%- liquid
@@ -97,7 +96,7 @@ const Product = ({ children, setting, styles, style, builderProps, rawChildren,
97
96
  {%- endif -%}
98
97
  <gp-product data-uid="${builderProps?.uid}" data-id="${builderProps?.uid}" style="${{
99
98
  ...advancedStyle
100
- }}" class="${advanced?.cssClass}" gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${preSelectedOptionIds}], "isSyncProduct": "${isSyncProduct}", "variantSelected": {{ variant | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
99
+ }}" class="${advanced?.cssClass}" gp-context='{"productId": {{ product.id }}, "isSyncProduct": "${isSyncProduct}", "variantSelected": {{ variant | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
101
100
  gp-data='{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }}}'>
102
101
  <product-form class="product-form">
103
102
  {%- form 'product', product, id: product_form_id, class: 'form contents', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
@@ -9,7 +9,7 @@ import NextImage from '../../../../image/components/NextImage.liquid.js';
9
9
  import Video from '../../../../image/components/Video.liquid.js';
10
10
  import { getStyleOfObject } from '../../../helpers/function.js';
11
11
 
12
- const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyLoadImage, ...setting })=>{
12
+ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyloadImage, ...setting })=>{
13
13
  const ftAspectRatio = getAspectRatio(setting.ftShape);
14
14
  const getStyleFeaturedImageDisplay = ()=>{
15
15
  return getDisplayStyle((device)=>![
@@ -149,7 +149,7 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyLoad
149
149
  },
150
150
  priority: setting?.preload,
151
151
  className: `gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none ${className}`,
152
- enableLazyLoadImage
152
+ enableLazyloadImage
153
153
  })}`;
154
154
  };
155
155
  const renderNoImage = ()=>{
@@ -167,7 +167,7 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyLoad
167
167
  },
168
168
  priority: setting?.preload,
169
169
  className: `gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none`,
170
- enableLazyLoadImage
170
+ enableLazyloadImage
171
171
  })}`;
172
172
  };
173
173
  const getValueFromValueContainUnit = (value)=>{
@@ -394,11 +394,10 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyLoad
394
394
  },
395
395
  className: `gp-w-full featured-image-only !gp-rounded-none`,
396
396
  customLazyload: true,
397
- enableLazyLoadImage
397
+ enableLazyloadImage
398
398
  })}
399
399
  {%- endif -%}
400
- `,
401
- ftShapeProductImage: setting?.ftShape
400
+ `
402
401
  })}
403
402
  `;
404
403
  };
@@ -6,7 +6,7 @@ import { convertSpacing, getDisplayStyle, getAspectRatio, getSrcImage } from '..
6
6
  import { getShapeByLayout, getSettingMinWidthForCarouselItem, getSettingWidthForCarouselItem, getMinHeightByPosition, getSliderPerShowConfig, getAllowDotConfig, getDotStyleConfig, getCarouselVerticalConfigByPosition, checkDisplayGalleryByWidth, getZoomDisplay } from '../common/productGallery.js';
7
7
  import { getStyleOfObject } from '../../../helpers/function.js';
8
8
 
9
- const ProductGalleryCarousel = ({ builderPropUID, children, enableLazyLoadImage, ...setting })=>{
9
+ const ProductGalleryCarousel = ({ builderPropUID, children, enableLazyloadImage, ...setting })=>{
10
10
  const getCarouselDisplay = ()=>{
11
11
  const isDisplayCarousel = (type, position, device)=>{
12
12
  const layout = getResponsiveValueByScreen(position, device);
@@ -86,7 +86,7 @@ const ProductGalleryCarousel = ({ builderPropUID, children, enableLazyLoadImage,
86
86
  customLazyload: true,
87
87
  style: style,
88
88
  className: '!gp-rounded-none gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 gp-cursor-pointer',
89
- enableLazyLoadImage
89
+ enableLazyloadImage
90
90
  })}`;
91
91
  };
92
92
  const aspectRatioToPaddingBottom = ()=>{
@@ -8,7 +8,7 @@ import Model3d from '../../../../image/components/Modal3d.liquid.js';
8
8
  import Video from '../../../../image/components/Video.liquid.js';
9
9
  import HTML5Embed from '../../../../video/components/HTML5Embed.liquid.js';
10
10
 
11
- const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazyLoadImage, ...setting })=>{
11
+ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazyloadImage, ...setting })=>{
12
12
  const getGridDisplay = ()=>{
13
13
  const isDisplayGrid = (type, position, device)=>{
14
14
  const layout = getResponsiveValueByScreen(position, device);
@@ -97,7 +97,7 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
97
97
  style: style,
98
98
  className: '!gp-rounded-none',
99
99
  customLazyload: false,
100
- enableLazyLoadImage
100
+ enableLazyloadImage
101
101
  })}
102
102
  ${setting?.galleryHoverEffect !== 'none' ? `<div class="${cls('zoom-element !gp-max-w-none', getZoomImageClass())}">
103
103
  ${NextImage({
@@ -111,7 +111,7 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
111
111
  style: style,
112
112
  className: '!gp-rounded-none gp-w-full gp-h-full',
113
113
  customLazyload: false,
114
- enableLazyLoadImage
114
+ enableLazyloadImage
115
115
  })}
116
116
  </div>` : ''}
117
117
  ${setting?.galleryHoverEffect == 'zoom' && setting?.galleryZoomType == 'glasses' ? `
@@ -294,7 +294,7 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
294
294
  },
295
295
  className: '!gp-rounded-none',
296
296
  customLazyload: false,
297
- enableLazyLoadImage
297
+ enableLazyloadImage
298
298
  })}`;
299
299
  };
300
300
  return template`
@@ -7,7 +7,7 @@ import { getSettingPreloadData } from '../../../../helpers.js';
7
7
  import { getShapeByLayout, sizeSettingDefaultForNewLayout } from '../common/productGallery.js';
8
8
 
9
9
  const ProductImages = (productImageProps)=>{
10
- const { setting, styles, builderProps, style, advanced, rawChildren, pageContext, enableLazyLoadImage } = productImageProps;
10
+ const { setting, styles, builderProps, style, advanced, rawChildren, pageContext, enableLazyloadImage } = productImageProps;
11
11
  const settings = {
12
12
  ...setting,
13
13
  ...styles
@@ -112,7 +112,7 @@ const ProductImages = (productImageProps)=>{
112
112
  builderPropUID: `gp-carousel-${builderProps?.uid}`,
113
113
  ...settings,
114
114
  children: renderProductBadge(),
115
- enableLazyLoadImage
115
+ enableLazyloadImage
116
116
  })}
117
117
  ${shouldSkipLiquidRenderForSingleImage(settings?.position, template`
118
118
  <div
@@ -128,7 +128,7 @@ const ProductImages = (productImageProps)=>{
128
128
  ${ProductGalleryCarousel({
129
129
  builderPropUID: `gp-gallery-${builderProps?.uid}`,
130
130
  ...settings,
131
- enableLazyLoadImage
131
+ enableLazyloadImage
132
132
  })}
133
133
  </div>
134
134
  ${ProductGalleryGrid({
@@ -138,7 +138,7 @@ const ProductImages = (productImageProps)=>{
138
138
  },
139
139
  children: renderProductBadge(),
140
140
  ...settings,
141
- enableLazyLoadImage
141
+ enableLazyloadImage
142
142
  })}
143
143
  `)}
144
144
  </div>
@@ -1,4 +1,4 @@
1
- import { makeStyleResponsive, makeWidth, composeMemo, composeTypographyClassName, template, optionLayoutStyle, RenderIf, isLocalEnv, baseAssetURL, cls, getLayoutClasses, getAlignmentClasses, makeStyle, getResponsiveValueByScreen } from '@gem-sdk/core';
1
+ import { makeStyleResponsive, makeWidth, composeMemo, composeTypographyClassName, template, optionLayoutStyle, RenderIf, isLocalEnv, baseAssetURL, cls, makeStyle, getResponsiveValueByScreen } from '@gem-sdk/core';
2
2
  import Text from '../../../text/components/Text.liquid.js';
3
3
  import VariantItem from './variants/index.liquid.js';
4
4
  import DropdownVariant from './variants/Dropdown.liquid.js';
@@ -93,9 +93,15 @@ const ProductVariants = ({ builderProps, style, styles, setting, advanced })=>{
93
93
  <div
94
94
  option-name="{{option.name | escape}}"
95
95
  class="${cls('gp-flex variant-inside', {
96
- ...getLayoutClasses(layout),
96
+ 'gp-flex-col': layout?.desktop === 'vertical',
97
+ 'gp-flex-row': layout?.desktop === 'horizontal',
98
+ 'tablet:gp-flex-row': layout?.tablet === 'horizontal',
99
+ 'tablet:gp-flex-col': layout?.tablet === 'vertical',
100
+ 'mobile:gp-flex-row': layout?.mobile === 'horizontal',
101
+ 'mobile:gp-flex-col': layout?.mobile === 'vertical'
102
+ }, {
97
103
  ...getAlignClasses(layout, align)
98
- })}"
104
+ })} {% if hiddenPresetOptions contains option.name %} gp-hidden {% endif %}"
99
105
 
100
106
  >
101
107
  {% assign showVariantClass = 'variant-display' %}
@@ -127,7 +133,15 @@ const ProductVariants = ({ builderProps, style, styles, setting, advanced })=>{
127
133
  <div
128
134
  variant-option-name="{{option.name | escape}}"
129
135
  class="${cls({
130
- ...getAlignmentClasses(align)
136
+ 'gp-justify-start': align?.desktop === 'left',
137
+ 'gp-justify-center': align?.desktop === 'center',
138
+ 'gp-justify-end': align?.desktop === 'right',
139
+ 'tablet:gp-justify-start': align?.tablet === 'left',
140
+ 'tablet:gp-justify-center': align?.tablet === 'center',
141
+ 'tablet:gp-justify-end': align?.tablet === 'right',
142
+ 'mobile:gp-justify-start': align?.mobile === 'left',
143
+ 'mobile:gp-justify-center': align?.mobile === 'center',
144
+ 'mobile:gp-justify-end': align?.mobile === 'right'
131
145
  }, 'gp-flex gp-w-full gp-flex-wrap gp-items-center variant-option-group')}"
132
146
  style="${{
133
147
  ...makeStyle({
@@ -310,10 +324,6 @@ const ProductVariants = ({ builderProps, style, styles, setting, advanced })=>{
310
324
  `;
311
325
  };
312
326
  return template`
313
- {%- assign total_combinations = 1 -%}
314
- {%- for option in product.options_with_values -%}
315
- {%- assign total_combinations = total_combinations | times: option.values.size -%}
316
- {%- endfor -%}
317
327
  <gp-product-variants
318
328
  data-id="${uid}"
319
329
  class="${advanced?.cssClass}"
@@ -329,10 +339,7 @@ const ProductVariants = ({ builderProps, style, styles, setting, advanced })=>{
329
339
  "moneyFormat": {{shop.money_format | json | escape}},
330
340
  "productId": {{product.id | json | escape}},
331
341
  "productUrl": {{product.url | json | escape}},
332
- "productHandle": {{product.handle | json | escape}},
333
- "displayState": ${JSON.stringify(advancedDisplay)},
334
- "totalVariantCombinations": {{total_combinations}},
335
- "firstAvailableVariant": {{product.selected_or_first_available_variant | json | escape}}
342
+ "displayState":${JSON.stringify(advancedDisplay)}
336
343
  }
337
344
  '>
338
345
  {%- assign options = product.options_with_values -%}
@@ -152,7 +152,6 @@ const BaseVariant = ({ optionTransform, optionTypography, optionBgColor, optionT
152
152
  option-data="{{option.name | escape}}"
153
153
  option-value="{{value | escape}}"
154
154
  option-position="{{option.position}}"
155
- data-gp-option-available="{{value.available}}"
156
155
  option-type="${type || 'rectangle_list'}"
157
156
  data-disabled="{%- if option_disabled == true -%} disabled {%- endif -%}"
158
157
  data-hidden='true'
@@ -14,15 +14,6 @@ const DropdownVariant = ({ variantGroup, blankText, swatchAutoWidth, swatchHeigh
14
14
  };
15
15
  const appendTypoClass = composeTypographyClassName(optionTypo, optionTypography);
16
16
  const appendTypoStyle = composeTypographyStyle(optionTypo, optionTypography);
17
- const composeSelectOptionAttrs = `
18
- option-data="{{option.name | escape}}"
19
- option-value="{{value | escape}}"
20
- data-gp-option-value-id="{{value.id}}"
21
- data-gp-option-available="{{value.available}}"
22
- value="{{value | escape}}"
23
- class="option-value-wrapper"
24
- key="{{value | escape}}"
25
- `;
26
17
  return template /* liquid */ `
27
18
  <select
28
19
  aria-label={{option.name | escape}}
@@ -78,42 +69,37 @@ const DropdownVariant = ({ variantGroup, blankText, swatchAutoWidth, swatchHeigh
78
69
  -%}
79
70
  ${isSoldOutMark ? `{%- if option_disabled == true -%}
80
71
  {%- if value == selectedValue -%}
81
- <option disabled ${!hasPreSelected ? '' : 'selected'}
72
+ <option disabled ${!hasPreSelected ? '' : 'selected'} option-data="{{option.name | escape}}"
82
73
  option-position="{{option.position}}"
83
- ${composeSelectOptionAttrs}>
74
+ option-value="{{value | escape}}" value="{{value | escape}}" class="option-value-wrapper" key="{{value | escape}}">
84
75
  {{value}}
85
76
  </option>
86
77
  {% else %}
87
- <option
88
- disabled
89
- ${composeSelectOptionAttrs}>
78
+ <option disabled option-data="{{option.name | escape}}"
79
+ option-value="{{value | escape}}" value="{{value | escape}}" class="option-value-wrapper" key="{{value | escape}}">
90
80
  {{value}}
91
81
  </option>
92
82
  {%- endif -%}
93
83
  {%- else -%}
94
84
  {%- if value == selectedValue -%}
95
- <option ${!hasPreSelected ? '' : 'selected'}
96
- option-position="{{option.position}}"
97
- ${composeSelectOptionAttrs}>
85
+ <option ${!hasPreSelected ? '' : 'selected'} option-data="{{option.name | escape}}"
86
+ option-value="{{value | escape}}" option-position="{{option.position}}" class="option-value-wrapper" value="{{value | escape}}" key="{{value | escape}}">
98
87
  {{value}}
99
88
  </option>
100
89
  {% else %}
101
- <option
102
- ${composeSelectOptionAttrs}
103
- option-position="{{option.position}}">
90
+ <option option-data="{{option.name | escape}}"
91
+ option-value="{{value | escape}}" option-position="{{option.position}}" class="option-value-wrapper" value="{{value | escape}}" key="{{value | escape}}">
104
92
  {{value}}
105
93
  </option>
106
94
  {%- endif -%}
107
95
  {%- endif -%}` : `{%- if value == selectedValue -%}
108
- <option ${!hasPreSelected ? '' : 'selected'}
109
- ${composeSelectOptionAttrs}
110
- option-position="{{option.position}}">
96
+ <option ${!hasPreSelected ? '' : 'selected'} option-data="{{option.name | escape}}"
97
+ option-value="{{value | escape}}" option-position="{{option.position}}" class="option-value-wrapper" value="{{value | escape}}" key="{{value | escape}}">
111
98
  {{value}}
112
99
  </option>
113
100
  {% else %}
114
- <option
115
- ${composeSelectOptionAttrs}
116
- option-position="{{option.position}}">
101
+ <option option-data="{{option.name | escape}}"
102
+ option-value="{{value | escape}}" option-position="{{option.position}}" class="option-value-wrapper" value="{{value | escape}}" key="{{value | escape}}">
117
103
  {{value}}
118
104
  </option>
119
105
  {%- endif -%}`}
@@ -1,7 +1,7 @@
1
1
  import { makeStyleResponsive, makeWidth, composeTypographyClassName, composeTypographyStyle, template, cls, handleConvertClassColor, getGlobalColorStateClass, getStyleShadowState, makeStyle, getGlobalColorStateStyle, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertBorderColor, composeRadius, getSingleColorVariable } from '@gem-sdk/core';
2
- import { renderBlankOption, renderCombineVariants } from './combine/index.js';
2
+ import { getStaticLocale } from '../../../../helpers.js';
3
3
 
4
- const DropdownVariant = ({ price: hasPrice, blankText, optionTypography, optionBgColor, optionTextColor, optionRounded, optionShadow, optionHasShadow, optionBorder, optionTransform, hasPreSelected, optionTypo, combineWidth, combineHeight, soldOutStyle })=>{
4
+ const DropdownVariant = ({ price, blankText, optionTypography, optionBgColor, optionTextColor, optionRounded, optionShadow, optionHasShadow, optionBorder, optionTransform, hasPreSelected, optionTypo, combineWidth, combineHeight, soldOutStyle })=>{
5
5
  const swatchWidthResponsive = makeStyleResponsive('w', makeWidth(combineWidth));
6
6
  const getCustomCSSActiveState = ()=>{
7
7
  return makeStyle({
@@ -23,6 +23,7 @@ const DropdownVariant = ({ price: hasPrice, blankText, optionTypography, optionB
23
23
  option-data="{{option.name}}"
24
24
  option-type="{{optionType}}"
25
25
  class="${cls('gp-truncate gp-bg-auto gp-pl-4 gp-pr-6 gp-outline-none dropdown-option-item', handleConvertClassColor(optionBorder), appendTypoClass, getGlobalColorStateClass('text', optionTextColor), getGlobalColorStateClass('bg', optionBgColor), 'gp-outline-none', 'gp-shadow-none')}"
26
+
26
27
  style="${{
27
28
  ...getStyleShadowState(optionShadow, 'box-shadow', optionHasShadow),
28
29
  ...getCustomCSSActiveState(),
@@ -44,8 +45,40 @@ const DropdownVariant = ({ price: hasPrice, blankText, optionTypography, optionB
44
45
  'background-position': 'right 16px center'
45
46
  }}"
46
47
  >
47
- ${renderBlankOption(hasPreSelected, blankText)}
48
- ${renderCombineVariants(isSoldOutMark, hasPreSelected, hasPrice)}
48
+ ${!hasPreSelected ? `<option value="blank" selected>${blankText || getStaticLocale('ProductVariants', 'please_select')}</option>` : ''}
49
+ ${`{%- for variantItem in variants -%}
50
+ ${isSoldOutMark ? `{%- if variantItem.available == false -%}
51
+ {%- if variantItem.id == variant.id -%}
52
+ <option origin-price="{{variantItem.price}}" disabled ${!hasPreSelected ? '' : 'selected'} value="{{variantItem.id}}" key="{{variantItem.id}}">
53
+ {{variantItem.title}} ${price ? '- {{variantItem.price | money}}' : ''}
54
+ </option>
55
+ {% else %}
56
+ <option origin-price="{{variantItem.price}}" disabled value="{{variantItem.id}}" key="{{variantItem.id}}">
57
+ {{variantItem.title}} ${price ? '- {{variantItem.price | money}}' : ''}
58
+ </option>
59
+ {%- endif -%}
60
+ {%- else -%}
61
+ {%- if variantItem.id == variant.id -%}
62
+ <option origin-price="{{variantItem.price}}" ${!hasPreSelected ? '' : 'selected'} value="{{variantItem.id}}" key="{{variantItem.id}}">
63
+ {{variantItem.title}} ${price ? '- {{variantItem.price | money}}' : ''}
64
+ </option>
65
+ {% else %}
66
+ <option origin-price="{{variantItem.price}}" value="{{variantItem.id}}" key="{{variantItem.id}}">
67
+ {{variantItem.title}} ${price ? '- {{variantItem.price | money}}' : ''}
68
+ </option>
69
+ {%- endif -%}
70
+ {%- endif -%}` : `{%- if variantItem.id == variant.id -%}
71
+ <option origin-price="{{variantItem.price}}" ${!hasPreSelected ? '' : 'selected'} value="{{variantItem.id}}" key="{{variantItem.id}}">
72
+ {{variantItem.title}} ${price ? '- {{variantItem.price | money}}' : ''}
73
+ </option>
74
+ {% else %}
75
+ <option origin-price="{{variantItem.price}}" value="{{variantItem.id}}" key="{{variantItem.id}}">
76
+ {{variantItem.title}} ${price ? '- {{variantItem.price | money}}' : ''}
77
+ </option>
78
+ {%- endif -%}`}
79
+
80
+ {%- endfor -%}
81
+ `}
49
82
  </select>
50
83
  `;
51
84
  };
@@ -1,19 +1,20 @@
1
1
  import { useInteraction, useEditorMode } from '@gem-sdk/core';
2
- import { useEffect } from 'react';
2
+ import { useState, useEffect } from 'react';
3
3
 
4
4
  const useTabInteraction = ({ activeKey, setActiveKey, activeTab, refContainer, componentUid })=>{
5
- const { trigger, onListener, interactionListenerLoaded, saveToElementInteractionData, findElementIncludingSelf } = useInteraction();
5
+ const [previousTab, setPreviousTab] = useState(activeKey || 1);
6
+ const { trigger, onListener, interactionListenerLoaded } = useInteraction();
6
7
  const mode = useEditorMode();
7
8
  const changeOpenTabInteraction = (params)=>{
8
- const { data, isRollback, element, key } = params || {};
9
- if (data === undefined && isRollback) return;
10
- const newData = Number(data) + 1;
9
+ const { data, isRollback } = params || {};
10
+ if (data === undefined && isRollback === undefined) return;
11
11
  if (isRollback) {
12
- setActiveKey(newData);
12
+ setActiveKey(previousTab);
13
+ setPreviousTab(activeTab);
13
14
  return;
14
15
  }
15
- saveToElementInteractionData(element, key, String(activeKey));
16
- setActiveKey(newData);
16
+ setPreviousTab(activeTab);
17
+ setActiveKey(data + 1);
17
18
  };
18
19
  const dispatchEventTabActive = (index)=>{
19
20
  trigger({
@@ -34,16 +35,11 @@ const useTabInteraction = ({ activeKey, setActiveKey, activeTab, refContainer, c
34
35
  dispatchEventTabActive(activeTab - 1);
35
36
  });
36
37
  const selector = `[data-id="${componentUid}"]`;
37
- const element = findElementIncludingSelf(document, selector);
38
38
  const removeListener = onListener({
39
39
  event: 'gp:change-open-tab',
40
40
  selector
41
41
  }, (params)=>{
42
- changeOpenTabInteraction({
43
- ...params,
44
- element,
45
- key: params?.uniqueStorageKey
46
- });
42
+ changeOpenTabInteraction(params);
47
43
  });
48
44
  return ()=>{
49
45
  removeListener?.();
@@ -1,11 +1,11 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { makeGlobalSize, useEditorMode, composeTypographyClassName, composeTypographyStyle, cls, makeStyle, makeStyleResponsive, getGlobalColorClass, getGlobalColorStateClass, getStyleShadowState, getStyleShadow, makeLineClamp, getGlobalColorStyle, getGlobalColorStateStyle, getStyleBackgroundByDevice, getGradientBgrStyleByDevice, getCornerStyle } from '@gem-sdk/core';
3
3
  import { forwardRef, useMemo } from 'react';
4
- import { getDisplayText } from './common.js';
5
4
 
6
5
  const Text = /*#__PURE__*/ forwardRef(({ styles, builderAttrs, style, setting, advanced, builderProps, className, children, ...props }, ref)=>{
7
6
  const { text, htmlTag: Element = 'div', options, tagWidth, excludeFlex } = setting ?? {};
8
7
  const composeGlobalSize = makeGlobalSize(setting?.globalSize);
8
+ console.log('Text: ', text);
9
9
  const mode = useEditorMode();
10
10
  const getPlaceHolderWhenContentNone = ()=>{
11
11
  let classList = '';
@@ -86,7 +86,7 @@ const Text = /*#__PURE__*/ forwardRef(({ styles, builderAttrs, style, setting, a
86
86
  overflow: 'hidden'
87
87
  },
88
88
  dangerouslySetInnerHTML: {
89
- __html: getDisplayText(text?.toString() ?? '<p><br></p>')
89
+ __html: styles?.typo?.attrs?.transform === 'capitalize' ? text?.toString().toLocaleLowerCase() : text?.toString() || '<p><br></p>'
90
90
  }
91
91
  })
92
92
  }),
@@ -1,6 +1,5 @@
1
1
  import { makeGlobalSize, composeTypographyClassName, composeTypographyStyle, template, makeStyle, makeStyleResponsive, cls, getGlobalColorClass, getGlobalColorStateClass, getStyleShadowState, getStyleShadow, makeLineClamp, getGlobalColorStyle, getGlobalColorStateStyle, getStyleBackgroundByDevice, getGradientBgrStyleByDevice, getCornerStyle } from '@gem-sdk/core';
2
2
  import { replaceLinkData, getDynamicSourceLocales } from '../../helpers.js';
3
- import { getDisplayText } from './common.js';
4
3
 
5
4
  const Text = ({ styles, builderAttrs, style, setting, advanced, builderProps, className, isText, pageContext, elementAttrs, ...props })=>{
6
5
  const { text, htmlTag: Element = 'div', tagWidth, excludeFlex, isForceValue } = setting ?? {};
@@ -28,6 +27,7 @@ const Text = ({ styles, builderAttrs, style, setting, advanced, builderProps, cl
28
27
  uid: builderProps?.uid,
29
28
  settingId: setting?.translate,
30
29
  pageContext,
30
+ isCapitalize: styles?.typo?.attrs?.transform === 'capitalize',
31
31
  translate: setting.translate,
32
32
  isReplaceLocationOrigin: isViewliveHeadingOrTextComponent
33
33
  });
@@ -35,7 +35,7 @@ const Text = ({ styles, builderAttrs, style, setting, advanced, builderProps, cl
35
35
  displayText = renderText;
36
36
  }
37
37
  } else {
38
- displayText = getDisplayText(renderText ?? '');
38
+ displayText = styles?.typo?.attrs?.transform === 'capitalize' ? renderText?.toString().toLocaleLowerCase() : renderText;
39
39
  }
40
40
  return template`
41
41
  {% assign locationOrigin = request.origin | append: routes.root_url | split: '/' | join: '/' %}
@@ -2,7 +2,7 @@ import { getLiquidForAppBlock } from '../helpers/thirdParty.js';
2
2
 
3
3
  const RechargeSubscriptions = ({ setting, advanced })=>{
4
4
  const { align, appBlockId } = setting ?? {};
5
- return getLiquidForAppBlock(appBlockId, align, `${advanced?.cssClass ?? ''} !gp-block`);
5
+ return getLiquidForAppBlock(appBlockId, align, advanced?.cssClass);
6
6
  };
7
7
 
8
8
  export { RechargeSubscriptions as default };
@@ -50,11 +50,8 @@ const config = {
50
50
  options: [
51
51
  {
52
52
  label: 'Subscription Widget',
53
- value: 'subscription-widget'
54
- },
55
- {
56
- label: 'Subscription Widget 2.0',
57
- value: 'subscription-widget-v2'
53
+ value: 'subscription-widget',
54
+ maxOption: 1
58
55
  }
59
56
  ],
60
57
  default: 'subscription-widget'
@@ -47,14 +47,14 @@ const HTML5Embed = (props)=>{
47
47
  }),
48
48
  props.thumbnail && showThumbnail && /*#__PURE__*/ jsxs("div", {
49
49
  role: "presentation",
50
- className: "gp-absolute gp-top-0 gp-left-0 gp-w-full gp-h-full",
50
+ className: "gp-absolute gp-top-0 gp-left-0 gp-w-full",
51
51
  onClick: playVideoAndTurnOffThumbnail,
52
52
  style: props.style,
53
53
  children: [
54
54
  /*#__PURE__*/ jsx("img", {
55
55
  id: "video-thumbnail",
56
56
  src: props.thumbnail,
57
- className: "gp-w-full gp-h-full gp-object-contain gp-thumbnail-video",
57
+ className: "gp-w-full gp-h-full gp-object-cover gp-thumbnail-video",
58
58
  alt: "Video Thumbnail"
59
59
  }),
60
60
  /*#__PURE__*/ jsx("button", {
@@ -3,7 +3,6 @@ import NextImage from '../../image/components/NextImage.liquid.js';
3
3
  import { getSettingPreloadData } from '../../helpers.js';
4
4
 
5
5
  const HTML5Embed = (props)=>{
6
- const { enableLazyLoadImage, pageContext } = props;
7
6
  const videoId = `gp-video-${props.uid}`;
8
7
  const preloadThumbnail = props.autoplay && props.thumbnail;
9
8
  const offLazyVideo = !props.lazy && props.isVideoComponent;
@@ -20,9 +19,7 @@ const HTML5Embed = (props)=>{
20
19
  '--op': 0,
21
20
  '--z': -1,
22
21
  display: 'none'
23
- },
24
- enableLazyLoadImage,
25
- pageContext
22
+ }
26
23
  })}
27
24
  ${RenderIf(props.autoplay, `<script>
28
25
  document.addEventListener("DOMContentLoaded", (event) => {
@@ -71,14 +68,14 @@ const HTML5Embed = (props)=>{
71
68
  </video>
72
69
  <div
73
70
  style="${props.style}"
74
- class="${cls('gp-absolute gp-top-0 gp-left-0 gp-w-full gp-h-full gp-thumbnail-video', {
71
+ class="${cls('gp-absolute gp-top-0 gp-left-0 gp-w-full gp-thumbnail-video', {
75
72
  'gp-hidden': !props.thumbnail || props.autoplay
76
73
  })}"
77
74
  >
78
75
  <img
79
76
  id="video-thumbnail"
80
77
  src="${props.thumbnail ?? ''}"
81
- class="gp-w-full gp-h-full gp-object-contain"
78
+ class="gp-w-full gp-h-full gp-object-cover"
82
79
  alt="Video Thumbnail"
83
80
  ></img>
84
81
  <button
@@ -3,7 +3,7 @@ import NextImage from '../../image/components/NextImage.liquid.js';
3
3
  import { getSettingPreloadData } from '../../helpers.js';
4
4
 
5
5
  const LiteYouTubeEmbed = (props)=>{
6
- const { style, lazy, preload, enableLazyLoadImage, pageContext } = props;
6
+ const { style, lazy, preload } = props;
7
7
  const videoUid = `gp-video-${props.uid}`;
8
8
  const videoId = encodeURIComponent(props.id);
9
9
  const videoTitle = props.title;
@@ -38,7 +38,7 @@ const LiteYouTubeEmbed = (props)=>{
38
38
  data-title="${videoTitle}"
39
39
  style="${{
40
40
  ...makeStyleResponsive('bgi', {
41
- desktop: preload || !enableLazyLoadImage ? `url('${posterUrl}')` : `url('${imagePlaceholder}')`
41
+ desktop: preload ? `url('${posterUrl}')` : `url('${imagePlaceholder}')`
42
42
  }),
43
43
  ...style
44
44
  }}"
@@ -48,9 +48,7 @@ const LiteYouTubeEmbed = (props)=>{
48
48
  src: posterUrl,
49
49
  alt: 'Poster',
50
50
  className: `gp-invisible gp-w-full gp-h-full gp_lazyforbg`,
51
- isDisableAspectStyle: true,
52
- enableLazyLoadImage,
53
- pageContext
51
+ isDisableAspectStyle: true
54
52
  })}
55
53
  <button
56
54
  type="button"