@gem-sdk/core 1.23.0-staging.228 → 1.23.0-staging.233

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.
@@ -213,10 +213,11 @@ const ComponentToolbarPreview = ({ ...props })=>{
213
213
  return false;
214
214
  };
215
215
  const getSectionName = ()=>{
216
- if (props.name && props.name === `Section ${props.uid}`) {
217
- return `Section ${getIndexSection() + 1}${getSectionNumber() >= SECTION_LIMIT - 5 ? `/${SECTION_LIMIT}` : ''}`;
216
+ const checkRenamedSection = props.name && props.name === `Section ${props.uid}`;
217
+ if (getSectionNumber() >= SECTION_LIMIT - 5) {
218
+ return checkRenamedSection ? 'Section' : `${props?.name} ${getIndexSection() + 1}/${SECTION_LIMIT}`;
218
219
  }
219
- return props.name;
220
+ return checkRenamedSection ? `Section ${getIndexSection() + 1}` : props?.name;
220
221
  };
221
222
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
222
223
  children: [
@@ -14,13 +14,13 @@ const composeSpacing = ({ source, spacing, type, suffix = '' })=>{
14
14
  if (bottom) source[`--${type}b${suffix}`] = bottom;
15
15
  if (right) source[`--${type}r${suffix}`] = right;
16
16
  };
17
- const composeSpacingV2 = ({ source, spacing, suffix = '' })=>{
17
+ const composeSpacingV2 = ({ source, spacing, suffix = '', tag = '' })=>{
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 === '0px' ? 'auto' : left;
21
+ if (left) source[`--ml${suffix}`] = constant.layoutComponent.includes(tag) && left === '0px' ? 'auto' : left;
22
22
  if (bottom) source[`--mb${suffix}`] = bottom;
23
- if (right) source[`--mr${suffix}`] = right === '0px' ? 'auto' : right;
23
+ if (right) source[`--mr${suffix}`] = constant.layoutComponent.includes(tag) && right === '0px' ? 'auto' : right;
24
24
  }
25
25
  if (spacing && spacing.padding) {
26
26
  const { top, left, bottom, right } = spacing.padding;
@@ -93,7 +93,8 @@ function composeAdvanceStyle(data, tag) {
93
93
  case 'spacing-setting':
94
94
  composeSpacingV2({
95
95
  source: styles,
96
- spacing: deviceValue
96
+ spacing: deviceValue,
97
+ tag
97
98
  });
98
99
  break;
99
100
  case 'm':
@@ -125,7 +126,8 @@ function composeAdvanceStyle(data, tag) {
125
126
  composeSpacingV2({
126
127
  source: styles,
127
128
  spacing: deviceValue,
128
- suffix: `-${composeAttr}`
129
+ suffix: `-${composeAttr}`,
130
+ tag
129
131
  });
130
132
  break;
131
133
  case 'm':
@@ -211,10 +211,11 @@ const ComponentToolbarPreview = ({ ...props })=>{
211
211
  return false;
212
212
  };
213
213
  const getSectionName = ()=>{
214
- if (props.name && props.name === `Section ${props.uid}`) {
215
- return `Section ${getIndexSection() + 1}${getSectionNumber() >= SECTION_LIMIT - 5 ? `/${SECTION_LIMIT}` : ''}`;
214
+ const checkRenamedSection = props.name && props.name === `Section ${props.uid}`;
215
+ if (getSectionNumber() >= SECTION_LIMIT - 5) {
216
+ return checkRenamedSection ? 'Section' : `${props?.name} ${getIndexSection() + 1}/${SECTION_LIMIT}`;
216
217
  }
217
- return props.name;
218
+ return checkRenamedSection ? `Section ${getIndexSection() + 1}` : props?.name;
218
219
  };
219
220
  return /*#__PURE__*/ jsxs(Fragment, {
220
221
  children: [
@@ -12,13 +12,13 @@ const composeSpacing = ({ source, spacing, type, suffix = '' })=>{
12
12
  if (bottom) source[`--${type}b${suffix}`] = bottom;
13
13
  if (right) source[`--${type}r${suffix}`] = right;
14
14
  };
15
- const composeSpacingV2 = ({ source, spacing, suffix = '' })=>{
15
+ const composeSpacingV2 = ({ source, spacing, suffix = '', tag = '' })=>{
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 === '0px' ? 'auto' : left;
19
+ if (left) source[`--ml${suffix}`] = layoutComponent.includes(tag) && left === '0px' ? 'auto' : left;
20
20
  if (bottom) source[`--mb${suffix}`] = bottom;
21
- if (right) source[`--mr${suffix}`] = right === '0px' ? 'auto' : right;
21
+ if (right) source[`--mr${suffix}`] = layoutComponent.includes(tag) && right === '0px' ? 'auto' : right;
22
22
  }
23
23
  if (spacing && spacing.padding) {
24
24
  const { top, left, bottom, right } = spacing.padding;
@@ -91,7 +91,8 @@ function composeAdvanceStyle(data, tag) {
91
91
  case 'spacing-setting':
92
92
  composeSpacingV2({
93
93
  source: styles,
94
- spacing: deviceValue
94
+ spacing: deviceValue,
95
+ tag
95
96
  });
96
97
  break;
97
98
  case 'm':
@@ -123,7 +124,8 @@ function composeAdvanceStyle(data, tag) {
123
124
  composeSpacingV2({
124
125
  source: styles,
125
126
  spacing: deviceValue,
126
- suffix: `-${composeAttr}`
127
+ suffix: `-${composeAttr}`,
128
+ tag
127
129
  });
128
130
  break;
129
131
  case 'm':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.23.0-staging.228",
3
+ "version": "1.23.0-staging.233",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@gem-sdk/adapter-shopify": "1.23.0-staging.26",
28
- "@gem-sdk/styles": "1.23.0-staging.207"
28
+ "@gem-sdk/styles": "1.23.0-staging.233"
29
29
  },
30
30
  "dependencies": {
31
31
  "react-error-boundary": "4.0.10",