@gem-sdk/components 2.0.0-dev.351 → 2.0.0-dev.353
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/ArticleAuthor/uiV2.js +9 -2
- package/dist/cjs/article/setting/configs/ArticleDate/uiV2.js +13 -6
- package/dist/cjs/article/setting/configs/ArticleExcerpt/settings.js +1 -1
- package/dist/cjs/article/setting/configs/ArticleExcerpt/uiV2.js +11 -1
- package/dist/cjs/article/setting/configs/ArticleImage/presets.js +3 -3
- package/dist/cjs/article/setting/configs/ArticleReadMore/presets.js +9 -9
- package/dist/cjs/article/setting/configs/ArticleReadMore/settings.js +4 -4
- package/dist/cjs/article/setting/configs/ArticleReadMore/uiV2.js +16 -12
- package/dist/cjs/stock-counter/components/StockCounter.js +104 -112
- package/dist/cjs/stock-counter/components/StockCounter.liquid.js +116 -141
- package/dist/cjs/stock-counter/components/common/getAttrs.js +44 -0
- package/dist/cjs/stock-counter/components/common/getClasses.js +68 -0
- package/dist/cjs/stock-counter/components/common/getContent.js +71 -0
- package/dist/cjs/stock-counter/components/common/getInlineCss.js +39 -0
- package/dist/cjs/stock-counter/components/common/getStyles.js +73 -0
- package/dist/cjs/stock-counter/components/hook/useStockCounter.js +37 -0
- package/dist/cjs/stock-counter/const.js +0 -6
- package/dist/cjs/stock-counter/helpers.js +0 -14
- package/dist/cjs/stock-counter/index.js +3 -1
- package/dist/cjs/stock-counter/setting/StockCounter.js +2 -2
- package/dist/cjs/stock-counter/setting/configs/presets.js +3 -0
- package/dist/cjs/stock-counter/setting/configs/{settings.js → settingsV2.js} +211 -42
- package/dist/cjs/stock-counter/setting/configs/uiV2.js +228 -41
- package/dist/esm/article/setting/configs/ArticleAuthor/uiV2.js +9 -2
- package/dist/esm/article/setting/configs/ArticleDate/uiV2.js +13 -6
- package/dist/esm/article/setting/configs/ArticleExcerpt/settings.js +1 -1
- package/dist/esm/article/setting/configs/ArticleExcerpt/uiV2.js +11 -1
- package/dist/esm/article/setting/configs/ArticleImage/presets.js +3 -3
- package/dist/esm/article/setting/configs/ArticleReadMore/presets.js +9 -9
- package/dist/esm/article/setting/configs/ArticleReadMore/settings.js +4 -4
- package/dist/esm/article/setting/configs/ArticleReadMore/uiV2.js +16 -12
- package/dist/esm/stock-counter/components/StockCounter.js +106 -114
- package/dist/esm/stock-counter/components/StockCounter.liquid.js +116 -141
- package/dist/esm/stock-counter/components/common/getAttrs.js +39 -0
- package/dist/esm/stock-counter/components/common/getClasses.js +60 -0
- package/dist/esm/stock-counter/components/common/getContent.js +68 -0
- package/dist/esm/stock-counter/components/common/getInlineCss.js +37 -0
- package/dist/esm/stock-counter/components/common/getStyles.js +67 -0
- package/dist/esm/stock-counter/components/hook/useStockCounter.js +35 -0
- package/dist/esm/stock-counter/const.js +1 -4
- package/dist/esm/stock-counter/helpers.js +1 -14
- package/dist/esm/stock-counter/index.js +3 -1
- package/dist/esm/stock-counter/setting/StockCounter.js +2 -2
- package/dist/esm/stock-counter/setting/configs/presets.js +3 -0
- package/dist/esm/stock-counter/setting/configs/settingsV2.js +438 -0
- package/dist/esm/stock-counter/setting/configs/uiV2.js +228 -41
- package/dist/types/index.d.ts +13 -5
- package/package.json +1 -1
- package/dist/esm/stock-counter/setting/configs/settings.js +0 -269
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var settingsV2 = require('./configs/settingsV2.js');
|
|
6
6
|
var uiV1 = require('./configs/uiV1.js');
|
|
7
7
|
var uiV2 = require('./configs/uiV2.js');
|
|
8
8
|
var presets = require('./configs/presets.js');
|
|
@@ -15,7 +15,7 @@ const config = {
|
|
|
15
15
|
<path d="M33.3905 11.2545C33.1953 11.4498 32.8787 11.4498 32.6834 11.2545L29.8643 8.43541C29.6691 8.24014 29.6691 7.92356 29.8643 7.7283L30.9203 6.67231C31.1156 6.47705 31.4322 6.47705 31.6274 6.67231L34.4465 9.49139C34.6418 9.68666 34.6418 10.0032 34.4465 10.1985L33.3905 11.2545ZM15.7838 4.68533C15.7838 4.96148 16.0077 5.18534 16.2838 5.18534H22.84C23.1161 5.18534 23.34 4.96148 23.34 4.68534V3.16663C23.34 2.89048 23.1161 2.66663 22.84 2.66663H16.2838C16.0077 2.66663 15.7838 2.89048 15.7838 3.16663V4.68533ZM28.3774 28.6093L20.8212 21.0532V10.3487C26.4883 10.9784 30.8961 15.7639 30.8961 21.5569C30.8961 24.2016 30.0145 26.7203 28.3774 28.6093ZM8.22769 21.5569C8.22769 15.7639 12.6354 10.9784 18.3025 10.3487V21.7724C18.3025 22.0376 18.4079 22.292 18.5954 22.4795L26.6143 30.4984C24.7252 32.0096 22.2065 33.0171 19.5619 33.0171C13.2651 32.8911 8.22769 27.8537 8.22769 21.5569ZM19.5619 7.70404C11.8798 7.70404 5.70898 13.8749 5.70898 21.5569C5.70898 29.239 11.8798 35.4098 19.5619 35.4098C27.2439 35.4098 33.4148 29.239 33.4148 21.5569C33.4148 13.8749 27.2439 7.70404 19.5619 7.70404Z" fill="currentColor"/>
|
|
16
16
|
</svg>
|
|
17
17
|
`,
|
|
18
|
-
settings:
|
|
18
|
+
settings: settingsV2.StockCounterSettingsV2,
|
|
19
19
|
ui: uiV1.SettingUIV1,
|
|
20
20
|
uiV2: uiV2.SettingUIV2,
|
|
21
21
|
editorConfigs: {
|
|
@@ -2,10 +2,73 @@
|
|
|
2
2
|
|
|
3
3
|
var _const = require('../../const.js');
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const StockCounterSettingsV2 = [
|
|
6
6
|
{
|
|
7
7
|
id: 'setting',
|
|
8
8
|
controls: [
|
|
9
|
+
{
|
|
10
|
+
id: 'layout',
|
|
11
|
+
label: 'layout',
|
|
12
|
+
type: 'layout-selector',
|
|
13
|
+
iconViewBox: '0 0 72 72',
|
|
14
|
+
enableItemBackground: true,
|
|
15
|
+
itemPerRow: 2,
|
|
16
|
+
itemSpacing: 'large',
|
|
17
|
+
popoverLabel: 'Type',
|
|
18
|
+
options: [
|
|
19
|
+
{
|
|
20
|
+
label: 'Full',
|
|
21
|
+
value: 'full',
|
|
22
|
+
type: 'p-image-layout',
|
|
23
|
+
iconName: 'gp-stock-counter-full'
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: 'Text & progress bar',
|
|
27
|
+
value: 'text-and-progress-bar',
|
|
28
|
+
type: 'p-image-layout',
|
|
29
|
+
iconName: 'gp-stock-counter-text-and-progress-bar'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: 'Icon & Text',
|
|
33
|
+
value: 'icon-and-text',
|
|
34
|
+
type: 'p-image-layout',
|
|
35
|
+
iconName: 'gp-stock-counter-icon-and-text'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: 'Text only',
|
|
39
|
+
value: 'text-only',
|
|
40
|
+
type: 'p-image-layout',
|
|
41
|
+
iconName: 'gp-stock-counter-text-only'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: 'Progress bar only',
|
|
45
|
+
value: 'progress-bar',
|
|
46
|
+
type: 'p-image-layout',
|
|
47
|
+
iconName: 'gp-stock-counter-progress-bar'
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
default: 'full'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: 'source',
|
|
54
|
+
type: 'option:value',
|
|
55
|
+
options: [
|
|
56
|
+
{
|
|
57
|
+
value: 'built-in',
|
|
58
|
+
label: 'Shopify'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
value: 'custom',
|
|
62
|
+
label: 'Custom'
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
default: 'custom'
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: 'remaining',
|
|
69
|
+
type: 'input:number',
|
|
70
|
+
default: 16
|
|
71
|
+
},
|
|
9
72
|
{
|
|
10
73
|
id: 'displayCondition',
|
|
11
74
|
label: 'Display Condition',
|
|
@@ -14,7 +77,17 @@ const StockCounterSettings = [
|
|
|
14
77
|
{
|
|
15
78
|
id: 'displayByDefault',
|
|
16
79
|
label: 'Display By Default',
|
|
17
|
-
type: '
|
|
80
|
+
type: 'select',
|
|
81
|
+
options: [
|
|
82
|
+
{
|
|
83
|
+
label: 'Always show',
|
|
84
|
+
value: true
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
label: 'Show if under',
|
|
88
|
+
value: false
|
|
89
|
+
}
|
|
90
|
+
],
|
|
18
91
|
default: true
|
|
19
92
|
},
|
|
20
93
|
{
|
|
@@ -27,36 +100,25 @@ const StockCounterSettings = [
|
|
|
27
100
|
]
|
|
28
101
|
},
|
|
29
102
|
{
|
|
30
|
-
id: '
|
|
31
|
-
label: '
|
|
32
|
-
type: '
|
|
33
|
-
|
|
103
|
+
id: 'oosIcon',
|
|
104
|
+
label: '',
|
|
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>`
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
id: 'hiddenCounterWhenOutOfStock',
|
|
110
|
+
type: 'select',
|
|
111
|
+
options: [
|
|
34
112
|
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
type: 'input:slider',
|
|
42
|
-
default: _const.DEFAULT_REMAINING_PERCENT,
|
|
43
|
-
min: _const.MIN_REMAINING_PERCENT,
|
|
44
|
-
max: _const.MAX_REMAINING_PERCENT,
|
|
45
|
-
step: _const.DEFAULT_RANGE_STEP,
|
|
46
|
-
units: [
|
|
47
|
-
'%'
|
|
48
|
-
],
|
|
49
|
-
useOnlyUnitInit: true
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
id: 'hiddenCounterWhenOutOfStock',
|
|
53
|
-
label: 'Hide counter when out of stock',
|
|
54
|
-
type: 'toggle',
|
|
55
|
-
default: false
|
|
56
|
-
}
|
|
57
|
-
]
|
|
113
|
+
value: false,
|
|
114
|
+
label: 'Show message'
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
value: true,
|
|
118
|
+
label: 'Hide counter'
|
|
58
119
|
}
|
|
59
|
-
]
|
|
120
|
+
],
|
|
121
|
+
default: false
|
|
60
122
|
},
|
|
61
123
|
{
|
|
62
124
|
id: 'message',
|
|
@@ -68,8 +130,15 @@ const StockCounterSettings = [
|
|
|
68
130
|
label: 'Template',
|
|
69
131
|
type: 'textarea',
|
|
70
132
|
autoHeight: true,
|
|
133
|
+
showPlusBtn: true,
|
|
71
134
|
default: `<${_const.DEFAULT_HIGHLIGHT_TAG}>HURRY!</${_const.DEFAULT_HIGHLIGHT_TAG}> ONLY ${_const.DEFAULT_QUANTITY_TEMPLATE} LEFT`,
|
|
72
|
-
info: `Use ${_const.DEFAULT_QUANTITY_TEMPLATE} to represent remaining number
|
|
135
|
+
info: `Use ${_const.DEFAULT_QUANTITY_TEMPLATE} to represent remaining number`,
|
|
136
|
+
suggestContents: [
|
|
137
|
+
{
|
|
138
|
+
message: '%number%',
|
|
139
|
+
eg: ' Only 2 left'
|
|
140
|
+
}
|
|
141
|
+
]
|
|
73
142
|
},
|
|
74
143
|
{
|
|
75
144
|
id: 'outOfStockMessage',
|
|
@@ -112,6 +181,58 @@ const StockCounterSettings = [
|
|
|
112
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>`
|
|
113
182
|
}
|
|
114
183
|
]
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
id: 'progressBarPosition',
|
|
187
|
+
type: 'option:value',
|
|
188
|
+
options: [
|
|
189
|
+
{
|
|
190
|
+
value: 'top',
|
|
191
|
+
label: 'Top'
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
value: 'bottom',
|
|
195
|
+
label: 'Bottom'
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
default: 'bottom'
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: 'iconPosition',
|
|
202
|
+
type: 'option:value',
|
|
203
|
+
options: [
|
|
204
|
+
{
|
|
205
|
+
value: 'left',
|
|
206
|
+
label: 'Left'
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
value: 'right',
|
|
210
|
+
label: 'Right'
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
default: 'left'
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: 'iconSize',
|
|
217
|
+
type: 'input:stepper',
|
|
218
|
+
devices: {
|
|
219
|
+
desktop: {
|
|
220
|
+
default: 16
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
id: 'remainingPercentage',
|
|
226
|
+
label: 'Remaining Percentage (%)',
|
|
227
|
+
type: 'input:slider',
|
|
228
|
+
default: _const.DEFAULT_REMAINING_PERCENT,
|
|
229
|
+
min: _const.MIN_REMAINING_PERCENT,
|
|
230
|
+
max: _const.MAX_REMAINING_PERCENT,
|
|
231
|
+
step: _const.DEFAULT_RANGE_STEP,
|
|
232
|
+
units: [
|
|
233
|
+
'%'
|
|
234
|
+
],
|
|
235
|
+
useOnlyUnitInit: true
|
|
115
236
|
}
|
|
116
237
|
]
|
|
117
238
|
},
|
|
@@ -219,6 +340,16 @@ const StockCounterSettings = [
|
|
|
219
340
|
label: 'Color',
|
|
220
341
|
type: 'color-picker-v2',
|
|
221
342
|
default: 'text-2'
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
id: 'oosIconColor',
|
|
346
|
+
label: 'Color',
|
|
347
|
+
type: 'color-picker-v2'
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
id: 'oosTextColor',
|
|
351
|
+
label: 'Color',
|
|
352
|
+
type: 'color-picker-v2'
|
|
222
353
|
}
|
|
223
354
|
]
|
|
224
355
|
},
|
|
@@ -235,18 +366,12 @@ const StockCounterSettings = [
|
|
|
235
366
|
},
|
|
236
367
|
{
|
|
237
368
|
id: 'progressBarHeight',
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
// step: DEFAULT_RANGE_STEP,
|
|
242
|
-
min: _const.MIN_PROGRESS_BAR_HEIGHT,
|
|
243
|
-
max: _const.MAX_PROGRESS_BAR_HEIGHT,
|
|
244
|
-
units: [
|
|
245
|
-
'px'
|
|
246
|
-
],
|
|
369
|
+
type: 'input:stepper',
|
|
370
|
+
min: 5,
|
|
371
|
+
max: 20,
|
|
247
372
|
devices: {
|
|
248
373
|
desktop: {
|
|
249
|
-
default:
|
|
374
|
+
default: 10
|
|
250
375
|
}
|
|
251
376
|
}
|
|
252
377
|
},
|
|
@@ -263,9 +388,53 @@ const StockCounterSettings = [
|
|
|
263
388
|
default: true
|
|
264
389
|
}
|
|
265
390
|
]
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
id: 'borderRadius',
|
|
394
|
+
type: 'corner-v2',
|
|
395
|
+
devices: {
|
|
396
|
+
desktop: {
|
|
397
|
+
default: {
|
|
398
|
+
btrr: '99999px',
|
|
399
|
+
bblr: '99999px',
|
|
400
|
+
bbrr: '99999px',
|
|
401
|
+
btlr: '99999px',
|
|
402
|
+
radiusType: 'circle'
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
tablet: {
|
|
406
|
+
default: {
|
|
407
|
+
btrr: '99999px',
|
|
408
|
+
bblr: '99999px',
|
|
409
|
+
bbrr: '99999px',
|
|
410
|
+
btlr: '99999px',
|
|
411
|
+
radiusType: 'circle'
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
mobile: {
|
|
415
|
+
default: {
|
|
416
|
+
btrr: '99999px',
|
|
417
|
+
bblr: '99999px',
|
|
418
|
+
bbrr: '99999px',
|
|
419
|
+
btlr: '99999px',
|
|
420
|
+
radiusType: 'circle'
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
compoDefaultValue: {
|
|
425
|
+
desktop: {
|
|
426
|
+
default: {
|
|
427
|
+
btrr: '99999px',
|
|
428
|
+
bblr: '99999px',
|
|
429
|
+
bbrr: '99999px',
|
|
430
|
+
btlr: '99999px',
|
|
431
|
+
radiusType: 'circle'
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
266
435
|
}
|
|
267
436
|
]
|
|
268
437
|
}
|
|
269
438
|
];
|
|
270
439
|
|
|
271
|
-
exports.
|
|
440
|
+
exports.StockCounterSettingsV2 = StockCounterSettingsV2;
|