@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
@@ -8,6 +8,7 @@ var Link = require('next/link');
8
8
  var Text = require('../../text/components/Text.js');
9
9
  var core = require('@gem-sdk/core');
10
10
  var useArticleLink = require('../hooks/useArticleLink.js');
11
+ var system = require('@gem-sdk/system');
11
12
 
12
13
  const ArticleTitle = ({ setting, builderProps, styles })=>{
13
14
  const article = core.useArticleStore((s)=>s.article);
@@ -16,7 +17,7 @@ const ArticleTitle = ({ setting, builderProps, styles })=>{
16
17
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
17
18
  id: `shopify-text-element-${builderProps?.uid}`,
18
19
  "data-article-id": article?.baseID?.replace('gid://shopify/OnlineStoreArticle/', ''),
19
- children: !article ? null : setting?.enableLink && setting?.linkArticle ? /*#__PURE__*/ jsxRuntime.jsx(Link, {
20
+ children: system.If(!article ? null : setting?.enableLink, /*#__PURE__*/ jsxRuntime.jsx(Link, {
20
21
  href: shopifyArticleLink,
21
22
  target: target,
22
23
  title: article?.title,
@@ -29,7 +30,7 @@ const ArticleTitle = ({ setting, builderProps, styles })=>{
29
30
  excludeFlex: true
30
31
  }
31
32
  })
32
- }) : /*#__PURE__*/ jsxRuntime.jsx(Text.default, {
33
+ }), /*#__PURE__*/ jsxRuntime.jsx(Text.default, {
33
34
  builderProps: builderProps,
34
35
  styles: styles,
35
36
  setting: {
@@ -37,7 +38,7 @@ const ArticleTitle = ({ setting, builderProps, styles })=>{
37
38
  text: article.title,
38
39
  excludeFlex: true
39
40
  }
40
- })
41
+ }))
41
42
  });
42
43
  };
43
44
 
@@ -6,15 +6,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
6
6
  var core = require('@gem-sdk/core');
7
7
  var Text_liquid = require('../../text/components/Text.liquid.js');
8
8
  var helpers = require('../../helpers.js');
9
+ var system = require('@gem-sdk/system');
9
10
 
10
11
  const ArticleTitle = ({ setting, styles, advanced, builderProps })=>{
11
12
  const target = setting?.openNewTab ? '_blank' : '_self';
12
13
  return core.template`
13
- ${setting?.enableLink && setting?.linkArticle ? `
14
- <a href="${helpers.getLinkArticle(setting.linkArticle, setting.customURL)}" target="${{
14
+ ${system.If(setting?.enableLink, core.template`
15
+ <a href="${helpers.getLinkArticle(setting?.linkArticle, setting?.customURL)}" target="${{
15
16
  target
16
17
  }}" title="{{article.title}}">
17
- ${Text_liquid.default({
18
+ ${Text_liquid.default({
18
19
  styles: styles,
19
20
  setting: {
20
21
  ...setting,
@@ -26,9 +27,8 @@ const ArticleTitle = ({ setting, styles, advanced, builderProps })=>{
26
27
  'data-id': builderProps?.uid
27
28
  }
28
29
  })}
29
- </a>
30
- ` : `
31
- ${Text_liquid.default({
30
+ </a>
31
+ `, core.template`${Text_liquid.default({
32
32
  styles: styles,
33
33
  setting: {
34
34
  ...setting,
@@ -39,8 +39,7 @@ const ArticleTitle = ({ setting, styles, advanced, builderProps })=>{
39
39
  builderAttrs: {
40
40
  'data-id': builderProps?.uid
41
41
  }
42
- })}
43
- `}
42
+ })}`)}
44
43
  `;
45
44
  };
46
45
 
@@ -510,7 +510,7 @@ const config = {
510
510
  tag: 'ArticleImage',
511
511
  label: 'Article Image',
512
512
  settings: {
513
- linkArticle: true
513
+ linkArticle: 'go-to-article'
514
514
  },
515
515
  styles: {
516
516
  position: {
@@ -774,7 +774,7 @@ const config = {
774
774
  tag: 'ArticleTitle',
775
775
  settings: {
776
776
  htmlTag: 'h1',
777
- linkArticle: true
777
+ linkArticle: 'go-to-article'
778
778
  },
779
779
  styles: {
780
780
  typo: {
@@ -18,7 +18,7 @@ const ArticleImagePresets = [
18
18
  tag: 'ArticleImage',
19
19
  settings: {
20
20
  htmlTag: 'h1',
21
- linkArticle: true
21
+ linkArticle: 'go-to-article'
22
22
  },
23
23
  styles: {
24
24
  typo: {
@@ -98,7 +98,7 @@ const config = {
98
98
  desktop: 'auto'
99
99
  },
100
100
  align: {
101
- desktop: 'center'
101
+ desktop: 'left'
102
102
  }
103
103
  },
104
104
  advanced: {
@@ -252,6 +252,19 @@ const ButtonSettings = [
252
252
  hover: true
253
253
  }
254
254
  },
255
+ {
256
+ id: 'hasBoxShadowBtn',
257
+ type: 'toggle',
258
+ label: 'Enable Button Shadow',
259
+ default: {
260
+ normal: false,
261
+ hover: false
262
+ },
263
+ state: {
264
+ normal: true,
265
+ hover: true
266
+ }
267
+ },
255
268
  {
256
269
  id: 'boxShadowBtnV2',
257
270
  type: 'shadow-v2',
@@ -388,7 +401,7 @@ const ButtonSettings = [
388
401
  default: {
389
402
  type: 'paragraph-1',
390
403
  attrs: {
391
- color: 'text-1'
404
+ color: 'text-3'
392
405
  }
393
406
  },
394
407
  ignoreReRender: true,
@@ -154,9 +154,49 @@ const SettingUIV2 = [
154
154
  id: 'boxShadowBtnV2',
155
155
  state: 'normal'
156
156
  },
157
- controlConfig: {
158
- id: 'boxShadowBtnV2',
159
- type: 'shadow-v2'
157
+ options: {
158
+ updateFields: [
159
+ {
160
+ field: 'enable',
161
+ settingId: 'hasBoxShadowBtn',
162
+ state: 'normal'
163
+ }
164
+ ]
165
+ },
166
+ controlChangeTrigger: {
167
+ settings: [
168
+ {
169
+ condition: `boxShadowBtnV2.normal.enable === true`,
170
+ source: [
171
+ 'boxShadowBtnV2',
172
+ 'hasBoxShadowBtn'
173
+ ],
174
+ action: {
175
+ controlId: 'hasBoxShadowBtn',
176
+ groupType: 'advanced',
177
+ controlType: 'advanced',
178
+ state: 'normal',
179
+ newValue: true
180
+ }
181
+ },
182
+ {
183
+ condition: `boxShadowBtnV2.normal.enable === false`,
184
+ source: [
185
+ 'boxShadowBtnV2',
186
+ 'hasBoxShadowBtn'
187
+ ],
188
+ action: {
189
+ controlId: 'hasBoxShadowBtn',
190
+ groupType: 'advanced',
191
+ controlType: 'advanced',
192
+ state: 'normal',
193
+ newValue: false
194
+ }
195
+ }
196
+ ],
197
+ options: {
198
+ noRecordHistory: true
199
+ }
160
200
  }
161
201
  }
162
202
  ]
@@ -290,39 +330,84 @@ const SettingUIV2 = [
290
330
  id: 'textColorHover',
291
331
  state: 'hover'
292
332
  }
293
- },
294
- {
295
- label: {
296
- en: 'Border'
297
- },
298
- setting: {
299
- id: 'borderBtnV2',
300
- state: 'hover'
301
- }
302
- },
303
- {
304
- label: {
305
- en: 'Corner'
306
- },
307
- setting: {
308
- id: 'roundedBtnV2',
309
- state: 'hover'
310
- }
311
- },
312
- {
313
- label: {
314
- en: 'Shadow'
333
+ }
334
+ ],
335
+ moreSettings: {
336
+ type: 'collapse',
337
+ controls: [
338
+ {
339
+ label: {
340
+ en: 'Border'
341
+ },
342
+ setting: {
343
+ id: 'borderBtnV2',
344
+ state: 'hover'
345
+ }
315
346
  },
316
- setting: {
317
- id: 'boxShadowBtnV2',
318
- state: 'hover'
347
+ {
348
+ label: {
349
+ en: 'Corner'
350
+ },
351
+ setting: {
352
+ id: 'roundedBtnV2',
353
+ state: 'hover'
354
+ }
319
355
  },
320
- controlConfig: {
321
- id: 'boxShadowBtnV2',
322
- type: 'shadow-v2'
356
+ {
357
+ label: {
358
+ en: 'Shadow'
359
+ },
360
+ setting: {
361
+ id: 'boxShadowBtnV2',
362
+ state: 'hover'
363
+ },
364
+ options: {
365
+ updateFields: [
366
+ {
367
+ field: 'enable',
368
+ settingId: 'hasBoxShadowBtn',
369
+ state: 'hover'
370
+ }
371
+ ]
372
+ },
373
+ controlChangeTrigger: {
374
+ settings: [
375
+ {
376
+ condition: `boxShadowBtnV2.hover.enable === true`,
377
+ source: [
378
+ 'boxShadowBtnV2',
379
+ 'hasBoxShadowBtn'
380
+ ],
381
+ action: {
382
+ controlId: 'hasBoxShadowBtn',
383
+ groupType: 'advanced',
384
+ controlType: 'advanced',
385
+ state: 'hover',
386
+ newValue: true
387
+ }
388
+ },
389
+ {
390
+ condition: `boxShadowBtnV2.hover.enable === false`,
391
+ source: [
392
+ 'boxShadowBtnV2',
393
+ 'hasBoxShadowBtn'
394
+ ],
395
+ action: {
396
+ controlId: 'hasBoxShadowBtn',
397
+ groupType: 'advanced',
398
+ controlType: 'advanced',
399
+ state: 'hover',
400
+ newValue: false
401
+ }
402
+ }
403
+ ],
404
+ options: {
405
+ noRecordHistory: true
406
+ }
407
+ }
323
408
  }
324
- }
325
- ]
409
+ ]
410
+ }
326
411
  },
327
412
  {
328
413
  controls: [
@@ -225,11 +225,52 @@ const SettingUIV2 = [
225
225
  label: {
226
226
  en: 'Shadow'
227
227
  },
228
- controlConfig: {
228
+ setting: {
229
229
  id: 'shadow',
230
- type: 'shadow-v2',
231
- linkWithSetting: {
232
- name: 'shadow'
230
+ state: 'normal'
231
+ },
232
+ options: {
233
+ updateFields: [
234
+ {
235
+ field: 'enable',
236
+ settingId: 'hasActiveShadow',
237
+ state: 'normal'
238
+ }
239
+ ]
240
+ },
241
+ controlChangeTrigger: {
242
+ settings: [
243
+ {
244
+ condition: `shadow.normal.enable === true`,
245
+ source: [
246
+ 'shadow',
247
+ 'hasActiveShadow'
248
+ ],
249
+ action: {
250
+ controlId: 'hasActiveShadow',
251
+ groupType: 'advanced',
252
+ controlType: 'advanced',
253
+ state: 'normal',
254
+ newValue: true
255
+ }
256
+ },
257
+ {
258
+ condition: `shadow.normal.enable === false`,
259
+ source: [
260
+ 'shadow',
261
+ 'hasActiveShadow'
262
+ ],
263
+ action: {
264
+ controlId: 'hasActiveShadow',
265
+ groupType: 'advanced',
266
+ controlType: 'advanced',
267
+ state: 'normal',
268
+ newValue: false
269
+ }
270
+ }
271
+ ],
272
+ options: {
273
+ noRecordHistory: true
233
274
  }
234
275
  }
235
276
  }
@@ -359,6 +359,50 @@ const SettingUIV2 = [
359
359
  setting: {
360
360
  id: 'boxShadow',
361
361
  state: 'normal'
362
+ },
363
+ options: {
364
+ updateFields: [
365
+ {
366
+ field: 'enable',
367
+ settingId: 'hasBoxShadow',
368
+ state: 'normal'
369
+ }
370
+ ]
371
+ },
372
+ controlChangeTrigger: {
373
+ settings: [
374
+ {
375
+ condition: `boxShadow.normal.enable === true`,
376
+ source: [
377
+ 'boxShadow',
378
+ 'hasBoxShadow'
379
+ ],
380
+ action: {
381
+ controlId: 'hasBoxShadow',
382
+ groupType: 'advanced',
383
+ controlType: 'advanced',
384
+ state: 'normal',
385
+ newValue: true
386
+ }
387
+ },
388
+ {
389
+ condition: `boxShadow.normal.enable === false`,
390
+ source: [
391
+ 'boxShadow',
392
+ 'hasBoxShadow'
393
+ ],
394
+ action: {
395
+ controlId: 'hasBoxShadow',
396
+ groupType: 'advanced',
397
+ controlType: 'advanced',
398
+ state: 'normal',
399
+ newValue: false
400
+ }
401
+ }
402
+ ],
403
+ options: {
404
+ noRecordHistory: true
405
+ }
362
406
  }
363
407
  }
364
408
  ]
@@ -24,7 +24,7 @@ const DynamicCheckoutSettings = [
24
24
  default: {
25
25
  type: 'paragraph-1',
26
26
  attrs: {
27
- color: 'text-1'
27
+ color: 'text-3'
28
28
  }
29
29
  },
30
30
  hiddenSetting: {
@@ -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
  ]
@@ -305,39 +345,84 @@ const SettingUIV2 = [
305
345
  id: 'textColorHover',
306
346
  state: 'hover'
307
347
  }
308
- },
309
- {
310
- label: {
311
- en: 'Border'
312
- },
313
- setting: {
314
- id: 'borderBtnV2',
315
- state: 'hover'
316
- }
317
- },
318
- {
319
- label: {
320
- en: 'Corner'
321
- },
322
- setting: {
323
- id: 'roundedBtnV2',
324
- state: 'hover'
325
- }
326
- },
327
- {
328
- label: {
329
- en: 'Shadow'
348
+ }
349
+ ],
350
+ moreSettings: {
351
+ type: 'collapse',
352
+ controls: [
353
+ {
354
+ label: {
355
+ en: 'Border'
356
+ },
357
+ setting: {
358
+ id: 'borderBtnV2',
359
+ state: 'hover'
360
+ }
330
361
  },
331
- setting: {
332
- id: 'boxShadowBtnV2',
333
- state: 'hover'
362
+ {
363
+ label: {
364
+ en: 'Corner'
365
+ },
366
+ setting: {
367
+ id: 'roundedBtnV2',
368
+ state: 'hover'
369
+ }
334
370
  },
335
- controlConfig: {
336
- id: 'boxShadowBtnV2',
337
- type: 'shadow-v2'
371
+ {
372
+ label: {
373
+ en: 'Shadow'
374
+ },
375
+ setting: {
376
+ id: 'boxShadowBtnV2',
377
+ state: 'hover'
378
+ },
379
+ options: {
380
+ updateFields: [
381
+ {
382
+ field: 'enable',
383
+ settingId: 'hasBoxShadowBtn',
384
+ state: 'hover'
385
+ }
386
+ ]
387
+ },
388
+ controlChangeTrigger: {
389
+ settings: [
390
+ {
391
+ condition: `boxShadowBtnV2.hover.enable === true`,
392
+ source: [
393
+ 'boxShadowBtnV2',
394
+ 'hasBoxShadowBtn'
395
+ ],
396
+ action: {
397
+ controlId: 'hasBoxShadowBtn',
398
+ groupType: 'advanced',
399
+ controlType: 'advanced',
400
+ state: 'hover',
401
+ newValue: true
402
+ }
403
+ },
404
+ {
405
+ condition: `boxShadowBtnV2.hover.enable === false`,
406
+ source: [
407
+ 'boxShadowBtnV2',
408
+ 'hasBoxShadowBtn'
409
+ ],
410
+ action: {
411
+ controlId: 'hasBoxShadowBtn',
412
+ groupType: 'advanced',
413
+ controlType: 'advanced',
414
+ state: 'hover',
415
+ newValue: false
416
+ }
417
+ }
418
+ ],
419
+ options: {
420
+ noRecordHistory: true
421
+ }
422
+ }
338
423
  }
339
- }
340
- ]
424
+ ]
425
+ }
341
426
  },
342
427
  // {
343
428
  // label: {