@capillarytech/creatives-library 8.0.299-alpha.3 → 8.0.299-alpha.4

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "8.0.299-alpha.3",
4
+ "version": "8.0.299-alpha.4",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -10,6 +10,13 @@
10
10
  z-index: 10000 !important;
11
11
  }
12
12
 
13
+ /* Notifications rendered inside slidebox (getContainer) so they appear in campaigns/library mode */
14
+ .common-test-and-preview-notification-container {
15
+ .ant-notification {
16
+ z-index: 10001;
17
+ }
18
+ }
19
+
13
20
  /* Lookup spinner overlay above test-customers dropdown. */
14
21
  .common-test-preview-lookup-spin {
15
22
  position: relative;
@@ -199,6 +206,7 @@
199
206
 
200
207
  .left-panel {
201
208
  width: 40%;
209
+ min-width: 20rem; /* Consistent width in campaigns/library mode so test customer dropdown matches creatives */
202
210
  padding-right: 1rem;
203
211
  border-right: $CAP_SPACE_01 solid $CAP_G12;
204
212
  overflow-y: auto;
@@ -515,6 +523,7 @@
515
523
  }
516
524
  .test-customers-tree-select {
517
525
  width: 100%;
526
+ min-width: 18rem; /* Consistent dropdown width in campaigns and creatives */
518
527
  min-height: $CAP_SPACE_40;
519
528
  margin: $CAP_SPACE_12 0 $CAP_SPACE_08;
520
529
  .ant-select-selection,
@@ -535,7 +544,9 @@
535
544
  }
536
545
 
537
546
  // Test customers TreeSelect dropdown: limit height and make scrollable (dropdown renders in portal)
547
+ // min-width so dropdown looks the same in campaigns and creatives
538
548
  .test-customers-tree-select-dropdown {
549
+ min-width: 18rem !important;
539
550
  max-height: 20rem !important; /* 320px */
540
551
  overflow-y: auto !important;
541
552
  .ant-select-tree-list-holder-inner {
@@ -171,6 +171,9 @@ const CommonTestAndPreview = (props) => {
171
171
  const [selectedTestEntities, setSelectedTestEntities] = useState([]);
172
172
  const [beeContent, setBeeContent] = useState(''); // Track BEE editor content separately (EMAIL only)
173
173
  const previousBeeContentRef = useRef(''); // Track previous BEE content (EMAIL only)
174
+ // Container for notifications so they render inside the slidebox (visible in campaigns/library mode)
175
+ const notificationContainerRef = useRef(null);
176
+ const getNotificationContainer = () => notificationContainerRef.current || document.body;
174
177
  // Delivery settings for Test and Preview (SMS, Email, WhatsApp) — user selection only
175
178
  const [testPreviewDeliverySettings, setTestPreviewDeliverySettings] = useState({
176
179
  [CHANNELS.SMS]: {
@@ -444,6 +447,7 @@ const CommonTestAndPreview = (props) => {
444
447
  if (response && response.success) {
445
448
  CapNotification.success({
446
449
  message: formatMessage(messages.newTestCustomerAddedSuccess),
450
+ getContainer: getNotificationContainer,
447
451
  });
448
452
  // API may return customerId in response.response (e.g. { response: { customerId: 438845651 } })
449
453
  const res = response?.response || response;
@@ -466,6 +470,7 @@ const CommonTestAndPreview = (props) => {
466
470
  CapNotification.error({
467
471
  message: formatMessage(messages.errorTitle),
468
472
  description: response?.message || formatMessage(messages.failedToAddTestCustomer),
473
+ getContainer: getNotificationContainer,
469
474
  });
470
475
  }
471
476
  } catch (error) {
@@ -474,6 +479,7 @@ const CommonTestAndPreview = (props) => {
474
479
  CapNotification.error({
475
480
  message: formatMessage(messages.errorTitle),
476
481
  description: error?.message || formatMessage(messages.errorAddingTestCustomer),
482
+ getContainer: getNotificationContainer,
477
483
  });
478
484
  }
479
485
  } finally {
@@ -2522,6 +2528,7 @@ const CommonTestAndPreview = (props) => {
2522
2528
  } catch (error) {
2523
2529
  CapNotification.error({
2524
2530
  message: formatMessage(messages.invalidJSON),
2531
+ getContainer: getNotificationContainer,
2525
2532
  });
2526
2533
  }
2527
2534
  };
@@ -2568,6 +2575,7 @@ const CommonTestAndPreview = (props) => {
2568
2575
  } catch (error) {
2569
2576
  CapNotification.error({
2570
2577
  message: formatMessage(messages.previewUpdateError),
2578
+ getContainer: getNotificationContainer,
2571
2579
  });
2572
2580
  }
2573
2581
  };
@@ -2661,6 +2669,7 @@ const CommonTestAndPreview = (props) => {
2661
2669
  setSearchValue('');
2662
2670
  CapNotification.success({
2663
2671
  message: formatMessage(messages.customerAlreadyInTestList),
2672
+ getContainer: getNotificationContainer,
2664
2673
  });
2665
2674
  return;
2666
2675
  }
@@ -2676,7 +2685,7 @@ const CommonTestAndPreview = (props) => {
2676
2685
 
2677
2686
  if (!success) {
2678
2687
  const errorMessage = response?.message || response?.status?.message || formatMessage(messages.memberLookupError);
2679
- CapNotification.error({ title: formatMessage(messages.errorTitle), message: errorMessage });
2688
+ CapNotification.error({ title: formatMessage(messages.errorTitle), message: errorMessage, getContainer: getNotificationContainer });
2680
2689
  return;
2681
2690
  }
2682
2691
 
@@ -2693,6 +2702,7 @@ const CommonTestAndPreview = (props) => {
2693
2702
  setSearchValue('');
2694
2703
  CapNotification.success({
2695
2704
  message: formatMessage(messages.customerAlreadyInTestList),
2705
+ getContainer: getNotificationContainer,
2696
2706
  });
2697
2707
  return;
2698
2708
  }
@@ -2710,6 +2720,7 @@ const CommonTestAndPreview = (props) => {
2710
2720
  } catch {
2711
2721
  CapNotification.error({
2712
2722
  message: formatMessage(messages.memberLookupError),
2723
+ getContainer: getNotificationContainer,
2713
2724
  });
2714
2725
  } finally {
2715
2726
  setIsCustomerDataLoading(false);
@@ -2762,10 +2773,12 @@ const CommonTestAndPreview = (props) => {
2762
2773
  if (result) {
2763
2774
  CapNotification.success({
2764
2775
  message: formatMessage(messages.testMessageSent),
2776
+ getContainer: getNotificationContainer,
2765
2777
  });
2766
2778
  } else {
2767
2779
  CapNotification.error({
2768
2780
  message: formatMessage(messages.testMessageFailed),
2781
+ getContainer: getNotificationContainer,
2769
2782
  });
2770
2783
  }
2771
2784
  });
@@ -2887,6 +2900,7 @@ const CommonTestAndPreview = (props) => {
2887
2900
  show={show}
2888
2901
  size="size-xl"
2889
2902
  content={(
2903
+ <div ref={notificationContainerRef} className="common-test-and-preview-notification-container" style={{ position: 'relative', height: '100%' }}>
2890
2904
  <CapSpin
2891
2905
  spinning={isCustomerDataLoading}
2892
2906
  className={`common-test-preview-lookup-spin ${isCustomerDataLoading ? 'common-test-preview-customer-loading' : ''}`}
@@ -2933,6 +2947,7 @@ const CommonTestAndPreview = (props) => {
2933
2947
  )}
2934
2948
  </CapRow>
2935
2949
  </CapSpin>
2950
+ </div>
2936
2951
  )}
2937
2952
  />
2938
2953
  );