@gem-sdk/components 2.1.27-staging.1 → 2.1.27
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.
- package/dist/cjs/article/components/ArticleImage.js +1 -2
- package/dist/cjs/banner/components/hero-banner/index.liquid.js +7 -4
- package/dist/cjs/carousel/components/Carousel.liquid.js +2 -3
- package/dist/cjs/common/const.js +1 -1
- package/dist/cjs/helpers.js +1 -1
- package/dist/cjs/image/components/AdaptiveImage.liquid.js +5 -6
- package/dist/cjs/image/components/Image.js +2 -22
- package/dist/cjs/image/components/Image.liquid.js +4 -6
- package/dist/cjs/image/components/NextImage.liquid.js +3 -4
- package/dist/cjs/image-comparison/components/CompareImage.liquid.js +3 -7
- package/dist/cjs/post-purchase/product/components/ProductOffer.js +1 -5
- package/dist/cjs/product/components/Product.liquid.js +2 -3
- package/dist/cjs/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js +5 -6
- package/dist/cjs/product/components/ProductImagesV2/liquid/ProductGalleryCarousel.liquid.js +2 -2
- package/dist/cjs/product/components/ProductImagesV2/liquid/ProductGalleryGrid.liquid.js +4 -4
- package/dist/cjs/product/components/ProductImagesV2/liquid/ProductImages.liquid.js +4 -4
- package/dist/cjs/product/components/ProductVariants/index.liquid.js +18 -11
- package/dist/cjs/product/components/ProductVariants/variants/Base.liquid.js +0 -1
- package/dist/cjs/product/components/ProductVariants/variants/Dropdown.liquid.js +12 -26
- package/dist/cjs/product/components/ProductVariants/variants/DropdownGroup.liquid.js +37 -4
- package/dist/cjs/tab/hooks/useTabInteraction.js +9 -13
- package/dist/cjs/text/components/Text.js +1 -0
- package/dist/cjs/video/components/HTML5Embed.js +2 -2
- package/dist/cjs/video/components/HTML5Embed.liquid.js +3 -6
- package/dist/cjs/video/components/LiteYouTubeEmbed.liquid.js +3 -5
- package/dist/esm/article/components/ArticleImage.js +1 -2
- package/dist/esm/banner/components/hero-banner/index.liquid.js +7 -4
- package/dist/esm/carousel/components/Carousel.liquid.js +2 -3
- package/dist/esm/common/const.js +1 -1
- package/dist/esm/helpers.js +1 -1
- package/dist/esm/image/components/AdaptiveImage.liquid.js +5 -6
- package/dist/esm/image/components/Image.js +3 -23
- package/dist/esm/image/components/Image.liquid.js +4 -6
- package/dist/esm/image/components/NextImage.liquid.js +3 -4
- package/dist/esm/image-comparison/components/CompareImage.liquid.js +3 -7
- package/dist/esm/post-purchase/product/components/ProductOffer.js +1 -5
- package/dist/esm/product/components/Product.liquid.js +2 -3
- package/dist/esm/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js +5 -6
- package/dist/esm/product/components/ProductImagesV2/liquid/ProductGalleryCarousel.liquid.js +2 -2
- package/dist/esm/product/components/ProductImagesV2/liquid/ProductGalleryGrid.liquid.js +4 -4
- package/dist/esm/product/components/ProductImagesV2/liquid/ProductImages.liquid.js +4 -4
- package/dist/esm/product/components/ProductVariants/index.liquid.js +19 -12
- package/dist/esm/product/components/ProductVariants/variants/Base.liquid.js +0 -1
- package/dist/esm/product/components/ProductVariants/variants/Dropdown.liquid.js +12 -26
- package/dist/esm/product/components/ProductVariants/variants/DropdownGroup.liquid.js +37 -4
- package/dist/esm/tab/hooks/useTabInteraction.js +10 -14
- package/dist/esm/text/components/Text.js +1 -0
- package/dist/esm/video/components/HTML5Embed.js +2 -2
- package/dist/esm/video/components/HTML5Embed.liquid.js +3 -6
- package/dist/esm/video/components/LiteYouTubeEmbed.liquid.js +3 -5
- package/dist/types/index.d.ts +6 -23
- package/package.json +3 -3
- package/dist/cjs/image/components/NoDataImage.js +0 -133
- package/dist/cjs/product/components/ProductVariants/variants/combine/index.js +0 -47
- package/dist/esm/image/components/NoDataImage.js +0 -129
- package/dist/esm/product/components/ProductVariants/variants/combine/index.js +0 -44
|
@@ -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,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
"
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 {
|
|
2
|
+
import { getStaticLocale } from '../../../../helpers.js';
|
|
3
3
|
|
|
4
|
-
const DropdownVariant = ({ price
|
|
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
|
-
${
|
|
48
|
-
${
|
|
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
|
|
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
|
|
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(
|
|
12
|
+
setActiveKey(previousTab);
|
|
13
|
+
setPreviousTab(activeTab);
|
|
13
14
|
return;
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
setActiveKey(
|
|
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?.();
|
|
@@ -5,6 +5,7 @@ import { forwardRef, useMemo } from 'react';
|
|
|
5
5
|
const Text = /*#__PURE__*/ forwardRef(({ styles, builderAttrs, style, setting, advanced, builderProps, className, children, ...props }, ref)=>{
|
|
6
6
|
const { text, htmlTag: Element = 'div', options, tagWidth, excludeFlex } = setting ?? {};
|
|
7
7
|
const composeGlobalSize = makeGlobalSize(setting?.globalSize);
|
|
8
|
+
console.log('Text: ', text);
|
|
8
9
|
const mode = useEditorMode();
|
|
9
10
|
const getPlaceHolderWhenContentNone = ()=>{
|
|
10
11
|
let classList = '';
|
|
@@ -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
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
|
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
|
|
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"
|
package/dist/types/index.d.ts
CHANGED
|
@@ -447,7 +447,6 @@ type ImageSetting$1 = Pick<NextImageProps, 'priority' | 'quality' | 'vw'> & Pick
|
|
|
447
447
|
};
|
|
448
448
|
hoverEffect?: string;
|
|
449
449
|
isNotLazyload?: boolean;
|
|
450
|
-
disableNoDataState?: boolean;
|
|
451
450
|
} & Pick<AdaptiveImageProps, 'srcSet'>;
|
|
452
451
|
type ImageStyleSetting$1 = {
|
|
453
452
|
shape?: ObjectDevices<SizeSettingGlobal>;
|
|
@@ -1361,12 +1360,6 @@ type ProductSetting = {
|
|
|
1361
1360
|
initialVariantId?: string;
|
|
1362
1361
|
initialVariantBaseId?: string;
|
|
1363
1362
|
productHandle?: string;
|
|
1364
|
-
selectedOptions?: {
|
|
1365
|
-
name: string;
|
|
1366
|
-
value: string;
|
|
1367
|
-
optionType: string;
|
|
1368
|
-
valueBaseID: string;
|
|
1369
|
-
}[];
|
|
1370
1363
|
};
|
|
1371
1364
|
discountType?: 'PERCENTAGE' | 'FIXED_AMOUNT';
|
|
1372
1365
|
discountValue?: number;
|
|
@@ -3962,7 +3955,6 @@ type ImageComparisonStyle = {
|
|
|
3962
3955
|
} & Pick<SharedProps, 'aspectRatio'>;
|
|
3963
3956
|
type ImageComparisonProps = BaseProps & {
|
|
3964
3957
|
className?: string;
|
|
3965
|
-
enableLazyLoadImage?: boolean;
|
|
3966
3958
|
pageContext?: PageContext;
|
|
3967
3959
|
} & BasePropsWrap<ImageComparisonSetting, ImageComparisonStyle>;
|
|
3968
3960
|
declare const ImageComparison$1: React.FC<ImageComparisonProps>;
|
|
@@ -5599,12 +5591,6 @@ declare const Product: ({ children, setting, styles, style, builderProps, rawChi
|
|
|
5599
5591
|
initialVariantId?: string | undefined;
|
|
5600
5592
|
initialVariantBaseId?: string | undefined;
|
|
5601
5593
|
productHandle?: string | undefined;
|
|
5602
|
-
selectedOptions?: {
|
|
5603
|
-
name: string;
|
|
5604
|
-
value: string;
|
|
5605
|
-
optionType: string;
|
|
5606
|
-
valueBaseID: string;
|
|
5607
|
-
}[] | undefined;
|
|
5608
5594
|
} | undefined;
|
|
5609
5595
|
discountType?: "FIXED_AMOUNT" | "PERCENTAGE" | undefined;
|
|
5610
5596
|
discountValue?: number | undefined;
|
|
@@ -5744,7 +5730,7 @@ type PropTypes = ProductImagesProps$1 & React.ComponentPropsWithoutRef<'div'> &
|
|
|
5744
5730
|
children?: any;
|
|
5745
5731
|
} & {
|
|
5746
5732
|
pageContext?: PageContext;
|
|
5747
|
-
|
|
5733
|
+
enableLazyloadImage?: boolean;
|
|
5748
5734
|
};
|
|
5749
5735
|
declare const ProductImages: (productImageProps: PropTypes) => string;
|
|
5750
5736
|
|
|
@@ -6080,7 +6066,7 @@ declare const CarouselItem: ({ children, builderAttrs, styles, advanced, setting
|
|
|
6080
6066
|
background?: Partial<Record<NameDevices, Background>> | undefined;
|
|
6081
6067
|
}) => string;
|
|
6082
6068
|
|
|
6083
|
-
declare const Carousel: ({ builderAttrs, builderProps, style, styles, moveToIdx, rootId, rootAttr, rootClass, wrapperClass, rootStyles, children, rawChildren, isHiddenArrowWhenDisabled, advanced, disableMarginAuto, conditionAppendJs,
|
|
6069
|
+
declare const Carousel: ({ builderAttrs, builderProps, style, styles, moveToIdx, rootId, rootAttr, rootClass, wrapperClass, rootStyles, children, rawChildren, isHiddenArrowWhenDisabled, advanced, disableMarginAuto, conditionAppendJs, ...props }: _gem_sdk_core.BaseProps<CarouselSettings, CarouselStyles, Record<string, any>> & {
|
|
6084
6070
|
builderAttrs?: Record<string, any> | undefined;
|
|
6085
6071
|
style?: React.CSSProperties | undefined;
|
|
6086
6072
|
} & {
|
|
@@ -6112,7 +6098,6 @@ declare const Carousel: ({ builderAttrs, builderProps, style, styles, moveToIdx,
|
|
|
6112
6098
|
disableMarginAuto?: boolean | undefined;
|
|
6113
6099
|
slidesClass?: string | undefined;
|
|
6114
6100
|
conditionAppendJs?: string | undefined;
|
|
6115
|
-
ftShapeProductImage?: Partial<Record<NameDevices, SizeSettingGlobal>> | undefined;
|
|
6116
6101
|
}) => string;
|
|
6117
6102
|
|
|
6118
6103
|
type LineProps = {
|
|
@@ -6240,7 +6225,7 @@ type CountdownLiquidProps = BaseProps<{
|
|
|
6240
6225
|
};
|
|
6241
6226
|
declare const Countdown: ({ builderProps, setting, styles, advanced, pageContext, }: CountdownLiquidProps) => string;
|
|
6242
6227
|
|
|
6243
|
-
declare const Image: ({ styles, className, setting, builderAttrs, builderProps, style, advanced,
|
|
6228
|
+
declare const Image: ({ styles, className, setting, builderAttrs, builderProps, style, advanced, enableLazyloadImage, }: {
|
|
6244
6229
|
className?: string | undefined;
|
|
6245
6230
|
children?: React.ReactNode;
|
|
6246
6231
|
onClick?: React.MouseEventHandler<any> | undefined;
|
|
@@ -6277,7 +6262,6 @@ declare const Image: ({ styles, className, setting, builderAttrs, builderProps,
|
|
|
6277
6262
|
} | undefined;
|
|
6278
6263
|
hoverEffect?: string | undefined;
|
|
6279
6264
|
isNotLazyload?: boolean | undefined;
|
|
6280
|
-
disableNoDataState?: boolean | undefined;
|
|
6281
6265
|
} & Pick<AdaptiveImageProps, "srcSet">, {
|
|
6282
6266
|
shape?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.SizeSettingGlobal>> | undefined;
|
|
6283
6267
|
customAspectRadio?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.Ratio>> | undefined;
|
|
@@ -6300,8 +6284,7 @@ declare const Image: ({ styles, className, setting, builderAttrs, builderProps,
|
|
|
6300
6284
|
} & {
|
|
6301
6285
|
advanced?: any;
|
|
6302
6286
|
} & {
|
|
6303
|
-
|
|
6304
|
-
pageContext?: PageContext | undefined;
|
|
6287
|
+
enableLazyloadImage?: boolean | undefined;
|
|
6305
6288
|
}) => string;
|
|
6306
6289
|
|
|
6307
6290
|
type VideoProps = {} & BasePropsWrap<{
|
|
@@ -6366,7 +6349,7 @@ declare const TabItem: ({ children, builderAttrs, style, className, parentUid }:
|
|
|
6366
6349
|
parentUid?: string | undefined;
|
|
6367
6350
|
}) => string;
|
|
6368
6351
|
|
|
6369
|
-
declare const HeroBanner: ({ builderAttrs, builderProps, setting, styles, style, children, rawChildren, advanced,
|
|
6352
|
+
declare const HeroBanner: ({ builderAttrs, builderProps, setting, styles, style, children, rawChildren, advanced, enableLazyloadImage, }: _gem_sdk_core.BaseProps<{
|
|
6370
6353
|
link?: {
|
|
6371
6354
|
link?: string | undefined;
|
|
6372
6355
|
target?: string | undefined;
|
|
@@ -6429,7 +6412,7 @@ declare const HeroBanner: ({ builderAttrs, builderProps, setting, styles, style,
|
|
|
6429
6412
|
} & {
|
|
6430
6413
|
rawChildren?: any[] | undefined;
|
|
6431
6414
|
advanced?: any;
|
|
6432
|
-
|
|
6415
|
+
enableLazyloadImage?: boolean | undefined;
|
|
6433
6416
|
}) => string;
|
|
6434
6417
|
|
|
6435
6418
|
declare const CSSCode: ({ setting, style, advanced, builderAttrs, builderProps }: CSSCodeProps) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "2.1.27
|
|
3
|
+
"version": "2.1.27",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"format": "prettier --write \"./src/**/*.{ts,tsx}\""
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@gem-sdk/core": "2.1.
|
|
25
|
-
"@gem-sdk/styles": "2.1.27
|
|
24
|
+
"@gem-sdk/core": "2.1.24",
|
|
25
|
+
"@gem-sdk/styles": "2.1.27",
|
|
26
26
|
"@types/react-transition-group": "^4.4.5"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var AdaptiveImage = require('./AdaptiveImage.js');
|
|
7
|
-
|
|
8
|
-
const NoDataImage = ({ style })=>{
|
|
9
|
-
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
10
|
-
className: "gp-w-full gp-h-full gp-bg-[#F9F9F9] gp-flex gp-items-center gp-justify-center",
|
|
11
|
-
children: [
|
|
12
|
-
AdaptiveImage.default({
|
|
13
|
-
pictureClass: 'gp-w-full',
|
|
14
|
-
srcSet: {
|
|
15
|
-
desktop: {
|
|
16
|
-
src: 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif'
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
style: {
|
|
20
|
-
...style,
|
|
21
|
-
'--op': 0,
|
|
22
|
-
'--z': -1
|
|
23
|
-
}
|
|
24
|
-
}),
|
|
25
|
-
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
26
|
-
className: "gp-absolute gp-flex gp-justify-center gp-items-center",
|
|
27
|
-
children: /*#__PURE__*/ jsxRuntime.jsxs("svg", {
|
|
28
|
-
width: "40",
|
|
29
|
-
height: "40",
|
|
30
|
-
viewBox: "0 0 40 40",
|
|
31
|
-
fill: "none",
|
|
32
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
33
|
-
children: [
|
|
34
|
-
/*#__PURE__*/ jsxRuntime.jsxs("g", {
|
|
35
|
-
clipPath: "url(#clip0_942_39561)",
|
|
36
|
-
children: [
|
|
37
|
-
/*#__PURE__*/ jsxRuntime.jsx("rect", {
|
|
38
|
-
width: "40",
|
|
39
|
-
height: "40",
|
|
40
|
-
fill: "#F9F9F9"
|
|
41
|
-
}),
|
|
42
|
-
/*#__PURE__*/ jsxRuntime.jsx("rect", {
|
|
43
|
-
x: "4",
|
|
44
|
-
width: "32",
|
|
45
|
-
height: "40",
|
|
46
|
-
rx: "2",
|
|
47
|
-
fill: "#E2E2E2"
|
|
48
|
-
}),
|
|
49
|
-
/*#__PURE__*/ jsxRuntime.jsx("rect", {
|
|
50
|
-
y: "26",
|
|
51
|
-
width: "40",
|
|
52
|
-
height: "14",
|
|
53
|
-
fill: "url(#paint0_linear_942_39561)"
|
|
54
|
-
}),
|
|
55
|
-
/*#__PURE__*/ jsxRuntime.jsx("rect", {
|
|
56
|
-
x: "8",
|
|
57
|
-
y: "4",
|
|
58
|
-
width: "24",
|
|
59
|
-
height: "24",
|
|
60
|
-
rx: "1",
|
|
61
|
-
fill: "#F9F9F9"
|
|
62
|
-
}),
|
|
63
|
-
/*#__PURE__*/ jsxRuntime.jsx("circle", {
|
|
64
|
-
cx: "15.2809",
|
|
65
|
-
cy: "11.3688",
|
|
66
|
-
r: "1.36884",
|
|
67
|
-
fill: "#D2D2D2"
|
|
68
|
-
}),
|
|
69
|
-
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
70
|
-
d: "M13.1916 17.7343L15.3456 15.0797C15.4185 14.9896 15.5086 14.9168 15.6101 14.8659C15.7115 14.815 15.822 14.7872 15.9343 14.7844C16.0466 14.7815 16.1583 14.8036 16.2619 14.8492C16.3656 14.8949 16.459 14.963 16.536 15.0492L17.5432 16.1758L21.4803 11.2146C21.5573 11.1174 21.6542 11.0397 21.7637 10.9874C21.8732 10.9351 21.9925 10.9094 22.1127 10.9123C22.2329 10.9153 22.3509 10.9467 22.458 11.0043C22.5651 11.0619 22.6585 11.1442 22.7312 11.245L27.4383 17.7671C27.5283 17.8921 27.5834 18.0411 27.5974 18.1973C27.6114 18.3535 27.5838 18.5108 27.5176 18.6513C27.4514 18.7919 27.3493 18.9102 27.2228 18.993C27.0963 19.0758 26.9503 19.1198 26.8014 19.12L13.8002 19.1251C13.6473 19.1251 13.4975 19.0789 13.3688 18.992C13.24 18.9051 13.1375 18.7812 13.0735 18.6348C13.0095 18.4885 12.9866 18.326 13.0075 18.1664C13.0285 18.0068 13.0923 17.8569 13.1916 17.7343Z",
|
|
71
|
-
fill: "#D2D2D2"
|
|
72
|
-
}),
|
|
73
|
-
/*#__PURE__*/ jsxRuntime.jsx("rect", {
|
|
74
|
-
x: "24.3333",
|
|
75
|
-
y: "24.3333",
|
|
76
|
-
width: "15.3333",
|
|
77
|
-
height: "15.3333",
|
|
78
|
-
rx: "7.66667",
|
|
79
|
-
fill: "white"
|
|
80
|
-
}),
|
|
81
|
-
/*#__PURE__*/ jsxRuntime.jsx("rect", {
|
|
82
|
-
x: "24.3333",
|
|
83
|
-
y: "24.3333",
|
|
84
|
-
width: "15.3333",
|
|
85
|
-
height: "15.3333",
|
|
86
|
-
rx: "7.66667",
|
|
87
|
-
stroke: "#C4C4C4",
|
|
88
|
-
strokeWidth: "0.666667"
|
|
89
|
-
}),
|
|
90
|
-
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
91
|
-
d: "M33.813 34.5199C34.0083 34.7152 34.3249 34.7152 34.5201 34.5199C34.7154 34.3246 34.7154 34.0081 34.5201 33.8128L32.707 31.9997L34.5201 30.1866C34.7154 29.9913 34.7154 29.6747 34.5201 29.4795C34.3249 29.2842 34.0083 29.2842 33.813 29.4795L31.9999 31.2926L30.1868 29.4795C29.9915 29.2842 29.675 29.2842 29.4797 29.4795C29.2844 29.6747 29.2844 29.9913 29.4797 30.1866L31.2928 31.9997L29.4797 33.8128C29.2844 34.0081 29.2844 34.3246 29.4797 34.5199C29.675 34.7152 29.9915 34.7152 30.1868 34.5199L31.9999 32.7068L33.813 34.5199Z",
|
|
92
|
-
fill: "#676767"
|
|
93
|
-
})
|
|
94
|
-
]
|
|
95
|
-
}),
|
|
96
|
-
/*#__PURE__*/ jsxRuntime.jsxs("defs", {
|
|
97
|
-
children: [
|
|
98
|
-
/*#__PURE__*/ jsxRuntime.jsxs("linearGradient", {
|
|
99
|
-
id: "paint0_linear_942_39561",
|
|
100
|
-
x1: "20",
|
|
101
|
-
y1: "26",
|
|
102
|
-
x2: "20",
|
|
103
|
-
y2: "40",
|
|
104
|
-
gradientUnits: "userSpaceOnUse",
|
|
105
|
-
children: [
|
|
106
|
-
/*#__PURE__*/ jsxRuntime.jsx("stop", {
|
|
107
|
-
stopColor: "#F9F9F9",
|
|
108
|
-
stopOpacity: "0"
|
|
109
|
-
}),
|
|
110
|
-
/*#__PURE__*/ jsxRuntime.jsx("stop", {
|
|
111
|
-
offset: "1",
|
|
112
|
-
stopColor: "#F9F9F9"
|
|
113
|
-
})
|
|
114
|
-
]
|
|
115
|
-
}),
|
|
116
|
-
/*#__PURE__*/ jsxRuntime.jsx("clipPath", {
|
|
117
|
-
id: "clip0_942_39561",
|
|
118
|
-
children: /*#__PURE__*/ jsxRuntime.jsx("rect", {
|
|
119
|
-
width: "40",
|
|
120
|
-
height: "40",
|
|
121
|
-
fill: "white"
|
|
122
|
-
})
|
|
123
|
-
})
|
|
124
|
-
]
|
|
125
|
-
})
|
|
126
|
-
]
|
|
127
|
-
})
|
|
128
|
-
})
|
|
129
|
-
]
|
|
130
|
-
});
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
exports.default = NoDataImage;
|