superdoc 2.25.0-next.16 → 2.25.0-next.18
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-BbTRF-Z9.cjs → create-super-doc-ui-DZIB6Pd4.cjs} +317 -165
- package/dist/chunks/{create-super-doc-ui-Cr_04XnJ.es.js → create-super-doc-ui-DqCrc6Vw.es.js} +312 -166
- 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/customXml/customXml.types.d.ts +1 -1
- package/dist/document-api/src/lists/lists.types.d.ts +2 -0
- package/dist/document-api/src/metadata/anchored-metadata.types.d.ts +1 -1
- package/dist/document-api/src/types/mutation-plan.types.d.ts +4 -2
- package/dist/layout-engine/layout-bridge/src/index.d.ts +2 -0
- package/dist/layout-engine/layout-bridge/src/neutral-segment-geometry.d.ts +18 -1
- package/dist/layout-engine/layout-bridge/src/visual-bidi-geometry.d.ts +37 -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/style.css +1 -1
- package/dist/style.layered.css +1 -1
- package/dist/superdoc/src/public/ui/create-super-doc-ui.d.ts +7 -0
- package/dist/superdoc/src/stores/comments-store.d.ts +9 -3
- package/dist/superdoc/src/stores/superdoc-store.d.ts +27 -9
- package/dist/superdoc.cjs +98 -12
- package/dist/superdoc.es.js +98 -12
- package/dist-cdn/style.layered.css +1 -1
- package/dist-cdn/superdoc.min.css +1 -1
- package/dist-cdn/superdoc.min.js +42 -42
- package/package.json +2 -2
|
@@ -276,9 +276,11 @@ export const useSuperdocStore: import('pinia').StoreDefinition<"superdoc", Pick<
|
|
|
276
276
|
allResolved?: undefined;
|
|
277
277
|
removedRows?: undefined;
|
|
278
278
|
}>;
|
|
279
|
-
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, liveIds: suppliedLiveIds, liveAnchorKeys: suppliedLiveAnchorKeys, hydrationGeneration, }?: {
|
|
279
|
+
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, preparedPresentation, previousPreparedPresentation, liveIds: suppliedLiveIds, liveAnchorKeys: suppliedLiveAnchorKeys, hydrationGeneration, }?: {
|
|
280
280
|
pruneStale?: boolean | undefined;
|
|
281
281
|
preparedParams?: null | undefined;
|
|
282
|
+
preparedPresentation?: null | undefined;
|
|
283
|
+
previousPreparedPresentation?: null | undefined;
|
|
282
284
|
liveIds?: null | undefined;
|
|
283
285
|
liveAnchorKeys?: null | undefined;
|
|
284
286
|
}) => any;
|
|
@@ -560,9 +562,11 @@ export const useSuperdocStore: import('pinia').StoreDefinition<"superdoc", Pick<
|
|
|
560
562
|
allResolved?: undefined;
|
|
561
563
|
removedRows?: undefined;
|
|
562
564
|
}>;
|
|
563
|
-
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, liveIds: suppliedLiveIds, liveAnchorKeys: suppliedLiveAnchorKeys, hydrationGeneration, }?: {
|
|
565
|
+
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, preparedPresentation, previousPreparedPresentation, liveIds: suppliedLiveIds, liveAnchorKeys: suppliedLiveAnchorKeys, hydrationGeneration, }?: {
|
|
564
566
|
pruneStale?: boolean | undefined;
|
|
565
567
|
preparedParams?: null | undefined;
|
|
568
|
+
preparedPresentation?: null | undefined;
|
|
569
|
+
previousPreparedPresentation?: null | undefined;
|
|
566
570
|
liveIds?: null | undefined;
|
|
567
571
|
liveAnchorKeys?: null | undefined;
|
|
568
572
|
}) => any;
|
|
@@ -844,9 +848,11 @@ export const useSuperdocStore: import('pinia').StoreDefinition<"superdoc", Pick<
|
|
|
844
848
|
allResolved?: undefined;
|
|
845
849
|
removedRows?: undefined;
|
|
846
850
|
}>;
|
|
847
|
-
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, liveIds: suppliedLiveIds, liveAnchorKeys: suppliedLiveAnchorKeys, hydrationGeneration, }?: {
|
|
851
|
+
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, preparedPresentation, previousPreparedPresentation, liveIds: suppliedLiveIds, liveAnchorKeys: suppliedLiveAnchorKeys, hydrationGeneration, }?: {
|
|
848
852
|
pruneStale?: boolean | undefined;
|
|
849
853
|
preparedParams?: null | undefined;
|
|
854
|
+
preparedPresentation?: null | undefined;
|
|
855
|
+
previousPreparedPresentation?: null | undefined;
|
|
850
856
|
liveIds?: null | undefined;
|
|
851
857
|
liveAnchorKeys?: null | undefined;
|
|
852
858
|
}) => any;
|
|
@@ -1180,9 +1186,11 @@ export const useSuperdocStore: import('pinia').StoreDefinition<"superdoc", Pick<
|
|
|
1180
1186
|
allResolved?: undefined;
|
|
1181
1187
|
removedRows?: undefined;
|
|
1182
1188
|
}>;
|
|
1183
|
-
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, liveIds: suppliedLiveIds, liveAnchorKeys: suppliedLiveAnchorKeys, hydrationGeneration, }?: {
|
|
1189
|
+
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, preparedPresentation, previousPreparedPresentation, liveIds: suppliedLiveIds, liveAnchorKeys: suppliedLiveAnchorKeys, hydrationGeneration, }?: {
|
|
1184
1190
|
pruneStale?: boolean | undefined;
|
|
1185
1191
|
preparedParams?: null | undefined;
|
|
1192
|
+
preparedPresentation?: null | undefined;
|
|
1193
|
+
previousPreparedPresentation?: null | undefined;
|
|
1186
1194
|
liveIds?: null | undefined;
|
|
1187
1195
|
liveAnchorKeys?: null | undefined;
|
|
1188
1196
|
}) => any;
|
|
@@ -1464,9 +1472,11 @@ export const useSuperdocStore: import('pinia').StoreDefinition<"superdoc", Pick<
|
|
|
1464
1472
|
allResolved?: undefined;
|
|
1465
1473
|
removedRows?: undefined;
|
|
1466
1474
|
}>;
|
|
1467
|
-
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, liveIds: suppliedLiveIds, liveAnchorKeys: suppliedLiveAnchorKeys, hydrationGeneration, }?: {
|
|
1475
|
+
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, preparedPresentation, previousPreparedPresentation, liveIds: suppliedLiveIds, liveAnchorKeys: suppliedLiveAnchorKeys, hydrationGeneration, }?: {
|
|
1468
1476
|
pruneStale?: boolean | undefined;
|
|
1469
1477
|
preparedParams?: null | undefined;
|
|
1478
|
+
preparedPresentation?: null | undefined;
|
|
1479
|
+
previousPreparedPresentation?: null | undefined;
|
|
1470
1480
|
liveIds?: null | undefined;
|
|
1471
1481
|
liveAnchorKeys?: null | undefined;
|
|
1472
1482
|
}) => any;
|
|
@@ -1748,9 +1758,11 @@ export const useSuperdocStore: import('pinia').StoreDefinition<"superdoc", Pick<
|
|
|
1748
1758
|
allResolved?: undefined;
|
|
1749
1759
|
removedRows?: undefined;
|
|
1750
1760
|
}>;
|
|
1751
|
-
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, liveIds: suppliedLiveIds, liveAnchorKeys: suppliedLiveAnchorKeys, hydrationGeneration, }?: {
|
|
1761
|
+
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, preparedPresentation, previousPreparedPresentation, liveIds: suppliedLiveIds, liveAnchorKeys: suppliedLiveAnchorKeys, hydrationGeneration, }?: {
|
|
1752
1762
|
pruneStale?: boolean | undefined;
|
|
1753
1763
|
preparedParams?: null | undefined;
|
|
1764
|
+
preparedPresentation?: null | undefined;
|
|
1765
|
+
previousPreparedPresentation?: null | undefined;
|
|
1754
1766
|
liveIds?: null | undefined;
|
|
1755
1767
|
liveAnchorKeys?: null | undefined;
|
|
1756
1768
|
}) => any;
|
|
@@ -2084,9 +2096,11 @@ export const useSuperdocStore: import('pinia').StoreDefinition<"superdoc", Pick<
|
|
|
2084
2096
|
allResolved?: undefined;
|
|
2085
2097
|
removedRows?: undefined;
|
|
2086
2098
|
}>;
|
|
2087
|
-
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, liveIds: suppliedLiveIds, liveAnchorKeys: suppliedLiveAnchorKeys, hydrationGeneration, }?: {
|
|
2099
|
+
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, preparedPresentation, previousPreparedPresentation, liveIds: suppliedLiveIds, liveAnchorKeys: suppliedLiveAnchorKeys, hydrationGeneration, }?: {
|
|
2088
2100
|
pruneStale?: boolean | undefined;
|
|
2089
2101
|
preparedParams?: null | undefined;
|
|
2102
|
+
preparedPresentation?: null | undefined;
|
|
2103
|
+
previousPreparedPresentation?: null | undefined;
|
|
2090
2104
|
liveIds?: null | undefined;
|
|
2091
2105
|
liveAnchorKeys?: null | undefined;
|
|
2092
2106
|
}) => any;
|
|
@@ -2368,9 +2382,11 @@ export const useSuperdocStore: import('pinia').StoreDefinition<"superdoc", Pick<
|
|
|
2368
2382
|
allResolved?: undefined;
|
|
2369
2383
|
removedRows?: undefined;
|
|
2370
2384
|
}>;
|
|
2371
|
-
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, liveIds: suppliedLiveIds, liveAnchorKeys: suppliedLiveAnchorKeys, hydrationGeneration, }?: {
|
|
2385
|
+
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, preparedPresentation, previousPreparedPresentation, liveIds: suppliedLiveIds, liveAnchorKeys: suppliedLiveAnchorKeys, hydrationGeneration, }?: {
|
|
2372
2386
|
pruneStale?: boolean | undefined;
|
|
2373
2387
|
preparedParams?: null | undefined;
|
|
2388
|
+
preparedPresentation?: null | undefined;
|
|
2389
|
+
previousPreparedPresentation?: null | undefined;
|
|
2374
2390
|
liveIds?: null | undefined;
|
|
2375
2391
|
liveAnchorKeys?: null | undefined;
|
|
2376
2392
|
}) => any;
|
|
@@ -2652,9 +2668,11 @@ export const useSuperdocStore: import('pinia').StoreDefinition<"superdoc", Pick<
|
|
|
2652
2668
|
allResolved?: undefined;
|
|
2653
2669
|
removedRows?: undefined;
|
|
2654
2670
|
}>;
|
|
2655
|
-
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, liveIds: suppliedLiveIds, liveAnchorKeys: suppliedLiveAnchorKeys, hydrationGeneration, }?: {
|
|
2671
|
+
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, preparedPresentation, previousPreparedPresentation, liveIds: suppliedLiveIds, liveAnchorKeys: suppliedLiveAnchorKeys, hydrationGeneration, }?: {
|
|
2656
2672
|
pruneStale?: boolean | undefined;
|
|
2657
2673
|
preparedParams?: null | undefined;
|
|
2674
|
+
preparedPresentation?: null | undefined;
|
|
2675
|
+
previousPreparedPresentation?: null | undefined;
|
|
2658
2676
|
liveIds?: null | undefined;
|
|
2659
2677
|
liveAnchorKeys?: null | undefined;
|
|
2660
2678
|
}) => any;
|
package/dist/superdoc.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./chunks/rolldown-runtime-74VwNCz7.cjs");
|
|
3
3
|
const require_blank_docx = require("./chunks/blank-docx-BuFAbRjs.cjs");
|
|
4
|
-
const require_create_super_doc_ui = require("./chunks/create-super-doc-ui-
|
|
4
|
+
const require_create_super_doc_ui = require("./chunks/create-super-doc-ui-DZIB6Pd4.cjs");
|
|
5
5
|
const require_eventemitter3 = require("./chunks/eventemitter3-C_TAnXOl.cjs");
|
|
6
6
|
const require_uuid = require("./chunks/uuid-BhG0ngwk.cjs");
|
|
7
7
|
const require__plugin_vue_export_helper = require("./chunks/_plugin-vue_export-helper-BUdjGKyl.cjs");
|
|
@@ -304,7 +304,7 @@ var awarenessStatesToArray = (context, states) => {
|
|
|
304
304
|
var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
|
|
305
305
|
function getSuperdocVersion() {
|
|
306
306
|
try {
|
|
307
|
-
return "2.25.0-next.
|
|
307
|
+
return "2.25.0-next.18";
|
|
308
308
|
} catch {
|
|
309
309
|
return "unknown";
|
|
310
310
|
}
|
|
@@ -9963,6 +9963,7 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
9963
9963
|
])
|
|
9964
9964
|
].map((value) => normalizeCommentId(value)).filter(Boolean));
|
|
9965
9965
|
patch(() => {
|
|
9966
|
+
const previousPreparedPresentation = committedReviewPresentations.value[normalizedDocumentId] ?? null;
|
|
9966
9967
|
if (preparedReview?.presentation) committedReviewPresentations.value = {
|
|
9967
9968
|
...committedReviewPresentations.value,
|
|
9968
9969
|
[normalizedDocumentId]: preparedReview.presentation
|
|
@@ -9973,6 +9974,8 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
9973
9974
|
documentId: normalizedDocumentId,
|
|
9974
9975
|
items: trackedChangeItems,
|
|
9975
9976
|
preparedParams,
|
|
9977
|
+
preparedPresentation: preparedReview?.presentation ?? null,
|
|
9978
|
+
previousPreparedPresentation,
|
|
9976
9979
|
pruneStale: false
|
|
9977
9980
|
});
|
|
9978
9981
|
reconcileCommentsFromV2({
|
|
@@ -10986,6 +10989,8 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
10986
10989
|
if (!fromId || !toId || fromId === toId) continue;
|
|
10987
10990
|
const comment = commentsList.value.find((row) => matchesRemapSource(row, fromId));
|
|
10988
10991
|
if (!comment) continue;
|
|
10992
|
+
const presentation = committedReviewPresentations.value[normalizedDocumentId];
|
|
10993
|
+
if (normalizeCommentId(comment.fileId) === normalizedDocumentId && presentation && Object.prototype.hasOwnProperty.call(presentation.rowVersions ?? {}, String(comment.commentId))) continue;
|
|
10989
10994
|
const previousCommentId = normalizeCommentId(comment.commentId);
|
|
10990
10995
|
const previousCanonicalId = normalizeCommentId(comment.trackedChangeCanonicalId);
|
|
10991
10996
|
const previousPositionEntry = resolveCommentPositionEntry(comment).entry;
|
|
@@ -11353,7 +11358,7 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
11353
11358
|
}
|
|
11354
11359
|
};
|
|
11355
11360
|
};
|
|
11356
|
-
const reconcileTrackedChangesFromV2 = ({ superdoc, adapter, documentId, items, pruneStale = true, preparedParams = null, liveIds: suppliedLiveIds = null, liveAnchorKeys: suppliedLiveAnchorKeys = null, hydrationGeneration } = {}) => withInteractionSpan("store.trackedChanges.reconcile", "store-reconciliation", {
|
|
11361
|
+
const reconcileTrackedChangesFromV2 = ({ superdoc, adapter, documentId, items, pruneStale = true, preparedParams = null, preparedPresentation = null, previousPreparedPresentation = null, liveIds: suppliedLiveIds = null, liveAnchorKeys: suppliedLiveAnchorKeys = null, hydrationGeneration } = {}) => withInteractionSpan("store.trackedChanges.reconcile", "store-reconciliation", {
|
|
11357
11362
|
documentId: documentId ?? null,
|
|
11358
11363
|
itemCount: Array.isArray(items) ? items.length : null,
|
|
11359
11364
|
pruneStale,
|
|
@@ -11371,6 +11376,22 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
11371
11376
|
try {
|
|
11372
11377
|
for (const params of paramsList) {
|
|
11373
11378
|
if (!params) continue;
|
|
11379
|
+
if (preparedPresentation) {
|
|
11380
|
+
if (preparedPresentation !== committedReviewPresentations.value[String(effectiveDocumentId)]) continue;
|
|
11381
|
+
if (params.documentId != null && String(params.documentId) !== String(effectiveDocumentId)) continue;
|
|
11382
|
+
const id = normalizeCommentId(params.changeId);
|
|
11383
|
+
const version = preparedPresentation.rowVersions?.[id];
|
|
11384
|
+
if (!id || !Number.isSafeInteger(version) || version < 1) continue;
|
|
11385
|
+
const existing = [...trackedChangeIdentityIndex.candidates({ changeId: id })].filter((row) => String(row.fileId) === String(effectiveDocumentId) && String(row.commentId) === id);
|
|
11386
|
+
if (existing.length > 1) continue;
|
|
11387
|
+
const row = existing[0];
|
|
11388
|
+
if (row && row.trackedChangeCanonicalId !== params.trackedChangeCanonicalId) {
|
|
11389
|
+
const previousVersion = previousPreparedPresentation?.rowVersions?.[id];
|
|
11390
|
+
if (!row.trackedChange || params.event !== "add" || typeof params.trackedChangeCanonicalId !== "string" || !params.trackedChangeCanonicalId || !Number.isSafeInteger(previousVersion) || previousVersion < 1 || version <= previousVersion || getTrackedChangeStoryKey(row) !== parseTrackedChangeAnchorKey(params.trackedChangeAnchorKey)?.storyKey || row.trackedChangeType !== params.trackedChangeType || row.trackedChangeDisplayType !== params.trackedChangeDisplayType) continue;
|
|
11391
|
+
row.trackedChangeCanonicalId = params.trackedChangeCanonicalId;
|
|
11392
|
+
row.updateIdentityValues?.({ trackedChangeCanonicalId: params.trackedChangeCanonicalId });
|
|
11393
|
+
}
|
|
11394
|
+
}
|
|
11374
11395
|
if (params.event === "omit") {
|
|
11375
11396
|
if (params.changeId != null) liveIds.add(String(params.changeId));
|
|
11376
11397
|
continue;
|
|
@@ -13419,8 +13440,7 @@ var _hoisted_50 = {
|
|
|
13419
13440
|
var _hoisted_51 = { class: "reply-input-wrapper" };
|
|
13420
13441
|
var _hoisted_52 = { class: "reply-actions" };
|
|
13421
13442
|
var _hoisted_53 = ["disabled", "data-disabled-reason"];
|
|
13422
|
-
var
|
|
13423
|
-
var TRACKED_CHANGE_PREVIEW_MAX_PX = 90;
|
|
13443
|
+
var commentEditSessions = /* @__PURE__ */ new WeakMap();
|
|
13424
13444
|
var _sfc_main$33 = {
|
|
13425
13445
|
__name: "CommentDialog",
|
|
13426
13446
|
props: {
|
|
@@ -13469,12 +13489,17 @@ var _sfc_main$33 = {
|
|
|
13469
13489
|
const { proxy } = require__plugin_vue_export_helper.getCurrentInstance();
|
|
13470
13490
|
const superdocStore = useSuperdocStore();
|
|
13471
13491
|
const commentsStore = useCommentsStore();
|
|
13492
|
+
const editSessionOwner = {};
|
|
13493
|
+
const retireOwnEditSession = () => {
|
|
13494
|
+
if (commentEditSessions.get(commentsStore)?.owner === editSessionOwner) commentEditSessions.delete(commentsStore);
|
|
13495
|
+
};
|
|
13472
13496
|
const { addComment, cancelComment, deleteComment, getCommentAliasIds, removePendingComment, getCommentDocumentId, requestInstantSidebarAlignment, resolveCommentPositionEntry, clearInstantSidebarAlignment, setActiveFloatingCommentInstance } = commentsStore;
|
|
13473
13497
|
const { suppressInternalExternal, getConfig, activeComment, activeFloatingCommentInstanceId, floatingCommentsOffset, pendingComment, currentCommentText, currentCommentMentions, isDebugging, editingCommentId, editorCommentPositions, isCommentHighlighted } = storeToRefs(commentsStore);
|
|
13474
13498
|
const isInternal = require__plugin_vue_export_helper.ref(true);
|
|
13475
13499
|
const commentInput = require__plugin_vue_export_helper.ref(null);
|
|
13476
13500
|
const editCommentInputs = require__plugin_vue_export_helper.ref(/* @__PURE__ */ new Map());
|
|
13477
13501
|
const trackedChangeDecisionFailure = require__plugin_vue_export_helper.ref(null);
|
|
13502
|
+
const CLICK_OUTSIDE_HIT_TOLERANCE_PX = 3;
|
|
13478
13503
|
const CLICK_OUTSIDE_HIT_SAMPLE_OFFSETS = [
|
|
13479
13504
|
[0, 0],
|
|
13480
13505
|
[-3, 0],
|
|
@@ -13482,6 +13507,7 @@ var _sfc_main$33 = {
|
|
|
13482
13507
|
[0, -3],
|
|
13483
13508
|
[0, CLICK_OUTSIDE_HIT_TOLERANCE_PX]
|
|
13484
13509
|
];
|
|
13510
|
+
const TRACKED_CHANGE_PREVIEW_MAX_PX = 90;
|
|
13485
13511
|
const trackedChangeImagePreviewStyle = (preview) => {
|
|
13486
13512
|
const width = typeof preview?.width === "number" && Number.isFinite(preview.width) ? preview.width : null;
|
|
13487
13513
|
const height = typeof preview?.height === "number" && Number.isFinite(preview.height) ? preview.height : null;
|
|
@@ -14243,6 +14269,10 @@ var _sfc_main$33 = {
|
|
|
14243
14269
|
if (commentsAreReadOnly()) return readOnlyMutationOutcome();
|
|
14244
14270
|
switch (value) {
|
|
14245
14271
|
case "edit":
|
|
14272
|
+
commentEditSessions.set(commentsStore, {
|
|
14273
|
+
owner: editSessionOwner,
|
|
14274
|
+
submission: null
|
|
14275
|
+
});
|
|
14246
14276
|
currentCommentText.value = comment?.commentText?.value ?? comment?.commentText ?? "";
|
|
14247
14277
|
currentCommentMentions.value = Array.isArray(comment?.mentions) ? [...comment.mentions] : [];
|
|
14248
14278
|
activeComment.value = props.comment.commentId;
|
|
@@ -14264,12 +14294,23 @@ var _sfc_main$33 = {
|
|
|
14264
14294
|
const handleCommentUpdate = async (comment) => {
|
|
14265
14295
|
if (commentsAreReadOnly()) return readOnlyMutationOutcome();
|
|
14266
14296
|
if (isV2Mode.value && v2CommentsAdapter.value) {
|
|
14297
|
+
const session = commentEditSessions.get(commentsStore);
|
|
14298
|
+
const submission = Symbol("comment-edit-submission");
|
|
14299
|
+
if (session?.owner === editSessionOwner) session.submission = submission;
|
|
14300
|
+
const editor = proxy.$superdoc.activeEditor;
|
|
14301
|
+
const adapter = editor.v2Comments;
|
|
14302
|
+
const documentId = adapter.documentId;
|
|
14303
|
+
const document = editor.doc;
|
|
14304
|
+
const thread = props.comment;
|
|
14305
|
+
const draft = currentCommentText.value;
|
|
14267
14306
|
const outcome = await commentsStore.editCommentV2({
|
|
14268
14307
|
superdoc: proxy.$superdoc,
|
|
14269
14308
|
commentId: comment.commentId,
|
|
14270
|
-
text:
|
|
14309
|
+
text: draft
|
|
14271
14310
|
});
|
|
14272
14311
|
if (!outcome?.ok) return outcome;
|
|
14312
|
+
if (session?.owner !== editSessionOwner || commentEditSessions.get(commentsStore) !== session || session.submission !== submission || proxy.$superdoc.activeEditor !== editor || editor.v2Comments !== adapter || adapter.documentId !== documentId || editor.doc !== document || props.comment !== thread || editingCommentId.value !== comment.commentId || currentCommentText.value !== draft) return outcome;
|
|
14313
|
+
retireOwnEditSession();
|
|
14273
14314
|
editingCommentId.value = null;
|
|
14274
14315
|
removePendingComment(proxy.$superdoc);
|
|
14275
14316
|
return outcome;
|
|
@@ -14300,6 +14341,7 @@ var _sfc_main$33 = {
|
|
|
14300
14341
|
return typeof timestamp === "string" ? new Date(timestamp).getTime() : timestamp;
|
|
14301
14342
|
};
|
|
14302
14343
|
const handleCancel = (comment) => {
|
|
14344
|
+
retireOwnEditSession();
|
|
14303
14345
|
editingCommentId.value = null;
|
|
14304
14346
|
isReplying.value = false;
|
|
14305
14347
|
cancelComment(proxy.$superdoc);
|
|
@@ -14325,6 +14367,7 @@ var _sfc_main$33 = {
|
|
|
14325
14367
|
});
|
|
14326
14368
|
});
|
|
14327
14369
|
require__plugin_vue_export_helper.onBeforeUnmount(() => {
|
|
14370
|
+
retireOwnEditSession();
|
|
14328
14371
|
proxy.$superdoc?.off?.("active-editor-change", refreshActiveEditor);
|
|
14329
14372
|
});
|
|
14330
14373
|
require__plugin_vue_export_helper.watch(showInputSection, (isVisible) => {
|
|
@@ -14574,7 +14617,7 @@ var _sfc_main$33 = {
|
|
|
14574
14617
|
};
|
|
14575
14618
|
}
|
|
14576
14619
|
};
|
|
14577
|
-
var CommentDialog_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$33, [["__scopeId", "data-v-
|
|
14620
|
+
var CommentDialog_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$33, [["__scopeId", "data-v-b16fc5d0"]]);
|
|
14578
14621
|
//#endregion
|
|
14579
14622
|
//#region src/components/CommentsLayer/commentsList/ReviewDirectoryListItem.vue
|
|
14580
14623
|
var _hoisted_1$25 = [
|
|
@@ -15491,6 +15534,7 @@ var _sfc_main$30 = {
|
|
|
15491
15534
|
const sidebarOffsetY = require__plugin_vue_export_helper.ref(0);
|
|
15492
15535
|
const disableInstantLayoutTransitions = require__plugin_vue_export_helper.ref(false);
|
|
15493
15536
|
const directDecisionContinuityTargetId = require__plugin_vue_export_helper.ref(null);
|
|
15537
|
+
const workerDecisionContinuity = require__plugin_vue_export_helper.ref(null);
|
|
15494
15538
|
const viewportRevision = require__plugin_vue_export_helper.ref(0);
|
|
15495
15539
|
const isPendingThread = (commentOrId) => {
|
|
15496
15540
|
const pendingId = pendingComment.value?.commentId;
|
|
@@ -15754,7 +15798,7 @@ var _sfc_main$30 = {
|
|
|
15754
15798
|
resolveCollisions(collisionPositions, activeIndex, 15);
|
|
15755
15799
|
return positions;
|
|
15756
15800
|
});
|
|
15757
|
-
require__plugin_vue_export_helper.
|
|
15801
|
+
const measuredReviewContext = require__plugin_vue_export_helper.computed(() => {
|
|
15758
15802
|
const presentation = committedPresentation.value, container = floatingCommentsContainer.value;
|
|
15759
15803
|
if (!presentation || !container) return null;
|
|
15760
15804
|
viewportRevision.value;
|
|
@@ -15764,7 +15808,11 @@ var _sfc_main$30 = {
|
|
|
15764
15808
|
const stage = typeof presentation.readPaintOrigin === "function" ? presentation.readPaintOrigin() : props.parent?.getBoundingClientRect?.();
|
|
15765
15809
|
if (!stage || !Number.isFinite(stage.left) || !Number.isFinite(stage.top)) return null;
|
|
15766
15810
|
const instances = committedInstances.value ?? [];
|
|
15811
|
+
const captured = workerDecisionContinuity.value;
|
|
15812
|
+
const coordinate = presentation.coordinate;
|
|
15813
|
+
const target = captured && instances.find((instance) => instance.id === captured.request.targetInstanceId);
|
|
15767
15814
|
return {
|
|
15815
|
+
decisionContinuity: captured && coordinate && target && captured.documentId === String(props.currentDocument.id) && captured.documentMode === commentsStore.viewingVisibility?.documentMode && coordinate.documentEpoch === captured.request.documentEpoch && coordinate.mountId === captured.request.mountId && coordinate.commitSequence >= captured.request.commitSequence && coordinate.commitSequence <= captured.request.commitSequence + 1 && target.rowVersion === captured.request.targetRowVersion ? { ...captured.request } : null,
|
|
15768
15816
|
activeThreadId: activeComment.value == null ? null : String(activeComment.value),
|
|
15769
15817
|
activeInstanceId: activeCommentInstanceId.value == null ? null : String(activeCommentInstanceId.value),
|
|
15770
15818
|
editingRowId: editingCommentId.value == null ? null : String(editingCommentId.value),
|
|
@@ -15790,7 +15838,8 @@ var _sfc_main$30 = {
|
|
|
15790
15838
|
height: measuredHeights.value[instance.id]
|
|
15791
15839
|
}))
|
|
15792
15840
|
};
|
|
15793
|
-
}
|
|
15841
|
+
});
|
|
15842
|
+
require__plugin_vue_export_helper.watch(measuredReviewContext, (input) => {
|
|
15794
15843
|
if (input) committedPresentation.value?.updateContext(input);
|
|
15795
15844
|
}, { immediate: true });
|
|
15796
15845
|
const wrapperMinHeight = require__plugin_vue_export_helper.computed(() => {
|
|
@@ -15912,8 +15961,15 @@ var _sfc_main$30 = {
|
|
|
15912
15961
|
directDecisionContinuity = null;
|
|
15913
15962
|
directDecisionSourceId = null;
|
|
15914
15963
|
directDecisionContinuityTargetId.value = null;
|
|
15964
|
+
workerDecisionContinuity.value = null;
|
|
15915
15965
|
setInstantLayoutTransitionsDisabled(false);
|
|
15916
15966
|
};
|
|
15967
|
+
require__plugin_vue_export_helper.watch([
|
|
15968
|
+
() => props.currentDocument?.id,
|
|
15969
|
+
() => committedPresentation.value?.coordinate?.documentEpoch,
|
|
15970
|
+
() => committedPresentation.value?.coordinate?.mountId,
|
|
15971
|
+
() => commentsStore.viewingVisibility?.documentMode
|
|
15972
|
+
], () => releaseDirectDecisionContinuity());
|
|
15917
15973
|
const releaseDirectDecisionContinuityForUnrelatedPointer = (event) => {
|
|
15918
15974
|
if (!directDecisionContinuity) return;
|
|
15919
15975
|
const actionElement = (event?.target instanceof Element ? event.target : null)?.closest?.("[data-comment-action]");
|
|
@@ -16087,6 +16143,27 @@ var _sfc_main$30 = {
|
|
|
16087
16143
|
directDecisionSourceId = removedKey;
|
|
16088
16144
|
directDecisionContinuityTargetId.value = targetKey;
|
|
16089
16145
|
setInstantLayoutTransitionsDisabled(true);
|
|
16146
|
+
const presentation = committedPresentation.value;
|
|
16147
|
+
const coordinate = presentation?.coordinate;
|
|
16148
|
+
const removed = committedInstances.value?.find((instance) => instance.id === removedKey);
|
|
16149
|
+
const target = committedInstances.value?.find((instance) => instance.id === targetKey);
|
|
16150
|
+
const origin = presentation?.readPaintOrigin?.();
|
|
16151
|
+
if (coordinate && typeof coordinate.documentEpoch === "string" && coordinate.documentEpoch && typeof coordinate.mountId === "string" && coordinate.mountId && Number.isSafeInteger(coordinate.commitSequence) && coordinate.commitSequence >= 0 && Number.isSafeInteger(coordinate.reviewVersion) && coordinate.reviewVersion > 0 && removed && target && Number.isSafeInteger(removed.rowVersion) && removed.rowVersion > 0 && Number.isSafeInteger(target.rowVersion) && target.rowVersion > 0 && origin && Number.isFinite(origin.left) && Number.isFinite(origin.top)) {
|
|
16152
|
+
workerDecisionContinuity.value = {
|
|
16153
|
+
documentId: String(props.currentDocument.id),
|
|
16154
|
+
documentMode: commentsStore.viewingVisibility?.documentMode,
|
|
16155
|
+
request: {
|
|
16156
|
+
...coordinate,
|
|
16157
|
+
removedInstanceId: removedKey,
|
|
16158
|
+
removedRowVersion: removed.rowVersion,
|
|
16159
|
+
targetInstanceId: targetKey,
|
|
16160
|
+
targetRowVersion: target.rowVersion,
|
|
16161
|
+
top: targetClientY - floatingCommentsContainer.value.getBoundingClientRect().top
|
|
16162
|
+
}
|
|
16163
|
+
};
|
|
16164
|
+
const input = measuredReviewContext.value;
|
|
16165
|
+
if (input) presentation.updateContext(input);
|
|
16166
|
+
}
|
|
16090
16167
|
};
|
|
16091
16168
|
require__plugin_vue_export_helper.watch(activeCommentInstanceId, (newKey, oldKey) => {
|
|
16092
16169
|
clearDeferredRemeasureTimers();
|
|
@@ -16351,7 +16428,7 @@ var _sfc_main$30 = {
|
|
|
16351
16428
|
};
|
|
16352
16429
|
}
|
|
16353
16430
|
};
|
|
16354
|
-
var FloatingComments_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$30, [["__scopeId", "data-v-
|
|
16431
|
+
var FloatingComments_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$30, [["__scopeId", "data-v-ac790145"]]);
|
|
16355
16432
|
//#endregion
|
|
16356
16433
|
//#region src/components/CommentsLayer/PdfCommentsLayer.vue
|
|
16357
16434
|
var _hoisted_1$22 = {
|
|
@@ -22603,6 +22680,10 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
|
|
|
22603
22680
|
if (!ui) return Promise.resolve(UNAVAILABLE_COMMAND_RESULT);
|
|
22604
22681
|
return require_create_super_doc_ui.executeFirstPartyCommandAsync(ui, commandId, payload);
|
|
22605
22682
|
},
|
|
22683
|
+
executeAfterSelection: (commandId, payload) => {
|
|
22684
|
+
const ui = getSuperDocUI();
|
|
22685
|
+
return ui ? require_create_super_doc_ui.executeFirstPartyShortcutAsync(ui, commandId, payload) : Promise.resolve(UNAVAILABLE_COMMAND_RESULT);
|
|
22686
|
+
},
|
|
22606
22687
|
getState: (commandId) => getSuperDocUI()?.commands.get(commandId).getState() ?? UNAVAILABLE_COMMAND_STATE
|
|
22607
22688
|
},
|
|
22608
22689
|
...openLinkWorkflow ? { openLinkWorkflow } : {}
|
|
@@ -24576,6 +24657,11 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
|
|
|
24576
24657
|
const activeDocumentId = getActiveV2DocumentId();
|
|
24577
24658
|
const stage = activeDocumentId == null ? latestV2MountStage : v2MountStagesByDocumentId.get(String(activeDocumentId)) ?? null;
|
|
24578
24659
|
if (!stage?.isConnected) return null;
|
|
24660
|
+
const workerRoots = stage.querySelectorAll("[data-sd-worker-dom-root]");
|
|
24661
|
+
if (workerRoots.length) {
|
|
24662
|
+
if (workerRoots.length !== 1) return null;
|
|
24663
|
+
return workerRoots[0].querySelector(`.superdoc-page[data-worker-page-id][data-page-index="${v2RulerActivePageIndex}"]`)?.getBoundingClientRect() ?? null;
|
|
24664
|
+
}
|
|
24579
24665
|
const wrapper = Array.from(stage.children).find((element) => element.dataset?.v2PaintWrapper === "true") ?? stage;
|
|
24580
24666
|
const pages = Array.from(wrapper.children).filter((element) => element.classList?.contains("superdoc-page"));
|
|
24581
24667
|
return (pages.find((element) => Number(element.dataset?.pageIndex) === v2RulerActivePageIndex) ?? pages[0] ?? wrapper).getBoundingClientRect();
|
|
@@ -24943,7 +25029,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
|
|
|
24943
25029
|
], 46, _hoisted_1$17);
|
|
24944
25030
|
};
|
|
24945
25031
|
}
|
|
24946
|
-
}, [["__scopeId", "data-v-
|
|
25032
|
+
}, [["__scopeId", "data-v-a5d7d136"]]);
|
|
24947
25033
|
//#endregion
|
|
24948
25034
|
//#region src/core/create-app.js
|
|
24949
25035
|
var PINIA_DEVTOOLS_SETUP_EVENT = "devtools-plugin:setup";
|
|
@@ -46758,7 +46844,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
|
|
|
46758
46844
|
}
|
|
46759
46845
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
46760
46846
|
this.colorIndex = 0;
|
|
46761
|
-
this.version = "2.25.0-next.
|
|
46847
|
+
this.version = "2.25.0-next.18";
|
|
46762
46848
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
46763
46849
|
this.superdocId = config.superdocId || require_uuid.v4();
|
|
46764
46850
|
this.colors = this.config.colors ?? [];
|