@superdoc-dev/mcp 0.11.0-next.7 → 0.11.0-next.8
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/index.js +211 -38
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -52211,7 +52211,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
|
|
|
52211
52211
|
emptyOptions2 = {};
|
|
52212
52212
|
});
|
|
52213
52213
|
|
|
52214
|
-
// ../../packages/superdoc/dist/chunks/SuperConverter-
|
|
52214
|
+
// ../../packages/superdoc/dist/chunks/SuperConverter-DBsJeu9t.es.js
|
|
52215
52215
|
function getExtensionConfigField(extension$1, field, context = { name: "" }) {
|
|
52216
52216
|
const fieldValue = extension$1.config[field];
|
|
52217
52217
|
if (typeof fieldValue === "function")
|
|
@@ -111839,6 +111839,44 @@ var isRegExp = (value) => {
|
|
|
111839
111839
|
...comment,
|
|
111840
111840
|
commentParaId: generateDocxRandomId()
|
|
111841
111841
|
};
|
|
111842
|
+
}, getCommentIds = (comment) => {
|
|
111843
|
+
if (!comment)
|
|
111844
|
+
return [];
|
|
111845
|
+
return [
|
|
111846
|
+
comment.commentId,
|
|
111847
|
+
comment.importedId,
|
|
111848
|
+
comment.internalId
|
|
111849
|
+
].filter((id) => id != null).map((id) => String(id));
|
|
111850
|
+
}, buildCommentLookup = (comments = []) => {
|
|
111851
|
+
const byId = /* @__PURE__ */ new Map;
|
|
111852
|
+
for (const comment of comments)
|
|
111853
|
+
getCommentIds(comment).forEach((id) => byId.set(id, comment));
|
|
111854
|
+
return byId;
|
|
111855
|
+
}, findCommentById = (comments = [], id) => {
|
|
111856
|
+
if (id == null)
|
|
111857
|
+
return null;
|
|
111858
|
+
return buildCommentLookup(comments).get(String(id)) || null;
|
|
111859
|
+
}, isCommentResolvedInThread = (comment, allComments = []) => {
|
|
111860
|
+
const isDone = (c$1) => Boolean(c$1?.resolvedTime || c$1?.isDone);
|
|
111861
|
+
if (isDone(comment))
|
|
111862
|
+
return true;
|
|
111863
|
+
const byId = buildCommentLookup(allComments);
|
|
111864
|
+
const seen = /* @__PURE__ */ new Set;
|
|
111865
|
+
let current = comment;
|
|
111866
|
+
while (current) {
|
|
111867
|
+
const parentId = current.threadingParentCommentId || current.parentCommentId;
|
|
111868
|
+
const parentKey = parentId != null ? String(parentId) : null;
|
|
111869
|
+
if (parentKey == null || seen.has(parentKey))
|
|
111870
|
+
break;
|
|
111871
|
+
seen.add(parentKey);
|
|
111872
|
+
const parent = byId.get(parentKey);
|
|
111873
|
+
if (!parent)
|
|
111874
|
+
break;
|
|
111875
|
+
if (isDone(parent))
|
|
111876
|
+
return true;
|
|
111877
|
+
current = parent;
|
|
111878
|
+
}
|
|
111879
|
+
return false;
|
|
111842
111880
|
}, getCommentDefinition = (comment, commentId, allComments, editor) => {
|
|
111843
111881
|
const translatedParagraphs = (Array.isArray(comment.commentJSON) ? comment.commentJSON : comment.commentJSON ? [comment.commentJSON] : []).map((node2) => translator.decode({
|
|
111844
111882
|
editor,
|
|
@@ -111849,7 +111887,7 @@ var isRegExp = (value) => {
|
|
|
111849
111887
|
"w:author": comment.creatorName || comment.importedAuthor?.name,
|
|
111850
111888
|
"w:date": toIsoNoFractional(comment.createdTime),
|
|
111851
111889
|
"w:initials": getInitials(comment.creatorName),
|
|
111852
|
-
"w:done": comment
|
|
111890
|
+
"w:done": isCommentResolvedInThread(comment, allComments) ? "1" : "0",
|
|
111853
111891
|
"w15:paraId": comment.commentParaId,
|
|
111854
111892
|
"custom:internalId": comment.commentId || comment.internalId,
|
|
111855
111893
|
"custom:trackedChange": comment.trackedChange,
|
|
@@ -111860,7 +111898,7 @@ var isRegExp = (value) => {
|
|
|
111860
111898
|
"custom:email": comment.creatorEmail || comment.importedAuthor?.email
|
|
111861
111899
|
};
|
|
111862
111900
|
if (comment?.parentCommentId) {
|
|
111863
|
-
const parentComment = allComments
|
|
111901
|
+
const parentComment = findCommentById(allComments, comment.parentCommentId);
|
|
111864
111902
|
if (parentComment && !parentComment.trackedChange)
|
|
111865
111903
|
attributes["w15:paraIdParent"] = parentComment.commentParaId;
|
|
111866
111904
|
}
|
|
@@ -111936,7 +111974,7 @@ var isRegExp = (value) => {
|
|
|
111936
111974
|
return null;
|
|
111937
111975
|
const xmlCopy = carbonCopy(commentsExtendedXml);
|
|
111938
111976
|
const commentsEx = comments.map((comment) => {
|
|
111939
|
-
const isResolved = comment
|
|
111977
|
+
const isResolved = isCommentResolvedInThread(comment, comments);
|
|
111940
111978
|
const attributes = {
|
|
111941
111979
|
"w15:paraId": comment.commentParaId,
|
|
111942
111980
|
"w15:done": isResolved ? "1" : "0"
|
|
@@ -111944,7 +111982,7 @@ var isRegExp = (value) => {
|
|
|
111944
111982
|
const parentId = comment.threadingParentCommentId || comment.parentCommentId;
|
|
111945
111983
|
const threadingStyle = resolveThreadingStyle(comment, profile);
|
|
111946
111984
|
if (parentId && (threadingStyle === "commentsExtended" || shouldIncludeForThreads)) {
|
|
111947
|
-
const parentComment = comments
|
|
111985
|
+
const parentComment = findCommentById(comments, parentId);
|
|
111948
111986
|
const allowTrackedParent = profile?.defaultStyle === "commentsExtended";
|
|
111949
111987
|
if (parentComment && (allowTrackedParent || !parentComment.trackedChange))
|
|
111950
111988
|
attributes["w15:paraIdParent"] = parentComment.commentParaId;
|
|
@@ -115551,7 +115589,7 @@ var isRegExp = (value) => {
|
|
|
115551
115589
|
state.kern = kernNode.attributes["w:val"];
|
|
115552
115590
|
}
|
|
115553
115591
|
}, SuperConverter;
|
|
115554
|
-
var
|
|
115592
|
+
var init_SuperConverter_DBsJeu9t_es = __esm(() => {
|
|
115555
115593
|
init_rolldown_runtime_Bg48TavK_es();
|
|
115556
115594
|
init_jszip_C49i9kUs_es();
|
|
115557
115595
|
init_xml_js_CqGKpaft_es();
|
|
@@ -154586,7 +154624,7 @@ var init_SuperConverter_7JlFliK8_es = __esm(() => {
|
|
|
154586
154624
|
};
|
|
154587
154625
|
});
|
|
154588
154626
|
|
|
154589
|
-
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-
|
|
154627
|
+
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-BiY_0zZP.es.js
|
|
154590
154628
|
function parseSizeUnit(val = "0") {
|
|
154591
154629
|
const length = val.toString() || "0";
|
|
154592
154630
|
const value = Number.parseFloat(length);
|
|
@@ -164919,8 +164957,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
|
|
|
164919
164957
|
}
|
|
164920
164958
|
};
|
|
164921
164959
|
};
|
|
164922
|
-
var
|
|
164923
|
-
|
|
164960
|
+
var init_create_headless_toolbar_BiY_0zZP_es = __esm(() => {
|
|
164961
|
+
init_SuperConverter_DBsJeu9t_es();
|
|
164924
164962
|
init_uuid_qzgm05fK_es();
|
|
164925
164963
|
init_constants_D9qj59G2_es();
|
|
164926
164964
|
init_dist_B8HfvhaK_es();
|
|
@@ -219604,7 +219642,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
219604
219642
|
init_remark_gfm_BhnWr3yf_es();
|
|
219605
219643
|
});
|
|
219606
219644
|
|
|
219607
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
219645
|
+
// ../../packages/superdoc/dist/chunks/src-DYT7-l3i.es.js
|
|
219608
219646
|
function deleteProps(obj, propOrProps) {
|
|
219609
219647
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
219610
219648
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -281524,28 +281562,61 @@ var Node$13 = class Node$14 {
|
|
|
281524
281562
|
ranges
|
|
281525
281563
|
};
|
|
281526
281564
|
}, resolveCommentById = ({ commentId, importedId, state, tr, dispatch }) => {
|
|
281565
|
+
const converted = resolveCommentsInTr({
|
|
281566
|
+
items: [{
|
|
281567
|
+
commentId,
|
|
281568
|
+
importedId
|
|
281569
|
+
}],
|
|
281570
|
+
state,
|
|
281571
|
+
tr
|
|
281572
|
+
});
|
|
281573
|
+
if (converted)
|
|
281574
|
+
dispatch(tr);
|
|
281575
|
+
return converted;
|
|
281576
|
+
}, resolveCommentsInTr = ({ items = [], state, tr }) => {
|
|
281527
281577
|
const { schema } = state;
|
|
281528
281578
|
const markType = schema.marks?.[CommentMarkName];
|
|
281529
281579
|
if (!markType)
|
|
281530
281580
|
return false;
|
|
281531
|
-
const { segments, ranges } = getCommentMarkRangesById(commentId, state.doc, importedId);
|
|
281532
|
-
if (!segments.length)
|
|
281533
|
-
return false;
|
|
281534
|
-
segments.forEach(({ from: from$1, to, attrs }) => {
|
|
281535
|
-
tr.removeMark(from$1, to, markType.create(attrs));
|
|
281536
|
-
});
|
|
281537
281581
|
const startType = schema.nodes?.commentRangeStart;
|
|
281538
281582
|
const endType = schema.nodes?.commentRangeEnd;
|
|
281539
|
-
|
|
281540
|
-
|
|
281541
|
-
|
|
281542
|
-
|
|
281583
|
+
const insertions = [];
|
|
281584
|
+
const seen = /* @__PURE__ */ new Set;
|
|
281585
|
+
let converted = false;
|
|
281586
|
+
for (const item of items) {
|
|
281587
|
+
if (!item)
|
|
281588
|
+
continue;
|
|
281589
|
+
const { commentId, importedId } = item;
|
|
281590
|
+
if (commentId == null)
|
|
281591
|
+
continue;
|
|
281592
|
+
const key2 = `${commentId}:${importedId ?? ""}`;
|
|
281593
|
+
if (seen.has(key2))
|
|
281594
|
+
continue;
|
|
281595
|
+
seen.add(key2);
|
|
281596
|
+
const { segments, ranges } = getCommentMarkRangesById(commentId, state.doc, importedId);
|
|
281597
|
+
if (!segments.length)
|
|
281598
|
+
continue;
|
|
281599
|
+
converted = true;
|
|
281600
|
+
segments.forEach(({ from: from$1, to, attrs }) => {
|
|
281601
|
+
tr.removeMark(from$1, to, markType.create(attrs));
|
|
281602
|
+
});
|
|
281603
|
+
if (startType && endType && item.preserveAnchor !== false)
|
|
281604
|
+
ranges.forEach(({ from: from$1, to, internal }) => insertions.push({
|
|
281605
|
+
from: from$1,
|
|
281606
|
+
to,
|
|
281607
|
+
internal,
|
|
281608
|
+
commentId
|
|
281609
|
+
}));
|
|
281610
|
+
}
|
|
281611
|
+
if (startType && endType && insertions.length)
|
|
281612
|
+
insertions.sort((a2, b$1) => b$1.from - a2.from || b$1.to - a2.to).forEach(({ from: from$1, to, internal, commentId }) => {
|
|
281613
|
+
tr.insert(tr.mapping.map(to), endType.create({ "w:id": commentId }));
|
|
281614
|
+
tr.insert(tr.mapping.map(from$1), startType.create({
|
|
281543
281615
|
"w:id": commentId,
|
|
281544
281616
|
internal
|
|
281545
281617
|
}));
|
|
281546
281618
|
});
|
|
281547
|
-
|
|
281548
|
-
return true;
|
|
281619
|
+
return converted;
|
|
281549
281620
|
}, getCommentRangeAnchorsById = (commentId, doc$12, importedId) => {
|
|
281550
281621
|
const anchors = [];
|
|
281551
281622
|
doc$12.descendants((node2, pos) => {
|
|
@@ -281840,6 +281911,60 @@ var Node$13 = class Node$14 {
|
|
|
281840
281911
|
});
|
|
281841
281912
|
});
|
|
281842
281913
|
}
|
|
281914
|
+
const nodeAnchorsById = /* @__PURE__ */ new Map;
|
|
281915
|
+
doc$12.descendants((node2, pos) => {
|
|
281916
|
+
const typeName = node2.type?.name;
|
|
281917
|
+
if (typeName !== "commentRangeStart" && typeName !== "commentRangeEnd")
|
|
281918
|
+
return;
|
|
281919
|
+
const anchorId = node2.attrs?.["w:id"];
|
|
281920
|
+
if (anchorId == null)
|
|
281921
|
+
return;
|
|
281922
|
+
const entry = nodeAnchorsById.get(anchorId) || {};
|
|
281923
|
+
if (typeName === "commentRangeStart")
|
|
281924
|
+
entry.startPos = pos;
|
|
281925
|
+
else
|
|
281926
|
+
entry.endPos = pos;
|
|
281927
|
+
nodeAnchorsById.set(anchorId, entry);
|
|
281928
|
+
});
|
|
281929
|
+
const isRepresented = (c) => seen.has(c.commentId) || c.importedId != null && seen.has(c.importedId) || nodeAnchorsById.has(c.commentId) || c.importedId != null && nodeAnchorsById.has(c.importedId);
|
|
281930
|
+
const findAncestorNodeAnchor = (comment2) => {
|
|
281931
|
+
let current = comment2;
|
|
281932
|
+
const visited = /* @__PURE__ */ new Set;
|
|
281933
|
+
while (current) {
|
|
281934
|
+
const parentId = getThreadingParentId(current);
|
|
281935
|
+
if (parentId == null || visited.has(parentId))
|
|
281936
|
+
return null;
|
|
281937
|
+
visited.add(parentId);
|
|
281938
|
+
const parent = commentMap.get(parentId) || comments.find((c) => c.importedId === parentId || c.commentId === parentId);
|
|
281939
|
+
const anchor = nodeAnchorsById.get(parentId) ?? (parent ? nodeAnchorsById.get(parent.commentId) ?? nodeAnchorsById.get(parent.importedId) : undefined);
|
|
281940
|
+
if (anchor?.startPos != null && anchor?.endPos != null)
|
|
281941
|
+
return anchor;
|
|
281942
|
+
current = parent;
|
|
281943
|
+
}
|
|
281944
|
+
return null;
|
|
281945
|
+
};
|
|
281946
|
+
comments.filter((c) => !c.trackedChange && c.commentId != null && !isRepresented(c)).sort((a2, b$1) => (a2.createdTime || 0) - (b$1.createdTime || 0)).forEach((c) => {
|
|
281947
|
+
const anchor = findAncestorNodeAnchor(c);
|
|
281948
|
+
if (!anchor)
|
|
281949
|
+
return;
|
|
281950
|
+
seen.add(c.commentId);
|
|
281951
|
+
const childAttrs = getPreparedComment({
|
|
281952
|
+
commentId: c.commentId,
|
|
281953
|
+
internal: c.isInternal
|
|
281954
|
+
});
|
|
281955
|
+
startNodes.push({
|
|
281956
|
+
pos: anchor.startPos + 1,
|
|
281957
|
+
node: schema.nodes.commentRangeStart.create(childAttrs),
|
|
281958
|
+
commentId: c.commentId,
|
|
281959
|
+
parentCommentId: getThreadingParentId(c)
|
|
281960
|
+
});
|
|
281961
|
+
endNodes.push({
|
|
281962
|
+
pos: anchor.endPos + 1,
|
|
281963
|
+
node: schema.nodes.commentRangeEnd.create(childAttrs),
|
|
281964
|
+
commentId: c.commentId,
|
|
281965
|
+
parentCommentId: getThreadingParentId(c)
|
|
281966
|
+
});
|
|
281967
|
+
});
|
|
281843
281968
|
startNodes.sort((a2, b$1) => {
|
|
281844
281969
|
if (a2.pos !== b$1.pos)
|
|
281845
281970
|
return a2.pos - b$1.pos;
|
|
@@ -315653,13 +315778,13 @@ menclose::after {
|
|
|
315653
315778
|
return;
|
|
315654
315779
|
console.log(...args$1);
|
|
315655
315780
|
}, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions, TRACKED_MARK_NAMES;
|
|
315656
|
-
var
|
|
315781
|
+
var init_src_DYT7_l3i_es = __esm(() => {
|
|
315657
315782
|
init_rolldown_runtime_Bg48TavK_es();
|
|
315658
|
-
|
|
315783
|
+
init_SuperConverter_DBsJeu9t_es();
|
|
315659
315784
|
init_jszip_C49i9kUs_es();
|
|
315660
315785
|
init_xml_js_CqGKpaft_es();
|
|
315661
315786
|
init_uuid_qzgm05fK_es();
|
|
315662
|
-
|
|
315787
|
+
init_create_headless_toolbar_BiY_0zZP_es();
|
|
315663
315788
|
init_constants_D9qj59G2_es();
|
|
315664
315789
|
init_dist_B8HfvhaK_es();
|
|
315665
315790
|
init_unified_Dsuw2be5_es();
|
|
@@ -318740,6 +318865,17 @@ ${err.toString()}`);
|
|
|
318740
318865
|
dispatch
|
|
318741
318866
|
});
|
|
318742
318867
|
},
|
|
318868
|
+
resolveCommentThread: ({ comments } = {}) => ({ tr, dispatch, state }) => {
|
|
318869
|
+
tr.setMeta(CommentsPluginKey, { event: "update" });
|
|
318870
|
+
const converted = resolveCommentsInTr({
|
|
318871
|
+
items: comments,
|
|
318872
|
+
state,
|
|
318873
|
+
tr
|
|
318874
|
+
});
|
|
318875
|
+
if (converted)
|
|
318876
|
+
dispatch(tr);
|
|
318877
|
+
return converted;
|
|
318878
|
+
},
|
|
318743
318879
|
reopenComment: ({ commentId, importedId, internal }) => ({ tr, dispatch, state }) => {
|
|
318744
318880
|
tr.setMeta(CommentsPluginKey, { event: "update" });
|
|
318745
318881
|
return reopenCommentById({
|
|
@@ -342563,7 +342699,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
342563
342699
|
cambria: "Caladea",
|
|
342564
342700
|
arial: "Liberation Sans",
|
|
342565
342701
|
"times new roman": "Liberation Serif",
|
|
342566
|
-
"courier new": "Liberation Mono"
|
|
342702
|
+
"courier new": "Liberation Mono",
|
|
342703
|
+
helvetica: "Liberation Sans"
|
|
342567
342704
|
});
|
|
342568
342705
|
defaultResolver = new FontResolver;
|
|
342569
342706
|
DEFAULT_FONT_MEASURE_CONTEXT = Object.freeze({
|
|
@@ -350392,11 +350529,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
350392
350529
|
]);
|
|
350393
350530
|
});
|
|
350394
350531
|
|
|
350395
|
-
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-
|
|
350532
|
+
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-k5vyPmpN.es.js
|
|
350396
350533
|
var MOD_ALIASES, ALT_ALIASES, CTRL_ALIASES, SHIFT_ALIASES, BUILTIN_CONTEXT_MENU_GROUPS, BUILTIN_GROUP_ORDER, RESERVED_PROXY_PROPERTY_NAMES, ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS;
|
|
350397
|
-
var
|
|
350398
|
-
|
|
350399
|
-
|
|
350534
|
+
var init_create_super_doc_ui_k5vyPmpN_es = __esm(() => {
|
|
350535
|
+
init_SuperConverter_DBsJeu9t_es();
|
|
350536
|
+
init_create_headless_toolbar_BiY_0zZP_es();
|
|
350400
350537
|
MOD_ALIASES = new Set([
|
|
350401
350538
|
"Mod",
|
|
350402
350539
|
"Meta",
|
|
@@ -350438,16 +350575,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
|
|
|
350438
350575
|
|
|
350439
350576
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
350440
350577
|
var init_super_editor_es = __esm(() => {
|
|
350441
|
-
|
|
350442
|
-
|
|
350578
|
+
init_src_DYT7_l3i_es();
|
|
350579
|
+
init_SuperConverter_DBsJeu9t_es();
|
|
350443
350580
|
init_jszip_C49i9kUs_es();
|
|
350444
350581
|
init_xml_js_CqGKpaft_es();
|
|
350445
|
-
|
|
350582
|
+
init_create_headless_toolbar_BiY_0zZP_es();
|
|
350446
350583
|
init_constants_D9qj59G2_es();
|
|
350447
350584
|
init_dist_B8HfvhaK_es();
|
|
350448
350585
|
init_unified_Dsuw2be5_es();
|
|
350449
350586
|
init_DocxZipper_Bu2Fhqkw_es();
|
|
350450
|
-
|
|
350587
|
+
init_create_super_doc_ui_k5vyPmpN_es();
|
|
350451
350588
|
init_ui_C5PAS9hY_es();
|
|
350452
350589
|
init_eventemitter3_BnGqBE_Q_es();
|
|
350453
350590
|
init_errors_CNaD6vcg_es();
|
|
@@ -450924,6 +451061,42 @@ var prepareCommentParaIds2 = (comment2) => {
|
|
|
450924
451061
|
commentParaId: generateDocxRandomId2()
|
|
450925
451062
|
};
|
|
450926
451063
|
return newComment;
|
|
451064
|
+
}, getCommentIds2 = (comment2) => {
|
|
451065
|
+
if (!comment2)
|
|
451066
|
+
return [];
|
|
451067
|
+
return [comment2.commentId, comment2.importedId, comment2.internalId].filter((id2) => id2 != null).map((id2) => String(id2));
|
|
451068
|
+
}, buildCommentLookup2 = (comments = []) => {
|
|
451069
|
+
const byId = new Map;
|
|
451070
|
+
for (const comment2 of comments) {
|
|
451071
|
+
getCommentIds2(comment2).forEach((id2) => byId.set(id2, comment2));
|
|
451072
|
+
}
|
|
451073
|
+
return byId;
|
|
451074
|
+
}, findCommentById2 = (comments = [], id2) => {
|
|
451075
|
+
if (id2 == null)
|
|
451076
|
+
return null;
|
|
451077
|
+
const lookup3 = buildCommentLookup2(comments);
|
|
451078
|
+
return lookup3.get(String(id2)) || null;
|
|
451079
|
+
}, isCommentResolvedInThread2 = (comment2, allComments = []) => {
|
|
451080
|
+
const isDone = (c) => Boolean(c?.resolvedTime || c?.isDone);
|
|
451081
|
+
if (isDone(comment2))
|
|
451082
|
+
return true;
|
|
451083
|
+
const byId = buildCommentLookup2(allComments);
|
|
451084
|
+
const seen = new Set;
|
|
451085
|
+
let current = comment2;
|
|
451086
|
+
while (current) {
|
|
451087
|
+
const parentId = current.threadingParentCommentId || current.parentCommentId;
|
|
451088
|
+
const parentKey = parentId != null ? String(parentId) : null;
|
|
451089
|
+
if (parentKey == null || seen.has(parentKey))
|
|
451090
|
+
break;
|
|
451091
|
+
seen.add(parentKey);
|
|
451092
|
+
const parent = byId.get(parentKey);
|
|
451093
|
+
if (!parent)
|
|
451094
|
+
break;
|
|
451095
|
+
if (isDone(parent))
|
|
451096
|
+
return true;
|
|
451097
|
+
current = parent;
|
|
451098
|
+
}
|
|
451099
|
+
return false;
|
|
450927
451100
|
}, getCommentDefinition2 = (comment2, commentId, allComments, editor) => {
|
|
450928
451101
|
const nodes = Array.isArray(comment2.commentJSON) ? comment2.commentJSON : comment2.commentJSON ? [comment2.commentJSON] : [];
|
|
450929
451102
|
const translatedParagraphs = nodes.map((node4) => translator121.decode({ editor, node: node4 })).filter(Boolean);
|
|
@@ -450932,7 +451105,7 @@ var prepareCommentParaIds2 = (comment2) => {
|
|
|
450932
451105
|
"w:author": comment2.creatorName || comment2.importedAuthor?.name,
|
|
450933
451106
|
"w:date": toIsoNoFractional2(comment2.createdTime),
|
|
450934
451107
|
"w:initials": getInitials2(comment2.creatorName),
|
|
450935
|
-
"w:done": comment2
|
|
451108
|
+
"w:done": isCommentResolvedInThread2(comment2, allComments) ? "1" : "0",
|
|
450936
451109
|
"w15:paraId": comment2.commentParaId,
|
|
450937
451110
|
"custom:internalId": comment2.commentId || comment2.internalId,
|
|
450938
451111
|
"custom:trackedChange": comment2.trackedChange,
|
|
@@ -450943,7 +451116,7 @@ var prepareCommentParaIds2 = (comment2) => {
|
|
|
450943
451116
|
"custom:email": comment2.creatorEmail || comment2.importedAuthor?.email
|
|
450944
451117
|
};
|
|
450945
451118
|
if (comment2?.parentCommentId) {
|
|
450946
|
-
const parentComment = allComments
|
|
451119
|
+
const parentComment = findCommentById2(allComments, comment2.parentCommentId);
|
|
450947
451120
|
if (parentComment && !parentComment.trackedChange) {
|
|
450948
451121
|
attributes["w15:paraIdParent"] = parentComment.commentParaId;
|
|
450949
451122
|
}
|
|
@@ -451028,7 +451201,7 @@ var prepareCommentParaIds2 = (comment2) => {
|
|
|
451028
451201
|
}
|
|
451029
451202
|
const xmlCopy = carbonCopy2(commentsExtendedXml);
|
|
451030
451203
|
const commentsEx = comments.map((comment2) => {
|
|
451031
|
-
const isResolved = comment2
|
|
451204
|
+
const isResolved = isCommentResolvedInThread2(comment2, comments);
|
|
451032
451205
|
const attributes = {
|
|
451033
451206
|
"w15:paraId": comment2.commentParaId,
|
|
451034
451207
|
"w15:done": isResolved ? "1" : "0"
|
|
@@ -451036,7 +451209,7 @@ var prepareCommentParaIds2 = (comment2) => {
|
|
|
451036
451209
|
const parentId = comment2.threadingParentCommentId || comment2.parentCommentId;
|
|
451037
451210
|
const threadingStyle = resolveThreadingStyle2(comment2, profile);
|
|
451038
451211
|
if (parentId && (threadingStyle === "commentsExtended" || shouldIncludeForThreads)) {
|
|
451039
|
-
const parentComment = comments
|
|
451212
|
+
const parentComment = findCommentById2(comments, parentId);
|
|
451040
451213
|
const allowTrackedParent = profile?.defaultStyle === "commentsExtended";
|
|
451041
451214
|
if (parentComment && (allowTrackedParent || !parentComment.trackedChange)) {
|
|
451042
451215
|
attributes["w15:paraIdParent"] = parentComment.commentParaId;
|