@stll/folio-core 0.40.0 → 0.42.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/README.md +16 -0
- package/dist/ai-edits/clean-text.d.ts +28 -6
- package/dist/ai-edits/clean-text.js +28 -13
- package/dist/ai-edits/headless.d.ts +12 -0
- package/dist/ai-edits/headless.js +26 -3
- package/dist/ai-edits/snapshot.d.ts +6 -1
- package/dist/ai-edits/snapshot.js +15 -10
- package/dist/ai-suggestions/text-positions.js +15 -3
- package/dist/compare/inline-atoms.js +2 -2
- package/dist/compat/eigenpal.d.ts +4 -3
- package/dist/compat/eigenpal.js +2 -1
- package/dist/display-list/primitives.d.ts +2 -1
- package/dist/document-operations.d.ts +3 -2
- package/dist/docx/blockPlainText.d.ts +8 -0
- package/dist/docx/blockPlainText.js +40 -0
- package/dist/docx/compatibility.d.ts +16 -2
- package/dist/docx/compatibility.js +30 -9
- package/dist/docx/footnoteParser.js +4 -23
- package/dist/docx/graphicFrameLocks.d.ts +22 -0
- package/dist/docx/graphicFrameLocks.js +55 -0
- package/dist/docx/groupDrawingParser.d.ts +7 -1
- package/dist/docx/groupDrawingParser.js +11 -2
- package/dist/docx/headerFooterParser.d.ts +5 -1
- package/dist/docx/headerFooterParser.js +7 -21
- package/dist/docx/imageParser.js +5 -0
- package/dist/docx/imageRawXml.d.ts +33 -1
- package/dist/docx/imageRawXml.js +56 -1
- package/dist/docx/rezip.d.ts +20 -3
- package/dist/docx/rezip.js +24 -13
- package/dist/docx/runParser.js +43 -21
- package/dist/docx/serializer/runSerializer.js +4 -2
- package/dist/docx/server/createBilingualDocument.js +31 -5
- package/dist/docx/shapeParser.js +32 -6
- package/dist/docx/vmlImageParser.d.ts +11 -1
- package/dist/docx/vmlImageParser.js +29 -2
- package/dist/index.d.ts +4 -3
- package/dist/index.js +2 -1
- package/dist/internal/compare/inline-presentation.d.ts +11 -3
- package/dist/internal/compare/inline-presentation.js +8 -1
- package/dist/prosemirror/attrs/index.js +33 -3
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +13 -2
- package/dist/prosemirror/conversion/fromProseDoc.js +80 -27
- package/dist/prosemirror/conversion/index.d.ts +2 -2
- package/dist/prosemirror/conversion/toProseDoc.js +10 -2
- package/dist/prosemirror/extensions/nodes/ImageExtension.js +6 -0
- package/dist/prosemirror/imageCommit.js +7 -3
- package/dist/prosemirror/runFormattingInlineCarriers.d.ts +16 -1
- package/dist/prosemirror/runFormattingInlineCarriers.js +20 -1
- package/dist/prosemirror/schema/nodes.d.ts +20 -0
- package/dist/server.d.ts +2 -2
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { imageRawXmlFingerprint } from "../../docx/imageRawXml.js";
|
|
1
|
+
import { EDITED_PREVIEW_FINGERPRINT, imageRawXmlFingerprint } from "../../docx/imageRawXml.js";
|
|
2
2
|
import { PROSE_PARAGRAPH_SOURCE_CONTRACT_ATTR, ParagraphPropertySourceValidationError, copyDocumentParagraphPropertySourceContract, copyDocumentParagraphPropertySources, copyParagraphPropertyCapture, copyParagraphPropertySource, decodeTableCellParagraphSourcePayload, getDocumentParagraphPropertySourceContract, getParagraphPropertySource, getParagraphPropertySourceCandidate, getParagraphPropertySourceToken, getParagraphPropertySourceTransferId, getProseDocumentParagraphPropertySourceContract, getProseParagraphPropertySourceToken, isParagraphPropertySourceToken, linkParagraphPropertySourceCandidate, paragraphPropertySourceBelongsToDocument, paragraphPropertySourceTokenMatchesContract, recreateProseNodeWithParagraphPropertySource, restoreTableCellsWithParagraphPropertySources, visitDocumentStoryParagraphs, visitTableCellParagraphPropertySourceBindings } from "../../docx/paragraphPropertySource.js";
|
|
3
3
|
import { visitDocxParagraphs } from "../../docx/paragraphTraversal.js";
|
|
4
4
|
import { ShapeOutlineStyleSchema, narrowEnum } from "../../docx/parserEnums.js";
|
|
@@ -429,9 +429,42 @@ function materializeNumberedRefValues(doc) {
|
|
|
429
429
|
};
|
|
430
430
|
return visit(doc);
|
|
431
431
|
}
|
|
432
|
-
|
|
432
|
+
const SERIALIZER_EMPTY_PAGE_FIELD_RESULT = "1";
|
|
433
|
+
const fieldResultHasExplicitPageBreak = (node) => extractParagraphContent(node, void 0, void 0, /* @__PURE__ */ new Map(), false).filter((content) => content.type === "run" || content.type === "hyperlink").some((content) => {
|
|
434
|
+
return (content.type === "run" ? [content] : content.children).some((run) => run.type === "run" && run.content.some((runContent) => runContent.type === "break" && runContent.breakType === "page"));
|
|
435
|
+
});
|
|
436
|
+
/**
|
|
437
|
+
* PAGE and NUMPAGES have a stable visible fallback. Other empty fields may
|
|
438
|
+
* intentionally have no result (for example an empty TOC); inventing a space
|
|
439
|
+
* changes their authored result on every save/reopen cycle. A field whose
|
|
440
|
+
* result already carries an explicit page break owns that break's run, so the
|
|
441
|
+
* fallback would displace it.
|
|
442
|
+
*/
|
|
443
|
+
function materializeSerializerFieldFallbacks(doc) {
|
|
444
|
+
const visit = (node) => {
|
|
445
|
+
if (node.type.name === "field" || node.type.name === "structuredField") {
|
|
446
|
+
const attrs = expectFieldAttrs(node);
|
|
447
|
+
return (attrs.fieldType === "PAGE" || attrs.fieldType === "NUMPAGES") && !attrs.displayText && !fieldResultHasExplicitPageBreak(node) ? recreateProseNodeWithParagraphPropertySource(node, { attrs: {
|
|
448
|
+
...node.attrs,
|
|
449
|
+
displayText: SERIALIZER_EMPTY_PAGE_FIELD_RESULT
|
|
450
|
+
} }) : node;
|
|
451
|
+
}
|
|
452
|
+
if (node.childCount === 0) return node;
|
|
453
|
+
const children = [];
|
|
454
|
+
let changed = false;
|
|
455
|
+
node.forEach((child) => {
|
|
456
|
+
const mappedChild = visit(child);
|
|
457
|
+
children.push(mappedChild);
|
|
458
|
+
changed ||= mappedChild !== child;
|
|
459
|
+
});
|
|
460
|
+
return changed ? recreateProseNodeWithParagraphPropertySource(node, { content: Fragment.fromArray(children) }) : node;
|
|
461
|
+
};
|
|
462
|
+
return visit(doc);
|
|
463
|
+
}
|
|
464
|
+
function extractBlocks(inputDoc, refResolution = "resolve", styleResolver = null, emptyFieldResult = "serializerFallback") {
|
|
433
465
|
const strippedDoc = stripSuggestedProvenance(inputDoc, styleResolver);
|
|
434
|
-
const
|
|
466
|
+
const refResolvedDoc = refResolution === "resolve" ? materializeNumberedRefValues(strippedDoc) : strippedDoc;
|
|
467
|
+
const pmDoc = emptyFieldResult === "serializerFallback" ? materializeSerializerFieldFallbacks(refResolvedDoc) : refResolvedDoc;
|
|
435
468
|
const blocks = [];
|
|
436
469
|
const textBoxAnchorMarkers = /* @__PURE__ */ new Map();
|
|
437
470
|
const documentCounts = buildDocumentTrackedChangeCounts(pmDoc);
|
|
@@ -474,7 +507,7 @@ function extractBlocks(inputDoc, refResolution = "resolve", styleResolver = null
|
|
|
474
507
|
pendingPageBreaks = 0;
|
|
475
508
|
} else if (node.type.name === "blockSdt") {
|
|
476
509
|
if (pendingPageBreaks > 0 && !appendPendingPageBreaksToPreviousParagraph()) flushPendingPageBreaks();
|
|
477
|
-
blocks.push(convertPMBlockSdt(node, styleResolver));
|
|
510
|
+
blocks.push(convertPMBlockSdt(node, styleResolver, emptyFieldResult));
|
|
478
511
|
previousStandaloneTextBox = null;
|
|
479
512
|
}
|
|
480
513
|
});
|
|
@@ -482,7 +515,7 @@ function extractBlocks(inputDoc, refResolution = "resolve", styleResolver = null
|
|
|
482
515
|
removeUnresolvedTextBoxAnchors(blocks, textBoxAnchorMarkers);
|
|
483
516
|
return blocks;
|
|
484
517
|
}
|
|
485
|
-
function convertPMBlockSdt(node, styleResolver) {
|
|
518
|
+
function convertPMBlockSdt(node, styleResolver, emptyFieldResult) {
|
|
486
519
|
const attrs = expectBlockSdtAttrs(node);
|
|
487
520
|
const properties = { sdtType: attrs.sdtType };
|
|
488
521
|
if (attrs.alias) properties.alias = attrs.alias;
|
|
@@ -500,7 +533,7 @@ function convertPMBlockSdt(node, styleResolver) {
|
|
|
500
533
|
if (attrs.rawEndPropertiesXml) properties.rawEndPropertiesXml = attrs.rawEndPropertiesXml;
|
|
501
534
|
if (attrs.rawSdtChildrenBeforeContent) properties.rawSdtChildrenBeforeContent = attrs.rawSdtChildrenBeforeContent;
|
|
502
535
|
if (attrs.rawSdtChildrenAfterContent) properties.rawSdtChildrenAfterContent = attrs.rawSdtChildrenAfterContent;
|
|
503
|
-
const extracted = extractBlocks(node.type.schema.node("doc", null, node.content), "inherit", styleResolver);
|
|
536
|
+
const extracted = extractBlocks(node.type.schema.node("doc", null, node.content), "inherit", styleResolver, emptyFieldResult);
|
|
504
537
|
return {
|
|
505
538
|
type: "blockSdt",
|
|
506
539
|
properties,
|
|
@@ -1691,18 +1724,7 @@ function createFieldFromNode(node, { baseParagraphFormatting, inheritedFormattin
|
|
|
1691
1724
|
paragraphMarkPrecedesStyle: paragraphMarkPrecedesStyle ?? false,
|
|
1692
1725
|
styleResolver: styleResolver ?? null
|
|
1693
1726
|
}).filter((content) => content.type === "run" || content.type === "hyperlink");
|
|
1694
|
-
const
|
|
1695
|
-
return (content.type === "run" ? [content] : content.children).some((run) => run.type === "run" && run.content.some((runContent) => runContent.type === "break" && runContent.breakType === "page"));
|
|
1696
|
-
});
|
|
1697
|
-
let displayText = attrs.displayText ?? "";
|
|
1698
|
-
if (!displayText && !hasExplicitPageBreak) switch (attrs.fieldType) {
|
|
1699
|
-
case "PAGE":
|
|
1700
|
-
displayText = "1";
|
|
1701
|
-
break;
|
|
1702
|
-
case "NUMPAGES":
|
|
1703
|
-
displayText = "1";
|
|
1704
|
-
break;
|
|
1705
|
-
}
|
|
1727
|
+
const displayText = attrs.displayText ?? "";
|
|
1706
1728
|
const displayRun = {
|
|
1707
1729
|
type: "run",
|
|
1708
1730
|
content: [{
|
|
@@ -1822,6 +1844,7 @@ function createImageRun(node) {
|
|
|
1822
1844
|
const imagePosition = imagePositionFromAttrs(attrs.position);
|
|
1823
1845
|
if (imagePosition) image.position = imagePosition;
|
|
1824
1846
|
if (attrs.layoutInCell !== void 0) image.layoutInCell = attrs.layoutInCell;
|
|
1847
|
+
if (attrs.frameLocks !== void 0) image.frameLocks = { ...attrs.frameLocks };
|
|
1825
1848
|
if (attrs.borderWidth && attrs.borderWidth > 0) {
|
|
1826
1849
|
const outline = {
|
|
1827
1850
|
width: pixelsToEmu(attrs.borderWidth),
|
|
@@ -1853,21 +1876,51 @@ function createImageRun(node) {
|
|
|
1853
1876
|
if (cropLeft !== void 0) crop.left = cropLeft;
|
|
1854
1877
|
image.crop = crop;
|
|
1855
1878
|
}
|
|
1879
|
+
const { paddingTop, paddingRight, paddingBottom, paddingLeft } = attrs;
|
|
1880
|
+
if (paddingTop !== void 0 || paddingRight !== void 0 || paddingBottom !== void 0 || paddingLeft !== void 0) {
|
|
1881
|
+
const padding = {};
|
|
1882
|
+
if (paddingTop !== void 0) padding.top = paddingTop;
|
|
1883
|
+
if (paddingRight !== void 0) padding.right = paddingRight;
|
|
1884
|
+
if (paddingBottom !== void 0) padding.bottom = paddingBottom;
|
|
1885
|
+
if (paddingLeft !== void 0) padding.left = paddingLeft;
|
|
1886
|
+
image.padding = padding;
|
|
1887
|
+
}
|
|
1856
1888
|
return {
|
|
1857
1889
|
type: "run",
|
|
1858
|
-
content: [attrs
|
|
1890
|
+
content: [drawingFromImageAttrs(image, attrs)]
|
|
1891
|
+
};
|
|
1892
|
+
}
|
|
1893
|
+
/**
|
|
1894
|
+
* Rebuild the `DrawingContent` union member the image node came from.
|
|
1895
|
+
*
|
|
1896
|
+
* Each branch is listed in full rather than spread over a base object, so a
|
|
1897
|
+
* field from one mode cannot leak into another.
|
|
1898
|
+
*/
|
|
1899
|
+
const drawingFromImageAttrs = (image, attrs) => {
|
|
1900
|
+
const mode = attrs._docxRawXmlMode;
|
|
1901
|
+
switch (mode) {
|
|
1902
|
+
case void 0: return {
|
|
1903
|
+
type: "drawing",
|
|
1904
|
+
image,
|
|
1905
|
+
...attrs._docxRawXml ? { rawXml: attrs._docxRawXml } : {},
|
|
1906
|
+
...attrs._docxRawXml ? { rawImageFingerprint: imageRawXmlFingerprint(image) } : {}
|
|
1907
|
+
};
|
|
1908
|
+
case DRAWING_RAW_XML_MODES.PRESERVE_ONLY: return {
|
|
1859
1909
|
type: "drawing",
|
|
1860
1910
|
image,
|
|
1861
1911
|
rawXml: attrs._docxRawXml ?? panic("Preservation-only ProseMirror image attrs must include raw XML."),
|
|
1862
1912
|
rawXmlMode: DRAWING_RAW_XML_MODES.PRESERVE_ONLY
|
|
1863
|
-
}
|
|
1913
|
+
};
|
|
1914
|
+
case DRAWING_RAW_XML_MODES.PREVIEW_ONLY: return {
|
|
1864
1915
|
type: "drawing",
|
|
1865
1916
|
image,
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1917
|
+
rawXml: attrs._docxRawXml ?? panic("Preview-only ProseMirror image attrs must include raw XML."),
|
|
1918
|
+
rawImageFingerprint: attrs._docxRawImageFingerprint === void 0 ? EDITED_PREVIEW_FINGERPRINT : imageRawXmlFingerprint(image),
|
|
1919
|
+
rawXmlMode: DRAWING_RAW_XML_MODES.PREVIEW_ONLY
|
|
1920
|
+
};
|
|
1921
|
+
default: return mode;
|
|
1922
|
+
}
|
|
1923
|
+
};
|
|
1871
1924
|
/**
|
|
1872
1925
|
* Create a Run from a ProseMirror shape node
|
|
1873
1926
|
*/
|
|
@@ -2973,8 +3026,8 @@ function updateDocumentContent(originalDocument, pmDoc) {
|
|
|
2973
3026
|
* Used for converting edited header/footer PM content back to the document
|
|
2974
3027
|
* model.
|
|
2975
3028
|
*/
|
|
2976
|
-
function proseDocToBlocks(pmDoc, baseContent, styles) {
|
|
2977
|
-
const blocks = extractBlocks(pmDoc, "resolve", styles ? createStyleEngine(styles) : null);
|
|
3029
|
+
function proseDocToBlocks(pmDoc, baseContent, styles, options) {
|
|
3030
|
+
const blocks = extractBlocks(pmDoc, "resolve", styles ? createStyleEngine(styles) : null, options?.emptyFieldResult ?? "serializerFallback");
|
|
2978
3031
|
const linkedSources = restoreLinkedParagraphPropertySources(blocks);
|
|
2979
3032
|
if (baseContent) restoreParagraphPropertySources(blocks, baseContent, linkedSources.targets, linkedSources.sources);
|
|
2980
3033
|
return blocks;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fromProseDoc, proseDocToBlocks, updateDocumentContent } from "./fromProseDoc.js";
|
|
1
|
+
import { EmptyFieldResultMode, ProseDocToBlocksOptions, fromProseDoc, proseDocToBlocks, updateDocumentContent } from "./fromProseDoc.js";
|
|
2
2
|
import { ToProseDocOptions, createEmptyDoc, headerFooterToProseDoc, toProseDoc } from "./toProseDoc.js";
|
|
3
3
|
import { ProseMirrorDocumentValidationIssue, ValidateProseMirrorDocumentResult, assertValidProseMirrorDocument, formatProseMirrorDocumentIssues, validateProseMirrorDocument } from "../validation.js";
|
|
4
|
-
export { type ProseMirrorDocumentValidationIssue, type ToProseDocOptions, type ValidateProseMirrorDocumentResult, assertValidProseMirrorDocument, createEmptyDoc, formatProseMirrorDocumentIssues, fromProseDoc, headerFooterToProseDoc, proseDocToBlocks, toProseDoc, updateDocumentContent, validateProseMirrorDocument };
|
|
4
|
+
export { type EmptyFieldResultMode, type ProseDocToBlocksOptions, type ProseMirrorDocumentValidationIssue, type ToProseDocOptions, type ValidateProseMirrorDocumentResult, assertValidProseMirrorDocument, createEmptyDoc, formatProseMirrorDocumentIssues, fromProseDoc, headerFooterToProseDoc, proseDocToBlocks, toProseDoc, updateDocumentContent, validateProseMirrorDocument };
|
|
@@ -24,6 +24,7 @@ import { resolveEffectiveTableCellFormatting } from "./effectiveTableCellFormatt
|
|
|
24
24
|
import { shadingToRunShadingAttrs } from "./runShadingMark.js";
|
|
25
25
|
import { sdtAttrsFromProperties } from "./sdtAttrs.js";
|
|
26
26
|
import { TaggedError, panic } from "better-result";
|
|
27
|
+
import { DRAWING_RAW_XML_MODES } from "@stll/docx-core/model";
|
|
27
28
|
//#region src/prosemirror/conversion/toProseDoc.ts
|
|
28
29
|
/** DOCX content that cannot be preserved by the editable ProseMirror model. */
|
|
29
30
|
var UnsupportedDocxToProseMirrorConversionError = class extends TaggedError("UnsupportedDocxToProseMirrorConversionError") {};
|
|
@@ -1588,7 +1589,8 @@ function convertRunContent(content, marks, formatting, textBoxAnchors) {
|
|
|
1588
1589
|
case "drawing": return [withRunBoundaryMarks(convertImage({
|
|
1589
1590
|
image: content.image,
|
|
1590
1591
|
rawXml: content.rawXml,
|
|
1591
|
-
rawXmlMode: content.rawXmlMode
|
|
1592
|
+
rawXmlMode: content.rawXmlMode,
|
|
1593
|
+
rawImageFingerprint: content.rawXmlMode === DRAWING_RAW_XML_MODES.PRESERVE_ONLY ? void 0 : content.rawImageFingerprint
|
|
1592
1594
|
}), marks)];
|
|
1593
1595
|
case "shape": {
|
|
1594
1596
|
const shp = content.shape;
|
|
@@ -1628,7 +1630,7 @@ function withRunBoundaryMarks(node, marks) {
|
|
|
1628
1630
|
if (!marks.some(({ type }) => type.name === "hyperlink" || type.name === "pageBreakRunOwner")) return node;
|
|
1629
1631
|
return node.mark(marks);
|
|
1630
1632
|
}
|
|
1631
|
-
function convertImage({ image, rawXml, rawXmlMode }) {
|
|
1633
|
+
function convertImage({ image, rawXml, rawXmlMode, rawImageFingerprint }) {
|
|
1632
1634
|
const imageSize = image.size;
|
|
1633
1635
|
const widthPx = imageSize?.width ? emuToPixels(imageSize.width) : void 0;
|
|
1634
1636
|
const heightPx = imageSize?.height ? emuToPixels(imageSize.height) : void 0;
|
|
@@ -1720,8 +1722,13 @@ function convertImage({ image, rawXml, rawXmlMode }) {
|
|
|
1720
1722
|
cropRight: image.crop?.right,
|
|
1721
1723
|
cropBottom: image.crop?.bottom,
|
|
1722
1724
|
cropLeft: image.crop?.left,
|
|
1725
|
+
paddingTop: image.padding?.top,
|
|
1726
|
+
paddingRight: image.padding?.right,
|
|
1727
|
+
paddingBottom: image.padding?.bottom,
|
|
1728
|
+
paddingLeft: image.padding?.left,
|
|
1723
1729
|
position,
|
|
1724
1730
|
layoutInCell: image.layoutInCell,
|
|
1731
|
+
frameLocks: image.frameLocks ? { ...image.frameLocks } : void 0,
|
|
1725
1732
|
borderWidth,
|
|
1726
1733
|
borderColor,
|
|
1727
1734
|
borderStyle,
|
|
@@ -1730,6 +1737,7 @@ function convertImage({ image, rawXml, rawXmlMode }) {
|
|
|
1730
1737
|
hlinkRId: image.hlinkRId,
|
|
1731
1738
|
_docxRawXml: rawXml,
|
|
1732
1739
|
_docxRawXmlMode: rawXmlMode,
|
|
1740
|
+
_docxRawImageFingerprint: rawImageFingerprint,
|
|
1733
1741
|
_docxObjectPreview: rawXml !== void 0 && /<(?:[A-Za-z_][\w.-]*:)?object(?:\s|>)/u.test(rawXml)
|
|
1734
1742
|
});
|
|
1735
1743
|
}
|
|
@@ -33,8 +33,13 @@ const ImageExtension = createNodeExtension({
|
|
|
33
33
|
cropRight: { default: null },
|
|
34
34
|
cropBottom: { default: null },
|
|
35
35
|
cropLeft: { default: null },
|
|
36
|
+
paddingTop: { default: null },
|
|
37
|
+
paddingRight: { default: null },
|
|
38
|
+
paddingBottom: { default: null },
|
|
39
|
+
paddingLeft: { default: null },
|
|
36
40
|
position: { default: null },
|
|
37
41
|
layoutInCell: { default: null },
|
|
42
|
+
frameLocks: { default: null },
|
|
38
43
|
borderWidth: { default: null },
|
|
39
44
|
borderColor: { default: null },
|
|
40
45
|
borderStyle: { default: null },
|
|
@@ -43,6 +48,7 @@ const ImageExtension = createNodeExtension({
|
|
|
43
48
|
hlinkRId: { default: null },
|
|
44
49
|
_docxRawXml: { default: null },
|
|
45
50
|
_docxRawXmlMode: { default: null },
|
|
51
|
+
_docxRawImageFingerprint: { default: null },
|
|
46
52
|
_docxObjectPreview: { default: null }
|
|
47
53
|
},
|
|
48
54
|
parseDOM: [{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { allowsDirectDrawingEdit } from "../docx/imageRawXml.js";
|
|
1
2
|
import { expectImageAttrs, mergeImageAttrs } from "./attrs/index.js";
|
|
2
|
-
import { DRAWING_RAW_XML_MODES } from "@stll/docx-core/model";
|
|
3
3
|
//#region src/prosemirror/imageCommit.ts
|
|
4
4
|
const MIN_IMAGE_PX = 20;
|
|
5
5
|
const MAX_IMAGE_PX = 2e3;
|
|
@@ -38,11 +38,15 @@ function isFloatingImage(node) {
|
|
|
38
38
|
"through"
|
|
39
39
|
].includes(wrapType) : false);
|
|
40
40
|
}
|
|
41
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Resolve the image node at `pmPos`, or null if it isn't an image or is one
|
|
43
|
+
* whose raw XML says more than the model does. Refusing the node leaves the
|
|
44
|
+
* rest of the document editable.
|
|
45
|
+
*/
|
|
42
46
|
function imageNodeAt(view, pmPos) {
|
|
43
47
|
const node = view.state.doc.nodeAt(pmPos);
|
|
44
48
|
if (!node || node.type.name !== "image") return null;
|
|
45
|
-
if (expectImageAttrs(node)._docxRawXmlMode
|
|
49
|
+
if (!allowsDirectDrawingEdit(expectImageAttrs(node)._docxRawXmlMode)) return null;
|
|
46
50
|
return node;
|
|
47
51
|
}
|
|
48
52
|
/**
|
|
@@ -26,6 +26,21 @@ declare const RUN_FORMATTING_INLINE_ATOM_DISPOSITIONS: Readonly<{
|
|
|
26
26
|
readonly textBoxAnchor: "not-a-run";
|
|
27
27
|
}>;
|
|
28
28
|
declare const runFormattingInlineControlCharacter: (node: Node) => string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Text an inline atom contributes to a flattened, reader-facing projection.
|
|
31
|
+
*
|
|
32
|
+
* A control-character carrier contributes its character; a field contributes its
|
|
33
|
+
* authored result, so a cross-reference reads as the text Word shows instead of
|
|
34
|
+
* vanishing. A field with no result contributes nothing: the placeholder
|
|
35
|
+
* `getFieldVisibleText` paints for the editor is a rendering decision, not
|
|
36
|
+
* document text, and one of its branches is the current date.
|
|
37
|
+
*/
|
|
38
|
+
declare const runFormattingInlineAtomCleanText: (node: Node) => string | null;
|
|
39
|
+
/**
|
|
40
|
+
* Document text an inline atom contributes, as opposed to a control character:
|
|
41
|
+
* today a field's authored result.
|
|
42
|
+
*/
|
|
43
|
+
declare const runFormattingInlineAtomResultText: (node: Node) => string | null;
|
|
29
44
|
declare const runFormattingInlineControlNodeName: (character: string) => string | null;
|
|
30
45
|
declare const runFormattingInlineAtomDisposition: (node: Node) => RunFormattingInlineAtomDisposition | null;
|
|
31
46
|
type RunFormattingCarrierRepresentation = {
|
|
@@ -74,4 +89,4 @@ declare const selectRunFormattingCarrierRepresentations: ({ doc, from, to }: Sel
|
|
|
74
89
|
/** Deterministic visible text for one logical formatting revision carrier. */
|
|
75
90
|
declare const runFormattingCarrierReviewText: (carrier: RunFormattingCarrier) => string;
|
|
76
91
|
//#endregion
|
|
77
|
-
export { RUN_FORMATTING_INLINE_ATOM_DISPOSITIONS, RunFormattingCarrier, RunFormattingCarrierRepresentation, RunFormattingInlineAtomDisposition, SelectedRunFormattingCarrierRepresentation, applyMarksToRunFormattingRepresentation, expandRunFormattingCarrier, runFormattingCarrierReviewText, runFormattingInlineAtomDisposition, runFormattingInlineControlCharacter, runFormattingInlineControlNodeName, selectRunFormattingCarrierRepresentations };
|
|
92
|
+
export { RUN_FORMATTING_INLINE_ATOM_DISPOSITIONS, RunFormattingCarrier, RunFormattingCarrierRepresentation, RunFormattingInlineAtomDisposition, SelectedRunFormattingCarrierRepresentation, applyMarksToRunFormattingRepresentation, expandRunFormattingCarrier, runFormattingCarrierReviewText, runFormattingInlineAtomCleanText, runFormattingInlineAtomDisposition, runFormattingInlineAtomResultText, runFormattingInlineControlCharacter, runFormattingInlineControlNodeName, selectRunFormattingCarrierRepresentations };
|
|
@@ -42,6 +42,25 @@ const runFormattingInlineControlCharacter = (node) => {
|
|
|
42
42
|
if (disposition === null) return null;
|
|
43
43
|
return CONTROL_CHARACTER_BY_DISPOSITION[disposition] ?? null;
|
|
44
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* Text an inline atom contributes to a flattened, reader-facing projection.
|
|
47
|
+
*
|
|
48
|
+
* A control-character carrier contributes its character; a field contributes its
|
|
49
|
+
* authored result, so a cross-reference reads as the text Word shows instead of
|
|
50
|
+
* vanishing. A field with no result contributes nothing: the placeholder
|
|
51
|
+
* `getFieldVisibleText` paints for the editor is a rendering decision, not
|
|
52
|
+
* document text, and one of its branches is the current date.
|
|
53
|
+
*/
|
|
54
|
+
const runFormattingInlineAtomCleanText = (node) => {
|
|
55
|
+
const disposition = runFormattingInlineAtomDisposition(node);
|
|
56
|
+
if (disposition === null) return null;
|
|
57
|
+
return runFormattingInlineAtomResultText(node) ?? CONTROL_CHARACTER_BY_DISPOSITION[disposition];
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Document text an inline atom contributes, as opposed to a control character:
|
|
61
|
+
* today a field's authored result.
|
|
62
|
+
*/
|
|
63
|
+
const runFormattingInlineAtomResultText = (node) => runFormattingInlineAtomDisposition(node) === "field-run" ? expectFieldAttrs(node).displayText ?? "" : null;
|
|
45
64
|
const runFormattingInlineControlNodeName = (character) => {
|
|
46
65
|
return Object.entries(RUN_FORMATTING_INLINE_ATOM_DISPOSITIONS).find(([, disposition]) => CONTROL_CHARACTER_BY_DISPOSITION[disposition] === character)?.[0] ?? null;
|
|
47
66
|
};
|
|
@@ -148,4 +167,4 @@ const runFormattingCarrierReviewText = (carrier) => {
|
|
|
148
167
|
}
|
|
149
168
|
};
|
|
150
169
|
//#endregion
|
|
151
|
-
export { RUN_FORMATTING_INLINE_ATOM_DISPOSITIONS, applyMarksToRunFormattingRepresentation, expandRunFormattingCarrier, runFormattingCarrierReviewText, runFormattingInlineAtomDisposition, runFormattingInlineControlCharacter, runFormattingInlineControlNodeName, selectRunFormattingCarrierRepresentations };
|
|
170
|
+
export { RUN_FORMATTING_INLINE_ATOM_DISPOSITIONS, applyMarksToRunFormattingRepresentation, expandRunFormattingCarrier, runFormattingCarrierReviewText, runFormattingInlineAtomCleanText, runFormattingInlineAtomDisposition, runFormattingInlineAtomResultText, runFormattingInlineControlCharacter, runFormattingInlineControlNodeName, selectRunFormattingCarrierRepresentations };
|
|
@@ -292,10 +292,25 @@ type ImageAttrs = {
|
|
|
292
292
|
cropRight?: number;
|
|
293
293
|
cropBottom?: number;
|
|
294
294
|
cropLeft?: number;
|
|
295
|
+
/**
|
|
296
|
+
* `wp:effectExtent` reservation, in EMU — not pixels like `dist*` above.
|
|
297
|
+
* Nothing renders it, and `emuToPixels` rounds (12700 EMU would land back
|
|
298
|
+
* as 9525), so the editor carries the authored units untouched.
|
|
299
|
+
*/
|
|
300
|
+
paddingTop?: number;
|
|
301
|
+
paddingRight?: number;
|
|
302
|
+
paddingBottom?: number;
|
|
303
|
+
paddingLeft?: number;
|
|
295
304
|
/** Position for floating images (horizontal and vertical alignment) */
|
|
296
305
|
position?: ImagePositionAttrs;
|
|
297
306
|
/** Use the containing table cell as the anchor's positioning scope (the OOXML default). */
|
|
298
307
|
layoutInCell?: boolean;
|
|
308
|
+
/**
|
|
309
|
+
* Authored `a:graphicFrameLocks`. Carried through the editor so a resize,
|
|
310
|
+
* which forces the serializer to regenerate DrawingML, cannot silently
|
|
311
|
+
* relax a lock the author set.
|
|
312
|
+
*/
|
|
313
|
+
frameLocks?: document_d_exports.ImageFrameLocks;
|
|
299
314
|
/** Border width in pixels */
|
|
300
315
|
borderWidth?: number;
|
|
301
316
|
/** Border color as CSS color string */
|
|
@@ -312,6 +327,11 @@ type ImageAttrs = {
|
|
|
312
327
|
_docxRawXml?: string;
|
|
313
328
|
/** Raw XML preserved without an editable image projection. */
|
|
314
329
|
_docxRawXmlMode?: document_d_exports.DrawingRawXmlMode;
|
|
330
|
+
/**
|
|
331
|
+
* The fingerprint captured with `_docxRawXml`. A preview-only drawing must
|
|
332
|
+
* compare against this rather than re-baseline on its own edited projection.
|
|
333
|
+
*/
|
|
334
|
+
_docxRawImageFingerprint?: string;
|
|
315
335
|
/** Embedded-object previews use their authored box as the exact line height. */
|
|
316
336
|
_docxObjectPreview?: boolean;
|
|
317
337
|
};
|
package/dist/server.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, DocumentPreset, Do
|
|
|
10
10
|
import { CreateEmptyDocumentOptions, createEmptyDocument } from "./utils/createDocument.js";
|
|
11
11
|
import { DocumentStyleCatalog, DocumentStyleCatalogEntry, ExtractDocumentStyleSetOptions, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, inspectDocumentStyles, inspectDocumentStylesFromDocx } from "./style-sets/extract.js";
|
|
12
12
|
import { STELLA_STYLE_SET_NAME, createStellaStyleDocumentPreset, createStellaStyleSet } from "./style-sets/stellaStyle.js";
|
|
13
|
-
import { createDocx } from "./docx/rezip.js";
|
|
13
|
+
import { DocumentPropertiesOptions, createDocx } from "./docx/rezip.js";
|
|
14
14
|
import { EnsureParaIdsError, EnsureParaIdsOptions, EnsureParaIdsResult, ensureParaIds } from "./docx/ensureParaIds.js";
|
|
15
15
|
import { FOLIO_DOCUMENT_METADATA_PROPERTIES, FOLIO_DOCUMENT_PRIVACY_TRANSFORMS, FolioDocumentMetadataProperty, FolioDocumentPrivacyArchiveError, FolioDocumentPrivacyOptions, FolioDocumentPrivacyReport, FolioDocumentPrivacyTransform, InvalidFolioDocumentPrivacyOptionsError, RewriteDocxMetadataPrivacyResult, isFolioDocumentPrivacyTransform, rewriteDocxMetadataPrivacy } from "./docx/metadataPrivacy.js";
|
|
16
16
|
import { ParseOptions, parseDocx } from "./docx/parser.js";
|
|
@@ -28,4 +28,4 @@ import { FOLIO_DOCX_PACKAGE_INSPECTION_DEFAULTS, FOLIO_DOCX_PACKAGE_INSPECTION_E
|
|
|
28
28
|
import { FOLIO_YJS_DOCX_MATERIALIZATION_ERROR_CODES, FOLIO_YJS_PROSEMIRROR_FRAGMENT_NAME, FOLIO_YJS_UPDATE_MAX_BYTES, FolioYjsDocxMaterializationError, FolioYjsDocxMaterializationErrorCode, MaterializeYjsDocxOptions, materializeYjsDocx } from "./docx/server/materializeYjsDocx.js";
|
|
29
29
|
import { GenerateRedlineDocxOptions, GenerateRedlineDocxResult, GenerateRedlineUnprocessedStory, InvalidGenerateRedlineDocxOptionsError, generateRedlineDocx } from "./redline.js";
|
|
30
30
|
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";
|
|
31
|
-
export { type ApplyDocxXmlPatchProposalArgs, type ApplyFolioAIEditsToBufferOptions, type ApplyFolioAIEditsToBufferResult, BILINGUAL_TABLE_LAYOUTS, type BilingualBorders, type BilingualParagraphRef, type BilingualRow, type BilingualRowKind, type BilingualTableLayout, type BilingualTableParagraphRef, type CreateBilingualDocumentOptions, type CreateBilingualDocumentResult, type CreateBilingualDocxOptions, type CreateBilingualDocxResult, type CreateCommentReplyInput, type CreateEmptyDocumentOptions, DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, type DeriveBlockIdInput, type DocumentPreset, type DocumentStyleCatalog, type DocumentStyleCatalogEntry, type DocumentStyleSet, DocxArchiveError, type DocxArchiveOptions, type DocxParagraphSource, type DocxTableRowKind, type DocxTableRowPosition, EnsureParaIdsError, type EnsureParaIdsOptions, type EnsureParaIdsResult, type EvaluateDocxXmlPatchProposalArgs, type ExtractDocumentStyleSetOptions, 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_LINE_SPACING_RULE_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, FOLIO_YJS_DOCX_MATERIALIZATION_ERROR_CODES, FOLIO_YJS_PROSEMIRROR_FRAGMENT_NAME, FOLIO_YJS_UPDATE_MAX_BYTES, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIBlockStructuralBoundary, type FolioAIComment, type FolioAIEditApplyMode, type FolioAIEditApplyResult, type FolioAIEditNormalization, type FolioAIEditNormalizationCode, type FolioAIEditOperation, type FolioAIEditPrecondition, type FolioAIEditSnapshot, type FolioAIInlineBooleanProperty, type FolioAIInlineFormatting, type FolioAIInlineFormattingPatch, type FolioAIParagraphSpacing, type FolioAITextRangeHandle, 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 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 FolioReviewedStory, type FolioReviewedView, type FolioStoryDiff, type FolioVersionBlockHandle, type FolioVersionChangeProperty, type FolioVersionComparisonPrivacyTransform, type FolioVersionComparisonScope, type FolioVersionDiff, type FolioVersionDiffPrivacyOptions, type FolioVersionDiffPrivacyReport, type FolioVersionDiffSegment, type FolioVersionDiffSummaryCounts, FolioYjsDocxMaterializationError, type FolioYjsDocxMaterializationErrorCode, type GenerateRedlineDocxOptions, type GenerateRedlineDocxResult, type GenerateRedlineUnprocessedStory, HEADING_LEVELS, type HeadingLevel, type InspectDocxPackageOptions, InvalidBilingualDocumentOptionsError, InvalidFolioDocumentOperationBatchError, InvalidFolioDocumentPrivacyOptionsError, InvalidFolioDocxXmlPatchProposalError, InvalidFolioDocxXmlPatchProposalOptionsError, InvalidFolioReportBuilderOptionsError, InvalidFolioVersionComparisonOptionsError, InvalidGenerateRedlineDocxOptionsError, type MaterializeYjsDocxOptions, type ParseOptions, type RewriteDocxMetadataPrivacyResult, STELLA_STYLE_SET_NAME, type TableCellSpec, UnsupportedFolioDocumentOperationVersionError, UnsupportedFolioDocxXmlPatchApplicationProfileError, UnsupportedFolioReviewedViewError, type ValidateDocxConformanceOptions, applyDocxXmlPatchProposal, applyFolioAIEditsToBuffer, applyFolioVersionDiffPrivacy, assertSupportedFolioDocumentOperationVersion, bookmark, compareDocxVersions, createBilingualDocument, createBilingualDocx, createDocx, createEmptyDocument, createFolioAITextRangeHandle, createStellaStyleDocumentPreset, createStellaStyleSet, createTableOfContentsField, deriveBlockId, docxToMarkdown, endnote, ensureParaIds, evaluateDocxXmlPatchProposal, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, extractDocxText, generateRedlineDocx, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, getFolioDocumentOutline, getFolioParaIdFromBlockId, hashFolioAIBlockText, heading, hyperlink, inspectDocumentStyles, inspectDocumentStylesFromDocx, inspectDocxPackage, isFolioAIContentBlock, isFolioBlockId, isFolioDocumentOperationModeSupported, isFolioDocumentPrivacyTransform, isFolioResolvedReviewedView, isFolioReviewedView, isFolioVersionComparisonPrivacyTransform, isFolioVersionComparisonScope, isSequentialFolioBlockId, isSupportedFolioDocumentOperationVersion, materializeYjsDocx, normalizeFolioAIBlockText, pageBreak, paragraph, parseDocx, parseFolioDocumentOperationBatch, parseFolioDocxXmlPatchProposal, readBilingualDocument, readBilingualDocx, readFolioDocumentSection, replyToComment, rewriteDocxMetadataPrivacy, run, table, validateDocxConformance };
|
|
31
|
+
export { type ApplyDocxXmlPatchProposalArgs, type ApplyFolioAIEditsToBufferOptions, type ApplyFolioAIEditsToBufferResult, BILINGUAL_TABLE_LAYOUTS, type BilingualBorders, type BilingualParagraphRef, type BilingualRow, type BilingualRowKind, type BilingualTableLayout, type BilingualTableParagraphRef, 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 DocxParagraphSource, type DocxTableRowKind, type DocxTableRowPosition, EnsureParaIdsError, type EnsureParaIdsOptions, type EnsureParaIdsResult, type EvaluateDocxXmlPatchProposalArgs, type ExtractDocumentStyleSetOptions, 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_LINE_SPACING_RULE_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, FOLIO_YJS_DOCX_MATERIALIZATION_ERROR_CODES, FOLIO_YJS_PROSEMIRROR_FRAGMENT_NAME, FOLIO_YJS_UPDATE_MAX_BYTES, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIBlockStructuralBoundary, type FolioAIComment, type FolioAIEditApplyMode, type FolioAIEditApplyResult, type FolioAIEditNormalization, type FolioAIEditNormalizationCode, type FolioAIEditOperation, type FolioAIEditPrecondition, type FolioAIEditSnapshot, type FolioAIInlineBooleanProperty, type FolioAIInlineFormatting, type FolioAIInlineFormattingPatch, type FolioAIParagraphSpacing, type FolioAITextRangeHandle, 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 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 FolioReviewedStory, type FolioReviewedView, type FolioStoryDiff, type FolioVersionBlockHandle, type FolioVersionChangeProperty, type FolioVersionComparisonPrivacyTransform, type FolioVersionComparisonScope, type FolioVersionDiff, type FolioVersionDiffPrivacyOptions, type FolioVersionDiffPrivacyReport, type FolioVersionDiffSegment, type FolioVersionDiffSummaryCounts, FolioYjsDocxMaterializationError, type FolioYjsDocxMaterializationErrorCode, type GenerateRedlineDocxOptions, type GenerateRedlineDocxResult, type GenerateRedlineUnprocessedStory, HEADING_LEVELS, type HeadingLevel, type InspectDocxPackageOptions, InvalidBilingualDocumentOptionsError, InvalidFolioDocumentOperationBatchError, InvalidFolioDocumentPrivacyOptionsError, InvalidFolioDocxXmlPatchProposalError, InvalidFolioDocxXmlPatchProposalOptionsError, InvalidFolioReportBuilderOptionsError, InvalidFolioVersionComparisonOptionsError, InvalidGenerateRedlineDocxOptionsError, type MaterializeYjsDocxOptions, type ParseOptions, type RewriteDocxMetadataPrivacyResult, STELLA_STYLE_SET_NAME, type TableCellSpec, UnsupportedFolioDocumentOperationVersionError, UnsupportedFolioDocxXmlPatchApplicationProfileError, UnsupportedFolioReviewedViewError, type ValidateDocxConformanceOptions, applyDocxXmlPatchProposal, applyFolioAIEditsToBuffer, applyFolioVersionDiffPrivacy, assertSupportedFolioDocumentOperationVersion, bookmark, compareDocxVersions, createBilingualDocument, createBilingualDocx, createDocx, createEmptyDocument, createFolioAITextRangeHandle, createStellaStyleDocumentPreset, createStellaStyleSet, createTableOfContentsField, deriveBlockId, docxToMarkdown, endnote, ensureParaIds, evaluateDocxXmlPatchProposal, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, extractDocxText, generateRedlineDocx, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, getFolioDocumentOutline, getFolioParaIdFromBlockId, hashFolioAIBlockText, heading, hyperlink, inspectDocumentStyles, inspectDocumentStylesFromDocx, inspectDocxPackage, isFolioAIContentBlock, isFolioBlockId, isFolioDocumentOperationModeSupported, isFolioDocumentPrivacyTransform, isFolioResolvedReviewedView, isFolioReviewedView, isFolioVersionComparisonPrivacyTransform, isFolioVersionComparisonScope, isSequentialFolioBlockId, isSupportedFolioDocumentOperationVersion, materializeYjsDocx, normalizeFolioAIBlockText, pageBreak, paragraph, parseDocx, parseFolioDocumentOperationBatch, parseFolioDocxXmlPatchProposal, readBilingualDocument, readBilingualDocx, readFolioDocumentSection, replyToComment, rewriteDocxMetadataPrivacy, run, table, validateDocxConformance };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/folio-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"description": "Headless, framework-neutral core of folio: the OOXML (.docx) parser, document model, ProseMirror integration, and page-layout engine. No React.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"document-model",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"perf": "bun scripts/profile-editor.ts"
|
|
122
122
|
},
|
|
123
123
|
"dependencies": {
|
|
124
|
-
"@stll/docx-core": "^0.
|
|
124
|
+
"@stll/docx-core": "^0.21.0",
|
|
125
125
|
"@stll/docx-utils": "^0.1.0",
|
|
126
126
|
"@stll/template-conditions": ">=0.4.0 <1.0.0",
|
|
127
127
|
"better-result": "3.0.1",
|