scandoc-ai-components 0.0.77 → 0.0.79

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 (2) hide show
  1. package/dist/index.js +26 -21
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11174,13 +11174,12 @@ class ExtractorVideo {
11174
11174
  static VALIDATION_IMG_HEIGHT = 384;
11175
11175
  static VIDEO_SETTINGS = Object.freeze({
11176
11176
  width: {
11177
- ideal: 1024
11177
+ ideal: 1920
11178
11178
  },
11179
11179
  height: {
11180
- ideal: 768
11180
+ ideal: 1080
11181
11181
  },
11182
- // 4:3
11183
- facingMode: "user"
11182
+ facingMode: "environment"
11184
11183
  });
11185
11184
  constructor(onExtractedResults) {
11186
11185
  this.candidateImages = [];
@@ -11191,7 +11190,6 @@ class ExtractorVideo {
11191
11190
  this.scanStartTime = null;
11192
11191
  this.unsupportedDocCount = 0;
11193
11192
  this.video = null;
11194
- this.updateOverlayTimeout = null;
11195
11193
  }
11196
11194
  reset() {
11197
11195
  this.stopVideo();
@@ -11404,8 +11402,8 @@ class ExtractorVideo {
11404
11402
  }
11405
11403
  adjustOverlayPosition() {
11406
11404
  const video = this.video;
11407
- const overlay = document.querySelector(".desktopRectangle");
11408
- if (!video || !overlay || video.videoWidth === 0 || video.videoHeight === 0) return;
11405
+ const dot = document.querySelector(".centerGuideDot");
11406
+ if (!video || !dot || video.videoWidth === 0 || video.videoHeight === 0) return;
11409
11407
  const videoRatio = video.videoWidth / video.videoHeight;
11410
11408
  const container = video.parentElement;
11411
11409
  const containerRatio = container.clientWidth / container.clientHeight;
@@ -11419,14 +11417,11 @@ class ExtractorVideo {
11419
11417
  }
11420
11418
  const offsetX = (container.clientWidth - scaleWidth) / 2;
11421
11419
  const offsetY = (container.clientHeight - scaleHeight) / 2;
11422
- const paddingRatio = 0.05;
11423
- const minPadding = 16;
11424
- const padX = Math.max(scaleWidth * paddingRatio, minPadding);
11425
- const padY = Math.max(scaleHeight * paddingRatio, minPadding);
11426
- overlay.style.left = `${offsetX + padX}px`;
11427
- overlay.style.top = `${offsetY + padY}px`;
11428
- overlay.style.width = `${scaleWidth - padX * 2}px`;
11429
- overlay.style.height = `${scaleHeight - padY * 2}px`;
11420
+ const centerX = offsetX + scaleWidth / 2;
11421
+ const centerY = offsetY + scaleHeight / 2;
11422
+ dot.style.display = "block";
11423
+ dot.style.left = `${centerX - 8}px`; // center minus half dot size
11424
+ dot.style.top = `${centerY - 8}px`;
11430
11425
  }
11431
11426
  getHTML() {
11432
11427
  const cfgValues = (0,_config__WEBPACK_IMPORTED_MODULE_1__.getScanDocAIConfigValues)();
@@ -11438,7 +11433,7 @@ class ExtractorVideo {
11438
11433
  <div class="desktopVideoHolder">
11439
11434
  <video id="ScanDocAIVideoElement" class="desktopVideo" autoPlay muted playsInline></video>
11440
11435
  <div class="backgroundOverlay"></div>
11441
- <div class="desktopRectangle dashedRectangle"></div>
11436
+ <div class="centerGuideDot"></div>
11442
11437
  </div>
11443
11438
  </div>
11444
11439
 
@@ -11468,13 +11463,23 @@ class ExtractorVideo {
11468
11463
  height: 100%;
11469
11464
  object-fit: cover;
11470
11465
  }
11471
-
11472
- .desktopRectangle {
11466
+
11467
+ .centerGuideDot {
11473
11468
  position: absolute;
11474
- border: 5px dashed ${borderColor};
11475
- border-radius: 30px;
11469
+ width: 16px;
11470
+ height: 16px;
11471
+ background-color: #00ff55;
11472
+ border-radius: 50%;
11473
+ box-shadow: 0 0 8px 2px rgba(0, 255, 100, 0.8);
11474
+ z-index: 4;
11475
+ animation: flicker 1s infinite;
11476
11476
  pointer-events: none;
11477
- z-index: 3;
11477
+ display: none; /* Hidden until video is ready */
11478
+ }
11479
+
11480
+ @keyframes flicker {
11481
+ 0%, 100% { opacity: 1; }
11482
+ 50% { opacity: 0.3; }
11478
11483
  }
11479
11484
 
11480
11485
  .backgroundOverlay {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "scandoc-ai-components",
3
3
  "author": "ScanDoc-AI",
4
- "version": "0.0.77",
4
+ "version": "0.0.79",
5
5
  "private": false,
6
6
  "description": "Pure JavaScript package for integrating ScanDoc-AI services.",
7
7
  "keywords": [