@notificationapi/react 1.7.0 → 1.8.0
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/dist/assets/Badge.js +4 -3
- package/dist/assets/Box.js +26 -24
- package/dist/assets/Button.js +20 -18
- package/dist/assets/ButtonBase.js +193 -185
- package/dist/assets/DefaultPropsProvider.js +416 -4199
- package/dist/assets/DefaultPropsProvider2.js +992 -0
- package/dist/assets/Divider.js +2 -1
- package/dist/assets/GlobalStyles.js +23 -0
- package/dist/assets/Grow.js +87 -92
- package/dist/assets/IconButton.js +8 -7
- package/dist/assets/List.js +12 -11
- package/dist/assets/Modal.js +18 -17
- package/dist/assets/Notification.js +787 -770
- package/dist/assets/Paper.js +6 -6
- package/dist/assets/Popover.js +38 -37
- package/dist/assets/Portal.js +38 -48
- package/dist/assets/Stack.js +32 -30
- package/dist/assets/Typography.js +84 -97
- package/dist/assets/createSvgIcon.js +25 -24
- package/dist/assets/createTheme.js +2828 -0
- package/dist/assets/dividerClasses.js +16 -15
- package/dist/assets/exactProp.js +13 -0
- package/dist/assets/index.js +19 -148
- package/dist/assets/index2.js +151 -0
- package/dist/assets/useTheme.js +6 -7
- package/dist/assets/{useTheme2.js → useThemeWithoutDefault.js} +63 -67
- package/dist/assets/utils.js +2 -2
- package/dist/components/Notifications/Inbox.js +592 -582
- package/dist/components/Notifications/InboxHeader.js +31 -30
- package/dist/components/Notifications/Notification.js +4 -2
- package/dist/components/Notifications/NotificationFeed.js +40 -32
- package/dist/components/Notifications/NotificationLauncher.js +90 -64
- package/dist/components/Notifications/NotificationPopup.js +76 -65
- package/dist/components/Preferences/NotificationPreferencesInline.js +57 -39
- package/dist/components/Preferences/NotificationPreferencesPopup.js +111 -99
- package/dist/components/Preferences/PreferenceInput.js +427 -414
- package/dist/components/Preferences/Preferences.js +329 -278
- package/dist/components/Provider/index.d.ts +2 -0
- package/dist/components/Provider/index.js +1008 -401
- package/dist/components/Slack/SlackConnect.js +8 -7
- package/dist/main.d.ts +2 -0
- package/dist/main.js +6 -3
- package/dist/utils/theme.d.ts +17 -0
- package/dist/utils/theme.js +104 -0
- package/package.json +1 -1
|
@@ -2,14 +2,15 @@ import { jsx as k, jsxs as Be, Fragment as mo } from "react/jsx-runtime";
|
|
|
2
2
|
import { T as vo } from "../../assets/Typography.js";
|
|
3
3
|
import { B as ho } from "../../assets/Box.js";
|
|
4
4
|
import * as M from "react";
|
|
5
|
-
import { g as Wt,
|
|
6
|
-
import { u as
|
|
7
|
-
import { u as
|
|
8
|
-
import { c as
|
|
9
|
-
import { o as Rt, P as
|
|
5
|
+
import { g as Wt, P as r, e as It, a as Ht } from "../../assets/createTheme.js";
|
|
6
|
+
import { g as Vt, a as Ft, s as ot, u as Ut, m as ut, c as xt } from "../../assets/DefaultPropsProvider.js";
|
|
7
|
+
import { u as zt } from "../../assets/index.js";
|
|
8
|
+
import { c as go, r as qt, d as Tt, u as yo, a as Xe, f as Pt, b as Ge, h as bo, i as Et } from "../../assets/ButtonBase.js";
|
|
9
|
+
import { o as Rt, P as wo, H as _e, g as Oo, e as xo } from "../../assets/Portal.js";
|
|
10
10
|
import { u as pt } from "../../assets/resolveComponentProps.js";
|
|
11
|
-
import { u as
|
|
12
|
-
import { a as
|
|
11
|
+
import { u as To } from "../../assets/useSlotProps.js";
|
|
12
|
+
import { a as Po, u as Eo } from "../../assets/dividerClasses.js";
|
|
13
|
+
import { G as Ro } from "../../assets/Grow.js";
|
|
13
14
|
import { I as At } from "../../assets/IconButton.js";
|
|
14
15
|
import { c as Yt } from "../../assets/createSvgIcon.js";
|
|
15
16
|
import { D as Ao } from "../../assets/Divider.js";
|
|
@@ -917,9 +918,9 @@ var Sr = [tr, br, _o, Fo, gr, ur, xr, Ko, mr], $r = /* @__PURE__ */ Dr({
|
|
|
917
918
|
defaultModifiers: Sr
|
|
918
919
|
});
|
|
919
920
|
function Lr(t) {
|
|
920
|
-
return
|
|
921
|
+
return Wt("MuiPopper", t);
|
|
921
922
|
}
|
|
922
|
-
|
|
923
|
+
Vt("MuiPopper", ["root"]);
|
|
923
924
|
function kr(t, e) {
|
|
924
925
|
if (e === "ltr")
|
|
925
926
|
return t;
|
|
@@ -949,7 +950,7 @@ const Nr = (t) => {
|
|
|
949
950
|
const {
|
|
950
951
|
classes: e
|
|
951
952
|
} = t;
|
|
952
|
-
return
|
|
953
|
+
return Ft({
|
|
953
954
|
root: ["root"]
|
|
954
955
|
}, Lr, e);
|
|
955
956
|
}, Wr = {}, Ir = /* @__PURE__ */ M.forwardRef(function(e, o) {
|
|
@@ -1024,7 +1025,7 @@ const Nr = (t) => {
|
|
|
1024
1025
|
placement: R
|
|
1025
1026
|
};
|
|
1026
1027
|
T !== null && (C.TransitionProps = T);
|
|
1027
|
-
const W = Nr(e), j = u.root ?? "div", G =
|
|
1028
|
+
const W = Nr(e), j = u.root ?? "div", G = To({
|
|
1028
1029
|
elementType: j,
|
|
1029
1030
|
externalSlotProps: x.root,
|
|
1030
1031
|
externalForwardedProps: h,
|
|
@@ -1076,7 +1077,7 @@ const Nr = (t) => {
|
|
|
1076
1077
|
onEnter: y,
|
|
1077
1078
|
onExited: b
|
|
1078
1079
|
} : void 0;
|
|
1079
|
-
return /* @__PURE__ */ k(
|
|
1080
|
+
return /* @__PURE__ */ k(wo, {
|
|
1080
1081
|
disablePortal: i,
|
|
1081
1082
|
container: R,
|
|
1082
1083
|
children: /* @__PURE__ */ k(Ir, {
|
|
@@ -1117,7 +1118,7 @@ process.env.NODE_ENV !== "production" && (oo.propTypes = {
|
|
|
1117
1118
|
* It's used to set the position of the popper.
|
|
1118
1119
|
* The return value will passed as the reference object of the Popper instance.
|
|
1119
1120
|
*/
|
|
1120
|
-
anchorEl:
|
|
1121
|
+
anchorEl: go(r.oneOfType([_e, r.object, r.func]), (t) => {
|
|
1121
1122
|
if (t.open) {
|
|
1122
1123
|
const e = tt(t.anchorEl);
|
|
1123
1124
|
if (e && nt(e) && e.nodeType === 1) {
|
|
@@ -1232,7 +1233,7 @@ const Hr = ot(oo, {
|
|
|
1232
1233
|
slot: "Root",
|
|
1233
1234
|
overridesResolver: (t, e) => e.root
|
|
1234
1235
|
})({}), wt = /* @__PURE__ */ M.forwardRef(function(e, o) {
|
|
1235
|
-
const n = zt(), a =
|
|
1236
|
+
const n = zt(), a = Ut({
|
|
1236
1237
|
props: e,
|
|
1237
1238
|
name: "MuiPopper"
|
|
1238
1239
|
}), {
|
|
@@ -1408,9 +1409,9 @@ process.env.NODE_ENV !== "production" && (wt.propTypes = {
|
|
|
1408
1409
|
transition: r.bool
|
|
1409
1410
|
});
|
|
1410
1411
|
function Vr(t) {
|
|
1411
|
-
return
|
|
1412
|
+
return Wt("MuiTooltip", t);
|
|
1412
1413
|
}
|
|
1413
|
-
const L =
|
|
1414
|
+
const L = Vt("MuiTooltip", ["popper", "popperInteractive", "popperArrow", "popperClose", "tooltip", "tooltipArrow", "touch", "tooltipPlacementLeft", "tooltipPlacementRight", "tooltipPlacementTop", "tooltipPlacementBottom", "arrow"]);
|
|
1414
1415
|
function Fr(t) {
|
|
1415
1416
|
return Math.round(t * 1e5) / 1e5;
|
|
1416
1417
|
}
|
|
@@ -1423,10 +1424,10 @@ const Ur = (t) => {
|
|
|
1423
1424
|
placement: s
|
|
1424
1425
|
} = t, c = {
|
|
1425
1426
|
popper: ["popper", !o && "popperInteractive", n && "popperArrow"],
|
|
1426
|
-
tooltip: ["tooltip", n && "tooltipArrow", a && "touch", `tooltipPlacement${
|
|
1427
|
+
tooltip: ["tooltip", n && "tooltipArrow", a && "touch", `tooltipPlacement${It(s.split("-")[0])}`],
|
|
1427
1428
|
arrow: ["arrow"]
|
|
1428
1429
|
};
|
|
1429
|
-
return
|
|
1430
|
+
return Ft(c, Vr, e);
|
|
1430
1431
|
}, zr = ot(wt, {
|
|
1431
1432
|
name: "MuiTooltip",
|
|
1432
1433
|
slot: "Popper",
|
|
@@ -1537,12 +1538,12 @@ const Ur = (t) => {
|
|
|
1537
1538
|
const {
|
|
1538
1539
|
ownerState: o
|
|
1539
1540
|
} = t;
|
|
1540
|
-
return [e.tooltip, o.touch && e.touch, o.arrow && e.tooltipArrow, e[`tooltipPlacement${
|
|
1541
|
+
return [e.tooltip, o.touch && e.touch, o.arrow && e.tooltipArrow, e[`tooltipPlacement${It(o.placement.split("-")[0])}`]];
|
|
1541
1542
|
}
|
|
1542
1543
|
})(ut(({
|
|
1543
1544
|
theme: t
|
|
1544
1545
|
}) => ({
|
|
1545
|
-
backgroundColor: t.vars ? t.vars.palette.Tooltip.bg :
|
|
1546
|
+
backgroundColor: t.vars ? t.vars.palette.Tooltip.bg : Ht(t.palette.grey[700], 0.92),
|
|
1546
1547
|
borderRadius: (t.vars || t).shape.borderRadius,
|
|
1547
1548
|
color: (t.vars || t).palette.common.white,
|
|
1548
1549
|
fontFamily: t.typography.fontFamily,
|
|
@@ -1663,7 +1664,7 @@ const Ur = (t) => {
|
|
|
1663
1664
|
width: "1em",
|
|
1664
1665
|
height: "0.71em",
|
|
1665
1666
|
boxSizing: "border-box",
|
|
1666
|
-
color: t.vars ? t.vars.palette.Tooltip.bg :
|
|
1667
|
+
color: t.vars ? t.vars.palette.Tooltip.bg : Ht(t.palette.grey[700], 0.9),
|
|
1667
1668
|
"&::before": {
|
|
1668
1669
|
content: '""',
|
|
1669
1670
|
margin: "auto",
|
|
@@ -1675,7 +1676,7 @@ const Ur = (t) => {
|
|
|
1675
1676
|
}
|
|
1676
1677
|
})));
|
|
1677
1678
|
let Je = !1;
|
|
1678
|
-
const Nt = new
|
|
1679
|
+
const Nt = new bo();
|
|
1679
1680
|
let ke = {
|
|
1680
1681
|
x: 0,
|
|
1681
1682
|
y: 0
|
|
@@ -1686,7 +1687,7 @@ function Qe(t, e) {
|
|
|
1686
1687
|
};
|
|
1687
1688
|
}
|
|
1688
1689
|
const ft = /* @__PURE__ */ M.forwardRef(function(e, o) {
|
|
1689
|
-
const n =
|
|
1690
|
+
const n = Ut({
|
|
1690
1691
|
props: e,
|
|
1691
1692
|
name: "MuiTooltip"
|
|
1692
1693
|
}), {
|
|
@@ -1721,7 +1722,7 @@ const ft = /* @__PURE__ */ M.forwardRef(function(e, o) {
|
|
|
1721
1722
|
...$
|
|
1722
1723
|
} = n, D = /* @__PURE__ */ M.isValidElement(s) ? s : /* @__PURE__ */ k("span", {
|
|
1723
1724
|
children: s
|
|
1724
|
-
}), N = yo(), re = zt(), [B, ve] = M.useState(), [ne, he] = M.useState(null), J = M.useRef(!1), F = x || w, ie = Xe(), se = Xe(), U = Xe(), ge = Xe(), [at, ye] =
|
|
1725
|
+
}), N = yo(), re = zt(), [B, ve] = M.useState(), [ne, he] = M.useState(null), J = M.useRef(!1), F = x || w, ie = Xe(), se = Xe(), U = Xe(), ge = Xe(), [at, ye] = Po({
|
|
1725
1726
|
controlled: R,
|
|
1726
1727
|
default: !1,
|
|
1727
1728
|
name: "Tooltip",
|
|
@@ -1737,7 +1738,7 @@ const ft = /* @__PURE__ */ M.forwardRef(function(e, o) {
|
|
|
1737
1738
|
`));
|
|
1738
1739
|
}, [j, B, v]);
|
|
1739
1740
|
}
|
|
1740
|
-
const be =
|
|
1741
|
+
const be = Eo(E), le = M.useRef(), we = Pt(() => {
|
|
1741
1742
|
le.current !== void 0 && (document.body.style.WebkitUserSelect = le.current, le.current = void 0), ge.clear();
|
|
1742
1743
|
});
|
|
1743
1744
|
M.useEffect(() => we, [we]);
|
|
@@ -1789,7 +1790,7 @@ const ft = /* @__PURE__ */ M.forwardRef(function(e, o) {
|
|
|
1789
1790
|
document.removeEventListener("keydown", v);
|
|
1790
1791
|
};
|
|
1791
1792
|
}, [ce, Q]);
|
|
1792
|
-
const ze = pt(
|
|
1793
|
+
const ze = pt(Oo(D), ve, o);
|
|
1793
1794
|
!j && j !== 0 && (Q = !1);
|
|
1794
1795
|
const xe = M.useRef(), qe = (v) => {
|
|
1795
1796
|
const _ = D.props;
|
|
@@ -1867,7 +1868,7 @@ const ft = /* @__PURE__ */ M.forwardRef(function(e, o) {
|
|
|
1867
1868
|
ownerState: ue,
|
|
1868
1869
|
className: xt(st.popper, P == null ? void 0 : P.className)
|
|
1869
1870
|
}), [so, po] = Ge("transition", {
|
|
1870
|
-
elementType:
|
|
1871
|
+
elementType: Ro,
|
|
1871
1872
|
externalForwardedProps: Ye,
|
|
1872
1873
|
ownerState: ue
|
|
1873
1874
|
}), [lo, co] = Ge("tooltip", {
|
|
@@ -1932,7 +1933,7 @@ process.env.NODE_ENV !== "production" && (ft.propTypes = {
|
|
|
1932
1933
|
/**
|
|
1933
1934
|
* Tooltip reference element.
|
|
1934
1935
|
*/
|
|
1935
|
-
children:
|
|
1936
|
+
children: xo.isRequired,
|
|
1936
1937
|
/**
|
|
1937
1938
|
* Override or extend the styles applied to the component.
|
|
1938
1939
|
*/
|
|
@@ -2110,7 +2111,7 @@ const Xr = Yt(/* @__PURE__ */ k("path", {
|
|
|
2110
2111
|
d: "m18 7-1.41-1.41-6.34 6.34 1.41 1.41zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12zM.41 13.41 6 19l1.41-1.41L1.83 12z"
|
|
2111
2112
|
}), "DoneAll"), Gr = Yt(/* @__PURE__ */ k("path", {
|
|
2112
2113
|
d: "M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"
|
|
2113
|
-
}), "Settings"),
|
|
2114
|
+
}), "Settings"), fn = (t) => {
|
|
2114
2115
|
const e = t.title ?? /* @__PURE__ */ k(vo, { variant: "body1", children: "Notifications" });
|
|
2115
2116
|
return /* @__PURE__ */ Be(mo, { children: [
|
|
2116
2117
|
/* @__PURE__ */ Be(
|
|
@@ -2144,5 +2145,5 @@ const Xr = Yt(/* @__PURE__ */ k("path", {
|
|
|
2144
2145
|
] });
|
|
2145
2146
|
};
|
|
2146
2147
|
export {
|
|
2147
|
-
|
|
2148
|
+
fn as InboxHeader
|
|
2148
2149
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import { N as
|
|
2
|
+
import { N as c } from "../../assets/Notification.js";
|
|
3
3
|
import "../../assets/DefaultPropsProvider.js";
|
|
4
|
+
import "../../utils/theme.js";
|
|
5
|
+
import "../../assets/ButtonBase.js";
|
|
4
6
|
import "../../assets/Typography.js";
|
|
5
7
|
import "../../assets/IconButton.js";
|
|
6
8
|
import "../../assets/Badge.js";
|
|
7
9
|
export {
|
|
8
|
-
|
|
10
|
+
c as Notification
|
|
9
11
|
};
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Inbox as
|
|
4
|
-
import { NotificationAPIContext as
|
|
5
|
-
import { NotificationPreferencesPopup as
|
|
6
|
-
import { Filter as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
1
|
+
import { jsx as n, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useContext as u, useEffect as p } from "react";
|
|
3
|
+
import { Inbox as x } from "./Inbox.js";
|
|
4
|
+
import { NotificationAPIContext as b } from "../Provider/context.js";
|
|
5
|
+
import { NotificationPreferencesPopup as S } from "../Preferences/NotificationPreferencesPopup.js";
|
|
6
|
+
import { Filter as C } from "./interface.js";
|
|
7
|
+
import { getThemeColors as I } from "../../utils/theme.js";
|
|
8
|
+
import { W as H } from "../../assets/WebPushOptInMessage.js";
|
|
9
|
+
import { c as P } from "../../assets/createSvgIcon.js";
|
|
10
|
+
import { u as y } from "../../assets/ButtonBase.js";
|
|
11
|
+
import { D as v } from "../../assets/Divider.js";
|
|
12
|
+
const M = P(/* @__PURE__ */ n("path", {
|
|
11
13
|
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"),
|
|
13
|
-
var a,
|
|
14
|
-
const [
|
|
15
|
-
if (
|
|
14
|
+
}), "Language"), R = (e) => {
|
|
15
|
+
var a, c, s, l;
|
|
16
|
+
const [m, o] = h(!1), i = u(b), g = y(), r = I(g);
|
|
17
|
+
if (p(() => {
|
|
16
18
|
if (!i) return;
|
|
17
19
|
i.markAsOpened();
|
|
18
|
-
const
|
|
20
|
+
const d = setInterval(() => {
|
|
19
21
|
i.markAsOpened();
|
|
20
22
|
}, 5e3);
|
|
21
|
-
return () => clearInterval(
|
|
23
|
+
return () => clearInterval(d);
|
|
22
24
|
}, [i]), !i)
|
|
23
25
|
return null;
|
|
24
26
|
const t = {
|
|
@@ -26,33 +28,34 @@ const H = C(/* @__PURE__ */ n("path", {
|
|
|
26
28
|
pageSize: e.pageSize || 5,
|
|
27
29
|
pagePosition: e.pagePosition || "top",
|
|
28
30
|
style: e.style || {},
|
|
29
|
-
filter: e.filter ||
|
|
31
|
+
filter: e.filter || C.ALL,
|
|
30
32
|
infiniteScrollHeight: e.infiniteScrollHeight ? e.infiniteScrollHeight : window.innerHeight * 0.75,
|
|
31
33
|
renderers: {
|
|
32
34
|
notification: (a = e.renderers) == null ? void 0 : a.notification
|
|
33
35
|
},
|
|
34
36
|
header: {
|
|
35
|
-
title: (
|
|
36
|
-
button1ClickHandler: ((
|
|
37
|
-
button2ClickHandler: ((l = e.header) == null ? void 0 : l.button2ClickHandler) ?? (() =>
|
|
37
|
+
title: (c = e.header) == null ? void 0 : c.title,
|
|
38
|
+
button1ClickHandler: ((s = e.header) == null ? void 0 : s.button1ClickHandler) ?? i.markAsArchived,
|
|
39
|
+
button2ClickHandler: ((l = e.header) == null ? void 0 : l.button2ClickHandler) ?? (() => o(!0))
|
|
38
40
|
},
|
|
39
41
|
imageShape: e.imageShape || "circle",
|
|
40
42
|
newTab: e.newTab ?? !1
|
|
41
43
|
};
|
|
42
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ f(
|
|
43
45
|
"div",
|
|
44
46
|
{
|
|
45
47
|
style: {
|
|
46
48
|
padding: "0 12px",
|
|
47
49
|
boxSizing: "border-box",
|
|
48
50
|
borderRadius: 8,
|
|
49
|
-
background:
|
|
50
|
-
border:
|
|
51
|
+
background: r.paper,
|
|
52
|
+
border: `1px solid ${r.border}`,
|
|
53
|
+
color: r.text,
|
|
51
54
|
...e.style
|
|
52
55
|
},
|
|
53
56
|
children: [
|
|
54
57
|
/* @__PURE__ */ n(
|
|
55
|
-
|
|
58
|
+
x,
|
|
56
59
|
{
|
|
57
60
|
maxHeight: t.infiniteScrollHeight,
|
|
58
61
|
pagination: t.pagination,
|
|
@@ -65,13 +68,18 @@ const H = C(/* @__PURE__ */ n("path", {
|
|
|
65
68
|
newTab: t.newTab
|
|
66
69
|
}
|
|
67
70
|
),
|
|
68
|
-
i.webPushOptInMessage && localStorage.getItem("hideWebPushOptInMessage") !== "true" && /* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */ n(I, { style: { margin: "10px 0" } }),
|
|
71
|
+
i.webPushOptInMessage && localStorage.getItem("hideWebPushOptInMessage") !== "true" && /* @__PURE__ */ f("div", { children: [
|
|
70
72
|
/* @__PURE__ */ n(
|
|
71
|
-
|
|
73
|
+
v,
|
|
74
|
+
{
|
|
75
|
+
style: { margin: "10px 0", borderColor: r.divider }
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ n(
|
|
79
|
+
H,
|
|
72
80
|
{
|
|
73
81
|
hideAfterInteraction: !0,
|
|
74
|
-
icon: /* @__PURE__ */ n(
|
|
82
|
+
icon: /* @__PURE__ */ n(M, { type: "text", style: { marginLeft: "9px" } }),
|
|
75
83
|
descriptionStyle: {
|
|
76
84
|
flexDirection: "column",
|
|
77
85
|
// Stack the elements vertically
|
|
@@ -93,10 +101,10 @@ const H = C(/* @__PURE__ */ n("path", {
|
|
|
93
101
|
)
|
|
94
102
|
] }),
|
|
95
103
|
/* @__PURE__ */ n(
|
|
96
|
-
|
|
104
|
+
S,
|
|
97
105
|
{
|
|
98
|
-
open:
|
|
99
|
-
onClose: () =>
|
|
106
|
+
open: m,
|
|
107
|
+
onClose: () => o(!1)
|
|
100
108
|
}
|
|
101
109
|
)
|
|
102
110
|
]
|
|
@@ -104,5 +112,5 @@ const H = C(/* @__PURE__ */ n("path", {
|
|
|
104
112
|
);
|
|
105
113
|
};
|
|
106
114
|
export {
|
|
107
|
-
|
|
115
|
+
R as NotificationFeed
|
|
108
116
|
};
|
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Inbox as
|
|
4
|
-
import { UnreadBadge as
|
|
5
|
-
import { NotificationAPIContext as
|
|
6
|
-
import { NotificationPreferencesPopup as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsx as o, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as c, useContext as y } from "react";
|
|
3
|
+
import { Inbox as z } from "./Inbox.js";
|
|
4
|
+
import { UnreadBadge as T } from "./UnreadBadge.js";
|
|
5
|
+
import { NotificationAPIContext as N } from "../Provider/context.js";
|
|
6
|
+
import { NotificationPreferencesPopup as k } from "../Preferences/NotificationPreferencesPopup.js";
|
|
7
|
+
import { getThemeColors as v } from "../../utils/theme.js";
|
|
8
|
+
import { W as H, L as A } from "../../assets/WebPushOptInMessage.js";
|
|
9
|
+
import { u as L } from "../../assets/ButtonBase.js";
|
|
10
|
+
import { N as w } from "../../assets/channelUtils.js";
|
|
11
|
+
import { I as W } from "../../assets/IconButton.js";
|
|
12
|
+
import { P as B } from "../../assets/Popover.js";
|
|
13
|
+
import { D as E } from "../../assets/Divider.js";
|
|
14
|
+
const K = (e) => {
|
|
15
|
+
var f, u, h, p, g, m, b, I;
|
|
16
|
+
const [x, d] = c(!1), [r, s] = c(!1), i = y(N), [C, P] = c(null), O = L(), n = v(O);
|
|
17
|
+
if (!i)
|
|
16
18
|
return null;
|
|
17
19
|
const t = {
|
|
18
20
|
buttonIcon: e.buttonIcon || /* @__PURE__ */ o(
|
|
19
|
-
|
|
21
|
+
w,
|
|
20
22
|
{
|
|
21
23
|
style: {
|
|
22
24
|
fontSize: e.buttonIconSize || 20,
|
|
23
|
-
color: e.iconColor ||
|
|
25
|
+
color: e.iconColor || n.icon
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
),
|
|
@@ -32,7 +34,7 @@ const j = (e) => {
|
|
|
32
34
|
popupWidth: e.popupWidth || 400,
|
|
33
35
|
popupHeight: e.popupHeight || 600,
|
|
34
36
|
buttonIconSize: e.buttonIconSize || 20,
|
|
35
|
-
iconColor: e.iconColor ||
|
|
37
|
+
iconColor: e.iconColor || n.icon,
|
|
36
38
|
pagination: e.pagination || "INFINITE_SCROLL",
|
|
37
39
|
pageSize: e.pageSize || 10,
|
|
38
40
|
pagePosition: e.pagePosition || "top",
|
|
@@ -44,24 +46,24 @@ const j = (e) => {
|
|
|
44
46
|
count: e.count || "COUNT_UNOPENED_NOTIFICATIONS",
|
|
45
47
|
filter: e.filter || "ALL",
|
|
46
48
|
header: {
|
|
47
|
-
title: (
|
|
48
|
-
button1ClickHandler: ((
|
|
49
|
-
button2ClickHandler: ((
|
|
49
|
+
title: (f = e.header) == null ? void 0 : f.title,
|
|
50
|
+
button1ClickHandler: ((u = e.header) == null ? void 0 : u.button1ClickHandler) ?? i.markAsArchived,
|
|
51
|
+
button2ClickHandler: ((h = e.header) == null ? void 0 : h.button2ClickHandler) ?? (() => d(!0))
|
|
50
52
|
},
|
|
51
53
|
renderers: {
|
|
52
|
-
notification: (
|
|
54
|
+
notification: (p = e.renderers) == null ? void 0 : p.notification
|
|
53
55
|
},
|
|
54
56
|
popoverPosition: {
|
|
55
57
|
anchorOrigin: {
|
|
56
58
|
vertical: ((m = (g = e.popoverPosition) == null ? void 0 : g.anchorOrigin) == null ? void 0 : m.vertical) ?? "top",
|
|
57
|
-
horizontal: ((
|
|
59
|
+
horizontal: ((I = (b = e.popoverPosition) == null ? void 0 : b.anchorOrigin) == null ? void 0 : I.horizontal) ?? "left"
|
|
58
60
|
}
|
|
59
61
|
},
|
|
60
62
|
newTab: e.newTab ?? !1
|
|
61
|
-
},
|
|
62
|
-
s(!
|
|
63
|
+
}, S = (a) => {
|
|
64
|
+
s(!r), P(a == null ? void 0 : a.currentTarget), r && i.markAsOpened();
|
|
63
65
|
};
|
|
64
|
-
return /* @__PURE__ */
|
|
66
|
+
return /* @__PURE__ */ l(
|
|
65
67
|
"div",
|
|
66
68
|
{
|
|
67
69
|
style: {
|
|
@@ -77,14 +79,14 @@ const j = (e) => {
|
|
|
77
79
|
style: {
|
|
78
80
|
display: "inline-block"
|
|
79
81
|
},
|
|
80
|
-
children: /* @__PURE__ */ o(
|
|
82
|
+
children: /* @__PURE__ */ o(T, { ...e.unreadBadgeProps, count: t.count, children: /* @__PURE__ */ o(W, { style: t.buttonStyles, onClick: S, children: t.buttonIcon }) })
|
|
81
83
|
}
|
|
82
84
|
),
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
85
|
+
/* @__PURE__ */ o(
|
|
86
|
+
B,
|
|
85
87
|
{
|
|
86
|
-
open:
|
|
87
|
-
anchorEl:
|
|
88
|
+
open: r,
|
|
89
|
+
anchorEl: C,
|
|
88
90
|
anchorReference: "anchorEl",
|
|
89
91
|
anchorOrigin: {
|
|
90
92
|
horizontal: "center",
|
|
@@ -98,45 +100,69 @@ const j = (e) => {
|
|
|
98
100
|
slotProps: {
|
|
99
101
|
paper: {
|
|
100
102
|
style: {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
borderRadius: 8,
|
|
104
|
+
backgroundColor: n.paper,
|
|
105
|
+
color: n.text
|
|
104
106
|
}
|
|
105
107
|
}
|
|
106
108
|
},
|
|
107
|
-
children:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
{
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
109
|
+
children: /* @__PURE__ */ l(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
style: {
|
|
113
|
+
width: t.popupWidth,
|
|
114
|
+
padding: "0 16px",
|
|
115
|
+
zIndex: t.popupZIndex,
|
|
116
|
+
height: t.popupHeight,
|
|
117
|
+
backgroundColor: n.paper,
|
|
118
|
+
color: n.text
|
|
119
|
+
},
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ o(
|
|
122
|
+
z,
|
|
123
|
+
{
|
|
124
|
+
maxHeight: t.popupHeight - 73,
|
|
125
|
+
pagination: t.pagination,
|
|
126
|
+
filter: t.filter,
|
|
127
|
+
pageSize: t.pageSize,
|
|
128
|
+
pagePosition: t.pagePosition,
|
|
129
|
+
notificationRenderer: t.renderers.notification,
|
|
130
|
+
header: t.header,
|
|
131
|
+
newTab: t.newTab
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
i.webPushOptInMessage && localStorage.getItem("hideWebPushOptInMessage") !== "true" && /* @__PURE__ */ l("div", { children: [
|
|
135
|
+
/* @__PURE__ */ o(
|
|
136
|
+
E,
|
|
137
|
+
{
|
|
138
|
+
style: { margin: "10px 0", borderColor: n.divider }
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
/* @__PURE__ */ o(
|
|
142
|
+
H,
|
|
143
|
+
{
|
|
144
|
+
hideAfterInteraction: !0,
|
|
145
|
+
icon: /* @__PURE__ */ o(
|
|
146
|
+
A,
|
|
147
|
+
{
|
|
148
|
+
type: "text",
|
|
149
|
+
style: { marginLeft: "9px" }
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
alertContainerStyle: { maxWidth: "345px" }
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
] })
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
)
|
|
133
159
|
}
|
|
134
160
|
),
|
|
135
161
|
/* @__PURE__ */ o(
|
|
136
|
-
|
|
162
|
+
k,
|
|
137
163
|
{
|
|
138
|
-
open:
|
|
139
|
-
onClose: () =>
|
|
164
|
+
open: x,
|
|
165
|
+
onClose: () => d(!1)
|
|
140
166
|
}
|
|
141
167
|
)
|
|
142
168
|
]
|
|
@@ -144,5 +170,5 @@ const j = (e) => {
|
|
|
144
170
|
);
|
|
145
171
|
};
|
|
146
172
|
export {
|
|
147
|
-
|
|
173
|
+
K as NotificationLauncher
|
|
148
174
|
};
|