analytica-frontend-lib 1.1.56 → 1.1.58

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.
@@ -52,6 +52,10 @@ interface Notification {
52
52
  * ID of the entity this notification refers to (optional)
53
53
  */
54
54
  entityId?: string | null;
55
+ /**
56
+ * Action link for global notifications (optional)
57
+ */
58
+ actionLink?: string | null;
55
59
  /**
56
60
  * Sender information (optional)
57
61
  */
@@ -90,6 +94,7 @@ interface BackendNotification {
90
94
  description: string;
91
95
  entityType: string | null;
92
96
  entityId: string | null;
97
+ actionLink?: string | null;
93
98
  read: boolean;
94
99
  createdAt: string;
95
100
  updatedAt: string;
@@ -292,6 +297,10 @@ interface NotificationListMode extends BaseNotificationProps {
292
297
  * Callback when user navigates from a notification in list mode
293
298
  */
294
299
  onNavigateById?: (entityType?: NotificationEntityType, entityId?: string) => void;
300
+ /**
301
+ * Callback when user clicks on a global notification
302
+ */
303
+ onGlobalNotificationClick?: (notification: Notification) => void;
295
304
  /**
296
305
  * Function to get action label for a notification
297
306
  */
@@ -377,6 +386,7 @@ interface LegacyNotificationCardProps extends BaseNotificationProps {
377
386
  onMarkAsReadById?: (id: string) => void;
378
387
  onDeleteById?: (id: string) => void;
379
388
  onNavigateById?: (entityType?: NotificationEntityType, entityId?: string) => void;
389
+ onGlobalNotificationClick?: (notification: Notification) => void;
380
390
  getActionLabel?: (entityType?: NotificationEntityType) => string | undefined;
381
391
  renderEmpty?: () => ReactNode;
382
392
  variant?: 'card' | 'center';
@@ -52,6 +52,10 @@ interface Notification {
52
52
  * ID of the entity this notification refers to (optional)
53
53
  */
54
54
  entityId?: string | null;
55
+ /**
56
+ * Action link for global notifications (optional)
57
+ */
58
+ actionLink?: string | null;
55
59
  /**
56
60
  * Sender information (optional)
57
61
  */
@@ -90,6 +94,7 @@ interface BackendNotification {
90
94
  description: string;
91
95
  entityType: string | null;
92
96
  entityId: string | null;
97
+ actionLink?: string | null;
93
98
  read: boolean;
94
99
  createdAt: string;
95
100
  updatedAt: string;
@@ -292,6 +297,10 @@ interface NotificationListMode extends BaseNotificationProps {
292
297
  * Callback when user navigates from a notification in list mode
293
298
  */
294
299
  onNavigateById?: (entityType?: NotificationEntityType, entityId?: string) => void;
300
+ /**
301
+ * Callback when user clicks on a global notification
302
+ */
303
+ onGlobalNotificationClick?: (notification: Notification) => void;
295
304
  /**
296
305
  * Function to get action label for a notification
297
306
  */
@@ -377,6 +386,7 @@ interface LegacyNotificationCardProps extends BaseNotificationProps {
377
386
  onMarkAsReadById?: (id: string) => void;
378
387
  onDeleteById?: (id: string) => void;
379
388
  onNavigateById?: (entityType?: NotificationEntityType, entityId?: string) => void;
389
+ onGlobalNotificationClick?: (notification: Notification) => void;
380
390
  getActionLabel?: (entityType?: NotificationEntityType) => string | undefined;
381
391
  renderEmpty?: () => ReactNode;
382
392
  variant?: 'card' | 'center';
@@ -3570,6 +3570,8 @@ var CardAudio = (0, import_react7.forwardRef)(
3570
3570
  const [showSpeedMenu, setShowSpeedMenu] = (0, import_react7.useState)(false);
3571
3571
  const [playbackRate, setPlaybackRate] = (0, import_react7.useState)(1);
3572
3572
  const audioRef = (0, import_react7.useRef)(null);
3573
+ const volumeControlRef = (0, import_react7.useRef)(null);
3574
+ const speedMenuRef = (0, import_react7.useRef)(null);
3573
3575
  const formatTime = (time) => {
3574
3576
  const minutes = Math.floor(time / 60);
3575
3577
  const seconds = Math.floor(time % 60);
@@ -3621,9 +3623,11 @@ var CardAudio = (0, import_react7.forwardRef)(
3621
3623
  };
3622
3624
  const toggleVolumeControl = () => {
3623
3625
  setShowVolumeControl(!showVolumeControl);
3626
+ setShowSpeedMenu(false);
3624
3627
  };
3625
3628
  const toggleSpeedMenu = () => {
3626
3629
  setShowSpeedMenu(!showSpeedMenu);
3630
+ setShowVolumeControl(false);
3627
3631
  };
3628
3632
  const handleSpeedChange = (speed) => {
3629
3633
  setPlaybackRate(speed);
@@ -3641,6 +3645,20 @@ var CardAudio = (0, import_react7.forwardRef)(
3641
3645
  }
3642
3646
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_phosphor_react5.SpeakerHigh, { size: 24 });
3643
3647
  };
3648
+ (0, import_react7.useEffect)(() => {
3649
+ const handleClickOutside = (event) => {
3650
+ if (volumeControlRef.current && !volumeControlRef.current.contains(event.target)) {
3651
+ setShowVolumeControl(false);
3652
+ }
3653
+ if (speedMenuRef.current && !speedMenuRef.current.contains(event.target)) {
3654
+ setShowSpeedMenu(false);
3655
+ }
3656
+ };
3657
+ document.addEventListener("mousedown", handleClickOutside);
3658
+ return () => {
3659
+ document.removeEventListener("mousedown", handleClickOutside);
3660
+ };
3661
+ }, []);
3644
3662
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
3645
3663
  CardBase,
3646
3664
  {
@@ -3729,7 +3747,7 @@ var CardAudio = (0, import_react7.forwardRef)(
3729
3747
  }
3730
3748
  ) }),
3731
3749
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime(duration) }),
3732
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative h-6", children: [
3750
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative h-6", ref: volumeControlRef, children: [
3733
3751
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3734
3752
  "button",
3735
3753
  {
@@ -3791,7 +3809,7 @@ var CardAudio = (0, import_react7.forwardRef)(
3791
3809
  }
3792
3810
  )
3793
3811
  ] }),
3794
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative h-6", children: [
3812
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative h-6", ref: speedMenuRef, children: [
3795
3813
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3796
3814
  "button",
3797
3815
  {