@gem-sdk/components 2.0.0-dev.574 → 2.0.0-dev.576
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/setting/HeroBanner.js +11 -1
- package/dist/cjs/banner/setting/presets/heroBanner1ColPreSalesPage.js +138 -0
- package/dist/cjs/banner/setting/presets/heroBannerContentLeftPreSalesPage.js +158 -0
- package/dist/cjs/banner/setting/presets/heroBannerContentRightPreSalesPage.js +166 -0
- package/dist/cjs/banner/setting/presets/heroBannerParallaxPreSalesPage.js +138 -0
- package/dist/cjs/banner/setting/presets/heroBannerVideoPreSalesPage.js +134 -0
- package/dist/cjs/button/components/common/helpers.js +1 -1
- package/dist/cjs/button/setting/Button.js +82 -0
- package/dist/cjs/carousel/setting/configs/uiV2.js +9 -9
- package/dist/cjs/helpers.js +5 -1
- package/dist/cjs/image/setting/configs/presets.js +165 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/product/components/ProductImagesV2/index.js +10 -11
- package/dist/cjs/product/components/ProductList/common/getClass.js +2 -2
- package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/index.js +19 -19
- package/dist/cjs/product/setting/product-image-v2/configs/uiV2.js +2 -2
- package/dist/esm/banner/setting/HeroBanner.js +11 -1
- package/dist/esm/banner/setting/presets/heroBanner1ColPreSalesPage.js +136 -0
- package/dist/esm/banner/setting/presets/heroBannerContentLeftPreSalesPage.js +156 -0
- package/dist/esm/banner/setting/presets/heroBannerContentRightPreSalesPage.js +164 -0
- package/dist/esm/banner/setting/presets/heroBannerParallaxPreSalesPage.js +136 -0
- package/dist/esm/banner/setting/presets/heroBannerVideoPreSalesPage.js +132 -0
- package/dist/esm/button/components/common/helpers.js +2 -2
- package/dist/esm/button/setting/Button.js +82 -0
- package/dist/esm/carousel/setting/configs/uiV2.js +9 -9
- package/dist/esm/helpers.js +5 -2
- package/dist/esm/image/setting/configs/presets.js +165 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/product/components/ProductImagesV2/index.js +11 -12
- package/dist/esm/product/components/ProductList/common/getClass.js +2 -2
- package/dist/esm/product/setting/product-image-v2/configs/setting-v2/index.js +19 -19
- package/dist/esm/product/setting/product-image-v2/configs/uiV2.js +2 -2
- package/dist/types/index.d.ts +2 -1
- package/package.json +2 -2
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
const heroBannerVideoPreSalesPage = {
|
|
2
|
+
id: 'hero-banner-video-pre-sales-page',
|
|
3
|
+
name: {
|
|
4
|
+
en: 'Video Banner'
|
|
5
|
+
},
|
|
6
|
+
icon: {
|
|
7
|
+
desktop: `
|
|
8
|
+
<svg width="96" height="48" viewBox="0 0 96 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9
|
+
<g clip-path="url(#clip0_12567_1327)">
|
|
10
|
+
<rect width="96" height="48" rx="3" fill="#424242"/>
|
|
11
|
+
<ellipse cx="4" cy="1.5" rx="11" ry="11.5" fill="#5E5E5E"/>
|
|
12
|
+
<path d="M25.6011 61.8234L43.5988 40.4906C44.2081 39.767 44.9611 39.1816 45.8088 38.7727C46.6564 38.3638 47.5796 38.1406 48.5181 38.1175C49.4566 38.0944 50.3894 38.272 51.2556 38.6387C52.1219 39.0055 52.902 39.5531 53.5453 40.2459L61.9609 49.2989L94.858 9.43075C95.502 8.64956 96.3116 8.02551 97.2264 7.60499C98.1413 7.18447 99.138 6.9783 100.142 7.00181C101.147 7.02532 102.133 7.2779 103.028 7.74078C103.922 8.20366 104.703 8.86493 105.31 9.67543L144.641 62.0866C145.393 63.0913 145.853 64.2887 145.97 65.5441C146.087 66.7994 145.856 68.063 145.303 69.1926C144.751 70.3222 143.897 71.2732 142.84 71.9384C141.783 72.6037 140.564 72.957 139.319 72.9585L30.686 73C29.4082 72.9995 28.1573 72.6281 27.0813 71.9299C26.0053 71.2317 25.1492 70.2358 24.6143 69.06C24.0794 67.8843 23.8881 66.5779 24.0629 65.2955C24.2378 64.0131 24.7716 62.8082 25.6011 61.8234Z" fill="#5E5E5E"/>
|
|
13
|
+
<path d="M40 28.4163V14.3838C40 13.2662 41.3774 12.6113 42.3799 13.2521L53.3549 20.2684C54.215 20.8183 54.215 21.9818 53.3549 22.5317L42.3799 29.5479C41.3774 30.1888 40 29.5338 40 28.4163Z" fill="#F9F9F9"/>
|
|
14
|
+
</g>
|
|
15
|
+
<defs>
|
|
16
|
+
<clipPath id="clip0_12567_1327">
|
|
17
|
+
<rect width="96" height="48" rx="3" fill="white"/>
|
|
18
|
+
</clipPath>
|
|
19
|
+
</defs>
|
|
20
|
+
</svg>
|
|
21
|
+
`
|
|
22
|
+
},
|
|
23
|
+
components: [
|
|
24
|
+
{
|
|
25
|
+
tag: 'HeroBanner',
|
|
26
|
+
settings: {
|
|
27
|
+
layout: {
|
|
28
|
+
desktop: {
|
|
29
|
+
cols: [
|
|
30
|
+
12
|
|
31
|
+
],
|
|
32
|
+
display: 'fill'
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
link: {
|
|
36
|
+
type: 'go-to-sales-page',
|
|
37
|
+
link: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
38
|
+
target: '_self'
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
styles: {
|
|
42
|
+
contentWidth: {
|
|
43
|
+
desktop: '1200px'
|
|
44
|
+
},
|
|
45
|
+
background: {
|
|
46
|
+
desktop: {
|
|
47
|
+
type: 'video',
|
|
48
|
+
image: {
|
|
49
|
+
src: '',
|
|
50
|
+
width: 1920,
|
|
51
|
+
height: 900
|
|
52
|
+
},
|
|
53
|
+
videoType: 'html5',
|
|
54
|
+
video: 'https://youtu.be/KOxfzBp72uk',
|
|
55
|
+
videoHtml5: 'https://media.w3.org/2010/05/sintel/trailer.mp4'
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
childrens: [
|
|
60
|
+
{
|
|
61
|
+
tag: 'Col',
|
|
62
|
+
childrens: [
|
|
63
|
+
{
|
|
64
|
+
tag: 'Heading',
|
|
65
|
+
settings: {
|
|
66
|
+
text: 'Click here to edit heading'
|
|
67
|
+
},
|
|
68
|
+
styles: {
|
|
69
|
+
textAlign: {
|
|
70
|
+
desktop: 'center'
|
|
71
|
+
},
|
|
72
|
+
typo: {
|
|
73
|
+
attrs: {
|
|
74
|
+
color: '#FFFFFF'
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
advanced: {
|
|
79
|
+
'spacing-setting': {
|
|
80
|
+
desktop: {
|
|
81
|
+
margin: {
|
|
82
|
+
bottom: 'var(--g-s-l)'
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
tag: 'Text',
|
|
90
|
+
settings: {
|
|
91
|
+
text: "This is your text block. Click to edit and make it your own. Share your product's story<br/>\
|
|
92
|
+
or services offered. Get creative and make it yours!"
|
|
93
|
+
},
|
|
94
|
+
styles: {
|
|
95
|
+
textAlign: {
|
|
96
|
+
desktop: 'center'
|
|
97
|
+
},
|
|
98
|
+
typo: {
|
|
99
|
+
attrs: {
|
|
100
|
+
color: '#FFFFFF'
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
advanced: {
|
|
105
|
+
'spacing-setting': {
|
|
106
|
+
desktop: {
|
|
107
|
+
margin: {
|
|
108
|
+
bottom: 'var(--g-s-l)'
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
tag: 'Button',
|
|
116
|
+
settings: {
|
|
117
|
+
label: 'Get started'
|
|
118
|
+
},
|
|
119
|
+
styles: {
|
|
120
|
+
align: {
|
|
121
|
+
desktop: 'center'
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export { heroBannerVideoPreSalesPage };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { splitStyle, convertHTML } from '@gem-sdk/core';
|
|
2
|
-
import { getDynamicSourceLocales } from '../../../helpers.js';
|
|
2
|
+
import { isLinkedToSalesPage, getDynamicSourceLocales } from '../../../helpers.js';
|
|
3
3
|
import Link from '../../../link/components/Link.js';
|
|
4
4
|
|
|
5
5
|
const getCleanedStyles = (styles, disabled)=>{
|
|
@@ -86,7 +86,7 @@ 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 shouldRenderLink = enableBtnLink ? isDomain || isShopifyDomain || isLink() || isHomePageHref : false;
|
|
89
|
+
const shouldRenderLink = enableBtnLink ? isDomain || isShopifyDomain || isLink() || isHomePageHref || isLinkedToSalesPage(setting?.type) : false;
|
|
90
90
|
let transformedUrl = urlHref;
|
|
91
91
|
if (isLiquid && (isShopifyDomain || isHomePageHref)) {
|
|
92
92
|
transformedUrl = setting?.isTranslate ? '$locationOrigin' + urlHref : "{{ request.origin }}{{ routes.root_url | split: '/' | join: '/' }}" + urlHref;
|
|
@@ -86,6 +86,88 @@ const config = {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'button-pre-sales-page',
|
|
92
|
+
name: {
|
|
93
|
+
en: 'Button'
|
|
94
|
+
},
|
|
95
|
+
icon: {
|
|
96
|
+
desktop: `
|
|
97
|
+
<svg width="96" height="48" viewBox="0 0 96 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
98
|
+
<rect width="96" height="48" rx="3" fill="#424242"/>
|
|
99
|
+
<rect x="21.5" y="20" width="53" height="8" rx="4" fill="#757575"/>
|
|
100
|
+
</svg>
|
|
101
|
+
`
|
|
102
|
+
},
|
|
103
|
+
components: [
|
|
104
|
+
{
|
|
105
|
+
tag: 'Button',
|
|
106
|
+
advanced: {
|
|
107
|
+
'spacing-setting': {
|
|
108
|
+
desktop: {
|
|
109
|
+
margin: {
|
|
110
|
+
bottom: 'var(--g-s-l)'
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
editorData: {
|
|
115
|
+
cssPlaceholder: 'button.{{rootClassName}} {\n\n}'
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
settings: {
|
|
119
|
+
btnLink: {
|
|
120
|
+
type: 'go-to-sales-page',
|
|
121
|
+
link: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
122
|
+
target: '_self'
|
|
123
|
+
},
|
|
124
|
+
enableBtnLink: true
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: 'button-icon-pre-sales-page',
|
|
131
|
+
name: {
|
|
132
|
+
en: 'Button'
|
|
133
|
+
},
|
|
134
|
+
icon: {
|
|
135
|
+
desktop: `
|
|
136
|
+
<svg width="96" height="48" viewBox="0 0 96 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
137
|
+
<rect width="96" height="48" rx="3" fill="#424242"/>
|
|
138
|
+
<path d="M23.6415 17.8126C23.7882 17.5153 24.2121 17.5153 24.3589 17.8126L26.1255 21.3922C26.1838 21.5102 26.2964 21.5921 26.4267 21.611L30.377 22.185C30.7051 22.2327 30.8361 22.6359 30.5987 22.8673L27.7402 25.6536C27.6459 25.7455 27.6029 25.8779 27.6252 26.0077L28.3 29.9421C28.356 30.2688 28.0131 30.518 27.7196 30.3638L24.1863 28.5062C24.0698 28.4449 23.9306 28.4449 23.814 28.5062L20.2807 30.3637C19.9873 30.518 19.6443 30.2688 19.7004 29.9421L20.3752 26.0077C20.3974 25.8779 20.3544 25.7455 20.2601 25.6536L17.4016 22.8673C17.1642 22.6359 17.2952 22.2327 17.6233 22.185L21.5737 21.611C21.7039 21.5921 21.8166 21.5102 21.8748 21.3922L23.6415 17.8126Z" fill="#F9F9F9"/>
|
|
139
|
+
<rect x="40" y="20" width="40" height="8" rx="4" fill="#757575"/>
|
|
140
|
+
</svg>
|
|
141
|
+
`
|
|
142
|
+
},
|
|
143
|
+
components: [
|
|
144
|
+
{
|
|
145
|
+
tag: 'Button',
|
|
146
|
+
settings: {
|
|
147
|
+
iconVisible: true,
|
|
148
|
+
iconAlign: 'left',
|
|
149
|
+
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
|
+
btnLink: {
|
|
151
|
+
type: 'go-to-sales-page',
|
|
152
|
+
link: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
153
|
+
target: '_self'
|
|
154
|
+
},
|
|
155
|
+
enableBtnLink: true
|
|
156
|
+
},
|
|
157
|
+
advanced: {
|
|
158
|
+
'spacing-setting': {
|
|
159
|
+
desktop: {
|
|
160
|
+
margin: {
|
|
161
|
+
bottom: 0
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
editorData: {
|
|
166
|
+
cssPlaceholder: 'button.{{rootClassName}} {\n\n}'
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
]
|
|
89
171
|
}
|
|
90
172
|
],
|
|
91
173
|
rootOverride: {
|
|
@@ -71,7 +71,7 @@ const carouselNavigationSettings = {
|
|
|
71
71
|
en: 'Padding'
|
|
72
72
|
},
|
|
73
73
|
controlConfig: {
|
|
74
|
-
id: 'padding',
|
|
74
|
+
id: 'arrow-button-padding',
|
|
75
75
|
type: 'padding-v2',
|
|
76
76
|
linkWithSetting: {
|
|
77
77
|
name: 'arrowButtonSize',
|
|
@@ -260,18 +260,18 @@ const carouselEffectsSettings = {
|
|
|
260
260
|
setting: {
|
|
261
261
|
id: 'loop'
|
|
262
262
|
}
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
label: {
|
|
266
|
+
en: 'Drag / swipe'
|
|
267
|
+
},
|
|
268
|
+
setting: {
|
|
269
|
+
id: 'enableDrag'
|
|
270
|
+
}
|
|
263
271
|
}
|
|
264
272
|
],
|
|
265
273
|
moreSettings: {
|
|
266
274
|
controls: [
|
|
267
|
-
{
|
|
268
|
-
label: {
|
|
269
|
-
en: 'Drag / swipe'
|
|
270
|
-
},
|
|
271
|
-
setting: {
|
|
272
|
-
id: 'enableDrag'
|
|
273
|
-
}
|
|
274
|
-
},
|
|
275
275
|
{
|
|
276
276
|
label: {
|
|
277
277
|
en: 'Slide speed'
|
package/dist/esm/helpers.js
CHANGED
|
@@ -113,6 +113,9 @@ const getInsertLinkData = (defaultWrap, setting, htmlType)=>{
|
|
|
113
113
|
shouldRenderLink
|
|
114
114
|
};
|
|
115
115
|
};
|
|
116
|
+
const isLinkedToSalesPage = (type)=>{
|
|
117
|
+
return type === 'go-to-sales-page';
|
|
118
|
+
};
|
|
116
119
|
const getLinkData = ({ setting, htmlType, defaultWrap, isLiquid = false, enableImageLink = false })=>{
|
|
117
120
|
const URL_INCLUDES = [
|
|
118
121
|
'product.url'
|
|
@@ -134,7 +137,7 @@ const getLinkData = ({ setting, htmlType, defaultWrap, isLiquid = false, enableI
|
|
|
134
137
|
if (URL_START_WITH.find((el)=>urlHref.startsWith(el))) return true;
|
|
135
138
|
return false;
|
|
136
139
|
};
|
|
137
|
-
const shouldRenderLink = enableImageLink && (isDomain || isShopifyDomain || isLink() || isHomePageHref);
|
|
140
|
+
const shouldRenderLink = enableImageLink && (isDomain || isShopifyDomain || isLink() || isHomePageHref || isLinkedToSalesPage(setting?.type));
|
|
138
141
|
let transformedUrl = urlHref;
|
|
139
142
|
if (isLiquid && (isShopifyDomain || isHomePageHref)) {
|
|
140
143
|
transformedUrl = setting?.isTranslate ? '$locationOrigin' + urlHref : "{{ request.origin }}{{ routes.root_url | split: '/' | join: '/' }}" + urlHref;
|
|
@@ -210,4 +213,4 @@ const convertUnitToNumber = (value, defaultValue)=>{
|
|
|
210
213
|
return !isNaN(Number(data)) ? Number(data) : defaultValue;
|
|
211
214
|
};
|
|
212
215
|
|
|
213
|
-
export { convertUnitToNumber, filterTruthyObject, filterTruthyStyles, getDisplayStyle, getDynamicSourceLocales, getInsertLinkData, getLinkArticle, getLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isTransparentColor, isTransparentRGBA, replaceLinkData, youtubeShortsRegex };
|
|
216
|
+
export { convertUnitToNumber, filterTruthyObject, filterTruthyStyles, getDisplayStyle, getDynamicSourceLocales, getInsertLinkData, getLinkArticle, getLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isLinkedToSalesPage, isTransparentColor, isTransparentRGBA, replaceLinkData, youtubeShortsRegex };
|
|
@@ -151,6 +151,171 @@ const ImagePreset = [
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: 'image-pre-sales-page',
|
|
157
|
+
name: {
|
|
158
|
+
en: 'Image'
|
|
159
|
+
},
|
|
160
|
+
icon: {
|
|
161
|
+
desktop: `
|
|
162
|
+
<svg width="96" height="48" viewBox="0 0 96 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
163
|
+
<rect width="96" height="48" rx="3" fill="#424242"/>
|
|
164
|
+
<circle cx="37" cy="17" r="3" fill="#D6D6D6"/>
|
|
165
|
+
<path d="M32.42 30.9518L37.1407 25.1338C37.3005 24.9364 37.498 24.7768 37.7203 24.6653C37.9427 24.5538 38.1848 24.4929 38.431 24.4866C38.6772 24.4803 38.9218 24.5287 39.149 24.6287C39.3762 24.7288 39.5809 24.8781 39.7496 25.0671L41.957 27.5361L50.5857 16.6629C50.7546 16.4499 50.967 16.2797 51.2069 16.165C51.4469 16.0503 51.7083 15.9941 51.9718 16.0005C52.2352 16.0069 52.4939 16.0758 52.7285 16.202C52.9632 16.3283 53.1679 16.5086 53.3273 16.7297L63.6435 31.0236C63.8408 31.2976 63.9615 31.6242 63.9922 31.9666C64.0229 32.3089 63.9623 32.6535 63.8173 32.9616C63.6723 33.2697 63.4485 33.529 63.1712 33.7105C62.8939 33.8919 62.5741 33.9883 62.2476 33.9887L33.7537 34C33.4185 33.9999 33.0904 33.8986 32.8082 33.7082C32.526 33.5177 32.3014 33.2461 32.1611 32.9255C32.0208 32.6048 31.9706 32.2485 32.0165 31.8988C32.0624 31.549 32.2024 31.2204 32.42 30.9518Z" fill="#D6D6D6"/>
|
|
166
|
+
</svg>
|
|
167
|
+
`
|
|
168
|
+
},
|
|
169
|
+
components: [
|
|
170
|
+
{
|
|
171
|
+
tag: 'Image',
|
|
172
|
+
advanced: {
|
|
173
|
+
'spacing-setting': {
|
|
174
|
+
desktop: {
|
|
175
|
+
margin: {
|
|
176
|
+
bottom: 'var(--g-s-l)'
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
editorData: {
|
|
181
|
+
cssPlaceholder: '.{{rootClassName}} {\n\n}\n.{{rootClassName}} > figure > img {\n\n}'
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
settings: {
|
|
185
|
+
imageLink: {
|
|
186
|
+
type: 'go-to-sales-page',
|
|
187
|
+
link: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
188
|
+
target: '_self'
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
flowTagComponents: {
|
|
194
|
+
Marquee: [
|
|
195
|
+
{
|
|
196
|
+
tag: 'Image',
|
|
197
|
+
styles: {
|
|
198
|
+
shape: {
|
|
199
|
+
desktop: {
|
|
200
|
+
width: 'auto',
|
|
201
|
+
height: 'auto'
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
enableBorder: 'none'
|
|
205
|
+
},
|
|
206
|
+
advanced: {
|
|
207
|
+
'spacing-setting': {
|
|
208
|
+
desktop: {
|
|
209
|
+
margin: {
|
|
210
|
+
bottom: 'var(--g-s-l)'
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
editorData: {
|
|
215
|
+
rootClassName: '{{rootClassName}}',
|
|
216
|
+
css: '.{{rootClassName}} {\n\n}\n.{{rootClassName}} > figure > img {\n\n}'
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
settings: {
|
|
220
|
+
isNotLazyload: true
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
id: 'image-circle-pre-sales-page',
|
|
228
|
+
name: {
|
|
229
|
+
en: 'Image'
|
|
230
|
+
},
|
|
231
|
+
icon: {
|
|
232
|
+
desktop: `
|
|
233
|
+
<svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
234
|
+
<rect x="2" y="2" width="52" height="52" rx="26" fill="#424242"/>
|
|
235
|
+
<ellipse cx="20.4375" cy="22.9688" rx="2.0625" ry="1.96875" fill="#F9F9F9"/>
|
|
236
|
+
<path d="M17.2887 32.9997L20.5342 29.1816C20.6441 29.052 20.7799 28.9473 20.9327 28.8741C21.0856 28.8009 21.2521 28.761 21.4213 28.7568C21.5905 28.7527 21.7587 28.7845 21.915 28.8501C22.0712 28.9158 22.2118 29.0138 22.3278 29.1378L23.8454 30.758L29.7777 23.6225C29.8938 23.4827 30.0398 23.371 30.2048 23.2958C30.3697 23.2205 30.5495 23.1836 30.7306 23.1878C30.9117 23.192 31.0895 23.2372 31.2509 23.3201C31.4122 23.4029 31.5529 23.5213 31.6625 23.6663L38.7549 33.0467C38.8905 33.2266 38.9735 33.4409 38.9947 33.6656C39.0158 33.8902 38.9741 34.1164 38.8744 34.3186C38.7747 34.5207 38.6209 34.6909 38.4302 34.81C38.2396 34.9291 38.0197 34.9923 37.7952 34.9926L18.2057 35C17.9753 34.9999 17.7497 34.9334 17.5557 34.8085C17.3616 34.6835 17.2072 34.5053 17.1108 34.2948C17.0143 34.0844 16.9798 33.8506 17.0113 33.6211C17.0429 33.3915 17.1391 33.1759 17.2887 32.9997Z" fill="#F9F9F9"/>
|
|
237
|
+
</svg>
|
|
238
|
+
`
|
|
239
|
+
},
|
|
240
|
+
components: [
|
|
241
|
+
{
|
|
242
|
+
tag: 'Image',
|
|
243
|
+
settings: {
|
|
244
|
+
imageStyle: 'circle',
|
|
245
|
+
imageLink: {
|
|
246
|
+
type: 'go-to-sales-page',
|
|
247
|
+
link: '{{ page.metafields.sales_funnel.sales_page_url }}',
|
|
248
|
+
target: '_self'
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
styles: {
|
|
252
|
+
shape: {
|
|
253
|
+
desktop: {
|
|
254
|
+
shape: 'square',
|
|
255
|
+
shapeValue: '1/1',
|
|
256
|
+
width: '80px',
|
|
257
|
+
shapeLinked: true
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
borderRadius: {
|
|
261
|
+
btrr: '999999px',
|
|
262
|
+
bblr: '999999px',
|
|
263
|
+
bbrr: '999999px',
|
|
264
|
+
btlr: '999999px',
|
|
265
|
+
radiusType: 'custom'
|
|
266
|
+
},
|
|
267
|
+
wrapperBorder: {
|
|
268
|
+
borderType: 'none',
|
|
269
|
+
border: 'none',
|
|
270
|
+
width: '1px 1px 1px 1px',
|
|
271
|
+
position: 'all',
|
|
272
|
+
borderWidth: '1px',
|
|
273
|
+
color: '#000000',
|
|
274
|
+
isCustom: true
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
advanced: {
|
|
278
|
+
'spacing-setting': {
|
|
279
|
+
desktop: {
|
|
280
|
+
margin: {
|
|
281
|
+
bottom: 'var(--g-s-l)'
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
editorData: {
|
|
286
|
+
cssplaceholder: '.{{rootClassName}} {\n\n}\n.{{rootClassName}} > figure > img {\n\n}'
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
],
|
|
291
|
+
rootOverride: {
|
|
292
|
+
styles: {
|
|
293
|
+
shape: {
|
|
294
|
+
desktop: {
|
|
295
|
+
shape: 'square',
|
|
296
|
+
shapeValue: '1/1',
|
|
297
|
+
width: '80px',
|
|
298
|
+
shapeLinked: true
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
borderRadius: {
|
|
302
|
+
btrr: '999999px',
|
|
303
|
+
bblr: '999999px',
|
|
304
|
+
bbrr: '999999px',
|
|
305
|
+
btlr: '999999px',
|
|
306
|
+
radiusType: 'custom'
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
advanced: {
|
|
310
|
+
'spacing-setting': {
|
|
311
|
+
desktop: {
|
|
312
|
+
margin: {
|
|
313
|
+
bottom: 0
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
154
319
|
}
|
|
155
320
|
];
|
|
156
321
|
|
package/dist/esm/index.js
CHANGED
|
@@ -63,7 +63,7 @@ import 'react/jsx-runtime';
|
|
|
63
63
|
import 'react';
|
|
64
64
|
import '@gem-sdk/core';
|
|
65
65
|
export { ELEMENT_Z_INDEX } from './common/const.js';
|
|
66
|
-
export { convertUnitToNumber, filterTruthyObject, filterTruthyStyles, getDisplayStyle, getDynamicSourceLocales, getInsertLinkData, getLinkArticle, getLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isTransparentColor, isTransparentRGBA, replaceLinkData, youtubeShortsRegex } from './helpers.js';
|
|
66
|
+
export { convertUnitToNumber, filterTruthyObject, filterTruthyStyles, getDisplayStyle, getDynamicSourceLocales, getInsertLinkData, getLinkArticle, getLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isLinkedToSalesPage, isTransparentColor, isTransparentRGBA, replaceLinkData, youtubeShortsRegex } from './helpers.js';
|
|
67
67
|
export { default as Accordion } from './accordion/components/Accordion.js';
|
|
68
68
|
export { default as AccordionItem } from './accordion/components/AccordionItem.js';
|
|
69
69
|
export { default as ArticleList } from './article/components/ArticleList.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { setDefaultWhenUndefineSetting, getAspectRatio } from './common/common.js';
|
|
4
|
-
import { useProductShopifyEditLink, useProduct, useCurrentDevice, useCurrentVariant, useEditorMode, useProductStore, getResponsiveValueByScreen, filterToolbarPreview } from '@gem-sdk/core';
|
|
4
|
+
import { useProductShopifyEditLink, useProduct, useCurrentDevice, useCurrentVariant, useSelectedOption, useEditorMode, useProductStore, getResponsiveValueByScreen, filterToolbarPreview } from '@gem-sdk/core';
|
|
5
5
|
import { useMemo, useState, useEffect, Children, isValidElement } from 'react';
|
|
6
6
|
import FeatureImageWithGallery from './components/feature-gallery/FeatureImageWithGallery.js';
|
|
7
7
|
import OnlyFeatureImage from './components/feature-only/OnlyFeatureImage.js';
|
|
@@ -36,11 +36,11 @@ const ProductImagesV2 = (props)=>{
|
|
|
36
36
|
const product = useProduct();
|
|
37
37
|
const currentDevice = useCurrentDevice();
|
|
38
38
|
const currentVariant = useCurrentVariant();
|
|
39
|
+
const { isChangeSelectedOption } = useSelectedOption();
|
|
39
40
|
const mode = useEditorMode();
|
|
40
41
|
const setProductFeaturedImage = useProductStore((s)=>s.setProductFeaturedImage);
|
|
41
42
|
// State
|
|
42
43
|
const [openLightBox, setOpenLightBox] = useState(false);
|
|
43
|
-
const [hasVariantAvailable, setHasVariantAvailable] = useState(true);
|
|
44
44
|
const getFirstVideo = (product)=>{
|
|
45
45
|
return product?.medias?.edges.find((item)=>[
|
|
46
46
|
'VIDEO',
|
|
@@ -53,36 +53,35 @@ const ProductImagesV2 = (props)=>{
|
|
|
53
53
|
const getFirst3DModal = (product)=>{
|
|
54
54
|
return product?.medias?.edges.find((item)=>item?.node?.contentType === 'MODEL_3D')?.node;
|
|
55
55
|
};
|
|
56
|
+
const isFirstActiveFeatureImage = useMemo(()=>setting?.typeDisplay === 'all-images' && !isChangeSelectedOption, [
|
|
57
|
+
isChangeSelectedOption,
|
|
58
|
+
setting?.typeDisplay
|
|
59
|
+
]);
|
|
56
60
|
const priorityFeatureImage = useMemo(()=>{
|
|
57
|
-
if (
|
|
58
|
-
setHasVariantAvailable(true);
|
|
61
|
+
if (isFirstActiveFeatureImage) {
|
|
59
62
|
let priorityItem;
|
|
60
63
|
switch(setting?.preDisplay){
|
|
61
64
|
case '1st-images':
|
|
62
65
|
priorityItem = getFirstImage(product);
|
|
63
|
-
setHasVariantAvailable(false);
|
|
64
66
|
break;
|
|
65
67
|
case '1st-3d-mode':
|
|
66
68
|
priorityItem = getFirst3DModal(product);
|
|
67
|
-
setHasVariantAvailable(false);
|
|
68
69
|
break;
|
|
69
70
|
case '1st-video':
|
|
70
71
|
priorityItem = getFirstVideo(product);
|
|
71
|
-
setHasVariantAvailable(false);
|
|
72
72
|
break;
|
|
73
73
|
case '1st-available-variant':
|
|
74
74
|
priorityItem = currentVariant?.media;
|
|
75
|
-
setHasVariantAvailable(false);
|
|
76
75
|
break;
|
|
77
76
|
}
|
|
78
77
|
setProductFeaturedImage(priorityItem);
|
|
79
78
|
return priorityItem;
|
|
80
79
|
}
|
|
81
80
|
}, [
|
|
82
|
-
|
|
81
|
+
isFirstActiveFeatureImage,
|
|
83
82
|
setting?.preDisplay,
|
|
84
|
-
product,
|
|
85
83
|
setProductFeaturedImage,
|
|
84
|
+
product,
|
|
86
85
|
currentVariant?.media
|
|
87
86
|
]);
|
|
88
87
|
const gallery = useMemo(()=>{
|
|
@@ -136,7 +135,7 @@ const ProductImagesV2 = (props)=>{
|
|
|
136
135
|
}
|
|
137
136
|
};
|
|
138
137
|
useEffect(()=>{
|
|
139
|
-
if (currentVariant &&
|
|
138
|
+
if (currentVariant && !isFirstActiveFeatureImage) {
|
|
140
139
|
const index = galleryIndex[currentVariant?.mediaId];
|
|
141
140
|
if (index !== undefined) {
|
|
142
141
|
const fImage = gallery[index] ?? product?.featuredImage;
|
|
@@ -151,7 +150,7 @@ const ProductImagesV2 = (props)=>{
|
|
|
151
150
|
gallery,
|
|
152
151
|
product?.featuredImage,
|
|
153
152
|
setProductFeaturedImage,
|
|
154
|
-
|
|
153
|
+
isFirstActiveFeatureImage
|
|
155
154
|
]);
|
|
156
155
|
const isRenderLightBox = useMemo(()=>{
|
|
157
156
|
const isRender = getResponsiveValueByScreen(setting?.ftClickOpenLightBox, currentDevice) === 'popup' || getResponsiveValueByScreen(setting?.clickOpenLightBox, currentDevice);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createClass } from '@gem-sdk/system';
|
|
2
2
|
|
|
3
3
|
const getClass = (props)=>{
|
|
4
|
-
const { setting, className, builderProps, advanced } = props;
|
|
4
|
+
const { setting, className, builderProps, advanced, styles } = props;
|
|
5
5
|
const gridLayoutClass = createClass({
|
|
6
6
|
...className && {
|
|
7
7
|
[className]: true
|
|
@@ -16,7 +16,7 @@ const getClass = (props)=>{
|
|
|
16
16
|
'gp-relative gp-flex': true
|
|
17
17
|
});
|
|
18
18
|
const gpProductClass = createClass({
|
|
19
|
-
'gp-contents': setting?.sameHeight
|
|
19
|
+
'gp-contents': setting?.sameHeight && styles?.layout === 'grid'
|
|
20
20
|
});
|
|
21
21
|
const carouselClass = createClass({
|
|
22
22
|
'gp-justify-center': true,
|
|
@@ -203,25 +203,6 @@ const ProductImageSettingsV2 = [
|
|
|
203
203
|
type: 'p-image-layout',
|
|
204
204
|
iconName: 'gp-product-image-layout-right'
|
|
205
205
|
},
|
|
206
|
-
{
|
|
207
|
-
label: 'Featured only',
|
|
208
|
-
value: 'only-feature',
|
|
209
|
-
type: 'p-image-layout',
|
|
210
|
-
iconName: 'gp-product-image-layout-featured-only'
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
label: 'Image list 2 col',
|
|
214
|
-
value: 'two-col',
|
|
215
|
-
type: 'p-image-layout',
|
|
216
|
-
iconName: 'gp-product-image-layout-two-col'
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
label: 'Image list 1 col',
|
|
220
|
-
value: 'one-col',
|
|
221
|
-
type: 'p-image-layout',
|
|
222
|
-
iconName: 'gp-product-image-layout-one-col',
|
|
223
|
-
noPadding: 'y'
|
|
224
|
-
},
|
|
225
206
|
{
|
|
226
207
|
label: 'Image list inside bottom',
|
|
227
208
|
value: 'inside-bottom',
|
|
@@ -239,6 +220,25 @@ const ProductImageSettingsV2 = [
|
|
|
239
220
|
value: 'inside-right',
|
|
240
221
|
type: 'p-image-layout',
|
|
241
222
|
iconName: 'gp-product-image-layout-right-inside'
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
label: 'Featured only',
|
|
226
|
+
value: 'only-feature',
|
|
227
|
+
type: 'p-image-layout',
|
|
228
|
+
iconName: 'gp-product-image-layout-featured-only'
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
label: 'Image list 1 col',
|
|
232
|
+
value: 'one-col',
|
|
233
|
+
type: 'p-image-layout',
|
|
234
|
+
iconName: 'gp-product-image-layout-one-col',
|
|
235
|
+
noPadding: 'y'
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
label: 'Image list 2 col',
|
|
239
|
+
value: 'two-col',
|
|
240
|
+
type: 'p-image-layout',
|
|
241
|
+
iconName: 'gp-product-image-layout-two-col'
|
|
242
242
|
}
|
|
243
243
|
],
|
|
244
244
|
devices: {
|
|
@@ -421,13 +421,13 @@ const SettingUIV2 = [
|
|
|
421
421
|
},
|
|
422
422
|
{
|
|
423
423
|
label: {
|
|
424
|
-
en: '
|
|
424
|
+
en: 'Display condition'
|
|
425
425
|
},
|
|
426
426
|
conditionDisplay: '["bottom-center", "left", "right", "only-feature", "inside-bottom", "inside-left", "inside-right"].includes(position)',
|
|
427
427
|
controls: [
|
|
428
428
|
{
|
|
429
429
|
label: {
|
|
430
|
-
en: '
|
|
430
|
+
en: 'Default item'
|
|
431
431
|
},
|
|
432
432
|
setting: {
|
|
433
433
|
id: 'preDisplay'
|