@capillarytech/creatives-library 9.1.8-alpha.sprint-cap-214249.38 → 9.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/constants/unified.js +4 -0
  2. package/index.js +13 -0
  3. package/package.json +1 -1
  4. package/services/getSchema.js +4 -1
  5. package/services/tests/getSchema.test.js +2 -2
  6. package/translations/en.json +1 -0
  7. package/translations/ja-JP.json +1 -0
  8. package/translations/zh.json +1 -0
  9. package/utils/common.js +6 -0
  10. package/utils/createMobilePushPayload.js +33 -47
  11. package/utils/tagValidations.js +35 -4
  12. package/utils/templateVarUtils.js +49 -0
  13. package/utils/tests/createMobilePushPayload.test.js +8 -102
  14. package/utils/tests/tagValidations.test.js +48 -0
  15. package/utils/tests/templateVarUtils.test.js +89 -0
  16. package/v2Components/CapMpushCTA/index.js +9 -10
  17. package/v2Components/CapMpushCTA/index.scss +3 -29
  18. package/v2Components/CapTagList/TagFallbackPanel.js +124 -0
  19. package/v2Components/CapTagList/constants.js +5 -0
  20. package/v2Components/CapTagList/index.js +46 -7
  21. package/v2Components/CapTagList/messages.js +44 -0
  22. package/v2Components/CapTagList/style.scss +113 -1
  23. package/v2Components/CapTagList/tests/TagFallback.test.js +222 -0
  24. package/v2Components/CapTagList/utils.js +17 -0
  25. package/v2Components/CommonTestAndPreview/UnifiedPreview/MobilePushPreviewContent.js +13 -26
  26. package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +1 -13
  27. package/v2Components/CommonTestAndPreview/constants.js +3 -2
  28. package/v2Components/CommonTestAndPreview/index.js +62 -62
  29. package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/MobilePushPreviewContent.test.js +5 -79
  30. package/v2Components/CommonTestAndPreview/tests/index.test.js +0 -86
  31. package/v2Components/CommonTestAndPreview/tests/utils.test.js +102 -0
  32. package/v2Components/CommonTestAndPreview/utils.js +42 -3
  33. package/v2Components/FormBuilder/Classic.js +24 -14
  34. package/v2Components/FormBuilder/Functional/channels/mobilepush/config.js +1 -0
  35. package/v2Components/FormBuilder/Functional/channels/mobilepush/getEditorErrorDescriptor.js +1 -1
  36. package/v2Components/FormBuilder/Functional/channels/mobilepush/tests/validate.test.js +57 -0
  37. package/v2Components/FormBuilder/Functional/channels/mobilepush/validate.js +4 -4
  38. package/v2Components/FormBuilder/Functional/channels/sms/getEditorErrorDescriptor.js +3 -0
  39. package/v2Components/FormBuilder/Functional/channels/sms/tests/getEditorErrorDescriptor.test.js +5 -0
  40. package/v2Components/FormBuilder/Functional/channels/sms/tests/validate.test.js +6 -0
  41. package/v2Components/FormBuilder/Functional/channels/sms/validate.js +3 -1
  42. package/v2Components/FormBuilder/Functional/renderers/mpushRenderers.js +3 -0
  43. package/v2Components/FormBuilder/Functional/tests/manual.typingPerf.test.js +135 -0
  44. package/v2Components/FormBuilder/Functional/tests/mpush.crossFlowParity.test.js +1 -1
  45. package/v2Components/FormBuilder/Functional/tests/mpush.ctaFlows.parity.test.js +320 -0
  46. package/v2Components/FormBuilder/Functional/tests/mpush.editContainer.parity.test.js +148 -0
  47. package/v2Components/FormBuilder/Functional/tests/mpush.libraryValidity.parity.test.js +152 -0
  48. package/v2Components/FormBuilder/Functional/tests/mpush.shellEvents.test.js +1 -1
  49. package/v2Components/FormBuilder/Functional/tests/mpush.singlePlatform.test.js +1 -1
  50. package/v2Components/FormBuilder/Functional/tests/mpushRenderers.test.js +22 -0
  51. package/v2Components/FormBuilder/tests/mpush.characterization.test.js +2 -2
  52. package/v2Components/TemplatePreview/_templatePreview.scss +2 -12
  53. package/v2Components/TemplatePreview/index.js +17 -30
  54. package/v2Components/TemplatePreview/tests/index.test.js +0 -61
  55. package/v2Containers/Cap/index.js +3 -0
  56. package/v2Containers/Cap/messages.js +4 -0
  57. package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +1 -0
  58. package/v2Containers/CreativesContainer/SlideBoxContent.js +151 -70
  59. package/v2Containers/CreativesContainer/index.js +6 -3
  60. package/v2Containers/CreativesContainer/tests/SlideBoxContent.test.js +0 -29
  61. package/v2Containers/InApp/index.js +4 -1
  62. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +3 -0
  63. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +2 -0
  64. package/v2Containers/Line/Container/Text/index.js +3 -1
  65. package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +16 -0
  66. package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +18 -0
  67. package/v2Containers/MobilePush/Create/_mobilePushCreate.scss +70 -0
  68. package/v2Containers/MobilePush/Create/actions.js +52 -0
  69. package/v2Containers/MobilePush/Create/constants.js +26 -0
  70. package/v2Containers/MobilePush/Create/index.js +2149 -0
  71. package/v2Containers/MobilePush/Create/messages.js +349 -0
  72. package/v2Containers/MobilePush/Create/reducer.js +72 -0
  73. package/v2Containers/MobilePush/Create/sagas.js +79 -0
  74. package/v2Containers/MobilePush/Create/selectors.js +29 -0
  75. package/v2Containers/MobilePush/Create/test/contentValidity.test.js +154 -0
  76. package/v2Containers/MobilePush/Create/test/saga.test.js +19 -0
  77. package/v2Containers/MobilePush/Create/test/stayOpenOnSave.test.js +80 -0
  78. package/v2Containers/MobilePush/Edit/_mobilePushCreate.scss +65 -0
  79. package/v2Containers/MobilePush/Edit/actions.js +94 -0
  80. package/v2Containers/MobilePush/Edit/constants.js +37 -0
  81. package/v2Containers/MobilePush/Edit/index.js +2407 -0
  82. package/v2Containers/MobilePush/Edit/messages.js +341 -0
  83. package/v2Containers/MobilePush/Edit/reducer.js +113 -0
  84. package/v2Containers/MobilePush/Edit/sagas.js +113 -0
  85. package/v2Containers/MobilePush/Edit/selectors.js +33 -0
  86. package/v2Containers/MobilePush/Edit/test/contentValidity.test.js +149 -0
  87. package/v2Containers/MobilePush/Edit/test/saga.test.js +255 -0
  88. package/v2Containers/MobilePush/Edit/test/stayOpenOnSave.test.js +60 -0
  89. package/v2Containers/MobilePush/commonMethods.js +333 -0
  90. package/v2Containers/MobilePush/eventsMap.js +130 -0
  91. package/v2Containers/MobilePush/tests/commonMethods.test.js +401 -0
  92. package/v2Containers/MobilePushNew/components/CtaButtons.js +47 -52
  93. package/v2Containers/MobilePushNew/components/MediaUploaders.js +192 -207
  94. package/v2Containers/MobilePushNew/components/PlatformContentFields.js +121 -116
  95. package/v2Containers/MobilePushNew/components/tests/CtaButtons.test.js +208 -30
  96. package/v2Containers/MobilePushNew/components/tests/MediaUploaders.test.js +72 -316
  97. package/v2Containers/MobilePushNew/components/tests/PlatformContentFields.test.js +16 -45
  98. package/v2Containers/MobilePushNew/constants.js +0 -5
  99. package/v2Containers/MobilePushNew/hooks/tests/usePlatformSync.test.js +1 -63
  100. package/v2Containers/MobilePushNew/hooks/tests/useUpload.test.js +0 -52
  101. package/v2Containers/MobilePushNew/hooks/usePlatformSync.js +1 -38
  102. package/v2Containers/MobilePushNew/hooks/useUpload.js +39 -29
  103. package/v2Containers/MobilePushNew/index.js +192 -454
  104. package/v2Containers/MobilePushNew/index.scss +4 -188
  105. package/v2Containers/MobilePushNew/messages.js +6 -86
  106. package/v2Containers/MobilePushNew/tests/index.test.js +1 -450
  107. package/v2Containers/MobilePushNew/tests/utils.test.js +0 -25
  108. package/v2Containers/MobilePushNew/utils.js +0 -8
  109. package/v2Containers/MobilepushWrapper/_mobilepushWrapper.scss +22 -0
  110. package/v2Containers/MobilepushWrapper/index.js +178 -0
  111. package/v2Containers/MobilepushWrapper/messages.js +29 -0
  112. package/v2Containers/Rcs/index.js +8 -1
  113. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +59 -0
  114. package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +4 -0
  115. package/v2Containers/SmsTrai/Edit/index.js +17 -7
  116. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +42 -0
  117. package/v2Containers/Templates/_templates.scss +2 -10
  118. package/v2Containers/Templates/index.js +90 -84
  119. package/v2Containers/Templates/tests/index.test.js +0 -68
  120. package/v2Containers/Viber/index.js +3 -1
  121. package/v2Containers/WebPush/Create/utils/validation.js +6 -0
  122. package/v2Containers/WebPush/Create/utils/validation.test.js +50 -0
  123. package/v2Containers/Whatsapp/index.js +9 -5
  124. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +2 -2
  125. package/v2Containers/Zalo/index.js +4 -1
  126. package/v2Components/CapMpushCTA/tests/index.test.js +0 -89
  127. /package/{v2Components/FormBuilder/Functional/tests/fixtures/mpushInitialSchema.js → v2Containers/MobilePush/initialSchema.js} +0 -0
@@ -22,95 +22,13 @@
22
22
  min-height: 37.5rem;
23
23
  }
24
24
 
25
- // Same as the old editor's form column: the form scrolls, the phone beside it stays put
26
- .mobile-push-container .content-section {
27
- height: 70vh;
28
- overflow-y: auto;
29
- overflow-x: hidden;
30
- // Right: room for the scrollbar. Left: the scroll box clips the checkbox's -3px margin and
31
- // input focus outlines, so pad them back in without shifting the form.
32
- padding-right: $CAP_SPACE_16;
33
- padding-left: $CAP_SPACE_04;
34
- margin-left: -$CAP_SPACE_04;
35
- }
36
-
37
- // Editor phone preview, matched to the Preview and Test phone.
38
- // TemplatePreview sets `position: unset` on this shell, so the card was placed against a
39
- // wider ancestor and spilled out of the phone; re-anchor it to the phone image.
40
- .mobile-push-container .preview-section #mobilepush-preview.shell-v2 {
41
- position: relative;
42
- width: 100%;
43
- max-width: 26.786rem;
44
- padding: 0;
45
-
46
- .preview-image {
47
- width: 100%;
48
- }
49
-
50
- .android-push-message-Container,
51
- .iphone-push-message-Container {
52
- left: 4%;
53
- width: 92%;
54
-
55
- .message-pop {
56
- padding: $CAP_SPACE_08;
57
- border-radius: $CAP_SPACE_08;
58
- background: $CAP_WHITE;
59
- line-height: normal;
60
- }
61
-
62
- .app-header {
63
- align-items: center;
64
- flex-wrap: nowrap;
65
- }
66
-
67
- .app-header-left {
68
- flex: 1 1 auto;
69
- flex-wrap: nowrap;
70
- min-width: 0;
71
-
72
- .app-icon {
73
- flex: none;
74
- width: $CAP_SPACE_20;
75
- height: $CAP_SPACE_20;
76
- background-color: $CAP_COLOR_16;
77
- }
78
- }
79
-
80
- .title {
81
- max-width: none;
82
- min-width: 0;
83
- font-size: $FONT_SIZE_M;
84
- font-weight: 600;
85
- color: $FONT_COLOR_01;
86
- }
87
-
88
- .app-header-right {
89
- flex: none;
90
- flex-wrap: nowrap;
91
- margin-left: $CAP_SPACE_08;
92
- gap: $CAP_SPACE_04;
93
- font-size: $FONT_SIZE_VS;
94
- }
95
-
96
- .body-text {
97
- padding-left: 2.785rem;
98
- }
99
-
100
- // Fixed 18.75rem image + left margin is wider than the card on narrow columns
101
- .body-image img {
102
- max-width: calc(100% - 1.571rem);
103
- }
104
- }
105
- }
106
-
107
25
  .form-section {
108
26
  padding: $CAP_SPACE_24;
109
27
  background: #fff;
110
28
  border-radius: $CAP_SPACE_08;
111
29
  }
112
30
 
113
- .mobile-push-container .creative-name-container {
31
+ .creative-name-section {
114
32
  margin-bottom: $CAP_SPACE_24;
115
33
  }
116
34
 
@@ -126,11 +44,6 @@
126
44
  display: flex;
127
45
  align-items: center;
128
46
  gap: 8px;
129
-
130
- // antd adds its own end-margin to icons inside tabs, on top of the gap
131
- .anticon {
132
- margin-inline-end: 0;
133
- }
134
47
  }
135
48
 
136
49
  .android-icon,
@@ -146,16 +59,6 @@
146
59
  margin-top: $CAP_SPACE_12;
147
60
  }
148
61
 
149
- // Line up with the inputs' right edge, past the form column's scrollbar padding
150
- .mobile-push-container .same-content-checkbox {
151
- right: $CAP_SPACE_16;
152
-
153
- // antd's 8px label padding plus the library's 4px title padding left a wide gap after the box
154
- .ant-checkbox-label {
155
- padding-inline-start: $CAP_SPACE_04;
156
- }
157
- }
158
-
159
62
  .input-section {
160
63
  display: flex;
161
64
  flex-direction: column;
@@ -173,21 +76,11 @@
173
76
  gap: $CAP_SPACE_08;
174
77
  }
175
78
 
176
- .creatives-mpush-title {
177
- margin-bottom: $CAP_SPACE_24;
178
- }
179
-
180
79
  .mpush-title-main,
181
80
  .mpush-message-main {
182
81
  display: flex;
183
82
  align-items: center;
184
83
  justify-content: space-between;
185
-
186
- // Shrink the full-height "Add labels" button so the label sits close to its input
187
- .cap-button-v2.flat-btn {
188
- height: auto;
189
- padding: 0;
190
- }
191
84
  }
192
85
 
193
86
  .mpush-title,
@@ -310,68 +203,9 @@
310
203
  padding-left: 0.625rem;
311
204
  }
312
205
 
313
- // Notification tap and Buttons sections. Scoped under the container: the library's label and
314
- // heading classes reset margin with the same specificity and load later, so bare classes lose.
315
- .mobile-push-container {
316
- // Heading with "(Optional)" beside it
317
- .mpush-section-heading {
318
- margin-bottom: 0;
319
-
320
- .optional-text {
321
- margin-left: $CAP_SPACE_08;
322
- padding: 0;
323
- }
324
- }
325
-
326
- .creatives-mpush-actions {
327
- .mpush-tap-description {
328
- display: block;
329
- color: $FONT_COLOR_02;
330
- font-size: $FONT_SIZE_M;
331
- font-weight: $FONT_WEIGHT_REGULAR;
332
- margin: $CAP_SPACE_04 0 $CAP_SPACE_20;
333
- }
334
-
335
- .mpush-tap-help {
336
- margin: $CAP_SPACE_08 0 0;
337
- }
338
-
339
- .mpush-tap-label {
340
- display: block;
341
- color: $FONT_COLOR_01;
342
- font-weight: $FONT_WEIGHT_MEDIUM;
343
- margin-bottom: $CAP_SPACE_08;
344
- }
345
-
346
- .mpush-tap-link {
347
- min-width: 0;
348
- }
349
-
350
- // Same height as the "When tapped, open" label (h4 line height), so the URL input lines up with
351
- // the dropdown; the taller "Add labels" trigger is centred in the row instead of stretching it
352
- .mpush-tap-link-header {
353
- height: 1.449rem;
354
- margin-bottom: $CAP_SPACE_08;
355
-
356
- .mpush-tap-label {
357
- margin-bottom: 0;
358
- }
359
-
360
- // Shrink the full-height "Add labels" button so the label row stays compact
361
- .cap-button-v2.flat-btn {
362
- height: auto;
363
- padding: 0;
364
- }
365
- }
366
-
367
- .mpush-tap-deep-link-keys {
368
- margin-top: $CAP_SPACE_16;
369
- }
370
- }
371
-
372
- .mpush-cta-buttons .mpush-section-heading {
373
- margin-bottom: $CAP_SPACE_04;
374
- }
206
+ .action-on-click-checkbox {
207
+ margin-left: -3px;
208
+ margin-top: $CAP_SPACE_02;
375
209
  }
376
210
 
377
211
  .action-description {
@@ -446,12 +280,6 @@
446
280
  }
447
281
  }
448
282
 
449
- // Pin Reupload inside the image box's right edge, independent of the column width
450
- .mobile-push-container .cap-custom-image-upload .dragger-button.re-upload {
451
- left: 100%;
452
- transform: translateX(calc(-100% - #{$CAP_SPACE_08}));
453
- }
454
-
455
283
  .mobile-push-carousel-card {
456
284
  .ant-card-head {
457
285
  border-bottom: none;
@@ -508,18 +336,6 @@
508
336
  margin-bottom: $CAP_SPACE_12;
509
337
  }
510
338
 
511
- // Sticky footer matching the slidebox footer height, so Save stays reachable while scrolling
512
- .mpush-save-section {
513
- margin-bottom: 0;
514
- position: sticky;
515
- bottom: 0;
516
- z-index: 2;
517
- align-items: center;
518
- height: 6.286rem;
519
- background: $CAP_WHITE;
520
- border-top: 1px solid $CAP_G07;
521
- }
522
-
523
339
  .mpush-media-type {
524
340
  margin-bottom: $CAP_SPACE_08;
525
341
  }
@@ -195,93 +195,13 @@ export default defineMessages({
195
195
  id: `${scope}.validationLoadingMessage`,
196
196
  defaultMessage: 'Please wait while we validate the template',
197
197
  },
198
- platforms: {
199
- id: `${scope}.platforms`,
200
- defaultMessage: 'Platforms',
198
+ androidValidationError: {
199
+ id: `${scope}.androidValidationError`,
200
+ defaultMessage: 'Please fill in title and message for Android',
201
201
  },
202
- androidAndIos: {
203
- id: `${scope}.androidAndIos`,
204
- defaultMessage: 'Android and iOS',
205
- },
206
- androidOnly: {
207
- id: `${scope}.androidOnly`,
208
- defaultMessage: 'Android only',
209
- },
210
- iosOnly: {
211
- id: `${scope}.iosOnly`,
212
- defaultMessage: 'iOS only',
213
- },
214
- removePlatformContent: {
215
- id: `${scope}.removePlatformContent`,
216
- defaultMessage: 'Remove {platform} content?',
217
- },
218
- removeContent: {
219
- id: `${scope}.removeContent`,
220
- defaultMessage: 'Remove content',
221
- },
222
- notificationTap: {
223
- id: `${scope}.notificationTap`,
224
- defaultMessage: 'Notification tap',
225
- },
226
- notificationTapDescription: {
227
- id: `${scope}.notificationTapDescription`,
228
- defaultMessage: 'What happens when someone taps the notification itself.',
229
- },
230
- whenTappedOpen: {
231
- id: `${scope}.whenTappedOpen`,
232
- defaultMessage: 'When tapped, open',
233
- },
234
- tapActionApp: {
235
- id: `${scope}.tapActionApp`,
236
- defaultMessage: 'App (default)',
237
- },
238
- tapActionAppHelp: {
239
- id: `${scope}.tapActionAppHelp`,
240
- defaultMessage: 'Opens your app. Choose a link to send people to a specific page instead.',
241
- },
242
- cardTap: {
243
- id: `${scope}.cardTap`,
244
- defaultMessage: 'Card tap',
245
- },
246
- cardTapDescription: {
247
- id: `${scope}.cardTapDescription`,
248
- defaultMessage: 'What happens when someone taps this card.',
249
- },
250
- cardTapAppHelp: {
251
- id: `${scope}.cardTapAppHelp`,
252
- defaultMessage: 'Opens your app. Choose a link to send people to a specific page from this card instead.',
253
- },
254
- tapActionDeepLink: {
255
- id: `${scope}.tapActionDeepLink`,
256
- defaultMessage: 'Deep link',
257
- },
258
- tapActionExternalLink: {
259
- id: `${scope}.tapActionExternalLink`,
260
- defaultMessage: 'External link',
261
- },
262
- url: {
263
- id: `${scope}.url`,
264
- defaultMessage: 'URL',
265
- },
266
- enterUrl: {
267
- id: `${scope}.enterUrl`,
268
- defaultMessage: 'Enter URL',
269
- },
270
- urlNotValid: {
271
- id: `${scope}.urlNotValid`,
272
- defaultMessage: 'URL is not valid',
273
- },
274
- replacePlatformContent: {
275
- id: `${scope}.replacePlatformContent`,
276
- defaultMessage: 'Replace {platform} content?',
277
- },
278
- replacePlatformContentBody: {
279
- id: `${scope}.replacePlatformContentBody`,
280
- defaultMessage: 'The {platform} title, message, media and buttons will be replaced with the {source} content.',
281
- },
282
- replace: {
283
- id: `${scope}.replace`,
284
- defaultMessage: 'Replace',
202
+ iosValidationError: {
203
+ id: `${scope}.iosValidationError`,
204
+ defaultMessage: 'Please fill in title and message for iOS',
285
205
  },
286
206
  carouselMediaType: {
287
207
  id: `${scope}.carouselMediaType`,