@gem-sdk/components 2.0.0-dev.601 → 2.0.0-dev.604
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/button/components/common/classes.js +1 -1
- package/dist/cjs/button/components/common/data.js +2 -2
- package/dist/cjs/button/components/common/helpers.js +2 -2
- package/dist/cjs/code/setting/config/setting.js +2 -1
- package/dist/cjs/product/components/ProductButton/ProductButton.liquid.js +2 -2
- package/dist/cjs/product/components/ProductButton/components/SoldOutButton.liquid.js +1 -1
- package/dist/esm/button/components/common/classes.js +1 -1
- package/dist/esm/button/components/common/data.js +2 -2
- package/dist/esm/button/components/common/helpers.js +2 -2
- package/dist/esm/code/setting/config/setting.js +2 -1
- package/dist/esm/product/components/ProductButton/ProductButton.liquid.js +2 -2
- package/dist/esm/product/components/ProductButton/components/SoldOutButton.liquid.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -37,7 +37,7 @@ const getButtonContentWrapperClasses = (setting)=>{
|
|
|
37
37
|
};
|
|
38
38
|
const getButtonLabelClasses = (styles, isEditable)=>{
|
|
39
39
|
return {
|
|
40
|
-
'gp-relative gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line': true,
|
|
40
|
+
'gp-content-product-button gp-relative gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line': true,
|
|
41
41
|
'[&:not(:has(p))]:gp-pr-[0.2em] [&_p]:[&:has(p)]:gp-pr-[0.2em]': styles?.typo?.attrs?.italic,
|
|
42
42
|
'gp-text button-text': isEditable
|
|
43
43
|
};
|
|
@@ -4,7 +4,7 @@ var helpers = require('./helpers.js');
|
|
|
4
4
|
var styles = require('./styles.js');
|
|
5
5
|
|
|
6
6
|
const getData = (props)=>{
|
|
7
|
-
const { style, dataId, pageContext, styles: styles$1 = {}, setting = {}, builderProps, builderAttrs,
|
|
7
|
+
const { style, dataId, pageContext, styles: styles$1 = {}, setting = {}, builderProps, builderAttrs, isUseTranslatedValue = false } = props;
|
|
8
8
|
const { label, iconSvg, btnLink, loading, options, disabled, translate, iconVisible, shouldClearSpace } = setting;
|
|
9
9
|
const [wrapStyle, restStyle] = helpers.getSplitStyles(style);
|
|
10
10
|
const cleanedStyles = helpers.getCleanedStyles(styles$1, disabled);
|
|
@@ -36,7 +36,7 @@ const getData = (props)=>{
|
|
|
36
36
|
pageContext
|
|
37
37
|
},
|
|
38
38
|
...isLiquid && {
|
|
39
|
-
|
|
39
|
+
isUseTranslatedValue
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
};
|
|
@@ -25,8 +25,8 @@ const getCleanedStyles = (styles, disabled)=>{
|
|
|
25
25
|
});
|
|
26
26
|
return cleanedStyles;
|
|
27
27
|
};
|
|
28
|
-
const handleGetLabelToDisplay = ({ label, styles, translate, pageContext,
|
|
29
|
-
const liquidLabel =
|
|
28
|
+
const handleGetLabelToDisplay = ({ label, styles, translate, pageContext, isUseTranslatedValue, builderProps, isLiquid = false })=>{
|
|
29
|
+
const liquidLabel = !isUseTranslatedValue ? label : helpers.getDynamicSourceLocales({
|
|
30
30
|
translate,
|
|
31
31
|
val: label,
|
|
32
32
|
pageContext,
|
|
@@ -52,8 +52,8 @@ const ProductButton = (props)=>{
|
|
|
52
52
|
gp-data-wrapper="true"
|
|
53
53
|
gp-href="${urlData.href}"
|
|
54
54
|
class="gp-product-button"
|
|
55
|
-
label-out-of-
|
|
56
|
-
label-unavailable="${unavailableButtonLabel}"
|
|
55
|
+
gp-label-out-of-stock="${outOfStockButtonLabel}"
|
|
56
|
+
gp-label-unavailable="${unavailableButtonLabel}"
|
|
57
57
|
gp-data='${JSON.stringify(productButtonState).replaceAll("'", ''')}'
|
|
58
58
|
data-variant-selection-required-message="${variantSelectionRequiredMessage}"
|
|
59
59
|
>
|
|
@@ -32,7 +32,7 @@ const SoldOutButton = (props)=>{
|
|
|
32
32
|
uid: `${builderProps?.uid}-sold-out`
|
|
33
33
|
},
|
|
34
34
|
pageContext,
|
|
35
|
-
|
|
35
|
+
isUseTranslatedValue: true,
|
|
36
36
|
dataId: builderProps?.uid,
|
|
37
37
|
customAttrs: {
|
|
38
38
|
'gp-data-hidden': `{% if variant.available %}true{% endif %}`
|
|
@@ -35,7 +35,7 @@ const getButtonContentWrapperClasses = (setting)=>{
|
|
|
35
35
|
};
|
|
36
36
|
const getButtonLabelClasses = (styles, isEditable)=>{
|
|
37
37
|
return {
|
|
38
|
-
'gp-relative gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line': true,
|
|
38
|
+
'gp-content-product-button gp-relative gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line': true,
|
|
39
39
|
'[&:not(:has(p))]:gp-pr-[0.2em] [&_p]:[&:has(p)]:gp-pr-[0.2em]': styles?.typo?.attrs?.italic,
|
|
40
40
|
'gp-text button-text': isEditable
|
|
41
41
|
};
|
|
@@ -2,7 +2,7 @@ import { getSplitStyles, getCleanedStyles, checkIsScrollToElement, getDataState,
|
|
|
2
2
|
import { getCustomCssStyles } from './styles.js';
|
|
3
3
|
|
|
4
4
|
const getData = (props)=>{
|
|
5
|
-
const { style, dataId, pageContext, styles = {}, setting = {}, builderProps, builderAttrs,
|
|
5
|
+
const { style, dataId, pageContext, styles = {}, setting = {}, builderProps, builderAttrs, isUseTranslatedValue = false } = props;
|
|
6
6
|
const { label, iconSvg, btnLink, loading, options, disabled, translate, iconVisible, shouldClearSpace } = setting;
|
|
7
7
|
const [wrapStyle, restStyle] = getSplitStyles(style);
|
|
8
8
|
const cleanedStyles = getCleanedStyles(styles, disabled);
|
|
@@ -34,7 +34,7 @@ const getData = (props)=>{
|
|
|
34
34
|
pageContext
|
|
35
35
|
},
|
|
36
36
|
...isLiquid && {
|
|
37
|
-
|
|
37
|
+
isUseTranslatedValue
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
};
|
|
@@ -23,8 +23,8 @@ const getCleanedStyles = (styles, disabled)=>{
|
|
|
23
23
|
});
|
|
24
24
|
return cleanedStyles;
|
|
25
25
|
};
|
|
26
|
-
const handleGetLabelToDisplay = ({ label, styles, translate, pageContext,
|
|
27
|
-
const liquidLabel =
|
|
26
|
+
const handleGetLabelToDisplay = ({ label, styles, translate, pageContext, isUseTranslatedValue, builderProps, isLiquid = false })=>{
|
|
27
|
+
const liquidLabel = !isUseTranslatedValue ? label : getDynamicSourceLocales({
|
|
28
28
|
translate,
|
|
29
29
|
val: label,
|
|
30
30
|
pageContext,
|
|
@@ -48,8 +48,8 @@ const ProductButton = (props)=>{
|
|
|
48
48
|
gp-data-wrapper="true"
|
|
49
49
|
gp-href="${urlData.href}"
|
|
50
50
|
class="gp-product-button"
|
|
51
|
-
label-out-of-
|
|
52
|
-
label-unavailable="${unavailableButtonLabel}"
|
|
51
|
+
gp-label-out-of-stock="${outOfStockButtonLabel}"
|
|
52
|
+
gp-label-unavailable="${unavailableButtonLabel}"
|
|
53
53
|
gp-data='${JSON.stringify(productButtonState).replaceAll("'", ''')}'
|
|
54
54
|
data-variant-selection-required-message="${variantSelectionRequiredMessage}"
|
|
55
55
|
>
|
|
@@ -30,7 +30,7 @@ const SoldOutButton = (props)=>{
|
|
|
30
30
|
uid: `${builderProps?.uid}-sold-out`
|
|
31
31
|
},
|
|
32
32
|
pageContext,
|
|
33
|
-
|
|
33
|
+
isUseTranslatedValue: true,
|
|
34
34
|
dataId: builderProps?.uid,
|
|
35
35
|
customAttrs: {
|
|
36
36
|
'gp-data-hidden': `{% if variant.available %}true{% endif %}`
|
package/dist/types/index.d.ts
CHANGED
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.604",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"update-img-src-3rd": "node ./scripts/update-img-src-3rd.js"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@gem-sdk/core": "2.0.0-dev.
|
|
26
|
+
"@gem-sdk/core": "2.0.0-dev.604",
|
|
27
27
|
"@gem-sdk/styles": "2.0.0-dev.571",
|
|
28
28
|
"@gem-sdk/system": "2.0.0-dev.504",
|
|
29
29
|
"@types/react-transition-group": "^4.4.5"
|