@gem-sdk/components 2.0.0-dev.353 → 2.0.0-dev.356

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 (110) hide show
  1. package/dist/cjs/article/components/ArticleAuthor.liquid.js +27 -0
  2. package/dist/cjs/article/components/ArticleCategory.liquid.js +27 -0
  3. package/dist/cjs/article/components/ArticleContent.liquid.js +42 -0
  4. package/dist/cjs/article/components/ArticleDate.liquid.js +35 -0
  5. package/dist/cjs/article/components/ArticleExcerpt.liquid.js +26 -0
  6. package/dist/cjs/article/components/ArticleImage.liquid.js +67 -0
  7. package/dist/cjs/article/components/ArticlePagination.liquid.js +17 -0
  8. package/dist/cjs/article/components/ArticleReadMore.liquid.js +58 -0
  9. package/dist/cjs/article/components/ArticleTag.liquid.js +27 -0
  10. package/dist/cjs/article/components/ArticleTitle.liquid.js +46 -0
  11. package/dist/cjs/builder.js +1 -1
  12. package/dist/cjs/button/components/Button.js +5 -3
  13. package/dist/cjs/button/components/Button.liquid.js +7 -3
  14. package/dist/cjs/button/components/common/attributes.js +1 -2
  15. package/dist/cjs/button/components/common/helpers.js +2 -2
  16. package/dist/cjs/button/components/common/styles.js +29 -1
  17. package/dist/cjs/button/setting/configs/settings.js +24 -4
  18. package/dist/cjs/button/setting/configs/uiV2.js +46 -8
  19. package/dist/cjs/form/setting/newsletter/configs/settings.js +2 -2
  20. package/dist/cjs/form/setting/newsletter/configs/uiV2.js +0 -44
  21. package/dist/cjs/image/setting/configs/uiV2.js +5 -1
  22. package/dist/cjs/index.js +1 -1
  23. package/dist/cjs/index.liquid.js +20 -0
  24. package/dist/cjs/post-purchase/callout-banner/setting/config/callout-text/setting.js +4 -3
  25. package/dist/cjs/post-purchase/image/common/getClasses.js +1 -4
  26. package/dist/cjs/post-purchase/product/common/getClasses.js +4 -5
  27. package/dist/cjs/post-purchase/product/components/product-image/carousel-post-purchase/CarouselPostPurchase.js +3 -2
  28. package/dist/cjs/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +2 -1
  29. package/dist/cjs/post-purchase/product/components/product-offer/common/attrs.js +14 -0
  30. package/dist/cjs/post-purchase/product/components/product-offer/common/classes.js +29 -0
  31. package/dist/cjs/post-purchase/product/components/product-offer/common/styles.js +27 -0
  32. package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOffer.js +53 -0
  33. package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOfferItem.js +45 -0
  34. package/dist/cjs/post-purchase/product/components/product-offer/hooks/useProductOfferData.js +57 -0
  35. package/dist/cjs/post-purchase/product/hooks/product-image/useListCarousel.js +6 -2
  36. package/dist/cjs/post-purchase/product/index.js +2 -2
  37. package/dist/cjs/post-purchase/product/next.js +1 -1
  38. package/dist/cjs/post-purchase/product/settings/product-image/setting-v2.js +5 -5
  39. package/dist/cjs/post-purchase/product/settings/product-image/uiV2.js +2 -1
  40. package/dist/cjs/post-purchase/product/settings/{ProductOffer.js → product-offer/index.js} +23 -143
  41. package/dist/cjs/post-purchase/product/settings/product-offer/ui/uiV1.js +140 -0
  42. package/dist/cjs/post-purchase/product/settings/product-offer/ui/uiV2.js +141 -0
  43. package/dist/cjs/post-purchase/utils/constants.js +6 -0
  44. package/dist/cjs/product/components/ProductViewMore/ProductViewMore.js +17 -18
  45. package/dist/cjs/product/components/ProductViewMore/ProductViewMore.liquid.js +14 -21
  46. package/dist/cjs/product/components/ProductViewMore/common/data.js +26 -0
  47. package/dist/cjs/product/components/ProductViewMore/common/styles.js +12 -0
  48. package/dist/cjs/product/setting/dynamic-checkout/configs/settings.js +9 -5
  49. package/dist/cjs/product/setting/dynamic-checkout/configs/uiV2.js +10 -10
  50. package/dist/cjs/product/setting/product-button/configs/settings.js +1 -0
  51. package/dist/cjs/product/setting/product-button/configs/uiV2.js +1 -1
  52. package/dist/cjs/product/setting/product-view-more/configs/settings.js +17 -16
  53. package/dist/cjs/product/setting/product-view-more/configs/uiV2.js +45 -45
  54. package/dist/esm/article/components/ArticleAuthor.liquid.js +23 -0
  55. package/dist/esm/article/components/ArticleCategory.liquid.js +23 -0
  56. package/dist/esm/article/components/ArticleContent.liquid.js +38 -0
  57. package/dist/esm/article/components/ArticleDate.liquid.js +31 -0
  58. package/dist/esm/article/components/ArticleExcerpt.liquid.js +22 -0
  59. package/dist/esm/article/components/ArticleImage.liquid.js +63 -0
  60. package/dist/esm/article/components/ArticlePagination.liquid.js +13 -0
  61. package/dist/esm/article/components/ArticleReadMore.liquid.js +54 -0
  62. package/dist/esm/article/components/ArticleTag.liquid.js +23 -0
  63. package/dist/esm/article/components/ArticleTitle.liquid.js +42 -0
  64. package/dist/esm/builder.js +1 -1
  65. package/dist/esm/button/components/Button.js +5 -3
  66. package/dist/esm/button/components/Button.liquid.js +7 -3
  67. package/dist/esm/button/components/common/attributes.js +1 -2
  68. package/dist/esm/button/components/common/helpers.js +2 -2
  69. package/dist/esm/button/components/common/styles.js +29 -3
  70. package/dist/esm/button/setting/configs/settings.js +24 -4
  71. package/dist/esm/button/setting/configs/uiV2.js +46 -8
  72. package/dist/esm/form/setting/newsletter/configs/settings.js +2 -2
  73. package/dist/esm/form/setting/newsletter/configs/uiV2.js +0 -44
  74. package/dist/esm/image/setting/configs/uiV2.js +5 -1
  75. package/dist/esm/index.js +1 -1
  76. package/dist/esm/index.liquid.js +10 -0
  77. package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/setting.js +4 -3
  78. package/dist/esm/post-purchase/image/common/getClasses.js +1 -4
  79. package/dist/esm/post-purchase/product/common/getClasses.js +4 -5
  80. package/dist/esm/post-purchase/product/components/product-image/carousel-post-purchase/CarouselPostPurchase.js +3 -2
  81. package/dist/esm/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +2 -1
  82. package/dist/esm/post-purchase/product/components/product-offer/common/attrs.js +12 -0
  83. package/dist/esm/post-purchase/product/components/product-offer/common/classes.js +25 -0
  84. package/dist/esm/post-purchase/product/components/product-offer/common/styles.js +24 -0
  85. package/dist/esm/post-purchase/product/components/product-offer/components/ProductOffer.js +49 -0
  86. package/dist/esm/post-purchase/product/components/product-offer/components/ProductOfferItem.js +43 -0
  87. package/dist/esm/post-purchase/product/components/product-offer/hooks/useProductOfferData.js +55 -0
  88. package/dist/esm/post-purchase/product/hooks/product-image/useListCarousel.js +6 -2
  89. package/dist/esm/post-purchase/product/index.js +1 -1
  90. package/dist/esm/post-purchase/product/next.js +1 -1
  91. package/dist/esm/post-purchase/product/settings/product-image/setting-v2.js +5 -5
  92. package/dist/esm/post-purchase/product/settings/product-image/uiV2.js +2 -1
  93. package/dist/esm/post-purchase/product/settings/{ProductOffer.js → product-offer/index.js} +23 -143
  94. package/dist/esm/post-purchase/product/settings/product-offer/ui/uiV1.js +138 -0
  95. package/dist/esm/post-purchase/product/settings/product-offer/ui/uiV2.js +139 -0
  96. package/dist/esm/post-purchase/utils/constants.js +6 -1
  97. package/dist/esm/product/components/ProductViewMore/ProductViewMore.js +17 -18
  98. package/dist/esm/product/components/ProductViewMore/ProductViewMore.liquid.js +14 -21
  99. package/dist/esm/product/components/ProductViewMore/common/data.js +23 -0
  100. package/dist/esm/product/components/ProductViewMore/common/styles.js +10 -0
  101. package/dist/esm/product/setting/dynamic-checkout/configs/settings.js +9 -5
  102. package/dist/esm/product/setting/dynamic-checkout/configs/uiV2.js +10 -10
  103. package/dist/esm/product/setting/product-button/configs/settings.js +1 -0
  104. package/dist/esm/product/setting/product-button/configs/uiV2.js +1 -1
  105. package/dist/esm/product/setting/product-view-more/configs/settings.js +17 -16
  106. package/dist/esm/product/setting/product-view-more/configs/uiV2.js +45 -45
  107. package/dist/types/index.d.ts +82 -18
  108. package/package.json +2 -2
  109. package/dist/cjs/post-purchase/product/components/ProductOffer.js +0 -138
  110. package/dist/esm/post-purchase/product/components/ProductOffer.js +0 -133
@@ -24,7 +24,7 @@ const DynamicCheckoutSettings = [
24
24
  default: {
25
25
  type: 'paragraph-1',
26
26
  attrs: {
27
- color: 'text-3'
27
+ color: 'text-1'
28
28
  }
29
29
  },
30
30
  hiddenSetting: {
@@ -358,7 +358,7 @@ const DynamicCheckoutSettings = [
358
358
  ],
359
359
  devices: {
360
360
  desktop: {
361
- default: 'center'
361
+ default: 'left'
362
362
  }
363
363
  }
364
364
  },
@@ -410,12 +410,16 @@ const DynamicCheckoutSettings = [
410
410
  type: 'color-picker-v2',
411
411
  devices: {
412
412
  desktop: {
413
- default: {}
413
+ default: {
414
+ hover: 'text-3'
415
+ }
414
416
  }
415
417
  },
416
418
  compoDefaultValue: {
417
419
  desktop: {
418
- default: {}
420
+ default: {
421
+ hover: 'text-3'
422
+ }
419
423
  }
420
424
  },
421
425
  enableGradient: true
@@ -426,7 +430,7 @@ const DynamicCheckoutSettings = [
426
430
  devices: {
427
431
  desktop: {
428
432
  default: {
429
- width: 'Auto',
433
+ width: '100%',
430
434
  height: 'Auto',
431
435
  padding: {
432
436
  type: 'medium',
@@ -288,15 +288,15 @@ const SettingUIV2 = [
288
288
  state: 'hover'
289
289
  }
290
290
  },
291
- // {
292
- // label: {
293
- // en: 'BG image',
294
- // },
295
- // setting: {
296
- // id: 'backgroundImage',
297
- // state: 'hover',
298
- // },
299
- // },
291
+ {
292
+ label: {
293
+ en: 'Image'
294
+ },
295
+ setting: {
296
+ id: 'backgroundImage',
297
+ state: 'hover'
298
+ }
299
+ },
300
300
  {
301
301
  label: {
302
302
  en: 'Text color'
@@ -366,7 +366,7 @@ const SettingUIV2 = [
366
366
  options: {
367
367
  labelVariant: 'primary',
368
368
  fullWidth: true,
369
- disableMessage: `Align is not supported when width is 100%`
369
+ disableMessage: `Horizontal alignment is disabled when the width is set to 100% or greater`
370
370
  }
371
371
  }
372
372
  ]
@@ -160,6 +160,7 @@ const ProductButtonSettings = [
160
160
  link: '/cart',
161
161
  target: '_self'
162
162
  },
163
+ isHiddenOpenLinkSelect: true,
163
164
  hide: true
164
165
  },
165
166
  {
@@ -550,7 +550,7 @@ const SettingUIV2 = [
550
550
  options: {
551
551
  labelVariant: 'primary',
552
552
  fullWidth: true,
553
- disableMessage: `Align is not supported when width is 100%`
553
+ disableMessage: `Horizontal alignment is disabled when the width is set to 100% or greater`
554
554
  }
555
555
  }
556
556
  ]
@@ -55,19 +55,9 @@ const ProductViewMoreSettings = [
55
55
  default: false
56
56
  },
57
57
  {
58
- id: 'target',
59
- type: 'option:value',
60
- options: [
61
- {
62
- label: 'Current',
63
- value: 'current'
64
- },
65
- {
66
- label: 'New Tab',
67
- value: 'new-tab'
68
- }
69
- ],
70
- default: 'current'
58
+ id: 'redirectNewTab',
59
+ type: 'toggle',
60
+ default: false
71
61
  }
72
62
  ]
73
63
  },
@@ -385,16 +375,25 @@ const ProductViewMoreSettings = [
385
375
  ],
386
376
  devices: {
387
377
  desktop: {
388
- default: 'center'
378
+ default: 'left'
389
379
  }
390
380
  }
391
381
  },
382
+ {
383
+ id: 'enableTextStyle',
384
+ label: '',
385
+ type: 'toggle',
386
+ default: true
387
+ },
392
388
  {
393
389
  id: 'typo',
394
390
  type: 'typography-v2',
395
391
  label: 'Typography',
396
392
  default: {
397
- type: 'paragraph-1'
393
+ type: 'paragraph-1',
394
+ attrs: {
395
+ color: 'text-1'
396
+ }
398
397
  },
399
398
  hiddenSetting: {
400
399
  textAlign: true
@@ -512,10 +511,12 @@ const ProductViewMoreSettings = [
512
511
  },
513
512
  {
514
513
  id: 'iconSpacing',
515
- type: 'input:unit',
514
+ type: 'input:slider',
516
515
  units: [
517
516
  'px'
518
517
  ],
518
+ step: 1,
519
+ max: 40,
519
520
  devices: {
520
521
  desktop: {
521
522
  default: '8px'
@@ -190,28 +190,27 @@ const SettingUIV2 = [
190
190
  ]
191
191
  },
192
192
  {
193
- label: {
194
- en: 'Icon'
195
- },
196
193
  controls: [
197
194
  {
195
+ label: {
196
+ en: 'Icon'
197
+ },
198
198
  setting: {
199
199
  id: 'iconVisible'
200
+ },
201
+ options: {
202
+ labelVariant: 'primary',
203
+ toggleStyle: 'switch'
200
204
  }
201
- }
202
- ]
203
- },
204
- {
205
- conditionDisplay: 'iconVisible == true',
206
- controls: [
205
+ },
207
206
  {
208
- type: 'control',
209
207
  label: {
210
- en: 'Choose icon'
208
+ en: 'Icon'
211
209
  },
212
210
  setting: {
213
211
  id: 'iconSvg'
214
- }
212
+ },
213
+ conditionDisplay: 'iconVisible == true'
215
214
  },
216
215
  {
217
216
  type: 'control',
@@ -220,24 +219,35 @@ const SettingUIV2 = [
220
219
  },
221
220
  setting: {
222
221
  id: 'iconAlign'
223
- }
222
+ },
223
+ conditionDisplay: 'iconVisible == true'
224
224
  },
225
225
  {
226
226
  type: 'control',
227
227
  label: {
228
- en: 'Spacing'
228
+ en: 'Text & icon gap'
229
229
  },
230
230
  setting: {
231
231
  id: 'iconSpacing'
232
- }
232
+ },
233
+ conditionDisplay: 'iconVisible == true'
233
234
  }
234
235
  ]
235
236
  },
236
237
  {
237
- label: {
238
- en: 'Text style'
239
- },
240
238
  controls: [
239
+ {
240
+ label: {
241
+ en: 'Text'
242
+ },
243
+ setting: {
244
+ id: 'enableTextStyle'
245
+ },
246
+ options: {
247
+ labelVariant: 'primary',
248
+ toggleStyle: 'switch'
249
+ }
250
+ },
241
251
  {
242
252
  id: 'typo',
243
253
  label: {
@@ -246,6 +256,7 @@ const SettingUIV2 = [
246
256
  setting: {
247
257
  id: 'typo'
248
258
  },
259
+ conditionDisplay: 'enableTextStyle == true',
249
260
  options: {
250
261
  hideLabel: true,
251
262
  fullWidth: true,
@@ -283,22 +294,22 @@ const SettingUIV2 = [
283
294
  controls: [
284
295
  {
285
296
  label: {
286
- en: 'Background'
297
+ en: 'Color'
287
298
  },
288
299
  setting: {
289
300
  id: 'backgroundColorV2',
290
301
  state: 'hover'
291
302
  }
292
303
  },
293
- // {
294
- // label: {
295
- // en: 'BG image',
296
- // },
297
- // setting: {
298
- // id: 'backgroundImage',
299
- // state: 'hover',
300
- // },
301
- // },
304
+ {
305
+ label: {
306
+ en: 'Image'
307
+ },
308
+ setting: {
309
+ id: 'backgroundImage',
310
+ state: 'hover'
311
+ }
312
+ },
302
313
  {
303
314
  label: {
304
315
  en: 'Text color'
@@ -341,28 +352,17 @@ const SettingUIV2 = [
341
352
  }
342
353
  ]
343
354
  },
344
- // {
345
- // label: {
346
- // en: 'Link',
347
- // },
348
- // controls: [
349
- // {
350
- // type: 'control',
351
- // layout: 'vertical',
352
- // setting: {
353
- // id: 'btnLink',
354
- // },
355
- // },
356
- // ],
357
- // },
358
355
  {
359
356
  label: {
360
- en: 'Open in'
357
+ en: 'Redirect to'
361
358
  },
362
359
  controls: [
363
360
  {
361
+ label: {
362
+ en: 'New tab'
363
+ },
364
364
  setting: {
365
- id: 'target'
365
+ id: 'redirectNewTab'
366
366
  }
367
367
  }
368
368
  ]
@@ -380,7 +380,7 @@ const SettingUIV2 = [
380
380
  options: {
381
381
  labelVariant: 'primary',
382
382
  fullWidth: true,
383
- disableMessage: `Align is not supported when width is 100%`
383
+ disableMessage: `Horizontal alignment is disabled when the width is set to 100% or greater`
384
384
  }
385
385
  }
386
386
  ]
@@ -0,0 +1,23 @@
1
+ 'use client';
2
+ import { template } from '@gem-sdk/core';
3
+ import Text from '../../text/components/Text.liquid.js';
4
+
5
+ const ArticleAuthor = ({ setting, styles, advanced, builderProps })=>{
6
+ const { prefix } = setting ?? {};
7
+ return template`
8
+ ${Text({
9
+ styles: styles,
10
+ setting: {
11
+ ...setting,
12
+ text: `${prefix} {{ article.author }}`,
13
+ excludeFlex: true
14
+ },
15
+ advanced: advanced,
16
+ builderAttrs: {
17
+ 'data-id': builderProps?.uid
18
+ }
19
+ })}
20
+ `;
21
+ };
22
+
23
+ export { ArticleAuthor as default };
@@ -0,0 +1,23 @@
1
+ 'use client';
2
+ import { template } from '@gem-sdk/core';
3
+ import Text from '../../text/components/Text.liquid.js';
4
+
5
+ const ArticleCategory = ({ setting, styles, advanced, builderProps })=>{
6
+ return template`
7
+
8
+ ${Text({
9
+ styles: styles,
10
+ setting: {
11
+ ...setting,
12
+ text: '{{blogTitle}}',
13
+ excludeFlex: true
14
+ },
15
+ advanced: advanced,
16
+ builderAttrs: {
17
+ 'data-id': builderProps?.uid
18
+ }
19
+ })}
20
+ `;
21
+ };
22
+
23
+ export { ArticleCategory as default };
@@ -0,0 +1,38 @@
1
+ 'use client';
2
+ import { composeTypographyClassName, composeTypographyStyle, makeStyleResponsive, getGlobalColorStateStyle, makeStyle, makeLineClamp, template, cls, getGlobalColorStateClass, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
3
+ import { getSettingPreloadData } from '../../helpers.js';
4
+
5
+ const ArticleContent = ({ styles, builderProps })=>{
6
+ const appendTypoClass = composeTypographyClassName(styles?.typo, styles?.typography);
7
+ const appendTypoStyle = composeTypographyStyle(styles?.typo, styles?.typography);
8
+ const defaultStyle = {
9
+ ...makeStyleResponsive('ta', styles?.textAlign),
10
+ ...getGlobalColorStateStyle('c', styles?.color),
11
+ ...makeStyle({
12
+ tt: styles?.transform
13
+ }),
14
+ ...appendTypoStyle
15
+ };
16
+ const collapseStyle = {
17
+ ...defaultStyle,
18
+ ...makeStyleResponsive('line-clamp', makeLineClamp(styles?.lineClamp, styles?.hasLineClamp))
19
+ };
20
+ return template`
21
+ <gp-article-content data-id="${builderProps?.uid}" >
22
+ <div
23
+ class="${cls('gp-relative gp-p-description-text gp-break-words safari:[&_p]:gp-inline safari:[&_p]:after:gp-whitespace-pre', appendTypoClass, getGlobalColorStateClass('text', styles?.color), "data-[browser=safari]:after:gp-content-[' '] data-[browser=safari]:after:gp-absolute data-[browser=safari]:after:gp-left-0 data-[browser=safari]:after:gp-right-0 data-[browser=safari]:after:gp-bottom-0 data-[browser=safari]:after:gp-w-full data-[browser=safari]:after:gp-h-1/2 data-[browser=safari]:after:gp-bg-gradient-to-t data-[browser=safari]:after:gp-from-white")}"
24
+ style="${collapseStyle}"
25
+ >
26
+ {{article.content}}
27
+ </div>
28
+ {% style %}
29
+ .gp-p-description-text * {
30
+ color: inherit
31
+ }
32
+ {% endstyle %}
33
+ </gp-article-content>
34
+ ${RenderIf(isLocalEnv, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-article-content.js' | asset_url }}" defer="defer"></script>`, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="${baseAssetURL}/assets-v2/gp-article-content.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
35
+ `;
36
+ };
37
+
38
+ export { ArticleContent as default };
@@ -0,0 +1,31 @@
1
+ 'use client';
2
+ import { template } from '@gem-sdk/core';
3
+ import Text from '../../text/components/Text.liquid.js';
4
+
5
+ const FORMAT_MAP = {
6
+ '{"locales":"en-US","options":{"month":"short","day":"2-digit","year":"numeric"}}': '%b %d, %Y',
7
+ '{"locales":"en-US","options":{"month":"long","day":"2-digit","year":"numeric"}}': '%B %d, %Y',
8
+ '{"locales":"en-GB","options":{"month":"long","day":"2-digit","year":"numeric"}}': '%d %B %Y',
9
+ '{"locales":"en-GB","options":{"month":"2-digit","day":"2-digit","year":"numeric"}}': '%d/%m/%Y',
10
+ '{"locales":"en-US","options":{"month":"2-digit","day":"2-digit","year":"numeric"}}': '%m/%d/%Y',
11
+ '{"locales":"ja-JP","options":{"month":"2-digit","day":"2-digit","year":"numeric"}}': '%Y/%m/%d'
12
+ };
13
+ const ArticleDate = ({ setting, styles, advanced, builderProps })=>{
14
+ const { dateFormat } = setting ?? {};
15
+ return template`
16
+ ${Text({
17
+ styles: styles,
18
+ setting: {
19
+ ...setting,
20
+ text: `{{ article.published_at | date: '${FORMAT_MAP[dateFormat ?? '{"locales":"en-US","options":{"month":"short","day":"2-digit","year":"numeric"}}']}' }}`,
21
+ excludeFlex: true
22
+ },
23
+ advanced: advanced,
24
+ builderAttrs: {
25
+ 'data-id': builderProps?.uid
26
+ }
27
+ })}
28
+ `;
29
+ };
30
+
31
+ export { ArticleDate as default };
@@ -0,0 +1,22 @@
1
+ 'use client';
2
+ import { template } from '@gem-sdk/core';
3
+ import Text from '../../text/components/Text.liquid.js';
4
+
5
+ const ArticleExcerpt = ({ setting, styles, advanced, builderProps })=>{
6
+ return template`
7
+ ${Text({
8
+ styles: styles,
9
+ setting: {
10
+ ...setting,
11
+ text: '{{article.excerpt}}',
12
+ excludeFlex: true
13
+ },
14
+ advanced: advanced,
15
+ builderAttrs: {
16
+ 'data-id': builderProps?.uid
17
+ }
18
+ })}
19
+ `;
20
+ };
21
+
22
+ export { ArticleExcerpt as default };
@@ -0,0 +1,63 @@
1
+ 'use client';
2
+ import { template, cls } from '@gem-sdk/core';
3
+ import Image from '../../image/components/Image.liquid.js';
4
+
5
+ const ArticleImage = (props)=>{
6
+ const setting = props?.setting ?? {};
7
+ const { builderProps } = props;
8
+ return template`
9
+ <div class="${cls('gp-text-center gp-overflow-hidden', props?.className)}" style="border-radius: inherit">
10
+ ${setting?.linkArticle ? `
11
+ <a href="{{article.url}}" title="{{article.title}}">
12
+ ${Image({
13
+ ...props,
14
+ styles: props.styles,
15
+ setting: {
16
+ ...props.setting,
17
+ alt: '{{article.image.alt}}',
18
+ image: {
19
+ src: `{{article.image.src | img_url: '1024x1024'}}`,
20
+ alt: '{{article.image.alt}}'
21
+ },
22
+ srcSet: {
23
+ desktop: {
24
+ src: `{{article.image.src | img_url: '1024x1024'}}`
25
+ }
26
+ },
27
+ disableNoDataState: true
28
+ },
29
+ advanced: props.advanced,
30
+ builderAttrs: {
31
+ 'data-id': builderProps?.uid
32
+ }
33
+ })}
34
+ </a>
35
+ ` : `
36
+ ${Image({
37
+ ...props,
38
+ styles: props.styles,
39
+ setting: {
40
+ ...props.setting,
41
+ alt: '{{article.image.alt}}',
42
+ image: {
43
+ src: `{{article.image.src | img_url: '1024x1024'}}`,
44
+ alt: '{{article.image.alt}}'
45
+ },
46
+ srcSet: {
47
+ desktop: {
48
+ src: `{{article.image.src | img_url: '1024x1024'}}`
49
+ }
50
+ },
51
+ disableNoDataState: true
52
+ },
53
+ advanced: props.advanced,
54
+ builderAttrs: {
55
+ 'data-id': builderProps?.uid
56
+ }
57
+ })}
58
+ `}
59
+ </div>
60
+ `;
61
+ };
62
+
63
+ export { ArticleImage as default };
@@ -0,0 +1,13 @@
1
+ 'use client';
2
+ import '@gem-sdk/core';
3
+ import 'react/jsx-runtime';
4
+ import 'react';
5
+ import 'next/link';
6
+ import '@gem-sdk/system';
7
+ import CollectionPaginator from '../../collection/components/collection-paginator/components/CollectionPaginator.liquid.js';
8
+
9
+ const ArticlePagination = (props)=>{
10
+ return CollectionPaginator(props);
11
+ };
12
+
13
+ export { ArticlePagination as default };
@@ -0,0 +1,54 @@
1
+ 'use client';
2
+ import { template, RenderIf } from '@gem-sdk/core';
3
+ import Text from '../../text/components/Text.liquid.js';
4
+ import Button from '../../button/components/Button.liquid.js';
5
+
6
+ const ArticleReadMore = ({ setting, styles, builderAttrs, builderProps, advanced, style })=>{
7
+ const { readMoreType, label } = setting ?? {};
8
+ const { typoBtn, typoText, globalSizeText, globalSizeBtn, textColorTextState, textColorBtnState, alignBtn, alignText } = styles ?? {};
9
+ return template /* liquid */ `
10
+ <a href="{{article.url}}" target="_blank">
11
+ ${RenderIf(readMoreType === 'text', Text({
12
+ builderAttrs,
13
+ builderProps,
14
+ advanced,
15
+ styles: {
16
+ ...styles,
17
+ color: textColorTextState,
18
+ typo: typoText,
19
+ spacing: '0px',
20
+ align: alignText
21
+ },
22
+ style: style ?? {},
23
+ setting: {
24
+ ...setting,
25
+ text: label,
26
+ globalSize: globalSizeText,
27
+ excludeFlex: true,
28
+ translate: undefined
29
+ }
30
+ }))}
31
+ ${RenderIf(readMoreType === 'button', Button({
32
+ builderAttrs,
33
+ builderProps,
34
+ advanced,
35
+ styles: {
36
+ ...styles,
37
+ typo: typoBtn,
38
+ globalSize: globalSizeBtn,
39
+ textColor: textColorBtnState,
40
+ align: alignBtn
41
+ },
42
+ style: style ?? {},
43
+ setting: {
44
+ ...setting,
45
+ label: label,
46
+ htmlType: 'button',
47
+ translate: undefined
48
+ }
49
+ }))}
50
+ </a>
51
+ `;
52
+ };
53
+
54
+ export { ArticleReadMore as default };
@@ -0,0 +1,23 @@
1
+ 'use client';
2
+ import { template } from '@gem-sdk/core';
3
+ import Text from '../../text/components/Text.liquid.js';
4
+
5
+ const ArticleTag = ({ setting, styles, advanced, builderProps })=>{
6
+ return template`
7
+ {%- assign tagsString = article.tags | join: ', ' -%}
8
+ ${Text({
9
+ styles: styles,
10
+ setting: {
11
+ ...setting,
12
+ text: '{{tagsString}}',
13
+ excludeFlex: true
14
+ },
15
+ advanced,
16
+ builderAttrs: {
17
+ 'data-id': builderProps?.uid
18
+ }
19
+ })}
20
+ `;
21
+ };
22
+
23
+ export { ArticleTag as default };
@@ -0,0 +1,42 @@
1
+ 'use client';
2
+ import { template } from '@gem-sdk/core';
3
+ import Text from '../../text/components/Text.liquid.js';
4
+
5
+ const ArticleTitle = ({ setting, styles, advanced, builderProps })=>{
6
+ const target = setting?.openNewTab ? '_blank' : '_self';
7
+ return template`
8
+ ${setting?.enableLink && setting?.linkArticle ? `
9
+ <a href="{{article.url}}" target="${{
10
+ target
11
+ }}" title="{{article.title}}">
12
+ ${Text({
13
+ styles: styles,
14
+ setting: {
15
+ ...setting,
16
+ text: '{{article.title}}',
17
+ excludeFlex: true
18
+ },
19
+ advanced: advanced,
20
+ builderAttrs: {
21
+ 'data-id': builderProps?.uid
22
+ }
23
+ })}
24
+ </a>
25
+ ` : `
26
+ ${Text({
27
+ styles: styles,
28
+ setting: {
29
+ ...setting,
30
+ text: '{{article.title}}',
31
+ excludeFlex: true
32
+ },
33
+ advanced: advanced,
34
+ builderAttrs: {
35
+ 'data-id': builderProps?.uid
36
+ }
37
+ })}
38
+ `}
39
+ `;
40
+ };
41
+
42
+ export { ArticleTitle as default };