@superdoc-dev/cli 0.15.0-next.10 → 0.15.0-next.11

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 +39 -9
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -221759,7 +221759,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
221759
221759
  init_remark_gfm_BhnWr3yf_es();
221760
221760
  });
221761
221761
 
221762
- // ../../packages/superdoc/dist/chunks/src-DxXn8f3n.es.js
221762
+ // ../../packages/superdoc/dist/chunks/src-BmITdkcx.es.js
221763
221763
  function deleteProps(obj, propOrProps) {
221764
221764
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
221765
221765
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -318943,7 +318943,7 @@ menclose::after {
318943
318943
  return;
318944
318944
  console.log(...args$1);
318945
318945
  }, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions, TRACKED_MARK_NAMES;
318946
- var init_src_DxXn8f3n_es = __esm(() => {
318946
+ var init_src_BmITdkcx_es = __esm(() => {
318947
318947
  init_rolldown_runtime_Bg48TavK_es();
318948
318948
  init_SuperConverter_C6hKp29w_es();
318949
318949
  init_jszip_C49i9kUs_es();
@@ -337212,8 +337212,13 @@ function print() { __p += __j.call(arguments, '') }
337212
337212
  if (dispatch)
337213
337213
  dispatch(tr);
337214
337214
  const presentationEditor = editor.presentationEditor;
337215
- if (!(presentationEditor?.scrollToPosition?.(from$1, { block: "center" }) ?? false)) {
337216
- Promise.resolve(presentationEditor?.scrollToPositionAsync?.(from$1, { block: "center" })).catch(() => {});
337215
+ const scrollOpts = {
337216
+ block: "center",
337217
+ ifNeeded: true,
337218
+ suppressSelectionSyncScroll: true
337219
+ };
337220
+ if (!(presentationEditor?.scrollToPosition?.(from$1, scrollOpts) ?? false)) {
337221
+ Promise.resolve(presentationEditor?.scrollToPositionAsync?.(from$1, scrollOpts)).catch(() => {});
337217
337222
  const { node: node3 } = editor.view.domAtPos(from$1);
337218
337223
  if (node3?.scrollIntoView)
337219
337224
  node3.scrollIntoView({
@@ -347073,6 +347078,7 @@ function print() { __p += __j.call(arguments, '') }
347073
347078
  #isRerendering = false;
347074
347079
  #selectionSync = new SelectionSyncCoordinator;
347075
347080
  #shouldScrollSelectionIntoView = false;
347081
+ #suppressSelectionScrollUntilRaf = false;
347076
347082
  #dragDropIndicatorPos = null;
347077
347083
  #epochMapper = new EpochPositionMapper;
347078
347084
  #layoutEpoch = 0;
@@ -348745,6 +348751,19 @@ function print() { __p += __j.call(arguments, '') }
348745
348751
  }
348746
348752
  return null;
348747
348753
  }
348754
+ #isElementFullyVisibleInScrollContainer(el) {
348755
+ const rect = el.getBoundingClientRect();
348756
+ const viewport$1 = this.#scrollContainer instanceof Window ? {
348757
+ top: 0,
348758
+ bottom: this.#scrollContainer.innerHeight
348759
+ } : this.#scrollContainer instanceof Element ? this.#scrollContainer.getBoundingClientRect() : this.#visibleHost?.ownerDocument?.defaultView ? {
348760
+ top: 0,
348761
+ bottom: this.#visibleHost.ownerDocument.defaultView.innerHeight
348762
+ } : null;
348763
+ if (!viewport$1)
348764
+ return false;
348765
+ return rect.top >= viewport$1.top && rect.bottom <= viewport$1.bottom;
348766
+ }
348748
348767
  scrollToPosition(pos, options = {}) {
348749
348768
  if (this.#focusScrollRafId != null) {
348750
348769
  const win = this.#visibleHost.ownerDocument?.defaultView;
@@ -348759,7 +348778,7 @@ function print() { __p += __j.call(arguments, '') }
348759
348778
  return false;
348760
348779
  const clampedPos = Math.max(0, Math.min(pos, doc$12.content.size));
348761
348780
  const behavior = options.behavior ?? "auto";
348762
- const block = options.block ?? "center";
348781
+ const requestedBlock = options.block ?? "center";
348763
348782
  const layout = this.#layoutState.layout;
348764
348783
  const sessionMode = this.#headerFooterSession?.session?.mode ?? "body";
348765
348784
  if (layout && sessionMode === "body") {
@@ -348779,7 +348798,9 @@ function print() { __p += __j.call(arguments, '') }
348779
348798
  if (pageIndex != null) {
348780
348799
  const pageEl = getPageElementByIndex(this.#viewportHost, pageIndex);
348781
348800
  if (pageEl) {
348782
- const elToScroll = this.#findElementAtPosition(pageEl, clampedPos) ?? pageEl;
348801
+ const targetEl = this.#findElementAtPosition(pageEl, clampedPos);
348802
+ const elToScroll = targetEl ?? pageEl;
348803
+ const block = options.ifNeeded && targetEl && this.#isElementFullyVisibleInScrollContainer(targetEl) ? "nearest" : requestedBlock;
348783
348804
  elToScroll.scrollIntoView({
348784
348805
  block,
348785
348806
  inline: "nearest",
@@ -348787,7 +348808,9 @@ function print() { __p += __j.call(arguments, '') }
348787
348808
  });
348788
348809
  this.#shouldScrollSelectionIntoView = false;
348789
348810
  const win = this.#visibleHost.ownerDocument?.defaultView;
348790
- if (win)
348811
+ if (win) {
348812
+ if (options.suppressSelectionSyncScroll)
348813
+ this.#suppressSelectionScrollUntilRaf = true;
348791
348814
  win.requestAnimationFrame(() => {
348792
348815
  elToScroll.scrollIntoView({
348793
348816
  block,
@@ -348795,7 +348818,9 @@ function print() { __p += __j.call(arguments, '') }
348795
348818
  behavior
348796
348819
  });
348797
348820
  this.#shouldScrollSelectionIntoView = false;
348821
+ this.#suppressSelectionScrollUntilRaf = false;
348798
348822
  });
348823
+ }
348799
348824
  return true;
348800
348825
  }
348801
348826
  }
@@ -348929,7 +348954,10 @@ function print() { __p += __j.call(arguments, '') }
348929
348954
  console.warn(`[PresentationEditor] scrollToPositionAsync: Page ${pageIndex} failed to mount within timeout`);
348930
348955
  return false;
348931
348956
  }
348932
- return this.scrollToPosition(pos, options);
348957
+ return this.scrollToPosition(pos, {
348958
+ ...options,
348959
+ ifNeeded: false
348960
+ });
348933
348961
  }
348934
348962
  async scrollContentControlIntoView(entityId, options = {}) {
348935
348963
  const pos = this.#resolveContentControlCaretPos(entityId);
@@ -351203,6 +351231,8 @@ function print() { __p += __j.call(arguments, '') }
351203
351231
  }
351204
351232
  }
351205
351233
  #scrollActiveEndIntoView(pageIndex) {
351234
+ if (this.#suppressSelectionScrollUntilRaf)
351235
+ return;
351206
351236
  if (!!!this.#painterHost.querySelector(`[data-page-index="${pageIndex}"]`)) {
351207
351237
  this.#scrollPageIntoView(pageIndex);
351208
351238
  return;
@@ -353375,7 +353405,7 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
353375
353405
 
353376
353406
  // ../../packages/superdoc/dist/super-editor.es.js
353377
353407
  var init_super_editor_es = __esm(() => {
353378
- init_src_DxXn8f3n_es();
353408
+ init_src_BmITdkcx_es();
353379
353409
  init_SuperConverter_C6hKp29w_es();
353380
353410
  init_jszip_C49i9kUs_es();
353381
353411
  init_xml_js_CqGKpaft_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.15.0-next.10",
3
+ "version": "0.15.0-next.11",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -25,20 +25,20 @@
25
25
  "@types/ws": "^8.5.13",
26
26
  "typescript": "^5.9.2",
27
27
  "@superdoc/document-api": "0.0.1",
28
+ "@superdoc/pm-adapter": "0.0.0",
28
29
  "@superdoc/super-editor": "0.0.1",
29
- "superdoc": "1.37.0",
30
- "@superdoc/pm-adapter": "0.0.0"
30
+ "superdoc": "1.37.0"
31
31
  },
32
32
  "module": "src/index.ts",
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
36
  "optionalDependencies": {
37
- "@superdoc-dev/cli-darwin-arm64": "0.15.0-next.10",
38
- "@superdoc-dev/cli-darwin-x64": "0.15.0-next.10",
39
- "@superdoc-dev/cli-windows-x64": "0.15.0-next.10",
40
- "@superdoc-dev/cli-linux-x64": "0.15.0-next.10",
41
- "@superdoc-dev/cli-linux-arm64": "0.15.0-next.10"
37
+ "@superdoc-dev/cli-darwin-arm64": "0.15.0-next.11",
38
+ "@superdoc-dev/cli-darwin-x64": "0.15.0-next.11",
39
+ "@superdoc-dev/cli-linux-x64": "0.15.0-next.11",
40
+ "@superdoc-dev/cli-linux-arm64": "0.15.0-next.11",
41
+ "@superdoc-dev/cli-windows-x64": "0.15.0-next.11"
42
42
  },
43
43
  "scripts": {
44
44
  "predev": "node scripts/ensure-superdoc-build.js",