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

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 +68 -32
  2. package/package.json +9 -9
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-Bm7Xq4ys.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) => {
@@ -291584,7 +291584,7 @@ var Node$13 = class Node$14 {
291584
291584
  }
291585
291585
  });
291586
291586
  }
291587
- }, COMPOSITION_INPUT_TYPES, COMBINING_MARK_REGEX, graphemeSegmenter, DEAD_KEY_PLACEHOLDER_MARKS, getTextNodeAtPos = ({ doc: doc$12, pos }) => {
291587
+ }, COMPOSITION_INPUT_TYPES, COMBINING_MARK_REGEX, graphemeSegmenter, DEAD_KEY_PLACEHOLDER_MARKS, TRACKABLE_META_KEYS, PASSTHROUGH_META_KEYS, ALLOWED_META_KEYS, getTextNodeAtPos = ({ doc: doc$12, pos }) => {
291588
291588
  let found2 = null;
291589
291589
  doc$12.nodesBetween(Math.max(0, pos - 1), Math.min(doc$12.content.size, pos + 1), (node3, nodePos) => {
291590
291590
  if (found2 || !node3.isText || !node3.text)
@@ -291775,6 +291775,12 @@ var Node$13 = class Node$14 {
291775
291775
  ...existingMeta,
291776
291776
  ...extraMeta
291777
291777
  });
291778
+ }, copyPassthroughMeta = (sourceTr, targetTr) => {
291779
+ PASSTHROUGH_META_KEYS.forEach((key2) => {
291780
+ const value = sourceTr.getMeta(key2);
291781
+ if (value !== undefined)
291782
+ targetTr.setMeta(key2, value);
291783
+ });
291778
291784
  }, getPendingDeadKeyPlaceholder = ({ tr, newTr, user }) => {
291779
291785
  if (!isCompositionTransaction(tr) || tr.steps.length !== 1)
291780
291786
  return null;
@@ -291804,13 +291810,6 @@ var Node$13 = class Node$14 {
291804
291810
  authorEmail: user.email
291805
291811
  };
291806
291812
  }, trackedTransaction = ({ tr, state, user, replacements = "paired" }) => {
291807
- const onlyInputTypeMeta = [
291808
- "inputType",
291809
- "uiEvent",
291810
- "paste",
291811
- "pointer",
291812
- "composition"
291813
- ];
291814
291813
  const notAllowedMeta = [
291815
291814
  "historyUndo",
291816
291815
  "historyRedo",
@@ -291819,13 +291818,7 @@ var Node$13 = class Node$14 {
291819
291818
  const isProgrammaticInput = tr.getMeta("inputType") === "programmatic";
291820
291819
  const ySyncMeta = tr.getMeta(ySyncPluginKey);
291821
291820
  const pendingDeadKeyPlaceholder = TrackChangesBasePluginKey.getState(state)?.pendingDeadKeyPlaceholder ?? null;
291822
- const allowedMeta = new Set([
291823
- ...onlyInputTypeMeta,
291824
- ySyncPluginKey.key,
291825
- "forceTrackChanges",
291826
- "protectTrackedReviewState"
291827
- ]);
291828
- const hasDisallowedMeta = tr.meta && Object.keys(tr.meta).some((meta2) => !allowedMeta.has(meta2));
291821
+ const hasDisallowedMeta = tr.meta && Object.keys(tr.meta).some((meta2) => !ALLOWED_META_KEYS.has(meta2));
291829
291822
  if (ySyncMeta?.isChangeOrigin || !tr.steps.length || hasDisallowedMeta && !isProgrammaticInput || notAllowedMeta.includes(tr.getMeta("inputType")) || tr.getMeta(CommentsPluginKey)) {
291830
291823
  if (pendingDeadKeyPlaceholder && !isCompositionTransaction(tr))
291831
291824
  mergeTrackChangesMeta(tr, { pendingDeadKeyPlaceholder: null });
@@ -291900,14 +291893,7 @@ var Node$13 = class Node$14 {
291900
291893
  else
291901
291894
  newTr.step(step3);
291902
291895
  });
291903
- if (tr.getMeta("inputType"))
291904
- newTr.setMeta("inputType", tr.getMeta("inputType"));
291905
- if (tr.getMeta("uiEvent"))
291906
- newTr.setMeta("uiEvent", tr.getMeta("uiEvent"));
291907
- if (tr.getMeta("composition") !== undefined)
291908
- newTr.setMeta("composition", tr.getMeta("composition"));
291909
- if (tr.getMeta("addToHistory") !== undefined)
291910
- newTr.setMeta("addToHistory", tr.getMeta("addToHistory"));
291896
+ copyPassthroughMeta(tr, newTr);
291911
291897
  mergeTrackChangesMeta(newTr, { pendingDeadKeyPlaceholder: getPendingDeadKeyPlaceholder({
291912
291898
  tr,
291913
291899
  newTr,
@@ -318943,7 +318929,7 @@ menclose::after {
318943
318929
  return;
318944
318930
  console.log(...args$1);
318945
318931
  }, 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(() => {
318932
+ var init_src_Bm7Xq4ys_es = __esm(() => {
318947
318933
  init_rolldown_runtime_Bg48TavK_es();
318948
318934
  init_SuperConverter_C6hKp29w_es();
318949
318935
  init_jszip_C49i9kUs_es();
@@ -335934,6 +335920,26 @@ function print() { __p += __j.call(arguments, '') }
335934
335920
  ["~", "̃"],
335935
335921
  ["¨", "̈"]
335936
335922
  ]);
335923
+ TRACKABLE_META_KEYS = [
335924
+ "inputType",
335925
+ "uiEvent",
335926
+ "paste",
335927
+ "pointer",
335928
+ "composition",
335929
+ "superdocSlicePaste",
335930
+ "forceTrackChanges",
335931
+ "protectTrackedReviewState"
335932
+ ];
335933
+ PASSTHROUGH_META_KEYS = [
335934
+ "inputType",
335935
+ "uiEvent",
335936
+ "paste",
335937
+ "pointer",
335938
+ "composition",
335939
+ "addToHistory",
335940
+ "superdocSlicePaste"
335941
+ ];
335942
+ ALLOWED_META_KEYS = new Set([...TRACKABLE_META_KEYS, ySyncPluginKey.key]);
335937
335943
  TrackFormat = Mark3.create({
335938
335944
  name: TrackFormatMarkName,
335939
335945
  group: "track",
@@ -337212,8 +337218,13 @@ function print() { __p += __j.call(arguments, '') }
337212
337218
  if (dispatch)
337213
337219
  dispatch(tr);
337214
337220
  const presentationEditor = editor.presentationEditor;
337215
- if (!(presentationEditor?.scrollToPosition?.(from$1, { block: "center" }) ?? false)) {
337216
- Promise.resolve(presentationEditor?.scrollToPositionAsync?.(from$1, { block: "center" })).catch(() => {});
337221
+ const scrollOpts = {
337222
+ block: "center",
337223
+ ifNeeded: true,
337224
+ suppressSelectionSyncScroll: true
337225
+ };
337226
+ if (!(presentationEditor?.scrollToPosition?.(from$1, scrollOpts) ?? false)) {
337227
+ Promise.resolve(presentationEditor?.scrollToPositionAsync?.(from$1, scrollOpts)).catch(() => {});
337217
337228
  const { node: node3 } = editor.view.domAtPos(from$1);
337218
337229
  if (node3?.scrollIntoView)
337219
337230
  node3.scrollIntoView({
@@ -347073,6 +347084,7 @@ function print() { __p += __j.call(arguments, '') }
347073
347084
  #isRerendering = false;
347074
347085
  #selectionSync = new SelectionSyncCoordinator;
347075
347086
  #shouldScrollSelectionIntoView = false;
347087
+ #suppressSelectionScrollUntilRaf = false;
347076
347088
  #dragDropIndicatorPos = null;
347077
347089
  #epochMapper = new EpochPositionMapper;
347078
347090
  #layoutEpoch = 0;
@@ -348745,6 +348757,19 @@ function print() { __p += __j.call(arguments, '') }
348745
348757
  }
348746
348758
  return null;
348747
348759
  }
348760
+ #isElementFullyVisibleInScrollContainer(el) {
348761
+ const rect = el.getBoundingClientRect();
348762
+ const viewport$1 = this.#scrollContainer instanceof Window ? {
348763
+ top: 0,
348764
+ bottom: this.#scrollContainer.innerHeight
348765
+ } : this.#scrollContainer instanceof Element ? this.#scrollContainer.getBoundingClientRect() : this.#visibleHost?.ownerDocument?.defaultView ? {
348766
+ top: 0,
348767
+ bottom: this.#visibleHost.ownerDocument.defaultView.innerHeight
348768
+ } : null;
348769
+ if (!viewport$1)
348770
+ return false;
348771
+ return rect.top >= viewport$1.top && rect.bottom <= viewport$1.bottom;
348772
+ }
348748
348773
  scrollToPosition(pos, options = {}) {
348749
348774
  if (this.#focusScrollRafId != null) {
348750
348775
  const win = this.#visibleHost.ownerDocument?.defaultView;
@@ -348759,7 +348784,7 @@ function print() { __p += __j.call(arguments, '') }
348759
348784
  return false;
348760
348785
  const clampedPos = Math.max(0, Math.min(pos, doc$12.content.size));
348761
348786
  const behavior = options.behavior ?? "auto";
348762
- const block = options.block ?? "center";
348787
+ const requestedBlock = options.block ?? "center";
348763
348788
  const layout = this.#layoutState.layout;
348764
348789
  const sessionMode = this.#headerFooterSession?.session?.mode ?? "body";
348765
348790
  if (layout && sessionMode === "body") {
@@ -348779,7 +348804,9 @@ function print() { __p += __j.call(arguments, '') }
348779
348804
  if (pageIndex != null) {
348780
348805
  const pageEl = getPageElementByIndex(this.#viewportHost, pageIndex);
348781
348806
  if (pageEl) {
348782
- const elToScroll = this.#findElementAtPosition(pageEl, clampedPos) ?? pageEl;
348807
+ const targetEl = this.#findElementAtPosition(pageEl, clampedPos);
348808
+ const elToScroll = targetEl ?? pageEl;
348809
+ const block = options.ifNeeded && targetEl && this.#isElementFullyVisibleInScrollContainer(targetEl) ? "nearest" : requestedBlock;
348783
348810
  elToScroll.scrollIntoView({
348784
348811
  block,
348785
348812
  inline: "nearest",
@@ -348787,7 +348814,9 @@ function print() { __p += __j.call(arguments, '') }
348787
348814
  });
348788
348815
  this.#shouldScrollSelectionIntoView = false;
348789
348816
  const win = this.#visibleHost.ownerDocument?.defaultView;
348790
- if (win)
348817
+ if (win) {
348818
+ if (options.suppressSelectionSyncScroll)
348819
+ this.#suppressSelectionScrollUntilRaf = true;
348791
348820
  win.requestAnimationFrame(() => {
348792
348821
  elToScroll.scrollIntoView({
348793
348822
  block,
@@ -348795,7 +348824,9 @@ function print() { __p += __j.call(arguments, '') }
348795
348824
  behavior
348796
348825
  });
348797
348826
  this.#shouldScrollSelectionIntoView = false;
348827
+ this.#suppressSelectionScrollUntilRaf = false;
348798
348828
  });
348829
+ }
348799
348830
  return true;
348800
348831
  }
348801
348832
  }
@@ -348929,7 +348960,10 @@ function print() { __p += __j.call(arguments, '') }
348929
348960
  console.warn(`[PresentationEditor] scrollToPositionAsync: Page ${pageIndex} failed to mount within timeout`);
348930
348961
  return false;
348931
348962
  }
348932
- return this.scrollToPosition(pos, options);
348963
+ return this.scrollToPosition(pos, {
348964
+ ...options,
348965
+ ifNeeded: false
348966
+ });
348933
348967
  }
348934
348968
  async scrollContentControlIntoView(entityId, options = {}) {
348935
348969
  const pos = this.#resolveContentControlCaretPos(entityId);
@@ -351203,6 +351237,8 @@ function print() { __p += __j.call(arguments, '') }
351203
351237
  }
351204
351238
  }
351205
351239
  #scrollActiveEndIntoView(pageIndex) {
351240
+ if (this.#suppressSelectionScrollUntilRaf)
351241
+ return;
351206
351242
  if (!!!this.#painterHost.querySelector(`[data-page-index="${pageIndex}"]`)) {
351207
351243
  this.#scrollPageIntoView(pageIndex);
351208
351244
  return;
@@ -353375,7 +353411,7 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
353375
353411
 
353376
353412
  // ../../packages/superdoc/dist/super-editor.es.js
353377
353413
  var init_super_editor_es = __esm(() => {
353378
- init_src_DxXn8f3n_es();
353414
+ init_src_Bm7Xq4ys_es();
353379
353415
  init_SuperConverter_C6hKp29w_es();
353380
353416
  init_jszip_C49i9kUs_es();
353381
353417
  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.12",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -24,21 +24,21 @@
24
24
  "@types/node": "22.19.2",
25
25
  "@types/ws": "^8.5.13",
26
26
  "typescript": "^5.9.2",
27
- "@superdoc/document-api": "0.0.1",
27
+ "@superdoc/pm-adapter": "0.0.0",
28
28
  "@superdoc/super-editor": "0.0.1",
29
- "superdoc": "1.37.0",
30
- "@superdoc/pm-adapter": "0.0.0"
29
+ "@superdoc/document-api": "0.0.1",
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.12",
38
+ "@superdoc-dev/cli-darwin-x64": "0.15.0-next.12",
39
+ "@superdoc-dev/cli-linux-arm64": "0.15.0-next.12",
40
+ "@superdoc-dev/cli-windows-x64": "0.15.0-next.12",
41
+ "@superdoc-dev/cli-linux-x64": "0.15.0-next.12"
42
42
  },
43
43
  "scripts": {
44
44
  "predev": "node scripts/ensure-superdoc-build.js",