@stll/folio-core 0.37.4 → 0.38.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/apply.js +275 -88
- package/dist/ai-edits/clean-text.js +12 -1
- package/dist/ai-edits/headless.d.ts +110 -0
- package/dist/ai-edits/headless.js +569 -40
- package/dist/ai-edits/index.d.ts +2 -1
- package/dist/ai-edits/snapshot.d.ts +24 -1
- package/dist/ai-edits/snapshot.js +206 -9
- package/dist/ai-edits/table-geometry.d.ts +7 -7
- package/dist/ai-edits/table-geometry.js +43 -27
- package/dist/ai-edits/table-template.d.ts +2 -1
- package/dist/ai-edits/table-template.js +9 -3
- package/dist/ai-edits/types.d.ts +38 -16
- package/dist/compare/__fixtures__/body-sequence.d.ts +4 -0
- package/dist/compare/__fixtures__/body-sequence.js +5 -3
- package/dist/compare/compare.d.ts +26 -2
- package/dist/compare/compare.js +444 -16
- package/dist/compare/content-alignment.js +216 -137
- package/dist/compare/content-types.d.ts +36 -2
- package/dist/compare/content.d.ts +13 -10
- package/dist/compare/content.js +69 -23
- package/dist/compare/formatting.d.ts +4 -22
- package/dist/compare/formatting.js +8 -112
- package/dist/compare/inline-atom-resources.d.ts +6 -0
- package/dist/compare/inline-atom-resources.js +26 -0
- package/dist/compare/inline-atoms.d.ts +35 -0
- package/dist/compare/inline-atoms.js +383 -0
- package/dist/compare/inline-provenance.d.ts +36 -0
- package/dist/compare/inline-provenance.js +334 -0
- package/dist/compare/plan.d.ts +4 -1
- package/dist/compare/plan.js +32 -4
- package/dist/compare/scenario.d.ts +4 -6
- package/dist/compare/section-boundary-properties.d.ts +63 -0
- package/dist/compare/section-boundary-properties.js +235 -0
- package/dist/compare/style-resources.d.ts +30 -0
- package/dist/compare/style-resources.js +404 -0
- package/dist/compare/types.d.ts +50 -11
- package/dist/compare/types.js +3 -1
- package/dist/compare/verification.d.ts +3 -5
- package/dist/compare/verification.js +8 -39
- package/dist/compat/eigenpal.d.ts +4 -4
- package/dist/compat/eigenpal.js +3 -3
- package/dist/document-operations.d.ts +5 -3
- package/dist/document-operations.js +112 -5
- package/dist/docx/blockContentParser.js +14 -2
- package/dist/docx/drawingIdNormalization.js +43 -2
- package/dist/docx/drawingRelationships.d.ts +10 -0
- package/dist/docx/drawingRelationships.js +28 -0
- package/dist/docx/fieldParser.js +1 -1
- package/dist/docx/hyperlinkParser.js +3 -5
- package/dist/docx/imageRawXml.d.ts +8 -0
- package/dist/docx/imageRawXml.js +13 -0
- package/dist/docx/newImage.d.ts +2 -2
- package/dist/docx/newImage.js +3 -3
- package/dist/docx/numberingParser.d.ts +1 -13
- package/dist/docx/numberingParser.js +31 -37
- package/dist/docx/paragraphParser.js +12 -9
- package/dist/docx/paragraphPropertySource.d.ts +8 -5
- package/dist/docx/paragraphPropertySource.js +16 -4
- package/dist/docx/removeHeaderFooterParts.d.ts +14 -0
- package/dist/docx/removeHeaderFooterParts.js +87 -0
- package/dist/docx/rezip.d.ts +3 -1
- package/dist/docx/rezip.js +143 -41
- package/dist/docx/runParser.js +16 -5
- package/dist/docx/sectionParser.js +3 -0
- package/dist/docx/sectionReferenceHistory.d.ts +17 -0
- package/dist/docx/sectionReferenceHistory.js +59 -0
- package/dist/docx/selectiveSave.js +11 -31
- package/dist/docx/selectiveXmlPatch.d.ts +8 -1
- package/dist/docx/selectiveXmlPatch.js +62 -2
- package/dist/docx/serializer/borderSerializer.d.ts +4 -1
- package/dist/docx/serializer/borderSerializer.js +20 -18
- package/dist/docx/serializer/commentSerializer.js +1 -1
- package/dist/docx/serializer/numberingSerializer.js +1 -1
- package/dist/docx/serializer/paragraphSerializer.js +13 -177
- package/dist/docx/serializer/partNamespaces.d.ts +1 -1
- package/dist/docx/serializer/partNamespaces.js +4 -0
- package/dist/docx/serializer/runSerializer.d.ts +1 -5
- package/dist/docx/serializer/runSerializer.js +4 -130
- package/dist/docx/serializer/sectionPropertiesSerializer.js +5 -2
- package/dist/docx/serializer/stylesSerializer.js +1 -1
- package/dist/docx/serializer/textFormattingSerializer.d.ts +17 -0
- package/dist/docx/serializer/textFormattingSerializer.js +144 -0
- package/dist/docx/tableParser.js +21 -11
- package/dist/docx/xmlParser.d.ts +10 -1
- package/dist/docx/xmlParser.js +23 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/internal/compare/inline-presentation.d.ts +20 -0
- package/dist/internal/compare/inline-presentation.js +222 -0
- package/dist/internal/paragraphFormattingSerialization.d.ts +25 -0
- package/dist/internal/paragraphFormattingSerialization.js +164 -0
- package/dist/internal/sectionReferenceResolution.d.ts +21 -0
- package/dist/internal/sectionReferenceResolution.js +72 -0
- package/dist/layout-bridge/convert/toFlowBlocks.js +1 -0
- package/dist/markdown/renderRuns.js +1 -0
- package/dist/markdown/renderTable.js +1 -0
- package/dist/prosemirror/attrs/index.js +20 -1
- package/dist/prosemirror/commands/comments.d.ts +11 -1
- package/dist/prosemirror/commands/comments.js +68 -6
- package/dist/prosemirror/commands/propertyChangeScope.d.ts +9 -3
- package/dist/prosemirror/commands/propertyChangeScope.js +4 -10
- package/dist/prosemirror/conversion/fromProseDoc.js +22 -22
- package/dist/prosemirror/conversion/toProseDoc.js +16 -57
- package/dist/prosemirror/extensions/core/ParagraphExtension.js +2 -0
- package/dist/prosemirror/extensions/marks/RunFormattingOverrideExtension.js +3 -0
- package/dist/prosemirror/imageCommit.js +7 -9
- package/dist/prosemirror/paragraphIndentation.d.ts +21 -0
- package/dist/prosemirror/paragraphIndentation.js +72 -0
- package/dist/prosemirror/plugins/documentNumbering.d.ts +3 -1
- package/dist/prosemirror/plugins/documentNumbering.js +7 -1
- package/dist/prosemirror/plugins/documentStyles.d.ts +3 -1
- package/dist/prosemirror/plugins/documentStyles.js +7 -1
- package/dist/prosemirror/rebaseParagraphRunFormatting.d.ts +3 -1
- package/dist/prosemirror/rebaseParagraphRunFormatting.js +2 -1
- package/dist/prosemirror/runFormattingInlineCarriers.d.ts +15 -2
- package/dist/prosemirror/runFormattingInlineCarriers.js +33 -3
- package/dist/prosemirror/runStyleFormatting.d.ts +15 -2
- package/dist/prosemirror/runStyleFormatting.js +76 -2
- package/dist/prosemirror/schema/marks.d.ts +3 -1
- package/dist/prosemirror/schema/marks.js +2 -0
- package/dist/prosemirror/schema/nodes.d.ts +3 -0
- package/dist/prosemirror/tableCellRevisionVisibility.d.ts +6 -0
- package/dist/prosemirror/tableCellRevisionVisibility.js +14 -0
- package/dist/prosemirror/trackedRunInlineAtoms.d.ts +1 -1
- package/dist/prosemirror/trackedRunInlineAtoms.js +1 -1
- package/dist/redline.js +15 -2
- package/dist/server.d.ts +3 -2
- package/dist/server.js +2 -2
- package/dist/version-comparison.d.ts +2 -0
- package/dist/version-comparison.js +30 -29
- package/package.json +2 -2
package/dist/ai-edits/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { document_d_exports } from "../types/document.js";
|
|
2
|
-
import { FolioContentBlock, FolioContentInlineBooleanProperty, FolioContentInlineFormatting, FolioContentInlineFormattingPatch, FolioContentParagraphSpacing, FolioContentRun, FolioContentSnapshot, FolioContentTableLocation } from "../compare/content-types.js";
|
|
2
|
+
import { FolioContentBlock, FolioContentInlineBooleanProperty, FolioContentInlineFormatting, FolioContentInlineFormattingPatch, FolioContentListReference, FolioContentParagraphIndentation, FolioContentParagraphKind, FolioContentParagraphSpacing, FolioContentRun, FolioContentSnapshot, FolioContentTableLocation } from "../compare/content-types.js";
|
|
3
3
|
//#region src/ai-edits/types.d.ts
|
|
4
|
-
type FolioAIBlockKind =
|
|
4
|
+
type FolioAIBlockKind = FolioContentParagraphKind;
|
|
5
5
|
/** Boolean run properties supported by snapshots and range-formatting mutations. */
|
|
6
6
|
type FolioAIInlineBooleanProperty = FolioContentInlineBooleanProperty;
|
|
7
7
|
type FolioAIInlineFormatting = FolioContentInlineFormatting;
|
|
@@ -40,6 +40,9 @@ type FolioAIBlock = FolioContentBlock<FolioAIBlockKind> & {
|
|
|
40
40
|
* an explicit zero or false value.
|
|
41
41
|
*/
|
|
42
42
|
type FolioAIParagraphSpacing = FolioContentParagraphSpacing;
|
|
43
|
+
/** The complete modeled attribute set of one direct `w:pPr/w:ind` child. */
|
|
44
|
+
type FolioAIParagraphIndentation = FolioContentParagraphIndentation;
|
|
45
|
+
type FolioAIListReference = FolioContentListReference;
|
|
43
46
|
/**
|
|
44
47
|
* The paragraph properties an operation may set. A subset of `w:pPrChange`'s
|
|
45
48
|
* scope: properties a comparison can see in a block projection and an agent
|
|
@@ -49,14 +52,18 @@ type FolioAIBlockParagraphProperties = {
|
|
|
49
52
|
/** `w:pStyle`. `null` clears the style back to the default. */
|
|
50
53
|
styleId?: string | null;
|
|
51
54
|
/**
|
|
52
|
-
* `w:numPr/w:ilvl`, zero-based. `null` removes `
|
|
53
|
-
*
|
|
55
|
+
* `w:numPr/w:ilvl`, zero-based. `null` removes numbering unless `numbering`
|
|
56
|
+
* supplies a concrete instance; together they retain that instance without
|
|
57
|
+
* an authored level.
|
|
54
58
|
*/
|
|
55
59
|
listLevel?: number | null;
|
|
60
|
+
numbering?: FolioAIListReference | null;
|
|
56
61
|
/** Direct `w:jc`. `null` clears the override and restores style inheritance. */
|
|
57
62
|
alignment?: document_d_exports.ParagraphAlignment | null;
|
|
58
63
|
/** Direct `w:spacing` attributes. `null` removes the whole direct child. */
|
|
59
64
|
spacing?: FolioAIParagraphSpacing | null;
|
|
65
|
+
/** Direct `w:ind` attributes. `null` removes the whole direct child. */
|
|
66
|
+
indentation?: FolioAIParagraphIndentation | null;
|
|
60
67
|
};
|
|
61
68
|
/**
|
|
62
69
|
* Every paragraph of one story, blank ones included.
|
|
@@ -203,12 +210,13 @@ type FolioAIEditOperation = FolioAIEditReviewMeta & {
|
|
|
203
210
|
type: "insertAfterBlock" | "insertBeforeBlock";
|
|
204
211
|
blockId: string;
|
|
205
212
|
/**
|
|
206
|
-
* The paragraph text to insert.
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
* formatting. Blank lines are dropped
|
|
211
|
-
* `splitMultilineText` normalization
|
|
213
|
+
* The paragraph text to insert. With the default `lineBreakMode:
|
|
214
|
+
* "paragraph"`, a line break splits `text` into consecutive
|
|
215
|
+
* paragraphs at the same anchor: only the first paragraph gets
|
|
216
|
+
* `styleId` / `alignment` / `inheritFormatting`, later ones use
|
|
217
|
+
* body formatting. Blank lines are dropped and reported as a
|
|
218
|
+
* `splitMultilineText` normalization. `"inline"` retains the
|
|
219
|
+
* control inside one paragraph.
|
|
212
220
|
*
|
|
213
221
|
* `""` inserts a BLANK paragraph, and is a real edit: adding an empty
|
|
214
222
|
* line is a change a reader sees, and a document that has one where
|
|
@@ -216,6 +224,11 @@ type FolioAIEditOperation = FolioAIEditReviewMeta & {
|
|
|
216
224
|
* with a tracked paragraph mark, so rejecting closes it away.
|
|
217
225
|
*/
|
|
218
226
|
text: string;
|
|
227
|
+
/**
|
|
228
|
+
* `"paragraph"` (the default) splits newlines into consecutive blocks.
|
|
229
|
+
* `"inline"` retains tabs and hard breaks inside this inserted block.
|
|
230
|
+
*/
|
|
231
|
+
lineBreakMode?: "paragraph" | "inline";
|
|
219
232
|
inheritFormatting?: boolean;
|
|
220
233
|
/**
|
|
221
234
|
* Links this insertion to the deletion that carries the same
|
|
@@ -229,6 +242,13 @@ type FolioAIEditOperation = FolioAIEditReviewMeta & {
|
|
|
229
242
|
* new page. Use for explicit page-break inserts.
|
|
230
243
|
*/
|
|
231
244
|
pageBreakBefore?: boolean;
|
|
245
|
+
/**
|
|
246
|
+
* Insert one standalone authored `<w:br w:type="page"/>` carrier.
|
|
247
|
+
* This differs from `pageBreakBefore`, which is a paragraph property.
|
|
248
|
+
*/
|
|
249
|
+
hardPageBreak?: {
|
|
250
|
+
clear?: document_d_exports.BreakContent["clear"];
|
|
251
|
+
};
|
|
232
252
|
/**
|
|
233
253
|
* Override the paragraph `styleId` attr of the inserted
|
|
234
254
|
* block (e.g. `ClauseHeading1`). When omitted the inserted
|
|
@@ -242,10 +262,11 @@ type FolioAIEditOperation = FolioAIEditReviewMeta & {
|
|
|
242
262
|
* anchor's `w:numId`. Without it the inserted paragraph takes the
|
|
243
263
|
* anchor's level, which is the wrong one whenever the new item sits
|
|
244
264
|
* beside a list item at a different depth. `null` gives it no
|
|
245
|
-
* numbering
|
|
246
|
-
*
|
|
265
|
+
* numbering unless `numbering` supplies a concrete instance; together
|
|
266
|
+
* they retain that instance without an authored level.
|
|
247
267
|
*/
|
|
248
268
|
listLevel?: number | null;
|
|
269
|
+
numbering?: FolioAIListReference | null;
|
|
249
270
|
/**
|
|
250
271
|
* Direct `w:jc` for the inserted block. `null` clears alignment copied
|
|
251
272
|
* from the anchor and lets the inserted paragraph's style decide.
|
|
@@ -256,6 +277,8 @@ type FolioAIEditOperation = FolioAIEditReviewMeta & {
|
|
|
256
277
|
* copied from the anchor and lets the inserted paragraph's style decide.
|
|
257
278
|
*/
|
|
258
279
|
spacing?: FolioAIParagraphSpacing | null;
|
|
280
|
+
/** Direct `w:ind` for the inserted block. `null` clears copied indentation. */
|
|
281
|
+
indentation?: FolioAIParagraphIndentation | null;
|
|
259
282
|
comment?: FolioAIComment;
|
|
260
283
|
} | {
|
|
261
284
|
id: string;
|
|
@@ -545,9 +568,8 @@ type FolioAIEditSkippedOperation = {
|
|
|
545
568
|
*/
|
|
546
569
|
type FolioAIEditNormalization =
|
|
547
570
|
/**
|
|
548
|
-
* A line-break in `insertAfterBlock` /
|
|
549
|
-
*
|
|
550
|
-
* lines); the applier split it into one paragraph per non-blank line.
|
|
571
|
+
* A line-break in paragraph-mode `insertAfterBlock` /
|
|
572
|
+
* `insertBeforeBlock` text was split into one paragraph per non-blank line.
|
|
551
573
|
*/
|
|
552
574
|
{
|
|
553
575
|
id: string;
|
|
@@ -574,4 +596,4 @@ type FolioAIEditApplyResult = {
|
|
|
574
596
|
normalizations?: FolioAIEditNormalization[];
|
|
575
597
|
};
|
|
576
598
|
//#endregion
|
|
577
|
-
export { FolioAIBlock, FolioAIBlockAnchor, FolioAIBlockKind, FolioAIBlockParagraphProperties, FolioAIBlockPreviewRun, FolioAIBlockStructuralBoundary, FolioAIBlockTableLocation, FolioAIComment, FolioAIEditAppliedOperation, FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditNormalization, FolioAIEditNormalizationCode, FolioAIEditOperation, FolioAIEditPrecondition, FolioAIEditReviewMeta, FolioAIEditSeverity, FolioAIEditSkipReason, FolioAIEditSkippedOperation, FolioAIEditSnapshot, FolioAIInlineBooleanProperty, FolioAIInlineFormatting, FolioAIInlineFormattingPatch, FolioAIParagraphSpacing, FolioAISignatureParty, FolioAITextRangeHandle, FolioDocumentNavigationTarget, FolioDocumentOutline, FolioDocumentOutlineEntry, FolioDocumentSection, FolioDocumentSectionHandle, FolioDocumentSectionReadResult };
|
|
599
|
+
export { FolioAIBlock, FolioAIBlockAnchor, FolioAIBlockKind, FolioAIBlockParagraphProperties, FolioAIBlockPreviewRun, FolioAIBlockStructuralBoundary, FolioAIBlockTableLocation, FolioAIComment, FolioAIEditAppliedOperation, FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditNormalization, FolioAIEditNormalizationCode, FolioAIEditOperation, FolioAIEditPrecondition, FolioAIEditReviewMeta, FolioAIEditSeverity, FolioAIEditSkipReason, FolioAIEditSkippedOperation, FolioAIEditSnapshot, FolioAIInlineBooleanProperty, FolioAIInlineFormatting, FolioAIInlineFormattingPatch, FolioAIListReference, FolioAIParagraphIndentation, FolioAIParagraphSpacing, FolioAISignatureParty, FolioAITextRangeHandle, FolioDocumentNavigationTarget, FolioDocumentOutline, FolioDocumentOutlineEntry, FolioDocumentSection, FolioDocumentSectionHandle, FolioDocumentSectionReadResult };
|
|
@@ -53,10 +53,14 @@ type TableProperties = {
|
|
|
53
53
|
value: number;
|
|
54
54
|
type: "auto" | "dxa" | "pct";
|
|
55
55
|
};
|
|
56
|
+
/** `w:bidiVisual`. */
|
|
57
|
+
bidi?: boolean;
|
|
56
58
|
/** `w:jc` on the table. */
|
|
57
59
|
justification?: "left" | "center" | "right";
|
|
58
60
|
/** `w:tblInd` in twips. */
|
|
59
61
|
indent?: number;
|
|
62
|
+
/** `w:tblCellSpacing` in twips. */
|
|
63
|
+
cellSpacing?: number;
|
|
60
64
|
/** `w:tblBorders`, single style on every side, in eighths of a point. */
|
|
61
65
|
borderSize?: number;
|
|
62
66
|
/** `w:shd` fill colour on the table, as six hex digits. */
|
|
@@ -132,9 +132,9 @@ const MARGIN_SIDES = [
|
|
|
132
132
|
const borders = (element, sides, size) => `<w:${element}>${sides.map((side) => `<w:${side} w:val="single" w:sz="${String(size)}" w:space="0" w:color="000000"/>`).join("")}</w:${element}>`;
|
|
133
133
|
const margins = (element, value) => `<w:${element}>${MARGIN_SIDES.map((side) => `<w:${side} w:w="${String(value)}" w:type="dxa"/>`).join("")}</w:${element}>`;
|
|
134
134
|
/**
|
|
135
|
-
* `w:tblPr` children in the order CT_TblPrBase declares: tblStyle,
|
|
136
|
-
* tblInd, tblBorders, shd, tblLayout, tblCellMar,
|
|
137
|
-
* written.
|
|
135
|
+
* `w:tblPr` children in the order CT_TblPrBase declares: tblStyle, bidiVisual,
|
|
136
|
+
* tblW, jc, tblCellSpacing, tblInd, tblBorders, shd, tblLayout, tblCellMar,
|
|
137
|
+
* tblLook. `w:tblW` is always written.
|
|
138
138
|
*/
|
|
139
139
|
const tableProperties = ({ properties }) => {
|
|
140
140
|
const width = properties?.width ?? {
|
|
@@ -143,8 +143,10 @@ const tableProperties = ({ properties }) => {
|
|
|
143
143
|
};
|
|
144
144
|
return `<w:tblPr>${[
|
|
145
145
|
...properties?.styleId === void 0 ? [] : [`<w:tblStyle w:val="${properties.styleId}"/>`],
|
|
146
|
+
...properties?.bidi === void 0 ? [] : [properties.bidi ? "<w:bidiVisual/>" : "<w:bidiVisual w:val=\"0\"/>"],
|
|
146
147
|
`<w:tblW w:w="${String(width.value)}" w:type="${width.type}"/>`,
|
|
147
148
|
...properties?.justification === void 0 ? [] : [`<w:jc w:val="${properties.justification}"/>`],
|
|
149
|
+
...properties?.cellSpacing === void 0 ? [] : [`<w:tblCellSpacing w:w="${String(properties.cellSpacing)}" w:type="dxa"/>`],
|
|
148
150
|
...properties?.indent === void 0 ? [] : [`<w:tblInd w:w="${String(properties.indent)}" w:type="dxa"/>`],
|
|
149
151
|
...properties?.borderSize === void 0 ? [] : [borders("tblBorders", BORDER_SIDES, properties.borderSize)],
|
|
150
152
|
...properties?.shadingFill === void 0 ? [] : [`<w:shd w:val="clear" w:color="auto" w:fill="${properties.shadingFill}"/>`],
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { document_d_exports } from "../types/document.js";
|
|
1
2
|
import { FolioAIEditSkipReason, FolioAIEditSnapshot } from "../ai-edits/types.js";
|
|
2
3
|
import { WordDiffGranularity } from "../ai-edits/word-diff.js";
|
|
3
4
|
import { FolioRevisionStamp } from "../ai-edits/apply.js";
|
|
4
5
|
import { FolioDocumentStoryHandle, FolioDocxReviewer } from "../ai-edits/headless.js";
|
|
5
6
|
import { CompareVerification } from "./verification.js";
|
|
6
|
-
import { CompareChange, CompareDocxApplyError, CompareDocxError, CompareDocxFinalParagraphMarkError, CompareDocxOperationLimitError, CompareDocxOptions, CompareDocxParseError, CompareDocxSerializeError, CompareResult, CompareUnsupportedPart, InvalidCompareDocxOptionsError } from "./types.js";
|
|
7
|
+
import { CompareChange, CompareCompatibility, CompareDocxApplyError, CompareDocxError, CompareDocxFinalParagraphMarkError, CompareDocxOperationLimitError, CompareDocxOptions, CompareDocxParseError, CompareDocxSerializeError, CompareResult, CompareUnsupportedPart, InvalidCompareDocxOptionsError } from "./types.js";
|
|
7
8
|
import { CompareStoryPlan } from "./plan.js";
|
|
8
9
|
import { Result } from "better-result";
|
|
9
10
|
//#region src/compare/compare.d.ts
|
|
@@ -17,12 +18,26 @@ type ComparedStoryPair = {
|
|
|
17
18
|
baseStory: FolioDocumentStoryHandle;
|
|
18
19
|
targetStory: FolioDocumentStoryHandle;
|
|
19
20
|
baseSnapshot: FolioAIEditSnapshot;
|
|
21
|
+
/** Raw base expectation when Folio-exact staging added an untracked carrier. */
|
|
22
|
+
rawBaseSnapshot?: FolioAIEditSnapshot;
|
|
20
23
|
targetSnapshot: FolioAIEditSnapshot;
|
|
21
24
|
};
|
|
25
|
+
type FinalSectionComparison = {
|
|
26
|
+
status: "same";
|
|
27
|
+
} | {
|
|
28
|
+
status: "stage";
|
|
29
|
+
previous: document_d_exports.SectionProperties;
|
|
30
|
+
target: document_d_exports.SectionProperties;
|
|
31
|
+
} | {
|
|
32
|
+
status: "unsupported";
|
|
33
|
+
detail: string;
|
|
34
|
+
};
|
|
22
35
|
/** Everything the later stages need, and nothing they have to re-derive. */
|
|
23
36
|
type ParsedComparison = {
|
|
24
37
|
/** Token size a changed paragraph's redline is cut at. */
|
|
25
38
|
granularity: WordDiffGranularity;
|
|
39
|
+
revisionFormat: "word" | "folio-exact";
|
|
40
|
+
terminalTableCarrierStaged: boolean;
|
|
26
41
|
/**
|
|
27
42
|
* The base package as it arrived. It is the result when nothing changed, but
|
|
28
43
|
* only when it carried no revisions of its own: otherwise the compared base
|
|
@@ -36,6 +51,14 @@ type ParsedComparison = {
|
|
|
36
51
|
pairs: readonly ComparedStoryPair[];
|
|
37
52
|
/** Package-level numbering differences, which belong to no story. */
|
|
38
53
|
numberingChanges: readonly CompareChange[];
|
|
54
|
+
targetNumbering: document_d_exports.NumberingDefinitions | null | undefined;
|
|
55
|
+
targetNumberingReferences: readonly {
|
|
56
|
+
numId: number;
|
|
57
|
+
level: number;
|
|
58
|
+
}[];
|
|
59
|
+
targetNumberingReferenceMap: ReadonlyMap<number, number>;
|
|
60
|
+
finalSectionComparison: FinalSectionComparison;
|
|
61
|
+
styleImportFailure: string | undefined;
|
|
39
62
|
unsupported: readonly CompareUnsupportedPart[];
|
|
40
63
|
};
|
|
41
64
|
/** Stage 1: both packages to editor models, paired story by story. */
|
|
@@ -53,6 +76,7 @@ declare const planComparison: ({ pairs }: ParsedComparison) => Result<readonly P
|
|
|
53
76
|
declare const getCompareSkipDisposition: (reason: FolioAIEditSkipReason) => "fatal" | "unwritable";
|
|
54
77
|
/** What stage 3 produced: the change list, whether it was proven, and whether it wrote anything. */
|
|
55
78
|
type AppliedComparison = {
|
|
79
|
+
compatibility: CompareCompatibility;
|
|
56
80
|
changes: readonly CompareChange[];
|
|
57
81
|
verification: CompareVerification;
|
|
58
82
|
/**
|
|
@@ -76,7 +100,7 @@ type AppliedComparison = {
|
|
|
76
100
|
* what you could not represent" and "give me nothing unless you can prove it"
|
|
77
101
|
* are both legitimate asks and only the caller knows which one it is making.
|
|
78
102
|
*/
|
|
79
|
-
declare const applyComparison: ({ reviewer, revisionStamp, granularity, numberingChanges }: ParsedComparison, planned: readonly PlannedStoryComparison[]) => Result<AppliedComparison, CompareDocxApplyError>;
|
|
103
|
+
declare const applyComparison: ({ reviewer, revisionStamp, granularity, revisionFormat, terminalTableCarrierStaged, numberingChanges, targetNumbering, targetNumberingReferences, targetNumberingReferenceMap, finalSectionComparison, styleImportFailure, pairs }: ParsedComparison, planned: readonly PlannedStoryComparison[]) => Result<AppliedComparison, CompareDocxApplyError | CompareDocxOperationLimitError>;
|
|
80
104
|
/**
|
|
81
105
|
* Stage 4: the result package, with every ZIP entry date pinned.
|
|
82
106
|
*
|