@gem-sdk/components 2.0.0-dev.383 → 2.0.0-dev.384

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.
@@ -9,7 +9,7 @@ var helpers = require('./helpers.js');
9
9
  const getRowStyle = (rowProps)=>{
10
10
  const { children, setting, builderProps, styles, style, advanced, isNotFullWidth } = rowProps;
11
11
  const { isSection, layout, horizontalAlign, responsive, inlineAlignment } = setting ?? {};
12
- const { width, columnGap, fullWidth, background, verticalGutter, verticalGutterMobile } = styles ?? {};
12
+ const { width, columnGap, fullWidth, background, verticalGutter, verticalGutterMobile, enablePagePadding } = styles ?? {};
13
13
  const innerRadius = getInnerRadius.getInnerRadiusExcludeBorder(advanced?.border, advanced?.rounded);
14
14
  const overFlowStyle = core.makeStyleResponsive('of', {
15
15
  desktop: innerRadius.desktop ? 'hidden' : undefined,
@@ -91,11 +91,16 @@ const getRowStyle = (rowProps)=>{
91
91
  transform: 'translateY(-50%)',
92
92
  top: '50%'
93
93
  });
94
+ const sectionPagePaddingStyle = {
95
+ desktop: enablePagePadding?.desktop ? 'var(--g-ct-p, 15px)' : undefined,
96
+ tablet: enablePagePadding?.tablet ? 'var(--g-ct-p, 15px)' : undefined,
97
+ mobile: enablePagePadding?.mobile ? 'var(--g-ct-p, 15px)' : undefined
98
+ };
94
99
  const sectionStyle = system.createStyle({
95
100
  ...wrapStyle,
96
101
  ...core.makeStyleResponsive('w', sizeStyles.wrapper),
97
- ...core.makeStyleResponsive('pl', sizeStyles.padding),
98
- ...core.makeStyleResponsive('pr', sizeStyles.padding)
102
+ ...core.makeStyleResponsive('pl', sectionPagePaddingStyle),
103
+ ...core.makeStyleResponsive('pr', sectionPagePaddingStyle)
99
104
  });
100
105
  return {
101
106
  embedVideoStyle,
@@ -28,10 +28,10 @@ const config = {
28
28
  }
29
29
  },
30
30
  styles: {
31
- fullWidth: {
32
- desktop: true,
33
- tablet: true,
34
- mobile: true
31
+ enablePagePadding: {
32
+ desktop: false,
33
+ tablet: false,
34
+ mobile: false
35
35
  }
36
36
  },
37
37
  advanced: {
@@ -146,8 +146,8 @@ const SectionSettings = [
146
146
  id: 'style',
147
147
  controls: [
148
148
  {
149
- id: 'fullWidth',
150
- label: 'Full Width',
149
+ id: 'enablePagePadding',
150
+ label: 'Page padding',
151
151
  type: 'toggle',
152
152
  devices: {
153
153
  desktop: {
@@ -174,7 +174,7 @@ const SectionSettings = [
174
174
  isRowWith: true,
175
175
  devices: {
176
176
  desktop: {
177
- default: 'default'
177
+ default: '100%'
178
178
  }
179
179
  },
180
180
  displayOptions: [
@@ -7,10 +7,7 @@ const SettingUIV2 = [
7
7
  setting: {
8
8
  id: 'layout'
9
9
  },
10
- layout: 'vertical',
11
- options: {
12
- fullWidth: true
13
- }
10
+ layout: 'vertical'
14
11
  },
15
12
  {
16
13
  label: {
@@ -19,9 +16,6 @@ const SettingUIV2 = [
19
16
  setting: {
20
17
  id: 'columnGap'
21
18
  },
22
- options: {
23
- fullWidth: true
24
- },
25
19
  conditionDisplay: `pageType == "POST_PURCHASE"`,
26
20
  conditionEnable: '!!layout.cols && layout.cols.length > 1'
27
21
  }
@@ -88,17 +82,8 @@ const SettingUIV2 = [
88
82
  en: 'Size'
89
83
  },
90
84
  controls: [
91
- {
92
- setting: {
93
- id: 'fullWidth'
94
- },
95
- label: {
96
- en: 'Full Width'
97
- }
98
- },
99
85
  {
100
86
  id: 'Width',
101
- conditionDisplay: 'fullWidth !== true',
102
87
  setting: {
103
88
  id: 'width'
104
89
  },
@@ -136,6 +121,14 @@ const SettingUIV2 = [
136
121
  }
137
122
  }
138
123
  }
124
+ },
125
+ {
126
+ setting: {
127
+ id: 'enablePagePadding'
128
+ },
129
+ label: {
130
+ en: 'Page padding'
131
+ }
139
132
  }
140
133
  ]
141
134
  },
@@ -7,7 +7,7 @@ import { createStyleObject } from './helpers.js';
7
7
  const getRowStyle = (rowProps)=>{
8
8
  const { children, setting, builderProps, styles, style, advanced, isNotFullWidth } = rowProps;
9
9
  const { isSection, layout, horizontalAlign, responsive, inlineAlignment } = setting ?? {};
10
- const { width, columnGap, fullWidth, background, verticalGutter, verticalGutterMobile } = styles ?? {};
10
+ const { width, columnGap, fullWidth, background, verticalGutter, verticalGutterMobile, enablePagePadding } = styles ?? {};
11
11
  const innerRadius = getInnerRadiusExcludeBorder(advanced?.border, advanced?.rounded);
12
12
  const overFlowStyle = makeStyleResponsive('of', {
13
13
  desktop: innerRadius.desktop ? 'hidden' : undefined,
@@ -89,11 +89,16 @@ const getRowStyle = (rowProps)=>{
89
89
  transform: 'translateY(-50%)',
90
90
  top: '50%'
91
91
  });
92
+ const sectionPagePaddingStyle = {
93
+ desktop: enablePagePadding?.desktop ? 'var(--g-ct-p, 15px)' : undefined,
94
+ tablet: enablePagePadding?.tablet ? 'var(--g-ct-p, 15px)' : undefined,
95
+ mobile: enablePagePadding?.mobile ? 'var(--g-ct-p, 15px)' : undefined
96
+ };
92
97
  const sectionStyle = createStyle({
93
98
  ...wrapStyle,
94
99
  ...makeStyleResponsive('w', sizeStyles.wrapper),
95
- ...makeStyleResponsive('pl', sizeStyles.padding),
96
- ...makeStyleResponsive('pr', sizeStyles.padding)
100
+ ...makeStyleResponsive('pl', sectionPagePaddingStyle),
101
+ ...makeStyleResponsive('pr', sectionPagePaddingStyle)
97
102
  });
98
103
  return {
99
104
  embedVideoStyle,
@@ -24,10 +24,10 @@ const config = {
24
24
  }
25
25
  },
26
26
  styles: {
27
- fullWidth: {
28
- desktop: true,
29
- tablet: true,
30
- mobile: true
27
+ enablePagePadding: {
28
+ desktop: false,
29
+ tablet: false,
30
+ mobile: false
31
31
  }
32
32
  },
33
33
  advanced: {
@@ -144,8 +144,8 @@ const SectionSettings = [
144
144
  id: 'style',
145
145
  controls: [
146
146
  {
147
- id: 'fullWidth',
148
- label: 'Full Width',
147
+ id: 'enablePagePadding',
148
+ label: 'Page padding',
149
149
  type: 'toggle',
150
150
  devices: {
151
151
  desktop: {
@@ -172,7 +172,7 @@ const SectionSettings = [
172
172
  isRowWith: true,
173
173
  devices: {
174
174
  desktop: {
175
- default: 'default'
175
+ default: '100%'
176
176
  }
177
177
  },
178
178
  displayOptions: [
@@ -5,10 +5,7 @@ const SettingUIV2 = [
5
5
  setting: {
6
6
  id: 'layout'
7
7
  },
8
- layout: 'vertical',
9
- options: {
10
- fullWidth: true
11
- }
8
+ layout: 'vertical'
12
9
  },
13
10
  {
14
11
  label: {
@@ -17,9 +14,6 @@ const SettingUIV2 = [
17
14
  setting: {
18
15
  id: 'columnGap'
19
16
  },
20
- options: {
21
- fullWidth: true
22
- },
23
17
  conditionDisplay: `pageType == "POST_PURCHASE"`,
24
18
  conditionEnable: '!!layout.cols && layout.cols.length > 1'
25
19
  }
@@ -86,17 +80,8 @@ const SettingUIV2 = [
86
80
  en: 'Size'
87
81
  },
88
82
  controls: [
89
- {
90
- setting: {
91
- id: 'fullWidth'
92
- },
93
- label: {
94
- en: 'Full Width'
95
- }
96
- },
97
83
  {
98
84
  id: 'Width',
99
- conditionDisplay: 'fullWidth !== true',
100
85
  setting: {
101
86
  id: 'width'
102
87
  },
@@ -134,6 +119,14 @@ const SettingUIV2 = [
134
119
  }
135
120
  }
136
121
  }
122
+ },
123
+ {
124
+ setting: {
125
+ id: 'enablePagePadding'
126
+ },
127
+ label: {
128
+ en: 'Page padding'
129
+ }
137
130
  }
138
131
  ]
139
132
  },
@@ -488,6 +488,7 @@ type RowSettingsType = {
488
488
  sameHeightSubgridContainer?: boolean;
489
489
  };
490
490
  type RowStylesType = {
491
+ enablePagePadding?: ObjectDevices$1<boolean>;
491
492
  fullWidth?: ObjectDevices$1<boolean>;
492
493
  width?: ObjectDevices$1<string>;
493
494
  preloadBgImage?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.383",
3
+ "version": "2.0.0-dev.384",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",