@capillarytech/creatives-library 8.0.263 → 8.0.264

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 (163) 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/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +35 -17
  9. package/tests/integration/TemplateCreation/api-response.js +1 -31
  10. package/tests/integration/TemplateCreation/msw-handler.js +0 -2
  11. package/utils/common.js +0 -5
  12. package/utils/commonUtils.js +5 -28
  13. package/utils/tagValidations.js +2 -1
  14. package/utils/tests/commonUtil.test.js +0 -224
  15. package/utils/transformTemplateConfig.js +10 -0
  16. package/v2Components/CapDeviceContent/index.js +56 -61
  17. package/v2Components/CapTagList/index.js +1 -6
  18. package/v2Components/CapTagListWithInput/index.js +1 -5
  19. package/v2Components/CapTagListWithInput/messages.js +1 -1
  20. package/v2Components/CapWhatsappCTA/tests/index.test.js +0 -5
  21. package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +2 -2
  22. package/v2Components/ErrorInfoNote/index.js +72 -402
  23. package/v2Components/ErrorInfoNote/messages.js +6 -32
  24. package/v2Components/ErrorInfoNote/style.scss +6 -278
  25. package/v2Components/FormBuilder/index.js +8 -8
  26. package/v2Components/FormBuilder/tests/index.test.js +4 -13
  27. package/v2Components/HtmlEditor/HTMLEditor.js +99 -418
  28. package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +133 -1882
  29. package/v2Components/HtmlEditor/__tests__/index.lazy.test.js +16 -27
  30. package/v2Components/HtmlEditor/_htmlEditor.scss +45 -108
  31. package/v2Components/HtmlEditor/_index.lazy.scss +1 -0
  32. package/v2Components/HtmlEditor/components/CodeEditorPane/_codeEditorPane.scss +102 -23
  33. package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +140 -148
  34. package/v2Components/HtmlEditor/components/DeviceToggle/_deviceToggle.scss +1 -2
  35. package/v2Components/HtmlEditor/components/DeviceToggle/index.js +3 -3
  36. package/v2Components/HtmlEditor/components/EditorToolbar/_editorToolbar.scss +1 -9
  37. package/v2Components/HtmlEditor/components/EditorToolbar/index.js +6 -31
  38. package/v2Components/HtmlEditor/components/FullscreenModal/_fullscreenModal.scss +0 -22
  39. package/v2Components/HtmlEditor/components/InAppPreviewPane/DeviceFrame.js +7 -4
  40. package/v2Components/HtmlEditor/components/InAppPreviewPane/__tests__/DeviceFrame.test.js +45 -35
  41. package/v2Components/HtmlEditor/components/InAppPreviewPane/_inAppPreviewPane.scss +3 -1
  42. package/v2Components/HtmlEditor/components/InAppPreviewPane/constants.js +33 -33
  43. package/v2Components/HtmlEditor/components/InAppPreviewPane/index.js +6 -7
  44. package/v2Components/HtmlEditor/components/PreviewPane/_previewPane.scss +10 -7
  45. package/v2Components/HtmlEditor/components/PreviewPane/index.js +43 -22
  46. package/v2Components/HtmlEditor/components/SplitContainer/_splitContainer.scss +1 -1
  47. package/v2Components/HtmlEditor/components/ValidationErrorDisplay/__tests__/index.test.js +152 -0
  48. package/v2Components/HtmlEditor/components/ValidationErrorDisplay/_validationErrorDisplay.scss +0 -18
  49. package/v2Components/HtmlEditor/components/ValidationErrorDisplay/index.js +31 -36
  50. package/v2Components/HtmlEditor/components/ValidationPanel/_validationPanel.scss +34 -46
  51. package/v2Components/HtmlEditor/components/ValidationPanel/index.js +46 -52
  52. package/v2Components/HtmlEditor/constants.js +20 -45
  53. package/v2Components/HtmlEditor/hooks/__tests__/useInAppContent.test.js +16 -373
  54. package/v2Components/HtmlEditor/hooks/__tests__/useValidation.test.js +16 -351
  55. package/v2Components/HtmlEditor/hooks/useEditorContent.js +2 -5
  56. package/v2Components/HtmlEditor/hooks/useInAppContent.js +146 -88
  57. package/v2Components/HtmlEditor/hooks/useValidation.js +56 -213
  58. package/v2Components/HtmlEditor/index.js +1 -1
  59. package/v2Components/HtmlEditor/messages.js +94 -102
  60. package/v2Components/HtmlEditor/utils/__tests__/htmlValidator.enhanced.test.js +45 -214
  61. package/v2Components/HtmlEditor/utils/__tests__/validationAdapter.test.js +0 -134
  62. package/v2Components/HtmlEditor/utils/contentSanitizer.js +41 -40
  63. package/v2Components/HtmlEditor/utils/htmlValidator.js +72 -71
  64. package/v2Components/HtmlEditor/utils/liquidTemplateSupport.js +124 -158
  65. package/v2Components/HtmlEditor/utils/properSyntaxHighlighting.js +25 -23
  66. package/v2Components/HtmlEditor/utils/validationAdapter.js +41 -66
  67. package/v2Components/MobilePushPreviewV2/index.js +7 -33
  68. package/v2Components/TemplatePreview/_templatePreview.scss +24 -55
  69. package/v2Components/TemplatePreview/index.js +32 -47
  70. package/v2Components/TemplatePreview/messages.js +0 -4
  71. package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +0 -1
  72. package/v2Containers/BeeEditor/index.js +90 -172
  73. package/v2Containers/CreativesContainer/SlideBoxContent.js +51 -127
  74. package/v2Containers/CreativesContainer/SlideBoxFooter.js +13 -163
  75. package/v2Containers/CreativesContainer/SlideBoxHeader.js +1 -2
  76. package/v2Containers/CreativesContainer/constants.js +0 -1
  77. package/v2Containers/CreativesContainer/index.js +46 -240
  78. package/v2Containers/CreativesContainer/messages.js +0 -8
  79. package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +2 -11
  80. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +50 -38
  81. package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +0 -103
  82. package/v2Containers/Email/actions.js +0 -7
  83. package/v2Containers/Email/constants.js +1 -5
  84. package/v2Containers/Email/index.js +29 -234
  85. package/v2Containers/Email/messages.js +0 -32
  86. package/v2Containers/Email/reducer.js +1 -12
  87. package/v2Containers/Email/sagas.js +7 -61
  88. package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +0 -2
  89. package/v2Containers/Email/tests/reducer.test.js +0 -46
  90. package/v2Containers/Email/tests/sagas.test.js +29 -320
  91. package/v2Containers/EmailWrapper/components/EmailWrapperView.js +21 -211
  92. package/v2Containers/EmailWrapper/components/HTMLEditorTesting.js +74 -40
  93. package/v2Containers/EmailWrapper/components/__tests__/HTMLEditorTesting.test.js +67 -2
  94. package/v2Containers/EmailWrapper/constants.js +0 -2
  95. package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +77 -629
  96. package/v2Containers/EmailWrapper/index.js +23 -103
  97. package/v2Containers/EmailWrapper/messages.js +1 -65
  98. package/v2Containers/EmailWrapper/tests/EmailWrapperView.test.js +214 -0
  99. package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +77 -594
  100. package/v2Containers/FTP/index.js +1 -1
  101. package/v2Containers/InApp/actions.js +0 -7
  102. package/v2Containers/InApp/constants.js +4 -20
  103. package/v2Containers/InApp/index.js +360 -802
  104. package/v2Containers/InApp/index.scss +3 -4
  105. package/v2Containers/InApp/messages.js +3 -7
  106. package/v2Containers/InApp/reducer.js +3 -21
  107. package/v2Containers/InApp/sagas.js +9 -29
  108. package/v2Containers/InApp/selectors.js +5 -25
  109. package/v2Containers/InApp/tests/index.test.js +50 -154
  110. package/v2Containers/InApp/tests/reducer.test.js +0 -34
  111. package/v2Containers/InApp/tests/sagas.test.js +9 -61
  112. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +0 -3
  113. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +0 -2
  114. package/v2Containers/Line/Container/Text/index.js +1 -0
  115. package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +0 -2
  116. package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +0 -9
  117. package/v2Containers/MobilePushNew/index.js +1 -0
  118. package/v2Containers/Rcs/index.js +3 -0
  119. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +0 -12
  120. package/v2Containers/SmsTrai/Edit/index.js +1 -0
  121. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +0 -4
  122. package/v2Containers/TagList/index.js +19 -62
  123. package/v2Containers/Templates/_templates.scss +1 -60
  124. package/v2Containers/Templates/index.js +4 -89
  125. package/v2Containers/Templates/messages.js +0 -4
  126. package/v2Containers/TemplatesV2/TemplatesV2.style.js +2 -4
  127. package/v2Containers/Viber/index.js +1 -0
  128. package/v2Containers/WebPush/Create/index.js +1 -1
  129. package/v2Containers/WebPush/Create/utils/validation.js +2 -1
  130. package/v2Containers/Whatsapp/index.js +1 -0
  131. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +0 -34
  132. package/v2Containers/Zalo/index.js +1 -0
  133. package/v2Containers/Zalo/tests/index.test.js +1 -5
  134. package/v2Components/ErrorInfoNote/constants.js +0 -1
  135. package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +0 -870
  136. package/v2Components/HtmlEditor/components/ValidationPanel/constants.js +0 -6
  137. package/v2Components/HtmlEditor/components/ValidationTabs/_validationTabs.scss +0 -281
  138. package/v2Components/HtmlEditor/components/ValidationTabs/index.js +0 -295
  139. package/v2Components/HtmlEditor/components/ValidationTabs/messages.js +0 -51
  140. package/v2Components/HtmlEditor/utils/validationConstants.js +0 -38
  141. package/v2Components/MobilePushPreviewV2/constants.js +0 -6
  142. package/v2Containers/BeePopupEditor/_beePopupEditor.scss +0 -14
  143. package/v2Containers/BeePopupEditor/constants.js +0 -10
  144. package/v2Containers/BeePopupEditor/index.js +0 -194
  145. package/v2Containers/BeePopupEditor/tests/index.test.js +0 -627
  146. package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +0 -1246
  147. package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +0 -2472
  148. package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +0 -520
  149. package/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +0 -956
  150. package/v2Containers/InApp/__tests__/InAppHTMLEditor.test.js +0 -376
  151. package/v2Containers/InApp/__tests__/sagas.test.js +0 -363
  152. package/v2Containers/InApp/tests/selectors.test.js +0 -612
  153. package/v2Containers/InAppWrapper/components/InAppWrapperView.js +0 -151
  154. package/v2Containers/InAppWrapper/components/__tests__/InAppWrapperView.test.js +0 -267
  155. package/v2Containers/InAppWrapper/components/inAppWrapperView.scss +0 -23
  156. package/v2Containers/InAppWrapper/constants.js +0 -16
  157. package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +0 -473
  158. package/v2Containers/InAppWrapper/hooks/useInAppWrapper.js +0 -198
  159. package/v2Containers/InAppWrapper/index.js +0 -148
  160. package/v2Containers/InAppWrapper/messages.js +0 -49
  161. package/v2Containers/InappAdvance/index.js +0 -1099
  162. package/v2Containers/InappAdvance/index.scss +0 -10
  163. package/v2Containers/InappAdvance/tests/index.test.js +0 -448
@@ -2281,7 +2281,6 @@ new message content.",
2281
2281
  "email": [Function],
2282
2282
  "facebookPreview": [Function],
2283
2283
  "gallery": [Function],
2284
- "inApp": [Function],
2285
2284
  "language": [Function],
2286
2285
  "navigationConfig": [Function],
2287
2286
  "previewAndTest": [Function],
@@ -11300,7 +11299,6 @@ new message content.",
11300
11299
  "email": [Function],
11301
11300
  "facebookPreview": [Function],
11302
11301
  "gallery": [Function],
11303
- "inApp": [Function],
11304
11302
  "language": [Function],
11305
11303
  "navigationConfig": [Function],
11306
11304
  "previewAndTest": [Function],
@@ -20503,7 +20501,6 @@ new message content.",
20503
20501
  "email": [Function],
20504
20502
  "facebookPreview": [Function],
20505
20503
  "gallery": [Function],
20506
- "inApp": [Function],
20507
20504
  "language": [Function],
20508
20505
  "navigationConfig": [Function],
20509
20506
  "previewAndTest": [Function],
@@ -29983,7 +29980,6 @@ new message content.",
29983
29980
  "email": [Function],
29984
29981
  "facebookPreview": [Function],
29985
29982
  "gallery": [Function],
29986
- "inApp": [Function],
29987
29983
  "language": [Function],
29988
29984
  "navigationConfig": [Function],
29989
29985
  "previewAndTest": [Function],
@@ -41684,7 +41680,6 @@ new message content.",
41684
41680
  "email": [Function],
41685
41681
  "facebookPreview": [Function],
41686
41682
  "gallery": [Function],
41687
- "inApp": [Function],
41688
41683
  "language": [Function],
41689
41684
  "navigationConfig": [Function],
41690
41685
  "previewAndTest": [Function],
@@ -53427,7 +53422,6 @@ new message content.",
53427
53422
  "email": [Function],
53428
53423
  "facebookPreview": [Function],
53429
53424
  "gallery": [Function],
53430
- "inApp": [Function],
53431
53425
  "language": [Function],
53432
53426
  "navigationConfig": [Function],
53433
53427
  "previewAndTest": [Function],
@@ -61220,7 +61214,6 @@ new message content.",
61220
61214
  "email": [Function],
61221
61215
  "facebookPreview": [Function],
61222
61216
  "gallery": [Function],
61223
- "inApp": [Function],
61224
61217
  "language": [Function],
61225
61218
  "navigationConfig": [Function],
61226
61219
  "previewAndTest": [Function],
@@ -69431,7 +69424,6 @@ new message content.",
69431
69424
  "email": [Function],
69432
69425
  "facebookPreview": [Function],
69433
69426
  "gallery": [Function],
69434
- "inApp": [Function],
69435
69427
  "language": [Function],
69436
69428
  "navigationConfig": [Function],
69437
69429
  "previewAndTest": [Function],
@@ -77919,7 +77911,6 @@ new message content.",
77919
77911
  "email": [Function],
77920
77912
  "facebookPreview": [Function],
77921
77913
  "gallery": [Function],
77922
- "inApp": [Function],
77923
77914
  "language": [Function],
77924
77915
  "navigationConfig": [Function],
77925
77916
  "previewAndTest": [Function],
@@ -805,6 +805,7 @@ const MobilePushNew = ({
805
805
  injectedTagsParams: injectedTags,
806
806
  location,
807
807
  tagModule: getDefaultTags,
808
+ isFullMode,
808
809
  }) || {};
809
810
  if (value === "" && MEDIA_TYPES_OPTIONS[0].value) {
810
811
  errorTemplateDescMessage = formatMessage(
@@ -399,6 +399,7 @@ export const Rcs = (props) => {
399
399
  location,
400
400
  tagModule: getDefaultTags,
401
401
  eventContextTags,
402
+ isFullMode,
402
403
  }) || {};
403
404
  const unsupportedTagsLengthCheck =
404
405
  validationResponse?.unsupportedTags?.length > 0;
@@ -840,6 +841,7 @@ export const Rcs = (props) => {
840
841
  injectedTagsParams: injectedTags,
841
842
  location,
842
843
  tagModule: getDefaultTags,
844
+ isFullMode,
843
845
  }) || {};
844
846
 
845
847
  const maxLength = templateType === contentType.text_message
@@ -873,6 +875,7 @@ export const Rcs = (props) => {
873
875
  injectedTagsParams: injectedTags,
874
876
  location,
875
877
  tagModule: getDefaultTags,
878
+ isFullMode,
876
879
  }) || {};
877
880
  if (value?.length > FALLBACK_MESSAGE_MAX_LENGTH) {
878
881
  errorMessage = formatMessage(messages.fallbackMsgLenError);
@@ -2281,7 +2281,6 @@ new message content.",
2281
2281
  "email": [Function],
2282
2282
  "facebookPreview": [Function],
2283
2283
  "gallery": [Function],
2284
- "inApp": [Function],
2285
2284
  "language": [Function],
2286
2285
  "navigationConfig": [Function],
2287
2286
  "previewAndTest": [Function],
@@ -18314,7 +18313,6 @@ new message content.",
18314
18313
  "email": [Function],
18315
18314
  "facebookPreview": [Function],
18316
18315
  "gallery": [Function],
18317
- "inApp": [Function],
18318
18316
  "language": [Function],
18319
18317
  "navigationConfig": [Function],
18320
18318
  "previewAndTest": [Function],
@@ -34347,7 +34345,6 @@ new message content.",
34347
34345
  "email": [Function],
34348
34346
  "facebookPreview": [Function],
34349
34347
  "gallery": [Function],
34350
- "inApp": [Function],
34351
34348
  "language": [Function],
34352
34349
  "navigationConfig": [Function],
34353
34350
  "previewAndTest": [Function],
@@ -50902,7 +50899,6 @@ new message content.",
50902
50899
  "email": [Function],
50903
50900
  "facebookPreview": [Function],
50904
50901
  "gallery": [Function],
50905
- "inApp": [Function],
50906
50902
  "language": [Function],
50907
50903
  "navigationConfig": [Function],
50908
50904
  "previewAndTest": [Function],
@@ -68005,7 +68001,6 @@ new message content.",
68005
68001
  "email": [Function],
68006
68002
  "facebookPreview": [Function],
68007
68003
  "gallery": [Function],
68008
- "inApp": [Function],
68009
68004
  "language": [Function],
68010
68005
  "navigationConfig": [Function],
68011
68006
  "previewAndTest": [Function],
@@ -84038,7 +84033,6 @@ new message content.",
84038
84033
  "email": [Function],
84039
84034
  "facebookPreview": [Function],
84040
84035
  "gallery": [Function],
84041
- "inApp": [Function],
84042
84036
  "language": [Function],
84043
84037
  "navigationConfig": [Function],
84044
84038
  "previewAndTest": [Function],
@@ -103380,7 +103374,6 @@ new message content.",
103380
103374
  "email": [Function],
103381
103375
  "facebookPreview": [Function],
103382
103376
  "gallery": [Function],
103383
- "inApp": [Function],
103384
103377
  "language": [Function],
103385
103378
  "navigationConfig": [Function],
103386
103379
  "previewAndTest": [Function],
@@ -122722,7 +122715,6 @@ new message content.",
122722
122715
  "email": [Function],
122723
122716
  "facebookPreview": [Function],
122724
122717
  "gallery": [Function],
122725
- "inApp": [Function],
122726
122718
  "language": [Function],
122727
122719
  "navigationConfig": [Function],
122728
122720
  "previewAndTest": [Function],
@@ -142739,7 +142731,6 @@ new message content.",
142739
142731
  "email": [Function],
142740
142732
  "facebookPreview": [Function],
142741
142733
  "gallery": [Function],
142742
- "inApp": [Function],
142743
142734
  "language": [Function],
142744
142735
  "navigationConfig": [Function],
142745
142736
  "previewAndTest": [Function],
@@ -158772,7 +158763,6 @@ new message content.",
158772
158763
  "email": [Function],
158773
158764
  "facebookPreview": [Function],
158774
158765
  "gallery": [Function],
158775
- "inApp": [Function],
158776
158766
  "language": [Function],
158777
158767
  "navigationConfig": [Function],
158778
158768
  "previewAndTest": [Function],
@@ -174805,7 +174795,6 @@ new message content.",
174805
174795
  "email": [Function],
174806
174796
  "facebookPreview": [Function],
174807
174797
  "gallery": [Function],
174808
- "inApp": [Function],
174809
174798
  "language": [Function],
174810
174799
  "navigationConfig": [Function],
174811
174800
  "previewAndTest": [Function],
@@ -190838,7 +190827,6 @@ new message content.",
190838
190827
  "email": [Function],
190839
190828
  "facebookPreview": [Function],
190840
190829
  "gallery": [Function],
190841
- "inApp": [Function],
190842
190830
  "language": [Function],
190843
190831
  "navigationConfig": [Function],
190844
190832
  "previewAndTest": [Function],
@@ -243,6 +243,7 @@ export const SmsTraiEdit = (props) => {
243
243
  location,
244
244
  tagModule: getDefaultTags,
245
245
  eventContextTags,
246
+ isFullMode,
246
247
  }) || {};
247
248
  updateIsTagValidationError(
248
249
  tagValidationResponse.unsupportedTags.length > 0,
@@ -2281,7 +2281,6 @@ new message content.",
2281
2281
  "email": [Function],
2282
2282
  "facebookPreview": [Function],
2283
2283
  "gallery": [Function],
2284
- "inApp": [Function],
2285
2284
  "language": [Function],
2286
2285
  "navigationConfig": [Function],
2287
2286
  "previewAndTest": [Function],
@@ -13328,7 +13327,6 @@ new message content.",
13328
13327
  "email": [Function],
13329
13328
  "facebookPreview": [Function],
13330
13329
  "gallery": [Function],
13331
- "inApp": [Function],
13332
13330
  "language": [Function],
13333
13331
  "navigationConfig": [Function],
13334
13332
  "previewAndTest": [Function],
@@ -24121,7 +24119,6 @@ new message content.",
24121
24119
  "email": [Function],
24122
24120
  "facebookPreview": [Function],
24123
24121
  "gallery": [Function],
24124
- "inApp": [Function],
24125
24122
  "language": [Function],
24126
24123
  "navigationConfig": [Function],
24127
24124
  "previewAndTest": [Function],
@@ -34914,7 +34911,6 @@ new message content.",
34914
34911
  "email": [Function],
34915
34912
  "facebookPreview": [Function],
34916
34913
  "gallery": [Function],
34917
- "inApp": [Function],
34918
34914
  "language": [Function],
34919
34915
  "navigationConfig": [Function],
34920
34916
  "previewAndTest": [Function],
@@ -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)? (