@capillarytech/creatives-library 6.8.7 → 6.8.8

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 (30) hide show
  1. package/components/TemplatePreview/_templatePreview.scss +6 -0
  2. package/components/TemplatePreview/index.js +35 -28
  3. package/package.json +1 -1
  4. package/v2Components/Carousel/index.js +120 -0
  5. package/v2Components/Carousel/style.scss +40 -0
  6. package/v2Components/TemplatePreview/_templatePreview.scss +381 -380
  7. package/v2Components/TemplatePreview/index.js +36 -29
  8. package/v2Containers/CreativesContainer/SlideBoxContent.js +7 -1
  9. package/v2Containers/Line/Container/Image/index.js +21 -19
  10. package/v2Containers/Line/Container/ImageCarousel/Content.js +554 -0
  11. package/v2Containers/Line/Container/ImageCarousel/constants.js +10 -0
  12. package/v2Containers/Line/Container/ImageCarousel/index.js +526 -0
  13. package/v2Containers/Line/Container/ImageCarousel/messages.js +178 -0
  14. package/v2Containers/Line/Container/ImageCarousel/style.js +61 -0
  15. package/v2Containers/Line/Container/ImageMap/constants.js +2 -1
  16. package/v2Containers/Line/Container/ImageMap/index.js +31 -6
  17. package/v2Containers/Line/Container/ImageMap/messages.js +12 -0
  18. package/v2Containers/Line/Container/Wrapper/index.js +5 -1
  19. package/v2Containers/Line/Container/Wrapper/messages.js +4 -0
  20. package/v2Containers/Line/Container/Wrapper/utils.js +15 -16
  21. package/v2Containers/Line/Container/_lineCreate.scss +2 -2
  22. package/v2Containers/Line/Container/actions.js +4 -2
  23. package/v2Containers/Line/Container/constants.js +3 -0
  24. package/v2Containers/Line/Container/index.js +49 -11
  25. package/v2Containers/Line/Container/reducer.js +2 -2
  26. package/v2Containers/Line/Container/sagas.js +2 -2
  27. package/v2Containers/Line/Container/style.js +2 -1
  28. package/v2Containers/Templates/_templates.scss +414 -405
  29. package/v2Containers/Templates/index.js +29 -2
  30. package/v2Containers/Templates/messages.js +4 -0
@@ -81,7 +81,8 @@ const LINE_FILTERS = {
81
81
  ALL: 'all',
82
82
  TEXT: 'text',
83
83
  IMAGE_VIDEO: 'image',
84
- IMAGE_MAP: 'imagemap'
84
+ IMAGE_MAP: 'imagemap',
85
+ IMAGE_CAROUSEL: 'template',
85
86
  };
86
87
 
87
88
  export class Templates extends React.Component { // eslint-disable-line react/prefer-stateless-function
@@ -640,11 +641,34 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
640
641
  stickerUrl = '',
641
642
  animatedStickerUrl = '',
642
643
  baseUrl = '',
644
+ template: carouselTemplate,
643
645
  }] = [{}],
644
646
  } = {},
645
647
  } = template.versions.base;
646
648
  templateData.content = text;
647
649
  templateData.url = originalContentUrl || animatedStickerUrl || stickerUrl || (baseUrl ? `${baseUrl}/1040` : '');
650
+ if (carouselTemplate) {
651
+ const carouselContent = get(carouselTemplate, 'columns', [{}]).map(({ imageUrl, action: { label: actionLabel } = {} }) => ({ imageUrl, actionLabel }) );
652
+ templateData.content = (
653
+ <div style={{ display: 'flex'}}>
654
+ {
655
+ carouselContent.map(({
656
+ imageUrl,
657
+ actionLabel
658
+ }) => (
659
+ <img
660
+ width={208}
661
+ height={279}
662
+ src={imageUrl}
663
+ alt={actionLabel}
664
+ key={`${imageUrl}_${actionLabel}`}
665
+ />
666
+ ))
667
+ }
668
+ </div>
669
+ );
670
+ templateData.className = 'carousel-img-section';
671
+ }
648
672
  break;
649
673
  }
650
674
  default:
@@ -1783,7 +1807,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1783
1807
  <CapRadio.CapRadioGroup className="line-filters" defaultValue={lineFilter} onChange={this.setLineFilter}>
1784
1808
  {
1785
1809
  (() => {
1786
- const { ALL, TEXT, IMAGE_VIDEO, STICKER, IMAGE_MAP } = LINE_FILTERS;
1810
+ const { ALL, TEXT, IMAGE_VIDEO, IMAGE_CAROUSEL, IMAGE_MAP } = LINE_FILTERS;
1787
1811
  return (
1788
1812
  <>
1789
1813
  <CapRadio.Button value={ALL}><CapLabel type="label2">
@@ -1798,6 +1822,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1798
1822
  <CapRadio.Button value={IMAGE_MAP}><CapLabel type="label2">
1799
1823
  <FormattedMessage {...messages.imageMapTemplate} />
1800
1824
  </CapLabel></CapRadio.Button>
1825
+ <CapRadio.Button value={IMAGE_CAROUSEL}><CapLabel type="label2">
1826
+ <FormattedMessage {...messages.imageCarouselTemplate} />
1827
+ </CapLabel></CapRadio.Button>
1801
1828
  </>
1802
1829
  );
1803
1830
  })()
@@ -242,6 +242,10 @@ export default defineMessages({
242
242
  id: `${scope}.imageMapTemplate`,
243
243
  defaultMessage: `Rich message`,
244
244
  },
245
+ "imageCarouselTemplate": {
246
+ id: `${scope}.imageCarouselTemplate`,
247
+ defaultMessage: `Card message`,
248
+ },
245
249
  "selectDefaultButton": {
246
250
  id: `${scope}.selectDefaultButton`,
247
251
  defaultMessage: `Select`,