@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,4 +1,60 @@
|
|
|
1
1
|
const SettingUIV2 = [
|
|
2
|
+
{
|
|
3
|
+
label: {
|
|
4
|
+
en: 'Countdown time'
|
|
5
|
+
},
|
|
6
|
+
controls: [
|
|
7
|
+
{
|
|
8
|
+
label: {
|
|
9
|
+
en: 'Run type'
|
|
10
|
+
},
|
|
11
|
+
setting: {
|
|
12
|
+
id: 'behaviour'
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
conditionDisplay: 'behaviour === "standard"',
|
|
17
|
+
label: {
|
|
18
|
+
en: 'Date'
|
|
19
|
+
},
|
|
20
|
+
setting: {
|
|
21
|
+
id: 'dateStandard'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
conditionDisplay: 'behaviour === "standard"',
|
|
26
|
+
label: {
|
|
27
|
+
en: 'Time zone'
|
|
28
|
+
},
|
|
29
|
+
setting: {
|
|
30
|
+
id: 'timeZone'
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
conditionDisplay: 'behaviour === "daily"',
|
|
35
|
+
setting: {
|
|
36
|
+
id: 'timerDaily'
|
|
37
|
+
},
|
|
38
|
+
layout: 'vertical'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
conditionDisplay: 'behaviour === "evergreen"',
|
|
42
|
+
setting: {
|
|
43
|
+
id: 'timerEverygreen'
|
|
44
|
+
},
|
|
45
|
+
layout: 'vertical'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
conditionDisplay: 'behaviour === "evergreen"',
|
|
49
|
+
label: {
|
|
50
|
+
en: 'Loop (refresh after finish)'
|
|
51
|
+
},
|
|
52
|
+
setting: {
|
|
53
|
+
id: 'loopAfterFinish'
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
},
|
|
2
58
|
{
|
|
3
59
|
label: {
|
|
4
60
|
en: 'Item management'
|
|
@@ -7,7 +63,7 @@ const SettingUIV2 = [
|
|
|
7
63
|
{
|
|
8
64
|
type: 'combo',
|
|
9
65
|
label: {
|
|
10
|
-
en: '
|
|
66
|
+
en: 'Items'
|
|
11
67
|
},
|
|
12
68
|
fixedValue: 'Edit...',
|
|
13
69
|
iconName: 'polaris-list-bulleted',
|
|
@@ -107,184 +163,162 @@ const SettingUIV2 = [
|
|
|
107
163
|
},
|
|
108
164
|
{
|
|
109
165
|
label: {
|
|
110
|
-
en: '
|
|
166
|
+
en: 'Hover effect'
|
|
111
167
|
},
|
|
112
168
|
controls: [
|
|
113
169
|
{
|
|
114
170
|
label: {
|
|
115
|
-
en: '
|
|
171
|
+
en: 'Border'
|
|
116
172
|
},
|
|
117
173
|
setting: {
|
|
118
|
-
id: '
|
|
174
|
+
id: 'borderState',
|
|
175
|
+
state: 'hover'
|
|
119
176
|
}
|
|
120
177
|
},
|
|
121
178
|
{
|
|
122
|
-
conditionDisplay: 'behaviour === "standard"',
|
|
123
179
|
label: {
|
|
124
|
-
en: '
|
|
180
|
+
en: 'Corner'
|
|
125
181
|
},
|
|
126
182
|
setting: {
|
|
127
|
-
id: '
|
|
183
|
+
id: 'roundedState',
|
|
184
|
+
state: 'hover'
|
|
128
185
|
}
|
|
129
|
-
}
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
label: {
|
|
191
|
+
en: 'Item style'
|
|
192
|
+
},
|
|
193
|
+
controls: [
|
|
130
194
|
{
|
|
131
|
-
conditionDisplay: 'behaviour === "standard"',
|
|
132
195
|
label: {
|
|
133
|
-
en: '
|
|
196
|
+
en: 'Item gap'
|
|
134
197
|
},
|
|
135
198
|
setting: {
|
|
136
|
-
id: '
|
|
199
|
+
id: 'horizontalGap'
|
|
137
200
|
}
|
|
138
201
|
},
|
|
139
202
|
{
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
id: 'timerDaily'
|
|
203
|
+
label: {
|
|
204
|
+
en: 'Padding'
|
|
143
205
|
},
|
|
144
|
-
|
|
206
|
+
setting: {
|
|
207
|
+
id: 'itemPadding'
|
|
208
|
+
}
|
|
145
209
|
},
|
|
146
210
|
{
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
id: 'timerEverygreen'
|
|
211
|
+
label: {
|
|
212
|
+
en: 'Background'
|
|
150
213
|
},
|
|
151
|
-
|
|
214
|
+
setting: {
|
|
215
|
+
id: 'backgroundItemColor'
|
|
216
|
+
}
|
|
152
217
|
},
|
|
153
218
|
{
|
|
154
|
-
conditionDisplay: 'behaviour === "evergreen"',
|
|
155
219
|
label: {
|
|
156
|
-
en: '
|
|
220
|
+
en: 'Border'
|
|
157
221
|
},
|
|
158
222
|
setting: {
|
|
159
|
-
id: '
|
|
223
|
+
id: 'borderState',
|
|
224
|
+
state: 'normal'
|
|
160
225
|
}
|
|
161
|
-
}
|
|
162
|
-
]
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
label: {
|
|
166
|
-
en: 'Items gap'
|
|
167
|
-
},
|
|
168
|
-
controls: [
|
|
226
|
+
},
|
|
169
227
|
{
|
|
170
228
|
label: {
|
|
171
|
-
en: '
|
|
229
|
+
en: 'Corner'
|
|
172
230
|
},
|
|
173
231
|
setting: {
|
|
174
|
-
id: '
|
|
232
|
+
id: 'roundedState',
|
|
233
|
+
state: 'normal'
|
|
175
234
|
}
|
|
176
235
|
}
|
|
177
236
|
]
|
|
178
237
|
},
|
|
179
238
|
{
|
|
180
|
-
label: {
|
|
181
|
-
en: 'Countdown item'
|
|
182
|
-
},
|
|
183
239
|
controls: [
|
|
184
240
|
{
|
|
185
241
|
label: {
|
|
186
|
-
en: '
|
|
242
|
+
en: 'Item style'
|
|
187
243
|
},
|
|
188
244
|
setting: {
|
|
189
|
-
id: '
|
|
245
|
+
id: 'enableLabelTextStyle'
|
|
246
|
+
},
|
|
247
|
+
options: {
|
|
248
|
+
labelVariant: 'primary',
|
|
249
|
+
toggleStyle: 'switch'
|
|
190
250
|
}
|
|
191
251
|
},
|
|
192
252
|
{
|
|
193
253
|
label: {
|
|
194
|
-
en: '
|
|
254
|
+
en: 'Time'
|
|
195
255
|
},
|
|
256
|
+
conditionDisplay: 'enableLabelTextStyle == true',
|
|
196
257
|
type: 'combo',
|
|
197
258
|
iconName: 'polaris-text-title',
|
|
198
|
-
|
|
259
|
+
getValueFromSettingID: 'labelTypo.type',
|
|
199
260
|
isHideClear: true,
|
|
200
261
|
controls: [
|
|
201
262
|
{
|
|
202
263
|
setting: {
|
|
203
|
-
id: '
|
|
264
|
+
id: 'labelTypo'
|
|
204
265
|
},
|
|
205
266
|
layout: 'vertical'
|
|
206
267
|
}
|
|
207
268
|
]
|
|
269
|
+
}
|
|
270
|
+
]
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
controls: [
|
|
274
|
+
{
|
|
275
|
+
label: {
|
|
276
|
+
en: 'Caption'
|
|
277
|
+
},
|
|
278
|
+
setting: {
|
|
279
|
+
id: 'enableNumberTextStyle'
|
|
280
|
+
},
|
|
281
|
+
options: {
|
|
282
|
+
labelVariant: 'primary',
|
|
283
|
+
toggleStyle: 'switch'
|
|
284
|
+
}
|
|
208
285
|
},
|
|
209
286
|
{
|
|
210
287
|
label: {
|
|
211
|
-
en: '
|
|
288
|
+
en: 'Text style'
|
|
212
289
|
},
|
|
290
|
+
conditionDisplay: 'enableNumberTextStyle == true',
|
|
213
291
|
type: 'combo',
|
|
214
292
|
iconName: 'polaris-text-title',
|
|
215
|
-
fixedValue: 'Edit...',
|
|
216
293
|
isHideClear: true,
|
|
294
|
+
getValueFromSettingID: 'numTypo.type',
|
|
217
295
|
controls: [
|
|
218
296
|
{
|
|
219
297
|
setting: {
|
|
220
|
-
id: '
|
|
298
|
+
id: 'numTypo'
|
|
221
299
|
},
|
|
222
300
|
layout: 'vertical'
|
|
223
301
|
}
|
|
224
302
|
]
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
label: {
|
|
228
|
-
en: 'Gap to digit'
|
|
229
|
-
},
|
|
230
|
-
setting: {
|
|
231
|
-
id: 'verticalGap'
|
|
232
|
-
}
|
|
233
303
|
}
|
|
234
|
-
]
|
|
235
|
-
moreSettings: {
|
|
236
|
-
type: 'collapse',
|
|
237
|
-
controls: [
|
|
238
|
-
{
|
|
239
|
-
label: {
|
|
240
|
-
en: 'Background'
|
|
241
|
-
},
|
|
242
|
-
setting: {
|
|
243
|
-
id: 'backgroundItemColor'
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
label: {
|
|
248
|
-
en: 'Border'
|
|
249
|
-
},
|
|
250
|
-
setting: {
|
|
251
|
-
id: 'borderState',
|
|
252
|
-
state: 'normal'
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
label: {
|
|
257
|
-
en: 'Corner'
|
|
258
|
-
},
|
|
259
|
-
setting: {
|
|
260
|
-
id: 'roundedState',
|
|
261
|
-
state: 'normal'
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
]
|
|
265
|
-
}
|
|
304
|
+
]
|
|
266
305
|
},
|
|
267
306
|
{
|
|
268
307
|
label: {
|
|
269
|
-
en: '
|
|
308
|
+
en: 'Size'
|
|
270
309
|
},
|
|
271
310
|
controls: [
|
|
272
311
|
{
|
|
273
312
|
label: {
|
|
274
|
-
en: '
|
|
275
|
-
},
|
|
276
|
-
setting: {
|
|
277
|
-
id: 'borderState',
|
|
278
|
-
state: 'hover'
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
label: {
|
|
283
|
-
en: 'Corner'
|
|
313
|
+
en: 'Padding'
|
|
284
314
|
},
|
|
285
|
-
|
|
286
|
-
id: '
|
|
287
|
-
|
|
315
|
+
controlConfig: {
|
|
316
|
+
id: 'padding',
|
|
317
|
+
type: 'padding-v2',
|
|
318
|
+
linkWithSetting: {
|
|
319
|
+
name: 'spacing-setting',
|
|
320
|
+
field: 'padding'
|
|
321
|
+
}
|
|
288
322
|
}
|
|
289
323
|
}
|
|
290
324
|
]
|
|
@@ -293,14 +327,13 @@ const SettingUIV2 = [
|
|
|
293
327
|
label: {
|
|
294
328
|
en: 'Shape'
|
|
295
329
|
},
|
|
296
|
-
conditionDisplay: 'pageType != "POST_PURCHASE"',
|
|
297
330
|
controls: [
|
|
298
331
|
{
|
|
299
332
|
label: {
|
|
300
333
|
en: 'Border'
|
|
301
334
|
},
|
|
302
335
|
setting: {
|
|
303
|
-
id: '
|
|
336
|
+
id: 'borderState',
|
|
304
337
|
state: 'normal'
|
|
305
338
|
}
|
|
306
339
|
},
|
|
@@ -309,7 +342,7 @@ const SettingUIV2 = [
|
|
|
309
342
|
en: 'Corner'
|
|
310
343
|
},
|
|
311
344
|
setting: {
|
|
312
|
-
id: '
|
|
345
|
+
id: 'roundedState',
|
|
313
346
|
state: 'normal'
|
|
314
347
|
}
|
|
315
348
|
},
|
|
@@ -320,6 +353,50 @@ const SettingUIV2 = [
|
|
|
320
353
|
setting: {
|
|
321
354
|
id: 'boxShadow',
|
|
322
355
|
state: 'normal'
|
|
356
|
+
},
|
|
357
|
+
options: {
|
|
358
|
+
updateFields: [
|
|
359
|
+
{
|
|
360
|
+
field: 'enable',
|
|
361
|
+
settingId: 'advanced.hasBoxShadow',
|
|
362
|
+
state: 'normal'
|
|
363
|
+
}
|
|
364
|
+
]
|
|
365
|
+
},
|
|
366
|
+
controlChangeTrigger: {
|
|
367
|
+
settings: [
|
|
368
|
+
{
|
|
369
|
+
condition: `boxShadow.normal.enable === true`,
|
|
370
|
+
source: [
|
|
371
|
+
'boxShadow',
|
|
372
|
+
'hasBoxShadow'
|
|
373
|
+
],
|
|
374
|
+
action: {
|
|
375
|
+
controlId: 'hasBoxShadow',
|
|
376
|
+
groupType: 'advanced',
|
|
377
|
+
controlType: 'advanced',
|
|
378
|
+
state: 'normal',
|
|
379
|
+
newValue: true
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
condition: `boxShadow.normal.enable === false`,
|
|
384
|
+
source: [
|
|
385
|
+
'boxShadow',
|
|
386
|
+
'hasBoxShadow'
|
|
387
|
+
],
|
|
388
|
+
action: {
|
|
389
|
+
controlId: 'hasBoxShadow',
|
|
390
|
+
groupType: 'advanced',
|
|
391
|
+
controlType: 'advanced',
|
|
392
|
+
state: 'normal',
|
|
393
|
+
newValue: false
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
],
|
|
397
|
+
options: {
|
|
398
|
+
noRecordHistory: true
|
|
399
|
+
}
|
|
323
400
|
}
|
|
324
401
|
}
|
|
325
402
|
]
|
|
@@ -338,7 +338,7 @@ const DialogSettings = [
|
|
|
338
338
|
desktop: {
|
|
339
339
|
default: {
|
|
340
340
|
type: 'color',
|
|
341
|
-
color: 'bg-
|
|
341
|
+
color: 'bg-1',
|
|
342
342
|
image: {
|
|
343
343
|
src: '',
|
|
344
344
|
width: 0,
|
|
@@ -358,7 +358,7 @@ const DialogSettings = [
|
|
|
358
358
|
desktop: {
|
|
359
359
|
default: {
|
|
360
360
|
type: 'color',
|
|
361
|
-
color: 'bg-
|
|
361
|
+
color: 'bg-1',
|
|
362
362
|
image: {
|
|
363
363
|
src: 'https://ucarecdn.com/5e27d43d-eb1e-4e71-b7e1-4158f3071bb6/-/format/auto/',
|
|
364
364
|
width: 1200,
|
|
@@ -30,6 +30,7 @@ const ProductTag = ({ setting, styles, builderProps, advanced, pageContext })=>{
|
|
|
30
30
|
const wrapperTextClass = createClass(getWrapperTextClass(styles));
|
|
31
31
|
const containerClass = createClass(getContainerClass());
|
|
32
32
|
const productTagClass = createClass(getProductTagClass(advanced));
|
|
33
|
+
const isTypePercentage = customContent?.unit === 'percentage';
|
|
33
34
|
const renderScript = ()=>{
|
|
34
35
|
const jsURL = isLocalEnv ? `{{ 'gp-product-tag.js' | asset_url }}` : `${baseAssetURL}/assets-v2/gp-product-tag.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;
|
|
35
36
|
return `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="${jsURL}" defer="defer"></script>`;
|
|
@@ -42,7 +43,7 @@ const ProductTag = ({ setting, styles, builderProps, advanced, pageContext })=>{
|
|
|
42
43
|
assign prefixVal = ${pageContext?.isPreviewing ? JSON.stringify(prefixVal) : prefixVal}
|
|
43
44
|
assign suffixVal = ${pageContext?.isPreviewing ? JSON.stringify(suffixVal) : suffixVal}
|
|
44
45
|
%}
|
|
45
|
-
${LiquidIf('salePrice == null or price == null', Liquid(`{% assign pricePercentage = prefixVal ${If(
|
|
46
|
+
${LiquidIf('salePrice == null or price == null', Liquid(`{% assign pricePercentage = prefixVal ${If(isTypePercentage, `| append: ' 0% '`, `| ${moneyFormat} | append: ' '`)} | append: suffixVal %}`), `${If(isTypePercentage, `{% assign salePercent = priceSave | divided_by: salePrice | times: 100 | round %}
|
|
46
47
|
{% assign pricePercentage = prefixVal | append: ' ' | append: salePercent | append: '% ' | append: suffixVal %}`, LiquidIf('priceSave > 0', `{% assign priceSaveMoney = priceSave | ${moneyFormat} %}
|
|
47
48
|
{% assign pricePercentage = prefixVal | append: ' ' | append: priceSaveMoney | append: ' ' | append: suffixVal %}`, `{% assign priceSaveMoney = 0 | ${moneyFormat} %}
|
|
48
49
|
{% assign pricePercentage = prefixVal | append: ' ' | append: priceSaveMoney | append: ' ' | append: suffixVal %}`))}`)}
|
|
@@ -51,7 +52,7 @@ const ProductTag = ({ setting, styles, builderProps, advanced, pageContext })=>{
|
|
|
51
52
|
class="${productTagClass}"
|
|
52
53
|
style="${rootStyle}"
|
|
53
54
|
data-id="${builderProps?.uid}"
|
|
54
|
-
data-disabled="{
|
|
55
|
+
data-disabled="${LiquidIf(`${If(isTypePercentage, 'salePercent', 'priceSave')} > 0`, `false`, `true`)}"
|
|
55
56
|
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 }}"}'
|
|
56
57
|
price-save="{{priceSave}}"
|
|
57
58
|
>
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { template, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
|
|
2
2
|
import { getSettingPreloadData } from '../../../helpers.js';
|
|
3
3
|
import Text from '../../../text/components/Text.liquid.js';
|
|
4
|
-
import { LiquidUnless } from '@gem-sdk/system';
|
|
4
|
+
import { LiquidUnless, LiquidIf, If } from '@gem-sdk/system';
|
|
5
5
|
|
|
6
6
|
const ProductSku = ({ setting, styles, advanced, builderProps })=>{
|
|
7
|
-
const
|
|
7
|
+
const isCapitalize = styles?.typo?.attrs?.transform === 'capitalize';
|
|
8
|
+
const labelContent = setting?.label && setting.label.trim().length ? `${isCapitalize ? setting.label.toString().toLocaleLowerCase() : setting.label}` : '';
|
|
8
9
|
// remove underlineLink from element 7.5
|
|
9
10
|
if (styles?.disableHoverColor) delete styles.underlineLink;
|
|
10
11
|
const renderScript = ()=>{
|
|
@@ -20,7 +21,7 @@ const ProductSku = ({ setting, styles, advanced, builderProps })=>{
|
|
|
20
21
|
styles: styles,
|
|
21
22
|
setting: {
|
|
22
23
|
...setting,
|
|
23
|
-
text:
|
|
24
|
+
text: `${LiquidIf('currentVariant.sku.size > 0 ', `${labelContent} ${If(isCapitalize, `{{ currentVariant.sku | downcase }}`, `{{ currentVariant.sku }}`)}`)}`,
|
|
24
25
|
excludeFlex: true,
|
|
25
26
|
isForceValue: true
|
|
26
27
|
},
|
|
@@ -32,6 +32,11 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
|
|
|
32
32
|
d: advancedDisplay
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
|
+
// Fix for drawer page content theme 1.0
|
|
36
|
+
const styleInline = `.drawer-page-content {
|
|
37
|
+
transform: none !important;
|
|
38
|
+
-webkit-transform: none !important;
|
|
39
|
+
}`;
|
|
35
40
|
return template`
|
|
36
41
|
${RenderIf(!!preloadBgImage, `${RenderIf(!!background?.desktop?.image?.src, `<link rel="preload" href="${background?.desktop?.image?.src}" as="image" />`)}${RenderIf(!!background?.tablet?.image?.src, `<link rel="preload" href="${background?.tablet?.image?.src}" as="image" />`)}${RenderIf(!!background?.mobile?.image?.src, `<link rel="preload" href="${background?.mobile?.image?.src}" as="image" />`)}`)}
|
|
37
42
|
<gp-sticky
|
|
@@ -42,6 +47,7 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
|
|
|
42
47
|
class="${computedContainerClasses} ${getSettingPreloadData('gps-lazy')}"
|
|
43
48
|
style="${computedContainerStyles}"
|
|
44
49
|
>
|
|
50
|
+
<style>${styleInline}</style>
|
|
45
51
|
<div ${{
|
|
46
52
|
...builderAttrs
|
|
47
53
|
}} style="${{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_SCARCITY_THRESHOLD,
|
|
1
|
+
import { DEFAULT_SCARCITY_THRESHOLD, DEFAULT_QUANTITY_TEMPLATE, DEFAULT_REMAINING_PERCENT, MIN_REMAINING_PERCENT, MAX_REMAINING_PERCENT, DEFAULT_RANGE_STEP } from '../../const.js';
|
|
2
2
|
|
|
3
3
|
const StockCounterSettingsV2 = [
|
|
4
4
|
{
|
|
@@ -65,7 +65,7 @@ const StockCounterSettingsV2 = [
|
|
|
65
65
|
{
|
|
66
66
|
id: 'remaining',
|
|
67
67
|
type: 'input:stepper',
|
|
68
|
-
default:
|
|
68
|
+
default: 4
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
id: 'displayCondition',
|
|
@@ -101,7 +101,7 @@ const StockCounterSettingsV2 = [
|
|
|
101
101
|
id: 'oosIcon',
|
|
102
102
|
label: '',
|
|
103
103
|
type: 'icon',
|
|
104
|
-
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>`
|
|
104
|
+
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>`
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
id: 'hiddenCounterWhenOutOfStock',
|
|
@@ -129,8 +129,9 @@ const StockCounterSettingsV2 = [
|
|
|
129
129
|
type: 'textarea',
|
|
130
130
|
autoHeight: true,
|
|
131
131
|
showPlusBtn: true,
|
|
132
|
-
default:
|
|
132
|
+
default: `Only ${DEFAULT_QUANTITY_TEMPLATE} left`,
|
|
133
133
|
info: `Use ${DEFAULT_QUANTITY_TEMPLATE} to represent remaining number`,
|
|
134
|
+
minHeight: 56,
|
|
134
135
|
suggestContents: [
|
|
135
136
|
{
|
|
136
137
|
message: '%number%',
|
|
@@ -149,7 +150,7 @@ const StockCounterSettingsV2 = [
|
|
|
149
150
|
label: 'Continue Selling When Out Of Stock Message',
|
|
150
151
|
type: 'textarea',
|
|
151
152
|
autoHeight: true,
|
|
152
|
-
default: '
|
|
153
|
+
default: 'Restock soon! PREORDER NOW',
|
|
153
154
|
info: 'Turn out-of-stock productions into pre-orders'
|
|
154
155
|
},
|
|
155
156
|
{
|
|
@@ -157,7 +158,7 @@ const StockCounterSettingsV2 = [
|
|
|
157
158
|
label: 'Unlimited Quantity Message',
|
|
158
159
|
type: 'textarea',
|
|
159
160
|
autoHeight: true,
|
|
160
|
-
default: '
|
|
161
|
+
default: 'Hurry! LET BUY NOW'
|
|
161
162
|
}
|
|
162
163
|
]
|
|
163
164
|
},
|
|
@@ -176,7 +177,7 @@ const StockCounterSettingsV2 = [
|
|
|
176
177
|
id: 'icon',
|
|
177
178
|
label: '',
|
|
178
179
|
type: 'icon',
|
|
179
|
-
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>`
|
|
180
|
+
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>`
|
|
180
181
|
}
|
|
181
182
|
]
|
|
182
183
|
},
|
|
@@ -361,19 +361,49 @@ const SettingUIV2 = [
|
|
|
361
361
|
controls: [
|
|
362
362
|
{
|
|
363
363
|
label: {
|
|
364
|
+
en: 'Sell when OOS'
|
|
365
|
+
},
|
|
366
|
+
type: 'combo',
|
|
367
|
+
iconName: 'polaris-text-block',
|
|
368
|
+
getValueFromSettingID: 'continueSelling',
|
|
369
|
+
isHideClear: true,
|
|
370
|
+
popoverLabel: {
|
|
364
371
|
en: 'Out of stock sell'
|
|
365
372
|
},
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
373
|
+
controls: [
|
|
374
|
+
{
|
|
375
|
+
label: {
|
|
376
|
+
en: 'Content'
|
|
377
|
+
},
|
|
378
|
+
setting: {
|
|
379
|
+
id: 'continueSelling'
|
|
380
|
+
},
|
|
381
|
+
layout: 'vertical'
|
|
382
|
+
}
|
|
383
|
+
]
|
|
369
384
|
},
|
|
370
385
|
{
|
|
371
386
|
label: {
|
|
387
|
+
en: 'Unlimited stock'
|
|
388
|
+
},
|
|
389
|
+
type: 'combo',
|
|
390
|
+
iconName: 'polaris-text-block',
|
|
391
|
+
getValueFromSettingID: 'unlimitedQuantityMessage',
|
|
392
|
+
isHideClear: true,
|
|
393
|
+
popoverLabel: {
|
|
372
394
|
en: 'Unlimited quantity'
|
|
373
395
|
},
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
396
|
+
controls: [
|
|
397
|
+
{
|
|
398
|
+
label: {
|
|
399
|
+
en: 'Content'
|
|
400
|
+
},
|
|
401
|
+
setting: {
|
|
402
|
+
id: 'unlimitedQuantityMessage'
|
|
403
|
+
},
|
|
404
|
+
layout: 'vertical'
|
|
405
|
+
}
|
|
406
|
+
]
|
|
377
407
|
}
|
|
378
408
|
]
|
|
379
409
|
},
|
package/dist/types/index.d.ts
CHANGED
|
@@ -379,6 +379,7 @@ type ArticleListStyle = {
|
|
|
379
379
|
wrapperBorder?: Border;
|
|
380
380
|
hasActiveShadow?: boolean;
|
|
381
381
|
shadow?: ShadowProps$1;
|
|
382
|
+
padding?: ObjectDevices$1<SizeSettingGlobal>;
|
|
382
383
|
};
|
|
383
384
|
type ArticleListProps = BaseProps<ArticleListSetting, ArticleListStyle> & {
|
|
384
385
|
style?: React.CSSProperties;
|
|
@@ -717,6 +718,8 @@ type Setting$4 = {
|
|
|
717
718
|
title?: string;
|
|
718
719
|
aspectRatio?: ObjectDevices$1<string>;
|
|
719
720
|
ratioOptions?: ObjectDevices$1<Ratio>;
|
|
721
|
+
enableLink?: boolean;
|
|
722
|
+
contentBanner?: string;
|
|
720
723
|
} & Pick<NonNullable<RowProps['setting']>, 'layout' | 'horizontalAlign'>;
|
|
721
724
|
type Styles$2 = {
|
|
722
725
|
height?: ObjectDevices$1<string>;
|
|
@@ -1331,6 +1334,9 @@ type CountdownProps = BaseProps<{
|
|
|
1331
1334
|
minWidth?: string;
|
|
1332
1335
|
colorNumber?: ColorValueType$1;
|
|
1333
1336
|
colorLabel?: ColorValueType$1;
|
|
1337
|
+
enableNumberTextStyle?: boolean;
|
|
1338
|
+
enableLabelTextStyle?: boolean;
|
|
1339
|
+
padding?: ObjectDevices$1<SizeSettingGlobal>;
|
|
1334
1340
|
/**
|
|
1335
1341
|
* @deprecated use `numTypo` instead
|
|
1336
1342
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.482",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@gem-sdk/core": "2.0.0-dev.479",
|
|
27
|
-
"@gem-sdk/styles": "2.0.0-dev.
|
|
27
|
+
"@gem-sdk/styles": "2.0.0-dev.482",
|
|
28
28
|
"@gem-sdk/system": "2.0.0-dev.464",
|
|
29
29
|
"@types/react-transition-group": "^4.4.5"
|
|
30
30
|
},
|