scandoc-ai-components 0.0.64 → 0.0.65
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/dist/index.js +18 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11248,14 +11248,22 @@ class ExtractorVideo {
|
|
|
11248
11248
|
}
|
|
11249
11249
|
updateRectangleOverlay = async () => {
|
|
11250
11250
|
const margins = await this.getCameraMargins();
|
|
11251
|
+
const video = document.getElementById('ScanDocAIVideoElement');
|
|
11251
11252
|
const rectangle = document.querySelector('.desktopRectangle');
|
|
11252
|
-
if (!rectangle) return;
|
|
11253
|
-
const
|
|
11254
|
-
const
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
|
|
11258
|
-
|
|
11253
|
+
if (!video || !rectangle) return;
|
|
11254
|
+
const rect = video.getBoundingClientRect(); // Only visible portion
|
|
11255
|
+
const width = rect.width;
|
|
11256
|
+
const height = rect.height;
|
|
11257
|
+
const leftPx = margins.leftPct * width;
|
|
11258
|
+
const rightPx = margins.rightPct * width;
|
|
11259
|
+
const topPx = margins.topPct * height;
|
|
11260
|
+
const bottomPx = margins.bottomPct * height;
|
|
11261
|
+
|
|
11262
|
+
// Position rectangle in actual pixels (not %)
|
|
11263
|
+
rectangle.style.left = `${rect.left + leftPx}px`;
|
|
11264
|
+
rectangle.style.top = `${rect.top + topPx}px`;
|
|
11265
|
+
rectangle.style.width = `${width - leftPx - rightPx}px`;
|
|
11266
|
+
rectangle.style.height = `${height - topPx - bottomPx}px`;
|
|
11259
11267
|
};
|
|
11260
11268
|
async analyzeVideoStream() {
|
|
11261
11269
|
if (!this.isRunning) {
|
|
@@ -11498,14 +11506,12 @@ class ExtractorVideo {
|
|
|
11498
11506
|
}
|
|
11499
11507
|
|
|
11500
11508
|
.desktopRectangle {
|
|
11501
|
-
position: absolute
|
|
11509
|
+
position: fixed; /* not absolute anymore */
|
|
11502
11510
|
border-radius: 30px;
|
|
11503
|
-
display: flex;
|
|
11504
|
-
justify-content: center;
|
|
11505
|
-
align-items: center;
|
|
11506
|
-
z-index: 3;
|
|
11507
11511
|
border: 5px dashed #5078bb;
|
|
11508
11512
|
transition: all 0.3s ease;
|
|
11513
|
+
pointer-events: none;
|
|
11514
|
+
z-index: 1000;
|
|
11509
11515
|
}
|
|
11510
11516
|
|
|
11511
11517
|
.backgroundOverlay {
|