@gem-sdk/components 2.1.17 → 2.1.20
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/ArticleList.js +1 -1
- package/dist/cjs/banner/components/hero-banner/index.liquid.js +9 -7
- package/dist/cjs/banner/components/hero-banner/utils/index.js +5 -3
- package/dist/cjs/form/components/textarea/TextArea.liquid.js +2 -2
- package/dist/cjs/image/components/Image.js +0 -1
- package/dist/cjs/image/components/Image.liquid.js +0 -1
- package/dist/cjs/product/components/ProductImagesV2/jsx/ProductImages.js +2 -9
- package/dist/cjs/product/setting/ProductButton.js +1 -1
- package/dist/cjs/sticky/setting/preset-config.js +2 -2
- package/dist/cjs/third-party/components/ShopifySubscriptions.liquid.js +3 -2
- package/dist/cjs/third-party/setting/ShopifySubscriptions.js +22 -0
- package/dist/esm/article/components/ArticleList.js +1 -1
- package/dist/esm/banner/components/hero-banner/index.liquid.js +9 -7
- package/dist/esm/banner/components/hero-banner/utils/index.js +5 -3
- package/dist/esm/form/components/textarea/TextArea.liquid.js +2 -2
- package/dist/esm/image/components/Image.js +0 -1
- package/dist/esm/image/components/Image.liquid.js +0 -1
- package/dist/esm/product/components/ProductImagesV2/jsx/ProductImages.js +2 -9
- package/dist/esm/product/setting/ProductButton.js +1 -1
- package/dist/esm/sticky/setting/preset-config.js +2 -2
- package/dist/esm/third-party/components/ShopifySubscriptions.liquid.js +3 -2
- package/dist/esm/third-party/setting/ShopifySubscriptions.js +22 -0
- package/dist/types/index.d.ts +3 -0
- package/package.json +2 -2
|
@@ -14,7 +14,7 @@ const ArticleList = ({ styles, setting, className, children, builderProps })=>{
|
|
|
14
14
|
const { articleSetting, numberOfArticle } = setting ?? {};
|
|
15
15
|
const { articleIds, articlePickType } = articleSetting ?? {};
|
|
16
16
|
const articlesQuery = {
|
|
17
|
-
first:
|
|
17
|
+
first: articleIds?.length ?? 50,
|
|
18
18
|
where: {
|
|
19
19
|
baseIDIn: [
|
|
20
20
|
...articleSetting?.articleIds ?? []
|
|
@@ -134,6 +134,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
134
134
|
tablet: helpers$1.createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.width ?? 0),
|
|
135
135
|
mobile: helpers$1.createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.width ?? 0)
|
|
136
136
|
};
|
|
137
|
+
const enableLazyLoad = !setting?.preload && enableLazyloadImage;
|
|
137
138
|
const renderInnerHeroBanner = ()=>{
|
|
138
139
|
return core.template /* liquid */ `
|
|
139
140
|
<div
|
|
@@ -197,9 +198,10 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
197
198
|
'clip-path': index.getClipPath(borderBg?.width, cornerBg)
|
|
198
199
|
}}"
|
|
199
200
|
>
|
|
200
|
-
<div class="${core.cls('hero-banner-bg-parallax gp-hero-banner-image-background
|
|
201
|
+
<div class="${core.cls('hero-banner-bg-parallax gp-hero-banner-image-background', {
|
|
201
202
|
'gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)]': hoverEffect,
|
|
202
|
-
'gp-transition-transform': hoverEffect
|
|
203
|
+
'gp-transition-transform': hoverEffect,
|
|
204
|
+
gp_lazybg: enableLazyLoad
|
|
203
205
|
})}"
|
|
204
206
|
style="${{
|
|
205
207
|
...core.getStyleBackgroundByDevice(background, {
|
|
@@ -208,9 +210,9 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
208
210
|
liquid: true
|
|
209
211
|
}),
|
|
210
212
|
...core.makeStyleResponsive('bgi', {
|
|
211
|
-
desktop: `url('${bgiEnableByDevice['desktop'] ?
|
|
212
|
-
tablet: `url('${bgiEnableByDevice['tablet'] ?
|
|
213
|
-
mobile: `url('${bgiEnableByDevice['mobile'] ?
|
|
213
|
+
desktop: `url('${bgiEnableByDevice['desktop'] ? !enableLazyLoad ? getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, 'desktop'), 'desktop') : imagePlaceholder['desktop'] : ''}')`,
|
|
214
|
+
tablet: `url('${bgiEnableByDevice['tablet'] ? !enableLazyLoad ? getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, 'tablet'), 'tablet') : imagePlaceholder['tablet'] : ''}')`,
|
|
215
|
+
mobile: `url('${bgiEnableByDevice['mobile'] ? !enableLazyLoad ? getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, 'mobile'), 'mobile') : imagePlaceholder['mobile'] : ''}')`
|
|
214
216
|
}),
|
|
215
217
|
'--duration': `${hoverEffectDuration ?? 0}s`,
|
|
216
218
|
'--scale': hoverEffectScale ?? 1,
|
|
@@ -218,6 +220,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
218
220
|
...index.getStyleHeroBannerBg(backgroundResponsive || {}, enableParallax)
|
|
219
221
|
}}"
|
|
220
222
|
>
|
|
223
|
+
${embed()}
|
|
221
224
|
${!setting?.preload ? getSrcSet.DEVICES.map((device)=>{
|
|
222
225
|
return core.RenderIf(getEnableBgImageByDevice(device), NextImage_liquid.default({
|
|
223
226
|
src: getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, device), device),
|
|
@@ -227,8 +230,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
227
230
|
enableLazyloadImage
|
|
228
231
|
}));
|
|
229
232
|
}).join('') : ''}
|
|
230
|
-
</div>
|
|
231
|
-
${embed()} </div>
|
|
233
|
+
</div></div>
|
|
232
234
|
</div>
|
|
233
235
|
${core.RenderIf(overlayEnable, core.template`<div
|
|
234
236
|
aria-label="Overlay"
|
|
@@ -27,13 +27,14 @@ const getHeightHeroBanner = (background, enableParallax)=>{
|
|
|
27
27
|
'tablet'
|
|
28
28
|
];
|
|
29
29
|
DEVICES.forEach((device)=>{
|
|
30
|
+
const enableParallaxDevice = background?.[device]?.type === 'image' ? enableParallax : false;
|
|
30
31
|
const isScale = isScaleImage({
|
|
31
|
-
enableParallax,
|
|
32
|
+
enableParallax: enableParallaxDevice,
|
|
32
33
|
attachment: background[device]?.attachment
|
|
33
34
|
});
|
|
34
35
|
result = {
|
|
35
36
|
...result,
|
|
36
|
-
[device]:
|
|
37
|
+
[device]: enableParallaxDevice ? '150%' : isScale ? '100vh' : '100%'
|
|
37
38
|
};
|
|
38
39
|
});
|
|
39
40
|
return core.makeStyleResponsive('h', result);
|
|
@@ -46,8 +47,9 @@ const getWidthHeroBanner = (background, enableParallax)=>{
|
|
|
46
47
|
'tablet'
|
|
47
48
|
];
|
|
48
49
|
DEVICES.forEach((device)=>{
|
|
50
|
+
const enableParallaxDevice = background?.[device]?.type === 'image' ? enableParallax : false;
|
|
49
51
|
const isScale = isScaleImage({
|
|
50
|
-
enableParallax,
|
|
52
|
+
enableParallax: enableParallaxDevice,
|
|
51
53
|
attachment: background[device]?.attachment
|
|
52
54
|
});
|
|
53
55
|
result = {
|
|
@@ -6,10 +6,10 @@ var core = require('@gem-sdk/core');
|
|
|
6
6
|
var helpers = require('../../../helpers.js');
|
|
7
7
|
|
|
8
8
|
const FormTextarea = ({ setting, builderProps, className, builderAttrs, advanced, pageContext })=>{
|
|
9
|
-
const { text, name, placeholder, required, width, fullWidth, typography } = setting ?? {};
|
|
9
|
+
const { text, name, placeholder, required, width, fullWidth, typography, translate } = setting ?? {};
|
|
10
10
|
const textAreaWidth = core.makeStyleResponsive('w', core.makeWidth(width, fullWidth));
|
|
11
11
|
const defaultName = name === '' || name === undefined ? 'contact[note]' : name;
|
|
12
|
-
const { border, rounded, hasBoxShadow, boxShadow, pos, d, op, right, top, left, bottom, z, margin, padding
|
|
12
|
+
const { border, rounded, hasBoxShadow, boxShadow, pos, d, op, right, top, left, bottom, z, margin, padding } = advanced ?? {};
|
|
13
13
|
const spacingSetting = advanced?.['spacing-setting'];
|
|
14
14
|
const inputStyle = core.composeAdvanceStyle({
|
|
15
15
|
border,
|
|
@@ -80,7 +80,6 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
80
80
|
style: {
|
|
81
81
|
...core.getStyleShadowState(styles?.boxShadowImg, 'box-shadow', styles?.hasBoxShadowImg),
|
|
82
82
|
borderRadius: 'inherit',
|
|
83
|
-
overflow: 'hidden',
|
|
84
83
|
...core.makeStyleResponsive('jc', styles?.align)
|
|
85
84
|
},
|
|
86
85
|
children: [
|
|
@@ -50,7 +50,6 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
50
50
|
style="${{
|
|
51
51
|
...core.getStyleShadowState(styles?.boxShadowImg, 'box-shadow', styles?.hasBoxShadowImg),
|
|
52
52
|
'border-radius': 'inherit',
|
|
53
|
-
overflow: 'hidden',
|
|
54
53
|
...core.makeStyleResponsive('jc', styles?.align)
|
|
55
54
|
}}"
|
|
56
55
|
>
|
|
@@ -42,7 +42,6 @@ const ProductImagesV2 = (productImageProps)=>{
|
|
|
42
42
|
const extraClass = advanced?.cssClass;
|
|
43
43
|
// State
|
|
44
44
|
const [openLightBox, setOpenLightBox] = React.useState(false);
|
|
45
|
-
const [hasVariantAvailable, setHasVariantAvailable] = React.useState(true);
|
|
46
45
|
const getFirstVideo = (product)=>{
|
|
47
46
|
return product?.medias?.edges.find((item)=>[
|
|
48
47
|
'VIDEO',
|
|
@@ -57,24 +56,19 @@ const ProductImagesV2 = (productImageProps)=>{
|
|
|
57
56
|
};
|
|
58
57
|
const priorityFeatureImage = React.useMemo(()=>{
|
|
59
58
|
if (setting?.typeDisplay === 'all-images') {
|
|
60
|
-
setHasVariantAvailable(true);
|
|
61
59
|
let priorityItem;
|
|
62
60
|
switch(setting?.preDisplay){
|
|
63
61
|
case '1st-images':
|
|
64
62
|
priorityItem = getFirstImage(product);
|
|
65
|
-
setHasVariantAvailable(false);
|
|
66
63
|
break;
|
|
67
64
|
case '1st-3d-mode':
|
|
68
65
|
priorityItem = getFirst3DModal(product);
|
|
69
|
-
setHasVariantAvailable(false);
|
|
70
66
|
break;
|
|
71
67
|
case '1st-video':
|
|
72
68
|
priorityItem = getFirstVideo(product);
|
|
73
|
-
setHasVariantAvailable(false);
|
|
74
69
|
break;
|
|
75
70
|
case '1st-available-variant':
|
|
76
71
|
priorityItem = currentVariant?.media;
|
|
77
|
-
setHasVariantAvailable(false);
|
|
78
72
|
break;
|
|
79
73
|
}
|
|
80
74
|
setProductFeaturedImage(priorityItem);
|
|
@@ -141,7 +135,7 @@ const ProductImagesV2 = (productImageProps)=>{
|
|
|
141
135
|
}
|
|
142
136
|
};
|
|
143
137
|
React.useEffect(()=>{
|
|
144
|
-
if (currentVariant
|
|
138
|
+
if (currentVariant) {
|
|
145
139
|
const index = galleryIndex[currentVariant?.mediaId];
|
|
146
140
|
if (index !== undefined) {
|
|
147
141
|
const fImage = gallery[index] ?? product?.featuredImage;
|
|
@@ -155,8 +149,7 @@ const ProductImagesV2 = (productImageProps)=>{
|
|
|
155
149
|
galleryIndex,
|
|
156
150
|
gallery,
|
|
157
151
|
product?.featuredImage,
|
|
158
|
-
setProductFeaturedImage
|
|
159
|
-
hasVariantAvailable
|
|
152
|
+
setProductFeaturedImage
|
|
160
153
|
]);
|
|
161
154
|
const isRenderLightBox = React.useMemo(()=>{
|
|
162
155
|
const isRender = core.getResponsiveValueByScreen(setting?.ftClickOpenLightBox, currentDevice) === 'popup' || core.getResponsiveValueByScreen(setting?.clickOpenLightBox, currentDevice);
|
|
@@ -761,7 +761,7 @@ const StickyPreset = {
|
|
|
761
761
|
settings: {
|
|
762
762
|
label: 'Add to cart',
|
|
763
763
|
outOfStockLabel: 'Out of stock',
|
|
764
|
-
actionEffect: '
|
|
764
|
+
actionEffect: 'open-cart-drawer',
|
|
765
765
|
customURL: {
|
|
766
766
|
link: '/cart',
|
|
767
767
|
target: '_self'
|
|
@@ -1856,7 +1856,7 @@ const StickyPresetProduct = {
|
|
|
1856
1856
|
settings: {
|
|
1857
1857
|
label: 'Add to cart',
|
|
1858
1858
|
outOfStockLabel: 'Out of stock',
|
|
1859
|
-
actionEffect: '
|
|
1859
|
+
actionEffect: 'open-cart-drawer',
|
|
1860
1860
|
customURL: {
|
|
1861
1861
|
link: '/cart',
|
|
1862
1862
|
target: '_self'
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var core = require('@gem-sdk/core');
|
|
6
|
+
var thirdParty = require('../helpers/thirdParty.js');
|
|
6
7
|
|
|
7
8
|
const ShopifySubscriptions = ({ setting, advanced })=>{
|
|
8
|
-
const { align } = setting ?? {};
|
|
9
|
-
return core.template`
|
|
9
|
+
const { align, widgetType, appBlockId } = setting ?? {};
|
|
10
|
+
return widgetType === 'app-block' ? thirdParty.getLiquidForAppBlock(appBlockId, align, `${advanced?.cssClass ?? ''} !gp-block`) : core.template`
|
|
10
11
|
<div
|
|
11
12
|
class="${advanced?.cssClass}"
|
|
12
13
|
style="${{
|
|
@@ -42,6 +42,11 @@ const config = {
|
|
|
42
42
|
{
|
|
43
43
|
id: 'setting',
|
|
44
44
|
controls: [
|
|
45
|
+
{
|
|
46
|
+
id: 'appBlockId',
|
|
47
|
+
type: 'input',
|
|
48
|
+
default: ''
|
|
49
|
+
},
|
|
45
50
|
{
|
|
46
51
|
id: 'install',
|
|
47
52
|
type: 'open-link',
|
|
@@ -58,6 +63,23 @@ const config = {
|
|
|
58
63
|
href: 'https://admin.shopify.com/?redirect=/apps/subscriptions-remix',
|
|
59
64
|
appName: ShopifySubscriptions.AppConfig.label
|
|
60
65
|
},
|
|
66
|
+
{
|
|
67
|
+
id: 'widgetType',
|
|
68
|
+
label: 'Choose widget',
|
|
69
|
+
type: 'select',
|
|
70
|
+
default: 'app-block',
|
|
71
|
+
options: [
|
|
72
|
+
{
|
|
73
|
+
label: 'app block',
|
|
74
|
+
value: 'app-block'
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 'productHandle',
|
|
80
|
+
type: 'product-handle',
|
|
81
|
+
hide: true
|
|
82
|
+
},
|
|
61
83
|
{
|
|
62
84
|
id: 'align',
|
|
63
85
|
label: 'Alignment',
|
|
@@ -10,7 +10,7 @@ const ArticleList = ({ styles, setting, className, children, builderProps })=>{
|
|
|
10
10
|
const { articleSetting, numberOfArticle } = setting ?? {};
|
|
11
11
|
const { articleIds, articlePickType } = articleSetting ?? {};
|
|
12
12
|
const articlesQuery = {
|
|
13
|
-
first:
|
|
13
|
+
first: articleIds?.length ?? 50,
|
|
14
14
|
where: {
|
|
15
15
|
baseIDIn: [
|
|
16
16
|
...articleSetting?.articleIds ?? []
|
|
@@ -130,6 +130,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
130
130
|
tablet: createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.width ?? 0),
|
|
131
131
|
mobile: createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.width ?? 0)
|
|
132
132
|
};
|
|
133
|
+
const enableLazyLoad = !setting?.preload && enableLazyloadImage;
|
|
133
134
|
const renderInnerHeroBanner = ()=>{
|
|
134
135
|
return template /* liquid */ `
|
|
135
136
|
<div
|
|
@@ -193,9 +194,10 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
193
194
|
'clip-path': getClipPath(borderBg?.width, cornerBg)
|
|
194
195
|
}}"
|
|
195
196
|
>
|
|
196
|
-
<div class="${cls('hero-banner-bg-parallax gp-hero-banner-image-background
|
|
197
|
+
<div class="${cls('hero-banner-bg-parallax gp-hero-banner-image-background', {
|
|
197
198
|
'gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)]': hoverEffect,
|
|
198
|
-
'gp-transition-transform': hoverEffect
|
|
199
|
+
'gp-transition-transform': hoverEffect,
|
|
200
|
+
gp_lazybg: enableLazyLoad
|
|
199
201
|
})}"
|
|
200
202
|
style="${{
|
|
201
203
|
...getStyleBackgroundByDevice(background, {
|
|
@@ -204,9 +206,9 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
204
206
|
liquid: true
|
|
205
207
|
}),
|
|
206
208
|
...makeStyleResponsive('bgi', {
|
|
207
|
-
desktop: `url('${bgiEnableByDevice['desktop'] ?
|
|
208
|
-
tablet: `url('${bgiEnableByDevice['tablet'] ?
|
|
209
|
-
mobile: `url('${bgiEnableByDevice['mobile'] ?
|
|
209
|
+
desktop: `url('${bgiEnableByDevice['desktop'] ? !enableLazyLoad ? getImageSrc(getResponsiveValueByScreen(srcSet, 'desktop'), 'desktop') : imagePlaceholder['desktop'] : ''}')`,
|
|
210
|
+
tablet: `url('${bgiEnableByDevice['tablet'] ? !enableLazyLoad ? getImageSrc(getResponsiveValueByScreen(srcSet, 'tablet'), 'tablet') : imagePlaceholder['tablet'] : ''}')`,
|
|
211
|
+
mobile: `url('${bgiEnableByDevice['mobile'] ? !enableLazyLoad ? getImageSrc(getResponsiveValueByScreen(srcSet, 'mobile'), 'mobile') : imagePlaceholder['mobile'] : ''}')`
|
|
210
212
|
}),
|
|
211
213
|
'--duration': `${hoverEffectDuration ?? 0}s`,
|
|
212
214
|
'--scale': hoverEffectScale ?? 1,
|
|
@@ -214,6 +216,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
214
216
|
...getStyleHeroBannerBg(backgroundResponsive || {}, enableParallax)
|
|
215
217
|
}}"
|
|
216
218
|
>
|
|
219
|
+
${embed()}
|
|
217
220
|
${!setting?.preload ? DEVICES.map((device)=>{
|
|
218
221
|
return RenderIf(getEnableBgImageByDevice(device), NextImage({
|
|
219
222
|
src: getImageSrc(getResponsiveValueByScreen(srcSet, device), device),
|
|
@@ -223,8 +226,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
223
226
|
enableLazyloadImage
|
|
224
227
|
}));
|
|
225
228
|
}).join('') : ''}
|
|
226
|
-
</div>
|
|
227
|
-
${embed()} </div>
|
|
229
|
+
</div></div>
|
|
228
230
|
</div>
|
|
229
231
|
${RenderIf(overlayEnable, template`<div
|
|
230
232
|
aria-label="Overlay"
|
|
@@ -25,13 +25,14 @@ const getHeightHeroBanner = (background, enableParallax)=>{
|
|
|
25
25
|
'tablet'
|
|
26
26
|
];
|
|
27
27
|
DEVICES.forEach((device)=>{
|
|
28
|
+
const enableParallaxDevice = background?.[device]?.type === 'image' ? enableParallax : false;
|
|
28
29
|
const isScale = isScaleImage({
|
|
29
|
-
enableParallax,
|
|
30
|
+
enableParallax: enableParallaxDevice,
|
|
30
31
|
attachment: background[device]?.attachment
|
|
31
32
|
});
|
|
32
33
|
result = {
|
|
33
34
|
...result,
|
|
34
|
-
[device]:
|
|
35
|
+
[device]: enableParallaxDevice ? '150%' : isScale ? '100vh' : '100%'
|
|
35
36
|
};
|
|
36
37
|
});
|
|
37
38
|
return makeStyleResponsive('h', result);
|
|
@@ -44,8 +45,9 @@ const getWidthHeroBanner = (background, enableParallax)=>{
|
|
|
44
45
|
'tablet'
|
|
45
46
|
];
|
|
46
47
|
DEVICES.forEach((device)=>{
|
|
48
|
+
const enableParallaxDevice = background?.[device]?.type === 'image' ? enableParallax : false;
|
|
47
49
|
const isScale = isScaleImage({
|
|
48
|
-
enableParallax,
|
|
50
|
+
enableParallax: enableParallaxDevice,
|
|
49
51
|
attachment: background[device]?.attachment
|
|
50
52
|
});
|
|
51
53
|
result = {
|
|
@@ -2,10 +2,10 @@ import { makeStyleResponsive, makeWidth, composeAdvanceStyle, composeTypographyC
|
|
|
2
2
|
import { getDynamicSourceLocales } from '../../../helpers.js';
|
|
3
3
|
|
|
4
4
|
const FormTextarea = ({ setting, builderProps, className, builderAttrs, advanced, pageContext })=>{
|
|
5
|
-
const { text, name, placeholder, required, width, fullWidth, typography } = setting ?? {};
|
|
5
|
+
const { text, name, placeholder, required, width, fullWidth, typography, translate } = setting ?? {};
|
|
6
6
|
const textAreaWidth = makeStyleResponsive('w', makeWidth(width, fullWidth));
|
|
7
7
|
const defaultName = name === '' || name === undefined ? 'contact[note]' : name;
|
|
8
|
-
const { border, rounded, hasBoxShadow, boxShadow, pos, d, op, right, top, left, bottom, z, margin, padding
|
|
8
|
+
const { border, rounded, hasBoxShadow, boxShadow, pos, d, op, right, top, left, bottom, z, margin, padding } = advanced ?? {};
|
|
9
9
|
const spacingSetting = advanced?.['spacing-setting'];
|
|
10
10
|
const inputStyle = composeAdvanceStyle({
|
|
11
11
|
border,
|
|
@@ -76,7 +76,6 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
76
76
|
style: {
|
|
77
77
|
...getStyleShadowState(styles?.boxShadowImg, 'box-shadow', styles?.hasBoxShadowImg),
|
|
78
78
|
borderRadius: 'inherit',
|
|
79
|
-
overflow: 'hidden',
|
|
80
79
|
...makeStyleResponsive('jc', styles?.align)
|
|
81
80
|
},
|
|
82
81
|
children: [
|
|
@@ -46,7 +46,6 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
46
46
|
style="${{
|
|
47
47
|
...getStyleShadowState(styles?.boxShadowImg, 'box-shadow', styles?.hasBoxShadowImg),
|
|
48
48
|
'border-radius': 'inherit',
|
|
49
|
-
overflow: 'hidden',
|
|
50
49
|
...makeStyleResponsive('jc', styles?.align)
|
|
51
50
|
}}"
|
|
52
51
|
>
|
|
@@ -38,7 +38,6 @@ const ProductImagesV2 = (productImageProps)=>{
|
|
|
38
38
|
const extraClass = advanced?.cssClass;
|
|
39
39
|
// State
|
|
40
40
|
const [openLightBox, setOpenLightBox] = useState(false);
|
|
41
|
-
const [hasVariantAvailable, setHasVariantAvailable] = useState(true);
|
|
42
41
|
const getFirstVideo = (product)=>{
|
|
43
42
|
return product?.medias?.edges.find((item)=>[
|
|
44
43
|
'VIDEO',
|
|
@@ -53,24 +52,19 @@ const ProductImagesV2 = (productImageProps)=>{
|
|
|
53
52
|
};
|
|
54
53
|
const priorityFeatureImage = useMemo(()=>{
|
|
55
54
|
if (setting?.typeDisplay === 'all-images') {
|
|
56
|
-
setHasVariantAvailable(true);
|
|
57
55
|
let priorityItem;
|
|
58
56
|
switch(setting?.preDisplay){
|
|
59
57
|
case '1st-images':
|
|
60
58
|
priorityItem = getFirstImage(product);
|
|
61
|
-
setHasVariantAvailable(false);
|
|
62
59
|
break;
|
|
63
60
|
case '1st-3d-mode':
|
|
64
61
|
priorityItem = getFirst3DModal(product);
|
|
65
|
-
setHasVariantAvailable(false);
|
|
66
62
|
break;
|
|
67
63
|
case '1st-video':
|
|
68
64
|
priorityItem = getFirstVideo(product);
|
|
69
|
-
setHasVariantAvailable(false);
|
|
70
65
|
break;
|
|
71
66
|
case '1st-available-variant':
|
|
72
67
|
priorityItem = currentVariant?.media;
|
|
73
|
-
setHasVariantAvailable(false);
|
|
74
68
|
break;
|
|
75
69
|
}
|
|
76
70
|
setProductFeaturedImage(priorityItem);
|
|
@@ -137,7 +131,7 @@ const ProductImagesV2 = (productImageProps)=>{
|
|
|
137
131
|
}
|
|
138
132
|
};
|
|
139
133
|
useEffect(()=>{
|
|
140
|
-
if (currentVariant
|
|
134
|
+
if (currentVariant) {
|
|
141
135
|
const index = galleryIndex[currentVariant?.mediaId];
|
|
142
136
|
if (index !== undefined) {
|
|
143
137
|
const fImage = gallery[index] ?? product?.featuredImage;
|
|
@@ -151,8 +145,7 @@ const ProductImagesV2 = (productImageProps)=>{
|
|
|
151
145
|
galleryIndex,
|
|
152
146
|
gallery,
|
|
153
147
|
product?.featuredImage,
|
|
154
|
-
setProductFeaturedImage
|
|
155
|
-
hasVariantAvailable
|
|
148
|
+
setProductFeaturedImage
|
|
156
149
|
]);
|
|
157
150
|
const isRenderLightBox = useMemo(()=>{
|
|
158
151
|
const isRender = getResponsiveValueByScreen(setting?.ftClickOpenLightBox, currentDevice) === 'popup' || getResponsiveValueByScreen(setting?.clickOpenLightBox, currentDevice);
|
|
@@ -759,7 +759,7 @@ const StickyPreset = {
|
|
|
759
759
|
settings: {
|
|
760
760
|
label: 'Add to cart',
|
|
761
761
|
outOfStockLabel: 'Out of stock',
|
|
762
|
-
actionEffect: '
|
|
762
|
+
actionEffect: 'open-cart-drawer',
|
|
763
763
|
customURL: {
|
|
764
764
|
link: '/cart',
|
|
765
765
|
target: '_self'
|
|
@@ -1854,7 +1854,7 @@ const StickyPresetProduct = {
|
|
|
1854
1854
|
settings: {
|
|
1855
1855
|
label: 'Add to cart',
|
|
1856
1856
|
outOfStockLabel: 'Out of stock',
|
|
1857
|
-
actionEffect: '
|
|
1857
|
+
actionEffect: 'open-cart-drawer',
|
|
1858
1858
|
customURL: {
|
|
1859
1859
|
link: '/cart',
|
|
1860
1860
|
target: '_self'
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { template, makeStyleResponsive } from '@gem-sdk/core';
|
|
2
|
+
import { getLiquidForAppBlock } from '../helpers/thirdParty.js';
|
|
2
3
|
|
|
3
4
|
const ShopifySubscriptions = ({ setting, advanced })=>{
|
|
4
|
-
const { align } = setting ?? {};
|
|
5
|
-
return template`
|
|
5
|
+
const { align, widgetType, appBlockId } = setting ?? {};
|
|
6
|
+
return widgetType === 'app-block' ? getLiquidForAppBlock(appBlockId, align, `${advanced?.cssClass ?? ''} !gp-block`) : template`
|
|
6
7
|
<div
|
|
7
8
|
class="${advanced?.cssClass}"
|
|
8
9
|
style="${{
|
|
@@ -38,6 +38,11 @@ const config = {
|
|
|
38
38
|
{
|
|
39
39
|
id: 'setting',
|
|
40
40
|
controls: [
|
|
41
|
+
{
|
|
42
|
+
id: 'appBlockId',
|
|
43
|
+
type: 'input',
|
|
44
|
+
default: ''
|
|
45
|
+
},
|
|
41
46
|
{
|
|
42
47
|
id: 'install',
|
|
43
48
|
type: 'open-link',
|
|
@@ -54,6 +59,23 @@ const config = {
|
|
|
54
59
|
href: 'https://admin.shopify.com/?redirect=/apps/subscriptions-remix',
|
|
55
60
|
appName: AppConfig.label
|
|
56
61
|
},
|
|
62
|
+
{
|
|
63
|
+
id: 'widgetType',
|
|
64
|
+
label: 'Choose widget',
|
|
65
|
+
type: 'select',
|
|
66
|
+
default: 'app-block',
|
|
67
|
+
options: [
|
|
68
|
+
{
|
|
69
|
+
label: 'app block',
|
|
70
|
+
value: 'app-block'
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 'productHandle',
|
|
76
|
+
type: 'product-handle',
|
|
77
|
+
hide: true
|
|
78
|
+
},
|
|
57
79
|
{
|
|
58
80
|
id: 'align',
|
|
59
81
|
label: 'Alignment',
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2927,6 +2927,9 @@ type ShopifySubscriptionsProps = BaseProps<{
|
|
|
2927
2927
|
align?: ObjectDevices<AlignProp>;
|
|
2928
2928
|
openApp?: any;
|
|
2929
2929
|
install?: any;
|
|
2930
|
+
appBlockId?: string;
|
|
2931
|
+
widgetType?: string;
|
|
2932
|
+
productHandle?: string;
|
|
2930
2933
|
}>;
|
|
2931
2934
|
declare const ShopifySubscriptions$1: React.FC<ShopifySubscriptionsProps>;
|
|
2932
2935
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.20",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"format": "prettier --write \"./src/**/*.{ts,tsx}\""
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@gem-sdk/core": "2.1.
|
|
24
|
+
"@gem-sdk/core": "2.1.20",
|
|
25
25
|
"@gem-sdk/styles": "2.1.0",
|
|
26
26
|
"@types/react-transition-group": "^4.4.5"
|
|
27
27
|
},
|