@gem-sdk/components 2.0.0-dev.458 → 2.0.0-dev.461

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/coupon/setting/config/settings.js +0 -11
  6. package/dist/cjs/marquee/setting/Marquee.js +1 -3
  7. package/dist/cjs/marquee/setting/configs/presets.js +10 -10
  8. package/dist/cjs/marquee/setting/configs/settingsV2.js +42 -40
  9. package/dist/cjs/marquee/setting/configs/uiV2.js +137 -34
  10. package/dist/cjs/product/components/ProductVariants/components/variants/index.js +4 -1
  11. package/dist/cjs/product/setting/product/configs/settings.js +1 -1
  12. package/dist/cjs/product/setting/product-variant/configs/settings.js +9 -7
  13. package/dist/cjs/product/setting/product-variant/configs/uiV2.js +0 -3
  14. package/dist/cjs/sticky/components/Sticky.js +0 -2
  15. package/dist/cjs/sticky/components/Sticky.liquid.js +1 -2
  16. package/dist/esm/breadcrumb/components/Breadcrumb.js +2 -1
  17. package/dist/esm/breadcrumb/components/Breadcrumb.liquid.js +2 -1
  18. package/dist/esm/breadcrumb/setting/configs/settings.js +29 -2
  19. package/dist/esm/breadcrumb/setting/configs/uiV2.js +230 -114
  20. package/dist/esm/coupon/setting/config/settings.js +0 -11
  21. package/dist/esm/marquee/setting/Marquee.js +1 -3
  22. package/dist/esm/marquee/setting/configs/presets.js +10 -10
  23. package/dist/esm/marquee/setting/configs/settingsV2.js +42 -40
  24. package/dist/esm/marquee/setting/configs/uiV2.js +137 -34
  25. package/dist/esm/product/components/ProductVariants/components/variants/index.js +4 -1
  26. package/dist/esm/product/setting/product/configs/settings.js +1 -1
  27. package/dist/esm/product/setting/product-variant/configs/settings.js +9 -7
  28. package/dist/esm/product/setting/product-variant/configs/uiV2.js +0 -3
  29. package/dist/esm/sticky/components/Sticky.js +2 -4
  30. package/dist/esm/sticky/components/Sticky.liquid.js +1 -2
  31. package/dist/types/index.d.ts +1 -0
  32. package/package.json +2 -2
  33. package/dist/cjs/marquee/setting/configs/settings.js +0 -318
  34. package/dist/esm/marquee/setting/configs/settings.js +0 -316
@@ -6,7 +6,7 @@ const SettingUIV2 = [
6
6
  controls: [
7
7
  {
8
8
  label: {
9
- en: 'Items'
9
+ en: 'Order'
10
10
  },
11
11
  setting: {
12
12
  id: 'childItem'
@@ -16,7 +16,22 @@ const SettingUIV2 = [
16
16
  },
17
17
  {
18
18
  label: {
19
- en: 'Item'
19
+ en: 'Item spacing'
20
+ },
21
+ controls: [
22
+ {
23
+ label: {
24
+ en: 'Gap'
25
+ },
26
+ setting: {
27
+ id: 'itemSpacing'
28
+ }
29
+ }
30
+ ]
31
+ },
32
+ {
33
+ label: {
34
+ en: 'Item style'
20
35
  },
21
36
  controls: [
22
37
  {
@@ -25,8 +40,7 @@ const SettingUIV2 = [
25
40
  },
26
41
  label: {
27
42
  en: 'Max width'
28
- },
29
- layout: 'vertical'
43
+ }
30
44
  },
31
45
  {
32
46
  layout: 'vertical',
@@ -77,26 +91,11 @@ const SettingUIV2 = [
77
91
  ]
78
92
  }
79
93
  },
80
- {
81
- label: {
82
- en: 'Item spacing'
83
- },
84
- controls: [
85
- {
86
- label: {
87
- en: 'Gap'
88
- },
89
- setting: {
90
- id: 'itemSpacing'
91
- }
92
- }
93
- ]
94
- },
95
94
  {
96
95
  controls: [
97
96
  {
98
97
  label: {
99
- en: 'Icon separator'
98
+ en: 'Separator'
100
99
  },
101
100
  setting: {
102
101
  id: 'isShowIconSeparator'
@@ -112,7 +111,7 @@ const SettingUIV2 = [
112
111
  },
113
112
  conditionDisplay: 'isShowIconSeparator == true',
114
113
  label: {
115
- en: 'Choose'
114
+ en: 'Icon'
116
115
  }
117
116
  },
118
117
  {
@@ -135,6 +134,43 @@ const SettingUIV2 = [
135
134
  }
136
135
  ]
137
136
  },
137
+ {
138
+ label: {
139
+ en: 'Marquee effect'
140
+ },
141
+ controls: [
142
+ {
143
+ label: {
144
+ en: 'Direction'
145
+ },
146
+ setting: {
147
+ id: 'direction'
148
+ }
149
+ },
150
+ {
151
+ label: {
152
+ en: 'Stop on hover'
153
+ },
154
+ setting: {
155
+ id: 'stopOnHover'
156
+ }
157
+ },
158
+ {
159
+ label: {
160
+ en: 'Speed'
161
+ },
162
+ setting: {
163
+ id: 'speed'
164
+ }
165
+ },
166
+ {
167
+ setting: {
168
+ id: 'isPreview'
169
+ },
170
+ layout: 'vertical'
171
+ }
172
+ ]
173
+ },
138
174
  {
139
175
  label: {
140
176
  en: 'Size'
@@ -198,6 +234,32 @@ const SettingUIV2 = [
198
234
  }
199
235
  ]
200
236
  }
237
+ },
238
+ {
239
+ label: {
240
+ en: 'Padding'
241
+ },
242
+ controlConfig: {
243
+ id: 'padding',
244
+ type: 'padding-v2',
245
+ linkWithSetting: {
246
+ name: 'spacing-setting',
247
+ field: 'padding'
248
+ },
249
+ compoDefaultValue: {
250
+ desktop: {
251
+ default: {
252
+ padding: {
253
+ type: 'custom',
254
+ top: '16px',
255
+ bottom: '16px',
256
+ left: '0px',
257
+ right: '0px'
258
+ }
259
+ }
260
+ }
261
+ }
262
+ }
201
263
  }
202
264
  ]
203
265
  },
@@ -218,38 +280,79 @@ const SettingUIV2 = [
218
280
  },
219
281
  {
220
282
  label: {
221
- en: 'Interaction'
283
+ en: 'Shape'
222
284
  },
223
285
  controls: [
224
286
  {
225
287
  label: {
226
- en: 'Stop on hover'
288
+ en: 'Border'
227
289
  },
228
290
  setting: {
229
- id: 'stopOnHover'
291
+ id: 'border',
292
+ state: 'normal'
230
293
  }
231
294
  },
232
295
  {
233
296
  label: {
234
- en: 'Speed'
297
+ en: 'Corner'
235
298
  },
236
299
  setting: {
237
- id: 'speed'
300
+ id: 'rounded',
301
+ state: 'normal'
238
302
  }
239
303
  },
240
304
  {
241
305
  label: {
242
- en: 'Direction'
306
+ en: 'Shadow'
243
307
  },
244
308
  setting: {
245
- id: 'direction'
246
- }
247
- },
248
- {
249
- setting: {
250
- id: 'isPreview'
309
+ id: 'boxShadow',
310
+ state: 'normal'
251
311
  },
252
- layout: 'vertical'
312
+ options: {
313
+ updateFields: [
314
+ {
315
+ field: 'enable',
316
+ settingId: 'hasBoxShadow',
317
+ state: 'normal'
318
+ }
319
+ ]
320
+ },
321
+ controlChangeTrigger: {
322
+ settings: [
323
+ {
324
+ condition: `boxShadow.normal.enable === true`,
325
+ source: [
326
+ 'boxShadow',
327
+ 'hasBoxShadow'
328
+ ],
329
+ action: {
330
+ controlId: 'hasBoxShadow',
331
+ groupType: 'advanced',
332
+ controlType: 'advanced',
333
+ state: 'normal',
334
+ newValue: true
335
+ }
336
+ },
337
+ {
338
+ condition: `boxShadow.normal.enable === false`,
339
+ source: [
340
+ 'boxShadow',
341
+ 'hasBoxShadow'
342
+ ],
343
+ action: {
344
+ controlId: 'hasBoxShadow',
345
+ groupType: 'advanced',
346
+ controlType: 'advanced',
347
+ state: 'normal',
348
+ newValue: false
349
+ }
350
+ }
351
+ ],
352
+ options: {
353
+ noRecordHistory: true
354
+ }
355
+ }
253
356
  }
254
357
  ]
255
358
  },
@@ -71,7 +71,10 @@ const VariantItem = (props)=>{
71
71
  window.dispatchEvent(changeSelectedOptionEvent);
72
72
  }
73
73
  };
74
- const labelClass = createClass(getVariantItemLabelClass(props));
74
+ const labelClass = createClass(getVariantItemLabelClass({
75
+ ...props,
76
+ available
77
+ }));
75
78
  const tooltipClass = createClass(getTooltipClass());
76
79
  const tooltipSvgClass = createClass(getTooltipSvgClass());
77
80
  const variantOptionClass = createClass(getVariantOptionClass());
@@ -271,7 +271,7 @@ const ProductSettings = [
271
271
  max: 80,
272
272
  devices: {
273
273
  desktop: {
274
- default: '16px'
274
+ default: '32px'
275
275
  }
276
276
  }
277
277
  },
@@ -181,7 +181,7 @@ const ProductVariantSettings = [
181
181
  {
182
182
  id: 'layout',
183
183
  label: 'Layout',
184
- type: 'layout-segment',
184
+ type: 'option:illustration',
185
185
  iconViewBox: '0 0 66 45',
186
186
  enableItemBackground: true,
187
187
  devices: {
@@ -190,15 +190,17 @@ const ProductVariantSettings = [
190
190
  }
191
191
  },
192
192
  options: [
193
- {
194
- label: 'Horizontal',
195
- value: 'horizontal',
196
- type: 'arrange'
197
- },
198
193
  {
199
194
  label: 'Vertical',
200
195
  value: 'vertical',
201
- type: 'arrange'
196
+ type: 'arrange',
197
+ svgName: 'gp-arrange-vertical'
198
+ },
199
+ {
200
+ label: 'Horizontal',
201
+ value: 'horizontal',
202
+ type: 'arrange',
203
+ svgName: 'gp-arrange-horizontal'
202
204
  }
203
205
  ]
204
206
  },
@@ -84,9 +84,6 @@ const SettingUIV2 = [
84
84
  ]
85
85
  },
86
86
  {
87
- label: {
88
- en: 'Variant style'
89
- },
90
87
  conditionDisplay: "optionType === 'singleOption'",
91
88
  controls: [
92
89
  {
@@ -1,16 +1,15 @@
1
1
  'use client';
2
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
- import { useEditorMode, cls, getStyleBackgroundByDevice, isEmptyChildren } from '@gem-sdk/core';
3
+ import { cls, getStyleBackgroundByDevice, isEmptyChildren } from '@gem-sdk/core';
4
4
  import Head from 'next/head';
5
5
  import ChildrenDroppable from '../../grid/components/ChildrenDroppable.js';
6
6
  import 'react';
7
7
  import { ELEMENT_Z_INDEX } from '../../common/const.js';
8
8
  import useSticky from './hooks/useSticky.js';
9
9
  import { createStyle } from '@gem-sdk/system';
10
- import { getStylePadding, displayConditionStyle, filterStyles } from './common/styles.js';
10
+ import { getStylePadding, filterStyles } from './common/styles.js';
11
11
 
12
12
  const Sticky = ({ children, builderAttrs, setting, style, builderProps })=>{
13
- const mode = useEditorMode();
14
13
  const { background, preloadBgImage } = setting ?? {};
15
14
  const { w, positionStyle, displayStyle, getCSSAlign } = useSticky(setting);
16
15
  const computedContainerStyles = createStyle({
@@ -18,7 +17,6 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps })=>{
18
17
  ...w,
19
18
  ...displayStyle,
20
19
  ...getStylePadding(style),
21
- ...mode !== 'edit' && setting?.isScrollToTop ? displayConditionStyle(setting?.display, setting?.position) : {},
22
20
  ...positionStyle,
23
21
  ...getCSSAlign,
24
22
  zIndex: ELEMENT_Z_INDEX.STICKY
@@ -15,8 +15,7 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
15
15
  const createDataState = createStateOrContext({
16
16
  uid: builderProps?.uid,
17
17
  setting: {
18
- display,
19
- isScrollToTop
18
+ display
20
19
  },
21
20
  advanced: {
22
21
  d: advancedDisplay
@@ -765,6 +765,7 @@ type BreadcrumbProps = BaseProps<{
765
765
  background?: ObjectDevices$1<Background>;
766
766
  spacing?: ObjectDevices$1<string>;
767
767
  color?: ColorValueType$1;
768
+ globalSize?: ObjectDevices$1<SizeSettingGlobal>;
768
769
  }> & BasePropsWrap<{
769
770
  iconSvg?: string;
770
771
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.458",
3
+ "version": "2.0.0-dev.461",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -23,7 +23,7 @@
23
23
  "update-img-src-3rd": "node ./scripts/update-img-src-3rd.js"
24
24
  },
25
25
  "devDependencies": {
26
- "@gem-sdk/core": "2.0.0-dev.455",
26
+ "@gem-sdk/core": "2.0.0-dev.460",
27
27
  "@gem-sdk/styles": "2.0.0-dev.381",
28
28
  "@gem-sdk/system": "2.0.0-dev.451",
29
29
  "@types/react-transition-group": "^4.4.5"
@@ -1,318 +0,0 @@
1
- 'use strict';
2
-
3
- var childTemplate = require('./childTemplate.js');
4
-
5
- const MarqueeSettings = [
6
- {
7
- id: 'setting',
8
- controls: [
9
- {
10
- id: 'activeItem',
11
- type: 'input',
12
- default: '0'
13
- },
14
- {
15
- id: 'hoverItem',
16
- type: 'input',
17
- default: '0'
18
- },
19
- {
20
- id: 'childItem',
21
- label: 'Item management',
22
- type: 'child-item',
23
- childTemplate: childTemplate.ChildTemplate,
24
- default: [
25
- 'Item 1',
26
- 'Item 2',
27
- 'Item 3',
28
- 'Item 4'
29
- ]
30
- },
31
- {
32
- id: 'isShowIconSeparator',
33
- label: 'isShowIconSeparator',
34
- type: 'toggle',
35
- default: false
36
- },
37
- {
38
- id: 'iconSeparatorSvg',
39
- label: 'iconSeparatorSvg',
40
- type: 'icon',
41
- default: `<svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor">
42
- <path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M232,128A104,104,0,1,1,128,24,104.13,104.13,0,0,1,232,128Z"></path></svg>`
43
- },
44
- {
45
- id: 'stopOnHover',
46
- label: 'stopOnHover',
47
- type: 'toggle',
48
- default: false
49
- },
50
- {
51
- id: 'speed',
52
- label: 'speed',
53
- type: 'input:slider',
54
- hideInput: true,
55
- useOnlyUnitInit: true,
56
- hideUnit: true,
57
- min: 0,
58
- max: 4,
59
- step: 0.1,
60
- default: 1
61
- },
62
- {
63
- id: 'direction',
64
- label: 'direction',
65
- type: 'option:value',
66
- options: [
67
- {
68
- label: 'Left',
69
- value: 'left',
70
- type: 'direction',
71
- tooltip: 'Left'
72
- },
73
- {
74
- label: 'Right',
75
- value: 'right',
76
- type: 'direction',
77
- tooltip: 'Right'
78
- }
79
- ],
80
- default: 'left'
81
- },
82
- {
83
- id: 'isPreview',
84
- type: 'play-pause',
85
- hideLabel: true,
86
- default: false
87
- },
88
- {
89
- id: 'hasItemShadow',
90
- label: 'hasItemShadow',
91
- type: 'toggle',
92
- default: false
93
- },
94
- {
95
- id: 'itemWidthType',
96
- type: 'select',
97
- label: 'Aspect Ratio',
98
- isFullWidth: true,
99
- options: [
100
- {
101
- label: 'Fit to content',
102
- value: 'FIT_CONTENT',
103
- note: 'Match the width of the element inside'
104
- },
105
- {
106
- label: 'Based on the item count',
107
- value: 'BASE_ON_NUMBER_OF_ITEMS',
108
- note: 'Max item width is screen width divided by the number of items'
109
- },
110
- {
111
- label: 'Custom',
112
- value: 'CUSTOM',
113
- note: 'Set the max width as you want'
114
- }
115
- ],
116
- devices: {
117
- desktop: {
118
- default: 'BASE_ON_NUMBER_OF_ITEMS'
119
- },
120
- tablet: {
121
- default: 'BASE_ON_NUMBER_OF_ITEMS'
122
- },
123
- mobile: {
124
- default: 'CUSTOM'
125
- }
126
- }
127
- }
128
- ]
129
- },
130
- {
131
- id: 'style',
132
- controls: [
133
- {
134
- id: 'iconSeparatorSize',
135
- label: 'iconSeparatorSize',
136
- type: 'input:stepper',
137
- devices: {
138
- desktop: {
139
- default: 24
140
- },
141
- tablet: {
142
- default: 24
143
- },
144
- mobile: {
145
- default: 24
146
- }
147
- }
148
- },
149
- {
150
- id: 'iconSeparatorColor',
151
- label: 'iconSeparatorColor',
152
- type: 'color-picker-v2',
153
- default: '#0C0C0C'
154
- },
155
- {
156
- id: 'itemSpacing',
157
- label: 'Spacing',
158
- type: 'input:unit',
159
- units: [
160
- 'px'
161
- ],
162
- placeholder: 'Auto',
163
- min: 0,
164
- devices: {
165
- desktop: {
166
- default: '48px'
167
- }
168
- }
169
- },
170
- {
171
- id: 'itemMaxWidth',
172
- label: 'itemMaxWidth',
173
- type: 'input:unit',
174
- units: [
175
- 'px'
176
- ],
177
- placeholder: 'Auto',
178
- min: 40,
179
- devices: {
180
- desktop: {
181
- default: '300px'
182
- },
183
- tablet: {
184
- default: '300px'
185
- },
186
- mobile: {
187
- default: '150px'
188
- }
189
- }
190
- },
191
- {
192
- id: 'sizeSetting',
193
- type: 'size-setting',
194
- label: '',
195
- devices: {
196
- desktop: {
197
- default: {
198
- shapeLinked: false,
199
- width: '100%',
200
- height: 'auto'
201
- }
202
- }
203
- },
204
- settingConfig: {
205
- width: {
206
- name: 'Width'
207
- },
208
- height: {
209
- displayOptions: [
210
- 'auto',
211
- 'small',
212
- 'medium',
213
- 'large'
214
- ],
215
- name: 'Height',
216
- sizeConfig: {
217
- small: '32px',
218
- medium: '64px',
219
- large: '96px'
220
- }
221
- }
222
- },
223
- hiddenSettings: [
224
- 'padding',
225
- 'gap',
226
- 'shape'
227
- ]
228
- },
229
- {
230
- id: 'itemBorderStyle',
231
- type: 'border',
232
- label: 'Border',
233
- default: {
234
- borderType: 'none',
235
- border: 'none',
236
- borderWidth: '1px',
237
- width: '1px 1px 1px 1px',
238
- isCustom: false,
239
- color: '#000000'
240
- }
241
- },
242
- {
243
- id: 'itemCorner',
244
- type: 'radius-preset',
245
- label: 'Border Radius',
246
- default: {
247
- radiusType: 'none'
248
- }
249
- },
250
- {
251
- id: 'itemBackgroundColor',
252
- type: 'color-picker-v2',
253
- devices: {
254
- desktop: {
255
- default: 'transparent'
256
- }
257
- }
258
- },
259
- {
260
- id: 'backgroundColor',
261
- type: 'color-picker-v2',
262
- devices: {
263
- desktop: {
264
- default: 'transparent'
265
- }
266
- }
267
- },
268
- {
269
- id: 'align',
270
- label: 'Alignment',
271
- type: 'option:value',
272
- options: [
273
- {
274
- label: 'Left',
275
- value: 'left',
276
- type: 'align',
277
- tooltip: 'Align left',
278
- iconName: 'gp-align-left'
279
- },
280
- {
281
- label: 'Center',
282
- value: 'center',
283
- type: 'align',
284
- tooltip: 'Align center',
285
- iconName: 'gp-align-center'
286
- },
287
- {
288
- label: 'Right',
289
- value: 'right',
290
- type: 'align',
291
- tooltip: 'Align right',
292
- iconName: 'gp-align-right'
293
- }
294
- ],
295
- devices: {
296
- desktop: {
297
- default: 'center'
298
- }
299
- }
300
- },
301
- {
302
- id: 'itemShadow',
303
- type: 'shadow-v2',
304
- label: 'Button Shadow',
305
- default: {
306
- type: 'none',
307
- distance: '4px',
308
- blur: '12px',
309
- spread: '0px',
310
- color: '#121212',
311
- angle: 90
312
- }
313
- }
314
- ]
315
- }
316
- ];
317
-
318
- exports.MarqueeSettings = MarqueeSettings;