@gem-sdk/components 2.0.0-dev.480 → 2.0.0-dev.482
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/article/components/ArticleList.js +1 -2
- package/dist/cjs/article/components/ArticleList.liquid.js +1 -1
- package/dist/cjs/article/setting/ArticleList.js +7 -591
- package/dist/cjs/article/setting/configs/ArticleList/presets.js +346 -0
- package/dist/cjs/article/setting/configs/ArticleList/settings.js +315 -0
- package/dist/cjs/article/setting/configs/ArticleList/uiV2.js +201 -0
- package/dist/cjs/article/setting/configs/ArticleReadMore/settings.js +1 -1
- package/dist/cjs/banner/components/HeroBanner.liquid.js +2 -2
- package/dist/cjs/banner/components/HeroBannerItem.js +15 -7
- package/dist/cjs/banner/components/HeroBannerItem.liquid.js +13 -11
- package/dist/cjs/banner/components/common/common.js +13 -29
- package/dist/cjs/banner/components/common/getClasses.js +2 -1
- package/dist/cjs/banner/components/common/getStyle.js +2 -0
- package/dist/cjs/banner/components/hooks/useHeroBanner.js +2 -7
- package/dist/cjs/banner/setting/setting.js +12 -0
- package/dist/cjs/banner/setting/uiV2.js +28 -6
- package/dist/cjs/countdown-timer/setting/configs/settings.js +51 -6
- package/dist/cjs/countdown-timer/setting/configs/uiV2.js +177 -100
- package/dist/cjs/dialog/setting/configs/settings.js +2 -2
- package/dist/cjs/product/components/ProductDiscountTag/index.liquid.js +3 -2
- package/dist/cjs/product/components/ProductSKU/Sku.liquid.js +3 -2
- package/dist/cjs/product/setting/product-price/configs/uiV2.js +1 -1
- package/dist/cjs/sticky/components/Sticky.liquid.js +6 -0
- package/dist/cjs/stock-counter/setting/configs/settingsV2.js +7 -6
- package/dist/cjs/stock-counter/setting/configs/uiV2.js +36 -6
- package/dist/esm/article/components/ArticleList.js +1 -2
- package/dist/esm/article/components/ArticleList.liquid.js +1 -1
- package/dist/esm/article/setting/ArticleList.js +7 -591
- package/dist/esm/article/setting/configs/ArticleList/presets.js +344 -0
- package/dist/esm/article/setting/configs/ArticleList/settings.js +313 -0
- package/dist/esm/article/setting/configs/ArticleList/uiV2.js +199 -0
- package/dist/esm/article/setting/configs/ArticleReadMore/settings.js +1 -1
- package/dist/esm/banner/components/HeroBanner.liquid.js +2 -2
- package/dist/esm/banner/components/HeroBannerItem.js +16 -8
- package/dist/esm/banner/components/HeroBannerItem.liquid.js +12 -10
- package/dist/esm/banner/components/common/common.js +15 -30
- package/dist/esm/banner/components/common/getClasses.js +2 -1
- package/dist/esm/banner/components/common/getStyle.js +2 -0
- package/dist/esm/banner/components/hooks/useHeroBanner.js +4 -9
- package/dist/esm/banner/setting/setting.js +12 -0
- package/dist/esm/banner/setting/uiV2.js +28 -6
- package/dist/esm/countdown-timer/setting/configs/settings.js +51 -6
- package/dist/esm/countdown-timer/setting/configs/uiV2.js +177 -100
- package/dist/esm/dialog/setting/configs/settings.js +2 -2
- package/dist/esm/product/components/ProductDiscountTag/index.liquid.js +3 -2
- package/dist/esm/product/components/ProductSKU/Sku.liquid.js +4 -3
- package/dist/esm/product/setting/product-price/configs/uiV2.js +1 -1
- package/dist/esm/sticky/components/Sticky.liquid.js +6 -0
- package/dist/esm/stock-counter/setting/configs/settingsV2.js +8 -7
- package/dist/esm/stock-counter/setting/configs/uiV2.js +36 -6
- package/dist/types/index.d.ts +6 -0
- package/package.json +2 -2
|
@@ -1,6 +1,62 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const SettingUIV2 = [
|
|
4
|
+
{
|
|
5
|
+
label: {
|
|
6
|
+
en: 'Countdown time'
|
|
7
|
+
},
|
|
8
|
+
controls: [
|
|
9
|
+
{
|
|
10
|
+
label: {
|
|
11
|
+
en: 'Run type'
|
|
12
|
+
},
|
|
13
|
+
setting: {
|
|
14
|
+
id: 'behaviour'
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
conditionDisplay: 'behaviour === "standard"',
|
|
19
|
+
label: {
|
|
20
|
+
en: 'Date'
|
|
21
|
+
},
|
|
22
|
+
setting: {
|
|
23
|
+
id: 'dateStandard'
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
conditionDisplay: 'behaviour === "standard"',
|
|
28
|
+
label: {
|
|
29
|
+
en: 'Time zone'
|
|
30
|
+
},
|
|
31
|
+
setting: {
|
|
32
|
+
id: 'timeZone'
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
conditionDisplay: 'behaviour === "daily"',
|
|
37
|
+
setting: {
|
|
38
|
+
id: 'timerDaily'
|
|
39
|
+
},
|
|
40
|
+
layout: 'vertical'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
conditionDisplay: 'behaviour === "evergreen"',
|
|
44
|
+
setting: {
|
|
45
|
+
id: 'timerEverygreen'
|
|
46
|
+
},
|
|
47
|
+
layout: 'vertical'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
conditionDisplay: 'behaviour === "evergreen"',
|
|
51
|
+
label: {
|
|
52
|
+
en: 'Loop (refresh after finish)'
|
|
53
|
+
},
|
|
54
|
+
setting: {
|
|
55
|
+
id: 'loopAfterFinish'
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
},
|
|
4
60
|
{
|
|
5
61
|
label: {
|
|
6
62
|
en: 'Item management'
|
|
@@ -9,7 +65,7 @@ const SettingUIV2 = [
|
|
|
9
65
|
{
|
|
10
66
|
type: 'combo',
|
|
11
67
|
label: {
|
|
12
|
-
en: '
|
|
68
|
+
en: 'Items'
|
|
13
69
|
},
|
|
14
70
|
fixedValue: 'Edit...',
|
|
15
71
|
iconName: 'polaris-list-bulleted',
|
|
@@ -109,184 +165,162 @@ const SettingUIV2 = [
|
|
|
109
165
|
},
|
|
110
166
|
{
|
|
111
167
|
label: {
|
|
112
|
-
en: '
|
|
168
|
+
en: 'Hover effect'
|
|
113
169
|
},
|
|
114
170
|
controls: [
|
|
115
171
|
{
|
|
116
172
|
label: {
|
|
117
|
-
en: '
|
|
173
|
+
en: 'Border'
|
|
118
174
|
},
|
|
119
175
|
setting: {
|
|
120
|
-
id: '
|
|
176
|
+
id: 'borderState',
|
|
177
|
+
state: 'hover'
|
|
121
178
|
}
|
|
122
179
|
},
|
|
123
180
|
{
|
|
124
|
-
conditionDisplay: 'behaviour === "standard"',
|
|
125
181
|
label: {
|
|
126
|
-
en: '
|
|
182
|
+
en: 'Corner'
|
|
127
183
|
},
|
|
128
184
|
setting: {
|
|
129
|
-
id: '
|
|
185
|
+
id: 'roundedState',
|
|
186
|
+
state: 'hover'
|
|
130
187
|
}
|
|
131
|
-
}
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
label: {
|
|
193
|
+
en: 'Item style'
|
|
194
|
+
},
|
|
195
|
+
controls: [
|
|
132
196
|
{
|
|
133
|
-
conditionDisplay: 'behaviour === "standard"',
|
|
134
197
|
label: {
|
|
135
|
-
en: '
|
|
198
|
+
en: 'Item gap'
|
|
136
199
|
},
|
|
137
200
|
setting: {
|
|
138
|
-
id: '
|
|
201
|
+
id: 'horizontalGap'
|
|
139
202
|
}
|
|
140
203
|
},
|
|
141
204
|
{
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
id: 'timerDaily'
|
|
205
|
+
label: {
|
|
206
|
+
en: 'Padding'
|
|
145
207
|
},
|
|
146
|
-
|
|
208
|
+
setting: {
|
|
209
|
+
id: 'itemPadding'
|
|
210
|
+
}
|
|
147
211
|
},
|
|
148
212
|
{
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
id: 'timerEverygreen'
|
|
213
|
+
label: {
|
|
214
|
+
en: 'Background'
|
|
152
215
|
},
|
|
153
|
-
|
|
216
|
+
setting: {
|
|
217
|
+
id: 'backgroundItemColor'
|
|
218
|
+
}
|
|
154
219
|
},
|
|
155
220
|
{
|
|
156
|
-
conditionDisplay: 'behaviour === "evergreen"',
|
|
157
221
|
label: {
|
|
158
|
-
en: '
|
|
222
|
+
en: 'Border'
|
|
159
223
|
},
|
|
160
224
|
setting: {
|
|
161
|
-
id: '
|
|
225
|
+
id: 'borderState',
|
|
226
|
+
state: 'normal'
|
|
162
227
|
}
|
|
163
|
-
}
|
|
164
|
-
]
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
label: {
|
|
168
|
-
en: 'Items gap'
|
|
169
|
-
},
|
|
170
|
-
controls: [
|
|
228
|
+
},
|
|
171
229
|
{
|
|
172
230
|
label: {
|
|
173
|
-
en: '
|
|
231
|
+
en: 'Corner'
|
|
174
232
|
},
|
|
175
233
|
setting: {
|
|
176
|
-
id: '
|
|
234
|
+
id: 'roundedState',
|
|
235
|
+
state: 'normal'
|
|
177
236
|
}
|
|
178
237
|
}
|
|
179
238
|
]
|
|
180
239
|
},
|
|
181
240
|
{
|
|
182
|
-
label: {
|
|
183
|
-
en: 'Countdown item'
|
|
184
|
-
},
|
|
185
241
|
controls: [
|
|
186
242
|
{
|
|
187
243
|
label: {
|
|
188
|
-
en: '
|
|
244
|
+
en: 'Item style'
|
|
189
245
|
},
|
|
190
246
|
setting: {
|
|
191
|
-
id: '
|
|
247
|
+
id: 'enableLabelTextStyle'
|
|
248
|
+
},
|
|
249
|
+
options: {
|
|
250
|
+
labelVariant: 'primary',
|
|
251
|
+
toggleStyle: 'switch'
|
|
192
252
|
}
|
|
193
253
|
},
|
|
194
254
|
{
|
|
195
255
|
label: {
|
|
196
|
-
en: '
|
|
256
|
+
en: 'Time'
|
|
197
257
|
},
|
|
258
|
+
conditionDisplay: 'enableLabelTextStyle == true',
|
|
198
259
|
type: 'combo',
|
|
199
260
|
iconName: 'polaris-text-title',
|
|
200
|
-
|
|
261
|
+
getValueFromSettingID: 'labelTypo.type',
|
|
201
262
|
isHideClear: true,
|
|
202
263
|
controls: [
|
|
203
264
|
{
|
|
204
265
|
setting: {
|
|
205
|
-
id: '
|
|
266
|
+
id: 'labelTypo'
|
|
206
267
|
},
|
|
207
268
|
layout: 'vertical'
|
|
208
269
|
}
|
|
209
270
|
]
|
|
271
|
+
}
|
|
272
|
+
]
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
controls: [
|
|
276
|
+
{
|
|
277
|
+
label: {
|
|
278
|
+
en: 'Caption'
|
|
279
|
+
},
|
|
280
|
+
setting: {
|
|
281
|
+
id: 'enableNumberTextStyle'
|
|
282
|
+
},
|
|
283
|
+
options: {
|
|
284
|
+
labelVariant: 'primary',
|
|
285
|
+
toggleStyle: 'switch'
|
|
286
|
+
}
|
|
210
287
|
},
|
|
211
288
|
{
|
|
212
289
|
label: {
|
|
213
|
-
en: '
|
|
290
|
+
en: 'Text style'
|
|
214
291
|
},
|
|
292
|
+
conditionDisplay: 'enableNumberTextStyle == true',
|
|
215
293
|
type: 'combo',
|
|
216
294
|
iconName: 'polaris-text-title',
|
|
217
|
-
fixedValue: 'Edit...',
|
|
218
295
|
isHideClear: true,
|
|
296
|
+
getValueFromSettingID: 'numTypo.type',
|
|
219
297
|
controls: [
|
|
220
298
|
{
|
|
221
299
|
setting: {
|
|
222
|
-
id: '
|
|
300
|
+
id: 'numTypo'
|
|
223
301
|
},
|
|
224
302
|
layout: 'vertical'
|
|
225
303
|
}
|
|
226
304
|
]
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
label: {
|
|
230
|
-
en: 'Gap to digit'
|
|
231
|
-
},
|
|
232
|
-
setting: {
|
|
233
|
-
id: 'verticalGap'
|
|
234
|
-
}
|
|
235
305
|
}
|
|
236
|
-
]
|
|
237
|
-
moreSettings: {
|
|
238
|
-
type: 'collapse',
|
|
239
|
-
controls: [
|
|
240
|
-
{
|
|
241
|
-
label: {
|
|
242
|
-
en: 'Background'
|
|
243
|
-
},
|
|
244
|
-
setting: {
|
|
245
|
-
id: 'backgroundItemColor'
|
|
246
|
-
}
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
label: {
|
|
250
|
-
en: 'Border'
|
|
251
|
-
},
|
|
252
|
-
setting: {
|
|
253
|
-
id: 'borderState',
|
|
254
|
-
state: 'normal'
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
label: {
|
|
259
|
-
en: 'Corner'
|
|
260
|
-
},
|
|
261
|
-
setting: {
|
|
262
|
-
id: 'roundedState',
|
|
263
|
-
state: 'normal'
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
]
|
|
267
|
-
}
|
|
306
|
+
]
|
|
268
307
|
},
|
|
269
308
|
{
|
|
270
309
|
label: {
|
|
271
|
-
en: '
|
|
310
|
+
en: 'Size'
|
|
272
311
|
},
|
|
273
312
|
controls: [
|
|
274
313
|
{
|
|
275
314
|
label: {
|
|
276
|
-
en: '
|
|
277
|
-
},
|
|
278
|
-
setting: {
|
|
279
|
-
id: 'borderState',
|
|
280
|
-
state: 'hover'
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
label: {
|
|
285
|
-
en: 'Corner'
|
|
315
|
+
en: 'Padding'
|
|
286
316
|
},
|
|
287
|
-
|
|
288
|
-
id: '
|
|
289
|
-
|
|
317
|
+
controlConfig: {
|
|
318
|
+
id: 'padding',
|
|
319
|
+
type: 'padding-v2',
|
|
320
|
+
linkWithSetting: {
|
|
321
|
+
name: 'spacing-setting',
|
|
322
|
+
field: 'padding'
|
|
323
|
+
}
|
|
290
324
|
}
|
|
291
325
|
}
|
|
292
326
|
]
|
|
@@ -295,14 +329,13 @@ const SettingUIV2 = [
|
|
|
295
329
|
label: {
|
|
296
330
|
en: 'Shape'
|
|
297
331
|
},
|
|
298
|
-
conditionDisplay: 'pageType != "POST_PURCHASE"',
|
|
299
332
|
controls: [
|
|
300
333
|
{
|
|
301
334
|
label: {
|
|
302
335
|
en: 'Border'
|
|
303
336
|
},
|
|
304
337
|
setting: {
|
|
305
|
-
id: '
|
|
338
|
+
id: 'borderState',
|
|
306
339
|
state: 'normal'
|
|
307
340
|
}
|
|
308
341
|
},
|
|
@@ -311,7 +344,7 @@ const SettingUIV2 = [
|
|
|
311
344
|
en: 'Corner'
|
|
312
345
|
},
|
|
313
346
|
setting: {
|
|
314
|
-
id: '
|
|
347
|
+
id: 'roundedState',
|
|
315
348
|
state: 'normal'
|
|
316
349
|
}
|
|
317
350
|
},
|
|
@@ -322,6 +355,50 @@ const SettingUIV2 = [
|
|
|
322
355
|
setting: {
|
|
323
356
|
id: 'boxShadow',
|
|
324
357
|
state: 'normal'
|
|
358
|
+
},
|
|
359
|
+
options: {
|
|
360
|
+
updateFields: [
|
|
361
|
+
{
|
|
362
|
+
field: 'enable',
|
|
363
|
+
settingId: 'advanced.hasBoxShadow',
|
|
364
|
+
state: 'normal'
|
|
365
|
+
}
|
|
366
|
+
]
|
|
367
|
+
},
|
|
368
|
+
controlChangeTrigger: {
|
|
369
|
+
settings: [
|
|
370
|
+
{
|
|
371
|
+
condition: `boxShadow.normal.enable === true`,
|
|
372
|
+
source: [
|
|
373
|
+
'boxShadow',
|
|
374
|
+
'hasBoxShadow'
|
|
375
|
+
],
|
|
376
|
+
action: {
|
|
377
|
+
controlId: 'hasBoxShadow',
|
|
378
|
+
groupType: 'advanced',
|
|
379
|
+
controlType: 'advanced',
|
|
380
|
+
state: 'normal',
|
|
381
|
+
newValue: true
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
condition: `boxShadow.normal.enable === false`,
|
|
386
|
+
source: [
|
|
387
|
+
'boxShadow',
|
|
388
|
+
'hasBoxShadow'
|
|
389
|
+
],
|
|
390
|
+
action: {
|
|
391
|
+
controlId: 'hasBoxShadow',
|
|
392
|
+
groupType: 'advanced',
|
|
393
|
+
controlType: 'advanced',
|
|
394
|
+
state: 'normal',
|
|
395
|
+
newValue: false
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
],
|
|
399
|
+
options: {
|
|
400
|
+
noRecordHistory: true
|
|
401
|
+
}
|
|
325
402
|
}
|
|
326
403
|
}
|
|
327
404
|
]
|
|
@@ -340,7 +340,7 @@ const DialogSettings = [
|
|
|
340
340
|
desktop: {
|
|
341
341
|
default: {
|
|
342
342
|
type: 'color',
|
|
343
|
-
color: 'bg-
|
|
343
|
+
color: 'bg-1',
|
|
344
344
|
image: {
|
|
345
345
|
src: '',
|
|
346
346
|
width: 0,
|
|
@@ -360,7 +360,7 @@ const DialogSettings = [
|
|
|
360
360
|
desktop: {
|
|
361
361
|
default: {
|
|
362
362
|
type: 'color',
|
|
363
|
-
color: 'bg-
|
|
363
|
+
color: 'bg-1',
|
|
364
364
|
image: {
|
|
365
365
|
src: 'https://ucarecdn.com/5e27d43d-eb1e-4e71-b7e1-4158f3071bb6/-/format/auto/',
|
|
366
366
|
width: 1200,
|
|
@@ -34,6 +34,7 @@ const ProductTag = ({ setting, styles, builderProps, advanced, pageContext })=>{
|
|
|
34
34
|
const wrapperTextClass = system.createClass(getClasses.getWrapperTextClass(styles));
|
|
35
35
|
const containerClass = system.createClass(getClasses.getContainerClass());
|
|
36
36
|
const productTagClass = system.createClass(getClasses.getProductTagClass(advanced));
|
|
37
|
+
const isTypePercentage = customContent?.unit === 'percentage';
|
|
37
38
|
const renderScript = ()=>{
|
|
38
39
|
const jsURL = core.isLocalEnv ? `{{ 'gp-product-tag.js' | asset_url }}` : `${core.baseAssetURL}/assets-v2/gp-product-tag.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;
|
|
39
40
|
return `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="${jsURL}" defer="defer"></script>`;
|
|
@@ -46,7 +47,7 @@ const ProductTag = ({ setting, styles, builderProps, advanced, pageContext })=>{
|
|
|
46
47
|
assign prefixVal = ${pageContext?.isPreviewing ? JSON.stringify(prefixVal) : prefixVal}
|
|
47
48
|
assign suffixVal = ${pageContext?.isPreviewing ? JSON.stringify(suffixVal) : suffixVal}
|
|
48
49
|
%}
|
|
49
|
-
${system.LiquidIf('salePrice == null or price == null', system.Liquid(`{% assign pricePercentage = prefixVal ${system.If(
|
|
50
|
+
${system.LiquidIf('salePrice == null or price == null', system.Liquid(`{% assign pricePercentage = prefixVal ${system.If(isTypePercentage, `| append: ' 0% '`, `| ${moneyFormat} | append: ' '`)} | append: suffixVal %}`), `${system.If(isTypePercentage, `{% assign salePercent = priceSave | divided_by: salePrice | times: 100 | round %}
|
|
50
51
|
{% assign pricePercentage = prefixVal | append: ' ' | append: salePercent | append: '% ' | append: suffixVal %}`, system.LiquidIf('priceSave > 0', `{% assign priceSaveMoney = priceSave | ${moneyFormat} %}
|
|
51
52
|
{% assign pricePercentage = prefixVal | append: ' ' | append: priceSaveMoney | append: ' ' | append: suffixVal %}`, `{% assign priceSaveMoney = 0 | ${moneyFormat} %}
|
|
52
53
|
{% assign pricePercentage = prefixVal | append: ' ' | append: priceSaveMoney | append: ' ' | append: suffixVal %}`))}`)}
|
|
@@ -55,7 +56,7 @@ const ProductTag = ({ setting, styles, builderProps, advanced, pageContext })=>{
|
|
|
55
56
|
class="${productTagClass}"
|
|
56
57
|
style="${rootStyle}"
|
|
57
58
|
data-id="${builderProps?.uid}"
|
|
58
|
-
data-disabled="{
|
|
59
|
+
data-disabled="${system.LiquidIf(`${system.If(isTypePercentage, 'salePercent', 'priceSave')} > 0`, `false`, `true`)}"
|
|
59
60
|
gp-data='{"setting":${JSON.stringify(setting).replaceAll("'", ''')}, "id": "${builderProps?.uid}", "locale": "{{shop.locale}}", "currency": "{{shop.currency}}", "moneyFormat": "{{ ${setting?.moneyWithCurrentFormat ? 'shop.money_with_currency_format' : 'shop.money_format'} | replace: '"', '\\"' | escape }}"}'
|
|
60
61
|
price-save="{{priceSave}}"
|
|
61
62
|
>
|
|
@@ -8,7 +8,8 @@ var Text_liquid = require('../../../text/components/Text.liquid.js');
|
|
|
8
8
|
var system = require('@gem-sdk/system');
|
|
9
9
|
|
|
10
10
|
const ProductSku = ({ setting, styles, advanced, builderProps })=>{
|
|
11
|
-
const
|
|
11
|
+
const isCapitalize = styles?.typo?.attrs?.transform === 'capitalize';
|
|
12
|
+
const labelContent = setting?.label && setting.label.trim().length ? `${isCapitalize ? setting.label.toString().toLocaleLowerCase() : setting.label}` : '';
|
|
12
13
|
// remove underlineLink from element 7.5
|
|
13
14
|
if (styles?.disableHoverColor) delete styles.underlineLink;
|
|
14
15
|
const renderScript = ()=>{
|
|
@@ -24,7 +25,7 @@ const ProductSku = ({ setting, styles, advanced, builderProps })=>{
|
|
|
24
25
|
styles: styles,
|
|
25
26
|
setting: {
|
|
26
27
|
...setting,
|
|
27
|
-
text:
|
|
28
|
+
text: `${system.LiquidIf('currentVariant.sku.size > 0 ', `${labelContent} ${system.If(isCapitalize, `{{ currentVariant.sku | downcase }}`, `{{ currentVariant.sku }}`)}`)}`,
|
|
28
29
|
excludeFlex: true,
|
|
29
30
|
isForceValue: true
|
|
30
31
|
},
|
|
@@ -36,6 +36,11 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
|
|
|
36
36
|
d: advancedDisplay
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
+
// Fix for drawer page content theme 1.0
|
|
40
|
+
const styleInline = `.drawer-page-content {
|
|
41
|
+
transform: none !important;
|
|
42
|
+
-webkit-transform: none !important;
|
|
43
|
+
}`;
|
|
39
44
|
return core.template`
|
|
40
45
|
${core.RenderIf(!!preloadBgImage, `${core.RenderIf(!!background?.desktop?.image?.src, `<link rel="preload" href="${background?.desktop?.image?.src}" as="image" />`)}${core.RenderIf(!!background?.tablet?.image?.src, `<link rel="preload" href="${background?.tablet?.image?.src}" as="image" />`)}${core.RenderIf(!!background?.mobile?.image?.src, `<link rel="preload" href="${background?.mobile?.image?.src}" as="image" />`)}`)}
|
|
41
46
|
<gp-sticky
|
|
@@ -46,6 +51,7 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
|
|
|
46
51
|
class="${computedContainerClasses} ${helpers.getSettingPreloadData('gps-lazy')}"
|
|
47
52
|
style="${computedContainerStyles}"
|
|
48
53
|
>
|
|
54
|
+
<style>${styleInline}</style>
|
|
49
55
|
<div ${{
|
|
50
56
|
...builderAttrs
|
|
51
57
|
}} style="${{
|
|
@@ -67,7 +67,7 @@ const StockCounterSettingsV2 = [
|
|
|
67
67
|
{
|
|
68
68
|
id: 'remaining',
|
|
69
69
|
type: 'input:stepper',
|
|
70
|
-
default:
|
|
70
|
+
default: 4
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
id: 'displayCondition',
|
|
@@ -103,7 +103,7 @@ const StockCounterSettingsV2 = [
|
|
|
103
103
|
id: 'oosIcon',
|
|
104
104
|
label: '',
|
|
105
105
|
type: 'icon',
|
|
106
|
-
default: `<svg width="100%" height="100%" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> <path d="M7.75193 0.0658784C7.90565 -0.0219595 8.09435 -0.0219595 8.24807 0.0658784L11.9981 2.20874C12.1539 2.29776 12.25 2.46343 12.25 2.64286V6.63841L15.7481 8.63731C15.9039 8.72633 16 8.892 16 9.07143V13.3571C16 13.5366 15.9039 13.7022 15.7481 13.7913L11.9981 15.9341C11.8444 16.022 11.6556 16.022 11.5019 15.9341L8 13.933L4.49807 15.9341C4.34435 16.022 4.15565 16.022 4.00193 15.9341L0.25193 13.7913C0.096143 13.7022 0 13.5366 0 13.3571V9.07143C0 8.892 0.096143 8.72633 0.251931 8.63731L3.75 6.63841V2.64286C3.75 2.46343 3.84614 2.29776 4.00193 2.20874L7.75193 0.0658784ZM4.25 7.50445L1.50778 9.07143L4.25 10.6384L6.99222 9.07143L4.25 7.50445ZM7.5 9.93302L4.75 11.5044V14.6384L7.5 13.067V9.93302ZM8.5 13.067L11.25 14.6384V11.5044L8.5 9.93302V13.067ZM9.00778 9.07143L11.75 10.6384L14.4922 9.07143L11.75 7.50445L9.00778 9.07143ZM11.25 6.63841V3.50445L8.5 5.07588V8.20984L11.25 6.63841ZM7.5 8.20984V5.07588L4.75 3.50445V6.63841L7.5 8.20984ZM5.25778 2.64286L8 4.20984L10.7422 2.64286L8 1.07588L5.25778 2.64286ZM15 9.93302L12.25 11.5044V14.6384L15 13.067V9.93302ZM3.75 14.6384V11.5044L1 9.93302V13.067L3.75 14.6384Z" fill="currentColor"/> </svg>`
|
|
106
|
+
default: `<svg data-name="boxes" width="100%" height="100%" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> <path d="M7.75193 0.0658784C7.90565 -0.0219595 8.09435 -0.0219595 8.24807 0.0658784L11.9981 2.20874C12.1539 2.29776 12.25 2.46343 12.25 2.64286V6.63841L15.7481 8.63731C15.9039 8.72633 16 8.892 16 9.07143V13.3571C16 13.5366 15.9039 13.7022 15.7481 13.7913L11.9981 15.9341C11.8444 16.022 11.6556 16.022 11.5019 15.9341L8 13.933L4.49807 15.9341C4.34435 16.022 4.15565 16.022 4.00193 15.9341L0.25193 13.7913C0.096143 13.7022 0 13.5366 0 13.3571V9.07143C0 8.892 0.096143 8.72633 0.251931 8.63731L3.75 6.63841V2.64286C3.75 2.46343 3.84614 2.29776 4.00193 2.20874L7.75193 0.0658784ZM4.25 7.50445L1.50778 9.07143L4.25 10.6384L6.99222 9.07143L4.25 7.50445ZM7.5 9.93302L4.75 11.5044V14.6384L7.5 13.067V9.93302ZM8.5 13.067L11.25 14.6384V11.5044L8.5 9.93302V13.067ZM9.00778 9.07143L11.75 10.6384L14.4922 9.07143L11.75 7.50445L9.00778 9.07143ZM11.25 6.63841V3.50445L8.5 5.07588V8.20984L11.25 6.63841ZM7.5 8.20984V5.07588L4.75 3.50445V6.63841L7.5 8.20984ZM5.25778 2.64286L8 4.20984L10.7422 2.64286L8 1.07588L5.25778 2.64286ZM15 9.93302L12.25 11.5044V14.6384L15 13.067V9.93302ZM3.75 14.6384V11.5044L1 9.93302V13.067L3.75 14.6384Z" fill="currentColor"/> </svg>`
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
109
|
id: 'hiddenCounterWhenOutOfStock',
|
|
@@ -131,8 +131,9 @@ const StockCounterSettingsV2 = [
|
|
|
131
131
|
type: 'textarea',
|
|
132
132
|
autoHeight: true,
|
|
133
133
|
showPlusBtn: true,
|
|
134
|
-
default:
|
|
134
|
+
default: `Only ${_const.DEFAULT_QUANTITY_TEMPLATE} left`,
|
|
135
135
|
info: `Use ${_const.DEFAULT_QUANTITY_TEMPLATE} to represent remaining number`,
|
|
136
|
+
minHeight: 56,
|
|
136
137
|
suggestContents: [
|
|
137
138
|
{
|
|
138
139
|
message: '%number%',
|
|
@@ -151,7 +152,7 @@ const StockCounterSettingsV2 = [
|
|
|
151
152
|
label: 'Continue Selling When Out Of Stock Message',
|
|
152
153
|
type: 'textarea',
|
|
153
154
|
autoHeight: true,
|
|
154
|
-
default: '
|
|
155
|
+
default: 'Restock soon! PREORDER NOW',
|
|
155
156
|
info: 'Turn out-of-stock productions into pre-orders'
|
|
156
157
|
},
|
|
157
158
|
{
|
|
@@ -159,7 +160,7 @@ const StockCounterSettingsV2 = [
|
|
|
159
160
|
label: 'Unlimited Quantity Message',
|
|
160
161
|
type: 'textarea',
|
|
161
162
|
autoHeight: true,
|
|
162
|
-
default: '
|
|
163
|
+
default: 'Hurry! LET BUY NOW'
|
|
163
164
|
}
|
|
164
165
|
]
|
|
165
166
|
},
|
|
@@ -178,7 +179,7 @@ const StockCounterSettingsV2 = [
|
|
|
178
179
|
id: 'icon',
|
|
179
180
|
label: '',
|
|
180
181
|
type: 'icon',
|
|
181
|
-
default: `<svg style="width: 100%; height: 100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"> <path fill="currentColor" strokeLinecap="round" strokeLinejoin="round" fill="currentColor" d="M176.64 11.488A16 16 0 0 1 192 0h128a16 16 0 0 1 15.168 21.056L278.208 192H400a16 16 0 0 1 12.64 25.824l-224 288a16 16 0 0 1 -27.936 -14.528L218.336 304H112a16 16 0 0 1 -15.36 -20.512l80 -272z" /></svg>`
|
|
182
|
+
default: `<svg data-name="Lightning" style="width: 100%; height: 100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"> <path fill="currentColor" strokeLinecap="round" strokeLinejoin="round" fill="currentColor" d="M176.64 11.488A16 16 0 0 1 192 0h128a16 16 0 0 1 15.168 21.056L278.208 192H400a16 16 0 0 1 12.64 25.824l-224 288a16 16 0 0 1 -27.936 -14.528L218.336 304H112a16 16 0 0 1 -15.36 -20.512l80 -272z" /></svg>`
|
|
182
183
|
}
|
|
183
184
|
]
|
|
184
185
|
},
|
|
@@ -363,19 +363,49 @@ const SettingUIV2 = [
|
|
|
363
363
|
controls: [
|
|
364
364
|
{
|
|
365
365
|
label: {
|
|
366
|
+
en: 'Sell when OOS'
|
|
367
|
+
},
|
|
368
|
+
type: 'combo',
|
|
369
|
+
iconName: 'polaris-text-block',
|
|
370
|
+
getValueFromSettingID: 'continueSelling',
|
|
371
|
+
isHideClear: true,
|
|
372
|
+
popoverLabel: {
|
|
366
373
|
en: 'Out of stock sell'
|
|
367
374
|
},
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
375
|
+
controls: [
|
|
376
|
+
{
|
|
377
|
+
label: {
|
|
378
|
+
en: 'Content'
|
|
379
|
+
},
|
|
380
|
+
setting: {
|
|
381
|
+
id: 'continueSelling'
|
|
382
|
+
},
|
|
383
|
+
layout: 'vertical'
|
|
384
|
+
}
|
|
385
|
+
]
|
|
371
386
|
},
|
|
372
387
|
{
|
|
373
388
|
label: {
|
|
389
|
+
en: 'Unlimited stock'
|
|
390
|
+
},
|
|
391
|
+
type: 'combo',
|
|
392
|
+
iconName: 'polaris-text-block',
|
|
393
|
+
getValueFromSettingID: 'unlimitedQuantityMessage',
|
|
394
|
+
isHideClear: true,
|
|
395
|
+
popoverLabel: {
|
|
374
396
|
en: 'Unlimited quantity'
|
|
375
397
|
},
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
398
|
+
controls: [
|
|
399
|
+
{
|
|
400
|
+
label: {
|
|
401
|
+
en: 'Content'
|
|
402
|
+
},
|
|
403
|
+
setting: {
|
|
404
|
+
id: 'unlimitedQuantityMessage'
|
|
405
|
+
},
|
|
406
|
+
layout: 'vertical'
|
|
407
|
+
}
|
|
408
|
+
]
|
|
379
409
|
}
|
|
380
410
|
]
|
|
381
411
|
},
|
|
@@ -81,7 +81,6 @@ const ArticleList = ({ styles, setting, className, children, builderProps })=>{
|
|
|
81
81
|
styles: {
|
|
82
82
|
horizontalGutter: styles?.horizontalGutter,
|
|
83
83
|
verticalGutter: styles?.verticalGutter,
|
|
84
|
-
fullWidth: styles?.fullWidth,
|
|
85
84
|
spacing: styles?.spacing,
|
|
86
85
|
width: styles?.width,
|
|
87
86
|
height: styles?.height
|
|
@@ -108,7 +107,7 @@ const ArticleList = ({ styles, setting, className, children, builderProps })=>{
|
|
|
108
107
|
},
|
|
109
108
|
children: /*#__PURE__*/ jsx("div", {
|
|
110
109
|
style: {
|
|
111
|
-
...makeStyleResponsive('w', makeWidth(styles?.width
|
|
110
|
+
...makeStyleResponsive('w', makeWidth(styles?.width)),
|
|
112
111
|
...makeStyleResponsive('rg', styles?.horizontalGutter),
|
|
113
112
|
...makeStyleResponsive('cg', styles?.verticalGutter),
|
|
114
113
|
...getStyleBackgroundByDevice(setting?.background),
|
|
@@ -27,7 +27,7 @@ const ArticleList = ({ setting, styles, className, children, advanced, builderPr
|
|
|
27
27
|
}}"
|
|
28
28
|
>
|
|
29
29
|
<div style="${{
|
|
30
|
-
...makeStyleResponsive('w', makeWidth(styles?.width
|
|
30
|
+
...makeStyleResponsive('w', makeWidth(styles?.width)),
|
|
31
31
|
...makeStyleResponsive('rg', styles?.horizontalGutter),
|
|
32
32
|
...makeStyleResponsive('cg', styles?.verticalGutter),
|
|
33
33
|
...getStyleBackgroundByDevice(setting?.background),
|