iglooform 3.0.0-alpha.9 → 3.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.
Files changed (64) hide show
  1. package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +2 -2
  2. package/es/form/hsteps/index.js +8 -11
  3. package/es/form/steps/index.js +8 -11
  4. package/es/free-form/steps/index.js +8 -11
  5. package/es/hooks/ocr/index.js +1 -3
  6. package/es/hooks/ocr/micro-blink.d.ts +4 -1
  7. package/es/hooks/ocr/micro-blink.js +42 -20
  8. package/es/locale/en-US/messages.json +4 -0
  9. package/es/locale/id-ID/messages.json +4 -0
  10. package/es/locale/th-TH/messages.json +4 -0
  11. package/es/locale/vi-VN/messages.json +4 -0
  12. package/es/locale/zh-CN/messages.json +4 -0
  13. package/es/locale/zh-TW/messages.json +4 -0
  14. package/es/ocr/micro-blink/index.js +52 -48
  15. package/es/types.d.ts +1 -0
  16. package/lib/form/hsteps/index.js +8 -11
  17. package/lib/form/steps/index.js +8 -11
  18. package/lib/free-form/steps/index.js +8 -11
  19. package/lib/hooks/ocr/index.js +1 -3
  20. package/lib/hooks/ocr/micro-blink.d.ts +4 -1
  21. package/lib/hooks/ocr/micro-blink.js +41 -19
  22. package/lib/locale/en-US/messages.json +4 -0
  23. package/lib/locale/id-ID/messages.json +4 -0
  24. package/lib/locale/th-TH/messages.json +4 -0
  25. package/lib/locale/vi-VN/messages.json +4 -0
  26. package/lib/locale/zh-CN/messages.json +4 -0
  27. package/lib/locale/zh-TW/messages.json +4 -0
  28. package/lib/ocr/micro-blink/index.js +51 -47
  29. package/lib/types.d.ts +1 -0
  30. package/package.json +1 -1
  31. package/es/admin-amount/style/index.d.ts +0 -0
  32. package/es/babel-plugin-import-option.d.ts +0 -7
  33. package/es/back-top/index.d.ts +0 -5
  34. package/es/input/style/amount/index.d.ts +0 -2
  35. package/es/input/style/index.d.ts +0 -2
  36. package/es/input/style/input-date/index.d.ts +0 -2
  37. package/es/input/style/otp/index.d.ts +0 -2
  38. package/es/input/style/phone-number/index.d.ts +0 -2
  39. package/es/input/style/text-area/index.d.ts +0 -2
  40. package/es/locale/locale-provider.d.ts +0 -11
  41. package/es/login-page/index.d.ts +0 -7
  42. package/es/message/style/index.d.ts +0 -1
  43. package/es/ocr/micro-blink/style/index.d.ts +0 -1
  44. package/es/platform/platform-card/index.d.ts +0 -12
  45. package/es/platform/switch-platform/index.d.ts +0 -12
  46. package/es/tabs/index.d.ts +0 -15
  47. package/es/utils/useAsyncEffect.d.ts +0 -3
  48. package/lib/admin-amount/style/index.d.ts +0 -0
  49. package/lib/babel-plugin-import-option.d.ts +0 -7
  50. package/lib/back-top/index.d.ts +0 -5
  51. package/lib/input/style/amount/index.d.ts +0 -2
  52. package/lib/input/style/index.d.ts +0 -2
  53. package/lib/input/style/input-date/index.d.ts +0 -2
  54. package/lib/input/style/otp/index.d.ts +0 -2
  55. package/lib/input/style/phone-number/index.d.ts +0 -2
  56. package/lib/input/style/text-area/index.d.ts +0 -2
  57. package/lib/locale/locale-provider.d.ts +0 -11
  58. package/lib/login-page/index.d.ts +0 -7
  59. package/lib/message/style/index.d.ts +0 -1
  60. package/lib/ocr/micro-blink/style/index.d.ts +0 -1
  61. package/lib/platform/platform-card/index.d.ts +0 -12
  62. package/lib/platform/switch-platform/index.d.ts +0 -12
  63. package/lib/tabs/index.d.ts +0 -15
  64. package/lib/utils/useAsyncEffect.d.ts +0 -3
@@ -59,14 +59,11 @@ var HSteps = function HSteps(_ref) {
59
59
  _useState2 = _slicedToArray(_useState, 2),
60
60
  current = _useState2[0],
61
61
  setCurrent = _useState2[1];
62
- var _useState3 = (0, _react.useState)(0),
62
+ // const [last, setLast] = useState(0);
63
+ var _useState3 = (0, _react.useState)(false),
63
64
  _useState4 = _slicedToArray(_useState3, 2),
64
- last = _useState4[0],
65
- setLast = _useState4[1];
66
- var _useState5 = (0, _react.useState)(false),
67
- _useState6 = _slicedToArray(_useState5, 2),
68
- shouldScroll = _useState6[0],
69
- setShouldScroll = _useState6[1];
65
+ shouldScroll = _useState4[0],
66
+ setShouldScroll = _useState4[1];
70
67
  var _useReducer = (0, _react.useReducer)(function (r) {
71
68
  return r + 1;
72
69
  }, 0),
@@ -210,10 +207,10 @@ var HSteps = function HSteps(_ref) {
210
207
  _context.t2 = _context["catch"](31);
211
208
  return _context.abrupt("return");
212
209
  case 42:
213
- setCurrent(last || current + 1);
214
- setLast(0);
210
+ setCurrent(current + 1);
211
+ // setLast(0);
215
212
  setShouldScroll(true);
216
- case 45:
213
+ case 44:
217
214
  case "end":
218
215
  return _context.stop();
219
216
  }
@@ -224,7 +221,7 @@ var HSteps = function HSteps(_ref) {
224
221
  };
225
222
  }();
226
223
  var handleEdit = function handleEdit(index) {
227
- setLast(current);
224
+ // setLast(current);
228
225
  setCurrent(index);
229
226
  setShouldScroll(false);
230
227
  typeof onEdit === 'function' && onEdit(index);
@@ -44,14 +44,11 @@ var Steps = function Steps(_ref) {
44
44
  _useState2 = _slicedToArray(_useState, 2),
45
45
  current = _useState2[0],
46
46
  setCurrent = _useState2[1];
47
- var _useState3 = (0, _react.useState)(0),
47
+ // const [last, setLast] = useState(0);
48
+ var _useState3 = (0, _react.useState)(false),
48
49
  _useState4 = _slicedToArray(_useState3, 2),
49
- last = _useState4[0],
50
- setLast = _useState4[1];
51
- var _useState5 = (0, _react.useState)(false),
52
- _useState6 = _slicedToArray(_useState5, 2),
53
- shouldScroll = _useState6[0],
54
- setShouldScroll = _useState6[1];
50
+ shouldScroll = _useState4[0],
51
+ setShouldScroll = _useState4[1];
55
52
  var _useReducer = (0, _react.useReducer)(function (r) {
56
53
  return r + 1;
57
54
  }, 0),
@@ -174,10 +171,10 @@ var Steps = function Steps(_ref) {
174
171
  _context.t2 = _context["catch"](29);
175
172
  return _context.abrupt("return");
176
173
  case 40:
177
- setCurrent(last || current + 1);
178
- setLast(0);
174
+ setCurrent(current + 1);
175
+ // setLast(0);
179
176
  setShouldScroll(true);
180
- case 43:
177
+ case 42:
181
178
  case "end":
182
179
  return _context.stop();
183
180
  }
@@ -188,7 +185,7 @@ var Steps = function Steps(_ref) {
188
185
  };
189
186
  }();
190
187
  var handleEdit = function handleEdit(index) {
191
- setLast(current);
188
+ // setLast(current);
192
189
  setCurrent(index);
193
190
  setShouldScroll(false);
194
191
  typeof onEdit === 'function' && onEdit(index);
@@ -37,14 +37,11 @@ var Steps = function Steps(_ref) {
37
37
  _useState2 = _slicedToArray(_useState, 2),
38
38
  current = _useState2[0],
39
39
  setCurrent = _useState2[1];
40
- var _useState3 = (0, _react.useState)(0),
40
+ // const [last, setLast] = useState(0);
41
+ var _useState3 = (0, _react.useState)(false),
41
42
  _useState4 = _slicedToArray(_useState3, 2),
42
- last = _useState4[0],
43
- setLast = _useState4[1];
44
- var _useState5 = (0, _react.useState)(false),
45
- _useState6 = _slicedToArray(_useState5, 2),
46
- shouldScroll = _useState6[0],
47
- setShouldScroll = _useState6[1];
43
+ shouldScroll = _useState4[0],
44
+ setShouldScroll = _useState4[1];
48
45
  (0, _react.useEffect)(function () {
49
46
  if (currentStep === undefined || currentStep === current) return;
50
47
  setCurrent(currentStep);
@@ -54,10 +51,10 @@ var Steps = function Steps(_ref) {
54
51
  return _regeneratorRuntime().wrap(function _callee$(_context) {
55
52
  while (1) switch (_context.prev = _context.next) {
56
53
  case 0:
57
- setCurrent(last || current + 1);
58
- setLast(0);
54
+ setCurrent(current + 1);
55
+ // setLast(0);
59
56
  setShouldScroll(true);
60
- case 3:
57
+ case 2:
61
58
  case "end":
62
59
  return _context.stop();
63
60
  }
@@ -68,7 +65,7 @@ var Steps = function Steps(_ref) {
68
65
  };
69
66
  }();
70
67
  var handleEdit = function handleEdit(index) {
71
- setLast(current);
68
+ // setLast(current);
72
69
  setCurrent(index);
73
70
  setShouldScroll(false);
74
71
  typeof onEdit === 'function' && onEdit(index);
@@ -16,9 +16,7 @@ var useOCR = function useOCR() {
16
16
  var hooks = {};
17
17
  (0, _invariant.default)(Boolean(microBlink) === Boolean(licenseKey), 'Must Config licenseKey of Micro Blink');
18
18
  if (microBlink && licenseKey) {
19
- hooks['microBlink'] = {
20
- recognize: createRecognize(licenseKey)
21
- };
19
+ hooks['microBlink'] = createRecognize(licenseKey);
22
20
  }
23
21
  return hooks;
24
22
  };
@@ -1,3 +1,6 @@
1
1
  import * as BlinkIDSDK from '@microblink/blinkid-in-browser-sdk';
2
- declare const useMicroBlink: () => (licenseKey: string) => (file: File) => Promise<BlinkIDSDK.BlinkIdSingleSideRecognizerResult | null>;
2
+ declare const useMicroBlink: () => (licenseKey: string) => {
3
+ recognize: (file: File) => Promise<BlinkIDSDK.BlinkIdSingleSideRecognizerResult | null>;
4
+ loading: boolean;
5
+ };
3
6
  export default useMicroBlink;
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _react = require("react");
9
9
  var BlinkIDSDK = _interopRequireWildcard(require("@microblink/blinkid-in-browser-sdk"));
10
+ var _locale = require("../../locale");
10
11
  var _message = _interopRequireDefault(require("../../message"));
11
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
13
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -49,18 +50,24 @@ function _getWorkerLocation() {
49
50
  return _getWorkerLocation.apply(this, arguments);
50
51
  }
51
52
  var useMicroBlink = function useMicroBlink() {
52
- var _useState = (0, _react.useState)(''),
53
+ var _useContext = (0, _react.useContext)(_locale.LocaleContext),
54
+ formatMessage = _useContext.formatMessage;
55
+ var _useState = (0, _react.useState)(false),
53
56
  _useState2 = _slicedToArray(_useState, 2),
54
- currentKey = _useState2[0],
55
- setCurrentKey = _useState2[1];
56
- var _useState3 = (0, _react.useState)(null),
57
+ initLoading = _useState2[0],
58
+ setInitLoading = _useState2[1];
59
+ var _useState3 = (0, _react.useState)(''),
57
60
  _useState4 = _slicedToArray(_useState3, 2),
58
- recognizer = _useState4[0],
59
- setRecognizer = _useState4[1];
61
+ currentKey = _useState4[0],
62
+ setCurrentKey = _useState4[1];
60
63
  var _useState5 = (0, _react.useState)(null),
61
64
  _useState6 = _slicedToArray(_useState5, 2),
62
- recognizerRunner = _useState6[0],
63
- setRecognizerRunner = _useState6[1];
65
+ recognizer = _useState6[0],
66
+ setRecognizer = _useState6[1];
67
+ var _useState7 = (0, _react.useState)(null),
68
+ _useState8 = _slicedToArray(_useState7, 2),
69
+ recognizerRunner = _useState8[0],
70
+ setRecognizerRunner = _useState8[1];
64
71
  var initSdk = /*#__PURE__*/function () {
65
72
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(licenseKey) {
66
73
  var loadSettings;
@@ -68,14 +75,15 @@ var useMicroBlink = function useMicroBlink() {
68
75
  while (1) switch (_context2.prev = _context2.next) {
69
76
  case 0:
70
77
  if (!BlinkIDSDK.isBrowserSupported()) {
71
- _context2.next = 9;
78
+ _context2.next = 10;
72
79
  break;
73
80
  }
81
+ setInitLoading(true);
74
82
  loadSettings = new BlinkIDSDK.WasmSDKLoadSettings(licenseKey);
75
83
  loadSettings.engineLocation = MICRO_BLINK_SERVICE_PATH;
76
- _context2.next = 5;
84
+ _context2.next = 6;
77
85
  return getWorkerLocation("".concat(MICRO_BLINK_SERVICE_PATH, "/BlinkIDWasmSDK.worker.min.js"));
78
- case 5:
86
+ case 6:
79
87
  loadSettings.workerLocation = _context2.sent;
80
88
  BlinkIDSDK.loadWasmModule(loadSettings).then( /*#__PURE__*/function () {
81
89
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(wasmSDK) {
@@ -88,12 +96,13 @@ var useMicroBlink = function useMicroBlink() {
88
96
  case 2:
89
97
  recognizer = _context.sent;
90
98
  _context.next = 5;
91
- return BlinkIDSDK.createRecognizerRunner(wasmSDK, [recognizer], true);
99
+ return BlinkIDSDK.createRecognizerRunner(wasmSDK, [recognizer], false);
92
100
  case 5:
93
101
  recognizerRunner = _context.sent;
94
102
  setRecognizer(recognizer);
95
103
  setRecognizerRunner(recognizerRunner);
96
- case 8:
104
+ setInitLoading(false);
105
+ case 9:
97
106
  case "end":
98
107
  return _context.stop();
99
108
  }
@@ -103,13 +112,21 @@ var useMicroBlink = function useMicroBlink() {
103
112
  return _ref2.apply(this, arguments);
104
113
  };
105
114
  }(), function (error) {
106
- console.log('Error during the initialization of the SDK!', error);
115
+ setInitLoading(false);
116
+ _message.default.error(formatMessage({
117
+ id: 'Error during the initialization of the SDK! {error}',
118
+ values: {
119
+ error: error.message || error
120
+ }
121
+ }));
107
122
  });
108
- _context2.next = 10;
123
+ _context2.next = 11;
109
124
  break;
110
- case 9:
111
- _message.default.error('This browser is not supported by the SDK!');
112
125
  case 10:
126
+ _message.default.error(formatMessage({
127
+ id: 'This browser is not supported by the SDK!'
128
+ }));
129
+ case 11:
113
130
  case "end":
114
131
  return _context2.stop();
115
132
  }
@@ -147,7 +164,9 @@ var useMicroBlink = function useMicroBlink() {
147
164
  recognitionResult = _context3.sent;
148
165
  return _context3.abrupt("return", recognitionResult);
149
166
  case 15:
150
- _message.default.error('Recognition was not successful!');
167
+ _message.default.error(formatMessage({
168
+ id: 'Recognition was not successful!'
169
+ }));
151
170
  return _context3.abrupt("return", null);
152
171
  case 17:
153
172
  case "end":
@@ -188,7 +207,10 @@ var useMicroBlink = function useMicroBlink() {
188
207
  };
189
208
  return function (licenseKey) {
190
209
  dealRepeatSendRequest(licenseKey);
191
- return recognize();
210
+ return {
211
+ recognize: recognize(),
212
+ loading: initLoading
213
+ };
192
214
  };
193
215
  };
194
216
  var _default = useMicroBlink;
@@ -27,6 +27,7 @@
27
27
  "Encrypted PDF": "Encrypted PDF",
28
28
  "Enter the password to open this PDF file.": "Enter the password to open this PDF file.",
29
29
  "Error Report": "Error Report",
30
+ "Error during the initialization of the SDK! {error}": "Error during the initialization of the SDK! {error}",
30
31
  "Failed to load PDF file.": "Failed to load PDF file.",
31
32
  "Filter": "Filter",
32
33
  "I agree to the Igloo": "I agree to the Igloo",
@@ -42,6 +43,7 @@
42
43
  "Log in": "Log in",
43
44
  "Next": "Next",
44
45
  "No preview for this file. Only support image, video or PDF file.": "No preview for this file. Only support image, video or PDF file.",
46
+ "Nothing has been recognized.": "Nothing has been recognized.",
45
47
  "Numbers only, please omit \" \" or \"-\".": "Numbers only, please omit \" \" or \"-\".",
46
48
  "OK": "OK",
47
49
  "Ok": "Ok",
@@ -62,6 +64,7 @@
62
64
  "Processing": "Processing",
63
65
  "Processing progress cannot be updated at the moment. Don’t worry! All your file data are still in progress.": "Processing progress cannot be updated at the moment. Don’t worry! All your file data are still in progress.",
64
66
  "Quantity of files should be less than {limit}": "Quantity of files should be less than {limit}",
67
+ "Recognition was not successful!": "Recognition was not successful!",
65
68
  "Reject": "Reject",
66
69
  "Remove": "Remove",
67
70
  "Resend OTP": "Resend OTP",
@@ -80,6 +83,7 @@
80
83
  "The file type is not supported.": "The file type is not supported.",
81
84
  "There are no options available currently": "There are no options available currently",
82
85
  "This Month": "This Month",
86
+ "This browser is not supported by the SDK!": "This browser is not supported by the SDK!",
83
87
  "This is an encrypted file, click to enter password.": "This is an encrypted file, click to enter password.",
84
88
  "Unselect All": "Unselect All",
85
89
  "Uploading": "Uploading",
@@ -27,6 +27,7 @@
27
27
  "Encrypted PDF": "PDF terenkripsi",
28
28
  "Enter the password to open this PDF file.": "Masukkan kata sandi untuk membuka file PDF ini.",
29
29
  "Error Report": "Laporan Kesalahan",
30
+ "Error during the initialization of the SDK! {error}": "",
30
31
  "Failed to load PDF file.": "Gagal memuat file PDF.",
31
32
  "Filter": "Saring",
32
33
  "I agree to the Igloo": "Saya setuju dengan Igloo",
@@ -42,6 +43,7 @@
42
43
  "Log in": "Masuk",
43
44
  "Next": "Selanjutnya",
44
45
  "No preview for this file. Only support image, video or PDF file.": "Tidak ada pratinjau untuk file ini. Hanya mendukung file gambar, video atau PDF.",
46
+ "Nothing has been recognized.": "",
45
47
  "Numbers only, please omit \" \" or \"-\".": "Angka saja, harap hilangkan \" \" atau \"-\".",
46
48
  "OK": "oke",
47
49
  "Ok": "oke",
@@ -62,6 +64,7 @@
62
64
  "Processing": "Sedang diproses",
63
65
  "Processing progress cannot be updated at the moment. Don’t worry! All your file data are still in progress.": "Perkembangan terkait proses belum dapat diperbarui saat ini. Jangan khawatir! Semua data Anda masih dalam proses .",
64
66
  "Quantity of files should be less than {limit}": "Jumlah dokumen tidak bisa lebih dari {limit}",
67
+ "Recognition was not successful!": "",
65
68
  "Reject": "Menolak",
66
69
  "Remove": "Menghapus",
67
70
  "Resend OTP": "Kirim ulang OTP",
@@ -80,6 +83,7 @@
80
83
  "The file type is not supported.": "Jenis file tidak didukung.",
81
84
  "There are no options available currently": "Tidak ada opsi yang tersedia saat ini",
82
85
  "This Month": "Bulan ini",
86
+ "This browser is not supported by the SDK!": "",
83
87
  "This is an encrypted file, click to enter password.": "Ini adalah file terenkripsi, klik untuk memasukkan kata sandi.",
84
88
  "Unselect All": "Batalkan semua",
85
89
  "Uploading": "Mengunggah",
@@ -27,6 +27,7 @@
27
27
  "Encrypted PDF": "PDF ที่เข้ารหัส",
28
28
  "Enter the password to open this PDF file.": "ป้อนรหัสผ่านเพื่อเปิดไฟล์ PDF นี้",
29
29
  "Error Report": "รายงานข้อผิดพลาด",
30
+ "Error during the initialization of the SDK! {error}": "",
30
31
  "Failed to load PDF file.": "ไม่สามารถโหลดไฟล์ PDF",
31
32
  "Filter": "กรอง",
32
33
  "I agree to the Igloo": "ฉันเห็นด้วยกับกระท่อมน้ำแข็ง",
@@ -42,6 +43,7 @@
42
43
  "Log in": "เข้าสู่ระบบ",
43
44
  "Next": "ต่อไป",
44
45
  "No preview for this file. Only support image, video or PDF file.": "ไม่มีการแสดงตัวอย่างสำหรับไฟล์นี้ รองรับเฉพาะรูปภาพ, วิดีโอ หรือ ไฟล์ PDF",
46
+ "Nothing has been recognized.": "",
45
47
  "Numbers only, please omit \" \" or \"-\".": "ตัวเลขเท่านั้น โปรดเว้น \" \" หรือ \"-\"",
46
48
  "OK": "ตกลง",
47
49
  "Ok": "ตกลง",
@@ -62,6 +64,7 @@
62
64
  "Processing": "กำลังประมวลผล",
63
65
  "Processing progress cannot be updated at the moment. Don’t worry! All your file data are still in progress.": "ไม่สามารถอัปเดตการประมวลผลได้ในขณะนี้ ไม่ต้องกังวล! ไฟล์ของคุณทั้งหมดกำลังอยู่ระหว่างดำเนินการ",
64
66
  "Quantity of files should be less than {limit}": "จำนวนไฟล์ควรน้อยกว่า {limit}",
67
+ "Recognition was not successful!": "",
65
68
  "Reject": "ปฏิเสธ",
66
69
  "Remove": "ลบ",
67
70
  "Resend OTP": "ขอ OTP อีกครั้ง",
@@ -80,6 +83,7 @@
80
83
  "The file type is not supported.": "ประเภทไฟล์ไม่รองรับ",
81
84
  "There are no options available currently": "ไม่มีตัวเลือกในขณะนี้",
82
85
  "This Month": "เดือนนี้",
86
+ "This browser is not supported by the SDK!": "",
83
87
  "This is an encrypted file, click to enter password.": "นี่เป็นไฟล์ที่เข้ารหัส คลิกเพื่อป้อนรหัสผ่าน",
84
88
  "Unselect All": "ไม่เลือกทั้งหมด",
85
89
  "Uploading": "กำลังอัพโหลด",
@@ -27,6 +27,7 @@
27
27
  "Encrypted PDF": "PDF được mã hóa",
28
28
  "Enter the password to open this PDF file.": "Nhập mật khẩu để mở tệp PDF này.",
29
29
  "Error Report": "Báo cáo lỗi",
30
+ "Error during the initialization of the SDK! {error}": "",
30
31
  "Failed to load PDF file.": "Không tải được tệp PDF.",
31
32
  "Filter": "Lọc",
32
33
  "I agree to the Igloo": "Tôi đồng ý với Igloo",
@@ -42,6 +43,7 @@
42
43
  "Log in": "Đăng nhập",
43
44
  "Next": "Tiếp theo",
44
45
  "No preview for this file. Only support image, video or PDF file.": "Không có bản xem trước cho tệp này. Chỉ hỗ trợ hình ảnh, video hoặc tệp PDF.",
46
+ "Nothing has been recognized.": "",
45
47
  "Numbers only, please omit \" \" or \"-\".": "Chỉ số, vui lòng bỏ qua \" \" hoặc \"-\".",
46
48
  "OK": "Vâng",
47
49
  "Ok": "Vâng",
@@ -62,6 +64,7 @@
62
64
  "Processing": "Đang xử lý",
63
65
  "Processing progress cannot be updated at the moment. Don’t worry! All your file data are still in progress.": "Dữ liệu chưa được cập nhật và đang trong quá trình xử lý.",
64
66
  "Quantity of files should be less than {limit}": "Số lượng tệp tin không vượt quá {limit}",
67
+ "Recognition was not successful!": "",
65
68
  "Reject": "Từ chối",
66
69
  "Remove": "tẩy",
67
70
  "Resend OTP": "Gửi lại OTP",
@@ -80,6 +83,7 @@
80
83
  "The file type is not supported.": "Loại tệp không được hỗ trợ.",
81
84
  "There are no options available currently": "Hiện tại không có tùy chọn nào",
82
85
  "This Month": "Tháng này",
86
+ "This browser is not supported by the SDK!": "",
83
87
  "This is an encrypted file, click to enter password.": "Đây là một tập tin được mã hóa, bấm vào để nhập mật khẩu.",
84
88
  "Unselect All": "Hủy chọn tất cả",
85
89
  "Uploading": "Đang tải lên",
@@ -27,6 +27,7 @@
27
27
  "Encrypted PDF": "加密的PDF文件",
28
28
  "Enter the password to open this PDF file.": "输入密码后预览该文件",
29
29
  "Error Report": "错误报告",
30
+ "Error during the initialization of the SDK! {error}": "",
30
31
  "Failed to load PDF file.": "PDF文件加载失败",
31
32
  "Filter": "过滤条件",
32
33
  "I agree to the Igloo": "我同意Igloo",
@@ -42,6 +43,7 @@
42
43
  "Log in": "登录",
43
44
  "Next": "下一步",
44
45
  "No preview for this file. Only support image, video or PDF file.": "此文件不支持预览。仅支持图片、视频和PDF。",
46
+ "Nothing has been recognized.": "",
45
47
  "Numbers only, please omit \" \" or \"-\".": "仅数字,请省略“ ”或“-”。",
46
48
  "OK": "确定",
47
49
  "Ok": "确定",
@@ -62,6 +64,7 @@
62
64
  "Processing": "解析中",
63
65
  "Processing progress cannot be updated at the moment. Don’t worry! All your file data are still in progress.": "文件解析中,请耐心等待。",
64
66
  "Quantity of files should be less than {limit}": "文件数量不能超过{limit}",
67
+ "Recognition was not successful!": "",
65
68
  "Reject": "拒绝",
66
69
  "Remove": "移除",
67
70
  "Resend OTP": "重新发送OTP",
@@ -80,6 +83,7 @@
80
83
  "The file type is not supported.": "不支持上传该类型的文件。",
81
84
  "There are no options available currently": "当前没有可用的选项",
82
85
  "This Month": "当月",
86
+ "This browser is not supported by the SDK!": "",
83
87
  "This is an encrypted file, click to enter password.": "该文件已加密,请输入密码。",
84
88
  "Unselect All": "反选",
85
89
  "Uploading": "上传中",
@@ -27,6 +27,7 @@
27
27
  "Encrypted PDF": "",
28
28
  "Enter the password to open this PDF file.": "",
29
29
  "Error Report": "錯誤報告",
30
+ "Error during the initialization of the SDK! {error}": "",
30
31
  "Failed to load PDF file.": "",
31
32
  "Filter": "篩選",
32
33
  "I agree to the Igloo": "",
@@ -42,6 +43,7 @@
42
43
  "Log in": "登錄",
43
44
  "Next": "下一個",
44
45
  "No preview for this file. Only support image, video or PDF file.": "不支持預覽此文件。只支持圖像,視頻或PDF文件。",
46
+ "Nothing has been recognized.": "",
45
47
  "Numbers only, please omit \" \" or \"-\".": "只有數字,請省略“”或“ - ”。",
46
48
  "OK": "好",
47
49
  "Ok": "",
@@ -62,6 +64,7 @@
62
64
  "Processing": "處理中",
63
65
  "Processing progress cannot be updated at the moment. Don’t worry! All your file data are still in progress.": "此刻無法更新處理進度。別擔心!您的所有文件數據仍在進行中。",
64
66
  "Quantity of files should be less than {limit}": "文件的數量應小於{limit}",
67
+ "Recognition was not successful!": "",
65
68
  "Reject": "拒絕",
66
69
  "Remove": "消除",
67
70
  "Resend OTP": "重新發送OTP.",
@@ -80,6 +83,7 @@
80
83
  "The file type is not supported.": "不支持文件類型。",
81
84
  "There are no options available currently": "當前沒有可用的選項",
82
85
  "This Month": "本月",
86
+ "This browser is not supported by the SDK!": "",
83
87
  "This is an encrypted file, click to enter password.": "",
84
88
  "Unselect All": "全部取消選擇",
85
89
  "Uploading": "上傳",
@@ -47,7 +47,8 @@ var MicroBlink = function MicroBlink(props) {
47
47
  var _ref = ocrHooks || {},
48
48
  microBlink = _ref.microBlink;
49
49
  var _ref2 = microBlink || {},
50
- recognize = _ref2.recognize;
50
+ recognize = _ref2.recognize,
51
+ loading = _ref2.loading;
51
52
  (0, _invariant.default)(Boolean(microBlink) && Boolean(recognize), 'Must Config Micro Blink licenseKey');
52
53
  var onUpload = /*#__PURE__*/function () {
53
54
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
@@ -115,54 +116,57 @@ var MicroBlink = function MicroBlink(props) {
115
116
  return _ref3.apply(this, arguments);
116
117
  };
117
118
  }();
118
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
119
- className: 'igloo-micro-blink',
120
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Dragger, {
121
- action: function action(file) {
122
- onUpload(file);
123
- return '';
124
- },
125
- showUploadList: false,
126
- className: "igloo-upload-box",
127
- customRequest: function customRequest() {}
128
- //@ts-ignore
129
- ,
130
- disabled: disabled,
131
- multiple: true,
132
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
133
- className: "igloo-upload-box-center",
134
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_iglooicon.UploadOutlined, {
135
- style: {
136
- marginRight: 16,
137
- fontSize: 24,
138
- color: '#666666'
139
- }
140
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
141
- className: "igloo-upload-placeholder",
142
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
143
- level: "body1",
144
- children: formatMessage({
145
- id: 'Drag and drop a file here'
146
- })
147
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
148
- level: "body1",
119
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Spin, {
120
+ spinning: loading,
121
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
122
+ className: 'igloo-micro-blink',
123
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Dragger, {
124
+ action: function action(file) {
125
+ onUpload(file);
126
+ return '';
127
+ },
128
+ showUploadList: false,
129
+ className: "igloo-upload-box",
130
+ customRequest: function customRequest() {}
131
+ // @ts-ignore
132
+ ,
133
+ disabled: disabled,
134
+ multiple: true,
135
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
136
+ className: "igloo-upload-box-center",
137
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_iglooicon.UploadOutlined, {
149
138
  style: {
150
- marginLeft: 4
151
- },
152
- children: formatMessage({
153
- id: 'or'
154
- })
155
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
156
- level: "body1",
157
- style: {
158
- color: _iglootheme.colors.purpleMain,
159
- marginLeft: 4
160
- },
161
- children: formatMessage({
162
- id: 'browse'
163
- })
139
+ marginRight: 16,
140
+ fontSize: 24,
141
+ color: '#666666'
142
+ }
143
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
144
+ className: "igloo-upload-placeholder",
145
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
146
+ level: "body1",
147
+ children: formatMessage({
148
+ id: 'Drag and drop a file here'
149
+ })
150
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
151
+ level: "body1",
152
+ style: {
153
+ marginLeft: 4
154
+ },
155
+ children: formatMessage({
156
+ id: 'or'
157
+ })
158
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
159
+ level: "body1",
160
+ style: {
161
+ color: _iglootheme.colors.purpleMain,
162
+ marginLeft: 4
163
+ },
164
+ children: formatMessage({
165
+ id: 'browse'
166
+ })
167
+ })]
164
168
  })]
165
- })]
169
+ })
166
170
  })
167
171
  })
168
172
  });
package/lib/types.d.ts CHANGED
@@ -9,6 +9,7 @@ export { Rule } from 'rc-field-form/lib/interface';
9
9
  export interface OCRHooks {
10
10
  microBlink?: {
11
11
  recognize: ((file: File) => Promise<BlinkIdSingleSideRecognizerResult | null>) | null;
12
+ loading?: boolean;
12
13
  };
13
14
  }
14
15
  export interface OCRConfig {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iglooform",
3
- "version": "3.0.0-alpha.9",
3
+ "version": "3.0.1",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "build-dev": "dumi build",
File without changes
@@ -1,7 +0,0 @@
1
- declare const _default: {
2
- libraryName: string;
3
- libraryDirectory: string;
4
- style: boolean;
5
- customName: (name: string) => string;
6
- };
7
- export default _default;
@@ -1,5 +0,0 @@
1
- import { FC } from 'react';
2
- import './style';
3
- import { BackTopProps } from 'antd';
4
- declare const BackToTop: FC<BackTopProps>;
5
- export default BackToTop;
@@ -1,2 +0,0 @@
1
- import '../index';
2
- import './index.less';
@@ -1,2 +0,0 @@
1
- import './default-input.less';
2
- import './common.less';
@@ -1,2 +0,0 @@
1
- import '../index';
2
- import './index.less';
@@ -1,2 +0,0 @@
1
- import '../index';
2
- import './index.less';
@@ -1,2 +0,0 @@
1
- import '../index';
2
- import './index.less';
@@ -1,2 +0,0 @@
1
- import '../index';
2
- import './index.less';