@gem-sdk/components 2.0.0-dev.381 → 2.0.0-dev.383

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 (29) hide show
  1. package/dist/cjs/article/components/ArticleTitle.js +4 -3
  2. package/dist/cjs/article/components/ArticleTitle.liquid.js +7 -8
  3. package/dist/cjs/article/setting/ArticleList.js +2 -2
  4. package/dist/cjs/article/setting/configs/ArticleImage/presets.js +1 -1
  5. package/dist/cjs/button/setting/Button.js +1 -1
  6. package/dist/cjs/button/setting/configs/settings.js +14 -1
  7. package/dist/cjs/button/setting/configs/uiV2.js +118 -33
  8. package/dist/cjs/image/setting/configs/uiV2.js +45 -4
  9. package/dist/cjs/image-comparison/setting/configs/uiV2.js +44 -0
  10. package/dist/cjs/product/setting/dynamic-checkout/configs/settings.js +1 -1
  11. package/dist/cjs/product/setting/dynamic-checkout/configs/uiV2.js +118 -33
  12. package/dist/cjs/product/setting/product-button/configs/uiV2.js +86 -6
  13. package/dist/cjs/product/setting/product-view-more/configs/uiV2.js +86 -6
  14. package/dist/cjs/sticky/setting/configs/uiV2.js +43 -3
  15. package/dist/esm/article/components/ArticleTitle.js +4 -3
  16. package/dist/esm/article/components/ArticleTitle.liquid.js +7 -8
  17. package/dist/esm/article/setting/ArticleList.js +2 -2
  18. package/dist/esm/article/setting/configs/ArticleImage/presets.js +1 -1
  19. package/dist/esm/button/setting/Button.js +1 -1
  20. package/dist/esm/button/setting/configs/settings.js +14 -1
  21. package/dist/esm/button/setting/configs/uiV2.js +118 -33
  22. package/dist/esm/image/setting/configs/uiV2.js +45 -4
  23. package/dist/esm/image-comparison/setting/configs/uiV2.js +44 -0
  24. package/dist/esm/product/setting/dynamic-checkout/configs/settings.js +1 -1
  25. package/dist/esm/product/setting/dynamic-checkout/configs/uiV2.js +118 -33
  26. package/dist/esm/product/setting/product-button/configs/uiV2.js +86 -6
  27. package/dist/esm/product/setting/product-view-more/configs/uiV2.js +86 -6
  28. package/dist/esm/sticky/setting/configs/uiV2.js +43 -3
  29. package/package.json +1 -1
@@ -156,9 +156,49 @@ const SettingUIV2 = [
156
156
  id: 'boxShadowBtnV2',
157
157
  state: 'normal'
158
158
  },
159
- controlConfig: {
160
- id: 'boxShadowBtnV2',
161
- type: 'shadow-v2'
159
+ options: {
160
+ updateFields: [
161
+ {
162
+ field: 'enable',
163
+ settingId: 'hasBoxShadowBtn',
164
+ state: 'normal'
165
+ }
166
+ ]
167
+ },
168
+ controlChangeTrigger: {
169
+ settings: [
170
+ {
171
+ condition: `boxShadowBtnV2.normal.enable === true`,
172
+ source: [
173
+ 'boxShadowBtnV2',
174
+ 'hasBoxShadowBtn'
175
+ ],
176
+ action: {
177
+ controlId: 'hasBoxShadowBtn',
178
+ groupType: 'advanced',
179
+ controlType: 'advanced',
180
+ state: 'normal',
181
+ newValue: true
182
+ }
183
+ },
184
+ {
185
+ condition: `boxShadowBtnV2.normal.enable === false`,
186
+ source: [
187
+ 'boxShadowBtnV2',
188
+ 'hasBoxShadowBtn'
189
+ ],
190
+ action: {
191
+ controlId: 'hasBoxShadowBtn',
192
+ groupType: 'advanced',
193
+ controlType: 'advanced',
194
+ state: 'normal',
195
+ newValue: false
196
+ }
197
+ }
198
+ ],
199
+ options: {
200
+ noRecordHistory: true
201
+ }
162
202
  }
163
203
  }
164
204
  ]
@@ -365,9 +405,49 @@ const SettingUIV2 = [
365
405
  id: 'boxShadowBtnV2',
366
406
  state: 'hover'
367
407
  },
368
- controlConfig: {
369
- id: 'boxShadowBtnV2',
370
- type: 'shadow-v2'
408
+ options: {
409
+ updateFields: [
410
+ {
411
+ field: 'enable',
412
+ settingId: 'hasBoxShadowBtn',
413
+ state: 'hover'
414
+ }
415
+ ]
416
+ },
417
+ controlChangeTrigger: {
418
+ settings: [
419
+ {
420
+ condition: `boxShadowBtnV2.hover.enable === true`,
421
+ source: [
422
+ 'boxShadowBtnV2',
423
+ 'hasBoxShadowBtn'
424
+ ],
425
+ action: {
426
+ controlId: 'hasBoxShadowBtn',
427
+ groupType: 'advanced',
428
+ controlType: 'advanced',
429
+ state: 'hover',
430
+ newValue: true
431
+ }
432
+ },
433
+ {
434
+ condition: `boxShadowBtnV2.hover.enable === false`,
435
+ source: [
436
+ 'boxShadowBtnV2',
437
+ 'hasBoxShadowBtn'
438
+ ],
439
+ action: {
440
+ controlId: 'hasBoxShadowBtn',
441
+ groupType: 'advanced',
442
+ controlType: 'advanced',
443
+ state: 'hover',
444
+ newValue: false
445
+ }
446
+ }
447
+ ],
448
+ options: {
449
+ noRecordHistory: true
450
+ }
371
451
  }
372
452
  }
373
453
  ]
@@ -182,9 +182,49 @@ const SettingUIV2 = [
182
182
  id: 'boxShadowBtnV2',
183
183
  state: 'normal'
184
184
  },
185
- controlConfig: {
186
- id: 'boxShadowBtnV2',
187
- type: 'shadow-v2'
185
+ options: {
186
+ updateFields: [
187
+ {
188
+ field: 'enable',
189
+ settingId: 'hasBoxShadowBtn',
190
+ state: 'normal'
191
+ }
192
+ ]
193
+ },
194
+ controlChangeTrigger: {
195
+ settings: [
196
+ {
197
+ condition: `boxShadowBtnV2.normal.enable === true`,
198
+ source: [
199
+ 'boxShadowBtnV2',
200
+ 'hasBoxShadowBtn'
201
+ ],
202
+ action: {
203
+ controlId: 'hasBoxShadowBtn',
204
+ groupType: 'advanced',
205
+ controlType: 'advanced',
206
+ state: 'normal',
207
+ newValue: true
208
+ }
209
+ },
210
+ {
211
+ condition: `boxShadowBtnV2.normal.enable === false`,
212
+ source: [
213
+ 'boxShadowBtnV2',
214
+ 'hasBoxShadowBtn'
215
+ ],
216
+ action: {
217
+ controlId: 'hasBoxShadowBtn',
218
+ groupType: 'advanced',
219
+ controlType: 'advanced',
220
+ state: 'normal',
221
+ newValue: false
222
+ }
223
+ }
224
+ ],
225
+ options: {
226
+ noRecordHistory: true
227
+ }
188
228
  }
189
229
  }
190
230
  ]
@@ -345,9 +385,49 @@ const SettingUIV2 = [
345
385
  id: 'boxShadowBtnV2',
346
386
  state: 'hover'
347
387
  },
348
- controlConfig: {
349
- id: 'boxShadowBtnV2',
350
- type: 'shadow-v2'
388
+ options: {
389
+ updateFields: [
390
+ {
391
+ field: 'enable',
392
+ settingId: 'hasBoxShadowBtn',
393
+ state: 'hover'
394
+ }
395
+ ]
396
+ },
397
+ controlChangeTrigger: {
398
+ settings: [
399
+ {
400
+ condition: `boxShadowBtnV2.hover.enable === true`,
401
+ source: [
402
+ 'boxShadowBtnV2',
403
+ 'hasBoxShadowBtn'
404
+ ],
405
+ action: {
406
+ controlId: 'hasBoxShadowBtn',
407
+ groupType: 'advanced',
408
+ controlType: 'advanced',
409
+ state: 'hover',
410
+ newValue: true
411
+ }
412
+ },
413
+ {
414
+ condition: `boxShadowBtnV2.normal.enable === false`,
415
+ source: [
416
+ 'boxShadowBtnV2',
417
+ 'hasBoxShadowBtn'
418
+ ],
419
+ action: {
420
+ controlId: 'hasBoxShadowBtn',
421
+ groupType: 'advanced',
422
+ controlType: 'advanced',
423
+ state: 'normal',
424
+ newValue: false
425
+ }
426
+ }
427
+ ],
428
+ options: {
429
+ noRecordHistory: true
430
+ }
351
431
  }
352
432
  }
353
433
  ]
@@ -97,9 +97,49 @@ const SettingUIV2 = [
97
97
  id: 'boxShadow',
98
98
  state: 'normal'
99
99
  },
100
- controlConfig: {
101
- id: 'boxShadow',
102
- type: 'shadow-v2'
100
+ options: {
101
+ updateFields: [
102
+ {
103
+ field: 'enable',
104
+ settingId: 'hasBoxShadow',
105
+ state: 'normal'
106
+ }
107
+ ]
108
+ },
109
+ controlChangeTrigger: {
110
+ settings: [
111
+ {
112
+ condition: `boxShadow.normal.enable === true`,
113
+ source: [
114
+ 'boxShadow',
115
+ 'hasBoxShadow'
116
+ ],
117
+ action: {
118
+ controlId: 'hasBoxShadow',
119
+ groupType: 'advanced',
120
+ controlType: 'advanced',
121
+ state: 'normal',
122
+ newValue: true
123
+ }
124
+ },
125
+ {
126
+ condition: `boxShadow.normal.enable === false`,
127
+ source: [
128
+ 'boxShadow',
129
+ 'hasBoxShadow'
130
+ ],
131
+ action: {
132
+ controlId: 'hasBoxShadow',
133
+ groupType: 'advanced',
134
+ controlType: 'advanced',
135
+ state: 'normal',
136
+ newValue: false
137
+ }
138
+ }
139
+ ],
140
+ options: {
141
+ noRecordHistory: true
142
+ }
103
143
  }
104
144
  }
105
145
  ]
@@ -4,6 +4,7 @@ import Link from 'next/link';
4
4
  import Text from '../../text/components/Text.js';
5
5
  import { useArticleStore } from '@gem-sdk/core';
6
6
  import { useArticleLink } from '../hooks/useArticleLink.js';
7
+ import { If } from '@gem-sdk/system';
7
8
 
8
9
  const ArticleTitle = ({ setting, builderProps, styles })=>{
9
10
  const article = useArticleStore((s)=>s.article);
@@ -12,7 +13,7 @@ const ArticleTitle = ({ setting, builderProps, styles })=>{
12
13
  return /*#__PURE__*/ jsx("div", {
13
14
  id: `shopify-text-element-${builderProps?.uid}`,
14
15
  "data-article-id": article?.baseID?.replace('gid://shopify/OnlineStoreArticle/', ''),
15
- children: !article ? null : setting?.enableLink && setting?.linkArticle ? /*#__PURE__*/ jsx(Link, {
16
+ children: If(!article ? null : setting?.enableLink, /*#__PURE__*/ jsx(Link, {
16
17
  href: shopifyArticleLink,
17
18
  target: target,
18
19
  title: article?.title,
@@ -25,7 +26,7 @@ const ArticleTitle = ({ setting, builderProps, styles })=>{
25
26
  excludeFlex: true
26
27
  }
27
28
  })
28
- }) : /*#__PURE__*/ jsx(Text, {
29
+ }), /*#__PURE__*/ jsx(Text, {
29
30
  builderProps: builderProps,
30
31
  styles: styles,
31
32
  setting: {
@@ -33,7 +34,7 @@ const ArticleTitle = ({ setting, builderProps, styles })=>{
33
34
  text: article.title,
34
35
  excludeFlex: true
35
36
  }
36
- })
37
+ }))
37
38
  });
38
39
  };
39
40
 
@@ -2,15 +2,16 @@
2
2
  import { template } from '@gem-sdk/core';
3
3
  import Text from '../../text/components/Text.liquid.js';
4
4
  import { getLinkArticle } from '../../helpers.js';
5
+ import { If } from '@gem-sdk/system';
5
6
 
6
7
  const ArticleTitle = ({ setting, styles, advanced, builderProps })=>{
7
8
  const target = setting?.openNewTab ? '_blank' : '_self';
8
9
  return template`
9
- ${setting?.enableLink && setting?.linkArticle ? `
10
- <a href="${getLinkArticle(setting.linkArticle, setting.customURL)}" target="${{
10
+ ${If(setting?.enableLink, template`
11
+ <a href="${getLinkArticle(setting?.linkArticle, setting?.customURL)}" target="${{
11
12
  target
12
13
  }}" title="{{article.title}}">
13
- ${Text({
14
+ ${Text({
14
15
  styles: styles,
15
16
  setting: {
16
17
  ...setting,
@@ -22,9 +23,8 @@ const ArticleTitle = ({ setting, styles, advanced, builderProps })=>{
22
23
  'data-id': builderProps?.uid
23
24
  }
24
25
  })}
25
- </a>
26
- ` : `
27
- ${Text({
26
+ </a>
27
+ `, template`${Text({
28
28
  styles: styles,
29
29
  setting: {
30
30
  ...setting,
@@ -35,8 +35,7 @@ const ArticleTitle = ({ setting, styles, advanced, builderProps })=>{
35
35
  builderAttrs: {
36
36
  'data-id': builderProps?.uid
37
37
  }
38
- })}
39
- `}
38
+ })}`)}
40
39
  `;
41
40
  };
42
41
 
@@ -506,7 +506,7 @@ const config = {
506
506
  tag: 'ArticleImage',
507
507
  label: 'Article Image',
508
508
  settings: {
509
- linkArticle: true
509
+ linkArticle: 'go-to-article'
510
510
  },
511
511
  styles: {
512
512
  position: {
@@ -770,7 +770,7 @@ const config = {
770
770
  tag: 'ArticleTitle',
771
771
  settings: {
772
772
  htmlTag: 'h1',
773
- linkArticle: true
773
+ linkArticle: 'go-to-article'
774
774
  },
775
775
  styles: {
776
776
  typo: {
@@ -16,7 +16,7 @@ const ArticleImagePresets = [
16
16
  tag: 'ArticleImage',
17
17
  settings: {
18
18
  htmlTag: 'h1',
19
- linkArticle: true
19
+ linkArticle: 'go-to-article'
20
20
  },
21
21
  styles: {
22
22
  typo: {
@@ -94,7 +94,7 @@ const config = {
94
94
  desktop: 'auto'
95
95
  },
96
96
  align: {
97
- desktop: 'center'
97
+ desktop: 'left'
98
98
  }
99
99
  },
100
100
  advanced: {
@@ -250,6 +250,19 @@ const ButtonSettings = [
250
250
  hover: true
251
251
  }
252
252
  },
253
+ {
254
+ id: 'hasBoxShadowBtn',
255
+ type: 'toggle',
256
+ label: 'Enable Button Shadow',
257
+ default: {
258
+ normal: false,
259
+ hover: false
260
+ },
261
+ state: {
262
+ normal: true,
263
+ hover: true
264
+ }
265
+ },
253
266
  {
254
267
  id: 'boxShadowBtnV2',
255
268
  type: 'shadow-v2',
@@ -386,7 +399,7 @@ const ButtonSettings = [
386
399
  default: {
387
400
  type: 'paragraph-1',
388
401
  attrs: {
389
- color: 'text-1'
402
+ color: 'text-3'
390
403
  }
391
404
  },
392
405
  ignoreReRender: true,
@@ -152,9 +152,49 @@ const SettingUIV2 = [
152
152
  id: 'boxShadowBtnV2',
153
153
  state: 'normal'
154
154
  },
155
- controlConfig: {
156
- id: 'boxShadowBtnV2',
157
- type: 'shadow-v2'
155
+ options: {
156
+ updateFields: [
157
+ {
158
+ field: 'enable',
159
+ settingId: 'hasBoxShadowBtn',
160
+ state: 'normal'
161
+ }
162
+ ]
163
+ },
164
+ controlChangeTrigger: {
165
+ settings: [
166
+ {
167
+ condition: `boxShadowBtnV2.normal.enable === true`,
168
+ source: [
169
+ 'boxShadowBtnV2',
170
+ 'hasBoxShadowBtn'
171
+ ],
172
+ action: {
173
+ controlId: 'hasBoxShadowBtn',
174
+ groupType: 'advanced',
175
+ controlType: 'advanced',
176
+ state: 'normal',
177
+ newValue: true
178
+ }
179
+ },
180
+ {
181
+ condition: `boxShadowBtnV2.normal.enable === false`,
182
+ source: [
183
+ 'boxShadowBtnV2',
184
+ 'hasBoxShadowBtn'
185
+ ],
186
+ action: {
187
+ controlId: 'hasBoxShadowBtn',
188
+ groupType: 'advanced',
189
+ controlType: 'advanced',
190
+ state: 'normal',
191
+ newValue: false
192
+ }
193
+ }
194
+ ],
195
+ options: {
196
+ noRecordHistory: true
197
+ }
158
198
  }
159
199
  }
160
200
  ]
@@ -288,39 +328,84 @@ const SettingUIV2 = [
288
328
  id: 'textColorHover',
289
329
  state: 'hover'
290
330
  }
291
- },
292
- {
293
- label: {
294
- en: 'Border'
295
- },
296
- setting: {
297
- id: 'borderBtnV2',
298
- state: 'hover'
299
- }
300
- },
301
- {
302
- label: {
303
- en: 'Corner'
304
- },
305
- setting: {
306
- id: 'roundedBtnV2',
307
- state: 'hover'
308
- }
309
- },
310
- {
311
- label: {
312
- en: 'Shadow'
331
+ }
332
+ ],
333
+ moreSettings: {
334
+ type: 'collapse',
335
+ controls: [
336
+ {
337
+ label: {
338
+ en: 'Border'
339
+ },
340
+ setting: {
341
+ id: 'borderBtnV2',
342
+ state: 'hover'
343
+ }
313
344
  },
314
- setting: {
315
- id: 'boxShadowBtnV2',
316
- state: 'hover'
345
+ {
346
+ label: {
347
+ en: 'Corner'
348
+ },
349
+ setting: {
350
+ id: 'roundedBtnV2',
351
+ state: 'hover'
352
+ }
317
353
  },
318
- controlConfig: {
319
- id: 'boxShadowBtnV2',
320
- type: 'shadow-v2'
354
+ {
355
+ label: {
356
+ en: 'Shadow'
357
+ },
358
+ setting: {
359
+ id: 'boxShadowBtnV2',
360
+ state: 'hover'
361
+ },
362
+ options: {
363
+ updateFields: [
364
+ {
365
+ field: 'enable',
366
+ settingId: 'hasBoxShadowBtn',
367
+ state: 'hover'
368
+ }
369
+ ]
370
+ },
371
+ controlChangeTrigger: {
372
+ settings: [
373
+ {
374
+ condition: `boxShadowBtnV2.hover.enable === true`,
375
+ source: [
376
+ 'boxShadowBtnV2',
377
+ 'hasBoxShadowBtn'
378
+ ],
379
+ action: {
380
+ controlId: 'hasBoxShadowBtn',
381
+ groupType: 'advanced',
382
+ controlType: 'advanced',
383
+ state: 'hover',
384
+ newValue: true
385
+ }
386
+ },
387
+ {
388
+ condition: `boxShadowBtnV2.hover.enable === false`,
389
+ source: [
390
+ 'boxShadowBtnV2',
391
+ 'hasBoxShadowBtn'
392
+ ],
393
+ action: {
394
+ controlId: 'hasBoxShadowBtn',
395
+ groupType: 'advanced',
396
+ controlType: 'advanced',
397
+ state: 'hover',
398
+ newValue: false
399
+ }
400
+ }
401
+ ],
402
+ options: {
403
+ noRecordHistory: true
404
+ }
405
+ }
321
406
  }
322
- }
323
- ]
407
+ ]
408
+ }
324
409
  },
325
410
  {
326
411
  controls: [
@@ -223,11 +223,52 @@ const SettingUIV2 = [
223
223
  label: {
224
224
  en: 'Shadow'
225
225
  },
226
- controlConfig: {
226
+ setting: {
227
227
  id: 'shadow',
228
- type: 'shadow-v2',
229
- linkWithSetting: {
230
- name: 'shadow'
228
+ state: 'normal'
229
+ },
230
+ options: {
231
+ updateFields: [
232
+ {
233
+ field: 'enable',
234
+ settingId: 'hasActiveShadow',
235
+ state: 'normal'
236
+ }
237
+ ]
238
+ },
239
+ controlChangeTrigger: {
240
+ settings: [
241
+ {
242
+ condition: `shadow.normal.enable === true`,
243
+ source: [
244
+ 'shadow',
245
+ 'hasActiveShadow'
246
+ ],
247
+ action: {
248
+ controlId: 'hasActiveShadow',
249
+ groupType: 'advanced',
250
+ controlType: 'advanced',
251
+ state: 'normal',
252
+ newValue: true
253
+ }
254
+ },
255
+ {
256
+ condition: `shadow.normal.enable === false`,
257
+ source: [
258
+ 'shadow',
259
+ 'hasActiveShadow'
260
+ ],
261
+ action: {
262
+ controlId: 'hasActiveShadow',
263
+ groupType: 'advanced',
264
+ controlType: 'advanced',
265
+ state: 'normal',
266
+ newValue: false
267
+ }
268
+ }
269
+ ],
270
+ options: {
271
+ noRecordHistory: true
231
272
  }
232
273
  }
233
274
  }