@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
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const getChannelLabel: (c: Channels) => string;
|
|
4
|
-
export declare const getChannelIcon: (channel: Channels) => React.ReactElement;
|
|
1
|
+
/// <reference types="react" />
|
|
5
2
|
export declare function Preferences(): JSX.Element | null;
|
|
@@ -1,10 +1,581 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "../Provider/index.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
1
|
+
import { jsxs as ae, Fragment as G, jsx as B } from "react/jsx-runtime";
|
|
2
|
+
import { NotificationAPIContext as oe } from "../Provider/index.js";
|
|
3
|
+
import * as O from "react";
|
|
4
|
+
import b, { useContext as ie } from "react";
|
|
5
|
+
import { PreferenceInput as L } from "./PreferenceInput.js";
|
|
6
|
+
import { R as re } from "../../assets/RightOutlined.js";
|
|
7
|
+
import { e as F, c as D, h as k, d as U, a as T, w as le, b as ce } from "../../assets/index3.js";
|
|
8
|
+
import { d as se, _ as de, e as J, a as Q, g as ue, m as fe, u as R, r as me, f as pe, c as V } from "../../assets/colors.js";
|
|
9
|
+
import { K as W, t as Y, u as ve, e as ge, f as Ce, o as X } from "../../assets/index4.js";
|
|
10
|
+
import { p as be } from "../../assets/pickAttrs.js";
|
|
11
|
+
const he = (e) => ({
|
|
12
|
+
[e.componentCls]: {
|
|
13
|
+
// For common/openAnimation
|
|
14
|
+
[`${e.antCls}-motion-collapse-legacy`]: {
|
|
15
|
+
overflow: "hidden",
|
|
16
|
+
"&-active": {
|
|
17
|
+
transition: `height ${e.motionDurationMid} ${e.motionEaseInOut},
|
|
18
|
+
opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
[`${e.antCls}-motion-collapse`]: {
|
|
22
|
+
overflow: "hidden",
|
|
23
|
+
transition: `height ${e.motionDurationMid} ${e.motionEaseInOut},
|
|
24
|
+
opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
var Z = /* @__PURE__ */ b.forwardRef(function(e, n) {
|
|
29
|
+
var t = e.prefixCls, o = e.forceRender, i = e.className, c = e.style, f = e.children, r = e.isActive, s = e.role, a = b.useState(r || o), v = F(a, 2), d = v[0], m = v[1];
|
|
30
|
+
return b.useEffect(function() {
|
|
31
|
+
(o || r) && m(!0);
|
|
32
|
+
}, [o, r]), d ? /* @__PURE__ */ b.createElement("div", {
|
|
33
|
+
ref: n,
|
|
34
|
+
className: D("".concat(t, "-content"), k(k({}, "".concat(t, "-content-active"), r), "".concat(t, "-content-inactive"), !r), i),
|
|
35
|
+
style: c,
|
|
36
|
+
role: s
|
|
37
|
+
}, /* @__PURE__ */ b.createElement("div", {
|
|
38
|
+
className: "".concat(t, "-content-box")
|
|
39
|
+
}, f)) : null;
|
|
40
|
+
});
|
|
41
|
+
Z.displayName = "PanelContent";
|
|
42
|
+
var ye = ["showArrow", "headerClass", "isActive", "onItemClick", "forceRender", "className", "prefixCls", "collapsible", "accordion", "panelKey", "extra", "header", "expandIcon", "openMotion", "destroyInactivePanel", "children"], ee = /* @__PURE__ */ b.forwardRef(function(e, n) {
|
|
43
|
+
var t = e.showArrow, o = t === void 0 ? !0 : t, i = e.headerClass, c = e.isActive, f = e.onItemClick, r = e.forceRender, s = e.className, a = e.prefixCls, v = e.collapsible, d = e.accordion, m = e.panelKey, g = e.extra, S = e.header, h = e.expandIcon, l = e.openMotion, x = e.destroyInactivePanel, I = e.children, $ = U(e, ye), u = v === "disabled", N = v === "header", C = v === "icon", E = g != null && typeof g != "boolean", y = function() {
|
|
44
|
+
f == null || f(m);
|
|
45
|
+
}, P = function(K) {
|
|
46
|
+
(K.key === "Enter" || K.keyCode === W.ENTER || K.which === W.ENTER) && y();
|
|
47
|
+
}, A = typeof h == "function" ? h(e) : /* @__PURE__ */ b.createElement("i", {
|
|
48
|
+
className: "arrow"
|
|
49
|
+
});
|
|
50
|
+
A && (A = /* @__PURE__ */ b.createElement("div", {
|
|
51
|
+
className: "".concat(a, "-expand-icon"),
|
|
52
|
+
onClick: ["header", "icon"].includes(v) ? y : void 0
|
|
53
|
+
}, A));
|
|
54
|
+
var p = D(k(k(k({}, "".concat(a, "-item"), !0), "".concat(a, "-item-active"), c), "".concat(a, "-item-disabled"), u), s), w = D(i, k(k(k({}, "".concat(a, "-header"), !0), "".concat(a, "-header-collapsible-only"), N), "".concat(a, "-icon-collapsible-only"), C)), M = {
|
|
55
|
+
className: w,
|
|
56
|
+
"aria-expanded": c,
|
|
57
|
+
"aria-disabled": u,
|
|
58
|
+
onKeyDown: P
|
|
59
|
+
};
|
|
60
|
+
return !N && !C && (M.onClick = y, M.role = d ? "tab" : "button", M.tabIndex = u ? -1 : 0), /* @__PURE__ */ b.createElement("div", T({}, $, {
|
|
61
|
+
ref: n,
|
|
62
|
+
className: p
|
|
63
|
+
}), /* @__PURE__ */ b.createElement("div", M, o && A, /* @__PURE__ */ b.createElement("span", {
|
|
64
|
+
className: "".concat(a, "-header-text"),
|
|
65
|
+
onClick: v === "header" ? y : void 0
|
|
66
|
+
}, S), E && /* @__PURE__ */ b.createElement("div", {
|
|
67
|
+
className: "".concat(a, "-extra")
|
|
68
|
+
}, g)), /* @__PURE__ */ b.createElement(se, T({
|
|
69
|
+
visible: c,
|
|
70
|
+
leavedClassName: "".concat(a, "-content-hidden")
|
|
71
|
+
}, l, {
|
|
72
|
+
forceRender: r,
|
|
73
|
+
removeOnLeave: x
|
|
74
|
+
}), function(_, K) {
|
|
75
|
+
var H = _.className, j = _.style;
|
|
76
|
+
return /* @__PURE__ */ b.createElement(Z, {
|
|
77
|
+
ref: K,
|
|
78
|
+
prefixCls: a,
|
|
79
|
+
className: H,
|
|
80
|
+
style: j,
|
|
81
|
+
isActive: c,
|
|
82
|
+
forceRender: r,
|
|
83
|
+
role: d ? "tabpanel" : void 0
|
|
84
|
+
}, I);
|
|
85
|
+
}));
|
|
86
|
+
}), Ie = ["children", "label", "key", "collapsible", "onItemClick", "destroyInactivePanel"], xe = function(n, t) {
|
|
87
|
+
var o = t.prefixCls, i = t.accordion, c = t.collapsible, f = t.destroyInactivePanel, r = t.onItemClick, s = t.activeKey, a = t.openMotion, v = t.expandIcon;
|
|
88
|
+
return n.map(function(d, m) {
|
|
89
|
+
var g = d.children, S = d.label, h = d.key, l = d.collapsible, x = d.onItemClick, I = d.destroyInactivePanel, $ = U(d, Ie), u = String(h ?? m), N = l ?? c, C = I ?? f, E = function(A) {
|
|
90
|
+
N !== "disabled" && (r(A), x == null || x(A));
|
|
91
|
+
}, y = !1;
|
|
92
|
+
return i ? y = s[0] === u : y = s.indexOf(u) > -1, /* @__PURE__ */ b.createElement(ee, T({}, $, {
|
|
93
|
+
prefixCls: o,
|
|
94
|
+
key: u,
|
|
95
|
+
panelKey: u,
|
|
96
|
+
isActive: y,
|
|
97
|
+
accordion: i,
|
|
98
|
+
openMotion: a,
|
|
99
|
+
expandIcon: v,
|
|
100
|
+
header: S,
|
|
101
|
+
collapsible: N,
|
|
102
|
+
onItemClick: E,
|
|
103
|
+
destroyInactivePanel: C
|
|
104
|
+
}), g);
|
|
105
|
+
});
|
|
106
|
+
}, $e = function(n, t, o) {
|
|
107
|
+
if (!n)
|
|
108
|
+
return null;
|
|
109
|
+
var i = o.prefixCls, c = o.accordion, f = o.collapsible, r = o.destroyInactivePanel, s = o.onItemClick, a = o.activeKey, v = o.openMotion, d = o.expandIcon, m = n.key || String(t), g = n.props, S = g.header, h = g.headerClass, l = g.destroyInactivePanel, x = g.collapsible, I = g.onItemClick, $ = !1;
|
|
110
|
+
c ? $ = a[0] === m : $ = a.indexOf(m) > -1;
|
|
111
|
+
var u = x ?? f, N = function(y) {
|
|
112
|
+
u !== "disabled" && (s(y), I == null || I(y));
|
|
113
|
+
}, C = {
|
|
114
|
+
key: m,
|
|
115
|
+
panelKey: m,
|
|
116
|
+
header: S,
|
|
117
|
+
headerClass: h,
|
|
118
|
+
isActive: $,
|
|
119
|
+
prefixCls: i,
|
|
120
|
+
destroyInactivePanel: l ?? r,
|
|
121
|
+
openMotion: v,
|
|
122
|
+
accordion: c,
|
|
123
|
+
children: n.props.children,
|
|
124
|
+
onItemClick: N,
|
|
125
|
+
expandIcon: d,
|
|
126
|
+
collapsible: u
|
|
127
|
+
};
|
|
128
|
+
return typeof n.type == "string" ? n : (Object.keys(C).forEach(function(E) {
|
|
129
|
+
typeof C[E] > "u" && delete C[E];
|
|
130
|
+
}), /* @__PURE__ */ b.cloneElement(n, C));
|
|
131
|
+
};
|
|
132
|
+
function Ne(e, n, t) {
|
|
133
|
+
return Array.isArray(e) ? xe(e, t) : Y(n).map(function(o, i) {
|
|
134
|
+
return $e(o, i, t);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function Pe(e) {
|
|
138
|
+
var n = e;
|
|
139
|
+
if (!Array.isArray(n)) {
|
|
140
|
+
var t = ce(n);
|
|
141
|
+
n = t === "number" || t === "string" ? [n] : [];
|
|
142
|
+
}
|
|
143
|
+
return n.map(function(o) {
|
|
144
|
+
return String(o);
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
var we = /* @__PURE__ */ b.forwardRef(function(e, n) {
|
|
148
|
+
var t = e.prefixCls, o = t === void 0 ? "rc-collapse" : t, i = e.destroyInactivePanel, c = i === void 0 ? !1 : i, f = e.style, r = e.accordion, s = e.className, a = e.children, v = e.collapsible, d = e.openMotion, m = e.expandIcon, g = e.activeKey, S = e.defaultActiveKey, h = e.onChange, l = e.items, x = D(o, s), I = ve([], {
|
|
149
|
+
value: g,
|
|
150
|
+
onChange: function(P) {
|
|
151
|
+
return h == null ? void 0 : h(P);
|
|
152
|
+
},
|
|
153
|
+
defaultValue: S,
|
|
154
|
+
postState: Pe
|
|
155
|
+
}), $ = F(I, 2), u = $[0], N = $[1], C = function(P) {
|
|
156
|
+
return N(function() {
|
|
157
|
+
if (r)
|
|
158
|
+
return u[0] === P ? [] : [P];
|
|
159
|
+
var A = u.indexOf(P), p = A > -1;
|
|
160
|
+
return p ? u.filter(function(w) {
|
|
161
|
+
return w !== P;
|
|
162
|
+
}) : [].concat(de(u), [P]);
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
le(!a, "[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");
|
|
166
|
+
var E = Ne(l, a, {
|
|
167
|
+
prefixCls: o,
|
|
168
|
+
accordion: r,
|
|
169
|
+
openMotion: d,
|
|
170
|
+
expandIcon: m,
|
|
171
|
+
collapsible: v,
|
|
172
|
+
destroyInactivePanel: c,
|
|
173
|
+
onItemClick: C,
|
|
174
|
+
activeKey: u
|
|
175
|
+
});
|
|
176
|
+
return /* @__PURE__ */ b.createElement("div", T({
|
|
177
|
+
ref: n,
|
|
178
|
+
className: x,
|
|
179
|
+
style: f,
|
|
180
|
+
role: r ? "tablist" : void 0
|
|
181
|
+
}, be(e, {
|
|
182
|
+
aria: !0,
|
|
183
|
+
data: !0
|
|
184
|
+
})), E);
|
|
185
|
+
});
|
|
186
|
+
const z = Object.assign(we, {
|
|
187
|
+
/**
|
|
188
|
+
* @deprecated use `items` instead, will be removed in `v4.0.0`
|
|
189
|
+
*/
|
|
190
|
+
Panel: ee
|
|
191
|
+
});
|
|
192
|
+
z.Panel;
|
|
193
|
+
const Se = /* @__PURE__ */ O.forwardRef((e, n) => {
|
|
194
|
+
process.env.NODE_ENV !== "production" && J("Collapse.Panel").deprecated(!("disabled" in e), "disabled", 'collapsible="disabled"');
|
|
195
|
+
const {
|
|
196
|
+
getPrefixCls: t
|
|
197
|
+
} = O.useContext(Q), {
|
|
198
|
+
prefixCls: o,
|
|
199
|
+
className: i,
|
|
200
|
+
showArrow: c = !0
|
|
201
|
+
} = e, f = t("collapse", o), r = D({
|
|
202
|
+
[`${f}-no-arrow`]: !c
|
|
203
|
+
}, i);
|
|
204
|
+
return /* @__PURE__ */ O.createElement(z.Panel, Object.assign({
|
|
205
|
+
ref: n
|
|
206
|
+
}, e, {
|
|
207
|
+
prefixCls: f,
|
|
208
|
+
className: r
|
|
209
|
+
}));
|
|
210
|
+
}), Ee = (e) => {
|
|
211
|
+
const {
|
|
212
|
+
componentCls: n,
|
|
213
|
+
contentBg: t,
|
|
214
|
+
padding: o,
|
|
215
|
+
headerBg: i,
|
|
216
|
+
headerPadding: c,
|
|
217
|
+
collapseHeaderPaddingSM: f,
|
|
218
|
+
collapseHeaderPaddingLG: r,
|
|
219
|
+
collapsePanelBorderRadius: s,
|
|
220
|
+
lineWidth: a,
|
|
221
|
+
lineType: v,
|
|
222
|
+
colorBorder: d,
|
|
223
|
+
colorText: m,
|
|
224
|
+
colorTextHeading: g,
|
|
225
|
+
colorTextDisabled: S,
|
|
226
|
+
fontSizeLG: h,
|
|
227
|
+
lineHeight: l,
|
|
228
|
+
lineHeightLG: x,
|
|
229
|
+
marginSM: I,
|
|
230
|
+
paddingSM: $,
|
|
231
|
+
paddingLG: u,
|
|
232
|
+
paddingXS: N,
|
|
233
|
+
motionDurationSlow: C,
|
|
234
|
+
fontSizeIcon: E,
|
|
235
|
+
contentPadding: y,
|
|
236
|
+
fontHeight: P,
|
|
237
|
+
fontHeightLG: A
|
|
238
|
+
} = e, p = `${R(a)} ${v} ${d}`;
|
|
239
|
+
return {
|
|
240
|
+
[n]: Object.assign(Object.assign({}, me(e)), {
|
|
241
|
+
backgroundColor: i,
|
|
242
|
+
border: p,
|
|
243
|
+
borderRadius: s,
|
|
244
|
+
"&-rtl": {
|
|
245
|
+
direction: "rtl"
|
|
246
|
+
},
|
|
247
|
+
[`& > ${n}-item`]: {
|
|
248
|
+
borderBottom: p,
|
|
249
|
+
"&:last-child": {
|
|
250
|
+
[`
|
|
251
|
+
&,
|
|
252
|
+
& > ${n}-header`]: {
|
|
253
|
+
borderRadius: `0 0 ${R(s)} ${R(s)}`
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
[`> ${n}-header`]: {
|
|
257
|
+
position: "relative",
|
|
258
|
+
// Compatible with old version of antd, should remove in next version
|
|
259
|
+
display: "flex",
|
|
260
|
+
flexWrap: "nowrap",
|
|
261
|
+
alignItems: "flex-start",
|
|
262
|
+
padding: c,
|
|
263
|
+
color: g,
|
|
264
|
+
lineHeight: l,
|
|
265
|
+
cursor: "pointer",
|
|
266
|
+
transition: `all ${C}, visibility 0s`,
|
|
267
|
+
[`> ${n}-header-text`]: {
|
|
268
|
+
flex: "auto"
|
|
269
|
+
},
|
|
270
|
+
"&:focus": {
|
|
271
|
+
outline: "none"
|
|
272
|
+
},
|
|
273
|
+
// >>>>> Arrow
|
|
274
|
+
[`${n}-expand-icon`]: {
|
|
275
|
+
height: P,
|
|
276
|
+
display: "flex",
|
|
277
|
+
alignItems: "center",
|
|
278
|
+
paddingInlineEnd: I
|
|
279
|
+
},
|
|
280
|
+
[`${n}-arrow`]: Object.assign(Object.assign({}, pe()), {
|
|
281
|
+
fontSize: E,
|
|
282
|
+
// when `transform: rotate()` is applied to icon's root element
|
|
283
|
+
transition: `transform ${C}`,
|
|
284
|
+
// when `transform: rotate()` is applied to icon's child element
|
|
285
|
+
svg: {
|
|
286
|
+
transition: `transform ${C}`
|
|
287
|
+
}
|
|
288
|
+
}),
|
|
289
|
+
// >>>>> Text
|
|
290
|
+
[`${n}-header-text`]: {
|
|
291
|
+
marginInlineEnd: "auto"
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
[`${n}-icon-collapsible-only`]: {
|
|
295
|
+
cursor: "unset",
|
|
296
|
+
[`${n}-expand-icon`]: {
|
|
297
|
+
cursor: "pointer"
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
[`${n}-content`]: {
|
|
302
|
+
color: m,
|
|
303
|
+
backgroundColor: t,
|
|
304
|
+
borderTop: p,
|
|
305
|
+
[`& > ${n}-content-box`]: {
|
|
306
|
+
padding: y
|
|
307
|
+
},
|
|
308
|
+
"&-hidden": {
|
|
309
|
+
display: "none"
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
"&-small": {
|
|
313
|
+
[`> ${n}-item`]: {
|
|
314
|
+
[`> ${n}-header`]: {
|
|
315
|
+
padding: f,
|
|
316
|
+
paddingInlineStart: N,
|
|
317
|
+
[`> ${n}-expand-icon`]: {
|
|
318
|
+
// Arrow offset
|
|
319
|
+
marginInlineStart: e.calc($).sub(N).equal()
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
[`> ${n}-content > ${n}-content-box`]: {
|
|
323
|
+
padding: $
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
"&-large": {
|
|
328
|
+
[`> ${n}-item`]: {
|
|
329
|
+
fontSize: h,
|
|
330
|
+
lineHeight: x,
|
|
331
|
+
[`> ${n}-header`]: {
|
|
332
|
+
padding: r,
|
|
333
|
+
paddingInlineStart: o,
|
|
334
|
+
[`> ${n}-expand-icon`]: {
|
|
335
|
+
height: A,
|
|
336
|
+
// Arrow offset
|
|
337
|
+
marginInlineStart: e.calc(u).sub(o).equal()
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
[`> ${n}-content > ${n}-content-box`]: {
|
|
341
|
+
padding: u
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
[`${n}-item:last-child`]: {
|
|
346
|
+
borderBottom: 0,
|
|
347
|
+
[`> ${n}-content`]: {
|
|
348
|
+
borderRadius: `0 0 ${R(s)} ${R(s)}`
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
[`& ${n}-item-disabled > ${n}-header`]: {
|
|
352
|
+
"\n &,\n & > .arrow\n ": {
|
|
353
|
+
color: S,
|
|
354
|
+
cursor: "not-allowed"
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
// ========================== Icon Position ==========================
|
|
358
|
+
[`&${n}-icon-position-end`]: {
|
|
359
|
+
[`& > ${n}-item`]: {
|
|
360
|
+
[`> ${n}-header`]: {
|
|
361
|
+
[`${n}-expand-icon`]: {
|
|
362
|
+
order: 1,
|
|
363
|
+
paddingInlineEnd: 0,
|
|
364
|
+
paddingInlineStart: I
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
})
|
|
370
|
+
};
|
|
371
|
+
}, Ae = (e) => {
|
|
372
|
+
const {
|
|
373
|
+
componentCls: n
|
|
374
|
+
} = e, t = `> ${n}-item > ${n}-header ${n}-arrow`;
|
|
375
|
+
return {
|
|
376
|
+
[`${n}-rtl`]: {
|
|
377
|
+
[t]: {
|
|
378
|
+
transform: "rotate(180deg)"
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
}, Me = (e) => {
|
|
383
|
+
const {
|
|
384
|
+
componentCls: n,
|
|
385
|
+
headerBg: t,
|
|
386
|
+
paddingXXS: o,
|
|
387
|
+
colorBorder: i
|
|
388
|
+
} = e;
|
|
389
|
+
return {
|
|
390
|
+
[`${n}-borderless`]: {
|
|
391
|
+
backgroundColor: t,
|
|
392
|
+
border: 0,
|
|
393
|
+
[`> ${n}-item`]: {
|
|
394
|
+
borderBottom: `1px solid ${i}`
|
|
395
|
+
},
|
|
396
|
+
[`
|
|
397
|
+
> ${n}-item:last-child,
|
|
398
|
+
> ${n}-item:last-child ${n}-header
|
|
399
|
+
`]: {
|
|
400
|
+
borderRadius: 0
|
|
401
|
+
},
|
|
402
|
+
[`> ${n}-item:last-child`]: {
|
|
403
|
+
borderBottom: 0
|
|
404
|
+
},
|
|
405
|
+
[`> ${n}-item > ${n}-content`]: {
|
|
406
|
+
backgroundColor: "transparent",
|
|
407
|
+
borderTop: 0
|
|
408
|
+
},
|
|
409
|
+
[`> ${n}-item > ${n}-content > ${n}-content-box`]: {
|
|
410
|
+
paddingTop: o
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
}, Oe = (e) => {
|
|
415
|
+
const {
|
|
416
|
+
componentCls: n,
|
|
417
|
+
paddingSM: t
|
|
418
|
+
} = e;
|
|
419
|
+
return {
|
|
420
|
+
[`${n}-ghost`]: {
|
|
421
|
+
backgroundColor: "transparent",
|
|
422
|
+
border: 0,
|
|
423
|
+
[`> ${n}-item`]: {
|
|
424
|
+
borderBottom: 0,
|
|
425
|
+
[`> ${n}-content`]: {
|
|
426
|
+
backgroundColor: "transparent",
|
|
427
|
+
border: 0,
|
|
428
|
+
[`> ${n}-content-box`]: {
|
|
429
|
+
paddingBlock: t
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
}, Re = (e) => ({
|
|
436
|
+
headerPadding: `${e.paddingSM}px ${e.padding}px`,
|
|
437
|
+
headerBg: e.colorFillAlter,
|
|
438
|
+
contentPadding: `${e.padding}px 16px`,
|
|
439
|
+
// Fixed Value
|
|
440
|
+
contentBg: e.colorBgContainer
|
|
441
|
+
}), _e = ue("Collapse", (e) => {
|
|
442
|
+
const n = fe(e, {
|
|
443
|
+
collapseHeaderPaddingSM: `${R(e.paddingXS)} ${R(e.paddingSM)}`,
|
|
444
|
+
collapseHeaderPaddingLG: `${R(e.padding)} ${R(e.paddingLG)}`,
|
|
445
|
+
collapsePanelBorderRadius: e.borderRadiusLG
|
|
446
|
+
});
|
|
447
|
+
return [Ee(n), Me(n), Oe(n), Ae(n), he(n)];
|
|
448
|
+
}, Re), ne = /* @__PURE__ */ O.forwardRef((e, n) => {
|
|
449
|
+
const {
|
|
450
|
+
getPrefixCls: t,
|
|
451
|
+
direction: o,
|
|
452
|
+
collapse: i
|
|
453
|
+
} = O.useContext(Q), {
|
|
454
|
+
prefixCls: c,
|
|
455
|
+
className: f,
|
|
456
|
+
rootClassName: r,
|
|
457
|
+
style: s,
|
|
458
|
+
bordered: a = !0,
|
|
459
|
+
ghost: v,
|
|
460
|
+
size: d,
|
|
461
|
+
expandIconPosition: m = "start",
|
|
462
|
+
children: g,
|
|
463
|
+
expandIcon: S
|
|
464
|
+
} = e, h = ge((p) => {
|
|
465
|
+
var w;
|
|
466
|
+
return (w = d ?? p) !== null && w !== void 0 ? w : "middle";
|
|
467
|
+
}), l = t("collapse", c), x = t(), [I, $, u] = _e(l);
|
|
468
|
+
if (process.env.NODE_ENV !== "production") {
|
|
469
|
+
const p = J("Collapse");
|
|
470
|
+
process.env.NODE_ENV !== "production" && p(m !== "left" && m !== "right", "deprecated", "`expandIconPosition` with `left` or `right` is deprecated. Please use `start` or `end` instead.");
|
|
471
|
+
}
|
|
472
|
+
const N = O.useMemo(() => m === "left" ? "start" : m === "right" ? "end" : m, [m]), C = S ?? (i == null ? void 0 : i.expandIcon), E = O.useCallback(function() {
|
|
473
|
+
let p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
474
|
+
const w = typeof C == "function" ? C(p) : /* @__PURE__ */ O.createElement(re, {
|
|
475
|
+
rotate: p.isActive ? 90 : void 0
|
|
476
|
+
});
|
|
477
|
+
return V(w, () => {
|
|
478
|
+
var M;
|
|
479
|
+
return {
|
|
480
|
+
className: D((M = w == null ? void 0 : w.props) === null || M === void 0 ? void 0 : M.className, `${l}-arrow`)
|
|
481
|
+
};
|
|
482
|
+
});
|
|
483
|
+
}, [C, l]), y = D(`${l}-icon-position-${N}`, {
|
|
484
|
+
[`${l}-borderless`]: !a,
|
|
485
|
+
[`${l}-rtl`]: o === "rtl",
|
|
486
|
+
[`${l}-ghost`]: !!v,
|
|
487
|
+
[`${l}-${h}`]: h !== "middle"
|
|
488
|
+
}, i == null ? void 0 : i.className, f, r, $, u), P = Object.assign(Object.assign({}, Ce(x)), {
|
|
489
|
+
motionAppear: !1,
|
|
490
|
+
leavedClassName: `${l}-content-hidden`
|
|
491
|
+
}), A = O.useMemo(() => g ? Y(g).map((p, w) => {
|
|
492
|
+
var M, _;
|
|
493
|
+
if (!((M = p.props) === null || M === void 0) && M.disabled) {
|
|
494
|
+
const K = (_ = p.key) !== null && _ !== void 0 ? _ : String(w), {
|
|
495
|
+
disabled: H,
|
|
496
|
+
collapsible: j
|
|
497
|
+
} = p.props, te = Object.assign(Object.assign({}, X(p.props, ["disabled"])), {
|
|
498
|
+
key: K,
|
|
499
|
+
collapsible: j ?? (H ? "disabled" : void 0)
|
|
500
|
+
});
|
|
501
|
+
return V(p, te);
|
|
502
|
+
}
|
|
503
|
+
return p;
|
|
504
|
+
}) : null, [g]);
|
|
505
|
+
return I(
|
|
506
|
+
// @ts-ignore
|
|
507
|
+
/* @__PURE__ */ O.createElement(z, Object.assign({
|
|
508
|
+
ref: n,
|
|
509
|
+
openMotion: P
|
|
510
|
+
}, X(e, ["rootClassName"]), {
|
|
511
|
+
expandIcon: E,
|
|
512
|
+
prefixCls: l,
|
|
513
|
+
className: y,
|
|
514
|
+
style: Object.assign(Object.assign({}, i == null ? void 0 : i.style), s)
|
|
515
|
+
}), A)
|
|
516
|
+
);
|
|
517
|
+
});
|
|
518
|
+
process.env.NODE_ENV !== "production" && (ne.displayName = "Collapse");
|
|
519
|
+
const q = Object.assign(ne, {
|
|
520
|
+
Panel: Se
|
|
521
|
+
});
|
|
522
|
+
function Le() {
|
|
523
|
+
const e = ie(oe);
|
|
524
|
+
if (!e || !e.preferences)
|
|
525
|
+
return null;
|
|
526
|
+
const n = e.preferences.notifications.sort((t, o) => t.title.localeCompare(o.title)).map((t) => {
|
|
527
|
+
var f, r, s;
|
|
528
|
+
const o = (f = e.preferences) == null ? void 0 : f.preferences.filter(
|
|
529
|
+
(a) => a.notificationId === t.notificationId && !a.subNotificationId
|
|
530
|
+
), i = (r = e.preferences) == null ? void 0 : r.preferences.filter(
|
|
531
|
+
(a) => a.notificationId === t.notificationId && a.subNotificationId
|
|
532
|
+
), c = (s = e.preferences) == null ? void 0 : s.subNotifications.filter(
|
|
533
|
+
(a) => i == null ? void 0 : i.find(
|
|
534
|
+
(v) => v.subNotificationId === a.subNotificationId
|
|
535
|
+
)
|
|
536
|
+
);
|
|
537
|
+
return {
|
|
538
|
+
label: t.title,
|
|
539
|
+
key: t.notificationId,
|
|
540
|
+
children: /* @__PURE__ */ ae(G, { children: [
|
|
541
|
+
/* @__PURE__ */ B(
|
|
542
|
+
L,
|
|
543
|
+
{
|
|
544
|
+
notification: t,
|
|
545
|
+
preferences: o || [],
|
|
546
|
+
updateDelivery: e.updateDelivery
|
|
547
|
+
},
|
|
548
|
+
t.notificationId
|
|
549
|
+
),
|
|
550
|
+
c == null ? void 0 : c.map((a) => /* @__PURE__ */ B(
|
|
551
|
+
q,
|
|
552
|
+
{
|
|
553
|
+
bordered: !1,
|
|
554
|
+
items: [
|
|
555
|
+
{
|
|
556
|
+
label: a.title,
|
|
557
|
+
key: a.subNotificationId,
|
|
558
|
+
children: /* @__PURE__ */ B(
|
|
559
|
+
L,
|
|
560
|
+
{
|
|
561
|
+
notification: t,
|
|
562
|
+
preferences: i || [],
|
|
563
|
+
updateDelivery: e.updateDelivery,
|
|
564
|
+
subNotificationId: a.subNotificationId
|
|
565
|
+
},
|
|
566
|
+
a.subNotificationId
|
|
567
|
+
)
|
|
568
|
+
}
|
|
569
|
+
],
|
|
570
|
+
defaultActiveKey: []
|
|
571
|
+
},
|
|
572
|
+
a.subNotificationId
|
|
573
|
+
))
|
|
574
|
+
] })
|
|
575
|
+
};
|
|
576
|
+
});
|
|
577
|
+
return /* @__PURE__ */ B(G, { children: /* @__PURE__ */ B(q, { items: n, defaultActiveKey: [] }) });
|
|
578
|
+
}
|
|
6
579
|
export {
|
|
7
|
-
|
|
8
|
-
p as getChannelIcon,
|
|
9
|
-
i as getChannelLabel
|
|
580
|
+
Le as Preferences
|
|
10
581
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NotificationPreferencesPopup as r } from "./NotificationPreferencesPopup.js";
|
|
2
2
|
import { NotificationPreferencesInline as f } from "./NotificationPreferencesInline.js";
|
|
3
3
|
export {
|
|
4
4
|
f as NotificationPreferencesInline,
|
|
@@ -6,10 +6,16 @@ export type Context = {
|
|
|
6
6
|
preferences?: GetPreferencesResponse;
|
|
7
7
|
loadNotifications: (initial?: boolean) => void;
|
|
8
8
|
markAsOpened: () => void;
|
|
9
|
-
markAsArchived: (ids: string[] |
|
|
10
|
-
markAsUnarchived: (ids: string[] |
|
|
9
|
+
markAsArchived: (ids: string[] | 'ALL') => void;
|
|
10
|
+
markAsUnarchived: (ids: string[] | 'ALL') => void;
|
|
11
11
|
markAsClicked: (ids: string[]) => void;
|
|
12
12
|
updateDelivery: (notificationId: string, channel: Channels, delivery: DeliveryOptionsForEmail | DeliveryOptionsForInappWeb | BaseDeliveryOptions, subNotificationId?: string) => void;
|
|
13
|
+
updateDeliveries: (params: {
|
|
14
|
+
notificationId: string;
|
|
15
|
+
channel: Channels;
|
|
16
|
+
delivery: DeliveryOptionsForEmail | DeliveryOptionsForInappWeb | BaseDeliveryOptions;
|
|
17
|
+
subNotificationId?: string;
|
|
18
|
+
}[]) => void;
|
|
13
19
|
};
|
|
14
20
|
export declare const NotificationAPIContext: import('react').Context<Context | undefined>;
|
|
15
21
|
type Props = {
|