@notificationapi/react 0.0.10 → 0.0.11

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,6 +1,6 @@
1
- import { jsxs as lt, jsx as se } from "react/jsx-runtime";
1
+ import { jsxs as lt, jsx as ae } from "react/jsx-runtime";
2
2
  import * as q from "react";
3
- import ae, { 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";
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";
5
5
  import { j as _o, p as bn, D as No, x as jo, T as or, R as Mo } from "./index3.js";
6
6
  import { P as Lo } from "./index.js";
@@ -213,7 +213,7 @@ const Sn = ["xxl", "xl", "lg", "md", "sm", "xs"], Bo = (e) => ({
213
213
  };
214
214
  function Wo() {
215
215
  const [, e] = wo(), t = Bo(Yo(e));
216
- return ae.useMemo(() => {
216
+ return ie.useMemo(() => {
217
217
  const r = /* @__PURE__ */ new Map();
218
218
  let n = -1, o = {};
219
219
  return {
@@ -1017,9 +1017,9 @@ function ja(e) {
1017
1017
  return y.name || Ie(15), ge(b, y.name);
1018
1018
  }, Pn).toString() : "", v;
1019
1019
  }
1020
- var Ma = new _n(), Pt = ja(), jn = ae.createContext({ shouldForwardProp: void 0, styleSheet: Ma, stylis: Pt });
1020
+ var Ma = new _n(), Pt = ja(), jn = ie.createContext({ shouldForwardProp: void 0, styleSheet: Ma, stylis: Pt });
1021
1021
  jn.Consumer;
1022
- ae.createContext(void 0);
1022
+ ie.createContext(void 0);
1023
1023
  function mr() {
1024
1024
  return co(jn);
1025
1025
  }
@@ -1117,7 +1117,7 @@ var za = An(ut), Ua = function() {
1117
1117
  }
1118
1118
  return o;
1119
1119
  }, e;
1120
- }(), Fn = ae.createContext(void 0);
1120
+ }(), Fn = ie.createContext(void 0);
1121
1121
  Fn.Consumer;
1122
1122
  var ht = {}, gr = /* @__PURE__ */ new Set();
1123
1123
  function qa(e, t, r) {
@@ -1142,7 +1142,7 @@ 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, oe = ae.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
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) {
@@ -1164,7 +1164,7 @@ function qa(e, t, r) {
1164
1164
  }(O, x, f);
1165
1165
  }
1166
1166
  M.displayName = v;
1167
- var O = ae.forwardRef(M);
1167
+ var O = ie.forwardRef(M);
1168
1168
  return O.attrs = y, O.componentStyle = k, O.displayName = v, O.shouldForwardProp = E, O.foldedComponentIds = n ? ve(o.foldedComponentIds, o.styledComponentId) : "", O.styledComponentId = b, O.target = n ? o.target : e, Object.defineProperty(O, "defaultProps", { get: function() {
1169
1169
  return this._foldedDefaultProps;
1170
1170
  }, set: function(x) {
@@ -3378,8 +3378,8 @@ function ms() {
3378
3378
  }
3379
3379
  function x(d) {
3380
3380
  if (typeof d == "object" && d !== null) {
3381
- var ie = d.$$typeof;
3382
- switch (ie) {
3381
+ var se = d.$$typeof;
3382
+ switch (se) {
3383
3383
  case t:
3384
3384
  var Ue = d.type;
3385
3385
  switch (Ue) {
@@ -3400,11 +3400,11 @@ function ms() {
3400
3400
  case i:
3401
3401
  return Qt;
3402
3402
  default:
3403
- return ie;
3403
+ return se;
3404
3404
  }
3405
3405
  }
3406
3406
  case r:
3407
- return ie;
3407
+ return se;
3408
3408
  }
3409
3409
  }
3410
3410
  }
@@ -3519,11 +3519,11 @@ function hs() {
3519
3519
  );
3520
3520
  throw d.name = "Invariant Violation", d;
3521
3521
  } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
3522
- var ie = g + ":" + A;
3523
- !h[ie] && // Avoid spamming the console because they are often not actionable except for lib authors
3522
+ var se = g + ":" + A;
3523
+ !h[se] && // Avoid spamming the console because they are often not actionable except for lib authors
3524
3524
  T < 3 && (a(
3525
3525
  "You are manually calling a React.PropTypes validation function for the `" + C + "` prop on `" + g + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
3526
- ), h[ie] = !0, T++);
3526
+ ), h[se] = !0, T++);
3527
3527
  }
3528
3528
  }
3529
3529
  return $[A] == null ? _ ? $[A] === null ? new S("The " + w + " `" + C + "` is marked as required " + ("in `" + g + "`, but its value is `null`.")) : new S("The " + w + " `" + C + "` is marked as required in " + ("`" + g + "`, but its value is `undefined`.")) : null : p($, A, g, w, C);
@@ -3608,8 +3608,8 @@ function hs() {
3608
3608
  if (E(A, p[g]))
3609
3609
  return null;
3610
3610
  var w = JSON.stringify(p, function(G, d) {
3611
- var ie = L(d);
3612
- return ie === "symbol" ? String(d) : d;
3611
+ var se = L(d);
3612
+ return se === "symbol" ? String(d) : d;
3613
3613
  });
3614
3614
  return new S("Invalid " + _ + " `" + $ + "` of value `" + String(A) + "` " + ("supplied to `" + R + "`, expected one of " + w + "."));
3615
3615
  }
@@ -3649,8 +3649,8 @@ function hs() {
3649
3649
  return null;
3650
3650
  d.data && n(d.data, "expectedType") && w.push(d.data.expectedType);
3651
3651
  }
3652
- var ie = w.length > 0 ? ", expected one of type [" + w.join(", ") + "]" : "";
3653
- return new S("Invalid " + A + " `" + g + "` supplied to " + ("`" + $ + "`" + ie + "."));
3652
+ var se = w.length > 0 ? ", expected one of type [" + w.join(", ") + "]" : "";
3653
+ return new S("Invalid " + A + " `" + g + "` supplied to " + ("`" + $ + "`" + se + "."));
3654
3654
  }
3655
3655
  return I(P);
3656
3656
  }
@@ -3867,14 +3867,14 @@ function ot(e, t) {
3867
3867
  var r = e.date, n = e.verboseDate, o = e.tooltip, a = e.children, i = Ss(e, ws), s = ye(function() {
3868
3868
  return r.toISOString();
3869
3869
  }, [r]);
3870
- return /* @__PURE__ */ ae.createElement("time", qt({
3870
+ return /* @__PURE__ */ ie.createElement("time", qt({
3871
3871
  ref: t
3872
3872
  }, i, {
3873
3873
  dateTime: s,
3874
3874
  title: o ? n : void 0
3875
3875
  }), a);
3876
3876
  }
3877
- ot = /* @__PURE__ */ ae.forwardRef(ot);
3877
+ ot = /* @__PURE__ */ ie.forwardRef(ot);
3878
3878
  ot.propTypes = {
3879
3879
  date: j.instanceOf(Date).isRequired,
3880
3880
  verboseDate: j.string,
@@ -4381,12 +4381,12 @@ function st(e) {
4381
4381
  now: y,
4382
4382
  timeOffset: E,
4383
4383
  polyfill: S
4384
- }), K = W.date, ee = W.verboseDate, re = W.formattedDate, Z = /* @__PURE__ */ ae.createElement(O, it({
4384
+ }), K = W.date, ee = W.verboseDate, re = W.formattedDate, Z = /* @__PURE__ */ ie.createElement(O, it({
4385
4385
  date: K,
4386
4386
  verboseDate: ee,
4387
4387
  tooltip: k
4388
4388
  }, V), re), Y = f || x;
4389
- return Y ? /* @__PURE__ */ ae.createElement(Y, it({}, D, {
4389
+ return Y ? /* @__PURE__ */ ie.createElement(Y, it({}, D, {
4390
4390
  verboseDate: ee
4391
4391
  }), Z) : Z;
4392
4392
  }
@@ -4473,7 +4473,7 @@ st.propTypes = {
4473
4473
  // Custom `props` passed to `wrapperComponent`.
4474
4474
  wrapperProps: j.object
4475
4475
  };
4476
- st = /* @__PURE__ */ ae.memo(st);
4476
+ st = /* @__PURE__ */ ie.memo(st);
4477
4477
  ne.addDefaultLocale(ro);
4478
4478
  ne.addLocale(ro);
4479
4479
  var lu = /* @__PURE__ */ ((e) => (e.square = "square", e.circle = "circle", e))(lu || {});
@@ -4496,8 +4496,8 @@ const pu = Un.div`
4496
4496
  pu,
4497
4497
  {
4498
4498
  $redirect: !!e.notification.redirectURL,
4499
- $seen: e.notification.seen || e.notification.opened,
4500
- $archived: e.notification.archived,
4499
+ $seen: e.notification.seen || !!e.notification.opened,
4500
+ $archived: !!e.notification.archived,
4501
4501
  onClick: () => {
4502
4502
  e.markAsClicked(e.notification.id), e.notification.redirectURL && (window.location.href = e.notification.redirectURL);
4503
4503
  },
@@ -4510,7 +4510,7 @@ const pu = Un.div`
4510
4510
  width: "100%"
4511
4511
  },
4512
4512
  children: [
4513
- /* @__PURE__ */ se("div", { children: /* @__PURE__ */ se(
4513
+ /* @__PURE__ */ ae("div", { children: /* @__PURE__ */ ae(
4514
4514
  Tn,
4515
4515
  {
4516
4516
  src: e.notification.imageURL,
@@ -4529,8 +4529,13 @@ const pu = Un.div`
4529
4529
  flexGrow: 1
4530
4530
  },
4531
4531
  children: [
4532
- /* @__PURE__ */ se("div", { children: /* @__PURE__ */ se(or.Text, { children: e.notification.title }) }),
4533
- /* @__PURE__ */ se("div", { children: /* @__PURE__ */ se(or.Text, { type: "secondary", style: { fontSize: 12 }, children: /* @__PURE__ */ se(
4532
+ /* @__PURE__ */ ae("div", { children: /* @__PURE__ */ ae(or.Text, { children: /* @__PURE__ */ ae(
4533
+ "span",
4534
+ {
4535
+ dangerouslySetInnerHTML: { __html: e.notification.title }
4536
+ }
4537
+ ) }) }),
4538
+ /* @__PURE__ */ ae("div", { children: /* @__PURE__ */ ae(or.Text, { type: "secondary", style: { fontSize: 12 }, children: /* @__PURE__ */ ae(
4534
4539
  st,
4535
4540
  {
4536
4541
  date: new Date(e.notification.date).getTime(),
@@ -4551,18 +4556,18 @@ const pu = Un.div`
4551
4556
  alignItems: "center"
4552
4557
  },
4553
4558
  children: [
4554
- /* @__PURE__ */ se(
4559
+ /* @__PURE__ */ ae(
4555
4560
  Fo,
4556
4561
  {
4557
4562
  className: "notification-archive-button",
4558
- icon: /* @__PURE__ */ se(Mo, {}),
4563
+ icon: /* @__PURE__ */ ae(Mo, {}),
4559
4564
  size: "small",
4560
4565
  type: "text",
4561
4566
  shape: "circle",
4562
4567
  onClick: (t) => (e.markAsArchived([e.notification.id]), t.preventDefault(), t.stopPropagation(), !1)
4563
4568
  }
4564
4569
  ),
4565
- /* @__PURE__ */ se(
4570
+ /* @__PURE__ */ ae(
4566
4571
  zo,
4567
4572
  {
4568
4573
  dot: !0,