@gem-sdk/components 2.0.0-dev.492 → 2.0.0-dev.494
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/ArticleTag/presets.js +1 -1
- package/dist/cjs/dialog/setting/configs/settings.js +5 -2
- package/dist/cjs/stock-counter/components/StockCounter.js +1 -1
- package/dist/cjs/stock-counter/components/StockCounter.liquid.js +1 -1
- package/dist/cjs/stock-counter/components/common/getAttrs.js +4 -2
- package/dist/cjs/stock-counter/components/common/getStyles.js +2 -2
- package/dist/cjs/stock-counter/setting/configs/settingsV2.js +2 -0
- package/dist/esm/article/setting/configs/ArticleTag/presets.js +1 -1
- package/dist/esm/dialog/setting/configs/settings.js +5 -2
- package/dist/esm/stock-counter/components/StockCounter.js +1 -1
- package/dist/esm/stock-counter/components/StockCounter.liquid.js +1 -1
- package/dist/esm/stock-counter/components/common/getAttrs.js +4 -2
- package/dist/esm/stock-counter/components/common/getStyles.js +3 -3
- package/dist/esm/stock-counter/setting/configs/settingsV2.js +2 -0
- package/package.json +1 -1
|
@@ -203,8 +203,11 @@ const DialogSettings = [
|
|
|
203
203
|
label: 'SVG Icon',
|
|
204
204
|
type: 'icon',
|
|
205
205
|
default: `<svg height="20" width="20" data-name="x-bold" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817606065848680">
|
|
206
|
-
|
|
207
|
-
</svg
|
|
206
|
+
<path fill="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"/>
|
|
207
|
+
</svg>`,
|
|
208
|
+
compoDefaultValue: `<svg height="20" width="20" data-name="x-bold" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817606065848680">
|
|
209
|
+
<path fill="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"/>
|
|
210
|
+
</svg>`
|
|
208
211
|
},
|
|
209
212
|
{
|
|
210
213
|
id: 'btnWidth',
|
|
@@ -54,7 +54,7 @@ const StockCounter = ({ setting, styles, builderProps })=>{
|
|
|
54
54
|
});
|
|
55
55
|
};
|
|
56
56
|
const iconAttrs = ({ isOutOfStockIcon, isVisible })=>{
|
|
57
|
-
return system.
|
|
57
|
+
return system.createAttr({
|
|
58
58
|
...getAttrs.getIconAttrs(isOutOfStockIcon, isVisible)
|
|
59
59
|
});
|
|
60
60
|
};
|
|
@@ -54,7 +54,7 @@ const StockCounter = ({ setting, styles, style, advanced, builderProps })=>{
|
|
|
54
54
|
});
|
|
55
55
|
};
|
|
56
56
|
const iconAttrs = ({ isOutOfStockIcon, isVisible })=>{
|
|
57
|
-
return system.
|
|
57
|
+
return system.createAttr({
|
|
58
58
|
...getAttrs.getIconAttrs(isOutOfStockIcon, isVisible)
|
|
59
59
|
});
|
|
60
60
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const getLiquidTagAttrs = (builderProps, setting, styles)=>{
|
|
4
|
-
const { displayByDefault, scarcityThreshold = 0, template: templateString, outOfStockMessage, continueSelling, unlimitedQuantityMessage, hiddenCounterWhenOutOfStock } = setting ?? {};
|
|
4
|
+
const { displayByDefault, scarcityThreshold = 0, template: templateString, outOfStockMessage, continueSelling, unlimitedQuantityMessage, hiddenCounterWhenOutOfStock, remaining, source } = setting ?? {};
|
|
5
5
|
const { displayProgressBar, textColor, oosTextColor, typo } = styles ?? {};
|
|
6
6
|
const mainColor = textColor || 'brand';
|
|
7
7
|
const typoColor = typo?.attrs?.color;
|
|
@@ -20,7 +20,9 @@ const getLiquidTagAttrs = (builderProps, setting, styles)=>{
|
|
|
20
20
|
color: mainColor,
|
|
21
21
|
hiddenCounterWhenOutOfStock,
|
|
22
22
|
oosTextColor,
|
|
23
|
-
typoColor
|
|
23
|
+
typoColor,
|
|
24
|
+
remaining,
|
|
25
|
+
source
|
|
24
26
|
}).replaceAll(`"`, '"')
|
|
25
27
|
};
|
|
26
28
|
};
|
|
@@ -13,7 +13,7 @@ const getProgressBarStyles = (styles, setting)=>{
|
|
|
13
13
|
]));
|
|
14
14
|
}
|
|
15
15
|
return {
|
|
16
|
-
...core.makeStyleResponsive('h', convertedProgressBarHeight, 'px'),
|
|
16
|
+
...core.makeStyleResponsive('h', core.makeWidth(convertedProgressBarHeight), 'px'),
|
|
17
17
|
...core.makeStyle({
|
|
18
18
|
bg: 'linear-gradient(90deg, #eee 50%, transparent 50%)',
|
|
19
19
|
bgc: core.getSingleColorVariable(color),
|
|
@@ -43,7 +43,7 @@ const getIconStyles = (styles, setting, isOutOfStock)=>{
|
|
|
43
43
|
...core.makeStyle({
|
|
44
44
|
c: core.getSingleColorVariable(isOutOfStock ? oosIconColor : iconColor)
|
|
45
45
|
}),
|
|
46
|
-
...core.makeStyleResponsive('w', iconSize, 'px')
|
|
46
|
+
...core.makeStyleResponsive('w', core.makeWidth(iconSize), 'px')
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
const getTextStyles = (styles, isOutOfStock)=>{
|
|
@@ -201,8 +201,11 @@ const DialogSettings = [
|
|
|
201
201
|
label: 'SVG Icon',
|
|
202
202
|
type: 'icon',
|
|
203
203
|
default: `<svg height="20" width="20" data-name="x-bold" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817606065848680">
|
|
204
|
-
|
|
205
|
-
</svg
|
|
204
|
+
<path fill="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"/>
|
|
205
|
+
</svg>`,
|
|
206
|
+
compoDefaultValue: `<svg height="20" width="20" data-name="x-bold" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817606065848680">
|
|
207
|
+
<path fill="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"/>
|
|
208
|
+
</svg>`
|
|
206
209
|
},
|
|
207
210
|
{
|
|
208
211
|
id: 'btnWidth',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const getLiquidTagAttrs = (builderProps, setting, styles)=>{
|
|
2
|
-
const { displayByDefault, scarcityThreshold = 0, template: templateString, outOfStockMessage, continueSelling, unlimitedQuantityMessage, hiddenCounterWhenOutOfStock } = setting ?? {};
|
|
2
|
+
const { displayByDefault, scarcityThreshold = 0, template: templateString, outOfStockMessage, continueSelling, unlimitedQuantityMessage, hiddenCounterWhenOutOfStock, remaining, source } = setting ?? {};
|
|
3
3
|
const { displayProgressBar, textColor, oosTextColor, typo } = styles ?? {};
|
|
4
4
|
const mainColor = textColor || 'brand';
|
|
5
5
|
const typoColor = typo?.attrs?.color;
|
|
@@ -18,7 +18,9 @@ const getLiquidTagAttrs = (builderProps, setting, styles)=>{
|
|
|
18
18
|
color: mainColor,
|
|
19
19
|
hiddenCounterWhenOutOfStock,
|
|
20
20
|
oosTextColor,
|
|
21
|
-
typoColor
|
|
21
|
+
typoColor,
|
|
22
|
+
remaining,
|
|
23
|
+
source
|
|
22
24
|
}).replaceAll(`"`, '"')
|
|
23
25
|
};
|
|
24
26
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { makeStyleResponsive, makeStyle, getSingleColorVariable,
|
|
1
|
+
import { makeStyleResponsive, makeWidth, makeStyle, getSingleColorVariable, composeTypographyStyle, getStyleShadow } from '@gem-sdk/core';
|
|
2
2
|
|
|
3
3
|
const getProgressBarStyles = (styles, setting)=>{
|
|
4
4
|
const { progressBarHeight, color } = styles ?? {};
|
|
@@ -11,7 +11,7 @@ const getProgressBarStyles = (styles, setting)=>{
|
|
|
11
11
|
]));
|
|
12
12
|
}
|
|
13
13
|
return {
|
|
14
|
-
...makeStyleResponsive('h', convertedProgressBarHeight, 'px'),
|
|
14
|
+
...makeStyleResponsive('h', makeWidth(convertedProgressBarHeight), 'px'),
|
|
15
15
|
...makeStyle({
|
|
16
16
|
bg: 'linear-gradient(90deg, #eee 50%, transparent 50%)',
|
|
17
17
|
bgc: getSingleColorVariable(color),
|
|
@@ -41,7 +41,7 @@ const getIconStyles = (styles, setting, isOutOfStock)=>{
|
|
|
41
41
|
...makeStyle({
|
|
42
42
|
c: getSingleColorVariable(isOutOfStock ? oosIconColor : iconColor)
|
|
43
43
|
}),
|
|
44
|
-
...makeStyleResponsive('w', iconSize, 'px')
|
|
44
|
+
...makeStyleResponsive('w', makeWidth(iconSize), 'px')
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
47
|
const getTextStyles = (styles, isOutOfStock)=>{
|