@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.
@@ -1,4 +1,60 @@
1
1
  const SettingUIV2 = [
2
+ {
3
+ label: {
4
+ en: 'Countdown time'
5
+ },
6
+ controls: [
7
+ {
8
+ label: {
9
+ en: 'Run type'
10
+ },
11
+ setting: {
12
+ id: 'behaviour'
13
+ }
14
+ },
15
+ {
16
+ conditionDisplay: 'behaviour === "standard"',
17
+ label: {
18
+ en: 'Date'
19
+ },
20
+ setting: {
21
+ id: 'dateStandard'
22
+ }
23
+ },
24
+ {
25
+ conditionDisplay: 'behaviour === "standard"',
26
+ label: {
27
+ en: 'Time zone'
28
+ },
29
+ setting: {
30
+ id: 'timeZone'
31
+ }
32
+ },
33
+ {
34
+ conditionDisplay: 'behaviour === "daily"',
35
+ setting: {
36
+ id: 'timerDaily'
37
+ },
38
+ layout: 'vertical'
39
+ },
40
+ {
41
+ conditionDisplay: 'behaviour === "evergreen"',
42
+ setting: {
43
+ id: 'timerEverygreen'
44
+ },
45
+ layout: 'vertical'
46
+ },
47
+ {
48
+ conditionDisplay: 'behaviour === "evergreen"',
49
+ label: {
50
+ en: 'Loop (refresh after finish)'
51
+ },
52
+ setting: {
53
+ id: 'loopAfterFinish'
54
+ }
55
+ }
56
+ ]
57
+ },
2
58
  {
3
59
  label: {
4
60
  en: 'Item management'
@@ -7,7 +63,7 @@ const SettingUIV2 = [
7
63
  {
8
64
  type: 'combo',
9
65
  label: {
10
- en: 'Item'
66
+ en: 'Items'
11
67
  },
12
68
  fixedValue: 'Edit...',
13
69
  iconName: 'polaris-list-bulleted',
@@ -107,184 +163,162 @@ const SettingUIV2 = [
107
163
  },
108
164
  {
109
165
  label: {
110
- en: 'Configuration'
166
+ en: 'Hover effect'
111
167
  },
112
168
  controls: [
113
169
  {
114
170
  label: {
115
- en: 'Type'
171
+ en: 'Border'
116
172
  },
117
173
  setting: {
118
- id: 'behaviour'
174
+ id: 'borderState',
175
+ state: 'hover'
119
176
  }
120
177
  },
121
178
  {
122
- conditionDisplay: 'behaviour === "standard"',
123
179
  label: {
124
- en: 'Date'
180
+ en: 'Corner'
125
181
  },
126
182
  setting: {
127
- id: 'dateStandard'
183
+ id: 'roundedState',
184
+ state: 'hover'
128
185
  }
129
- },
186
+ }
187
+ ]
188
+ },
189
+ {
190
+ label: {
191
+ en: 'Item style'
192
+ },
193
+ controls: [
130
194
  {
131
- conditionDisplay: 'behaviour === "standard"',
132
195
  label: {
133
- en: 'Time zone'
196
+ en: 'Item gap'
134
197
  },
135
198
  setting: {
136
- id: 'timeZone'
199
+ id: 'horizontalGap'
137
200
  }
138
201
  },
139
202
  {
140
- conditionDisplay: 'behaviour === "daily"',
141
- setting: {
142
- id: 'timerDaily'
203
+ label: {
204
+ en: 'Padding'
143
205
  },
144
- layout: 'vertical'
206
+ setting: {
207
+ id: 'itemPadding'
208
+ }
145
209
  },
146
210
  {
147
- conditionDisplay: 'behaviour === "evergreen"',
148
- setting: {
149
- id: 'timerEverygreen'
211
+ label: {
212
+ en: 'Background'
150
213
  },
151
- layout: 'vertical'
214
+ setting: {
215
+ id: 'backgroundItemColor'
216
+ }
152
217
  },
153
218
  {
154
- conditionDisplay: 'behaviour === "evergreen"',
155
219
  label: {
156
- en: 'Loop (refresh after finish)'
220
+ en: 'Border'
157
221
  },
158
222
  setting: {
159
- id: 'loopAfterFinish'
223
+ id: 'borderState',
224
+ state: 'normal'
160
225
  }
161
- }
162
- ]
163
- },
164
- {
165
- label: {
166
- en: 'Items gap'
167
- },
168
- controls: [
226
+ },
169
227
  {
170
228
  label: {
171
- en: 'Gap'
229
+ en: 'Corner'
172
230
  },
173
231
  setting: {
174
- id: 'horizontalGap'
232
+ id: 'roundedState',
233
+ state: 'normal'
175
234
  }
176
235
  }
177
236
  ]
178
237
  },
179
238
  {
180
- label: {
181
- en: 'Countdown item'
182
- },
183
239
  controls: [
184
240
  {
185
241
  label: {
186
- en: 'Padding'
242
+ en: 'Item style'
187
243
  },
188
244
  setting: {
189
- id: 'itemPadding'
245
+ id: 'enableLabelTextStyle'
246
+ },
247
+ options: {
248
+ labelVariant: 'primary',
249
+ toggleStyle: 'switch'
190
250
  }
191
251
  },
192
252
  {
193
253
  label: {
194
- en: 'Digit style'
254
+ en: 'Time'
195
255
  },
256
+ conditionDisplay: 'enableLabelTextStyle == true',
196
257
  type: 'combo',
197
258
  iconName: 'polaris-text-title',
198
- fixedValue: 'Edit...',
259
+ getValueFromSettingID: 'labelTypo.type',
199
260
  isHideClear: true,
200
261
  controls: [
201
262
  {
202
263
  setting: {
203
- id: 'numTypo'
264
+ id: 'labelTypo'
204
265
  },
205
266
  layout: 'vertical'
206
267
  }
207
268
  ]
269
+ }
270
+ ]
271
+ },
272
+ {
273
+ controls: [
274
+ {
275
+ label: {
276
+ en: 'Caption'
277
+ },
278
+ setting: {
279
+ id: 'enableNumberTextStyle'
280
+ },
281
+ options: {
282
+ labelVariant: 'primary',
283
+ toggleStyle: 'switch'
284
+ }
208
285
  },
209
286
  {
210
287
  label: {
211
- en: 'Label style'
288
+ en: 'Text style'
212
289
  },
290
+ conditionDisplay: 'enableNumberTextStyle == true',
213
291
  type: 'combo',
214
292
  iconName: 'polaris-text-title',
215
- fixedValue: 'Edit...',
216
293
  isHideClear: true,
294
+ getValueFromSettingID: 'numTypo.type',
217
295
  controls: [
218
296
  {
219
297
  setting: {
220
- id: 'labelTypo'
298
+ id: 'numTypo'
221
299
  },
222
300
  layout: 'vertical'
223
301
  }
224
302
  ]
225
- },
226
- {
227
- label: {
228
- en: 'Gap to digit'
229
- },
230
- setting: {
231
- id: 'verticalGap'
232
- }
233
303
  }
234
- ],
235
- moreSettings: {
236
- type: 'collapse',
237
- controls: [
238
- {
239
- label: {
240
- en: 'Background'
241
- },
242
- setting: {
243
- id: 'backgroundItemColor'
244
- }
245
- },
246
- {
247
- label: {
248
- en: 'Border'
249
- },
250
- setting: {
251
- id: 'borderState',
252
- state: 'normal'
253
- }
254
- },
255
- {
256
- label: {
257
- en: 'Corner'
258
- },
259
- setting: {
260
- id: 'roundedState',
261
- state: 'normal'
262
- }
263
- }
264
- ]
265
- }
304
+ ]
266
305
  },
267
306
  {
268
307
  label: {
269
- en: 'Countdown Item hover effect'
308
+ en: 'Size'
270
309
  },
271
310
  controls: [
272
311
  {
273
312
  label: {
274
- en: 'Border'
275
- },
276
- setting: {
277
- id: 'borderState',
278
- state: 'hover'
279
- }
280
- },
281
- {
282
- label: {
283
- en: 'Corner'
313
+ en: 'Padding'
284
314
  },
285
- setting: {
286
- id: 'roundedState',
287
- state: 'hover'
315
+ controlConfig: {
316
+ id: 'padding',
317
+ type: 'padding-v2',
318
+ linkWithSetting: {
319
+ name: 'spacing-setting',
320
+ field: 'padding'
321
+ }
288
322
  }
289
323
  }
290
324
  ]
@@ -293,14 +327,13 @@ const SettingUIV2 = [
293
327
  label: {
294
328
  en: 'Shape'
295
329
  },
296
- conditionDisplay: 'pageType != "POST_PURCHASE"',
297
330
  controls: [
298
331
  {
299
332
  label: {
300
333
  en: 'Border'
301
334
  },
302
335
  setting: {
303
- id: 'border',
336
+ id: 'borderState',
304
337
  state: 'normal'
305
338
  }
306
339
  },
@@ -309,7 +342,7 @@ const SettingUIV2 = [
309
342
  en: 'Corner'
310
343
  },
311
344
  setting: {
312
- id: 'rounded',
345
+ id: 'roundedState',
313
346
  state: 'normal'
314
347
  }
315
348
  },
@@ -320,6 +353,50 @@ const SettingUIV2 = [
320
353
  setting: {
321
354
  id: 'boxShadow',
322
355
  state: 'normal'
356
+ },
357
+ options: {
358
+ updateFields: [
359
+ {
360
+ field: 'enable',
361
+ settingId: 'advanced.hasBoxShadow',
362
+ state: 'normal'
363
+ }
364
+ ]
365
+ },
366
+ controlChangeTrigger: {
367
+ settings: [
368
+ {
369
+ condition: `boxShadow.normal.enable === true`,
370
+ source: [
371
+ 'boxShadow',
372
+ 'hasBoxShadow'
373
+ ],
374
+ action: {
375
+ controlId: 'hasBoxShadow',
376
+ groupType: 'advanced',
377
+ controlType: 'advanced',
378
+ state: 'normal',
379
+ newValue: true
380
+ }
381
+ },
382
+ {
383
+ condition: `boxShadow.normal.enable === false`,
384
+ source: [
385
+ 'boxShadow',
386
+ 'hasBoxShadow'
387
+ ],
388
+ action: {
389
+ controlId: 'hasBoxShadow',
390
+ groupType: 'advanced',
391
+ controlType: 'advanced',
392
+ state: 'normal',
393
+ newValue: false
394
+ }
395
+ }
396
+ ],
397
+ options: {
398
+ noRecordHistory: true
399
+ }
323
400
  }
324
401
  }
325
402
  ]
@@ -4,7 +4,6 @@ import { getAttr, getAttrContainer, getAttrOverlay, getAttrClose } from './commo
4
4
  import { getWrapperStyle, getContainStyle, getBackdropStyle, getOverlayStyle, getDialogContentStyle, getButtonContentStyle, getSvgContentStyle, getBodyContentStyle } from './common/getStyle.js';
5
5
  import { getContainClasses, getBackdropClasses, getOverlayClasses, getDialogContentClasses, getHeadContentClasses, getButtonContentClasses, getSvgContentClasses, getBodyContentClasses } from './common/getClasses.js';
6
6
  import { getSettingPreloadData } from '../../helpers.js';
7
- import ButtonIcon from '../../button/components/ButtonIcon.js';
8
7
 
9
8
  const Dialog = (props)=>{
10
9
  const { setting, children, builderProps, style, advanced, builderAttrs } = props;
@@ -148,13 +147,11 @@ const Dialog = (props)=>{
148
147
  class="${buttonContentClasses}"
149
148
  style="${buttonContentStyle}"
150
149
  >
151
- ${ButtonIcon({
152
- iconSvg: iconSvg ?? `<svg viewBox="0 0 12 12" fill="currentColor" style={svgContentStyle}>
153
- <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>
154
- </svg>`,
155
- styles: svgContentStyle,
156
- classes: svgContentClasses
157
- })}
150
+ <span style="${svgContentStyle}" class="${svgContentClasses}">
151
+ ${iconSvg ?? `<svg viewBox="0 0 12 12" fill="currentColor" style={svgContentStyle}>
152
+ <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>
153
+ </svg>`}
154
+ </span>
158
155
  </button>
159
156
  <div
160
157
  aria-label="Dialog body"
@@ -199,11 +199,9 @@ const DialogSettings = [
199
199
  id: 'iconSvg',
200
200
  label: 'SVG Icon',
201
201
  type: 'icon',
202
- default: `
203
- <svg viewBox="0 0 12 12" fill="currentColor">
204
- <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>
205
- </svg>
206
- `
202
+ 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">
203
+ <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"/>
204
+ </svg>`
207
205
  },
208
206
  {
209
207
  id: 'btnWidth',
@@ -264,12 +262,14 @@ const DialogSettings = [
264
262
  {
265
263
  id: 'btnBg',
266
264
  type: 'color-picker-v2',
267
- default: '#ffffff'
265
+ default: 'brand',
266
+ compoDefaultValue: 'brand'
268
267
  },
269
268
  {
270
269
  id: 'btnColor',
271
270
  type: 'color-picker-v2',
272
- default: 'text-1'
271
+ default: 'text-3',
272
+ compoDefaultValue: 'text-3'
273
273
  },
274
274
  {
275
275
  id: 'trigger',
@@ -338,7 +338,7 @@ const DialogSettings = [
338
338
  desktop: {
339
339
  default: {
340
340
  type: 'color',
341
- color: '#FFFFFF',
341
+ color: 'bg-1',
342
342
  image: {
343
343
  src: '',
344
344
  width: 0,
@@ -358,7 +358,7 @@ const DialogSettings = [
358
358
  desktop: {
359
359
  default: {
360
360
  type: 'color',
361
- color: '#CCCCCC',
361
+ color: 'bg-1',
362
362
  image: {
363
363
  src: 'https://ucarecdn.com/5e27d43d-eb1e-4e71-b7e1-4158f3071bb6/-/format/auto/',
364
364
  width: 1200,
@@ -32,6 +32,11 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
32
32
  d: advancedDisplay
33
33
  }
34
34
  });
35
+ // Fix for drawer page content theme 1.0
36
+ const styleInline = `.drawer-page-content {
37
+ transform: none !important;
38
+ -webkit-transform: none !important;
39
+ }`;
35
40
  return template`
36
41
  ${RenderIf(!!preloadBgImage, `${RenderIf(!!background?.desktop?.image?.src, `<link rel="preload" href="${background?.desktop?.image?.src}" as="image" />`)}${RenderIf(!!background?.tablet?.image?.src, `<link rel="preload" href="${background?.tablet?.image?.src}" as="image" />`)}${RenderIf(!!background?.mobile?.image?.src, `<link rel="preload" href="${background?.mobile?.image?.src}" as="image" />`)}`)}
37
42
  <gp-sticky
@@ -42,6 +47,7 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
42
47
  class="${computedContainerClasses} ${getSettingPreloadData('gps-lazy')}"
43
48
  style="${computedContainerStyles}"
44
49
  >
50
+ <style>${styleInline}</style>
45
51
  <div ${{
46
52
  ...builderAttrs
47
53
  }} style="${{
@@ -26,24 +26,27 @@ const TabsSettings = [
26
26
  },
27
27
  {
28
28
  id: 'position',
29
- type: 'layout-segment',
29
+ type: 'layout-selector',
30
30
  label: 'Layout',
31
- disableToggle: true,
31
+ iconViewBox: '0 0 74 48',
32
+ enableItemBackground: true,
33
+ itemPerRow: 2,
34
+ itemSpacing: 'large',
32
35
  options: [
33
36
  {
34
37
  value: 'top',
35
38
  label: 'Top',
36
- type: 'layout-align'
39
+ iconName: 'gp-tab-top'
37
40
  },
38
41
  {
39
42
  value: 'left',
40
43
  label: 'Left',
41
- type: 'layout-align'
44
+ iconName: 'gp-tab-top'
42
45
  },
43
46
  {
44
47
  value: 'right',
45
48
  label: 'Right',
46
- type: 'layout-align'
49
+ iconName: 'gp-tab-top'
47
50
  }
48
51
  ],
49
52
  devices: {
@@ -140,7 +143,7 @@ const TabsSettings = [
140
143
  ],
141
144
  devices: {
142
145
  desktop: {
143
- default: '200px'
146
+ default: 'auto'
144
147
  }
145
148
  }
146
149
  },