@gem-sdk/components 2.0.0-dev.702 → 2.0.0-dev.704
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/setting/configs/ArticleReadMore/settings.js +86 -134
- package/dist/cjs/button/components/common/helpers.js +2 -9
- package/dist/cjs/button/components/common/styles.js +14 -81
- package/dist/cjs/button/setting/configs/settings.js +85 -133
- package/dist/cjs/coupon/common/classes.js +3 -12
- package/dist/cjs/coupon/common/styles.js +7 -17
- package/dist/cjs/coupon/setting/config/settings.js +60 -100
- package/dist/cjs/form/setting/submit-button/configs/settings.js +103 -250
- package/dist/cjs/helpers.js +4 -1
- package/dist/cjs/image/components/NextImage.liquid.js +2 -2
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/post-purchase/product/settings/product-image/setting-v2.js +2 -2
- package/dist/cjs/post-purchase/product/settings/product-image/uiV2.js +72 -2
- package/dist/cjs/product/components/DynamicCheckout/common/styles.js +12 -12
- package/dist/cjs/product/components/ProductBadge/index.liquid.js +12 -3
- package/dist/cjs/product/components/ProductBadge/utils/generateLiquidContent.js +2 -2
- package/dist/cjs/product/components/ProductButton/common/styles.js +4 -14
- package/dist/cjs/product/components/ProductDescription/index.liquid.js +21 -4
- package/dist/cjs/product/components/ProductImagesV2/common/common.js +1 -1
- package/dist/cjs/product/setting/constant/bundle-layout/horizontalThree.js +1 -0
- package/dist/cjs/product/setting/constant/bundle-layout/horizontalTwo.js +1 -0
- package/dist/cjs/product/setting/constant/bundle-layout/verticalThree.js +1 -0
- package/dist/cjs/product/setting/constant/bundle-layout/verticalTwo.js +1 -0
- package/dist/cjs/product/setting/dynamic-checkout/configs/settings.js +86 -134
- package/dist/cjs/product/setting/product-badge/configs/settings.js +5 -0
- package/dist/cjs/product/setting/product-button/configs/settings.js +142 -222
- package/dist/cjs/product/setting/product-description/configs/settings.js +5 -0
- package/dist/cjs/product/setting/product-view-more/configs/settings.js +100 -148
- package/dist/cjs/stock-counter/components/StockCounter.js +0 -2
- package/dist/cjs/stock-counter/components/StockCounter.liquid.js +44 -3
- package/dist/cjs/stock-counter/components/common/getContent.js +19 -10
- package/dist/cjs/stock-counter/helpers.js +20 -3
- package/dist/cjs/stock-counter/index.js +0 -1
- package/dist/cjs/stock-counter/setting/configs/settingsV2.js +5 -0
- package/dist/cjs/third-party/setting/Selleasy/index.js +5 -5
- package/dist/esm/article/setting/configs/ArticleReadMore/settings.js +86 -134
- package/dist/esm/button/components/common/helpers.js +2 -9
- package/dist/esm/button/components/common/styles.js +16 -81
- package/dist/esm/button/setting/configs/settings.js +85 -133
- package/dist/esm/coupon/common/classes.js +3 -12
- package/dist/esm/coupon/common/styles.js +7 -17
- package/dist/esm/coupon/setting/config/settings.js +60 -100
- package/dist/esm/form/setting/submit-button/configs/settings.js +103 -250
- package/dist/esm/helpers.js +4 -1
- package/dist/esm/image/components/NextImage.liquid.js +2 -2
- package/dist/esm/index.js +1 -0
- package/dist/esm/post-purchase/product/settings/product-image/setting-v2.js +2 -2
- package/dist/esm/post-purchase/product/settings/product-image/uiV2.js +72 -2
- package/dist/esm/product/components/DynamicCheckout/common/styles.js +12 -12
- package/dist/esm/product/components/ProductBadge/index.liquid.js +13 -4
- package/dist/esm/product/components/ProductBadge/utils/generateLiquidContent.js +2 -2
- package/dist/esm/product/components/ProductButton/common/styles.js +4 -14
- package/dist/esm/product/components/ProductDescription/index.liquid.js +22 -5
- package/dist/esm/product/components/ProductImagesV2/common/common.js +1 -1
- package/dist/esm/product/setting/constant/bundle-layout/horizontalThree.js +1 -0
- package/dist/esm/product/setting/constant/bundle-layout/horizontalTwo.js +1 -0
- package/dist/esm/product/setting/constant/bundle-layout/verticalThree.js +1 -0
- package/dist/esm/product/setting/constant/bundle-layout/verticalTwo.js +1 -0
- package/dist/esm/product/setting/dynamic-checkout/configs/settings.js +86 -134
- package/dist/esm/product/setting/product-badge/configs/settings.js +5 -0
- package/dist/esm/product/setting/product-button/configs/settings.js +142 -222
- package/dist/esm/product/setting/product-description/configs/settings.js +5 -0
- package/dist/esm/product/setting/product-view-more/configs/settings.js +100 -148
- package/dist/esm/stock-counter/components/StockCounter.js +0 -2
- package/dist/esm/stock-counter/components/StockCounter.liquid.js +46 -5
- package/dist/esm/stock-counter/components/common/getContent.js +19 -11
- package/dist/esm/stock-counter/helpers.js +20 -4
- package/dist/esm/stock-counter/index.js +0 -1
- package/dist/esm/stock-counter/setting/configs/settingsV2.js +5 -0
- package/dist/esm/third-party/setting/Selleasy/index.js +5 -5
- package/dist/types/index.d.ts +40 -28
- package/package.json +3 -3
|
@@ -93,44 +93,36 @@ const ProductViewMoreSettings = [
|
|
|
93
93
|
{
|
|
94
94
|
id: 'borderBtnV2',
|
|
95
95
|
type: 'border-v2',
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
color: '#121212',
|
|
113
|
-
isCustom: true
|
|
114
|
-
}
|
|
115
|
-
}
|
|
96
|
+
default: {
|
|
97
|
+
normal: {
|
|
98
|
+
borderType: 'none',
|
|
99
|
+
border: 'none',
|
|
100
|
+
borderWidth: '1px',
|
|
101
|
+
width: '1px 1px 1px 1px',
|
|
102
|
+
color: '#121212',
|
|
103
|
+
isCustom: true
|
|
104
|
+
},
|
|
105
|
+
hover: {
|
|
106
|
+
borderType: 'none',
|
|
107
|
+
border: 'none',
|
|
108
|
+
borderWidth: '1px',
|
|
109
|
+
width: '1px 1px 1px 1px',
|
|
110
|
+
color: '#121212',
|
|
111
|
+
isCustom: true
|
|
116
112
|
}
|
|
117
113
|
},
|
|
118
114
|
compoDefaultValue: {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
width: '1px',
|
|
131
|
-
borderWidth: '1px'
|
|
132
|
-
}
|
|
133
|
-
}
|
|
115
|
+
normal: {
|
|
116
|
+
border: 'solid',
|
|
117
|
+
color: '#121212',
|
|
118
|
+
width: '1px',
|
|
119
|
+
borderWidth: '1px'
|
|
120
|
+
},
|
|
121
|
+
hover: {
|
|
122
|
+
border: 'solid',
|
|
123
|
+
color: '#121212',
|
|
124
|
+
width: '1px',
|
|
125
|
+
borderWidth: '1px'
|
|
134
126
|
}
|
|
135
127
|
}
|
|
136
128
|
},
|
|
@@ -150,66 +142,50 @@ const ProductViewMoreSettings = [
|
|
|
150
142
|
{
|
|
151
143
|
id: 'backgroundColorV2',
|
|
152
144
|
type: 'color-picker-v2',
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
normal: 'brand',
|
|
157
|
-
hover: 'highlight'
|
|
158
|
-
}
|
|
159
|
-
}
|
|
145
|
+
default: {
|
|
146
|
+
normal: 'brand',
|
|
147
|
+
hover: 'highlight'
|
|
160
148
|
},
|
|
161
149
|
compoDefaultValue: {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
normal: 'brand',
|
|
165
|
-
hover: 'highlight'
|
|
166
|
-
}
|
|
167
|
-
}
|
|
150
|
+
normal: 'brand',
|
|
151
|
+
hover: 'highlight'
|
|
168
152
|
},
|
|
169
153
|
enableGradient: true
|
|
170
154
|
},
|
|
171
155
|
{
|
|
172
156
|
id: 'backgroundImage',
|
|
173
157
|
type: 'background-image',
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
normal: {},
|
|
178
|
-
hover: {}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
158
|
+
default: {
|
|
159
|
+
normal: {},
|
|
160
|
+
hover: {}
|
|
181
161
|
},
|
|
182
162
|
compoDefaultValue: {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
width: 1200,
|
|
210
|
-
height: 480
|
|
211
|
-
}
|
|
212
|
-
}
|
|
163
|
+
normal: {
|
|
164
|
+
size: 'cover',
|
|
165
|
+
position: {
|
|
166
|
+
x: 50,
|
|
167
|
+
y: 50
|
|
168
|
+
},
|
|
169
|
+
repeat: 'no-repeat',
|
|
170
|
+
attachment: 'scroll',
|
|
171
|
+
image: {
|
|
172
|
+
src: 'https://ucarecdn.com/06075225-af9e-460c-8e3c-6be63c0b773a/-/format/auto/',
|
|
173
|
+
width: 1200,
|
|
174
|
+
height: 480
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
hover: {
|
|
178
|
+
size: 'cover',
|
|
179
|
+
position: {
|
|
180
|
+
x: 50,
|
|
181
|
+
y: 50
|
|
182
|
+
},
|
|
183
|
+
repeat: 'no-repeat',
|
|
184
|
+
attachment: 'scroll',
|
|
185
|
+
image: {
|
|
186
|
+
src: 'https://ucarecdn.com/06075225-af9e-460c-8e3c-6be63c0b773a/-/format/auto/',
|
|
187
|
+
width: 1200,
|
|
188
|
+
height: 480
|
|
213
189
|
}
|
|
214
190
|
}
|
|
215
191
|
}
|
|
@@ -265,25 +241,17 @@ const ProductViewMoreSettings = [
|
|
|
265
241
|
{
|
|
266
242
|
id: 'boxShadowBtnV2',
|
|
267
243
|
type: 'shadow-v2',
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
default: {
|
|
271
|
-
normal: {}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
244
|
+
default: {
|
|
245
|
+
normal: {}
|
|
274
246
|
},
|
|
275
247
|
compoDefaultValue: {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
color: 'rgba(18, 18, 18, 0.2)',
|
|
284
|
-
angle: 45
|
|
285
|
-
}
|
|
286
|
-
}
|
|
248
|
+
normal: {
|
|
249
|
+
type: 'shadow-2',
|
|
250
|
+
distance: '12px',
|
|
251
|
+
blur: '12px',
|
|
252
|
+
spread: '0px',
|
|
253
|
+
color: 'rgba(18, 18, 18, 0.2)',
|
|
254
|
+
angle: 45
|
|
287
255
|
}
|
|
288
256
|
}
|
|
289
257
|
},
|
|
@@ -304,63 +272,47 @@ const ProductViewMoreSettings = [
|
|
|
304
272
|
{
|
|
305
273
|
id: 'roundedBtnV2',
|
|
306
274
|
type: 'corner-v2',
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
btlr: '0px',
|
|
322
|
-
radiusType: 'none'
|
|
323
|
-
}
|
|
324
|
-
}
|
|
275
|
+
default: {
|
|
276
|
+
normal: {
|
|
277
|
+
btrr: '0px',
|
|
278
|
+
bblr: '0px',
|
|
279
|
+
bbrr: '0px',
|
|
280
|
+
btlr: '0px',
|
|
281
|
+
radiusType: 'none'
|
|
282
|
+
},
|
|
283
|
+
hover: {
|
|
284
|
+
btrr: '0px',
|
|
285
|
+
bblr: '0px',
|
|
286
|
+
bbrr: '0px',
|
|
287
|
+
btlr: '0px',
|
|
288
|
+
radiusType: 'none'
|
|
325
289
|
}
|
|
326
290
|
},
|
|
327
291
|
compoDefaultValue: {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
btlr: '8px',
|
|
342
|
-
radiusType: 'rounded'
|
|
343
|
-
}
|
|
344
|
-
}
|
|
292
|
+
normal: {
|
|
293
|
+
btrr: '8px',
|
|
294
|
+
bblr: '8px',
|
|
295
|
+
bbrr: '8px',
|
|
296
|
+
btlr: '8px',
|
|
297
|
+
radiusType: 'rounded'
|
|
298
|
+
},
|
|
299
|
+
hover: {
|
|
300
|
+
btrr: '8px',
|
|
301
|
+
bblr: '8px',
|
|
302
|
+
bbrr: '8px',
|
|
303
|
+
btlr: '8px',
|
|
304
|
+
radiusType: 'rounded'
|
|
345
305
|
}
|
|
346
306
|
}
|
|
347
307
|
},
|
|
348
308
|
{
|
|
349
309
|
id: 'textColorHover',
|
|
350
310
|
type: 'color-picker-v2',
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
default: {
|
|
354
|
-
hover: 'text-3'
|
|
355
|
-
}
|
|
356
|
-
}
|
|
311
|
+
default: {
|
|
312
|
+
hover: 'text-3'
|
|
357
313
|
},
|
|
358
314
|
compoDefaultValue: {
|
|
359
|
-
|
|
360
|
-
default: {
|
|
361
|
-
hover: 'text-3'
|
|
362
|
-
}
|
|
363
|
-
}
|
|
315
|
+
hover: 'text-3'
|
|
364
316
|
}
|
|
365
317
|
},
|
|
366
318
|
{
|
|
@@ -9,8 +9,6 @@ var useStockCounterInteraction = require('../hooks/useStockCounterInteraction.js
|
|
|
9
9
|
var getInlineCss = require('./common/getInlineCss.js');
|
|
10
10
|
var getClasses = require('./common/getClasses.js');
|
|
11
11
|
var getStyles = require('./common/getStyles.js');
|
|
12
|
-
require('next/link');
|
|
13
|
-
require('@gem-sdk/core');
|
|
14
12
|
var getAttrs = require('./common/getAttrs.js');
|
|
15
13
|
var system = require('@gem-sdk/system');
|
|
16
14
|
var useStockCounter = require('./hook/useStockCounter.js');
|
|
@@ -11,11 +11,40 @@ var getContent = require('./common/getContent.js');
|
|
|
11
11
|
var getAttrs = require('./common/getAttrs.js');
|
|
12
12
|
var system = require('@gem-sdk/system');
|
|
13
13
|
|
|
14
|
-
const StockCounter = ({ setting, styles, style, advanced, builderProps })=>{
|
|
14
|
+
const StockCounter = ({ setting, styles, style, advanced, builderProps, pageContext })=>{
|
|
15
15
|
const { borderRadius } = styles ?? {};
|
|
16
|
-
const { showIcon, icon, oosIcon, layout = 'full' } = setting ?? {};
|
|
16
|
+
const { showIcon, icon, oosIcon, layout = 'full', template: templateString, outOfStockMessage, continueSelling, unlimitedQuantityMessage } = setting ?? {};
|
|
17
17
|
const inlineCss = getInlineCss.getInlineCss(builderProps?.uid, borderRadius);
|
|
18
18
|
const showText = layout !== 'progress-bar';
|
|
19
|
+
const templateStringDisplay = helpers.getDynamicSourceLocales({
|
|
20
|
+
val: templateString,
|
|
21
|
+
uid: builderProps?.uid,
|
|
22
|
+
settingId: 'template',
|
|
23
|
+
pageContext,
|
|
24
|
+
translate: setting?.translate,
|
|
25
|
+
isReplaceInventoryQuantity: true
|
|
26
|
+
});
|
|
27
|
+
const outOfStockMessageDisplay = helpers.getDynamicSourceLocales({
|
|
28
|
+
val: outOfStockMessage,
|
|
29
|
+
uid: builderProps?.uid,
|
|
30
|
+
settingId: 'outOfStockMessage',
|
|
31
|
+
pageContext,
|
|
32
|
+
translate: setting?.translate
|
|
33
|
+
});
|
|
34
|
+
const continueSellingDisplay = helpers.getDynamicSourceLocales({
|
|
35
|
+
val: continueSelling,
|
|
36
|
+
uid: builderProps?.uid,
|
|
37
|
+
settingId: 'continueSelling',
|
|
38
|
+
pageContext,
|
|
39
|
+
translate: setting?.translate
|
|
40
|
+
});
|
|
41
|
+
const unlimitedQuantityMessageDisplay = helpers.getDynamicSourceLocales({
|
|
42
|
+
val: unlimitedQuantityMessage,
|
|
43
|
+
uid: builderProps?.uid,
|
|
44
|
+
settingId: 'unlimitedQuantityMessage',
|
|
45
|
+
pageContext,
|
|
46
|
+
translate: setting?.translate
|
|
47
|
+
});
|
|
19
48
|
const liquidTagAttrs = system.createAttr({
|
|
20
49
|
...getAttrs.getLiquidTagAttrs(builderProps, setting, styles)
|
|
21
50
|
});
|
|
@@ -40,7 +69,12 @@ const StockCounter = ({ setting, styles, style, advanced, builderProps })=>{
|
|
|
40
69
|
...getStyles.getWrapperStyles(styles)
|
|
41
70
|
});
|
|
42
71
|
const liquidInitData = getContent.getLiquidInitData(setting, styles);
|
|
43
|
-
const liquidTextContent = getContent.getLiquidTextContent(
|
|
72
|
+
const liquidTextContent = getContent.getLiquidTextContent({
|
|
73
|
+
templateStringDisplay,
|
|
74
|
+
outOfStockMessageDisplay,
|
|
75
|
+
continueSellingDisplay,
|
|
76
|
+
unlimitedQuantityMessageDisplay
|
|
77
|
+
});
|
|
44
78
|
const wrapperIconClasses = system.createClass({
|
|
45
79
|
...getClasses.getWrapperIconClasses(setting)
|
|
46
80
|
});
|
|
@@ -73,6 +107,12 @@ const StockCounter = ({ setting, styles, style, advanced, builderProps })=>{
|
|
|
73
107
|
const textAttrs = system.createAttr({
|
|
74
108
|
...getAttrs.getLiquidTextAttrs()
|
|
75
109
|
});
|
|
110
|
+
const textDisplayData = getContent.getTextDisplayData({
|
|
111
|
+
templateStringDisplay,
|
|
112
|
+
outOfStockMessageDisplay,
|
|
113
|
+
continueSellingDisplay,
|
|
114
|
+
unlimitedQuantityMessageDisplay
|
|
115
|
+
}, styles);
|
|
76
116
|
return core.template /* liquid */ `
|
|
77
117
|
${liquidInitData}
|
|
78
118
|
<gp-product-stock-counter ${{
|
|
@@ -135,6 +175,7 @@ const StockCounter = ({ setting, styles, style, advanced, builderProps })=>{
|
|
|
135
175
|
${icon}
|
|
136
176
|
</div>`)}
|
|
137
177
|
`)}
|
|
178
|
+
${textDisplayData}
|
|
138
179
|
${core.RenderIf(showText, core.template`
|
|
139
180
|
${system.LiquidIf('is_out_of_stock', core.template`<p
|
|
140
181
|
${{
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var helpers$1 = require('../../../helpers.js');
|
|
4
3
|
var _const = require('../../const.js');
|
|
5
|
-
var helpers = require('../../helpers.js');
|
|
6
4
|
|
|
7
|
-
const getLiquidTextContent = (
|
|
8
|
-
const {
|
|
9
|
-
const { textColor } = styles ?? {};
|
|
10
|
-
const mainColor = textColor || 'brand';
|
|
5
|
+
const getLiquidTextContent = (data)=>{
|
|
6
|
+
const { templateStringDisplay, outOfStockMessageDisplay, continueSellingDisplay, unlimitedQuantityMessageDisplay } = data ?? {};
|
|
11
7
|
return `{% if inventory_management == null and inventory_quantity <= 0 %}
|
|
12
|
-
${
|
|
8
|
+
${unlimitedQuantityMessageDisplay}
|
|
13
9
|
{% elsif available == false %}
|
|
14
|
-
${
|
|
10
|
+
${outOfStockMessageDisplay}
|
|
15
11
|
{% elsif available and inventory_policy == '${_const.CONTINUE_SELLING_WHEN_OUT_OF_STOCK.toLowerCase()}' and inventory_quantity <= 0 %}
|
|
16
|
-
${
|
|
12
|
+
${continueSellingDisplay}
|
|
17
13
|
{% else %}
|
|
18
|
-
${
|
|
14
|
+
${templateStringDisplay}
|
|
19
15
|
{% endif %}`;
|
|
20
16
|
};
|
|
21
17
|
const getLiquidInitData = (setting, styles)=>{
|
|
@@ -68,6 +64,19 @@ const getLiquidInitData = (setting, styles)=>{
|
|
|
68
64
|
}
|
|
69
65
|
{% endcapture %}`;
|
|
70
66
|
};
|
|
67
|
+
const getTextDisplayData = (data, styles)=>{
|
|
68
|
+
const { templateStringDisplay, outOfStockMessageDisplay, continueSellingDisplay, unlimitedQuantityMessageDisplay } = data ?? {};
|
|
69
|
+
const { textColor } = styles ?? {};
|
|
70
|
+
const mainColor = textColor || 'brand';
|
|
71
|
+
return `
|
|
72
|
+
<div class="gp-hidden gp-text-white gp-py-1 gp-px-2 gp-mr-1 gp-inline-block gp-my-[1px] gp-text-g-${mainColor} gp-bg-g-${mainColor}" >
|
|
73
|
+
<div id="template">${templateStringDisplay}</div>
|
|
74
|
+
<div id="out-of-stock-message">${outOfStockMessageDisplay}</div>
|
|
75
|
+
<div id="continue-selling">${continueSellingDisplay}</div>
|
|
76
|
+
<div id="unlimited-quantity-message">${unlimitedQuantityMessageDisplay}</div>
|
|
77
|
+
</div>`;
|
|
78
|
+
};
|
|
71
79
|
|
|
72
80
|
exports.getLiquidInitData = getLiquidInitData;
|
|
73
81
|
exports.getLiquidTextContent = getLiquidTextContent;
|
|
82
|
+
exports.getTextDisplayData = getTextDisplayData;
|
|
@@ -28,13 +28,30 @@ const transformNumberTag = (template, stringColor, quantityLeft)=>{
|
|
|
28
28
|
let quantityTag = '';
|
|
29
29
|
// Is hex color
|
|
30
30
|
if (stringColor.includes('#')) {
|
|
31
|
-
quantityTag = `<span style='--c: ${stringColor}'
|
|
31
|
+
quantityTag = `<span style='--c: ${stringColor}'><$quantity$></span>`;
|
|
32
32
|
} else {
|
|
33
33
|
// Is global style color
|
|
34
|
-
quantityTag = `<span class='gp-text-g-${stringColor}'
|
|
34
|
+
quantityTag = `<span class='gp-text-g-${stringColor}'><$quantity$></span>`;
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
if (quantityLeft) {
|
|
37
|
+
quantityTag = quantityTag.replace('<$quantity$>', quantityLeft.toString());
|
|
38
|
+
}
|
|
39
|
+
return template.replaceAll(_const.DEFAULT_QUANTITY_TEMPLATE, quantityTag);
|
|
40
|
+
};
|
|
41
|
+
const convertSizeToWidth = (typographyVar)=>{
|
|
42
|
+
const widthObject = {};
|
|
43
|
+
if (typographyVar['--size']) {
|
|
44
|
+
widthObject['--w'] = typographyVar['--size'];
|
|
45
|
+
}
|
|
46
|
+
if (typographyVar['--size-tablet']) {
|
|
47
|
+
widthObject['--w-tablet'] = typographyVar['--size-tablet'];
|
|
48
|
+
}
|
|
49
|
+
if (typographyVar['--size-mobile']) {
|
|
50
|
+
widthObject['--w-mobile'] = typographyVar['--size-mobile'];
|
|
51
|
+
}
|
|
52
|
+
return widthObject;
|
|
37
53
|
};
|
|
38
54
|
|
|
55
|
+
exports.convertSizeToWidth = convertSizeToWidth;
|
|
39
56
|
exports.transformHighlighTag = transformHighlighTag;
|
|
40
57
|
exports.transformNumberTag = transformNumberTag;
|
|
@@ -142,6 +142,11 @@ const StockCounterSettingsV2 = [
|
|
|
142
142
|
type: 'textarea',
|
|
143
143
|
autoHeight: true,
|
|
144
144
|
default: 'Hurry! LET BUY NOW'
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
id: 'translate',
|
|
148
|
+
type: 'input',
|
|
149
|
+
default: 'template,outOfStockMessage,continueSelling,unlimitedQuantityMessage'
|
|
145
150
|
}
|
|
146
151
|
]
|
|
147
152
|
},
|
|
@@ -56,17 +56,17 @@ const config = {
|
|
|
56
56
|
type: 'select',
|
|
57
57
|
options: [
|
|
58
58
|
{
|
|
59
|
-
label: '
|
|
60
|
-
value: 'lb-upsell-
|
|
59
|
+
label: 'FBT List',
|
|
60
|
+
value: 'lb-upsell-widget-bl',
|
|
61
61
|
maxOption: 1
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
|
-
label: '
|
|
65
|
-
value: 'lb-upsell-
|
|
64
|
+
label: 'Add-ons List',
|
|
65
|
+
value: 'lb-upsell-widget-pal',
|
|
66
66
|
maxOption: 1
|
|
67
67
|
}
|
|
68
68
|
],
|
|
69
|
-
default: 'lb-upsell-
|
|
69
|
+
default: 'lb-upsell-widget-bl'
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
id: 'install',
|