@gem-sdk/components 2.0.0-dev.700 → 2.0.0-dev.702

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 (110) hide show
  1. package/dist/cjs/banner/components/common/common.js +16 -5
  2. package/dist/cjs/banner/components/common/getStyle.js +1 -1
  3. package/dist/cjs/banner/components/hooks/useHeroBanner.js +1 -1
  4. package/dist/cjs/banner/setting/uiV2.js +37 -0
  5. package/dist/cjs/button/components/Button.js +4 -1
  6. package/dist/cjs/carousel/carousel-item/common/getClass.js +1 -1
  7. package/dist/cjs/grid/row/commons/getClass.js +1 -1
  8. package/dist/cjs/grid/row/commons/getStyle.js +2 -1
  9. package/dist/cjs/grid/row/setting/configs/settings.js +21 -0
  10. package/dist/cjs/grid/row/setting/configs/uiV2.js +10 -4
  11. package/dist/cjs/helpers.js +31 -1
  12. package/dist/cjs/icon-list-v2/components/IconList.liquid.js +1 -0
  13. package/dist/cjs/image/components/Image.js +1 -1
  14. package/dist/cjs/image/components/Image.liquid.js +1 -1
  15. package/dist/cjs/image/components/common/classes.js +3 -1
  16. package/dist/cjs/image/helpers/getSrcSet.js +2 -1
  17. package/dist/cjs/image/setting/configs/settings.js +9 -0
  18. package/dist/cjs/index.js +2 -0
  19. package/dist/cjs/post-purchase/product/components/product-offer/common/classes.js +5 -1
  20. package/dist/cjs/product/components/ProductBundle/common/styles.js +2 -2
  21. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +1 -1
  22. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +1 -1
  23. package/dist/cjs/product/components/ProductBundle/setting/ProductBundleDiscount.js +2 -8
  24. package/dist/cjs/product/components/ProductImagesV2/common/common.js +1 -1
  25. package/dist/cjs/product/components/ProductImagesV2/components/feature-gallery/FeatureImageWithGallery.liquid.js +6 -2
  26. package/dist/cjs/product/components/ProductList/ProductList.liquid.js +4 -8
  27. package/dist/cjs/product/components/ProductVariants/index.liquid.js +8 -3
  28. package/dist/cjs/product/setting/constant/bundle-layout/horizontalThree.js +4 -6
  29. package/dist/cjs/product/setting/constant/bundle-layout/horizontalTwo.js +3 -5
  30. package/dist/cjs/product/setting/constant/bundle-layout/verticalThree.js +2 -1
  31. package/dist/cjs/product/setting/constant/bundle-layout/verticalTwo.js +2 -1
  32. package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/ProductFeatureImage.js +13 -11
  33. package/dist/cjs/stock-counter/components/common/getContent.js +1 -1
  34. package/dist/cjs/text/components/Text.liquid.js +1 -0
  35. package/dist/cjs/text/components/common/getDisplayText.js +11 -20
  36. package/dist/cjs/third-party/components/EcomsendBackInStockAlert.liquid.js +8 -8
  37. package/dist/cjs/third-party/components/ProductOptionsVariantOption.js +2 -2
  38. package/dist/cjs/third-party/components/ProductOptionsVariantOption.liquid.js +2 -2
  39. package/dist/cjs/third-party/components/UnlimitedBundlesDiscounts.liquid.js +1 -1
  40. package/dist/cjs/third-party/configs/EcoboostifyShoppableReelUgc.js +1 -1
  41. package/dist/cjs/third-party/configs/NotifyBackInStockPreOrder.js +1 -1
  42. package/dist/cjs/third-party/setting/EcoboostifyShoppableReelUgc/index.js +2 -2
  43. package/dist/cjs/third-party/setting/EcomsendBackInStockAlert/index.js +5 -0
  44. package/dist/cjs/third-party/setting/EcomsendBackInStockAlert/uiV1.js +14 -0
  45. package/dist/cjs/third-party/setting/EcomsendBackInStockAlert/uiV2.js +31 -0
  46. package/dist/cjs/third-party/setting/FlyBundlesUpsellsFbt/uiV1.js +5 -0
  47. package/dist/cjs/third-party/setting/NotifyBackInStockPreOrder/index.js +2 -2
  48. package/dist/cjs/third-party/setting/ProductOptionsVariantOption/index.js +1 -7
  49. package/dist/cjs/third-party/setting/ProductOptionsVariantOption/uiV1.js +0 -9
  50. package/dist/cjs/third-party/setting/ProductOptionsVariantOption/uiV2.js +0 -30
  51. package/dist/cjs/third-party/setting/RequestQuoteHidePrice/index.js +2 -1
  52. package/dist/cjs/third-party/setting/UnlimitedBundlesDiscounts/index.js +5 -1
  53. package/dist/cjs/third-party/setting/UnlimitedBundlesDiscounts/uiV1.js +9 -0
  54. package/dist/cjs/third-party/setting/UnlimitedBundlesDiscounts/uiV2.js +12 -0
  55. package/dist/esm/banner/components/common/common.js +17 -6
  56. package/dist/esm/banner/components/common/getStyle.js +1 -1
  57. package/dist/esm/banner/components/hooks/useHeroBanner.js +1 -1
  58. package/dist/esm/banner/setting/uiV2.js +37 -0
  59. package/dist/esm/button/components/Button.js +4 -1
  60. package/dist/esm/carousel/carousel-item/common/getClass.js +1 -1
  61. package/dist/esm/grid/row/commons/getClass.js +1 -1
  62. package/dist/esm/grid/row/commons/getStyle.js +2 -1
  63. package/dist/esm/grid/row/setting/configs/settings.js +21 -0
  64. package/dist/esm/grid/row/setting/configs/uiV2.js +10 -4
  65. package/dist/esm/helpers.js +30 -2
  66. package/dist/esm/icon-list-v2/components/IconList.liquid.js +1 -0
  67. package/dist/esm/image/components/Image.js +1 -1
  68. package/dist/esm/image/components/Image.liquid.js +1 -1
  69. package/dist/esm/image/components/common/classes.js +4 -2
  70. package/dist/esm/image/helpers/getSrcSet.js +2 -1
  71. package/dist/esm/image/setting/configs/settings.js +9 -0
  72. package/dist/esm/index.js +1 -1
  73. package/dist/esm/post-purchase/product/components/product-offer/common/classes.js +5 -1
  74. package/dist/esm/product/components/ProductBundle/common/styles.js +2 -2
  75. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +1 -1
  76. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +1 -1
  77. package/dist/esm/product/components/ProductBundle/setting/ProductBundleDiscount.js +2 -8
  78. package/dist/esm/product/components/ProductImagesV2/common/common.js +1 -1
  79. package/dist/esm/product/components/ProductImagesV2/components/feature-gallery/FeatureImageWithGallery.liquid.js +6 -2
  80. package/dist/esm/product/components/ProductList/ProductList.liquid.js +4 -8
  81. package/dist/esm/product/components/ProductVariants/index.liquid.js +8 -3
  82. package/dist/esm/product/setting/constant/bundle-layout/horizontalThree.js +4 -6
  83. package/dist/esm/product/setting/constant/bundle-layout/horizontalTwo.js +3 -5
  84. package/dist/esm/product/setting/constant/bundle-layout/verticalThree.js +2 -1
  85. package/dist/esm/product/setting/constant/bundle-layout/verticalTwo.js +2 -1
  86. package/dist/esm/product/setting/product-image-v2/configs/setting-v2/ProductFeatureImage.js +13 -11
  87. package/dist/esm/stock-counter/components/common/getContent.js +1 -1
  88. package/dist/esm/text/components/Text.liquid.js +1 -0
  89. package/dist/esm/text/components/common/getDisplayText.js +12 -21
  90. package/dist/esm/third-party/components/EcomsendBackInStockAlert.liquid.js +8 -8
  91. package/dist/esm/third-party/components/ProductOptionsVariantOption.js +2 -2
  92. package/dist/esm/third-party/components/ProductOptionsVariantOption.liquid.js +2 -2
  93. package/dist/esm/third-party/components/UnlimitedBundlesDiscounts.liquid.js +1 -1
  94. package/dist/esm/third-party/configs/EcoboostifyShoppableReelUgc.js +1 -1
  95. package/dist/esm/third-party/configs/NotifyBackInStockPreOrder.js +1 -1
  96. package/dist/esm/third-party/setting/EcoboostifyShoppableReelUgc/index.js +2 -2
  97. package/dist/esm/third-party/setting/EcomsendBackInStockAlert/index.js +5 -0
  98. package/dist/esm/third-party/setting/EcomsendBackInStockAlert/uiV1.js +14 -0
  99. package/dist/esm/third-party/setting/EcomsendBackInStockAlert/uiV2.js +31 -0
  100. package/dist/esm/third-party/setting/FlyBundlesUpsellsFbt/uiV1.js +5 -0
  101. package/dist/esm/third-party/setting/NotifyBackInStockPreOrder/index.js +2 -2
  102. package/dist/esm/third-party/setting/ProductOptionsVariantOption/index.js +1 -7
  103. package/dist/esm/third-party/setting/ProductOptionsVariantOption/uiV1.js +0 -9
  104. package/dist/esm/third-party/setting/ProductOptionsVariantOption/uiV2.js +0 -30
  105. package/dist/esm/third-party/setting/RequestQuoteHidePrice/index.js +2 -1
  106. package/dist/esm/third-party/setting/UnlimitedBundlesDiscounts/index.js +5 -1
  107. package/dist/esm/third-party/setting/UnlimitedBundlesDiscounts/uiV1.js +9 -0
  108. package/dist/esm/third-party/setting/UnlimitedBundlesDiscounts/uiV2.js +12 -0
  109. package/dist/types/index.d.ts +5 -1
  110. package/package.json +2 -2
@@ -185,6 +185,27 @@ const RowSettings = [
185
185
  }
186
186
  ]
187
187
  },
188
+ {
189
+ id: 'height',
190
+ type: 'option:value',
191
+ devices: {
192
+ desktop: {
193
+ default: 'auto'
194
+ }
195
+ },
196
+ options: [
197
+ {
198
+ label: 'Full',
199
+ value: '100%',
200
+ tooltip: 'Stretch to fill <br> vertical space'
201
+ },
202
+ {
203
+ label: 'Fit',
204
+ value: 'auto',
205
+ tooltip: 'Adjust size <br> based on content'
206
+ }
207
+ ]
208
+ },
188
209
  {
189
210
  id: 'verticalGutter',
190
211
  type: 'input:slider',
@@ -106,8 +106,15 @@ const SettingUIV2 = [
106
106
  en: 'Width',
107
107
  es: 'Ancho',
108
108
  cn: '宽度'
109
+ }
110
+ },
111
+ {
112
+ setting: {
113
+ id: 'height'
109
114
  },
110
- layout: 'horizontal'
115
+ label: {
116
+ en: 'Height'
117
+ }
111
118
  },
112
119
  {
113
120
  label: {
@@ -258,7 +265,6 @@ const SettingUIV2 = [
258
265
  label: {
259
266
  en: 'Align column'
260
267
  },
261
- conditionDisplay: `pageType != "POST_PURCHASE" && (layout.display !== 'fill' || (!!layout.cols && layout.cols.length > 1))`,
262
268
  controls: [
263
269
  {
264
270
  id: 'verticalAlign',
@@ -268,7 +274,7 @@ const SettingUIV2 = [
268
274
  setting: {
269
275
  id: 'verticalAlign'
270
276
  },
271
- conditionDisplay: '!!layout.cols && layout.cols.length > 1'
277
+ conditionDisplay: `((!!layout.cols && layout.cols.length > 1) || (!!layout.cols && layout.cols.length == 1 && height == '100%')) && pageType != "POST_PURCHASE"`
272
278
  },
273
279
  {
274
280
  id: 'horizontalAlign',
@@ -278,7 +284,7 @@ const SettingUIV2 = [
278
284
  setting: {
279
285
  id: 'horizontalAlign'
280
286
  },
281
- conditionDisplay: `layout.display !== 'fill'`,
287
+ conditionDisplay: `layout.display !== 'fill' && pageType != "POST_PURCHASE"`,
282
288
  options: {
283
289
  disableMessage: `Horizontal Align is available when layout is "Fit to content"`
284
290
  }
@@ -64,6 +64,10 @@ const getStaticLocale = (tag, key)=>{
64
64
  const getSettingPreloadData = (disabledValue, enabledValue)=>{
65
65
  return `{% if section.settings.section_preload == "false" %}${disabledValue} ${enabledValue ? `{% else %}${enabledValue}` : ''}{% endif %}`;
66
66
  };
67
+ const getHttpUrl = (link)=>{
68
+ if (!link) return '';
69
+ return link.match(/^https?:\/\//i) ? link : `http://${link}`;
70
+ };
67
71
  const getInsertLinkData = (defaultWrap, setting, htmlType)=>{
68
72
  const URL_START_WITH = [
69
73
  '#',
@@ -76,7 +80,7 @@ const getInsertLinkData = (defaultWrap, setting, htmlType)=>{
76
80
  const isHyperlink = setting?.link !== undefined && setting.link !== '';
77
81
  let urlHref = setting?.link ?? '';
78
82
  const isHomePageHref = urlHref === '/';
79
- const regexHttp = new RegExp(/^https?:\/\//i);
83
+ const regexHttp = new RegExp(/^(?:https?:\/\/)?[\w.-]+\.[a-z]{2,}/i);
80
84
  const regexPageType = new RegExp(/^\/?(?:collections|pages|products|blogs|checkout|cart)\/?/i);
81
85
  const isShopifyDomain = isHyperlink && !regexHttp.test(urlHref) && regexPageType.test(urlHref);
82
86
  const isDomain = isHyperlink && regexHttp.test(urlHref);
@@ -87,6 +91,7 @@ const getInsertLinkData = (defaultWrap, setting, htmlType)=>{
87
91
  urlHref = "{{ request.origin }}{{ routes.root_url | split: '/' | join: '/' }}" + urlHref;
88
92
  }
89
93
  }
94
+ if (isDomain) urlHref = getHttpUrl(urlHref);
90
95
  const isLink = ()=>{
91
96
  if (URL_START_WITH.find((el)=>urlHref.startsWith(el))) return true;
92
97
  if (URL_INCLUDES.find((el)=>urlHref.includes(el))) return true;
@@ -212,5 +217,28 @@ const convertUnitToNumber = (value, defaultValue)=>{
212
217
  const data = typeof value === 'string' ? value.replaceAll('px', '').replaceAll('%', '').replaceAll('rem', '').replaceAll('em', '') : defaultValue;
213
218
  return !isNaN(Number(data)) ? Number(data) : defaultValue;
214
219
  };
220
+ const getAllHrefFromString = (htmlString)=>{
221
+ if (!htmlString) return [];
222
+ const regex = /href="([^"]*)"/g;
223
+ const hrefs = [];
224
+ let match;
225
+ while((match = regex.exec(htmlString)) !== null){
226
+ match[1] && hrefs.push(match[1]);
227
+ }
228
+ return hrefs;
229
+ };
230
+ const replaceAllHrefFromString = (htmlString, hrefs)=>{
231
+ if (!htmlString) return '';
232
+ const regex = /href="([^"]*)"/g;
233
+ let match;
234
+ let i = 0;
235
+ while((match = regex.exec(htmlString)) !== null){
236
+ if (match[1]) {
237
+ htmlString = htmlString.replace(match[1], hrefs[i] ?? '');
238
+ i++;
239
+ }
240
+ }
241
+ return htmlString;
242
+ };
215
243
 
216
- export { convertUnitToNumber, filterTruthyObject, filterTruthyStyles, getDisplayStyle, getDynamicSourceLocales, getInsertLinkData, getLinkArticle, getLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isLinkedToSalesPage, isTransparentColor, isTransparentRGBA, replaceLinkData, youtubeShortsRegex };
244
+ export { convertUnitToNumber, filterTruthyObject, filterTruthyStyles, getAllHrefFromString, getDisplayStyle, getDynamicSourceLocales, getInsertLinkData, getLinkArticle, getLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isLinkedToSalesPage, isTransparentColor, isTransparentRGBA, replaceAllHrefFromString, replaceLinkData, youtubeShortsRegex };
@@ -54,6 +54,7 @@ const IconListV2 = (props)=>{
54
54
  setting
55
55
  });
56
56
  return template`
57
+ {% assign locationOrigin = request.origin | append: routes.root_url | split: '/' | join: '/' %}
57
58
  <gp-icon-list
58
59
  ${{
59
60
  ...attr
@@ -24,7 +24,7 @@ const Image = ({ style, styles, setting, children, advanced, className, builderA
24
24
  const containerStyles = createStyle(getContainerStyles(style, styles));
25
25
  const wrapperClasses = createClass(getWrapperClasses());
26
26
  const imageClasses = createClass(getImageClasses(className, styles));
27
- const containerClasses = createClass(getContainerClasses(builderProps?.uid, advanced?.cssClass));
27
+ const containerClasses = createClass(getContainerClasses(builderProps?.uid, advanced?.cssClass, styles?.shape));
28
28
  const containerAttrs = createAttr(getContainerAttrs(builderAttrs, builderProps?.uid));
29
29
  const linkWrapperAttrs = getLinkWrapperAttrs({
30
30
  urlData,
@@ -21,7 +21,7 @@ const Image = ({ style, styles, setting, advanced, className, pageContext, build
21
21
  const containerStyles = createStyle(getContainerStyles(style, styles));
22
22
  const wrapperClasses = createClass(getWrapperClasses());
23
23
  const imageClasses = createClass(getImageClasses(className, styles));
24
- const containerClasses = createClass(getContainerClasses(builderProps?.uid, advanced?.cssClass));
24
+ const containerClasses = createClass(getContainerClasses(builderProps?.uid, advanced?.cssClass, styles?.shape));
25
25
  const containerAttrs = createAttr(getContainerAttrs(builderAttrs, builderProps?.uid));
26
26
  const linkWrapperAttrs = getLinkWrapperAttrs({
27
27
  urlData,
@@ -1,9 +1,11 @@
1
- import { handleConvertClassColor } from '@gem-sdk/core';
1
+ import { getFlexGrowClassByShapeGlobalSize, handleConvertClassColor } from '@gem-sdk/core';
2
2
 
3
- const getContainerClasses = (uid, cssClass)=>{
3
+ const getContainerClasses = (uid, cssClass, shape)=>{
4
+ const imageFlexGrowClass = getFlexGrowClassByShapeGlobalSize(shape);
4
5
  return {
5
6
  'gp-group/image gp-relative': true,
6
7
  [`force-publish-${new Date().getTime()}`]: true,
8
+ ...imageFlexGrowClass,
7
9
  ...uid && {
8
10
  [uid]: true
9
11
  },
@@ -28,7 +28,8 @@ const getSrcSetLiquid = (liquid, storage)=>{
28
28
  return `{{ '${liquid}' | asset_img_url: '768x' }} 768w, {{ '${liquid}' | asset_img_url: '1024x' }} 1024w, {{ '${liquid}' | asset_img_url: 'master' }} 1440w`;
29
29
  };
30
30
  const getSrcSetLink = (link)=>{
31
- return `${link} 768w,${link} 1024w,${link} 1440w`;
31
+ return link;
32
+ // return `${link} 768w,${link} 1024w,${link} 1440w`; // Since image src didn't change in size so this line of code is pointless
32
33
  };
33
34
  const getImageSrc = (image, currentDevice, isNotLiquid)=>{
34
35
  if (image?.metafieldDefinitionKey) {
@@ -198,6 +198,15 @@ const ImageSettings = [
198
198
  displayOptions: [
199
199
  'full'
200
200
  ]
201
+ },
202
+ height: {
203
+ displayOptions: [
204
+ 'full'
205
+ ],
206
+ units: [
207
+ 'px',
208
+ '%'
209
+ ]
201
210
  }
202
211
  },
203
212
  hiddenSettings: [
package/dist/esm/index.js CHANGED
@@ -64,7 +64,7 @@ import 'react/jsx-runtime';
64
64
  import 'react';
65
65
  import '@gem-sdk/core';
66
66
  export { ELEMENT_Z_INDEX } from './common/const.js';
67
- export { convertUnitToNumber, filterTruthyObject, filterTruthyStyles, getDisplayStyle, getDynamicSourceLocales, getInsertLinkData, getLinkArticle, getLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isLinkedToSalesPage, isTransparentColor, isTransparentRGBA, replaceLinkData, youtubeShortsRegex } from './helpers.js';
67
+ export { convertUnitToNumber, filterTruthyObject, filterTruthyStyles, getAllHrefFromString, getDisplayStyle, getDynamicSourceLocales, getInsertLinkData, getLinkArticle, getLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isLinkedToSalesPage, isTransparentColor, isTransparentRGBA, replaceAllHrefFromString, replaceLinkData, youtubeShortsRegex } from './helpers.js';
68
68
  export { default as Accordion } from './accordion/components/Accordion.js';
69
69
  export { default as AccordionItem } from './accordion/components/AccordionItem.js';
70
70
  export { default as ArticleList } from './article/components/ArticleList.js';
@@ -13,8 +13,12 @@ const getProductOfferWrapperClasses = ()=>{
13
13
  const getProductOfferItemClasses = (index, setting, totalProduct)=>{
14
14
  const { productOfferLayout } = setting ?? {};
15
15
  let className = '';
16
- DEVICES.map((device)=>{
16
+ DEVICES.forEach((device)=>{
17
17
  const key = device === 'desktop' ? '' : `${device}:`;
18
+ if (device === 'mobile') {
19
+ className += ` mobile:gp-col-span-2`;
20
+ return;
21
+ }
18
22
  if (productOfferLayout?.[device] === '1col' && index % 3 === 0 || (totalProduct || 0) <= 1) {
19
23
  className += ` ${key}gp-col-span-2`;
20
24
  }
@@ -59,11 +59,11 @@ const getSvgActiveStyles = (styles)=>{
59
59
  })
60
60
  };
61
61
  };
62
- const getSvgStyles = (settings, styles)=>{
62
+ const getSvgStyles = (styles)=>{
63
63
  return {
64
64
  ...getGlobalColorStateStyle('c', {
65
65
  ...styles?.iconColor,
66
- normal: settings?.iconItemColor ? settings?.iconItemColor : styles?.iconColor?.normal
66
+ normal: styles?.iconColor?.normal
67
67
  })
68
68
  };
69
69
  };
@@ -11,7 +11,7 @@ const ProductBundleDiscountChildrenItem = (props)=>{
11
11
  const composeLayoutClasses = createClass(getLayoutClasses(setting));
12
12
  const composeIconStyles = createStyle(getIconStyles(setting));
13
13
  const composeSvgActiveStyles = createStyle(getSvgActiveStyles(styles));
14
- const composeSvgStyles = createStyle(getSvgStyles(setting, styles));
14
+ const composeSvgStyles = createStyle(getSvgStyles(styles));
15
15
  const composeIconSectionClasses = createClass(getIconSectionClasses);
16
16
  const composeItemClasses = createClass(getItemClasses);
17
17
  const composeFlexChildren = createClass(getFlexChildren);
@@ -9,7 +9,7 @@ const ProductBundleDiscountChildrenItemLiquid = (props)=>{
9
9
  const composeLayoutClasses = createClass(getLayoutClasses(setting));
10
10
  const composeIconStyles = createStyle(getIconStyles(setting));
11
11
  const composeSvgActiveStyles = createStyle(getSvgActiveStyles(styles));
12
- const composeSvgStyles = createStyle(getSvgStyles(setting, styles));
12
+ const composeSvgStyles = createStyle(getSvgStyles(styles));
13
13
  const composeIconSectionClasses = createClass(getIconSectionClasses);
14
14
  const composeItemClasses = createClass(getItemClasses);
15
15
  const composeFlexChildren = createClass(getFlexChildren);
@@ -430,10 +430,7 @@ const config = {
430
430
  childItem: [],
431
431
  layout: 'vertical-layout'
432
432
  },
433
- childrens: [],
434
- advanced: {
435
- of: 'hidden'
436
- }
433
+ childrens: []
437
434
  }
438
435
  ]
439
436
  },
@@ -463,10 +460,7 @@ const config = {
463
460
  layout: 'horizontal-layout',
464
461
  enableIcon: false
465
462
  },
466
- childrens: [],
467
- advanced: {
468
- of: 'hidden'
469
- }
463
+ childrens: []
470
464
  }
471
465
  ]
472
466
  }
@@ -333,7 +333,7 @@ const getPaddingBottomByShapeSetting = (shapeSetting)=>{
333
333
  };
334
334
  return;
335
335
  }
336
- const value = aspectRatio?.[device] !== 'auto' && !!aspectRatio?.[device] ? aspectRatio?.[device]?.split('').reverse().join('') : '{%if media.height%} {{media.height}} / {{media.width}} {%else%} 100 / 100 {%endif%}';
336
+ const value = aspectRatio?.[device] !== 'auto' && !!aspectRatio?.[device] ? aspectRatio?.[device]?.split('/').reverse().join('') : '{%if media.height%} {{media.height}} / {{media.width}} {%else%} 100 / 100 {%endif%}';
337
337
  result = {
338
338
  ...result,
339
339
  [device]: `calc((${value})*100%)`
@@ -89,8 +89,12 @@ const FeatureImageWithGallery = ({ builderPropUID, children, enableLazyLoadImage
89
89
  const renderFeaturedImageOnly = (className, hasHoverEffect)=>{
90
90
  return template`
91
91
  {% assign src = featureMedia.src %}
92
- ${If(hasHoverEffect && setting.hoverEffect == 'other', `{% assign otherImage = product.media[${setting.otherImage}] %}
93
- {% assign src = otherImage.src %}
92
+ ${If(hasHoverEffect && setting.hoverEffect == 'other', `{% assign media_length = product.media | size %}
93
+ {% assign other_image_index = ${setting.otherImage} | plus: 0 %}
94
+ {% if other_image_index >= media_length %}
95
+ {% assign other_image_index = media_length | minus: 1 %}
96
+ {% endif %}
97
+ {% assign otherImage = product.media[other_image_index] %}
94
98
  ${LiquidIf(`otherImage.media_type != 'image'`, `{% assign src = otherImage.preview_image.src %}`)}
95
99
  `)}
96
100
  ${NextImage({
@@ -32,6 +32,7 @@ const ProductList = (props)=>{
32
32
  endif
33
33
  assign arrayRelatedExclude = relatedExclude | split: ","
34
34
  assign idSelectedList = ''
35
+ assign relatedListProduct = null
35
36
  for collection in collections
36
37
  assign collectionId = collection.id
37
38
  assign isInCollection = false
@@ -46,20 +47,15 @@ const ProductList = (props)=>{
46
47
  break
47
48
  else
48
49
  assign idSelectedList = idSelectedList | append: "," | append: product.id
50
+ assign productSelected = product | sort
51
+ assign relatedListProduct = relatedListProduct | concat: productSelected
49
52
  endif
50
53
  endfor
51
54
  endif
52
55
  endunless
53
56
  endfor
54
57
  endfor
55
- for item in allProductsPaginated
56
- assign handle = item.handle
57
- assign productF = item | sort
58
- if idSelectedList contains item.id
59
- assign products = products | concat: productF
60
- endif
61
- endfor
62
- assign products = products | uniq
58
+ assign products = relatedListProduct | uniq
63
59
  when 'vendor'
64
60
  assign vendorAssignProduct = assignProduct.vendor
65
61
  assign productFilter = allProductsPaginated | where: 'vendor', vendorAssignProduct
@@ -18,11 +18,16 @@ const DEVICES = [
18
18
  'tablet',
19
19
  'mobile'
20
20
  ];
21
+ const DEFAULT_ADVANCED_DISPLAY_SETTING = {
22
+ desktop: true,
23
+ tablet: true,
24
+ mobile: true
25
+ };
21
26
  const ProductVariants = (props)=>{
22
27
  const { builderProps, styles, setting, advanced } = props;
23
28
  const { align, swatchItemWidth, dropdownItemWidth, swatchSpacing, optionTypo } = styles ?? {};
24
29
  const { label, optionType, showAsSwatches, layout, hasPreSelected } = setting ?? {};
25
- const advancedDisplay = advanced?.d;
30
+ const advancedDisplay = advanced?.d ?? DEFAULT_ADVANCED_DISPLAY_SETTING;
26
31
  const { uid } = builderProps ?? {};
27
32
  const variantGroup = optionType === 'groupOption';
28
33
  const getSwatchAutoWidth = ()=>{
@@ -239,7 +244,7 @@ const ProductVariants = (props)=>{
239
244
  productId: `{{ product.id | json | escape }}`,
240
245
  productUrl: `{{ product.url | json | escape }}`,
241
246
  productHandle: `{{ product.handle | json | escape }}`,
242
- displayState: advancedDisplay,
247
+ displayState: `${JSON.stringify(advancedDisplay)}`,
243
248
  totalVariantCombinations: `{{ total_combinations }}`,
244
249
  firstAvailableVariant: `{{ product.selected_or_first_available_variant | json | escape }}`
245
250
  });
@@ -279,7 +284,7 @@ const ProductVariants = (props)=>{
279
284
  '>
280
285
  ${Liquid(`{%- assign options = product.options_with_values -%}`)}
281
286
  ${Liquid(`{%- assign variants = product.variants -%}`)}
282
- ${LiquidIf(`options.size == 0 or options.size == 1 and options[0].name == 'Title' and options[0].values.size == 1 and options[0].values[0] == 'Default Title'`, `<div></div>`, template`<div
287
+ ${LiquidIf(`options.size == 0 or options.size == 1 and variants.size == 1 and variants[0].title == 'Default Title' and variants[0].option1 == 'Default Title'`, `<div></div>`, template`<div
283
288
  class="${pVariantClass}"
284
289
  style="${pVariantStyle}"
285
290
  >
@@ -12,7 +12,7 @@ const horizontalThree = [
12
12
  tablet: true
13
13
  },
14
14
  editorData: {
15
- css: '.{{rootClassName}} > div > div,.g5t77h4sjA gp-product-badge > div > div{\nwidth:100% !important;\n}',
15
+ css: '.{{rootClassName}} > div > div{\nwidth:100%;\n}',
16
16
  rootClassName: '{{rootClassName}}'
17
17
  },
18
18
  hasBoxShadow: {
@@ -27,7 +27,7 @@ const horizontalThree = [
27
27
  desktop: '100%'
28
28
  },
29
29
  pos: {
30
- desktop: 'absolute'
30
+ desktop: 'static'
31
31
  },
32
32
  right: {
33
33
  desktop: '0px'
@@ -50,9 +50,6 @@ const horizontalThree = [
50
50
  }
51
51
  }
52
52
  },
53
- top: {
54
- desktop: '-44px'
55
- },
56
53
  z: {
57
54
  desktop: 1
58
55
  }
@@ -152,7 +149,8 @@ const horizontalThree = [
152
149
  }
153
150
  },
154
151
  tag: 'ProductBadge',
155
- uid: 'gaWpBvn_TG'
152
+ uid: 'gHRinlrdow',
153
+ childrens: []
156
154
  },
157
155
  {
158
156
  advanced: {
@@ -26,7 +26,7 @@ const horizontalTwo = [
26
26
  desktop: '100%'
27
27
  },
28
28
  pos: {
29
- desktop: 'absolute'
29
+ desktop: 'static'
30
30
  },
31
31
  right: {
32
32
  desktop: '0px'
@@ -49,9 +49,6 @@ const horizontalTwo = [
49
49
  }
50
50
  }
51
51
  },
52
- top: {
53
- desktop: '-44px'
54
- },
55
52
  z: {
56
53
  desktop: 1
57
54
  }
@@ -151,7 +148,8 @@ const horizontalTwo = [
151
148
  }
152
149
  },
153
150
  tag: 'ProductBadge',
154
- uid: 'gPMEqW9TKV'
151
+ uid: 'gHRinlrdow',
152
+ childrens: []
155
153
  },
156
154
  {
157
155
  advanced: {
@@ -289,7 +289,8 @@ const verticalThree = [
289
289
  }
290
290
  },
291
291
  tag: 'ProductBadge',
292
- uid: 'gPMEqW9TKV'
292
+ uid: 'gHRinlrdow',
293
+ childrens: []
293
294
  },
294
295
  {
295
296
  childrens: [
@@ -289,7 +289,8 @@ const verticalTwo = [
289
289
  }
290
290
  },
291
291
  tag: 'ProductBadge',
292
- uid: 'gPMEqW9TKV'
292
+ uid: 'gHRinlrdow',
293
+ childrens: []
293
294
  },
294
295
  {
295
296
  childrens: [
@@ -66,27 +66,29 @@ const productFeatureImageSetting = [
66
66
  {
67
67
  id: 'otherImage',
68
68
  label: 'Other image',
69
- type: 'select',
70
- options: [
71
- {
72
- title: 'Image 1',
73
- value: 0
74
- },
69
+ type: 'dropdown:input',
70
+ isNumber: true,
71
+ isIndexValue: true,
72
+ displayOptions: [
75
73
  {
76
- title: 'Image 2',
74
+ label: 'Image 1',
77
75
  value: 1
78
76
  },
79
77
  {
80
- title: 'Image 3',
78
+ label: 'Image 2',
81
79
  value: 2
82
80
  },
83
81
  {
84
- title: 'Image 4',
82
+ label: 'Image 3',
85
83
  value: 3
86
84
  },
87
85
  {
88
- title: 'Last image',
89
- value: -1
86
+ label: 'Image 4',
87
+ value: 4
88
+ },
89
+ {
90
+ label: 'Last image',
91
+ value: 'Last image'
90
92
  }
91
93
  ],
92
94
  default: 0
@@ -6,7 +6,7 @@ const getLiquidTextContent = (setting, styles)=>{
6
6
  const { template: templateString, outOfStockMessage, continueSelling, unlimitedQuantityMessage } = setting ?? {};
7
7
  const { textColor } = styles ?? {};
8
8
  const mainColor = textColor || 'brand';
9
- return `{% if inventory_management == null or inventory_management != "shopify" and inventory_quantity <= 0 %}
9
+ return `{% if inventory_management == null and inventory_quantity <= 0 %}
10
10
  ${transformHighlighTag(unlimitedQuantityMessage ?? getStaticLocale('StockCounter', 'let_buy_now'), mainColor)}
11
11
  {% elsif available == false %}
12
12
  ${transformHighlighTag(outOfStockMessage || '', mainColor)}
@@ -58,6 +58,7 @@ const Text = ({ id, styles, builderAttrs, style, setting, advanced, builderProps
58
58
  });
59
59
  const outputText = createContent(displayText);
60
60
  return template`
61
+ {% assign locationOrigin = request.origin | append: routes.root_url | split: '/' | join: '/' %}
61
62
  <div ${{
62
63
  ...attrs
63
64
  }}
@@ -1,26 +1,13 @@
1
- import { getInsertLinkData, getDynamicSourceLocales } from '../../../helpers.js';
1
+ import { replaceLinkData, getDynamicSourceLocales } from '../../../helpers.js';
2
2
 
3
3
  const getDisplayText = ({ type, styles, setting, builderProps, pageContext })=>{
4
4
  const { text, isForceValue } = setting ?? {};
5
5
  let displayText = '';
6
- let renderText = '';
7
- const regexCheckHasTagLink = /<a\s[^>]*>.*?<\/a>/;
8
- if (text && regexCheckHasTagLink.test(text)) {
9
- const regex = // eslint-disable-next-line regexp/no-super-linear-backtracking, regexp/no-unused-capturing-group
10
- /<a\s+(?:[^>]*?\s+)?href=["']([^"']*)["'](?:\s+[^>]*?)?(?:target=["']([^"']*)["'])?.*?>.*?<\/a>/gi;
11
- let newText = text.toString();
12
- let match;
13
- while((match = regex.exec(newText)) !== null){
14
- const href = match[1];
15
- const { urlData } = getInsertLinkData('', {
16
- link: href
17
- });
18
- newText = newText.replace(match[0], match[0].replace(/(href=['"])([^'"]*)(['"])/i, `$1${urlData.href}$3`));
19
- }
20
- renderText = newText;
21
- } else {
22
- renderText = text;
23
- }
6
+ const isViewliveHeadingOrTextComponent = [
7
+ 'Heading',
8
+ 'Text'
9
+ ].includes(builderProps?.builderData?.tag ?? '') && !pageContext?.isPreviewing;
10
+ const renderText = replaceLinkData(text?.toString());
24
11
  const isCapitalize = styles?.typo?.attrs?.transform === 'capitalize';
25
12
  if (type === 'React') {
26
13
  displayText = isCapitalize ? text?.toString().toLocaleLowerCase() : text?.toString();
@@ -29,13 +16,17 @@ const getDisplayText = ({ type, styles, setting, builderProps, pageContext })=>{
29
16
  displayText = renderText;
30
17
  } else if (setting?.translate) {
31
18
  displayText = getDynamicSourceLocales({
32
- val: renderText,
19
+ val: text,
33
20
  uid: builderProps?.uid,
34
21
  settingId: setting?.translate,
35
22
  pageContext,
36
23
  isCapitalize,
37
- translate: setting.translate
24
+ translate: setting.translate,
25
+ isReplaceLocationOrigin: isViewliveHeadingOrTextComponent
38
26
  });
27
+ if (displayText == text) {
28
+ displayText = renderText;
29
+ }
39
30
  } else {
40
31
  displayText = isCapitalize ? renderText?.toString().toLocaleLowerCase() : renderText;
41
32
  }
@@ -1,17 +1,17 @@
1
1
  import { template, makeStyleResponsive } from '@gem-sdk/core';
2
2
 
3
3
  const EcomsendBackInStockAlert = ({ setting, advanced })=>{
4
- const { align } = setting ?? {};
4
+ const { align, productId } = setting ?? {};
5
5
  return template`
6
- <div
7
- class="${advanced?.cssClass}"
8
- style="${{
6
+ <div
7
+ class="${advanced?.cssClass}"
8
+ style="${{
9
9
  ...makeStyleResponsive('ta', align)
10
10
  }}"
11
- >
12
- <div id="sealapps-bis-widget"></div>
13
- </div>
14
- `;
11
+ >
12
+ ${productId ? `<div style="display: block" class="ecomsend-bis-block" data-product-id="${productId}"></div>` : `<div id="sealapps-bis-widget"></div>`}
13
+ </div>
14
+ `;
15
15
  };
16
16
 
17
17
  export { EcomsendBackInStockAlert as default };
@@ -4,7 +4,7 @@ import ThirdPartyPreview from './ThirdPartyPreview.js';
4
4
 
5
5
  const AppConfig = {
6
6
  id: 'product-options-variant-option',
7
- label: 'Product Options Variant Option',
7
+ label: 'Avis Product Options, Variants',
8
8
  logoUrl: 'https://cdn.shopify.com/app-store/listing_images/5ee1f244b087cfbec9b19c8b3f62c8f6/icon/CMCq1s7J5vQCEAE=.png',
9
9
  tag: 'ProductOptionsVariantOption'
10
10
  };
@@ -14,7 +14,7 @@ const ProductOptionsVariantOptionContent = ()=>{
14
14
  className: "gp-p-2",
15
15
  children: /*#__PURE__*/ jsx(ThirdPartyPreview, {
16
16
  setting: {
17
- label: 'Product Options Variant Option',
17
+ label: 'Avis Product Options, Variants',
18
18
  iconSvg: `<img class="gp-w-6 gp-border gp-border-[#494949] gp-rounded-[3px]" src="${AppConfig.logoUrl}">`
19
19
  }
20
20
  })