@capillarytech/creatives-library 8.0.266-alpha.1 → 8.0.266

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 (280) hide show
  1. package/assets/Android.png +0 -0
  2. package/assets/iOS.png +0 -0
  3. package/constants/unified.js +2 -2
  4. package/initialReducer.js +0 -2
  5. package/package.json +1 -1
  6. package/services/api.js +5 -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 +6 -5
  12. package/utils/commonUtils.js +5 -28
  13. package/utils/imageUrlUpload.js +141 -0
  14. package/utils/tests/commonUtil.test.js +0 -224
  15. package/utils/tests/transformerUtils.test.js +297 -0
  16. package/utils/transformTemplateConfig.js +10 -0
  17. package/utils/transformerUtils.js +40 -0
  18. package/v2Components/CapDeviceContent/index.js +56 -61
  19. package/v2Components/CapImageUpload/constants.js +2 -0
  20. package/v2Components/CapImageUpload/index.js +65 -16
  21. package/v2Components/CapImageUpload/index.scss +4 -1
  22. package/v2Components/CapImageUpload/messages.js +5 -1
  23. package/v2Components/CapImageUrlUpload/constants.js +26 -0
  24. package/v2Components/CapImageUrlUpload/index.js +365 -0
  25. package/v2Components/CapImageUrlUpload/index.scss +35 -0
  26. package/v2Components/CapImageUrlUpload/messages.js +47 -0
  27. package/v2Components/CapTagList/index.js +1 -6
  28. package/v2Components/CapTagListWithInput/index.js +1 -5
  29. package/v2Components/CapTagListWithInput/messages.js +1 -1
  30. package/v2Components/CapWhatsappCTA/tests/index.test.js +0 -5
  31. package/v2Components/ErrorInfoNote/index.js +72 -402
  32. package/v2Components/ErrorInfoNote/messages.js +6 -32
  33. package/v2Components/ErrorInfoNote/style.scss +6 -278
  34. package/v2Components/FormBuilder/tests/index.test.js +4 -13
  35. package/v2Components/HtmlEditor/HTMLEditor.js +99 -418
  36. package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +133 -1882
  37. package/v2Components/HtmlEditor/__tests__/index.lazy.test.js +16 -27
  38. package/v2Components/HtmlEditor/_htmlEditor.scss +45 -108
  39. package/v2Components/HtmlEditor/_index.lazy.scss +1 -0
  40. package/v2Components/HtmlEditor/components/CodeEditorPane/_codeEditorPane.scss +102 -23
  41. package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +140 -148
  42. package/v2Components/HtmlEditor/components/DeviceToggle/_deviceToggle.scss +1 -2
  43. package/v2Components/HtmlEditor/components/DeviceToggle/index.js +3 -3
  44. package/v2Components/HtmlEditor/components/EditorToolbar/_editorToolbar.scss +1 -9
  45. package/v2Components/HtmlEditor/components/EditorToolbar/index.js +6 -31
  46. package/v2Components/HtmlEditor/components/FullscreenModal/_fullscreenModal.scss +0 -22
  47. package/v2Components/HtmlEditor/components/InAppPreviewPane/DeviceFrame.js +7 -4
  48. package/v2Components/HtmlEditor/components/InAppPreviewPane/__tests__/DeviceFrame.test.js +45 -35
  49. package/v2Components/HtmlEditor/components/InAppPreviewPane/_inAppPreviewPane.scss +3 -1
  50. package/v2Components/HtmlEditor/components/InAppPreviewPane/constants.js +33 -33
  51. package/v2Components/HtmlEditor/components/InAppPreviewPane/index.js +6 -7
  52. package/v2Components/HtmlEditor/components/PreviewPane/_previewPane.scss +10 -7
  53. package/v2Components/HtmlEditor/components/PreviewPane/index.js +43 -22
  54. package/v2Components/HtmlEditor/components/SplitContainer/_splitContainer.scss +1 -1
  55. package/v2Components/HtmlEditor/components/ValidationErrorDisplay/__tests__/index.test.js +152 -0
  56. package/v2Components/HtmlEditor/components/ValidationErrorDisplay/_validationErrorDisplay.scss +0 -18
  57. package/v2Components/HtmlEditor/components/ValidationErrorDisplay/index.js +31 -36
  58. package/v2Components/HtmlEditor/components/ValidationPanel/_validationPanel.scss +34 -46
  59. package/v2Components/HtmlEditor/components/ValidationPanel/index.js +46 -52
  60. package/v2Components/HtmlEditor/constants.js +20 -45
  61. package/v2Components/HtmlEditor/hooks/__tests__/useInAppContent.test.js +16 -373
  62. package/v2Components/HtmlEditor/hooks/__tests__/useValidation.test.js +16 -351
  63. package/v2Components/HtmlEditor/hooks/useEditorContent.js +2 -5
  64. package/v2Components/HtmlEditor/hooks/useInAppContent.js +146 -88
  65. package/v2Components/HtmlEditor/hooks/useValidation.js +56 -213
  66. package/v2Components/HtmlEditor/index.js +1 -1
  67. package/v2Components/HtmlEditor/messages.js +94 -102
  68. package/v2Components/HtmlEditor/utils/__tests__/htmlValidator.enhanced.test.js +45 -214
  69. package/v2Components/HtmlEditor/utils/__tests__/validationAdapter.test.js +0 -134
  70. package/v2Components/HtmlEditor/utils/contentSanitizer.js +41 -40
  71. package/v2Components/HtmlEditor/utils/htmlValidator.js +72 -71
  72. package/v2Components/HtmlEditor/utils/liquidTemplateSupport.js +124 -158
  73. package/v2Components/HtmlEditor/utils/properSyntaxHighlighting.js +25 -23
  74. package/v2Components/HtmlEditor/utils/validationAdapter.js +41 -66
  75. package/v2Components/MobilePushPreviewV2/index.js +7 -33
  76. package/v2Components/TemplatePreview/_templatePreview.scss +24 -55
  77. package/v2Components/TemplatePreview/index.js +32 -47
  78. package/v2Components/TemplatePreview/messages.js +0 -4
  79. package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +0 -1
  80. package/v2Containers/App/constants.js +5 -0
  81. package/v2Containers/BeeEditor/index.js +90 -172
  82. package/v2Containers/CreativesContainer/SlideBoxContent.js +108 -129
  83. package/v2Containers/CreativesContainer/SlideBoxFooter.js +13 -163
  84. package/v2Containers/CreativesContainer/SlideBoxHeader.js +2 -2
  85. package/v2Containers/CreativesContainer/constants.js +3 -1
  86. package/v2Containers/CreativesContainer/index.js +215 -243
  87. package/v2Containers/CreativesContainer/messages.js +4 -8
  88. package/v2Containers/CreativesContainer/tests/SlideBoxContent.test.js +210 -0
  89. package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +2 -11
  90. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +354 -38
  91. package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +0 -103
  92. package/v2Containers/Email/actions.js +0 -7
  93. package/v2Containers/Email/constants.js +1 -5
  94. package/v2Containers/Email/index.js +29 -234
  95. package/v2Containers/Email/messages.js +0 -32
  96. package/v2Containers/Email/reducer.js +1 -12
  97. package/v2Containers/Email/sagas.js +7 -61
  98. package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +0 -2
  99. package/v2Containers/Email/tests/reducer.test.js +0 -46
  100. package/v2Containers/Email/tests/sagas.test.js +29 -320
  101. package/v2Containers/EmailWrapper/components/EmailWrapperView.js +21 -212
  102. package/v2Containers/EmailWrapper/components/HTMLEditorTesting.js +74 -40
  103. package/v2Containers/EmailWrapper/components/__tests__/HTMLEditorTesting.test.js +67 -2
  104. package/v2Containers/EmailWrapper/constants.js +0 -2
  105. package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +79 -629
  106. package/v2Containers/EmailWrapper/index.js +23 -103
  107. package/v2Containers/EmailWrapper/messages.js +1 -65
  108. package/v2Containers/EmailWrapper/tests/EmailWrapperView.test.js +214 -0
  109. package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +82 -596
  110. package/v2Containers/InApp/actions.js +0 -7
  111. package/v2Containers/InApp/constants.js +4 -20
  112. package/v2Containers/InApp/index.js +359 -802
  113. package/v2Containers/InApp/index.scss +3 -4
  114. package/v2Containers/InApp/messages.js +3 -7
  115. package/v2Containers/InApp/reducer.js +3 -21
  116. package/v2Containers/InApp/sagas.js +9 -29
  117. package/v2Containers/InApp/selectors.js +5 -25
  118. package/v2Containers/InApp/tests/index.test.js +50 -154
  119. package/v2Containers/InApp/tests/reducer.test.js +0 -34
  120. package/v2Containers/InApp/tests/sagas.test.js +9 -61
  121. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +0 -3
  122. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +0 -2
  123. package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +0 -2
  124. package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +0 -9
  125. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +0 -12
  126. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +0 -4
  127. package/v2Containers/TagList/index.js +19 -62
  128. package/v2Containers/Templates/ChannelTypeIllustration.js +13 -1
  129. package/v2Containers/Templates/_templates.scss +202 -56
  130. package/v2Containers/Templates/actions.js +2 -1
  131. package/v2Containers/Templates/constants.js +1 -0
  132. package/v2Containers/Templates/index.js +278 -123
  133. package/v2Containers/Templates/messages.js +24 -4
  134. package/v2Containers/Templates/reducer.js +2 -0
  135. package/v2Containers/Templates/tests/index.test.js +10 -0
  136. package/v2Containers/TemplatesV2/TemplatesV2.style.js +2 -4
  137. package/v2Containers/TemplatesV2/index.js +15 -7
  138. package/v2Containers/TemplatesV2/messages.js +4 -0
  139. package/v2Containers/WebPush/Create/components/BrandIconSection.js +108 -0
  140. package/v2Containers/WebPush/Create/components/ButtonForm.js +172 -0
  141. package/v2Containers/WebPush/Create/components/ButtonItem.js +101 -0
  142. package/v2Containers/WebPush/Create/components/ButtonList.js +145 -0
  143. package/v2Containers/WebPush/Create/components/ButtonsLinksSection.js +164 -0
  144. package/v2Containers/WebPush/Create/components/ButtonsLinksSection.test.js +463 -0
  145. package/v2Containers/WebPush/Create/components/FormActions.js +54 -0
  146. package/v2Containers/WebPush/Create/components/FormActions.test.js +163 -0
  147. package/v2Containers/WebPush/Create/components/MediaSection.js +142 -0
  148. package/v2Containers/WebPush/Create/components/MediaSection.test.js +341 -0
  149. package/v2Containers/WebPush/Create/components/MessageSection.js +103 -0
  150. package/v2Containers/WebPush/Create/components/MessageSection.test.js +268 -0
  151. package/v2Containers/WebPush/Create/components/NotificationTitleSection.js +87 -0
  152. package/v2Containers/WebPush/Create/components/NotificationTitleSection.test.js +210 -0
  153. package/v2Containers/WebPush/Create/components/TemplateNameSection.js +54 -0
  154. package/v2Containers/WebPush/Create/components/TemplateNameSection.test.js +143 -0
  155. package/v2Containers/WebPush/Create/components/__snapshots__/ButtonsLinksSection.test.js.snap +86 -0
  156. package/v2Containers/WebPush/Create/components/__snapshots__/FormActions.test.js.snap +16 -0
  157. package/v2Containers/WebPush/Create/components/__snapshots__/MediaSection.test.js.snap +41 -0
  158. package/v2Containers/WebPush/Create/components/__snapshots__/MessageSection.test.js.snap +54 -0
  159. package/v2Containers/WebPush/Create/components/__snapshots__/NotificationTitleSection.test.js.snap +37 -0
  160. package/v2Containers/WebPush/Create/components/__snapshots__/TemplateNameSection.test.js.snap +21 -0
  161. package/v2Containers/WebPush/Create/components/_buttons.scss +246 -0
  162. package/v2Containers/WebPush/Create/components/tests/ButtonForm.test.js +554 -0
  163. package/v2Containers/WebPush/Create/components/tests/ButtonItem.test.js +607 -0
  164. package/v2Containers/WebPush/Create/components/tests/ButtonList.test.js +633 -0
  165. package/v2Containers/WebPush/Create/components/tests/__snapshots__/ButtonForm.test.js.snap +666 -0
  166. package/v2Containers/WebPush/Create/components/tests/__snapshots__/ButtonItem.test.js.snap +74 -0
  167. package/v2Containers/WebPush/Create/components/tests/__snapshots__/ButtonList.test.js.snap +78 -0
  168. package/v2Containers/WebPush/Create/hooks/useButtonManagement.js +138 -0
  169. package/v2Containers/WebPush/Create/hooks/useButtonManagement.test.js +406 -0
  170. package/v2Containers/WebPush/Create/hooks/useCharacterCount.js +30 -0
  171. package/v2Containers/WebPush/Create/hooks/useCharacterCount.test.js +151 -0
  172. package/v2Containers/WebPush/Create/hooks/useImageUpload.js +104 -0
  173. package/v2Containers/WebPush/Create/hooks/useImageUpload.test.js +538 -0
  174. package/v2Containers/WebPush/Create/hooks/useTagManagement.js +122 -0
  175. package/v2Containers/WebPush/Create/hooks/useTagManagement.test.js +633 -0
  176. package/v2Containers/WebPush/Create/index.js +1148 -0
  177. package/v2Containers/WebPush/Create/index.scss +134 -0
  178. package/v2Containers/WebPush/Create/messages.js +211 -0
  179. package/v2Containers/WebPush/Create/preview/DevicePreviewContent.js +228 -0
  180. package/v2Containers/WebPush/Create/preview/NotificationContainer.js +294 -0
  181. package/v2Containers/WebPush/Create/preview/PreviewContent.js +90 -0
  182. package/v2Containers/WebPush/Create/preview/PreviewControls.js +305 -0
  183. package/v2Containers/WebPush/Create/preview/PreviewDisclaimer.js +25 -0
  184. package/v2Containers/WebPush/Create/preview/WebPushPreview.js +156 -0
  185. package/v2Containers/WebPush/Create/preview/assets/Light.svg +53 -0
  186. package/v2Containers/WebPush/Create/preview/assets/Top.svg +5 -0
  187. package/v2Containers/WebPush/Create/preview/assets/android-arrow-down.svg +9 -0
  188. package/v2Containers/WebPush/Create/preview/assets/android-arrow-up.svg +9 -0
  189. package/v2Containers/WebPush/Create/preview/assets/chrome-icon.png +0 -0
  190. package/v2Containers/WebPush/Create/preview/assets/edge-icon.png +0 -0
  191. package/v2Containers/WebPush/Create/preview/assets/firefox-icon.svg +106 -0
  192. package/v2Containers/WebPush/Create/preview/assets/iOS.svg +26 -0
  193. package/v2Containers/WebPush/Create/preview/assets/macos-arrow-down-icon.svg +9 -0
  194. package/v2Containers/WebPush/Create/preview/assets/macos-triple-dot-icon.svg +9 -0
  195. package/v2Containers/WebPush/Create/preview/assets/opera-icon.svg +18 -0
  196. package/v2Containers/WebPush/Create/preview/assets/safari-icon.svg +29 -0
  197. package/v2Containers/WebPush/Create/preview/assets/windows-close-icon.svg +9 -0
  198. package/v2Containers/WebPush/Create/preview/assets/windows-triple-dot-icon.svg +9 -0
  199. package/v2Containers/WebPush/Create/preview/components/AndroidMobileChromeHeader.js +51 -0
  200. package/v2Containers/WebPush/Create/preview/components/AndroidMobileExpanded.js +145 -0
  201. package/v2Containers/WebPush/Create/preview/components/IOSHeader.js +45 -0
  202. package/v2Containers/WebPush/Create/preview/components/NotificationExpandedContent.js +68 -0
  203. package/v2Containers/WebPush/Create/preview/components/NotificationHeader.js +61 -0
  204. package/v2Containers/WebPush/Create/preview/components/WindowsChromeExpanded.js +99 -0
  205. package/v2Containers/WebPush/Create/preview/components/tests/AndroidMobileExpanded.test.js +733 -0
  206. package/v2Containers/WebPush/Create/preview/components/tests/WindowsChromeExpanded.test.js +571 -0
  207. package/v2Containers/WebPush/Create/preview/components/tests/__snapshots__/AndroidMobileExpanded.test.js.snap +85 -0
  208. package/v2Containers/WebPush/Create/preview/components/tests/__snapshots__/WindowsChromeExpanded.test.js.snap +81 -0
  209. package/v2Containers/WebPush/Create/preview/config/notificationMappings.js +50 -0
  210. package/v2Containers/WebPush/Create/preview/constants.js +637 -0
  211. package/v2Containers/WebPush/Create/preview/notification-container.scss +79 -0
  212. package/v2Containers/WebPush/Create/preview/preview.scss +358 -0
  213. package/v2Containers/WebPush/Create/preview/styles/_android-mobile-chrome.scss +370 -0
  214. package/v2Containers/WebPush/Create/preview/styles/_android-mobile-edge.scss +12 -0
  215. package/v2Containers/WebPush/Create/preview/styles/_android-mobile-firefox.scss +12 -0
  216. package/v2Containers/WebPush/Create/preview/styles/_android-mobile-opera.scss +12 -0
  217. package/v2Containers/WebPush/Create/preview/styles/_android-tablet-chrome.scss +47 -0
  218. package/v2Containers/WebPush/Create/preview/styles/_android-tablet-edge.scss +11 -0
  219. package/v2Containers/WebPush/Create/preview/styles/_android-tablet-firefox.scss +11 -0
  220. package/v2Containers/WebPush/Create/preview/styles/_android-tablet-opera.scss +11 -0
  221. package/v2Containers/WebPush/Create/preview/styles/_base.scss +207 -0
  222. package/v2Containers/WebPush/Create/preview/styles/_ios.scss +153 -0
  223. package/v2Containers/WebPush/Create/preview/styles/_ipados.scss +107 -0
  224. package/v2Containers/WebPush/Create/preview/styles/_macos-chrome.scss +101 -0
  225. package/v2Containers/WebPush/Create/preview/styles/_windows-chrome.scss +229 -0
  226. package/v2Containers/WebPush/Create/preview/tests/DevicePreviewContent.test.js +906 -0
  227. package/v2Containers/WebPush/Create/preview/tests/NotificationContainer.test.js +1081 -0
  228. package/v2Containers/WebPush/Create/preview/tests/PreviewControls.test.js +723 -0
  229. package/v2Containers/WebPush/Create/preview/tests/WebPushPreview.test.js +1327 -0
  230. package/v2Containers/WebPush/Create/preview/tests/__snapshots__/DevicePreviewContent.test.js.snap +131 -0
  231. package/v2Containers/WebPush/Create/preview/tests/__snapshots__/NotificationContainer.test.js.snap +112 -0
  232. package/v2Containers/WebPush/Create/preview/tests/__snapshots__/PreviewControls.test.js.snap +144 -0
  233. package/v2Containers/WebPush/Create/preview/tests/__snapshots__/WebPushPreview.test.js.snap +129 -0
  234. package/v2Containers/WebPush/Create/utils/payloadBuilder.js +96 -0
  235. package/v2Containers/WebPush/Create/utils/payloadBuilder.test.js +396 -0
  236. package/v2Containers/WebPush/Create/utils/previewUtils.js +89 -0
  237. package/v2Containers/WebPush/Create/utils/urlValidation.js +115 -0
  238. package/v2Containers/WebPush/Create/utils/urlValidation.test.js +449 -0
  239. package/v2Containers/WebPush/Create/utils/validation.js +75 -0
  240. package/v2Containers/WebPush/Create/utils/validation.test.js +283 -0
  241. package/v2Containers/WebPush/actions.js +60 -0
  242. package/v2Containers/WebPush/constants.js +132 -0
  243. package/v2Containers/WebPush/index.js +2 -0
  244. package/v2Containers/WebPush/reducer.js +104 -0
  245. package/v2Containers/WebPush/sagas.js +119 -0
  246. package/v2Containers/WebPush/selectors.js +65 -0
  247. package/v2Containers/WebPush/tests/reducer.test.js +863 -0
  248. package/v2Containers/WebPush/tests/sagas.test.js +566 -0
  249. package/v2Containers/WebPush/tests/selectors.test.js +960 -0
  250. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +0 -34
  251. package/v2Components/ErrorInfoNote/constants.js +0 -1
  252. package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +0 -870
  253. package/v2Components/HtmlEditor/components/ValidationPanel/constants.js +0 -6
  254. package/v2Components/HtmlEditor/components/ValidationTabs/_validationTabs.scss +0 -277
  255. package/v2Components/HtmlEditor/components/ValidationTabs/index.js +0 -295
  256. package/v2Components/HtmlEditor/components/ValidationTabs/messages.js +0 -51
  257. package/v2Components/HtmlEditor/utils/validationConstants.js +0 -38
  258. package/v2Components/MobilePushPreviewV2/constants.js +0 -6
  259. package/v2Containers/BeePopupEditor/_beePopupEditor.scss +0 -14
  260. package/v2Containers/BeePopupEditor/constants.js +0 -10
  261. package/v2Containers/BeePopupEditor/index.js +0 -194
  262. package/v2Containers/BeePopupEditor/tests/index.test.js +0 -627
  263. package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +0 -1246
  264. package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +0 -2472
  265. package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +0 -520
  266. package/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +0 -955
  267. package/v2Containers/InApp/__tests__/InAppHTMLEditor.test.js +0 -376
  268. package/v2Containers/InApp/__tests__/sagas.test.js +0 -363
  269. package/v2Containers/InApp/tests/selectors.test.js +0 -612
  270. package/v2Containers/InAppWrapper/components/InAppWrapperView.js +0 -151
  271. package/v2Containers/InAppWrapper/components/__tests__/InAppWrapperView.test.js +0 -267
  272. package/v2Containers/InAppWrapper/components/inAppWrapperView.scss +0 -23
  273. package/v2Containers/InAppWrapper/constants.js +0 -16
  274. package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +0 -473
  275. package/v2Containers/InAppWrapper/hooks/useInAppWrapper.js +0 -198
  276. package/v2Containers/InAppWrapper/index.js +0 -148
  277. package/v2Containers/InAppWrapper/messages.js +0 -49
  278. package/v2Containers/InappAdvance/index.js +0 -1099
  279. package/v2Containers/InappAdvance/index.scss +0 -10
  280. package/v2Containers/InappAdvance/tests/index.test.js +0 -448
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import {
4
- CAP_SPACE_16, CAP_SPACE_32, CAP_SPACE_56, CAP_SPACE_64,
5
- } from '@capillarytech/cap-ui-library/styled/variables';
3
+ import { CAP_SPACE_32, CAP_SPACE_56, CAP_SPACE_64 } from '@capillarytech/cap-ui-library/styled/variables';
6
4
 
7
5
  import CapSlideBox from '@capillarytech/cap-ui-library/CapSlideBox';
8
6
  import CapHeader from '@capillarytech/cap-ui-library/CapHeader';
@@ -44,8 +42,9 @@ import { makeSelectFetchingCmsData } from '../Email/selectors';
44
42
  import {
45
43
  IMAGE as LINE_IMAGE, IMAGE_MAP, IMAGE_CAROUSEL, VIDEO as LINE_VIDEO, TEMPLATE, STICKER,
46
44
  } from '../Line/Container/constants';
45
+ import {EXTERNAL_URL, SITE_URL, WEBPUSH_MEDIA_TYPES} from '../WebPush/constants';
47
46
  import { IMAGE, VIDEO } from '../Facebook/Advertisement/constant';
48
- import { RCS_STATUSES } from '../Rcs/constants';
47
+ import {RCS_STATUSES} from '../Rcs/constants';
49
48
  import { CREATIVE } from '../Facebook/constants';
50
49
  import { LOYALTY } from '../App/constants';
51
50
  import {
@@ -66,29 +65,19 @@ import {
66
65
  // getTemplateDiffState
67
66
  } from "../../utils/transformerUtils";
68
67
  import { MANUAL_CAROUSEL } from '../MobilePushNew/constants';
69
- import { BIG_HTML } from '../InApp/constants';
70
68
 
71
69
  const classPrefix = 'add-creatives-section';
72
70
  const CREATIVES_CONTAINER = 'creativesContainer';
73
71
 
74
72
  const SlideBoxWrapper = styled.div`
75
73
  .cap-slide-box-v2-container{
76
- .slidebox-header, .slidebox-content-container{
74
+ .slidebox-header, .slidebox-content-container, .slidebox-footer{
77
75
  margin-bottom: ${({ slideBoxWrapperMargin }) => `${slideBoxWrapperMargin}`};
78
76
  padding: 0 rem;
79
77
  &.has-footer{
80
78
  overflow-x: hidden;
81
79
  }
82
80
  }
83
- .slidebox-footer{
84
- /* Only apply margin-bottom to footer when ErrorInfoNote is shown in footer (BEE editor) */
85
- /* For HTML Editor, errors are shown in ValidationErrorDisplay (inside content area), so no footer margin needed */
86
- margin-bottom: ${({ shouldApplyFooterMargin }) => (shouldApplyFooterMargin ? `${CAP_SPACE_16}` : '0')};
87
- padding: 0 rem;
88
- &.has-footer{
89
- overflow-x: hidden;
90
- }
91
- }
92
81
  }
93
82
  `;
94
83
  export class Creatives extends React.Component {
@@ -107,7 +96,6 @@ export class Creatives extends React.Component {
107
96
  currentChannel: this.props.channel || 'sms',
108
97
  weChatTemplateType: '',
109
98
  weChatMaptemplateStep: 0,
110
- inAppEditorType: null,
111
99
  isLiquidValidationError: false,
112
100
  errorMessages: [],
113
101
  liquidErrorMessage: {
@@ -120,15 +108,6 @@ export class Creatives extends React.Component {
120
108
  isTestAndPreviewMode: false, // Add flag to track Test & Preview mode
121
109
  // Performance optimization: Local template name for immediate UI feedback
122
110
  localTemplateName: '',
123
- // Track selected email create mode for new flow (HTML Editor vs Drag & Drop)
124
- selectedEmailCreateMode: null,
125
- // HTML Editor validation state (for email channel)
126
- htmlEditorValidationState: {
127
- isContentEmpty: true,
128
- issueCounts: { errors: 0, warnings: 0, total: 0 },
129
- validationComplete: false, // Flag to track if validation has completed
130
- errorsAcknowledged: false, // Flag to track if user has acknowledged errors by clicking redirection icon
131
- },
132
111
  };
133
112
  this.liquidFlow = Boolean(commonUtil.hasLiquidSupportFeature());
134
113
  this.creativesTemplateSteps = {
@@ -158,7 +137,7 @@ export class Creatives extends React.Component {
158
137
  if (!this.props?.isFullMode) {
159
138
  this.props?.templateActions.getCdnTransformationConfig();
160
139
  }
161
-
140
+
162
141
  // Store loyalty tag props if loyaltyTagFetchingDependencies is provided
163
142
  const { loyaltyTagFetchingDependencies } = this.props;
164
143
  if (loyaltyTagFetchingDependencies) {
@@ -184,9 +163,9 @@ export class Creatives extends React.Component {
184
163
  const isEmptyTemplateName = !value.trim();
185
164
 
186
165
  // 1. IMMEDIATE: Update local state for instant UI feedback
187
- this.setState({
166
+ this.setState({
188
167
  isTemplateNameEmpty: isEmptyTemplateName,
189
- localTemplateName: value,
168
+ localTemplateName: value
190
169
  });
191
170
 
192
171
  // 2. DEBOUNCED: Only debounce the expensive onFormDataChange call
@@ -265,19 +244,8 @@ export class Creatives extends React.Component {
265
244
  onCreateNextStep = () => {
266
245
  this.setState((prevState) => {
267
246
  let templateStep = prevState.templateStep + 1;
268
- const { emailCreateMode, currentChannel, selectedEmailCreateMode } = prevState;
269
-
270
- // Check if we should skip template selection for HTML Editor
271
- const supportCKEditor = commonUtil.hasSupportCKEditor();
272
- const shouldSkipTemplateSelection = !supportCKEditor
273
- && selectedEmailCreateMode === 'html_editor'
274
- && currentChannel.toUpperCase() === constants.EMAIL
275
- && prevState.templateStep === 1; // Only skip if we're at modeSelection step
276
-
277
- if (shouldSkipTemplateSelection) {
278
- // Skip template selection (step 2), go directly to createTemplateContent (step 3)
279
- templateStep = prevState.templateStep + 2;
280
- } else if ((currentChannel.toUpperCase() === constants.EMAIL && emailCreateMode === "upload") || [constants.MOBILE_PUSH, constants.WECHAT, constants.INAPP].includes(currentChannel.toUpperCase())) {
247
+ const { emailCreateMode, currentChannel } = prevState;
248
+ if ((currentChannel.toUpperCase() === constants.EMAIL && emailCreateMode === "upload") || [constants.MOBILE_PUSH, constants.WECHAT, constants.INAPP].includes(currentChannel.toUpperCase())) {
281
249
  templateStep = prevState.templateStep + 2;
282
250
  }
283
251
  return {
@@ -286,21 +254,14 @@ export class Creatives extends React.Component {
286
254
  });
287
255
  }
288
256
 
289
- onEmailModeChange = (mode, selectedMode = null) => {
290
- this.setState({
291
- emailCreateMode: mode,
292
- selectedEmailCreateMode: selectedMode || mode, // Store the selected mode for new flow
293
- });
257
+ onEmailModeChange = (mode) => {
258
+ this.setState({ emailCreateMode: mode });
294
259
  }
295
260
 
296
261
  onInAppModeChange = (mode) => {
297
262
  this.setState({ inAppCreateMode: mode });
298
263
  }
299
264
 
300
- onInAppEditorTypeChange = (editorType) => {
301
- this.setState({ inAppEditorType: editorType });
302
- }
303
-
304
265
  onMobilepushModeChange = (mode) => {
305
266
  this.setState({ mobilePushCreateMode: mode });
306
267
  }
@@ -344,7 +305,7 @@ export class Creatives extends React.Component {
344
305
  }
345
306
  return buttonObj;
346
307
  });
347
- const { url, previewUrl } = media || {};
308
+ const {url, previewUrl} = media || {};
348
309
  return {
349
310
  bodyText: bodyTemplate,
350
311
  varMap: cardVarMapped,
@@ -473,35 +434,14 @@ export class Creatives extends React.Component {
473
434
  }
474
435
  case constants.INAPP: {
475
436
  const mode = get(templateData, 'androidContent.type') || get(templateData, 'iosContent.type') || '';
476
-
477
- // Check if this is a BEE editor template (identified by special title 'bee free template')
478
- const isAndroidBeeEditor = templateData?.androidContent?.type === constants.HTML
479
- && templateData?.androidContent?.title?.toLowerCase() === 'bee free template';
480
- const isIosBeeEditor = templateData?.iosContent?.type === constants.HTML
481
- && templateData?.iosContent?.title?.toLowerCase() === 'bee free template';
482
-
483
437
  creativesTemplateData = {
484
438
  type: channel,
485
439
  name: templateData.messageSubject,
486
440
  versions: {
487
441
  base: {
488
442
  content: {
489
- ANDROID: isAndroidBeeEditor ? {
490
- type: templateData?.androidContent?.type,
491
- bodyType: templateData?.androidContent?.bodyType,
492
- deviceType: constants.ANDROID,
493
- beeHtml: { value: templateData?.androidContent?.message },
494
- beeJson: templateData?.androidContent?.expandableDetails?.message,
495
- isBEEeditor: true,
496
- } : templateData?.androidContent,
497
- IOS: isIosBeeEditor ? {
498
- type: templateData?.iosContent?.type,
499
- bodyType: templateData?.iosContent?.bodyType,
500
- deviceType: constants.IOS,
501
- beeHtml: { value: templateData?.iosContent?.message },
502
- beeJson: templateData?.iosContent?.expandableDetails?.message,
503
- isBEEeditor: true,
504
- } : templateData?.iosContent,
443
+ ANDROID: templateData?.androidContent,
444
+ IOS: templateData?.iosContent,
505
445
  },
506
446
  },
507
447
  },
@@ -736,7 +676,7 @@ export class Creatives extends React.Component {
736
676
  } = templateData || {};
737
677
  const cardContent = (rcsContent.cardContent && rcsContent.cardContent[0]) || {};
738
678
  const Status = RCS_STATUSES.approved || '';
739
-
679
+
740
680
  creativesTemplateData = {
741
681
  type: channel,
742
682
  edit: true,
@@ -769,6 +709,73 @@ export class Creatives extends React.Component {
769
709
  };
770
710
  break;
771
711
  }
712
+ case constants.WEBPUSH: {
713
+ // Convert from campaign format (messageContent.content.content) to creatives format
714
+ const webpushContent = get(templateData, 'content', {});
715
+ const accountId = get(templateData, 'accountId');
716
+ const {
717
+ title,
718
+ message,
719
+ iconImageUrl: brandIcon = "",
720
+ cta,
721
+ expandableDetails
722
+ } = webpushContent || {};
723
+
724
+ // Map cta to onClickAction
725
+ let onClickAction = null;
726
+ if (cta) {
727
+ if (cta?.type === EXTERNAL_URL) {
728
+ onClickAction = {
729
+ type: URL,
730
+ url: cta?.actionLink || '',
731
+ };
732
+ } else {
733
+ onClickAction = {
734
+ type: cta?.type || SITE_URL,
735
+ };
736
+ }
737
+ }
738
+
739
+ // Map expandableDetails.ctas to ctas array
740
+ let ctas = [];
741
+ if (expandableDetails?.ctas && expandableDetails?.ctas?.length > 0) {
742
+ ctas = expandableDetails?.ctas?.map((ctaItem) => ({
743
+ actionText: ctaItem?.title || ctaItem?.actionText || '',
744
+ type: URL,
745
+ actionLink: ctaItem?.actionLink || '',
746
+ }));
747
+ }
748
+
749
+ // Map expandableDetails.media to image if present
750
+ let image = null;
751
+ if (expandableDetails?.media && expandableDetails?.media?.length > 0) {
752
+ const firstMedia = expandableDetails?.media[0];
753
+ if (firstMedia?.type === WEBPUSH_MEDIA_TYPES.IMAGE && firstMedia?.url) {
754
+ image = firstMedia?.url;
755
+ }
756
+ }
757
+
758
+ creativesTemplateData = {
759
+ type: channel,
760
+ name: templateData?.messageSubject,
761
+ versions: {
762
+ base: {
763
+ content: {
764
+ webpush: {
765
+ title: title || '',
766
+ message: message || '',
767
+ ...(brandIcon && { brandIcon }),
768
+ ...(onClickAction && { onClickAction }),
769
+ ...(ctas.length > 0 && { ctas }),
770
+ ...(image && { image, mediaType: IMAGE }),
771
+ },
772
+ },
773
+ },
774
+ },
775
+ definition: { accountId },
776
+ };
777
+ break;
778
+ }
772
779
  default:
773
780
  break;
774
781
  }
@@ -821,7 +828,7 @@ export class Creatives extends React.Component {
821
828
  });
822
829
 
823
830
  getMobilePushCarouselData = (expandableDetails = []) => {
824
- const newExpandableDetails = { ...expandableDetails };
831
+ const newExpandableDetails = {...expandableDetails};
825
832
  newExpandableDetails.style = expandableDetails.style || MANUAL_CAROUSEL;
826
833
  newExpandableDetails.message = expandableDetails.message || '';
827
834
  newExpandableDetails.ctas = expandableDetails.ctas || [];
@@ -916,24 +923,11 @@ export class Creatives extends React.Component {
916
923
  androidContent.custom = custom;
917
924
  }
918
925
  if (channel === constants.MOBILE_PUSH && androidContent?.expandableDetails?.carouselData?.length) {
919
- androidContent.expandableDetails = this.getMobilePushCarouselData({ ...androidContent?.expandableDetails });
920
- }
921
- if (androidContent?.isBEEeditor && androidContent?.beeHtml?.value) {
922
- templateData.androidContent = {};
923
- templateData.androidContent.type = constants.HTML;
924
- templateData.androidContent.message = androidContent?.beeHtml?.value || '';
925
- templateData.androidContent.title = 'bee free template';
926
- templateData.androidContent.bodyType = androidContent?.bodyType;
927
- templateData.androidContent.deviceType = constants.ANDROID;
928
- templateData.androidContent.expandableDetails = {
929
- style: BIG_HTML,
930
- message: androidContent?.beeJson || '',
931
- };
932
- } else if (!androidContent?.isBEEeditor) {
933
- templateData.androidContent = androidContent;
934
- templateData.androidContent.type = androidContent?.type || get(channelTemplate, 'definition.mode', '')?.toUpperCase() || constants.TEXT;
935
- templateData.androidContent.deviceType = constants.ANDROID;
926
+ androidContent.expandableDetails = this.getMobilePushCarouselData({...androidContent?.expandableDetails});
936
927
  }
928
+ templateData.androidContent = androidContent;
929
+ templateData.androidContent.type = androidContent?.type || get(channelTemplate, 'definition.mode', '')?.toUpperCase() || constants.TEXT;
930
+ templateData.androidContent.deviceType = constants.ANDROID;
937
931
  }
938
932
  const iosContent = channel === constants.INAPP ? get(channelTemplate, 'versions.base.content.IOS') : get(channelTemplate, 'versions.base.IOS');
939
933
  if (!isEmpty(iosContent)) {
@@ -951,24 +945,11 @@ export class Creatives extends React.Component {
951
945
  iosContent.custom = custom;
952
946
  }
953
947
  if (channel === constants.MOBILE_PUSH && iosContent?.expandableDetails?.carouselData?.length) {
954
- iosContent.expandableDetails = this.getMobilePushCarouselData({ ...iosContent?.expandableDetails });
955
- }
956
- if (iosContent?.isBEEeditor && iosContent?.beeHtml?.value) {
957
- templateData.iosContent = {};
958
- templateData.iosContent.type = constants.HTML;
959
- templateData.iosContent.message = iosContent?.beeHtml?.value || '';
960
- templateData.iosContent.title = 'bee free template';
961
- templateData.iosContent.bodyType = iosContent?.bodyType;
962
- templateData.iosContent.deviceType = constants.IOS;
963
- templateData.iosContent.expandableDetails = {
964
- style: BIG_HTML,
965
- message: iosContent?.beeJson || '',
966
- };
967
- } else if (!iosContent?.isBEEeditor) {
968
- templateData.iosContent = iosContent;
969
- templateData.iosContent.type = iosContent?.type || get(channelTemplate, 'definition.mode', '')?.toUpperCase() || 'TEXT';
970
- templateData.iosContent.deviceType = constants.IOS;
948
+ iosContent.expandableDetails = this.getMobilePushCarouselData({...iosContent?.expandableDetails});
971
949
  }
950
+ templateData.iosContent = iosContent;
951
+ templateData.iosContent.type = iosContent?.type || get(channelTemplate, 'definition.mode', '')?.toUpperCase() || 'TEXT';
952
+ templateData.iosContent.deviceType = constants.IOS;
972
953
  }
973
954
  templateData.messageSubject = channelTemplate?.name ? channelTemplate?.name : "messageSubject";
974
955
  }
@@ -1183,7 +1164,7 @@ export class Creatives extends React.Component {
1183
1164
  contentType = "",
1184
1165
  cardType = "",
1185
1166
  cardSettings = {},
1186
- } = get(versions, 'base.content.RCS.rcsContent', {});
1167
+ } = get(versions, 'base.content.RCS.rcsContent',{});
1187
1168
  const rcsContent = {
1188
1169
  contentType,
1189
1170
  cardType,
@@ -1209,6 +1190,105 @@ export class Creatives extends React.Component {
1209
1190
  }
1210
1191
  }
1211
1192
  break;
1193
+ case constants.WEBPUSH: {
1194
+ if (template.value) {
1195
+ const channelTemplate = template.value;
1196
+ const accountId = get(channelTemplate, 'definition.accountId');
1197
+ const webpushContent = get(channelTemplate, 'versions.base.content.webpush', {});
1198
+ const {
1199
+ title,
1200
+ message,
1201
+ brandIcon,
1202
+ iconImageUrl: templateImageUrl ,
1203
+ onClickAction,
1204
+ ctas: templateCtas,
1205
+ cta: templateCta,
1206
+ expandableDetails: templateExpandableDetails,
1207
+ image
1208
+ } = webpushContent || {};
1209
+
1210
+ const iconImageUrl = brandIcon || templateImageUrl || '';
1211
+
1212
+ // Map onClickAction to cta
1213
+ let cta = null;
1214
+ if (onClickAction) {
1215
+ if (onClickAction?.type === URL) {
1216
+ cta = {
1217
+ type: EXTERNAL_URL,
1218
+ actionLink: onClickAction?.url || '',
1219
+ };
1220
+ } else {
1221
+ cta = {
1222
+ type: onClickAction?.type || SITE_URL,
1223
+ actionLink: onClickAction?.url || '',
1224
+ };
1225
+ }
1226
+ } else if (templateCta) {
1227
+ // Fallback to cta if onClickAction is not present
1228
+ cta = {
1229
+ type: templateCta?.type || EXTERNAL_URL,
1230
+ actionLink: templateCta?.actionLink || '',
1231
+ };
1232
+ }
1233
+
1234
+ // Map ctas array to expandableDetails.ctas
1235
+ let expandableDetails = null;
1236
+ const hasCtas = templateCtas && templateCtas.length > 0;
1237
+ const hasImage = image;
1238
+
1239
+ if (hasCtas || hasImage) {
1240
+ expandableDetails = {
1241
+ media: [],
1242
+ ctas: [],
1243
+ };
1244
+
1245
+ // Map image to expandableDetails.media
1246
+ if (hasImage) {
1247
+ expandableDetails.media = [{
1248
+ url: image,
1249
+ type: IMAGE,
1250
+ }];
1251
+ }
1252
+
1253
+ // Map ctas array to expandableDetails.ctas
1254
+ if (hasCtas) {
1255
+ expandableDetails.ctas = templateCtas.map((ctaItem) => ({
1256
+ type: ctaItem?.type === URL ? EXTERNAL_URL : ctaItem?.type,
1257
+ action: ctaItem?.action || '',
1258
+ title: ctaItem?.actionText || ctaItem?.title || '',
1259
+ actionLink: ctaItem?.actionLink || '',
1260
+ }));
1261
+ }
1262
+ } else if (templateExpandableDetails) {
1263
+ // If expandableDetails already exists, use it
1264
+ expandableDetails = {
1265
+ media: templateExpandableDetails?.media || [],
1266
+ ctas: templateExpandableDetails?.ctas || [],
1267
+ };
1268
+ }
1269
+
1270
+ // Convert from creatives format to campaign format
1271
+ templateData = {
1272
+ channel,
1273
+ messageContent: {
1274
+ content: {
1275
+ channel: constants.WEBPUSH,
1276
+ accountId,
1277
+ content: {
1278
+ title: title || '',
1279
+ message: message || '',
1280
+ ...(iconImageUrl && { iconImageUrl }),
1281
+ ...(cta && { cta }),
1282
+ ...(expandableDetails && { expandableDetails }),
1283
+ },
1284
+ messageSubject: channelTemplate?.name ? channelTemplate.name : 'messageSubject',
1285
+ offers: [],
1286
+ },
1287
+ },
1288
+ };
1289
+ }
1290
+ break;
1291
+ }
1212
1292
  default:
1213
1293
  break;
1214
1294
  }
@@ -1260,6 +1340,7 @@ export class Creatives extends React.Component {
1260
1340
  case constants.SMS:
1261
1341
  case constants.WECHAT:
1262
1342
  case constants.VIBER:
1343
+ case constants.WEBPUSH:
1263
1344
  break;
1264
1345
  case constants.EMAIL:
1265
1346
  gtmDetails = {
@@ -1321,7 +1402,7 @@ export class Creatives extends React.Component {
1321
1402
  processCentralCommsMetaId = (channel, creativesData) => {
1322
1403
  // Create the payload for the centralcommnsmetaId API call
1323
1404
  const { isLoyaltyModule = false, loyaltyMetaData = {} } = this.props;
1324
- const { actionName, setMetaData = () => { } } = loyaltyMetaData;
1405
+ const { actionName, setMetaData = () => {} } = loyaltyMetaData;
1325
1406
 
1326
1407
  // const isTemplateModified = getTemplateDiffState(
1327
1408
  // channel,
@@ -1371,9 +1452,6 @@ export class Creatives extends React.Component {
1371
1452
  if (prevState.currentChannel.toUpperCase() === constants.EMAIL) {
1372
1453
  newState = { ...newState, emailCreateMode: null };
1373
1454
  }
1374
- if (prevState.currentChannel.toUpperCase() === constants.INAPP) {
1375
- newState = { ...newState, inAppEditorType: null };
1376
- }
1377
1455
  return newState;
1378
1456
  });
1379
1457
  }
@@ -1419,7 +1497,7 @@ export class Creatives extends React.Component {
1419
1497
  shouldShowFooter = () => {
1420
1498
  const { isFullMode } = this.props;
1421
1499
  const {
1422
- slidBoxContent, currentChannel, emailCreateMode, templateNameExists, templateStep, mobilePushCreateMode, weChatTemplateType, templateData, inAppCreateMode,
1500
+ slidBoxContent, currentChannel, emailCreateMode, templateNameExists, templateStep, mobilePushCreateMode, weChatTemplateType, templateData,
1423
1501
  } = this.state;
1424
1502
  const channel = currentChannel.toUpperCase();
1425
1503
  const currentStep = this.creativesTemplateSteps[templateStep];
@@ -1427,13 +1505,6 @@ export class Creatives extends React.Component {
1427
1505
  showFooter = isFullMode && slidBoxContent === "preview";
1428
1506
  const isMobilepush = channel === constants.MOBILE_PUSH;
1429
1507
 
1430
- const supportCKEditor = commonUtil.hasSupportCKEditor();
1431
- if (!supportCKEditor && channel === constants.EMAIL && currentStep === 'modeSelection' && slidBoxContent === 'createTemplate') {
1432
- return true;
1433
- }
1434
- if (!supportCKEditor && channel === constants.EMAIL && currentStep === 'createTemplateContent' && slidBoxContent === 'createTemplate') {
1435
- showFooter = true;
1436
- }
1437
1508
 
1438
1509
  if (!isFullMode) {
1439
1510
  const isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL && currentStep !== 'createTemplateContent';
@@ -1445,12 +1516,7 @@ export class Creatives extends React.Component {
1445
1516
  }
1446
1517
  } else if (channel === constants.EMAIL && isFullMode) {
1447
1518
  const isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL && currentStep !== 'createTemplateContent';
1448
- // CK editor flow: show footer on mode selection when a card is selected so user sees Continue (disabled until name + card)
1449
- if (supportCKEditor && slidBoxContent === 'createTemplate' && currentStep === 'modeSelection') {
1450
- showFooter = !!emailCreateMode;
1451
- } else {
1452
- showFooter = isEmailCreate && emailCreateMode && templateNameExists;
1453
- }
1519
+ showFooter = isEmailCreate && emailCreateMode && templateNameExists;
1454
1520
  }
1455
1521
  if (channel === constants.EMAIL && emailCreateMode === "upload") {
1456
1522
  showFooter = showFooter && !this.props.isUploading;
@@ -1474,7 +1540,6 @@ export class Creatives extends React.Component {
1474
1540
  showFooter = true;
1475
1541
  }
1476
1542
 
1477
-
1478
1543
  if (showFooter) {
1479
1544
  if (slidBoxContent === "createTemplate" && ((channel === constants.EMAIL && currentStep === 'createTemplateContent')
1480
1545
  || ([constants.SMS, constants.WECHAT].includes(channel) && currentStep === 'modeSelection'))) {
@@ -1497,7 +1562,7 @@ export class Creatives extends React.Component {
1497
1562
 
1498
1563
  shouldShowDoneFooter = () => {
1499
1564
  const {
1500
- slidBoxContent, templateStep, currentChannel, templateData, inAppCreateMode,
1565
+ slidBoxContent, templateStep, currentChannel, templateData,
1501
1566
  } = this.state;
1502
1567
  const { isFullMode } = this.props;
1503
1568
  const currentStep = this.creativesTemplateSteps[templateStep];
@@ -1505,17 +1570,10 @@ export class Creatives extends React.Component {
1505
1570
  const channelName = !isFullMode && templateData ? templateData.type : currentChannel;
1506
1571
  const channel = channelName?.toUpperCase();
1507
1572
 
1508
- // Check supportCKEditor flag for new HTML editor flow
1509
- const supportCKEditor = commonUtil.hasSupportCKEditor();
1573
+
1510
1574
  if (channel === constants.EMAIL || channel === constants.SMS) {
1511
1575
  const isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL && currentStep !== 'createTemplateContent';
1512
-
1513
- // For new HTML editor flow (when supportCKEditor is false), show Done footer when in createTemplateContent step
1514
- if (!supportCKEditor && channel === constants.EMAIL && slidBoxContent === 'createTemplate' && currentStep === 'createTemplateContent') {
1515
- showDone = true;
1516
- } else {
1517
- showDone = (slidBoxContent === 'editTemplate' || slidBoxContent === 'createTemplate') && !isEmailCreate;
1518
- }
1576
+ showDone = (slidBoxContent === 'editTemplate' || slidBoxContent === 'createTemplate') && !isEmailCreate;
1519
1577
  } else if ([constants.WECHAT, constants.MOBILE_PUSH].includes(channel)) {
1520
1578
  showDone = currentStep === "createTemplateContent" || slidBoxContent === "editTemplate";
1521
1579
 
@@ -1525,6 +1583,7 @@ export class Creatives extends React.Component {
1525
1583
  }
1526
1584
  }
1527
1585
 
1586
+
1528
1587
  return showDone;
1529
1588
  }
1530
1589
 
@@ -1544,18 +1603,18 @@ export class Creatives extends React.Component {
1544
1603
  templateNameComponentInput = ({ formData, onFormDataChange, name }) => {
1545
1604
  // Use local state for immediate UI feedback, fallback to prop value
1546
1605
  const displayValue = this.state.localTemplateName !== '' ? this.state.localTemplateName : name;
1547
-
1606
+
1548
1607
  return (
1549
1608
  <CapInput
1550
1609
  value={displayValue}
1551
1610
  suffix={<span />}
1552
- onBlur={() => {
1553
- this.setState({
1611
+ onBlur={() => {
1612
+ this.setState({
1554
1613
  isEditName: false,
1555
- localTemplateName: '', // Clear local state on blur
1556
- }, () => {
1557
- this.showTemplateName({ formData, onFormDataChange });
1558
- });
1614
+ localTemplateName: '' // Clear local state on blur
1615
+ }, () => {
1616
+ this.showTemplateName({ formData, onFormDataChange });
1617
+ });
1559
1618
  }}
1560
1619
  onChange={(ev) => {
1561
1620
  const { value } = ev.currentTarget;
@@ -1567,18 +1626,10 @@ export class Creatives extends React.Component {
1567
1626
  }
1568
1627
 
1569
1628
  showTemplateName = ({ formData, onFormDataChange }) => { //gets called from email/index after template data is fetched
1570
- const {
1571
- slidBoxContent, currentChannel, isEditName, templateStep,
1572
- } = this.state;
1629
+ const { slidBoxContent, currentChannel, isEditName } = this.state;
1573
1630
  const channel = currentChannel.toUpperCase();
1574
1631
  if ([constants.EMAIL, constants.MOBILE_PUSH, constants.INAPP].includes(channel) && (slidBoxContent === 'editTemplate' || slidBoxContent === 'createTemplate')) {
1575
1632
  const name = get(formData, 'template-name');
1576
-
1577
- const isModeSelectionStep = templateStep === 'modeSelection' || this.creativesTemplateSteps[templateStep] === 'modeSelection';
1578
- const isCreateMode = slidBoxContent === 'createTemplate';
1579
- if (isCreateMode && isModeSelectionStep) {
1580
- return;
1581
- }
1582
1633
  if (channel === constants.EMAIL && !name && slidBoxContent === 'createTemplate') {
1583
1634
  this.setState({ isTemplateNameEmpty: true });
1584
1635
  }
@@ -1586,9 +1637,9 @@ export class Creatives extends React.Component {
1586
1637
  if (name && !isEditName) {
1587
1638
  this.setState({ showTemplateNameComponentEdit: false });
1588
1639
  } else if (isEditName) {
1589
- this.setState({
1640
+ this.setState({
1590
1641
  showTemplateNameComponentEdit: true,
1591
- localTemplateName: name || '', // Initialize local state with current value
1642
+ localTemplateName: name || '' // Initialize local state with current value
1592
1643
  });
1593
1644
  }
1594
1645
  }
@@ -1602,31 +1653,15 @@ export class Creatives extends React.Component {
1602
1653
  });
1603
1654
  }
1604
1655
 
1605
- // Callback to update HTML Editor validation state (called from EmailWrapper)
1606
- updateHtmlEditorValidationState = (validationState) => {
1607
- this.setState({
1608
- htmlEditorValidationState: validationState,
1609
- });
1610
- }
1611
-
1612
1656
  shouldShowContinueFooter = () => { // only for email for now, has to be modified according to channel
1613
1657
  const {
1614
- slidBoxContent, templateStep, currentChannel, emailCreateMode, mobilePushCreateMode, inAppEditorType, weChatTemplateType,
1658
+ slidBoxContent, templateStep, currentChannel, emailCreateMode, mobilePushCreateMode, inAppCreateMode, weChatTemplateType,
1615
1659
  } = this.state;
1616
1660
  let isShowContinueFooter = false;
1617
1661
  const currentStep = this.creativesTemplateSteps[templateStep];
1618
1662
  const channel = currentChannel.toUpperCase();
1619
- // Check if supportCKEditor is false (new flow)
1620
- const supportCKEditor = commonUtil.hasSupportCKEditor(); // Default to legacy flow
1621
1663
  if (channel === constants.EMAIL || channel === constants.SMS) {
1622
- // New flow: Show Continue button when supportCKEditor is false and in modeSelection
1623
- // Always show it (even if disabled) - visibility is separate from enabled state
1624
- if (!supportCKEditor && currentStep === 'modeSelection' && slidBoxContent === 'createTemplate') {
1625
- return true; // Return early to ensure visibility
1626
- }
1627
-
1628
- // Legacy flow: Original logic (only when supportCKEditor is true)
1629
- if (supportCKEditor && ((emailCreateMode === "upload" && !isEmpty(this.props.EmailLayout)) || emailCreateMode === "editor")) {
1664
+ if ((emailCreateMode === "upload" && !isEmpty(this.props.EmailLayout)) || emailCreateMode === "editor") {
1630
1665
  let isEmailCreate = slidBoxContent === 'createTemplate';
1631
1666
  isEmailCreate = currentChannel.toUpperCase() === constants.EMAIL && ((emailCreateMode === "upload" && currentStep !== 'createTemplateContent') || (emailCreateMode === "editor" && currentStep !== 'createTemplateContent' && currentStep !== "templateSelection"));
1632
1667
  isShowContinueFooter = isEmailCreate && emailCreateMode;
@@ -1635,6 +1670,8 @@ export class Creatives extends React.Component {
1635
1670
  isShowContinueFooter = !isEmpty(mobilePushCreateMode) && currentStep === "modeSelection";
1636
1671
  } else if (currentChannel.toUpperCase() === constants.WECHAT) {
1637
1672
  isShowContinueFooter = !isEmpty(weChatTemplateType) && currentStep === "modeSelection";
1673
+ } else if (currentChannel.toUpperCase() === constants.INAPP) {
1674
+ isShowContinueFooter = !isEmpty(inAppCreateMode) && currentChannel === "modeSelection";
1638
1675
  }
1639
1676
 
1640
1677
  return isShowContinueFooter;
@@ -1660,28 +1697,6 @@ export class Creatives extends React.Component {
1660
1697
  return true;
1661
1698
  }
1662
1699
 
1663
- // Check if Continue button should be disabled (for new flow only)
1664
- isContinueButtonDisabled = () => {
1665
- const { currentChannel, emailCreateMode, templateNameExists } = this.state;
1666
- const { isFullMode, EmailLayout } = this.props;
1667
- if (currentChannel.toUpperCase() === constants.EMAIL) {
1668
- // Upload mode: enable when a file has been uploaded (EmailLayout set by ZIP or HTML upload)
1669
- // Other modes: enable when an editor type is selected (html_editor, drag_drop, editor)
1670
- const isUploadComplete = emailCreateMode === 'upload' && !isEmpty(EmailLayout);
1671
- const isEditorSelected = !!emailCreateMode && emailCreateMode !== 'upload';
1672
- const canContinue = isUploadComplete || isEditorSelected;
1673
- // In full mode: require both template name AND (upload complete or editor selected)
1674
- // In library mode: require only upload complete or editor selection
1675
- // Same rules for both CK editor and non-CK flows
1676
- if (isFullMode) {
1677
- const isTemplateNameValid = templateNameExists;
1678
- return !(isTemplateNameValid && canContinue);
1679
- }
1680
- return !canContinue;
1681
- }
1682
- return true;
1683
- }
1684
-
1685
1700
  render() {
1686
1701
  const {
1687
1702
  slidBoxContent,
@@ -1690,7 +1705,6 @@ export class Creatives extends React.Component {
1690
1705
  templateData,
1691
1706
  currentChannel,
1692
1707
  emailCreateMode,
1693
- selectedEmailCreateMode,
1694
1708
  templateStep,
1695
1709
  isLoadingContent,
1696
1710
  mobilePushCreateMode,
@@ -1703,8 +1717,6 @@ export class Creatives extends React.Component {
1703
1717
  activeFormBuilderTab,
1704
1718
  showTestAndPreviewSlidebox,
1705
1719
  isTestAndPreviewMode,
1706
- inAppEditorType,
1707
- htmlEditorValidationState,
1708
1720
  } = this.state;
1709
1721
  const {
1710
1722
  isFullMode,
@@ -1727,35 +1739,9 @@ export class Creatives extends React.Component {
1727
1739
  isLoyaltyModule,
1728
1740
  loyaltyMetaData = {},
1729
1741
  } = this.props;
1730
- // Compute Continue button label
1731
- const supportCKEditor = commonUtil.hasSupportCKEditor();
1732
- const continueButtonLabel = supportCKEditor ? messages.continue : messages.next;
1733
-
1734
1742
  const mapTemplateCreate = slidBoxContent === "createTemplate"
1735
1743
  && weChatTemplateType === MAP_TEMPLATE
1736
1744
  && templateStep !== "modeSelection";
1737
-
1738
- // Determine if we're in HTML Editor mode (where errors are shown in ValidationErrorDisplay, not ErrorInfoNote in footer)
1739
- const isEmailChannel = currentChannel?.toUpperCase() === constants.EMAIL;
1740
- const isEditMode = slidBoxContent === 'editTemplate';
1741
- const isHTMLEditorModeInCreate = selectedEmailCreateMode === 'html_editor';
1742
- const isHTMLEditorModeInEdit = isEditMode && htmlEditorValidationState != null;
1743
- const isHTMLEditorMode = isEmailChannel && (isHTMLEditorModeInCreate || isHTMLEditorModeInEdit);
1744
- const isBEEEditor = selectedEmailCreateMode === 'drag_drop'
1745
- || (emailCreateMode === 'editor' && !isHTMLEditorMode);
1746
-
1747
- // Check for BEE editor errors (same logic as SlideBoxFooter)
1748
- const hasStandardErrors = liquidErrorMessage && liquidErrorMessage.STANDARD_ERROR_MSG && liquidErrorMessage.STANDARD_ERROR_MSG.length > 0;
1749
- const hasLiquidErrors = liquidErrorMessage && liquidErrorMessage.LIQUID_ERROR_MSG && liquidErrorMessage.LIQUID_ERROR_MSG.length > 0;
1750
- const htmlEditorHasErrors = htmlEditorValidationState && htmlEditorValidationState.issueCounts && htmlEditorValidationState.issueCounts.total > 0;
1751
- const hasBEEEditorErrors = isEmailChannel && (hasStandardErrors || hasLiquidErrors) && (!htmlEditorValidationState || !htmlEditorHasErrors);
1752
-
1753
- // Only apply margin to footer when ErrorInfoNote is shown in footer (BEE editor)
1754
- // For HTML Editor, errors are shown in ValidationErrorDisplay (inside content area), so no footer margin needed
1755
- // IMPORTANT: Never show ErrorInfoNote in footer when in HTML Editor mode, even if liquidErrorMessage exists
1756
- const shouldShowErrorInfoNoteInFooter = isHTMLEditorMode ? false : hasBEEEditorErrors;
1757
-
1758
- // Calculate margin for header/content (always apply if there are errors, regardless of editor type)
1759
1745
  const slideBoxWrapperMargin = (get(liquidErrorMessage, 'STANDARD_ERROR_MSG.length', 0) > 0 && get(liquidErrorMessage, 'LIQUID_ERROR_MSG.length', 0) > 0)
1760
1746
  ? CAP_SPACE_64
1761
1747
  : get(liquidErrorMessage, 'LIQUID_ERROR_MSG.length', 0) > 0
@@ -1765,11 +1751,7 @@ export class Creatives extends React.Component {
1765
1751
  : 0;
1766
1752
  /* TODO: Instead of passing down same props separately to each component down, write common function to these props and pass it accordingly */
1767
1753
  return (
1768
- <SlideBoxWrapper
1769
- slideBoxWrapperMargin={slideBoxWrapperMargin}
1770
- shouldApplyFooterMargin={shouldShowErrorInfoNoteInFooter}
1771
- className={classnames(`${classPrefix} ${isFullMode ? 'creatives-full-mode' : 'creatives-library-mode'} ${mapTemplateCreate ? 'map-template-create' : ''}`)}
1772
- >
1754
+ <SlideBoxWrapper slideBoxWrapperMargin={slideBoxWrapperMargin} className={classnames(`${classPrefix} ${isFullMode ? 'creatives-full-mode' : 'creatives-library-mode'} ${mapTemplateCreate ? 'map-template-create' : ''}`)}>
1773
1755
  <CapSlideBox
1774
1756
  header={
1775
1757
  this.shouldShowHeader() && (
@@ -1818,8 +1800,6 @@ export class Creatives extends React.Component {
1818
1800
  onChannelChange={this.onChannelChange}
1819
1801
  onEmailModeChange={this.onEmailModeChange}//used when create is clicked in email
1820
1802
  emailCreateMode={emailCreateMode}// upload zip || use editor are values
1821
- onInAppEditorTypeChange={this.onInAppEditorTypeChange}//used when create is clicked in inapp
1822
- inAppEditorType={inAppEditorType}// htmlEditor || dragDropEditor are values
1823
1803
  templateStep={this.creativesTemplateSteps[templateStep]}
1824
1804
  onCreateNextStep={this.onCreateNextStep}
1825
1805
  onEnterTemplateName={this.onEnterTemplateName}
@@ -1829,8 +1809,6 @@ export class Creatives extends React.Component {
1829
1809
  cap={cap}
1830
1810
  setIsLoadingContent={this.setIsLoadingContent}
1831
1811
  onMobilepushModeChange={this.onMobilepushModeChange}
1832
- inAppCreateMode={this.state.inAppCreateMode}
1833
- onInAppModeChange={this.onInAppModeChange}
1834
1812
  mobilePushCreateMode={mobilePushCreateMode}
1835
1813
  showTemplateName={this.showTemplateName}
1836
1814
  onValidationFail={this.onValidationFail}
@@ -1869,7 +1847,6 @@ export class Creatives extends React.Component {
1869
1847
  handleTestAndPreview={this.handleTestAndPreview}
1870
1848
  handleCloseTestAndPreview={this.handleCloseTestAndPreview}
1871
1849
  isTestAndPreviewMode={(() => this.state.isTestAndPreviewMode)()}
1872
- onHtmlEditorValidationStateChange={this.updateHtmlEditorValidationState}
1873
1850
  />
1874
1851
  )}
1875
1852
  footer={this.shouldShowFooter() ? (
@@ -1884,7 +1861,6 @@ export class Creatives extends React.Component {
1884
1861
  currentChannel={currentChannel.toUpperCase()}
1885
1862
  templateStep={this.creativesTemplateSteps[templateStep]}
1886
1863
  emailCreateMode={emailCreateMode}
1887
- selectedEmailCreateMode={selectedEmailCreateMode}
1888
1864
  shouldShowContinueFooter={this.shouldShowContinueFooter}
1889
1865
  shouldShowDoneFooter={this.shouldShowDoneFooter}
1890
1866
  fetchingCmsData={fetchingCmsData}
@@ -1893,22 +1869,18 @@ export class Creatives extends React.Component {
1893
1869
  errorMessages={liquidErrorMessage}
1894
1870
  currentTab={activeFormBuilderTab}
1895
1871
  onTestAndPreview={this.handleTestAndPreview}
1896
- isContinueButtonDisabled={this.isContinueButtonDisabled()}
1897
- continueButtonLabel={continueButtonLabel}
1898
1872
  showTestAndPreviewButton={(() => {
1899
1873
  const isEmailOrSmsOrWhatsappOrRcsOrInAppOrMobilePush = [constants.EMAIL, constants.SMS, constants.WHATSAPP, constants.RCS, constants.INAPP, constants.MOBILE_PUSH, constants.VIBER, constants.ZALO].includes(currentChannel.toUpperCase());
1900
1874
  const showButton = isEmailOrSmsOrWhatsappOrRcsOrInAppOrMobilePush && (slidBoxContent === 'editTemplate' || slidBoxContent === 'createTemplate');
1901
1875
  return showButton;
1902
1876
  })()}
1903
- htmlEditorValidationState={htmlEditorValidationState}
1904
- isCreatingTemplate={slidBoxContent === 'createTemplate' && currentChannel.toUpperCase() === constants.EMAIL}
1905
1877
  />
1906
1878
  ) : isLiquidValidationError && (
1907
1879
  <CapRow className="template-footer-width">
1908
1880
  {(() => {
1909
1881
  const errorsToShow = get(liquidErrorMessage, constants.LIQUID_ERROR_MSG, []);
1910
1882
  const standardErrorsToShow = get(liquidErrorMessage, constants.STANDARD_ERROR_MSG, []);
1911
- return <ErrorInfoNote currentTab={activeFormBuilderTab?.toUpperCase()} errorMessages={{ LIQUID_ERROR_MSG: errorsToShow, STANDARD_ERROR_MSG: standardErrorsToShow }} />;
1883
+ return <ErrorInfoNote currentTab={activeFormBuilderTab?.toUpperCase()} errorMessages={{LIQUID_ERROR_MSG: errorsToShow, STANDARD_ERROR_MSG: standardErrorsToShow}} />;
1912
1884
  })()}
1913
1885
  </CapRow>
1914
1886
  )}