@capillarytech/creatives-library 9.0.41-alpha.0 → 9.0.41-alpha.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 (25) hide show
  1. package/package.json +1 -1
  2. package/v2Components/CapDeviceContent/index.scss +1 -1
  3. package/v2Components/CommonTestAndPreview/UnifiedPreview/ViberPreviewContent.js +15 -108
  4. package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +1 -139
  5. package/v2Components/CommonTestAndPreview/_commonTestAndPreview.scss +5 -1
  6. package/v2Components/CommonTestAndPreview/index.js +26 -240
  7. package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/ViberPreviewContent.test.js +0 -364
  8. package/v2Components/FormBuilder/_formBuilder.scss +1 -1
  9. package/v2Containers/Email/_email.scss +4 -0
  10. package/v2Containers/Email/index.js +1 -1
  11. package/v2Containers/MobilePush/Create/_mobilePushCreate.scss +14 -10
  12. package/v2Containers/MobilePush/Edit/_mobilePushCreate.scss +14 -9
  13. package/v2Containers/Templates/_templates.scss +11 -196
  14. package/v2Containers/Templates/index.js +18 -110
  15. package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +15 -6
  16. package/v2Containers/Viber/constants.js +0 -21
  17. package/v2Containers/Viber/index.js +49 -719
  18. package/v2Containers/Viber/index.scss +0 -175
  19. package/v2Containers/Viber/messages.js +0 -121
  20. package/v2Containers/Viber/tests/index.test.js +0 -80
  21. package/v2Containers/Whatsapp/index.js +4 -2
  22. package/v2Containers/Whatsapp/index.scss +8 -5
  23. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +280 -224
  24. package/v2Components/CommonTestAndPreview/UnifiedPreview/ViberCarouselPreviewCards.js +0 -132
  25. package/v2Components/CommonTestAndPreview/UnifiedPreview/_viberCarouselPreviewCards.scss +0 -131
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "9.0.41-alpha.0",
4
+ "version": "9.0.41-alpha.2",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -84,7 +84,7 @@
84
84
  }
85
85
  }
86
86
  .cap-heading:first-of-type {
87
- margin-bottom: $CAP_SPACE_04;
87
+ margin-bottom: $CAP_SPACE_12;
88
88
  }
89
89
  }
90
90
  }
@@ -14,25 +14,14 @@ import CapSpin from '@capillarytech/cap-ui-library/CapSpin';
14
14
  import CapImage from '@capillarytech/cap-ui-library/CapImage';
15
15
  import CapTooltip from '@capillarytech/cap-ui-library/CapTooltip';
16
16
  import CapRow from '@capillarytech/cap-ui-library/CapRow';
17
- import {
18
- ANDROID,
19
- IOS,
20
- ANDROID_DEVICE_NAME,
21
- IOS_DEVICE_NAME,
22
- VIBER_ACCOUNT_NAME,
23
- MEDIA_TYPE_CAROUSEL,
24
- } from '../constants';
17
+ import { ANDROID, IOS, ANDROID_DEVICE_NAME, IOS_DEVICE_NAME, VIBER_ACCOUNT_NAME } from '../constants';
25
18
  import messages from '../messages';
26
19
  import videoPlay from '../../../assets/videoPlay.svg';
27
- import ViberCarouselPreviewCards from './ViberCarouselPreviewCards';
28
20
 
29
21
  // Import device mockup images (same as SMS)
30
22
  const smsMobileAndroid = require('../../../assets/Android.png');
31
23
  const smsMobileIos = require('../../../assets/iOS.png');
32
24
 
33
- const getTrimmedText = (value = '') => (value ?? '').trim();
34
- const hasTrimmedText = (value = '') => Boolean(getTrimmedText(value));
35
-
36
25
  const ViberPreviewContent = ({
37
26
  content,
38
27
  device,
@@ -54,35 +43,7 @@ const ViberPreviewContent = ({
54
43
  imageURL = '',
55
44
  videoParams = {},
56
45
  buttonText = '',
57
- type = '',
58
- cards = [],
59
- showCarouselEditorPreview = false,
60
46
  } = viberContent;
61
- const hasCarouselContent = type === MEDIA_TYPE_CAROUSEL;
62
-
63
- const cardHasMeaningfulContent = (card) => {
64
- if (!card || typeof card !== 'object') return false;
65
- return (
66
- hasTrimmedText(card?.text) ||
67
- hasTrimmedText(card?.mediaUrl) ||
68
- (card.buttons ?? []).some(button => hasTrimmedText(button?.title))
69
- );
70
- };
71
-
72
- const hasMeaningfulCarousel =
73
- hasCarouselContent &&
74
- Array.isArray(cards) &&
75
- cards.length > 0 &&
76
- cards.some(cardHasMeaningfulContent);
77
-
78
- const showCarouselInPreview =
79
- hasCarouselContent && (Boolean(showCarouselEditorPreview) || hasMeaningfulCarousel);
80
-
81
- const previewCarouselCards =
82
- hasCarouselContent && Array.isArray(cards) && cards.length ? cards : hasCarouselContent ? [{}] : [];
83
-
84
- const trimmedMessageContent = getTrimmedText(messageContent);
85
- const trimmedButtonText = getTrimmedText(buttonText);
86
47
 
87
48
  // Get account name (first letter for icon)
88
49
  const accountIcon = (accountName || brandName || 'V')[0]?.toUpperCase();
@@ -138,15 +99,8 @@ const ViberPreviewContent = ({
138
99
  );
139
100
  }
140
101
 
141
- // Check if there's any content to display (whitespace-only strings do not count)
142
- const hasContent = Boolean(
143
- trimmedMessageContent
144
- || hasTrimmedText(imageURL)
145
- || videoParams?.viberVideoSrc
146
- || trimmedButtonText
147
- || hasMeaningfulCarousel
148
- || (hasCarouselContent && showCarouselEditorPreview)
149
- );
102
+ // Check if there's any content to display
103
+ const hasContent = messageContent || imageURL || videoParams?.viberVideoSrc || buttonText;
150
104
 
151
105
  // Render normal Viber preview
152
106
  return (
@@ -171,34 +125,23 @@ const ViberPreviewContent = ({
171
125
 
172
126
  {/* Viber Message Container */}
173
127
  {hasContent && (
174
- <CapRow className={`viber-message-container ${showCarouselInPreview ? 'viber-message-container-carousel' : ''} ${device !== ANDROID ? 'viber-message-container-ios' : ''}`}>
128
+ <CapRow className={`viber-message-container ${device !== ANDROID ? 'viber-message-container-ios' : ''}`}>
175
129
  {/* Brand Name Display (from TemplatePreview line 1136) */}
176
- <CapRow
177
- type="flex"
178
- align="middle"
179
- fullWidth={showCarouselInPreview}
180
- className={`msg-container viber-preview ${showCarouselInPreview ? 'viber-preview-carousel' : ''}`}
181
- >
130
+ <CapRow type="flex" align="middle" className="msg-container viber-preview">
182
131
  {/* Account Icon (from TemplatePreview line 1146-1160) */}
183
- {!hasCarouselContent && (
184
- <CapRow type="flex" className="viber-account-icon">
185
- {accountIcon}
186
- </CapRow>
187
- )}
132
+ <CapRow type='flex' className="viber-account-icon">
133
+ {accountIcon}
134
+ </CapRow>
188
135
 
189
136
  {/* Message Bubble (from TemplatePreview line 1161-1223) */}
190
- <CapRow
191
- useLegacy
192
- fullWidth={showCarouselInPreview}
193
- className={`message-pop align-left viber-message-pop ${showCarouselInPreview ? 'viber-message-pop-carousel' : ''}`}
194
- >
137
+ <CapRow useLegacy className="message-pop align-left viber-message-pop">
195
138
  {/* Text Viber preview */}
196
- {trimmedMessageContent && !hasCarouselContent && (
139
+ {messageContent && (
197
140
  <CapLabel type="label15" className="viber-message-text">{messageContent}</CapLabel>
198
141
  )}
199
142
 
200
143
  {/* Image Viber preview */}
201
- {hasTrimmedText(imageURL) && (
144
+ {imageURL && (
202
145
  <CapImage
203
146
  src={imageURL}
204
147
  className="viber-image-preview"
@@ -228,42 +171,16 @@ const ViberPreviewContent = ({
228
171
  )}
229
172
 
230
173
  {/* Button Viber preview */}
231
- {trimmedButtonText && (
174
+ {buttonText && (
232
175
  <CapLabel className="viber-button-base">
233
176
  <p className="viber-button-card-text">
234
177
  {buttonText}
235
178
  </p>
236
179
  </CapLabel>
237
180
  )}
238
- {/* Carousel Viber preview */}
239
- {showCarouselInPreview && (
240
- <CapRow type="flex-column" fullWidth className="viber-carousel-preview">
241
- <CapRow type="flex-column" className="viber-carousel-message-pop">
242
- {trimmedMessageContent ? (
243
- <CapLabel
244
- type="label15"
245
- className="message-pop-item align-left viber-message-text viber-carousel-message-box-text"
246
- >
247
- {messageContent}
248
- </CapLabel>
249
- ) : (
250
- <CapRow className="viber-carousel-message-box-placeholder" />
251
- )}
252
- <CapLabel type="label1" className="viber-carousel-message-timestamp">
253
- {timestamp}
254
- </CapLabel>
255
- </CapRow>
256
-
257
- <CapRow type="flex-column" fullWidth className="viber-carousel-cards-pop">
258
- <ViberCarouselPreviewCards cards={previewCarouselCards} />
259
- </CapRow>
260
- </CapRow>
261
- )}
262
- {!showCarouselInPreview && (
263
- <CapLabel type="label1" className="viber-timestamp">
264
- {timestamp}
265
- </CapLabel>
266
- )}
181
+ <CapLabel type="label1" className="viber-timestamp">
182
+ {timestamp}
183
+ </CapLabel>
267
184
  <CapRow useLegacy className="empty-placeholder" />
268
185
  </CapRow>
269
186
 
@@ -297,16 +214,6 @@ ViberPreviewContent.propTypes = {
297
214
  viberVideoPreviewImg: PropTypes.string,
298
215
  }),
299
216
  buttonText: PropTypes.string,
300
- type: PropTypes.string,
301
- cards: PropTypes.arrayOf(PropTypes.shape({
302
- text: PropTypes.string,
303
- mediaUrl: PropTypes.string,
304
- buttons: PropTypes.arrayOf(PropTypes.shape({
305
- title: PropTypes.string,
306
- action: PropTypes.string,
307
- })),
308
- })),
309
- showCarouselEditorPreview: PropTypes.bool,
310
217
  }),
311
218
  }),
312
219
  device: PropTypes.oneOf([ANDROID, IOS]),
@@ -1,5 +1,4 @@
1
1
  @import '~@capillarytech/cap-ui-library/styles/_variables';
2
- @import './_viberCarouselPreviewCards.scss';
3
2
 
4
3
  /**
5
4
  * UnifiedPreview Styles
@@ -783,13 +782,9 @@
783
782
 
784
783
  .viber-content-overlay {
785
784
  top: 3.2rem;
786
- overflow: hidden;
787
-
788
- .sms-navigation-bar.viber-navigation-bar {
789
- width: calc(100% - #{$CAP_SPACE_06} - #{$CAP_SPACE_08});
785
+ .viber-navigation-bar {
790
786
  margin-left: $CAP_SPACE_06;
791
787
  margin-right: $CAP_SPACE_08;
792
- box-sizing: border-box;
793
788
  }
794
789
  }
795
790
 
@@ -2412,21 +2407,12 @@
2412
2407
  // Body content follows TemplatePreview Viber structure
2413
2408
  .sms-content-overlay {
2414
2409
  &.viber-preview {
2415
- overflow: hidden;
2416
-
2417
2410
  // Viber message container
2418
2411
  .viber-message-container {
2419
2412
  position: relative;
2420
2413
  flex: 1;
2421
2414
  display: flex;
2422
2415
  flex-direction: column;
2423
- overflow-x: hidden;
2424
- overflow-y: auto;
2425
- -webkit-overflow-scrolling: touch;
2426
- min-width: 0;
2427
- max-width: 100%;
2428
- box-sizing: border-box;
2429
- width: calc(100% - #{$CAP_SPACE_06} - #{$CAP_SPACE_08});
2430
2416
  padding: 0 $CAP_SPACE_16;
2431
2417
  background-color: #ffffff;
2432
2418
  margin-left: $CAP_SPACE_06;
@@ -2434,20 +2420,6 @@
2434
2420
  border-bottom-left-radius: 2.6rem;
2435
2421
  border-bottom-right-radius: 2.6rem;
2436
2422
 
2437
- &.viber-message-container-carousel {
2438
- padding-left: $CAP_SPACE_08;
2439
- padding-right: $CAP_SPACE_08;
2440
- width: calc(100% - #{$CAP_SPACE_04} - #{$CAP_SPACE_04});
2441
- margin-left: $CAP_SPACE_04;
2442
- margin-right: $CAP_SPACE_04;
2443
-
2444
- > .ant-row,
2445
- .ant-row.msg-container.viber-preview-carousel {
2446
- margin-left: 0;
2447
- margin-right: 0;
2448
- }
2449
- }
2450
-
2451
2423
  // Brand name display (from TemplatePreview line 1136)
2452
2424
  .viber-brand-name {
2453
2425
  position: absolute;
@@ -2469,16 +2441,6 @@
2469
2441
  flex-direction: row;
2470
2442
  align-items: start;
2471
2443
 
2472
- &.viber-preview-carousel {
2473
- width: 100%;
2474
- max-width: 100%;
2475
- margin-left: 0;
2476
- margin-right: 0;
2477
- max-height: 100%;
2478
- min-width: 0;
2479
- box-sizing: border-box;
2480
- }
2481
-
2482
2444
  // Account icon (from TemplatePreview line 1146-1160)
2483
2445
  .viber-account-icon {
2484
2446
  width: $CAP_SPACE_20;
@@ -2503,22 +2465,6 @@
2503
2465
  border-radius: $CAP_SPACE_04;
2504
2466
  padding: $CAP_SPACE_04;
2505
2467
 
2506
- &.viber-message-pop-carousel {
2507
- width: 100%;
2508
- max-width: 100%;
2509
- min-width: 0;
2510
- left: 0;
2511
- margin-top: 0;
2512
- padding: 0;
2513
- background: transparent;
2514
- display: flex;
2515
- flex-direction: column;
2516
- align-items: flex-start;
2517
- gap: $CAP_SPACE_06;
2518
- overflow: hidden;
2519
- box-sizing: border-box;
2520
- }
2521
-
2522
2468
  // Text Viber preview (from TemplatePreview line 1166-1174)
2523
2469
  .viber-message-text {
2524
2470
  margin: 0.107rem $CAP_SPACE_06 $CAP_SPACE_01 0.5rem;
@@ -2590,85 +2536,6 @@
2590
2536
  }
2591
2537
  }
2592
2538
 
2593
- .viber-carousel-preview {
2594
- width: 100%;
2595
- max-width: 100%;
2596
- min-width: 0;
2597
- display: flex;
2598
- flex-direction: column;
2599
- align-items: flex-start;
2600
- gap: $CAP_SPACE_06;
2601
- overflow: hidden;
2602
- box-sizing: border-box;
2603
- }
2604
-
2605
- .viber-carousel-message-pop,
2606
- .viber-carousel-cards-pop {
2607
- width: 100%;
2608
- max-width: 100%;
2609
- min-width: 0;
2610
- background: $CAP_G08;
2611
- border-radius: $CAP_SPACE_06;
2612
- padding: $CAP_SPACE_08;
2613
- box-sizing: border-box;
2614
- }
2615
-
2616
- .viber-carousel-message-pop {
2617
- margin-top: 0;
2618
- width: 85%;
2619
- border-radius: 0 $CAP_SPACE_06 $CAP_SPACE_06 $CAP_SPACE_06;
2620
- display: flex;
2621
- flex-direction: column;
2622
- overflow: hidden;
2623
- }
2624
-
2625
- .viber-carousel-cards-pop {
2626
- margin-top: 0;
2627
- width: 100%;
2628
- background: transparent;
2629
- border: none;
2630
- border-radius: 0;
2631
- padding: 0;
2632
- overflow: hidden;
2633
- }
2634
-
2635
- .viber-carousel-message-box {
2636
- width: 100%;
2637
- min-height: 2.25rem;
2638
- height: auto;
2639
- border-radius: $CAP_SPACE_04;
2640
- background: transparent;
2641
- padding: 0 $CAP_SPACE_08;
2642
- display: flex;
2643
- align-items: center;
2644
- }
2645
-
2646
- .viber-carousel-message-box-text {
2647
- color: $CAP_G01;
2648
- margin: 0.107rem $CAP_SPACE_06 $CAP_SPACE_01 0.5rem;
2649
- white-space: normal;
2650
- word-break: break-word;
2651
- overflow-wrap: break-word;
2652
- overflow: hidden;
2653
- max-width: 100%;
2654
- box-sizing: border-box;
2655
- }
2656
-
2657
- .viber-carousel-message-box-placeholder {
2658
- width: 100%;
2659
- height: 0.875rem;
2660
- border-radius: $CAP_SPACE_04;
2661
- background: $CAP_G07;
2662
- }
2663
-
2664
- .viber-carousel-message-timestamp,
2665
- .viber-carousel-cards-timestamp {
2666
- display: block;
2667
- text-align: right;
2668
- margin-top: $CAP_SPACE_06;
2669
- color: $CAP_G04;
2670
- }
2671
-
2672
2539
  .empty-placeholder {
2673
2540
  height: $CAP_SPACE_08;
2674
2541
  }
@@ -2682,11 +2549,6 @@
2682
2549
  .viber-message-container-ios {
2683
2550
  margin-left: 1rem;
2684
2551
  margin-right: 1rem;
2685
-
2686
- &.viber-message-container-carousel {
2687
- margin-left: $CAP_SPACE_04;
2688
- margin-right: $CAP_SPACE_04;
2689
- }
2690
2552
  }
2691
2553
  }
2692
2554
  }
@@ -609,7 +609,11 @@
609
609
  }
610
610
 
611
611
  .accordion-content-wrapper {
612
- padding-left: $CAP_SPACE_08;
612
+ padding-left: 0;
613
+ }
614
+
615
+ .ant-collapse-body {
616
+ padding-left: 0 !important;
613
617
  }
614
618
 
615
619
  .send-test-content {