@notificationapi/react 0.0.24 → 0.0.26
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 +579 -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 +8 -2
- package/dist/components/Provider/index.js +162 -135
- 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
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { w as L, b, _ as c, g as U, I, u as W, d as N, e as R, f as q, c as F, h, a as G } from "./index3.js";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import x, { useContext as H, useEffect as J } from "react";
|
|
4
|
+
function S(n) {
|
|
5
|
+
var o;
|
|
6
|
+
return n == null || (o = n.getRootNode) === null || o === void 0 ? void 0 : o.call(n);
|
|
7
|
+
}
|
|
8
|
+
function K(n) {
|
|
9
|
+
return S(n) instanceof ShadowRoot;
|
|
10
|
+
}
|
|
11
|
+
function M(n) {
|
|
12
|
+
return K(n) ? S(n) : null;
|
|
13
|
+
}
|
|
14
|
+
function Q(n) {
|
|
15
|
+
return n.replace(/-(.)/g, function(o, e) {
|
|
16
|
+
return e.toUpperCase();
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function V(n, o) {
|
|
20
|
+
L(n, "[@ant-design/icons] ".concat(o));
|
|
21
|
+
}
|
|
22
|
+
function _(n) {
|
|
23
|
+
return b(n) === "object" && typeof n.name == "string" && typeof n.theme == "string" && (b(n.icon) === "object" || typeof n.icon == "function");
|
|
24
|
+
}
|
|
25
|
+
function k() {
|
|
26
|
+
var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
27
|
+
return Object.keys(n).reduce(function(o, e) {
|
|
28
|
+
var r = n[e];
|
|
29
|
+
switch (e) {
|
|
30
|
+
case "class":
|
|
31
|
+
o.className = r, delete o.class;
|
|
32
|
+
break;
|
|
33
|
+
default:
|
|
34
|
+
delete o[e], o[Q(e)] = r;
|
|
35
|
+
}
|
|
36
|
+
return o;
|
|
37
|
+
}, {});
|
|
38
|
+
}
|
|
39
|
+
function p(n, o, e) {
|
|
40
|
+
return e ? /* @__PURE__ */ x.createElement(n.tag, c(c({
|
|
41
|
+
key: o
|
|
42
|
+
}, k(n.attrs)), e), (n.children || []).map(function(r, t) {
|
|
43
|
+
return p(r, "".concat(o, "-").concat(n.tag, "-").concat(t));
|
|
44
|
+
})) : /* @__PURE__ */ x.createElement(n.tag, c({
|
|
45
|
+
key: o
|
|
46
|
+
}, k(n.attrs)), (n.children || []).map(function(r, t) {
|
|
47
|
+
return p(r, "".concat(o, "-").concat(n.tag, "-").concat(t));
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
function z(n) {
|
|
51
|
+
return U(n)[0];
|
|
52
|
+
}
|
|
53
|
+
function E(n) {
|
|
54
|
+
return n ? Array.isArray(n) ? n : [n] : [];
|
|
55
|
+
}
|
|
56
|
+
var X = `
|
|
57
|
+
.anticon {
|
|
58
|
+
display: inline-flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
color: inherit;
|
|
61
|
+
font-style: normal;
|
|
62
|
+
line-height: 0;
|
|
63
|
+
text-align: center;
|
|
64
|
+
text-transform: none;
|
|
65
|
+
vertical-align: -0.125em;
|
|
66
|
+
text-rendering: optimizeLegibility;
|
|
67
|
+
-webkit-font-smoothing: antialiased;
|
|
68
|
+
-moz-osx-font-smoothing: grayscale;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.anticon > * {
|
|
72
|
+
line-height: 1;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.anticon svg {
|
|
76
|
+
display: inline-block;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.anticon::before {
|
|
80
|
+
display: none;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.anticon .anticon-icon {
|
|
84
|
+
display: block;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.anticon[tabindex] {
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.anticon-spin::before,
|
|
92
|
+
.anticon-spin {
|
|
93
|
+
display: inline-block;
|
|
94
|
+
-webkit-animation: loadingCircle 1s infinite linear;
|
|
95
|
+
animation: loadingCircle 1s infinite linear;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@-webkit-keyframes loadingCircle {
|
|
99
|
+
100% {
|
|
100
|
+
-webkit-transform: rotate(360deg);
|
|
101
|
+
transform: rotate(360deg);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@keyframes loadingCircle {
|
|
106
|
+
100% {
|
|
107
|
+
-webkit-transform: rotate(360deg);
|
|
108
|
+
transform: rotate(360deg);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
`, Y = function(o) {
|
|
112
|
+
var e = H(I), r = e.csp, t = e.prefixCls, i = X;
|
|
113
|
+
t && (i = i.replace(/anticon/g, t)), J(function() {
|
|
114
|
+
var l = o.current, s = M(l);
|
|
115
|
+
W(i, "@ant-design-icons", {
|
|
116
|
+
prepend: !0,
|
|
117
|
+
csp: r,
|
|
118
|
+
attachTo: s
|
|
119
|
+
});
|
|
120
|
+
}, []);
|
|
121
|
+
}, Z = ["icon", "className", "onClick", "style", "primaryColor", "secondaryColor"], f = {
|
|
122
|
+
primaryColor: "#333",
|
|
123
|
+
secondaryColor: "#E6E6E6",
|
|
124
|
+
calculated: !1
|
|
125
|
+
};
|
|
126
|
+
function nn(n) {
|
|
127
|
+
var o = n.primaryColor, e = n.secondaryColor;
|
|
128
|
+
f.primaryColor = o, f.secondaryColor = e || z(o), f.calculated = !!e;
|
|
129
|
+
}
|
|
130
|
+
function on() {
|
|
131
|
+
return c({}, f);
|
|
132
|
+
}
|
|
133
|
+
var u = function(o) {
|
|
134
|
+
var e = o.icon, r = o.className, t = o.onClick, i = o.style, l = o.primaryColor, s = o.secondaryColor, y = N(o, Z), C = d.useRef(), m = f;
|
|
135
|
+
if (l && (m = {
|
|
136
|
+
primaryColor: l,
|
|
137
|
+
secondaryColor: s || z(l)
|
|
138
|
+
}), Y(C), V(_(e), "icon should be icon definiton, but got ".concat(e)), !_(e))
|
|
139
|
+
return null;
|
|
140
|
+
var a = e;
|
|
141
|
+
return a && typeof a.icon == "function" && (a = c(c({}, a), {}, {
|
|
142
|
+
icon: a.icon(m.primaryColor, m.secondaryColor)
|
|
143
|
+
})), p(a.icon, "svg-".concat(a.name), c(c({
|
|
144
|
+
className: r,
|
|
145
|
+
onClick: t,
|
|
146
|
+
style: i,
|
|
147
|
+
"data-icon": a.name,
|
|
148
|
+
width: "1em",
|
|
149
|
+
height: "1em",
|
|
150
|
+
fill: "currentColor",
|
|
151
|
+
"aria-hidden": "true"
|
|
152
|
+
}, y), {}, {
|
|
153
|
+
ref: C
|
|
154
|
+
}));
|
|
155
|
+
};
|
|
156
|
+
u.displayName = "IconReact";
|
|
157
|
+
u.getTwoToneColors = on;
|
|
158
|
+
u.setTwoToneColors = nn;
|
|
159
|
+
function $(n) {
|
|
160
|
+
var o = E(n), e = R(o, 2), r = e[0], t = e[1];
|
|
161
|
+
return u.setTwoToneColors({
|
|
162
|
+
primaryColor: r,
|
|
163
|
+
secondaryColor: t
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
function en() {
|
|
167
|
+
var n = u.getTwoToneColors();
|
|
168
|
+
return n.calculated ? [n.primaryColor, n.secondaryColor] : n.primaryColor;
|
|
169
|
+
}
|
|
170
|
+
var rn = ["className", "icon", "spin", "rotate", "tabIndex", "onClick", "twoToneColor"];
|
|
171
|
+
$(q.primary);
|
|
172
|
+
var T = /* @__PURE__ */ d.forwardRef(function(n, o) {
|
|
173
|
+
var e = n.className, r = n.icon, t = n.spin, i = n.rotate, l = n.tabIndex, s = n.onClick, y = n.twoToneColor, C = N(n, rn), m = d.useContext(I), a = m.prefixCls, g = a === void 0 ? "anticon" : a, j = m.rootClassName, A = F(j, g, h(h({}, "".concat(g, "-").concat(r.name), !!r.name), "".concat(g, "-spin"), !!t || r.name === "loading"), e), v = l;
|
|
174
|
+
v === void 0 && s && (v = -1);
|
|
175
|
+
var P = i ? {
|
|
176
|
+
msTransform: "rotate(".concat(i, "deg)"),
|
|
177
|
+
transform: "rotate(".concat(i, "deg)")
|
|
178
|
+
} : void 0, B = E(y), w = R(B, 2), O = w[0], D = w[1];
|
|
179
|
+
return /* @__PURE__ */ d.createElement("span", G({
|
|
180
|
+
role: "img",
|
|
181
|
+
"aria-label": r.name
|
|
182
|
+
}, C, {
|
|
183
|
+
ref: o,
|
|
184
|
+
tabIndex: v,
|
|
185
|
+
onClick: s,
|
|
186
|
+
className: A
|
|
187
|
+
}), /* @__PURE__ */ d.createElement(u, {
|
|
188
|
+
icon: r,
|
|
189
|
+
primaryColor: O,
|
|
190
|
+
secondaryColor: D,
|
|
191
|
+
style: P
|
|
192
|
+
}));
|
|
193
|
+
});
|
|
194
|
+
T.displayName = "AntdIcon";
|
|
195
|
+
T.getTwoToneColor = en;
|
|
196
|
+
T.setTwoToneColor = $;
|
|
197
|
+
export {
|
|
198
|
+
T as I,
|
|
199
|
+
M as g
|
|
200
|
+
};
|