@notificationapi/react 0.0.15 → 0.0.17

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.
@@ -1,4 +1,4 @@
1
- import { jsxs as lt, jsx as oe } from "react/jsx-runtime";
1
+ import { jsxs as lt, jsx as ae } from "react/jsx-runtime";
2
2
  import * as q from "react";
3
3
  import ie, { useRef as Qe, useDebugValue as er, createElement as uo, useContext as co, useMemo as ye, useCallback as fo, useState as lo, useEffect as tr } from "react";
4
4
  import { S as po, U as N, V as le, W as B, X as U, Y as mo, Z as pt, $ as Me, a0 as pe, a1 as ho, a2 as dn, a3 as yo, a4 as go, a5 as mn, a6 as me, a7 as vo, a8 as bo, a9 as Te, aa as rr, ab as nr, h as wo, ac as So, g as Oo, m as To, r as xo, u as Eo, p as Po, a as hn, j as Ao, c as St, b as Ro, ad as Co, ae as $o, af as ko, ag as Do, ah as Io, ai as yn, aj as gn, ak as vn } from "./colors.js";
@@ -436,16 +436,16 @@ const Qo = (e, t) => {
436
436
  } = e, Z = Zo(e, ["prefixCls", "shape", "size", "src", "srcSet", "icon", "className", "rootClassName", "alt", "draggable", "children", "crossOrigin"]), Y = _o((g) => {
437
437
  var w, C;
438
438
  return (C = (w = M ?? (y == null ? void 0 : y.size)) !== null && w !== void 0 ? w : g) !== null && C !== void 0 ? C : "default";
439
- }), Q = Object.keys(typeof Y == "object" ? Y || {} : {}).some((g) => ["xs", "sm", "md", "lg", "xl", "xxl"].includes(g)), ae = Go(Q), X = q.useMemo(() => {
439
+ }), Q = Object.keys(typeof Y == "object" ? Y || {} : {}).some((g) => ["xs", "sm", "md", "lg", "xl", "xxl"].includes(g)), oe = Go(Q), X = q.useMemo(() => {
440
440
  if (typeof Y != "object")
441
441
  return {};
442
- const g = Sn.find((C) => ae[C]), w = Y[g];
442
+ const g = Sn.find((C) => oe[C]), w = Y[g];
443
443
  return w ? {
444
444
  width: w,
445
445
  height: w,
446
446
  fontSize: w && (f || ee) ? w / 2 : 18
447
447
  } : {};
448
- }, [ae, Y]);
448
+ }, [oe, Y]);
449
449
  if (process.env.NODE_ENV !== "production") {
450
450
  const g = Ao("Avatar");
451
451
  process.env.NODE_ENV !== "production" && g(!(typeof f == "string" && f.length > 2), "breaking", `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${f}\` at https://ant.design/components/icon`);
@@ -1142,9 +1142,9 @@ function qa(e, t, r) {
1142
1142
  var k = new Ua(r, b, n ? o.componentStyle : void 0);
1143
1143
  function M(x, f) {
1144
1144
  return function(D, V, W) {
1145
- var K = D.attrs, ee = D.componentStyle, re = D.defaultProps, Z = D.foldedComponentIds, Y = D.styledComponentId, Q = D.target, ae = ie.useContext(Fn), X = mr(), L = D.shouldForwardProp || X.shouldForwardProp;
1145
+ var K = D.attrs, ee = D.componentStyle, re = D.defaultProps, Z = D.foldedComponentIds, Y = D.styledComponentId, Q = D.target, oe = ie.useContext(Fn), X = mr(), L = D.shouldForwardProp || X.shouldForwardProp;
1146
1146
  process.env.NODE_ENV !== "production" && er(Y);
1147
- var J = sa(V, ae, re) || Ce, H = function(_, $, A) {
1147
+ var J = sa(V, oe, re) || Ce, H = function(_, $, A) {
1148
1148
  for (var g, w = te(te({}, $), { className: void 0, theme: A }), C = 0; C < _.length; C += 1) {
1149
1149
  var G = $e(g = _[C]) ? g(w) : g;
1150
1150
  for (var d in G)
@@ -3408,7 +3408,7 @@ function ms() {
3408
3408
  }
3409
3409
  }
3410
3410
  }
3411
- var f = c, D = l, V = s, W = i, K = t, ee = m, re = n, Z = E, Y = y, Q = r, ae = a, X = o, L = v, J = !1;
3411
+ var f = c, D = l, V = s, W = i, K = t, ee = m, re = n, Z = E, Y = y, Q = r, oe = a, X = o, L = v, J = !1;
3412
3412
  function H(d) {
3413
3413
  return J || (J = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), p(d) || x(d) === c;
3414
3414
  }
@@ -3448,7 +3448,7 @@ function ms() {
3448
3448
  function G(d) {
3449
3449
  return x(d) === v;
3450
3450
  }
3451
- z.AsyncMode = f, z.ConcurrentMode = D, z.ContextConsumer = V, z.ContextProvider = W, z.Element = K, z.ForwardRef = ee, z.Fragment = re, z.Lazy = Z, z.Memo = Y, z.Portal = Q, z.Profiler = ae, z.StrictMode = X, z.Suspense = L, z.isAsyncMode = H, z.isConcurrentMode = p, z.isContextConsumer = h, z.isContextProvider = T, z.isElement = P, z.isForwardRef = R, z.isFragment = _, z.isLazy = $, z.isMemo = A, z.isPortal = g, z.isProfiler = w, z.isStrictMode = C, z.isSuspense = G, z.isValidElementType = O, z.typeOf = x;
3451
+ z.AsyncMode = f, z.ConcurrentMode = D, z.ContextConsumer = V, z.ContextProvider = W, z.Element = K, z.ForwardRef = ee, z.Fragment = re, z.Lazy = Z, z.Memo = Y, z.Portal = Q, z.Profiler = oe, z.StrictMode = X, z.Suspense = L, z.isAsyncMode = H, z.isConcurrentMode = p, z.isContextConsumer = h, z.isContextProvider = T, z.isElement = P, z.isForwardRef = R, z.isFragment = _, z.isLazy = $, z.isMemo = A, z.isPortal = g, z.isProfiler = w, z.isStrictMode = C, z.isSuspense = G, z.isValidElementType = O, z.typeOf = x;
3452
3452
  }()), z;
3453
3453
  }
3454
3454
  var Qr;
@@ -3738,12 +3738,12 @@ Valid keys: ` + JSON.stringify(Object.keys(p), null, " ")
3738
3738
  return !1;
3739
3739
  }
3740
3740
  }
3741
- function ae(p, h) {
3741
+ function oe(p, h) {
3742
3742
  return p === "symbol" ? !0 : h ? h["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && h instanceof Symbol : !1;
3743
3743
  }
3744
3744
  function X(p) {
3745
3745
  var h = typeof p;
3746
- return Array.isArray(p) ? "array" : p instanceof RegExp ? "object" : ae(h, p) ? "symbol" : h;
3746
+ return Array.isArray(p) ? "array" : p instanceof RegExp ? "object" : oe(h, p) ? "symbol" : h;
3747
3747
  }
3748
3748
  function L(p) {
3749
3749
  if (typeof p > "u" || p === null)
@@ -4293,11 +4293,11 @@ function ru(e) {
4293
4293
  Y(H);
4294
4294
  }
4295
4295
  }, [x]);
4296
- var ae = ye(function() {
4296
+ var oe = ye(function() {
4297
4297
  return Is(M, m);
4298
4298
  }, [M, m]), X = ye(function() {
4299
- return c ? c(t) : ae(t);
4300
- }, [t, c, ae]);
4299
+ return c ? c(t) : oe(t);
4300
+ }, [t, c, oe]);
4301
4301
  return {
4302
4302
  date: t,
4303
4303
  formattedDate: Z,
@@ -4510,7 +4510,7 @@ const pu = Un.div`
4510
4510
  width: "100%"
4511
4511
  },
4512
4512
  children: [
4513
- /* @__PURE__ */ oe("div", { children: /* @__PURE__ */ oe(
4513
+ /* @__PURE__ */ ae("div", { children: /* @__PURE__ */ ae(
4514
4514
  Tn,
4515
4515
  {
4516
4516
  src: e.notification.imageURL,
@@ -4529,20 +4529,19 @@ const pu = Un.div`
4529
4529
  flexGrow: 1
4530
4530
  },
4531
4531
  children: [
4532
- /* @__PURE__ */ oe("div", { children: /* @__PURE__ */ oe(or.Text, { children: /* @__PURE__ */ oe(
4532
+ /* @__PURE__ */ ae("div", { children: /* @__PURE__ */ ae(or.Text, { children: /* @__PURE__ */ ae(
4533
4533
  "span",
4534
4534
  {
4535
4535
  dangerouslySetInnerHTML: { __html: e.notification.title }
4536
4536
  }
4537
4537
  ) }) }),
4538
- /* @__PURE__ */ oe("div", { children: /* @__PURE__ */ oe(or.Text, { type: "secondary", style: { fontSize: 12 }, children: /* @__PURE__ */ oe(
4538
+ /* @__PURE__ */ ae("div", { children: /* @__PURE__ */ ae(or.Text, { type: "secondary", style: { fontSize: 12 }, children: /* @__PURE__ */ ae(
4539
4539
  st,
4540
4540
  {
4541
4541
  date: new Date(e.notification.date).getTime(),
4542
4542
  locale: "en-US"
4543
4543
  }
4544
- ) }) }),
4545
- e.extraRenderer && /* @__PURE__ */ oe("div", { children: e.extraRenderer(e.notification) })
4544
+ ) }) })
4546
4545
  ]
4547
4546
  }
4548
4547
  ),
@@ -4557,18 +4556,18 @@ const pu = Un.div`
4557
4556
  alignItems: "center"
4558
4557
  },
4559
4558
  children: [
4560
- /* @__PURE__ */ oe(
4559
+ /* @__PURE__ */ ae(
4561
4560
  Fo,
4562
4561
  {
4563
4562
  className: "notification-archive-button",
4564
- icon: /* @__PURE__ */ oe(Mo, {}),
4563
+ icon: /* @__PURE__ */ ae(Mo, {}),
4565
4564
  size: "small",
4566
4565
  type: "text",
4567
4566
  shape: "circle",
4568
4567
  onClick: (t) => (e.markAsArchived([e.notification.id]), t.preventDefault(), t.stopPropagation(), !1)
4569
4568
  }
4570
4569
  ),
4571
- /* @__PURE__ */ oe(
4570
+ /* @__PURE__ */ ae(
4572
4571
  zo,
4573
4572
  {
4574
4573
  dot: !0,
@@ -14,6 +14,8 @@ export type InboxProps = {
14
14
  pageSize: number;
15
15
  pagePosition: NotificationPopupProps["pagePosition"];
16
16
  notificationRenderer: ((notification: InAppNotification) => JSX.Element) | undefined;
17
- notificationExtraRenderer: ((notification: InAppNotification) => JSX.Element) | undefined;
17
+ header?: {
18
+ title?: JSX.Element;
19
+ };
18
20
  };
19
21
  export declare const Inbox: React.FC<InboxProps>;
@@ -1,4 +1,6 @@
1
1
  /// <reference types="react" />
2
- export declare const InboxHeader: (props: {
2
+ export type InboxHeaderProps = {
3
3
  markAsArchived: (ids: string[] | "ALL") => void;
4
- }) => JSX.Element;
4
+ title?: JSX.Element;
5
+ };
6
+ export declare const InboxHeader: (props: InboxHeaderProps) => JSX.Element;
@@ -1,52 +1,55 @@
1
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import { I as s, T as d, R as f } from "../../assets/index3.js";
3
- import { P as c } from "../../assets/index.js";
1
+ import { jsx as t, jsxs as c } from "react/jsx-runtime";
2
+ import { I as s, T as d, R as m } from "../../assets/index3.js";
3
+ import { P as n } from "../../assets/index.js";
4
4
  import { B as a } from "../../assets/button.js";
5
- import { _ as m } from "../../assets/colors.js";
6
- import * as n from "react";
7
- var p = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z" } }] }, name: "setting", theme: "outlined" }, u = function(o, r) {
8
- return /* @__PURE__ */ n.createElement(s, m({}, o, {
5
+ import { _ as f } from "../../assets/colors.js";
6
+ import * as i from "react";
7
+ var p = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z" } }] }, name: "setting", theme: "outlined" }, u = function(l, r) {
8
+ return /* @__PURE__ */ i.createElement(s, f({}, l, {
9
9
  ref: r,
10
10
  icon: p
11
11
  }));
12
- }, i = /* @__PURE__ */ n.forwardRef(u);
13
- process.env.NODE_ENV !== "production" && (i.displayName = "SettingOutlined");
14
- const R = (t) => /* @__PURE__ */ l(
15
- "div",
16
- {
17
- style: {
18
- display: "flex",
19
- justifyContent: "space-between",
20
- paddingRight: 5
21
- },
22
- children: [
23
- /* @__PURE__ */ e(d.Text, { strong: !0, children: "Notifications" }),
24
- /* @__PURE__ */ l("div", { children: [
25
- /* @__PURE__ */ e(c, { content: "Resolve all", children: /* @__PURE__ */ e(
26
- a,
27
- {
28
- icon: /* @__PURE__ */ e(f, {}),
29
- size: "small",
30
- type: "text",
31
- onClick: () => {
32
- t.markAsArchived("ALL");
12
+ }, o = /* @__PURE__ */ i.forwardRef(u);
13
+ process.env.NODE_ENV !== "production" && (o.displayName = "SettingOutlined");
14
+ const R = (e) => {
15
+ const l = e.title ?? /* @__PURE__ */ t(d.Text, { strong: !0, children: "Notifications" });
16
+ return /* @__PURE__ */ c(
17
+ "div",
18
+ {
19
+ style: {
20
+ display: "flex",
21
+ justifyContent: "space-between",
22
+ paddingRight: 5
23
+ },
24
+ children: [
25
+ l,
26
+ /* @__PURE__ */ c("div", { children: [
27
+ /* @__PURE__ */ t(n, { content: "Resolve all", children: /* @__PURE__ */ t(
28
+ a,
29
+ {
30
+ icon: /* @__PURE__ */ t(m, {}),
31
+ size: "small",
32
+ type: "text",
33
+ onClick: () => {
34
+ e.markAsArchived("ALL");
35
+ }
33
36
  }
34
- }
35
- ) }),
36
- /* @__PURE__ */ e(c, { content: "Notification Preferences", children: /* @__PURE__ */ e(
37
- a,
38
- {
39
- icon: /* @__PURE__ */ e(i, {}),
40
- size: "small",
41
- type: "text",
42
- onClick: () => {
37
+ ) }),
38
+ /* @__PURE__ */ t(n, { content: "Notification Preferences", children: /* @__PURE__ */ t(
39
+ a,
40
+ {
41
+ icon: /* @__PURE__ */ t(o, {}),
42
+ size: "small",
43
+ type: "text",
44
+ onClick: () => {
45
+ }
43
46
  }
44
- }
45
- ) })
46
- ] })
47
- ]
48
- }
49
- );
47
+ ) })
48
+ ] })
49
+ ]
50
+ }
51
+ );
52
+ };
50
53
  export {
51
54
  R as InboxHeader
52
55
  };
@@ -10,6 +10,5 @@ export type NotificationProps = {
10
10
  markAsClicked: (id: string) => void;
11
11
  imageShape: keyof typeof ImageShape;
12
12
  renderer?: (notification: InAppNotification) => JSX.Element;
13
- extraRenderer?: (notification: InAppNotification) => JSX.Element;
14
13
  };
15
14
  export declare const Notification: (props: NotificationProps) => JSX.Element;
@@ -13,7 +13,9 @@ export type NotificationFeedProps = {
13
13
  filter?: keyof typeof Filter | ((n: InAppNotification) => boolean);
14
14
  renderers?: {
15
15
  notification?: NotificationProps["renderer"];
16
- notificationExtra?: NotificationProps["extraRenderer"];
16
+ };
17
+ header?: {
18
+ title?: JSX.Element;
17
19
  };
18
20
  };
19
21
  export declare const NotificationFeed: React.FC<NotificationFeedProps>;
@@ -1,53 +1,55 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { useContext as f, useEffect as c } from "react";
3
- import { F as g, I as l } from "../../assets/Inbox.js";
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { useContext as l, useEffect as g } from "react";
3
+ import { F as f, I as c } from "../../assets/Inbox.js";
4
4
  import { NotificationAPIContext as d } from "../Provider/index.js";
5
- const h = (i) => {
6
- var n, o;
7
- const e = {
8
- imageShape: i.imageShape || "circle",
9
- pagination: i.pagination || "INFINITE_SCROLL",
10
- pageSize: i.pageSize || 10,
11
- pagePosition: i.pagePosition || "top",
12
- style: i.style || {},
13
- filter: i.filter || g.ALL,
14
- infiniteScrollHeight: i.infiniteScrollHeight ? i.infiniteScrollHeight : window.innerHeight * 0.75,
5
+ const x = (e) => {
6
+ var n, a;
7
+ const i = {
8
+ imageShape: e.imageShape || "circle",
9
+ pagination: e.pagination || "INFINITE_SCROLL",
10
+ pageSize: e.pageSize || 10,
11
+ pagePosition: e.pagePosition || "top",
12
+ style: e.style || {},
13
+ filter: e.filter || f.ALL,
14
+ infiniteScrollHeight: e.infiniteScrollHeight ? e.infiniteScrollHeight : window.innerHeight * 0.75,
15
15
  renderers: {
16
- notification: (n = i.renderers) == null ? void 0 : n.notification,
17
- notificationExtra: (o = i.renderers) == null ? void 0 : o.notificationExtra
16
+ notification: (n = e.renderers) == null ? void 0 : n.notification
17
+ },
18
+ header: {
19
+ title: (a = e.header) == null ? void 0 : a.title
18
20
  }
19
- }, t = f(d);
20
- return t ? (c(() => {
21
+ }, t = l(d);
22
+ return t ? (g(() => {
21
23
  t.markAsOpened();
22
24
  const r = setInterval(() => {
23
25
  t.markAsOpened();
24
26
  }, 5e3);
25
27
  return () => clearInterval(r);
26
- }, []), /* @__PURE__ */ a(
28
+ }, []), /* @__PURE__ */ o(
27
29
  "div",
28
30
  {
29
31
  style: {
30
32
  padding: 12,
31
33
  boxSizing: "border-box",
32
34
  background: "#fff",
33
- ...i.style
35
+ ...e.style
34
36
  },
35
- children: /* @__PURE__ */ a(
36
- l,
37
+ children: /* @__PURE__ */ o(
38
+ c,
37
39
  {
38
- maxHeight: e.infiniteScrollHeight,
39
- pagination: e.pagination,
40
- filter: e.filter,
41
- imageShape: e.imageShape,
42
- pageSize: e.pageSize,
43
- pagePosition: e.pagePosition,
44
- notificationRenderer: e.renderers.notification,
45
- notificationExtraRenderer: e.renderers.notificationExtra
40
+ maxHeight: i.infiniteScrollHeight,
41
+ pagination: i.pagination,
42
+ filter: i.filter,
43
+ imageShape: i.imageShape,
44
+ pageSize: i.pageSize,
45
+ pagePosition: i.pagePosition,
46
+ notificationRenderer: i.renderers.notification,
47
+ header: i.header
46
48
  }
47
49
  )
48
50
  }
49
51
  )) : null;
50
52
  };
51
53
  export {
52
- h as NotificationFeed
54
+ x as NotificationFeed
53
55
  };
@@ -1,15 +1,23 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import { I as f } from "../../assets/Inbox.js";
3
- import { UnreadBadge as d } from "./UnreadBadge.js";
4
- import { useContext as c } from "react";
5
- import { NotificationAPIContext as g } from "../Provider/index.js";
6
- import { P as u } from "../../assets/index.js";
7
- import { B as h } from "../../assets/button.js";
8
- import { R as l } from "../../assets/BellOutlined.js";
2
+ import { I as d } from "../../assets/Inbox.js";
3
+ import { UnreadBadge as f } from "./UnreadBadge.js";
4
+ import { useContext as u } from "react";
5
+ import { NotificationAPIContext as h } from "../Provider/index.js";
6
+ import { R as c } from "../../assets/BellOutlined.js";
7
+ import { P as g } from "../../assets/index.js";
8
+ import { B as l } from "../../assets/button.js";
9
9
  var m = /* @__PURE__ */ ((t) => (t.TOP_LEFT = "top-left", t.TOP_RIGHT = "top-right", t.BOTTOM_LEFT = "bottom-left", t.BOTTOM_RIGHT = "bottom-right", t))(m || {});
10
- const y = (t) => {
10
+ const W = (t) => {
11
11
  var n, a;
12
12
  const e = {
13
+ buttonIcon: t.buttonIcon || /* @__PURE__ */ i(
14
+ c,
15
+ {
16
+ style: {
17
+ fontSize: t.buttonIconSize || (t.buttonWidth ? t.buttonWidth / 2 : 20)
18
+ }
19
+ }
20
+ ),
13
21
  buttonWidth: t.buttonWidth || 40,
14
22
  buttonHeight: t.buttonHeight || 40,
15
23
  popupWidth: t.popupWidth || 400,
@@ -19,37 +27,35 @@ const y = (t) => {
19
27
  pagination: t.pagination || "INFINITE_SCROLL",
20
28
  pageSize: t.pageSize || 10,
21
29
  pagePosition: t.pagePosition || "top",
22
- style: {
23
- zIndex: 999,
24
- ...t.style
25
- },
30
+ popupZIndex: t.popupZIndex || 1030,
26
31
  unreadBadgeProps: t.unreadBadgeProps ?? {},
27
32
  offsetX: t.offsetX || 16,
28
33
  offsetY: t.offsetY || 16,
29
34
  position: t.position || "BOTTOM_RIGHT",
30
35
  count: t.count || "COUNT_UNOPENED_NOTIFICATIONS",
31
36
  filter: t.filter || "ALL",
37
+ header: {
38
+ title: (n = t.header) == null ? void 0 : n.title
39
+ },
32
40
  renderers: {
33
- notification: (n = t.renderers) == null ? void 0 : n.notification,
34
- notificationExtra: (a = t.renderers) == null ? void 0 : a.notificationExtra
41
+ notification: (a = t.renderers) == null ? void 0 : a.notification
35
42
  }
36
- }, o = c(g);
43
+ }, o = u(h);
37
44
  return o ? /* @__PURE__ */ i(
38
45
  "div",
39
46
  {
40
47
  style: {
41
48
  position: "fixed",
42
49
  right: e.offsetX,
43
- bottom: e.offsetY,
44
- ...e.style
50
+ bottom: e.offsetY
45
51
  },
46
52
  children: /* @__PURE__ */ i(
47
- u,
53
+ g,
48
54
  {
49
55
  autoAdjustOverflow: !0,
50
56
  trigger: "click",
51
57
  content: /* @__PURE__ */ i(
52
- f,
58
+ d,
53
59
  {
54
60
  maxHeight: 500,
55
61
  pagination: e.pagination,
@@ -58,7 +64,7 @@ const y = (t) => {
58
64
  pageSize: e.pageSize,
59
65
  pagePosition: e.pagePosition,
60
66
  notificationRenderer: e.renderers.notification,
61
- notificationExtraRenderer: e.renderers.notificationExtra
67
+ header: e.header
62
68
  }
63
69
  ),
64
70
  arrow: !1,
@@ -76,7 +82,7 @@ const y = (t) => {
76
82
  display: "inline-block"
77
83
  },
78
84
  children: /* @__PURE__ */ i(
79
- d,
85
+ f,
80
86
  {
81
87
  ...t.unreadBadgeProps,
82
88
  style: {
@@ -85,16 +91,9 @@ const y = (t) => {
85
91
  },
86
92
  count: e.count,
87
93
  children: /* @__PURE__ */ i(
88
- h,
94
+ l,
89
95
  {
90
- icon: /* @__PURE__ */ i(
91
- l,
92
- {
93
- style: {
94
- fontSize: e.buttonIconSize
95
- }
96
- }
97
- ),
96
+ icon: e.buttonIcon,
98
97
  style: {
99
98
  width: e.buttonWidth,
100
99
  height: e.buttonHeight
@@ -113,6 +112,6 @@ const y = (t) => {
113
112
  ) : null;
114
113
  };
115
114
  export {
116
- y as NotificationLauncher,
115
+ W as NotificationLauncher,
117
116
  m as Position
118
117
  };
@@ -8,6 +8,7 @@ export declare enum Filter {
8
8
  UNARCHIVED = "UNARCHIVED"
9
9
  }
10
10
  export type NotificationPopupProps = {
11
+ buttonIcon?: React.ReactNode;
11
12
  buttonIconSize?: number;
12
13
  buttonWidth?: number;
13
14
  buttonHeight?: number;
@@ -17,13 +18,15 @@ export type NotificationPopupProps = {
17
18
  pagination?: keyof typeof Pagination;
18
19
  pageSize?: number;
19
20
  pagePosition?: "top" | "bottom";
20
- style?: React.CSSProperties;
21
+ popupZIndex?: number;
21
22
  unreadBadgeProps?: UnreadBadgeProps;
22
23
  count?: UnreadBadgeProps["count"];
23
24
  filter?: keyof typeof Filter | ((n: InAppNotification) => boolean);
24
25
  renderers?: {
25
26
  notification?: NotificationProps["renderer"];
26
- notificationExtra?: NotificationProps["extraRenderer"];
27
+ };
28
+ header?: {
29
+ title?: JSX.Element;
27
30
  };
28
31
  };
29
32
  export declare const NotificationPopup: React.FC<NotificationPopupProps>;
@@ -3,9 +3,9 @@ import { F as s, N as F } from "../../assets/Inbox.js";
3
3
  import "./UnreadBadge.js";
4
4
  import "../Provider/index.js";
5
5
  import "react";
6
+ import "../../assets/BellOutlined.js";
6
7
  import "../../assets/index.js";
7
8
  import "../../assets/button.js";
8
- import "../../assets/BellOutlined.js";
9
9
  export {
10
10
  s as Filter,
11
11
  F as NotificationPopup
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@notificationapi/react",
3
3
  "private": false,
4
- "version": "0.0.15",
4
+ "version": "0.0.17",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",