message-verify 1.0.1-beta.8 → 1.0.1-beta.9

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.
@@ -7,5 +7,8 @@ declare const _default: {
7
7
  sendFailed: string;
8
8
  reSend: string;
9
9
  countDownSecound: string;
10
+ accountAlert: string;
11
+ alertContent: string;
12
+ ok: string;
10
13
  };
11
14
  export default _default;
@@ -6,5 +6,8 @@ export default {
6
6
  sendSuccess: 'Successfully sent',
7
7
  sendFailed: 'Send failed',
8
8
  reSend: 'Resend',
9
- countDownSecound: '{countdown} seconds'
9
+ countDownSecound: '{countdown} seconds',
10
+ accountAlert: 'Account Security Alert',
11
+ alertContent: 'Changes have been detected in your login environment or network information.To ensure account security, please log in again to verify your identity.',
12
+ ok: 'OK'
10
13
  };
@@ -7,5 +7,8 @@ declare const _default: {
7
7
  sendFailed: string;
8
8
  reSend: string;
9
9
  countDownSecound: string;
10
+ accountAlert: string;
11
+ alertContent: string;
12
+ ok: string;
10
13
  };
11
14
  export default _default;
@@ -6,5 +6,8 @@ export default {
6
6
  sendSuccess: 'Berhasil dikirim',
7
7
  sendFailed: 'Gagal mengirim',
8
8
  reSend: 'Kirim Ulang',
9
- countDownSecound: '{countdown} detik'
9
+ countDownSecound: '{countdown} detik',
10
+ accountAlert: 'Peringatan Keamanan Akun',
11
+ alertContent: 'Terdeteksi perubahan pada lingkungan login atau informasi jaringan Anda.Untuk menjaga keamanan akun, silakan login kembali untuk memverifikasi identitas Anda.',
12
+ ok: 'Baiklah'
10
13
  };
@@ -7,5 +7,8 @@ declare const _default: {
7
7
  sendFailed: string;
8
8
  reSend: string;
9
9
  countDownSecound: string;
10
+ accountAlert: string;
11
+ alertContent: string;
12
+ ok: string;
10
13
  };
11
14
  export default _default;
@@ -6,5 +6,8 @@ export default {
6
6
  sendSuccess: '发送成功',
7
7
  sendFailed: '发送失败',
8
8
  reSend: '重新发送',
9
- countDownSecound: '{countdown}秒'
9
+ countDownSecound: '{countdown}秒',
10
+ accountAlert: '账号安全提醒',
11
+ alertContent: '检测到您的登录环境或网络信息有变动,为保障账户安全,请重新登录验证身份',
12
+ ok: '好的'
10
13
  };
package/dist/main.js CHANGED
@@ -55,4 +55,5 @@ createRoot(document.getElementById('root')).render(_jsxs(_Fragment, { children:
55
55
  goLogin: () => {
56
56
  console.log('goLogin');
57
57
  },
58
+ lang: 'zh',
58
59
  }), children: "Show login Modal" })] }));
@@ -1,23 +1,23 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
3
  import { Modal, Button } from './compoments/index.js';
4
+ import t from './utils/i18n.js';
4
5
  const ReLoginModal = ({ props }) => {
5
- const { goLogin } = props || {};
6
+ const { goLogin, lang } = props || {};
6
7
  const [visible, setVisible] = useState(true);
7
8
  const onClose = () => {
8
9
  setVisible(false);
9
10
  goLogin();
10
11
  };
11
- return (_jsxs(Modal, { visible: visible, onClose: onClose, width: 420, children: [_jsx("div", { style: { fontWeight: 500, fontSize: 20, marginBottom: 24 }, children: "\u8D26\u53F7\u5B89\u5168\u63D0\u9192" }), _jsx("div", { style: { color: '#222', fontSize: 16, marginBottom: 40, lineHeight: '24px' }, children: "\u68C0\u6D4B\u5230\u60A8\u7684\u767B\u5F55\u73AF\u5883\u6216\u7F51\u7EDC\u4FE1\u606F\u6709\u53D8\u52A8\uFF0C\u4E3A\u4FDD\u969C\u8D26\u6237\u5B89\u5168\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\u9A8C\u8BC1\u8EAB\u4EFD" }), _jsx("div", { style: { display: 'flex', justifyContent: 'center' }, children: _jsx(Button, { style: {
12
+ return (_jsxs(Modal, { visible: visible, onClose: onClose, width: 420, children: [_jsx("div", { style: { fontWeight: 500, fontSize: 20, marginBottom: 24 }, children: t('accountAlert', lang) }), _jsx("div", { style: { color: '#222', fontSize: 16, marginBottom: 40, lineHeight: '24px' }, children: t('alertContent', lang) }), _jsx("div", { style: { display: 'flex', justifyContent: 'center' }, children: _jsx(Button, { style: {
12
13
  background: '#1677ff',
13
14
  color: '#fff',
14
15
  border: 'none',
15
- width: 160,
16
- height: 44,
17
- fontSize: 18,
18
- fontWeight: 500,
16
+ width: 80,
17
+ height: 36,
18
+ fontSize: 14,
19
19
  borderRadius: 8,
20
20
  boxShadow: '0 2px 8px rgba(22,119,255,0.08)',
21
- }, onClick: onClose, children: "\u597D\u7684" }) })] }));
21
+ }, onClick: onClose, children: t('ok', lang) }) })] }));
22
22
  };
23
23
  export default ReLoginModal;
@@ -7,7 +7,7 @@ export type ModalConfig = {
7
7
  };
8
8
  [key: string]: unknown;
9
9
  };
10
- lang: 'zh' | 'en' | 'id';
10
+ lang?: 'zh' | 'en' | 'id';
11
11
  http: {
12
12
  (params: object): Promise<unknown>;
13
13
  defaults: {
@@ -23,4 +23,5 @@ export type ModalConfig = {
23
23
  };
24
24
  export type LoginModalConfig = {
25
25
  goLogin: () => void;
26
+ lang?: 'zh' | 'en' | 'id';
26
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "message-verify",
3
- "version": "1.0.1-beta.8",
3
+ "version": "1.0.1-beta.9",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "dependencies": {
package/src/locales/en.ts CHANGED
@@ -6,5 +6,8 @@ export default {
6
6
  sendSuccess: 'Successfully sent',
7
7
  sendFailed: 'Send failed',
8
8
  reSend: 'Resend',
9
- countDownSecound: '{countdown} seconds'
9
+ countDownSecound: '{countdown} seconds',
10
+ accountAlert: 'Account Security Alert',
11
+ alertContent: 'Changes have been detected in your login environment or network information.To ensure account security, please log in again to verify your identity.',
12
+ ok: 'OK'
10
13
  };
package/src/locales/id.ts CHANGED
@@ -6,5 +6,8 @@ export default {
6
6
  sendSuccess: 'Berhasil dikirim',
7
7
  sendFailed: 'Gagal mengirim',
8
8
  reSend: 'Kirim Ulang',
9
- countDownSecound: '{countdown} detik'
9
+ countDownSecound: '{countdown} detik',
10
+ accountAlert: 'Peringatan Keamanan Akun',
11
+ alertContent: 'Terdeteksi perubahan pada lingkungan login atau informasi jaringan Anda.Untuk menjaga keamanan akun, silakan login kembali untuk memverifikasi identitas Anda.',
12
+ ok: 'Baiklah'
10
13
  };
package/src/locales/zh.ts CHANGED
@@ -6,5 +6,8 @@ export default {
6
6
  sendSuccess: '发送成功',
7
7
  sendFailed: '发送失败',
8
8
  reSend: '重新发送',
9
- countDownSecound: '{countdown}秒'
9
+ countDownSecound: '{countdown}秒',
10
+ accountAlert: '账号安全提醒',
11
+ alertContent: '检测到您的登录环境或网络信息有变动,为保障账户安全,请重新登录验证身份',
12
+ ok: '好的'
10
13
  };
package/src/main.tsx CHANGED
@@ -62,6 +62,7 @@ createRoot(document.getElementById('root')!).render(
62
62
  goLogin: () => {
63
63
  console.log('goLogin');
64
64
  },
65
+ lang: 'zh',
65
66
  })}>
66
67
  Show login Modal
67
68
  </button>
@@ -1,9 +1,10 @@
1
1
  import { useState } from 'react'
2
2
  import { Modal, Button } from './compoments/index.js'
3
3
  import { LoginModalConfig } from './utils/type.js';
4
+ import t from './utils/i18n.js'
4
5
 
5
6
  const ReLoginModal = ({ props }: { props: LoginModalConfig }) => {
6
- const { goLogin } = props || {};
7
+ const { goLogin, lang } = props || {};
7
8
  const [visible, setVisible] = useState(true);
8
9
  const onClose = () => {
9
10
  setVisible(false);
@@ -12,10 +13,10 @@ const ReLoginModal = ({ props }: { props: LoginModalConfig }) => {
12
13
  return (
13
14
  <Modal visible={visible} onClose={onClose} width={420}>
14
15
  <div style={{ fontWeight: 500, fontSize: 20, marginBottom: 24 }}>
15
- 账号安全提醒
16
+ {t('accountAlert', lang)}
16
17
  </div>
17
18
  <div style={{ color: '#222', fontSize: 16, marginBottom: 40, lineHeight: '24px' }}>
18
- 检测到您的登录环境或网络信息有变动,为保障账户安全,请重新登录验证身份
19
+ {t('alertContent', lang)}
19
20
  </div>
20
21
  <div style={{ display: 'flex', justifyContent: 'center' }}>
21
22
  <Button
@@ -23,16 +24,15 @@ const ReLoginModal = ({ props }: { props: LoginModalConfig }) => {
23
24
  background: '#1677ff',
24
25
  color: '#fff',
25
26
  border: 'none',
26
- width: 160,
27
- height: 44,
28
- fontSize: 18,
29
- fontWeight: 500,
27
+ width: 80,
28
+ height: 36,
29
+ fontSize: 14,
30
30
  borderRadius: 8,
31
31
  boxShadow: '0 2px 8px rgba(22,119,255,0.08)',
32
32
  }}
33
33
  onClick={onClose}
34
34
  >
35
- 好的
35
+ {t('ok', lang)}
36
36
  </Button>
37
37
  </div>
38
38
  </Modal>
package/src/utils/type.ts CHANGED
@@ -8,7 +8,7 @@ export type ModalConfig = {
8
8
  };
9
9
  [key: string]: unknown;
10
10
  };
11
- lang: 'zh' | 'en' | 'id';
11
+ lang?: 'zh' | 'en' | 'id';
12
12
  http: {
13
13
  (params: object): Promise<unknown>;
14
14
  defaults: {
@@ -25,4 +25,5 @@ export type ModalConfig = {
25
25
 
26
26
  export type LoginModalConfig = {
27
27
  goLogin: () => void;
28
+ lang?: 'zh' | 'en' | 'id';
28
29
  }