@notificationapi/react 0.0.37 → 1.0.1
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/Badge.js +456 -0
- package/dist/assets/Box.js +57 -0
- package/dist/assets/ButtonBase.js +1224 -0
- package/dist/assets/DefaultPropsProvider.js +4368 -0
- package/dist/assets/Divider.js +343 -0
- package/dist/assets/IconButton.js +225 -0
- package/dist/assets/Inbox.js +3051 -0
- package/dist/assets/InboxHeader.js +2338 -0
- package/dist/assets/Notification.js +5349 -7150
- package/dist/assets/NotificationPreferencesPopup.js +1694 -0
- package/dist/assets/Paper.js +154 -0
- package/dist/assets/Popover.js +451 -0
- package/dist/assets/Portal.js +110 -0
- package/dist/assets/PreferenceInput.js +1545 -1366
- package/dist/assets/Typography.js +292 -0
- package/dist/assets/WebPushOptInMessage.js +794 -407
- package/dist/assets/channelUtils.js +33 -65
- package/dist/assets/createSimplePaletteValueFilter.js +17 -0
- package/dist/assets/createSvgIcon.js +248 -0
- package/dist/assets/integerPropType.js +31 -0
- package/dist/assets/resolveComponentProps.js +93 -0
- package/dist/assets/style.css +1 -0
- package/dist/assets/useSlotProps.js +24 -0
- package/dist/assets/useTheme.js +10 -0
- package/dist/assets/useTheme2.js +16 -0
- package/dist/assets/utils.js +743 -0
- package/dist/components/Notifications/DefaultEmpty.d.ts +3 -0
- package/dist/components/Notifications/DefaultEmpty.js +7 -0
- package/dist/components/Notifications/Inbox.d.ts +4 -4
- package/dist/components/Notifications/Inbox.js +9 -6450
- package/dist/components/Notifications/InboxHeader.d.ts +1 -1
- package/dist/components/Notifications/InboxHeader.js +7 -53
- package/dist/components/Notifications/Notification.d.ts +3 -4
- package/dist/components/Notifications/Notification.js +6 -5
- package/dist/components/Notifications/NotificationCounter.js +16 -6
- package/dist/components/Notifications/NotificationFeed.d.ts +1 -2
- package/dist/components/Notifications/NotificationFeed.js +41 -38
- package/dist/components/Notifications/NotificationLauncher.d.ts +1 -0
- package/dist/components/Notifications/NotificationLauncher.js +100 -114
- package/dist/components/Notifications/NotificationPopup.d.ts +3 -4
- package/dist/components/Notifications/NotificationPopup.js +86 -88
- package/dist/components/Notifications/UnreadBadge.d.ts +7 -4
- package/dist/components/Notifications/UnreadBadge.js +28 -20
- package/dist/components/Notifications/interface.d.ts +0 -4
- package/dist/components/Notifications/interface.js +4 -5
- package/dist/components/Preferences/NotificationPreferencesInline.js +14 -14
- package/dist/components/Preferences/NotificationPreferencesPopup.js +7 -2068
- package/dist/components/Preferences/PreferenceInput.js +4 -3
- package/dist/components/Preferences/Preferences.js +1042 -547
- package/dist/components/Preferences/channelUtils.js +3 -4
- package/dist/components/Preferences/index.js +1 -1
- package/dist/components/Provider/context.d.ts +27 -0
- package/dist/components/Provider/context.js +7 -0
- package/dist/components/Provider/index.d.ts +2 -25
- package/dist/components/Provider/index.js +22 -24
- package/dist/components/WebPush/WebPushOptInMessage.js +3 -4
- package/dist/main.d.ts +1 -0
- package/dist/main.js +4 -4
- package/package.json +14 -12
- package/dist/assets/AntdIcon.js +0 -200
- package/dist/assets/CloseOutlined.js +0 -13
- package/dist/assets/PurePanel.js +0 -59
- package/dist/assets/RightOutlined.js +0 -13
- package/dist/assets/button.js +0 -1660
- package/dist/assets/colors.js +0 -36
- package/dist/assets/compact-item.js +0 -860
- package/dist/assets/index.js +0 -271
- package/dist/assets/index2.js +0 -647
- package/dist/assets/index3.js +0 -7527
- package/dist/assets/pickAttrs.js +0 -42
- package/dist/assets/presets.js +0 -810
- package/dist/assets/reactNode.js +0 -20821
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "../../assets/presets.js";
|
|
3
2
|
import "../Notifications/interface.js";
|
|
4
|
-
import { a as
|
|
3
|
+
import { a as t, g as r } from "../../assets/channelUtils.js";
|
|
5
4
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
t as getChannelIcon,
|
|
6
|
+
r as getChannelLabel
|
|
8
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N as r } from "../../assets/NotificationPreferencesPopup.js";
|
|
2
2
|
import { NotificationPreferencesInline as f } from "./NotificationPreferencesInline.js";
|
|
3
3
|
export {
|
|
4
4
|
f as NotificationPreferencesInline,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { NotificationAPIClientSDK } from '@notificationapi/core';
|
|
2
|
+
import { BaseDeliveryOptions, Channels, DeliveryOptionsForEmail, DeliveryOptionsForInappWeb, GetPreferencesResponse, InAppNotification, UserAccountMetadata } from '@notificationapi/core/dist/interfaces';
|
|
3
|
+
|
|
4
|
+
export type Context = {
|
|
5
|
+
notifications?: InAppNotification[];
|
|
6
|
+
preferences?: GetPreferencesResponse;
|
|
7
|
+
userAccountMetaData?: {
|
|
8
|
+
userAccountMetadata: UserAccountMetadata;
|
|
9
|
+
};
|
|
10
|
+
webPushOptInMessage?: 'AUTOMATIC' | boolean;
|
|
11
|
+
loadNotifications: (initial?: boolean) => void;
|
|
12
|
+
markAsOpened: () => void;
|
|
13
|
+
markAsArchived: (ids: string[] | 'ALL') => void;
|
|
14
|
+
markAsUnarchived: (ids: string[] | 'ALL') => void;
|
|
15
|
+
markAsClicked: (ids: string[]) => void;
|
|
16
|
+
updateDelivery: (notificationId: string, channel: Channels, delivery: DeliveryOptionsForEmail | DeliveryOptionsForInappWeb | BaseDeliveryOptions, subNotificationId?: string) => void;
|
|
17
|
+
updateDeliveries: (params: {
|
|
18
|
+
notificationId: string;
|
|
19
|
+
channel: Channels;
|
|
20
|
+
delivery: DeliveryOptionsForEmail | DeliveryOptionsForInappWeb | BaseDeliveryOptions;
|
|
21
|
+
subNotificationId?: string;
|
|
22
|
+
}[]) => void;
|
|
23
|
+
getClient: () => typeof NotificationAPIClientSDK;
|
|
24
|
+
setWebPushOptInMessage: React.Dispatch<React.SetStateAction<'AUTOMATIC' | boolean>>;
|
|
25
|
+
setWebPushOptIn: React.Dispatch<React.SetStateAction<boolean>>;
|
|
26
|
+
};
|
|
27
|
+
export declare const NotificationAPIContext: import('react').Context<Context | undefined>;
|
|
@@ -1,31 +1,8 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { NotificationAPIClientSDK } from '@notificationapi/core';
|
|
3
|
-
import {
|
|
3
|
+
import { User } from '@notificationapi/core/dist/interfaces';
|
|
4
|
+
import { Context } from './context';
|
|
4
5
|
|
|
5
|
-
export type Context = {
|
|
6
|
-
notifications?: InAppNotification[];
|
|
7
|
-
preferences?: GetPreferencesResponse;
|
|
8
|
-
userAccountMetaData?: {
|
|
9
|
-
userAccountMetadata: UserAccountMetadata;
|
|
10
|
-
};
|
|
11
|
-
webPushOptInMessage?: 'AUTOMATIC' | boolean;
|
|
12
|
-
loadNotifications: (initial?: boolean) => void;
|
|
13
|
-
markAsOpened: () => void;
|
|
14
|
-
markAsArchived: (ids: string[] | 'ALL') => void;
|
|
15
|
-
markAsUnarchived: (ids: string[] | 'ALL') => void;
|
|
16
|
-
markAsClicked: (ids: string[]) => void;
|
|
17
|
-
updateDelivery: (notificationId: string, channel: Channels, delivery: DeliveryOptionsForEmail | DeliveryOptionsForInappWeb | BaseDeliveryOptions, subNotificationId?: string) => void;
|
|
18
|
-
updateDeliveries: (params: {
|
|
19
|
-
notificationId: string;
|
|
20
|
-
channel: Channels;
|
|
21
|
-
delivery: DeliveryOptionsForEmail | DeliveryOptionsForInappWeb | BaseDeliveryOptions;
|
|
22
|
-
subNotificationId?: string;
|
|
23
|
-
}[]) => void;
|
|
24
|
-
getClient: () => typeof NotificationAPIClientSDK;
|
|
25
|
-
setWebPushOptInMessage: React.Dispatch<React.SetStateAction<'AUTOMATIC' | boolean>>;
|
|
26
|
-
setWebPushOptIn: React.Dispatch<React.SetStateAction<boolean>>;
|
|
27
|
-
};
|
|
28
|
-
export declare const NotificationAPIContext: import('react').Context<Context | undefined>;
|
|
29
6
|
type Props = ({
|
|
30
7
|
userId: string;
|
|
31
8
|
} | {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as Q } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { useState as I, useCallback as m, useMemo as X, useRef as T, useEffect as P, useContext as Y } from "react";
|
|
3
|
+
import { NotificationAPIContext as H } from "./context.js";
|
|
4
|
+
const Z = async (e, c, o, a, f, N, h) => {
|
|
5
|
+
const l = ee(a, f, N), g = await fetch(
|
|
5
6
|
`https://${c}/${a}/users/${encodeURIComponent(
|
|
6
7
|
f
|
|
7
8
|
)}/${o}`,
|
|
@@ -18,7 +19,7 @@ const ee = async (e, c, o, a, f, N, h) => {
|
|
|
18
19
|
} catch {
|
|
19
20
|
return;
|
|
20
21
|
}
|
|
21
|
-
},
|
|
22
|
+
}, ee = (e, c, o) => btoa(o ? e + ":" + c + ":" + o : e + ":" + c), q = {
|
|
22
23
|
host: "api.notificationapi.com",
|
|
23
24
|
websocketHost: "ws.notificationapi.com",
|
|
24
25
|
userId: "",
|
|
@@ -40,7 +41,7 @@ const ee = async (e, c, o, a, f, N, h) => {
|
|
|
40
41
|
},
|
|
41
42
|
rest: {
|
|
42
43
|
generic: function(e, c, o) {
|
|
43
|
-
return
|
|
44
|
+
return Z(
|
|
44
45
|
e,
|
|
45
46
|
i.config.host,
|
|
46
47
|
c,
|
|
@@ -154,9 +155,7 @@ const ee = async (e, c, o, a, f, N, h) => {
|
|
|
154
155
|
return i.rest.postUser(e);
|
|
155
156
|
},
|
|
156
157
|
getUserAccountMetadata: async () => i.rest.getUserAccountMetadata()
|
|
157
|
-
},
|
|
158
|
-
void 0
|
|
159
|
-
), F = typeof window < "u", ne = (e) => {
|
|
158
|
+
}, F = typeof window < "u", te = (e) => {
|
|
160
159
|
const o = {
|
|
161
160
|
...{
|
|
162
161
|
apiURL: "https://api.notificationapi.com",
|
|
@@ -170,7 +169,7 @@ const ee = async (e, c, o, a, f, N, h) => {
|
|
|
170
169
|
},
|
|
171
170
|
...e,
|
|
172
171
|
user: "userId" in e ? { id: e.userId } : e.user
|
|
173
|
-
}, [a, f] = I(), [N, h] = I(), [l, g] = I(), [w, S] = I(!1), [k,
|
|
172
|
+
}, [a, f] = I(), [N, h] = I(), [l, g] = I(), [w, S] = I(!1), [k, C] = I((/* @__PURE__ */ new Date()).toISOString()), [A, U] = I(!0), [v, b] = I(o.webPushOptInMessage), [W, J] = I(!1), x = m(() => {
|
|
174
173
|
o.playSoundOnNewNotification && new Audio(o.newNotificationSoundPath).play().catch((s) => {
|
|
175
174
|
console.log("Failed to play new notification sound:", s);
|
|
176
175
|
});
|
|
@@ -183,13 +182,13 @@ const ee = async (e, c, o, a, f, N, h) => {
|
|
|
183
182
|
...t.filter((d) => !n.find((D) => D.id === d.id)),
|
|
184
183
|
...n
|
|
185
184
|
]));
|
|
186
|
-
}, []), u =
|
|
185
|
+
}, []), u = X(() => {
|
|
187
186
|
const t = e.client ? e.client : i.init({
|
|
188
187
|
clientId: o.clientId,
|
|
189
188
|
userId: o.user.id,
|
|
190
189
|
hashedUserId: o.hashedUserId,
|
|
191
190
|
onNewInAppNotifications: (s) => {
|
|
192
|
-
|
|
191
|
+
x(), y(s);
|
|
193
192
|
}
|
|
194
193
|
});
|
|
195
194
|
return t.identify({
|
|
@@ -203,15 +202,15 @@ const ee = async (e, c, o, a, f, N, h) => {
|
|
|
203
202
|
o.user.number,
|
|
204
203
|
o.hashedUserId,
|
|
205
204
|
y,
|
|
206
|
-
|
|
205
|
+
x,
|
|
207
206
|
e.client
|
|
208
207
|
]), E = m(
|
|
209
208
|
async (t, s) => {
|
|
210
209
|
const n = await u.rest.getNotifications(t, s);
|
|
211
|
-
|
|
210
|
+
C(n.oldestReceived), U(n.couldLoadMore), y(n.notifications);
|
|
212
211
|
},
|
|
213
212
|
[y, u.rest]
|
|
214
|
-
), L =
|
|
213
|
+
), L = T(A), R = T(w), $ = T(k);
|
|
215
214
|
P(() => {
|
|
216
215
|
L.current = A, R.current = w, $.current = k;
|
|
217
216
|
}, [A, w, k]);
|
|
@@ -291,7 +290,7 @@ const ee = async (e, c, o, a, f, N, h) => {
|
|
|
291
290
|
});
|
|
292
291
|
}, M = m(() => {
|
|
293
292
|
"serviceWorker" in navigator && navigator.serviceWorker.register(o.customServiceWorkerPath).then(async (t) => {
|
|
294
|
-
b(!1),
|
|
293
|
+
b(!1), ie().then(async (s) => {
|
|
295
294
|
s === "granted" ? await t.pushManager.subscribe({
|
|
296
295
|
userVisibleOnly: !0,
|
|
297
296
|
applicationServerKey: l == null ? void 0 : l.userAccountMetadata.environmentVapidPublicKey
|
|
@@ -328,7 +327,7 @@ const ee = async (e, c, o, a, f, N, h) => {
|
|
|
328
327
|
l == null ? void 0 : l.userAccountMetadata.environmentVapidPublicKey
|
|
329
328
|
]);
|
|
330
329
|
P(() => {
|
|
331
|
-
f([]), S(!1), h(void 0),
|
|
330
|
+
f([]), S(!1), h(void 0), C((/* @__PURE__ */ new Date()).toISOString()), U(!0), O(!0), u.openWebSocket(), u.getPreferences().then((t) => {
|
|
332
331
|
h(t);
|
|
333
332
|
});
|
|
334
333
|
}, [u, O, M]), P(() => {
|
|
@@ -338,8 +337,8 @@ const ee = async (e, c, o, a, f, N, h) => {
|
|
|
338
337
|
g(t), b(t.userAccountMetadata.hasWebPushEnabled);
|
|
339
338
|
}));
|
|
340
339
|
}, [u, v]), P(() => {
|
|
341
|
-
|
|
342
|
-
}, [
|
|
340
|
+
W && M();
|
|
341
|
+
}, [W, M]);
|
|
343
342
|
const z = {
|
|
344
343
|
notifications: a,
|
|
345
344
|
preferences: N,
|
|
@@ -357,14 +356,14 @@ const ee = async (e, c, o, a, f, N, h) => {
|
|
|
357
356
|
setWebPushOptIn: J
|
|
358
357
|
};
|
|
359
358
|
return /* @__PURE__ */ Q(H.Provider, { value: z, children: e.children });
|
|
360
|
-
},
|
|
361
|
-
const e =
|
|
359
|
+
}, ne = () => {
|
|
360
|
+
const e = Y(H);
|
|
362
361
|
if (!e)
|
|
363
362
|
throw new Error("useMyContext must be used within a MyProvider");
|
|
364
363
|
return e;
|
|
365
364
|
};
|
|
366
|
-
|
|
367
|
-
const
|
|
365
|
+
te.useNotificationAPIContext = ne;
|
|
366
|
+
const ie = async () => {
|
|
368
367
|
if (F && "Notification" in window && typeof Notification.requestPermission == "function")
|
|
369
368
|
try {
|
|
370
369
|
return await Notification.requestPermission();
|
|
@@ -375,6 +374,5 @@ const oe = async () => {
|
|
|
375
374
|
return console.warn("Web Push Notifications are not supported in this browser."), "default";
|
|
376
375
|
};
|
|
377
376
|
export {
|
|
378
|
-
|
|
379
|
-
ne as NotificationAPIProvider
|
|
377
|
+
te as NotificationAPIProvider
|
|
380
378
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import "../Provider/
|
|
4
|
-
import { W as
|
|
5
|
-
import "../../assets/button.js";
|
|
3
|
+
import "../Provider/context.js";
|
|
4
|
+
import { W as i } from "../../assets/WebPushOptInMessage.js";
|
|
6
5
|
export {
|
|
7
|
-
|
|
6
|
+
i as default
|
|
8
7
|
};
|
package/dist/main.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
export { NotificationFeed, NotificationPopup, NotificationLauncher, NotificationCounter } from './components/Notifications';
|
|
2
3
|
export { NotificationPreferencesInline, NotificationPreferencesPopup } from './components/Preferences';
|
|
3
4
|
export { NotificationAPIProvider } from './components/Provider';
|
package/dist/main.js
CHANGED
|
@@ -2,8 +2,8 @@ import { NotificationFeed as r } from "./components/Notifications/NotificationFe
|
|
|
2
2
|
import { NotificationPopup as e } from "./components/Notifications/NotificationPopup.js";
|
|
3
3
|
import { NotificationLauncher as n } from "./components/Notifications/NotificationLauncher.js";
|
|
4
4
|
import { NotificationCounter as c } from "./components/Notifications/NotificationCounter.js";
|
|
5
|
-
import {
|
|
6
|
-
import { NotificationPreferencesInline as
|
|
5
|
+
import { N } from "./assets/NotificationPreferencesPopup.js";
|
|
6
|
+
import { NotificationPreferencesInline as x } from "./components/Preferences/NotificationPreferencesInline.js";
|
|
7
7
|
import { NotificationAPIProvider as u } from "./components/Provider/index.js";
|
|
8
8
|
export {
|
|
9
9
|
u as NotificationAPIProvider,
|
|
@@ -11,6 +11,6 @@ export {
|
|
|
11
11
|
r as NotificationFeed,
|
|
12
12
|
n as NotificationLauncher,
|
|
13
13
|
e as NotificationPopup,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
x as NotificationPreferencesInline,
|
|
15
|
+
N as NotificationPreferencesPopup
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@notificationapi/react",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"browserslist": [
|
|
7
7
|
"last 2 versions",
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
"prepublishOnly": "npm run build"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"react": "^17.0.2",
|
|
28
|
-
"react-dom": "^17.0.2"
|
|
27
|
+
"react": "^17.0.2 || ^18.0.0 || ^19.0.0",
|
|
28
|
+
"react-dom": "^17.0.2 || ^18.0.0 || ^19.0.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@
|
|
31
|
+
"@faker-js/faker": "^9.2.0",
|
|
32
32
|
"@types/node": "^20.12.7",
|
|
33
|
-
"@types/react": "^
|
|
34
|
-
"@types/react-dom": "^
|
|
33
|
+
"@types/react": "^19.0.0",
|
|
34
|
+
"@types/react-dom": "^19.0.0",
|
|
35
35
|
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
|
36
36
|
"@typescript-eslint/parser": "^7.2.0",
|
|
37
37
|
"@vitejs/plugin-react": "^4.2.1",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"eslint-plugin-compat": "^6.0.1",
|
|
40
40
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
41
41
|
"eslint-plugin-react-refresh": "^0.4.6",
|
|
42
|
+
"faker-js": "^1.0.0",
|
|
42
43
|
"glob": "^10.4.1",
|
|
43
44
|
"prettier": "^3.3.3",
|
|
44
45
|
"typescript": "^5.2.2",
|
|
@@ -51,16 +52,17 @@
|
|
|
51
52
|
"files": [
|
|
52
53
|
"dist"
|
|
53
54
|
],
|
|
54
|
-
"sideEffects":
|
|
55
|
-
"**/*.css"
|
|
56
|
-
],
|
|
55
|
+
"sideEffects": false,
|
|
57
56
|
"dependencies": {
|
|
57
|
+
"@emotion/react": "^11.14.0",
|
|
58
|
+
"@emotion/styled": "^11.14.0",
|
|
59
|
+
"@fontsource/roboto": "^5.1.1",
|
|
60
|
+
"@mui/icons-material": "^6.3.1",
|
|
61
|
+
"@mui/material": "^6.3.1",
|
|
58
62
|
"@notificationapi/core": "^0.0.12",
|
|
59
|
-
"antd": "^5.17.4",
|
|
60
63
|
"javascript-time-ago": "^2.5.10",
|
|
61
64
|
"liquidjs": "^10.14.0",
|
|
62
65
|
"rc-virtual-list": "^3.11.5",
|
|
63
|
-
"react-time-ago": "^7.3.3"
|
|
64
|
-
"styled-components": "^6.1.9"
|
|
66
|
+
"react-time-ago": "^7.3.3"
|
|
65
67
|
}
|
|
66
68
|
}
|
package/dist/assets/AntdIcon.js
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import { w as L, d as b, _ as c, g as U, I, u as W, e as N, f as R, c as q, b as h, a as F, h as G } from "./presets.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
|
-
$(G.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 = q(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", F({
|
|
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
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { a as l } from "./presets.js";
|
|
2
|
-
import * as e from "react";
|
|
3
|
-
import { I as o } from "./AntdIcon.js";
|
|
4
|
-
var t = { icon: { tag: "svg", attrs: { "fill-rule": "evenodd", viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, name: "close", theme: "outlined" }, r = function(a, c) {
|
|
5
|
-
return /* @__PURE__ */ e.createElement(o, l({}, a, {
|
|
6
|
-
ref: c,
|
|
7
|
-
icon: t
|
|
8
|
-
}));
|
|
9
|
-
}, n = /* @__PURE__ */ e.forwardRef(r);
|
|
10
|
-
process.env.NODE_ENV !== "production" && (n.displayName = "CloseOutlined");
|
|
11
|
-
export {
|
|
12
|
-
n as R
|
|
13
|
-
};
|
package/dist/assets/PurePanel.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import * as e from "react";
|
|
2
|
-
import { u as x } from "./compact-item.js";
|
|
3
|
-
import { C as j, a as w } from "./reactNode.js";
|
|
4
|
-
function y(n) {
|
|
5
|
-
return (i) => /* @__PURE__ */ e.createElement(j, {
|
|
6
|
-
theme: {
|
|
7
|
-
token: {
|
|
8
|
-
motion: !1,
|
|
9
|
-
zIndexPopupBase: 0
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}, /* @__PURE__ */ e.createElement(n, Object.assign({}, i)));
|
|
13
|
-
}
|
|
14
|
-
const W = (n, i, R, z) => y((r) => {
|
|
15
|
-
const {
|
|
16
|
-
prefixCls: p,
|
|
17
|
-
style: f
|
|
18
|
-
} = r, o = e.useRef(null), [d, g] = e.useState(0), [m, P] = e.useState(0), [a, v] = x(!1, {
|
|
19
|
-
value: r.open
|
|
20
|
-
}), {
|
|
21
|
-
getPrefixCls: C
|
|
22
|
-
} = e.useContext(w), b = C("select", p);
|
|
23
|
-
e.useEffect(() => {
|
|
24
|
-
if (v(!0), typeof ResizeObserver < "u") {
|
|
25
|
-
const l = new ResizeObserver((t) => {
|
|
26
|
-
const s = t[0].target;
|
|
27
|
-
g(s.offsetHeight + 8), P(s.offsetWidth);
|
|
28
|
-
}), c = setInterval(() => {
|
|
29
|
-
var t;
|
|
30
|
-
const s = `.${b}-dropdown`, u = (t = o.current) === null || t === void 0 ? void 0 : t.querySelector(s);
|
|
31
|
-
u && (clearInterval(c), l.observe(u));
|
|
32
|
-
}, 10);
|
|
33
|
-
return () => {
|
|
34
|
-
clearInterval(c), l.disconnect();
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
}, []);
|
|
38
|
-
let h = Object.assign(Object.assign({}, r), {
|
|
39
|
-
style: Object.assign(Object.assign({}, f), {
|
|
40
|
-
margin: 0
|
|
41
|
-
}),
|
|
42
|
-
open: a,
|
|
43
|
-
visible: a,
|
|
44
|
-
getPopupContainer: () => o.current
|
|
45
|
-
});
|
|
46
|
-
const O = {
|
|
47
|
-
paddingBottom: d,
|
|
48
|
-
position: "relative",
|
|
49
|
-
minWidth: m
|
|
50
|
-
};
|
|
51
|
-
return /* @__PURE__ */ e.createElement("div", {
|
|
52
|
-
ref: o,
|
|
53
|
-
style: O
|
|
54
|
-
}, /* @__PURE__ */ e.createElement(n, Object.assign({}, h)));
|
|
55
|
-
});
|
|
56
|
-
export {
|
|
57
|
-
W as g,
|
|
58
|
-
y as w
|
|
59
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { a as r } from "./presets.js";
|
|
2
|
-
import * as t from "react";
|
|
3
|
-
import { I as i } from "./AntdIcon.js";
|
|
4
|
-
var o = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, name: "right", theme: "outlined" }, n = function(e, a) {
|
|
5
|
-
return /* @__PURE__ */ t.createElement(i, r({}, e, {
|
|
6
|
-
ref: a,
|
|
7
|
-
icon: o
|
|
8
|
-
}));
|
|
9
|
-
}, c = /* @__PURE__ */ t.forwardRef(n);
|
|
10
|
-
process.env.NODE_ENV !== "production" && (c.displayName = "RightOutlined");
|
|
11
|
-
export {
|
|
12
|
-
c as R
|
|
13
|
-
};
|