@capillarytech/creatives-library 8.0.259 → 8.0.260-alpha.0

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 (157) hide show
  1. package/assets/Android.png +0 -0
  2. package/assets/iOS.png +0 -0
  3. package/constants/unified.js +1 -2
  4. package/initialReducer.js +0 -2
  5. package/package.json +1 -1
  6. package/services/api.js +0 -10
  7. package/services/tests/api.test.js +0 -34
  8. package/translations/en.json +3 -4
  9. package/utils/common.js +0 -12
  10. package/utils/commonUtils.js +5 -28
  11. package/utils/tests/commonUtil.test.js +0 -224
  12. package/utils/transformTemplateConfig.js +10 -0
  13. package/v2Components/CapDeviceContent/index.js +56 -61
  14. package/v2Components/CapTagList/index.js +1 -6
  15. package/v2Components/CapTagListWithInput/index.js +1 -5
  16. package/v2Components/CapTagListWithInput/messages.js +1 -1
  17. package/v2Components/CapWhatsappCTA/tests/index.test.js +0 -5
  18. package/v2Components/ErrorInfoNote/index.js +72 -457
  19. package/v2Components/ErrorInfoNote/messages.js +6 -36
  20. package/v2Components/ErrorInfoNote/style.scss +6 -282
  21. package/v2Components/FormBuilder/index.js +4 -4
  22. package/v2Components/FormBuilder/tests/index.test.js +4 -13
  23. package/v2Components/HtmlEditor/HTMLEditor.js +94 -547
  24. package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +133 -1441
  25. package/v2Components/HtmlEditor/__tests__/index.lazy.test.js +16 -27
  26. package/v2Components/HtmlEditor/_htmlEditor.scss +45 -108
  27. package/v2Components/HtmlEditor/_index.lazy.scss +1 -0
  28. package/v2Components/HtmlEditor/components/CodeEditorPane/_codeEditorPane.scss +102 -23
  29. package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +140 -148
  30. package/v2Components/HtmlEditor/components/DeviceToggle/_deviceToggle.scss +1 -2
  31. package/v2Components/HtmlEditor/components/DeviceToggle/index.js +3 -3
  32. package/v2Components/HtmlEditor/components/EditorToolbar/_editorToolbar.scss +0 -9
  33. package/v2Components/HtmlEditor/components/EditorToolbar/index.js +4 -4
  34. package/v2Components/HtmlEditor/components/FullscreenModal/_fullscreenModal.scss +0 -22
  35. package/v2Components/HtmlEditor/components/InAppPreviewPane/DeviceFrame.js +7 -4
  36. package/v2Components/HtmlEditor/components/InAppPreviewPane/__tests__/DeviceFrame.test.js +45 -35
  37. package/v2Components/HtmlEditor/components/InAppPreviewPane/_inAppPreviewPane.scss +3 -1
  38. package/v2Components/HtmlEditor/components/InAppPreviewPane/constants.js +33 -33
  39. package/v2Components/HtmlEditor/components/InAppPreviewPane/index.js +6 -7
  40. package/v2Components/HtmlEditor/components/PreviewPane/_previewPane.scss +6 -3
  41. package/v2Components/HtmlEditor/components/PreviewPane/index.js +43 -22
  42. package/v2Components/HtmlEditor/components/SplitContainer/_splitContainer.scss +1 -1
  43. package/v2Components/HtmlEditor/components/ValidationErrorDisplay/__tests__/index.test.js +152 -0
  44. package/v2Components/HtmlEditor/components/ValidationErrorDisplay/_validationErrorDisplay.scss +0 -1
  45. package/v2Components/HtmlEditor/components/ValidationErrorDisplay/index.js +31 -49
  46. package/v2Components/HtmlEditor/components/ValidationPanel/_validationPanel.scss +34 -50
  47. package/v2Components/HtmlEditor/components/ValidationPanel/index.js +41 -70
  48. package/v2Components/HtmlEditor/constants.js +20 -42
  49. package/v2Components/HtmlEditor/hooks/__tests__/useInAppContent.test.js +16 -373
  50. package/v2Components/HtmlEditor/hooks/__tests__/useValidation.test.js +16 -120
  51. package/v2Components/HtmlEditor/hooks/useEditorContent.js +2 -5
  52. package/v2Components/HtmlEditor/hooks/useInAppContent.js +146 -88
  53. package/v2Components/HtmlEditor/hooks/useValidation.js +53 -189
  54. package/v2Components/HtmlEditor/index.js +1 -1
  55. package/v2Components/HtmlEditor/messages.js +94 -92
  56. package/v2Components/HtmlEditor/utils/__tests__/htmlValidator.enhanced.test.js +45 -94
  57. package/v2Components/HtmlEditor/utils/__tests__/validationAdapter.test.js +0 -134
  58. package/v2Components/HtmlEditor/utils/contentSanitizer.js +41 -40
  59. package/v2Components/HtmlEditor/utils/htmlValidator.js +72 -71
  60. package/v2Components/HtmlEditor/utils/liquidTemplateSupport.js +102 -134
  61. package/v2Components/HtmlEditor/utils/properSyntaxHighlighting.js +25 -23
  62. package/v2Components/HtmlEditor/utils/validationAdapter.js +41 -66
  63. package/v2Components/MobilePushPreviewV2/index.js +7 -32
  64. package/v2Components/TemplatePreview/_templatePreview.scss +24 -55
  65. package/v2Components/TemplatePreview/index.js +32 -47
  66. package/v2Components/TemplatePreview/messages.js +0 -4
  67. package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +0 -1
  68. package/v2Containers/BeeEditor/index.js +90 -172
  69. package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +3 -4
  70. package/v2Containers/CreativesContainer/SlideBoxContent.js +52 -128
  71. package/v2Containers/CreativesContainer/SlideBoxFooter.js +13 -163
  72. package/v2Containers/CreativesContainer/SlideBoxHeader.js +1 -2
  73. package/v2Containers/CreativesContainer/constants.js +0 -1
  74. package/v2Containers/CreativesContainer/index.js +46 -240
  75. package/v2Containers/CreativesContainer/messages.js +0 -8
  76. package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +2 -11
  77. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +50 -38
  78. package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +0 -106
  79. package/v2Containers/Email/actions.js +0 -7
  80. package/v2Containers/Email/constants.js +1 -5
  81. package/v2Containers/Email/index.js +30 -239
  82. package/v2Containers/Email/messages.js +0 -32
  83. package/v2Containers/Email/reducer.js +1 -12
  84. package/v2Containers/Email/sagas.js +7 -61
  85. package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +0 -2
  86. package/v2Containers/Email/tests/reducer.test.js +0 -46
  87. package/v2Containers/Email/tests/sagas.test.js +29 -320
  88. package/v2Containers/EmailWrapper/components/EmailWrapperView.js +21 -211
  89. package/v2Containers/EmailWrapper/components/HTMLEditorTesting.js +74 -40
  90. package/v2Containers/EmailWrapper/components/__tests__/HTMLEditorTesting.test.js +67 -2
  91. package/v2Containers/EmailWrapper/constants.js +0 -2
  92. package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +77 -629
  93. package/v2Containers/EmailWrapper/index.js +23 -103
  94. package/v2Containers/EmailWrapper/messages.js +1 -65
  95. package/v2Containers/EmailWrapper/tests/EmailWrapperView.test.js +214 -0
  96. package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +77 -594
  97. package/v2Containers/InApp/actions.js +0 -7
  98. package/v2Containers/InApp/constants.js +4 -20
  99. package/v2Containers/InApp/index.js +360 -804
  100. package/v2Containers/InApp/index.scss +3 -4
  101. package/v2Containers/InApp/messages.js +3 -7
  102. package/v2Containers/InApp/reducer.js +3 -21
  103. package/v2Containers/InApp/sagas.js +9 -29
  104. package/v2Containers/InApp/selectors.js +5 -25
  105. package/v2Containers/InApp/tests/index.test.js +71 -152
  106. package/v2Containers/InApp/tests/reducer.test.js +0 -34
  107. package/v2Containers/InApp/tests/sagas.test.js +9 -61
  108. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +12 -39
  109. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +6 -10
  110. package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +75 -102
  111. package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +54 -81
  112. package/v2Containers/MobilePushNew/index.js +2 -3
  113. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +178 -262
  114. package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +12 -16
  115. package/v2Containers/SmsTrai/Edit/index.js +1 -2
  116. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +111 -468
  117. package/v2Containers/TagList/index.js +19 -62
  118. package/v2Containers/Templates/_templates.scss +1 -60
  119. package/v2Containers/Templates/index.js +4 -89
  120. package/v2Containers/Templates/messages.js +0 -4
  121. package/v2Containers/WebPush/Create/messages.js +8 -0
  122. package/v2Containers/WebPush/Create/preview/PreviewControls.js +2 -2
  123. package/v2Containers/WebPush/Create/preview/PreviewDisclaimer.js +3 -1
  124. package/v2Containers/WebPush/Create/preview/components/AndroidMobileChromeHeader.js +5 -1
  125. package/v2Containers/WebPush/Create/preview/components/AndroidMobileExpanded.js +5 -1
  126. package/v2Containers/WebPush/Create/preview/components/tests/__snapshots__/AndroidMobileExpanded.test.js.snap +5 -1
  127. package/v2Containers/WebPush/Create/preview/preview.scss +7 -0
  128. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +734 -1306
  129. package/v2Components/ErrorInfoNote/constants.js +0 -1
  130. package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +0 -874
  131. package/v2Components/HtmlEditor/components/ValidationPanel/constants.js +0 -6
  132. package/v2Components/HtmlEditor/components/ValidationTabs/_validationTabs.scss +0 -255
  133. package/v2Components/HtmlEditor/components/ValidationTabs/index.js +0 -364
  134. package/v2Components/HtmlEditor/components/ValidationTabs/messages.js +0 -51
  135. package/v2Components/HtmlEditor/utils/validationConstants.js +0 -40
  136. package/v2Containers/BeePopupEditor/_beePopupEditor.scss +0 -14
  137. package/v2Containers/BeePopupEditor/constants.js +0 -10
  138. package/v2Containers/BeePopupEditor/index.js +0 -194
  139. package/v2Containers/BeePopupEditor/tests/index.test.js +0 -627
  140. package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +0 -1285
  141. package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +0 -1880
  142. package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +0 -520
  143. package/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +0 -643
  144. package/v2Containers/InApp/__tests__/InAppHTMLEditor.test.js +0 -376
  145. package/v2Containers/InApp/__tests__/sagas.test.js +0 -363
  146. package/v2Containers/InApp/tests/selectors.test.js +0 -612
  147. package/v2Containers/InAppWrapper/components/InAppWrapperView.js +0 -151
  148. package/v2Containers/InAppWrapper/components/__tests__/InAppWrapperView.test.js +0 -267
  149. package/v2Containers/InAppWrapper/components/inAppWrapperView.scss +0 -23
  150. package/v2Containers/InAppWrapper/constants.js +0 -16
  151. package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +0 -473
  152. package/v2Containers/InAppWrapper/hooks/useInAppWrapper.js +0 -198
  153. package/v2Containers/InAppWrapper/index.js +0 -148
  154. package/v2Containers/InAppWrapper/messages.js +0 -49
  155. package/v2Containers/InappAdvance/index.js +0 -1099
  156. package/v2Containers/InappAdvance/index.scss +0 -10
  157. package/v2Containers/InappAdvance/tests/index.test.js +0 -448
@@ -40,7 +40,6 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
40
40
  tags: [],
41
41
  tagsError: false,
42
42
  currentContext: null, // Track current context to detect changes
43
- hasTriggeredInitialApiCall: false, // Track if we've triggered API call when popover opens
44
43
  };
45
44
  this.renderTags = this.renderTags.bind(this);
46
45
  this.populateTags = this.populateTags.bind(this);
@@ -52,14 +51,6 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
52
51
 
53
52
  componentDidMount() {
54
53
  this.generateTags(this.props);
55
- // Trigger initial API call if tags are empty (similar to Email/SMS behavior)
56
- const { tags, injectedTags, onContextChange } = this.props;
57
- const hasNoTags = (!tags || tags.length === 0) && _.isEmpty(injectedTags);
58
- if (hasNoTags && onContextChange) {
59
- // Trigger API call with default 'Outbound' context to match CapTagList default
60
- // This ensures tags are loaded when component mounts
61
- this.getTagsforContext('Outbound');
62
- }
63
54
  }
64
55
 
65
56
  componentWillReceiveProps(nextProps) {
@@ -68,27 +59,23 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
68
59
  // 2. Context change is happening (detected by different tag arrays)
69
60
  const { injectedTags: currentInjectedTags, tags: currentTags } = this.props;
70
61
  const { injectedTags: nextInjectedTags, tags: nextTags, fetchingSchemaError } = nextProps;
71
-
62
+
72
63
  const isInitialLoad = _.isEmpty(currentInjectedTags) && _.isEmpty(currentTags);
73
64
  const isContextChange = !_.isEqual(nextTags, currentTags) && !_.isEmpty(currentTags);
74
-
65
+
75
66
  if (isInitialLoad || isContextChange) {
76
67
  this.setState({loading: true});
77
68
  }
78
-
69
+
79
70
  // Only reset loading for injectedTags changes if we're not currently loading due to context change
80
71
  if (!_.isEqual(nextInjectedTags, currentInjectedTags) && !this.state.loading) {
81
72
  this.setState({loading: false});
82
73
  this.clearLoadingTimeout();
83
74
  }
84
-
75
+
85
76
  if (!_.isEqual(nextTags, currentTags)) {
86
77
  this.setState({loading: false});
87
78
  this.clearLoadingTimeout();
88
- // Reset the flag when tags are received, so we can trigger API call again if needed
89
- if (nextTags && nextTags.length > 0) {
90
- this.setState({ hasTriggeredInitialApiCall: false });
91
- }
92
79
  }
93
80
  if (fetchingSchemaError) {
94
81
  this.setState({tagsError: fetchingSchemaError, loading: false});
@@ -99,7 +86,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
99
86
  componentDidUpdate(prevProps) {
100
87
  const { tags, injectedTags, selectedOfferDetails } = this.props;
101
88
  const { tags: prevTags, injectedTags: prevInjectedTags, selectedOfferDetails: prevSelectedOfferDetails } = prevProps;
102
-
89
+
103
90
  if (tags !== prevTags || injectedTags !== prevInjectedTags || selectedOfferDetails !== prevSelectedOfferDetails) {
104
91
  this.generateTags(this.props);
105
92
  }
@@ -124,44 +111,17 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
124
111
  getTagsforContext = (data) => {
125
112
  // Set loading state when context change is requested
126
113
  this.setState({loading: true, currentContext: data});
127
-
114
+
128
115
  // Set a timeout to prevent infinite loading (fallback safety)
129
116
  this.clearLoadingTimeout();
130
117
  this.loadingTimeout = setTimeout(() => {
131
118
  this.setState({loading: false});
132
119
  }, 5000); // Reduced timeout to 5 seconds for better UX
133
-
120
+
134
121
  const { onContextChange } = this.props;
135
- // Always call onContextChange if available - this triggers the API call
136
- // The API call will fetch tags from /meta/TAG endpoint
137
- if (onContextChange) {
138
- onContextChange(data);
139
- } else {
140
- console.warn('TagList: onContextChange is not available. API call will not be triggered.');
141
- }
122
+ onContextChange(data);
142
123
  }
143
124
 
144
- handlePopoverVisibilityChange = (visible) => {
145
- // When popover opens, trigger API call if tags are empty or if we haven't triggered it yet
146
- // This ensures API call happens when user clicks "Add Label" button
147
- if (visible && this.props.onContextChange) {
148
- const { tags, injectedTags } = this.props;
149
- // Check if tags array is empty or if state tags are empty
150
- const hasNoTags = (!tags || tags.length === 0) && _.isEmpty(injectedTags);
151
- const hasNoStateTags = _.isEmpty(this.state.tags);
152
- const hasNotTriggeredApiCall = !this.state.hasTriggeredInitialApiCall;
153
-
154
- // Trigger API call if tags are not loaded yet OR if we haven't triggered it yet
155
- if ((hasNoTags || hasNoStateTags || hasNotTriggeredApiCall)) {
156
- // Mark that we've triggered the API call
157
- this.setState({ hasTriggeredInitialApiCall: true });
158
- // Trigger API call with default 'Outbound' context to match CapTagList default
159
- // This will call onContextChange which triggers handleOnTagsContextChange in InApp
160
- this.getTagsforContext('Outbound');
161
- }
162
- }
163
- };
164
-
165
125
  generateTags = (props) => {
166
126
  let tags = {};
167
127
  let injectedTags = {};
@@ -189,11 +149,11 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
189
149
  if (eventContextTags?.length) {
190
150
  const TAG_HEADER_MSG_LABEL = this.props.intl.formatMessage(messages.entryEvent);
191
151
  eventContextTagsObj.eventContextTags = {
192
- "name": TAG_HEADER_MSG_LABEL,
193
- "desc": TAG_HEADER_MSG_LABEL,
194
- "resolved": true,
152
+ name: TAG_HEADER_MSG_LABEL,
153
+ desc: TAG_HEADER_MSG_LABEL,
154
+ resolved: true,
195
155
  'tag-header': true,
196
- "subtags": {},
156
+ subtags: {},
197
157
  };
198
158
 
199
159
  eventContextTags.forEach((tag) => {
@@ -204,11 +164,11 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
204
164
  // Initializing the tags profile if it doesn't exist
205
165
  if (!eventContextTagsObj?.eventContextTags?.subtags?.[profileId]) {
206
166
  eventContextTagsObj.eventContextTags.subtags[profileId] = {
207
- "name": profileName,
208
- "desc": profileName,
209
- "resolved": true,
167
+ name: profileName,
168
+ desc: profileName,
169
+ resolved: true,
210
170
  'tag-header': true,
211
- "subtags": {},
171
+ subtags: {},
212
172
  };
213
173
  }
214
174
  // Adding the current tag to the profile group
@@ -241,7 +201,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
241
201
  _.forEach(tagsList, (temp) => {
242
202
  const tag = temp.definition;
243
203
  const { intl } = this.props;
244
- const { locale: userLocale } = intl || {};
204
+ const { locale: userLocale } = intl || {};
245
205
 
246
206
  // Check if the tag.value should be skipped based on feature control
247
207
  if (_.includes(excludedTags, tag.value)) {
@@ -249,8 +209,8 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
249
209
  }
250
210
  if (!tag['tag-header']) {
251
211
  mainTags[tag.value] = {
252
- name: tag?.label[userLocale] ? tag?.label[userLocale] : tag?.label?.en,
253
- desc: tag?.label[userLocale] ? tag?.label[userLocale] : tag?.label?.en,
212
+ "name": tag?.label[userLocale] ? tag?.label[userLocale] : tag?.label?.en,
213
+ "desc": tag?.label[userLocale] ? tag?.label[userLocale] : tag?.label?.en,
254
214
  };
255
215
  } else if (tag['tag-header'] && mainTags[tag.value]) {
256
216
  mainTags[tag.value].subtags = _.concat(mainTags[tag.value].subtags, tag.subtags);
@@ -406,14 +366,12 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
406
366
  visibleTaglist={this.props.visibleTaglist}
407
367
  hidePopover={this.props.hidePopover}
408
368
  onContextChange={this.getTagsforContext}
409
- onVisibleChange={this.handlePopoverVisibilityChange}
410
369
  moduleFilterEnabled={this.props.moduleFilterEnabled}
411
370
  modalProps={this.props.modalProps}
412
371
  currentOrgDetails={this.props.currentOrgDetails}
413
372
  channel={this.props.channel}
414
373
  disabled={this.props.disabled}
415
374
  fetchingSchemaError={this?.state?.tagsError}
416
- popoverPlacement={this.props.popoverPlacement}
417
375
  />
418
376
  </div>
419
377
  );
@@ -444,7 +402,6 @@ TagList.propTypes = {
444
402
  disabled: PropTypes.bool,
445
403
  fetchingSchemaError: PropTypes.bool,
446
404
  eventContextTags: PropTypes.array,
447
- popoverPlacement: PropTypes.string,
448
405
  intl: PropTypes.shape({
449
406
  formatMessage: PropTypes.func.isRequired,
450
407
  locale: PropTypes.string,
@@ -316,64 +316,6 @@
316
316
  }
317
317
  }
318
318
  }
319
- .INAPP {
320
- margin-bottom: $CAP_SPACE_12;
321
- .inapp-container {
322
- margin-top: $CAP_SPACE_24;
323
- }
324
- // Modal Layout - centered
325
- .inapp-modal-layout {
326
- position: absolute;
327
- display: flex;
328
- width: 12rem;
329
- top: 10%;
330
- left: 10%;
331
- bottom: 5%;
332
- overflow: hidden;
333
- background-color: $CAP_WHITE;
334
- border-radius: $CAP_SPACE_08;
335
- }
336
-
337
- // Full Screen Layout
338
- .inapp-fullscreen-layout {
339
- position: absolute;
340
- display: flex;
341
- width: 12rem;
342
- left: 10%;
343
- top: 1%;
344
- bottom: 1%;
345
- overflow: hidden;
346
- background-color: $CAP_WHITE;
347
- border-radius: $CAP_SPACE_08;
348
- }
349
-
350
- // Top Banner Layout
351
- .inapp-top-banner-layout {
352
- position: absolute;
353
- display: flex;
354
- width: 12rem;
355
- left: 10%;
356
- top: 1%;
357
- bottom: 20%;
358
- overflow: hidden;
359
- background-color: $CAP_WHITE;
360
- border-radius: $CAP_SPACE_08;
361
- }
362
-
363
- // Bottom Banner Layout
364
- .inapp-bottom-banner-layout {
365
- position: absolute;
366
- display: flex;
367
- justify-content: center;
368
- width: 12rem;
369
- left: 10%;
370
- top: 50%;
371
- bottom: 2%;
372
- overflow: hidden;
373
- background-color: $CAP_WHITE;
374
- border-radius: $CAP_SPACE_08;
375
- }
376
- }
377
319
  }
378
320
 
379
321
  .WEBPUSH {
@@ -955,8 +897,7 @@
955
897
  }
956
898
 
957
899
  .whatsapp-filters,
958
- .zalo-filters,
959
- .inapp-filters {
900
+ .zalo-filters {
960
901
  display: flex;
961
902
  width: 100%;
962
903
  padding-left: 8px;
@@ -128,14 +128,13 @@ import {
128
128
  VIDEO,
129
129
  GIF,
130
130
  } from '../Whatsapp/constants';
131
- import { INAPP_LAYOUT_DETAILS, INAPP_MESSAGE_LAYOUT_TYPES, INAPP_MEDIA_TYPES, BIG_HTML, ANDROID, IOS } from '../InApp/constants';
131
+ import { INAPP_LAYOUT_DETAILS } from '../InApp/constants';
132
132
  import { ZALO_STATUS_OPTIONS, ZALO_STATUSES } from '../Zalo/constants';
133
133
  import { getWhatsappContent, getWhatsappStatus, getWhatsappCategory, getWhatsappCta, getWhatsappQuickReply, getWhatsappAutoFill, getWhatsappCarouselButtonView } from '../Whatsapp/utils';
134
134
  import { getRCSContent } from '../Rcs/utils';
135
135
  import {RCS_STATUSES} from '../Rcs/constants';
136
136
  import zaloMessages from '../Zalo/messages';
137
137
  import rcsMessages from '../Rcs/messages';
138
- import inAppMessages from '../InApp/messages';
139
138
  import globalMessages from '../../v2Containers/Cap/messages';
140
139
  import { handlePreviewInNewTab } from '../../utils/common';
141
140
 
@@ -205,29 +204,6 @@ const SMS_FILTERS = {
205
204
  SERVICE_IMPLICIT: 'implicit',
206
205
  };
207
206
 
208
- const INAPP_LAYOUT_OPTIONS = [
209
- {
210
- key: 'popup',
211
- value: INAPP_MESSAGE_LAYOUT_TYPES.MODAL,
212
- label: <FormattedMessage {...inAppMessages.layoutModal} />,
213
- },
214
- {
215
- key: 'topBanner',
216
- value: INAPP_MESSAGE_LAYOUT_TYPES.TOPBANNER,
217
- label: <FormattedMessage {...inAppMessages.layoutTopBanner} />,
218
- },
219
- {
220
- key: 'bottomBanner',
221
- value: INAPP_MESSAGE_LAYOUT_TYPES.BOTTOMBANNER,
222
- label: <FormattedMessage {...inAppMessages.layoutBottomBanner} />,
223
- },
224
- {
225
- key: 'fullScreen',
226
- value: INAPP_MESSAGE_LAYOUT_TYPES.FULLSCREEN,
227
- label: <FormattedMessage {...inAppMessages.layoutFullScreen} />,
228
- },
229
- ];
230
-
231
207
  const WHATSAPP_LOWERCASE = WHATSAPP.toLowerCase();
232
208
  const RCS_LOWERCASE = RCS.toLowerCase();
233
209
  const SMS_LOWERCASE = SMS.toLowerCase();
@@ -279,7 +255,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
279
255
  selectedWhatsappStatus: '',
280
256
  selectedWhatsappCategory: '',
281
257
  selectedZaloStatus: '',
282
- selectedInAppLayout: '',
283
258
  hostName: '',
284
259
  searchedZaloTemplates: [],
285
260
  searchingZaloTemplate: false,
@@ -1784,19 +1759,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1784
1759
  return templates;
1785
1760
  }
1786
1761
 
1787
- filterInAppTemplates = (templates) => {
1788
- const { selectedInAppLayout } = this.state;
1789
- if (!selectedInAppLayout) {
1790
- return templates;
1791
- }
1792
- return templates.filter((template) => {
1793
- const androidBodyType = get(template, 'versions.base.content.ANDROID.bodyType');
1794
- const iosBodyType = get(template, 'versions.base.content.IOS.bodyType');
1795
- const inappBodyType = androidBodyType || iosBodyType;
1796
- return inappBodyType === selectedInAppLayout;
1797
- });
1798
- }
1799
-
1800
1762
  filterSMSTemplates = (templates) => {
1801
1763
  const { smsFilter } = this.state;
1802
1764
  if (SMS_FILTERS.ALL === smsFilter) {
@@ -1883,9 +1845,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1883
1845
  case ZALO:
1884
1846
  filteredTemplates = this.filterZaloTemplates(templates);
1885
1847
  break;
1886
- case INAPP:
1887
- filteredTemplates = this.filterInAppTemplates(templates);
1888
- break;
1889
1848
  default:
1890
1849
  break;
1891
1850
  }
@@ -2175,12 +2134,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
2175
2134
  templateData.isNewMobilePush = commonUtil.hasNewMobilePushFeatureEnabled();
2176
2135
  }
2177
2136
  break;
2178
- case INAPP: {
2179
- // Pass the full template object to CapCustomCard so getInAppContent can extract the data
2180
- // Similar to how MOBILE_PUSH passes the full template when new feature is enabled
2137
+ case INAPP:
2181
2138
  templateData.content = template;
2182
2139
  break;
2183
- }
2184
2140
  case WECHAT:
2185
2141
  templateData.content = this.prepareWeChatPreviewData(template);
2186
2142
  break;
@@ -2558,7 +2514,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
2558
2514
  return (<div>
2559
2515
  {[WECHAT, MOBILE_PUSH, WEBPUSH, INAPP, WHATSAPP, ZALO, RCS].includes(currentChannel) && this.showAccountName()}
2560
2516
  {filterContent}
2561
- {[WHATSAPP, ZALO, INAPP,RCS].includes(currentChannel) && this.selectedFilters()}
2517
+ {[WHATSAPP, ZALO,RCS].includes(currentChannel) && this.selectedFilters()}
2562
2518
  {<div>
2563
2519
  {!isEmpty(filteredTemplates) || !isEmpty(this.state.searchText) || !isEmpty(this.props.Templates.templateError) ? (
2564
2520
  <div className={!isEmpty(this.state.searchText) && isEmpty(cardDataList) ? '' : this.isFullMode() ? "v2-pagination-container" : "v2-pagination-container-half"}>
@@ -2773,9 +2729,6 @@ return (<div>
2773
2729
 
2774
2730
  prepareWeChatMappedPreviewData(content, templateTags, tagData) {
2775
2731
  let formattedContent = cloneDeep(content);
2776
- if (!formattedContent || typeof formattedContent !== 'string') {
2777
- return formattedContent || '';
2778
- }
2779
2732
  forEach(templateTags, (tag) => {
2780
2733
  if (tagData[tag].value !== undefined) {
2781
2734
  formattedContent = formattedContent.replace(`{{${tag}.DATA}}`, tagData[tag].value);
@@ -4028,19 +3981,14 @@ return (<div>
4028
3981
  }
4029
3982
 
4030
3983
  removeZaloFilter = () => this.setState({ selectedZaloStatus: null });
4031
- removeInAppLayoutFilter = () => this.setState({ selectedInAppLayout: '' });
4032
3984
 
4033
3985
  selectedFilters = () => {
4034
- const { selectedWhatsappStatus, selectedWhatsappCategory, selectedZaloStatus, selectedInAppLayout } = this.state;
3986
+ const { selectedWhatsappStatus, selectedWhatsappCategory, selectedZaloStatus } = this.state;
4035
3987
  const {
4036
3988
  intl: {
4037
3989
  formatMessage,
4038
3990
  },
4039
3991
  } = this.props;
4040
- const getInAppLayoutLabel = (layoutValue) => {
4041
- const layoutOption = INAPP_LAYOUT_OPTIONS.find(opt => opt.value === layoutValue);
4042
- return layoutOption ? layoutOption.label : layoutValue;
4043
- };
4044
3992
  return (
4045
3993
  <CapRow type="flex" align="middle" className="selected-whatsapp-filters">
4046
3994
  {
@@ -4075,23 +4023,6 @@ return (<div>
4075
4023
  </CapTag>
4076
4024
  ) : null
4077
4025
  }
4078
- {
4079
- selectedInAppLayout ? (
4080
- <CapTag closable onClose={this.removeInAppLayoutFilter}>
4081
- {formatMessage(messages.layout)}: {getInAppLayoutLabel(selectedInAppLayout)}
4082
- </CapTag>
4083
- ) : null
4084
- }
4085
- {
4086
- selectedInAppLayout ? (
4087
- <CapLink
4088
- onClick={() => {
4089
- this.removeInAppLayoutFilter();
4090
- }}
4091
- title={this.props.intl.formatMessage(messages.clearAll)}
4092
- />
4093
- ) : null
4094
- }
4095
4026
  </CapRow>
4096
4027
  );
4097
4028
  }
@@ -4102,7 +4033,6 @@ return (<div>
4102
4033
  setLineFilter = (e) => this.setState({lineFilter: e.target.value});
4103
4034
  setSMSFilter = (e) => this.setState({smsFilter: e.target.value});
4104
4035
  setZaloStatus = (value) => this.setState({selectedZaloStatus: value?.item?.props?.value});
4105
- setInAppLayout = (value) => this.setState({selectedInAppLayout: value?.item?.props?.value});
4106
4036
 
4107
4037
  openCreativesFullMode = () => {
4108
4038
  const channelLowerCase = this.state.channel.toLowerCase();
@@ -4355,21 +4285,6 @@ return (<div>
4355
4285
  )
4356
4286
  : () => null
4357
4287
  }
4358
- {
4359
- channel.toUpperCase() === INAPP && (
4360
- <div className="inapp-filters">
4361
- <CapSelectFilter
4362
- placement="bottomLeft"
4363
- data={INAPP_LAYOUT_OPTIONS}
4364
- onSelect={this.setInAppLayout}
4365
- selectedValue={this.state.selectedInAppLayout}
4366
- placeholder="Layout"
4367
- showBadge
4368
- width="120px"
4369
- />
4370
- </div>
4371
- )
4372
- }
4373
4288
  <div style={{display: "flex", justifyContent: "space-between", alignItems: 'center'}}>
4374
4289
  {
4375
4290
  this.state?.channel?.toLowerCase() === WHATSAPP_LOWERCASE && (isWhatsappCountExeeded)? (
@@ -558,10 +558,6 @@ export default defineMessages({
558
558
  id: `${scope}.rcsOnlyApprovedTemplates`,
559
559
  defaultMessage: 'Only "Approved" templates are available here, as you can use those templates to create a message.',
560
560
  },
561
- "layout": {
562
- id: `${scope}.layout`,
563
- defaultMessage: `Layout`,
564
- },
565
561
  "status": {
566
562
  id: `${scope}.status`,
567
563
  defaultMessage: 'Status',
@@ -195,6 +195,14 @@ export default defineMessages({
195
195
  id: `${scope}.state`,
196
196
  defaultMessage: 'State',
197
197
  },
198
+ previewDisclaimer: {
199
+ id: `${scope}.previewDisclaimer`,
200
+ defaultMessage: "For the most accurate desktop preview, switch to full screen under 'Preview in all devices'.",
201
+ },
202
+ notificationTime: {
203
+ id: `${scope}.notificationTime`,
204
+ defaultMessage: '2:29 PM',
205
+ },
198
206
  templateIdMissingError: {
199
207
  id: `${scope}.templateIdMissingError`,
200
208
  defaultMessage: 'Unable to save template: Template ID is missing. Please refresh the page and try again.',
@@ -77,7 +77,7 @@ const PreviewControls = ({
77
77
  const renderStateDropdown = useMemo(() => {
78
78
  if (isStateDropdownDisabled) {
79
79
  return (
80
- <div style={{ pointerEvents: 'none', opacity: 0.6 }}>
80
+ <div className="preview-control-disabled-wrapper">
81
81
  {stateDropdownContent}
82
82
  </div>
83
83
  );
@@ -205,7 +205,7 @@ const PreviewControls = ({
205
205
  return (
206
206
  <div key={key} className={`preview-control ${className}`}>
207
207
  {disabled ? (
208
- <div style={{ pointerEvents: 'none', opacity: 0.6 }}>
208
+ <div className="preview-control-disabled-wrapper">
209
209
  {controlContent}
210
210
  </div>
211
211
  ) : (
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
+ import { FormattedMessage } from 'react-intl';
2
3
  import CapRow from '@capillarytech/cap-ui-library/CapRow';
3
4
  import CapColumn from '@capillarytech/cap-ui-library/CapColumn';
4
5
  import CapLabel from '@capillarytech/cap-ui-library/CapLabel';
6
+ import messages from '../messages';
5
7
  import './preview.scss';
6
8
 
7
9
  /**
@@ -13,7 +15,7 @@ const PreviewDisclaimer = () => (
13
15
  <CapRow className="preview-disclaimer">
14
16
  <CapColumn span={24}>
15
17
  <CapLabel type="label2" className="disclaimer-text">
16
- For the most accurate desktop preview, switch to full screen under &apos;Preview in all devices&apos;.
18
+ <FormattedMessage {...messages.previewDisclaimer} />
17
19
  </CapLabel>
18
20
  </CapColumn>
19
21
  </CapRow>
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import { FormattedMessage } from 'react-intl';
3
4
  import androidArrowDownIcon from '../assets/android-arrow-down.svg';
5
+ import messages from '../../messages';
4
6
 
5
7
  const AndroidMobileChromeHeader = ({
6
8
  icon,
@@ -17,7 +19,9 @@ const AndroidMobileChromeHeader = ({
17
19
  <div className="notification-content android-mobile-chrome-content">
18
20
  <div className="notification-title-row">
19
21
  <div className="notification-title">{notificationTitle}</div>
20
- <div className="notification-time">2:29 PM</div>
22
+ <div className="notification-time">
23
+ <FormattedMessage {...messages.notificationTime} />
24
+ </div>
21
25
  </div>
22
26
  <div className="notification-body">{notificationBody}</div>
23
27
  </div>
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import { FormattedMessage } from 'react-intl';
3
4
  import androidArrowUpIcon from '../assets/android-arrow-up.svg';
4
5
  import { BROWSER_DISPLAY_NAMES_ANDROID } from '../constants';
6
+ import messages from '../../messages';
5
7
 
6
8
  /**
7
9
  * AndroidMobileExpanded Component
@@ -53,7 +55,9 @@ const AndroidMobileExpanded = ({
53
55
  </span>
54
56
  <span className="android-mobile-expanded-domain-time">
55
57
  <span className="android-mobile-expanded-domain">{displayUrl}</span>
56
- <span className="android-mobile-expanded-time">2:29 PM</span>
58
+ <span className="android-mobile-expanded-time">
59
+ <FormattedMessage {...messages.notificationTime} />
60
+ </span>
57
61
  </span>
58
62
  </div>
59
63
  </div>
@@ -46,7 +46,11 @@ exports[`AndroidMobileExpanded Basic Rendering should render correctly with defa
46
46
  <span
47
47
  className="android-mobile-expanded-time"
48
48
  >
49
- 2:29 PM
49
+ <FormattedMessage
50
+ defaultMessage="2:29 PM"
51
+ id="creatives.containersV2.WebPush.notificationTime"
52
+ values={Object {}}
53
+ />
50
54
  </span>
51
55
  </span>
52
56
  </div>
@@ -28,6 +28,13 @@
28
28
  }
29
29
  }
30
30
 
31
+ // Wrapper for disabled dropdown (State when Windows, or when stateDropdownDisabled)
32
+ // Scoped under container to avoid conflicts; keeps controls visible but non-interactive
33
+ .preview-control-disabled-wrapper {
34
+ pointer-events: none;
35
+ opacity: 0.6;
36
+ }
37
+
31
38
  .preview-controls-compact {
32
39
  display: block;
33
40
  margin-bottom: 16px;