@stll/folio-core 0.76.0 → 0.78.0
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/ai-edits/headless.d.ts +6 -4
- package/dist/ai-edits/headless.js +32 -15
- package/dist/ai-edits/pending-suggestions.d.ts +9 -0
- package/dist/ai-edits/pending-suggestions.js +11 -0
- package/dist/ai-edits/read.js +24 -1
- package/dist/ai-edits/table-geometry.js +12 -4
- package/dist/canonical/canonicalBatchReview.js +7 -6
- package/dist/canonical/canonicalInlineProjection.d.ts +2 -2
- package/dist/canonical/canonicalInlineProjection.js +2 -2
- package/dist/canonical/canonicalProjectionBlocks.d.ts +10 -1
- package/dist/canonical/canonicalPublicOperations.js +19 -40
- package/dist/canonical/canonicalSeedContent.d.ts +18 -3
- package/dist/canonical/canonicalSeedContent.js +28 -15
- package/dist/canonical/canonicalSession.d.ts +22 -12
- package/dist/canonical/canonicalSession.js +190 -194
- package/dist/compare/inline-provenance.js +8 -1
- package/dist/controller/canonicalClipboard.d.ts +2 -1
- package/dist/controller/canonicalClipboard.js +312 -47
- package/dist/controller/canonicalComposition.js +67 -14
- package/dist/controller/canonicalStoryEditor.js +2 -0
- package/dist/controller/hiddenEditorManager.js +2 -0
- package/dist/docx/importedIdCollisions.js +29 -4
- package/dist/docx/paragraphParser.js +1 -1
- package/dist/docx/reviewResolutionProvenance.d.ts +2 -0
- package/dist/docx/reviewResolutionProvenance.js +22 -2
- package/dist/docx/server/templatePlan/apply.js +47 -2
- package/dist/docx/server/templatePlan/blocks.d.ts +34 -7
- package/dist/docx/server/templatePlan/blocks.js +190 -13
- package/dist/docx/server/templatePlan/builders.d.ts +8 -1
- package/dist/docx/server/templatePlan/builders.js +21 -5
- package/dist/docx/server/templatePlan/emit.d.ts +2 -0
- package/dist/docx/server/templatePlan/emit.js +108 -6
- package/dist/docx/server/templatePlan/plan.d.ts +26 -1
- package/dist/docx/server/templatePlan/plan.js +181 -21
- package/dist/docx/server/templatePlan/planShape.js +15 -3
- package/dist/docx/server/templatePlan/revisions.d.ts +55 -0
- package/dist/docx/server/templatePlan/revisions.js +276 -2
- package/dist/docx/server/templatePlan/story.d.ts +58 -1
- package/dist/docx/server/templatePlan/story.js +176 -12
- package/dist/docx/server/templatePlan/types.d.ts +153 -1
- package/dist/docx/server/templatePlan/verify.js +58 -15
- package/dist/docx/settingsHeaderFooterUpdate.d.ts +1 -1
- package/dist/docx/tableGridXml.d.ts +3 -7
- package/dist/docx/tableGridXml.js +23 -15
- package/dist/docx/tableParser.js +3 -1
- package/dist/layout-bridge/convert/footnoteLayout.js +34 -8
- package/dist/prosemirror/canonicalMarkupDocument.d.ts +20 -0
- package/dist/prosemirror/canonicalMarkupDocument.js +73 -0
- package/dist/prosemirror/canonicalTableCommands.d.ts +1 -1
- package/dist/prosemirror/canonicalTableCommands.js +7 -9
- package/dist/prosemirror/conversion/markupViewSource.d.ts +17 -0
- package/dist/prosemirror/conversion/markupViewSource.js +11 -0
- package/dist/prosemirror/conversion/toProseDoc.d.ts +8 -0
- package/dist/prosemirror/conversion/toProseDoc.js +43 -19
- package/dist/prosemirror/independentMarkupProjection.d.ts +27 -0
- package/dist/prosemirror/independentMarkupProjection.js +147 -0
- package/dist/prosemirror/markupViewNotes.d.ts +1 -1
- package/dist/prosemirror/markupViewNotes.js +24 -27
- package/dist/prosemirror/markupViewPositionMap.d.ts +16 -0
- package/dist/prosemirror/markupViewPositionMap.js +316 -0
- package/dist/prosemirror/markupViewProjection.d.ts +3 -46
- package/dist/prosemirror/markupViewProjection.js +90 -17
- package/dist/prosemirror/replacedAnnotations.d.ts +4 -78
- package/dist/prosemirror/replacedAnnotations.js +11 -194
- package/dist/prosemirror/styles/styleResolver.d.ts +1 -0
- package/dist/prosemirror/styles/styleResolver.js +4 -1
- package/dist/server.d.ts +2 -2
- package/dist/types/canonicalCapabilities.d.ts +3 -10
- package/dist/types/canonicalCapabilities.js +3 -10
- package/package.json +2 -2
- package/dist/internal/revisionResolutionEdits.d.ts +0 -11
- package/dist/internal/revisionResolutionEdits.js +0 -18
- package/dist/internal/revisionResolutionInline.d.ts +0 -24
- package/dist/internal/revisionResolutionInline.js +0 -302
- package/dist/internal/revisionResolutionStep.d.ts +0 -3
- package/dist/internal/revisionResolutionStep.js +0 -113
- package/dist/internal/revisionResolutionTracking.d.ts +0 -9
- package/dist/internal/revisionResolutionTracking.js +0 -124
- package/dist/internal/wholeStoryRevisionResolution.d.ts +0 -56
- package/dist/internal/wholeStoryRevisionResolution.js +0 -783
- package/dist/prosemirror/commands/resolveAllTableChanges.d.ts +0 -38
- package/dist/prosemirror/commands/resolveAllTableChanges.js +0 -642
- package/dist/prosemirror/commands/resolveNodePropertyChangeAttrs.d.ts +0 -13
- package/dist/prosemirror/commands/resolveNodePropertyChangeAttrs.js +0 -45
- package/dist/prosemirror/commands/tableCellMergeResolution.d.ts +0 -8
- package/dist/prosemirror/commands/tableCellMergeResolution.js +0 -56
- package/dist/prosemirror/commands/tableMergeFoldDecisions.d.ts +0 -60
- package/dist/prosemirror/commands/tableMergeFoldDecisions.js +0 -78
- package/dist/prosemirror/rejoinRunCarriers.d.ts +0 -42
- package/dist/prosemirror/rejoinRunCarriers.js +0 -65
- package/dist/prosemirror/runPropertyChangeResolution.d.ts +0 -15
- package/dist/prosemirror/runPropertyChangeResolution.js +0 -34
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isCommentAnchorCarrier } from "../ai-edits/comment-lifecycle.js";
|
|
2
2
|
import { minOf } from "../utils/extremes.js";
|
|
3
3
|
import { expectParagraphAttrs, expectTableCellAttrs, expectTableRowAttrs } from "./attrs/index.js";
|
|
4
4
|
import { expectCommentRangeBoundaryAttrs } from "./commentRangeBoundaryAttrs.js";
|
|
@@ -11,8 +11,7 @@ import { TEXT_BOX_ANCHOR_NODE_NAME } from "./extensions/nodes/TextBoxAnchorExten
|
|
|
11
11
|
import { readMoveRangeBoundaryAttrs } from "./moveRangeBoundaryAttrs.js";
|
|
12
12
|
import { readRangeAnchorAttrs } from "./rangeAnchorAttrs.js";
|
|
13
13
|
import { isZeroWidthAnchor } from "./zeroWidthAnchors.js";
|
|
14
|
-
import {
|
|
15
|
-
import { isCommentExhausted, withoutCommentThreads } from "@stll/docx-core/ops";
|
|
14
|
+
import { isCommentExhausted } from "@stll/docx-core/ops";
|
|
16
15
|
import { Fragment, Mark } from "prosemirror-model";
|
|
17
16
|
// src/prosemirror/replacedAnnotations.ts
|
|
18
17
|
/**
|
|
@@ -34,9 +33,9 @@ import { Fragment, Mark } from "prosemirror-model";
|
|
|
34
33
|
* span. It can propose a point at the replacement start for an emptied range;
|
|
35
34
|
* downstream ranged-comment exhaustion may retire that comment. The applier
|
|
36
35
|
* decides alignment once for direct and tracked edits.
|
|
37
|
-
* Canonical replacements
|
|
38
|
-
*
|
|
39
|
-
*
|
|
36
|
+
* Canonical replacements place comment anchors by the docx-core policy
|
|
37
|
+
* beside `rangeEndAfterDeletion`: markers inside the replaced words stay,
|
|
38
|
+
* in order, before the new words, and a range left covering nothing goes.
|
|
40
39
|
*
|
|
41
40
|
* - `comment` mark: carried over its aligned replacement span.
|
|
42
41
|
* - `hyperlink` mark: the replacement carries the first link the span held, so
|
|
@@ -76,8 +75,7 @@ import { Fragment, Mark } from "prosemirror-model";
|
|
|
76
75
|
* already gives the replacement the formatting of the text it replaces.
|
|
77
76
|
*
|
|
78
77
|
* Removing the owning block removes its comment. Point anchors proposed by
|
|
79
|
-
* the alignment helper do not override ranged-comment retirement
|
|
80
|
-
* canonical guard refuses point transitions whose outcome is not proven.
|
|
78
|
+
* the alignment helper do not override ranged-comment retirement.
|
|
81
79
|
*/
|
|
82
80
|
/**
|
|
83
81
|
* What a replacement does with each mark the schema declares
|
|
@@ -203,7 +201,7 @@ const lendsMarks = (node, content) => {
|
|
|
203
201
|
default: throw new Error(`Unhandled replaced content ${String(content)}`);
|
|
204
202
|
}
|
|
205
203
|
};
|
|
206
|
-
const surveyAnnotations = (doc, { from, to, content
|
|
204
|
+
const surveyAnnotations = (doc, { from, to, content }) => {
|
|
207
205
|
if (to <= from) return NOTHING_REPLACED;
|
|
208
206
|
const carried = [];
|
|
209
207
|
const leading = [];
|
|
@@ -212,7 +210,7 @@ const surveyAnnotations = (doc, { from, to, content, containers }) => {
|
|
|
212
210
|
if (!node.isInline) return true;
|
|
213
211
|
for (const mark of lendsMarks(node, content) ? node.marks : []) if (isCarried(mark) && !alreadyCarried(mark, carried)) carried.push(mark);
|
|
214
212
|
const placement = anchorPlacement(node);
|
|
215
|
-
if (placement === void 0 || position < from || position + node.nodeSize > to) return
|
|
213
|
+
if (placement === void 0 || position < from || position + node.nodeSize > to) return false;
|
|
216
214
|
(opensRange(node, placement) ? leading : trailing).push(node);
|
|
217
215
|
return false;
|
|
218
216
|
});
|
|
@@ -230,8 +228,7 @@ const surveyAnnotations = (doc, { from, to, content, containers }) => {
|
|
|
230
228
|
const surveyReplacedAnnotations = (doc, from, to) => surveyAnnotations(doc, {
|
|
231
229
|
from,
|
|
232
230
|
to,
|
|
233
|
-
content: "asWritten"
|
|
234
|
-
containers: "preserve"
|
|
231
|
+
content: "asWritten"
|
|
235
232
|
});
|
|
236
233
|
/**
|
|
237
234
|
* {@link surveyReplacedAnnotations} over the span as it reads once accepted:
|
|
@@ -241,189 +238,9 @@ const surveyReplacedAnnotations = (doc, from, to) => surveyAnnotations(doc, {
|
|
|
241
238
|
const surveyAcceptedReplacedAnnotations = (doc, from, to) => surveyAnnotations(doc, {
|
|
242
239
|
from,
|
|
243
240
|
to,
|
|
244
|
-
content: "asAccepted"
|
|
245
|
-
containers: "preserve"
|
|
241
|
+
content: "asAccepted"
|
|
246
242
|
});
|
|
247
243
|
/**
|
|
248
|
-
* A walker over the accepted leaves that carry words, handing each one's
|
|
249
|
-
* ranged comment ids and extent to `visit`.
|
|
250
|
-
*/
|
|
251
|
-
const rangedCommentLeaves = (visit) => (node, position) => {
|
|
252
|
-
if (!node.isInline) return true;
|
|
253
|
-
if (!node.isLeaf) return lendsMarks(node, "asAccepted");
|
|
254
|
-
if (isZeroWidthAnchor(node) || !lendsMarks(node, "asAccepted")) return false;
|
|
255
|
-
const ids = [];
|
|
256
|
-
for (const mark of node.marks) {
|
|
257
|
-
const id = mark.attrs["commentId"];
|
|
258
|
-
if (mark.type.name === "comment" && mark.attrs["point"] !== true && typeof id === "number") ids.push(id);
|
|
259
|
-
}
|
|
260
|
-
visit(ids, position, position + node.nodeSize);
|
|
261
|
-
return false;
|
|
262
|
-
};
|
|
263
|
-
/**
|
|
264
|
-
* Whether every word each of `ids` covers lies inside a change, so that
|
|
265
|
-
* accepting the tracked replacement leaves those comments nothing to cover.
|
|
266
|
-
*/
|
|
267
|
-
const coveredOnlyInside = ({ doc, changes, ids }) => {
|
|
268
|
-
let outside = false;
|
|
269
|
-
doc.descendants(rangedCommentLeaves((leafIds, from, to) => {
|
|
270
|
-
if (!changes.some((change) => change.from <= from && to <= change.to) && leafIds.some((id) => ids.has(id))) outside = true;
|
|
271
|
-
}));
|
|
272
|
-
return !outside;
|
|
273
|
-
};
|
|
274
|
-
/**
|
|
275
|
-
* The comment threads a direct replacement takes with its words: each root
|
|
276
|
-
* whose every accepted covered word lies inside a change, with its replies.
|
|
277
|
-
* Accepting the tracked replacement leaves such a root nothing to cover, so
|
|
278
|
-
* it drops the same threads.
|
|
279
|
-
*/
|
|
280
|
-
const threadsTakenBy = ({ doc, changes, comments }) => {
|
|
281
|
-
const inside = (from, to) => changes.some((change) => change.from <= from && to <= change.to);
|
|
282
|
-
const candidates = /* @__PURE__ */ new Set();
|
|
283
|
-
for (const change of changes) doc.nodesBetween(change.from, change.to, rangedCommentLeaves((ids, from, to) => {
|
|
284
|
-
if (inside(from, to)) for (const id of ids) candidates.add(id);
|
|
285
|
-
}));
|
|
286
|
-
if (candidates.size === 0) return candidates;
|
|
287
|
-
const surviving = /* @__PURE__ */ new Set();
|
|
288
|
-
doc.descendants(rangedCommentLeaves((ids, from, to) => {
|
|
289
|
-
if (!inside(from, to)) for (const id of ids) surviving.add(id);
|
|
290
|
-
}));
|
|
291
|
-
const roots = new Set(comments.filter(({ id, parentId }) => parentId === void 0 && candidates.has(id) && !surviving.has(id)).map(({ id }) => id));
|
|
292
|
-
if (roots.size === 0) return roots;
|
|
293
|
-
const kept = new Set(withoutCommentThreads(comments, roots).map(({ id }) => id));
|
|
294
|
-
return new Set(comments.filter(({ id }) => !kept.has(id)).map(({ id }) => id));
|
|
295
|
-
};
|
|
296
|
-
/**
|
|
297
|
-
* A direct replacement's changes cut at each boundary of a comment it keeps
|
|
298
|
-
* that stands inside a changed stretch: the words before the boundary go, and
|
|
299
|
-
* the new words follow every such boundary, where accepting the tracked
|
|
300
|
-
* replacement leaves them. A range ending in the stretch ends before the new
|
|
301
|
-
* words; one starting in it holds them.
|
|
302
|
-
*/
|
|
303
|
-
const splitAtKeptCommentBoundaries = ({ doc, changes, comments }) => {
|
|
304
|
-
const retired = threadsTakenBy({
|
|
305
|
-
doc,
|
|
306
|
-
changes,
|
|
307
|
-
comments
|
|
308
|
-
});
|
|
309
|
-
const split = [];
|
|
310
|
-
for (const change of changes) {
|
|
311
|
-
const cuts = [];
|
|
312
|
-
doc.nodesBetween(change.from, change.to, (node, position) => {
|
|
313
|
-
if (isCommentAnchorCarrier(node) && change.from < position && position < change.to && commentAnchorIdsForNode(node).some((id) => !retired.has(id)) && cuts.at(-1) !== position) cuts.push(position);
|
|
314
|
-
return !node.isLeaf && lendsMarks(node, "asAccepted");
|
|
315
|
-
});
|
|
316
|
-
let from = change.from;
|
|
317
|
-
for (const cut of cuts) {
|
|
318
|
-
split.push({
|
|
319
|
-
...change,
|
|
320
|
-
from,
|
|
321
|
-
to: cut,
|
|
322
|
-
text: ""
|
|
323
|
-
});
|
|
324
|
-
from = cut;
|
|
325
|
-
}
|
|
326
|
-
split.push({
|
|
327
|
-
...change,
|
|
328
|
-
from
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
return {
|
|
332
|
-
changes: split,
|
|
333
|
-
retiredCommentIds: retired
|
|
334
|
-
};
|
|
335
|
-
};
|
|
336
|
-
/**
|
|
337
|
-
* Whether source boundaries already express the replacement's aligned ranges.
|
|
338
|
-
* A changed stretch lends no comment to its replacement: the new words go
|
|
339
|
-
* past the end of every range the stretch reaches, and a direct replacement
|
|
340
|
-
* takes every thread it leaves nothing to cover. Pure deletions within
|
|
341
|
-
* surviving source content follow the ranged-comment exhaustion owner; other
|
|
342
|
-
* collapses need a point policy. Decide over the whole replacement, before
|
|
343
|
-
* any of its fragments are applied.
|
|
344
|
-
*/
|
|
345
|
-
const preservesReplacementCommentAlignment = ({ doc, source, changes, retiredCommentIds, removal }) => {
|
|
346
|
-
let previousEnd = source.from;
|
|
347
|
-
for (const change of changes) {
|
|
348
|
-
if (change.from < previousEnd || change.to < change.from || change.to > source.to) panic("Replacement changes must be ordered inside their source coverage.");
|
|
349
|
-
previousEnd = change.to;
|
|
350
|
-
}
|
|
351
|
-
const retired = new Set(retiredCommentIds);
|
|
352
|
-
if (removal.type === "direct") for (const id of threadsTakenBy({
|
|
353
|
-
doc,
|
|
354
|
-
changes,
|
|
355
|
-
comments: removal.comments
|
|
356
|
-
})) retired.add(id);
|
|
357
|
-
const collapsing = [];
|
|
358
|
-
const continued = [];
|
|
359
|
-
for (const change of changes) {
|
|
360
|
-
const comments = surveyAnnotations(doc, {
|
|
361
|
-
from: change.from,
|
|
362
|
-
to: change.to,
|
|
363
|
-
content: "asAccepted",
|
|
364
|
-
containers: "descend"
|
|
365
|
-
}).carried.filter((mark) => mark.type.name === "comment" && !retired.has(mark.attrs["commentId"]));
|
|
366
|
-
if (comments.some((mark) => mark.attrs["point"] === true)) return false;
|
|
367
|
-
if (change.markers === "selected" && comments.length > 0 && (removal.type === "direct" || !doc.resolve(change.from).sameParent(doc.resolve(change.to)) || !coveredOnlyInside({
|
|
368
|
-
doc,
|
|
369
|
-
changes,
|
|
370
|
-
ids: new Set(comments.map((mark) => Number(mark.attrs["commentId"])))
|
|
371
|
-
}))) return false;
|
|
372
|
-
if (removal.type === "tracked") continue;
|
|
373
|
-
let internalCarrier = false;
|
|
374
|
-
doc.nodesBetween(change.from, change.to, (node, position) => {
|
|
375
|
-
if (isCommentAnchorCarrier(node) && change.from < position && position < change.to) {
|
|
376
|
-
const ids = commentAnchorIdsForNode(node);
|
|
377
|
-
if (ids.length === 0 || ids.some((id) => !retired.has(id))) internalCarrier = true;
|
|
378
|
-
}
|
|
379
|
-
return !node.isLeaf && lendsMarks(node, "asAccepted");
|
|
380
|
-
});
|
|
381
|
-
if (internalCarrier) return false;
|
|
382
|
-
if (change.text === "") {
|
|
383
|
-
for (const mark of comments) if (!mark.isInSet(collapsing)) collapsing.push(mark);
|
|
384
|
-
continue;
|
|
385
|
-
}
|
|
386
|
-
for (const mark of comments) if (!mark.isInSet(continued)) continued.push(mark);
|
|
387
|
-
}
|
|
388
|
-
const candidates = collapsing.filter((mark) => !mark.isInSet(continued));
|
|
389
|
-
if (candidates.length === 0) return true;
|
|
390
|
-
const retained = [];
|
|
391
|
-
let sourceContentSurvives = false;
|
|
392
|
-
let changeIndex = 0;
|
|
393
|
-
doc.descendants((node, position) => {
|
|
394
|
-
if (!node.isInline) return true;
|
|
395
|
-
if (!node.isLeaf) return lendsMarks(node, "asAccepted");
|
|
396
|
-
if (isZeroWidthAnchor(node) || !lendsMarks(node, "asAccepted")) return false;
|
|
397
|
-
const from = position;
|
|
398
|
-
const to = position + node.nodeSize;
|
|
399
|
-
const sourceFrom = Math.max(source.from, from);
|
|
400
|
-
const sourceTo = Math.min(source.to, to);
|
|
401
|
-
while ((changes[changeIndex]?.to ?? 1e400) <= from) changeIndex++;
|
|
402
|
-
let removed = 0;
|
|
403
|
-
let sourceRemoved = 0;
|
|
404
|
-
for (let index = changeIndex; index < changes.length; index++) {
|
|
405
|
-
const change = changes[index];
|
|
406
|
-
if (change === void 0 || change.from >= to) break;
|
|
407
|
-
removed += Math.max(0, Math.min(to, change.to) - Math.max(from, change.from));
|
|
408
|
-
sourceRemoved += Math.max(0, Math.min(sourceTo, change.to) - Math.max(sourceFrom, change.from));
|
|
409
|
-
}
|
|
410
|
-
if (sourceFrom < sourceTo && sourceRemoved < sourceTo - sourceFrom) sourceContentSurvives = true;
|
|
411
|
-
if (removed < to - from) {
|
|
412
|
-
for (const mark of candidates) if (mark.isInSet(node.marks) && !mark.isInSet(retained)) retained.push(mark);
|
|
413
|
-
}
|
|
414
|
-
return false;
|
|
415
|
-
});
|
|
416
|
-
const deletesOnly = changes.every(({ text }) => text === "");
|
|
417
|
-
return candidates.every((mark) => {
|
|
418
|
-
const survivingNonCarrierContent = mark.isInSet(retained);
|
|
419
|
-
return survivingNonCarrierContent || deletesOnly && sourceContentSurvives && isCommentExhausted({
|
|
420
|
-
type: "coverage",
|
|
421
|
-
anchorKind: "range",
|
|
422
|
-
survivingNonCarrierContent
|
|
423
|
-
});
|
|
424
|
-
});
|
|
425
|
-
};
|
|
426
|
-
/**
|
|
427
244
|
* Whether the span already contributed this mark, or one the mark would evict.
|
|
428
245
|
* Comments do not exclude each other, so every comment is collected; a
|
|
429
246
|
* hyperlink excludes its own type, so the first address in the span wins
|
|
@@ -703,4 +520,4 @@ const inheritedReplacementMarks = (doc, from, to) => {
|
|
|
703
520
|
const $from = doc.resolve(from);
|
|
704
521
|
return (to === from ? $from.marks() : $from.marksAcross(doc.resolve(to))) ?? Mark.none;
|
|
705
522
|
};
|
|
706
|
-
export { NON_INCLUSIVE_MARK_DISPOSITION, addCarriedMarks, annotatedReplacement, commentPoint, commentsAcrossBlockBoundary, commentsForTrackedInsertion, commentsSpanningInsertion, createResolvedCommentPointCollector, hasReplacedAnnotations, inheritedReplacementMarks, joinCommentStretches, nonInclusiveMarkNames, placeTrackedInsertion,
|
|
523
|
+
export { NON_INCLUSIVE_MARK_DISPOSITION, addCarriedMarks, annotatedReplacement, commentPoint, commentsAcrossBlockBoundary, commentsForTrackedInsertion, commentsSpanningInsertion, createResolvedCommentPointCollector, hasReplacedAnnotations, inheritedReplacementMarks, joinCommentStretches, nonInclusiveMarkNames, placeTrackedInsertion, surveyAcceptedReplacedAnnotations, surveyReplacedAnnotations };
|
|
@@ -47,6 +47,7 @@ export type ReadonlyTextFormatting = DeepReadonly<document_d_exports.TextFormatt
|
|
|
47
47
|
* projection is modeled end to end.
|
|
48
48
|
*/
|
|
49
49
|
export type TableCellParagraphSpacingOverlay = DeepReadonly<Pick<document_d_exports.ParagraphFormatting, "spaceBefore" | "spaceAfter" | "lineSpacing" | "lineSpacingRule" | "contextualSpacing" | "frame">>;
|
|
50
|
+
export declare const styleResolverSource: (resolver: StyleResolver) => DeepReadonly<document_d_exports.StyleDefinitions> | undefined;
|
|
50
51
|
/**
|
|
51
52
|
* StyleResolver provides efficient access to resolved style properties
|
|
52
53
|
*/
|
|
@@ -41,6 +41,8 @@ const BUILTIN_NORMAL_STYLE = {
|
|
|
41
41
|
default: true,
|
|
42
42
|
pPr: BUILT_IN_DEFAULT_PARAGRAPH_FORMATTING
|
|
43
43
|
};
|
|
44
|
+
const sourceDefinitions = /* @__PURE__ */ new WeakMap();
|
|
45
|
+
const styleResolverSource = (resolver) => sourceDefinitions.get(resolver);
|
|
44
46
|
/**
|
|
45
47
|
* StyleResolver provides efficient access to resolved style properties
|
|
46
48
|
*/
|
|
@@ -52,6 +54,7 @@ var StyleResolver = class {
|
|
|
52
54
|
defaultCharacterStyle;
|
|
53
55
|
defaultTableStyle;
|
|
54
56
|
constructor(styleDefinitions) {
|
|
57
|
+
if (styleDefinitions !== void 0) sourceDefinitions.set(this, styleDefinitions);
|
|
55
58
|
this.stylesById = /* @__PURE__ */ new Map();
|
|
56
59
|
this.docDefaults = styleDefinitions?.docDefaults;
|
|
57
60
|
if (styleDefinitions?.styles) {
|
|
@@ -270,4 +273,4 @@ const resolveStyleParagraphNumbering = (resolver, styleId) => {
|
|
|
270
273
|
for (const layer of paragraphNumberingLayers(resolver, styleId)) numbering = mergeParagraphNumbering(numbering, layer?.numPr);
|
|
271
274
|
return numbering;
|
|
272
275
|
};
|
|
273
|
-
export { StyleResolver, createStyleResolver, resolveStyleParagraphNumbering };
|
|
276
|
+
export { StyleResolver, createStyleResolver, resolveStyleParagraphNumbering, styleResolverSource };
|
package/dist/server.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ import { FOLIO_DOCX_PACKAGE_INSPECTION_DEFAULTS, FOLIO_DOCX_PACKAGE_INSPECTION_E
|
|
|
36
36
|
import { applyTemplatePlan } from "./docx/server/templatePlan/apply.js";
|
|
37
37
|
import { analyzeDocxBlocks } from "./docx/server/templatePlan/blocks.js";
|
|
38
38
|
import { inspectDocxTemplate } from "./docx/server/templatePlan/inspect.js";
|
|
39
|
-
import { ApplyTemplatePlanArgs, ApplyTemplatePlanOptions, ApplyTemplatePlanResult, DocxBlock, DocxBlockManifest, DocxBlockNumbering, DocxCompat, DocxNote, DocxSection, DocxTableCell, DocxTemplateBookmark, DocxTemplateField, DocxTemplateInspection, DocxTemplateInvisibleEffect, DocxTemplateNumbering, DocxTemplateNumberingLevel, DocxTemplateSection, DocxTemplateStyle, DocxTextEffect, DocxTextEffectOwner, DocxTrackedChanges, TEMPLATE_PLAN_ERROR_CODES, TemplatePlan, TemplatePlanAlignment, TemplatePlanBlockResult, TemplatePlanEffectCount, TemplatePlanError, TemplatePlanErrorCode, TemplatePlanFieldLeftover, TemplatePlanHighlight, TemplatePlanIndent, TemplatePlanIssue, TemplatePlanItem, TemplatePlanMerge, TemplatePlanNestedParagraph, TemplatePlanNoteCounts, TemplatePlanNumbering, TemplatePlanNumberingPatch, TemplatePlanOmitReason, TemplatePlanReference, TemplatePlanReferenceResult, TemplatePlanReport, TemplatePlanSection, TemplatePlanSectionPage, TemplatePlanSourceItem, TemplatePlanSpanCounts, TemplatePlanTrackedView, VerifyTemplatePlanOutputArgs } from "./docx/server/templatePlan/types.js";
|
|
39
|
+
import { ApplyTemplatePlanArgs, ApplyTemplatePlanOptions, ApplyTemplatePlanResult, DocxBlock, DocxBlockCrossReference, DocxBlockManifest, DocxBlockNumbering, DocxBlockRevision, DocxCompat, DocxNote, DocxSection, DocxTableCell, DocxTemplateBookmark, DocxTemplateField, DocxTemplateInspection, DocxTemplateInvisibleEffect, DocxTemplateNumbering, DocxTemplateNumberingLevel, DocxTemplateSection, DocxTemplateStyle, DocxTextEffect, DocxTextEffectOwner, DocxTrackedChanges, TEMPLATE_PLAN_ERROR_CODES, TemplatePlan, TemplatePlanAlignment, TemplatePlanBlockResult, TemplatePlanEffectCount, TemplatePlanError, TemplatePlanErrorCode, TemplatePlanFieldLeftover, TemplatePlanHighlight, TemplatePlanIndent, TemplatePlanIssue, TemplatePlanItem, TemplatePlanMerge, TemplatePlanNestedParagraph, TemplatePlanNoteCounts, TemplatePlanNumbering, TemplatePlanNumberingPatch, TemplatePlanOmitReason, TemplatePlanReference, TemplatePlanReferenceResult, TemplatePlanReport, TemplatePlanSection, TemplatePlanSectionPage, TemplatePlanSourceItem, TemplatePlanSpacing, TemplatePlanSpanCounts, TemplatePlanTrackedChanges, TemplatePlanTrackedView, VerifyTemplatePlanOutputArgs } from "./docx/server/templatePlan/types.js";
|
|
40
40
|
import { verifyTemplatePlanOutput } from "./docx/server/templatePlan/verify.js";
|
|
41
41
|
import { FOLIO_DOCX_CONFORMANCE_CHECKS, FOLIO_DOCX_CONFORMANCE_ISSUE_CODES, FOLIO_DOCX_CONFORMANCE_PROFILE, FOLIO_DOCX_CONFORMANCE_REPORT_VERSION, FolioDocxConformanceCheck, FolioDocxConformanceCheckId, FolioDocxConformanceCheckStatus, FolioDocxConformanceIssue, FolioDocxConformanceIssueCode, FolioDocxConformanceReport, FolioDocxConformanceStatus, ValidateDocxConformanceOptions, validateDocxConformance } from "./docx/server/validateDocxConformance.js";
|
|
42
42
|
import { GenerateRedlineDocxOptions, GenerateRedlineDocxResourceImportError, GenerateRedlineDocxResult, GenerateRedlineReferenceWarning, GenerateRedlineUnprocessedStory, InvalidGenerateRedlineDocxOptionsError, generateRedlineDocx } from "./redline.js";
|
|
@@ -46,4 +46,4 @@ import { DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, DocumentPreset, Do
|
|
|
46
46
|
import { DeriveBlockIdInput, FolioBlockId, deriveBlockId, getFolioParaIdFromBlockId, isFolioBlockId, isSequentialFolioBlockId } from "./types/block-id.js";
|
|
47
47
|
import { CreateEmptyDocumentOptions, createEmptyDocument } from "./utils/createDocument.js";
|
|
48
48
|
import { FOLIO_VERSION_COMPARISON_PRIVACY_TRANSFORMS, FOLIO_VERSION_COMPARISON_SCOPES, FolioBlockDiff, FolioBlockProperty, FolioCompareDocxVersionsOptions, FolioDocumentMetadataValue, FolioFormatProperty, FolioMetadataDiff, FolioStoryDiff, FolioVersionBlockHandle, FolioVersionChangeProperty, FolioVersionComparisonPrivacyTransform, FolioVersionComparisonScope, FolioVersionDiff, FolioVersionDiffPrivacyOptions, FolioVersionDiffPrivacyReport, FolioVersionDiffSegment, FolioVersionDiffSummaryCounts, InvalidFolioVersionComparisonOptionsError, applyFolioVersionDiffPrivacy, compareDocxVersions, isFolioVersionComparisonPrivacyTransform, isFolioVersionComparisonScope } from "./version-comparison.js";
|
|
49
|
-
export { type ApplyDocxXmlPatchProposalArgs, type ApplyFolioAIEditsToBufferOptions, type ApplyFolioAIEditsToBufferResult, type ApplyTemplatePlanArgs, type ApplyTemplatePlanOptions, type ApplyTemplatePlanResult, BILINGUAL_TABLE_LAYOUTS, type BilingualBorders, type BilingualParagraphRef, type BilingualRow, type BilingualRowKind, type BilingualTableLayout, type BilingualTableParagraphRef, type ChangeListFormatOptions, type CreateBilingualDocumentOptions, type CreateBilingualDocumentResult, type CreateBilingualDocxOptions, type CreateBilingualDocxResult, type CreateCommentReplyInput, type CreateEmptyDocumentOptions, DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, type DeriveBlockIdInput, type DocumentPreset, type DocumentPropertiesOptions, type DocumentStyleCatalog, type DocumentStyleCatalogEntry, type DocumentStyleSet, DocxArchiveError, type DocxArchiveOptions, type DocxBlock, type DocxBlockManifest, type DocxBlockNumbering, type DocxCompat, type DocxNote, type DocxParagraphSource, type DocxSection, type DocxTableCell, type DocxTableRowKind, type DocxTableRowPosition, type DocxTemplateBookmark, type DocxTemplateField, type DocxTemplateInspection, type DocxTemplateInvisibleEffect, type DocxTemplateNumbering, type DocxTemplateNumberingLevel, type DocxTemplateSection, type DocxTemplateStyle, type DocxTextEffect, type DocxTextEffectOwner, type DocxTrackedChanges, EnsureParaIdsError, type EnsureParaIdsOptions, type EnsureParaIdsResult, type EvaluateDocxXmlPatchProposalArgs, type ExtractDocumentStyleSetOptions, type ExtractDocxTextOptions, type ExtractedDocxParagraph, type ExtractedDocxTableCell, type ExtractedDocxTableCellParagraph, type ExtractedDocxText, FOLIO_DOCUMENT_METADATA_PROPERTIES, FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_BATCH_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_KEYS_BY_TYPE, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FOLIO_DOCUMENT_PRIVACY_TRANSFORMS, FOLIO_DOCX_CONFORMANCE_CHECKS, FOLIO_DOCX_CONFORMANCE_ISSUE_CODES, FOLIO_DOCX_CONFORMANCE_PROFILE, FOLIO_DOCX_CONFORMANCE_REPORT_VERSION, FOLIO_DOCX_PACKAGE_INSPECTION_DEFAULTS, FOLIO_DOCX_PACKAGE_INSPECTION_ERROR_CODES, FOLIO_DOCX_PACKAGE_INSPECTION_VERSION, FOLIO_DOCX_XML_PATCH_APPLICATION_PROFILE, FOLIO_DOCX_XML_PATCH_APPLICATION_VERSION, FOLIO_DOCX_XML_PATCH_PROPOSAL_DEFAULTS, FOLIO_DOCX_XML_PATCH_PROPOSAL_ISSUE_CODES, FOLIO_DOCX_XML_PATCH_PROPOSAL_PROFILE, FOLIO_DOCX_XML_PATCH_PROPOSAL_VERSION, FOLIO_EXISTING_REVISION_POLICIES, FOLIO_HIGHLIGHT_COLOR_VALUES, FOLIO_LINE_SPACING_RULE_VALUES, FOLIO_LIST_NUMBER_FORMAT_VALUES, FOLIO_PAGE_BREAK_CLEAR_VALUES, FOLIO_PARAGRAPH_ALIGNMENT_VALUES, FOLIO_RESOLVED_REVIEWED_VIEWS, FOLIO_REVIEWED_VIEWS, FOLIO_VERSION_COMPARISON_PRIVACY_TRANSFORMS, FOLIO_VERSION_COMPARISON_SCOPES, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIBlockStructuralBoundary, type FolioAIComment, type FolioAIDiagnosticBlock, type FolioAIEditApplyMode, type FolioAIEditApplyResult, type FolioAIEditNormalization, type FolioAIEditNormalizationCode, type FolioAIEditOperation, type FolioAIEditPrecondition, type FolioAIEditSnapshot, type FolioAIInlineBooleanProperty, type FolioAIInlineFormatting, type FolioAIInlineFormattingPatch, type FolioAIParagraphBlock, type FolioAIParagraphSpacing, type FolioAITextRangeHandle, type FolioAbsorbedBlock, type FolioApplyDocumentOperationsOptions, type FolioApplyDocumentOperationsToStoryOptions, type FolioApplyOperationsOptions, type FolioBlockDiff, type FolioBlockId, type FolioBlockProperty, type FolioCompareDocxVersionsOptions, type FolioContentParagraphKind, type FolioDocumentMetadataProperty, type FolioDocumentMetadataValue, type FolioDocumentNavigationTarget, type FolioDocumentOperation, type FolioDocumentOperationAffectedTarget, type FolioDocumentOperationBatch, type FolioDocumentOperationBatchInput, type FolioDocumentOperationBatchPrecondition, type FolioDocumentOperationCapabilities, type FolioDocumentOperationIssue, type FolioDocumentOperationMode, type FolioDocumentOperationPrecondition, type FolioDocumentOperationQueuedOperation, type FolioDocumentOperationReceipt, type FolioDocumentOperationRecovery, type FolioDocumentOperationResult, type FolioDocumentOperationResultBase, type FolioDocumentOperationStatus, type FolioDocumentOperationStory, type FolioDocumentOperationType, type FolioDocumentOperationUndoFailureReason, type FolioDocumentOperationUndoHandle, type FolioDocumentOperationUndoResult, type FolioDocumentOutline, type FolioDocumentOutlineEntry, FolioDocumentPrivacyArchiveError, type FolioDocumentPrivacyOptions, type FolioDocumentPrivacyReport, type FolioDocumentPrivacyTransform, type FolioDocumentSection, type FolioDocumentSectionHandle, type FolioDocumentSectionReadResult, type FolioDocumentStory, type FolioDocumentStoryHandle, FolioDocumentStoryNotFoundError, type FolioDocxConformanceCheck, type FolioDocxConformanceCheckId, type FolioDocxConformanceCheckStatus, type FolioDocxConformanceIssue, type FolioDocxConformanceIssueCode, type FolioDocxConformanceReport, type FolioDocxConformanceStatus, type FolioDocxInspectedXmlPart, type FolioDocxPackageInspection, FolioDocxPackageInspectionError, type FolioDocxPackageInspectionErrorCode, type FolioDocxPackageInspectionLimits, type FolioDocxPackagePart, type FolioDocxPackagePartKind, type FolioDocxPreparedXmlReplacement, FolioDocxReviewer, type FolioDocxReviewerOptions, type FolioDocxXmlPatchApplication, FolioDocxXmlPatchApplicationError, type FolioDocxXmlPatchApplicationReceipt, type FolioDocxXmlPatchProposal, type FolioDocxXmlPatchProposalEvaluation, type FolioDocxXmlPatchProposalIssue, type FolioDocxXmlPatchProposalIssueCode, type FolioDocxXmlPatchProposalLimits, type FolioDocxXmlReplacement, type FolioEditableDocumentStoryHandle, type FolioFormatProperty, type FolioMetadataDiff, type FolioReadReviewedStoryOptions, type FolioResolveReviewedStoryOptions, type FolioResolvedReviewedView, type FolioReviewChange, type FolioReviewChangeFilter, type FolioReviewChangeKind, type FolioReviewComment, type FolioReviewCommentFilter, type FolioReviewCommentReply, type FolioReviewReplyInput, type FolioReviewResolution, type FolioReviewResolutionSkip, type FolioReviewedStory, type FolioReviewedView, type FolioReviewerRepackReason, type FolioReviewerSaveOptions, type FolioReviewerSaveResult, type FolioRevisionStamp, FolioRoomJournalError, type FolioStoryDiff, type FolioVersionBlockHandle, type FolioVersionChangeProperty, type FolioVersionComparisonPrivacyTransform, type FolioVersionComparisonScope, type FolioVersionDiff, type FolioVersionDiffPrivacyOptions, type FolioVersionDiffPrivacyReport, type FolioVersionDiffSegment, type FolioVersionDiffSummaryCounts, type GenerateRedlineDocxOptions, GenerateRedlineDocxResourceImportError, type GenerateRedlineDocxResult, type GenerateRedlineReferenceWarning, type GenerateRedlineUnprocessedStory, HEADING_LEVELS, type HeadingLevel, type InspectDocxPackageOptions, InvalidBilingualDocumentOptionsError, InvalidFolioDocumentOperationBatchError, InvalidFolioDocumentPrivacyOptionsError, InvalidFolioDocxXmlPatchProposalError, InvalidFolioDocxXmlPatchProposalOptionsError, InvalidFolioReportBuilderOptionsError, InvalidFolioVersionComparisonOptionsError, InvalidGenerateRedlineDocxOptionsError, type ParseOptions, type RewriteDocxMetadataPrivacyResult, STELLA_STYLE_SET_NAME, TEMPLATE_PLAN_ERROR_CODES, type TableCellSpec, type TemplatePlan, type TemplatePlanAlignment, type TemplatePlanBlockResult, type TemplatePlanEffectCount, TemplatePlanError, type TemplatePlanErrorCode, type TemplatePlanFieldLeftover, type TemplatePlanHighlight, type TemplatePlanIndent, type TemplatePlanIssue, type TemplatePlanItem, type TemplatePlanMerge, type TemplatePlanNestedParagraph, type TemplatePlanNoteCounts, type TemplatePlanNumbering, type TemplatePlanNumberingPatch, type TemplatePlanOmitReason, type TemplatePlanReference, type TemplatePlanReferenceResult, type TemplatePlanReport, type TemplatePlanSection, type TemplatePlanSectionPage, type TemplatePlanSourceItem, type TemplatePlanSpanCounts, type TemplatePlanTrackedView, UnsupportedFolioDocumentOperationVersionError, UnsupportedFolioDocxXmlPatchApplicationProfileError, UnsupportedFolioReviewedViewError, type ValidateDocxConformanceOptions, type VerifyTemplatePlanOutputArgs, analyzeDocxBlocks, applyDocxXmlPatchProposal, applyFolioAIEditsToBuffer, applyFolioVersionDiffPrivacy, applyTemplatePlan, assertSupportedFolioDocumentOperationVersion, bookmark, changeListFormat, compareDocxVersions, createBilingualDocument, createBilingualDocx, createDocx, createEmptyDocument, createFolioAITextRangeHandle, createStellaStyleDocumentPreset, createStellaStyleSet, createTableOfContentsField, deriveBlockId, docxToMarkdown, endnote, ensureParaIds, evaluateDocxXmlPatchProposal, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, extractDocxText, generateRedlineDocx, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, getFolioDocumentOperationRemovedBlockIds, getFolioDocumentOutline, getFolioParaIdFromBlockId, getTrackedFolioDocumentOperationRemovedBlockIds, hashFolioAIBlockText, heading, hyperlink, inspectDocumentStyles, inspectDocumentStylesFromDocx, inspectDocxPackage, inspectDocxTemplate, isFolioAIContentBlock, isFolioBlockId, isFolioDocumentOperationModeSupported, isFolioDocumentPrivacyTransform, isFolioResolvedReviewedView, isFolioReviewedView, isFolioVersionComparisonPrivacyTransform, isFolioVersionComparisonScope, isSequentialFolioBlockId, isSupportedFolioDocumentOperationVersion, normalizeFolioAIBlockText, pageBreak, paragraph, parseDocx, parseFolioDocumentOperationBatch, parseFolioDocxXmlPatchProposal, readBilingualDocument, readBilingualDocx, readFolioDocumentSection, replyToComment, rewriteDocxMetadataPrivacy, run, table, validateDocxConformance, verifyTemplatePlanOutput };
|
|
49
|
+
export { type ApplyDocxXmlPatchProposalArgs, type ApplyFolioAIEditsToBufferOptions, type ApplyFolioAIEditsToBufferResult, type ApplyTemplatePlanArgs, type ApplyTemplatePlanOptions, type ApplyTemplatePlanResult, BILINGUAL_TABLE_LAYOUTS, type BilingualBorders, type BilingualParagraphRef, type BilingualRow, type BilingualRowKind, type BilingualTableLayout, type BilingualTableParagraphRef, type ChangeListFormatOptions, type CreateBilingualDocumentOptions, type CreateBilingualDocumentResult, type CreateBilingualDocxOptions, type CreateBilingualDocxResult, type CreateCommentReplyInput, type CreateEmptyDocumentOptions, DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, type DeriveBlockIdInput, type DocumentPreset, type DocumentPropertiesOptions, type DocumentStyleCatalog, type DocumentStyleCatalogEntry, type DocumentStyleSet, DocxArchiveError, type DocxArchiveOptions, type DocxBlock, type DocxBlockCrossReference, type DocxBlockManifest, type DocxBlockNumbering, type DocxBlockRevision, type DocxCompat, type DocxNote, type DocxParagraphSource, type DocxSection, type DocxTableCell, type DocxTableRowKind, type DocxTableRowPosition, type DocxTemplateBookmark, type DocxTemplateField, type DocxTemplateInspection, type DocxTemplateInvisibleEffect, type DocxTemplateNumbering, type DocxTemplateNumberingLevel, type DocxTemplateSection, type DocxTemplateStyle, type DocxTextEffect, type DocxTextEffectOwner, type DocxTrackedChanges, EnsureParaIdsError, type EnsureParaIdsOptions, type EnsureParaIdsResult, type EvaluateDocxXmlPatchProposalArgs, type ExtractDocumentStyleSetOptions, type ExtractDocxTextOptions, type ExtractedDocxParagraph, type ExtractedDocxTableCell, type ExtractedDocxTableCellParagraph, type ExtractedDocxText, FOLIO_DOCUMENT_METADATA_PROPERTIES, FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_BATCH_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_KEYS_BY_TYPE, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FOLIO_DOCUMENT_PRIVACY_TRANSFORMS, FOLIO_DOCX_CONFORMANCE_CHECKS, FOLIO_DOCX_CONFORMANCE_ISSUE_CODES, FOLIO_DOCX_CONFORMANCE_PROFILE, FOLIO_DOCX_CONFORMANCE_REPORT_VERSION, FOLIO_DOCX_PACKAGE_INSPECTION_DEFAULTS, FOLIO_DOCX_PACKAGE_INSPECTION_ERROR_CODES, FOLIO_DOCX_PACKAGE_INSPECTION_VERSION, FOLIO_DOCX_XML_PATCH_APPLICATION_PROFILE, FOLIO_DOCX_XML_PATCH_APPLICATION_VERSION, FOLIO_DOCX_XML_PATCH_PROPOSAL_DEFAULTS, FOLIO_DOCX_XML_PATCH_PROPOSAL_ISSUE_CODES, FOLIO_DOCX_XML_PATCH_PROPOSAL_PROFILE, FOLIO_DOCX_XML_PATCH_PROPOSAL_VERSION, FOLIO_EXISTING_REVISION_POLICIES, FOLIO_HIGHLIGHT_COLOR_VALUES, FOLIO_LINE_SPACING_RULE_VALUES, FOLIO_LIST_NUMBER_FORMAT_VALUES, FOLIO_PAGE_BREAK_CLEAR_VALUES, FOLIO_PARAGRAPH_ALIGNMENT_VALUES, FOLIO_RESOLVED_REVIEWED_VIEWS, FOLIO_REVIEWED_VIEWS, FOLIO_VERSION_COMPARISON_PRIVACY_TRANSFORMS, FOLIO_VERSION_COMPARISON_SCOPES, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIBlockStructuralBoundary, type FolioAIComment, type FolioAIDiagnosticBlock, type FolioAIEditApplyMode, type FolioAIEditApplyResult, type FolioAIEditNormalization, type FolioAIEditNormalizationCode, type FolioAIEditOperation, type FolioAIEditPrecondition, type FolioAIEditSnapshot, type FolioAIInlineBooleanProperty, type FolioAIInlineFormatting, type FolioAIInlineFormattingPatch, type FolioAIParagraphBlock, type FolioAIParagraphSpacing, type FolioAITextRangeHandle, type FolioAbsorbedBlock, type FolioApplyDocumentOperationsOptions, type FolioApplyDocumentOperationsToStoryOptions, type FolioApplyOperationsOptions, type FolioBlockDiff, type FolioBlockId, type FolioBlockProperty, type FolioCompareDocxVersionsOptions, type FolioContentParagraphKind, type FolioDocumentMetadataProperty, type FolioDocumentMetadataValue, type FolioDocumentNavigationTarget, type FolioDocumentOperation, type FolioDocumentOperationAffectedTarget, type FolioDocumentOperationBatch, type FolioDocumentOperationBatchInput, type FolioDocumentOperationBatchPrecondition, type FolioDocumentOperationCapabilities, type FolioDocumentOperationIssue, type FolioDocumentOperationMode, type FolioDocumentOperationPrecondition, type FolioDocumentOperationQueuedOperation, type FolioDocumentOperationReceipt, type FolioDocumentOperationRecovery, type FolioDocumentOperationResult, type FolioDocumentOperationResultBase, type FolioDocumentOperationStatus, type FolioDocumentOperationStory, type FolioDocumentOperationType, type FolioDocumentOperationUndoFailureReason, type FolioDocumentOperationUndoHandle, type FolioDocumentOperationUndoResult, type FolioDocumentOutline, type FolioDocumentOutlineEntry, FolioDocumentPrivacyArchiveError, type FolioDocumentPrivacyOptions, type FolioDocumentPrivacyReport, type FolioDocumentPrivacyTransform, type FolioDocumentSection, type FolioDocumentSectionHandle, type FolioDocumentSectionReadResult, type FolioDocumentStory, type FolioDocumentStoryHandle, FolioDocumentStoryNotFoundError, type FolioDocxConformanceCheck, type FolioDocxConformanceCheckId, type FolioDocxConformanceCheckStatus, type FolioDocxConformanceIssue, type FolioDocxConformanceIssueCode, type FolioDocxConformanceReport, type FolioDocxConformanceStatus, type FolioDocxInspectedXmlPart, type FolioDocxPackageInspection, FolioDocxPackageInspectionError, type FolioDocxPackageInspectionErrorCode, type FolioDocxPackageInspectionLimits, type FolioDocxPackagePart, type FolioDocxPackagePartKind, type FolioDocxPreparedXmlReplacement, FolioDocxReviewer, type FolioDocxReviewerOptions, type FolioDocxXmlPatchApplication, FolioDocxXmlPatchApplicationError, type FolioDocxXmlPatchApplicationReceipt, type FolioDocxXmlPatchProposal, type FolioDocxXmlPatchProposalEvaluation, type FolioDocxXmlPatchProposalIssue, type FolioDocxXmlPatchProposalIssueCode, type FolioDocxXmlPatchProposalLimits, type FolioDocxXmlReplacement, type FolioEditableDocumentStoryHandle, type FolioFormatProperty, type FolioMetadataDiff, type FolioReadReviewedStoryOptions, type FolioResolveReviewedStoryOptions, type FolioResolvedReviewedView, type FolioReviewChange, type FolioReviewChangeFilter, type FolioReviewChangeKind, type FolioReviewComment, type FolioReviewCommentFilter, type FolioReviewCommentReply, type FolioReviewReplyInput, type FolioReviewResolution, type FolioReviewResolutionSkip, type FolioReviewedStory, type FolioReviewedView, type FolioReviewerRepackReason, type FolioReviewerSaveOptions, type FolioReviewerSaveResult, type FolioRevisionStamp, FolioRoomJournalError, type FolioStoryDiff, type FolioVersionBlockHandle, type FolioVersionChangeProperty, type FolioVersionComparisonPrivacyTransform, type FolioVersionComparisonScope, type FolioVersionDiff, type FolioVersionDiffPrivacyOptions, type FolioVersionDiffPrivacyReport, type FolioVersionDiffSegment, type FolioVersionDiffSummaryCounts, type GenerateRedlineDocxOptions, GenerateRedlineDocxResourceImportError, type GenerateRedlineDocxResult, type GenerateRedlineReferenceWarning, type GenerateRedlineUnprocessedStory, HEADING_LEVELS, type HeadingLevel, type InspectDocxPackageOptions, InvalidBilingualDocumentOptionsError, InvalidFolioDocumentOperationBatchError, InvalidFolioDocumentPrivacyOptionsError, InvalidFolioDocxXmlPatchProposalError, InvalidFolioDocxXmlPatchProposalOptionsError, InvalidFolioReportBuilderOptionsError, InvalidFolioVersionComparisonOptionsError, InvalidGenerateRedlineDocxOptionsError, type ParseOptions, type RewriteDocxMetadataPrivacyResult, STELLA_STYLE_SET_NAME, TEMPLATE_PLAN_ERROR_CODES, type TableCellSpec, type TemplatePlan, type TemplatePlanAlignment, type TemplatePlanBlockResult, type TemplatePlanEffectCount, TemplatePlanError, type TemplatePlanErrorCode, type TemplatePlanFieldLeftover, type TemplatePlanHighlight, type TemplatePlanIndent, type TemplatePlanIssue, type TemplatePlanItem, type TemplatePlanMerge, type TemplatePlanNestedParagraph, type TemplatePlanNoteCounts, type TemplatePlanNumbering, type TemplatePlanNumberingPatch, type TemplatePlanOmitReason, type TemplatePlanReference, type TemplatePlanReferenceResult, type TemplatePlanReport, type TemplatePlanSection, type TemplatePlanSectionPage, type TemplatePlanSourceItem, type TemplatePlanSpacing, type TemplatePlanSpanCounts, type TemplatePlanTrackedChanges, type TemplatePlanTrackedView, UnsupportedFolioDocumentOperationVersionError, UnsupportedFolioDocxXmlPatchApplicationProfileError, UnsupportedFolioReviewedViewError, type ValidateDocxConformanceOptions, type VerifyTemplatePlanOutputArgs, analyzeDocxBlocks, applyDocxXmlPatchProposal, applyFolioAIEditsToBuffer, applyFolioVersionDiffPrivacy, applyTemplatePlan, assertSupportedFolioDocumentOperationVersion, bookmark, changeListFormat, compareDocxVersions, createBilingualDocument, createBilingualDocx, createDocx, createEmptyDocument, createFolioAITextRangeHandle, createStellaStyleDocumentPreset, createStellaStyleSet, createTableOfContentsField, deriveBlockId, docxToMarkdown, endnote, ensureParaIds, evaluateDocxXmlPatchProposal, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, extractDocxText, generateRedlineDocx, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, getFolioDocumentOperationRemovedBlockIds, getFolioDocumentOutline, getFolioParaIdFromBlockId, getTrackedFolioDocumentOperationRemovedBlockIds, hashFolioAIBlockText, heading, hyperlink, inspectDocumentStyles, inspectDocumentStylesFromDocx, inspectDocxPackage, inspectDocxTemplate, isFolioAIContentBlock, isFolioBlockId, isFolioDocumentOperationModeSupported, isFolioDocumentPrivacyTransform, isFolioResolvedReviewedView, isFolioReviewedView, isFolioVersionComparisonPrivacyTransform, isFolioVersionComparisonScope, isSequentialFolioBlockId, isSupportedFolioDocumentOperationVersion, normalizeFolioAIBlockText, pageBreak, paragraph, parseDocx, parseFolioDocumentOperationBatch, parseFolioDocxXmlPatchProposal, readBilingualDocument, readBilingualDocx, readFolioDocumentSection, replyToComment, rewriteDocxMetadataPrivacy, run, table, validateDocxConformance, verifyTemplatePlanOutput };
|
|
@@ -3,7 +3,6 @@ export declare const CANONICAL_GAP: {
|
|
|
3
3
|
readonly trackedTableStructure: "tracked-table-structure";
|
|
4
4
|
readonly storyContentProjection: "story-content-projection";
|
|
5
5
|
readonly trackedChangeRecords: "tracked-change-records";
|
|
6
|
-
readonly commentReplacementAlignment: "comment-replacement-alignment";
|
|
7
6
|
readonly publicHeadlessSession: "publicOps.headlessSession";
|
|
8
7
|
};
|
|
9
8
|
export type CanonicalGap = (typeof CANONICAL_GAP)[keyof typeof CANONICAL_GAP];
|
|
@@ -88,25 +87,19 @@ export declare const CANONICAL_CAPABILITIES: {
|
|
|
88
87
|
readonly owner: "controller";
|
|
89
88
|
readonly kind: "refusal";
|
|
90
89
|
readonly adapters: readonly ["react", "vue"];
|
|
91
|
-
readonly summary: "
|
|
90
|
+
readonly summary: "A paste of content whose package parts the model does not carry refuses: an opaque drawing or kept block markup from another package, and a copied comment holding images or external links.";
|
|
92
91
|
};
|
|
93
92
|
readonly "tracked-change-records": {
|
|
94
93
|
readonly owner: "document-operations";
|
|
95
94
|
readonly kind: "refusal";
|
|
96
95
|
readonly adapters: readonly ["react", "vue"];
|
|
97
|
-
readonly summary: "A suggested change whose content the tracked-change records cannot express is refused:
|
|
98
|
-
};
|
|
99
|
-
readonly "comment-replacement-alignment": {
|
|
100
|
-
readonly owner: "controller";
|
|
101
|
-
readonly kind: "refusal";
|
|
102
|
-
readonly adapters: readonly ["react", "vue"];
|
|
103
|
-
readonly summary: "Replacements refuse when preserving aligned comments needs anchor transitions or an unproven collapsed-range policy.";
|
|
96
|
+
readonly summary: "A suggested change whose content the tracked-change records cannot express is refused: paragraph-mark run properties, a section-ending mark resolved across a standing range boundary, a change inside a simple field holding content the field cannot hold, content a w:ins or w:del cannot hold, a block content control or custom XML element pasted or moved, an insertion after a pending paragraph mark without its former snapshot, and the removal of a block content control's only paragraph.";
|
|
104
97
|
};
|
|
105
98
|
readonly "publicOps.headlessSession": {
|
|
106
99
|
readonly owner: "document-operations";
|
|
107
100
|
readonly kind: "refusal";
|
|
108
101
|
readonly adapters: readonly ["react", "vue"];
|
|
109
|
-
readonly summary: "A reviewer refuses
|
|
102
|
+
readonly summary: "A reviewer refuses a resolved view, a comparison projection or a story resolution that leaves a staged suggestion pending, because the suggestion's resolution refused without stating its ground.";
|
|
110
103
|
};
|
|
111
104
|
};
|
|
112
105
|
/**
|
|
@@ -4,7 +4,6 @@ const CANONICAL_GAP = {
|
|
|
4
4
|
trackedTableStructure: "tracked-table-structure",
|
|
5
5
|
storyContentProjection: "story-content-projection",
|
|
6
6
|
trackedChangeRecords: "tracked-change-records",
|
|
7
|
-
commentReplacementAlignment: "comment-replacement-alignment",
|
|
8
7
|
publicHeadlessSession: "publicOps.headlessSession"
|
|
9
8
|
};
|
|
10
9
|
/**
|
|
@@ -93,25 +92,19 @@ const CANONICAL_CAPABILITIES = {
|
|
|
93
92
|
owner: "controller",
|
|
94
93
|
kind: "refusal",
|
|
95
94
|
adapters: ["react", "vue"],
|
|
96
|
-
summary: "
|
|
95
|
+
summary: "A paste of content whose package parts the model does not carry refuses: an opaque drawing or kept block markup from another package, and a copied comment holding images or external links."
|
|
97
96
|
},
|
|
98
97
|
[CANONICAL_GAP.trackedChangeRecords]: {
|
|
99
98
|
owner: "document-operations",
|
|
100
99
|
kind: "refusal",
|
|
101
100
|
adapters: ["react", "vue"],
|
|
102
|
-
summary: "A suggested change whose content the tracked-change records cannot express is refused:
|
|
103
|
-
},
|
|
104
|
-
[CANONICAL_GAP.commentReplacementAlignment]: {
|
|
105
|
-
owner: "controller",
|
|
106
|
-
kind: "refusal",
|
|
107
|
-
adapters: ["react", "vue"],
|
|
108
|
-
summary: "Replacements refuse when preserving aligned comments needs anchor transitions or an unproven collapsed-range policy."
|
|
101
|
+
summary: "A suggested change whose content the tracked-change records cannot express is refused: paragraph-mark run properties, a section-ending mark resolved across a standing range boundary, a change inside a simple field holding content the field cannot hold, content a w:ins or w:del cannot hold, a block content control or custom XML element pasted or moved, an insertion after a pending paragraph mark without its former snapshot, and the removal of a block content control's only paragraph."
|
|
109
102
|
},
|
|
110
103
|
[CANONICAL_GAP.publicHeadlessSession]: {
|
|
111
104
|
owner: "document-operations",
|
|
112
105
|
kind: "refusal",
|
|
113
106
|
adapters: ["react", "vue"],
|
|
114
|
-
summary: "A reviewer refuses
|
|
107
|
+
summary: "A reviewer refuses a resolved view, a comparison projection or a story resolution that leaves a staged suggestion pending, because the suggestion's resolution refused without stating its ground."
|
|
115
108
|
}
|
|
116
109
|
};
|
|
117
110
|
const canonicalRefusalMessage = (gap, message) => `[${gap}] ${message}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/folio-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.78.0",
|
|
4
4
|
"description": "Headless DOCX engine: reads .docx into a typed OOXML model, applies every edit as a validated operation, paginates it, and writes .docx back with untouched parts byte for byte.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"document-model",
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
"perf": "bun scripts/profile-editor.ts"
|
|
174
174
|
},
|
|
175
175
|
"dependencies": {
|
|
176
|
-
"@stll/docx-core": "^0.
|
|
176
|
+
"@stll/docx-core": "^0.48.1",
|
|
177
177
|
"@stll/template-conditions": "^0.7.0",
|
|
178
178
|
"@stll/utf8-boundaries": "0.2.0",
|
|
179
179
|
"better-result": "3.0.1",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Node } from "prosemirror-model";
|
|
2
|
-
import { Step } from "prosemirror-transform";
|
|
3
|
-
type RecordNodeResolutionOptions = {
|
|
4
|
-
before: Node;
|
|
5
|
-
after: Node;
|
|
6
|
-
position: number;
|
|
7
|
-
steps: Step[];
|
|
8
|
-
};
|
|
9
|
-
/** Record only carrier edits; content replacements are recorded by their owning walk. */
|
|
10
|
-
export declare const recordNodeResolution: ({ before, after, position, steps }: RecordNodeResolutionOptions) => void;
|
|
11
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { AddMarkStep, AddNodeMarkStep, AttrStep, RemoveMarkStep, RemoveNodeMarkStep } from "prosemirror-transform";
|
|
2
|
-
// src/internal/revisionResolutionEdits.ts
|
|
3
|
-
/** Record only carrier edits; content replacements are recorded by their owning walk. */
|
|
4
|
-
const recordNodeResolution = ({ before, after, position, steps }) => {
|
|
5
|
-
if (before === after) return;
|
|
6
|
-
if (!before.isText) {
|
|
7
|
-
for (const name of Object.keys(after.attrs)) if (before.attrs[name] !== after.attrs[name]) steps.push(new AttrStep(position, name, after.attrs[name]));
|
|
8
|
-
}
|
|
9
|
-
for (const mark of before.marks) {
|
|
10
|
-
if (mark.isInSet(after.marks)) continue;
|
|
11
|
-
steps.push(before.isText ? new RemoveMarkStep(position, position + before.nodeSize, mark) : new RemoveNodeMarkStep(position, mark));
|
|
12
|
-
}
|
|
13
|
-
for (const mark of after.marks) {
|
|
14
|
-
if (mark.isInSet(before.marks)) continue;
|
|
15
|
-
steps.push(before.isText ? new AddMarkStep(position, position + before.nodeSize, mark) : new AddNodeMarkStep(position, mark));
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
export { recordNodeResolution };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { RunStyleResolver } from "../prosemirror/runStyleFormatting.js";
|
|
2
|
-
import { MarkType, Node } from "prosemirror-model";
|
|
3
|
-
import { Step, StepMap } from "prosemirror-transform";
|
|
4
|
-
export type RevisionResolutionMode = "accept" | "reject";
|
|
5
|
-
type RevisionRange = {
|
|
6
|
-
from: number;
|
|
7
|
-
to: number;
|
|
8
|
-
};
|
|
9
|
-
type ResolveInlineRevisionsOptions = {
|
|
10
|
-
pointComments: Set<number>;
|
|
11
|
-
doc: Node;
|
|
12
|
-
mode: RevisionResolutionMode;
|
|
13
|
-
keepType: MarkType | undefined;
|
|
14
|
-
removeType: MarkType | undefined;
|
|
15
|
-
styleResolver: RunStyleResolver | null;
|
|
16
|
-
};
|
|
17
|
-
export declare const resolveInlineRevisions: ({ pointComments, doc, mode, keepType, removeType, styleResolver }: ResolveInlineRevisionsOptions) => {
|
|
18
|
-
resolved: Node;
|
|
19
|
-
positionMap: StepMap;
|
|
20
|
-
ranges: RevisionRange[];
|
|
21
|
-
steps: Step[];
|
|
22
|
-
keptBoundaries: Set<Node>;
|
|
23
|
-
} | null;
|
|
24
|
-
export {};
|