@gooddata/sdk-ui-ext 10.18.0-alpha.30 → 10.18.0-alpha.32

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 (99) hide show
  1. package/NOTICE +3 -3
  2. package/esm/index.d.ts +12 -2
  3. package/esm/index.d.ts.map +1 -1
  4. package/esm/index.js +10 -2
  5. package/esm/index.js.map +1 -1
  6. package/esm/notificationsPanel/@staging/OrganizationContext/OrganizationContext.d.ts +12 -0
  7. package/esm/notificationsPanel/@staging/OrganizationContext/OrganizationContext.d.ts.map +1 -1
  8. package/esm/notificationsPanel/@staging/OrganizationContext/OrganizationContext.js +10 -1
  9. package/esm/notificationsPanel/@staging/OrganizationContext/OrganizationContext.js.map +1 -1
  10. package/esm/notificationsPanel/@staging/OrganizationContext/useFetchOrganization.d.ts +6 -4
  11. package/esm/notificationsPanel/@staging/OrganizationContext/useFetchOrganization.d.ts.map +1 -1
  12. package/esm/notificationsPanel/@staging/OrganizationContext/useFetchOrganization.js +1 -1
  13. package/esm/notificationsPanel/@staging/OrganizationContext/useFetchOrganization.js.map +1 -1
  14. package/esm/notificationsPanel/Notification/AlertNotification.d.ts +2 -2
  15. package/esm/notificationsPanel/Notification/AlertNotification.d.ts.map +1 -1
  16. package/esm/notificationsPanel/Notification/AlertNotification.js +3 -3
  17. package/esm/notificationsPanel/Notification/AlertNotification.js.map +1 -1
  18. package/esm/notificationsPanel/Notification/DefaultNotification.d.ts +17 -4
  19. package/esm/notificationsPanel/Notification/DefaultNotification.d.ts.map +1 -1
  20. package/esm/notificationsPanel/Notification/DefaultNotification.js +6 -4
  21. package/esm/notificationsPanel/Notification/DefaultNotification.js.map +1 -1
  22. package/esm/notificationsPanel/NotificationTriggersDetail/NotificationTriggersDetail.d.ts +4 -1
  23. package/esm/notificationsPanel/NotificationTriggersDetail/NotificationTriggersDetail.d.ts.map +1 -1
  24. package/esm/notificationsPanel/NotificationTriggersDetail/NotificationTriggersDetail.js +1 -1
  25. package/esm/notificationsPanel/NotificationTriggersDetail/NotificationTriggersDetail.js.map +1 -1
  26. package/esm/notificationsPanel/NotificationTriggersDetail/NotificationTriggersDetailDialog.d.ts +4 -1
  27. package/esm/notificationsPanel/NotificationTriggersDetail/NotificationTriggersDetailDialog.d.ts.map +1 -1
  28. package/esm/notificationsPanel/NotificationTriggersDetail/NotificationTriggersDetailDialog.js +1 -1
  29. package/esm/notificationsPanel/NotificationTriggersDetail/NotificationTriggersDetailDialog.js.map +1 -1
  30. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsList.d.ts +66 -4
  31. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsList.d.ts.map +1 -1
  32. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsList.js +17 -35
  33. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsList.js.map +1 -1
  34. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsListEmptyState.d.ts +9 -2
  35. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsListEmptyState.d.ts.map +1 -1
  36. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsListEmptyState.js +4 -2
  37. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsListEmptyState.js.map +1 -1
  38. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsListErrorState.d.ts +9 -2
  39. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsListErrorState.d.ts.map +1 -1
  40. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsListErrorState.js +4 -2
  41. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsListErrorState.js.map +1 -1
  42. package/esm/notificationsPanel/NotificationsList/DefaultSkeletonItem.d.ts +19 -0
  43. package/esm/notificationsPanel/NotificationsList/DefaultSkeletonItem.d.ts.map +1 -0
  44. package/esm/notificationsPanel/NotificationsList/DefaultSkeletonItem.js +9 -0
  45. package/esm/notificationsPanel/NotificationsList/DefaultSkeletonItem.js.map +1 -0
  46. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanel.d.ts +95 -5
  47. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanel.d.ts.map +1 -1
  48. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanel.js +7 -5
  49. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanel.js.map +1 -1
  50. package/esm/notificationsPanel/NotificationsPanel/{DefaultOpenNotificationsPanelButton.d.ts → DefaultNotificationsPanelButton.d.ts} +8 -6
  51. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanelButton.d.ts.map +1 -0
  52. package/esm/notificationsPanel/NotificationsPanel/{DefaultOpenNotificationsPanelButton.js → DefaultNotificationsPanelButton.js} +4 -4
  53. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanelButton.js.map +1 -0
  54. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanelHeader.d.ts +8 -4
  55. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanelHeader.d.ts.map +1 -1
  56. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanelHeader.js +6 -4
  57. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanelHeader.js.map +1 -1
  58. package/esm/notificationsPanel/NotificationsPanel/NotificationsPanel.d.ts +73 -13
  59. package/esm/notificationsPanel/NotificationsPanel/NotificationsPanel.d.ts.map +1 -1
  60. package/esm/notificationsPanel/NotificationsPanel/NotificationsPanel.js +21 -11
  61. package/esm/notificationsPanel/NotificationsPanel/NotificationsPanel.js.map +1 -1
  62. package/esm/notificationsPanel/bem.d.ts +5 -0
  63. package/esm/notificationsPanel/bem.d.ts.map +1 -1
  64. package/esm/notificationsPanel/bem.js +6 -1
  65. package/esm/notificationsPanel/bem.js.map +1 -1
  66. package/esm/notificationsPanel/data/NotificationsContext.d.ts +16 -1
  67. package/esm/notificationsPanel/data/NotificationsContext.d.ts.map +1 -1
  68. package/esm/notificationsPanel/data/NotificationsContext.js +9 -3
  69. package/esm/notificationsPanel/data/NotificationsContext.js.map +1 -1
  70. package/esm/notificationsPanel/data/useFetchNotifications.d.ts +10 -8
  71. package/esm/notificationsPanel/data/useFetchNotifications.d.ts.map +1 -1
  72. package/esm/notificationsPanel/data/useFetchNotifications.js +10 -7
  73. package/esm/notificationsPanel/data/useFetchNotifications.js.map +1 -1
  74. package/esm/notificationsPanel/data/useNotificationFiltersDetail.d.ts.map +1 -1
  75. package/esm/notificationsPanel/data/useNotificationFiltersDetail.js +7 -8
  76. package/esm/notificationsPanel/data/useNotificationFiltersDetail.js.map +1 -1
  77. package/esm/notificationsPanel/data/useNotifications.d.ts +23 -3
  78. package/esm/notificationsPanel/data/useNotifications.d.ts.map +1 -1
  79. package/esm/notificationsPanel/data/useNotifications.js +9 -5
  80. package/esm/notificationsPanel/data/useNotifications.js.map +1 -1
  81. package/esm/notificationsPanel/types.d.ts +3 -1
  82. package/esm/notificationsPanel/types.d.ts.map +1 -1
  83. package/esm/notificationsPanel/types.js +1 -1
  84. package/esm/notificationsPanel/types.js.map +1 -1
  85. package/esm/sdk-ui-ext.d.ts +395 -54
  86. package/package.json +18 -18
  87. package/src/notificationsPanel/NotificationsPanel/DefaultNotificationsPanel.scss +4 -6
  88. package/src/notificationsPanel/NotificationsPanel/{DefaultOpenNotificationsPanelButton.scss → DefaultNotificationsPanelButton.scss} +2 -2
  89. package/src/notificationsPanel/NotificationsPanel/DefaultNotificationsPanelHeader.scss +3 -1
  90. package/src/notificationsPanel/notificationPanel.scss +8 -3
  91. package/styles/css/main.css +500 -36
  92. package/styles/css/main.css.map +1 -1
  93. package/esm/notificationsPanel/NotificationsPanel/DefaultOpenNotificationsPanelButton.d.ts.map +0 -1
  94. package/esm/notificationsPanel/NotificationsPanel/DefaultOpenNotificationsPanelButton.js.map +0 -1
  95. package/esm/notificationsPanel/components/VirtualList.d.ts +0 -15
  96. package/esm/notificationsPanel/components/VirtualList.d.ts.map +0 -1
  97. package/esm/notificationsPanel/components/VirtualList.js +0 -78
  98. package/esm/notificationsPanel/components/VirtualList.js.map +0 -1
  99. package/src/notificationsPanel/components/VirtualList.scss +0 -32
@@ -41,7 +41,7 @@ import { LocalIdRef } from '@gooddata/sdk-model';
41
41
  import { ObjRef } from '@gooddata/sdk-model';
42
42
  import { OnError } from '@gooddata/sdk-ui';
43
43
  import { default as React_2 } from 'react';
44
- import { RefObject } from 'react';
44
+ import { UiSkeleton } from '@gooddata/sdk-ui-kit';
45
45
  import { UseCancelablePromiseStatus } from '@gooddata/sdk-ui';
46
46
  import { WithIntlProps } from 'react-intl';
47
47
  import { WrappedComponentProps } from 'react-intl';
@@ -129,10 +129,59 @@ export declare type DataSourcePermission = "USE" | "MANAGE";
129
129
  */
130
130
  export declare type DataSourcePermissionSubject = "user" | "userGroup";
131
131
 
132
+ /**
133
+ * Default implementation of the Notification component.
134
+ *
135
+ * @public
136
+ */
137
+ export declare function DefaultNotification({ notification, markNotificationAsRead, onNotificationClick, }: INotificationComponentProps): React_2.JSX.Element;
138
+
139
+ /**
140
+ * Default implementation of the NotificationSkeletonItem component.
141
+ *
142
+ * @public
143
+ */
144
+ export declare const DefaultNotificationSkeletonItem: typeof UiSkeleton;
145
+
146
+ /**
147
+ * Default implementation of the NotificationsList component.
148
+ *
149
+ * @public
150
+ */
151
+ export declare function DefaultNotificationsList({ Notification, NotificationsListEmptyState, NotificationsListErrorState, NotificationSkeletonItem, activeView, status, error, activeNotifications, markNotificationAsRead, onNotificationClick, hasNextPage, loadNextPage, itemHeight, itemsGap, itemPadding, skeletonItemsCount, maxListHeight, }: INotificationsListComponentProps): React_2.JSX.Element;
152
+
153
+ /**
154
+ * Default implementation of the NotificationsListEmptyState component.
155
+ *
156
+ * @public
157
+ */
158
+ export declare function DefaultNotificationsListEmptyState({ activeView, }: INotificationsListEmptyStateComponentProps): React_2.JSX.Element;
159
+
160
+ /**
161
+ * Default implementation of the NotificationsListErrorState component.
162
+ *
163
+ * @public
164
+ */
165
+ export declare function DefaultNotificationsListErrorState({ error }: INotificationsListErrorStateComponentProps): React_2.JSX.Element;
166
+
167
+ /**
168
+ * Default implementation of the NotificationsPanel component.
169
+ *
170
+ * @public
171
+ */
172
+ export declare function DefaultNotificationsPanel({ NotificationsPanelHeader, NotificationsList, NotificationsListEmptyState, NotificationsListErrorState, Notification, NotificationSkeletonItem, activeView, changeActiveView, markNotificationAsRead, markAllNotificationsAsRead, unreadNotificationsCount, hasUnreadNotifications, activeNotifications, onNotificationClick, status, error, loadNextPage, hasNextPage, itemHeight, itemsGap, itemPadding, skeletonItemsCount, maxListHeight, }: INotificationsPanelComponentProps): React_2.JSX.Element;
173
+
132
174
  /**
133
175
  * @internal
134
176
  */
135
- export declare function DefaultOpenNotificationsPanelButton({ buttonRef, isNotificationPanelOpen, toggleNotificationPanel, hasUnreadNotifications, }: IOpenNotificationsPanelButtonComponentProps): React_2.JSX.Element;
177
+ export declare function DefaultNotificationsPanelButton({ buttonRef, isNotificationPanelOpen, toggleNotificationPanel, hasUnreadNotifications, }: INotificationsPanelButtonComponentProps): React_2.JSX.Element;
178
+
179
+ /**
180
+ * Default implementation of the notifications panel header.
181
+ *
182
+ * @public
183
+ */
184
+ export declare function DefaultNotificationsPanelHeader({ activeView, changeActiveView, markAllNotificationsAsRead, hasUnreadNotifications, unreadNotificationsCount, }: INotificationsPanelHeaderComponentProps): React_2.JSX.Element;
136
185
 
137
186
  /**
138
187
  * @internal
@@ -540,78 +589,291 @@ export declare interface ILayoutDescriptor {
540
589
  }
541
590
 
542
591
  /**
543
- * @alpha
592
+ * Props for the Notification component.
593
+ *
594
+ * @public
544
595
  */
545
596
  export declare interface INotificationComponentProps {
597
+ /**
598
+ * Notification to display.
599
+ */
546
600
  notification: INotification;
547
- markAsRead: (id: string) => void;
601
+ /**
602
+ * Function to mark notification as read.
603
+ */
604
+ markNotificationAsRead: (id: string) => void;
605
+ /**
606
+ * Function to handle notification click.
607
+ */
548
608
  onNotificationClick: (notification: INotification) => void;
549
609
  }
550
610
 
551
611
  /**
552
- * @alpha
612
+ * Props for the NotificationSkeletonItem component.
613
+ *
614
+ * @public
615
+ */
616
+ export declare interface INotificationSkeletonItemComponentProps {
617
+ /**
618
+ * Height of the skeleton item in pixels.
619
+ */
620
+ itemHeight: number;
621
+ }
622
+
623
+ /**
624
+ * Props for the NotificationsList component.
625
+ *
626
+ * @public
553
627
  */
554
628
  export declare interface INotificationsListComponentProps {
629
+ /**
630
+ * Component to render when the notifications list is empty.
631
+ */
555
632
  NotificationsListEmptyState: React_2.ComponentType<INotificationsListEmptyStateComponentProps>;
633
+ /**
634
+ * Component to render when the notifications list is in error state.
635
+ */
556
636
  NotificationsListErrorState: React_2.ComponentType<INotificationsListErrorStateComponentProps>;
637
+ /**
638
+ * Component to render each notification.
639
+ */
557
640
  Notification: React_2.ComponentType<INotificationComponentProps>;
641
+ /**
642
+ * Component to render each skeleton item.
643
+ */
644
+ NotificationSkeletonItem: React_2.ComponentType<INotificationSkeletonItemComponentProps>;
645
+ /**
646
+ * Active view of the notifications list.
647
+ */
558
648
  activeView: INotificationsPanelView;
649
+ /**
650
+ * Status of the notifications list.
651
+ */
559
652
  status: UseCancelablePromiseStatus;
653
+ /**
654
+ * Error to display.
655
+ */
560
656
  error?: GoodDataSdkError;
561
- notifications?: INotification[];
657
+ /**
658
+ * Loaded notifications relevant to the active view.
659
+ */
660
+ activeNotifications?: INotification[];
661
+ /**
662
+ * Callback function to mark notification as read.
663
+ */
562
664
  markNotificationAsRead: (notificationId: string) => Promise<void>;
665
+ /**
666
+ * Callback function to handle notification click.
667
+ */
563
668
  onNotificationClick: (notification: INotification) => void;
669
+ /**
670
+ * Whether there is a next page of notifications.
671
+ */
564
672
  hasNextPage: boolean;
673
+ /**
674
+ * Load next page of notifications.
675
+ */
565
676
  loadNextPage: () => void;
677
+ /**
678
+ * Height of the notification item in pixels.
679
+ */
680
+ itemHeight: number;
681
+ /**
682
+ * Gap between notification items in pixels.
683
+ */
684
+ itemsGap: number;
685
+ /**
686
+ * Padding of the notification item (from left/right) in pixels.
687
+ */
688
+ itemPadding: number;
689
+ /**
690
+ * Number of skeleton items to render when loading notifications.
691
+ */
692
+ skeletonItemsCount: number;
693
+ /**
694
+ * Maximum height of the notifications list in pixels.
695
+ */
696
+ maxListHeight?: number;
566
697
  }
567
698
 
568
699
  /**
569
- * @alpha
700
+ * Props for the NotificationsListEmptyState component.
701
+ *
702
+ * @public
570
703
  */
571
704
  export declare interface INotificationsListEmptyStateComponentProps {
705
+ /**
706
+ * Active view of the notifications list.
707
+ */
572
708
  activeView: INotificationsPanelView;
573
709
  }
574
710
 
575
711
  /**
576
- * @alpha
712
+ * Props for the NotificationsListErrorState component.
713
+ *
714
+ * @public
577
715
  */
578
716
  export declare interface INotificationsListErrorStateComponentProps {
717
+ /**
718
+ * Error to display.
719
+ */
579
720
  error?: GoodDataSdkError;
580
721
  }
581
722
 
582
723
  /**
583
- * @alpha
724
+ * OpenNotificationsPanelButton component props.
725
+ *
726
+ * @public
727
+ */
728
+ export declare interface INotificationsPanelButtonComponentProps {
729
+ /**
730
+ * Ref to the button element - is required for proper alignment of the notification panel.
731
+ */
732
+ buttonRef: React_2.RefObject<HTMLButtonElement>;
733
+ /**
734
+ * Opens the notification panel.
735
+ */
736
+ openNotificationPanel: () => void;
737
+ /**
738
+ * Closes the notification panel.
739
+ */
740
+ closeNotificationPanel: () => void;
741
+ /**
742
+ * Toggles the notification panel.
743
+ */
744
+ toggleNotificationPanel: () => void;
745
+ /**
746
+ * Indicates whether the notification panel is open.
747
+ */
748
+ isNotificationPanelOpen: boolean;
749
+ /**
750
+ * Indicates whether there are unread notifications.
751
+ */
752
+ hasUnreadNotifications: boolean;
753
+ }
754
+
755
+ /**
756
+ * NotificationsPanel component props.
757
+ *
758
+ * @public
584
759
  */
585
760
  export declare interface INotificationsPanelComponentProps {
761
+ /**
762
+ * Custom notifications panel header component.
763
+ */
586
764
  NotificationsPanelHeader: React_2.ComponentType<INotificationsPanelHeaderComponentProps>;
765
+ /**
766
+ * Custom notifications list component.
767
+ */
587
768
  NotificationsList: React_2.ComponentType<INotificationsListComponentProps>;
769
+ /**
770
+ * Custom notifications list empty state component.
771
+ */
588
772
  NotificationsListEmptyState: React_2.ComponentType<INotificationsListEmptyStateComponentProps>;
773
+ /**
774
+ * Custom notifications list error state component.
775
+ */
589
776
  NotificationsListErrorState: React_2.ComponentType<INotificationsListErrorStateComponentProps>;
777
+ /**
778
+ * Custom notification component.
779
+ */
590
780
  Notification: React_2.ComponentType<INotificationComponentProps>;
781
+ /**
782
+ * Custom notification skeleton item component.
783
+ */
784
+ NotificationSkeletonItem: React_2.ComponentType<INotificationSkeletonItemComponentProps>;
785
+ /**
786
+ * The callback to toggle the notifications panel.
787
+ */
591
788
  toggleNotificationsPanel: () => void;
789
+ /**
790
+ * The callback to open the notifications panel.
791
+ */
592
792
  openNotificationsPanel: () => void;
793
+ /**
794
+ * The callback to close the notifications panel.
795
+ */
593
796
  closeNotificationsPanel: () => void;
797
+ /**
798
+ * The currently active view of the notifications panel.
799
+ */
594
800
  activeView: INotificationsPanelView;
801
+ /**
802
+ * The callback to change the active view of the notifications panel.
803
+ */
595
804
  changeActiveView: (view: INotificationsPanelView) => void;
805
+ /**
806
+ * The callback to mark a notification as read.
807
+ */
596
808
  markNotificationAsRead: (notificationId: string) => Promise<void>;
809
+ /**
810
+ * The callback to mark all notifications as read.
811
+ */
597
812
  markAllNotificationsAsRead: () => Promise<void>;
813
+ /**
814
+ * The number of unread notifications.
815
+ */
598
816
  unreadNotificationsCount: number;
817
+ /**
818
+ * Indicates if there are unread notifications.
819
+ */
820
+ hasUnreadNotifications: boolean;
821
+ /**
822
+ * Loaded notifications, relevant for the currently active view.
823
+ */
599
824
  activeNotifications: INotification[];
825
+ /**
826
+ * The callback to handle a notification click.
827
+ */
600
828
  onNotificationClick: (notification: INotification) => void;
829
+ /**
830
+ * The status of the notifications loading.
831
+ */
601
832
  status: UseCancelablePromiseStatus;
833
+ /**
834
+ * The error that occurred while loading notifications.
835
+ */
602
836
  error?: GoodDataSdkError;
837
+ /**
838
+ * The callback to load the next page of notifications.
839
+ */
603
840
  loadNextPage: () => void;
841
+ /**
842
+ * Indicates if there is a next page of notifications.
843
+ */
604
844
  hasNextPage: boolean;
845
+ /**
846
+ * The height of the notification item in pixels.
847
+ */
848
+ itemHeight: number;
849
+ /**
850
+ * Gap between notification items in pixels.
851
+ */
852
+ itemsGap: number;
853
+ /**
854
+ * Padding of the notification item (from left/right) in pixels.
855
+ */
856
+ itemPadding: number;
857
+ /**
858
+ * Number of skeleton items to render when loading notifications.
859
+ */
860
+ skeletonItemsCount: number;
861
+ /**
862
+ * Maximum height of the notifications list in pixels.
863
+ */
864
+ maxListHeight?: number;
605
865
  }
606
866
 
607
867
  /**
608
- * @alpha
868
+ * @public
609
869
  */
610
870
  export declare interface INotificationsPanelCustomComponentsProps {
611
871
  /**
612
872
  * Custom open notifications panel button component.
873
+ *
874
+ * - Required if renderInline is not enabled.
613
875
  */
614
- OpenNotificationsPanelButton: React_2.ComponentType<IOpenNotificationsPanelButtonComponentProps>;
876
+ NotificationsPanelButton?: React_2.ComponentType<INotificationsPanelButtonComponentProps>;
615
877
  /**
616
878
  * Custom notifications panel component.
617
879
  */
@@ -636,10 +898,16 @@ export declare interface INotificationsPanelCustomComponentsProps {
636
898
  * Custom notification component.
637
899
  */
638
900
  Notification?: React_2.ComponentType<INotificationComponentProps>;
901
+ /**
902
+ * Custom notification skeleton item component.
903
+ */
904
+ NotificationSkeletonItem?: React_2.ComponentType<INotificationSkeletonItemComponentProps>;
639
905
  }
640
906
 
641
907
  /**
642
- * @alpha
908
+ * Props for the NotificationsPanelHeader component.
909
+ *
910
+ * @public
643
911
  */
644
912
  export declare interface INotificationsPanelHeaderComponentProps {
645
913
  /**
@@ -661,43 +929,98 @@ export declare interface INotificationsPanelHeaderComponentProps {
661
929
  /**
662
930
  * The callback to mark all notifications as read.
663
931
  */
664
- markAllAsRead: () => void;
932
+ markAllNotificationsAsRead: () => void;
665
933
  }
666
934
 
667
935
  /**
668
- * @alpha
936
+ * @public
669
937
  */
670
938
  export declare interface INotificationsPanelProps extends INotificationsPanelCustomComponentsProps {
939
+ /**
940
+ * Locale to use.
941
+ */
942
+ locale?: ILocale;
671
943
  /**
672
944
  * Backend to use.
945
+ *
946
+ * - If not defined, the backend from the BackendProvider context will be used.
673
947
  */
674
948
  backend?: IAnalyticalBackend;
675
949
  /**
676
950
  * Workspace ID to use.
951
+ *
952
+ * - If not defined, the workspace ID from the WorkspaceProvider context will be used.
953
+ * - If workspace is not defined and there is no WorkspaceProvider, notifications will be loaded from all workspaces.
677
954
  */
678
955
  workspace?: string;
956
+ /**
957
+ * Enable inline rendering of the notifications panel
958
+ *
959
+ * - Default: false
960
+ * - If enabled, NotificationsPanelButton won't be rendered, and NotificationsPanel won't be rendered inside modal
961
+ * - This is useful when you want to render notifications panel in a custom modal.
962
+ */
963
+ renderInline?: boolean;
679
964
  /**
680
965
  * Refresh interval in milliseconds.
681
- * Default is 10 minutes.
682
- * If set to 0, notifications will not be refreshed automatically.
966
+ *
967
+ * - Default: 600000 (10 minutes)
968
+ * - If set to 0, notifications won't be refreshed automatically.
683
969
  */
684
970
  refreshInterval?: number;
685
971
  /**
686
- * Locale to use.
972
+ * Number of notifications to load per page.
973
+ *
974
+ * - Default: 50
687
975
  */
688
- locale?: ILocale;
976
+ itemsPerPage?: number;
689
977
  /**
690
- * Render notifications panel inline (without button + clicking on it).
978
+ * Number of skeleton items to render when loading notifications.
979
+ *
980
+ * - Default: 5
691
981
  */
692
- renderInline?: boolean;
982
+ skeletonItemsCount?: number;
693
983
  /**
694
- * Handler for notification click.
984
+ * Height of the item in notifications list in pixels.
985
+ *
986
+ * - Default: 52
695
987
  */
696
- onNotificationClick: (notification: INotification) => void;
988
+ itemHeight?: number;
989
+ /**
990
+ * Optionally override max width of the notifications panel.
991
+ *
992
+ * - Does not have effect when renderInline is true - inline rendering always fills the parent container.
993
+ */
994
+ maxWidth?: number | string;
995
+ /**
996
+ * Maximum height of the notifications list in pixels.
997
+ *
998
+ * - Default: 527
999
+ * - Does not have effect when renderInline is true - inline rendering always fills the parent container.
1000
+ */
1001
+ maxListHeight?: number;
1002
+ /**
1003
+ * Gap between notification items in the list in pixels.
1004
+ *
1005
+ * - Default: 10
1006
+ */
1007
+ itemsGap?: number;
1008
+ /**
1009
+ * Padding of the notification item (from left and right) in pixels.
1010
+ *
1011
+ * - Default: 15
1012
+ */
1013
+ itemPadding?: number;
1014
+ /**
1015
+ * Callback for notification click.
1016
+ */
1017
+ onNotificationClick?: (notification: INotification) => void;
697
1018
  }
698
1019
 
699
1020
  /**
700
- * @alpha
1021
+ * View mode of the notifications panel.
1022
+ *
1023
+ * @public
701
1024
  */
702
1025
  export declare type INotificationsPanelView = "all" | "unread";
703
1026
 
@@ -739,36 +1062,6 @@ export declare class InsightView extends React_2.Component<IInsightViewProps> {
739
1062
  render(): React_2.JSX.Element;
740
1063
  }
741
1064
 
742
- /**
743
- * @alpha
744
- */
745
- export declare interface IOpenNotificationsPanelButtonComponentProps {
746
- /**
747
- * Ref to the button element - is required for proper alignment of the notification panel.
748
- */
749
- buttonRef: RefObject<HTMLElement | null>;
750
- /**
751
- * Opens the notification panel.
752
- */
753
- openNotificationPanel: () => void;
754
- /**
755
- * Closes the notification panel.
756
- */
757
- closeNotificationPanel: () => void;
758
- /**
759
- * Toggles the notification panel.
760
- */
761
- toggleNotificationPanel: () => void;
762
- /**
763
- * Indicates whether the notification panel is open.
764
- */
765
- isNotificationPanelOpen: boolean;
766
- /**
767
- * Indicates whether there are unread notifications.
768
- */
769
- hasUnreadNotifications: boolean;
770
- }
771
-
772
1065
  /**
773
1066
  * Type-guard testing whether the provided object is an instance of {@link IDrillDownDefinition}.
774
1067
  * @beta
@@ -821,6 +1114,33 @@ export declare type ISizeInfoDefault = ISizeInfo & {
821
1114
  default: number;
822
1115
  };
823
1116
 
1117
+ /**
1118
+ * Hook for fetching all and unread notifications.
1119
+ *
1120
+ * @public
1121
+ */
1122
+ export declare interface IUseNotificationsProps {
1123
+ /**
1124
+ * Workspace to fetch notifications from.
1125
+ *
1126
+ * - If not provided, the workspace from WorkspaceProvider is used.
1127
+ * - If not provided and there is no WorkspaceProvider, notifications will be loaded from all workspaces.
1128
+ */
1129
+ workspace?: string;
1130
+ /**
1131
+ * Backend to fetch notifications from.
1132
+ */
1133
+ backend?: IAnalyticalBackend;
1134
+ /**
1135
+ * Refresh interval in milliseconds.
1136
+ */
1137
+ refreshInterval: number;
1138
+ /**
1139
+ * Number of items per page.
1140
+ */
1141
+ itemsPerPage: number;
1142
+ }
1143
+
824
1144
  /**
825
1145
  * @internal
826
1146
  */
@@ -922,7 +1242,7 @@ export declare type LayoutType = "fluid";
922
1242
  export declare const MIN_VISUALIZATION_WIDTH = 2;
923
1243
 
924
1244
  /**
925
- * @alpha
1245
+ * @public
926
1246
  */
927
1247
  export declare function NotificationsPanel(props: INotificationsPanelProps): React_2.JSX.Element;
928
1248
 
@@ -989,6 +1309,27 @@ export declare type TelemetryEvent = "multiple-users-deleted" | "multiple-groups
989
1309
  */
990
1310
  export declare type TrackEventCallback = (event: TelemetryEvent) => void;
991
1311
 
1312
+ /**
1313
+ * @public
1314
+ */
1315
+ export declare function useNotifications({ workspace, refreshInterval, itemsPerPage }: IUseNotificationsProps): {
1316
+ notifications: INotification[];
1317
+ notificationsStatus: "error" | "loading" | "pending" | "success";
1318
+ notificationsError: GoodDataSdkError;
1319
+ notificationsHasNextPage: boolean;
1320
+ notificationsLoadNextPage: () => void;
1321
+ notificationsReset: () => void;
1322
+ unreadNotifications: INotification[];
1323
+ unreadNotificationsStatus: "error" | "loading" | "pending" | "success";
1324
+ unreadNotificationsError: GoodDataSdkError;
1325
+ unreadNotificationsHasNextPage: boolean;
1326
+ unreadNotificationsLoadNextPage: () => void;
1327
+ unreadNotificationsReset: () => void;
1328
+ unreadNotificationsCount: number;
1329
+ markNotificationAsRead: (notificationId: string) => Promise<void>;
1330
+ markAllNotificationsAsRead: () => Promise<void>;
1331
+ };
1332
+
992
1333
  /**
993
1334
  * @internal
994
1335
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-ui-ext",
3
- "version": "10.18.0-alpha.30",
3
+ "version": "10.18.0-alpha.32",
4
4
  "description": "GoodData.UI SDK - Extensions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,7 +35,6 @@
35
35
  "NOTICE"
36
36
  ],
37
37
  "dependencies": {
38
- "@tanstack/react-virtual": "^3.11.1",
39
38
  "classnames": "^2.3.1",
40
39
  "codemirror": "^5.54.0",
41
40
  "date-fns": "^2.22.1",
@@ -48,6 +47,7 @@
48
47
  "lru-cache": "^10.0.1",
49
48
  "react-intl": "^6.4.1",
50
49
  "react-lines-ellipsis": "^0.15.0",
50
+ "react-loading-skeleton": "^3.4.0",
51
51
  "react-measure": "^2.5.2",
52
52
  "react-select": "^5.7.3",
53
53
  "react-select-async-paginate": "^0.7.3",
@@ -55,19 +55,19 @@
55
55
  "ts-invariant": "^0.7.5",
56
56
  "tslib": "^2.5.0",
57
57
  "uuid": "^8.3.2",
58
- "@gooddata/sdk-backend-base": "10.18.0-alpha.30",
59
- "@gooddata/sdk-backend-spi": "10.18.0-alpha.30",
60
- "@gooddata/sdk-embedding": "10.18.0-alpha.30",
61
- "@gooddata/sdk-ui": "10.18.0-alpha.30",
62
- "@gooddata/sdk-model": "10.18.0-alpha.30",
63
- "@gooddata/sdk-ui-charts": "10.18.0-alpha.30",
64
- "@gooddata/sdk-ui-filters": "10.18.0-alpha.30",
65
- "@gooddata/sdk-ui-geo": "10.18.0-alpha.30",
66
- "@gooddata/sdk-ui-kit": "10.18.0-alpha.30",
67
- "@gooddata/sdk-ui-pivot": "10.18.0-alpha.30",
68
- "@gooddata/sdk-ui-vis-commons": "10.18.0-alpha.30",
69
- "@gooddata/sdk-ui-theme-provider": "10.18.0-alpha.30",
70
- "@gooddata/util": "10.18.0-alpha.30"
58
+ "@gooddata/sdk-backend-base": "10.18.0-alpha.32",
59
+ "@gooddata/sdk-backend-spi": "10.18.0-alpha.32",
60
+ "@gooddata/sdk-embedding": "10.18.0-alpha.32",
61
+ "@gooddata/sdk-ui": "10.18.0-alpha.32",
62
+ "@gooddata/sdk-model": "10.18.0-alpha.32",
63
+ "@gooddata/sdk-ui-charts": "10.18.0-alpha.32",
64
+ "@gooddata/sdk-ui-filters": "10.18.0-alpha.32",
65
+ "@gooddata/sdk-ui-geo": "10.18.0-alpha.32",
66
+ "@gooddata/sdk-ui-kit": "10.18.0-alpha.32",
67
+ "@gooddata/sdk-ui-pivot": "10.18.0-alpha.32",
68
+ "@gooddata/sdk-ui-theme-provider": "10.18.0-alpha.32",
69
+ "@gooddata/sdk-ui-vis-commons": "10.18.0-alpha.32",
70
+ "@gooddata/util": "10.18.0-alpha.32"
71
71
  },
72
72
  "peerDependencies": {
73
73
  "react": "^16.10.0 || ^17.0.0 || ^18.0.0",
@@ -124,9 +124,9 @@
124
124
  "@types/json-stable-stringify": "^1.0.32",
125
125
  "@types/codemirror": "^5.60.7",
126
126
  "@types/js-yaml": "^4.0.9",
127
- "@gooddata/i18n-toolkit": "10.18.0-alpha.30",
128
- "@gooddata/sdk-backend-mockingbird": "10.18.0-alpha.30",
129
- "@gooddata/reference-workspace": "10.18.0-alpha.30"
127
+ "@gooddata/i18n-toolkit": "10.18.0-alpha.32",
128
+ "@gooddata/sdk-backend-mockingbird": "10.18.0-alpha.32",
129
+ "@gooddata/reference-workspace": "10.18.0-alpha.32"
130
130
  },
131
131
  "scripts": {
132
132
  "clean": "rm -rf ci dist esm coverage *.log styles/css tsconfig.tsbuildinfo",
@@ -1,7 +1,10 @@
1
- // (C) 2024 GoodData Corporation
1
+ // (C) 2024-2025 GoodData Corporation
2
2
 
3
3
  .gd-ui-ext-notifications-panel {
4
4
  font-family: var(--gd-font-family);
5
+ font-size: 12px;
6
+ line-height: 14px;
7
+
5
8
  background-color: var(--gd-palette-complementary-0);
6
9
 
7
10
  box-shadow: 0 2px 10px 0 var(--gd-shadow-color);
@@ -16,8 +19,3 @@
16
19
 
17
20
  overflow: hidden;
18
21
  }
19
-
20
- .gd-ui-ext-notifications-panel-overlay {
21
- width: 370px;
22
- max-height: 560px;
23
- }