@gem-sdk/components 2.0.0-dev.457 → 2.0.0-dev.460

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.
Files changed (34) hide show
  1. package/dist/cjs/breadcrumb/components/Breadcrumb.js +1 -0
  2. package/dist/cjs/breadcrumb/components/Breadcrumb.liquid.js +1 -0
  3. package/dist/cjs/breadcrumb/setting/configs/settings.js +29 -2
  4. package/dist/cjs/breadcrumb/setting/configs/uiV2.js +230 -114
  5. package/dist/cjs/button/setting/configs/settings.js +2 -1
  6. package/dist/cjs/coupon/common/classes.js +16 -2
  7. package/dist/cjs/coupon/common/index.js +2 -2
  8. package/dist/cjs/coupon/common/styles.js +44 -26
  9. package/dist/cjs/coupon/components/Coupon.js +3 -6
  10. package/dist/cjs/coupon/components/Coupon.liquid.js +4 -7
  11. package/dist/cjs/coupon/setting/config/settings.js +194 -131
  12. package/dist/cjs/coupon/setting/config/uiV2.js +349 -142
  13. package/dist/cjs/product/components/FileUpload/components/config/uiV2.js +15 -0
  14. package/dist/cjs/product/setting/product/configs/settings.js +1 -1
  15. package/dist/cjs/sticky/components/Sticky.js +0 -2
  16. package/dist/cjs/sticky/components/Sticky.liquid.js +1 -2
  17. package/dist/esm/breadcrumb/components/Breadcrumb.js +2 -1
  18. package/dist/esm/breadcrumb/components/Breadcrumb.liquid.js +2 -1
  19. package/dist/esm/breadcrumb/setting/configs/settings.js +29 -2
  20. package/dist/esm/breadcrumb/setting/configs/uiV2.js +230 -114
  21. package/dist/esm/button/setting/configs/settings.js +2 -1
  22. package/dist/esm/coupon/common/classes.js +16 -2
  23. package/dist/esm/coupon/common/index.js +2 -2
  24. package/dist/esm/coupon/common/styles.js +45 -26
  25. package/dist/esm/coupon/components/Coupon.js +5 -8
  26. package/dist/esm/coupon/components/Coupon.liquid.js +6 -9
  27. package/dist/esm/coupon/setting/config/settings.js +194 -131
  28. package/dist/esm/coupon/setting/config/uiV2.js +349 -142
  29. package/dist/esm/product/components/FileUpload/components/config/uiV2.js +15 -0
  30. package/dist/esm/product/setting/product/configs/settings.js +1 -1
  31. package/dist/esm/sticky/components/Sticky.js +2 -4
  32. package/dist/esm/sticky/components/Sticky.liquid.js +1 -2
  33. package/dist/types/index.d.ts +1 -0
  34. package/package.json +2 -2
@@ -273,7 +273,7 @@ const ProductSettings = [
273
273
  max: 80,
274
274
  devices: {
275
275
  desktop: {
276
- default: '16px'
276
+ default: '32px'
277
277
  }
278
278
  }
279
279
  },
@@ -14,7 +14,6 @@ var system = require('@gem-sdk/system');
14
14
  var styles = require('./common/styles.js');
15
15
 
16
16
  const Sticky = ({ children, builderAttrs, setting, style, builderProps })=>{
17
- const mode = core.useEditorMode();
18
17
  const { background, preloadBgImage } = setting ?? {};
19
18
  const { w, positionStyle, displayStyle, getCSSAlign } = useSticky.default(setting);
20
19
  const computedContainerStyles = system.createStyle({
@@ -22,7 +21,6 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps })=>{
22
21
  ...w,
23
22
  ...displayStyle,
24
23
  ...styles.getStylePadding(style),
25
- ...mode !== 'edit' && setting?.isScrollToTop ? styles.displayConditionStyle(setting?.display, setting?.position) : {},
26
24
  ...positionStyle,
27
25
  ...getCSSAlign,
28
26
  zIndex: _const.ELEMENT_Z_INDEX.STICKY
@@ -19,8 +19,7 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
19
19
  const createDataState = system.createStateOrContext({
20
20
  uid: builderProps?.uid,
21
21
  setting: {
22
- display,
23
- isScrollToTop
22
+ display
24
23
  },
25
24
  advanced: {
26
25
  d: advancedDisplay
@@ -7,7 +7,7 @@ import { createAttr, createStyle, createClass } from '@gem-sdk/system';
7
7
  import { getAttr, getNavAttr } from './common/attr.js';
8
8
  import { getBreadcrumbStyles, getSpacingStyles } from './common/style.js';
9
9
  import { getBreadcrumbClasses, getNavClasses } from './common/classes.js';
10
- import { makeStyleResponsive } from '@gem-sdk/core';
10
+ import { makeGlobalSize, makeStyleResponsive } from '@gem-sdk/core';
11
11
 
12
12
  const Breadcrumb = ({ className, setting = {}, style, styles = {}, builderAttrs, builderProps })=>{
13
13
  const { background, align } = setting || {};
@@ -51,6 +51,7 @@ const Breadcrumb = ({ className, setting = {}, style, styles = {}, builderAttrs,
51
51
  ...getNavAttr()
52
52
  });
53
53
  const navStyles = createStyle({
54
+ ...makeGlobalSize(setting?.globalSize).padding,
54
55
  ...getSpacingStyles(setting?.spacing),
55
56
  ...makeStyleResponsive('jc', align)
56
57
  });
@@ -1,4 +1,4 @@
1
- import { makeStyleResponsive, template } from '@gem-sdk/core';
1
+ import { makeGlobalSize, makeStyleResponsive, template } from '@gem-sdk/core';
2
2
  import { createAttr, createClass, createStyle, Liquid, LiquidUnless } from '@gem-sdk/system';
3
3
  import { BreadcrumbItem } from './BreadcrumbItem.liquid.js';
4
4
  import { getAttr, getNavAttr } from './common/attr.js';
@@ -45,6 +45,7 @@ const Breadcrumb = ({ setting = {}, builderAttrs, style, styles = {}, className,
45
45
  ...getNavAttr()
46
46
  });
47
47
  const navStyles = createStyle({
48
+ ...makeGlobalSize(setting?.globalSize).padding,
48
49
  ...getSpacingStyles(spacing),
49
50
  ...makeStyleResponsive('jc', align)
50
51
  });
@@ -2,6 +2,31 @@ const BreadcrumbSettings = [
2
2
  {
3
3
  id: 'setting',
4
4
  controls: [
5
+ {
6
+ id: 'globalSize',
7
+ type: 'size-setting',
8
+ devices: {
9
+ desktop: {
10
+ default: {
11
+ width: 'Auto',
12
+ height: 'Auto',
13
+ padding: {
14
+ type: 'custom',
15
+ top: '4px',
16
+ bottom: '4px',
17
+ left: '16px',
18
+ right: '16px'
19
+ }
20
+ }
21
+ }
22
+ },
23
+ hiddenSettings: [
24
+ 'shape',
25
+ 'gap',
26
+ 'width',
27
+ 'height'
28
+ ]
29
+ },
5
30
  {
6
31
  id: 'hideCurrentPage',
7
32
  type: 'toggle',
@@ -35,10 +60,12 @@ const BreadcrumbSettings = [
35
60
  {
36
61
  id: 'spacing',
37
62
  label: 'Spacing',
38
- type: 'input:unit',
63
+ type: 'input:slider',
39
64
  units: [
40
65
  'px'
41
66
  ],
67
+ step: 1,
68
+ max: 40,
42
69
  devices: {
43
70
  desktop: {
44
71
  default: '4px'
@@ -178,7 +205,7 @@ const BreadcrumbSettings = [
178
205
  id: 'color',
179
206
  type: 'color-picker-v2',
180
207
  label: 'Color',
181
- default: '#595959'
208
+ default: 'text-1'
182
209
  }
183
210
  ]
184
211
  },
@@ -1,204 +1,320 @@
1
1
  const SettingUIV2 = [
2
2
  {
3
+ label: {
4
+ en: 'Separator Icon'
5
+ },
3
6
  controls: [
4
7
  {
5
8
  label: {
6
- en: 'Hide current page'
9
+ en: 'Icon'
7
10
  },
8
11
  setting: {
9
- id: 'hideCurrentPage'
12
+ id: 'iconSvg'
13
+ }
14
+ },
15
+ {
16
+ label: {
17
+ en: 'Color'
10
18
  },
11
- options: {
12
- labelVariant: 'primary',
13
- toggleStyle: 'switch'
19
+ setting: {
20
+ id: 'color'
21
+ }
22
+ },
23
+ {
24
+ label: {
25
+ en: 'Size'
26
+ },
27
+ setting: {
28
+ id: 'iconWidth'
14
29
  }
15
30
  }
16
31
  ]
17
32
  },
18
33
  {
19
34
  label: {
20
- en: 'Item'
35
+ en: 'Text style'
21
36
  },
22
37
  controls: [
23
38
  {
24
- label: {
25
- en: 'Text style'
39
+ setting: {
40
+ id: 'typo'
26
41
  },
27
- type: 'combo',
28
- iconName: 'polaris-text-title',
29
- fixedValue: 'Edit...',
30
- isHideClear: true,
31
- controls: [
32
- {
33
- setting: {
34
- id: 'typo'
42
+ layout: 'vertical',
43
+ options: {
44
+ updateFields: [
45
+ {
46
+ field: 'attrs.color',
47
+ settingId: 'labelColor',
48
+ state: 'normal'
35
49
  },
36
- layout: 'vertical',
37
- options: {
38
- updateFields: [
39
- {
40
- field: 'attrs.color',
41
- settingId: 'labelColor',
42
- state: 'normal'
43
- },
44
- {
45
- field: 'custom.fontWeight',
46
- settingId: 'fontWeight',
47
- state: 'normal'
48
- }
49
- ]
50
+ {
51
+ field: 'custom.fontWeight',
52
+ settingId: 'fontWeight',
53
+ state: 'normal'
54
+ }
55
+ ]
56
+ },
57
+ controlChangeTrigger: {
58
+ settings: [
59
+ {
60
+ action: {
61
+ controlId: 'labelColor',
62
+ valueFromField: 'attrs.color',
63
+ groupType: 'setting',
64
+ controlType: 'setting',
65
+ removeDevice: true,
66
+ state: 'normal'
67
+ }
50
68
  },
51
- controlChangeTrigger: {
52
- settings: [
53
- {
54
- action: {
55
- controlId: 'labelColor',
56
- valueFromField: 'attrs.color',
57
- groupType: 'setting',
58
- controlType: 'setting',
59
- removeDevice: true,
60
- state: 'normal'
61
- }
62
- },
63
- {
64
- action: {
65
- controlId: 'fontWeight',
66
- valueFromField: 'custom.fontWeight',
67
- groupType: 'setting',
68
- controlType: 'setting',
69
- removeDevice: true,
70
- state: 'normal'
71
- }
72
- }
73
- ],
74
- options: {
75
- noRecordHistory: true
69
+ {
70
+ action: {
71
+ controlId: 'fontWeight',
72
+ valueFromField: 'custom.fontWeight',
73
+ groupType: 'setting',
74
+ controlType: 'setting',
75
+ removeDevice: true,
76
+ state: 'normal'
76
77
  }
77
78
  }
79
+ ],
80
+ options: {
81
+ noRecordHistory: true
78
82
  }
79
- ]
80
- },
83
+ }
84
+ }
85
+ ]
86
+ },
87
+ {
88
+ label: {
89
+ en: 'Item spacing'
90
+ },
91
+ controls: [
81
92
  {
82
93
  label: {
83
- en: 'Effect'
94
+ en: 'Gap'
84
95
  },
85
- type: 'combo',
86
- iconName: 'polaris-edit',
87
- fixedValue: 'Hover',
88
- isHideClear: true,
89
- popoverLabel: {
90
- en: 'Hover'
96
+ setting: {
97
+ id: 'spacing'
98
+ }
99
+ }
100
+ ]
101
+ },
102
+ {
103
+ label: {
104
+ en: 'Size'
105
+ },
106
+ controls: [
107
+ {
108
+ label: {
109
+ en: 'Padding'
91
110
  },
92
- controls: [
93
- {
94
- label: {
95
- en: 'Text color'
96
- },
97
- setting: {
98
- id: 'labelColor',
99
- state: 'hover'
100
- }
111
+ controlConfig: {
112
+ id: 'padding',
113
+ type: 'padding-v2',
114
+ linkWithSetting: {
115
+ name: 'globalSize',
116
+ field: 'padding'
101
117
  },
102
- {
103
- label: {
104
- en: 'Font weight'
105
- },
106
- setting: {
107
- id: 'fontWeight',
108
- state: 'hover'
118
+ compoDefaultValue: {
119
+ desktop: {
120
+ default: {
121
+ type: 'custom',
122
+ top: '4px',
123
+ bottom: '4px',
124
+ left: '16px',
125
+ right: '16px'
126
+ }
109
127
  }
110
128
  }
111
- ]
129
+ }
112
130
  }
113
131
  ]
114
132
  },
115
133
  {
116
134
  label: {
117
- en: 'Item spacing'
135
+ en: 'Background'
118
136
  },
119
137
  controls: [
120
138
  {
121
139
  label: {
122
- en: 'Spacing'
140
+ en: 'Color'
123
141
  },
124
- setting: {
125
- id: 'spacing'
142
+ controlConfig: {
143
+ id: 'background-color',
144
+ type: 'color-picker-v2',
145
+ linkWithSetting: {
146
+ name: 'background',
147
+ field: 'color'
148
+ },
149
+ compoDefaultValue: {
150
+ desktop: {
151
+ default: '#ffffff'
152
+ }
153
+ }
126
154
  }
127
155
  }
128
156
  ]
129
157
  },
130
158
  {
131
159
  label: {
132
- en: 'Separator Icon'
160
+ en: 'Shape'
133
161
  },
134
162
  controls: [
135
163
  {
136
164
  label: {
137
- en: 'Choose icon'
165
+ en: 'Border'
138
166
  },
139
167
  setting: {
140
- id: 'iconSvg'
168
+ id: 'border',
169
+ state: 'normal'
141
170
  }
142
171
  },
143
172
  {
144
173
  label: {
145
- en: 'Size'
174
+ en: 'Corner'
146
175
  },
147
176
  setting: {
148
- id: 'iconWidth'
177
+ id: 'rounded',
178
+ state: 'normal'
149
179
  }
150
180
  },
151
181
  {
152
182
  label: {
153
- en: 'Icon color'
183
+ en: 'Shadow'
154
184
  },
155
185
  setting: {
156
- id: 'color'
186
+ id: 'boxShadow',
187
+ state: 'normal'
188
+ },
189
+ options: {
190
+ updateFields: [
191
+ {
192
+ field: 'enable',
193
+ settingId: 'hasBoxShadow',
194
+ state: 'normal'
195
+ }
196
+ ]
197
+ },
198
+ controlChangeTrigger: {
199
+ settings: [
200
+ {
201
+ condition: `boxShadow.normal.enable === true`,
202
+ source: [
203
+ 'boxShadow',
204
+ 'hasBoxShadow'
205
+ ],
206
+ action: {
207
+ controlId: 'hasBoxShadow',
208
+ groupType: 'advanced',
209
+ controlType: 'advanced',
210
+ state: 'normal',
211
+ newValue: true
212
+ }
213
+ },
214
+ {
215
+ condition: `boxShadow.normal.enable === false`,
216
+ source: [
217
+ 'boxShadow',
218
+ 'hasBoxShadow'
219
+ ],
220
+ action: {
221
+ controlId: 'hasBoxShadow',
222
+ groupType: 'advanced',
223
+ controlType: 'advanced',
224
+ state: 'normal',
225
+ newValue: false
226
+ }
227
+ }
228
+ ],
229
+ options: {
230
+ noRecordHistory: true
231
+ }
157
232
  }
158
233
  }
159
234
  ]
160
235
  },
161
236
  {
162
237
  label: {
163
- en: 'Background'
238
+ en: 'Effect'
164
239
  },
165
240
  controls: [
166
241
  {
167
242
  label: {
168
- en: 'Color'
243
+ en: 'Hover'
169
244
  },
170
- controlConfig: {
171
- id: 'background-color',
172
- type: 'color-picker-v2',
173
- linkWithSetting: {
174
- name: 'background',
175
- field: 'color'
245
+ type: 'combo',
246
+ iconName: 'polaris-check-hover',
247
+ fixedValue: 'Enabled',
248
+ isHideClear: true,
249
+ popoverLabel: {
250
+ en: 'Hover'
251
+ },
252
+ controls: [
253
+ {
254
+ label: {
255
+ en: 'Text color'
256
+ },
257
+ setting: {
258
+ id: 'labelColor',
259
+ state: 'hover'
260
+ }
261
+ },
262
+ {
263
+ label: {
264
+ en: 'Font weight'
265
+ },
266
+ setting: {
267
+ id: 'fontWeight',
268
+ state: 'hover'
269
+ }
176
270
  }
177
- }
271
+ ]
272
+ },
273
+ {
274
+ label: {
275
+ en: 'Active'
276
+ },
277
+ type: 'combo',
278
+ iconName: 'polaris-status-active',
279
+ fixedValue: 'Enabled',
280
+ isHideClear: true,
281
+ popoverLabel: {
282
+ en: 'Active'
283
+ },
284
+ controls: [
285
+ {
286
+ label: {
287
+ en: 'Text color'
288
+ },
289
+ setting: {
290
+ id: 'labelColor',
291
+ state: 'active'
292
+ }
293
+ },
294
+ {
295
+ label: {
296
+ en: 'Font weight'
297
+ },
298
+ setting: {
299
+ id: 'fontWeight',
300
+ state: 'active'
301
+ }
302
+ }
303
+ ]
178
304
  }
179
305
  ]
180
306
  },
181
307
  {
182
308
  label: {
183
- en: 'Active item'
309
+ en: 'Display option'
184
310
  },
185
311
  controls: [
186
312
  {
187
313
  label: {
188
- en: 'Text color'
314
+ en: 'Current page'
189
315
  },
190
316
  setting: {
191
- id: 'labelColor',
192
- state: 'active'
193
- }
194
- },
195
- {
196
- label: {
197
- en: 'Font weight'
198
- },
199
- setting: {
200
- id: 'fontWeight',
201
- state: 'active'
317
+ id: 'hideCurrentPage'
202
318
  }
203
319
  }
204
320
  ]
@@ -422,7 +422,8 @@ const ButtonSettings = [
422
422
  hover: 'text-3'
423
423
  }
424
424
  }
425
- }
425
+ },
426
+ enableGradient: true
426
427
  },
427
428
  {
428
429
  id: 'transform',
@@ -1,7 +1,21 @@
1
1
  import { composeClasses, cls } from '@gem-sdk/core';
2
2
 
3
- const getActiveClasses = (backgroundColorActive, textActive)=>{
4
- return composeClasses(cls('gp-coupon', backgroundColorActive ? `[&_button]:data-[active=true]:!gp-bg-[${backgroundColorActive}]` : '', textActive ? `[&_button]:data-[active=true]:!gp-text-[${textActive}]` : ''));
3
+ const getActiveClasses = (backgroundColor, text)=>{
4
+ const breakpoints = {
5
+ desktop: '',
6
+ tablet: 'tablet:',
7
+ mobile: 'mobile:'
8
+ };
9
+ const generateClass = (type, device, value)=>value ? `${breakpoints[device]}[_&button]:data-[active=true]:!gp-${type}-[${value}]` : '';
10
+ const classes = [
11
+ generateClass('bg', 'desktop', backgroundColor?.desktop?.active),
12
+ generateClass('bg', 'tablet', backgroundColor?.tablet?.active),
13
+ generateClass('bg', 'mobile', backgroundColor?.mobile?.active),
14
+ generateClass('text', 'desktop', text?.desktop?.active),
15
+ generateClass('text', 'tablet', text?.tablet?.active),
16
+ generateClass('text', 'mobile', text?.mobile?.active)
17
+ ].filter(Boolean).join(' ');
18
+ return composeClasses(cls('gp-coupon', classes));
5
19
  };
6
20
 
7
21
  export { getActiveClasses };
@@ -1,11 +1,11 @@
1
1
  const getButtonSetting = (setting, label, htmlType)=>{
2
- const { iconSvg, iconAlign, couponLayout, translate, shouldClearSpace } = setting ?? {};
2
+ const { iconSvg, iconAlign, couponLayout, translate, shouldClearSpace, iconVisible } = setting ?? {};
3
3
  return {
4
4
  label,
5
5
  htmlType,
6
6
  iconAlign,
7
7
  iconSvg,
8
- iconVisible: couponLayout === 'icon',
8
+ iconVisible: couponLayout === 'icon' && iconVisible,
9
9
  translate,
10
10
  shouldClearSpace
11
11
  };