superdoc 2.0.0-next.27 → 2.0.0-next.28

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 (32) hide show
  1. package/dist/chunks/{create-super-doc-ui-Dvl3EZsv.es.js → create-super-doc-ui-BlnUCtrx.es.js} +171 -51
  2. package/dist/chunks/{create-super-doc-ui-pYMthdDn.cjs → create-super-doc-ui-CZBUMdjl.cjs} +171 -51
  3. package/dist/collaboration-upgrade-engine.cjs +1 -1
  4. package/dist/collaboration-upgrade-engine.es.js +1 -1
  5. package/dist/document-api/src/contract/operation-definitions.d.ts +1 -1
  6. package/dist/document-api/src/track-changes/track-changes.d.ts +6 -2
  7. package/dist/document-api/src/types/clipboard.d.ts +5 -1
  8. package/dist/document-api/src/types/table-operations.types.d.ts +6 -4
  9. package/dist/document-api/src/types/track-changes.types.d.ts +15 -0
  10. package/dist/layout-engine/contracts/src/incremental-dependency.d.ts +10 -0
  11. package/dist/layout-engine/contracts/src/index.d.ts +38 -0
  12. package/dist/layout-engine/layout-bridge/src/incrementalLayout.d.ts +23 -1
  13. package/dist/layout-engine/layout-engine/src/index.d.ts +17 -0
  14. package/dist/layout-engine/layout-engine/src/paginator.d.ts +16 -0
  15. package/dist/layout-engine/layout-engine/src/paragraph-layout-eligibility.d.ts +1 -4
  16. package/dist/public/ui-react.cjs +1 -1
  17. package/dist/public/ui-react.es.js +1 -1
  18. package/dist/public/ui.cjs +1 -1
  19. package/dist/public/ui.es.js +1 -1
  20. package/dist/style.css +82 -63
  21. package/dist/style.layered.css +82 -63
  22. package/dist/superdoc/src/core/types/index.d.ts +7 -0
  23. package/dist/superdoc/src/public/ui/reasons.d.ts +8 -0
  24. package/dist/superdoc/src/stores/comments-store.d.ts +9 -9
  25. package/dist/superdoc/src/stores/helpers/floating-comment-instances.d.ts +2 -10
  26. package/dist/superdoc/src/stores/superdoc-store.d.ts +27 -27
  27. package/dist/superdoc.cjs +137 -29
  28. package/dist/superdoc.es.js +137 -29
  29. package/dist-cdn/style.layered.css +1 -1
  30. package/dist-cdn/superdoc.min.css +1 -1
  31. package/dist-cdn/superdoc.min.js +37 -37
  32. package/package.json +1 -1
package/dist/superdoc.cjs CHANGED
@@ -6,7 +6,7 @@ const require_uuid = require("./chunks/uuid-CFp0WGVU.cjs");
6
6
  const require_jszip = require("./chunks/jszip-BdUBlUeG.cjs");
7
7
  const require__plugin_vue_export_helper = require("./chunks/_plugin-vue_export-helper-BTwbGDKw.cjs");
8
8
  const require_constants = require("./chunks/constants-sbCZ2O_A.cjs");
9
- const require_create_super_doc_ui = require("./chunks/create-super-doc-ui-pYMthdDn.cjs");
9
+ const require_create_super_doc_ui = require("./chunks/create-super-doc-ui-CZBUMdjl.cjs");
10
10
  let vue = require("vue");
11
11
  vue = require_rolldown_runtime.__toESM(vue);
12
12
  require("y-websocket");
@@ -2520,7 +2520,7 @@ var aggregateRectBounds = (rects) => {
2520
2520
  };
2521
2521
  var groupRectsByPage = (rects) => {
2522
2522
  const groupedRects = /* @__PURE__ */ new Map();
2523
- rects.forEach((rect) => {
2523
+ (Array.isArray(rects) ? rects : []).forEach((rect) => {
2524
2524
  const pageIndex = toFinitePageIndex(rect?.pageIndex);
2525
2525
  if (pageIndex == null) return;
2526
2526
  const pageRects = groupedRects.get(pageIndex);
@@ -2547,31 +2547,40 @@ var resolveSelectionPageIndex = (comment) => {
2547
2547
  };
2548
2548
  var buildSingleFloatingCommentInstance = ({ id, threadId, comment, positionKey, positionEntry }) => {
2549
2549
  const geometryPageIndex = toFinitePageIndex(positionEntry?.pageIndex);
2550
- const pageIndex = geometryPageIndex != null ? geometryPageIndex : resolveSelectionPageIndex(comment);
2550
+ const fallbackPageIndex = comment?.trackedChange ? null : resolveSelectionPageIndex(comment);
2551
2551
  return {
2552
2552
  id,
2553
2553
  threadId,
2554
2554
  comment,
2555
2555
  positionKey,
2556
2556
  positionEntry: positionEntry ?? null,
2557
- pageIndex,
2557
+ pageIndex: geometryPageIndex ?? fallbackPageIndex,
2558
2558
  isPrimary: true
2559
2559
  };
2560
2560
  };
2561
- var buildRepeatedHeaderFooterInstances = ({ comment, positionKey, positionEntry }) => {
2561
+ var buildRepeatedHeaderFooterInstances = ({ comment, positionKey, positionEntry, primaryInstanceId }) => {
2562
2562
  const rectGroups = groupRectsByPage(positionEntry?.rects);
2563
2563
  if (rectGroups.length < 2) return [];
2564
- const primaryPageIndex = toFinitePageIndex(positionEntry?.pageIndex) ?? rectGroups[0]?.pageIndex ?? null;
2565
- return rectGroups.map(({ pageIndex, rects }) => {
2564
+ const renderableGroups = rectGroups.map(({ pageIndex, rects }) => {
2566
2565
  const bounds = aggregateRectBounds(rects);
2567
- if (!bounds) return null;
2566
+ return bounds ? {
2567
+ pageIndex,
2568
+ rects,
2569
+ bounds
2570
+ } : null;
2571
+ }).filter(Boolean);
2572
+ if (renderableGroups.length < 2) return [];
2573
+ const geometryPageIndex = toFinitePageIndex(positionEntry?.pageIndex);
2574
+ const primaryPageIndex = renderableGroups.some(({ pageIndex }) => pageIndex === geometryPageIndex) ? geometryPageIndex : renderableGroups[0]?.pageIndex ?? null;
2575
+ return renderableGroups.map(({ pageIndex, rects, bounds }) => {
2576
+ const isPrimary = pageIndex === primaryPageIndex;
2568
2577
  return {
2569
- id: buildPageScopedInstanceId(positionKey, pageIndex),
2578
+ id: isPrimary ? primaryInstanceId : buildPageScopedInstanceId(primaryInstanceId, pageIndex),
2570
2579
  threadId: comment?.commentId ?? positionKey,
2571
2580
  comment,
2572
2581
  positionKey,
2573
2582
  pageIndex,
2574
- isPrimary: pageIndex === primaryPageIndex,
2583
+ isPrimary,
2575
2584
  positionEntry: {
2576
2585
  ...positionEntry,
2577
2586
  pageIndex,
@@ -2579,7 +2588,7 @@ var buildRepeatedHeaderFooterInstances = ({ comment, positionKey, positionEntry
2579
2588
  bounds
2580
2589
  }
2581
2590
  };
2582
- }).filter(Boolean);
2591
+ });
2583
2592
  };
2584
2593
  const buildFloatingCommentInstances = ({ comment, positionKey, positionEntry, fallbackId }) => {
2585
2594
  const instanceId = comment?.trackedChange && comment?.trackedChangeCanonicalId && positionKey && fallbackId && String(positionKey) !== String(fallbackId) ? fallbackId : positionKey ?? fallbackId;
@@ -2588,7 +2597,8 @@ const buildFloatingCommentInstances = ({ comment, positionKey, positionEntry, fa
2588
2597
  const repeatedInstances = buildRepeatedHeaderFooterInstances({
2589
2598
  comment,
2590
2599
  positionKey,
2591
- positionEntry
2600
+ positionEntry,
2601
+ primaryInstanceId: instanceId
2592
2602
  });
2593
2603
  if (repeatedInstances.length > 0) return repeatedInstances;
2594
2604
  }
@@ -5812,6 +5822,7 @@ const useCommentsStore = defineStore("comments", () => {
5812
5822
  const getFloatingComments = (0, vue.computed)(() => {
5813
5823
  return getGroupedComments.value?.parentComments.filter((c) => !c.resolvedTime).filter((c) => {
5814
5824
  if (!isEditorBackedComment(c)) return true;
5825
+ if (isTrackedChangeThread(c)) return true;
5815
5826
  return Boolean(resolveCommentPositionEntry(c).entry);
5816
5827
  }).filter((c) => !isInlineTrackedChangeInsideTrackedTable(c));
5817
5828
  });
@@ -6971,12 +6982,18 @@ var _hoisted_44 = {
6971
6982
  class: "comment-separator"
6972
6983
  };
6973
6984
  var _hoisted_45 = {
6985
+ key: 2,
6986
+ class: "tracked-change-decision-alert",
6987
+ role: "alert"
6988
+ };
6989
+ var _hoisted_46 = { class: "tracked-change-decision-alert__message" };
6990
+ var _hoisted_47 = {
6974
6991
  key: 1,
6975
6992
  class: "reply-expanded"
6976
6993
  };
6977
- var _hoisted_46 = { class: "reply-input-wrapper" };
6978
- var _hoisted_47 = { class: "reply-actions" };
6979
- var _hoisted_48 = ["disabled", "data-disabled-reason"];
6994
+ var _hoisted_48 = { class: "reply-input-wrapper" };
6995
+ var _hoisted_49 = { class: "reply-actions" };
6996
+ var _hoisted_50 = ["disabled", "data-disabled-reason"];
6980
6997
  var CLICK_OUTSIDE_HIT_TOLERANCE_PX = 3;
6981
6998
  var TRACKED_CHANGE_PREVIEW_MAX_PX = 90;
6982
6999
  var _sfc_main$32 = {
@@ -7028,6 +7045,7 @@ var _sfc_main$32 = {
7028
7045
  const isInternal = (0, vue.ref)(true);
7029
7046
  const commentInput = (0, vue.ref)(null);
7030
7047
  const editCommentInputs = (0, vue.ref)(/* @__PURE__ */ new Map());
7048
+ const trackedChangeDecisionFailure = (0, vue.ref)(null);
7031
7049
  const CLICK_OUTSIDE_HIT_SAMPLE_OFFSETS = [
7032
7050
  [0, 0],
7033
7051
  [-CLICK_OUTSIDE_HIT_TOLERANCE_PX, 0],
@@ -7477,6 +7495,35 @@ var _sfc_main$32 = {
7477
7495
  if (!isV2WriteDisabled.value) return null;
7478
7496
  return v2WriteCapability.value?.reason ?? "v2-write-unavailable";
7479
7497
  });
7498
+ const reportTrackedChangeDecisionFailure = (decision, outcome) => {
7499
+ trackedChangeDecisionFailure.value = {
7500
+ decision,
7501
+ reason: outcome?.reason ?? null
7502
+ };
7503
+ (0, vue.nextTick)(() => emit("resize"));
7504
+ };
7505
+ const clearTrackedChangeDecisionFailure = () => {
7506
+ if (!trackedChangeDecisionFailure.value) return;
7507
+ trackedChangeDecisionFailure.value = null;
7508
+ (0, vue.nextTick)(() => emit("resize"));
7509
+ };
7510
+ const trackedChangeDecisionFailureMessage = (0, vue.computed)(() => {
7511
+ const failure = trackedChangeDecisionFailure.value;
7512
+ if (!failure) return null;
7513
+ const action = failure.decision === "reject" ? "reject" : "accept";
7514
+ if (failure.reason === "stale-catalog") return `Couldn't ${action} this change because the review list is stale.`;
7515
+ return `Couldn't ${action} this change.`;
7516
+ });
7517
+ const retryTrackedChangeDecision = () => {
7518
+ const failure = trackedChangeDecisionFailure.value;
7519
+ if (!failure) return;
7520
+ trackedChangeDecisionFailure.value = null;
7521
+ if (failure.decision === "reject") {
7522
+ handleReject();
7523
+ return;
7524
+ }
7525
+ handleResolve();
7526
+ };
7480
7527
  const handleReject = async () => {
7481
7528
  if (commentsAreReadOnly$1()) return readOnlyMutationOutcome$1();
7482
7529
  const customHandler = proxy.$superdoc.config.onTrackedChangeBubbleReject;
@@ -7487,7 +7534,11 @@ var _sfc_main$32 = {
7487
7534
  comment: props.comment,
7488
7535
  decision: "reject"
7489
7536
  });
7490
- if (!outcome?.ok || outcome.success === false) return;
7537
+ if (!outcome?.ok || outcome.success === false) {
7538
+ reportTrackedChangeDecisionFailure("reject", outcome);
7539
+ return;
7540
+ }
7541
+ clearTrackedChangeDecisionFailure();
7491
7542
  if (typeof customHandler === "function") customHandler(props.comment, proxy.$superdoc.activeEditor);
7492
7543
  (0, vue.nextTick)(() => {
7493
7544
  commentsStore.lastUpdate = /* @__PURE__ */ new Date();
@@ -7543,7 +7594,11 @@ var _sfc_main$32 = {
7543
7594
  comment: props.comment,
7544
7595
  decision: "accept"
7545
7596
  });
7546
- if (!outcome?.ok || outcome.success === false) return;
7597
+ if (!outcome?.ok || outcome.success === false) {
7598
+ reportTrackedChangeDecisionFailure("accept", outcome);
7599
+ return;
7600
+ }
7601
+ clearTrackedChangeDecisionFailure();
7547
7602
  if (typeof customHandler === "function") customHandler(props.comment, proxy.$superdoc.activeEditor);
7548
7603
  (0, vue.nextTick)(() => {
7549
7604
  commentsStore.lastUpdate = /* @__PURE__ */ new Date();
@@ -7895,11 +7950,16 @@ var _sfc_main$32 = {
7895
7950
  showSeparator.value(index) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_44)) : (0, vue.createCommentVNode)("", true)
7896
7951
  ]);
7897
7952
  }), 128)),
7898
- showInputSection.value && !(0, vue.unref)(getConfig).readOnly ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 2 }, [!isReplying.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
7953
+ trackedChangeDecisionFailure.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_45, [(0, vue.createElementVNode)("span", _hoisted_46, (0, vue.toDisplayString)(trackedChangeDecisionFailureMessage.value), 1), (0, vue.createElementVNode)("button", {
7954
+ type: "button",
7955
+ class: "sd-button tracked-change-decision-alert__retry",
7956
+ onClick: (0, vue.withModifiers)(retryTrackedChangeDecision, ["stop", "prevent"])
7957
+ }, " Retry ")])) : (0, vue.createCommentVNode)("", true),
7958
+ showInputSection.value && !(0, vue.unref)(getConfig).readOnly ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 3 }, [!isReplying.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
7899
7959
  key: 0,
7900
7960
  class: "reply-pill",
7901
7961
  onClick: (0, vue.withModifiers)(startReply, ["stop", "prevent"])
7902
- }, "Reply or add others with @")) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_45, [(0, vue.createElementVNode)("div", _hoisted_46, [(0, vue.createVNode)(CommentInput_default, {
7962
+ }, "Reply or add others with @")) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_47, [(0, vue.createElementVNode)("div", _hoisted_48, [(0, vue.createVNode)(CommentInput_default, {
7903
7963
  ref_key: "commentInput",
7904
7964
  ref: commentInput,
7905
7965
  users: usersFiltered.value,
@@ -7910,7 +7970,7 @@ var _sfc_main$32 = {
7910
7970
  "users",
7911
7971
  "config",
7912
7972
  "comment"
7913
- ])]), (0, vue.createElementVNode)("div", _hoisted_47, [(0, vue.createElementVNode)("button", {
7973
+ ])]), (0, vue.createElementVNode)("div", _hoisted_49, [(0, vue.createElementVNode)("button", {
7914
7974
  class: "sd-button reply-btn-cancel",
7915
7975
  onClick: (0, vue.withModifiers)(handleCancel, ["stop", "prevent"])
7916
7976
  }, "Cancel"), (0, vue.createElementVNode)("button", {
@@ -7918,12 +7978,12 @@ var _sfc_main$32 = {
7918
7978
  onClick: (0, vue.withModifiers)(handleAddComment, ["stop", "prevent"]),
7919
7979
  disabled: !hasTextContent.value || isV2WriteDisabled.value,
7920
7980
  "data-disabled-reason": isV2WriteDisabled.value ? v2WriteCapability.value?.reason ?? null : null
7921
- }, " Reply ", 10, _hoisted_48)])]))], 64)) : (0, vue.createCommentVNode)("", true)
7981
+ }, " Reply ", 10, _hoisted_50)])]))], 64)) : (0, vue.createCommentVNode)("", true)
7922
7982
  ], 64))], 14, _hoisted_1$25)), [[_directive_click_outside, handleClickOutside]]);
7923
7983
  };
7924
7984
  }
7925
7985
  };
7926
- var CommentDialog_default = /* @__PURE__ */ require__plugin_vue_export_helper.__plugin_vue_export_helper_default(_sfc_main$32, [["__scopeId", "data-v-67a03ee2"]]);
7986
+ var CommentDialog_default = /* @__PURE__ */ require__plugin_vue_export_helper.__plugin_vue_export_helper_default(_sfc_main$32, [["__scopeId", "data-v-35236c9c"]]);
7927
7987
  var _hoisted_1$24 = { class: "comments-list" };
7928
7988
  var _hoisted_2$19 = { key: 0 };
7929
7989
  var _hoisted_3$15 = [
@@ -8311,6 +8371,7 @@ var _sfc_main$30 = {
8311
8371
  setup(__props) {
8312
8372
  const ESTIMATED_HEIGHT = 110;
8313
8373
  const OBSERVER_MARGIN = 600;
8374
+ const FALLBACK_ANCHOR_STEP = .001;
8314
8375
  const resolveCollisions = (positions, activeIndex, gap) => {
8315
8376
  if (activeIndex >= 0) {
8316
8377
  positions[activeIndex].top = positions[activeIndex].anchorTop;
@@ -8442,18 +8503,31 @@ var _sfc_main$30 = {
8442
8503
  const hasPending = pendingComment.value && pendingComment.value.fileId === props.currentDocument.id;
8443
8504
  if (!instances.length && !hasPending) return [];
8444
8505
  const positions = [];
8506
+ let lastAnchoredTop = 0;
8507
+ let fallbackAnchorCount = 0;
8445
8508
  for (const instance of instances) {
8446
8509
  const key = instance?.id;
8447
8510
  const anchorTop = getAnchorTop(instance);
8448
8511
  const threadId = getThreadId(instance?.comment);
8449
- if (!key || !threadId || typeof anchorTop !== "number" || isNaN(anchorTop)) continue;
8450
- const top = normalizeFloatingAnchorTop(anchorTop, instance.comment);
8512
+ if (!key || !threadId) continue;
8513
+ const hasAnchorGeometry = typeof anchorTop === "number" && !isNaN(anchorTop);
8514
+ if (!hasAnchorGeometry && !isPersistentReviewSidebarItem(instance?.comment)) continue;
8515
+ let top;
8516
+ if (hasAnchorGeometry) {
8517
+ top = normalizeFloatingAnchorTop(anchorTop, instance.comment);
8518
+ lastAnchoredTop = top;
8519
+ fallbackAnchorCount = 0;
8520
+ } else {
8521
+ fallbackAnchorCount += 1;
8522
+ top = lastAnchoredTop + fallbackAnchorCount * FALLBACK_ANCHOR_STEP;
8523
+ }
8451
8524
  positions.push({
8452
8525
  id: key,
8453
8526
  threadId,
8454
8527
  pageIndex: instance?.pageIndex ?? null,
8455
8528
  anchorTop: top,
8456
- anchorBottom: getAnchorBottom(instance, top),
8529
+ anchorBottom: hasAnchorGeometry ? getAnchorBottom(instance, top) : top,
8530
+ hasAnchorGeometry,
8457
8531
  top,
8458
8532
  height: measuredHeights.value[key] || ESTIMATED_HEIGHT,
8459
8533
  commentRef: instance.comment,
@@ -8466,6 +8540,7 @@ var _sfc_main$30 = {
8466
8540
  id: "pending",
8467
8541
  anchorTop: pendingTop,
8468
8542
  anchorBottom: pendingTop,
8543
+ hasAnchorGeometry: true,
8469
8544
  top: pendingTop,
8470
8545
  height: measuredHeights.value["pending"] || ESTIMATED_HEIGHT,
8471
8546
  commentRef: pendingComment.value
@@ -8476,6 +8551,7 @@ var _sfc_main$30 = {
8476
8551
  resolveCollisions(positions, activeKey ? positions.findIndex((p) => p.id === activeKey) : -1, 15);
8477
8552
  const viewportRange = getFloatingViewportRange();
8478
8553
  if (viewportRange) for (const position of positions) {
8554
+ if (!position.hasAnchorGeometry) continue;
8479
8555
  const persistentReviewTop = resolvePersistentReviewCardTop({
8480
8556
  comment: position.commentRef,
8481
8557
  anchorTop: position.anchorTop,
@@ -8605,6 +8681,7 @@ var _sfc_main$30 = {
8605
8681
  let continuityAlignmentScheduled = false;
8606
8682
  let continuityAlignmentGeneration = 0;
8607
8683
  let continuityTransitionFrame = null;
8684
+ let activeLayoutContinuityFrame = null;
8608
8685
  const clearDeferredRemeasureTimers = () => {
8609
8686
  remeasureTimers.forEach(clearTimeout);
8610
8687
  remeasureTimers = [];
@@ -8776,14 +8853,27 @@ var _sfc_main$30 = {
8776
8853
  });
8777
8854
  let prevPositionIds = /* @__PURE__ */ new Set();
8778
8855
  let prevActiveAnchorTop = null;
8856
+ let prevActiveLayoutTop = null;
8779
8857
  (0, vue.watch)(allPositions, (positions) => {
8780
8858
  const activePosition = activeCommentInstanceId.value ? positions.find((position) => position.id === activeCommentInstanceId.value) : null;
8781
8859
  const activeAnchorTop = typeof activePosition?.anchorTop === "number" && Number.isFinite(activePosition.anchorTop) ? activePosition.anchorTop : null;
8782
- if (activeAnchorTop != null && prevActiveAnchorTop != null && Math.abs(activeAnchorTop - prevActiveAnchorTop) > 1 && sidebarOffsetY.value !== 0 && !Number.isFinite(instantSidebarAlignmentTargetY.value)) {
8860
+ const activeAnchorMoved = activeAnchorTop != null && prevActiveAnchorTop != null && Math.abs(activeAnchorTop - prevActiveAnchorTop) > 1;
8861
+ const activeLayoutTop = typeof activePosition?.top === "number" && Number.isFinite(activePosition.top) ? activePosition.top : null;
8862
+ const activeLayoutMoved = activeLayoutTop != null && prevActiveLayoutTop != null && Math.abs(activeLayoutTop - prevActiveLayoutTop) > 1;
8863
+ if (activeAnchorMoved && sidebarOffsetY.value !== 0 && !Number.isFinite(instantSidebarAlignmentTargetY.value)) {
8783
8864
  sidebarOffsetY.value = 0;
8784
8865
  setInstantLayoutTransitionsDisabled(false);
8866
+ } else if (activeLayoutMoved && sidebarOffsetY.value !== 0 && !Number.isFinite(instantSidebarAlignmentTargetY.value) && !sidebarContinuityAnchor) {
8867
+ setInstantLayoutTransitionsDisabled(true);
8868
+ sidebarOffsetY.value += prevActiveLayoutTop - activeLayoutTop;
8869
+ if (activeLayoutContinuityFrame != null) cancelAnimationFrame(activeLayoutContinuityFrame);
8870
+ activeLayoutContinuityFrame = requestAnimationFrame(() => {
8871
+ activeLayoutContinuityFrame = null;
8872
+ if (!sidebarContinuityAnchor && !Number.isFinite(instantSidebarAlignmentTargetY.value)) setInstantLayoutTransitionsDisabled(false);
8873
+ });
8785
8874
  }
8786
8875
  prevActiveAnchorTop = activeAnchorTop;
8876
+ prevActiveLayoutTop = activeLayoutTop;
8787
8877
  const positionOrder = positions.map((position) => position.id);
8788
8878
  const currentIds = new Set(positionOrder);
8789
8879
  if (sidebarContinuityAnchor && !currentIds.has(sidebarContinuityAnchor.key)) {
@@ -8848,6 +8938,10 @@ var _sfc_main$30 = {
8848
8938
  clearDeferredRemeasureTimers();
8849
8939
  if (scrollTimer) clearTimeout(scrollTimer);
8850
8940
  clearSidebarContinuityAnchor();
8941
+ if (activeLayoutContinuityFrame != null) {
8942
+ cancelAnimationFrame(activeLayoutContinuityFrame);
8943
+ activeLayoutContinuityFrame = null;
8944
+ }
8851
8945
  if (observer) {
8852
8946
  observer.disconnect();
8853
8947
  observer = null;
@@ -8909,7 +9003,7 @@ var _sfc_main$30 = {
8909
9003
  };
8910
9004
  }
8911
9005
  };
8912
- var FloatingComments_default = /* @__PURE__ */ require__plugin_vue_export_helper.__plugin_vue_export_helper_default(_sfc_main$30, [["__scopeId", "data-v-7bf85652"]]);
9006
+ var FloatingComments_default = /* @__PURE__ */ require__plugin_vue_export_helper.__plugin_vue_export_helper_default(_sfc_main$30, [["__scopeId", "data-v-3672b976"]]);
8913
9007
  var _hoisted_1$22 = {
8914
9008
  class: "superdoc__pdf-comments-layer pdf-comments-layer",
8915
9009
  "aria-hidden": "false"
@@ -9655,6 +9749,17 @@ const DRAWING_SUPPORT_TAXONOMY = {
9655
9749
  }
9656
9750
  };
9657
9751
  const DRAWING_FAMILIES = Object.keys(DRAWING_SUPPORT_TAXONOMY);
9752
+ const PAGE_CHECKPOINT_DEPENDENCY_CLASSES = Object.freeze([
9753
+ "multiple-sections",
9754
+ "furniture-page-tokens",
9755
+ "non-balanceable-multi-column-sections",
9756
+ "body-anchored-objects",
9757
+ "footnotes",
9758
+ "page-references",
9759
+ "keep-constraints",
9760
+ "tables",
9761
+ "furniture-anchored-objects"
9762
+ ]);
9658
9763
  var _hoisted_1$20 = { class: "superdoc-html-viewer" };
9659
9764
  var _hoisted_2$17 = { class: "superdoc-html-viewer__document" };
9660
9765
  var _hoisted_3$14 = ["innerHTML"];
@@ -11511,8 +11616,11 @@ function scrollToElement(targetElement, options = {
11511
11616
  const container = getScrollableParent(targetElement);
11512
11617
  const containerRect = container.getBoundingClientRect();
11513
11618
  const offsetTop = targetElement.getBoundingClientRect().top - containerRect.top + container.scrollTop;
11619
+ const scrollPaddingTopValue = window.getComputedStyle(container).scrollPaddingTop?.trim();
11620
+ const resolvedScrollPaddingTop = scrollPaddingTopValue?.endsWith("px") ? Number(scrollPaddingTopValue.slice(0, -2)) : 0;
11621
+ const scrollPaddingTop = Number.isFinite(resolvedScrollPaddingTop) && resolvedScrollPaddingTop >= 0 ? resolvedScrollPaddingTop : 0;
11514
11622
  container.scrollTo({
11515
- top: options.block === "start" ? offsetTop : offsetTop - container.clientHeight + targetElement.offsetHeight,
11623
+ top: options.block === "start" ? offsetTop - scrollPaddingTop : offsetTop - container.clientHeight + targetElement.offsetHeight,
11516
11624
  behavior: options.behavior
11517
11625
  });
11518
11626
  }
@@ -34539,7 +34647,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
34539
34647
  this.config.colors = shuffleArray(this.config.colors);
34540
34648
  this.userColorMap = /* @__PURE__ */ new Map();
34541
34649
  this.colorIndex = 0;
34542
- this.version = "2.0.0-next.27";
34650
+ this.version = "2.0.0-next.28";
34543
34651
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
34544
34652
  this.superdocId = config.superdocId || require_uuid.v4_default();
34545
34653
  this.colors = this.config.colors ?? [];