@beyondwork/docx-react-component 1.0.66 → 1.0.67
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/package.json +1 -1
- package/src/io/docx-session.ts +9 -7
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beyondwork/docx-react-component",
|
|
3
3
|
"publisher": "beyondwork",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.67",
|
|
5
5
|
"description": "Embeddable React Word (docx) editor with review, comments, tracked changes, and round-trip OOXML fidelity.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": [
|
package/src/io/docx-session.ts
CHANGED
|
@@ -333,7 +333,7 @@ interface ImportedDocxState {
|
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
-
interface NormalizedImportedCommentsResult extends ParsedCommentsResult {
|
|
336
|
+
export interface NormalizedImportedCommentsResult extends ParsedCommentsResult {
|
|
337
337
|
preservedDefinitions: readonly ImportedCommentDefinition[];
|
|
338
338
|
}
|
|
339
339
|
|
|
@@ -3179,22 +3179,24 @@ function normalizeImportedRevisionRecords(
|
|
|
3179
3179
|
};
|
|
3180
3180
|
}
|
|
3181
3181
|
|
|
3182
|
-
function normalizeImportedCommentThreads(
|
|
3182
|
+
export function normalizeImportedCommentThreads(
|
|
3183
3183
|
parsed: ParsedCommentsResult,
|
|
3184
3184
|
opaqueFragments: Record<string, OpaqueFragmentRecord>,
|
|
3185
3185
|
revisions: readonly ReviewRevisionRecord[],
|
|
3186
3186
|
): NormalizedImportedCommentsResult {
|
|
3187
3187
|
const opaqueRanges = Object.values(opaqueFragments).map((fragment) => fragment.lastKnownRange);
|
|
3188
|
+
// Use getRevisionActionability() — not the raw preserveOnlyReason flag — so
|
|
3189
|
+
// Lane 7b-promoted shapes (cellIns/cellDel/cellMerge, linked-pair moves) that
|
|
3190
|
+
// still carry a default preserveOnlyReason aren't treated as preserve-only
|
|
3191
|
+
// for comment-anchor detachment. See revision-types.ts:192-200.
|
|
3188
3192
|
const preserveOnlyRevisionRanges = revisions.flatMap((revision) => {
|
|
3189
|
-
const { anchor } = revision;
|
|
3190
3193
|
if (
|
|
3191
|
-
anchor.kind !== "range" ||
|
|
3192
|
-
|
|
3193
|
-
revision.metadata.preserveOnlyReason.length === 0
|
|
3194
|
+
revision.anchor.kind !== "range" ||
|
|
3195
|
+
getRevisionActionability(revision) !== "preserve-only"
|
|
3194
3196
|
) {
|
|
3195
3197
|
return [];
|
|
3196
3198
|
}
|
|
3197
|
-
return [anchor.range];
|
|
3199
|
+
return [revision.anchor.range];
|
|
3198
3200
|
});
|
|
3199
3201
|
const preserveOnlyCommentIds = new Set(parsed.diagnostics.map((diagnostic) => diagnostic.commentId));
|
|
3200
3202
|
const additionalDiagnostics: CommentImportDiagnostic[] = [];
|