@gem-sdk/components 2.0.0-dev.389 → 2.0.0-dev.391

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.
@@ -39,14 +39,14 @@ const getData = (props)=>{
39
39
  };
40
40
  const stateData = system.createStateOrContext({
41
41
  id: uniqueComponentId,
42
- setting,
43
- styles,
44
42
  moveToIdx,
45
- isHiddenArrowWhenDisabled
43
+ isHiddenArrowWhenDisabled,
44
+ setting,
45
+ styles
46
46
  });
47
47
  return {
48
48
  loopConfig: getLoopSetting(),
49
- stateData: core.dataStringify(stateData).replaceAll("'", '''),
49
+ stateData: JSON.stringify(stateData).replaceAll("'", '''),
50
50
  uniqueComponentId,
51
51
  arrowShowConfig: getArrowType(),
52
52
  sliderSelector
@@ -28,24 +28,17 @@ const ProductListGridLayout = (props)=>{
28
28
  </gp-same-height-v2>
29
29
  `;
30
30
  };
31
- return core.template /* liquid */ `
32
- <div
33
- ${productListAttr}
34
- style="${gridLayoutStyle}"
35
- class="${gridLayoutClass}"
36
- >
31
+ const renderProductList = ()=>{
32
+ return core.template /* liquid */ `
37
33
  {%- assign count = 0 -%}
38
34
  {%- for product in products limit: limit -%}
39
35
  {%- if product.id != empty -%}
40
36
  {%- assign count = count | plus: 1 -%}
41
37
  {%- assign variant = product.selected_or_first_available_variant -%}
42
38
  {%- assign product_form_id = 'product-form-' | append: "${builderProps?.uid}" | append: product.id -%}
43
- ${core.RenderIf(setting?.sameHeight, renderSameHeightGrid(`${ProductListItem_liquid.default({
44
- ...props
45
- })}`))}
46
- ${core.RenderIf(!setting?.sameHeight, core.template /* liquid */ `${ProductListItem_liquid.default({
47
- ...props
48
- })}`)}
39
+ ${ProductListItem_liquid.default({
40
+ ...props
41
+ })}
49
42
  {%- endif -%}
50
43
  {% endfor %}
51
44
  {%- if count == 0 and ${productListId?.length} == 0 -%}
@@ -55,6 +48,16 @@ const ProductListGridLayout = (props)=>{
55
48
  <div>${helpers.getStaticLocale('ProductList', 'no_products_found')}</div>
56
49
  {%- endif -%}
57
50
  {%- endif -%}
51
+ `;
52
+ };
53
+ return core.template /* liquid */ `
54
+ <div
55
+ ${productListAttr}
56
+ style="${gridLayoutStyle}"
57
+ class="${gridLayoutClass}"
58
+ >
59
+ ${core.RenderIf(setting?.sameHeight, renderSameHeightGrid(`${renderProductList()}`))}
60
+ ${core.RenderIf(!setting?.sameHeight, core.template /* liquid */ `${renderProductList()}`)}
58
61
  </div>
59
62
  `;
60
63
  };
@@ -256,7 +256,7 @@ const ProductSettings = [
256
256
  'px'
257
257
  ],
258
258
  min: 0,
259
- max: 200,
259
+ max: 80,
260
260
  devices: {
261
261
  desktop: {
262
262
  default: '32px'
@@ -270,7 +270,7 @@ const ProductSettings = [
270
270
  'px'
271
271
  ],
272
272
  min: 0,
273
- max: 200,
273
+ max: 80,
274
274
  devices: {
275
275
  desktop: {
276
276
  default: '16px'
@@ -299,23 +299,12 @@ const ProductSettings = [
299
299
  type: 'background-media',
300
300
  ignoreReRender: true,
301
301
  showVideo: false,
302
+ hideImage: true,
302
303
  devices: {
303
304
  desktop: {
304
305
  default: {
305
306
  type: 'color',
306
- color: 'transparent',
307
- image: {
308
- src: '',
309
- width: 0,
310
- height: 0
311
- },
312
- size: 'cover',
313
- position: {
314
- x: 50,
315
- y: 50
316
- },
317
- repeat: 'no-repeat',
318
- attachment: 'scroll'
307
+ color: 'transparent'
319
308
  }
320
309
  }
321
310
  },
@@ -323,24 +312,7 @@ const ProductSettings = [
323
312
  desktop: {
324
313
  default: {
325
314
  type: 'color',
326
- color: '#DDDDDD',
327
- image: {
328
- src: 'https://ucarecdn.com/5e27d43d-eb1e-4e71-b7e1-4158f3071bb6/-/format/auto/',
329
- width: 1200,
330
- height: 480
331
- },
332
- size: 'cover',
333
- position: {
334
- x: 50,
335
- y: 50
336
- },
337
- repeat: 'no-repeat',
338
- attachment: 'scroll',
339
- preload: false,
340
- video: 'https://youtu.be/KOxfzBp72uk',
341
- videoHtml5: 'https://media.w3.org/2010/05/sintel/trailer.mp4',
342
- videoType: 'youtube',
343
- loop: true
315
+ color: '#DDDDDD'
344
316
  }
345
317
  }
346
318
  }
@@ -160,6 +160,50 @@ const SettingUIV2 = [
160
160
  setting: {
161
161
  id: 'boxShadow',
162
162
  state: 'normal'
163
+ },
164
+ options: {
165
+ updateFields: [
166
+ {
167
+ field: 'enable',
168
+ settingId: 'advanced.hasBoxShadow',
169
+ state: 'normal'
170
+ }
171
+ ]
172
+ },
173
+ controlChangeTrigger: {
174
+ settings: [
175
+ {
176
+ condition: `boxShadow.normal.enable === true`,
177
+ source: [
178
+ 'boxShadow',
179
+ 'hasBoxShadow'
180
+ ],
181
+ action: {
182
+ controlId: 'hasBoxShadow',
183
+ groupType: 'advanced',
184
+ controlType: 'advanced',
185
+ state: 'normal',
186
+ newValue: true
187
+ }
188
+ },
189
+ {
190
+ condition: `boxShadow.normal.enable === false`,
191
+ source: [
192
+ 'boxShadow',
193
+ 'hasBoxShadow'
194
+ ],
195
+ action: {
196
+ controlId: 'hasBoxShadow',
197
+ groupType: 'advanced',
198
+ controlType: 'advanced',
199
+ state: 'normal',
200
+ newValue: false
201
+ }
202
+ }
203
+ ],
204
+ options: {
205
+ noRecordHistory: true
206
+ }
163
207
  }
164
208
  }
165
209
  ]
@@ -21,12 +21,11 @@ const ProductListSettingsV2 = [
21
21
  },
22
22
  {
23
23
  id: 'slidesToShow',
24
- type: 'range',
24
+ type: 'input:slider',
25
25
  min: 1,
26
26
  max: 6,
27
+ isNumber: true,
27
28
  label: 'Products per rows ',
28
- hideUnit: true,
29
- useOnlyUnitInit: true,
30
29
  devices: {
31
30
  desktop: {
32
31
  default: 4
@@ -41,14 +40,12 @@ const ProductListSettingsV2 = [
41
40
  },
42
41
  {
43
42
  id: 'numberOfProducts',
44
- type: 'range',
43
+ type: 'input:slider',
45
44
  min: 1,
46
45
  max: 50,
47
46
  label: 'Number of products',
47
+ isNumber: true,
48
48
  default: 4,
49
- hide: true,
50
- hideUnit: true,
51
- useOnlyUnitInit: true,
52
49
  ignoreMax: true
53
50
  },
54
51
  {
@@ -114,7 +114,8 @@ const SettingUIV2 = [
114
114
  id: 'arrow'
115
115
  },
116
116
  options: {
117
- labelVariant: 'primary'
117
+ labelVariant: 'primary',
118
+ toggleStyle: 'switch'
118
119
  }
119
120
  },
120
121
  {
@@ -128,7 +129,9 @@ const SettingUIV2 = [
128
129
  },
129
130
  {
130
131
  conditionDisplay: 'arrow === true',
131
- layout: 'vertical',
132
+ label: {
133
+ en: 'Icon'
134
+ },
132
135
  setting: {
133
136
  id: 'arrowCustom'
134
137
  }
@@ -9,8 +9,8 @@ var Tabs$1 = require('./setting/Tabs.js');
9
9
  var TabItem$1 = require('./setting/TabItem.js');
10
10
 
11
11
  const tabSetting = {
12
- TabsSetting: Tabs$1.default,
13
- TabItemSetting: TabItem$1.default
12
+ Tabs: Tabs$1.default,
13
+ TabItem: TabItem$1.default
14
14
  };
15
15
 
16
16
  exports.tabSetting = tabSetting;
@@ -1,4 +1,4 @@
1
- import { dataStringify, getResponsiveValueByScreen } from '@gem-sdk/core';
1
+ import { getResponsiveValueByScreen } from '@gem-sdk/core';
2
2
  import { createStateOrContext } from '@gem-sdk/system';
3
3
 
4
4
  const getData = (props)=>{
@@ -37,14 +37,14 @@ const getData = (props)=>{
37
37
  };
38
38
  const stateData = createStateOrContext({
39
39
  id: uniqueComponentId,
40
- setting,
41
- styles,
42
40
  moveToIdx,
43
- isHiddenArrowWhenDisabled
41
+ isHiddenArrowWhenDisabled,
42
+ setting,
43
+ styles
44
44
  });
45
45
  return {
46
46
  loopConfig: getLoopSetting(),
47
- stateData: dataStringify(stateData).replaceAll("'", '&#039;'),
47
+ stateData: JSON.stringify(stateData).replaceAll("'", '&#039;'),
48
48
  uniqueComponentId,
49
49
  arrowShowConfig: getArrowType(),
50
50
  sliderSelector
@@ -24,24 +24,17 @@ const ProductListGridLayout = (props)=>{
24
24
  </gp-same-height-v2>
25
25
  `;
26
26
  };
27
- return template /* liquid */ `
28
- <div
29
- ${productListAttr}
30
- style="${gridLayoutStyle}"
31
- class="${gridLayoutClass}"
32
- >
27
+ const renderProductList = ()=>{
28
+ return template /* liquid */ `
33
29
  {%- assign count = 0 -%}
34
30
  {%- for product in products limit: limit -%}
35
31
  {%- if product.id != empty -%}
36
32
  {%- assign count = count | plus: 1 -%}
37
33
  {%- assign variant = product.selected_or_first_available_variant -%}
38
34
  {%- assign product_form_id = 'product-form-' | append: "${builderProps?.uid}" | append: product.id -%}
39
- ${RenderIf(setting?.sameHeight, renderSameHeightGrid(`${ProductListItem({
40
- ...props
41
- })}`))}
42
- ${RenderIf(!setting?.sameHeight, template /* liquid */ `${ProductListItem({
43
- ...props
44
- })}`)}
35
+ ${ProductListItem({
36
+ ...props
37
+ })}
45
38
  {%- endif -%}
46
39
  {% endfor %}
47
40
  {%- if count == 0 and ${productListId?.length} == 0 -%}
@@ -51,6 +44,16 @@ const ProductListGridLayout = (props)=>{
51
44
  <div>${getStaticLocale('ProductList', 'no_products_found')}</div>
52
45
  {%- endif -%}
53
46
  {%- endif -%}
47
+ `;
48
+ };
49
+ return template /* liquid */ `
50
+ <div
51
+ ${productListAttr}
52
+ style="${gridLayoutStyle}"
53
+ class="${gridLayoutClass}"
54
+ >
55
+ ${RenderIf(setting?.sameHeight, renderSameHeightGrid(`${renderProductList()}`))}
56
+ ${RenderIf(!setting?.sameHeight, template /* liquid */ `${renderProductList()}`)}
54
57
  </div>
55
58
  `;
56
59
  };
@@ -254,7 +254,7 @@ const ProductSettings = [
254
254
  'px'
255
255
  ],
256
256
  min: 0,
257
- max: 200,
257
+ max: 80,
258
258
  devices: {
259
259
  desktop: {
260
260
  default: '32px'
@@ -268,7 +268,7 @@ const ProductSettings = [
268
268
  'px'
269
269
  ],
270
270
  min: 0,
271
- max: 200,
271
+ max: 80,
272
272
  devices: {
273
273
  desktop: {
274
274
  default: '16px'
@@ -297,23 +297,12 @@ const ProductSettings = [
297
297
  type: 'background-media',
298
298
  ignoreReRender: true,
299
299
  showVideo: false,
300
+ hideImage: true,
300
301
  devices: {
301
302
  desktop: {
302
303
  default: {
303
304
  type: 'color',
304
- color: 'transparent',
305
- image: {
306
- src: '',
307
- width: 0,
308
- height: 0
309
- },
310
- size: 'cover',
311
- position: {
312
- x: 50,
313
- y: 50
314
- },
315
- repeat: 'no-repeat',
316
- attachment: 'scroll'
305
+ color: 'transparent'
317
306
  }
318
307
  }
319
308
  },
@@ -321,24 +310,7 @@ const ProductSettings = [
321
310
  desktop: {
322
311
  default: {
323
312
  type: 'color',
324
- color: '#DDDDDD',
325
- image: {
326
- src: 'https://ucarecdn.com/5e27d43d-eb1e-4e71-b7e1-4158f3071bb6/-/format/auto/',
327
- width: 1200,
328
- height: 480
329
- },
330
- size: 'cover',
331
- position: {
332
- x: 50,
333
- y: 50
334
- },
335
- repeat: 'no-repeat',
336
- attachment: 'scroll',
337
- preload: false,
338
- video: 'https://youtu.be/KOxfzBp72uk',
339
- videoHtml5: 'https://media.w3.org/2010/05/sintel/trailer.mp4',
340
- videoType: 'youtube',
341
- loop: true
313
+ color: '#DDDDDD'
342
314
  }
343
315
  }
344
316
  }
@@ -158,6 +158,50 @@ const SettingUIV2 = [
158
158
  setting: {
159
159
  id: 'boxShadow',
160
160
  state: 'normal'
161
+ },
162
+ options: {
163
+ updateFields: [
164
+ {
165
+ field: 'enable',
166
+ settingId: 'advanced.hasBoxShadow',
167
+ state: 'normal'
168
+ }
169
+ ]
170
+ },
171
+ controlChangeTrigger: {
172
+ settings: [
173
+ {
174
+ condition: `boxShadow.normal.enable === true`,
175
+ source: [
176
+ 'boxShadow',
177
+ 'hasBoxShadow'
178
+ ],
179
+ action: {
180
+ controlId: 'hasBoxShadow',
181
+ groupType: 'advanced',
182
+ controlType: 'advanced',
183
+ state: 'normal',
184
+ newValue: true
185
+ }
186
+ },
187
+ {
188
+ condition: `boxShadow.normal.enable === false`,
189
+ source: [
190
+ 'boxShadow',
191
+ 'hasBoxShadow'
192
+ ],
193
+ action: {
194
+ controlId: 'hasBoxShadow',
195
+ groupType: 'advanced',
196
+ controlType: 'advanced',
197
+ state: 'normal',
198
+ newValue: false
199
+ }
200
+ }
201
+ ],
202
+ options: {
203
+ noRecordHistory: true
204
+ }
161
205
  }
162
206
  }
163
207
  ]
@@ -19,12 +19,11 @@ const ProductListSettingsV2 = [
19
19
  },
20
20
  {
21
21
  id: 'slidesToShow',
22
- type: 'range',
22
+ type: 'input:slider',
23
23
  min: 1,
24
24
  max: 6,
25
+ isNumber: true,
25
26
  label: 'Products per rows ',
26
- hideUnit: true,
27
- useOnlyUnitInit: true,
28
27
  devices: {
29
28
  desktop: {
30
29
  default: 4
@@ -39,14 +38,12 @@ const ProductListSettingsV2 = [
39
38
  },
40
39
  {
41
40
  id: 'numberOfProducts',
42
- type: 'range',
41
+ type: 'input:slider',
43
42
  min: 1,
44
43
  max: 50,
45
44
  label: 'Number of products',
45
+ isNumber: true,
46
46
  default: 4,
47
- hide: true,
48
- hideUnit: true,
49
- useOnlyUnitInit: true,
50
47
  ignoreMax: true
51
48
  },
52
49
  {
@@ -112,7 +112,8 @@ const SettingUIV2 = [
112
112
  id: 'arrow'
113
113
  },
114
114
  options: {
115
- labelVariant: 'primary'
115
+ labelVariant: 'primary',
116
+ toggleStyle: 'switch'
116
117
  }
117
118
  },
118
119
  {
@@ -126,7 +127,9 @@ const SettingUIV2 = [
126
127
  },
127
128
  {
128
129
  conditionDisplay: 'arrow === true',
129
- layout: 'vertical',
130
+ label: {
131
+ en: 'Icon'
132
+ },
130
133
  setting: {
131
134
  id: 'arrowCustom'
132
135
  }
@@ -7,8 +7,8 @@ import config from './setting/Tabs.js';
7
7
  import config$1 from './setting/TabItem.js';
8
8
 
9
9
  const tabSetting = {
10
- TabsSetting: config,
11
- TabItemSetting: config$1
10
+ Tabs: config,
11
+ TabItem: config$1
12
12
  };
13
13
 
14
14
  export { tabSetting };
@@ -4155,8 +4155,8 @@ declare const Tabs$1: (props: TabsProps) => React.JSX.Element;
4155
4155
  declare const TabItem$1: React.FC<TabItemProps>;
4156
4156
 
4157
4157
  declare const tabSetting: {
4158
- TabsSetting: _gem_sdk_core.ComponentSetting<TabsProps>;
4159
- TabItemSetting: _gem_sdk_core.ComponentSetting<TabItemProps>;
4158
+ Tabs: _gem_sdk_core.ComponentSetting<TabsProps>;
4159
+ TabItem: _gem_sdk_core.ComponentSetting<TabItemProps>;
4160
4160
  };
4161
4161
 
4162
4162
  type MixedProps = BaseProps<{
@@ -7625,8 +7625,8 @@ declare const _default: {
7625
7625
  Video: _gem_sdk_core.ComponentSetting<VideoProps>;
7626
7626
  Textarea: _gem_sdk_core.ComponentSetting<TextareaProps>;
7627
7627
  Text: _gem_sdk_core.ComponentSetting<TextProps>;
7628
- TabsSetting: _gem_sdk_core.ComponentSetting<TabsProps>;
7629
- TabItemSetting: _gem_sdk_core.ComponentSetting<TabItemProps>;
7628
+ Tabs: _gem_sdk_core.ComponentSetting<TabsProps>;
7629
+ TabItem: _gem_sdk_core.ComponentSetting<TabItemProps>;
7630
7630
  Select: _gem_sdk_core.ComponentSetting<SelectProps>;
7631
7631
  Radio: _gem_sdk_core.ComponentSetting<RadioProps>;
7632
7632
  Product: _gem_sdk_core.ComponentSetting<ProductProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.389",
3
+ "version": "2.0.0-dev.391",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -22,7 +22,7 @@
22
22
  "relationship": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/get-control-relationship.js && node ./scripts/get-element-relationship.js"
23
23
  },
24
24
  "devDependencies": {
25
- "@gem-sdk/core": "2.0.0-dev.388",
25
+ "@gem-sdk/core": "2.0.0-dev.391",
26
26
  "@gem-sdk/styles": "2.0.0-dev.381",
27
27
  "@gem-sdk/system": "2.0.0-dev.371",
28
28
  "@types/react-transition-group": "^4.4.5"