@gem-sdk/core 1.23.0-staging.257 → 1.23.0-staging.261

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.
@@ -38,6 +38,9 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
38
38
  if (editorConfigs.placeholder?.notAppendBeforeAfter) {
39
39
  customProps['data-placeholder-not-append-before-after'] = true;
40
40
  }
41
+ if (editorConfigs.placeholder?.notAppendLeftRight) {
42
+ customProps['data-placeholder-not-append-left-right'] = true;
43
+ }
41
44
  if (editorConfigs.toolbar?.parent) {
42
45
  customProps['data-toolbar-parent'] = true;
43
46
  }
@@ -122,7 +122,7 @@ function Spacing(props) {
122
122
  const $component = $bottomDrag.current?.closest('[data-toolbar-wrap]');
123
123
  const toolbar = $component && getChildrenByAttrSelector($component, 'data-toolbar');
124
124
  const isActive = toolbar && toolbar.getAttribute('data-toolbar-active');
125
- if (isActive && detail?.marginBottom) {
125
+ if (isActive && detail?.marginBottom !== undefined && detail?.marginBottom != null) {
126
126
  const currentValue = parseInt(detail?.marginBottom);
127
127
  const newValue = `${currentValue}px`;
128
128
  if ($bottomDrag.current && $bottomBg.current) {
@@ -134,6 +134,7 @@ function Spacing(props) {
134
134
  $bottomDrag.current.style.display = 'block';
135
135
  $bottomBg.current.style.height = newValue;
136
136
  $bottomDrag.current.style.top = newValue;
137
+ $component.style.marginBottom = newValue;
137
138
  }
138
139
  }
139
140
  }
@@ -2,7 +2,10 @@
2
2
 
3
3
  function checkInStock(variant) {
4
4
  if (!variant) return false;
5
- return variant?.inventoryQuantity && variant.inventoryQuantity > 0 || !variant?.manageInventory || variant.inventoryPolicy === 'CONTINUE';
5
+ return variant?.inventoryQuantity && variant.inventoryQuantity > 0 && !isDefaultVariant(variant) || !variant?.manageInventory || variant.inventoryPolicy === 'CONTINUE';
6
+ }
7
+ function isDefaultVariant(variant) {
8
+ return variant?.title === 'Default Title';
6
9
  }
7
10
 
8
11
  exports.checkInStock = checkInStock;
@@ -34,6 +34,9 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
34
34
  if (editorConfigs.placeholder?.notAppendBeforeAfter) {
35
35
  customProps['data-placeholder-not-append-before-after'] = true;
36
36
  }
37
+ if (editorConfigs.placeholder?.notAppendLeftRight) {
38
+ customProps['data-placeholder-not-append-left-right'] = true;
39
+ }
37
40
  if (editorConfigs.toolbar?.parent) {
38
41
  customProps['data-toolbar-parent'] = true;
39
42
  }
@@ -118,7 +118,7 @@ function Spacing(props) {
118
118
  const $component = $bottomDrag.current?.closest('[data-toolbar-wrap]');
119
119
  const toolbar = $component && getChildrenByAttrSelector($component, 'data-toolbar');
120
120
  const isActive = toolbar && toolbar.getAttribute('data-toolbar-active');
121
- if (isActive && detail?.marginBottom) {
121
+ if (isActive && detail?.marginBottom !== undefined && detail?.marginBottom != null) {
122
122
  const currentValue = parseInt(detail?.marginBottom);
123
123
  const newValue = `${currentValue}px`;
124
124
  if ($bottomDrag.current && $bottomBg.current) {
@@ -130,6 +130,7 @@ function Spacing(props) {
130
130
  $bottomDrag.current.style.display = 'block';
131
131
  $bottomBg.current.style.height = newValue;
132
132
  $bottomDrag.current.style.top = newValue;
133
+ $component.style.marginBottom = newValue;
133
134
  }
134
135
  }
135
136
  }
@@ -1,6 +1,9 @@
1
1
  function checkInStock(variant) {
2
2
  if (!variant) return false;
3
- return variant?.inventoryQuantity && variant.inventoryQuantity > 0 || !variant?.manageInventory || variant.inventoryPolicy === 'CONTINUE';
3
+ return variant?.inventoryQuantity && variant.inventoryQuantity > 0 && !isDefaultVariant(variant) || !variant?.manageInventory || variant.inventoryPolicy === 'CONTINUE';
4
+ }
5
+ function isDefaultVariant(variant) {
6
+ return variant?.title === 'Default Title';
4
7
  }
5
8
 
6
9
  export { checkInStock };
@@ -1061,6 +1061,7 @@ type ComponentSetting<P extends BaseProps> = {
1061
1061
  };
1062
1062
  placeholder?: {
1063
1063
  notAppendBeforeAfter?: boolean;
1064
+ notAppendLeftRight?: boolean;
1064
1065
  flowTag?: string[];
1065
1066
  flowPage?: string;
1066
1067
  notAppendTags?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.23.0-staging.257",
3
+ "version": "1.23.0-staging.261",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",