@gem-sdk/core 1.15.5 → 1.15.8

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.
@@ -14,6 +14,22 @@ 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 = '' })=>{
18
+ if (spacing && spacing.margin) {
19
+ const { top, left, bottom, right } = spacing.margin;
20
+ if (top) source[`--mt${suffix}`] = top;
21
+ if (left) source[`--ml${suffix}`] = left;
22
+ if (bottom) source[`--mb${suffix}`] = bottom;
23
+ if (right) source[`--mr${suffix}`] = right;
24
+ }
25
+ if (spacing && spacing.padding) {
26
+ const { top, left, bottom, right } = spacing.padding;
27
+ if (top) source[`--pt${suffix}`] = top;
28
+ if (left) source[`--pl${suffix}`] = left;
29
+ if (bottom) source[`--pb${suffix}`] = bottom;
30
+ if (right) source[`--pr${suffix}`] = right;
31
+ }
32
+ };
17
33
  const getAttrValue = (attr, value, tag)=>{
18
34
  if (value === undefined || value === null) return undefined;
19
35
  switch(attr){
@@ -73,6 +89,12 @@ function composeAdvanceStyle(data, tag) {
73
89
  type: 'm'
74
90
  });
75
91
  break;
92
+ case 'spacing-setting':
93
+ composeSpacingV2({
94
+ source: styles,
95
+ spacing: deviceValue
96
+ });
97
+ break;
76
98
  case 'm':
77
99
  case 'p':
78
100
  break;
@@ -98,6 +120,13 @@ function composeAdvanceStyle(data, tag) {
98
120
  suffix: `-${composeAttr}`
99
121
  });
100
122
  break;
123
+ case 'spacing-setting':
124
+ composeSpacingV2({
125
+ source: styles,
126
+ spacing: deviceValue,
127
+ suffix: `-${composeAttr}`
128
+ });
129
+ break;
101
130
  case 'm':
102
131
  case 'p':
103
132
  break;
@@ -12,6 +12,22 @@ 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 = '' })=>{
16
+ if (spacing && spacing.margin) {
17
+ const { top, left, bottom, right } = spacing.margin;
18
+ if (top) source[`--mt${suffix}`] = top;
19
+ if (left) source[`--ml${suffix}`] = left;
20
+ if (bottom) source[`--mb${suffix}`] = bottom;
21
+ if (right) source[`--mr${suffix}`] = right;
22
+ }
23
+ if (spacing && spacing.padding) {
24
+ const { top, left, bottom, right } = spacing.padding;
25
+ if (top) source[`--pt${suffix}`] = top;
26
+ if (left) source[`--pl${suffix}`] = left;
27
+ if (bottom) source[`--pb${suffix}`] = bottom;
28
+ if (right) source[`--pr${suffix}`] = right;
29
+ }
30
+ };
15
31
  const getAttrValue = (attr, value, tag)=>{
16
32
  if (value === undefined || value === null) return undefined;
17
33
  switch(attr){
@@ -71,6 +87,12 @@ function composeAdvanceStyle(data, tag) {
71
87
  type: 'm'
72
88
  });
73
89
  break;
90
+ case 'spacing-setting':
91
+ composeSpacingV2({
92
+ source: styles,
93
+ spacing: deviceValue
94
+ });
95
+ break;
74
96
  case 'm':
75
97
  case 'p':
76
98
  break;
@@ -96,6 +118,13 @@ function composeAdvanceStyle(data, tag) {
96
118
  suffix: `-${composeAttr}`
97
119
  });
98
120
  break;
121
+ case 'spacing-setting':
122
+ composeSpacingV2({
123
+ source: styles,
124
+ spacing: deviceValue,
125
+ suffix: `-${composeAttr}`
126
+ });
127
+ break;
99
128
  case 'm':
100
129
  case 'p':
101
130
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.15.5",
3
+ "version": "1.15.8",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",