@notificationapi/react 1.5.1 → 1.6.1

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.
@@ -5884,7 +5884,7 @@ const kc = di.div`
5884
5884
  $seen: c || !!f,
5885
5885
  $archived: !!d,
5886
5886
  onClick: () => {
5887
- t.markAsClicked(v), a && (window.location.href = a);
5887
+ t.markAsClicked(v), a && (t.newTab ? window.open(a, "_blank") : window.location.href = a);
5888
5888
  },
5889
5889
  style: {
5890
5890
  padding: "16px 6px 16px 0",
@@ -13,5 +13,6 @@ export type InboxProps = {
13
13
  header?: InboxHeaderProps;
14
14
  empty?: React.ReactNode;
15
15
  imageShape?: 'circle' | 'square';
16
+ newTab?: boolean;
16
17
  };
17
18
  export declare const Inbox: React.FC<InboxProps>;
@@ -2874,7 +2874,8 @@ const yi = (e) => {
2874
2874
  notifications: u,
2875
2875
  markAsClicked: n.markAsClicked,
2876
2876
  renderer: e.notificationRenderer,
2877
- imageShape: e.imageShape
2877
+ imageShape: e.imageShape,
2878
+ newTab: e.newTab
2878
2879
  }
2879
2880
  ) }, u[0].id)
2880
2881
  }
@@ -2908,7 +2909,8 @@ const yi = (e) => {
2908
2909
  notifications: u,
2909
2910
  markAsClicked: n.markAsClicked,
2910
2911
  renderer: e.notificationRenderer,
2911
- imageShape: e.imageShape
2912
+ imageShape: e.imageShape,
2913
+ newTab: e.newTab
2912
2914
  }
2913
2915
  ) }, u[0].id)),
2914
2916
  e.pagePosition === "bottom" && f.length > 0 && /* @__PURE__ */ j(
@@ -7,5 +7,6 @@ export type NotificationProps = {
7
7
  markAsClicked: (ids: string[]) => void;
8
8
  renderer?: (notification: InAppNotification[]) => ReactNode;
9
9
  imageShape?: 'circle' | 'square';
10
+ newTab?: boolean;
10
11
  };
11
12
  export declare const Notification: (props: NotificationProps) => import("react/jsx-runtime").JSX.Element;
@@ -15,5 +15,6 @@ export type NotificationFeedProps = {
15
15
  };
16
16
  header?: InboxHeaderProps;
17
17
  imageShape?: 'circle' | 'square';
18
+ newTab?: boolean;
18
19
  };
19
20
  export declare const NotificationFeed: React.FC<NotificationFeedProps>;
@@ -9,7 +9,7 @@ import { c as C } from "../../assets/createSvgIcon.js";
9
9
  import { D as I } from "../../assets/Divider.js";
10
10
  const H = C(/* @__PURE__ */ n("path", {
11
11
  d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56M12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96M4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2s.06 1.34.14 2zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56m2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8M12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96M14.34 14H9.66c-.09-.66-.16-1.32-.16-2s.07-1.35.16-2h4.68c.09.65.16 1.32.16 2s-.07 1.34-.16 2m.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56M16.36 14c.08-.66.14-1.32.14-2s-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2z"
12
- }), "Language"), N = (e) => {
12
+ }), "Language"), O = (e) => {
13
13
  var a, o, c, l;
14
14
  const [f, r] = d(!1), i = m(p);
15
15
  if (h(() => {
@@ -36,7 +36,8 @@ const H = C(/* @__PURE__ */ n("path", {
36
36
  button1ClickHandler: ((c = e.header) == null ? void 0 : c.button1ClickHandler) ?? i.markAsArchived,
37
37
  button2ClickHandler: ((l = e.header) == null ? void 0 : l.button2ClickHandler) ?? (() => r(!0))
38
38
  },
39
- imageShape: e.imageShape || "circle"
39
+ imageShape: e.imageShape || "circle",
40
+ newTab: e.newTab ?? !1
40
41
  };
41
42
  return /* @__PURE__ */ s(
42
43
  "div",
@@ -60,7 +61,8 @@ const H = C(/* @__PURE__ */ n("path", {
60
61
  pagePosition: t.pagePosition,
61
62
  notificationRenderer: t.renderers.notification,
62
63
  header: t.header,
63
- imageShape: t.imageShape
64
+ imageShape: t.imageShape,
65
+ newTab: t.newTab
64
66
  }
65
67
  ),
66
68
  i.webPushOptInMessage && localStorage.getItem("hideWebPushOptInMessage") !== "true" && /* @__PURE__ */ s("div", { children: [
@@ -102,5 +104,5 @@ const H = C(/* @__PURE__ */ n("path", {
102
104
  );
103
105
  };
104
106
  export {
105
- N as NotificationFeed
107
+ O as NotificationFeed
106
108
  };
@@ -1,22 +1,22 @@
1
1
  import { jsx as o, jsxs as a } from "react/jsx-runtime";
2
- import { useState as c, useContext as C } from "react";
2
+ import { useState as l, useContext as C } from "react";
3
3
  import { Inbox as S } from "./Inbox.js";
4
4
  import { UnreadBadge as y } from "./UnreadBadge.js";
5
5
  import { NotificationAPIContext as z } from "../Provider/context.js";
6
6
  import { NotificationPreferencesPopup as N } from "../Preferences/NotificationPreferencesPopup.js";
7
- import { W as k, L as v } from "../../assets/WebPushOptInMessage.js";
8
- import { N as A } from "../../assets/channelUtils.js";
9
- import { I as H } from "../../assets/IconButton.js";
10
- import { P as L } from "../../assets/Popover.js";
11
- import { D as T } from "../../assets/Divider.js";
7
+ import { W as T, L as k } from "../../assets/WebPushOptInMessage.js";
8
+ import { N as v } from "../../assets/channelUtils.js";
9
+ import { I as A } from "../../assets/IconButton.js";
10
+ import { P as H } from "../../assets/Popover.js";
11
+ import { D as L } from "../../assets/Divider.js";
12
12
  const j = (e) => {
13
- var d, f, u, h, g, p, m, I;
14
- const [P, l] = c(!1), [n, s] = c(!1), i = C(z), [b, O] = c(null);
15
- if (!i)
13
+ var d, f, u, h, g, m, p, b;
14
+ const [I, c] = l(!1), [i, s] = l(!1), n = C(z), [P, O] = l(null);
15
+ if (!n)
16
16
  return null;
17
17
  const t = {
18
18
  buttonIcon: e.buttonIcon || /* @__PURE__ */ o(
19
- A,
19
+ v,
20
20
  {
21
21
  style: {
22
22
  fontSize: e.buttonIconSize || 20,
@@ -45,20 +45,21 @@ const j = (e) => {
45
45
  filter: e.filter || "ALL",
46
46
  header: {
47
47
  title: (d = e.header) == null ? void 0 : d.title,
48
- button1ClickHandler: ((f = e.header) == null ? void 0 : f.button1ClickHandler) ?? i.markAsArchived,
49
- button2ClickHandler: ((u = e.header) == null ? void 0 : u.button2ClickHandler) ?? (() => l(!0))
48
+ button1ClickHandler: ((f = e.header) == null ? void 0 : f.button1ClickHandler) ?? n.markAsArchived,
49
+ button2ClickHandler: ((u = e.header) == null ? void 0 : u.button2ClickHandler) ?? (() => c(!0))
50
50
  },
51
51
  renderers: {
52
52
  notification: (h = e.renderers) == null ? void 0 : h.notification
53
53
  },
54
54
  popoverPosition: {
55
55
  anchorOrigin: {
56
- vertical: ((p = (g = e.popoverPosition) == null ? void 0 : g.anchorOrigin) == null ? void 0 : p.vertical) ?? "top",
57
- horizontal: ((I = (m = e.popoverPosition) == null ? void 0 : m.anchorOrigin) == null ? void 0 : I.horizontal) ?? "left"
56
+ vertical: ((m = (g = e.popoverPosition) == null ? void 0 : g.anchorOrigin) == null ? void 0 : m.vertical) ?? "top",
57
+ horizontal: ((b = (p = e.popoverPosition) == null ? void 0 : p.anchorOrigin) == null ? void 0 : b.horizontal) ?? "left"
58
58
  }
59
- }
59
+ },
60
+ newTab: e.newTab ?? !1
60
61
  }, x = (r) => {
61
- s(!n), O(r == null ? void 0 : r.currentTarget), n && i.markAsOpened();
62
+ s(!i), O(r == null ? void 0 : r.currentTarget), i && n.markAsOpened();
62
63
  };
63
64
  return /* @__PURE__ */ a(
64
65
  "div",
@@ -76,14 +77,14 @@ const j = (e) => {
76
77
  style: {
77
78
  display: "inline-block"
78
79
  },
79
- children: /* @__PURE__ */ o(y, { ...e.unreadBadgeProps, count: t.count, children: /* @__PURE__ */ o(H, { style: t.buttonStyles, onClick: x, children: t.buttonIcon }) })
80
+ children: /* @__PURE__ */ o(y, { ...e.unreadBadgeProps, count: t.count, children: /* @__PURE__ */ o(A, { style: t.buttonStyles, onClick: x, children: t.buttonIcon }) })
80
81
  }
81
82
  ),
82
83
  /* @__PURE__ */ a(
83
- L,
84
+ H,
84
85
  {
85
- open: n,
86
- anchorEl: b,
86
+ open: i,
87
+ anchorEl: P,
87
88
  anchorReference: "anchorEl",
88
89
  anchorOrigin: {
89
90
  horizontal: "center",
@@ -113,16 +114,17 @@ const j = (e) => {
113
114
  pageSize: t.pageSize,
114
115
  pagePosition: t.pagePosition,
115
116
  notificationRenderer: t.renderers.notification,
116
- header: t.header
117
+ header: t.header,
118
+ newTab: t.newTab
117
119
  }
118
120
  ),
119
- i.webPushOptInMessage && localStorage.getItem("hideWebPushOptInMessage") !== "true" && /* @__PURE__ */ a("div", { children: [
120
- /* @__PURE__ */ o(T, { style: { margin: "10px 0" } }),
121
+ n.webPushOptInMessage && localStorage.getItem("hideWebPushOptInMessage") !== "true" && /* @__PURE__ */ a("div", { children: [
122
+ /* @__PURE__ */ o(L, { style: { margin: "10px 0" } }),
121
123
  /* @__PURE__ */ o(
122
- k,
124
+ T,
123
125
  {
124
126
  hideAfterInteraction: !0,
125
- icon: /* @__PURE__ */ o(v, { type: "text", style: { marginLeft: "9px" } }),
127
+ icon: /* @__PURE__ */ o(k, { type: "text", style: { marginLeft: "9px" } }),
126
128
  alertContainerStyle: { maxWidth: "345px" }
127
129
  }
128
130
  )
@@ -133,8 +135,8 @@ const j = (e) => {
133
135
  /* @__PURE__ */ o(
134
136
  N,
135
137
  {
136
- open: P,
137
- onClose: () => l(!1)
138
+ open: I,
139
+ onClose: () => c(!1)
138
140
  }
139
141
  )
140
142
  ]
@@ -29,5 +29,6 @@ export type NotificationPopupProps = {
29
29
  horizontal: 'left' | 'center' | 'right';
30
30
  };
31
31
  };
32
+ newTab?: boolean;
32
33
  };
33
34
  export declare const NotificationPopup: React.FC<NotificationPopupProps>;
@@ -8,12 +8,12 @@ import { Filter as z } from "./interface.js";
8
8
  import { W as y } from "../../assets/WebPushOptInMessage.js";
9
9
  import { N as k } from "../../assets/channelUtils.js";
10
10
  import { I as H } from "../../assets/IconButton.js";
11
- import { P as A } from "../../assets/Popover.js";
12
- import { D as B } from "../../assets/Divider.js";
11
+ import { P as T } from "../../assets/Popover.js";
12
+ import { D as A } from "../../assets/Divider.js";
13
13
  const j = (e) => {
14
- var c, d, u, h, p, s, g, f;
15
- const [I, a] = m(!1), [n, l] = m(null), i = O(v);
16
- if (!i)
14
+ var c, d, u, h, s, p, g, f;
15
+ const [I, a] = m(!1), [i, l] = m(null), n = O(v);
16
+ if (!n)
17
17
  return null;
18
18
  const t = {
19
19
  buttonIcon: e.buttonIcon || /* @__PURE__ */ o(
@@ -43,7 +43,7 @@ const j = (e) => {
43
43
  filter: e.filter || z.ALL,
44
44
  header: {
45
45
  title: (c = e.header) == null ? void 0 : c.title,
46
- button1ClickHandler: ((d = e.header) == null ? void 0 : d.button1ClickHandler) ?? i.markAsArchived,
46
+ button1ClickHandler: ((d = e.header) == null ? void 0 : d.button1ClickHandler) ?? n.markAsArchived,
47
47
  button2ClickHandler: ((u = e.header) == null ? void 0 : u.button2ClickHandler) ?? (() => a(!0))
48
48
  },
49
49
  renderers: {
@@ -51,12 +51,13 @@ const j = (e) => {
51
51
  },
52
52
  popoverPosition: {
53
53
  anchorOrigin: {
54
- vertical: ((s = (p = e.popoverPosition) == null ? void 0 : p.anchorOrigin) == null ? void 0 : s.vertical) ?? "top",
54
+ vertical: ((p = (s = e.popoverPosition) == null ? void 0 : s.anchorOrigin) == null ? void 0 : p.vertical) ?? "top",
55
55
  horizontal: ((f = (g = e.popoverPosition) == null ? void 0 : g.anchorOrigin) == null ? void 0 : f.horizontal) ?? "left"
56
56
  }
57
- }
58
- }, P = (b) => {
59
- l(b.currentTarget), i.markAsOpened();
57
+ },
58
+ newTab: e.newTab ?? !1
59
+ }, b = (P) => {
60
+ l(P.currentTarget), n.markAsOpened();
60
61
  };
61
62
  return /* @__PURE__ */ r(C, { children: [
62
63
  /* @__PURE__ */ o(
@@ -71,17 +72,17 @@ const j = (e) => {
71
72
  ...e.unreadBadgeProps,
72
73
  count: t.count,
73
74
  filter: t.filter,
74
- children: /* @__PURE__ */ o(H, { onClick: P, style: t.buttonStyles, children: t.buttonIcon })
75
+ children: /* @__PURE__ */ o(H, { onClick: b, style: t.buttonStyles, children: t.buttonIcon })
75
76
  }
76
77
  )
77
78
  }
78
79
  ),
79
80
  /* @__PURE__ */ o(
80
- A,
81
+ T,
81
82
  {
82
- open: !!n,
83
+ open: !!i,
83
84
  onClose: () => l(null),
84
- anchorEl: n,
85
+ anchorEl: i,
85
86
  slotProps: {
86
87
  paper: {
87
88
  style: {
@@ -89,7 +90,7 @@ const j = (e) => {
89
90
  }
90
91
  }
91
92
  },
92
- "aria-hidden": !n,
93
+ "aria-hidden": !i,
93
94
  anchorOrigin: t.popoverPosition.anchorOrigin,
94
95
  children: /* @__PURE__ */ r(
95
96
  "div",
@@ -110,11 +111,12 @@ const j = (e) => {
110
111
  pageSize: t.pageSize,
111
112
  pagePosition: t.pagePosition,
112
113
  notificationRenderer: t.renderers.notification,
113
- header: t.header
114
+ header: t.header,
115
+ newTab: t.newTab
114
116
  }
115
117
  ),
116
- i.webPushOptInMessage && localStorage.getItem("hideWebPushOptInMessage") !== "true" && /* @__PURE__ */ r("div", { children: [
117
- /* @__PURE__ */ o(B, { style: { margin: "10px 0" } }),
118
+ n.webPushOptInMessage && localStorage.getItem("hideWebPushOptInMessage") !== "true" && /* @__PURE__ */ r("div", { children: [
119
+ /* @__PURE__ */ o(A, { style: { margin: "10px 0" } }),
118
120
  /* @__PURE__ */ o(y, { hideAfterInteraction: !0 })
119
121
  ] })
120
122
  ]
@@ -7,6 +7,12 @@ interface SlackConnectProps {
7
7
  cancelButtonText?: string;
8
8
  connectedText?: string;
9
9
  selectChannelText?: string;
10
+ /**
11
+ * Controls what type of Slack destination the user can select:
12
+ * - 'me': Only allows sending to the authenticated user's own DM (no channel picker or edit option)
13
+ * - 'any': Allows selecting any channel or user (default behavior)
14
+ */
15
+ destinationType?: 'me' | 'any';
10
16
  }
11
- export declare function SlackConnect({ description, connectButtonText, editButtonText, disconnectButtonText, saveButtonText, cancelButtonText, connectedText, selectChannelText }?: SlackConnectProps): import("react/jsx-runtime").JSX.Element | null;
17
+ export declare function SlackConnect({ description, connectButtonText, editButtonText, disconnectButtonText, saveButtonText, cancelButtonText, connectedText, selectChannelText, destinationType }?: SlackConnectProps): import("react/jsx-runtime").JSX.Element | null;
12
18
  export {};