@gem-sdk/components 2.0.0-dev.353 → 2.0.0-dev.356
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/ArticleAuthor.liquid.js +27 -0
- package/dist/cjs/article/components/ArticleCategory.liquid.js +27 -0
- package/dist/cjs/article/components/ArticleContent.liquid.js +42 -0
- package/dist/cjs/article/components/ArticleDate.liquid.js +35 -0
- package/dist/cjs/article/components/ArticleExcerpt.liquid.js +26 -0
- package/dist/cjs/article/components/ArticleImage.liquid.js +67 -0
- package/dist/cjs/article/components/ArticlePagination.liquid.js +17 -0
- package/dist/cjs/article/components/ArticleReadMore.liquid.js +58 -0
- package/dist/cjs/article/components/ArticleTag.liquid.js +27 -0
- package/dist/cjs/article/components/ArticleTitle.liquid.js +46 -0
- package/dist/cjs/builder.js +1 -1
- package/dist/cjs/button/components/Button.js +5 -3
- package/dist/cjs/button/components/Button.liquid.js +7 -3
- package/dist/cjs/button/components/common/attributes.js +1 -2
- package/dist/cjs/button/components/common/helpers.js +2 -2
- package/dist/cjs/button/components/common/styles.js +29 -1
- package/dist/cjs/button/setting/configs/settings.js +24 -4
- package/dist/cjs/button/setting/configs/uiV2.js +46 -8
- package/dist/cjs/form/setting/newsletter/configs/settings.js +2 -2
- package/dist/cjs/form/setting/newsletter/configs/uiV2.js +0 -44
- package/dist/cjs/image/setting/configs/uiV2.js +5 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.liquid.js +20 -0
- package/dist/cjs/post-purchase/callout-banner/setting/config/callout-text/setting.js +4 -3
- package/dist/cjs/post-purchase/image/common/getClasses.js +1 -4
- package/dist/cjs/post-purchase/product/common/getClasses.js +4 -5
- package/dist/cjs/post-purchase/product/components/product-image/carousel-post-purchase/CarouselPostPurchase.js +3 -2
- package/dist/cjs/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +2 -1
- package/dist/cjs/post-purchase/product/components/product-offer/common/attrs.js +14 -0
- package/dist/cjs/post-purchase/product/components/product-offer/common/classes.js +29 -0
- package/dist/cjs/post-purchase/product/components/product-offer/common/styles.js +27 -0
- package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOffer.js +53 -0
- package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOfferItem.js +45 -0
- package/dist/cjs/post-purchase/product/components/product-offer/hooks/useProductOfferData.js +57 -0
- package/dist/cjs/post-purchase/product/hooks/product-image/useListCarousel.js +6 -2
- package/dist/cjs/post-purchase/product/index.js +2 -2
- package/dist/cjs/post-purchase/product/next.js +1 -1
- package/dist/cjs/post-purchase/product/settings/product-image/setting-v2.js +5 -5
- package/dist/cjs/post-purchase/product/settings/product-image/uiV2.js +2 -1
- package/dist/cjs/post-purchase/product/settings/{ProductOffer.js → product-offer/index.js} +23 -143
- package/dist/cjs/post-purchase/product/settings/product-offer/ui/uiV1.js +140 -0
- package/dist/cjs/post-purchase/product/settings/product-offer/ui/uiV2.js +141 -0
- package/dist/cjs/post-purchase/utils/constants.js +6 -0
- package/dist/cjs/product/components/ProductViewMore/ProductViewMore.js +17 -18
- package/dist/cjs/product/components/ProductViewMore/ProductViewMore.liquid.js +14 -21
- package/dist/cjs/product/components/ProductViewMore/common/data.js +26 -0
- package/dist/cjs/product/components/ProductViewMore/common/styles.js +12 -0
- package/dist/cjs/product/setting/dynamic-checkout/configs/settings.js +9 -5
- package/dist/cjs/product/setting/dynamic-checkout/configs/uiV2.js +10 -10
- package/dist/cjs/product/setting/product-button/configs/settings.js +1 -0
- package/dist/cjs/product/setting/product-button/configs/uiV2.js +1 -1
- package/dist/cjs/product/setting/product-view-more/configs/settings.js +17 -16
- package/dist/cjs/product/setting/product-view-more/configs/uiV2.js +45 -45
- package/dist/esm/article/components/ArticleAuthor.liquid.js +23 -0
- package/dist/esm/article/components/ArticleCategory.liquid.js +23 -0
- package/dist/esm/article/components/ArticleContent.liquid.js +38 -0
- package/dist/esm/article/components/ArticleDate.liquid.js +31 -0
- package/dist/esm/article/components/ArticleExcerpt.liquid.js +22 -0
- package/dist/esm/article/components/ArticleImage.liquid.js +63 -0
- package/dist/esm/article/components/ArticlePagination.liquid.js +13 -0
- package/dist/esm/article/components/ArticleReadMore.liquid.js +54 -0
- package/dist/esm/article/components/ArticleTag.liquid.js +23 -0
- package/dist/esm/article/components/ArticleTitle.liquid.js +42 -0
- package/dist/esm/builder.js +1 -1
- package/dist/esm/button/components/Button.js +5 -3
- package/dist/esm/button/components/Button.liquid.js +7 -3
- package/dist/esm/button/components/common/attributes.js +1 -2
- package/dist/esm/button/components/common/helpers.js +2 -2
- package/dist/esm/button/components/common/styles.js +29 -3
- package/dist/esm/button/setting/configs/settings.js +24 -4
- package/dist/esm/button/setting/configs/uiV2.js +46 -8
- package/dist/esm/form/setting/newsletter/configs/settings.js +2 -2
- package/dist/esm/form/setting/newsletter/configs/uiV2.js +0 -44
- package/dist/esm/image/setting/configs/uiV2.js +5 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.liquid.js +10 -0
- package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/setting.js +4 -3
- package/dist/esm/post-purchase/image/common/getClasses.js +1 -4
- package/dist/esm/post-purchase/product/common/getClasses.js +4 -5
- package/dist/esm/post-purchase/product/components/product-image/carousel-post-purchase/CarouselPostPurchase.js +3 -2
- package/dist/esm/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +2 -1
- package/dist/esm/post-purchase/product/components/product-offer/common/attrs.js +12 -0
- package/dist/esm/post-purchase/product/components/product-offer/common/classes.js +25 -0
- package/dist/esm/post-purchase/product/components/product-offer/common/styles.js +24 -0
- package/dist/esm/post-purchase/product/components/product-offer/components/ProductOffer.js +49 -0
- package/dist/esm/post-purchase/product/components/product-offer/components/ProductOfferItem.js +43 -0
- package/dist/esm/post-purchase/product/components/product-offer/hooks/useProductOfferData.js +55 -0
- package/dist/esm/post-purchase/product/hooks/product-image/useListCarousel.js +6 -2
- package/dist/esm/post-purchase/product/index.js +1 -1
- package/dist/esm/post-purchase/product/next.js +1 -1
- package/dist/esm/post-purchase/product/settings/product-image/setting-v2.js +5 -5
- package/dist/esm/post-purchase/product/settings/product-image/uiV2.js +2 -1
- package/dist/esm/post-purchase/product/settings/{ProductOffer.js → product-offer/index.js} +23 -143
- package/dist/esm/post-purchase/product/settings/product-offer/ui/uiV1.js +138 -0
- package/dist/esm/post-purchase/product/settings/product-offer/ui/uiV2.js +139 -0
- package/dist/esm/post-purchase/utils/constants.js +6 -1
- package/dist/esm/product/components/ProductViewMore/ProductViewMore.js +17 -18
- package/dist/esm/product/components/ProductViewMore/ProductViewMore.liquid.js +14 -21
- package/dist/esm/product/components/ProductViewMore/common/data.js +23 -0
- package/dist/esm/product/components/ProductViewMore/common/styles.js +10 -0
- package/dist/esm/product/setting/dynamic-checkout/configs/settings.js +9 -5
- package/dist/esm/product/setting/dynamic-checkout/configs/uiV2.js +10 -10
- package/dist/esm/product/setting/product-button/configs/settings.js +1 -0
- package/dist/esm/product/setting/product-button/configs/uiV2.js +1 -1
- package/dist/esm/product/setting/product-view-more/configs/settings.js +17 -16
- package/dist/esm/product/setting/product-view-more/configs/uiV2.js +45 -45
- package/dist/types/index.d.ts +82 -18
- package/package.json +2 -2
- package/dist/cjs/post-purchase/product/components/ProductOffer.js +0 -138
- package/dist/esm/post-purchase/product/components/ProductOffer.js +0 -133
|
@@ -110,6 +110,15 @@ const SettingUIV2 = [
|
|
|
110
110
|
id: 'backgroundColorV2',
|
|
111
111
|
state: 'normal'
|
|
112
112
|
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
label: {
|
|
116
|
+
en: 'Image'
|
|
117
|
+
},
|
|
118
|
+
setting: {
|
|
119
|
+
id: 'backgroundImage',
|
|
120
|
+
state: 'normal'
|
|
121
|
+
}
|
|
113
122
|
}
|
|
114
123
|
]
|
|
115
124
|
},
|
|
@@ -188,7 +197,7 @@ const SettingUIV2 = [
|
|
|
188
197
|
{
|
|
189
198
|
type: 'control',
|
|
190
199
|
label: {
|
|
191
|
-
en: '
|
|
200
|
+
en: 'Gap'
|
|
192
201
|
},
|
|
193
202
|
setting: {
|
|
194
203
|
id: 'iconSpacing'
|
|
@@ -198,10 +207,19 @@ const SettingUIV2 = [
|
|
|
198
207
|
]
|
|
199
208
|
},
|
|
200
209
|
{
|
|
201
|
-
label: {
|
|
202
|
-
en: 'Text style'
|
|
203
|
-
},
|
|
204
210
|
controls: [
|
|
211
|
+
{
|
|
212
|
+
label: {
|
|
213
|
+
en: 'Text'
|
|
214
|
+
},
|
|
215
|
+
setting: {
|
|
216
|
+
id: 'enableTextStyle'
|
|
217
|
+
},
|
|
218
|
+
options: {
|
|
219
|
+
labelVariant: 'primary',
|
|
220
|
+
toggleStyle: 'switch'
|
|
221
|
+
}
|
|
222
|
+
},
|
|
205
223
|
{
|
|
206
224
|
id: 'typo',
|
|
207
225
|
label: {
|
|
@@ -210,6 +228,7 @@ const SettingUIV2 = [
|
|
|
210
228
|
setting: {
|
|
211
229
|
id: 'typo'
|
|
212
230
|
},
|
|
231
|
+
conditionDisplay: 'enableTextStyle == true',
|
|
213
232
|
options: {
|
|
214
233
|
hideLabel: true,
|
|
215
234
|
fullWidth: true,
|
|
@@ -254,6 +273,15 @@ const SettingUIV2 = [
|
|
|
254
273
|
state: 'hover'
|
|
255
274
|
}
|
|
256
275
|
},
|
|
276
|
+
{
|
|
277
|
+
label: {
|
|
278
|
+
en: 'Image'
|
|
279
|
+
},
|
|
280
|
+
setting: {
|
|
281
|
+
id: 'backgroundImage',
|
|
282
|
+
state: 'hover'
|
|
283
|
+
}
|
|
284
|
+
},
|
|
257
285
|
{
|
|
258
286
|
label: {
|
|
259
287
|
en: 'Text color'
|
|
@@ -297,13 +325,23 @@ const SettingUIV2 = [
|
|
|
297
325
|
]
|
|
298
326
|
},
|
|
299
327
|
{
|
|
300
|
-
label: {
|
|
301
|
-
en: 'Link'
|
|
302
|
-
},
|
|
303
328
|
controls: [
|
|
329
|
+
{
|
|
330
|
+
label: {
|
|
331
|
+
en: 'Link'
|
|
332
|
+
},
|
|
333
|
+
setting: {
|
|
334
|
+
id: 'enableBtnLink'
|
|
335
|
+
},
|
|
336
|
+
options: {
|
|
337
|
+
labelVariant: 'primary',
|
|
338
|
+
toggleStyle: 'switch'
|
|
339
|
+
}
|
|
340
|
+
},
|
|
304
341
|
{
|
|
305
342
|
type: 'control',
|
|
306
343
|
layout: 'vertical',
|
|
344
|
+
conditionDisplay: 'enableBtnLink == true',
|
|
307
345
|
setting: {
|
|
308
346
|
id: 'btnLink'
|
|
309
347
|
}
|
|
@@ -323,7 +361,7 @@ const SettingUIV2 = [
|
|
|
323
361
|
options: {
|
|
324
362
|
labelVariant: 'primary',
|
|
325
363
|
fullWidth: true,
|
|
326
|
-
disableMessage: `
|
|
364
|
+
disableMessage: `Horizontal alignment is disabled when the width is set to 100% or greater`
|
|
327
365
|
}
|
|
328
366
|
}
|
|
329
367
|
]
|
|
@@ -90,7 +90,7 @@ const NewsletterSettings = [
|
|
|
90
90
|
desktop: {
|
|
91
91
|
default: {
|
|
92
92
|
type: 'color',
|
|
93
|
-
color: '#
|
|
93
|
+
color: '#E2E2E2',
|
|
94
94
|
image: {
|
|
95
95
|
src: 'https://ucarecdn.com/5e27d43d-eb1e-4e71-b7e1-4158f3071bb6/-/format/auto/',
|
|
96
96
|
width: 1200,
|
|
@@ -121,7 +121,7 @@ const NewsletterSettings = [
|
|
|
121
121
|
hide: true,
|
|
122
122
|
devices: {
|
|
123
123
|
desktop: {
|
|
124
|
-
default: '
|
|
124
|
+
default: '480px'
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
},
|
|
@@ -92,54 +92,10 @@ const SettingUIV2 = [
|
|
|
92
92
|
label: 'Fit content',
|
|
93
93
|
value: 'Auto',
|
|
94
94
|
showValue: true
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
label: 'Full',
|
|
98
|
-
value: '100%',
|
|
99
|
-
showValue: true
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
label: 'Small',
|
|
103
|
-
value: '100px',
|
|
104
|
-
showValue: true
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
label: 'Medium',
|
|
108
|
-
value: '116px',
|
|
109
|
-
showValue: true
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
label: 'Large',
|
|
113
|
-
value: '132px',
|
|
114
|
-
showValue: true
|
|
115
95
|
}
|
|
116
96
|
]
|
|
117
97
|
},
|
|
118
98
|
layout: 'horizontal'
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
label: {
|
|
122
|
-
en: 'Padding'
|
|
123
|
-
},
|
|
124
|
-
controlConfig: {
|
|
125
|
-
id: 'padding',
|
|
126
|
-
type: 'padding-v2',
|
|
127
|
-
linkWithSetting: {
|
|
128
|
-
name: 'globalSize',
|
|
129
|
-
field: 'padding'
|
|
130
|
-
},
|
|
131
|
-
compoDefaultValue: {
|
|
132
|
-
desktop: {
|
|
133
|
-
default: {
|
|
134
|
-
type: 'medium',
|
|
135
|
-
top: '12px',
|
|
136
|
-
bottom: '12px',
|
|
137
|
-
left: '24px',
|
|
138
|
-
right: '24px'
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
99
|
}
|
|
144
100
|
]
|
|
145
101
|
},
|
|
@@ -109,7 +109,7 @@ const SettingUIV2 = [
|
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
111
|
label: {
|
|
112
|
-
en: '
|
|
112
|
+
en: 'Source'
|
|
113
113
|
},
|
|
114
114
|
controls: [
|
|
115
115
|
{
|
|
@@ -285,6 +285,10 @@ const SettingUIV2 = [
|
|
|
285
285
|
label: {
|
|
286
286
|
en: 'Optimize LCP'
|
|
287
287
|
},
|
|
288
|
+
messageConfig: {
|
|
289
|
+
type: 'info',
|
|
290
|
+
message: 'You can optimize image size with our partnered app'
|
|
291
|
+
},
|
|
288
292
|
controls: [
|
|
289
293
|
{
|
|
290
294
|
label: {
|
package/dist/cjs/index.js
CHANGED
|
@@ -162,7 +162,7 @@ var ProductVariant = require('./post-purchase/product/components/product-variant
|
|
|
162
162
|
var AcceptButton = require('./post-purchase/product/components/AcceptButton.js');
|
|
163
163
|
var ProductQuantity = require('./post-purchase/product/components/ProductQuantity.js');
|
|
164
164
|
var ProductPriceBreakdown = require('./post-purchase/product/components/ProductPriceBreakdown.js');
|
|
165
|
-
var ProductOffer = require('./post-purchase/product/components/ProductOffer.js');
|
|
165
|
+
var ProductOffer = require('./post-purchase/product/components/product-offer/components/ProductOffer.js');
|
|
166
166
|
var ProductDiscountTag = require('./post-purchase/product/components/ProductDiscountTag.js');
|
|
167
167
|
var index$F = require('./post-purchase/product/components/product-image/index.js');
|
|
168
168
|
var product1Col = require('./post-purchase/product/settings/presets-config/product-presets/product-1-col.js');
|
package/dist/cjs/index.liquid.js
CHANGED
|
@@ -4,6 +4,16 @@
|
|
|
4
4
|
var Accordion_liquid = require('./accordion/components/Accordion.liquid.js');
|
|
5
5
|
var AccordionItem_liquid = require('./accordion/components/AccordionItem.liquid.js');
|
|
6
6
|
var ArticleList_liquid = require('./article/components/ArticleList.liquid.js');
|
|
7
|
+
var ArticleTitle_liquid = require('./article/components/ArticleTitle.liquid.js');
|
|
8
|
+
var ArticleExcerpt_liquid = require('./article/components/ArticleExcerpt.liquid.js');
|
|
9
|
+
var ArticleContent_liquid = require('./article/components/ArticleContent.liquid.js');
|
|
10
|
+
var ArticleImage_liquid = require('./article/components/ArticleImage.liquid.js');
|
|
11
|
+
var ArticlePagination_liquid = require('./article/components/ArticlePagination.liquid.js');
|
|
12
|
+
var ArticleAuthor_liquid = require('./article/components/ArticleAuthor.liquid.js');
|
|
13
|
+
var ArticleTag_liquid = require('./article/components/ArticleTag.liquid.js');
|
|
14
|
+
var ArticleCategory_liquid = require('./article/components/ArticleCategory.liquid.js');
|
|
15
|
+
var ArticleDate_liquid = require('./article/components/ArticleDate.liquid.js');
|
|
16
|
+
var ArticleReadMore_liquid = require('./article/components/ArticleReadMore.liquid.js');
|
|
7
17
|
var HeroBanner_liquid = require('./banner/components/HeroBanner.liquid.js');
|
|
8
18
|
var Breadcrumb_liquid = require('./breadcrumb/components/Breadcrumb.liquid.js');
|
|
9
19
|
var Button_liquid = require('./button/components/Button.liquid.js');
|
|
@@ -195,6 +205,16 @@ var Sticky_liquid = require('./sticky/components/Sticky.liquid.js');
|
|
|
195
205
|
exports.Accordion = Accordion_liquid.default;
|
|
196
206
|
exports.AccordionItem = AccordionItem_liquid.default;
|
|
197
207
|
exports.ArticleList = ArticleList_liquid.default;
|
|
208
|
+
exports.ArticleTitle = ArticleTitle_liquid.default;
|
|
209
|
+
exports.ArticleExcerpt = ArticleExcerpt_liquid.default;
|
|
210
|
+
exports.ArticleContent = ArticleContent_liquid.default;
|
|
211
|
+
exports.ArticleImage = ArticleImage_liquid.default;
|
|
212
|
+
exports.ArticlePagination = ArticlePagination_liquid.default;
|
|
213
|
+
exports.ArticleAuthor = ArticleAuthor_liquid.default;
|
|
214
|
+
exports.ArticleTag = ArticleTag_liquid.default;
|
|
215
|
+
exports.ArticleCategory = ArticleCategory_liquid.default;
|
|
216
|
+
exports.ArticleDate = ArticleDate_liquid.default;
|
|
217
|
+
exports.ArticleReadMore = ArticleReadMore_liquid.default;
|
|
198
218
|
exports.HeroBanner = HeroBanner_liquid.default;
|
|
199
219
|
exports.Breadcrumb = Breadcrumb_liquid.default;
|
|
200
220
|
exports.Button = Button_liquid.default;
|
|
@@ -93,14 +93,15 @@ const CalloutTextSettings = [
|
|
|
93
93
|
],
|
|
94
94
|
hideUnit: false,
|
|
95
95
|
devices: {
|
|
96
|
+
// Default: 100%
|
|
96
97
|
desktop: {
|
|
97
|
-
default: '
|
|
98
|
+
default: '100%'
|
|
98
99
|
},
|
|
99
100
|
tablet: {
|
|
100
|
-
default: '
|
|
101
|
+
default: '100%'
|
|
101
102
|
},
|
|
102
103
|
mobile: {
|
|
103
|
-
default: '
|
|
104
|
+
default: '100%'
|
|
104
105
|
}
|
|
105
106
|
},
|
|
106
107
|
displayOptions: [
|
|
@@ -15,11 +15,8 @@ const getImageClass = ()=>{
|
|
|
15
15
|
return core.composeClasses(classList);
|
|
16
16
|
};
|
|
17
17
|
const getImageWrapperClass = (settings)=>{
|
|
18
|
-
const classList = 'gp-border';
|
|
19
18
|
return {
|
|
20
|
-
|
|
21
|
-
'gp-border-[#d9d9d9]': settings?.enableBorder !== 'none',
|
|
22
|
-
'gp-border-transparent': settings?.enableBorder === 'none'
|
|
19
|
+
'gp-border-[#d9d9d9] gp-border': settings?.enableBorder !== 'none'
|
|
23
20
|
};
|
|
24
21
|
};
|
|
25
22
|
|
|
@@ -13,11 +13,10 @@ const getNavigationClass = ()=>{
|
|
|
13
13
|
return core.composeClasses('gp-w-[24px] gp-h-[24px] gp-shrink-0 gp-flex gp-items-center gp-justify-center');
|
|
14
14
|
};
|
|
15
15
|
const getItemCarouselPostPurchaseClass = (settings)=>{
|
|
16
|
-
const classList = 'gp-w-full
|
|
16
|
+
const classList = 'gp-w-full';
|
|
17
17
|
return {
|
|
18
18
|
...core.composeClasses(classList),
|
|
19
|
-
'!gp-border-[#d9d9d9]': settings?.border
|
|
20
|
-
'gp-border-transparent': !settings?.border
|
|
19
|
+
'!gp-border-[#d9d9d9] !gp-border': settings?.border
|
|
21
20
|
};
|
|
22
21
|
};
|
|
23
22
|
const getItemCarouseEmptyPostPurchaseClass = ()=>{
|
|
@@ -31,7 +30,7 @@ const getImageGridClass = ()=>{
|
|
|
31
30
|
};
|
|
32
31
|
const getProductImageClass = (settings)=>{
|
|
33
32
|
return {
|
|
34
|
-
...core.composeClasses('gp-flex'),
|
|
33
|
+
...core.composeClasses('gp-flex gp-w-full'),
|
|
35
34
|
[index.getPostPurchaseAlignClasses(settings?.align)]: true
|
|
36
35
|
};
|
|
37
36
|
};
|
|
@@ -42,7 +41,7 @@ const getFeatureImageClass = ()=>{
|
|
|
42
41
|
return core.composeClasses('gp-flex gp-justify-center gp-h-fit gp-w-full');
|
|
43
42
|
};
|
|
44
43
|
const getOnlyFeatureLayoutClass = ()=>{
|
|
45
|
-
return core.composeClasses('gp-flex gp-h-fit gp-max-w-full');
|
|
44
|
+
return core.composeClasses('gp-flex gp-h-fit gp-max-w-full gp-w-full');
|
|
46
45
|
};
|
|
47
46
|
|
|
48
47
|
exports.getContainerClasses = getContainerClasses;
|
|
@@ -9,10 +9,11 @@ require('@gem-sdk/core');
|
|
|
9
9
|
var useListCarousel = require('../../../hooks/product-image/useListCarousel.js');
|
|
10
10
|
|
|
11
11
|
const CarouselPostPurchase = (props)=>{
|
|
12
|
-
const { productImages, itemPerRow, border, aspectRatio, objectFit } = props;
|
|
12
|
+
const { productImages, itemPerRow, border, aspectRatio, objectFit, vertical } = props;
|
|
13
13
|
const { listRender } = useListCarousel.useListCarousel({
|
|
14
14
|
productImages,
|
|
15
|
-
itemPerRow
|
|
15
|
+
itemPerRow,
|
|
16
|
+
vertical
|
|
16
17
|
});
|
|
17
18
|
const itemEmptyClass = system.createClass(getClasses.getItemCarouseEmptyPostPurchaseClass());
|
|
18
19
|
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
@@ -58,7 +58,8 @@ const CarouselWrapperPostPurchase = ({ styles, setting, productImages, objectFit
|
|
|
58
58
|
itemPerRow: itemPerSlide,
|
|
59
59
|
border: border,
|
|
60
60
|
aspectRatio: aspectRatio,
|
|
61
|
-
objectFit: objectFit
|
|
61
|
+
objectFit: objectFit,
|
|
62
|
+
vertical: vertical
|
|
62
63
|
}),
|
|
63
64
|
/*#__PURE__*/ jsxRuntime.jsx(Arrow.ArrowPostPurchase, {
|
|
64
65
|
type: "next",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const getProductOfferAttrs = (product, uid)=>{
|
|
4
|
+
return {
|
|
5
|
+
'data-uid': uid || '',
|
|
6
|
+
'data-component-type': 'component',
|
|
7
|
+
'data-component-tag': 'Product',
|
|
8
|
+
'data-component-label': 'Product',
|
|
9
|
+
'data-component-no-setting': true,
|
|
10
|
+
'data-product-id': product?.baseID?.replace('gid://shopify/Product/', '') || ''
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.getProductOfferAttrs = getProductOfferAttrs;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@gem-sdk/core');
|
|
4
|
+
var constants = require('../../../../utils/constants.js');
|
|
5
|
+
|
|
6
|
+
const getProductOfferContainerClasses = (uid)=>{
|
|
7
|
+
return {
|
|
8
|
+
...core.composeClasses(uid),
|
|
9
|
+
...core.composeClasses('gp-flex gp-w-auto')
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
const getProductOfferWrapperClasses = ()=>{
|
|
13
|
+
return core.composeClasses('gp-grid gp-grid-cols-2');
|
|
14
|
+
};
|
|
15
|
+
const getProductOfferItemClasses = (index, setting, totalProduct)=>{
|
|
16
|
+
const { productOfferLayout } = setting ?? {};
|
|
17
|
+
let className = '';
|
|
18
|
+
constants.DEVICES.map((device)=>{
|
|
19
|
+
const key = device === 'desktop' ? '' : `${device}:`;
|
|
20
|
+
if (productOfferLayout?.[device] === '1col' && index % 3 === 0 || (totalProduct || 0) <= 1) {
|
|
21
|
+
className += ` ${key}gp-col-span-2`;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return core.composeClasses(className);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.getProductOfferContainerClasses = getProductOfferContainerClasses;
|
|
28
|
+
exports.getProductOfferItemClasses = getProductOfferItemClasses;
|
|
29
|
+
exports.getProductOfferWrapperClasses = getProductOfferWrapperClasses;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@gem-sdk/core');
|
|
4
|
+
var helper = require('../../../../utils/helper.js');
|
|
5
|
+
|
|
6
|
+
const getWrapperStyles = (styles)=>{
|
|
7
|
+
const { productOfferColumnGap, productOfferVerticalGutter, productOfferWidth } = styles ?? {};
|
|
8
|
+
return core.filterTruthyStyles({
|
|
9
|
+
...core.makeStyleResponsive('cg', productOfferColumnGap),
|
|
10
|
+
...core.makeStyleResponsive('rg', {
|
|
11
|
+
desktop: helper.postPurchaseViewSpacing[productOfferVerticalGutter || 'base']
|
|
12
|
+
}),
|
|
13
|
+
...core.makeStyleResponsive('w', core.makeWidth(productOfferWidth))
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
const getContainerStyles = (setting, style)=>{
|
|
17
|
+
const { inlineAlignment } = setting ?? {};
|
|
18
|
+
return core.filterTruthyStyles({
|
|
19
|
+
...core.makeStyle({
|
|
20
|
+
pc: inlineAlignment
|
|
21
|
+
}),
|
|
22
|
+
...style
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.getContainerStyles = getContainerStyles;
|
|
27
|
+
exports.getWrapperStyles = getWrapperStyles;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var Loading = require('../../../../../common/components/Loading.js');
|
|
9
|
+
require('@gem-sdk/core');
|
|
10
|
+
var classes = require('../common/classes.js');
|
|
11
|
+
var system = require('@gem-sdk/system');
|
|
12
|
+
var styles = require('../common/styles.js');
|
|
13
|
+
var useProductOfferData = require('../hooks/useProductOfferData.js');
|
|
14
|
+
var ProductOfferItem = require('./ProductOfferItem.js');
|
|
15
|
+
|
|
16
|
+
const PostPurchaseProductOffer = (props)=>{
|
|
17
|
+
const { styles: styles$1, builderAttrs, builderProps, setting } = props;
|
|
18
|
+
const { isLoading, productSortedById, totalProduct } = useProductOfferData.useProductOfferData();
|
|
19
|
+
const productOfferContainerClasses = system.createClass({
|
|
20
|
+
...classes.getProductOfferContainerClasses(builderProps?.uid)
|
|
21
|
+
});
|
|
22
|
+
const productOfferWrapperClasses = system.createClass({
|
|
23
|
+
...classes.getProductOfferWrapperClasses()
|
|
24
|
+
});
|
|
25
|
+
const wrapperStyles = system.createStyle({
|
|
26
|
+
...styles.getWrapperStyles(styles$1)
|
|
27
|
+
});
|
|
28
|
+
const containerStyles = system.createStyle({
|
|
29
|
+
...styles.getContainerStyles(setting)
|
|
30
|
+
});
|
|
31
|
+
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
32
|
+
children: isLoading ? /*#__PURE__*/ jsxRuntime.jsx(Loading.default, {}) : !productSortedById?.length ? /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
33
|
+
children: "You haven't set up a product yet. Please go back to the sales funnel details to add a product."
|
|
34
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
35
|
+
...builderAttrs,
|
|
36
|
+
className: productOfferContainerClasses,
|
|
37
|
+
style: containerStyles,
|
|
38
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
39
|
+
className: productOfferWrapperClasses,
|
|
40
|
+
style: wrapperStyles,
|
|
41
|
+
children: productSortedById?.map((product, index)=>/*#__PURE__*/ React.createElement(ProductOfferItem.ProductOfferItem, {
|
|
42
|
+
...props,
|
|
43
|
+
product: product,
|
|
44
|
+
index: index,
|
|
45
|
+
key: index,
|
|
46
|
+
totalProduct: totalProduct
|
|
47
|
+
}))
|
|
48
|
+
})
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
exports.default = PostPurchaseProductOffer;
|
package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOfferItem.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var core = require('@gem-sdk/core');
|
|
6
|
+
var Row = require('../../../../../grid/row/Row.js');
|
|
7
|
+
require('react');
|
|
8
|
+
var ChildrenDroppable = require('../../../../../grid/components/ChildrenDroppable.js');
|
|
9
|
+
var system = require('@gem-sdk/system');
|
|
10
|
+
var attrs = require('../common/attrs.js');
|
|
11
|
+
var classes = require('../common/classes.js');
|
|
12
|
+
|
|
13
|
+
const ProductOfferItem = (props)=>{
|
|
14
|
+
const { product, setting, builderProps, children, index, totalProduct, builderAttrs, styles } = props;
|
|
15
|
+
const mode = core.useEditorMode();
|
|
16
|
+
const { variantSelected, ...rowSetting } = setting ?? {};
|
|
17
|
+
const variantId = variantSelected?.[product?.baseID ?? '']?.variantId;
|
|
18
|
+
const attrs$1 = system.createAttr({
|
|
19
|
+
...attrs.getProductOfferAttrs(product, builderProps?.uid)
|
|
20
|
+
});
|
|
21
|
+
const productOfferItemClasses = system.createClass({
|
|
22
|
+
...classes.getProductOfferItemClasses(index, setting, totalProduct)
|
|
23
|
+
});
|
|
24
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
25
|
+
className: productOfferItemClasses,
|
|
26
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core.ProductProvider, {
|
|
27
|
+
product,
|
|
28
|
+
readOnly: true,
|
|
29
|
+
initialVariantId: variantId ?? 'Latest',
|
|
30
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
31
|
+
...mode === 'edit' ? {
|
|
32
|
+
...attrs$1
|
|
33
|
+
} : {},
|
|
34
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(Row.default, {
|
|
35
|
+
builderAttrs: builderAttrs,
|
|
36
|
+
setting: rowSetting,
|
|
37
|
+
styles: styles,
|
|
38
|
+
children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : children
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
}, `uid-${product?.id}`);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
exports.ProductOfferItem = ProductOfferItem;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@gem-sdk/core');
|
|
4
|
+
var useDynamicProduct = require('../../../hooks/useDynamicProduct.js');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var index = require('../../../helpers/index.js');
|
|
7
|
+
var ProductOfferPlaceholder = require('../../../constants/ProductOfferPlaceholder.js');
|
|
8
|
+
|
|
9
|
+
const useProductOfferData = ()=>{
|
|
10
|
+
const productOffers = core.usePageStore((s)=>s.productOffers);
|
|
11
|
+
const publicStoreFrontData = core.usePageStore((s)=>s.publicStoreFrontData);
|
|
12
|
+
const { isDynamicProduct } = useDynamicProduct.useDynamicProduct();
|
|
13
|
+
const dynamicDiscountOffer = core.usePageStore((s)=>s.dynamicDiscountOffer);
|
|
14
|
+
const totalProduct = React.useMemo(()=>isDynamicProduct ? dynamicDiscountOffer?.appliedProductCount : productOffers?.length, [
|
|
15
|
+
dynamicDiscountOffer?.appliedProductCount,
|
|
16
|
+
isDynamicProduct,
|
|
17
|
+
productOffers?.length
|
|
18
|
+
]);
|
|
19
|
+
const sortedProductBaseIDs = React.useMemo(()=>{
|
|
20
|
+
return productOffers?.sort((a, b)=>{
|
|
21
|
+
if (a?.node?.position && b?.node?.position) {
|
|
22
|
+
return a.node.position - b.node.position;
|
|
23
|
+
}
|
|
24
|
+
return 0;
|
|
25
|
+
}).map((item)=>item?.node?.objectBaseID).filter(Boolean);
|
|
26
|
+
}, [
|
|
27
|
+
productOffers
|
|
28
|
+
]);
|
|
29
|
+
const { isLoading, isValidating, data } = core.useProductsQuery(sortedProductBaseIDs || [], {
|
|
30
|
+
revalidateOnMount: true
|
|
31
|
+
}, {
|
|
32
|
+
allStatus: true,
|
|
33
|
+
fetcher: index.hasPublicStoreFrontData(publicStoreFrontData) ? index.createStoreFrontFetcher(publicStoreFrontData) : undefined
|
|
34
|
+
});
|
|
35
|
+
const loading = React.useMemo(()=>isLoading || isValidating, [
|
|
36
|
+
isLoading,
|
|
37
|
+
isValidating
|
|
38
|
+
]);
|
|
39
|
+
const products = React.useMemo(()=>core.flattenConnection(data?.products), [
|
|
40
|
+
data?.products
|
|
41
|
+
]);
|
|
42
|
+
const productSortedById = React.useMemo(()=>{
|
|
43
|
+
return isDynamicProduct && dynamicDiscountOffer?.appliedProductCount ? Array(dynamicDiscountOffer.appliedProductCount).fill(ProductOfferPlaceholder.productOfferPlaceholder) : sortedProductBaseIDs?.map((id)=>products?.find((el)=>el?.baseID === id)).filter(Boolean);
|
|
44
|
+
}, [
|
|
45
|
+
isDynamicProduct,
|
|
46
|
+
dynamicDiscountOffer?.appliedProductCount,
|
|
47
|
+
sortedProductBaseIDs,
|
|
48
|
+
products
|
|
49
|
+
]);
|
|
50
|
+
return {
|
|
51
|
+
isLoading: loading,
|
|
52
|
+
productSortedById,
|
|
53
|
+
totalProduct
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
exports.useProductOfferData = useProductOfferData;
|
|
@@ -4,7 +4,7 @@ var React = require('react');
|
|
|
4
4
|
var useCarousel = require('./useCarousel.js');
|
|
5
5
|
|
|
6
6
|
const useListCarousel = (props)=>{
|
|
7
|
-
const { productImages, itemPerRow } = props;
|
|
7
|
+
const { productImages, itemPerRow, vertical } = props;
|
|
8
8
|
const { moveToIdx } = useCarousel.useCarousel();
|
|
9
9
|
const list = React.useCallback(()=>{
|
|
10
10
|
const temp = [
|
|
@@ -18,6 +18,9 @@ const useListCarousel = (props)=>{
|
|
|
18
18
|
]);
|
|
19
19
|
const listRender = React.useMemo(()=>{
|
|
20
20
|
const listItem = list();
|
|
21
|
+
if (vertical) return [
|
|
22
|
+
...productImages
|
|
23
|
+
];
|
|
21
24
|
if (listItem.length < itemPerRow) {
|
|
22
25
|
const temp = [
|
|
23
26
|
...productImages
|
|
@@ -33,7 +36,8 @@ const useListCarousel = (props)=>{
|
|
|
33
36
|
}, [
|
|
34
37
|
list,
|
|
35
38
|
itemPerRow,
|
|
36
|
-
productImages
|
|
39
|
+
productImages,
|
|
40
|
+
vertical
|
|
37
41
|
]);
|
|
38
42
|
return {
|
|
39
43
|
listRender
|
|
@@ -16,7 +16,7 @@ var ProductPrice$1 = require('./settings/product-price/ProductPrice.js');
|
|
|
16
16
|
var ProductVariant$1 = require('./settings/product-variants/ProductVariant.js');
|
|
17
17
|
var index$1 = require('./settings/accept-button/index.js');
|
|
18
18
|
var index$2 = require('./settings/product-quantity/index.js');
|
|
19
|
-
var
|
|
19
|
+
var index$4 = require('./settings/product-offer/index.js');
|
|
20
20
|
var index$3 = require('./settings/product-price-breakdown/index.js');
|
|
21
21
|
var ProductDiscountTag$1 = require('./settings/product-discount-tag/ProductDiscountTag.js');
|
|
22
22
|
var ProductImages = require('./settings/product-image/ProductImages.js');
|
|
@@ -29,7 +29,7 @@ const postPurchaseProductSetting = {
|
|
|
29
29
|
PostPurchaseAcceptButton: index$1.default,
|
|
30
30
|
PostPurchaseProductQuantity: index$2.default,
|
|
31
31
|
PostPurchaseProductPriceBreakdown: index$3.default,
|
|
32
|
-
PostPurchaseProductOffer:
|
|
32
|
+
PostPurchaseProductOffer: index$4.default,
|
|
33
33
|
PostPurchaseProductDiscountTag: ProductDiscountTag$1.default,
|
|
34
34
|
PostPurchaseProductImages: ProductImages.default
|
|
35
35
|
};
|
|
@@ -30,7 +30,7 @@ const PostPurchaseProductQuantity = dynamic(()=>Promise.resolve().then(function
|
|
|
30
30
|
const PostPurchaseProductPriceBreakdown = dynamic(()=>Promise.resolve().then(function () { return require('./components/ProductPriceBreakdown.js'); }), {
|
|
31
31
|
loading: Loading.default
|
|
32
32
|
});
|
|
33
|
-
const PostPurchaseProductOffer = dynamic(()=>Promise.resolve().then(function () { return require('./components/ProductOffer.js'); }), {
|
|
33
|
+
const PostPurchaseProductOffer = dynamic(()=>Promise.resolve().then(function () { return require('./components/product-offer/components/ProductOffer.js'); }), {
|
|
34
34
|
loading: Loading.default
|
|
35
35
|
});
|
|
36
36
|
const PostPurchaseProductDiscountTag = dynamic(()=>Promise.resolve().then(function () { return require('./components/ProductDiscountTag.js'); }), {
|