@capillarytech/creatives-library 9.0.36-alpha.0 → 9.0.36

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 (61) hide show
  1. package/app.js +175 -10
  2. package/entry.js +1 -67
  3. package/mfe-exposed-components.js +4 -2
  4. package/package.json +2 -2
  5. package/services/api.js +1 -9
  6. package/styles/containers/layout/_layoutPage.scss +6 -8
  7. package/utils/gtmTrackers/gtmEvents/creativeDetails.js +1 -2
  8. package/utils/rcsPayloadUtils.js +2 -5
  9. package/utils/tests/rcsPayloadUtils.test.js +2 -54
  10. package/v2Components/CapActionButton/constants.js +0 -1
  11. package/v2Components/CapActionButton/index.js +9 -77
  12. package/v2Components/CapActionButton/index.scss +0 -13
  13. package/v2Components/CapActionButton/messages.js +0 -13
  14. package/v2Components/CapActionButton/tests/index.test.js +1 -32
  15. package/v2Components/CommonTestAndPreview/UnifiedPreview/ViberPreviewContent.js +15 -108
  16. package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +1 -139
  17. package/v2Components/CommonTestAndPreview/index.js +41 -284
  18. package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/ViberPreviewContent.test.js +0 -364
  19. package/v2Components/CommonTestAndPreview/tests/index.test.js +0 -78
  20. package/v2Components/CommonTestAndPreview/utils.js +0 -34
  21. package/v2Components/NavigationBar/index.js +7 -9
  22. package/v2Components/NavigationBar/tests/index.test.js +19 -39
  23. package/v2Components/SmsFallback/index.js +0 -6
  24. package/v2Containers/Cap/constants.js +0 -1
  25. package/v2Containers/Cap/index.js +27 -57
  26. package/v2Containers/CreativesContainer/index.js +8 -11
  27. package/v2Containers/CreativesContainer/tests/index.test.js +0 -53
  28. package/v2Containers/Rcs/carouselUtils.js +73 -46
  29. package/v2Containers/Rcs/components/CarouselCard.js +9 -11
  30. package/v2Containers/Rcs/components/CarouselCardButtons.js +0 -20
  31. package/v2Containers/Rcs/constants.js +7 -2
  32. package/v2Containers/Rcs/index.js +205 -226
  33. package/v2Containers/Rcs/rcsLibraryHydrationUtils.js +47 -60
  34. package/v2Containers/Rcs/tests/CarouselCard.test.js +2 -1
  35. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +0 -286
  36. package/v2Containers/Rcs/tests/carouselUtils.test.js +32 -28
  37. package/v2Containers/Rcs/tests/index.test.js +238 -151
  38. package/v2Containers/Rcs/tests/rcsLibraryHydrationUtils.test.js +0 -110
  39. package/v2Containers/Rcs/tests/utils.test.js +17 -36
  40. package/v2Containers/Rcs/utils.js +55 -28
  41. package/v2Containers/SmsTrai/Edit/index.js +24 -35
  42. package/v2Containers/Templates/_templates.scss +1 -115
  43. package/v2Containers/Templates/index.js +10 -91
  44. package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +0 -5
  45. package/v2Containers/TemplatesV2/TemplatesV2.style.js +3 -8
  46. package/v2Containers/TemplatesV2/index.js +9 -22
  47. package/v2Containers/Viber/constants.js +0 -21
  48. package/v2Containers/Viber/index.js +49 -719
  49. package/v2Containers/Viber/index.scss +0 -175
  50. package/v2Containers/Viber/messages.js +0 -121
  51. package/v2Containers/Viber/tests/index.test.js +0 -80
  52. package/AppRoot.js +0 -124
  53. package/app-config.js +0 -61
  54. package/bootstrap.js +0 -185
  55. package/utils/getDataLayer.js +0 -15
  56. package/utils/mfeDetect.js +0 -1
  57. package/utils/mfeFirstPaintReady.js +0 -29
  58. package/utils/mfeHistory.js +0 -62
  59. package/v2Components/CommonTestAndPreview/UnifiedPreview/ViberCarouselPreviewCards.js +0 -132
  60. package/v2Components/CommonTestAndPreview/UnifiedPreview/_viberCarouselPreviewCards.scss +0 -131
  61. package/v2Components/NavigationBar/mfeModuleHeader.config.js +0 -16
@@ -10,7 +10,7 @@ import { connect } from 'react-redux';
10
10
  import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
11
11
  import { createStructuredSelector } from 'reselect';
12
12
  import { bindActionCreators, compose } from 'redux';
13
- import { CapTab, CapCustomCard, CapButton, CapIcon, CapSpin, CapTooltip } from '@capillarytech/cap-ui-library';
13
+ import { CapTab, CapCustomCard, CapButton, CapHeader, CapIcon, CapSpin, CapTooltip } from '@capillarytech/cap-ui-library';
14
14
  import { find, get, pick } from 'lodash';
15
15
  import Helmet from 'react-helmet';
16
16
 
@@ -47,9 +47,6 @@ import {
47
47
  NORMALIZED_CHANNEL_ALIASES,
48
48
  SMS,
49
49
  } from "../CreativesContainer/constants";
50
- import { MFEEventBus } from '@capillarytech/cap-ui-utils';
51
- import { isMFEMode } from '../../utils/mfeDetect';
52
- import appConfig from '../../app-config';
53
50
 
54
51
  const { CapCustomCardList } = CapCustomCard;
55
52
 
@@ -57,7 +54,6 @@ const StyledCapTab = withStyles(CapTab, CapTabStyle);
57
54
  export class TemplatesV2 extends React.Component { // eslint-disable-line react/prefer-stateless-function
58
55
  constructor(props) {
59
56
  super(props);
60
- this.lcpReported = false;
61
57
  let defaultChannel = get(this, 'props.channel') || get(this, 'props.params.channel') || 'sms';
62
58
  if (defaultChannel === LOYALTY) {
63
59
  defaultChannel = 'sms';
@@ -226,23 +222,6 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
226
222
  }
227
223
  }
228
224
 
229
- componentDidUpdate(prevProps) {
230
- if (
231
- isMFEMode() &&
232
- !this.lcpReported &&
233
- !this.props.Templates.getAllTemplatesInProgress &&
234
- prevProps.Templates.getAllTemplatesInProgress
235
- ) {
236
- this.lcpReported = true;
237
- MFEEventBus.emit('mfe:segment', {
238
- action: 'stop',
239
- appId: appConfig.appName,
240
- type: 'lcp',
241
- timestamp: performance.now(),
242
- });
243
- }
244
- }
245
-
246
225
  componentWillReceiveProps(nextProps) {
247
226
  if (this.props.channel !== nextProps.channel) {
248
227
  const panes = this.setChannelContent(nextProps.channel, this.state.panes);
@@ -443,6 +422,14 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
443
422
  />
444
423
  )}
445
424
  <section className="component-wrapper">
425
+ {isFullMode && (
426
+ <CapHeader
427
+ title={<FormattedMessage {...messages.creatives} />}
428
+ {...(!useLocalTemplates && {
429
+ description: <FormattedMessage {...messages.creativesDesc} />,
430
+ })}
431
+ />
432
+ )}
446
433
  {hideChannelTabsForLocalSms ? (
447
434
  <section className="templates-v2-local-sms-pane">{activeLocalPane?.content}</section>
448
435
  ) : (
@@ -47,24 +47,7 @@ export const VIBER_MEDIA_TYPES = {
47
47
  TEXT: 'TEXT',
48
48
  IMAGE: 'IMAGE',
49
49
  VIDEO: 'VIDEO',
50
- CAROUSEL: 'CAROUSEL',
51
50
  };
52
- export const VIBER_CAROUSEL_MIN_CARDS = 2;
53
- export const VIBER_CAROUSEL_MAX_CARDS = 5;
54
- export const VIBER_CAROUSEL_MAX_BUTTONS = 2;
55
- export const VIBER_CAROUSEL_CARD_TITLE_MIN_LENGTH = 2;
56
- export const VIBER_CAROUSEL_CARD_TITLE_MAX_LENGTH = 38;
57
- export const VIBER_CAROUSEL_FIRST_BUTTON_TITLE_MAX_LENGTH = 10;
58
- export const VIBER_CAROUSEL_SECOND_BUTTON_TITLE_MAX_LENGTH = 12;
59
- export const VIBER_CAROUSEL_BUTTON_URL_MAX_LENGTH = 1000;
60
- export const STATIC_URL = 'STATIC_URL';
61
- export const DYNAMIC_URL = 'DYNAMIC_URL';
62
- /** Recommended / validated carousel image height in pixels (passed to image upload). */
63
- export const VIBER_CAROUSEL_IMG_HEIGHT = 600;
64
- /** Recommended / validated carousel image width in pixels (passed to image upload). */
65
- export const VIBER_CAROUSEL_IMG_WIDTH = 696;
66
- /** Maximum carousel image file size (bytes). 10_000_000 ≈ 10 MB (decimal). */
67
- export const VIBER_CAROUSEL_IMG_SIZE = 10000000;
68
51
  export const ALLOWED_IMAGE_EXTENSIONS_REGEX_VIBER = /\.(jpe?g|png)$/i;
69
52
  export const ALLOWED_EXTENSIONS_VIDEO_REGEX_VIBER = /\.(mp4|3gp|m4v|mov)$/i;
70
53
  export const NONE = 'NONE';
@@ -86,10 +69,6 @@ export const mediaRadioOptions = [
86
69
  value: VIBER_MEDIA_TYPES.VIDEO,
87
70
  label: <FormattedMessage {...messages.mediaVideo} />,
88
71
  },
89
- {
90
- value: VIBER_MEDIA_TYPES.CAROUSEL,
91
- label: <FormattedMessage {...messages.mediaCarousel} />,
92
- },
93
72
  ];
94
73
 
95
74
  export const buttonRadioOptions = [