@notificationapi/react 0.0.24 → 0.0.25
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/AntdIcon.js +200 -0
- package/dist/assets/Notification.js +118 -119
- package/dist/assets/PurePanel.js +69 -0
- package/dist/assets/RightOutlined.js +13 -0
- package/dist/assets/button.js +19 -18
- package/dist/assets/channelUtils.js +77 -0
- package/dist/assets/colors.js +8534 -9304
- package/dist/assets/index.js +16 -15
- package/dist/assets/index2.js +33 -32
- package/dist/assets/index3.js +722 -8531
- package/dist/assets/index4.js +8408 -0
- package/dist/assets/pickAttrs.js +42 -0
- package/dist/components/Notifications/Inbox.d.ts +3 -7
- package/dist/components/Notifications/Inbox.js +6250 -8
- package/dist/components/Notifications/InboxHeader.d.ts +1 -1
- package/dist/components/Notifications/InboxHeader.js +8 -7
- package/dist/components/Notifications/Notification.d.ts +2 -5
- package/dist/components/Notifications/Notification.js +3 -4
- package/dist/components/Notifications/NotificationCounter.d.ts +2 -2
- package/dist/components/Notifications/NotificationFeed.d.ts +4 -5
- package/dist/components/Notifications/NotificationFeed.js +28 -26
- package/dist/components/Notifications/NotificationLauncher.d.ts +1 -6
- package/dist/components/Notifications/NotificationLauncher.js +16 -18
- package/dist/components/Notifications/NotificationPopup.d.ts +5 -9
- package/dist/components/Notifications/NotificationPopup.js +119 -12
- package/dist/components/Notifications/UnreadBadge.d.ts +4 -7
- package/dist/components/Notifications/UnreadBadge.js +8 -10
- package/dist/components/Notifications/index.js +5 -5
- package/dist/components/Notifications/interface.d.ts +46 -0
- package/dist/components/Notifications/interface.js +19 -0
- package/dist/components/Preferences/NotificationPreferencesInline.d.ts +1 -1
- package/dist/components/Preferences/NotificationPreferencesInline.js +1 -1
- package/dist/components/Preferences/NotificationPreferencesPopup.js +1503 -4
- package/dist/components/Preferences/PreferenceInput.d.ts +5 -4
- package/dist/components/Preferences/PreferenceInput.js +1435 -4
- package/dist/components/Preferences/Preferences.d.ts +1 -4
- package/dist/components/Preferences/Preferences.js +581 -8
- package/dist/components/Preferences/channelUtils.d.ts +4 -0
- package/dist/components/Preferences/channelUtils.js +8 -0
- package/dist/components/Preferences/index.js +1 -1
- package/dist/components/Provider/index.d.ts +2 -2
- package/dist/components/Provider/index.js +150 -126
- package/dist/main.d.ts +2 -2
- package/dist/main.js +9 -9
- package/package.json +5 -2
- package/dist/assets/Inbox.js +0 -6363
- package/dist/assets/NotificationPreferencesPopup.js +0 -1562
- package/dist/assets/Preferences.js +0 -2120
package/dist/assets/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as a from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { i as
|
|
2
|
+
import { c as P } from "./index3.js";
|
|
3
|
+
import { i as z, g as M, a as R, b as V, P as A, u as H, c as L, d as K, K as F } from "./index4.js";
|
|
4
|
+
import { g as G, m as U, r as X, P as Y, a as S, c as Z } from "./colors.js";
|
|
4
5
|
const b = (e) => e ? typeof e == "function" ? e() : e : null, q = (e) => {
|
|
5
6
|
const {
|
|
6
7
|
componentCls: n,
|
|
@@ -21,7 +22,7 @@ const b = (e) => e ? typeof e == "function" ? e() : e : null, q = (e) => {
|
|
|
21
22
|
} = e;
|
|
22
23
|
return [
|
|
23
24
|
{
|
|
24
|
-
[n]: Object.assign(Object.assign({},
|
|
25
|
+
[n]: Object.assign(Object.assign({}, X(e)), {
|
|
25
26
|
position: "absolute",
|
|
26
27
|
top: 0,
|
|
27
28
|
// use `left` to fix https://github.com/ant-design/ant-design/issues/39195
|
|
@@ -70,7 +71,7 @@ const b = (e) => e ? typeof e == "function" ? e() : e : null, q = (e) => {
|
|
|
70
71
|
})
|
|
71
72
|
},
|
|
72
73
|
// Arrow Style
|
|
73
|
-
|
|
74
|
+
M(e, "var(--antd-arrow-background-color)"),
|
|
74
75
|
// Pure Render
|
|
75
76
|
{
|
|
76
77
|
[`${n}-pure`]: {
|
|
@@ -89,7 +90,7 @@ const b = (e) => e ? typeof e == "function" ? e() : e : null, q = (e) => {
|
|
|
89
90
|
componentCls: n
|
|
90
91
|
} = e;
|
|
91
92
|
return {
|
|
92
|
-
[n]:
|
|
93
|
+
[n]: Y.map((o) => {
|
|
93
94
|
const t = e[`${o}6`];
|
|
94
95
|
return {
|
|
95
96
|
[`&${n}-${o}`]: {
|
|
@@ -121,7 +122,7 @@ const b = (e) => e ? typeof e == "function" ? e() : e : null, q = (e) => {
|
|
|
121
122
|
return Object.assign(Object.assign(Object.assign({
|
|
122
123
|
titleMinWidth: 177,
|
|
123
124
|
zIndexPopup: i + 30
|
|
124
|
-
},
|
|
125
|
+
}, R(e)), V({
|
|
125
126
|
contentRadius: c,
|
|
126
127
|
limitVerticalRadius: !0
|
|
127
128
|
})), {
|
|
@@ -132,15 +133,15 @@ const b = (e) => e ? typeof e == "function" ? e() : e : null, q = (e) => {
|
|
|
132
133
|
titleBorderBottom: l ? `${n}px ${f} ${p}` : "none",
|
|
133
134
|
innerContentPadding: l ? `${v}px ${g}px` : 0
|
|
134
135
|
});
|
|
135
|
-
}, $ =
|
|
136
|
+
}, $ = G("Popover", (e) => {
|
|
136
137
|
const {
|
|
137
138
|
colorBgElevated: n,
|
|
138
139
|
colorText: o
|
|
139
|
-
} = e, t =
|
|
140
|
+
} = e, t = U(e, {
|
|
140
141
|
popoverBg: n,
|
|
141
142
|
popoverColor: o
|
|
142
143
|
});
|
|
143
|
-
return [q(t), J(t),
|
|
144
|
+
return [q(t), J(t), z(t, "zoom-big")];
|
|
144
145
|
}, Q, {
|
|
145
146
|
resetStyle: !1,
|
|
146
147
|
deprecatedTokens: [["width", "titleMinWidth"], ["minWidth", "titleMinWidth"]]
|
|
@@ -174,7 +175,7 @@ const te = (e, n, o) => !n && !o ? null : /* @__PURE__ */ a.createElement(a.Frag
|
|
|
174
175
|
style: r
|
|
175
176
|
}, /* @__PURE__ */ a.createElement("div", {
|
|
176
177
|
className: `${o}-arrow`
|
|
177
|
-
}), /* @__PURE__ */ a.createElement(
|
|
178
|
+
}), /* @__PURE__ */ a.createElement(A, Object.assign({}, e, {
|
|
178
179
|
className: n,
|
|
179
180
|
prefixCls: o
|
|
180
181
|
}), d || te(o, i, c)));
|
|
@@ -227,17 +228,17 @@ const ae = (e) => {
|
|
|
227
228
|
overlayStyle: y = {}
|
|
228
229
|
} = e, g = re(e, ["prefixCls", "title", "content", "overlayClassName", "placement", "trigger", "children", "mouseEnterDelay", "mouseLeaveDelay", "onOpenChange", "overlayStyle"]), {
|
|
229
230
|
getPrefixCls: O
|
|
230
|
-
} = a.useContext(S), x = O("popover", r), [N, B, j] = $(x), _ = O(), k = P(c, B, j), [I, T] =
|
|
231
|
+
} = a.useContext(S), x = O("popover", r), [N, B, j] = $(x), _ = O(), k = P(c, B, j), [I, T] = H(!1, {
|
|
231
232
|
value: (o = e.open) !== null && o !== void 0 ? o : e.visible,
|
|
232
233
|
defaultValue: (t = e.defaultOpen) !== null && t !== void 0 ? t : e.defaultVisible
|
|
233
234
|
}), w = (s, C) => {
|
|
234
235
|
T(s, !0), m == null || m(s, C);
|
|
235
236
|
}, W = (s) => {
|
|
236
|
-
s.keyCode ===
|
|
237
|
+
s.keyCode === F.ESC && w(!1, s);
|
|
237
238
|
}, D = (s) => {
|
|
238
239
|
w(s);
|
|
239
240
|
};
|
|
240
|
-
return N(/* @__PURE__ */ a.createElement(
|
|
241
|
+
return N(/* @__PURE__ */ a.createElement(L, Object.assign({
|
|
241
242
|
placement: d,
|
|
242
243
|
trigger: f,
|
|
243
244
|
mouseEnterDelay: v,
|
|
@@ -254,9 +255,9 @@ const ae = (e) => {
|
|
|
254
255
|
title: l,
|
|
255
256
|
content: i
|
|
256
257
|
}) : null,
|
|
257
|
-
transitionName:
|
|
258
|
+
transitionName: K(_, "zoom-big", g.transitionName),
|
|
258
259
|
"data-popover-inject": !0
|
|
259
|
-
}),
|
|
260
|
+
}), Z(p, {
|
|
260
261
|
onKeyDown: (s) => {
|
|
261
262
|
var C, h;
|
|
262
263
|
/* @__PURE__ */ a.isValidElement(p) && ((h = p == null ? void 0 : (C = p.props).onKeyDown) === null || h === void 0 || h.call(C, s)), W(s);
|
package/dist/assets/index2.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as l from "react";
|
|
2
2
|
import { useMemo as et, useRef as X } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { c as w } from "./index3.js";
|
|
4
|
+
import { g as nt, K as z, b as rt, r as it, u as j, m as Ot, a as K, i as st, c as at, d as xt } from "./colors.js";
|
|
4
5
|
const wt = new z("antStatusProcessing", {
|
|
5
6
|
"0%": {
|
|
6
7
|
transform: "scale(0.8)",
|
|
@@ -65,8 +66,8 @@ const wt = new z("antStatusProcessing", {
|
|
|
65
66
|
indicatorHeight: s,
|
|
66
67
|
indicatorHeightSM: c,
|
|
67
68
|
marginXS: f,
|
|
68
|
-
calc:
|
|
69
|
-
} = t, u = `${n}-scroll-number`,
|
|
69
|
+
calc: v
|
|
70
|
+
} = t, u = `${n}-scroll-number`, C = rt(t, (b, $) => {
|
|
70
71
|
let {
|
|
71
72
|
darkColor: S
|
|
72
73
|
} = $;
|
|
@@ -101,7 +102,7 @@ const wt = new z("antStatusProcessing", {
|
|
|
101
102
|
whiteSpace: "nowrap",
|
|
102
103
|
textAlign: "center",
|
|
103
104
|
background: t.badgeColor,
|
|
104
|
-
borderRadius:
|
|
105
|
+
borderRadius: v(s).div(2).equal(),
|
|
105
106
|
boxShadow: `0 0 0 ${j(o)} ${t.badgeShadowColor}`,
|
|
106
107
|
transition: `background ${t.motionDurationMid}`,
|
|
107
108
|
a: {
|
|
@@ -119,7 +120,7 @@ const wt = new z("antStatusProcessing", {
|
|
|
119
120
|
height: c,
|
|
120
121
|
fontSize: h,
|
|
121
122
|
lineHeight: j(c),
|
|
122
|
-
borderRadius:
|
|
123
|
+
borderRadius: v(c).div(2).equal()
|
|
123
124
|
},
|
|
124
125
|
[`${e}-multiple-words`]: {
|
|
125
126
|
padding: `0 ${j(t.paddingXS)}`,
|
|
@@ -204,7 +205,7 @@ const wt = new z("antStatusProcessing", {
|
|
|
204
205
|
fontSize: t.fontSize
|
|
205
206
|
}
|
|
206
207
|
}
|
|
207
|
-
}),
|
|
208
|
+
}), C), {
|
|
208
209
|
[`${e}-zoom-appear, ${e}-zoom-enter`]: {
|
|
209
210
|
animationName: jt,
|
|
210
211
|
animationDuration: t.motionDurationSlow,
|
|
@@ -396,14 +397,14 @@ const wt = new z("antStatusProcessing", {
|
|
|
396
397
|
} = t, {
|
|
397
398
|
getPrefixCls: g,
|
|
398
399
|
direction: m
|
|
399
|
-
} = l.useContext(K), s = g("ribbon", i), c = `${s}-wrapper`, [f,
|
|
400
|
+
} = l.useContext(K), s = g("ribbon", i), c = `${s}-wrapper`, [f, v, u] = Dt(s, c), C = st(o, !1), b = w(s, `${s}-placement-${h}`, {
|
|
400
401
|
[`${s}-rtl`]: m === "rtl",
|
|
401
|
-
[`${s}-color-${o}`]:
|
|
402
|
+
[`${s}-color-${o}`]: C
|
|
402
403
|
}, e), $ = {}, S = {};
|
|
403
|
-
return o && !
|
|
404
|
-
className: w(c, y,
|
|
404
|
+
return o && !C && ($.background = o, S.color = o), f(/* @__PURE__ */ l.createElement("div", {
|
|
405
|
+
className: w(c, y, v, u)
|
|
405
406
|
}, d, /* @__PURE__ */ l.createElement("div", {
|
|
406
|
-
className: w(b,
|
|
407
|
+
className: w(b, v),
|
|
407
408
|
style: Object.assign(Object.assign({}, $), n)
|
|
408
409
|
}, /* @__PURE__ */ l.createElement("span", {
|
|
409
410
|
className: `${s}-text`
|
|
@@ -463,11 +464,11 @@ function Ft(t) {
|
|
|
463
464
|
};
|
|
464
465
|
else {
|
|
465
466
|
s = [];
|
|
466
|
-
const f = o + 10,
|
|
467
|
+
const f = o + 10, v = [];
|
|
467
468
|
for (let b = o; b <= f; b += 1)
|
|
468
|
-
|
|
469
|
-
const u =
|
|
470
|
-
s =
|
|
469
|
+
v.push(b);
|
|
470
|
+
const u = v.findIndex((b) => b % 10 === a);
|
|
471
|
+
s = v.map((b, $) => {
|
|
471
472
|
const S = b % 10;
|
|
472
473
|
return /* @__PURE__ */ l.createElement(ot, Object.assign({}, t, {
|
|
473
474
|
key: b,
|
|
@@ -476,9 +477,9 @@ function Ft(t) {
|
|
|
476
477
|
current: $ === u
|
|
477
478
|
}));
|
|
478
479
|
});
|
|
479
|
-
const
|
|
480
|
+
const C = y < d ? 1 : -1;
|
|
480
481
|
c = {
|
|
481
|
-
transform: `translateY(${-Wt(a, o,
|
|
482
|
+
transform: `translateY(${-Wt(a, o, C)}00%)`
|
|
482
483
|
};
|
|
483
484
|
}
|
|
484
485
|
return /* @__PURE__ */ l.createElement("span", {
|
|
@@ -509,7 +510,7 @@ const _t = /* @__PURE__ */ l.forwardRef((t, e) => {
|
|
|
509
510
|
children: m
|
|
510
511
|
} = t, s = Ht(t, ["prefixCls", "count", "className", "motionClassName", "style", "title", "show", "component", "children"]), {
|
|
511
512
|
getPrefixCls: c
|
|
512
|
-
} = l.useContext(K), f = c("scroll-number", i),
|
|
513
|
+
} = l.useContext(K), f = c("scroll-number", i), v = Object.assign(Object.assign({}, s), {
|
|
513
514
|
"data-show": y,
|
|
514
515
|
style: a,
|
|
515
516
|
className: w(f, o, d),
|
|
@@ -517,20 +518,20 @@ const _t = /* @__PURE__ */ l.forwardRef((t, e) => {
|
|
|
517
518
|
});
|
|
518
519
|
let u = n;
|
|
519
520
|
if (n && Number(n) % 1 === 0) {
|
|
520
|
-
const
|
|
521
|
-
u = /* @__PURE__ */ l.createElement("bdi", null,
|
|
521
|
+
const C = String(n).split("");
|
|
522
|
+
u = /* @__PURE__ */ l.createElement("bdi", null, C.map((b, $) => /* @__PURE__ */ l.createElement(Ft, {
|
|
522
523
|
prefixCls: f,
|
|
523
524
|
count: Number(n),
|
|
524
525
|
value: b,
|
|
525
526
|
// eslint-disable-next-line react/no-array-index-key
|
|
526
|
-
key:
|
|
527
|
+
key: C.length - $
|
|
527
528
|
})));
|
|
528
529
|
}
|
|
529
|
-
return a && a.borderColor && (
|
|
530
|
+
return a && a.borderColor && (v.style = Object.assign(Object.assign({}, a), {
|
|
530
531
|
boxShadow: `0 0 0 1px ${a.borderColor} inset`
|
|
531
|
-
})), m ? at(m, (
|
|
532
|
-
className: w(`${f}-custom-component`,
|
|
533
|
-
})) : /* @__PURE__ */ l.createElement(g, Object.assign({},
|
|
532
|
+
})), m ? at(m, (C) => ({
|
|
533
|
+
className: w(`${f}-custom-component`, C == null ? void 0 : C.className, d)
|
|
534
|
+
})) : /* @__PURE__ */ l.createElement(g, Object.assign({}, v, {
|
|
534
535
|
ref: e
|
|
535
536
|
}), u);
|
|
536
537
|
});
|
|
@@ -553,9 +554,9 @@ const Mt = /* @__PURE__ */ l.forwardRef((t, e) => {
|
|
|
553
554
|
text: s,
|
|
554
555
|
color: c,
|
|
555
556
|
count: f = null,
|
|
556
|
-
overflowCount:
|
|
557
|
+
overflowCount: v = 99,
|
|
557
558
|
dot: u = !1,
|
|
558
|
-
size:
|
|
559
|
+
size: C = "default",
|
|
559
560
|
title: b,
|
|
560
561
|
offset: $,
|
|
561
562
|
style: S,
|
|
@@ -568,7 +569,7 @@ const Mt = /* @__PURE__ */ l.forwardRef((t, e) => {
|
|
|
568
569
|
getPrefixCls: Y,
|
|
569
570
|
direction: H,
|
|
570
571
|
badge: r
|
|
571
|
-
} = l.useContext(K), p = Y("badge", h), [k, gt, ft] = Tt(p), _ = f >
|
|
572
|
+
} = l.useContext(K), p = Y("badge", h), [k, gt, ft] = Tt(p), _ = f > v ? `${v}+` : f, T = _ === "0" || _ === 0, pt = f === null || T && !F, Z = (m != null || c != null) && pt, B = u && !T, E = B ? "" : _, P = et(() => (E == null || E === "" || T && !F) && !B, [E, T, F, B]), G = X(f);
|
|
572
573
|
P || (G.current = f);
|
|
573
574
|
const I = G.current, J = X(E);
|
|
574
575
|
P || (J.current = E);
|
|
@@ -581,7 +582,7 @@ const Mt = /* @__PURE__ */ l.forwardRef((t, e) => {
|
|
|
581
582
|
marginTop: $[1]
|
|
582
583
|
};
|
|
583
584
|
return H === "rtl" ? O.left = parseInt($[0], 10) : O.right = -parseInt($[0], 10), Object.assign(Object.assign(Object.assign({}, O), r == null ? void 0 : r.style), S);
|
|
584
|
-
}, [H, $, S, r == null ? void 0 : r.style]),
|
|
585
|
+
}, [H, $, S, r == null ? void 0 : r.style]), vt = b ?? (typeof I == "string" || typeof I == "number" ? I : void 0), Ct = P || !s ? null : /* @__PURE__ */ l.createElement("span", {
|
|
585
586
|
className: `${p}-status-text`
|
|
586
587
|
}, s), $t = !I || typeof I != "object" ? void 0 : at(I, (O) => ({
|
|
587
588
|
style: Object.assign(Object.assign({}, R), O.style)
|
|
@@ -629,7 +630,7 @@ const Mt = /* @__PURE__ */ l.forwardRef((t, e) => {
|
|
|
629
630
|
const St = Y("scroll-number", y), L = Q.current, Nt = w(x == null ? void 0 : x.indicator, (A = r == null ? void 0 : r.classNames) === null || A === void 0 ? void 0 : A.indicator, {
|
|
630
631
|
[`${p}-dot`]: L,
|
|
631
632
|
[`${p}-count`]: !L,
|
|
632
|
-
[`${p}-count-sm`]:
|
|
633
|
+
[`${p}-count-sm`]: C === "small",
|
|
633
634
|
[`${p}-multiple-words`]: !L && M && M.toString().length > 1,
|
|
634
635
|
[`${p}-status-${m}`]: !!m,
|
|
635
636
|
[`${p}-color-${c}`]: D
|
|
@@ -641,11 +642,11 @@ const Mt = /* @__PURE__ */ l.forwardRef((t, e) => {
|
|
|
641
642
|
motionClassName: ht,
|
|
642
643
|
className: Nt,
|
|
643
644
|
count: M,
|
|
644
|
-
title:
|
|
645
|
+
title: vt,
|
|
645
646
|
style: W,
|
|
646
647
|
key: "scrollNumber"
|
|
647
648
|
}, $t);
|
|
648
|
-
}),
|
|
649
|
+
}), Ct));
|
|
649
650
|
}), ut = Mt;
|
|
650
651
|
ut.Ribbon = dt;
|
|
651
652
|
process.env.NODE_ENV !== "production" && (ut.displayName = "Badge");
|