@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.
@@ -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, isForceValue = false } = props;
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
- isForceValue
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, isForceValue, builderProps, isLiquid = false })=>{
29
- const liquidLabel = isForceValue ? label : helpers.getDynamicSourceLocales({
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,
@@ -7,7 +7,8 @@ const SettingCode = [
7
7
  {
8
8
  id: 'customLabel',
9
9
  type: 'input',
10
- default: 'Custom code'
10
+ default: 'Custom code',
11
+ isUpdateCustomLabel: true
11
12
  },
12
13
  {
13
14
  id: 'editorData',
@@ -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-Stock="${outOfStockButtonLabel}"
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
- isForceValue: true,
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, isForceValue = false } = props;
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
- isForceValue
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, isForceValue, builderProps, isLiquid = false })=>{
27
- const liquidLabel = isForceValue ? label : getDynamicSourceLocales({
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,
@@ -5,7 +5,8 @@ const SettingCode = [
5
5
  {
6
6
  id: 'customLabel',
7
7
  type: 'input',
8
- default: 'Custom code'
8
+ default: 'Custom code',
9
+ isUpdateCustomLabel: true
9
10
  },
10
11
  {
11
12
  id: 'editorData',
@@ -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-Stock="${outOfStockButtonLabel}"
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
- isForceValue: true,
33
+ isUseTranslatedValue: true,
34
34
  dataId: builderProps?.uid,
35
35
  customAttrs: {
36
36
  'gp-data-hidden': `{% if variant.available %}true{% endif %}`
@@ -337,7 +337,7 @@ type ButtonProps = MixedProps$3 & BasePropsWrap<{
337
337
  nodePrice?: JSX.Element | string;
338
338
  };
339
339
  type ButtonLiquidProps = ButtonProps & {
340
- isForceValue?: boolean;
340
+ isUseTranslatedValue?: boolean;
341
341
  pageContext?: PageContext;
342
342
  };
343
343
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.601",
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.596",
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"