@gem-sdk/components 2.0.0-dev.479 → 2.0.0-dev.481

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.
@@ -465,7 +465,7 @@ const ArticleReadMoreSettings = [
465
465
  ],
466
466
  devices: {
467
467
  desktop: {
468
- default: 'center'
468
+ default: 'left'
469
469
  }
470
470
  }
471
471
  },
@@ -141,6 +141,12 @@ const SettingsV2 = [
141
141
  label: 'Preload',
142
142
  default: false
143
143
  },
144
+ {
145
+ id: 'enableLink',
146
+ label: '',
147
+ type: 'toggle',
148
+ default: true
149
+ },
144
150
  {
145
151
  id: 'link',
146
152
  type: 'pick-link',
@@ -330,11 +330,21 @@ const SettingUIV2 = [
330
330
  ]
331
331
  },
332
332
  {
333
- label: {
334
- en: 'Link'
335
- },
336
333
  controls: [
337
334
  {
335
+ label: {
336
+ en: 'Link'
337
+ },
338
+ setting: {
339
+ id: 'enableLink'
340
+ },
341
+ options: {
342
+ labelVariant: 'primary',
343
+ toggleStyle: 'switch'
344
+ }
345
+ },
346
+ {
347
+ conditionDisplay: 'enableLink == true',
338
348
  setting: {
339
349
  id: 'link'
340
350
  },
@@ -19,7 +19,7 @@ const CountdownSettings = [
19
19
  id: 'behaviour',
20
20
  label: 'Type',
21
21
  type: 'select',
22
- default: 'standard',
22
+ default: 'evergreen',
23
23
  options: [
24
24
  {
25
25
  label: 'To specific date',
@@ -380,6 +380,18 @@ const CountdownSettings = [
380
380
  {
381
381
  id: 'style',
382
382
  controls: [
383
+ {
384
+ id: 'enableLabelTextStyle',
385
+ label: '',
386
+ type: 'toggle',
387
+ default: true
388
+ },
389
+ {
390
+ id: 'enableNumberTextStyle',
391
+ label: '',
392
+ type: 'toggle',
393
+ default: true
394
+ },
383
395
  {
384
396
  id: 'textNumberGroup',
385
397
  label: 'Text Number',
@@ -472,6 +484,36 @@ const CountdownSettings = [
472
484
  }
473
485
  }
474
486
  },
487
+ {
488
+ id: 'padding',
489
+ type: 'padding-v2',
490
+ devices: {
491
+ desktop: {
492
+ default: {
493
+ padding: {
494
+ type: 'custom',
495
+ top: '12px',
496
+ left: '24px',
497
+ bottom: '12px',
498
+ right: '24px'
499
+ }
500
+ }
501
+ }
502
+ },
503
+ compoDefaultValue: {
504
+ desktop: {
505
+ default: {
506
+ padding: {
507
+ type: 'custom',
508
+ top: '12px',
509
+ left: '24px',
510
+ bottom: '12px',
511
+ right: '24px'
512
+ }
513
+ }
514
+ }
515
+ }
516
+ },
475
517
  {
476
518
  id: 'itemSettingGroup',
477
519
  type: 'group',
@@ -486,7 +528,9 @@ const CountdownSettings = [
486
528
  {
487
529
  id: 'verticalGap',
488
530
  label: 'Vertical Gap',
489
- type: 'input:unit',
531
+ type: 'input:slider',
532
+ min: 0,
533
+ max: 120,
490
534
  units: [
491
535
  'px'
492
536
  ],
@@ -496,17 +540,18 @@ const CountdownSettings = [
496
540
  {
497
541
  id: 'horizontalGap',
498
542
  label: 'Horizontal Gap',
499
- type: 'input:unit',
543
+ type: 'input:slider',
544
+ min: 0,
545
+ max: 120,
500
546
  units: [
501
547
  'px'
502
548
  ],
503
- default: '8px',
504
- placeholder: 'Auto'
549
+ default: '8px'
505
550
  },
506
551
  {
507
552
  id: 'itemPadding',
508
553
  label: 'Padding',
509
- type: 'size',
554
+ type: 'padding-v2',
510
555
  default: {
511
556
  type: 'medium'
512
557
  },
@@ -1,6 +1,62 @@
1
1
  'use strict';
2
2
 
3
3
  const SettingUIV2 = [
4
+ {
5
+ label: {
6
+ en: 'Countdown time'
7
+ },
8
+ controls: [
9
+ {
10
+ label: {
11
+ en: 'Run type'
12
+ },
13
+ setting: {
14
+ id: 'behaviour'
15
+ }
16
+ },
17
+ {
18
+ conditionDisplay: 'behaviour === "standard"',
19
+ label: {
20
+ en: 'Date'
21
+ },
22
+ setting: {
23
+ id: 'dateStandard'
24
+ }
25
+ },
26
+ {
27
+ conditionDisplay: 'behaviour === "standard"',
28
+ label: {
29
+ en: 'Time zone'
30
+ },
31
+ setting: {
32
+ id: 'timeZone'
33
+ }
34
+ },
35
+ {
36
+ conditionDisplay: 'behaviour === "daily"',
37
+ setting: {
38
+ id: 'timerDaily'
39
+ },
40
+ layout: 'vertical'
41
+ },
42
+ {
43
+ conditionDisplay: 'behaviour === "evergreen"',
44
+ setting: {
45
+ id: 'timerEverygreen'
46
+ },
47
+ layout: 'vertical'
48
+ },
49
+ {
50
+ conditionDisplay: 'behaviour === "evergreen"',
51
+ label: {
52
+ en: 'Loop (refresh after finish)'
53
+ },
54
+ setting: {
55
+ id: 'loopAfterFinish'
56
+ }
57
+ }
58
+ ]
59
+ },
4
60
  {
5
61
  label: {
6
62
  en: 'Item management'
@@ -9,7 +65,7 @@ const SettingUIV2 = [
9
65
  {
10
66
  type: 'combo',
11
67
  label: {
12
- en: 'Item'
68
+ en: 'Items'
13
69
  },
14
70
  fixedValue: 'Edit...',
15
71
  iconName: 'polaris-list-bulleted',
@@ -109,184 +165,162 @@ const SettingUIV2 = [
109
165
  },
110
166
  {
111
167
  label: {
112
- en: 'Configuration'
168
+ en: 'Hover effect'
113
169
  },
114
170
  controls: [
115
171
  {
116
172
  label: {
117
- en: 'Type'
173
+ en: 'Border'
118
174
  },
119
175
  setting: {
120
- id: 'behaviour'
176
+ id: 'borderState',
177
+ state: 'hover'
121
178
  }
122
179
  },
123
180
  {
124
- conditionDisplay: 'behaviour === "standard"',
125
181
  label: {
126
- en: 'Date'
182
+ en: 'Corner'
127
183
  },
128
184
  setting: {
129
- id: 'dateStandard'
185
+ id: 'roundedState',
186
+ state: 'hover'
130
187
  }
131
- },
188
+ }
189
+ ]
190
+ },
191
+ {
192
+ label: {
193
+ en: 'Item style'
194
+ },
195
+ controls: [
132
196
  {
133
- conditionDisplay: 'behaviour === "standard"',
134
197
  label: {
135
- en: 'Time zone'
198
+ en: 'Item gap'
136
199
  },
137
200
  setting: {
138
- id: 'timeZone'
201
+ id: 'horizontalGap'
139
202
  }
140
203
  },
141
204
  {
142
- conditionDisplay: 'behaviour === "daily"',
143
- setting: {
144
- id: 'timerDaily'
205
+ label: {
206
+ en: 'Padding'
145
207
  },
146
- layout: 'vertical'
208
+ setting: {
209
+ id: 'itemPadding'
210
+ }
147
211
  },
148
212
  {
149
- conditionDisplay: 'behaviour === "evergreen"',
150
- setting: {
151
- id: 'timerEverygreen'
213
+ label: {
214
+ en: 'Background'
152
215
  },
153
- layout: 'vertical'
216
+ setting: {
217
+ id: 'backgroundItemColor'
218
+ }
154
219
  },
155
220
  {
156
- conditionDisplay: 'behaviour === "evergreen"',
157
221
  label: {
158
- en: 'Loop (refresh after finish)'
222
+ en: 'Border'
159
223
  },
160
224
  setting: {
161
- id: 'loopAfterFinish'
225
+ id: 'borderState',
226
+ state: 'normal'
162
227
  }
163
- }
164
- ]
165
- },
166
- {
167
- label: {
168
- en: 'Items gap'
169
- },
170
- controls: [
228
+ },
171
229
  {
172
230
  label: {
173
- en: 'Gap'
231
+ en: 'Corner'
174
232
  },
175
233
  setting: {
176
- id: 'horizontalGap'
234
+ id: 'roundedState',
235
+ state: 'normal'
177
236
  }
178
237
  }
179
238
  ]
180
239
  },
181
240
  {
182
- label: {
183
- en: 'Countdown item'
184
- },
185
241
  controls: [
186
242
  {
187
243
  label: {
188
- en: 'Padding'
244
+ en: 'Item style'
189
245
  },
190
246
  setting: {
191
- id: 'itemPadding'
247
+ id: 'enableLabelTextStyle'
248
+ },
249
+ options: {
250
+ labelVariant: 'primary',
251
+ toggleStyle: 'switch'
192
252
  }
193
253
  },
194
254
  {
195
255
  label: {
196
- en: 'Digit style'
256
+ en: 'Time'
197
257
  },
258
+ conditionDisplay: 'enableLabelTextStyle == true',
198
259
  type: 'combo',
199
260
  iconName: 'polaris-text-title',
200
- fixedValue: 'Edit...',
261
+ getValueFromSettingID: 'labelTypo.type',
201
262
  isHideClear: true,
202
263
  controls: [
203
264
  {
204
265
  setting: {
205
- id: 'numTypo'
266
+ id: 'labelTypo'
206
267
  },
207
268
  layout: 'vertical'
208
269
  }
209
270
  ]
271
+ }
272
+ ]
273
+ },
274
+ {
275
+ controls: [
276
+ {
277
+ label: {
278
+ en: 'Caption'
279
+ },
280
+ setting: {
281
+ id: 'enableNumberTextStyle'
282
+ },
283
+ options: {
284
+ labelVariant: 'primary',
285
+ toggleStyle: 'switch'
286
+ }
210
287
  },
211
288
  {
212
289
  label: {
213
- en: 'Label style'
290
+ en: 'Text style'
214
291
  },
292
+ conditionDisplay: 'enableNumberTextStyle == true',
215
293
  type: 'combo',
216
294
  iconName: 'polaris-text-title',
217
- fixedValue: 'Edit...',
218
295
  isHideClear: true,
296
+ getValueFromSettingID: 'numTypo.type',
219
297
  controls: [
220
298
  {
221
299
  setting: {
222
- id: 'labelTypo'
300
+ id: 'numTypo'
223
301
  },
224
302
  layout: 'vertical'
225
303
  }
226
304
  ]
227
- },
228
- {
229
- label: {
230
- en: 'Gap to digit'
231
- },
232
- setting: {
233
- id: 'verticalGap'
234
- }
235
305
  }
236
- ],
237
- moreSettings: {
238
- type: 'collapse',
239
- controls: [
240
- {
241
- label: {
242
- en: 'Background'
243
- },
244
- setting: {
245
- id: 'backgroundItemColor'
246
- }
247
- },
248
- {
249
- label: {
250
- en: 'Border'
251
- },
252
- setting: {
253
- id: 'borderState',
254
- state: 'normal'
255
- }
256
- },
257
- {
258
- label: {
259
- en: 'Corner'
260
- },
261
- setting: {
262
- id: 'roundedState',
263
- state: 'normal'
264
- }
265
- }
266
- ]
267
- }
306
+ ]
268
307
  },
269
308
  {
270
309
  label: {
271
- en: 'Countdown Item hover effect'
310
+ en: 'Size'
272
311
  },
273
312
  controls: [
274
313
  {
275
314
  label: {
276
- en: 'Border'
277
- },
278
- setting: {
279
- id: 'borderState',
280
- state: 'hover'
281
- }
282
- },
283
- {
284
- label: {
285
- en: 'Corner'
315
+ en: 'Padding'
286
316
  },
287
- setting: {
288
- id: 'roundedState',
289
- state: 'hover'
317
+ controlConfig: {
318
+ id: 'padding',
319
+ type: 'padding-v2',
320
+ linkWithSetting: {
321
+ name: 'spacing-setting',
322
+ field: 'padding'
323
+ }
290
324
  }
291
325
  }
292
326
  ]
@@ -295,14 +329,13 @@ const SettingUIV2 = [
295
329
  label: {
296
330
  en: 'Shape'
297
331
  },
298
- conditionDisplay: 'pageType != "POST_PURCHASE"',
299
332
  controls: [
300
333
  {
301
334
  label: {
302
335
  en: 'Border'
303
336
  },
304
337
  setting: {
305
- id: 'border',
338
+ id: 'borderState',
306
339
  state: 'normal'
307
340
  }
308
341
  },
@@ -311,7 +344,7 @@ const SettingUIV2 = [
311
344
  en: 'Corner'
312
345
  },
313
346
  setting: {
314
- id: 'rounded',
347
+ id: 'roundedState',
315
348
  state: 'normal'
316
349
  }
317
350
  },
@@ -322,6 +355,50 @@ const SettingUIV2 = [
322
355
  setting: {
323
356
  id: 'boxShadow',
324
357
  state: 'normal'
358
+ },
359
+ options: {
360
+ updateFields: [
361
+ {
362
+ field: 'enable',
363
+ settingId: 'advanced.hasBoxShadow',
364
+ state: 'normal'
365
+ }
366
+ ]
367
+ },
368
+ controlChangeTrigger: {
369
+ settings: [
370
+ {
371
+ condition: `boxShadow.normal.enable === true`,
372
+ source: [
373
+ 'boxShadow',
374
+ 'hasBoxShadow'
375
+ ],
376
+ action: {
377
+ controlId: 'hasBoxShadow',
378
+ groupType: 'advanced',
379
+ controlType: 'advanced',
380
+ state: 'normal',
381
+ newValue: true
382
+ }
383
+ },
384
+ {
385
+ condition: `boxShadow.normal.enable === false`,
386
+ source: [
387
+ 'boxShadow',
388
+ 'hasBoxShadow'
389
+ ],
390
+ action: {
391
+ controlId: 'hasBoxShadow',
392
+ groupType: 'advanced',
393
+ controlType: 'advanced',
394
+ state: 'normal',
395
+ newValue: false
396
+ }
397
+ }
398
+ ],
399
+ options: {
400
+ noRecordHistory: true
401
+ }
325
402
  }
326
403
  }
327
404
  ]
@@ -8,7 +8,6 @@ var getAttr = require('./common/getAttr.js');
8
8
  var getStyle = require('./common/getStyle.js');
9
9
  var getClasses = require('./common/getClasses.js');
10
10
  var helpers = require('../../helpers.js');
11
- var ButtonIcon = require('../../button/components/ButtonIcon.js');
12
11
 
13
12
  const Dialog = (props)=>{
14
13
  const { setting, children, builderProps, style, advanced, builderAttrs } = props;
@@ -152,13 +151,11 @@ const Dialog = (props)=>{
152
151
  class="${buttonContentClasses}"
153
152
  style="${buttonContentStyle}"
154
153
  >
155
- ${ButtonIcon.default({
156
- iconSvg: iconSvg ?? `<svg viewBox="0 0 12 12" fill="currentColor" style={svgContentStyle}>
157
- <path d="M7.1,6l4.5,4.5l-1.1,1.1L6,7.1l-4.5,4.5l-1.1-1.1L4.9,6L0.5,1.5l1.1-1.1L6,4.9l4.5-4.5l1.1,1.1L7.1,6z"></path>
158
- </svg>`,
159
- styles: svgContentStyle,
160
- classes: svgContentClasses
161
- })}
154
+ <span style="${svgContentStyle}" class="${svgContentClasses}">
155
+ ${iconSvg ?? `<svg viewBox="0 0 12 12" fill="currentColor" style={svgContentStyle}>
156
+ <path d="M7.1,6l4.5,4.5l-1.1,1.1L6,7.1l-4.5,4.5l-1.1-1.1L4.9,6L0.5,1.5l1.1-1.1L6,4.9l4.5-4.5l1.1,1.1L7.1,6z"></path>
157
+ </svg>`}
158
+ </span>
162
159
  </button>
163
160
  <div
164
161
  aria-label="Dialog body"
@@ -201,11 +201,9 @@ const DialogSettings = [
201
201
  id: 'iconSvg',
202
202
  label: 'SVG Icon',
203
203
  type: 'icon',
204
- default: `
205
- <svg viewBox="0 0 12 12" fill="currentColor">
206
- <path d="M7.1,6l4.5,4.5l-1.1,1.1L6,7.1l-4.5,4.5l-1.1-1.1L4.9,6L0.5,1.5l1.1-1.1L6,4.9l4.5-4.5l1.1,1.1L7.1,6z"></path>
207
- </svg>
208
- `
204
+ default: `<svg height="20" width="20" data-name="x-bold" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508817606065848680">
205
+ <path fill="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"/>
206
+ </svg>`
209
207
  },
210
208
  {
211
209
  id: 'btnWidth',
@@ -266,12 +264,14 @@ const DialogSettings = [
266
264
  {
267
265
  id: 'btnBg',
268
266
  type: 'color-picker-v2',
269
- default: '#ffffff'
267
+ default: 'brand',
268
+ compoDefaultValue: 'brand'
270
269
  },
271
270
  {
272
271
  id: 'btnColor',
273
272
  type: 'color-picker-v2',
274
- default: 'text-1'
273
+ default: 'text-3',
274
+ compoDefaultValue: 'text-3'
275
275
  },
276
276
  {
277
277
  id: 'trigger',
@@ -340,7 +340,7 @@ const DialogSettings = [
340
340
  desktop: {
341
341
  default: {
342
342
  type: 'color',
343
- color: '#FFFFFF',
343
+ color: 'bg-1',
344
344
  image: {
345
345
  src: '',
346
346
  width: 0,
@@ -360,7 +360,7 @@ const DialogSettings = [
360
360
  desktop: {
361
361
  default: {
362
362
  type: 'color',
363
- color: '#CCCCCC',
363
+ color: 'bg-1',
364
364
  image: {
365
365
  src: 'https://ucarecdn.com/5e27d43d-eb1e-4e71-b7e1-4158f3071bb6/-/format/auto/',
366
366
  width: 1200,
@@ -36,6 +36,11 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
36
36
  d: advancedDisplay
37
37
  }
38
38
  });
39
+ // Fix for drawer page content theme 1.0
40
+ const styleInline = `.drawer-page-content {
41
+ transform: none !important;
42
+ -webkit-transform: none !important;
43
+ }`;
39
44
  return core.template`
40
45
  ${core.RenderIf(!!preloadBgImage, `${core.RenderIf(!!background?.desktop?.image?.src, `<link rel="preload" href="${background?.desktop?.image?.src}" as="image" />`)}${core.RenderIf(!!background?.tablet?.image?.src, `<link rel="preload" href="${background?.tablet?.image?.src}" as="image" />`)}${core.RenderIf(!!background?.mobile?.image?.src, `<link rel="preload" href="${background?.mobile?.image?.src}" as="image" />`)}`)}
41
46
  <gp-sticky
@@ -46,6 +51,7 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
46
51
  class="${computedContainerClasses} ${helpers.getSettingPreloadData('gps-lazy')}"
47
52
  style="${computedContainerStyles}"
48
53
  >
54
+ <style>${styleInline}</style>
49
55
  <div ${{
50
56
  ...builderAttrs
51
57
  }} style="${{