@idscan/idvc2 2.1.3 → 2.1.5

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/README.md CHANGED
@@ -8,6 +8,8 @@ Upon being switched on, the library integrates the component of capturing the do
8
8
  - Capture of pdf417
9
9
  - Capture of MRZ
10
10
  - Capture of faces
11
+ - Capture of QR code
12
+ - Capture of VIN
11
13
 
12
14
  ## Recommendations
13
15
 
@@ -16,7 +18,7 @@ The capture must be made in a well-lighted room. A document must be located at t
16
18
 
17
19
  ## Limitations
18
20
 
19
- This component works in phones with the operating system Android in the browser Chrome (minimum version 52) and in phones with the operating system iOS (minimum version 11) in the browser Safari
21
+ This component works in phones with the operating system Android in the browser Chrome (minimum version 93) and in phones with the operating system iOS (minimum version 14) in the browser Safari
20
22
 
21
23
  ## Installation
22
24
 
@@ -75,322 +77,19 @@ import IDVC from '@idscan/idvc2'
75
77
  import '@idscan/idvc2/dist/css/idvc.css'
76
78
 
77
79
  ```
78
- ## Initialization
79
80
 
80
- Create an instance of the object 'IDVC'. The object takes one object of the component configuration as a parameter.
81
+ ## Configuration
82
+ Configuration documentation you can find on our [site](https://docs.idscan.net/dvs/dvs-web-api/web-library-v2.html).
81
83
 
82
- Available fields:
83
-
84
- **el** (string) – id of an element on the page where the component will be integrated.
85
-
86
- **licenseKey** (string) – key for the library
87
-
88
- **autoContinue** (boolean) - this option switches on/off the automatic transition to the next step. Default: false
89
-
90
- **resizeUploadedImage** (integer) - sets the maximum size for manually loaded pictures. Default: -1
91
-
92
- **fixFrontOrientAfterUpload** (boolean) - this option provides the possibility to adjust the correct position of the document in case of manual uploading. Default: false
93
-
94
- **useCDN** (boolean) - set to true if you prefer to load neural networks from cdn instead of your domain. Default: false
95
-
96
- **useHeic** (boolean) - This option switches on/off the HEIC images processing (HEIC is Apple’s proprietary version of the Image File format). It’s possible to upload only via a Mac/MacBook.. Default: false
97
-
98
- **networkUrl** (string) - path to the folder with neural networks. Specify the path on the server if you need to remove the folder to another location. The default path is 'networks'. Default: 'networks'
99
-
100
- **language** (string) - The option sets the language used for the translation of the text in the library
101
-
102
- **realFaceMode** (string) - option that enable advanced capture with volumetric face detection. Available values: 'auto', 'none', 'all'. Auto - enable "realFaceMode" only for iphone. All - enable "realFaceMode" for all devices. None - disable this option. Default: 'auto'
103
-
104
- **documentTypes** (array) - The option that describes what steps needs for each document type you are needed.
105
-
106
- ***type*** (array) – array of types of acceptable documents. If you are going to use the component for the document validation, you can limit the list of acceptable documents.
107
-
108
- Available types (int):
109
-
110
- - **ID (1)** – USA driver license and USA ID (non-driver license), Canadian driver licenses,
111
- - **Passport (2)** – with 2 lines MRZ
112
- - **PassportCard (3)** – with 3 lines MRZ (most European IDs, USA passports/cards)
113
- - **GreenCard (6)** – USA Permanent Resident Cards (only MRZ),
114
- - **InternationalId (7)** – Internationally approved U.S. IDs with 3 lines MRZ
115
- - **VIN (8)** – Vehicle Identification Number
116
- - **Barcode (9)** – 1-d and 2-d barcodes
117
-
118
- ***steps*** (array) – array of steps which are necessary for you. Every step represents an object with the fields 'type', 'name' and unnecessary 'mode'. The field 'name' is the name of a step, which will be represented in the header.
119
- The field 'name' is a string type. Represents the step's name.
120
-
121
- The field 'mode' is an object that contains two fields: 'uploader' and 'video'. It turns on/off ability of image capturing via file upload and video capture.
122
- ```javascript
123
- mode: { uploader: true, video: true }
124
- ```
125
-
126
- The field 'type' is a type of a step. Possible variants are:
127
- - front – capture of a document
128
- - mrz – detection, capture and parsing of the mrz-code of a document
129
- - pdf – detection and capture of pdf417 of a document
130
- - face – detection and capture of a face using the front camera
131
- - barcode – detection, capture and parsing 1 dimensional (barcodes) or 2 dimensional (qr codes)
132
- - photo – capture of an image on click without analysis
133
-
134
- Steps can be combined in any order and in any combinations, except for the step 'auto'.
135
-
136
- E.g.:
137
- ```javascript
138
- documentTypes: [
139
- {
140
- type: "ID",
141
- steps:[
142
- { type: 'front', name: 'Document Front', mode: { uploader: true, video: true } },
143
- { type: 'pdf', name: 'Document PDF417 Barcode' , mode: { uploader: true, video: true } },
144
- { type: 'face', name: 'Face', mode: { uploader: false, video: true } }
145
- ]},
146
- {
147
- type: "Passport",
148
- steps:[
149
- { type: 'mrz', name: 'Passport Front' , mode: { uploader: true, video: true } },
150
- { type: 'face', name: 'Face', mode: { uploader: false, video: true } }
151
- ]},
152
- ]
153
- ```
154
-
155
- **onChange** - callback-function which will be called after change one step. The returnable value is the object with the type and the image
156
-
157
- **onCameraError** - The function that is invoked in case if the camera is not available. The response value is the object with the error code and the message
158
-
159
- **onReset** - callback-function which will be called after reset all the steps. The returnable value is the object with the steps
160
-
161
- **onRetakeHook** - the function that will be called before reset the current step. The returnable value is the object with the current step
162
-
163
- **onMounted** - the function that will be called on the component mounted. This function doesn't return a value.
164
-
165
- **changeLanguage** - the function that changes languages of the library.
166
-
167
- **submit** - callback-function which will be called after completing all the steps. The returnable value is the object with the following content:
168
- ```javascript
169
- {
170
- steps: [{
171
- img: "",
172
- type: "front",
173
- },
174
- …],
175
- documentType: 1,
176
- }
177
- ```
178
- where documentType – id of a document type ( ID – 1, Passport - 2, PassportCard – 3, GreenCard – 6, InternationalId – 7)
179
-
180
- steps – steps with the type and the image in the format 'base64'.
181
-
182
- Also, if you use automatic capture, in the "back" step **trackstring** will be returned (raw PDF417 data from Barcode encoded in base64)
183
-
184
- Config example:
185
-
186
- ```javascript
187
- new IDVC ({
188
- el: 'videoCapturingEl',
189
- licenseKey: '',
190
- networkUrl: 'networks',
191
- documentTypes: [
192
- {
193
- type: "ID",
194
- steps:[
195
- { type: 'front', name: 'Document Front', mode: { uploader: true, video: true } },
196
- { type: 'pdf', name: 'Document PDF417 Barcode', mode: { uploader: true, video: true } },
197
- { type: 'face', name: 'Face', mode: { uploader: false, video: true } }
198
- ]},
199
- {
200
- type: "Passport",
201
- steps:[
202
- { type: 'mrz', name: 'Passport Front' },
203
- { type: 'face', name: 'Face' }
204
- ]},
205
- ]
206
- })
207
- ```
208
84
 
209
85
  *Note: Request a license key for the library by emailing
210
86
  [sales@idscan.net](mailto:sales@idscan.net) or [support@idscan.net](mailto:support@idscan.net)*
211
87
 
212
- ## Style Customization
213
-
214
- To tweak the theme of the component you can redeclare variables in CSS custom properties. Don't forget to place the CSS file with redeclared variables below the component's CSS file. Redeclaration of CSS custom properties looks like this:
215
- ```CSS
216
- .idvc {
217
- --btn-border-radius-big: 40px;
218
- --color-background-white: #000000;
219
- }
220
- ```
221
-
222
- The component has the following customizable properties:
223
-
224
- **--font-family**
225
-
226
- *default: Arial, "Helvetica Neue", Helvetica, sans-serif*
227
-
228
- - library's font family
229
-
230
- **--btn-border-radius-big**
231
-
232
- *default: 4px*
233
-
234
- - radius of retake, continue, submit buttons
235
-
236
- **--btn-border-radius-small**
237
-
238
- *default: 4px*
239
-
240
- - radius of the manual switch button
241
- - radius of the messagebox
242
-
243
- **--color-text-secondary-light**
244
-
245
- *default: #C4C4C4*
246
-
247
- - 'select document type' menus's checkmark
248
-
249
- **--color-positive-light**
250
-
251
- *default: #17EA4C*
252
-
253
- - success frame on capturing
254
-
255
- **--border-color-divider**
256
-
257
- *default: #C0C0C0*
258
-
259
- - message box's default border color
260
- - 'select document type' menus's devider
261
-
262
- **--color-primary-light-2**
263
-
264
- *default: #DCE7FD*
265
-
266
- - primary button hover, focus colors
267
-
268
- **--color-primary-light-7**
269
-
270
- *default: #85AAF7*
271
-
272
- - transparent button hover and focus background color
273
-
274
- **--color-primary-light-9**
275
-
276
- *default: #6291F4*
277
-
278
- - transparent button border hover, focus colors
279
- - 'select document type' menus's selected item background
280
-
281
- **--color-primary-dark-2**
282
-
283
- *default: #080D18*
284
-
285
- - primary button active colors
286
- - transparent button active font color and border color
287
-
288
- **--color-background-subheader**
289
-
290
- *default: #F5F6F9*
291
-
292
- - background of the bottom part of the active step in 'steps' section
293
- - 'type not defined' select background of the modal window
294
- - scrollbar of 'result' modal window
295
-
296
- **--color-background-white**
297
-
298
- *default: #FFF*
299
-
300
- - uploader's background
301
- - background of 'result' modal window container
302
- - background of 'type not defined' modal window
303
- - background of 'document type-hint’ section
304
-
305
- **--border-color-base**
306
-
307
- *default: #DCDFE6*
308
-
309
- - border of 'type not defined' modal window select
310
- - border of 'document type-hint' section
311
- - borders of top part in 'steps' section
312
- - bottom icons of inactive step in 'steps' section
313
- - image background in 'steps' section
314
-
315
- **--color-primary**
316
-
317
- *default: #5185F3*
318
-
319
- - background of primary buttons
320
- - active step name, icon, and bottom line of the active step in 'steps' section
321
- - uploader labels, border
322
- - manual take picture button in video capturing
323
- - change the document type in 'document type-hint' section
324
- - step name on hover in 'steps' section
325
- - guideline inscription
326
- - background of the upload icon in the uploader
327
- - uploader's emphasized descriptions
328
- - disabled primary buttons
329
- - disabled button border
330
- - spinner's color
331
-
332
- **--color-success**
333
-
334
- *default: #13CE66*
335
-
336
- - succeeded steps in 'steps' section
337
- - face shape when capturing the video in face step
338
- - capture progress
339
- - valid sign of 'result' modal window container
340
- - hints on video capture
341
- - background of uploader's success sign
342
-
343
- **--color-danger**
344
-
345
- *default: #FF4949*
346
-
347
- - background and bottom border of the step error in 'steps' section
348
- - header of 'type not defined' modal window
349
- - invalid sign of 'result' modal window container
350
- - license error text
351
-
352
- **--color-warning**
353
-
354
- *default: #FFC632*
355
-
356
- - warning sign of uploader
357
-
358
- **--color-text-secondary**
359
-
360
- *default: #909399*
361
-
362
- - scrollbar of 'result' modal window
363
- - library version
364
- - descriptions of the uploader
365
- - close sign of 'result' modal window
366
- - name of the inactive step in 'steps' section
367
-
368
- **--color-black**
369
-
370
- *default: #000*
371
-
372
- - face shape icon in video capturing when the face is not detected at the face step
373
- - shadow of 'type not defined' modal window
374
- - caption of 'type not defined' modal window select
375
- - uploader's bold descriptions
376
- - shadow of 'result' modal window
377
- - bottom border of 'result' modal window row
378
- - options of change the document type in 'document type-hint' section
379
- - uploader's error sign stroke
380
- - uploader's error description
381
-
382
- **--color-white**
383
-
384
- *default: #FFF*
385
-
386
- - caption of buttons
387
- - border and caption of manual take picture button
388
- - upload icon
389
- - header description of 'type not defined' modal window
390
- - uploader success sign's checkmark
391
- - description of capture progress
392
-
393
88
  ## Version history
89
+ - **2.1.4**
90
+ - Added limitations check
91
+ - **2.1.4**
92
+ - fixed event listeners behavior on restart component
394
93
  - **2.1.3**
395
94
  - fixed reload component method
396
95
  - **2.1.2**
@@ -437,323 +136,3 @@ The component has the following customizable properties:
437
136
  - changed behavior: autoContinue.
438
137
  - feat: documentTypes. Now the "documentTypes" option is a union of steps and types.
439
138
  - feat: add translation.
440
-
441
- - **1.12.17**
442
- - added: onMounted hook
443
-
444
- - **1.12.16**
445
- - added: possibility to change a document type during the document processing
446
-
447
- - **1.12.15**
448
- - fixed: capture mask console output
449
- - improved back step filtering behaviour
450
-
451
- - **1.12.14**
452
- - fixed: capture mask resize
453
-
454
- - **1.12.13**
455
- - fixed: angular app resize and rotate image
456
-
457
- - **1.12.12**
458
- - fixed: desktop type select styles
459
- - fixed: fixFrontOrientAfterUpload
460
-
461
- - **1.12.11**
462
- - changed capture frame
463
- - changed success progress
464
- - performance improvement
465
- - changed hint behaviour
466
- - added message box
467
-
468
- - **1.12.10**
469
- - Some infrastructure improvements
470
-
471
- - **1.12.9**
472
- - Some infrastructure improvements
473
-
474
- - **1.12.8**
475
- - Added: type declaration
476
-
477
- - **1.12.7**
478
- - Fixed: not disappeared loader on reset all steps by manual upload
479
-
480
- - **1.12.6**
481
- - Added new modules available via CDN
482
-
483
- - **1.12.5**
484
- - improved iOs camera start
485
-
486
- - **1.12.3**
487
- - Fixed: automatic call of the submit callback if the submit button is disabled
488
-
489
- - **1.12.2**
490
- - Fixed: no video output on Safari 15
491
- - Fixed: global isShowManualSwitchButton
492
- - improved speed of library initialization
493
- - changed images
494
- - added: strictAllowedTypes config option
495
-
496
- - **1.12.1**
497
- - Fixed: neural networks path
498
-
499
- - **1.12.0**
500
- - Added: the ability to use CDN
501
- - BREAKING CHANGE: neural networks names are changed. Check out you don't forget to rebuild your app
502
- - Added: config validation
503
- - ALl colors are moved to CSS custom properties
504
- - All colors are standardized
505
-
506
- - **1.11.12**
507
- - Deprecated: enableMobileLimitation
508
- - Added: check if a browser supports work with media devices
509
-
510
- - **1.11.11**
511
- - Fixed: iPhone memory leak
512
- - Fixed: browser support
513
-
514
- - **1.11.10**
515
- - Fixed: Windows surface support
516
-
517
- - **1.11.9**
518
- - Fixed: On iOS devices was a black screen on the second step
519
-
520
- - **1.11.8**
521
- - Changed: On iOS devices version 12 and below, simplified face capture is now used
522
-
523
- - **1.11.7**
524
- - Changed: isShowManualSwitchButton can be setted in a step
525
-
526
- - **1.11.6**
527
- - Changed: new version of PDF reader
528
-
529
- - **1.11.5**
530
- - Added: onRetakeHook callback function
531
-
532
- - **1.11.4**
533
- - Changed: the tapOnVideo option is set to false as default value
534
-
535
- - **1.11.3**
536
- - Changed: isShowManualSwitchButton can accept an object instead of a boolean
537
-
538
- - **1.11.1**
539
- - Added: barcode step
540
- - Added: option display parsed data
541
-
542
- - **1.10.4**
543
- - Added: metadata field
544
- - Added: get user location
545
- - Added: send base64 encoded metadata
546
-
547
- - **1.10.3**
548
- - Fixed: reload component method
549
-
550
- - **1.10.2**
551
- - Fixed: 3D faces crashed on iPhone
552
-
553
- - **1.10.1**
554
- - Fixed: Models for 3D faces were loaded from tf hub and Google Storage. Now all models are stored inside the package
555
- Note: you’ll need to rebuild your app
556
-
557
- - **1.10.0**
558
- - Added: Option "parseMRZ" - if it is enabled, the captured MRZ lines are converted into the parsed document fields. Thus on-server parsing won’t be necessary. MRZ is captured automatically, after which the parsedData object is available
559
- - Added: Message "MRZ not recognized" during the "MRZ" step (or "Front" when the document requires presense of MRZ lines) the validity of MRZ is valid.
560
-
561
- Note: you’ll need to request a new license key since the new version will not work with the old one.
562
-
563
- - **1.9.18**
564
- - Added: New method showSpinner. Accepts the boolean value "true" or "false" as input.
565
-
566
- - **1.9.17**
567
- - Fixed: 3D face capture mode was enabled in document face capture mode
568
-
569
- - **1.9.16**
570
- - Fixed: "capturing" step doesn't work
571
-
572
- - **1.9.15**
573
- - Fixed: "resetAllSteps" method doesn't work
574
-
575
- - **1.9.14**
576
- - Set default value for minPdfFrames to 2
577
-
578
- - **1.9.13**
579
- - Fixed: fixFrontOrientAfterUpload doesn't work
580
-
581
- - **1.9.11**
582
- - Added: During the manual upload PDF417 will be scanned automatically.
583
- - Changed: The default value of ‘autoContinue’ is set to ‘true’.
584
- - Changed: The default value of ‘capturingMode’ is set to 4. NOTE! If you got an error related to the neural network downloading, then you’ll need to copy the ‘networks’ folder once again.
585
-
586
- - **1.9.10**
587
- - Added: Orientation change support
588
-
589
- - **1.9.9**
590
- - Added: The option enableFlash, which turns on the flash while capturing an image
591
- - Fixed: High load on CPU while stopping the mode of auto capturing
592
-
593
- - **1.9.8**
594
- - Added "source" field to each element of the steps array
595
- - Updated "captureMethod" field to contain a string value where each character is either a "0", "1" or a "2" (e.g. "102" or "111"). "0" indicates a step was completed by uploading a file, a "1" indicates a step was completed by the builtin autocapture functionality and a "2" indicates a user tapped the video area to capture an image manually
596
-
597
- - **1.9.7**
598
- - Fixed: Angles model is not loaded
599
-
600
- - **1.9.6**
601
- - Fixed: tfjs-converter is broken in version 1.7.4
602
-
603
- - **1.9.5**
604
- - Fixed: "fixFrontOrientAfterUpload" did not work if one step was specified
605
-
606
- - **1.9.4**
607
- - Fixed: Selecting a wide camera on Samsung devices
608
-
609
- - **1.9.3**
610
- - Added "captureMethod" field in the payload of the submit function
611
-
612
- - **1.9.2**
613
- - Fixed: face image not showing
614
-
615
- - **1.9.1**
616
- - Unless the browser supports the WebAssembly technology, the widget will show that the browser is not supported
617
-
618
- - **1.9.0**
619
- - The new option fixFrontOrientAfterUpload has been added. When you switch it on, the document will be rotated into correct position in case of manual uploading
620
-
621
- - **1.8.27**
622
- - Fixed: The widget broke down when using the camera during switching the page in SPA
623
-
624
- - **1.8.26**
625
- - Fixed: autocapturing does not work if method 4 is selected and one document type is selected
626
-
627
- - **1.8.25**
628
- - We have added the option "minPDFframes" which determines the minimal number of frames for capturing the PDF417. Default: 1
629
-
630
- - **1.8.24**
631
- - In each step we have added the field which means whether the auto capturing has been used or not
632
-
633
- - **1.8.23**
634
- - Fix blank image if capturinMethod is 'none'
635
-
636
- - **1.8.22**
637
- - Reduced minimum frames to capturing of PDF417 barcode from 4 to 1
638
-
639
- - **1.8.21**
640
- - Fix tapOnVideo in the new capturing mode
641
-
642
- - **1.8.20**
643
- - A new method of the autocapturing has been added. To enable it use option "capturingMode"
644
-
645
- - **1.8.14**
646
- - Fixed the style of the select of types
647
-
648
- - **1.8.13**
649
- - Changed text for the Driver's license label
650
-
651
- - **1.8.12**
652
- - Fix the rotation for Samsung browser
653
-
654
- - **1.8.11**
655
- - Disabled rotation after resizing
656
-
657
- - **1.8.10**
658
- - Fixed bundle for webpack 3
659
-
660
- - **1.8.9**
661
- - Fixed trim MRZ
662
-
663
- - **1.8.8**
664
- - Added callback "onCameraError" for exceptions from a camera
665
-
666
- - **1.8.7**
667
- - Added option "tapFace"
668
-
669
- - **1.8.6**
670
- - Added full support of HEIC format
671
-
672
- - **1.8.2**
673
- - Added support "Tap on video" on PC
674
-
675
- - **1.8.0**
676
- - Added option "autoContinue" (Default: false) - enables automatic transition to the next step
677
-
678
- - **1.7.21**
679
- - Fixed "Tap on video". Now all video area available for tap
680
-
681
- - **1.7.20**
682
- - Fix getCapabilities in Firefox
683
-
684
- - **1.7.19**
685
- - Now the file extension is checked by magic numbers
686
-
687
- - **1.7.18**
688
- - Changed text in the uploader
689
- - Changed text in the switch button
690
- - Changed timings (needed 25 frames, 100 ms between frames) in front capturing proccesing
691
-
692
- - **1.7.17**
693
- - Changed upload icon
694
-
695
- - **1.7.16**
696
- - Fixed: Widget stuck in spinner when cancel uploading image on Mac OS
697
-
698
- - **1.7.15**
699
- - Resize loss rate set to 1
700
-
701
- - **1.7.14**
702
- - Fixed image distortion in the preview of the steps
703
-
704
- - **1.7.13**
705
- - Updated mrz reader
706
-
707
- - **1.7.11**
708
- - Added heic support
709
-
710
- - **1.7.10**
711
- - Fix text when passport detected
712
-
713
- - **1.7.9**
714
- - Fix "showForceCapturingBtn" option
715
-
716
- - **1.7.8**
717
- - Added step - capturing
718
-
719
- - **1.7.7**
720
- - Added index to step
721
-
722
- - **1.7.6**
723
- - Fix real face for inverted camera
724
-
725
- - **1.7.5**
726
- - Added showing of error for unsupported types of images
727
-
728
- - **1.7.4**
729
- - Fix "reset all steps" when your document is passport
730
-
731
- - **1.7.3**
732
- - Fix error in pipeline of passport capturing
733
-
734
- - **1.7.2**
735
- - Added option tapBackSide (Default: false) - tap and hold the screen to capture the back side of the ID
736
-
737
- - **1.6.16**
738
- - Fixed for back step (hidden if it is not necessary)
739
-
740
- - **1.6.15**
741
- - Fonts are now included in the js file
742
-
743
- - **1.6.14**
744
- - Reduced the number of frames needed to capture PDF417 from 10 to 4
745
-
746
- - **1.6.10**
747
- - Changed text for barcode tips
748
-
749
- - **1.6.10**
750
- - Changed text for barcode tips
751
-
752
- - **1.6.8**
753
- - Added option: isShowVersion(boolean) - hide/show version of library in the bottom
754
-
755
- - **1.6.6**
756
- - Added pdf progress
757
-
758
- - **1.6.0**
759
- - Added option: **resizeUploadedImage** (integer) - sets the maximum size for manually loaded pictures