@gem-sdk/components 2.0.0-dev.619 → 2.0.0-dev.621
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/banner/components/HeroBanner.js +3 -1
- package/dist/cjs/banner/components/HeroBanner.liquid.js +2 -1
- package/dist/cjs/banner/components/common/common.js +12 -0
- package/dist/cjs/banner/setting/presets/heroBanner1ColPreSalesPage.js +1 -3
- package/dist/cjs/banner/setting/presets/heroBannerContentLeftPreSalesPage.js +1 -3
- package/dist/cjs/banner/setting/presets/heroBannerContentRightPreSalesPage.js +1 -3
- package/dist/cjs/banner/setting/presets/heroBannerParallaxPreSalesPage.js +1 -3
- package/dist/cjs/banner/setting/presets/heroBannerVideoPreSalesPage.js +1 -3
- package/dist/cjs/button/components/common/helpers.js +9 -2
- package/dist/cjs/button/setting/Button.js +2 -6
- package/dist/cjs/collection/components/collection-banner/components/CollectionBanner.liquid.js +3 -2
- package/dist/cjs/collection/components/collection-description/common/classes.js +1 -1
- package/dist/cjs/collection/setting/collection-banner/configs/settings.js +11 -8
- package/dist/cjs/collection/setting/collection-banner/configs/uiV2.js +1 -1
- package/dist/cjs/collection/setting/collection-description/configs/settings.js +2 -2
- package/dist/cjs/collection/setting/collection-toolbar/configs/settings.js +1 -1
- package/dist/cjs/image/components/common/attributes.js +9 -0
- package/dist/cjs/image/setting/configs/presets.js +2 -6
- package/dist/esm/banner/components/HeroBanner.js +3 -1
- package/dist/esm/banner/components/HeroBanner.liquid.js +3 -2
- package/dist/esm/banner/components/common/common.js +12 -1
- package/dist/esm/banner/setting/presets/heroBanner1ColPreSalesPage.js +1 -3
- package/dist/esm/banner/setting/presets/heroBannerContentLeftPreSalesPage.js +1 -3
- package/dist/esm/banner/setting/presets/heroBannerContentRightPreSalesPage.js +1 -3
- package/dist/esm/banner/setting/presets/heroBannerParallaxPreSalesPage.js +1 -3
- package/dist/esm/banner/setting/presets/heroBannerVideoPreSalesPage.js +1 -3
- package/dist/esm/button/components/common/helpers.js +9 -2
- package/dist/esm/button/setting/Button.js +2 -6
- package/dist/esm/collection/components/collection-banner/components/CollectionBanner.liquid.js +3 -2
- package/dist/esm/collection/components/collection-description/common/classes.js +1 -1
- package/dist/esm/collection/setting/collection-banner/configs/settings.js +11 -8
- package/dist/esm/collection/setting/collection-banner/configs/uiV2.js +1 -1
- package/dist/esm/collection/setting/collection-description/configs/settings.js +2 -2
- package/dist/esm/collection/setting/collection-toolbar/configs/settings.js +1 -1
- package/dist/esm/image/components/common/attributes.js +9 -0
- package/dist/esm/image/setting/configs/presets.js +2 -6
- package/package.json +2 -2
|
@@ -11,11 +11,13 @@ var getClasses = require('./common/getClasses.js');
|
|
|
11
11
|
var system = require('@gem-sdk/system');
|
|
12
12
|
var core = require('@gem-sdk/core');
|
|
13
13
|
var useHeroBanner = require('./hooks/useHeroBanner.js');
|
|
14
|
+
var common = require('./common/common.js');
|
|
14
15
|
|
|
15
16
|
const HeroBanner = (props)=>{
|
|
16
17
|
const { builderAttrs, builderProps, setting, styles, style, children, advanced, enableLazyloadImage = true } = props;
|
|
17
18
|
const mode = core.useEditorMode();
|
|
18
|
-
const {
|
|
19
|
+
const { enableLink } = setting ?? {};
|
|
20
|
+
const link = common.getBannerLink(setting);
|
|
19
21
|
const { cssClass } = advanced ?? {};
|
|
20
22
|
const currentDevice = core.useCurrentDevice();
|
|
21
23
|
const { elementRef, transform, onMouseEnterParallax, onMouseLeaveParallax, dataVideo, bgRef, isShowVideoHtml5, openLinkBanner, layoutResponsive } = useHeroBanner.useHeroBanner(styles, setting, currentDevice);
|
|
@@ -13,7 +13,8 @@ var common = require('./common/common.js');
|
|
|
13
13
|
|
|
14
14
|
const HeroBanner = (props)=>{
|
|
15
15
|
const { builderAttrs, builderProps, setting, styles, style, children, advanced, enableLazyloadImage = true } = props;
|
|
16
|
-
const {
|
|
16
|
+
const { enableLink } = setting ?? {};
|
|
17
|
+
const link = common.getBannerLink(setting);
|
|
17
18
|
const { cssClass } = advanced ?? {};
|
|
18
19
|
const { urlData } = helpers.getInsertLinkData('', link);
|
|
19
20
|
const stateDataHeroBanner = system.createStateOrContext({
|
|
@@ -456,6 +456,17 @@ function debounce(func, wait) {
|
|
|
456
456
|
};
|
|
457
457
|
}
|
|
458
458
|
const fallbackImg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+';
|
|
459
|
+
const getBannerLink = (setting)=>{
|
|
460
|
+
const link = setting?.link;
|
|
461
|
+
if (link?.type === 'go-to-sales-page') {
|
|
462
|
+
return {
|
|
463
|
+
type: 'go-to-sales-page',
|
|
464
|
+
link: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
465
|
+
target: '_self'
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
return link;
|
|
469
|
+
};
|
|
459
470
|
|
|
460
471
|
exports.bgiEnableByDevice = bgiEnableByDevice;
|
|
461
472
|
exports.debounce = debounce;
|
|
@@ -463,6 +474,7 @@ exports.fallbackImg = fallbackImg;
|
|
|
463
474
|
exports.getAspectRatioSettings = getAspectRatioSettings;
|
|
464
475
|
exports.getAttachmentDevice = getAttachmentDevice;
|
|
465
476
|
exports.getBackgroundImageHeroBanner = getBackgroundImageHeroBanner;
|
|
477
|
+
exports.getBannerLink = getBannerLink;
|
|
466
478
|
exports.getBgImage = getBgImage;
|
|
467
479
|
exports.getClassAlignBanner = getClassAlignBanner;
|
|
468
480
|
exports.getClassContentPosition = getClassContentPosition;
|
|
@@ -38,9 +38,7 @@ const heroBannerParallaxPreSalesPage = {
|
|
|
38
38
|
enableParallax: true,
|
|
39
39
|
speedParallax: 0.6,
|
|
40
40
|
link: {
|
|
41
|
-
type: 'go-to-sales-page'
|
|
42
|
-
link: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
43
|
-
target: '_self'
|
|
41
|
+
type: 'go-to-sales-page'
|
|
44
42
|
}
|
|
45
43
|
},
|
|
46
44
|
styles: {
|
|
@@ -88,7 +88,8 @@ const getInsertLinkData = ({ setting, htmlType, defaultTag, enableBtnLink, isLiq
|
|
|
88
88
|
if (URL_START_WITH.find((el)=>urlHref.startsWith(el))) return true;
|
|
89
89
|
return false;
|
|
90
90
|
};
|
|
91
|
-
const
|
|
91
|
+
const linkedToSalesPage = helpers.isLinkedToSalesPage(setting?.type);
|
|
92
|
+
const shouldRenderLink = enableBtnLink ? isDomain || isShopifyDomain || isLink() || isHomePageHref || linkedToSalesPage : false;
|
|
92
93
|
let transformedUrl = urlHref;
|
|
93
94
|
if (isLiquid && (isShopifyDomain || isHomePageHref)) {
|
|
94
95
|
transformedUrl = setting?.isTranslate ? '$locationOrigin' + urlHref : "{{ request.origin }}{{ routes.root_url | split: '/' | join: '/' }}" + urlHref;
|
|
@@ -101,12 +102,18 @@ const getInsertLinkData = ({ setting, htmlType, defaultTag, enableBtnLink, isLiq
|
|
|
101
102
|
rel: 'nofollow'
|
|
102
103
|
}
|
|
103
104
|
};
|
|
104
|
-
|
|
105
|
+
let urlData = shouldRenderLink ? baseUrlData : isHyperlink ? {
|
|
105
106
|
...baseUrlData,
|
|
106
107
|
type: htmlType
|
|
107
108
|
} : {
|
|
108
109
|
type: htmlType
|
|
109
110
|
};
|
|
111
|
+
if (linkedToSalesPage) {
|
|
112
|
+
urlData = {
|
|
113
|
+
href: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
114
|
+
target: '_self'
|
|
115
|
+
};
|
|
116
|
+
}
|
|
110
117
|
return {
|
|
111
118
|
HTMLTag,
|
|
112
119
|
urlData,
|
|
@@ -121,9 +121,7 @@ const config = {
|
|
|
121
121
|
},
|
|
122
122
|
settings: {
|
|
123
123
|
btnLink: {
|
|
124
|
-
type: 'go-to-sales-page'
|
|
125
|
-
link: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
126
|
-
target: '_self'
|
|
124
|
+
type: 'go-to-sales-page'
|
|
127
125
|
},
|
|
128
126
|
enableBtnLink: true
|
|
129
127
|
}
|
|
@@ -152,9 +150,7 @@ const config = {
|
|
|
152
150
|
iconAlign: 'left',
|
|
153
151
|
iconSvg: '<svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg" className="w-6 h-6" viewBox="0 0 512 512" fill="currentColor"> <path fill="currentColor" strokeLinecap="round" strokeLinejoin="round" fill="currentColor" d="M115.584 494.176c-12.352 6.336 -26.368 -4.768 -23.872 -18.944l26.56 -151.36L5.536 216.48c-10.528 -10.048 -5.056 -28.416 9.056 -30.4l156.736 -22.272L241.216 25.344c6.304 -12.48 23.36 -12.48 29.664 0l69.888 138.464 156.736 22.272c14.112 1.984 19.584 20.352 9.024 30.4l-112.704 107.392 26.56 151.36c2.496 14.176 -11.52 25.28 -23.872 18.944L256 421.984l-140.448 72.192z" /></svg>',
|
|
154
152
|
btnLink: {
|
|
155
|
-
type: 'go-to-sales-page'
|
|
156
|
-
link: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
157
|
-
target: '_self'
|
|
153
|
+
type: 'go-to-sales-page'
|
|
158
154
|
},
|
|
159
155
|
enableBtnLink: true
|
|
160
156
|
},
|
package/dist/cjs/collection/components/collection-banner/components/CollectionBanner.liquid.js
CHANGED
|
@@ -61,8 +61,9 @@ const CollectionBanner = ({ builderAttrs, builderProps, setting, style, children
|
|
|
61
61
|
role="banner"
|
|
62
62
|
class="${classContainerBackgoundImage}"
|
|
63
63
|
style="${styleContainerBackgoundImage}"
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
>
|
|
65
|
+
</div>
|
|
66
|
+
<div aria-label="Overlay" role="banner" class="${classOverlayBanner}" style="${styleOverlay}" ></div>
|
|
66
67
|
${core.RenderIf(!!link?.link, `<a
|
|
67
68
|
href="${link?.link}"
|
|
68
69
|
target="${link?.target}"
|
|
@@ -14,7 +14,7 @@ const getDescriptionClasses = ({ advanced })=>{
|
|
|
14
14
|
return composeClasses(core.cls('gp-collection-description', advanced?.cssClass));
|
|
15
15
|
};
|
|
16
16
|
const getShowMoreIconClasses = ()=>{
|
|
17
|
-
return composeClasses(core.cls('gp-show-more-icon gp-ml-1'));
|
|
17
|
+
return composeClasses(core.cls('gp-show-more-icon gp-ml-1 gp-flex gp-items-center'));
|
|
18
18
|
};
|
|
19
19
|
const getShowMoreTextClasses = ()=>{
|
|
20
20
|
return composeClasses(core.cls('gp-show-more-text'));
|
|
@@ -127,7 +127,7 @@ const CollectionBannerSettings = [
|
|
|
127
127
|
options: [
|
|
128
128
|
{
|
|
129
129
|
label: 'Start',
|
|
130
|
-
value: '
|
|
130
|
+
value: 'top',
|
|
131
131
|
tooltip: 'Align top',
|
|
132
132
|
iconName: 'gp-align-top'
|
|
133
133
|
},
|
|
@@ -139,12 +139,12 @@ const CollectionBannerSettings = [
|
|
|
139
139
|
},
|
|
140
140
|
{
|
|
141
141
|
label: 'End',
|
|
142
|
-
value: '
|
|
142
|
+
value: 'bottom',
|
|
143
143
|
tooltip: 'Align bottom',
|
|
144
144
|
iconName: 'gp-align-bottom'
|
|
145
145
|
}
|
|
146
146
|
],
|
|
147
|
-
default: '
|
|
147
|
+
default: 'center'
|
|
148
148
|
},
|
|
149
149
|
{
|
|
150
150
|
id: 'fullWidth',
|
|
@@ -164,16 +164,15 @@ const CollectionBannerSettings = [
|
|
|
164
164
|
},
|
|
165
165
|
{
|
|
166
166
|
id: 'width',
|
|
167
|
-
type: 'input:unit
|
|
167
|
+
type: 'input:unit',
|
|
168
168
|
label: 'Width',
|
|
169
169
|
min: 0,
|
|
170
170
|
units: [
|
|
171
|
-
'px'
|
|
172
|
-
'%'
|
|
171
|
+
'px'
|
|
173
172
|
],
|
|
174
173
|
devices: {
|
|
175
174
|
desktop: {
|
|
176
|
-
default: '
|
|
175
|
+
default: '1200px'
|
|
177
176
|
}
|
|
178
177
|
}
|
|
179
178
|
},
|
|
@@ -184,12 +183,14 @@ const CollectionBannerSettings = [
|
|
|
184
183
|
'px'
|
|
185
184
|
],
|
|
186
185
|
min: 0,
|
|
186
|
+
max: 120,
|
|
187
187
|
label: 'Spacing',
|
|
188
188
|
devices: {
|
|
189
189
|
desktop: {
|
|
190
190
|
default: '32px'
|
|
191
191
|
}
|
|
192
|
-
}
|
|
192
|
+
},
|
|
193
|
+
ignoreMax: true
|
|
193
194
|
}
|
|
194
195
|
]
|
|
195
196
|
},
|
|
@@ -202,6 +203,8 @@ const CollectionBannerSettings = [
|
|
|
202
203
|
id: 'background',
|
|
203
204
|
type: 'background-image',
|
|
204
205
|
ignoreReRender: true,
|
|
206
|
+
isBackground: true,
|
|
207
|
+
isHideClear: true,
|
|
205
208
|
devices: {
|
|
206
209
|
desktop: {
|
|
207
210
|
default: {
|
|
@@ -45,7 +45,7 @@ const CollectionDescriptionSettings = [
|
|
|
45
45
|
disableDecimal: true,
|
|
46
46
|
devices: {
|
|
47
47
|
desktop: {
|
|
48
|
-
default:
|
|
48
|
+
default: 3
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
},
|
|
@@ -116,7 +116,7 @@ const CollectionDescriptionSettings = [
|
|
|
116
116
|
],
|
|
117
117
|
devices: {
|
|
118
118
|
desktop: {
|
|
119
|
-
default: '
|
|
119
|
+
default: 'left'
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
},
|
|
@@ -22,6 +22,15 @@ const getLinkWrapperAttrs = ({ urlData, imageLink, title, isLiquid = false })=>{
|
|
|
22
22
|
setting: urlData,
|
|
23
23
|
title
|
|
24
24
|
};
|
|
25
|
+
if (imageLink?.type === 'go-to-sales-page') {
|
|
26
|
+
return {
|
|
27
|
+
...attributes,
|
|
28
|
+
setting: {
|
|
29
|
+
href: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
30
|
+
target: '_self'
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
25
34
|
return imageLink?.link ? attributes : {};
|
|
26
35
|
};
|
|
27
36
|
const getImageLiquidAttrs = ({ pageContext, enableLazyLoadImage = false })=>{
|
|
@@ -185,9 +185,7 @@ const ImagePreset = [
|
|
|
185
185
|
},
|
|
186
186
|
settings: {
|
|
187
187
|
imageLink: {
|
|
188
|
-
type: 'go-to-sales-page'
|
|
189
|
-
link: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
190
|
-
target: '_self'
|
|
188
|
+
type: 'go-to-sales-page'
|
|
191
189
|
}
|
|
192
190
|
}
|
|
193
191
|
}
|
|
@@ -245,9 +243,7 @@ const ImagePreset = [
|
|
|
245
243
|
settings: {
|
|
246
244
|
imageStyle: 'circle',
|
|
247
245
|
imageLink: {
|
|
248
|
-
type: 'go-to-sales-page'
|
|
249
|
-
link: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
250
|
-
target: '_self'
|
|
246
|
+
type: 'go-to-sales-page'
|
|
251
247
|
}
|
|
252
248
|
},
|
|
253
249
|
styles: {
|
|
@@ -7,11 +7,13 @@ import { getClasses, getLinkClasses } from './common/getClasses.js';
|
|
|
7
7
|
import { createAttr, createStyle, createClass, If } from '@gem-sdk/system';
|
|
8
8
|
import { useEditorMode, useCurrentDevice, filterToolbarPreview } from '@gem-sdk/core';
|
|
9
9
|
import { useHeroBanner } from './hooks/useHeroBanner.js';
|
|
10
|
+
import { getBannerLink } from './common/common.js';
|
|
10
11
|
|
|
11
12
|
const HeroBanner = (props)=>{
|
|
12
13
|
const { builderAttrs, builderProps, setting, styles, style, children, advanced, enableLazyloadImage = true } = props;
|
|
13
14
|
const mode = useEditorMode();
|
|
14
|
-
const {
|
|
15
|
+
const { enableLink } = setting ?? {};
|
|
16
|
+
const link = getBannerLink(setting);
|
|
15
17
|
const { cssClass } = advanced ?? {};
|
|
16
18
|
const currentDevice = useCurrentDevice();
|
|
17
19
|
const { elementRef, transform, onMouseEnterParallax, onMouseLeaveParallax, dataVideo, bgRef, isShowVideoHtml5, openLinkBanner, layoutResponsive } = useHeroBanner(styles, setting, currentDevice);
|
|
@@ -5,11 +5,12 @@ import { getClasses, getLinkClasses } from './common/getClasses.js';
|
|
|
5
5
|
import { createStateOrContext, createAttr, createStyle, createClass, If } from '@gem-sdk/system';
|
|
6
6
|
import { template, dataStringify, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
|
|
7
7
|
import { getInsertLinkData, getSettingPreloadData } from '../../helpers.js';
|
|
8
|
-
import { getResponsiveSetting } from './common/common.js';
|
|
8
|
+
import { getResponsiveSetting, getBannerLink } from './common/common.js';
|
|
9
9
|
|
|
10
10
|
const HeroBanner = (props)=>{
|
|
11
11
|
const { builderAttrs, builderProps, setting, styles, style, children, advanced, enableLazyloadImage = true } = props;
|
|
12
|
-
const {
|
|
12
|
+
const { enableLink } = setting ?? {};
|
|
13
|
+
const link = getBannerLink(setting);
|
|
13
14
|
const { cssClass } = advanced ?? {};
|
|
14
15
|
const { urlData } = getInsertLinkData('', link);
|
|
15
16
|
const stateDataHeroBanner = createStateOrContext({
|
|
@@ -454,5 +454,16 @@ function debounce(func, wait) {
|
|
|
454
454
|
};
|
|
455
455
|
}
|
|
456
456
|
const fallbackImg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+';
|
|
457
|
+
const getBannerLink = (setting)=>{
|
|
458
|
+
const link = setting?.link;
|
|
459
|
+
if (link?.type === 'go-to-sales-page') {
|
|
460
|
+
return {
|
|
461
|
+
type: 'go-to-sales-page',
|
|
462
|
+
link: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
463
|
+
target: '_self'
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
return link;
|
|
467
|
+
};
|
|
457
468
|
|
|
458
|
-
export { bgiEnableByDevice, debounce, fallbackImg, getAspectRatioSettings, getAttachmentDevice, getBackgroundImageHeroBanner, getBgImage, getClassAlignBanner, getClassContentPosition, getClassForContentByFitContent, getClassForStretchContent, getClassSpaceBetween, getClipPath, getContentPosition, getDataVideoHeroBannerResponsive, getDisplayStyleByFitContent, getEnableBgImageByDevice, getPercentageVisible, getResponsiveSetting, getStyleAspectRatioHeroBannerCustom, getStyleHeroBannerBg, getVisibilityStyle, getWidth, horizontalAlign, imagePlaceholder, isScaleImage, mapContentPositionToHorizontal, scrollToContentBanner, showVideoType };
|
|
469
|
+
export { bgiEnableByDevice, debounce, fallbackImg, getAspectRatioSettings, getAttachmentDevice, getBackgroundImageHeroBanner, getBannerLink, getBgImage, getClassAlignBanner, getClassContentPosition, getClassForContentByFitContent, getClassForStretchContent, getClassSpaceBetween, getClipPath, getContentPosition, getDataVideoHeroBannerResponsive, getDisplayStyleByFitContent, getEnableBgImageByDevice, getPercentageVisible, getResponsiveSetting, getStyleAspectRatioHeroBannerCustom, getStyleHeroBannerBg, getVisibilityStyle, getWidth, horizontalAlign, imagePlaceholder, isScaleImage, mapContentPositionToHorizontal, scrollToContentBanner, showVideoType };
|
|
@@ -36,9 +36,7 @@ const heroBannerParallaxPreSalesPage = {
|
|
|
36
36
|
enableParallax: true,
|
|
37
37
|
speedParallax: 0.6,
|
|
38
38
|
link: {
|
|
39
|
-
type: 'go-to-sales-page'
|
|
40
|
-
link: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
41
|
-
target: '_self'
|
|
39
|
+
type: 'go-to-sales-page'
|
|
42
40
|
}
|
|
43
41
|
},
|
|
44
42
|
styles: {
|
|
@@ -86,7 +86,8 @@ const getInsertLinkData = ({ setting, htmlType, defaultTag, enableBtnLink, isLiq
|
|
|
86
86
|
if (URL_START_WITH.find((el)=>urlHref.startsWith(el))) return true;
|
|
87
87
|
return false;
|
|
88
88
|
};
|
|
89
|
-
const
|
|
89
|
+
const linkedToSalesPage = isLinkedToSalesPage(setting?.type);
|
|
90
|
+
const shouldRenderLink = enableBtnLink ? isDomain || isShopifyDomain || isLink() || isHomePageHref || linkedToSalesPage : false;
|
|
90
91
|
let transformedUrl = urlHref;
|
|
91
92
|
if (isLiquid && (isShopifyDomain || isHomePageHref)) {
|
|
92
93
|
transformedUrl = setting?.isTranslate ? '$locationOrigin' + urlHref : "{{ request.origin }}{{ routes.root_url | split: '/' | join: '/' }}" + urlHref;
|
|
@@ -99,12 +100,18 @@ const getInsertLinkData = ({ setting, htmlType, defaultTag, enableBtnLink, isLiq
|
|
|
99
100
|
rel: 'nofollow'
|
|
100
101
|
}
|
|
101
102
|
};
|
|
102
|
-
|
|
103
|
+
let urlData = shouldRenderLink ? baseUrlData : isHyperlink ? {
|
|
103
104
|
...baseUrlData,
|
|
104
105
|
type: htmlType
|
|
105
106
|
} : {
|
|
106
107
|
type: htmlType
|
|
107
108
|
};
|
|
109
|
+
if (linkedToSalesPage) {
|
|
110
|
+
urlData = {
|
|
111
|
+
href: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
112
|
+
target: '_self'
|
|
113
|
+
};
|
|
114
|
+
}
|
|
108
115
|
return {
|
|
109
116
|
HTMLTag,
|
|
110
117
|
urlData,
|
|
@@ -117,9 +117,7 @@ const config = {
|
|
|
117
117
|
},
|
|
118
118
|
settings: {
|
|
119
119
|
btnLink: {
|
|
120
|
-
type: 'go-to-sales-page'
|
|
121
|
-
link: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
122
|
-
target: '_self'
|
|
120
|
+
type: 'go-to-sales-page'
|
|
123
121
|
},
|
|
124
122
|
enableBtnLink: true
|
|
125
123
|
}
|
|
@@ -148,9 +146,7 @@ const config = {
|
|
|
148
146
|
iconAlign: 'left',
|
|
149
147
|
iconSvg: '<svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg" className="w-6 h-6" viewBox="0 0 512 512" fill="currentColor"> <path fill="currentColor" strokeLinecap="round" strokeLinejoin="round" fill="currentColor" d="M115.584 494.176c-12.352 6.336 -26.368 -4.768 -23.872 -18.944l26.56 -151.36L5.536 216.48c-10.528 -10.048 -5.056 -28.416 9.056 -30.4l156.736 -22.272L241.216 25.344c6.304 -12.48 23.36 -12.48 29.664 0l69.888 138.464 156.736 22.272c14.112 1.984 19.584 20.352 9.024 30.4l-112.704 107.392 26.56 151.36c2.496 14.176 -11.52 25.28 -23.872 18.944L256 421.984l-140.448 72.192z" /></svg>',
|
|
150
148
|
btnLink: {
|
|
151
|
-
type: 'go-to-sales-page'
|
|
152
|
-
link: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
153
|
-
target: '_self'
|
|
149
|
+
type: 'go-to-sales-page'
|
|
154
150
|
},
|
|
155
151
|
enableBtnLink: true
|
|
156
152
|
},
|
package/dist/esm/collection/components/collection-banner/components/CollectionBanner.liquid.js
CHANGED
|
@@ -57,8 +57,9 @@ const CollectionBanner = ({ builderAttrs, builderProps, setting, style, children
|
|
|
57
57
|
role="banner"
|
|
58
58
|
class="${classContainerBackgoundImage}"
|
|
59
59
|
style="${styleContainerBackgoundImage}"
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
>
|
|
61
|
+
</div>
|
|
62
|
+
<div aria-label="Overlay" role="banner" class="${classOverlayBanner}" style="${styleOverlay}" ></div>
|
|
62
63
|
${RenderIf(!!link?.link, `<a
|
|
63
64
|
href="${link?.link}"
|
|
64
65
|
target="${link?.target}"
|
|
@@ -12,7 +12,7 @@ const getDescriptionClasses = ({ advanced })=>{
|
|
|
12
12
|
return composeClasses(cls('gp-collection-description', advanced?.cssClass));
|
|
13
13
|
};
|
|
14
14
|
const getShowMoreIconClasses = ()=>{
|
|
15
|
-
return composeClasses(cls('gp-show-more-icon gp-ml-1'));
|
|
15
|
+
return composeClasses(cls('gp-show-more-icon gp-ml-1 gp-flex gp-items-center'));
|
|
16
16
|
};
|
|
17
17
|
const getShowMoreTextClasses = ()=>{
|
|
18
18
|
return composeClasses(cls('gp-show-more-text'));
|
|
@@ -125,7 +125,7 @@ const CollectionBannerSettings = [
|
|
|
125
125
|
options: [
|
|
126
126
|
{
|
|
127
127
|
label: 'Start',
|
|
128
|
-
value: '
|
|
128
|
+
value: 'top',
|
|
129
129
|
tooltip: 'Align top',
|
|
130
130
|
iconName: 'gp-align-top'
|
|
131
131
|
},
|
|
@@ -137,12 +137,12 @@ const CollectionBannerSettings = [
|
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
139
|
label: 'End',
|
|
140
|
-
value: '
|
|
140
|
+
value: 'bottom',
|
|
141
141
|
tooltip: 'Align bottom',
|
|
142
142
|
iconName: 'gp-align-bottom'
|
|
143
143
|
}
|
|
144
144
|
],
|
|
145
|
-
default: '
|
|
145
|
+
default: 'center'
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
148
|
id: 'fullWidth',
|
|
@@ -162,16 +162,15 @@ const CollectionBannerSettings = [
|
|
|
162
162
|
},
|
|
163
163
|
{
|
|
164
164
|
id: 'width',
|
|
165
|
-
type: 'input:unit
|
|
165
|
+
type: 'input:unit',
|
|
166
166
|
label: 'Width',
|
|
167
167
|
min: 0,
|
|
168
168
|
units: [
|
|
169
|
-
'px'
|
|
170
|
-
'%'
|
|
169
|
+
'px'
|
|
171
170
|
],
|
|
172
171
|
devices: {
|
|
173
172
|
desktop: {
|
|
174
|
-
default: '
|
|
173
|
+
default: '1200px'
|
|
175
174
|
}
|
|
176
175
|
}
|
|
177
176
|
},
|
|
@@ -182,12 +181,14 @@ const CollectionBannerSettings = [
|
|
|
182
181
|
'px'
|
|
183
182
|
],
|
|
184
183
|
min: 0,
|
|
184
|
+
max: 120,
|
|
185
185
|
label: 'Spacing',
|
|
186
186
|
devices: {
|
|
187
187
|
desktop: {
|
|
188
188
|
default: '32px'
|
|
189
189
|
}
|
|
190
|
-
}
|
|
190
|
+
},
|
|
191
|
+
ignoreMax: true
|
|
191
192
|
}
|
|
192
193
|
]
|
|
193
194
|
},
|
|
@@ -200,6 +201,8 @@ const CollectionBannerSettings = [
|
|
|
200
201
|
id: 'background',
|
|
201
202
|
type: 'background-image',
|
|
202
203
|
ignoreReRender: true,
|
|
204
|
+
isBackground: true,
|
|
205
|
+
isHideClear: true,
|
|
203
206
|
devices: {
|
|
204
207
|
desktop: {
|
|
205
208
|
default: {
|
|
@@ -43,7 +43,7 @@ const CollectionDescriptionSettings = [
|
|
|
43
43
|
disableDecimal: true,
|
|
44
44
|
devices: {
|
|
45
45
|
desktop: {
|
|
46
|
-
default:
|
|
46
|
+
default: 3
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
},
|
|
@@ -114,7 +114,7 @@ const CollectionDescriptionSettings = [
|
|
|
114
114
|
],
|
|
115
115
|
devices: {
|
|
116
116
|
desktop: {
|
|
117
|
-
default: '
|
|
117
|
+
default: 'left'
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
},
|
|
@@ -20,6 +20,15 @@ const getLinkWrapperAttrs = ({ urlData, imageLink, title, isLiquid = false })=>{
|
|
|
20
20
|
setting: urlData,
|
|
21
21
|
title
|
|
22
22
|
};
|
|
23
|
+
if (imageLink?.type === 'go-to-sales-page') {
|
|
24
|
+
return {
|
|
25
|
+
...attributes,
|
|
26
|
+
setting: {
|
|
27
|
+
href: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
28
|
+
target: '_self'
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
23
32
|
return imageLink?.link ? attributes : {};
|
|
24
33
|
};
|
|
25
34
|
const getImageLiquidAttrs = ({ pageContext, enableLazyLoadImage = false })=>{
|
|
@@ -183,9 +183,7 @@ const ImagePreset = [
|
|
|
183
183
|
},
|
|
184
184
|
settings: {
|
|
185
185
|
imageLink: {
|
|
186
|
-
type: 'go-to-sales-page'
|
|
187
|
-
link: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
188
|
-
target: '_self'
|
|
186
|
+
type: 'go-to-sales-page'
|
|
189
187
|
}
|
|
190
188
|
}
|
|
191
189
|
}
|
|
@@ -243,9 +241,7 @@ const ImagePreset = [
|
|
|
243
241
|
settings: {
|
|
244
242
|
imageStyle: 'circle',
|
|
245
243
|
imageLink: {
|
|
246
|
-
type: 'go-to-sales-page'
|
|
247
|
-
link: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
248
|
-
target: '_self'
|
|
244
|
+
type: 'go-to-sales-page'
|
|
249
245
|
}
|
|
250
246
|
},
|
|
251
247
|
styles: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.621",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"scan-all-text": "node ./scripts/scan-all-text.js"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@gem-sdk/core": "2.0.0-dev.
|
|
28
|
+
"@gem-sdk/core": "2.0.0-dev.621",
|
|
29
29
|
"@gem-sdk/styles": "2.0.0-dev.571",
|
|
30
30
|
"@gem-sdk/system": "2.0.0-dev.504",
|
|
31
31
|
"@types/react-transition-group": "^4.4.5",
|