@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
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  [![NotificationAPI](./ReadmeLogo.svg)](https://notificationapi.com)
2
2
 
3
- The React SDK is mainly used for displaying In-App Notifications and allowing users to see and change their Notification Preferences.
3
+ The React SDK is mainly used for displaying In-App Notifications, allowing users to see and change their Notification Preferences and enabling web push notification .
4
4
 
5
5
  # Docs
6
6
 
@@ -1,4 +1,4 @@
1
- import { w as L, b, _ as c, g as U, I, u as W, d as N, e as R, c as q, f as h, a as F, h as G } from "./presets.js";
1
+ import { w as L, d as b, _ as c, g as U, I, u as W, e as N, f as R, c as q, b as h, a as F, h as G } from "./presets.js";
2
2
  import * as d from "react";
3
3
  import x, { useContext as H, useEffect as J } from "react";
4
4
  function S(n) {
@@ -0,0 +1,13 @@
1
+ import { a as l } from "./presets.js";
2
+ import * as e from "react";
3
+ import { I as o } from "./AntdIcon.js";
4
+ var t = { icon: { tag: "svg", attrs: { "fill-rule": "evenodd", viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, name: "close", theme: "outlined" }, r = function(a, c) {
5
+ return /* @__PURE__ */ e.createElement(o, l({}, a, {
6
+ ref: c,
7
+ icon: t
8
+ }));
9
+ }, n = /* @__PURE__ */ e.forwardRef(r);
10
+ process.env.NODE_ENV !== "production" && (n.displayName = "CloseOutlined");
11
+ export {
12
+ n as R
13
+ };
@@ -2,8 +2,9 @@ import { jsxs as Sr, jsx as Oe } from "react/jsx-runtime";
2
2
  import * as H from "react";
3
3
  import Pe, { useRef as Xt, useDebugValue as Nn, createElement as Bo, useContext as Ho, useMemo as Ve, useCallback as Yo, useState as Wo, useEffect as In } from "react";
4
4
  import { c as Jt, l as Ts, m as Os } from "./presets.js";
5
- import { e as Go, h as xs, D as Xo, t as Jo, T as Fn, R as Zo } from "./index3.js";
6
- import { l as Qo, I as Ko, g as ea, m as ta, r as ra, u as na, j as ia, a as ks, e as Es, c as sa, J as oa } from "./colors.js";
5
+ import { u as xs, n as Go, T as Fn, R as Xo } from "./index3.js";
6
+ import { A as Jo, Q as Zo, g as Qo, m as Ko, r as ea, u as ta, i as ra, a as ks, f as Es, c as na, U as ia } from "./reactNode.js";
7
+ import { a as sa, t as oa } from "./compact-item.js";
7
8
  import { P as aa } from "./index.js";
8
9
  import { B as ua } from "./button.js";
9
10
  import { B as ca } from "./index2.js";
@@ -31,7 +32,7 @@ const Ps = ["xxl", "xl", "lg", "md", "sm", "xs"], la = (e) => ({
31
32
  }), e;
32
33
  };
33
34
  function ha() {
34
- const [, e] = Qo(), t = la(fa(e));
35
+ const [, e] = Jo(), t = la(fa(e));
35
36
  return Pe.useMemo(() => {
36
37
  const r = /* @__PURE__ */ new Map();
37
38
  let n = -1, i = {};
@@ -79,7 +80,7 @@ function pa() {
79
80
  function da() {
80
81
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0;
81
82
  const t = Xt({}), r = pa(), n = ha();
82
- return Ko(() => {
83
+ return Zo(() => {
83
84
  const i = n.subscribe((s) => {
84
85
  t.current = s, e && r();
85
86
  });
@@ -119,7 +120,7 @@ const Fr = /* @__PURE__ */ H.createContext({}), ma = (e) => {
119
120
  }
120
121
  });
121
122
  return {
122
- [r]: Object.assign(Object.assign(Object.assign(Object.assign({}, ra(e)), {
123
+ [r]: Object.assign(Object.assign(Object.assign(Object.assign({}, ea(e)), {
123
124
  position: "relative",
124
125
  display: "inline-flex",
125
126
  justifyContent: "center",
@@ -130,7 +131,7 @@ const Fr = /* @__PURE__ */ H.createContext({}), ma = (e) => {
130
131
  textAlign: "center",
131
132
  verticalAlign: "middle",
132
133
  background: i,
133
- border: `${na(b)} ${D} transparent`,
134
+ border: `${ta(b)} ${D} transparent`,
134
135
  "&-image": {
135
136
  background: "transparent"
136
137
  },
@@ -195,11 +196,11 @@ const Fr = /* @__PURE__ */ H.createContext({}), ma = (e) => {
195
196
  groupOverlapping: -u,
196
197
  groupBorderColor: f
197
198
  };
198
- }, _s = ea("Avatar", (e) => {
199
+ }, _s = Qo("Avatar", (e) => {
199
200
  const {
200
201
  colorTextLightSolid: t,
201
202
  colorTextPlaceholder: r
202
- } = e, n = ta(e, {
203
+ } = e, n = Ko(e, {
203
204
  avatarBg: r,
204
205
  avatarColor: t
205
206
  });
@@ -213,7 +214,7 @@ var va = function(e, t) {
213
214
  return r;
214
215
  };
215
216
  const wa = (e, t) => {
216
- const [r, n] = H.useState(1), [i, s] = H.useState(!1), [o, a] = H.useState(!0), u = H.useRef(null), l = H.useRef(null), f = ia(t, u), {
217
+ const [r, n] = H.useState(1), [i, s] = H.useState(!1), [o, a] = H.useState(!0), u = H.useRef(null), l = H.useRef(null), f = ra(t, u), {
217
218
  getPrefixCls: h,
218
219
  avatar: g
219
220
  } = H.useContext(ks), m = H.useContext(Fr), x = () => {
@@ -250,7 +251,7 @@ const wa = (e, t) => {
250
251
  draggable: K,
251
252
  children: ee,
252
253
  crossOrigin: le
253
- } = e, G = va(e, ["prefixCls", "shape", "size", "src", "srcSet", "icon", "className", "rootClassName", "alt", "draggable", "children", "crossOrigin"]), Y = Go((E) => {
254
+ } = e, G = va(e, ["prefixCls", "shape", "size", "src", "srcSet", "icon", "className", "rootClassName", "alt", "draggable", "children", "crossOrigin"]), Y = sa((E) => {
254
255
  var P, N;
255
256
  return (N = (P = S ?? (m == null ? void 0 : m.size)) !== null && P !== void 0 ? P : E) !== null && N !== void 0 ? N : "default";
256
257
  }), fe = Object.keys(typeof Y == "object" ? Y || {} : {}).some((E) => ["xs", "sm", "md", "lg", "xl", "xxl"].includes(E)), me = da(fe), ae = H.useMemo(() => {
@@ -298,7 +299,7 @@ const wa = (e, t) => {
298
299
  WebkitTransform: E,
299
300
  transform: E
300
301
  };
301
- $ = /* @__PURE__ */ H.createElement(Xo, {
302
+ $ = /* @__PURE__ */ H.createElement(Go, {
302
303
  onResize: x
303
304
  }, /* @__PURE__ */ H.createElement("span", {
304
305
  className: `${q}-string`,
@@ -356,7 +357,7 @@ const Mn = (e) => {
356
357
  }
357
358
  const S = i("avatar", o), T = `${S}-group`, k = xs(S), [p, A, _] = _s(S, k), Z = Jt(T, {
358
359
  [`${T}-rtl`]: s === "rtl"
359
- }, _, k, a, u, A), K = Jo(D).map((G, Y) => sa(G, {
360
+ }, _, k, a, u, A), K = oa(D).map((G, Y) => na(G, {
360
361
  key: `avatar-key-${Y}`
361
362
  })), ee = (w == null ? void 0 : w.count) || f, le = K.length;
362
363
  if (ee && ee < le) {
@@ -3734,7 +3735,7 @@ var Ar, zi;
3734
3735
  function el() {
3735
3736
  if (zi) return Ar;
3736
3737
  zi = 1;
3737
- var e = yo(), t = oa(), r = Sn(), n = vo(), i = Kc(), s = function() {
3738
+ var e = yo(), t = ia(), r = Sn(), n = vo(), i = Kc(), s = function() {
3738
3739
  };
3739
3740
  process.env.NODE_ENV !== "production" && (s = function(a) {
3740
3741
  var u = "Warning: " + a;
@@ -7648,7 +7649,7 @@ const Dd = eo.div`
7648
7649
  &:hover .notification-archive-button {
7649
7650
  visibility: ${(e) => e.$archived ? "hidden" : "visible"};
7650
7651
  }
7651
- `, Ud = (e) => {
7652
+ `, Vd = (e) => {
7652
7653
  var x, b, D, w;
7653
7654
  if (e.renderer)
7654
7655
  return e.renderer(e.notifications);
@@ -7732,7 +7733,7 @@ const Dd = eo.div`
7732
7733
  ua,
7733
7734
  {
7734
7735
  className: "notification-archive-button",
7735
- icon: /* @__PURE__ */ Oe(Zo, {}),
7736
+ icon: /* @__PURE__ */ Oe(Xo, {}),
7736
7737
  size: "small",
7737
7738
  type: "text",
7738
7739
  shape: "circle",
@@ -7762,7 +7763,7 @@ const Dd = eo.div`
7762
7763
  };
7763
7764
  export {
7764
7765
  Dn as L,
7765
- Ud as N,
7766
+ Vd as N,
7766
7767
  da as a,
7767
7768
  Ps as r,
7768
7769
  ha as u