@notificationapi/react 0.0.33 → 0.0.35

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.
Files changed (30) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/AntdIcon.js +1 -1
  3. package/dist/assets/CloseOutlined.js +13 -0
  4. package/dist/assets/Notification.js +17 -16
  5. package/dist/assets/PreferenceInput.js +1470 -0
  6. package/dist/assets/PurePanel.js +32 -42
  7. package/dist/assets/WebPushOptInMessage.js +478 -0
  8. package/dist/assets/button.js +50 -50
  9. package/dist/assets/colors.js +25 -20840
  10. package/dist/assets/compact-item.js +860 -0
  11. package/dist/assets/index.js +11 -9
  12. package/dist/assets/index2.js +10 -9
  13. package/dist/assets/index3.js +2303 -3150
  14. package/dist/assets/presets.js +22 -22
  15. package/dist/assets/reactNode.js +20821 -0
  16. package/dist/components/Notifications/Inbox.js +81 -78
  17. package/dist/components/Notifications/NotificationFeed.js +59 -31
  18. package/dist/components/Notifications/NotificationLauncher.js +61 -41
  19. package/dist/components/Notifications/NotificationPopup.js +72 -65
  20. package/dist/components/Preferences/NotificationPreferencesInline.d.ts +1 -1
  21. package/dist/components/Preferences/NotificationPreferencesInline.js +39 -5
  22. package/dist/components/Preferences/NotificationPreferencesPopup.d.ts +1 -1
  23. package/dist/components/Preferences/NotificationPreferencesPopup.js +463 -464
  24. package/dist/components/Preferences/PreferenceInput.js +5 -1466
  25. package/dist/components/Preferences/Preferences.js +24 -23
  26. package/dist/components/Provider/index.d.ts +9 -1
  27. package/dist/components/Provider/index.js +214 -156
  28. package/dist/components/WebPush/WebPushOptInMessage.d.ts +14 -0
  29. package/dist/components/WebPush/WebPushOptInMessage.js +8 -0
  30. package/package.json +2 -2
@@ -1,16 +1,16 @@
1
1
  import * as ee from "react";
2
2
  import u, { forwardRef as ie, useState as ye, useRef as j, useEffect as ne, useMemo as te, useContext as he, Children as pt, createRef as Ct } from "react";
3
- import { c as L, f as _, d as Xe, _ as P, b as yt, e as U, a as fe } from "./presets.js";
4
- import { l as St, u as xt, m as Ht, n as $t, e as Bt, o as Et, W as _t } from "./index3.js";
5
- import { a as Ye, l as Ot, e as Ue, c as Rt, n as Lt, d as wt, o as Nt, p as Pt, q as Je, s as Ke, t as Qe, m as ae, v as me, g as Dt, u as re, k as zt, w as It, D as jt, j as Tt } from "./colors.js";
6
- var Mt = function(e, t) {
3
+ import { c as L, b as _, e as Xe, _ as P, d as yt, f as U, a as fe } from "./presets.js";
4
+ import { c as St, u as xt, g as Ht, d as $t, a as Et, o as Bt, W as _t } from "./compact-item.js";
5
+ import { a as Ye, A as Ot, f as Ue, c as Rt, E as Lt, e as wt, o as Nt, F as Pt, b as Je, _ as Ke, v as Qe, m as ae, G as me, g as Dt, u as re, q as zt, H as It, D as jt, i as Tt } from "./reactNode.js";
6
+ var At = function(e, t) {
7
7
  var r = {};
8
8
  for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && t.indexOf(o) < 0 && (r[o] = e[o]);
9
9
  if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var n = 0, o = Object.getOwnPropertySymbols(e); n < o.length; n++)
10
10
  t.indexOf(o[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[n]) && (r[o[n]] = e[o[n]]);
11
11
  return r;
12
12
  };
13
- const Ze = /* @__PURE__ */ ee.createContext(void 0), At = (e) => {
13
+ const Ze = /* @__PURE__ */ ee.createContext(void 0), Mt = (e) => {
14
14
  const {
15
15
  getPrefixCls: t,
16
16
  direction: r
@@ -18,7 +18,7 @@ const Ze = /* @__PURE__ */ ee.createContext(void 0), At = (e) => {
18
18
  prefixCls: o,
19
19
  size: n,
20
20
  className: i
21
- } = e, s = Mt(e, ["prefixCls", "size", "className"]), a = t("btn-group", o), [, , l] = Ot();
21
+ } = e, s = At(e, ["prefixCls", "size", "className"]), a = t("btn-group", o), [, , l] = Ot();
22
22
  let c = "";
23
23
  switch (n) {
24
24
  case "large":
@@ -42,7 +42,7 @@ const Ze = /* @__PURE__ */ ee.createContext(void 0), At = (e) => {
42
42
  className: d
43
43
  })));
44
44
  }, Ge = /^[\u4E00-\u9FA5]{2}$/, Se = Ge.test.bind(Ge);
45
- function Mr(e) {
45
+ function Ar(e) {
46
46
  return e === "danger" ? {
47
47
  danger: !0
48
48
  } : {
@@ -573,7 +573,7 @@ var qt = ["b"], Xt = ["v"], Ce = function(t) {
573
573
  }(se), Ut = "rc-color-picker", Y = function(t) {
574
574
  return t instanceof D ? t : new D(t);
575
575
  }, Jt = Y("#1677ff"), et = function(t) {
576
- var r = t.offset, o = t.targetRef, n = t.containerRef, i = t.color, s = t.type, a = n.current.getBoundingClientRect(), l = a.width, c = a.height, d = o.current.getBoundingClientRect(), g = d.width, b = d.height, f = g / 2, p = b / 2, B = (r.x + f) / l, E = 1 - (r.y + p) / c, S = i.toHsb(), x = B, O = (r.x + f) / l * 360;
576
+ var r = t.offset, o = t.targetRef, n = t.containerRef, i = t.color, s = t.type, a = n.current.getBoundingClientRect(), l = a.width, c = a.height, d = o.current.getBoundingClientRect(), g = d.width, b = d.height, f = g / 2, p = b / 2, E = (r.x + f) / l, B = 1 - (r.y + p) / c, S = i.toHsb(), x = E, O = (r.x + f) / l * 360;
577
577
  if (s)
578
578
  switch (s) {
579
579
  case "hue":
@@ -587,8 +587,8 @@ var qt = ["b"], Xt = ["v"], Ce = function(t) {
587
587
  }
588
588
  return Y({
589
589
  h: S.h,
590
- s: B <= 0 ? 0 : B,
591
- b: E >= 1 ? 1 : E,
590
+ s: E <= 0 ? 0 : E,
591
+ b: B >= 1 ? 1 : B,
592
592
  a: S.a
593
593
  });
594
594
  }, tt = function(t, r) {
@@ -642,20 +642,20 @@ function rt(e) {
642
642
  document.removeEventListener("mousemove", f.current), document.removeEventListener("mouseup", p.current), document.removeEventListener("touchmove", f.current), document.removeEventListener("touchend", p.current), f.current = null, p.current = null;
643
643
  };
644
644
  }, []);
645
- var B = function(h) {
646
- var y = Qt(h), K = y.pageX, T = y.pageY, w = r.current.getBoundingClientRect(), z = w.x, M = w.y, A = w.width, F = w.height, R = t.current.getBoundingClientRect(), q = R.width, I = R.height, G = q / 2, W = I / 2, m = Math.max(0, Math.min(K - z, A)) - G, C = Math.max(0, Math.min(T - M, F)) - W, v = {
645
+ var E = function(h) {
646
+ var y = Qt(h), K = y.pageX, T = y.pageY, w = r.current.getBoundingClientRect(), z = w.x, A = w.y, M = w.width, F = w.height, R = t.current.getBoundingClientRect(), q = R.width, I = R.height, G = q / 2, W = I / 2, m = Math.max(0, Math.min(K - z, M)) - G, C = Math.max(0, Math.min(T - A, F)) - W, v = {
647
647
  x: m,
648
648
  y: o === "x" ? g.y : C
649
649
  };
650
650
  if (q === 0 && I === 0 || q !== I)
651
651
  return !1;
652
652
  n == null || n(v);
653
- }, E = function(h) {
654
- h.preventDefault(), B(h);
653
+ }, B = function(h) {
654
+ h.preventDefault(), E(h);
655
655
  }, S = function(h) {
656
656
  h.preventDefault(), document.removeEventListener("mousemove", f.current), document.removeEventListener("mouseup", p.current), document.removeEventListener("touchmove", f.current), document.removeEventListener("touchend", p.current), f.current = null, p.current = null, i == null || i();
657
657
  }, x = function(h) {
658
- document.removeEventListener("mousemove", f.current), document.removeEventListener("mouseup", p.current), !l && (B(h), document.addEventListener("mousemove", E), document.addEventListener("mouseup", S), document.addEventListener("touchmove", E), document.addEventListener("touchend", S), f.current = E, p.current = S);
658
+ document.removeEventListener("mousemove", f.current), document.removeEventListener("mouseup", p.current), !l && (E(h), document.addEventListener("mousemove", B), document.addEventListener("mouseup", S), document.addEventListener("touchmove", B), document.addEventListener("touchend", S), f.current = B, p.current = S);
659
659
  };
660
660
  return [g, x];
661
661
  }
@@ -688,14 +688,14 @@ var ot = function(t) {
688
688
  }
689
689
  }, r);
690
690
  }), Zt = function(t) {
691
- var r = t.color, o = t.onChange, n = t.prefixCls, i = t.onChangeComplete, s = t.disabled, a = j(), l = j(), c = j(r), d = Qe(function(B) {
692
- var E = et({
693
- offset: B,
691
+ var r = t.color, o = t.onChange, n = t.prefixCls, i = t.onChangeComplete, s = t.disabled, a = j(), l = j(), c = j(r), d = Qe(function(E) {
692
+ var B = et({
693
+ offset: E,
694
694
  targetRef: l,
695
695
  containerRef: a,
696
696
  color: r
697
697
  });
698
- c.current = E, o(E);
698
+ c.current = B, o(B);
699
699
  }), g = rt({
700
700
  color: r,
701
701
  containerRef: a,
@@ -777,7 +777,7 @@ var ot = function(t) {
777
777
  },
778
778
  direction: "x",
779
779
  disabledDrag: n
780
- }), B = U(p, 2), E = B[0], S = B[1], x = u.useMemo(function() {
780
+ }), E = U(p, 2), B = E[0], S = E[1], x = u.useMemo(function() {
781
781
  if (l === "hue") {
782
782
  var h = a.toHsb();
783
783
  h.s = 1, h.b = 1, h.a = 1;
@@ -798,8 +798,8 @@ var ot = function(t) {
798
798
  }, /* @__PURE__ */ u.createElement(nt, {
799
799
  prefixCls: r
800
800
  }, /* @__PURE__ */ u.createElement(it, {
801
- x: E.x,
802
- y: E.y,
801
+ x: B.x,
802
+ y: B.y,
803
803
  ref: d
804
804
  }, /* @__PURE__ */ u.createElement(ot, {
805
805
  size: "small",
@@ -839,28 +839,28 @@ var or = [{
839
839
  color: "rgb(255, 0, 0)",
840
840
  percent: 100
841
841
  }], nr = /* @__PURE__ */ ie(function(e, t) {
842
- var r = e.value, o = e.defaultValue, n = e.prefixCls, i = n === void 0 ? Ut : n, s = e.onChange, a = e.onChangeComplete, l = e.className, c = e.style, d = e.panelRender, g = e.disabledAlpha, b = g === void 0 ? !1 : g, f = e.disabled, p = f === void 0 ? !1 : f, B = e.components, E = rr(B), S = U(E, 1), x = S[0], O = kt(o || Jt, r), h = U(O, 2), y = h[0], K = h[1], T = te(function() {
842
+ var r = e.value, o = e.defaultValue, n = e.prefixCls, i = n === void 0 ? Ut : n, s = e.onChange, a = e.onChangeComplete, l = e.className, c = e.style, d = e.panelRender, g = e.disabledAlpha, b = g === void 0 ? !1 : g, f = e.disabled, p = f === void 0 ? !1 : f, E = e.components, B = rr(E), S = U(B, 1), x = S[0], O = kt(o || Jt, r), h = U(O, 2), y = h[0], K = h[1], T = te(function() {
843
843
  return y.setA(1).toRgbString();
844
844
  }, [y]), w = function(C, v) {
845
845
  r || K(C), s == null || s(C, v);
846
846
  }, z = function(C) {
847
847
  return new D(y.setHue(C));
848
- }, M = function(C) {
849
- return new D(y.setA(C / 100));
850
848
  }, A = function(C) {
849
+ return new D(y.setA(C / 100));
850
+ }, M = function(C) {
851
851
  w(z(C), {
852
852
  type: "hue",
853
853
  value: C
854
854
  });
855
855
  }, F = function(C) {
856
- w(M(C), {
856
+ w(A(C), {
857
857
  type: "alpha",
858
858
  value: C
859
859
  });
860
860
  }, R = function(C) {
861
861
  a && a(z(C));
862
862
  }, q = function(C) {
863
- a && a(M(C));
863
+ a && a(A(C));
864
864
  }, I = L("".concat(i, "-panel"), l, _({}, "".concat(i, "-panel-disabled"), p)), G = {
865
865
  prefixCls: i,
866
866
  disabled: p,
@@ -879,7 +879,7 @@ var or = [{
879
879
  min: 0,
880
880
  max: 359,
881
881
  value: y.getHue(),
882
- onChange: A,
882
+ onChange: M,
883
883
  onChangeComplete: R
884
884
  })), !b && /* @__PURE__ */ u.createElement(x, fe({}, G, {
885
885
  type: "alpha",
@@ -1165,11 +1165,11 @@ const lr = (e, t) => {
1165
1165
  borderColor: t,
1166
1166
  background: r
1167
1167
  }, le(e, o, n))
1168
- }), Be = (e) => ({
1168
+ }), Ee = (e) => ({
1169
1169
  [`&${e.componentCls}-variant-dashed`]: {
1170
1170
  borderStyle: "dashed"
1171
1171
  }
1172
- }), Ee = (e, t, r, o) => ({
1172
+ }), Be = (e, t, r, o) => ({
1173
1173
  [`&${e.componentCls}-variant-filled`]: Object.assign({
1174
1174
  boxShadow: "none",
1175
1175
  background: t
@@ -1186,7 +1186,7 @@ const lr = (e, t) => {
1186
1186
  background: e.colorBgSolidHover
1187
1187
  }, {
1188
1188
  background: e.colorBgSolidActive
1189
- })), Be(e)), Ee(e, e.colorFillTertiary, {
1189
+ })), Ee(e)), Be(e, e.colorFillTertiary, {
1190
1190
  background: e.colorFillSecondary
1191
1191
  }, {
1192
1192
  background: e.colorFill
@@ -1206,7 +1206,7 @@ const lr = (e, t) => {
1206
1206
  color: e.colorPrimaryTextActive,
1207
1207
  borderColor: e.colorPrimaryActive,
1208
1208
  background: e.colorBgContainer
1209
- })), Be(e)), Ee(e, e.colorPrimaryBg, {
1209
+ })), Ee(e)), Be(e, e.colorPrimaryBg, {
1210
1210
  background: e.colorPrimaryBgHover
1211
1211
  }, {
1212
1212
  background: e.colorPrimaryBorder
@@ -1235,7 +1235,7 @@ const lr = (e, t) => {
1235
1235
  }, {
1236
1236
  color: e.colorErrorActive,
1237
1237
  borderColor: e.colorErrorActive
1238
- })), Be(e)), Ee(e, e.colorErrorBg, {
1238
+ })), Ee(e)), Be(e, e.colorErrorBg, {
1239
1239
  background: e.colorErrorBgFilledHover
1240
1240
  }, {
1241
1241
  background: e.colorErrorBgActive
@@ -1407,7 +1407,7 @@ const lr = (e, t) => {
1407
1407
  contentLineHeightLG: !0
1408
1408
  }
1409
1409
  });
1410
- function Br(e, t) {
1410
+ function Er(e, t) {
1411
1411
  return {
1412
1412
  // border collapse
1413
1413
  [`&-item:not(${t}-last-item)`]: {
@@ -1423,7 +1423,7 @@ function Br(e, t) {
1423
1423
  }
1424
1424
  };
1425
1425
  }
1426
- function Er(e, t) {
1426
+ function Br(e, t) {
1427
1427
  return {
1428
1428
  [`&-item:not(${t}-first-item):not(${t}-last-item)`]: {
1429
1429
  borderRadius: 0
@@ -1445,7 +1445,7 @@ function Er(e, t) {
1445
1445
  function _r(e) {
1446
1446
  const t = `${e.componentCls}-compact-vertical`;
1447
1447
  return {
1448
- [t]: Object.assign(Object.assign({}, Br(e, t)), Er(e.componentCls, t))
1448
+ [t]: Object.assign(Object.assign({}, Er(e, t)), Br(e.componentCls, t))
1449
1449
  };
1450
1450
  }
1451
1451
  const Or = (e) => {
@@ -1539,8 +1539,8 @@ const Nr = {
1539
1539
  size: b,
1540
1540
  styles: f,
1541
1541
  disabled: p,
1542
- className: B,
1543
- rootClassName: E,
1542
+ className: E,
1543
+ rootClassName: B,
1544
1544
  children: S,
1545
1545
  icon: x,
1546
1546
  iconPosition: O = "start",
@@ -1551,10 +1551,10 @@ const Nr = {
1551
1551
  classNames: T,
1552
1552
  style: w = {},
1553
1553
  autoInsertSpace: z
1554
- } = e, M = Lr(e, ["loading", "prefixCls", "color", "variant", "type", "danger", "shape", "size", "styles", "disabled", "className", "rootClassName", "children", "icon", "iconPosition", "ghost", "block", "htmlType", "classNames", "style", "autoInsertSpace"]), A = c || "default", [F, R] = te(() => {
1554
+ } = e, A = Lr(e, ["loading", "prefixCls", "color", "variant", "type", "danger", "shape", "size", "styles", "disabled", "className", "rootClassName", "children", "icon", "iconPosition", "ghost", "block", "htmlType", "classNames", "style", "autoInsertSpace"]), M = c || "default", [F, R] = te(() => {
1555
1555
  if (a && l)
1556
1556
  return [a, l];
1557
- const H = Nr[A] || [];
1557
+ const H = Nr[M] || [];
1558
1558
  return d ? ["danger", H[1]] : H;
1559
1559
  }, [c, a, l, d]), I = F === "danger" ? "dangerous" : F, {
1560
1560
  getPrefixCls: G,
@@ -1597,13 +1597,13 @@ const Nr = {
1597
1597
  large: "lg",
1598
1598
  small: "sm",
1599
1599
  middle: void 0
1600
- }, ze = Bt((H) => {
1600
+ }, ze = Et((H) => {
1601
1601
  var N, ge;
1602
1602
  return (ge = (N = b ?? ht) !== null && N !== void 0 ? N : gt) !== null && ge !== void 0 ? ge : H;
1603
- }), Ie = ze && ft[ze] || "", mt = V ? "loading" : x, ue = Et(M, ["navigate"]), je = L(v, ct, ut, {
1603
+ }), Ie = ze && ft[ze] || "", mt = V ? "loading" : x, ue = Bt(A, ["navigate"]), je = L(v, ct, ut, {
1604
1604
  [`${v}-${g}`]: g !== "default" && g,
1605
1605
  // line(253 - 254): Compatible with versions earlier than 5.21.0
1606
- [`${v}-${A}`]: A,
1606
+ [`${v}-${M}`]: M,
1607
1607
  [`${v}-dangerous`]: d,
1608
1608
  [`${v}-color-${I}`]: I,
1609
1609
  [`${v}-variant-${R}`]: R,
@@ -1615,7 +1615,7 @@ const Nr = {
1615
1615
  [`${v}-block`]: y,
1616
1616
  [`${v}-rtl`]: W === "rtl",
1617
1617
  [`${v}-icon-end`]: O === "end"
1618
- }, De, B, E, m == null ? void 0 : m.className), Te = Object.assign(Object.assign({}, m == null ? void 0 : m.style), w), vt = L(T == null ? void 0 : T.icon, (o = m == null ? void 0 : m.classNames) === null || o === void 0 ? void 0 : o.icon), bt = Object.assign(Object.assign({}, (f == null ? void 0 : f.icon) || {}), ((n = m == null ? void 0 : m.styles) === null || n === void 0 ? void 0 : n.icon) || {}), Me = x && !V ? /* @__PURE__ */ u.createElement(ke, {
1618
+ }, De, E, B, m == null ? void 0 : m.className), Te = Object.assign(Object.assign({}, m == null ? void 0 : m.style), w), vt = L(T == null ? void 0 : T.icon, (o = m == null ? void 0 : m.classNames) === null || o === void 0 ? void 0 : o.icon), bt = Object.assign(Object.assign({}, (f == null ? void 0 : f.icon) || {}), ((n = m == null ? void 0 : m.styles) === null || n === void 0 ? void 0 : n.icon) || {}), Ae = x && !V ? /* @__PURE__ */ u.createElement(ke, {
1619
1619
  prefixCls: v,
1620
1620
  className: vt,
1621
1621
  style: bt
@@ -1623,7 +1623,7 @@ const Nr = {
1623
1623
  existIcon: !!x,
1624
1624
  prefixCls: v,
1625
1625
  loading: V
1626
- }), Ae = S || S === 0 ? Wt(S, Ne && C) : null;
1626
+ }), Me = S || S === 0 ? Wt(S, Ne && C) : null;
1627
1627
  if (ue.href !== void 0)
1628
1628
  return Re(/* @__PURE__ */ u.createElement("a", Object.assign({}, ue, {
1629
1629
  className: L(je, {
@@ -1634,15 +1634,15 @@ const Nr = {
1634
1634
  onClick: Pe,
1635
1635
  ref: X,
1636
1636
  tabIndex: Q ? -1 : 0
1637
- }), Me, Ae));
1638
- let de = /* @__PURE__ */ u.createElement("button", Object.assign({}, M, {
1637
+ }), Ae, Me));
1638
+ let de = /* @__PURE__ */ u.createElement("button", Object.assign({}, A, {
1639
1639
  type: K,
1640
1640
  className: je,
1641
1641
  style: Te,
1642
1642
  onClick: Pe,
1643
1643
  disabled: Q,
1644
1644
  ref: X
1645
- }), Me, Ae, !!De && /* @__PURE__ */ u.createElement(Rr, {
1645
+ }), Ae, Me, !!De && /* @__PURE__ */ u.createElement(Rr, {
1646
1646
  key: "compact",
1647
1647
  prefixCls: v
1648
1648
  }));
@@ -1651,10 +1651,10 @@ const Nr = {
1651
1651
  disabled: V
1652
1652
  }, de)), Re(de);
1653
1653
  }), Oe = Pr;
1654
- Oe.Group = At;
1654
+ Oe.Group = Mt;
1655
1655
  Oe.__ANT_BUTTON = !0;
1656
1656
  process.env.NODE_ENV !== "production" && (Oe.displayName = "Button");
1657
1657
  export {
1658
1658
  Oe as B,
1659
- Mr as c
1659
+ Ar as c
1660
1660
  };