@gem-sdk/core 1.23.0-staging.227 → 1.23.0-staging.230

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.
@@ -212,6 +212,12 @@ const ComponentToolbarPreview = ({ ...props })=>{
212
212
  }
213
213
  return false;
214
214
  };
215
+ const getSectionName = ()=>{
216
+ if (props.name && props.name === `Section ${props.uid}`) {
217
+ return `Section ${getIndexSection() + 1}${getSectionNumber() >= SECTION_LIMIT - 5 ? `/${SECTION_LIMIT}` : ''}`;
218
+ }
219
+ return props.name;
220
+ };
215
221
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
216
222
  children: [
217
223
  !(props.tag == 'Section' && isThemeSectionEditor) && /*#__PURE__*/ jsxRuntime.jsxs("div", {
@@ -262,7 +268,7 @@ const ComponentToolbarPreview = ({ ...props })=>{
262
268
  }),
263
269
  props.tag == 'Section' ? /*#__PURE__*/ jsxRuntime.jsx("div", {
264
270
  "data-toolbar-name": true,
265
- children: props.name || `Section ${getIndexSection() + 1}${getSectionNumber() >= SECTION_LIMIT - 5 ? `/${SECTION_LIMIT}` : ''}`
271
+ children: getSectionName()
266
272
  }) : /*#__PURE__*/ jsxRuntime.jsx("div", {
267
273
  "data-toolbar-name": true,
268
274
  children: toolbarName()
@@ -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':
@@ -210,6 +210,12 @@ const ComponentToolbarPreview = ({ ...props })=>{
210
210
  }
211
211
  return false;
212
212
  };
213
+ const getSectionName = ()=>{
214
+ if (props.name && props.name === `Section ${props.uid}`) {
215
+ return `Section ${getIndexSection() + 1}${getSectionNumber() >= SECTION_LIMIT - 5 ? `/${SECTION_LIMIT}` : ''}`;
216
+ }
217
+ return props.name;
218
+ };
213
219
  return /*#__PURE__*/ jsxs(Fragment, {
214
220
  children: [
215
221
  !(props.tag == 'Section' && isThemeSectionEditor) && /*#__PURE__*/ jsxs("div", {
@@ -260,7 +266,7 @@ const ComponentToolbarPreview = ({ ...props })=>{
260
266
  }),
261
267
  props.tag == 'Section' ? /*#__PURE__*/ jsx("div", {
262
268
  "data-toolbar-name": true,
263
- children: props.name || `Section ${getIndexSection() + 1}${getSectionNumber() >= SECTION_LIMIT - 5 ? `/${SECTION_LIMIT}` : ''}`
269
+ children: getSectionName()
264
270
  }) : /*#__PURE__*/ jsx("div", {
265
271
  "data-toolbar-name": true,
266
272
  children: toolbarName()
@@ -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.227",
3
+ "version": "1.23.0-staging.230",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",