@abtnode/ux 1.17.9 → 1.17.10-beta-20260210-024836-33fc86ec

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.
@@ -1,9 +1,12 @@
1
1
  import { LocaleContext } from '@arcblock/ux/lib/Locale/context';
2
2
  import Tabs from '@arcblock/ux/lib/Tabs';
3
- import { Box, Typography } from '@mui/material';
3
+ import Toast from '@arcblock/ux/lib/Toast';
4
+ import { Box, FormControlLabel, Paper, Switch, Typography } from '@mui/material';
4
5
  import { useSearchParams } from 'react-router-dom';
5
6
  import { useCreation, useMemoizedFn } from 'ahooks';
6
- import { useContext, useMemo } from 'react';
7
+ import { useContext, useMemo, useState } from 'react';
8
+ import { useNodeContext } from '../../contexts/node';
9
+ import { useBlockletContext } from '../../contexts/blocklet';
7
10
  import NotificationEmail from './email';
8
11
  import NotificationPushKit from './push-kit';
9
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -49,7 +52,38 @@ function BlockletNotification() {
49
52
  const {
50
53
  t
51
54
  } = useContext(LocaleContext);
55
+ const {
56
+ api
57
+ } = useNodeContext();
58
+ const {
59
+ blocklet
60
+ } = useBlockletContext();
52
61
  const [params, setParams] = useSearchParams();
62
+ const did = blocklet?.meta?.did;
63
+ const [toastAlert, setToastAlert] = useState(Boolean(blocklet?.settings?.notification?.toastAlert));
64
+ const [toastAlertLoading, setToastAlertLoading] = useState(false);
65
+ const handleToastAlertChange = useMemoizedFn(async event => {
66
+ const {
67
+ checked
68
+ } = event.target;
69
+ try {
70
+ setToastAlertLoading(true);
71
+ await api.configNotification({
72
+ input: {
73
+ did,
74
+ notification: JSON.stringify({
75
+ toastAlert: checked
76
+ })
77
+ }
78
+ });
79
+ setToastAlert(checked);
80
+ Toast.success(t('common.saveSuccess'));
81
+ } catch (err) {
82
+ Toast.error(err.message || t('common.saveFailed'));
83
+ } finally {
84
+ setToastAlertLoading(false);
85
+ }
86
+ });
53
87
  const typeParam = params.get('type');
54
88
  const currentTab = validTabs.includes(typeParam) ? typeParam : tabs[0].value;
55
89
  const contents = useCreation(() => ({
@@ -76,14 +110,52 @@ function BlockletNotification() {
76
110
  };
77
111
  }, []);
78
112
  return /*#__PURE__*/_jsxs(Box, {
79
- children: [/*#__PURE__*/_jsx(Tabs, {
80
- variant: "card",
81
- tabs: tabs,
82
- current: currentTab,
83
- onChange: onTablChange
84
- }), /*#__PURE__*/_jsx(Box, {
85
- style: tabBodyStyle,
86
- children: contents[currentTab]
113
+ sx: {
114
+ display: 'flex',
115
+ flexDirection: 'column',
116
+ gap: 3
117
+ },
118
+ children: [/*#__PURE__*/_jsx(Paper, {
119
+ variant: "outlined",
120
+ sx: {
121
+ p: 3
122
+ },
123
+ children: /*#__PURE__*/_jsx(FormControlLabel, {
124
+ control: /*#__PURE__*/_jsx(Switch, {
125
+ checked: toastAlert,
126
+ onChange: handleToastAlertChange,
127
+ disabled: toastAlertLoading
128
+ }),
129
+ label: /*#__PURE__*/_jsxs(Box, {
130
+ children: [/*#__PURE__*/_jsx(Typography, {
131
+ variant: "body1",
132
+ fontWeight: 500,
133
+ children: t('notification.toastAlert.label')
134
+ }), /*#__PURE__*/_jsx(Typography, {
135
+ variant: "body2",
136
+ color: "text.secondary",
137
+ children: t('notification.toastAlert.description')
138
+ })]
139
+ }),
140
+ sx: {
141
+ alignItems: 'flex-start',
142
+ m: 0
143
+ }
144
+ })
145
+ }), /*#__PURE__*/_jsxs(Paper, {
146
+ variant: "outlined",
147
+ sx: {
148
+ p: 3
149
+ },
150
+ children: [/*#__PURE__*/_jsx(Tabs, {
151
+ variant: "card",
152
+ tabs: tabs,
153
+ current: currentTab,
154
+ onChange: onTablChange
155
+ }), /*#__PURE__*/_jsx(Box, {
156
+ style: tabBodyStyle,
157
+ children: contents[currentTab]
158
+ })]
87
159
  })]
88
160
  });
89
161
  }
package/lib/locales/ar.js CHANGED
@@ -1391,6 +1391,10 @@ export default {
1391
1391
  webhooks: {
1392
1392
  description: 'إرسال الإشعارات عبر Webhooks مفعّل دائمًا لجميع المستخدمين.'
1393
1393
  },
1394
+ toastAlert: {
1395
+ label: 'تنبيه منبثق',
1396
+ description: 'عرض إشعار منبثق عند وصول إشعار جديد.'
1397
+ },
1394
1398
  comingSoon: 'تحت الإنشاء مزيد من قنوات الإشعارات',
1395
1399
  unsubscribe: 'إلغاء الاشتراك',
1396
1400
  unsubscribeSucceed: 'تم إلغاء الاشتراك بنجاح',
package/lib/locales/de.js CHANGED
@@ -1391,6 +1391,10 @@ export default {
1391
1391
  webhooks: {
1392
1392
  description: 'Benachrichtigungen über Webhooks sind für alle Benutzer immer aktiviert.'
1393
1393
  },
1394
+ toastAlert: {
1395
+ label: 'Popup-Benachrichtigung',
1396
+ description: 'Zeigt ein Popup an, wenn eine neue Benachrichtigung eintrifft.'
1397
+ },
1394
1398
  comingSoon: 'Weitere Benachrichtigungskanäle befinden sich im Aufbau',
1395
1399
  unsubscribe: 'Abmelden',
1396
1400
  unsubscribeSucceed: 'Abmeldung erfolgreich',
package/lib/locales/en.js CHANGED
@@ -1420,6 +1420,10 @@ export default {
1420
1420
  webhooks: {
1421
1421
  description: 'Notifications sending through webhooks are always enabled for all users.'
1422
1422
  },
1423
+ toastAlert: {
1424
+ label: 'Toast Alert',
1425
+ description: 'Show a toast popup when a new notification arrives.'
1426
+ },
1423
1427
  comingSoon: 'More notification channel are under construction',
1424
1428
  unsubscribe: 'Unsubscribe',
1425
1429
  unsubscribeSucceed: 'Unsubscribe succeeded',
package/lib/locales/es.js CHANGED
@@ -1391,6 +1391,10 @@ export default {
1391
1391
  webhooks: {
1392
1392
  description: 'Las notificaciones enviadas a través de webhooks están siempre habilitadas para todos los usuarios.'
1393
1393
  },
1394
+ toastAlert: {
1395
+ label: 'Alerta emergente',
1396
+ description: 'Mostrar una notificación emergente cuando llega una nueva notificación.'
1397
+ },
1394
1398
  comingSoon: 'Más canales de notificación se encuentran en construcción',
1395
1399
  unsubscribe: 'Cancelar subscripción',
1396
1400
  unsubscribeSucceed: 'La cancelación se realizó con éxito',
package/lib/locales/fr.js CHANGED
@@ -1391,6 +1391,10 @@ export default {
1391
1391
  webhooks: {
1392
1392
  description: 'Les notifications envoyées via webhooks sont toujours activées pour tous les utilisateurs.'
1393
1393
  },
1394
+ toastAlert: {
1395
+ label: 'Alerte contextuelle',
1396
+ description: "Afficher une notification contextuelle lorsqu'une nouvelle notification arrive."
1397
+ },
1394
1398
  comingSoon: 'Plus de canaux de notification sont en cours de construction',
1395
1399
  unsubscribe: 'Se désabonner',
1396
1400
  unsubscribeSucceed: 'Désinscription réussie',
package/lib/locales/hi.js CHANGED
@@ -1391,6 +1391,10 @@ export default {
1391
1391
  webhooks: {
1392
1392
  description: 'वेबहुक के माध्यम से सूचनाएं हमेशा सक्षम हैं सभी उपयोगकर्ताओं के लिए।'
1393
1393
  },
1394
+ toastAlert: {
1395
+ label: 'पॉपअप सूचना',
1396
+ description: 'नई सूचना आने पर पॉपअप दिखाएं।'
1397
+ },
1394
1398
  comingSoon: 'और सूचना केंद्र निर्माण के तहत हैं',
1395
1399
  unsubscribe: 'असदुद्ध',
1396
1400
  unsubscribeSucceed: 'सदस्यता रद्द सफल',
package/lib/locales/id.js CHANGED
@@ -1391,6 +1391,10 @@ export default {
1391
1391
  webhooks: {
1392
1392
  description: 'Notifikasi yang dikirim melalui webhooks selalu diaktifkan untuk semua pengguna.'
1393
1393
  },
1394
+ toastAlert: {
1395
+ label: 'Pemberitahuan pop-up',
1396
+ description: 'Tampilkan notifikasi pop-up saat notifikasi baru tiba.'
1397
+ },
1394
1398
  comingSoon: 'Lebih banyak saluran pemberitahuan sedang dalam konstruksi',
1395
1399
  unsubscribe: 'Berhenti berlangganan',
1396
1400
  unsubscribeSucceed: 'Berhenti berhasil',
package/lib/locales/ja.js CHANGED
@@ -1391,6 +1391,10 @@ export default {
1391
1391
  webhooks: {
1392
1392
  description: 'Webhooks を介して送信される通知は、すべてのユーザーに対して常に有効です。'
1393
1393
  },
1394
+ toastAlert: {
1395
+ label: 'トースト通知',
1396
+ description: '新しい通知が届いたときにポップアップを表示します。'
1397
+ },
1394
1398
  comingSoon: 'さらに通知チャンネルが建設中です',
1395
1399
  unsubscribe: '購読解除',
1396
1400
  unsubscribeSucceed: '解約が成功しました',
package/lib/locales/ko.js CHANGED
@@ -1391,6 +1391,10 @@ export default {
1391
1391
  webhooks: {
1392
1392
  description: 'Webhooks를 통해 전송되는 알림은 모든 사용자에게 항상 활성화됩니다.'
1393
1393
  },
1394
+ toastAlert: {
1395
+ label: '팝업 알림',
1396
+ description: '새 알림이 도착하면 팝업을 표시합니다.'
1397
+ },
1394
1398
  comingSoon: '추가 알림 채널이 건설 중입니다',
1395
1399
  unsubscribe: '구독 해지',
1396
1400
  unsubscribeSucceed: '구독 해지가 성공했습니다',
package/lib/locales/pt.js CHANGED
@@ -1391,6 +1391,10 @@ export default {
1391
1391
  webhooks: {
1392
1392
  description: 'Notificações enviadas através de webhooks estão sempre habilitadas para todos os usuários.'
1393
1393
  },
1394
+ toastAlert: {
1395
+ label: 'Alerta pop-up',
1396
+ description: 'Exibir uma notificação pop-up quando uma nova notificação chegar.'
1397
+ },
1394
1398
  comingSoon: 'Mais canais de notificação estão em construção',
1395
1399
  unsubscribe: 'Cancelar inscrição',
1396
1400
  unsubscribeSucceed: 'Cancelar inscrição bem-sucedida',
package/lib/locales/ru.js CHANGED
@@ -1391,6 +1391,10 @@ export default {
1391
1391
  webhooks: {
1392
1392
  description: 'Уведомления, отправляемые через webhooks, всегда включены для всех пользователей.'
1393
1393
  },
1394
+ toastAlert: {
1395
+ label: 'Всплывающее уведомление',
1396
+ description: 'Показывать всплывающее уведомление при получении нового уведомления.'
1397
+ },
1394
1398
  comingSoon: 'Более множество каналов уведомлений находятся в процессе строительства',
1395
1399
  unsubscribe: 'Отказаться от подписки',
1396
1400
  unsubscribeSucceed: 'Отмена подписки выполнена успешно',
package/lib/locales/th.js CHANGED
@@ -1391,6 +1391,10 @@ export default {
1391
1391
  webhooks: {
1392
1392
  description: 'การส่งการแจ้งเตือนผ่าน webhooks จะถูกเปิดใช้งานสำหรับผู้ใช้ทั้งหมด'
1393
1393
  },
1394
+ toastAlert: {
1395
+ label: 'การแจ้งเตือนป๊อปอัป',
1396
+ description: 'แสดงป๊อปอัปเมื่อมีการแจ้งเตือนใหม่'
1397
+ },
1394
1398
  comingSoon: 'กำลังสร้างช่องการแจ้งเตือนเพิ่มเติม',
1395
1399
  unsubscribe: 'ยกเลิกการสมัครใช้',
1396
1400
  unsubscribeSucceed: 'ยกเลิกรับข้อมูลเรียบร้อยแล้ว',
package/lib/locales/vi.js CHANGED
@@ -1391,6 +1391,10 @@ export default {
1391
1391
  webhooks: {
1392
1392
  description: 'Thông báo gửi qua webhooks luôn được bật cho tất cả người dùng.'
1393
1393
  },
1394
+ toastAlert: {
1395
+ label: 'Thông báo bật lên',
1396
+ description: 'Hiển thị thông báo bật lên khi có thông báo mới.'
1397
+ },
1394
1398
  comingSoon: 'Có thêm kênh thông báo đang được xây dựng',
1395
1399
  unsubscribe: 'Huỷ đăng ký',
1396
1400
  unsubscribeSucceed: 'Hủy đăng ký thành công',
@@ -1391,6 +1391,10 @@ export default {
1391
1391
  webhooks: {
1392
1392
  description: '通過 webhooks 發送的通知總是對所有用戶啟用。'
1393
1393
  },
1394
+ toastAlert: {
1395
+ label: '彈窗提醒',
1396
+ description: '收到新通知時顯示彈窗提醒。'
1397
+ },
1394
1398
  comingSoon: '更多通知頻道正在建設中',
1395
1399
  unsubscribe: '取消訂閱',
1396
1400
  unsubscribeSucceed: '退訂成功',
package/lib/locales/zh.js CHANGED
@@ -1404,6 +1404,10 @@ export default {
1404
1404
  webhooks: {
1405
1405
  description: '通过 webhooks 发送的通知总是对所有用户启用。'
1406
1406
  },
1407
+ toastAlert: {
1408
+ label: '弹窗提醒',
1409
+ description: '收到新通知时显示弹窗提醒。'
1410
+ },
1407
1411
  comingSoon: '更多通知方式正在建设中',
1408
1412
  unsubscribe: '取消订阅',
1409
1413
  unsubscribeSucceed: '取消订阅成功',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/ux",
3
- "version": "1.17.9",
3
+ "version": "1.17.10-beta-20260210-024836-33fc86ec",
4
4
  "description": "UX components shared across abtnode packages",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -23,32 +23,32 @@
23
23
  "author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@abtnode/auth": "1.17.9",
27
- "@abtnode/constant": "1.17.9",
28
- "@abtnode/docker-utils": "1.17.9",
29
- "@abtnode/util": "1.17.9",
26
+ "@abtnode/auth": "1.17.10-beta-20260210-024836-33fc86ec",
27
+ "@abtnode/constant": "1.17.10-beta-20260210-024836-33fc86ec",
28
+ "@abtnode/docker-utils": "1.17.10-beta-20260210-024836-33fc86ec",
29
+ "@abtnode/util": "1.17.10-beta-20260210-024836-33fc86ec",
30
30
  "@ahooksjs/use-url-state": "^3.5.1",
31
- "@arcblock/did": "1.29.3",
32
- "@arcblock/did-connect-react": "^3.5.0",
33
- "@arcblock/did-ext": "1.29.3",
31
+ "@arcblock/did": "1.29.8",
32
+ "@arcblock/did-connect-react": "^3.5.2",
33
+ "@arcblock/did-ext": "1.29.8",
34
34
  "@arcblock/did-motif": "^1.1.14",
35
- "@arcblock/icons": "^3.5.0",
36
- "@arcblock/nft-display": "^3.5.0",
37
- "@arcblock/react-hooks": "^3.5.0",
38
- "@arcblock/terminal": "^3.5.0",
39
- "@arcblock/ux": "^3.5.0",
40
- "@arcblock/validator": "1.29.3",
41
- "@blocklet/aigne-hub": "^0.8.2",
42
- "@blocklet/constant": "1.17.9",
43
- "@blocklet/did-domain-react": "^0.6.20",
44
- "@blocklet/did-space-react": "^1.2.15",
35
+ "@arcblock/icons": "^3.5.2",
36
+ "@arcblock/nft-display": "^3.5.2",
37
+ "@arcblock/react-hooks": "^3.5.2",
38
+ "@arcblock/terminal": "^3.5.2",
39
+ "@arcblock/ux": "^3.5.2",
40
+ "@arcblock/validator": "1.29.8",
41
+ "@blocklet/aigne-hub": "^0.8.5",
42
+ "@blocklet/constant": "1.17.10-beta-20260210-024836-33fc86ec",
43
+ "@blocklet/did-domain-react": "^0.6.21",
44
+ "@blocklet/did-space-react": "1.2.15",
45
45
  "@blocklet/error": "^0.3.5",
46
- "@blocklet/js-sdk": "1.17.9",
47
- "@blocklet/launcher-layout": "^3.5.0",
48
- "@blocklet/list": "^0.18.11",
49
- "@blocklet/meta": "1.17.9",
50
- "@blocklet/theme": "^3.5.0",
51
- "@blocklet/ui-react": "^3.5.0",
46
+ "@blocklet/js-sdk": "1.17.10-beta-20260210-024836-33fc86ec",
47
+ "@blocklet/launcher-layout": "^3.5.2",
48
+ "@blocklet/list": "^0.18.12",
49
+ "@blocklet/meta": "1.17.10-beta-20260210-024836-33fc86ec",
50
+ "@blocklet/theme": "^3.5.2",
51
+ "@blocklet/ui-react": "^3.5.2",
52
52
  "@blocklet/uploader": "^0.3.19",
53
53
  "@emotion/react": "^11.14.0",
54
54
  "@emotion/styled": "^11.14.1",
@@ -61,9 +61,9 @@
61
61
  "@mui/material": "^7.2.0",
62
62
  "@mui/x-date-pickers": "^8.9.0",
63
63
  "@mui/x-tree-view": "^8.9.0",
64
- "@ocap/client": "1.29.3",
65
- "@ocap/mcrypto": "1.29.3",
66
- "@ocap/util": "1.29.3",
64
+ "@ocap/client": "1.29.8",
65
+ "@ocap/mcrypto": "1.29.8",
66
+ "@ocap/util": "1.29.8",
67
67
  "@uiw/react-markdown-preview": "^5.1.1",
68
68
  "ahooks": "^3.7.8",
69
69
  "axios": "^1.7.9",
@@ -127,5 +127,5 @@
127
127
  "babel-plugin-inline-react-svg": "^2.0.2",
128
128
  "glob": "^10.4.1"
129
129
  },
130
- "gitHead": "05dcc21faa379fbffcde742a3ea0d9919258e750"
130
+ "gitHead": "103fca8786e6bc94a11315c05904effad033083e"
131
131
  }