@gem-sdk/core 1.23.0-staging.220 → 1.23.0-staging.224

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.
@@ -34,7 +34,8 @@ const disableWrap = [
34
34
  'Product',
35
35
  'ProductImages',
36
36
  'ProductImagesV2',
37
- 'Sticky'
37
+ 'Sticky',
38
+ 'Heading'
38
39
  ];
39
40
  const customRenderChildren = [
40
41
  'Accordion',
@@ -123,11 +123,18 @@ function Spacing(props) {
123
123
  const toolbar = $component && getChildrenByAttrSelector($component, 'data-toolbar');
124
124
  const isActive = toolbar && toolbar.getAttribute('data-toolbar-active');
125
125
  if (isActive && detail?.marginBottom) {
126
- const currentValue = isNaN(parseInt(detail?.marginBottom)) ? 0 : Math.max(parseInt(detail?.marginBottom), 0);
126
+ const currentValue = parseInt(detail?.marginBottom);
127
127
  const newValue = `${currentValue}px`;
128
128
  if ($bottomDrag.current && $bottomBg.current) {
129
- $bottomBg.current.style.height = newValue;
130
- $bottomDrag.current.style.top = newValue;
129
+ if (currentValue < 0) {
130
+ $bottomBg.current.style.display = 'none';
131
+ $bottomDrag.current.style.display = 'none';
132
+ } else {
133
+ $bottomBg.current.style.display = 'block';
134
+ $bottomDrag.current.style.display = 'block';
135
+ $bottomBg.current.style.height = newValue;
136
+ $bottomDrag.current.style.top = newValue;
137
+ }
131
138
  }
132
139
  }
133
140
  }, []);
@@ -18,9 +18,9 @@ const composeSpacingV2 = ({ source, spacing, suffix = '' })=>{
18
18
  if (spacing && spacing.margin) {
19
19
  const { top, left, bottom, right } = spacing.margin;
20
20
  if (top) source[`--mt${suffix}`] = top;
21
- if (left) source[`--ml${suffix}`] = left;
21
+ if (left) source[`--ml${suffix}`] = left === '0px' ? 'auto' : left;
22
22
  if (bottom) source[`--mb${suffix}`] = bottom;
23
- if (right) source[`--mr${suffix}`] = right;
23
+ if (right) source[`--mr${suffix}`] = right === '0px' ? 'auto' : right;
24
24
  }
25
25
  if (spacing && spacing.padding) {
26
26
  const { top, left, bottom, right } = spacing.padding;
@@ -32,7 +32,8 @@ const disableWrap = [
32
32
  'Product',
33
33
  'ProductImages',
34
34
  'ProductImagesV2',
35
- 'Sticky'
35
+ 'Sticky',
36
+ 'Heading'
36
37
  ];
37
38
  const customRenderChildren = [
38
39
  'Accordion',
@@ -119,11 +119,18 @@ function Spacing(props) {
119
119
  const toolbar = $component && getChildrenByAttrSelector($component, 'data-toolbar');
120
120
  const isActive = toolbar && toolbar.getAttribute('data-toolbar-active');
121
121
  if (isActive && detail?.marginBottom) {
122
- const currentValue = isNaN(parseInt(detail?.marginBottom)) ? 0 : Math.max(parseInt(detail?.marginBottom), 0);
122
+ const currentValue = parseInt(detail?.marginBottom);
123
123
  const newValue = `${currentValue}px`;
124
124
  if ($bottomDrag.current && $bottomBg.current) {
125
- $bottomBg.current.style.height = newValue;
126
- $bottomDrag.current.style.top = newValue;
125
+ if (currentValue < 0) {
126
+ $bottomBg.current.style.display = 'none';
127
+ $bottomDrag.current.style.display = 'none';
128
+ } else {
129
+ $bottomBg.current.style.display = 'block';
130
+ $bottomDrag.current.style.display = 'block';
131
+ $bottomBg.current.style.height = newValue;
132
+ $bottomDrag.current.style.top = newValue;
133
+ }
127
134
  }
128
135
  }
129
136
  }, []);
@@ -16,9 +16,9 @@ const composeSpacingV2 = ({ source, spacing, suffix = '' })=>{
16
16
  if (spacing && spacing.margin) {
17
17
  const { top, left, bottom, right } = spacing.margin;
18
18
  if (top) source[`--mt${suffix}`] = top;
19
- if (left) source[`--ml${suffix}`] = left;
19
+ if (left) source[`--ml${suffix}`] = left === '0px' ? 'auto' : left;
20
20
  if (bottom) source[`--mb${suffix}`] = bottom;
21
- if (right) source[`--mr${suffix}`] = right;
21
+ if (right) source[`--mr${suffix}`] = right === '0px' ? 'auto' : right;
22
22
  }
23
23
  if (spacing && spacing.padding) {
24
24
  const { top, left, bottom, right } = spacing.padding;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.23.0-staging.220",
3
+ "version": "1.23.0-staging.224",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",