scandoc-ai-components 0.0.66 → 0.0.68

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 +13 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11249,11 +11249,19 @@ class ExtractorVideo {
11249
11249
  updateRectangleOverlay = async () => {
11250
11250
  const margins = await this.getCameraMargins();
11251
11251
  const rectangle = document.querySelector('.desktopRectangle');
11252
- if (!rectangle) return;
11253
- rectangle.style.top = `${margins.topPct * 100}%`;
11254
- rectangle.style.bottom = `${margins.bottomPct * 100}%`;
11255
- rectangle.style.left = `${margins.leftPct * 100}%`;
11256
- rectangle.style.right = `${margins.rightPct * 100}%`;
11252
+ const video = document.getElementById('ScanDocAIVideoElement');
11253
+ if (!rectangle || !video) return;
11254
+ const rect = video.getBoundingClientRect(); // the visible size
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
+ rectangle.style.left = `${leftPx}px`;
11262
+ rectangle.style.top = `${topPx}px`;
11263
+ rectangle.style.width = `${width - leftPx - rightPx}px`;
11264
+ rectangle.style.height = `${height - topPx - bottomPx}px`;
11257
11265
  };
11258
11266
  async analyzeVideoStream() {
11259
11267
  if (!this.isRunning) {
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.66",
4
+ "version": "0.0.68",
5
5
  "private": false,
6
6
  "description": "Pure JavaScript package for integrating ScanDoc-AI services.",
7
7
  "keywords": [