@stll/folio-core 0.47.7 → 0.49.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 +565 -121
- package/dist/ai-edits/minimal-replacement.d.ts +64 -0
- package/dist/ai-edits/minimal-replacement.js +282 -0
- package/dist/controller/fontReadiness.js +3 -3
- package/dist/controller/hyphenationReadiness.d.ts +19 -0
- package/dist/controller/hyphenationReadiness.js +47 -0
- package/dist/controller/layoutPipeline.d.ts +3 -0
- package/dist/controller/layoutPipeline.js +70 -18
- package/dist/display-list/build/buildDisplayList.js +39 -12
- package/dist/display-list/build/pageFurniture.d.ts +7 -1
- package/dist/display-list/build/pageFurniture.js +21 -8
- package/dist/display-list/build/paragraphPrimitives.js +68 -11
- package/dist/display-list/build/tablePrimitives.js +10 -6
- package/dist/display-list/build/textBoxPrimitives.js +1 -1
- package/dist/display-list/build/unsupported.d.ts +2 -2
- package/dist/display-list/build/unsupported.js +0 -0
- package/dist/display-list/dom/renderDisplayListToDom.js +0 -1
- package/dist/docx/attributeRemainder.js +10 -2
- package/dist/docx/blockContentParser.d.ts +2 -0
- package/dist/docx/blockContentParser.js +79 -64
- package/dist/docx/bulletMarkers.d.ts +18 -2
- package/dist/docx/bulletMarkers.js +27 -2
- package/dist/docx/commentParser.d.ts +2 -1
- package/dist/docx/commentParser.js +57 -45
- package/dist/docx/containerChildren.d.ts +21 -8
- package/dist/docx/containerChildren.js +39 -9
- package/dist/docx/documentParser.d.ts +5 -1
- package/dist/docx/documentParser.js +8 -5
- package/dist/docx/documentSectionFacts.d.ts +22 -0
- package/dist/docx/documentSectionFacts.js +43 -0
- package/dist/docx/drawingGroupChildren.d.ts +60 -0
- package/dist/docx/drawingGroupChildren.js +176 -0
- package/dist/docx/drawingUtils.js +3 -0
- package/dist/docx/fieldParser.d.ts +8 -1
- package/dist/docx/fieldParser.js +47 -3
- package/dist/docx/fontTableParser.js +34 -27
- package/dist/docx/footnoteParser.d.ts +3 -2
- package/dist/docx/footnoteParser.js +15 -12
- package/dist/docx/groupDrawingParser.d.ts +9 -2
- package/dist/docx/groupDrawingParser.js +125 -37
- package/dist/docx/headerFooterParser.d.ts +7 -2
- package/dist/docx/headerFooterParser.js +15 -5
- package/dist/docx/hyperlinkParser.d.ts +48 -36
- package/dist/docx/hyperlinkParser.js +97 -82
- package/dist/docx/numberingParser.js +108 -84
- package/dist/docx/packageParts.d.ts +45 -1
- package/dist/docx/packageParts.js +93 -2
- package/dist/docx/paraIdAttribute.d.ts +3 -2
- package/dist/docx/paragraphParser.d.ts +5 -1
- package/dist/docx/paragraphParser.js +468 -365
- package/dist/docx/paragraphProperties.js +123 -109
- package/dist/docx/paragraphPropertySource.d.ts +6 -1
- package/dist/docx/paragraphPropertySource.js +9 -1
- package/dist/docx/paragraphTextBoxEnrichment.d.ts +2 -1
- package/dist/docx/paragraphTextBoxEnrichment.js +143 -10
- package/dist/docx/parser.d.ts +7 -1
- package/dist/docx/parser.js +33 -16
- package/dist/docx/previewBudget.d.ts +55 -33
- package/dist/docx/previewBudget.js +59 -65
- package/dist/docx/rezip.js +41 -58
- package/dist/docx/runParser.d.ts +4 -1
- package/dist/docx/runParser.js +182 -184
- package/dist/docx/sdtProperties.js +87 -84
- package/dist/docx/sectionParser.js +169 -160
- package/dist/docx/selectiveSaveFlags.d.ts +10 -3
- package/dist/docx/selectiveSaveFlags.js +1 -1
- package/dist/docx/selectiveXmlPatch.d.ts +56 -34
- package/dist/docx/selectiveXmlPatch.js +222 -115
- package/dist/docx/serializer/groupTextBoxWriteBack.d.ts +12 -0
- package/dist/docx/serializer/groupTextBoxWriteBack.js +101 -0
- package/dist/docx/serializer/paragraphSerializer.js +47 -42
- package/dist/docx/serializer/runSerializer.d.ts +5 -1
- package/dist/docx/serializer/runSerializer.js +4 -3
- package/dist/docx/serializer/settingsSerializer.js +19 -1
- package/dist/docx/settingsParser.js +8 -0
- package/dist/docx/shapeAlternateContent.d.ts +25 -0
- package/dist/docx/shapeAlternateContent.js +52 -0
- package/dist/docx/streamingXmlParser.d.ts +6 -2
- package/dist/docx/streamingXmlParser.js +12 -7
- package/dist/docx/styleParser.js +34 -8
- package/dist/docx/tableParser.d.ts +21 -12
- package/dist/docx/tableParser.js +518 -441
- package/dist/docx/textBoxParser.d.ts +18 -5
- package/dist/docx/textBoxParser.js +12 -6
- package/dist/docx/verbatimCapture.d.ts +10 -8
- package/dist/docx/verbatimCapture.js +45 -2
- package/dist/docx/vmlImageParser.d.ts +15 -13
- package/dist/docx/vmlImageParser.js +75 -60
- package/dist/docx/vmlPreview.d.ts +3 -3
- package/dist/docx/vmlPreview.js +3 -4
- package/dist/docx/xmlNamespaceContext.d.ts +9 -0
- package/dist/docx/xmlNamespaceContext.js +54 -0
- package/dist/docx/xmlParser.d.ts +6 -3
- package/dist/docx/xmlParser.js +11 -41
- package/dist/docx/xmlResourceLimits.d.ts +2 -1
- package/dist/docx/xmlResourceLimits.js +4 -1
- package/dist/fonts/headlessMeasure.js +0 -0
- package/dist/headless-layout.d.ts +11 -2
- package/dist/headless-layout.js +153 -107
- package/dist/internal/headlessRevisionResolution.js +50 -13
- package/dist/internal/paragraphFormattingSerialization.js +3 -3
- package/dist/layout-bridge/convert/endnoteLayout.d.ts +65 -0
- package/dist/layout-bridge/convert/endnoteLayout.js +227 -0
- package/dist/layout-bridge/convert/footnoteLayout.d.ts +19 -3
- package/dist/layout-bridge/convert/footnoteLayout.js +40 -31
- package/dist/layout-bridge/convert/headerFooterLayout.d.ts +1 -7
- package/dist/layout-bridge/convert/headerFooterLayout.js +5 -20
- package/dist/layout-bridge/convert/paragraphMarkFormatting.d.ts +10 -0
- package/dist/layout-bridge/convert/paragraphMarkFormatting.js +59 -0
- package/dist/layout-bridge/convert/toFlowBlocks.d.ts +29 -1
- package/dist/layout-bridge/convert/toFlowBlocks.js +284 -39
- package/dist/layout-bridge/engine/hitTest.js +5 -3
- package/dist/layout-bridge/engine/selectionRects.js +5 -3
- package/dist/layout-engine/anchorLayoutInCellCompatibility.d.ts +10 -0
- package/dist/layout-engine/anchorLayoutInCellCompatibility.js +22 -0
- package/dist/layout-engine/index.d.ts +2 -2
- package/dist/layout-engine/index.js +102 -14
- package/dist/layout-engine/justificationCompatibility.d.ts +1 -1
- package/dist/layout-engine/justificationCompatibility.js +9 -5
- package/dist/layout-engine/keep-together.d.ts +15 -6
- package/dist/layout-engine/keep-together.js +43 -16
- package/dist/layout-engine/layoutInstrumentation.d.ts +8 -2
- package/dist/layout-engine/layoutInstrumentation.js +8 -1
- package/dist/layout-engine/measure/advanceComposition.js +50 -7
- package/dist/layout-engine/measure/hyphenationDictionaries.d.ts +74 -0
- package/dist/layout-engine/measure/hyphenationDictionaries.js +138 -0
- package/dist/layout-engine/measure/hyphenationPreload.d.ts +11 -0
- package/dist/layout-engine/measure/hyphenationPreload.js +24 -0
- package/dist/layout-engine/measure/lineBreakProvider.d.ts +12 -2
- package/dist/layout-engine/measure/lineBreakProvider.js +30 -30
- package/dist/layout-engine/measure/lineBreaks.d.ts +6 -1
- package/dist/layout-engine/measure/lineBreaks.js +10 -3
- package/dist/layout-engine/measure/listMarkerWidth.d.ts +9 -6
- package/dist/layout-engine/measure/listMarkerWidth.js +20 -22
- package/dist/layout-engine/measure/measureBlocks.js +46 -10
- package/dist/layout-engine/measure/measureContainer.js +51 -8
- package/dist/layout-engine/measure/measureHelpers.d.ts +15 -3
- package/dist/layout-engine/measure/measureHelpers.js +34 -8
- package/dist/layout-engine/measure/measureParagraph.js +143 -101
- package/dist/layout-engine/measure/measureTypes.d.ts +5 -0
- package/dist/layout-engine/measure/smallCapsCasing.d.ts +56 -0
- package/dist/layout-engine/measure/smallCapsCasing.js +88 -0
- package/dist/layout-engine/measure/tabCalculator.d.ts +2 -0
- package/dist/layout-engine/measure/tabCalculator.js +2 -1
- package/dist/layout-engine/measure/tableCellFloating.d.ts +2 -0
- package/dist/layout-engine/measure/tableCellFloating.js +51 -19
- package/dist/layout-engine/measure/tableCellGrid.d.ts +28 -3
- package/dist/layout-engine/measure/tableCellGrid.js +45 -5
- package/dist/layout-engine/measure/tableFragmentBorderGeometry.js +2 -1
- package/dist/layout-engine/noteAreaFlow.d.ts +19 -0
- package/dist/layout-engine/noteAreaFlow.js +83 -0
- package/dist/layout-engine/paginator.d.ts +12 -1
- package/dist/layout-engine/paginator.js +18 -2
- package/dist/layout-engine/paragraphSpacing.d.ts +4 -2
- package/dist/layout-engine/paragraphSpacing.js +2 -1
- package/dist/layout-engine/tableRowBreak.d.ts +8 -1
- package/dist/layout-engine/tableRowBreak.js +25 -2
- package/dist/layout-engine/types.d.ts +108 -3
- package/dist/layout-engine/types.js +96 -1
- package/dist/layout-painter/index.d.ts +3 -0
- package/dist/layout-painter/renderPage.js +32 -83
- package/dist/layout-painter/renderParagraph.d.ts +6 -1
- package/dist/layout-painter/renderParagraph.js +75 -26
- package/dist/layout-painter/renderTable.js +26 -13
- package/dist/layout-painter/renderTextBox.d.ts +12 -2
- package/dist/layout-painter/renderTextBox.js +26 -2
- package/dist/prosemirror/alternateContentAttrs.d.ts +9 -0
- package/dist/prosemirror/alternateContentAttrs.js +35 -0
- package/dist/prosemirror/attrs/index.d.ts +9 -9
- package/dist/prosemirror/attrs/index.js +133 -11
- package/dist/prosemirror/commands/comments.js +51 -41
- package/dist/prosemirror/contentControlRevisions.d.ts +43 -0
- package/dist/prosemirror/contentControlRevisions.js +84 -0
- package/dist/prosemirror/conversion/fromProseDoc.js +54 -23
- package/dist/prosemirror/conversion/markInterner.d.ts +21 -0
- package/dist/prosemirror/conversion/markInterner.js +90 -0
- package/dist/prosemirror/conversion/toProseDoc.js +117 -58
- package/dist/prosemirror/extensions/core/DocExtension.js +2 -1
- package/dist/prosemirror/extensions/core/ParagraphExtension.js +1 -0
- package/dist/prosemirror/extensions/features/AutoBidiDetectionExtension.d.ts +7 -7
- package/dist/prosemirror/extensions/features/AutoBidiDetectionExtension.js +7 -7
- package/dist/prosemirror/extensions/marks/markUtils.d.ts +6 -2
- package/dist/prosemirror/extensions/marks/markUtils.js +39 -51
- package/dist/prosemirror/extensions/nodes/FieldExtension.js +6 -3
- package/dist/prosemirror/extensions/nodes/SdtExtension.js +9 -2
- package/dist/prosemirror/extensions/nodes/ShapeExtension.js +1 -0
- package/dist/prosemirror/extensions/nodes/TextBoxExtension.js +5 -1
- package/dist/prosemirror/listMarker.d.ts +1 -0
- package/dist/prosemirror/listMarker.js +4 -2
- package/dist/prosemirror/listRenderingAttrs.d.ts +1 -0
- package/dist/prosemirror/listRenderingAttrs.js +3 -0
- package/dist/prosemirror/paragraphDirection.d.ts +29 -2
- package/dist/prosemirror/paragraphDirection.js +21 -2
- package/dist/prosemirror/plugins/suggestionMode.js +37 -8
- package/dist/prosemirror/rejoinRunCarriers.d.ts +27 -0
- package/dist/prosemirror/rejoinRunCarriers.js +66 -0
- package/dist/prosemirror/runIdentityAcrossRevisions.d.ts +10 -0
- package/dist/prosemirror/runIdentityAcrossRevisions.js +90 -0
- package/dist/prosemirror/schema/nodes.d.ts +50 -6
- package/dist/prosemirror/textBoxHostParagraph.d.ts +13 -0
- package/dist/prosemirror/textBoxHostParagraph.js +21 -0
- package/dist/prosemirror/validation.js +91 -80
- package/dist/types/content.d.ts +2 -2
- package/dist/utils/createDocument.js +10 -1
- package/dist/utils/scriptSegments.d.ts +33 -4
- package/dist/utils/scriptSegments.js +39 -6
- package/dist/utils/textFormattingMerge.d.ts +17 -3
- package/dist/utils/textFormattingMerge.js +18 -12
- package/dist/utils/trailingText.d.ts +22 -0
- package/dist/utils/trailingText.js +32 -0
- package/package.json +2 -2
- package/dist/layout-engine/justifiedLineFit.d.ts +0 -7
- package/dist/layout-engine/justifiedLineFit.js +0 -6
|
@@ -3,9 +3,25 @@ import { resolveRelativePath } from "./relsParser.js";
|
|
|
3
3
|
const CONTENT_TYPE_ELEMENT = /<(?:Default|Override)\b[^>]*?\/?>/giu;
|
|
4
4
|
const PART_NAME_ATTRIBUTE = /\bPartName\s*=\s*(?<quote>["'])(?<value>[^"']*)\k<quote>/u;
|
|
5
5
|
const RELATIONSHIP_ELEMENT = /<Relationship\b[^>]*?(?:\/>|>\s*<\/Relationship>)/giu;
|
|
6
|
+
const RELATIONSHIP_ID_ATTRIBUTE = /\bId\s*=\s*(?<quote>["'])(?<value>[^"']*)\k<quote>/u;
|
|
6
7
|
const TARGET_ATTRIBUTE = /\bTarget\s*=\s*(?<quote>["'])(?<value>[^"']*)\k<quote>/u;
|
|
7
8
|
const TARGET_MODE_ATTRIBUTE = /\bTargetMode\s*=\s*(?<quote>["'])(?<value>[^"']*)\k<quote>/u;
|
|
8
9
|
const CONTENT_TYPES_PATTERN = /^\[Content_Types\]\.xml$/iu;
|
|
10
|
+
/** Escape a string for literal use inside a `RegExp`. */
|
|
11
|
+
const escapeRegExp = (value) => value.replaceAll(/[.*+?^${}()|[\]\\]/gu, "\\$&");
|
|
12
|
+
/**
|
|
13
|
+
* The XML part a `.rels` part describes: `word/_rels/header1.xml.rels` ->
|
|
14
|
+
* `word/header1.xml`; the package-level `_rels/.rels` has no single owning
|
|
15
|
+
* part (its relationships are resolved by type, never by `r:id`), so it maps
|
|
16
|
+
* to `undefined`.
|
|
17
|
+
*/
|
|
18
|
+
const owningPartPath = (relsPath) => {
|
|
19
|
+
const slash = relsPath.lastIndexOf("/_rels/");
|
|
20
|
+
if (slash === -1) return;
|
|
21
|
+
const directory = relsPath.slice(0, slash);
|
|
22
|
+
const fileName = relsPath.slice(slash + 7).replace(/\.rels$/iu, "");
|
|
23
|
+
return fileName ? `${directory ? `${directory}/` : ""}${fileName}` : void 0;
|
|
24
|
+
};
|
|
9
25
|
/** Normalize a package path for comparison: lower case, no leading slash. */
|
|
10
26
|
const normalizePartPath = (path) => (path.startsWith("/") ? path.slice(1) : path).toLowerCase();
|
|
11
27
|
/**
|
|
@@ -80,8 +96,10 @@ const reconcilePackageReferences = async (zip, compressionLevel) => {
|
|
|
80
96
|
const present = presentPartPaths(zip);
|
|
81
97
|
const repair = {
|
|
82
98
|
danglingRelationships: [],
|
|
83
|
-
danglingOverrides: []
|
|
99
|
+
danglingOverrides: [],
|
|
100
|
+
orphanedIdReferences: []
|
|
84
101
|
};
|
|
102
|
+
const removedIdsByOwningPart = /* @__PURE__ */ new Map();
|
|
85
103
|
for (const { path, xml } of await readRelationshipParts(zip)) {
|
|
86
104
|
let dropped = false;
|
|
87
105
|
const pruned = xml.replaceAll(RELATIONSHIP_ELEMENT, (element) => {
|
|
@@ -89,6 +107,13 @@ const reconcilePackageReferences = async (zip, compressionLevel) => {
|
|
|
89
107
|
if (target === null || isPresent(present, target)) return element;
|
|
90
108
|
repair.danglingRelationships.push(target);
|
|
91
109
|
dropped = true;
|
|
110
|
+
const id = RELATIONSHIP_ID_ATTRIBUTE.exec(element)?.groups?.["value"];
|
|
111
|
+
const owningPart = owningPartPath(path);
|
|
112
|
+
if (id !== void 0 && owningPart !== void 0) {
|
|
113
|
+
const ids = removedIdsByOwningPart.get(owningPart) ?? /* @__PURE__ */ new Set();
|
|
114
|
+
ids.add(id);
|
|
115
|
+
removedIdsByOwningPart.set(owningPart, ids);
|
|
116
|
+
}
|
|
92
117
|
return "";
|
|
93
118
|
});
|
|
94
119
|
if (dropped) writePart({
|
|
@@ -98,6 +123,28 @@ const reconcilePackageReferences = async (zip, compressionLevel) => {
|
|
|
98
123
|
compressionLevel
|
|
99
124
|
});
|
|
100
125
|
}
|
|
126
|
+
for (const [partPath, ids] of removedIdsByOwningPart) {
|
|
127
|
+
const file = zip.file(partPath);
|
|
128
|
+
if (!file) continue;
|
|
129
|
+
const idPattern = [...ids].map((id) => escapeRegExp(id)).join("|");
|
|
130
|
+
const referencePattern = new RegExp(`\\s+r:[A-Za-z]+\\s*=\\s*(?<quote>["'])(?<id>${idPattern})\\k<quote>`, "gu");
|
|
131
|
+
const xml = await file.async("text");
|
|
132
|
+
const removedIds = /* @__PURE__ */ new Set();
|
|
133
|
+
const scrubbed = xml.replaceAll(referencePattern, (...args) => {
|
|
134
|
+
const groups = args.at(-1);
|
|
135
|
+
if (groups?.id !== void 0) removedIds.add(groups.id);
|
|
136
|
+
return "";
|
|
137
|
+
});
|
|
138
|
+
if (removedIds.size > 0) {
|
|
139
|
+
writePart({
|
|
140
|
+
zip,
|
|
141
|
+
path: partPath,
|
|
142
|
+
xml: scrubbed,
|
|
143
|
+
compressionLevel
|
|
144
|
+
});
|
|
145
|
+
for (const id of removedIds) repair.orphanedIdReferences.push(`${partPath}|${id}`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
101
148
|
const contentTypes = zip.file(CONTENT_TYPES_PATTERN)[0];
|
|
102
149
|
if (!contentTypes) return repair;
|
|
103
150
|
let droppedOverride = false;
|
|
@@ -116,5 +163,49 @@ const reconcilePackageReferences = async (zip, compressionLevel) => {
|
|
|
116
163
|
});
|
|
117
164
|
return repair;
|
|
118
165
|
};
|
|
166
|
+
/** Every `r:*`-style attribute value found anywhere in an XML part's text. */
|
|
167
|
+
const REFERENCE_ATTRIBUTE = /\br:[A-Za-z]+\s*=\s*(?<quote>["'])(?<id>[^"']*)\k<quote>/gu;
|
|
168
|
+
/**
|
|
169
|
+
* Verify the two invariants an OPC package must hold for a conforming
|
|
170
|
+
* consumer to accept it: every `r:*` reference in an XML part resolves in
|
|
171
|
+
* that part's own `.rels`, and every internal relationship target names a
|
|
172
|
+
* part the package actually holds.
|
|
173
|
+
*
|
|
174
|
+
* A read-only counterpart to {@link reconcilePackageReferences} — that
|
|
175
|
+
* function repairs a package by removing what does not resolve; this one
|
|
176
|
+
* only reports what still does not, so a test can assert a save produced
|
|
177
|
+
* nothing for it to find. Cheap enough to run after every repack in a test
|
|
178
|
+
* or a corpus-gate invariant: one pass over the `.rels` parts building an id
|
|
179
|
+
* census, one pass over the XML parts checking references against it.
|
|
180
|
+
*/
|
|
181
|
+
const checkPackageIntegrity = async (zip) => {
|
|
182
|
+
const present = presentPartPaths(zip);
|
|
183
|
+
const report = {
|
|
184
|
+
unresolvedReferences: [],
|
|
185
|
+
danglingRelationshipTargets: []
|
|
186
|
+
};
|
|
187
|
+
const idsByOwningPart = /* @__PURE__ */ new Map();
|
|
188
|
+
for (const { path, xml } of await readRelationshipParts(zip)) {
|
|
189
|
+
const owningPart = owningPartPath(path);
|
|
190
|
+
const ids = /* @__PURE__ */ new Set();
|
|
191
|
+
for (const element of xml.match(RELATIONSHIP_ELEMENT) ?? []) {
|
|
192
|
+
const id = RELATIONSHIP_ID_ATTRIBUTE.exec(element)?.groups?.["value"];
|
|
193
|
+
if (id !== void 0) ids.add(id);
|
|
194
|
+
const target = relationshipTarget(element, path);
|
|
195
|
+
if (target !== null && !isPresent(present, target)) report.danglingRelationshipTargets.push(`${path}|${target}`);
|
|
196
|
+
}
|
|
197
|
+
if (owningPart !== void 0) idsByOwningPart.set(owningPart, ids);
|
|
198
|
+
}
|
|
199
|
+
for (const [path, file] of Object.entries(zip.files)) {
|
|
200
|
+
if (file.dir || !normalizePartPath(path).endsWith(".xml")) continue;
|
|
201
|
+
const xml = await file.async("text");
|
|
202
|
+
const ids = idsByOwningPart.get(path);
|
|
203
|
+
for (const match of xml.matchAll(REFERENCE_ATTRIBUTE)) {
|
|
204
|
+
const id = match.groups?.["id"];
|
|
205
|
+
if (id !== void 0 && !ids?.has(id)) report.unresolvedReferences.push(`${path}|${id}`);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return report;
|
|
209
|
+
};
|
|
119
210
|
//#endregion
|
|
120
|
-
export { isUnsafePackagePath, reconcilePackageReferences, removeUnsafeEntries };
|
|
211
|
+
export { checkPackageIntegrity, isUnsafePackagePath, reconcilePackageReferences, removeUnsafeEntries };
|
|
@@ -85,8 +85,9 @@ declare const alignParagraphOrdinals: (base: readonly ParagraphIdentity[], revis
|
|
|
85
85
|
* describe one document — the source part and the model parsed from it — so
|
|
86
86
|
* {@link alignParagraphOrdinals}'s `consistent` is the whole of the question: a
|
|
87
87
|
* package with ids on some paragraphs proves its own alignment through them,
|
|
88
|
-
* and one with none is aligned
|
|
89
|
-
*
|
|
88
|
+
* and one with none is aligned exactly when the two sequences have the same
|
|
89
|
+
* length. The save asks this per story (main flow, text boxes), so a text box
|
|
90
|
+
* the model re-reads cannot misalign the main flow.
|
|
90
91
|
*/
|
|
91
92
|
type ParagraphIdentityPlan = {
|
|
92
93
|
identities: readonly ParagraphIdentity[];
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { document_d_exports } from "../types/document.js";
|
|
2
2
|
import { NumberingMap } from "./numberingParser.js";
|
|
3
3
|
import { XmlElement } from "./xmlParser.js";
|
|
4
|
+
import { PreviewLedger } from "./previewBudget.js";
|
|
4
5
|
import { StyleMap } from "./styleParser.js";
|
|
5
6
|
//#region src/docx/paragraphParser.d.ts
|
|
6
7
|
declare function parseParagraphPropertyChanges(pPr: XmlElement | null, theme: document_d_exports.Theme | null, currentFormatting: document_d_exports.ParagraphFormatting | undefined): document_d_exports.ParagraphPropertyChange[] | undefined;
|
|
7
8
|
type ParseParagraphOptions = {
|
|
8
9
|
inHeaderFooter?: boolean;
|
|
9
10
|
rootXmlns?: Record<string, string>;
|
|
11
|
+
/** The ledger of the package this paragraph belongs to. */
|
|
12
|
+
previews: PreviewLedger;
|
|
10
13
|
/** Delay run merging until a source-position-dependent enrichment pass completes. */
|
|
11
14
|
runConsolidation?: "immediate" | "deferred";
|
|
12
15
|
};
|
|
@@ -19,7 +22,8 @@ type ParseParagraphOptions = {
|
|
|
19
22
|
* @param numbering - Numbering definitions for list info
|
|
20
23
|
* @param rels - Relationship map for resolving hyperlink URLs
|
|
21
24
|
* @param media - Media files map for image data
|
|
22
|
-
* @param options - Parsing options for context-specific body behavior
|
|
25
|
+
* @param options - Parsing options for context-specific body behavior; a
|
|
26
|
+
* paragraph read without them charges its previews to no package
|
|
23
27
|
* @returns Parsed Paragraph object
|
|
24
28
|
*/
|
|
25
29
|
declare function parseParagraph(node: XmlElement, styles: StyleMap | null, theme: document_d_exports.Theme | null, numbering: NumberingMap | null, rels?: document_d_exports.RelationshipMap | null, media?: Map<string, document_d_exports.MediaFile> | null, options?: ParseParagraphOptions): document_d_exports.Paragraph;
|