ooxml-core 1.12.0 → 1.12.1
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/docx/ui/index.cjs
CHANGED
|
@@ -9420,6 +9420,15 @@ function resolveSectionPartRevisions(doc, mode) {
|
|
|
9420
9420
|
}
|
|
9421
9421
|
|
|
9422
9422
|
// docx/ui/review-commands.ts
|
|
9423
|
+
var reviewQueries = /* @__PURE__ */ new WeakMap();
|
|
9424
|
+
function reviewQuery(doc) {
|
|
9425
|
+
let cached2 = reviewQueries.get(doc);
|
|
9426
|
+
if (!cached2) {
|
|
9427
|
+
cached2 = { ranges: collectRevisionRanges(doc) };
|
|
9428
|
+
reviewQueries.set(doc, cached2);
|
|
9429
|
+
}
|
|
9430
|
+
return cached2;
|
|
9431
|
+
}
|
|
9423
9432
|
function collectRevisionRanges(doc) {
|
|
9424
9433
|
const ranges = [];
|
|
9425
9434
|
doc.descendants((node, pos) => {
|
|
@@ -9475,13 +9484,16 @@ function collectRevisionRanges(doc) {
|
|
|
9475
9484
|
return ranges.sort((a, b) => a.from - b.from);
|
|
9476
9485
|
}
|
|
9477
9486
|
function revisionNear(view) {
|
|
9478
|
-
const ranges =
|
|
9487
|
+
const { ranges } = reviewQuery(view.state.doc);
|
|
9479
9488
|
const { from, to } = view.state.selection;
|
|
9480
9489
|
return ranges.find((range) => range.from < to && range.to > from) ?? ranges.find((r) => r.from >= to);
|
|
9481
9490
|
}
|
|
9482
9491
|
function hasAnyChange(view) {
|
|
9483
|
-
return
|
|
9484
|
-
|
|
9492
|
+
if (!view) return false;
|
|
9493
|
+
const doc = view.state.doc;
|
|
9494
|
+
const cached2 = reviewQuery(doc);
|
|
9495
|
+
return cached2.anyChange ??= Boolean(
|
|
9496
|
+
cached2.ranges.length || hasNoteRevisions(doc) || hasSectionPartRevisions(doc)
|
|
9485
9497
|
);
|
|
9486
9498
|
}
|
|
9487
9499
|
function hasChangeAtCursor(view) {
|
package/dist/docx/ui/index.mjs
CHANGED
|
@@ -9398,6 +9398,15 @@ function resolveSectionPartRevisions(doc, mode) {
|
|
|
9398
9398
|
}
|
|
9399
9399
|
|
|
9400
9400
|
// docx/ui/review-commands.ts
|
|
9401
|
+
var reviewQueries = /* @__PURE__ */ new WeakMap();
|
|
9402
|
+
function reviewQuery(doc) {
|
|
9403
|
+
let cached2 = reviewQueries.get(doc);
|
|
9404
|
+
if (!cached2) {
|
|
9405
|
+
cached2 = { ranges: collectRevisionRanges(doc) };
|
|
9406
|
+
reviewQueries.set(doc, cached2);
|
|
9407
|
+
}
|
|
9408
|
+
return cached2;
|
|
9409
|
+
}
|
|
9401
9410
|
function collectRevisionRanges(doc) {
|
|
9402
9411
|
const ranges = [];
|
|
9403
9412
|
doc.descendants((node, pos) => {
|
|
@@ -9453,13 +9462,16 @@ function collectRevisionRanges(doc) {
|
|
|
9453
9462
|
return ranges.sort((a, b) => a.from - b.from);
|
|
9454
9463
|
}
|
|
9455
9464
|
function revisionNear(view) {
|
|
9456
|
-
const ranges =
|
|
9465
|
+
const { ranges } = reviewQuery(view.state.doc);
|
|
9457
9466
|
const { from, to } = view.state.selection;
|
|
9458
9467
|
return ranges.find((range) => range.from < to && range.to > from) ?? ranges.find((r) => r.from >= to);
|
|
9459
9468
|
}
|
|
9460
9469
|
function hasAnyChange(view) {
|
|
9461
|
-
return
|
|
9462
|
-
|
|
9470
|
+
if (!view) return false;
|
|
9471
|
+
const doc = view.state.doc;
|
|
9472
|
+
const cached2 = reviewQuery(doc);
|
|
9473
|
+
return cached2.anyChange ??= Boolean(
|
|
9474
|
+
cached2.ranges.length || hasNoteRevisions(doc) || hasSectionPartRevisions(doc)
|
|
9463
9475
|
);
|
|
9464
9476
|
}
|
|
9465
9477
|
function hasChangeAtCursor(view) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-commands.d.ts","sourceRoot":"","sources":["../../../docx/ui/review-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,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