@capillarytech/creatives-library 9.2.2 → 9.2.4-alpha.feature-rcs-multi-account.51

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 (60) hide show
  1. package/constants/unified.js +0 -1
  2. package/package.json +1 -1
  3. package/utils/common.js +0 -6
  4. package/utils/createMobilePushPayload.js +50 -56
  5. package/utils/tests/createMobilePushPayload.test.js +177 -168
  6. package/v2Components/CapMpushCTA/index.js +47 -57
  7. package/v2Components/CapMpushCTA/index.scss +43 -5
  8. package/v2Components/CapMpushCTA/tests/index.test.js +150 -0
  9. package/v2Components/CommonTestAndPreview/UnifiedPreview/MobilePushPreviewContent.js +11 -8
  10. package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +13 -1
  11. package/v2Components/CommonTestAndPreview/constants.js +2 -0
  12. package/v2Components/CommonTestAndPreview/index.js +59 -14
  13. package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/MobilePushPreviewContent.test.js +83 -5
  14. package/v2Components/CommonTestAndPreview/tests/index.test.js +158 -0
  15. package/v2Components/MobilePushPreviewV2/_mobilePushPreviewV2.scss +7 -0
  16. package/v2Components/MobilePushPreviewV2/index.js +22 -9
  17. package/v2Components/MobilePushPreviewV2/tests/index.test.js +55 -0
  18. package/v2Components/TemplatePreview/_mobilePushPhone.scss +72 -0
  19. package/v2Components/TemplatePreview/_templatePreview.scss +18 -2
  20. package/v2Components/TemplatePreview/index.js +20 -18
  21. package/v2Components/TemplatePreview/tests/index.test.js +69 -0
  22. package/v2Components/TestAndPreviewSlidebox/index.js +2 -0
  23. package/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/Tests/extractContentForPreview.test.js +45 -0
  24. package/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/extractContentForPreview.js +12 -2
  25. package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/DeliverySettingsSection.js +16 -3
  26. package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/SenderDetails.js +7 -2
  27. package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/Tests/deliverySettingsConfig.test.js +44 -0
  28. package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/deliverySettingsConfig.js +21 -8
  29. package/v2Containers/CreativesContainer/SlideBoxContent.js +4 -6
  30. package/v2Containers/CreativesContainer/index.js +18 -1
  31. package/v2Containers/CreativesContainer/tests/SlideBoxContent.test.js +43 -0
  32. package/v2Containers/CreativesContainer/tests/index.test.js +66 -0
  33. package/v2Containers/MobilePushNew/components/CtaButtons.js +52 -47
  34. package/v2Containers/MobilePushNew/components/MediaUploaders.js +105 -345
  35. package/v2Containers/MobilePushNew/components/PlatformContentFields.js +127 -105
  36. package/v2Containers/MobilePushNew/components/TapLinkActions.js +76 -0
  37. package/v2Containers/MobilePushNew/components/tests/CtaButtons.test.js +30 -208
  38. package/v2Containers/MobilePushNew/components/tests/MediaUploaders.test.js +305 -1482
  39. package/v2Containers/MobilePushNew/components/tests/PlatformContentFields.test.js +165 -59
  40. package/v2Containers/MobilePushNew/constants.js +12 -0
  41. package/v2Containers/MobilePushNew/hooks/tests/usePlatformSync.test.js +63 -1
  42. package/v2Containers/MobilePushNew/hooks/tests/useUpload.test.js +78 -0
  43. package/v2Containers/MobilePushNew/hooks/usePlatformSync.js +40 -1
  44. package/v2Containers/MobilePushNew/hooks/useUpload.js +42 -46
  45. package/v2Containers/MobilePushNew/index.js +498 -289
  46. package/v2Containers/MobilePushNew/index.scss +151 -4
  47. package/v2Containers/MobilePushNew/messages.js +106 -6
  48. package/v2Containers/MobilePushNew/tests/index.test.js +483 -1
  49. package/v2Containers/MobilePushNew/tests/utils.test.js +110 -0
  50. package/v2Containers/MobilePushNew/utils.js +83 -0
  51. package/v2Containers/Rcs/accountUtils.js +20 -0
  52. package/v2Containers/Rcs/index.js +18 -1
  53. package/v2Containers/Rcs/tests/accountUtils.test.js +24 -0
  54. package/v2Containers/Rcs/tests/index.test.js +23 -0
  55. package/v2Containers/Templates/ChannelTypeIllustration.js +12 -0
  56. package/v2Containers/Templates/_templates.scss +10 -2
  57. package/v2Containers/Templates/index.js +94 -85
  58. package/v2Containers/Templates/messages.js +4 -0
  59. package/v2Containers/Templates/tests/ChannelTypeIllustration.test.js +14 -2
  60. package/v2Containers/Templates/tests/index.test.js +182 -0
@@ -1,4 +1,5 @@
1
1
  @import '~@capillarytech/cap-ui-library/styles/_variables';
2
+ @import '../../v2Components/TemplatePreview/mobilePushPhone';
2
3
  .header-row {
3
4
  margin-bottom: $CAP_SPACE_24;
4
5
  }
@@ -22,13 +23,30 @@
22
23
  min-height: 37.5rem;
23
24
  }
24
25
 
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
+
25
43
  .form-section {
26
44
  padding: $CAP_SPACE_24;
27
45
  background: #fff;
28
46
  border-radius: $CAP_SPACE_08;
29
47
  }
30
48
 
31
- .creative-name-section {
49
+ .mobile-push-container .creative-name-container {
32
50
  margin-bottom: $CAP_SPACE_24;
33
51
  }
34
52
 
@@ -44,6 +62,11 @@
44
62
  display: flex;
45
63
  align-items: center;
46
64
  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
+ }
47
70
  }
48
71
 
49
72
  .android-icon,
@@ -59,6 +82,16 @@
59
82
  margin-top: $CAP_SPACE_12;
60
83
  }
61
84
 
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
+
62
95
  .input-section {
63
96
  display: flex;
64
97
  flex-direction: column;
@@ -76,11 +109,21 @@
76
109
  gap: $CAP_SPACE_08;
77
110
  }
78
111
 
112
+ .creatives-mpush-title {
113
+ margin-bottom: $CAP_SPACE_24;
114
+ }
115
+
79
116
  .mpush-title-main,
80
117
  .mpush-message-main {
81
118
  display: flex;
82
119
  align-items: center;
83
120
  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
+ }
84
127
  }
85
128
 
86
129
  .mpush-title,
@@ -203,9 +246,88 @@
203
246
  padding-left: 0.625rem;
204
247
  }
205
248
 
206
- .action-on-click-checkbox {
207
- margin-left: -3px;
208
- margin-top: $CAP_SPACE_02;
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
+ }
209
331
  }
210
332
 
211
333
  .action-description {
@@ -244,6 +366,13 @@
244
366
  margin: 0;
245
367
  }
246
368
 
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
+
247
376
  .cap-divider-v2 {
248
377
  height: 1.5rem;
249
378
  margin-bottom: 0.499rem;
@@ -280,6 +409,12 @@
280
409
  }
281
410
  }
282
411
 
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
+
283
418
  .mobile-push-carousel-card {
284
419
  .ant-card-head {
285
420
  border-bottom: none;
@@ -336,6 +471,18 @@
336
471
  margin-bottom: $CAP_SPACE_12;
337
472
  }
338
473
 
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
+
339
486
  .mpush-media-type {
340
487
  margin-bottom: $CAP_SPACE_08;
341
488
  }
@@ -195,13 +195,113 @@ export default defineMessages({
195
195
  id: `${scope}.validationLoadingMessage`,
196
196
  defaultMessage: 'Please wait while we validate the template',
197
197
  },
198
- androidValidationError: {
199
- id: `${scope}.androidValidationError`,
200
- defaultMessage: 'Please fill in title and message for Android',
198
+ platforms: {
199
+ id: `${scope}.platforms`,
200
+ defaultMessage: 'Platforms',
201
201
  },
202
- iosValidationError: {
203
- id: `${scope}.iosValidationError`,
204
- defaultMessage: 'Please fill in title and message for iOS',
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',
205
305
  },
206
306
  carouselMediaType: {
207
307
  id: `${scope}.carouselMediaType`,