@capillarytech/creatives-library 8.0.242-alpha.0 → 8.0.242-alpha.1

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 (215) hide show
  1. package/assets/Android.png +0 -0
  2. package/assets/iOS.png +0 -0
  3. package/constants/unified.js +2 -1
  4. package/initialReducer.js +2 -0
  5. package/package.json +1 -1
  6. package/sagas/__tests__/assetPolling.test.js +74 -3
  7. package/sagas/assetPolling.js +8 -1
  8. package/services/api.js +10 -5
  9. package/services/tests/api.test.js +18 -0
  10. package/translations/en.json +0 -1
  11. package/utils/common.js +5 -0
  12. package/utils/commonUtils.js +14 -1
  13. package/utils/tests/commonUtil.test.js +224 -0
  14. package/utils/transformTemplateConfig.js +0 -10
  15. package/utils/transformerUtils.js +0 -42
  16. package/v2Components/CapDeviceContent/index.js +61 -56
  17. package/v2Components/CapImageUpload/constants.js +0 -2
  18. package/v2Components/CapImageUpload/index.js +14 -54
  19. package/v2Components/CapImageUpload/index.scss +1 -4
  20. package/v2Components/CapImageUpload/messages.js +0 -4
  21. package/v2Components/CapTagList/index.js +6 -1
  22. package/v2Components/CapTagListWithInput/index.js +5 -1
  23. package/v2Components/CapTagListWithInput/messages.js +1 -1
  24. package/v2Components/CapWhatsappCTA/tests/index.test.js +5 -0
  25. package/v2Components/ErrorInfoNote/index.js +412 -72
  26. package/v2Components/ErrorInfoNote/messages.js +22 -0
  27. package/v2Components/ErrorInfoNote/style.scss +279 -2
  28. package/v2Components/HtmlEditor/HTMLEditor.js +210 -89
  29. package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +1132 -133
  30. package/v2Components/HtmlEditor/__tests__/index.lazy.test.js +17 -12
  31. package/v2Components/HtmlEditor/_htmlEditor.scss +8 -23
  32. package/v2Components/HtmlEditor/_index.lazy.scss +1 -1
  33. package/v2Components/HtmlEditor/components/CodeEditorPane/_codeEditorPane.scss +13 -101
  34. package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +148 -139
  35. package/v2Components/HtmlEditor/components/DeviceToggle/_deviceToggle.scss +2 -1
  36. package/v2Components/HtmlEditor/components/DeviceToggle/index.js +3 -3
  37. package/v2Components/HtmlEditor/components/EditorToolbar/index.js +1 -1
  38. package/v2Components/HtmlEditor/components/FullscreenModal/_fullscreenModal.scss +1 -0
  39. package/v2Components/HtmlEditor/components/InAppPreviewPane/DeviceFrame.js +4 -7
  40. package/v2Components/HtmlEditor/components/InAppPreviewPane/__tests__/DeviceFrame.test.js +35 -45
  41. package/v2Components/HtmlEditor/components/InAppPreviewPane/_inAppPreviewPane.scss +1 -3
  42. package/v2Components/HtmlEditor/components/InAppPreviewPane/constants.js +33 -33
  43. package/v2Components/HtmlEditor/components/InAppPreviewPane/index.js +7 -6
  44. package/v2Components/HtmlEditor/components/PreviewPane/_previewPane.scss +3 -6
  45. package/v2Components/HtmlEditor/components/PreviewPane/index.js +10 -11
  46. package/v2Components/HtmlEditor/components/SplitContainer/_splitContainer.scss +1 -1
  47. package/v2Components/HtmlEditor/components/ValidationErrorDisplay/__tests__/index.test.js +87 -62
  48. package/v2Components/HtmlEditor/components/ValidationErrorDisplay/index.js +49 -31
  49. package/v2Components/HtmlEditor/components/ValidationTabs/_validationTabs.scss +254 -0
  50. package/v2Components/HtmlEditor/components/ValidationTabs/index.js +362 -0
  51. package/v2Components/HtmlEditor/components/ValidationTabs/messages.js +51 -0
  52. package/v2Components/HtmlEditor/constants.js +29 -20
  53. package/v2Components/HtmlEditor/hooks/__tests__/useInAppContent.test.js +373 -16
  54. package/v2Components/HtmlEditor/hooks/useEditorContent.js +5 -2
  55. package/v2Components/HtmlEditor/hooks/useInAppContent.js +88 -146
  56. package/v2Components/HtmlEditor/index.js +1 -1
  57. package/v2Components/HtmlEditor/messages.js +95 -85
  58. package/v2Components/HtmlEditor/utils/liquidTemplateSupport.js +99 -101
  59. package/v2Components/HtmlEditor/utils/properSyntaxHighlighting.js +23 -25
  60. package/v2Components/HtmlEditor/utils/validationAdapter.js +34 -41
  61. package/v2Components/MobilePushPreviewV2/index.js +32 -7
  62. package/v2Components/TemplatePreview/_templatePreview.scss +44 -24
  63. package/v2Components/TemplatePreview/index.js +47 -32
  64. package/v2Components/TemplatePreview/messages.js +4 -0
  65. package/v2Components/TestAndPreviewSlidebox/index.js +31 -25
  66. package/v2Containers/App/constants.js +0 -5
  67. package/v2Containers/BeeEditor/index.js +82 -80
  68. package/v2Containers/BeePopupEditor/constants.js +10 -0
  69. package/v2Containers/BeePopupEditor/index.js +193 -0
  70. package/v2Containers/BeePopupEditor/tests/index.test.js +627 -0
  71. package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +0 -1
  72. package/v2Containers/CreativesContainer/SlideBoxContent.js +148 -120
  73. package/v2Containers/CreativesContainer/SlideBoxFooter.js +9 -3
  74. package/v2Containers/CreativesContainer/SlideBoxHeader.js +2 -2
  75. package/v2Containers/CreativesContainer/constants.js +1 -2
  76. package/v2Containers/CreativesContainer/index.js +173 -193
  77. package/v2Containers/CreativesContainer/messages.js +4 -4
  78. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +38 -50
  79. package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +36 -0
  80. package/v2Containers/Email/actions.js +7 -0
  81. package/v2Containers/Email/constants.js +5 -1
  82. package/v2Containers/Email/index.js +13 -0
  83. package/v2Containers/Email/messages.js +32 -0
  84. package/v2Containers/Email/reducer.js +12 -1
  85. package/v2Containers/Email/sagas.js +41 -6
  86. package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +2 -0
  87. package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +1045 -0
  88. package/v2Containers/EmailWrapper/components/EmailWrapperView.js +193 -7
  89. package/v2Containers/EmailWrapper/components/HTMLEditorTesting.js +40 -74
  90. package/v2Containers/EmailWrapper/components/__tests__/HTMLEditorTesting.test.js +2 -67
  91. package/v2Containers/EmailWrapper/constants.js +2 -0
  92. package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +436 -67
  93. package/v2Containers/EmailWrapper/index.js +99 -23
  94. package/v2Containers/EmailWrapper/messages.js +61 -1
  95. package/v2Containers/EmailWrapper/tests/EmailWrapperView.test.js +26 -1
  96. package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +111 -77
  97. package/v2Containers/InApp/__tests__/InAppHTMLEditor.test.js +376 -0
  98. package/v2Containers/InApp/__tests__/sagas.test.js +363 -0
  99. package/v2Containers/InApp/actions.js +7 -0
  100. package/v2Containers/InApp/constants.js +20 -4
  101. package/v2Containers/InApp/index.js +800 -357
  102. package/v2Containers/InApp/index.scss +4 -3
  103. package/v2Containers/InApp/messages.js +7 -3
  104. package/v2Containers/InApp/reducer.js +21 -3
  105. package/v2Containers/InApp/sagas.js +29 -9
  106. package/v2Containers/InApp/selectors.js +25 -5
  107. package/v2Containers/InApp/tests/index.test.js +154 -50
  108. package/v2Containers/InApp/tests/reducer.test.js +34 -0
  109. package/v2Containers/InApp/tests/sagas.test.js +61 -9
  110. package/v2Containers/InApp/tests/selectors.test.js +612 -0
  111. package/v2Containers/InAppWrapper/components/InAppWrapperView.js +162 -0
  112. package/v2Containers/InAppWrapper/components/__tests__/InAppWrapperView.test.js +267 -0
  113. package/v2Containers/InAppWrapper/components/inAppWrapperView.scss +9 -0
  114. package/v2Containers/InAppWrapper/constants.js +16 -0
  115. package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +473 -0
  116. package/v2Containers/InAppWrapper/hooks/useInAppWrapper.js +198 -0
  117. package/v2Containers/InAppWrapper/index.js +148 -0
  118. package/v2Containers/InAppWrapper/messages.js +49 -0
  119. package/v2Containers/InappAdvance/index.js +1099 -0
  120. package/v2Containers/InappAdvance/index.scss +10 -0
  121. package/v2Containers/InappAdvance/tests/index.test.js +448 -0
  122. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +3 -3
  123. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +2 -2
  124. package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +2 -25
  125. package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +9 -18
  126. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +12 -46
  127. package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +0 -4
  128. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +4 -8
  129. package/v2Containers/TagList/index.js +67 -1
  130. package/v2Containers/Templates/ChannelTypeIllustration.js +1 -13
  131. package/v2Containers/Templates/_templates.scss +56 -200
  132. package/v2Containers/Templates/actions.js +1 -2
  133. package/v2Containers/Templates/constants.js +0 -1
  134. package/v2Containers/Templates/index.js +124 -277
  135. package/v2Containers/Templates/messages.js +4 -24
  136. package/v2Containers/Templates/reducer.js +0 -2
  137. package/v2Containers/Templates/tests/index.test.js +0 -10
  138. package/v2Containers/TemplatesV2/index.js +2 -3
  139. package/v2Containers/TemplatesV2/messages.js +0 -4
  140. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +35 -132
  141. package/v2Components/CapImageUrlUpload/constants.js +0 -19
  142. package/v2Components/CapImageUrlUpload/index.js +0 -455
  143. package/v2Components/CapImageUrlUpload/index.scss +0 -35
  144. package/v2Components/CapImageUrlUpload/messages.js +0 -47
  145. package/v2Containers/WebPush/Create/components/ButtonForm.js +0 -175
  146. package/v2Containers/WebPush/Create/components/ButtonItem.js +0 -101
  147. package/v2Containers/WebPush/Create/components/ButtonList.js +0 -144
  148. package/v2Containers/WebPush/Create/components/_buttons.scss +0 -246
  149. package/v2Containers/WebPush/Create/components/tests/ButtonForm.test.js +0 -554
  150. package/v2Containers/WebPush/Create/components/tests/ButtonItem.test.js +0 -607
  151. package/v2Containers/WebPush/Create/components/tests/ButtonList.test.js +0 -633
  152. package/v2Containers/WebPush/Create/components/tests/__snapshots__/ButtonForm.test.js.snap +0 -666
  153. package/v2Containers/WebPush/Create/components/tests/__snapshots__/ButtonItem.test.js.snap +0 -74
  154. package/v2Containers/WebPush/Create/components/tests/__snapshots__/ButtonList.test.js.snap +0 -80
  155. package/v2Containers/WebPush/Create/index.js +0 -1755
  156. package/v2Containers/WebPush/Create/index.scss +0 -123
  157. package/v2Containers/WebPush/Create/messages.js +0 -199
  158. package/v2Containers/WebPush/Create/preview/DevicePreviewContent.js +0 -241
  159. package/v2Containers/WebPush/Create/preview/NotificationContainer.js +0 -290
  160. package/v2Containers/WebPush/Create/preview/PreviewContent.js +0 -81
  161. package/v2Containers/WebPush/Create/preview/PreviewControls.js +0 -240
  162. package/v2Containers/WebPush/Create/preview/PreviewDisclaimer.js +0 -23
  163. package/v2Containers/WebPush/Create/preview/WebPushPreview.js +0 -144
  164. package/v2Containers/WebPush/Create/preview/assets/Light.svg +0 -53
  165. package/v2Containers/WebPush/Create/preview/assets/Top.svg +0 -5
  166. package/v2Containers/WebPush/Create/preview/assets/chrome-icon.png +0 -0
  167. package/v2Containers/WebPush/Create/preview/assets/edge-icon.png +0 -0
  168. package/v2Containers/WebPush/Create/preview/assets/firefox-icon.svg +0 -106
  169. package/v2Containers/WebPush/Create/preview/assets/iOS.svg +0 -26
  170. package/v2Containers/WebPush/Create/preview/assets/opera-icon.svg +0 -18
  171. package/v2Containers/WebPush/Create/preview/assets/safari-icon.svg +0 -29
  172. package/v2Containers/WebPush/Create/preview/components/AndroidMobileChromeHeader.js +0 -44
  173. package/v2Containers/WebPush/Create/preview/components/AndroidMobileExpanded.js +0 -110
  174. package/v2Containers/WebPush/Create/preview/components/IOSHeader.js +0 -45
  175. package/v2Containers/WebPush/Create/preview/components/NotificationExpandedContent.js +0 -72
  176. package/v2Containers/WebPush/Create/preview/components/NotificationHeader.js +0 -55
  177. package/v2Containers/WebPush/Create/preview/components/WindowsChromeExpanded.js +0 -70
  178. package/v2Containers/WebPush/Create/preview/components/tests/AndroidMobileExpanded.test.js +0 -512
  179. package/v2Containers/WebPush/Create/preview/components/tests/__snapshots__/AndroidMobileExpanded.test.js.snap +0 -77
  180. package/v2Containers/WebPush/Create/preview/config/notificationMappings.js +0 -527
  181. package/v2Containers/WebPush/Create/preview/constants.js +0 -162
  182. package/v2Containers/WebPush/Create/preview/notification-container.scss +0 -104
  183. package/v2Containers/WebPush/Create/preview/preview.scss +0 -409
  184. package/v2Containers/WebPush/Create/preview/styles/_android-mobile-chrome.scss +0 -300
  185. package/v2Containers/WebPush/Create/preview/styles/_android-mobile-edge.scss +0 -12
  186. package/v2Containers/WebPush/Create/preview/styles/_android-mobile-firefox.scss +0 -12
  187. package/v2Containers/WebPush/Create/preview/styles/_android-mobile-opera.scss +0 -12
  188. package/v2Containers/WebPush/Create/preview/styles/_android-tablet-chrome.scss +0 -303
  189. package/v2Containers/WebPush/Create/preview/styles/_android-tablet-edge.scss +0 -11
  190. package/v2Containers/WebPush/Create/preview/styles/_android-tablet-firefox.scss +0 -11
  191. package/v2Containers/WebPush/Create/preview/styles/_android-tablet-opera.scss +0 -11
  192. package/v2Containers/WebPush/Create/preview/styles/_base.scss +0 -188
  193. package/v2Containers/WebPush/Create/preview/styles/_ios.scss +0 -106
  194. package/v2Containers/WebPush/Create/preview/styles/_ipados.scss +0 -107
  195. package/v2Containers/WebPush/Create/preview/styles/_macos-chrome.scss +0 -75
  196. package/v2Containers/WebPush/Create/preview/styles/_windows-chrome.scss +0 -174
  197. package/v2Containers/WebPush/Create/preview/tests/DevicePreviewContent.test.js +0 -909
  198. package/v2Containers/WebPush/Create/preview/tests/NotificationContainer.test.js +0 -1077
  199. package/v2Containers/WebPush/Create/preview/tests/PreviewControls.test.js +0 -723
  200. package/v2Containers/WebPush/Create/preview/tests/WebPushPreview.test.js +0 -943
  201. package/v2Containers/WebPush/Create/preview/tests/__snapshots__/DevicePreviewContent.test.js.snap +0 -128
  202. package/v2Containers/WebPush/Create/preview/tests/__snapshots__/NotificationContainer.test.js.snap +0 -121
  203. package/v2Containers/WebPush/Create/preview/tests/__snapshots__/PreviewControls.test.js.snap +0 -144
  204. package/v2Containers/WebPush/Create/preview/tests/__snapshots__/WebPushPreview.test.js.snap +0 -127
  205. package/v2Containers/WebPush/Create/utils/urlValidation.js +0 -116
  206. package/v2Containers/WebPush/Create/utils/urlValidation.test.js +0 -449
  207. package/v2Containers/WebPush/actions.js +0 -60
  208. package/v2Containers/WebPush/constants.js +0 -108
  209. package/v2Containers/WebPush/index.js +0 -2
  210. package/v2Containers/WebPush/reducer.js +0 -104
  211. package/v2Containers/WebPush/sagas.js +0 -119
  212. package/v2Containers/WebPush/selectors.js +0 -65
  213. package/v2Containers/WebPush/tests/reducer.test.js +0 -863
  214. package/v2Containers/WebPush/tests/sagas.test.js +0 -566
  215. package/v2Containers/WebPush/tests/selectors.test.js +0 -960
@@ -10,6 +10,7 @@ import SmsWrapper from '../SmsWrapper';
10
10
  import Email from '../Email';
11
11
  import EmailWrapper from '../EmailWrapper';
12
12
  import MobilepushWrapper from '../MobilepushWrapper';
13
+ import InAppWrapper from '../InAppWrapper';
13
14
  import EmailPreviewV2 from '../../v2Components/EmailPreviewV2';
14
15
  import MobilePushPreview from '../../v2Components/MobilePushPreviewV2';
15
16
  import WechatWrapper from '../WeChat/Wrapper';
@@ -28,10 +29,6 @@ import { getWhatsappContent } from '../Whatsapp/utils';
28
29
  import * as commonUtil from '../../utils/common';
29
30
  import Zalo from '../Zalo';
30
31
  import MobilePushNew from '../MobilePushNew';
31
- import WebPush from '../WebPush';
32
- import DevicePreviewContent from '../WebPush/Create/preview/DevicePreviewContent';
33
- import { LAYOUT_MODE } from '../WebPush/Create/preview/constants';
34
- import { WEBPUSH_CONTENT_FIELDS, WEBPUSH_TEMPLATE_PATHS } from '../WebPush/constants';
35
32
  const CreativesWrapper = styled.div`
36
33
  .ant-popover,
37
34
  .ant-notification,
@@ -119,7 +116,11 @@ export function SlideBoxContent(props) {
119
116
  emailCreateMode,
120
117
  onMobilepushModeChange,
121
118
  mobilePushCreateMode,
119
+ onInAppEditorTypeChange,
120
+ inAppEditorType,
122
121
  templateStep,
122
+ inAppCreateMode,
123
+ onInAppModeChange,
123
124
  onEnterTemplateName,
124
125
  onRemoveTemplateName,
125
126
  onCreateNextStep,
@@ -168,7 +169,6 @@ export function SlideBoxContent(props) {
168
169
  handleTestAndPreview,
169
170
  handleCloseTestAndPreview,
170
171
  isTestAndPreviewMode,
171
- supportedTags = [],
172
172
  } = props;
173
173
  const type = (messageDetails.type || '').toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
174
174
  const query = { type: !isFullMode && 'embedded', module: isFullMode ? 'default' : 'library', isEditFromCampaigns: (templateData || {}).isEditFromCampaigns};
@@ -205,7 +205,6 @@ export function SlideBoxContent(props) {
205
205
  const isCreateRcs = isCreate && channel === constants.RCS;
206
206
  const isCreateMPush = isCreate && channel === constants.MOBILE_PUSH;
207
207
  const isCreateCallTask = isCreate && channel === constants.CALL_TASK;
208
- const isCreateWebPush = isCreate && channel === constants.WEBPUSH;
209
208
  let isEditSms = false;
210
209
  let isEditEmailWithId = false;
211
210
  let isEmailEditWithContent = false;
@@ -213,14 +212,12 @@ export function SlideBoxContent(props) {
213
212
  let isEmailPreview = false;
214
213
  let isMpushPreview = false;
215
214
  let isInappPreview = false;
216
- let isWebPushPreview = false;
217
215
  let isEditCallTask = false;
218
216
  let isEditMPush = false;
219
217
  let isEditFacebook = false;
220
218
  let isEditFTP = false;
221
219
  let isEditWhatsapp = false;
222
220
  let isEditInApp = false;
223
- let isEditWebPush = false;
224
221
  let isEditRcs = false;
225
222
  let isEditZalo = false;
226
223
  const isEmailCreate = isCreate && channel === constants.EMAIL;
@@ -234,12 +231,10 @@ export function SlideBoxContent(props) {
234
231
  isEditFacebook = isEdit && channel === constants.FACEBOOK;
235
232
  isEditWhatsapp = isEdit && channel === constants.WHATSAPP;
236
233
  isEditRcs = isEdit && channel === constants.RCS;
237
- isEditWebPush = isEdit && channel === constants.WEBPUSH;
238
234
  isPreview = slidBoxContent === 'preview' && [constants.SMS, constants.LINE, constants.WHATSAPP, constants.FACEBOOK, constants.VIBER, constants.RCS].includes(channel);
239
235
  isEmailPreview = slidBoxContent === 'preview' && channel === constants.EMAIL;
240
236
  isMpushPreview = slidBoxContent === 'preview' && channel === constants.MOBILE_PUSH;
241
237
  isInappPreview = slidBoxContent === 'preview' && channel === constants.INAPP;
242
- isWebPushPreview = slidBoxContent === 'preview' && channel === constants.WEBPUSH;
243
238
  isEditFTP = isEdit && [constants.NO_COMMUNICATION, constants.FTP].includes(channel);
244
239
  isEditZalo = isEdit && channel?.toUpperCase() === constants.ZALO;
245
240
  isEditInApp = isEdit && channel === constants.INAPP;
@@ -487,30 +482,8 @@ export function SlideBoxContent(props) {
487
482
  templateData={templateData}
488
483
  channel={channel}
489
484
  forwardedTags={forwardedTags}
490
- />
485
+ />
491
486
  )}
492
- {isWebPushPreview && (() => {
493
- const webpushContent = get(templateData, WEBPUSH_TEMPLATE_PATHS.CONTENT, {});
494
- const notificationTitle = webpushContent?.[WEBPUSH_CONTENT_FIELDS.TITLE] || '';
495
- const notificationBody = webpushContent?.[WEBPUSH_CONTENT_FIELDS.MESSAGE] || '';
496
- const imageSrc = webpushContent?.[WEBPUSH_CONTENT_FIELDS.IMAGE] || '';
497
- const brandIconSrc = webpushContent?.[WEBPUSH_CONTENT_FIELDS.BRAND_ICON] || '';
498
- // Extract URL from onClickAction or use empty string
499
- const url = webpushContent?.[WEBPUSH_CONTENT_FIELDS.ON_CLICK_ACTION]?.url || '';
500
-
501
- return (
502
- <div className="webpush-preview-container">
503
- <DevicePreviewContent
504
- notificationTitle={notificationTitle}
505
- notificationBody={notificationBody}
506
- url={url}
507
- imageSrc={imageSrc}
508
- brandIconSrc={brandIconSrc}
509
- layoutMode={LAYOUT_MODE.COMPACT}
510
- />
511
- </div>
512
- );
513
- })()}
514
487
 
515
488
  {
516
489
  (currentChannel === constants.WECHAT && !!slidBoxContent) && <WechatWrapper
@@ -661,44 +634,92 @@ export function SlideBoxContent(props) {
661
634
  handleTestAndPreview={handleTestAndPreview}
662
635
  handleCloseTestAndPreview={handleCloseTestAndPreview}
663
636
  isTestAndPreviewMode={isTestAndPreviewMode}
637
+ location={location}
664
638
  />
665
639
  )}
666
640
  {(isEditEmailWithId || isEmailEditWithContent) && (
667
- <Email
668
- key="cretives-container-email-edit"
669
- setIsLoadingContent={setIsLoadingContent}
670
- location={{
671
- pathname: `/email/edit`,
672
- query: { type: 'embedded', module: 'library'},
673
- }}
674
- route={{ name: 'email' }}
675
- isGetFormData={isGetFormData}
676
- getFormdata={getFormData}
677
- params={{ id: templateData._id }}
678
- templateData={templateData}
679
- getFormSubscriptionData={getFormData}
680
- getDefaultTags={type}
681
- isFullMode={isFullMode}
682
- editor={editor}
683
- cap={cap}
684
- showTemplateName={showTemplateName}
685
- onValidationFail={onValidationFail}
686
- forwardedTags={forwardedTags}
687
- selectedOfferDetails={selectedOfferDetails}
688
- onPreviewContentClicked={onPreviewContentClicked}
689
- onTestContentClicked={onTestContentClicked}
690
- moduleType={moduleType}
691
- showLiquidErrorInFooter={showLiquidErrorInFooter}
692
- eventContextTags={eventContextTags}
693
- isLoyaltyModule={isLoyaltyModule}
694
- showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
695
- handleTestAndPreview={handleTestAndPreview}
696
- handleCloseTestAndPreview={handleCloseTestAndPreview}
697
- isTestAndPreviewMode={(() => {
698
- return isTestAndPreviewMode;
699
- })()}
700
- />
701
- )}
641
+ (() => {
642
+ const supportCKEditor = commonUtil.hasSupportCKEditor();
643
+ // When supportCKEditor is true: Always use Email component (legacy flow)
644
+ if (supportCKEditor || templateData?.is_drag_drop) {
645
+ return (
646
+ <Email
647
+ key="cretives-container-email-edit"
648
+ setIsLoadingContent={setIsLoadingContent}
649
+ location={{
650
+ pathname: `/email/edit`,
651
+ query: { type: 'embedded', module: 'library'},
652
+ }}
653
+ route={{ name: 'email' }}
654
+ isGetFormData={isGetFormData}
655
+ getFormdata={getFormData}
656
+ params={{ id: templateData._id }}
657
+ templateData={templateData}
658
+ getFormSubscriptionData={getFormData}
659
+ getDefaultTags={type}
660
+ isFullMode={isFullMode}
661
+ editor={editor}
662
+ cap={cap}
663
+ showTemplateName={showTemplateName}
664
+ onValidationFail={onValidationFail}
665
+ forwardedTags={forwardedTags}
666
+ selectedOfferDetails={selectedOfferDetails}
667
+ onPreviewContentClicked={onPreviewContentClicked}
668
+ onTestContentClicked={onTestContentClicked}
669
+ moduleType={moduleType}
670
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
671
+ eventContextTags={eventContextTags}
672
+ isLoyaltyModule={isLoyaltyModule}
673
+ showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
674
+ handleTestAndPreview={handleTestAndPreview}
675
+ handleCloseTestAndPreview={handleCloseTestAndPreview}
676
+ isTestAndPreviewMode={isTestAndPreviewMode}
677
+ />
678
+ );
679
+ }
680
+ // HTML template: Use EmailWrapper component (which uses EmailWithoutSaga)
681
+ return (
682
+ <EmailWrapper
683
+ key="cretives-container-email-edit-wrapper"
684
+ setIsLoadingContent={setIsLoadingContent}
685
+ onEmailModeChange={onEmailModeChange}
686
+ emailCreateMode="editor"
687
+ isGetFormData={isGetFormData}
688
+ getFormdata={getFormData}
689
+ templateData={templateData}
690
+ type={type}
691
+ step="createTemplateContent"
692
+ showNextStep={onCreateNextStep}
693
+ isFullMode={isFullMode}
694
+ editor={editor}
695
+ cap={cap}
696
+ onResetStep={onResetStep}
697
+ showTemplateName={showTemplateName}
698
+ onEnterTemplateName={onEnterTemplateName}
699
+ onRemoveTemplateName={onRemoveTemplateName}
700
+ onValidationFail={onValidationFail}
701
+ forwardedTags={forwardedTags}
702
+ selectedOfferDetails={selectedOfferDetails}
703
+ onPreviewContentClicked={onPreviewContentClicked}
704
+ onTestContentClicked={onTestContentClicked}
705
+ getCmsTemplatesInProgress={getCmsTemplatesInProgress}
706
+ moduleType={moduleType}
707
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
708
+ eventContextTags={eventContextTags}
709
+ isLoyaltyModule={isLoyaltyModule}
710
+ showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
711
+ handleTestAndPreview={handleTestAndPreview}
712
+ handleCloseTestAndPreview={handleCloseTestAndPreview}
713
+ isTestAndPreviewMode={isTestAndPreviewMode}
714
+ location={{
715
+ pathname: `/email/edit/${templateData._id}`,
716
+ query: { type: 'embedded', module: 'library', id: templateData._id },
717
+ }}
718
+ params={{ id: templateData._id }}
719
+ />
720
+ );
721
+ })()
722
+ )}
702
723
  {isEditMPush && (
703
724
  (isFullMode && !commonUtil.hasNewMobilePushFeatureEnabled()) ||
704
725
  (!isFullMode && isLoyaltyModule) ||
@@ -972,67 +993,73 @@ export function SlideBoxContent(props) {
972
993
  />
973
994
  )}
974
995
 
975
- {isCreateInApp && (<InApp
976
- isFullMode={isFullMode}
977
- onCreateComplete={onCreateComplete}
978
- handleClose={handleClose}
979
- location={{
980
- pathname: `/inapp/create`,
981
- query,
982
- search: '',
983
- }}
984
- getFormData={getFormData}
985
- isGetFormData={isGetFormData}
986
- templateData={templateData}
987
- getDefaultTags={type}
988
- eventContextTags={eventContextTags}
989
- showLiquidErrorInFooter={showLiquidErrorInFooter}
990
- />
991
- )}
992
-
993
- {isEditInApp && (<InApp
994
- isFullMode={isFullMode}
995
- templateData={templateData}
996
- getFormData={getFormData}
997
- getDefaultTags={type}
998
- forwardedTags={forwardedTags}
999
- onCreateComplete={onCreateComplete}
1000
- selectedOfferDetails={selectedOfferDetails}
1001
- eventContextTags={eventContextTags}
1002
- params={{
1003
- id: templateData._id,
1004
- }}
1005
- location={{
1006
- pathname: `/inapp/edit`,
1007
- query,
1008
- search: '',
1009
- }}
1010
- showLiquidErrorInFooter={showLiquidErrorInFooter}
996
+ {isCreateInApp && (
997
+ <InAppWrapper
998
+ key="creatives-inapp-wrapper"
999
+ date={new Date().getMilliseconds()}
1000
+ setIsLoadingContent={setIsLoadingContent}
1001
+ onInAppEditorTypeChange={onInAppEditorTypeChange}
1002
+ inAppEditorType={inAppEditorType}
1003
+ isGetFormData={isGetFormData}
1004
+ getFormdata={getFormData}
1005
+ templateData={templateData}
1006
+ type={type}
1007
+ step={templateStep}
1008
+ showNextStep={onCreateNextStep}
1009
+ isFullMode={isFullMode}
1010
+ cap={cap}
1011
+ onResetStep={onResetStep}
1012
+ showTemplateName={showTemplateName}
1013
+ onEnterTemplateName={onEnterTemplateName}
1014
+ onRemoveTemplateName={onRemoveTemplateName}
1015
+ onValidationFail={onValidationFail}
1016
+ forwardedTags={forwardedTags}
1017
+ selectedOfferDetails={selectedOfferDetails}
1018
+ onPreviewContentClicked={onPreviewContentClicked}
1019
+ onTestContentClicked={onTestContentClicked}
1020
+ moduleType={moduleType}
1021
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
1022
+ eventContextTags={eventContextTags}
1023
+ onCreateComplete={onCreateComplete}
1024
+ handleClose={handleClose}
1025
+ getDefaultTags={type}
1026
+ onInAppModeChange={onInAppModeChange}
1027
+ inAppCreateMode={inAppCreateMode}
1011
1028
  />
1012
1029
  )}
1013
1030
 
1014
- {(isCreateWebPush || isEditWebPush) && (
1015
- <WebPush
1031
+ {isEditInApp && (
1032
+ <InApp
1033
+ key={`creatives-inapp-edit-${templateData._id || 'new'}`}
1034
+ isEditInApp={true}
1016
1035
  isFullMode={isFullMode}
1017
- handleClose={handleClose}
1018
- onCreateComplete={onCreateComplete}
1036
+ templateData={templateData}
1019
1037
  getFormData={getFormData}
1020
- isGetFormData={isGetFormData}
1021
- templateData={isEditWebPush ? templateData : undefined}
1022
- creativesMode={creativesMode}
1023
- params={isEditWebPush && templateData ? { id: templateData._id } : undefined}
1024
- location={{
1025
- pathname: isEditWebPush ? '/webpush/edit' : '/webpush/create',
1026
- query,
1027
- search: '',
1028
- }}
1029
1038
  getDefaultTags={type}
1030
1039
  forwardedTags={forwardedTags}
1031
- supportedTags={supportedTags}
1040
+ onCreateComplete={onCreateComplete}
1032
1041
  selectedOfferDetails={selectedOfferDetails}
1033
1042
  eventContextTags={eventContextTags}
1043
+ params={{
1044
+ id: templateData._id,
1045
+ }}
1046
+ location={{
1047
+ pathname: `/inapp/edit`,
1048
+ query,
1049
+ search: '',
1050
+ }}
1051
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
1052
+ setIsLoadingContent={setIsLoadingContent}
1053
+ onInAppModeChange={onInAppModeChange}
1054
+ inAppCreateMode={inAppCreateMode}
1055
+ isGetFormData={isGetFormData}
1056
+ showTemplateName={showTemplateName}
1057
+ onValidationFail={onValidationFail}
1058
+ type={type}
1059
+ query={query}
1034
1060
  />
1035
1061
  )}
1062
+
1036
1063
  {isCreateRcs && (<Rcs
1037
1064
  {...rcsCommonProps}
1038
1065
  showLiquidErrorInFooter={showLiquidErrorInFooter}
@@ -1064,6 +1091,8 @@ SlideBoxContent.propTypes = {
1064
1091
  onSelectTemplate: PropTypes.func,
1065
1092
  onPreviewTemplate: PropTypes.func,
1066
1093
  templateData: PropTypes.object,
1094
+ onInAppEditorTypeChange: PropTypes.func,
1095
+ inAppEditorType: PropTypes.object,
1067
1096
  location: PropTypes.object,
1068
1097
  isGetFormData: PropTypes.bool,
1069
1098
  getFormData: PropTypes.func,
@@ -1089,7 +1118,6 @@ SlideBoxContent.propTypes = {
1089
1118
  onValidationFail: PropTypes.func,
1090
1119
  channelsToHide: PropTypes.array,
1091
1120
  forwardedTags: PropTypes.object,
1092
- supportedTags: PropTypes.array,
1093
1121
  selectedOfferDetails: PropTypes.array,
1094
1122
  channelsToDisable: PropTypes.array,
1095
1123
  weChatTemplateType: PropTypes.string,
@@ -1105,7 +1133,7 @@ SlideBoxContent.propTypes = {
1105
1133
  onFTPSubmit: PropTypes.func,
1106
1134
  messageStrategy: PropTypes.string,
1107
1135
  fbAdManager: PropTypes.string,
1108
- showDisabledFBInfo: PropTypes.bool,
1136
+ showDisabledFBInfo: PropTypes.boolean,
1109
1137
  orgUnitId: PropTypes.any,
1110
1138
  smsRegister: PropTypes.any,
1111
1139
  getCmsTemplatesInProgress: PropTypes.bool,
@@ -31,8 +31,9 @@ function SlideBoxFooter(props) {
31
31
  showTestAndPreviewButton,
32
32
  shouldShowDoneFooter,
33
33
  shouldShowContinueFooter,
34
+ isContinueButtonDisabled,
35
+ continueButtonLabel,
34
36
  } = props;
35
-
36
37
  return (
37
38
  <div className='template-footer-width'>
38
39
  {isLiquidValidationError && (<ErrorInfoNote errorMessages={errorMessages} currentTab={currentTab?.toUpperCase()} />)}
@@ -70,8 +71,11 @@ function SlideBoxFooter(props) {
70
71
  </div>
71
72
  )}
72
73
  {shouldShowContinueFooter() && (
73
- <CapButton onClick={onCreateNextStep}>
74
- <FormattedMessage {...messages.continue} />
74
+ <CapButton
75
+ onClick={onCreateNextStep}
76
+ disabled={isContinueButtonDisabled || false}
77
+ >
78
+ <FormattedMessage {...(continueButtonLabel || messages.continue)} />
75
79
  </CapButton>
76
80
  )}
77
81
  {slidBoxContent === PREVIEW && (
@@ -99,5 +103,7 @@ SlideBoxFooter.propTypes = {
99
103
  onTestAndPreview: PropTypes.func,
100
104
  isEmptyContent: PropTypes.bool,
101
105
  showTestAndPreviewButton: PropTypes.bool,
106
+ isContinueButtonDisabled: PropTypes.bool,
107
+ continueButtonLabel: PropTypes.object,
102
108
  };
103
109
  export default SlideBoxFooter;
@@ -45,6 +45,7 @@ export function SlideBoxHeader(props) {
45
45
  const isZaloEdit = channel.toLowerCase() === ZALO && slidBoxContent === 'editTemplate';
46
46
  const zaloOverview = isZaloEdit && isFullMode;
47
47
  const whatsappOverview = isWhatsappEdit && isFullMode;
48
+ const shouldShowInAppEditHeader = isInAppEdit && !isFullMode;
48
49
  const headerMessage = whatsappOverview ? messages.whatsappOverview : zaloOverview ? messages.zaloOverview : messages.editMessageContent;
49
50
  const {
50
51
  whatsappTemplateName,
@@ -71,7 +72,6 @@ export function SlideBoxHeader(props) {
71
72
  rcs: <FormattedMessage {...messages.rcsCreative} />,
72
73
  zalo: <FormattedMessage {...messages.zaloTemplate} />,
73
74
  viber: <FormattedMessage {...messages.viberTemplate} />,
74
- webpush: <FormattedMessage {...messages.webPushTemplate} />,
75
75
  };
76
76
  return labels[currentChannel.toLowerCase()];
77
77
  };
@@ -110,7 +110,7 @@ export function SlideBoxHeader(props) {
110
110
  }
111
111
  />
112
112
  )}
113
- {!showTemplateNameHeader && slidBoxContent === 'editTemplate' && (
113
+ {!showTemplateNameHeader && slidBoxContent === 'editTemplate' && (shouldShowInAppEditHeader || !isInAppCreate) && (
114
114
  <CapHeader
115
115
  className="support-video-elements"
116
116
  title={<FormattedMessage {...headerMessage} values={{ channel: getChannelLabel(channel) }} />}
@@ -21,11 +21,10 @@ export const PUSH = "PUSH";
21
21
  export const RCS = "RCS";
22
22
  export const ZALO = "ZALO";
23
23
  export const INAPP = "INAPP";
24
- export const WEBPUSH = "WEBPUSH";
25
- export const WEBPUSH_BRAND_ICON = "WEBPUSH_BRAND_ICON";
26
24
  export const PREVIEW = "preview";
27
25
  export const EDIT_TEMPLATE = "editTemplate";
28
26
  export const JOURNEY = "journey";
27
+ export const HTML = "HTML";
29
28
 
30
29
  export const LOYALTY_SUPPORTED_ACTION = "SEND_COMMUNICATION_ACTION";
31
30