@notificationapi/react 1.1.3 → 1.2.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.
@@ -2,12 +2,12 @@ import { jsx as d, jsxs as P, Fragment as ie } from "react/jsx-runtime";
2
2
  import { g as Oe, a as xe } from "./channelUtils.js";
3
3
  import { e as Te, T as _ } from "./Typography.js";
4
4
  import * as m from "react";
5
- import { y as Pe, w as $e, P as o, j as Ne, z as le, A as Q, B as Fe, D as Be, E as je, c as I, f as M, a as D, F as ce, g as G, s as v, v as oe, h as w, m as z, u as A, b as W, t as Ie, r as ze } from "./DefaultPropsProvider.js";
5
+ import { y as Pe, w as $e, P as o, j as Ne, z as le, A as Q, B as Fe, D as Be, E as je, c as I, f as M, a as D, F as ce, g as L, s as v, v as oe, h as w, m as z, u as A, b as W, t as Ie, r as ze } from "./DefaultPropsProvider.js";
6
6
  import { c as Y } from "./createSimplePaletteValueFilter.js";
7
7
  import { B as Ee, r as H, u as Me } from "./ButtonBase.js";
8
8
  import { u as he, a as De, D as Ve } from "./Divider.js";
9
- import { u as Ge } from "./resolveComponentProps.js";
10
- import { u as Le } from "./useTheme2.js";
9
+ import { u as Le } from "./resolveComponentProps.js";
10
+ import { u as Ge } from "./useTheme2.js";
11
11
  import { c as be } from "./createSvgIcon.js";
12
12
  const qe = Pe();
13
13
  function Ue(e) {
@@ -24,7 +24,7 @@ function _e({
24
24
  defaultTheme: r,
25
25
  themeId: n
26
26
  }) {
27
- let s = Le(r);
27
+ let s = Ge(r);
28
28
  return n && (s = s[n] || s), Ue({
29
29
  theme: s,
30
30
  name: t,
@@ -49,18 +49,18 @@ function Xe(e) {
49
49
  defaultTheme: We
50
50
  });
51
51
  }
52
- function Ze(e, t) {
52
+ function Ke(e, t) {
53
53
  const r = m.Children.toArray(e).filter(Boolean);
54
54
  return r.reduce((n, s, i) => (n.push(s), i < r.length - 1 && n.push(/* @__PURE__ */ m.cloneElement(t, {
55
55
  key: `separator-${i}`
56
56
  })), n), []);
57
57
  }
58
- const Je = (e) => ({
58
+ const Ze = (e) => ({
59
59
  row: "Left",
60
60
  "row-reverse": "Right",
61
61
  column: "Top",
62
62
  "column-reverse": "Bottom"
63
- })[e], Ke = ({
63
+ })[e], Je = ({
64
64
  ownerState: e,
65
65
  theme: t
66
66
  }) => {
@@ -100,7 +100,7 @@ const Je = (e) => ({
100
100
  margin: 0
101
101
  },
102
102
  "& > :not(style) ~ :not(style)": {
103
- [`margin${Je(l ? i[l] : e.direction)}`]: ce(n, c)
103
+ [`margin${Ze(l ? i[l] : e.direction)}`]: ce(n, c)
104
104
  }
105
105
  }));
106
106
  }
@@ -114,7 +114,7 @@ function Qe(e = {}) {
114
114
  componentName: n = "MuiStack"
115
115
  } = e, s = () => M({
116
116
  root: ["root"]
117
- }, (c) => D(n, c), {}), i = t(Ke), p = /* @__PURE__ */ m.forwardRef(function(c, l) {
117
+ }, (c) => D(n, c), {}), i = t(Je), p = /* @__PURE__ */ m.forwardRef(function(c, l) {
118
118
  const u = r(c), a = Te(u), {
119
119
  component: h = "div",
120
120
  direction: C = "column",
@@ -135,7 +135,7 @@ function Qe(e = {}) {
135
135
  ref: l,
136
136
  className: I(B.root, x),
137
137
  ...T,
138
- children: O ? Ze(y, O) : y
138
+ children: O ? Ke(y, O) : y
139
139
  });
140
140
  });
141
141
  return process.env.NODE_ENV !== "production" && (p.propTypes = {
@@ -161,7 +161,7 @@ function X() {
161
161
  function Ye(e) {
162
162
  return D("PrivateSwitchBase", e);
163
163
  }
164
- G("PrivateSwitchBase", ["root", "checked", "disabled", "input", "edgeStart", "edgeEnd"]);
164
+ L("PrivateSwitchBase", ["root", "checked", "disabled", "input", "edgeStart", "edgeEnd"]);
165
165
  const eo = (e) => {
166
166
  const {
167
167
  classes: t,
@@ -244,14 +244,14 @@ const eo = (e) => {
244
244
  required: S = !1,
245
245
  tabIndex: B,
246
246
  type: R,
247
- value: L,
248
- ...Z
247
+ value: G,
248
+ ...K
249
249
  } = t, [E, q] = he({
250
250
  controlled: s,
251
251
  default: !!f,
252
252
  name: "SwitchBase",
253
253
  state: "checked"
254
- }), $ = X(), J = (F) => {
254
+ }), $ = X(), Z = (F) => {
255
255
  b && b(F), $ && $.onFocus && $.onFocus(F);
256
256
  }, V = (F) => {
257
257
  y && y(F), $ && $.onBlur && $.onBlur(F);
@@ -263,13 +263,13 @@ const eo = (e) => {
263
263
  };
264
264
  let N = c;
265
265
  $ && typeof N > "u" && (N = $.disabled);
266
- const Re = R === "checkbox" || R === "radio", K = {
266
+ const Re = R === "checkbox" || R === "radio", J = {
267
267
  ...t,
268
268
  checked: E,
269
269
  disabled: N,
270
270
  disableFocusRipple: l,
271
271
  edge: u
272
- }, se = eo(K);
272
+ }, se = eo(J);
273
273
  return /* @__PURE__ */ P(oo, {
274
274
  component: "span",
275
275
  className: I(se.root, p),
@@ -278,11 +278,11 @@ const eo = (e) => {
278
278
  disabled: N,
279
279
  tabIndex: null,
280
280
  role: void 0,
281
- onFocus: J,
281
+ onFocus: Z,
282
282
  onBlur: V,
283
- ownerState: K,
283
+ ownerState: J,
284
284
  ref: r,
285
- ...Z,
285
+ ...K,
286
286
  children: [/* @__PURE__ */ d(to, {
287
287
  autoFocus: n,
288
288
  checked: s,
@@ -295,11 +295,11 @@ const eo = (e) => {
295
295
  readOnly: T,
296
296
  ref: k,
297
297
  required: S,
298
- ownerState: K,
298
+ ownerState: J,
299
299
  tabIndex: B,
300
300
  type: R,
301
- ...R === "checkbox" && L === void 0 ? {} : {
302
- value: L
301
+ ...R === "checkbox" && G === void 0 ? {} : {
302
+ value: G
303
303
  },
304
304
  ...C
305
305
  }), E ? i : a]
@@ -411,7 +411,7 @@ process.env.NODE_ENV !== "production" && (te.propTypes = {
411
411
  function ro(e) {
412
412
  return D("MuiFormControlLabel", e);
413
413
  }
414
- const U = G("MuiFormControlLabel", ["root", "labelPlacementStart", "labelPlacementTop", "labelPlacementBottom", "disabled", "label", "error", "required", "asterisk"]), no = (e) => {
414
+ const U = L("MuiFormControlLabel", ["root", "labelPlacementStart", "labelPlacementTop", "labelPlacementBottom", "disabled", "label", "error", "required", "asterisk"]), no = (e) => {
415
415
  const {
416
416
  classes: t,
417
417
  disabled: r,
@@ -517,14 +517,14 @@ const U = G("MuiFormControlLabel", ["root", "labelPlacementStart", "labelPlaceme
517
517
  slotProps: x = {},
518
518
  value: b,
519
519
  ...T
520
- } = n, S = X(), B = c ?? f.props.disabled ?? (S == null ? void 0 : S.disabled), R = O ?? f.props.required, L = {
520
+ } = n, S = X(), B = c ?? f.props.disabled ?? (S == null ? void 0 : S.disabled), R = O ?? f.props.required, G = {
521
521
  disabled: B,
522
522
  required: R
523
523
  };
524
524
  ["checked", "name", "onChange", "value", "inputRef"].forEach((N) => {
525
- typeof f.props[N] > "u" && typeof n[N] < "u" && (L[N] = n[N]);
525
+ typeof f.props[N] > "u" && typeof n[N] < "u" && (G[N] = n[N]);
526
526
  });
527
- const Z = ye({
527
+ const K = ye({
528
528
  props: n,
529
529
  muiFormControl: S,
530
530
  states: ["error"]
@@ -533,20 +533,20 @@ const U = G("MuiFormControlLabel", ["root", "labelPlacementStart", "labelPlaceme
533
533
  disabled: B,
534
534
  labelPlacement: h,
535
535
  required: R,
536
- error: Z.error
536
+ error: K.error
537
537
  }, q = no(E), $ = {
538
538
  slots: y,
539
539
  slotProps: {
540
540
  ...p,
541
541
  ...x
542
542
  }
543
- }, [J, V] = Me("typography", {
543
+ }, [Z, V] = Me("typography", {
544
544
  elementType: _,
545
545
  externalForwardedProps: $,
546
546
  ownerState: E
547
547
  });
548
548
  let j = a;
549
- return j != null && j.type !== _ && !l && (j = /* @__PURE__ */ d(J, {
549
+ return j != null && j.type !== _ && !l && (j = /* @__PURE__ */ d(Z, {
550
550
  component: "span",
551
551
  ...V,
552
552
  className: I(q.label, V == null ? void 0 : V.className),
@@ -556,7 +556,7 @@ const U = G("MuiFormControlLabel", ["root", "labelPlacementStart", "labelPlaceme
556
556
  ownerState: E,
557
557
  ref: r,
558
558
  ...T,
559
- children: [/* @__PURE__ */ m.cloneElement(f, L), R ? /* @__PURE__ */ P("div", {
559
+ children: [/* @__PURE__ */ m.cloneElement(f, G), R ? /* @__PURE__ */ P("div", {
560
560
  children: [j, /* @__PURE__ */ P(ao, {
561
561
  ownerState: E,
562
562
  "aria-hidden": !0,
@@ -657,7 +657,7 @@ process.env.NODE_ENV !== "production" && (ve.propTypes = {
657
657
  function io(e) {
658
658
  return D("MuiFormGroup", e);
659
659
  }
660
- G("MuiFormGroup", ["root", "row", "error"]);
660
+ L("MuiFormGroup", ["root", "row", "error"]);
661
661
  const lo = (e) => {
662
662
  const {
663
663
  classes: t,
@@ -820,7 +820,7 @@ function bo() {
820
820
  function yo(e) {
821
821
  return D("MuiRadio", e);
822
822
  }
823
- const de = G("MuiRadio", ["root", "checked", "disabled", "colorPrimary", "colorSecondary", "sizeSmall"]), go = (e) => {
823
+ const de = L("MuiRadio", ["root", "checked", "disabled", "colorPrimary", "colorSecondary", "sizeSmall"]), go = (e) => {
824
824
  const {
825
825
  classes: t,
826
826
  color: r,
@@ -1039,7 +1039,7 @@ process.env.NODE_ENV !== "production" && (ke.propTypes = {
1039
1039
  function ko(e) {
1040
1040
  return D("MuiRadioGroup", e);
1041
1041
  }
1042
- G("MuiRadioGroup", ["root", "row", "error"]);
1042
+ L("MuiRadioGroup", ["root", "row", "error"]);
1043
1043
  const wo = (e) => {
1044
1044
  const {
1045
1045
  classes: t,
@@ -1072,7 +1072,7 @@ const wo = (e) => {
1072
1072
  b || (b = a.current.querySelector("input:not(:disabled)")), b && b.focus();
1073
1073
  }
1074
1074
  }), []);
1075
- const O = Ge(r, a), y = De(f), x = m.useMemo(() => ({
1075
+ const O = Le(r, a), y = De(f), x = m.useMemo(() => ({
1076
1076
  name: y,
1077
1077
  onChange(b) {
1078
1078
  k(b.target.value), c && c(b, b.target.value);
@@ -1183,7 +1183,7 @@ process.env.NODE_ENV !== "production" && (Se.propTypes = {
1183
1183
  function So(e) {
1184
1184
  return D("MuiSwitch", e);
1185
1185
  }
1186
- const g = G("MuiSwitch", ["root", "edgeStart", "edgeEnd", "switchBase", "colorPrimary", "colorSecondary", "sizeSmall", "sizeMedium", "checked", "disabled", "input", "thumb", "track"]), Ro = (e) => {
1186
+ const g = L("MuiSwitch", ["root", "edgeStart", "edgeEnd", "switchBase", "colorPrimary", "colorSecondary", "sizeSmall", "sizeMedium", "checked", "disabled", "input", "thumb", "track"]), Ro = (e) => {
1187
1187
  const {
1188
1188
  classes: t,
1189
1189
  edge: r,
@@ -1497,7 +1497,15 @@ process.env.NODE_ENV !== "production" && (ee.propTypes = {
1497
1497
  value: o.any
1498
1498
  });
1499
1499
  const $o = (e, t) => {
1500
- const r = ["EMAIL", "INAPP_WEB", "SMS", "CALL", "PUSH", "WEB_PUSH"];
1500
+ const r = [
1501
+ "EMAIL",
1502
+ "INAPP_WEB",
1503
+ "SMS",
1504
+ "CALL",
1505
+ "PUSH",
1506
+ "WEB_PUSH",
1507
+ "SLACK"
1508
+ ];
1501
1509
  return r.indexOf(e) - r.indexOf(t);
1502
1510
  }, fe = (e, t) => {
1503
1511
  const r = ["off", "instant", "hourly", "daily", "weekly", "monthly"];
@@ -1509,7 +1517,7 @@ const $o = (e, t) => {
1509
1517
  daily: "Daily",
1510
1518
  weekly: "Weekly",
1511
1519
  monthly: "Monthly"
1512
- })[e], Go = ({
1520
+ })[e], Lo = ({
1513
1521
  notification: e,
1514
1522
  preferences: t,
1515
1523
  updateDelivery: r,
@@ -1644,6 +1652,6 @@ const $o = (e, t) => {
1644
1652
  ] }, s);
1645
1653
  }) });
1646
1654
  export {
1647
- Go as P,
1655
+ Lo as P,
1648
1656
  Ae as c
1649
1657
  };
@@ -1,45 +1,48 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
2
  import { Channels as c } from "../components/Notifications/interface.js";
3
- import { c as t } from "./createSvgIcon.js";
4
- const o = t(/* @__PURE__ */ a("path", {
3
+ import { c as r, S as o } from "./createSvgIcon.js";
4
+ const e = r(/* @__PURE__ */ a("path", {
5
5
  d: "M20.01 15.38c-1.23 0-2.42-.2-3.53-.56-.35-.12-.74-.03-1.01.24l-1.57 1.97c-2.83-1.35-5.48-3.9-6.89-6.83l1.95-1.66c.27-.28.35-.67.24-1.02-.37-1.11-.56-2.3-.56-3.53 0-.54-.45-.99-.99-.99H4.19C3.65 3 3 3.24 3 3.99 3 13.28 10.73 21 20.01 21c.71 0 .99-.63.99-1.18v-3.45c0-.54-.45-.99-.99-.99"
6
- }), "Call"), l = t(/* @__PURE__ */ a("path", {
6
+ }), "Call"), t = r(/* @__PURE__ */ a("path", {
7
7
  d: "M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2zm-2 0-8 5-8-5zm0 12H4V8l8 5 8-5z"
8
- }), "EmailOutlined"), e = t(/* @__PURE__ */ a("path", {
8
+ }), "EmailOutlined"), n = r(/* @__PURE__ */ a("path", {
9
9
  d: "M22 6.98V16c0 1.1-.9 2-2 2H6l-4 4V4c0-1.1.9-2 2-2h10.1c-.06.32-.1.66-.1 1 0 2.76 2.24 5 5 5 1.13 0 2.16-.39 3-1.02M16 3c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3"
10
- }), "MarkChatUnread"), n = t(/* @__PURE__ */ a("path", {
10
+ }), "MarkChatUnread"), s = r(/* @__PURE__ */ a("path", {
11
11
  d: "M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"
12
- }), "NotificationsOutlined"), s = t(/* @__PURE__ */ a("path", {
12
+ }), "NotificationsOutlined"), h = r(/* @__PURE__ */ a("path", {
13
13
  d: "M15.5 1h-8C6.12 1 5 2.12 5 3.5v17C5 21.88 6.12 23 7.5 23h8c1.38 0 2.5-1.12 2.5-2.5v-17C18 2.12 16.88 1 15.5 1m-4 21c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m4.5-4H7V4h9z"
14
- }), "PhoneIphone"), m = t(/* @__PURE__ */ a("path", {
14
+ }), "PhoneIphone"), i = r(/* @__PURE__ */ a("path", {
15
15
  d: "M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M9 11H7V9h2zm4 0h-2V9h2zm4 0h-2V9h2z"
16
- }), "Sms"), z = (r) => ({
16
+ }), "Sms"), M = (l) => ({
17
17
  EMAIL: "Email",
18
18
  INAPP_WEB: "In-App",
19
19
  SMS: "Text",
20
20
  CALL: "Automated Calling",
21
21
  PUSH: "Mobile",
22
- WEB_PUSH: "Browser"
23
- })[r], C = (r) => {
24
- switch (r) {
22
+ WEB_PUSH: "Browser",
23
+ SLACK: "Slack"
24
+ })[l], v = (l) => {
25
+ switch (l) {
25
26
  case c.EMAIL:
26
- return /* @__PURE__ */ a(l, { fontSize: "small", color: "primary" });
27
+ return /* @__PURE__ */ a(t, { fontSize: "small", color: "primary" });
27
28
  case c.SMS:
28
- return /* @__PURE__ */ a(m, { fontSize: "small", color: "primary" });
29
+ return /* @__PURE__ */ a(i, { fontSize: "small", color: "primary" });
29
30
  case c.PUSH:
30
- return /* @__PURE__ */ a(s, { fontSize: "small", color: "primary" });
31
+ return /* @__PURE__ */ a(h, { fontSize: "small", color: "primary" });
31
32
  case c.CALL:
32
- return /* @__PURE__ */ a(o, { fontSize: "small", color: "primary" });
33
+ return /* @__PURE__ */ a(e, { fontSize: "small", color: "primary" });
33
34
  case c.INAPP_WEB:
34
- return /* @__PURE__ */ a(n, { fontSize: "small", color: "primary" });
35
+ return /* @__PURE__ */ a(s, { fontSize: "small", color: "primary" });
35
36
  case c.WEB_PUSH:
36
- return /* @__PURE__ */ a(e, { fontSize: "small", color: "primary" });
37
+ return /* @__PURE__ */ a(n, { fontSize: "small", color: "primary" });
38
+ case c.SLACK:
39
+ return /* @__PURE__ */ a(o, { fontSize: "small", color: "primary", children: /* @__PURE__ */ a("path", { d: "M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.521-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.523 2.521h-2.521V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.521A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.523v-2.521h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z" }) });
37
40
  default:
38
- return /* @__PURE__ */ a(l, { fontSize: "small", color: "primary" });
41
+ return /* @__PURE__ */ a(t, { fontSize: "small", color: "primary" });
39
42
  }
40
43
  };
41
44
  export {
42
- n as N,
43
- C as a,
44
- z as g
45
+ s as N,
46
+ v as a,
47
+ M as g
45
48
  };
@@ -26,7 +26,7 @@ const $ = (o) => {
26
26
  })(N(({
27
27
  theme: o
28
28
  }) => {
29
- var r, n, s, t, c, S, a, g, p, d, l, m, y, f;
29
+ var r, n, s, t, c, u, a, g, p, d, l, m, y, f;
30
30
  return {
31
31
  userSelect: "none",
32
32
  width: "1em",
@@ -58,7 +58,7 @@ const $ = (o) => {
58
58
  fontSize: "small"
59
59
  },
60
60
  style: {
61
- fontSize: ((S = (c = o.typography) == null ? void 0 : c.pxToRem) == null ? void 0 : S.call(c, 20)) || "1.25rem"
61
+ fontSize: ((u = (c = o.typography) == null ? void 0 : c.pxToRem) == null ? void 0 : u.call(c, 20)) || "1.25rem"
62
62
  }
63
63
  },
64
64
  {
@@ -79,13 +79,13 @@ const $ = (o) => {
79
79
  },
80
80
  // TODO v5 deprecate color prop, v6 remove for sx
81
81
  ...Object.entries((o.vars ?? o).palette).filter(([, i]) => i && i.main).map(([i]) => {
82
- var u, v;
82
+ var S, v;
83
83
  return {
84
84
  props: {
85
85
  color: i
86
86
  },
87
87
  style: {
88
- color: (v = (u = (o.vars ?? o).palette) == null ? void 0 : u[i]) == null ? void 0 : v.main
88
+ color: (v = (S = (o.vars ?? o).palette) == null ? void 0 : S[i]) == null ? void 0 : v.main
89
89
  }
90
90
  };
91
91
  }),
@@ -122,7 +122,7 @@ const $ = (o) => {
122
122
  }), {
123
123
  children: t,
124
124
  className: c,
125
- color: S = "inherit",
125
+ color: u = "inherit",
126
126
  component: a = "svg",
127
127
  fontSize: g = "medium",
128
128
  htmlColor: p,
@@ -132,15 +132,15 @@ const $ = (o) => {
132
132
  ...y
133
133
  } = s, f = /* @__PURE__ */ h.isValidElement(t) && t.type === "svg", i = {
134
134
  ...s,
135
- color: S,
135
+ color: u,
136
136
  component: a,
137
137
  fontSize: g,
138
138
  instanceFontSize: r.fontSize,
139
139
  inheritViewBox: d,
140
140
  viewBox: m,
141
141
  hasSvgAsChild: f
142
- }, u = {};
143
- d || (u.viewBox = m);
142
+ }, S = {};
143
+ d || (S.viewBox = m);
144
144
  const v = $(i);
145
145
  return /* @__PURE__ */ b(A, {
146
146
  as: a,
@@ -150,7 +150,7 @@ const $ = (o) => {
150
150
  "aria-hidden": l ? void 0 : !0,
151
151
  role: l ? "img" : void 0,
152
152
  ref: n,
153
- ...u,
153
+ ...S,
154
154
  ...y,
155
155
  ...f && t.props,
156
156
  ownerState: i,
@@ -244,5 +244,6 @@ function V(o, r) {
244
244
  return process.env.NODE_ENV !== "production" && (n.displayName = `${r}Icon`), n.muiName = x.muiName, /* @__PURE__ */ h.memo(/* @__PURE__ */ h.forwardRef(n));
245
245
  }
246
246
  export {
247
+ x as S,
247
248
  V as c
248
249
  };
@@ -12,7 +12,8 @@ export declare enum Channels {
12
12
  SMS = "SMS",
13
13
  CALL = "CALL",
14
14
  PUSH = "PUSH",
15
- WEB_PUSH = "WEB_PUSH"
15
+ WEB_PUSH = "WEB_PUSH",
16
+ SLACK = "SLACK"
16
17
  }
17
18
  export declare enum DeliveryOptions {
18
19
  OFF = "off",
@@ -1,5 +1,5 @@
1
- var N = /* @__PURE__ */ ((I) => (I.INFINITE_SCROLL = "infinite_scroll", I.PAGINATED = "paginated", I))(N || {}), T = /* @__PURE__ */ ((I) => (I.ALL = "ALL", I.UNARCHIVED = "UNARCHIVED", I))(T || {}), A = /* @__PURE__ */ ((I) => (I.EMAIL = "EMAIL", I.INAPP_WEB = "INAPP_WEB", I.SMS = "SMS", I.CALL = "CALL", I.PUSH = "PUSH", I.WEB_PUSH = "WEB_PUSH", I))(A || {}), r = /* @__PURE__ */ ((I) => (I.OFF = "off", I.INSTANT = "instant", I.HOURLY = "hourly", I.DAILY = "daily", I.WEEKLY = "weekly", I.MONTHLY = "monthly", I))(r || {}), O = /* @__PURE__ */ ((I) => (I.COUNT_UNOPENED_NOTIFICATIONS = "COUNT_UNOPENED_NOTIFICATIONS", I.COUNT_UNARCHIVED_NOTIFICATIONS = "COUNT_UNARCHIVED_NOTIFICATIONS", I))(O || {}), E = /* @__PURE__ */ ((I) => (I.TOP_LEFT = "top-left", I.TOP_RIGHT = "top-right", I.BOTTOM_LEFT = "bottom-left", I.BOTTOM_RIGHT = "bottom-right", I))(E || {});
2
- const L = {
1
+ var N = /* @__PURE__ */ ((I) => (I.INFINITE_SCROLL = "infinite_scroll", I.PAGINATED = "paginated", I))(N || {}), T = /* @__PURE__ */ ((I) => (I.ALL = "ALL", I.UNARCHIVED = "UNARCHIVED", I))(T || {}), A = /* @__PURE__ */ ((I) => (I.EMAIL = "EMAIL", I.INAPP_WEB = "INAPP_WEB", I.SMS = "SMS", I.CALL = "CALL", I.PUSH = "PUSH", I.WEB_PUSH = "WEB_PUSH", I.SLACK = "SLACK", I))(A || {}), r = /* @__PURE__ */ ((I) => (I.OFF = "off", I.INSTANT = "instant", I.HOURLY = "hourly", I.DAILY = "daily", I.WEEKLY = "weekly", I.MONTHLY = "monthly", I))(r || {}), O = /* @__PURE__ */ ((I) => (I.COUNT_UNOPENED_NOTIFICATIONS = "COUNT_UNOPENED_NOTIFICATIONS", I.COUNT_UNARCHIVED_NOTIFICATIONS = "COUNT_UNARCHIVED_NOTIFICATIONS", I))(O || {}), L = /* @__PURE__ */ ((I) => (I.TOP_LEFT = "top-left", I.TOP_RIGHT = "top-right", I.BOTTOM_LEFT = "bottom-left", I.BOTTOM_RIGHT = "bottom-right", I))(L || {});
2
+ const E = {
3
3
  opened: "opened",
4
4
  clicked: "clicked",
5
5
  archived: "archived",
@@ -12,7 +12,7 @@ export {
12
12
  A as Channels,
13
13
  r as DeliveryOptions,
14
14
  T as Filter,
15
- L as NOTIFICATION_ACTIONS,
15
+ E as NOTIFICATION_ACTIONS,
16
16
  N as Pagination,
17
- E as Position
17
+ L as Position
18
18
  };
@@ -1,7 +1,8 @@
1
1
  import "react/jsx-runtime";
2
2
  import "../Notifications/interface.js";
3
- import { a as t, g as r } from "../../assets/channelUtils.js";
3
+ import { a as r, g as m } from "../../assets/channelUtils.js";
4
+ import "../../assets/createSvgIcon.js";
4
5
  export {
5
- t as getChannelIcon,
6
- r as getChannelLabel
6
+ r as getChannelIcon,
7
+ m as getChannelLabel
7
8
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as Q } from "react/jsx-runtime";
2
- import { useState as I, useCallback as m, useMemo as X, useRef as U, useEffect as P, useContext as Y } from "react";
2
+ import { useState as I, useCallback as m, useMemo as X, useRef as U, useEffect as y, useContext as Y } from "react";
3
3
  import { NotificationAPIContext as H } from "./context.js";
4
4
  const Z = async (e, c, i, a, f, b, h) => {
5
5
  const l = ee(a, f, b), g = await fetch(
@@ -173,7 +173,7 @@ const Z = async (e, c, i, a, f, b, h) => {
173
173
  i.playSoundOnNewNotification && new Audio(i.newNotificationSoundPath).play().catch((s) => {
174
174
  console.log("Failed to play new notification sound:", s);
175
175
  });
176
- }, [i.newNotificationSoundPath, i.playSoundOnNewNotification]), y = m((t) => {
176
+ }, [i.newNotificationSoundPath, i.playSoundOnNewNotification]), P = m((t) => {
177
177
  const s = (/* @__PURE__ */ new Date()).toISOString();
178
178
  f((n) => (t = Array.isArray(t) ? t : [], t = t.filter((d) => {
179
179
  const p = d.expDate && new Date(d.expDate).toISOString() > s, D = new Date(d.date).getTime() > new Date(s).getTime() + 1e3;
@@ -188,7 +188,7 @@ const Z = async (e, c, i, a, f, b, h) => {
188
188
  userId: i.user.id,
189
189
  hashedUserId: i.hashedUserId,
190
190
  onNewInAppNotifications: (s) => {
191
- W(), y(s);
191
+ W(), P(s);
192
192
  },
193
193
  host: i.apiURL,
194
194
  websocketHost: i.wsURL
@@ -203,7 +203,7 @@ const Z = async (e, c, i, a, f, b, h) => {
203
203
  i.user.email,
204
204
  i.user.number,
205
205
  i.hashedUserId,
206
- y,
206
+ P,
207
207
  W,
208
208
  e.client,
209
209
  i.apiURL,
@@ -211,11 +211,11 @@ const Z = async (e, c, i, a, f, b, h) => {
211
211
  ]), x = m(
212
212
  async (t, s) => {
213
213
  const n = await u.rest.getNotifications(t, s);
214
- T(n.oldestReceived), C(n.couldLoadMore), y(n.notifications);
214
+ T(n.oldestReceived), C(n.couldLoadMore), P(n.notifications);
215
215
  },
216
- [y, u.rest]
216
+ [P, u.rest]
217
217
  ), E = U(A), R = U(w), $ = U(k);
218
- P(() => {
218
+ y(() => {
219
219
  E.current = A, R.current = w, $.current = k;
220
220
  }, [A, w, k]);
221
221
  const O = m(
@@ -330,17 +330,19 @@ const Z = async (e, c, i, a, f, b, h) => {
330
330
  i.customServiceWorkerPath,
331
331
  l == null ? void 0 : l.userAccountMetadata.environmentVapidPublicKey
332
332
  ]);
333
- P(() => {
333
+ y(() => {
334
334
  f([]), S(!1), h(void 0), T((/* @__PURE__ */ new Date()).toISOString()), C(!0), O(!0), u.openWebSocket(), u.getPreferences().then((t) => {
335
335
  h(t);
336
336
  });
337
- }, [u, O, M]), P(() => {
338
- F && "Notification" in window && typeof Notification.requestPermission == "function" && Notification.permission !== "default" && N(!1), u.getUserAccountMetadata().then((t) => {
339
- g(t), N(t.userAccountMetadata.hasWebPushEnabled);
340
- }), v === "AUTOMATIC" && N(
337
+ }, [u, O, M]), y(() => {
338
+ u.getUserAccountMetadata().then((t) => {
339
+ g(t), F && "Notification" in window && typeof Notification.requestPermission == "function" ? Notification.permission !== "default" && N(!1) : N(t.userAccountMetadata.hasWebPushEnabled);
340
+ });
341
+ }, [u]), y(() => {
342
+ v === "AUTOMATIC" && N(
341
343
  localStorage.getItem("hideWebPushOptInMessage") !== "true"
342
344
  );
343
- }, [u, v]), P(() => {
345
+ }, [v]), y(() => {
344
346
  L && M();
345
347
  }, [L, M]);
346
348
  const z = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@notificationapi/react",
3
3
  "private": false,
4
- "version": "1.1.3",
4
+ "version": "1.2.0",
5
5
  "type": "module",
6
6
  "overrides": {
7
7
  "esbuild": "^0.25.0",
@@ -63,7 +63,7 @@
63
63
  "@fontsource/roboto": "^5.1.1",
64
64
  "@mui/icons-material": "^6.3.1",
65
65
  "@mui/material": "^6.3.1",
66
- "@notificationapi/core": "^0.0.15",
66
+ "@notificationapi/core": "^0.0.16",
67
67
  "javascript-time-ago": "^2.5.10",
68
68
  "liquidjs": "^10.14.0",
69
69
  "rc-virtual-list": "^3.11.5",