superdoc 2.25.0-next.3 → 2.25.0-next.5
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-D8ss5E0J.cjs → create-super-doc-ui-B-A8sK47.cjs} +36 -0
- package/dist/chunks/{create-super-doc-ui-3habU4hL.es.js → create-super-doc-ui-CrH79xw6.es.js} +36 -0
- 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/index.d.ts +1 -0
- package/dist/document-api/src/permission-ranges/permission-ranges.d.ts +9 -1
- package/dist/document-api/src/permission-ranges/permission-ranges.types.d.ts +17 -0
- package/dist/document-api/src/protection/protection.types.d.ts +2 -2
- package/dist/layout-engine/contracts/src/incremental-dependency.d.ts +2 -2
- package/dist/layout-engine/contracts/src/index.d.ts +4 -0
- package/dist/layout-engine/layout-bridge/src/font-metrics-cache.d.ts +2 -23
- package/dist/layout-engine/layout-bridge/src/incrementalLayout.d.ts +11 -4
- package/dist/layout-engine/layout-bridge/src/index.d.ts +3 -3
- package/dist/layout-engine/layout-bridge/src/measurement-environment.d.ts +12 -0
- package/dist/layout-engine/layout-bridge/src/resolveLiveCrossReferences.d.ts +1 -1
- package/dist/layout-engine/layout-bridge/src/text-measurement.d.ts +8 -0
- package/dist/layout-engine/painters/dom/src/index.d.ts +4 -0
- package/dist/layout-engine/painters/dom/src/runs/text-run.d.ts +2 -17
- package/dist/layout-engine/painters/dom/src/runs/text-style-facts.d.ts +9 -0
- package/dist/layout-engine/painters/dom/src/runs/tracked-changes.d.ts +6 -9
- package/dist/layout-engine/painters/dom/src/styles.d.ts +21 -0
- package/dist/public/ui-react.cjs +1 -1
- package/dist/public/ui-react.es.js +1 -1
- package/dist/public/ui-vue.cjs +1 -1
- package/dist/public/ui-vue.es.js +1 -1
- package/dist/public/ui.cjs +1 -1
- package/dist/public/ui.es.js +1 -1
- package/dist/shared/font-system/src/registry.d.ts +5 -1
- package/dist/shared/font-system/src/resolver.d.ts +2 -0
- package/dist/style.css +1 -4239
- package/dist/style.layered.css +1 -4239
- package/dist/superdoc/src/core/types/index.d.ts +1 -1
- package/dist/superdoc/src/index.d.cts +2 -0
- package/dist/superdoc/src/index.d.ts +1 -0
- package/dist/superdoc/src/public/index.d.cts +8 -0
- package/dist/superdoc/src/public/index.d.ts +2 -0
- package/dist/superdoc/src/stores/comments-store.d.ts +7 -4
- package/dist/superdoc/src/stores/superdoc-store.d.ts +21 -12
- package/dist/superdoc.cjs +184 -17
- package/dist/superdoc.es.js +183 -18
- package/dist-cdn/style.layered.css +1 -1
- package/dist-cdn/superdoc.min.css +1 -1
- package/dist-cdn/superdoc.min.js +41 -41
- package/package.json +2 -2
package/dist/superdoc.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as __toESM$2 } from "./chunks/rolldown-runtime-0pSA04fp.es.js";
|
|
2
2
|
import { t as blank_default } from "./chunks/blank-docx-DzQccOlW.es.js";
|
|
3
|
-
import { c as createImageFilePicker, d as DOM_CLASS_NAMES, f as closeInteractionHistory, g as recordInteraction, h as isWorkflowRecordingEnabled, i as registerFirstPartyCommandMutation, l as resolveImageSrc, m as getWorkflowRecording, n as executeFirstPartyCommandAsync, o as applyV2CommentInvalidationFromMutation, p as createInteractionHistory, r as readFirstPartyPageNumbers, s as getV2TrackedChangeMutationImpact, t as createSuperDocUI } from "./chunks/create-super-doc-ui-
|
|
3
|
+
import { c as createImageFilePicker, d as DOM_CLASS_NAMES, f as closeInteractionHistory, g as recordInteraction, h as isWorkflowRecordingEnabled, i as registerFirstPartyCommandMutation, l as resolveImageSrc, m as getWorkflowRecording, n as executeFirstPartyCommandAsync, o as applyV2CommentInvalidationFromMutation, p as createInteractionHistory, r as readFirstPartyPageNumbers, s as getV2TrackedChangeMutationImpact, t as createSuperDocUI } from "./chunks/create-super-doc-ui-CrH79xw6.es.js";
|
|
4
4
|
import { t as import_eventemitter3 } from "./chunks/eventemitter3-DEIiXiH2.es.js";
|
|
5
5
|
import { t as v4 } from "./chunks/uuid-H0Xcmmhy.es.js";
|
|
6
6
|
import { $ as vModelText, A as onActivated, B as renderSlot, C as isRef$1, D as normalizeClass, E as nextTick, F as openBlock, G as toRaw$2, H as resolveDynamicComponent, I as provide$1, J as unref, K as toRef, L as reactive, M as onDeactivated, N as onMounted, O as normalizeProps, P as onScopeDispose$1, Q as vModelSelect, R as ref, S as isReactive$1, T as mergeProps, U as shallowRef$1, V as resolveDirective, W as toDisplayString, X as useSlots, Y as useAttrs, Z as vModelCheckbox, _ as getCurrentInstance, a as computed$1, b as hasInjectionContext, c as createCommentVNode, d as createStaticVNode, et as watch$1, f as createTextVNode, g as effectScope, h as defineComponent, i as Transition, it as withModifiers, j as onBeforeUnmount, k as normalizeStyle, l as createElementBlock, m as defineAsyncComponent, n as Fragment, nt as withDirectives, o as createApp, p as createVNode, q as toRefs, r as Teleport, rt as withKeys, s as createBlock, t as _plugin_vue_export_helper_default, tt as withCtx, u as createElementVNode, v as getCurrentScope, w as markRaw, x as inject$1, y as h, z as renderList } from "./chunks/_plugin-vue_export-helper-7ZiLY07t.es.js";
|
|
@@ -302,7 +302,7 @@ var awarenessStatesToArray = (context, states) => {
|
|
|
302
302
|
var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
|
|
303
303
|
function getSuperdocVersion() {
|
|
304
304
|
try {
|
|
305
|
-
return "2.25.0-next.
|
|
305
|
+
return "2.25.0-next.5";
|
|
306
306
|
} catch {
|
|
307
307
|
return "unknown";
|
|
308
308
|
}
|
|
@@ -7845,6 +7845,7 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
7845
7845
|
const editorCommentPositions = ref({});
|
|
7846
7846
|
const isCommentHighlighted = ref(false);
|
|
7847
7847
|
const floatingCommentsOffset = ref(0);
|
|
7848
|
+
const committedReviewPresentations = shallowRef$1({});
|
|
7848
7849
|
const sortedConversations = ref([]);
|
|
7849
7850
|
const visibleConversations = ref([]);
|
|
7850
7851
|
const skipSelectionUpdate = ref(false);
|
|
@@ -8860,7 +8861,17 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
8860
8861
|
resolvedComments: resolvedComments.sort(sorter)
|
|
8861
8862
|
};
|
|
8862
8863
|
};
|
|
8863
|
-
const buildGroupedComments = (sorter) =>
|
|
8864
|
+
const buildGroupedComments = (sorter) => {
|
|
8865
|
+
const presentations = committedReviewPresentations.value;
|
|
8866
|
+
if (!Object.keys(presentations).length) return buildGroupedCommentsFrom(commentsList.value, sorter);
|
|
8867
|
+
const rows = new Map(commentsList.value.map((row) => [JSON.stringify([String(row.fileId), String(row.commentId)]), row]));
|
|
8868
|
+
const legacy = buildGroupedCommentsFrom(commentsList.value.filter((row) => !presentations[String(row.fileId)]), sorter);
|
|
8869
|
+
for (const [documentId, presentation] of Object.entries(presentations)) {
|
|
8870
|
+
legacy.parentComments.push(...presentation.groupOrder.open.map((id) => rows.get(JSON.stringify([documentId, String(id)]))).filter((row) => row && isThreadVisible(row)));
|
|
8871
|
+
legacy.resolvedComments.push(...presentation.groupOrder.resolved.map((id) => rows.get(JSON.stringify([documentId, String(id)]))).filter((row) => row && isThreadVisible(row)));
|
|
8872
|
+
}
|
|
8873
|
+
return legacy;
|
|
8874
|
+
};
|
|
8864
8875
|
/** @type {import('vue').ComputedRef<{parentComments: Array, resolvedComments: Array}>} Comments grouped and sorted by creation time */
|
|
8865
8876
|
const getGroupedComments = computed$1(() => buildGroupedComments(compareByCreatedTime));
|
|
8866
8877
|
const getGroupedReviewDirectory = computed$1(() => buildGroupedCommentsFrom(reviewDirectoryList.value, compareByCreatedTime));
|
|
@@ -9833,7 +9844,7 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
9833
9844
|
* wraps this action in one Pinia `$patch`; all fallible mapping completes
|
|
9834
9845
|
* before either row family mutates.
|
|
9835
9846
|
*/
|
|
9836
|
-
const applyReviewWindowFromV2 = ({ superdoc, commentsAdapter, trackedChangesAdapter, documentId, commentItems, trackedChangeItems, requestedCommentIds, requestedTrackedChangeIds, unresolvedCommentIds, trackedList, sourceCoverageRevision, evaluatedRevision, patch } = {}) => withInteractionSpan("store.reviewWindow.apply", "store-reconciliation", {
|
|
9847
|
+
const applyReviewWindowFromV2 = ({ superdoc, commentsAdapter, trackedChangesAdapter, documentId, commentItems, trackedChangeItems, preparedReview, requestedCommentIds, requestedTrackedChangeIds, unresolvedCommentIds, trackedList, sourceCoverageRevision, evaluatedRevision, patch } = {}) => withInteractionSpan("store.reviewWindow.apply", "store-reconciliation", {
|
|
9837
9848
|
commentItemCount: Array.isArray(commentItems) ? commentItems.length : null,
|
|
9838
9849
|
trackedItemCount: Array.isArray(trackedChangeItems) ? trackedChangeItems.length : null
|
|
9839
9850
|
}, () => {
|
|
@@ -9859,6 +9870,10 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
9859
9870
|
ok: false,
|
|
9860
9871
|
reason: "document-mismatch"
|
|
9861
9872
|
};
|
|
9873
|
+
if (preparedReview && (!Array.isArray(preparedReview.comments) || !Array.isArray(preparedReview.trackedChanges) || preparedReview.comments.length > 4096 || preparedReview.trackedChanges.length > 4096)) return {
|
|
9874
|
+
ok: false,
|
|
9875
|
+
reason: "items-invalid"
|
|
9876
|
+
};
|
|
9862
9877
|
if (!Array.isArray(commentItems) || !Array.isArray(trackedChangeItems)) return {
|
|
9863
9878
|
ok: false,
|
|
9864
9879
|
reason: "items-invalid"
|
|
@@ -9872,7 +9887,7 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
9872
9887
|
reason: "adapter-mapper-missing"
|
|
9873
9888
|
};
|
|
9874
9889
|
let effectiveCommentItems = commentItems;
|
|
9875
|
-
if (typeof commentsAdapter.seedReviewCatalog === "function") {
|
|
9890
|
+
if (!preparedReview && typeof commentsAdapter.seedReviewCatalog === "function") {
|
|
9876
9891
|
const seeded = commentsAdapter.seedReviewCatalog(commentItems, {
|
|
9877
9892
|
sourceCoverageRevision,
|
|
9878
9893
|
evaluatedRevision
|
|
@@ -9888,11 +9903,22 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
9888
9903
|
let preparedInputs;
|
|
9889
9904
|
let preparedParams;
|
|
9890
9905
|
try {
|
|
9891
|
-
preparedInputs =
|
|
9906
|
+
preparedInputs = preparedReview ? preparedReview.comments.map((input) => ({
|
|
9907
|
+
...input,
|
|
9908
|
+
fileId: normalizedDocumentId,
|
|
9909
|
+
fileType,
|
|
9910
|
+
selection: {
|
|
9911
|
+
...input.selection,
|
|
9912
|
+
documentId: normalizedDocumentId
|
|
9913
|
+
}
|
|
9914
|
+
})) : effectiveCommentItems.filter((item) => !isSyntheticTrackedChangeCommentLaneItem(item)).map((item) => commentsAdapter.mapV2CommentToUseCommentInput(item, {
|
|
9892
9915
|
fileId: normalizedDocumentId,
|
|
9893
9916
|
fileType
|
|
9894
9917
|
})).filter(Boolean);
|
|
9895
|
-
preparedParams =
|
|
9918
|
+
preparedParams = preparedReview ? preparedReview.trackedChanges.map((params) => ({
|
|
9919
|
+
...params,
|
|
9920
|
+
documentId: normalizedDocumentId
|
|
9921
|
+
})) : trackedChangeItems.map((item) => trackedChangesAdapter.mapV2TrackedChangeToCommentParams(item)).filter(Boolean);
|
|
9896
9922
|
} catch (error) {
|
|
9897
9923
|
return {
|
|
9898
9924
|
ok: false,
|
|
@@ -9927,6 +9953,10 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
9927
9953
|
])
|
|
9928
9954
|
].map((value) => normalizeCommentId(value)).filter(Boolean));
|
|
9929
9955
|
patch(() => {
|
|
9956
|
+
if (preparedReview?.presentation) committedReviewPresentations.value = {
|
|
9957
|
+
...committedReviewPresentations.value,
|
|
9958
|
+
[normalizedDocumentId]: preparedReview.presentation
|
|
9959
|
+
};
|
|
9930
9960
|
reconcileTrackedChangesFromV2({
|
|
9931
9961
|
superdoc,
|
|
9932
9962
|
adapter: trackedChangesAdapter,
|
|
@@ -10329,6 +10359,11 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
10329
10359
|
function removeCommentsForDocument(documentId) {
|
|
10330
10360
|
const activeDocumentId = documentId != null ? String(documentId) : null;
|
|
10331
10361
|
if (!activeDocumentId) return;
|
|
10362
|
+
if (committedReviewPresentations.value[activeDocumentId]) {
|
|
10363
|
+
const next = { ...committedReviewPresentations.value };
|
|
10364
|
+
delete next[activeDocumentId];
|
|
10365
|
+
committedReviewPresentations.value = next;
|
|
10366
|
+
}
|
|
10332
10367
|
cancelImportedTrackedChangeBootstrap(activeDocumentId);
|
|
10333
10368
|
const removedComments = commentsList.value.filter((comment) => belongsToDocument(comment, activeDocumentId, { allowSingleDocumentMismatch: true }));
|
|
10334
10369
|
if (!removedComments.length) return;
|
|
@@ -11988,6 +12023,7 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
11988
12023
|
hasInitializedLocations,
|
|
11989
12024
|
isCommentHighlighted,
|
|
11990
12025
|
floatingCommentsOffset,
|
|
12026
|
+
committedReviewPresentations,
|
|
11991
12027
|
sortedConversations,
|
|
11992
12028
|
visibleConversations,
|
|
11993
12029
|
skipSelectionUpdate,
|
|
@@ -15248,6 +15284,50 @@ var composeAuthorColorResolver = (config) => {
|
|
|
15248
15284
|
};
|
|
15249
15285
|
};
|
|
15250
15286
|
//#endregion
|
|
15287
|
+
//#region ../document-api/src/permission-ranges/permission-ranges.ts
|
|
15288
|
+
function editorKey(editor) {
|
|
15289
|
+
return editor.id?.trim() ? editor.id : editor.email?.trim() || void 0;
|
|
15290
|
+
}
|
|
15291
|
+
function editorMatches(editor, id) {
|
|
15292
|
+
return Boolean(id.trim()) && (editor.id === id || Boolean(editor.email?.trim() && editor.email.trim().toLowerCase() === id.toLowerCase()));
|
|
15293
|
+
}
|
|
15294
|
+
/**
|
|
15295
|
+
* Resolve a host ID or imported Word email against an explicitly supplied roster.
|
|
15296
|
+
* Word receives the email when available; opaque IDs remain host-specific.
|
|
15297
|
+
* Duplicate IDs/emails are ambiguous. This does not authenticate a user.
|
|
15298
|
+
*/
|
|
15299
|
+
function resolvePermissionRangeEditor(editors, id) {
|
|
15300
|
+
const matches = editors.filter((editor) => editorMatches(editor, id));
|
|
15301
|
+
if (matches.length === 0) return {
|
|
15302
|
+
status: "unknown",
|
|
15303
|
+
id
|
|
15304
|
+
};
|
|
15305
|
+
if (matches.length !== 1) return {
|
|
15306
|
+
status: "ambiguous",
|
|
15307
|
+
id
|
|
15308
|
+
};
|
|
15309
|
+
const editor = matches[0];
|
|
15310
|
+
const wordId = editor.email?.trim() || editor.id;
|
|
15311
|
+
if (editors.filter((candidate) => editorMatches(candidate, wordId)).length !== 1) return {
|
|
15312
|
+
status: "ambiguous",
|
|
15313
|
+
id
|
|
15314
|
+
};
|
|
15315
|
+
return {
|
|
15316
|
+
status: "resolved",
|
|
15317
|
+
id,
|
|
15318
|
+
editor: { ...editor },
|
|
15319
|
+
principal: {
|
|
15320
|
+
kind: "editor",
|
|
15321
|
+
id: wordId
|
|
15322
|
+
}
|
|
15323
|
+
};
|
|
15324
|
+
}
|
|
15325
|
+
/** Enumerate the host roster for an editor picker, including ambiguous entries. */
|
|
15326
|
+
function listPermissionRangeEditors(editors) {
|
|
15327
|
+
const ids = new Set(editors.map(editorKey).filter((id) => id !== void 0));
|
|
15328
|
+
return Array.from(ids, (id) => resolvePermissionRangeEditor(editors, id));
|
|
15329
|
+
}
|
|
15330
|
+
//#endregion
|
|
15251
15331
|
//#region src/core/superdoc-ui-owner.js
|
|
15252
15332
|
var ownerIds = /* @__PURE__ */ new WeakMap();
|
|
15253
15333
|
function getSuperDocUiOwnerId(superdoc) {
|
|
@@ -15369,7 +15449,22 @@ var FloatingComments_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
|
|
|
15369
15449
|
const { clearInstantSidebarAlignment } = commentsStore;
|
|
15370
15450
|
const { activeComment, activeFloatingCommentInstanceId, editorCommentPositions, pendingComment, editingCommentId, instantSidebarAlignmentTargetY, instantSidebarAlignmentThreadId, instantSidebarAlignmentInstanceId } = storeToRefs(commentsStore);
|
|
15371
15451
|
const { activeZoom } = storeToRefs(superdocStore);
|
|
15452
|
+
const committedPresentation = computed$1(() => commentsStore.committedReviewPresentations?.[String(props.currentDocument?.id)] ?? null);
|
|
15453
|
+
const committedInstances = computed$1(() => {
|
|
15454
|
+
const presentation = committedPresentation.value;
|
|
15455
|
+
if (!presentation) return null;
|
|
15456
|
+
const rows = new Map(commentsStore.commentsList.filter((row) => String(row.fileId) === String(props.currentDocument?.id)).map((row) => [String(row.commentId), row]));
|
|
15457
|
+
return presentation.instances.flatMap((instance) => {
|
|
15458
|
+
const comment = instance.rowId === "pending" ? pendingComment.value : rows.get(instance.rowId);
|
|
15459
|
+
return comment ? [{
|
|
15460
|
+
...instance,
|
|
15461
|
+
comment,
|
|
15462
|
+
rowVersion: presentation.rowVersions[instance.rowId] ?? 0
|
|
15463
|
+
}] : [];
|
|
15464
|
+
});
|
|
15465
|
+
});
|
|
15372
15466
|
const floatingCommentInstances = computed$1(() => {
|
|
15467
|
+
if (committedInstances.value) return committedInstances.value.filter((instance) => instance.rowId !== "pending");
|
|
15373
15468
|
const currentFloatingCommentInstances = commentsStore.getFloatingCommentInstances;
|
|
15374
15469
|
if (!Array.isArray(currentFloatingCommentInstances)) return [];
|
|
15375
15470
|
const documentId = props.currentDocument?.id;
|
|
@@ -15487,7 +15582,7 @@ var FloatingComments_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
|
|
|
15487
15582
|
const shouldRenderDialog = (position) => {
|
|
15488
15583
|
return shouldMountFloatingCommentDialog({
|
|
15489
15584
|
id: position?.id,
|
|
15490
|
-
visibleIds: visibleIds.value,
|
|
15585
|
+
visibleIds: committedPresentation.value ? new Set(allPositions.value.filter((item) => item.instanceRef?.mount).map((item) => item.id)) : visibleIds.value,
|
|
15491
15586
|
activeCommentInstanceId: activeCommentInstanceId.value,
|
|
15492
15587
|
comment: position?.commentRef
|
|
15493
15588
|
});
|
|
@@ -15533,6 +15628,19 @@ var FloatingComments_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
|
|
|
15533
15628
|
});
|
|
15534
15629
|
const allPositions = computed$1(() => {
|
|
15535
15630
|
viewportRevision.value;
|
|
15631
|
+
if (committedInstances.value) return committedInstances.value.map((instance) => ({
|
|
15632
|
+
id: instance.id,
|
|
15633
|
+
threadId: instance.threadId,
|
|
15634
|
+
pageIndex: instance.pageIndex,
|
|
15635
|
+
anchorTop: instance.anchorTop,
|
|
15636
|
+
anchorBottom: instance.anchorBottom,
|
|
15637
|
+
top: instance.top,
|
|
15638
|
+
height: instance.height,
|
|
15639
|
+
hasAnchorGeometry: instance.positionEntry != null || instance.rowId === "pending",
|
|
15640
|
+
isOffscreenReviewCard: instance.isOffscreenReviewCard,
|
|
15641
|
+
commentRef: instance.comment,
|
|
15642
|
+
instanceRef: instance
|
|
15643
|
+
}));
|
|
15536
15644
|
const positionedInstances = geometryBearingInstances.value;
|
|
15537
15645
|
const hasPending = pendingComment.value && pendingComment.value.fileId === props.currentDocument.id;
|
|
15538
15646
|
if (!positionedInstances.length && !floatingCommentInstances.value.length && !hasPending) return [];
|
|
@@ -15631,6 +15739,43 @@ var FloatingComments_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
|
|
|
15631
15739
|
resolveCollisions(collisionPositions, activeIndex, 15);
|
|
15632
15740
|
return positions;
|
|
15633
15741
|
});
|
|
15742
|
+
watch$1(() => {
|
|
15743
|
+
const presentation = committedPresentation.value, container = floatingCommentsContainer.value;
|
|
15744
|
+
if (!presentation || !container) return null;
|
|
15745
|
+
viewportRevision.value;
|
|
15746
|
+
const viewport = getFloatingViewportRange();
|
|
15747
|
+
if (!viewport) return null;
|
|
15748
|
+
const rail = container.getBoundingClientRect(), stage = props.parent?.getBoundingClientRect?.();
|
|
15749
|
+
const instances = committedInstances.value ?? [];
|
|
15750
|
+
return {
|
|
15751
|
+
activeThreadId: activeComment.value == null ? null : String(activeComment.value),
|
|
15752
|
+
activeInstanceId: activeCommentInstanceId.value == null ? null : String(activeCommentInstanceId.value),
|
|
15753
|
+
editingRowId: editingCommentId.value == null ? null : String(editingCommentId.value),
|
|
15754
|
+
retainedThreadIds: [],
|
|
15755
|
+
visibility: {
|
|
15756
|
+
comments: commentsStore.viewingVisibility?.documentMode !== "viewing" || commentsStore.viewingVisibility?.commentsVisible === true,
|
|
15757
|
+
trackedChanges: commentsStore.viewingVisibility?.documentMode !== "viewing" || commentsStore.viewingVisibility?.trackChangesVisible === true
|
|
15758
|
+
},
|
|
15759
|
+
viewport: {
|
|
15760
|
+
...viewport,
|
|
15761
|
+
width: Math.max(1, rail.width),
|
|
15762
|
+
scale: 1,
|
|
15763
|
+
stageOffsetX: (stage?.left ?? rail.left) - rail.left,
|
|
15764
|
+
stageOffsetY: (stage?.top ?? rail.top) - rail.top
|
|
15765
|
+
},
|
|
15766
|
+
pending: pendingComment.value?.fileId === props.currentDocument.id && getPendingAnchorTop() != null ? {
|
|
15767
|
+
anchorTop: getPendingAnchorTop(),
|
|
15768
|
+
height: measuredHeights.value.pending || ESTIMATED_HEIGHT
|
|
15769
|
+
} : null,
|
|
15770
|
+
measurements: instances.filter((instance) => measuredHeights.value[instance.id] > 0).map((instance) => ({
|
|
15771
|
+
instanceId: instance.id,
|
|
15772
|
+
rowVersion: instance.rowVersion,
|
|
15773
|
+
height: measuredHeights.value[instance.id]
|
|
15774
|
+
}))
|
|
15775
|
+
};
|
|
15776
|
+
}, (input) => {
|
|
15777
|
+
if (input) committedPresentation.value?.updateContext(input);
|
|
15778
|
+
}, { immediate: true });
|
|
15634
15779
|
const wrapperMinHeight = computed$1(() => {
|
|
15635
15780
|
viewportRevision.value;
|
|
15636
15781
|
return Math.max(0, props.parent?.clientHeight || 0, props.parent?.scrollHeight || 0);
|
|
@@ -16146,7 +16291,7 @@ var FloatingComments_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
|
|
|
16146
16291
|
}, [createElementVNode("div", {
|
|
16147
16292
|
class: "sidebar-container",
|
|
16148
16293
|
style: normalizeStyle({
|
|
16149
|
-
transform: `translateY(${sidebarOffsetY.value}px)`,
|
|
16294
|
+
transform: `translateY(${committedPresentation.value ? 0 : sidebarOffsetY.value}px)`,
|
|
16150
16295
|
transition: disableInstantLayoutTransitions.value ? "none" : void 0
|
|
16151
16296
|
})
|
|
16152
16297
|
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(allPositions.value, (pos) => {
|
|
@@ -16188,7 +16333,7 @@ var FloatingComments_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
|
|
|
16188
16333
|
}), 128))], 4)], 36);
|
|
16189
16334
|
};
|
|
16190
16335
|
}
|
|
16191
|
-
}, [["__scopeId", "data-v-
|
|
16336
|
+
}, [["__scopeId", "data-v-f0b1fd79"]]);
|
|
16192
16337
|
//#endregion
|
|
16193
16338
|
//#region src/components/CommentsLayer/PdfCommentsLayer.vue
|
|
16194
16339
|
var _hoisted_1$23 = {
|
|
@@ -22546,6 +22691,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
|
|
|
22546
22691
|
documentId: ctx?.documentId,
|
|
22547
22692
|
commentItems: result?.comments?.items,
|
|
22548
22693
|
trackedChangeItems: result?.trackedChanges?.items,
|
|
22694
|
+
preparedReview: result?.preparedReview,
|
|
22549
22695
|
requestedCommentIds: result?.comments?.requestedIds,
|
|
22550
22696
|
requestedTrackedChangeIds: result?.trackedChanges?.requestedIds,
|
|
22551
22697
|
unresolvedCommentIds: result?.comments?.unresolvedCommentIds,
|
|
@@ -23664,7 +23810,6 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
|
|
|
23664
23810
|
const onFontsResolvedFn = proxy.$superdoc.listeners?.("fonts-resolved")?.length > 0 ? proxy.$superdoc.listeners("fonts-resolved")[0] : null;
|
|
23665
23811
|
const useLayoutEngine = proxy.$superdoc.config.useLayoutEngine !== false;
|
|
23666
23812
|
const isNewFile = doc.isNewFile;
|
|
23667
|
-
const benchmarkExecutionMode = proxy.$superdoc.config?.benchmarkExecutionMode;
|
|
23668
23813
|
const benchmarkTraceEnabled = proxy.$superdoc.config?.benchmarkTraceEnabled === true;
|
|
23669
23814
|
const collaborationResolution = resolveDocumentV2Collaboration(doc);
|
|
23670
23815
|
const v2Collaboration = collaborationResolution.state === "valid" ? collaborationResolution.config : null;
|
|
@@ -23681,7 +23826,6 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
|
|
|
23681
23826
|
html: doc.html,
|
|
23682
23827
|
markdown: doc.markdown,
|
|
23683
23828
|
documentMode: proxy.$superdoc.config.documentMode,
|
|
23684
|
-
...benchmarkExecutionMode ? { benchmarkExecutionMode } : {},
|
|
23685
23829
|
...benchmarkTraceEnabled ? { benchmarkTraceEnabled: true } : {},
|
|
23686
23830
|
allowSelectionInViewMode: proxy.$superdoc.config.allowSelectionInViewMode,
|
|
23687
23831
|
rulers: doc.rulers,
|
|
@@ -24793,7 +24937,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
|
|
|
24793
24937
|
], 46, _hoisted_1$17);
|
|
24794
24938
|
};
|
|
24795
24939
|
}
|
|
24796
|
-
}, [["__scopeId", "data-v-
|
|
24940
|
+
}, [["__scopeId", "data-v-c57da6ae"]]);
|
|
24797
24941
|
//#endregion
|
|
24798
24942
|
//#region src/core/create-app.js
|
|
24799
24943
|
var PINIA_DEVTOOLS_SETUP_EVENT = "devtools-plugin:setup";
|
|
@@ -46353,6 +46497,8 @@ var SuperDoc = class extends import_eventemitter3.default {
|
|
|
46353
46497
|
return this.#surfacesConfig;
|
|
46354
46498
|
}
|
|
46355
46499
|
#surfaceManager;
|
|
46500
|
+
#sourceLifecycleReady;
|
|
46501
|
+
#pendingSourceLifecycle;
|
|
46356
46502
|
/**
|
|
46357
46503
|
* SuperDoc-owned editor runtime registry. This is the internal place to ask
|
|
46358
46504
|
* which mounted editor runtime is active and which runtime owns a DOM event
|
|
@@ -46425,6 +46571,8 @@ var SuperDoc = class extends import_eventemitter3.default {
|
|
|
46425
46571
|
this.whiteboard = null;
|
|
46426
46572
|
this.colors = [];
|
|
46427
46573
|
this.readyEditors = 0;
|
|
46574
|
+
this.#sourceLifecycleReady = false;
|
|
46575
|
+
this.#pendingSourceLifecycle = [];
|
|
46428
46576
|
this.#editorRuntimeRegistry = new EditorRuntimeRegistry();
|
|
46429
46577
|
this.#editorRuntimeRegistryUnsub = null;
|
|
46430
46578
|
this.#applyingRuntimeActiveChange = false;
|
|
@@ -46578,7 +46726,7 @@ var SuperDoc = class extends import_eventemitter3.default {
|
|
|
46578
46726
|
}
|
|
46579
46727
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
46580
46728
|
this.colorIndex = 0;
|
|
46581
|
-
this.version = "2.25.0-next.
|
|
46729
|
+
this.version = "2.25.0-next.5";
|
|
46582
46730
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
46583
46731
|
this.superdocId = config.superdocId || v4();
|
|
46584
46732
|
this.colors = this.config.colors ?? [];
|
|
@@ -46615,6 +46763,8 @@ var SuperDoc = class extends import_eventemitter3.default {
|
|
|
46615
46763
|
* Mount the Vue app, stores, and editor runtime.
|
|
46616
46764
|
*/
|
|
46617
46765
|
#startRuntime() {
|
|
46766
|
+
this.#sourceLifecycleReady = false;
|
|
46767
|
+
this.#pendingSourceLifecycle = [];
|
|
46618
46768
|
this.#initVueApp();
|
|
46619
46769
|
this.readyEditors = 0;
|
|
46620
46770
|
if (!this.app) throw new Error("SuperDoc: #startRuntime called before #initVueApp populated this.app");
|
|
@@ -47650,7 +47800,13 @@ var SuperDoc = class extends import_eventemitter3.default {
|
|
|
47650
47800
|
* Triggered when the superdoc is ready
|
|
47651
47801
|
*/
|
|
47652
47802
|
broadcastReady() {
|
|
47653
|
-
if (this
|
|
47803
|
+
if (this.#destroyed) return;
|
|
47804
|
+
if (this.readyEditors === this.requiredNumberOfEditors) {
|
|
47805
|
+
this.emit("ready", { superdoc: this });
|
|
47806
|
+
if (this.#destroyed) return;
|
|
47807
|
+
this.#sourceLifecycleReady = true;
|
|
47808
|
+
for (const type of this.#pendingSourceLifecycle.splice(0)) this.emit(type);
|
|
47809
|
+
}
|
|
47654
47810
|
}
|
|
47655
47811
|
/**
|
|
47656
47812
|
* Triggered before an editor is created
|
|
@@ -47669,11 +47825,19 @@ var SuperDoc = class extends import_eventemitter3.default {
|
|
|
47669
47825
|
this.#wireFontsChangedRelay(editor);
|
|
47670
47826
|
this.emit("editorCreate", { editor: createDeprecatedEditorProxy(editor) });
|
|
47671
47827
|
}
|
|
47828
|
+
#broadcastSourceLifecycle(type) {
|
|
47829
|
+
if (this.#destroyed) return;
|
|
47830
|
+
if (!this.#sourceLifecycleReady) {
|
|
47831
|
+
this.#pendingSourceLifecycle.push(type);
|
|
47832
|
+
return;
|
|
47833
|
+
}
|
|
47834
|
+
this.emit(type);
|
|
47835
|
+
}
|
|
47672
47836
|
broadcastSourceComplete() {
|
|
47673
|
-
this
|
|
47837
|
+
this.#broadcastSourceLifecycle("source:complete");
|
|
47674
47838
|
}
|
|
47675
47839
|
broadcastSourceSignalsComplete() {
|
|
47676
|
-
this
|
|
47840
|
+
this.#broadcastSourceLifecycle("source:signals-complete");
|
|
47677
47841
|
}
|
|
47678
47842
|
/** Editors whose `fonts-changed` we already relay, so a repeated create wires once. */
|
|
47679
47843
|
#fontsRelayEditors;
|
|
@@ -48935,6 +49099,7 @@ var SuperDoc = class extends import_eventemitter3.default {
|
|
|
48935
49099
|
destroy() {
|
|
48936
49100
|
closeInteractionHistory(this);
|
|
48937
49101
|
this.#destroyed = true;
|
|
49102
|
+
this.#pendingSourceLifecycle = [];
|
|
48938
49103
|
this.#contentControlClickRoot?.removeEventListener("click", this.#handleContentControlClick, true);
|
|
48939
49104
|
this.#contentControlClickRoot?.removeEventListener("pointerdown", this.#handleContentControlPointerDown, true);
|
|
48940
49105
|
this.#contentControlClickRoot?.ownerDocument.removeEventListener("pointerup", this.#handleContentControlPointerEnd, true);
|
|
@@ -49162,4 +49327,4 @@ function defineSuperDocExtension(extension) {
|
|
|
49162
49327
|
return extension;
|
|
49163
49328
|
}
|
|
49164
49329
|
//#endregion
|
|
49165
|
-
export { blank_default as BlankDOCX, DOCX, HTML, PDF, SuperDoc, buildTheme, compareVersions, createTheme, defineSuperDocExtension, getFileObject };
|
|
49330
|
+
export { blank_default as BlankDOCX, DOCX, HTML, PDF, SuperDoc, buildTheme, compareVersions, createTheme, defineSuperDocExtension, getFileObject, listPermissionRangeEditors, resolvePermissionRangeEditor };
|