@koi-br/ocr-web-sdk 1.0.42 → 1.0.44

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.
@@ -1,4 +1,4 @@
1
- import { g as getAugmentedNamespace, a as getDefaultExportFromCjs } from "./index-CjNYfaz9.mjs";
1
+ import { g as getAugmentedNamespace, a as getDefaultExportFromCjs } from "./index-DwGxSvlf.mjs";
2
2
  function _mergeNamespaces(U, W) {
3
3
  for (var Z = 0; Z < W.length; Z++) {
4
4
  const s0 = W[Z];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koi-br/ocr-web-sdk",
3
- "version": "1.0.42",
3
+ "version": "1.0.44",
4
4
  "description": "一个支持多种Office文件格式预览的Vue3组件SDK,包括PDF、Word、Excel、图片、OFD、TIF等格式",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -2237,7 +2237,15 @@ const highlightPosition = (
2237
2237
  if (shouldScroll && containerRef.value) {
2238
2238
  const isVisible = isElementVisible(elementRef, containerRef.value);
2239
2239
  if (!isVisible) {
2240
+ // 标记这是定位滚动,不应该被同步滚动干扰
2241
+ containerRef.value.dataset.pageScrolling = 'true';
2240
2242
  elementRef.scrollIntoView({ behavior: "smooth", block: "center" });
2243
+ // 延迟清除标记,确保滚动完成
2244
+ setTimeout(() => {
2245
+ if (containerRef.value) {
2246
+ delete containerRef.value.dataset.pageScrolling;
2247
+ }
2248
+ }, 500); // scrollIntoView 的 smooth 动画通常需要 300-500ms
2241
2249
  }
2242
2250
  }
2243
2251
 
@@ -2273,7 +2281,12 @@ const jumpToPosition = (
2273
2281
  return;
2274
2282
  }
2275
2283
 
2276
- // 等待DOM更新后再高亮
2284
+ // 先跳转到对应页面(如果不在当前页)
2285
+ if (pageNum !== currentPage.value) {
2286
+ switchToPage(pageNum);
2287
+ }
2288
+
2289
+ // 等待页面跳转完成后再高亮
2277
2290
  nextTick(() => {
2278
2291
  let retryCount = 0;
2279
2292
  const maxRetries = 5;
@@ -2294,7 +2307,8 @@ const jumpToPosition = (
2294
2307
  }
2295
2308
  };
2296
2309
 
2297
- setTimeout(tryHighlight, 300);
2310
+ // 增加延迟,确保页面跳转完成(特别是同步滚动场景)
2311
+ setTimeout(tryHighlight, 500);
2298
2312
  });
2299
2313
  };
2300
2314