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