@notificationapi/react 0.0.31 → 0.0.33
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 +4 -4
- package/dist/assets/Notification.js +3094 -2713
- package/dist/assets/PurePanel.js +2 -2
- package/dist/assets/RightOutlined.js +1 -1
- package/dist/assets/button.js +1394 -577
- package/dist/assets/channelUtils.js +1 -1
- package/dist/assets/colors.js +14798 -14301
- package/dist/assets/index.js +156 -158
- package/dist/assets/index2.js +212 -221
- package/dist/assets/index3.js +8307 -724
- package/dist/assets/pickAttrs.js +1 -1
- package/dist/assets/presets.js +810 -0
- package/dist/components/Notifications/Inbox.js +3520 -3323
- package/dist/components/Notifications/InboxHeader.d.ts +1 -2
- package/dist/components/Notifications/InboxHeader.js +2 -2
- package/dist/components/Notifications/Notification.js +1 -1
- package/dist/components/Notifications/NotificationFeed.js +1 -2
- package/dist/components/Preferences/NotificationPreferencesInline.d.ts +1 -2
- package/dist/components/Preferences/NotificationPreferencesPopup.d.ts +1 -2
- package/dist/components/Preferences/NotificationPreferencesPopup.js +1423 -857
- package/dist/components/Preferences/PreferenceInput.d.ts +1 -1
- package/dist/components/Preferences/PreferenceInput.js +843 -812
- package/dist/components/Preferences/Preferences.d.ts +1 -2
- package/dist/components/Preferences/Preferences.js +331 -328
- package/dist/components/Preferences/channelUtils.js +1 -1
- package/dist/components/Provider/index.d.ts +1 -0
- package/dist/components/Provider/index.js +27 -34
- package/package.json +5 -5
- package/dist/assets/index4.js +0 -8408
package/dist/assets/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import * as a from "react";
|
|
2
|
-
import { c as P } from "./
|
|
3
|
-
import { i as
|
|
4
|
-
import { g as
|
|
5
|
-
const
|
|
2
|
+
import { c as P } from "./presets.js";
|
|
3
|
+
import { i as V, g as A, a as H, b as L, P as K, u as F, c as G, d as U, K as X } from "./index3.js";
|
|
4
|
+
import { g as Y, m as Z, r as q, P as J, a as N, c as Q } from "./colors.js";
|
|
5
|
+
const x = (e) => e ? typeof e == "function" ? e() : e : null, ee = (e) => {
|
|
6
6
|
const {
|
|
7
|
-
componentCls:
|
|
8
|
-
popoverColor:
|
|
7
|
+
componentCls: o,
|
|
8
|
+
popoverColor: n,
|
|
9
9
|
titleMinWidth: t,
|
|
10
10
|
fontWeightStrong: r,
|
|
11
11
|
innerPadding: l,
|
|
12
|
-
boxShadowSecondary:
|
|
13
|
-
colorTextHeading:
|
|
14
|
-
borderRadiusLG:
|
|
15
|
-
zIndexPopup:
|
|
16
|
-
titleMarginBottom:
|
|
17
|
-
colorBgElevated:
|
|
18
|
-
popoverBg:
|
|
19
|
-
titleBorderBottom:
|
|
12
|
+
boxShadowSecondary: c,
|
|
13
|
+
colorTextHeading: d,
|
|
14
|
+
borderRadiusLG: p,
|
|
15
|
+
zIndexPopup: m,
|
|
16
|
+
titleMarginBottom: i,
|
|
17
|
+
colorBgElevated: g,
|
|
18
|
+
popoverBg: v,
|
|
19
|
+
titleBorderBottom: u,
|
|
20
20
|
innerContentPadding: y,
|
|
21
|
-
titlePadding:
|
|
21
|
+
titlePadding: f
|
|
22
22
|
} = e;
|
|
23
23
|
return [
|
|
24
24
|
{
|
|
25
|
-
[
|
|
25
|
+
[o]: Object.assign(Object.assign({}, q(e)), {
|
|
26
26
|
position: "absolute",
|
|
27
27
|
top: 0,
|
|
28
28
|
// use `left` to fix https://github.com/ant-design/ant-design/issues/39195
|
|
@@ -30,14 +30,16 @@ const b = (e) => e ? typeof e == "function" ? e() : e : null, q = (e) => {
|
|
|
30
30
|
_skip_check_: !0,
|
|
31
31
|
value: 0
|
|
32
32
|
},
|
|
33
|
-
zIndex:
|
|
33
|
+
zIndex: m,
|
|
34
34
|
fontWeight: "normal",
|
|
35
35
|
whiteSpace: "normal",
|
|
36
36
|
textAlign: "start",
|
|
37
37
|
cursor: "auto",
|
|
38
38
|
userSelect: "text",
|
|
39
|
-
|
|
40
|
-
"--
|
|
39
|
+
// When use `autoArrow`, origin will follow the arrow position
|
|
40
|
+
"--valid-offset-x": "var(--arrow-offset-horizontal, var(--arrow-x))",
|
|
41
|
+
transformOrigin: ["var(--valid-offset-x, 50%)", "var(--arrow-y, 50%)"].join(" "),
|
|
42
|
+
"--antd-arrow-background-color": g,
|
|
41
43
|
width: "max-content",
|
|
42
44
|
maxWidth: "100vw",
|
|
43
45
|
"&-rtl": {
|
|
@@ -46,226 +48,222 @@ const b = (e) => e ? typeof e == "function" ? e() : e : null, q = (e) => {
|
|
|
46
48
|
"&-hidden": {
|
|
47
49
|
display: "none"
|
|
48
50
|
},
|
|
49
|
-
[`${
|
|
51
|
+
[`${o}-content`]: {
|
|
50
52
|
position: "relative"
|
|
51
53
|
},
|
|
52
|
-
[`${
|
|
53
|
-
backgroundColor:
|
|
54
|
+
[`${o}-inner`]: {
|
|
55
|
+
backgroundColor: v,
|
|
54
56
|
backgroundClip: "padding-box",
|
|
55
|
-
borderRadius:
|
|
56
|
-
boxShadow:
|
|
57
|
+
borderRadius: p,
|
|
58
|
+
boxShadow: c,
|
|
57
59
|
padding: l
|
|
58
60
|
},
|
|
59
|
-
[`${
|
|
61
|
+
[`${o}-title`]: {
|
|
60
62
|
minWidth: t,
|
|
61
|
-
marginBottom:
|
|
62
|
-
color:
|
|
63
|
+
marginBottom: i,
|
|
64
|
+
color: d,
|
|
63
65
|
fontWeight: r,
|
|
64
|
-
borderBottom:
|
|
65
|
-
padding:
|
|
66
|
+
borderBottom: u,
|
|
67
|
+
padding: f
|
|
66
68
|
},
|
|
67
|
-
[`${
|
|
68
|
-
color:
|
|
69
|
+
[`${o}-inner-content`]: {
|
|
70
|
+
color: n,
|
|
69
71
|
padding: y
|
|
70
72
|
}
|
|
71
73
|
})
|
|
72
74
|
},
|
|
73
75
|
// Arrow Style
|
|
74
|
-
|
|
76
|
+
A(e, "var(--antd-arrow-background-color)"),
|
|
75
77
|
// Pure Render
|
|
76
78
|
{
|
|
77
|
-
[`${
|
|
79
|
+
[`${o}-pure`]: {
|
|
78
80
|
position: "relative",
|
|
79
81
|
maxWidth: "none",
|
|
80
82
|
margin: e.sizePopupArrow,
|
|
81
83
|
display: "inline-block",
|
|
82
|
-
[`${
|
|
84
|
+
[`${o}-content`]: {
|
|
83
85
|
display: "inline-block"
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
88
|
}
|
|
87
89
|
];
|
|
88
|
-
},
|
|
90
|
+
}, te = (e) => {
|
|
89
91
|
const {
|
|
90
|
-
componentCls:
|
|
92
|
+
componentCls: o
|
|
91
93
|
} = e;
|
|
92
94
|
return {
|
|
93
|
-
[
|
|
94
|
-
const t = e[`${
|
|
95
|
+
[o]: J.map((n) => {
|
|
96
|
+
const t = e[`${n}6`];
|
|
95
97
|
return {
|
|
96
|
-
[`&${
|
|
98
|
+
[`&${o}-${n}`]: {
|
|
97
99
|
"--antd-arrow-background-color": t,
|
|
98
|
-
[`${
|
|
100
|
+
[`${o}-inner`]: {
|
|
99
101
|
backgroundColor: t
|
|
100
102
|
},
|
|
101
|
-
[`${
|
|
103
|
+
[`${o}-arrow`]: {
|
|
102
104
|
background: "transparent"
|
|
103
105
|
}
|
|
104
106
|
}
|
|
105
107
|
};
|
|
106
108
|
})
|
|
107
109
|
};
|
|
108
|
-
},
|
|
110
|
+
}, oe = (e) => {
|
|
109
111
|
const {
|
|
110
|
-
lineWidth:
|
|
111
|
-
controlHeight:
|
|
112
|
+
lineWidth: o,
|
|
113
|
+
controlHeight: n,
|
|
112
114
|
fontHeight: t,
|
|
113
115
|
padding: r,
|
|
114
116
|
wireframe: l,
|
|
115
|
-
zIndexPopupBase:
|
|
116
|
-
borderRadiusLG:
|
|
117
|
-
marginXS:
|
|
118
|
-
lineType:
|
|
119
|
-
colorSplit:
|
|
120
|
-
paddingSM:
|
|
121
|
-
} = e,
|
|
117
|
+
zIndexPopupBase: c,
|
|
118
|
+
borderRadiusLG: d,
|
|
119
|
+
marginXS: p,
|
|
120
|
+
lineType: m,
|
|
121
|
+
colorSplit: i,
|
|
122
|
+
paddingSM: g
|
|
123
|
+
} = e, v = n - t, u = v / 2, y = v / 2 - o, f = r;
|
|
122
124
|
return Object.assign(Object.assign(Object.assign({
|
|
123
125
|
titleMinWidth: 177,
|
|
124
|
-
zIndexPopup:
|
|
125
|
-
},
|
|
126
|
-
contentRadius:
|
|
126
|
+
zIndexPopup: c + 30
|
|
127
|
+
}, H(e)), L({
|
|
128
|
+
contentRadius: d,
|
|
127
129
|
limitVerticalRadius: !0
|
|
128
130
|
})), {
|
|
129
131
|
// internal
|
|
130
132
|
innerPadding: l ? 0 : 12,
|
|
131
|
-
titleMarginBottom: l ? 0 :
|
|
132
|
-
titlePadding: l ? `${
|
|
133
|
-
titleBorderBottom: l ? `${
|
|
134
|
-
innerContentPadding: l ? `${
|
|
133
|
+
titleMarginBottom: l ? 0 : p,
|
|
134
|
+
titlePadding: l ? `${u}px ${f}px ${y}px` : 0,
|
|
135
|
+
titleBorderBottom: l ? `${o}px ${m} ${i}` : "none",
|
|
136
|
+
innerContentPadding: l ? `${g}px ${f}px` : 0
|
|
135
137
|
});
|
|
136
|
-
},
|
|
138
|
+
}, E = Y("Popover", (e) => {
|
|
137
139
|
const {
|
|
138
|
-
colorBgElevated:
|
|
139
|
-
colorText:
|
|
140
|
-
} = e, t =
|
|
141
|
-
popoverBg:
|
|
142
|
-
popoverColor:
|
|
140
|
+
colorBgElevated: o,
|
|
141
|
+
colorText: n
|
|
142
|
+
} = e, t = Z(e, {
|
|
143
|
+
popoverBg: o,
|
|
144
|
+
popoverColor: n
|
|
143
145
|
});
|
|
144
|
-
return [
|
|
145
|
-
},
|
|
146
|
+
return [ee(t), te(t), V(t, "zoom-big")];
|
|
147
|
+
}, oe, {
|
|
146
148
|
resetStyle: !1,
|
|
147
149
|
deprecatedTokens: [["width", "titleMinWidth"], ["minWidth", "titleMinWidth"]]
|
|
148
150
|
});
|
|
149
|
-
var
|
|
150
|
-
var
|
|
151
|
-
for (var t in e)
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
n.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[r]) && (o[t[r]] = e[t[r]]);
|
|
156
|
-
return o;
|
|
151
|
+
var ne = function(e, o) {
|
|
152
|
+
var n = {};
|
|
153
|
+
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (n[t] = e[t]);
|
|
154
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var r = 0, t = Object.getOwnPropertySymbols(e); r < t.length; r++)
|
|
155
|
+
o.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[r]) && (n[t[r]] = e[t[r]]);
|
|
156
|
+
return n;
|
|
157
157
|
};
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
const B = (e) => {
|
|
159
|
+
let {
|
|
160
|
+
title: o,
|
|
161
|
+
content: n,
|
|
162
|
+
prefixCls: t
|
|
163
|
+
} = e;
|
|
164
|
+
return !o && !n ? null : /* @__PURE__ */ a.createElement(a.Fragment, null, o && /* @__PURE__ */ a.createElement("div", {
|
|
165
|
+
className: `${t}-title`
|
|
166
|
+
}, o), n && /* @__PURE__ */ a.createElement("div", {
|
|
167
|
+
className: `${t}-inner-content`
|
|
168
|
+
}, n));
|
|
169
|
+
}, re = (e) => {
|
|
163
170
|
const {
|
|
164
|
-
hashId:
|
|
165
|
-
prefixCls:
|
|
171
|
+
hashId: o,
|
|
172
|
+
prefixCls: n,
|
|
166
173
|
className: t,
|
|
167
174
|
style: r,
|
|
168
175
|
placement: l = "top",
|
|
169
|
-
title:
|
|
170
|
-
content:
|
|
171
|
-
children:
|
|
172
|
-
} = e;
|
|
176
|
+
title: c,
|
|
177
|
+
content: d,
|
|
178
|
+
children: p
|
|
179
|
+
} = e, m = x(c), i = x(d), g = P(o, n, `${n}-pure`, `${n}-placement-${l}`, t);
|
|
173
180
|
return /* @__PURE__ */ a.createElement("div", {
|
|
174
|
-
className:
|
|
181
|
+
className: g,
|
|
175
182
|
style: r
|
|
176
183
|
}, /* @__PURE__ */ a.createElement("div", {
|
|
177
|
-
className: `${
|
|
178
|
-
}), /* @__PURE__ */ a.createElement(
|
|
179
|
-
className:
|
|
180
|
-
prefixCls:
|
|
181
|
-
}),
|
|
182
|
-
}, oe = (e) => {
|
|
183
|
-
const {
|
|
184
|
+
className: `${n}-arrow`
|
|
185
|
+
}), /* @__PURE__ */ a.createElement(K, Object.assign({}, e, {
|
|
186
|
+
className: o,
|
|
187
|
+
prefixCls: n
|
|
188
|
+
}), p || /* @__PURE__ */ a.createElement(B, {
|
|
184
189
|
prefixCls: n,
|
|
185
|
-
|
|
186
|
-
|
|
190
|
+
title: m,
|
|
191
|
+
content: i
|
|
192
|
+
})));
|
|
193
|
+
}, ae = (e) => {
|
|
194
|
+
const {
|
|
195
|
+
prefixCls: o,
|
|
196
|
+
className: n
|
|
197
|
+
} = e, t = ne(e, ["prefixCls", "className"]), {
|
|
187
198
|
getPrefixCls: r
|
|
188
|
-
} = a.useContext(
|
|
189
|
-
return
|
|
199
|
+
} = a.useContext(N), l = r("popover", o), [c, d, p] = E(l);
|
|
200
|
+
return c(/* @__PURE__ */ a.createElement(re, Object.assign({}, t, {
|
|
190
201
|
prefixCls: l,
|
|
191
|
-
hashId:
|
|
192
|
-
className: P(
|
|
202
|
+
hashId: d,
|
|
203
|
+
className: P(n, p)
|
|
193
204
|
})));
|
|
194
205
|
};
|
|
195
|
-
var
|
|
196
|
-
var
|
|
197
|
-
for (var t in e)
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
n.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[r]) && (o[t[r]] = e[t[r]]);
|
|
202
|
-
return o;
|
|
206
|
+
var le = function(e, o) {
|
|
207
|
+
var n = {};
|
|
208
|
+
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (n[t] = e[t]);
|
|
209
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var r = 0, t = Object.getOwnPropertySymbols(e); r < t.length; r++)
|
|
210
|
+
o.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[r]) && (n[t[r]] = e[t[r]]);
|
|
211
|
+
return n;
|
|
203
212
|
};
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
title: n,
|
|
207
|
-
content: o,
|
|
208
|
-
prefixCls: t
|
|
209
|
-
} = e;
|
|
210
|
-
return /* @__PURE__ */ a.createElement(a.Fragment, null, n && /* @__PURE__ */ a.createElement("div", {
|
|
211
|
-
className: `${t}-title`
|
|
212
|
-
}, b(n)), /* @__PURE__ */ a.createElement("div", {
|
|
213
|
-
className: `${t}-inner-content`
|
|
214
|
-
}, b(o)));
|
|
215
|
-
}, le = /* @__PURE__ */ a.forwardRef((e, n) => {
|
|
216
|
-
var o, t;
|
|
213
|
+
const ie = /* @__PURE__ */ a.forwardRef((e, o) => {
|
|
214
|
+
var n, t;
|
|
217
215
|
const {
|
|
218
216
|
prefixCls: r,
|
|
219
217
|
title: l,
|
|
220
|
-
content:
|
|
221
|
-
overlayClassName:
|
|
222
|
-
placement:
|
|
223
|
-
trigger:
|
|
224
|
-
children:
|
|
225
|
-
mouseEnterDelay:
|
|
226
|
-
mouseLeaveDelay:
|
|
227
|
-
onOpenChange:
|
|
218
|
+
content: c,
|
|
219
|
+
overlayClassName: d,
|
|
220
|
+
placement: p = "top",
|
|
221
|
+
trigger: m = "hover",
|
|
222
|
+
children: i,
|
|
223
|
+
mouseEnterDelay: g = 0.1,
|
|
224
|
+
mouseLeaveDelay: v = 0.1,
|
|
225
|
+
onOpenChange: u,
|
|
228
226
|
overlayStyle: y = {}
|
|
229
|
-
} = e,
|
|
227
|
+
} = e, f = le(e, ["prefixCls", "title", "content", "overlayClassName", "placement", "trigger", "children", "mouseEnterDelay", "mouseLeaveDelay", "onOpenChange", "overlayStyle"]), {
|
|
230
228
|
getPrefixCls: O
|
|
231
|
-
} = a.useContext(
|
|
232
|
-
value: (
|
|
229
|
+
} = a.useContext(N), b = O("popover", r), [_, k, I] = E(b), T = O(), W = P(d, k, I), [D, z] = F(!1, {
|
|
230
|
+
value: (n = e.open) !== null && n !== void 0 ? n : e.visible,
|
|
233
231
|
defaultValue: (t = e.defaultOpen) !== null && t !== void 0 ? t : e.defaultVisible
|
|
234
232
|
}), w = (s, C) => {
|
|
235
|
-
|
|
236
|
-
},
|
|
237
|
-
s.keyCode ===
|
|
238
|
-
},
|
|
233
|
+
z(s, !0), u == null || u(s, C);
|
|
234
|
+
}, M = (s) => {
|
|
235
|
+
s.keyCode === X.ESC && w(!1, s);
|
|
236
|
+
}, R = (s) => {
|
|
239
237
|
w(s);
|
|
240
|
-
};
|
|
241
|
-
return
|
|
242
|
-
placement:
|
|
243
|
-
trigger:
|
|
244
|
-
mouseEnterDelay:
|
|
245
|
-
mouseLeaveDelay:
|
|
238
|
+
}, S = x(l), $ = x(c);
|
|
239
|
+
return _(/* @__PURE__ */ a.createElement(G, Object.assign({
|
|
240
|
+
placement: p,
|
|
241
|
+
trigger: m,
|
|
242
|
+
mouseEnterDelay: g,
|
|
243
|
+
mouseLeaveDelay: v,
|
|
246
244
|
overlayStyle: y
|
|
247
|
-
},
|
|
248
|
-
prefixCls:
|
|
249
|
-
overlayClassName:
|
|
250
|
-
ref:
|
|
251
|
-
open:
|
|
252
|
-
onOpenChange:
|
|
253
|
-
overlay:
|
|
254
|
-
prefixCls:
|
|
255
|
-
title:
|
|
256
|
-
content:
|
|
245
|
+
}, f, {
|
|
246
|
+
prefixCls: b,
|
|
247
|
+
overlayClassName: W,
|
|
248
|
+
ref: o,
|
|
249
|
+
open: D,
|
|
250
|
+
onOpenChange: R,
|
|
251
|
+
overlay: S || $ ? /* @__PURE__ */ a.createElement(B, {
|
|
252
|
+
prefixCls: b,
|
|
253
|
+
title: S,
|
|
254
|
+
content: $
|
|
257
255
|
}) : null,
|
|
258
|
-
transitionName:
|
|
256
|
+
transitionName: U(T, "zoom-big", f.transitionName),
|
|
259
257
|
"data-popover-inject": !0
|
|
260
|
-
}),
|
|
258
|
+
}), Q(i, {
|
|
261
259
|
onKeyDown: (s) => {
|
|
262
260
|
var C, h;
|
|
263
|
-
/* @__PURE__ */ a.isValidElement(
|
|
261
|
+
/* @__PURE__ */ a.isValidElement(i) && ((h = i == null ? void 0 : (C = i.props).onKeyDown) === null || h === void 0 || h.call(C, s)), M(s);
|
|
264
262
|
}
|
|
265
263
|
})));
|
|
266
|
-
}),
|
|
267
|
-
|
|
268
|
-
process.env.NODE_ENV !== "production" && (
|
|
264
|
+
}), j = ie;
|
|
265
|
+
j._InternalPanelDoNotUseOrYouWillBeFired = ae;
|
|
266
|
+
process.env.NODE_ENV !== "production" && (j.displayName = "Popover");
|
|
269
267
|
export {
|
|
270
|
-
|
|
268
|
+
j as P
|
|
271
269
|
};
|