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

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 (133) 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 -18
  8. package/utils/common.js +0 -5
  9. package/utils/commonUtils.js +5 -28
  10. package/utils/tests/commonUtil.test.js +0 -224
  11. package/utils/transformTemplateConfig.js +10 -0
  12. package/v2Components/CapDeviceContent/index.js +56 -61
  13. package/v2Components/CapTagList/index.js +1 -6
  14. package/v2Components/CapTagListWithInput/index.js +1 -5
  15. package/v2Components/CapTagListWithInput/messages.js +1 -1
  16. package/v2Components/CapWhatsappCTA/tests/index.test.js +0 -5
  17. package/v2Components/ErrorInfoNote/index.js +72 -447
  18. package/v2Components/ErrorInfoNote/messages.js +0 -22
  19. package/v2Components/ErrorInfoNote/style.scss +4 -280
  20. package/v2Components/FormBuilder/tests/index.test.js +4 -13
  21. package/v2Components/HtmlEditor/HTMLEditor.js +94 -642
  22. package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +133 -1135
  23. package/v2Components/HtmlEditor/__tests__/index.lazy.test.js +16 -27
  24. package/v2Components/HtmlEditor/_htmlEditor.scss +45 -108
  25. package/v2Components/HtmlEditor/_index.lazy.scss +1 -1
  26. package/v2Components/HtmlEditor/components/CodeEditorPane/_codeEditorPane.scss +101 -13
  27. package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +139 -148
  28. package/v2Components/HtmlEditor/components/DeviceToggle/_deviceToggle.scss +1 -2
  29. package/v2Components/HtmlEditor/components/DeviceToggle/index.js +3 -3
  30. package/v2Components/HtmlEditor/components/EditorToolbar/_editorToolbar.scss +0 -9
  31. package/v2Components/HtmlEditor/components/EditorToolbar/index.js +1 -1
  32. package/v2Components/HtmlEditor/components/FullscreenModal/_fullscreenModal.scss +0 -22
  33. package/v2Components/HtmlEditor/components/InAppPreviewPane/DeviceFrame.js +7 -4
  34. package/v2Components/HtmlEditor/components/InAppPreviewPane/__tests__/DeviceFrame.test.js +45 -35
  35. package/v2Components/HtmlEditor/components/InAppPreviewPane/_inAppPreviewPane.scss +3 -1
  36. package/v2Components/HtmlEditor/components/InAppPreviewPane/constants.js +33 -33
  37. package/v2Components/HtmlEditor/components/InAppPreviewPane/index.js +6 -7
  38. package/v2Components/HtmlEditor/components/PreviewPane/_previewPane.scss +6 -3
  39. package/v2Components/HtmlEditor/components/PreviewPane/index.js +13 -11
  40. package/v2Components/HtmlEditor/components/SplitContainer/_splitContainer.scss +1 -1
  41. package/v2Components/HtmlEditor/components/ValidationErrorDisplay/__tests__/index.test.js +152 -0
  42. package/v2Components/HtmlEditor/components/ValidationErrorDisplay/index.js +31 -49
  43. package/v2Components/HtmlEditor/constants.js +20 -29
  44. package/v2Components/HtmlEditor/hooks/__tests__/useInAppContent.test.js +16 -373
  45. package/v2Components/HtmlEditor/hooks/useEditorContent.js +2 -5
  46. package/v2Components/HtmlEditor/hooks/useInAppContent.js +146 -88
  47. package/v2Components/HtmlEditor/hooks/useValidation.js +45 -150
  48. package/v2Components/HtmlEditor/index.js +1 -1
  49. package/v2Components/HtmlEditor/messages.js +85 -95
  50. package/v2Components/HtmlEditor/utils/liquidTemplateSupport.js +102 -134
  51. package/v2Components/HtmlEditor/utils/properSyntaxHighlighting.js +25 -23
  52. package/v2Components/HtmlEditor/utils/validationAdapter.js +41 -66
  53. package/v2Components/MobilePushPreviewV2/index.js +7 -32
  54. package/v2Components/TemplatePreview/_templatePreview.scss +24 -44
  55. package/v2Components/TemplatePreview/index.js +32 -47
  56. package/v2Components/TemplatePreview/messages.js +0 -4
  57. package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +0 -1
  58. package/v2Components/TestAndPreviewSlidebox/index.js +25 -31
  59. package/v2Containers/BeeEditor/index.js +90 -172
  60. package/v2Containers/CreativesContainer/SlideBoxContent.js +51 -128
  61. package/v2Containers/CreativesContainer/SlideBoxFooter.js +12 -113
  62. package/v2Containers/CreativesContainer/SlideBoxHeader.js +1 -2
  63. package/v2Containers/CreativesContainer/constants.js +0 -1
  64. package/v2Containers/CreativesContainer/index.js +46 -238
  65. package/v2Containers/CreativesContainer/messages.js +0 -8
  66. package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +2 -11
  67. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +50 -38
  68. package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +0 -91
  69. package/v2Containers/Email/actions.js +0 -7
  70. package/v2Containers/Email/constants.js +1 -5
  71. package/v2Containers/Email/index.js +30 -229
  72. package/v2Containers/Email/messages.js +0 -32
  73. package/v2Containers/Email/reducer.js +1 -12
  74. package/v2Containers/Email/sagas.js +7 -61
  75. package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +0 -2
  76. package/v2Containers/Email/tests/sagas.test.js +1 -1
  77. package/v2Containers/EmailWrapper/components/EmailWrapperView.js +15 -210
  78. package/v2Containers/EmailWrapper/components/HTMLEditorTesting.js +74 -40
  79. package/v2Containers/EmailWrapper/components/__tests__/HTMLEditorTesting.test.js +67 -2
  80. package/v2Containers/EmailWrapper/constants.js +0 -2
  81. package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +77 -629
  82. package/v2Containers/EmailWrapper/index.js +23 -103
  83. package/v2Containers/EmailWrapper/messages.js +1 -61
  84. package/v2Containers/EmailWrapper/tests/EmailWrapperView.test.js +214 -0
  85. package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +77 -509
  86. package/v2Containers/InApp/actions.js +0 -7
  87. package/v2Containers/InApp/constants.js +4 -20
  88. package/v2Containers/InApp/index.js +357 -801
  89. package/v2Containers/InApp/index.scss +3 -4
  90. package/v2Containers/InApp/messages.js +3 -7
  91. package/v2Containers/InApp/reducer.js +3 -21
  92. package/v2Containers/InApp/sagas.js +9 -29
  93. package/v2Containers/InApp/selectors.js +5 -25
  94. package/v2Containers/InApp/tests/index.test.js +50 -154
  95. package/v2Containers/InApp/tests/reducer.test.js +0 -34
  96. package/v2Containers/InApp/tests/sagas.test.js +9 -61
  97. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +0 -3
  98. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +0 -2
  99. package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +0 -2
  100. package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +0 -9
  101. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +0 -12
  102. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +0 -4
  103. package/v2Containers/TagList/index.js +19 -62
  104. package/v2Containers/Templates/_templates.scss +1 -60
  105. package/v2Containers/Templates/index.js +4 -89
  106. package/v2Containers/Templates/messages.js +0 -4
  107. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +0 -35
  108. package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +0 -874
  109. package/v2Components/HtmlEditor/components/ValidationTabs/_validationTabs.scss +0 -254
  110. package/v2Components/HtmlEditor/components/ValidationTabs/index.js +0 -363
  111. package/v2Components/HtmlEditor/components/ValidationTabs/messages.js +0 -51
  112. package/v2Components/HtmlEditor/hooks/__tests__/useValidation.apiErrors.test.js +0 -630
  113. package/v2Containers/BeePopupEditor/constants.js +0 -10
  114. package/v2Containers/BeePopupEditor/index.js +0 -193
  115. package/v2Containers/BeePopupEditor/tests/index.test.js +0 -627
  116. package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +0 -1317
  117. package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +0 -1605
  118. package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +0 -520
  119. package/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +0 -643
  120. package/v2Containers/InApp/__tests__/InAppHTMLEditor.test.js +0 -376
  121. package/v2Containers/InApp/__tests__/sagas.test.js +0 -363
  122. package/v2Containers/InApp/tests/selectors.test.js +0 -612
  123. package/v2Containers/InAppWrapper/components/InAppWrapperView.js +0 -162
  124. package/v2Containers/InAppWrapper/components/__tests__/InAppWrapperView.test.js +0 -267
  125. package/v2Containers/InAppWrapper/components/inAppWrapperView.scss +0 -9
  126. package/v2Containers/InAppWrapper/constants.js +0 -16
  127. package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +0 -473
  128. package/v2Containers/InAppWrapper/hooks/useInAppWrapper.js +0 -198
  129. package/v2Containers/InAppWrapper/index.js +0 -148
  130. package/v2Containers/InAppWrapper/messages.js +0 -49
  131. package/v2Containers/InappAdvance/index.js +0 -1099
  132. package/v2Containers/InappAdvance/index.scss +0 -10
  133. 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],
@@ -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],
@@ -14106,7 +14105,6 @@ new message content.",
14106
14105
  "email": [Function],
14107
14106
  "facebookPreview": [Function],
14108
14107
  "gallery": [Function],
14109
- "inApp": [Function],
14110
14108
  "language": [Function],
14111
14109
  "navigationConfig": [Function],
14112
14110
  "previewAndTest": [Function],
@@ -25931,7 +25929,6 @@ new message content.",
25931
25929
  "email": [Function],
25932
25930
  "facebookPreview": [Function],
25933
25931
  "gallery": [Function],
25934
- "inApp": [Function],
25935
25932
  "language": [Function],
25936
25933
  "navigationConfig": [Function],
25937
25934
  "previewAndTest": [Function],
@@ -37910,7 +37907,6 @@ new message content.",
37910
37907
  "email": [Function],
37911
37908
  "facebookPreview": [Function],
37912
37909
  "gallery": [Function],
37913
- "inApp": [Function],
37914
37910
  "language": [Function],
37915
37911
  "navigationConfig": [Function],
37916
37912
  "previewAndTest": [Function],
@@ -50049,7 +50045,6 @@ new message content.",
50049
50045
  "email": [Function],
50050
50046
  "facebookPreview": [Function],
50051
50047
  "gallery": [Function],
50052
- "inApp": [Function],
50053
50048
  "language": [Function],
50054
50049
  "navigationConfig": [Function],
50055
50050
  "previewAndTest": [Function],
@@ -61874,7 +61869,6 @@ new message content.",
61874
61869
  "email": [Function],
61875
61870
  "facebookPreview": [Function],
61876
61871
  "gallery": [Function],
61877
- "inApp": [Function],
61878
61872
  "language": [Function],
61879
61873
  "navigationConfig": [Function],
61880
61874
  "previewAndTest": [Function],
@@ -75364,7 +75358,6 @@ new message content.",
75364
75358
  "email": [Function],
75365
75359
  "facebookPreview": [Function],
75366
75360
  "gallery": [Function],
75367
- "inApp": [Function],
75368
75361
  "language": [Function],
75369
75362
  "navigationConfig": [Function],
75370
75363
  "previewAndTest": [Function],
@@ -88854,7 +88847,6 @@ new message content.",
88854
88847
  "email": [Function],
88855
88848
  "facebookPreview": [Function],
88856
88849
  "gallery": [Function],
88857
- "inApp": [Function],
88858
88850
  "language": [Function],
88859
88851
  "navigationConfig": [Function],
88860
88852
  "previewAndTest": [Function],
@@ -101915,7 +101907,6 @@ new message content.",
101915
101907
  "email": [Function],
101916
101908
  "facebookPreview": [Function],
101917
101909
  "gallery": [Function],
101918
- "inApp": [Function],
101919
101910
  "language": [Function],
101920
101911
  "navigationConfig": [Function],
101921
101912
  "previewAndTest": [Function],
@@ -113740,7 +113731,6 @@ new message content.",
113740
113731
  "email": [Function],
113741
113732
  "facebookPreview": [Function],
113742
113733
  "gallery": [Function],
113743
- "inApp": [Function],
113744
113734
  "language": [Function],
113745
113735
  "navigationConfig": [Function],
113746
113736
  "previewAndTest": [Function],
@@ -125565,7 +125555,6 @@ new message content.",
125565
125555
  "email": [Function],
125566
125556
  "facebookPreview": [Function],
125567
125557
  "gallery": [Function],
125568
- "inApp": [Function],
125569
125558
  "language": [Function],
125570
125559
  "navigationConfig": [Function],
125571
125560
  "previewAndTest": [Function],
@@ -137390,7 +137379,6 @@ new message content.",
137390
137379
  "email": [Function],
137391
137380
  "facebookPreview": [Function],
137392
137381
  "gallery": [Function],
137393
- "inApp": [Function],
137394
137382
  "language": [Function],
137395
137383
  "navigationConfig": [Function],
137396
137384
  "previewAndTest": [Function],
@@ -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],
@@ -9336,7 +9335,6 @@ new message content.",
9336
9335
  "email": [Function],
9337
9336
  "facebookPreview": [Function],
9338
9337
  "gallery": [Function],
9339
- "inApp": [Function],
9340
9338
  "language": [Function],
9341
9339
  "navigationConfig": [Function],
9342
9340
  "previewAndTest": [Function],
@@ -16197,7 +16195,6 @@ new message content.",
16197
16195
  "email": [Function],
16198
16196
  "facebookPreview": [Function],
16199
16197
  "gallery": [Function],
16200
- "inApp": [Function],
16201
16198
  "language": [Function],
16202
16199
  "navigationConfig": [Function],
16203
16200
  "previewAndTest": [Function],
@@ -23058,7 +23055,6 @@ new message content.",
23058
23055
  "email": [Function],
23059
23056
  "facebookPreview": [Function],
23060
23057
  "gallery": [Function],
23061
- "inApp": [Function],
23062
23058
  "language": [Function],
23063
23059
  "navigationConfig": [Function],
23064
23060
  "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,
@@ -313,64 +313,6 @@
313
313
  }
314
314
  }
315
315
  }
316
- .INAPP {
317
- margin-bottom: $CAP_SPACE_12;
318
- .inapp-container {
319
- margin-top: $CAP_SPACE_24;
320
- }
321
- // Modal Layout - centered
322
- .inapp-modal-layout {
323
- position: absolute;
324
- display: flex;
325
- width: 12rem;
326
- top: 10%;
327
- left: 10%;
328
- bottom: 5%;
329
- overflow: hidden;
330
- background-color: $CAP_WHITE;
331
- border-radius: $CAP_SPACE_08;
332
- }
333
-
334
- // Full Screen Layout
335
- .inapp-fullscreen-layout {
336
- position: absolute;
337
- display: flex;
338
- width: 12rem;
339
- left: 10%;
340
- top: 1%;
341
- bottom: 1%;
342
- overflow: hidden;
343
- background-color: $CAP_WHITE;
344
- border-radius: $CAP_SPACE_08;
345
- }
346
-
347
- // Top Banner Layout
348
- .inapp-top-banner-layout {
349
- position: absolute;
350
- display: flex;
351
- width: 12rem;
352
- left: 10%;
353
- top: 1%;
354
- bottom: 20%;
355
- overflow: hidden;
356
- background-color: $CAP_WHITE;
357
- border-radius: $CAP_SPACE_08;
358
- }
359
-
360
- // Bottom Banner Layout
361
- .inapp-bottom-banner-layout {
362
- position: absolute;
363
- display: flex;
364
- justify-content: center;
365
- width: 12rem;
366
- left: 10%;
367
- top: 50%;
368
- bottom: 2%;
369
- overflow: hidden;
370
- background-color: $CAP_WHITE;
371
- border-radius: $CAP_SPACE_08;
372
- }
373
- }
374
316
  }
375
317
 
376
318
  .create-new-link{
@@ -753,8 +695,7 @@
753
695
  }
754
696
 
755
697
  .whatsapp-filters,
756
- .zalo-filters,
757
- .inapp-filters {
698
+ .zalo-filters {
758
699
  display: flex;
759
700
  width: 100%;
760
701
  padding-left: 8px;
@@ -125,14 +125,13 @@ import {
125
125
  VIDEO,
126
126
  GIF,
127
127
  } from '../Whatsapp/constants';
128
- import { INAPP_LAYOUT_DETAILS, INAPP_MESSAGE_LAYOUT_TYPES, INAPP_MEDIA_TYPES, BIG_HTML, ANDROID, IOS } from '../InApp/constants';
128
+ import { INAPP_LAYOUT_DETAILS } from '../InApp/constants';
129
129
  import { ZALO_STATUS_OPTIONS, ZALO_STATUSES } from '../Zalo/constants';
130
130
  import { getWhatsappContent, getWhatsappStatus, getWhatsappCategory, getWhatsappCta, getWhatsappQuickReply, getWhatsappAutoFill, getWhatsappCarouselButtonView } from '../Whatsapp/utils';
131
131
  import { getRCSContent } from '../Rcs/utils';
132
132
  import {RCS_STATUSES} from '../Rcs/constants';
133
133
  import zaloMessages from '../Zalo/messages';
134
134
  import rcsMessages from '../Rcs/messages';
135
- import inAppMessages from '../InApp/messages';
136
135
  import globalMessages from '../../v2Containers/Cap/messages';
137
136
  import { handlePreviewInNewTab } from '../../utils/common';
138
137
 
@@ -199,29 +198,6 @@ const SMS_FILTERS = {
199
198
  SERVICE_IMPLICIT: 'implicit',
200
199
  };
201
200
 
202
- const INAPP_LAYOUT_OPTIONS = [
203
- {
204
- key: 'popup',
205
- value: INAPP_MESSAGE_LAYOUT_TYPES.MODAL,
206
- label: <FormattedMessage {...inAppMessages.layoutModal} />,
207
- },
208
- {
209
- key: 'topBanner',
210
- value: INAPP_MESSAGE_LAYOUT_TYPES.TOPBANNER,
211
- label: <FormattedMessage {...inAppMessages.layoutTopBanner} />,
212
- },
213
- {
214
- key: 'bottomBanner',
215
- value: INAPP_MESSAGE_LAYOUT_TYPES.BOTTOMBANNER,
216
- label: <FormattedMessage {...inAppMessages.layoutBottomBanner} />,
217
- },
218
- {
219
- key: 'fullScreen',
220
- value: INAPP_MESSAGE_LAYOUT_TYPES.FULLSCREEN,
221
- label: <FormattedMessage {...inAppMessages.layoutFullScreen} />,
222
- },
223
- ];
224
-
225
201
  const WHATSAPP_LOWERCASE = WHATSAPP.toLowerCase();
226
202
  const RCS_LOWERCASE = RCS.toLowerCase();
227
203
  const SMS_LOWERCASE = SMS.toLowerCase();
@@ -272,7 +248,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
272
248
  selectedWhatsappStatus: '',
273
249
  selectedWhatsappCategory: '',
274
250
  selectedZaloStatus: '',
275
- selectedInAppLayout: '',
276
251
  hostName: '',
277
252
  searchedZaloTemplates: [],
278
253
  searchingZaloTemplate: false,
@@ -1188,19 +1163,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1188
1163
  return templates;
1189
1164
  }
1190
1165
 
1191
- filterInAppTemplates = (templates) => {
1192
- const { selectedInAppLayout } = this.state;
1193
- if (!selectedInAppLayout) {
1194
- return templates;
1195
- }
1196
- return templates.filter((template) => {
1197
- const androidBodyType = get(template, 'versions.base.content.ANDROID.bodyType');
1198
- const iosBodyType = get(template, 'versions.base.content.IOS.bodyType');
1199
- const inappBodyType = androidBodyType || iosBodyType;
1200
- return inappBodyType === selectedInAppLayout;
1201
- });
1202
- }
1203
-
1204
1166
  filterSMSTemplates = (templates) => {
1205
1167
  const { smsFilter } = this.state;
1206
1168
  if (SMS_FILTERS.ALL === smsFilter) {
@@ -1287,9 +1249,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1287
1249
  case ZALO:
1288
1250
  filteredTemplates = this.filterZaloTemplates(templates);
1289
1251
  break;
1290
- case INAPP:
1291
- filteredTemplates = this.filterInAppTemplates(templates);
1292
- break;
1293
1252
  default:
1294
1253
  break;
1295
1254
  }
@@ -1509,12 +1468,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1509
1468
  templateData.isNewMobilePush = commonUtil.hasNewMobilePushFeatureEnabled();
1510
1469
  }
1511
1470
  break;
1512
- case INAPP: {
1513
- // Pass the full template object to CapCustomCard so getInAppContent can extract the data
1514
- // Similar to how MOBILE_PUSH passes the full template when new feature is enabled
1471
+ case INAPP:
1515
1472
  templateData.content = template;
1516
1473
  break;
1517
- }
1518
1474
  case WECHAT:
1519
1475
  templateData.content = this.prepareWeChatPreviewData(template);
1520
1476
  break;
@@ -1828,7 +1784,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1828
1784
  return (<div>
1829
1785
  {[WECHAT, MOBILE_PUSH, INAPP, WHATSAPP, ZALO,RCS].includes(currentChannel) && this.showAccountName()}
1830
1786
  {filterContent}
1831
- {[WHATSAPP, ZALO, INAPP,RCS].includes(currentChannel) && this.selectedFilters()}
1787
+ {[WHATSAPP, ZALO,RCS].includes(currentChannel) && this.selectedFilters()}
1832
1788
  {<div>
1833
1789
  {!isEmpty(filteredTemplates) || !isEmpty(this.state.searchText) || !isEmpty(this.props.Templates.templateError) ? (
1834
1790
  <div className={!isEmpty(this.state.searchText) && isEmpty(cardDataList) ? '' : this.isFullMode() ? "v2-pagination-container" : "v2-pagination-container-half"}>
@@ -2038,9 +1994,6 @@ return (<div>
2038
1994
 
2039
1995
  prepareWeChatMappedPreviewData(content, templateTags, tagData) {
2040
1996
  let formattedContent = cloneDeep(content);
2041
- if (!formattedContent || typeof formattedContent !== 'string') {
2042
- return formattedContent || '';
2043
- }
2044
1997
  forEach(templateTags, (tag) => {
2045
1998
  if (tagData[tag].value !== undefined) {
2046
1999
  formattedContent = formattedContent.replace(`{{${tag}.DATA}}`, tagData[tag].value);
@@ -3236,19 +3189,14 @@ return (<div>
3236
3189
  }
3237
3190
 
3238
3191
  removeZaloFilter = () => this.setState({ selectedZaloStatus: null });
3239
- removeInAppLayoutFilter = () => this.setState({ selectedInAppLayout: '' });
3240
3192
 
3241
3193
  selectedFilters = () => {
3242
- const { selectedWhatsappStatus, selectedWhatsappCategory, selectedZaloStatus, selectedInAppLayout } = this.state;
3194
+ const { selectedWhatsappStatus, selectedWhatsappCategory, selectedZaloStatus } = this.state;
3243
3195
  const {
3244
3196
  intl: {
3245
3197
  formatMessage,
3246
3198
  },
3247
3199
  } = this.props;
3248
- const getInAppLayoutLabel = (layoutValue) => {
3249
- const layoutOption = INAPP_LAYOUT_OPTIONS.find(opt => opt.value === layoutValue);
3250
- return layoutOption ? layoutOption.label : layoutValue;
3251
- };
3252
3200
  return (
3253
3201
  <CapRow type="flex" align="middle" className="selected-whatsapp-filters">
3254
3202
  {
@@ -3283,23 +3231,6 @@ return (<div>
3283
3231
  </CapTag>
3284
3232
  ) : null
3285
3233
  }
3286
- {
3287
- selectedInAppLayout ? (
3288
- <CapTag closable onClose={this.removeInAppLayoutFilter}>
3289
- {formatMessage(messages.layout)}: {getInAppLayoutLabel(selectedInAppLayout)}
3290
- </CapTag>
3291
- ) : null
3292
- }
3293
- {
3294
- selectedInAppLayout ? (
3295
- <CapLink
3296
- onClick={() => {
3297
- this.removeInAppLayoutFilter();
3298
- }}
3299
- title={this.props.intl.formatMessage(messages.clearAll)}
3300
- />
3301
- ) : null
3302
- }
3303
3234
  </CapRow>
3304
3235
  );
3305
3236
  }
@@ -3310,7 +3241,6 @@ return (<div>
3310
3241
  setLineFilter = (e) => this.setState({lineFilter: e.target.value});
3311
3242
  setSMSFilter = (e) => this.setState({smsFilter: e.target.value});
3312
3243
  setZaloStatus = (value) => this.setState({selectedZaloStatus: value?.item?.props?.value});
3313
- setInAppLayout = (value) => this.setState({selectedInAppLayout: value?.item?.props?.value});
3314
3244
 
3315
3245
  openCreativesFullMode = () => {
3316
3246
  const channelLowerCase = this.state.channel.toLowerCase();
@@ -3563,21 +3493,6 @@ return (<div>
3563
3493
  )
3564
3494
  : () => null
3565
3495
  }
3566
- {
3567
- channel.toUpperCase() === INAPP && (
3568
- <div className="inapp-filters">
3569
- <CapSelectFilter
3570
- placement="bottomLeft"
3571
- data={INAPP_LAYOUT_OPTIONS}
3572
- onSelect={this.setInAppLayout}
3573
- selectedValue={this.state.selectedInAppLayout}
3574
- placeholder="Layout"
3575
- showBadge
3576
- width="120px"
3577
- />
3578
- </div>
3579
- )
3580
- }
3581
3496
  <div style={{display: "flex", justifyContent: "space-between", alignItems: 'center'}}>
3582
3497
  {
3583
3498
  this.state?.channel?.toLowerCase() === WHATSAPP_LOWERCASE && (isWhatsappCountExeeded)? (
@@ -534,10 +534,6 @@ export default defineMessages({
534
534
  id: `${scope}.rcsOnlyApprovedTemplates`,
535
535
  defaultMessage: 'Only "Approved" templates are available here, as you can use those templates to create a message.',
536
536
  },
537
- "layout": {
538
- id: `${scope}.layout`,
539
- defaultMessage: `Layout`,
540
- },
541
537
  "status": {
542
538
  id: `${scope}.status`,
543
539
  defaultMessage: 'Status',