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.
- package/dist/chunks/{create-super-doc-ui-Dvl3EZsv.es.js → create-super-doc-ui-BlnUCtrx.es.js} +171 -51
- package/dist/chunks/{create-super-doc-ui-pYMthdDn.cjs → create-super-doc-ui-CZBUMdjl.cjs} +171 -51
- package/dist/collaboration-upgrade-engine.cjs +1 -1
- package/dist/collaboration-upgrade-engine.es.js +1 -1
- package/dist/document-api/src/contract/operation-definitions.d.ts +1 -1
- package/dist/document-api/src/track-changes/track-changes.d.ts +6 -2
- package/dist/document-api/src/types/clipboard.d.ts +5 -1
- package/dist/document-api/src/types/table-operations.types.d.ts +6 -4
- package/dist/document-api/src/types/track-changes.types.d.ts +15 -0
- package/dist/layout-engine/contracts/src/incremental-dependency.d.ts +10 -0
- package/dist/layout-engine/contracts/src/index.d.ts +38 -0
- package/dist/layout-engine/layout-bridge/src/incrementalLayout.d.ts +23 -1
- package/dist/layout-engine/layout-engine/src/index.d.ts +17 -0
- package/dist/layout-engine/layout-engine/src/paginator.d.ts +16 -0
- package/dist/layout-engine/layout-engine/src/paragraph-layout-eligibility.d.ts +1 -4
- package/dist/public/ui-react.cjs +1 -1
- package/dist/public/ui-react.es.js +1 -1
- package/dist/public/ui.cjs +1 -1
- package/dist/public/ui.es.js +1 -1
- package/dist/style.css +82 -63
- package/dist/style.layered.css +82 -63
- package/dist/superdoc/src/core/types/index.d.ts +7 -0
- package/dist/superdoc/src/public/ui/reasons.d.ts +8 -0
- package/dist/superdoc/src/stores/comments-store.d.ts +9 -9
- package/dist/superdoc/src/stores/helpers/floating-comment-instances.d.ts +2 -10
- package/dist/superdoc/src/stores/superdoc-store.d.ts +27 -27
- package/dist/superdoc.cjs +137 -29
- package/dist/superdoc.es.js +137 -29
- package/dist-cdn/style.layered.css +1 -1
- package/dist-cdn/superdoc.min.css +1 -1
- package/dist-cdn/superdoc.min.js +37 -37
- package/package.json +1 -1
package/dist/superdoc.es.js
CHANGED
|
@@ -5,7 +5,7 @@ import { t as v4_default } from "./chunks/uuid-B2Sqk-3p.es.js";
|
|
|
5
5
|
import { a as init_dist, i as global, n as init_dist$1, r as process$1, t as require_jszip_min } from "./chunks/jszip-DzmwAHr3.es.js";
|
|
6
6
|
import { t as __plugin_vue_export_helper_default } from "./chunks/_plugin-vue_export-helper-CInC0bKI.es.js";
|
|
7
7
|
import { n as PDF_TO_CSS_UNITS } from "./chunks/constants-CY3R3_kF.es.js";
|
|
8
|
-
import { a as createV2ReviewMutationReconciler, i as isV2EditableTextMutationEvent, o as getV2TrackedChangeMutationImpact, t as createSuperDocUI } from "./chunks/create-super-doc-ui-
|
|
8
|
+
import { a as createV2ReviewMutationReconciler, i as isV2EditableTextMutationEvent, o as getV2TrackedChangeMutationImpact, t as createSuperDocUI } from "./chunks/create-super-doc-ui-BlnUCtrx.es.js";
|
|
9
9
|
import * as Vue from "vue";
|
|
10
10
|
import { Fragment, Teleport, Transition, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, getCurrentInstance, h, inject, markRaw, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeUnmount, onDeactivated, onMounted, openBlock, reactive, ref, renderList, renderSlot, resolveDirective, resolveDynamicComponent, shallowRef, toDisplayString, toRaw, toRef, unref, useAttrs, vModelText, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
11
11
|
import "y-websocket";
|
|
@@ -2517,7 +2517,7 @@ var aggregateRectBounds = (rects) => {
|
|
|
2517
2517
|
};
|
|
2518
2518
|
var groupRectsByPage = (rects) => {
|
|
2519
2519
|
const groupedRects = /* @__PURE__ */ new Map();
|
|
2520
|
-
rects.forEach((rect) => {
|
|
2520
|
+
(Array.isArray(rects) ? rects : []).forEach((rect) => {
|
|
2521
2521
|
const pageIndex = toFinitePageIndex(rect?.pageIndex);
|
|
2522
2522
|
if (pageIndex == null) return;
|
|
2523
2523
|
const pageRects = groupedRects.get(pageIndex);
|
|
@@ -2544,31 +2544,40 @@ var resolveSelectionPageIndex = (comment) => {
|
|
|
2544
2544
|
};
|
|
2545
2545
|
var buildSingleFloatingCommentInstance = ({ id, threadId, comment, positionKey, positionEntry }) => {
|
|
2546
2546
|
const geometryPageIndex = toFinitePageIndex(positionEntry?.pageIndex);
|
|
2547
|
-
const
|
|
2547
|
+
const fallbackPageIndex = comment?.trackedChange ? null : resolveSelectionPageIndex(comment);
|
|
2548
2548
|
return {
|
|
2549
2549
|
id,
|
|
2550
2550
|
threadId,
|
|
2551
2551
|
comment,
|
|
2552
2552
|
positionKey,
|
|
2553
2553
|
positionEntry: positionEntry ?? null,
|
|
2554
|
-
pageIndex,
|
|
2554
|
+
pageIndex: geometryPageIndex ?? fallbackPageIndex,
|
|
2555
2555
|
isPrimary: true
|
|
2556
2556
|
};
|
|
2557
2557
|
};
|
|
2558
|
-
var buildRepeatedHeaderFooterInstances = ({ comment, positionKey, positionEntry }) => {
|
|
2558
|
+
var buildRepeatedHeaderFooterInstances = ({ comment, positionKey, positionEntry, primaryInstanceId }) => {
|
|
2559
2559
|
const rectGroups = groupRectsByPage(positionEntry?.rects);
|
|
2560
2560
|
if (rectGroups.length < 2) return [];
|
|
2561
|
-
const
|
|
2562
|
-
return rectGroups.map(({ pageIndex, rects }) => {
|
|
2561
|
+
const renderableGroups = rectGroups.map(({ pageIndex, rects }) => {
|
|
2563
2562
|
const bounds = aggregateRectBounds(rects);
|
|
2564
|
-
|
|
2563
|
+
return bounds ? {
|
|
2564
|
+
pageIndex,
|
|
2565
|
+
rects,
|
|
2566
|
+
bounds
|
|
2567
|
+
} : null;
|
|
2568
|
+
}).filter(Boolean);
|
|
2569
|
+
if (renderableGroups.length < 2) return [];
|
|
2570
|
+
const geometryPageIndex = toFinitePageIndex(positionEntry?.pageIndex);
|
|
2571
|
+
const primaryPageIndex = renderableGroups.some(({ pageIndex }) => pageIndex === geometryPageIndex) ? geometryPageIndex : renderableGroups[0]?.pageIndex ?? null;
|
|
2572
|
+
return renderableGroups.map(({ pageIndex, rects, bounds }) => {
|
|
2573
|
+
const isPrimary = pageIndex === primaryPageIndex;
|
|
2565
2574
|
return {
|
|
2566
|
-
id: buildPageScopedInstanceId(
|
|
2575
|
+
id: isPrimary ? primaryInstanceId : buildPageScopedInstanceId(primaryInstanceId, pageIndex),
|
|
2567
2576
|
threadId: comment?.commentId ?? positionKey,
|
|
2568
2577
|
comment,
|
|
2569
2578
|
positionKey,
|
|
2570
2579
|
pageIndex,
|
|
2571
|
-
isPrimary
|
|
2580
|
+
isPrimary,
|
|
2572
2581
|
positionEntry: {
|
|
2573
2582
|
...positionEntry,
|
|
2574
2583
|
pageIndex,
|
|
@@ -2576,7 +2585,7 @@ var buildRepeatedHeaderFooterInstances = ({ comment, positionKey, positionEntry
|
|
|
2576
2585
|
bounds
|
|
2577
2586
|
}
|
|
2578
2587
|
};
|
|
2579
|
-
})
|
|
2588
|
+
});
|
|
2580
2589
|
};
|
|
2581
2590
|
const buildFloatingCommentInstances = ({ comment, positionKey, positionEntry, fallbackId }) => {
|
|
2582
2591
|
const instanceId = comment?.trackedChange && comment?.trackedChangeCanonicalId && positionKey && fallbackId && String(positionKey) !== String(fallbackId) ? fallbackId : positionKey ?? fallbackId;
|
|
@@ -2585,7 +2594,8 @@ const buildFloatingCommentInstances = ({ comment, positionKey, positionEntry, fa
|
|
|
2585
2594
|
const repeatedInstances = buildRepeatedHeaderFooterInstances({
|
|
2586
2595
|
comment,
|
|
2587
2596
|
positionKey,
|
|
2588
|
-
positionEntry
|
|
2597
|
+
positionEntry,
|
|
2598
|
+
primaryInstanceId: instanceId
|
|
2589
2599
|
});
|
|
2590
2600
|
if (repeatedInstances.length > 0) return repeatedInstances;
|
|
2591
2601
|
}
|
|
@@ -5808,6 +5818,7 @@ const useCommentsStore = defineStore("comments", () => {
|
|
|
5808
5818
|
const getFloatingComments = computed(() => {
|
|
5809
5819
|
return getGroupedComments.value?.parentComments.filter((c) => !c.resolvedTime).filter((c) => {
|
|
5810
5820
|
if (!isEditorBackedComment(c)) return true;
|
|
5821
|
+
if (isTrackedChangeThread(c)) return true;
|
|
5811
5822
|
return Boolean(resolveCommentPositionEntry(c).entry);
|
|
5812
5823
|
}).filter((c) => !isInlineTrackedChangeInsideTrackedTable(c));
|
|
5813
5824
|
});
|
|
@@ -6962,12 +6973,18 @@ var _hoisted_44 = {
|
|
|
6962
6973
|
class: "comment-separator"
|
|
6963
6974
|
};
|
|
6964
6975
|
var _hoisted_45 = {
|
|
6976
|
+
key: 2,
|
|
6977
|
+
class: "tracked-change-decision-alert",
|
|
6978
|
+
role: "alert"
|
|
6979
|
+
};
|
|
6980
|
+
var _hoisted_46 = { class: "tracked-change-decision-alert__message" };
|
|
6981
|
+
var _hoisted_47 = {
|
|
6965
6982
|
key: 1,
|
|
6966
6983
|
class: "reply-expanded"
|
|
6967
6984
|
};
|
|
6968
|
-
var
|
|
6969
|
-
var
|
|
6970
|
-
var
|
|
6985
|
+
var _hoisted_48 = { class: "reply-input-wrapper" };
|
|
6986
|
+
var _hoisted_49 = { class: "reply-actions" };
|
|
6987
|
+
var _hoisted_50 = ["disabled", "data-disabled-reason"];
|
|
6971
6988
|
var CLICK_OUTSIDE_HIT_TOLERANCE_PX = 3;
|
|
6972
6989
|
var TRACKED_CHANGE_PREVIEW_MAX_PX = 90;
|
|
6973
6990
|
var CommentDialog_default = /* @__PURE__ */ __plugin_vue_export_helper_default({
|
|
@@ -7019,6 +7036,7 @@ var CommentDialog_default = /* @__PURE__ */ __plugin_vue_export_helper_default({
|
|
|
7019
7036
|
const isInternal = ref(true);
|
|
7020
7037
|
const commentInput = ref(null);
|
|
7021
7038
|
const editCommentInputs = ref(/* @__PURE__ */ new Map());
|
|
7039
|
+
const trackedChangeDecisionFailure = ref(null);
|
|
7022
7040
|
const CLICK_OUTSIDE_HIT_SAMPLE_OFFSETS = [
|
|
7023
7041
|
[0, 0],
|
|
7024
7042
|
[-CLICK_OUTSIDE_HIT_TOLERANCE_PX, 0],
|
|
@@ -7468,6 +7486,35 @@ var CommentDialog_default = /* @__PURE__ */ __plugin_vue_export_helper_default({
|
|
|
7468
7486
|
if (!isV2WriteDisabled.value) return null;
|
|
7469
7487
|
return v2WriteCapability.value?.reason ?? "v2-write-unavailable";
|
|
7470
7488
|
});
|
|
7489
|
+
const reportTrackedChangeDecisionFailure = (decision, outcome) => {
|
|
7490
|
+
trackedChangeDecisionFailure.value = {
|
|
7491
|
+
decision,
|
|
7492
|
+
reason: outcome?.reason ?? null
|
|
7493
|
+
};
|
|
7494
|
+
nextTick(() => emit("resize"));
|
|
7495
|
+
};
|
|
7496
|
+
const clearTrackedChangeDecisionFailure = () => {
|
|
7497
|
+
if (!trackedChangeDecisionFailure.value) return;
|
|
7498
|
+
trackedChangeDecisionFailure.value = null;
|
|
7499
|
+
nextTick(() => emit("resize"));
|
|
7500
|
+
};
|
|
7501
|
+
const trackedChangeDecisionFailureMessage = computed(() => {
|
|
7502
|
+
const failure = trackedChangeDecisionFailure.value;
|
|
7503
|
+
if (!failure) return null;
|
|
7504
|
+
const action = failure.decision === "reject" ? "reject" : "accept";
|
|
7505
|
+
if (failure.reason === "stale-catalog") return `Couldn't ${action} this change because the review list is stale.`;
|
|
7506
|
+
return `Couldn't ${action} this change.`;
|
|
7507
|
+
});
|
|
7508
|
+
const retryTrackedChangeDecision = () => {
|
|
7509
|
+
const failure = trackedChangeDecisionFailure.value;
|
|
7510
|
+
if (!failure) return;
|
|
7511
|
+
trackedChangeDecisionFailure.value = null;
|
|
7512
|
+
if (failure.decision === "reject") {
|
|
7513
|
+
handleReject();
|
|
7514
|
+
return;
|
|
7515
|
+
}
|
|
7516
|
+
handleResolve();
|
|
7517
|
+
};
|
|
7471
7518
|
const handleReject = async () => {
|
|
7472
7519
|
if (commentsAreReadOnly$1()) return readOnlyMutationOutcome$1();
|
|
7473
7520
|
const customHandler = proxy.$superdoc.config.onTrackedChangeBubbleReject;
|
|
@@ -7478,7 +7525,11 @@ var CommentDialog_default = /* @__PURE__ */ __plugin_vue_export_helper_default({
|
|
|
7478
7525
|
comment: props.comment,
|
|
7479
7526
|
decision: "reject"
|
|
7480
7527
|
});
|
|
7481
|
-
if (!outcome?.ok || outcome.success === false)
|
|
7528
|
+
if (!outcome?.ok || outcome.success === false) {
|
|
7529
|
+
reportTrackedChangeDecisionFailure("reject", outcome);
|
|
7530
|
+
return;
|
|
7531
|
+
}
|
|
7532
|
+
clearTrackedChangeDecisionFailure();
|
|
7482
7533
|
if (typeof customHandler === "function") customHandler(props.comment, proxy.$superdoc.activeEditor);
|
|
7483
7534
|
nextTick(() => {
|
|
7484
7535
|
commentsStore.lastUpdate = /* @__PURE__ */ new Date();
|
|
@@ -7534,7 +7585,11 @@ var CommentDialog_default = /* @__PURE__ */ __plugin_vue_export_helper_default({
|
|
|
7534
7585
|
comment: props.comment,
|
|
7535
7586
|
decision: "accept"
|
|
7536
7587
|
});
|
|
7537
|
-
if (!outcome?.ok || outcome.success === false)
|
|
7588
|
+
if (!outcome?.ok || outcome.success === false) {
|
|
7589
|
+
reportTrackedChangeDecisionFailure("accept", outcome);
|
|
7590
|
+
return;
|
|
7591
|
+
}
|
|
7592
|
+
clearTrackedChangeDecisionFailure();
|
|
7538
7593
|
if (typeof customHandler === "function") customHandler(props.comment, proxy.$superdoc.activeEditor);
|
|
7539
7594
|
nextTick(() => {
|
|
7540
7595
|
commentsStore.lastUpdate = /* @__PURE__ */ new Date();
|
|
@@ -7886,11 +7941,16 @@ var CommentDialog_default = /* @__PURE__ */ __plugin_vue_export_helper_default({
|
|
|
7886
7941
|
showSeparator.value(index) ? (openBlock(), createElementBlock("div", _hoisted_44)) : createCommentVNode("", true)
|
|
7887
7942
|
]);
|
|
7888
7943
|
}), 128)),
|
|
7889
|
-
|
|
7944
|
+
trackedChangeDecisionFailure.value ? (openBlock(), createElementBlock("div", _hoisted_45, [createElementVNode("span", _hoisted_46, toDisplayString(trackedChangeDecisionFailureMessage.value), 1), createElementVNode("button", {
|
|
7945
|
+
type: "button",
|
|
7946
|
+
class: "sd-button tracked-change-decision-alert__retry",
|
|
7947
|
+
onClick: withModifiers(retryTrackedChangeDecision, ["stop", "prevent"])
|
|
7948
|
+
}, " Retry ")])) : createCommentVNode("", true),
|
|
7949
|
+
showInputSection.value && !unref(getConfig).readOnly ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [!isReplying.value ? (openBlock(), createElementBlock("div", {
|
|
7890
7950
|
key: 0,
|
|
7891
7951
|
class: "reply-pill",
|
|
7892
7952
|
onClick: withModifiers(startReply, ["stop", "prevent"])
|
|
7893
|
-
}, "Reply or add others with @")) : (openBlock(), createElementBlock("div",
|
|
7953
|
+
}, "Reply or add others with @")) : (openBlock(), createElementBlock("div", _hoisted_47, [createElementVNode("div", _hoisted_48, [createVNode(CommentInput_default, {
|
|
7894
7954
|
ref_key: "commentInput",
|
|
7895
7955
|
ref: commentInput,
|
|
7896
7956
|
users: usersFiltered.value,
|
|
@@ -7901,7 +7961,7 @@ var CommentDialog_default = /* @__PURE__ */ __plugin_vue_export_helper_default({
|
|
|
7901
7961
|
"users",
|
|
7902
7962
|
"config",
|
|
7903
7963
|
"comment"
|
|
7904
|
-
])]), createElementVNode("div",
|
|
7964
|
+
])]), createElementVNode("div", _hoisted_49, [createElementVNode("button", {
|
|
7905
7965
|
class: "sd-button reply-btn-cancel",
|
|
7906
7966
|
onClick: withModifiers(handleCancel, ["stop", "prevent"])
|
|
7907
7967
|
}, "Cancel"), createElementVNode("button", {
|
|
@@ -7909,11 +7969,11 @@ var CommentDialog_default = /* @__PURE__ */ __plugin_vue_export_helper_default({
|
|
|
7909
7969
|
onClick: withModifiers(handleAddComment, ["stop", "prevent"]),
|
|
7910
7970
|
disabled: !hasTextContent.value || isV2WriteDisabled.value,
|
|
7911
7971
|
"data-disabled-reason": isV2WriteDisabled.value ? v2WriteCapability.value?.reason ?? null : null
|
|
7912
|
-
}, " Reply ", 10,
|
|
7972
|
+
}, " Reply ", 10, _hoisted_50)])]))], 64)) : createCommentVNode("", true)
|
|
7913
7973
|
], 64))], 14, _hoisted_1$25)), [[_directive_click_outside, handleClickOutside]]);
|
|
7914
7974
|
};
|
|
7915
7975
|
}
|
|
7916
|
-
}, [["__scopeId", "data-v-
|
|
7976
|
+
}, [["__scopeId", "data-v-35236c9c"]]);
|
|
7917
7977
|
var _hoisted_1$24 = { class: "comments-list" };
|
|
7918
7978
|
var _hoisted_2$19 = { key: 0 };
|
|
7919
7979
|
var _hoisted_3$15 = [
|
|
@@ -8300,6 +8360,7 @@ var FloatingComments_default = /* @__PURE__ */ __plugin_vue_export_helper_defaul
|
|
|
8300
8360
|
setup(__props) {
|
|
8301
8361
|
const ESTIMATED_HEIGHT = 110;
|
|
8302
8362
|
const OBSERVER_MARGIN = 600;
|
|
8363
|
+
const FALLBACK_ANCHOR_STEP = .001;
|
|
8303
8364
|
const resolveCollisions = (positions, activeIndex, gap) => {
|
|
8304
8365
|
if (activeIndex >= 0) {
|
|
8305
8366
|
positions[activeIndex].top = positions[activeIndex].anchorTop;
|
|
@@ -8431,18 +8492,31 @@ var FloatingComments_default = /* @__PURE__ */ __plugin_vue_export_helper_defaul
|
|
|
8431
8492
|
const hasPending = pendingComment.value && pendingComment.value.fileId === props.currentDocument.id;
|
|
8432
8493
|
if (!instances.length && !hasPending) return [];
|
|
8433
8494
|
const positions = [];
|
|
8495
|
+
let lastAnchoredTop = 0;
|
|
8496
|
+
let fallbackAnchorCount = 0;
|
|
8434
8497
|
for (const instance of instances) {
|
|
8435
8498
|
const key = instance?.id;
|
|
8436
8499
|
const anchorTop = getAnchorTop(instance);
|
|
8437
8500
|
const threadId = getThreadId(instance?.comment);
|
|
8438
|
-
if (!key || !threadId
|
|
8439
|
-
const
|
|
8501
|
+
if (!key || !threadId) continue;
|
|
8502
|
+
const hasAnchorGeometry = typeof anchorTop === "number" && !isNaN(anchorTop);
|
|
8503
|
+
if (!hasAnchorGeometry && !isPersistentReviewSidebarItem(instance?.comment)) continue;
|
|
8504
|
+
let top;
|
|
8505
|
+
if (hasAnchorGeometry) {
|
|
8506
|
+
top = normalizeFloatingAnchorTop(anchorTop, instance.comment);
|
|
8507
|
+
lastAnchoredTop = top;
|
|
8508
|
+
fallbackAnchorCount = 0;
|
|
8509
|
+
} else {
|
|
8510
|
+
fallbackAnchorCount += 1;
|
|
8511
|
+
top = lastAnchoredTop + fallbackAnchorCount * FALLBACK_ANCHOR_STEP;
|
|
8512
|
+
}
|
|
8440
8513
|
positions.push({
|
|
8441
8514
|
id: key,
|
|
8442
8515
|
threadId,
|
|
8443
8516
|
pageIndex: instance?.pageIndex ?? null,
|
|
8444
8517
|
anchorTop: top,
|
|
8445
|
-
anchorBottom: getAnchorBottom(instance, top),
|
|
8518
|
+
anchorBottom: hasAnchorGeometry ? getAnchorBottom(instance, top) : top,
|
|
8519
|
+
hasAnchorGeometry,
|
|
8446
8520
|
top,
|
|
8447
8521
|
height: measuredHeights.value[key] || ESTIMATED_HEIGHT,
|
|
8448
8522
|
commentRef: instance.comment,
|
|
@@ -8455,6 +8529,7 @@ var FloatingComments_default = /* @__PURE__ */ __plugin_vue_export_helper_defaul
|
|
|
8455
8529
|
id: "pending",
|
|
8456
8530
|
anchorTop: pendingTop,
|
|
8457
8531
|
anchorBottom: pendingTop,
|
|
8532
|
+
hasAnchorGeometry: true,
|
|
8458
8533
|
top: pendingTop,
|
|
8459
8534
|
height: measuredHeights.value["pending"] || ESTIMATED_HEIGHT,
|
|
8460
8535
|
commentRef: pendingComment.value
|
|
@@ -8465,6 +8540,7 @@ var FloatingComments_default = /* @__PURE__ */ __plugin_vue_export_helper_defaul
|
|
|
8465
8540
|
resolveCollisions(positions, activeKey ? positions.findIndex((p) => p.id === activeKey) : -1, 15);
|
|
8466
8541
|
const viewportRange = getFloatingViewportRange();
|
|
8467
8542
|
if (viewportRange) for (const position of positions) {
|
|
8543
|
+
if (!position.hasAnchorGeometry) continue;
|
|
8468
8544
|
const persistentReviewTop = resolvePersistentReviewCardTop({
|
|
8469
8545
|
comment: position.commentRef,
|
|
8470
8546
|
anchorTop: position.anchorTop,
|
|
@@ -8594,6 +8670,7 @@ var FloatingComments_default = /* @__PURE__ */ __plugin_vue_export_helper_defaul
|
|
|
8594
8670
|
let continuityAlignmentScheduled = false;
|
|
8595
8671
|
let continuityAlignmentGeneration = 0;
|
|
8596
8672
|
let continuityTransitionFrame = null;
|
|
8673
|
+
let activeLayoutContinuityFrame = null;
|
|
8597
8674
|
const clearDeferredRemeasureTimers = () => {
|
|
8598
8675
|
remeasureTimers.forEach(clearTimeout);
|
|
8599
8676
|
remeasureTimers = [];
|
|
@@ -8765,14 +8842,27 @@ var FloatingComments_default = /* @__PURE__ */ __plugin_vue_export_helper_defaul
|
|
|
8765
8842
|
});
|
|
8766
8843
|
let prevPositionIds = /* @__PURE__ */ new Set();
|
|
8767
8844
|
let prevActiveAnchorTop = null;
|
|
8845
|
+
let prevActiveLayoutTop = null;
|
|
8768
8846
|
watch(allPositions, (positions) => {
|
|
8769
8847
|
const activePosition = activeCommentInstanceId.value ? positions.find((position) => position.id === activeCommentInstanceId.value) : null;
|
|
8770
8848
|
const activeAnchorTop = typeof activePosition?.anchorTop === "number" && Number.isFinite(activePosition.anchorTop) ? activePosition.anchorTop : null;
|
|
8771
|
-
|
|
8849
|
+
const activeAnchorMoved = activeAnchorTop != null && prevActiveAnchorTop != null && Math.abs(activeAnchorTop - prevActiveAnchorTop) > 1;
|
|
8850
|
+
const activeLayoutTop = typeof activePosition?.top === "number" && Number.isFinite(activePosition.top) ? activePosition.top : null;
|
|
8851
|
+
const activeLayoutMoved = activeLayoutTop != null && prevActiveLayoutTop != null && Math.abs(activeLayoutTop - prevActiveLayoutTop) > 1;
|
|
8852
|
+
if (activeAnchorMoved && sidebarOffsetY.value !== 0 && !Number.isFinite(instantSidebarAlignmentTargetY.value)) {
|
|
8772
8853
|
sidebarOffsetY.value = 0;
|
|
8773
8854
|
setInstantLayoutTransitionsDisabled(false);
|
|
8855
|
+
} else if (activeLayoutMoved && sidebarOffsetY.value !== 0 && !Number.isFinite(instantSidebarAlignmentTargetY.value) && !sidebarContinuityAnchor) {
|
|
8856
|
+
setInstantLayoutTransitionsDisabled(true);
|
|
8857
|
+
sidebarOffsetY.value += prevActiveLayoutTop - activeLayoutTop;
|
|
8858
|
+
if (activeLayoutContinuityFrame != null) cancelAnimationFrame(activeLayoutContinuityFrame);
|
|
8859
|
+
activeLayoutContinuityFrame = requestAnimationFrame(() => {
|
|
8860
|
+
activeLayoutContinuityFrame = null;
|
|
8861
|
+
if (!sidebarContinuityAnchor && !Number.isFinite(instantSidebarAlignmentTargetY.value)) setInstantLayoutTransitionsDisabled(false);
|
|
8862
|
+
});
|
|
8774
8863
|
}
|
|
8775
8864
|
prevActiveAnchorTop = activeAnchorTop;
|
|
8865
|
+
prevActiveLayoutTop = activeLayoutTop;
|
|
8776
8866
|
const positionOrder = positions.map((position) => position.id);
|
|
8777
8867
|
const currentIds = new Set(positionOrder);
|
|
8778
8868
|
if (sidebarContinuityAnchor && !currentIds.has(sidebarContinuityAnchor.key)) {
|
|
@@ -8837,6 +8927,10 @@ var FloatingComments_default = /* @__PURE__ */ __plugin_vue_export_helper_defaul
|
|
|
8837
8927
|
clearDeferredRemeasureTimers();
|
|
8838
8928
|
if (scrollTimer) clearTimeout(scrollTimer);
|
|
8839
8929
|
clearSidebarContinuityAnchor();
|
|
8930
|
+
if (activeLayoutContinuityFrame != null) {
|
|
8931
|
+
cancelAnimationFrame(activeLayoutContinuityFrame);
|
|
8932
|
+
activeLayoutContinuityFrame = null;
|
|
8933
|
+
}
|
|
8840
8934
|
if (observer) {
|
|
8841
8935
|
observer.disconnect();
|
|
8842
8936
|
observer = null;
|
|
@@ -8897,7 +8991,7 @@ var FloatingComments_default = /* @__PURE__ */ __plugin_vue_export_helper_defaul
|
|
|
8897
8991
|
}), 128))], 4)], 4);
|
|
8898
8992
|
};
|
|
8899
8993
|
}
|
|
8900
|
-
}, [["__scopeId", "data-v-
|
|
8994
|
+
}, [["__scopeId", "data-v-3672b976"]]);
|
|
8901
8995
|
var _hoisted_1$22 = {
|
|
8902
8996
|
class: "superdoc__pdf-comments-layer pdf-comments-layer",
|
|
8903
8997
|
"aria-hidden": "false"
|
|
@@ -9421,6 +9515,17 @@ const DRAWING_DIAGNOSTIC_CODES = {
|
|
|
9421
9515
|
};
|
|
9422
9516
|
DRAWING_DIAGNOSTIC_CODES.missingRelationship, DRAWING_DIAGNOSTIC_CODES.unsupportedRelationshipType, DRAWING_DIAGNOSTIC_CODES.unsupportedRelationshipType, DRAWING_DIAGNOSTIC_CODES.imageTooLarge, DRAWING_DIAGNOSTIC_CODES.missingMediaPart, DRAWING_DIAGNOSTIC_CODES.unsupportedObject, DRAWING_DIAGNOSTIC_CODES.vmlUnsupported;
|
|
9423
9517
|
DRAWING_DIAGNOSTIC_CODES.externalImageDeferred, DRAWING_DIAGNOSTIC_CODES.missingRelationship, DRAWING_DIAGNOSTIC_CODES.missingMediaPart, DRAWING_DIAGNOSTIC_CODES.unsupportedRelationshipType, DRAWING_DIAGNOSTIC_CODES.unsupportedMime, DRAWING_DIAGNOSTIC_CODES.imageTooLarge, DRAWING_DIAGNOSTIC_CODES.unsafeSvg, DRAWING_DIAGNOSTIC_CODES.unsupportedFormat, DRAWING_DIAGNOSTIC_CODES.embeddedObjectNotSupported, DRAWING_DIAGNOSTIC_CODES.unsupportedObject, DRAWING_DIAGNOSTIC_CODES.vmlUnsupported, DRAWING_DIAGNOSTIC_CODES.vmlImageUnsupported, DRAWING_DIAGNOSTIC_CODES.unsupportedGeometryCommand, DRAWING_DIAGNOSTIC_CODES.anchorUnsupported, DRAWING_DIAGNOSTIC_CODES.wrapUnsupported, DRAWING_DIAGNOSTIC_CODES.altContentNoSupportedChoice, DRAWING_DIAGNOSTIC_CODES.groupChildUnsupported;
|
|
9518
|
+
Object.freeze([
|
|
9519
|
+
"multiple-sections",
|
|
9520
|
+
"furniture-page-tokens",
|
|
9521
|
+
"non-balanceable-multi-column-sections",
|
|
9522
|
+
"body-anchored-objects",
|
|
9523
|
+
"footnotes",
|
|
9524
|
+
"page-references",
|
|
9525
|
+
"keep-constraints",
|
|
9526
|
+
"tables",
|
|
9527
|
+
"furniture-anchored-objects"
|
|
9528
|
+
]);
|
|
9424
9529
|
var _hoisted_1$20 = { class: "superdoc-html-viewer" };
|
|
9425
9530
|
var _hoisted_2$17 = { class: "superdoc-html-viewer__document" };
|
|
9426
9531
|
var _hoisted_3$14 = ["innerHTML"];
|
|
@@ -11257,8 +11362,11 @@ function scrollToElement(targetElement, options = {
|
|
|
11257
11362
|
const container = getScrollableParent(targetElement);
|
|
11258
11363
|
const containerRect = container.getBoundingClientRect();
|
|
11259
11364
|
const offsetTop = targetElement.getBoundingClientRect().top - containerRect.top + container.scrollTop;
|
|
11365
|
+
const scrollPaddingTopValue = window.getComputedStyle(container).scrollPaddingTop?.trim();
|
|
11366
|
+
const resolvedScrollPaddingTop = scrollPaddingTopValue?.endsWith("px") ? Number(scrollPaddingTopValue.slice(0, -2)) : 0;
|
|
11367
|
+
const scrollPaddingTop = Number.isFinite(resolvedScrollPaddingTop) && resolvedScrollPaddingTop >= 0 ? resolvedScrollPaddingTop : 0;
|
|
11260
11368
|
container.scrollTo({
|
|
11261
|
-
top: options.block === "start" ? offsetTop : offsetTop - container.clientHeight + targetElement.offsetHeight,
|
|
11369
|
+
top: options.block === "start" ? offsetTop - scrollPaddingTop : offsetTop - container.clientHeight + targetElement.offsetHeight,
|
|
11262
11370
|
behavior: options.behavior
|
|
11263
11371
|
});
|
|
11264
11372
|
}
|
|
@@ -34257,7 +34365,7 @@ var SuperDoc = class extends import_eventemitter3.default {
|
|
|
34257
34365
|
this.config.colors = shuffleArray(this.config.colors);
|
|
34258
34366
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
34259
34367
|
this.colorIndex = 0;
|
|
34260
|
-
this.version = "2.0.0-next.
|
|
34368
|
+
this.version = "2.0.0-next.28";
|
|
34261
34369
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
34262
34370
|
this.superdocId = config.superdocId || v4_default();
|
|
34263
34371
|
this.colors = this.config.colors ?? [];
|