@capillarytech/creatives-library 9.2.2-alpha.sprint-cap-214249.44 → 9.2.2

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 (89) hide show
  1. package/constants/unified.js +1 -3
  2. package/package.json +1 -1
  3. package/translations/en.json +0 -1
  4. package/translations/ja-JP.json +0 -1
  5. package/translations/zh.json +0 -1
  6. package/utils/common.js +6 -0
  7. package/utils/createMobilePushPayload.js +56 -50
  8. package/utils/tagValidations.js +4 -35
  9. package/utils/tests/createMobilePushPayload.test.js +168 -177
  10. package/utils/tests/tagValidations.test.js +0 -48
  11. package/v2Components/CapMpushCTA/index.js +57 -47
  12. package/v2Components/CapMpushCTA/index.scss +5 -43
  13. package/v2Components/CapTagList/index.js +7 -46
  14. package/v2Components/CapTagList/messages.js +0 -44
  15. package/v2Components/CapTagList/style.scss +1 -113
  16. package/v2Components/CommonTestAndPreview/UnifiedPreview/MobilePushPreviewContent.js +8 -11
  17. package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +1 -13
  18. package/v2Components/CommonTestAndPreview/constants.js +0 -2
  19. package/v2Components/CommonTestAndPreview/index.js +12 -51
  20. package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/MobilePushPreviewContent.test.js +5 -83
  21. package/v2Components/CommonTestAndPreview/tests/index.test.js +0 -100
  22. package/v2Components/FormBuilder/Classic.js +14 -24
  23. package/v2Components/FormBuilder/Functional/channels/mobilepush/config.js +0 -1
  24. package/v2Components/FormBuilder/Functional/channels/mobilepush/getEditorErrorDescriptor.js +1 -1
  25. package/v2Components/FormBuilder/Functional/channels/mobilepush/tests/validate.test.js +0 -57
  26. package/v2Components/FormBuilder/Functional/channels/mobilepush/validate.js +4 -4
  27. package/v2Components/FormBuilder/Functional/channels/sms/getEditorErrorDescriptor.js +0 -3
  28. package/v2Components/FormBuilder/Functional/channels/sms/tests/getEditorErrorDescriptor.test.js +0 -5
  29. package/v2Components/FormBuilder/Functional/channels/sms/tests/validate.test.js +0 -6
  30. package/v2Components/FormBuilder/Functional/channels/sms/validate.js +1 -3
  31. package/v2Components/FormBuilder/Functional/renderers/mpushRenderers.js +0 -3
  32. package/v2Components/FormBuilder/Functional/tests/mpushRenderers.test.js +0 -22
  33. package/v2Components/MobilePushPreviewV2/index.js +9 -22
  34. package/v2Components/TemplatePreview/_templatePreview.scss +2 -18
  35. package/v2Components/TemplatePreview/index.js +18 -20
  36. package/v2Components/TemplatePreview/tests/index.test.js +0 -69
  37. package/v2Containers/Cap/messages.js +0 -4
  38. package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +0 -1
  39. package/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/extractContentForPreview.js +2 -12
  40. package/v2Containers/CreativesContainer/SlideBoxContent.js +6 -4
  41. package/v2Containers/CreativesContainer/index.js +1 -2
  42. package/v2Containers/CreativesContainer/tests/SlideBoxContent.test.js +0 -43
  43. package/v2Containers/InApp/index.js +1 -4
  44. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +0 -3
  45. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +0 -2
  46. package/v2Containers/Line/Container/Text/index.js +1 -3
  47. package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +0 -16
  48. package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +0 -18
  49. package/v2Containers/MobilePushNew/components/CtaButtons.js +47 -52
  50. package/v2Containers/MobilePushNew/components/MediaUploaders.js +345 -105
  51. package/v2Containers/MobilePushNew/components/PlatformContentFields.js +105 -127
  52. package/v2Containers/MobilePushNew/components/tests/CtaButtons.test.js +208 -30
  53. package/v2Containers/MobilePushNew/components/tests/MediaUploaders.test.js +1484 -307
  54. package/v2Containers/MobilePushNew/components/tests/PlatformContentFields.test.js +59 -165
  55. package/v2Containers/MobilePushNew/constants.js +0 -12
  56. package/v2Containers/MobilePushNew/hooks/tests/usePlatformSync.test.js +1 -63
  57. package/v2Containers/MobilePushNew/hooks/tests/useUpload.test.js +0 -78
  58. package/v2Containers/MobilePushNew/hooks/usePlatformSync.js +1 -40
  59. package/v2Containers/MobilePushNew/hooks/useUpload.js +46 -42
  60. package/v2Containers/MobilePushNew/index.js +290 -502
  61. package/v2Containers/MobilePushNew/index.scss +4 -151
  62. package/v2Containers/MobilePushNew/messages.js +6 -106
  63. package/v2Containers/MobilePushNew/tests/index.test.js +1 -483
  64. package/v2Containers/MobilePushNew/tests/utils.test.js +0 -110
  65. package/v2Containers/MobilePushNew/utils.js +0 -83
  66. package/v2Containers/Rcs/index.js +1 -8
  67. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +0 -59
  68. package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +0 -4
  69. package/v2Containers/SmsTrai/Edit/index.js +5 -13
  70. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +0 -15
  71. package/v2Containers/Templates/_templates.scss +2 -10
  72. package/v2Containers/Templates/index.js +81 -86
  73. package/v2Containers/Templates/tests/index.test.js +0 -81
  74. package/v2Containers/Viber/index.js +1 -3
  75. package/v2Containers/WebPush/Create/utils/validation.js +0 -6
  76. package/v2Containers/WebPush/Create/utils/validation.test.js +0 -50
  77. package/v2Containers/Whatsapp/index.js +5 -9
  78. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +2 -2
  79. package/v2Containers/Zalo/index.js +1 -4
  80. package/v2Components/CapMpushCTA/tests/index.test.js +0 -150
  81. package/v2Components/CapTagList/TagFallbackPanel.js +0 -124
  82. package/v2Components/CapTagList/constants.js +0 -5
  83. package/v2Components/CapTagList/tests/TagFallback.test.js +0 -222
  84. package/v2Components/CapTagList/utils.js +0 -17
  85. package/v2Components/MobilePushPreviewV2/_mobilePushPreviewV2.scss +0 -7
  86. package/v2Components/MobilePushPreviewV2/tests/index.test.js +0 -55
  87. package/v2Components/TemplatePreview/_mobilePushPhone.scss +0 -72
  88. package/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/Tests/extractContentForPreview.test.js +0 -45
  89. package/v2Containers/MobilePushNew/components/TapLinkActions.js +0 -76
@@ -1,5 +1,4 @@
1
1
  @import '~@capillarytech/cap-ui-library/styles/_variables';
2
- @import '../../v2Components/TemplatePreview/mobilePushPhone';
3
2
  .header-row {
4
3
  margin-bottom: $CAP_SPACE_24;
5
4
  }
@@ -23,30 +22,13 @@
23
22
  min-height: 37.5rem;
24
23
  }
25
24
 
26
- // Same as the old editor's form column: the form scrolls, the phone beside it stays put
27
- .mobile-push-container .content-section {
28
- height: 70vh;
29
- overflow-y: auto;
30
- overflow-x: hidden;
31
- // Right: room for the scrollbar. Left: the scroll box clips the checkbox's -3px margin and
32
- // input focus outlines, so pad them back in without shifting the form.
33
- padding-right: $CAP_SPACE_16;
34
- padding-left: $CAP_SPACE_04;
35
- margin-left: -$CAP_SPACE_04;
36
- }
37
-
38
- // Editor phone preview
39
- .mobile-push-container .preview-section #mobilepush-preview.shell-v2 {
40
- @include mobile-push-phone-shell;
41
- }
42
-
43
25
  .form-section {
44
26
  padding: $CAP_SPACE_24;
45
27
  background: #fff;
46
28
  border-radius: $CAP_SPACE_08;
47
29
  }
48
30
 
49
- .mobile-push-container .creative-name-container {
31
+ .creative-name-section {
50
32
  margin-bottom: $CAP_SPACE_24;
51
33
  }
52
34
 
@@ -62,11 +44,6 @@
62
44
  display: flex;
63
45
  align-items: center;
64
46
  gap: 8px;
65
-
66
- // antd adds its own end-margin to icons inside tabs, on top of the gap
67
- .anticon {
68
- margin-inline-end: 0;
69
- }
70
47
  }
71
48
 
72
49
  .android-icon,
@@ -82,16 +59,6 @@
82
59
  margin-top: $CAP_SPACE_12;
83
60
  }
84
61
 
85
- // Line up with the inputs' right edge, past the form column's scrollbar padding
86
- .mobile-push-container .same-content-checkbox {
87
- right: $CAP_SPACE_16;
88
-
89
- // antd's 8px label padding plus the library's 4px title padding left a wide gap after the box
90
- .ant-checkbox-label {
91
- padding-inline-start: $CAP_SPACE_04;
92
- }
93
- }
94
-
95
62
  .input-section {
96
63
  display: flex;
97
64
  flex-direction: column;
@@ -109,21 +76,11 @@
109
76
  gap: $CAP_SPACE_08;
110
77
  }
111
78
 
112
- .creatives-mpush-title {
113
- margin-bottom: $CAP_SPACE_24;
114
- }
115
-
116
79
  .mpush-title-main,
117
80
  .mpush-message-main {
118
81
  display: flex;
119
82
  align-items: center;
120
83
  justify-content: space-between;
121
-
122
- // Shrink the full-height "Add labels" button so the label sits close to its input
123
- .cap-button-v2.flat-btn {
124
- height: auto;
125
- padding: 0;
126
- }
127
84
  }
128
85
 
129
86
  .mpush-title,
@@ -246,88 +203,9 @@
246
203
  padding-left: 0.625rem;
247
204
  }
248
205
 
249
- // Notification tap and Buttons sections. Scoped under the container: the library's label and
250
- // heading classes reset margin with the same specificity and load later, so bare classes lose.
251
- .mobile-push-container {
252
- // Heading with "(Optional)" beside it
253
- .mpush-section-heading {
254
- margin-bottom: 0;
255
-
256
- .optional-text {
257
- margin-left: $CAP_SPACE_08;
258
- padding: 0;
259
- }
260
- }
261
-
262
- .creatives-mpush-actions {
263
- .mpush-tap-description {
264
- display: block;
265
- color: $FONT_COLOR_02;
266
- font-size: $FONT_SIZE_M;
267
- font-weight: $FONT_WEIGHT_REGULAR;
268
- margin: $CAP_SPACE_04 0 $CAP_SPACE_20;
269
- }
270
-
271
- .mpush-tap-help {
272
- margin: $CAP_SPACE_08 0 0;
273
- }
274
-
275
- .mpush-tap-label {
276
- display: block;
277
- color: $FONT_COLOR_01;
278
- font-weight: $FONT_WEIGHT_MEDIUM;
279
- margin-bottom: $CAP_SPACE_08;
280
- }
281
-
282
- .mpush-tap-link {
283
- min-width: 0;
284
- }
285
-
286
- // Same height as the "When tapped, open" label (h4 line height), so the URL input lines up with
287
- // the dropdown; the taller "Add labels" trigger is centred in the row instead of stretching it
288
- .mpush-tap-link-header {
289
- height: 1.449rem;
290
- margin-bottom: $CAP_SPACE_08;
291
-
292
- .mpush-tap-label {
293
- margin-bottom: 0;
294
- }
295
-
296
- // Shrink the full-height "Add labels" button so the label row stays compact
297
- .cap-button-v2.flat-btn {
298
- height: auto;
299
- padding: 0;
300
- }
301
- }
302
-
303
- .mpush-tap-deep-link-keys {
304
- margin-top: $CAP_SPACE_16;
305
-
306
- // One label + input per key, spaced as a pair so each label reads with its own input
307
- .mpush-deep-link-key {
308
- margin-top: $CAP_SPACE_12;
309
-
310
- .deep-link-keys-value {
311
- display: block;
312
- margin-bottom: $CAP_SPACE_08;
313
- }
314
- }
315
- }
316
-
317
- // Save / Delete under an open tap link, spaced like the button form's
318
- .mpush-tap-save-delete-btn {
319
- margin-top: $CAP_SPACE_16;
320
- gap: $CAP_SPACE_08;
321
-
322
- .button-disabled-tooltip-wrapper {
323
- margin-top: 0;
324
- }
325
- }
326
- }
327
-
328
- .mpush-cta-buttons .mpush-section-heading {
329
- margin-bottom: $CAP_SPACE_04;
330
- }
206
+ .action-on-click-checkbox {
207
+ margin-left: -3px;
208
+ margin-top: $CAP_SPACE_02;
331
209
  }
332
210
 
333
211
  .action-description {
@@ -366,13 +244,6 @@
366
244
  margin: 0;
367
245
  }
368
246
 
369
- // Shared wrapper has margin-top for another context; keep "+" in line with the tabs (as in RCS)
370
- .button-disabled-tooltip-wrapper {
371
- display: inline-flex;
372
- align-items: center;
373
- margin-top: 0;
374
- }
375
-
376
247
  .cap-divider-v2 {
377
248
  height: 1.5rem;
378
249
  margin-bottom: 0.499rem;
@@ -409,12 +280,6 @@
409
280
  }
410
281
  }
411
282
 
412
- // Pin Reupload inside the image box's right edge, independent of the column width
413
- .mobile-push-container .cap-custom-image-upload .dragger-button.re-upload {
414
- left: 100%;
415
- transform: translateX(calc(-100% - #{$CAP_SPACE_08}));
416
- }
417
-
418
283
  .mobile-push-carousel-card {
419
284
  .ant-card-head {
420
285
  border-bottom: none;
@@ -471,18 +336,6 @@
471
336
  margin-bottom: $CAP_SPACE_12;
472
337
  }
473
338
 
474
- // Sticky footer matching the slidebox footer height, so Save stays reachable while scrolling
475
- .mpush-save-section {
476
- margin-bottom: 0;
477
- position: sticky;
478
- bottom: 0;
479
- z-index: 2;
480
- align-items: center;
481
- height: 6.286rem;
482
- background: $CAP_WHITE;
483
- border-top: 1px solid $CAP_G07;
484
- }
485
-
486
339
  .mpush-media-type {
487
340
  margin-bottom: $CAP_SPACE_08;
488
341
  }
@@ -195,113 +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
- deepLinkRequired: {
243
- id: `${scope}.deepLinkRequired`,
244
- defaultMessage: 'Select a deep link',
245
- },
246
- completeCardToAdd: {
247
- id: `${scope}.completeCardToAdd`,
248
- defaultMessage: 'Please set-up the first card before creating the next ones',
249
- },
250
- tapLinkSaveDisabled: {
251
- id: `${scope}.tapLinkSaveDisabled`,
252
- defaultMessage: 'Please complete the above fields to enable Save',
253
- },
254
- saveTapLinkFirst: {
255
- id: `${scope}.saveTapLinkFirst`,
256
- defaultMessage: 'Save or delete the open tap link before saving the template',
257
- },
258
- carouselMaxCardTooltip: {
259
- id: `${scope}.carouselMaxCardTooltip`,
260
- defaultMessage: 'Mobile push carousel cannot contain more than {max} content cards.',
261
- },
262
- cardTap: {
263
- id: `${scope}.cardTap`,
264
- defaultMessage: 'Card tap',
265
- },
266
- cardTapDescription: {
267
- id: `${scope}.cardTapDescription`,
268
- defaultMessage: 'What happens when someone taps this card.',
269
- },
270
- cardTapAppHelp: {
271
- id: `${scope}.cardTapAppHelp`,
272
- defaultMessage: 'Opens your app. Choose a link to send people to a specific page from this card instead.',
273
- },
274
- tapActionDeepLink: {
275
- id: `${scope}.tapActionDeepLink`,
276
- defaultMessage: 'Deep link',
277
- },
278
- tapActionExternalLink: {
279
- id: `${scope}.tapActionExternalLink`,
280
- defaultMessage: 'External link',
281
- },
282
- url: {
283
- id: `${scope}.url`,
284
- defaultMessage: 'URL',
285
- },
286
- enterUrl: {
287
- id: `${scope}.enterUrl`,
288
- defaultMessage: 'Enter URL',
289
- },
290
- urlNotValid: {
291
- id: `${scope}.urlNotValid`,
292
- defaultMessage: 'URL is not valid',
293
- },
294
- replacePlatformContent: {
295
- id: `${scope}.replacePlatformContent`,
296
- defaultMessage: 'Replace {platform} content?',
297
- },
298
- replacePlatformContentBody: {
299
- id: `${scope}.replacePlatformContentBody`,
300
- defaultMessage: 'The {platform} title, message, media and buttons will be replaced with the {source} content.',
301
- },
302
- replace: {
303
- id: `${scope}.replace`,
304
- defaultMessage: 'Replace',
202
+ iosValidationError: {
203
+ id: `${scope}.iosValidationError`,
204
+ defaultMessage: 'Please fill in title and message for iOS',
305
205
  },
306
206
  carouselMediaType: {
307
207
  id: `${scope}.carouselMediaType`,