@stll/folio-core 0.42.0 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-edits/headless.js +6 -5
- package/dist/ai-edits/index.d.ts +2 -2
- package/dist/ai-edits/index.js +2 -2
- package/dist/ai-edits/snapshot.js +13 -9
- package/dist/compare/content-alignment.js +16 -1
- package/dist/compare/inline-atoms.js +1 -1
- package/dist/compare/style-resources.js +6 -0
- package/dist/compat/eigenpal.d.ts +2 -2
- package/dist/controller/layoutPipeline.d.ts +2 -1
- package/dist/controller/layoutPipeline.js +5 -2
- package/dist/controller/layoutSession.d.ts +2 -1
- package/dist/controller/layoutSession.js +1 -0
- package/dist/docx/appVersionNormalization.d.ts +0 -18
- package/dist/docx/blockContentParser.js +10 -1
- package/dist/docx/blockRangeMarkers.d.ts +36 -0
- package/dist/docx/blockRangeMarkers.js +59 -0
- package/dist/docx/bookmarkParser.d.ts +2 -20
- package/dist/docx/bookmarkParser.js +6 -30
- package/dist/docx/borderParser.d.ts +13 -0
- package/dist/docx/borderParser.js +71 -0
- package/dist/docx/builtInStyles.d.ts +165 -0
- package/dist/docx/builtInStyles.js +239 -0
- package/dist/docx/commentIdNormalization.d.ts +10 -0
- package/dist/docx/commentIdNormalization.js +33 -0
- package/dist/docx/commentParser.d.ts +2 -1
- package/dist/docx/commentParser.js +34 -7
- package/dist/docx/commentReferenceNormalization.d.ts +4 -1
- package/dist/docx/commentReferenceNormalization.js +23 -14
- package/dist/docx/danglingRelationshipReferences.d.ts +15 -0
- package/dist/docx/danglingRelationshipReferences.js +30 -0
- package/dist/docx/defaultParagraphStyle.d.ts +39 -0
- package/dist/docx/defaultParagraphStyle.js +54 -0
- package/dist/docx/documentParser.d.ts +2 -1
- package/dist/docx/documentParser.js +2 -2
- package/dist/docx/drawingUtils.d.ts +8 -1
- package/dist/docx/drawingUtils.js +12 -3
- package/dist/docx/fieldParser.js +3 -5
- package/dist/docx/footnoteParser.d.ts +3 -2
- package/dist/docx/footnoteParser.js +19 -2
- package/dist/docx/groupDrawingParser.js +1 -1
- package/dist/docx/headerFooterRefParser.d.ts +15 -3
- package/dist/docx/headerFooterRefParser.js +51 -14
- package/dist/docx/headerFooterReferenceNormalization.d.ts +4 -1
- package/dist/docx/headerFooterReferenceNormalization.js +5 -1
- package/dist/docx/hyperlinkParser.js +11 -15
- package/dist/docx/imageParser.d.ts +1 -1
- package/dist/docx/imageParser.js +22 -18
- package/dist/docx/imageRawXml.js +5 -5
- package/dist/docx/markupRangeMarker.d.ts +15 -0
- package/dist/docx/markupRangeMarker.js +44 -0
- package/dist/docx/noteReferenceStyles.d.ts +29 -0
- package/dist/docx/noteReferenceStyles.js +70 -0
- package/dist/docx/numberingParser.js +2 -1
- package/dist/docx/numberingReference.d.ts +21 -0
- package/dist/docx/numberingReference.js +21 -0
- package/dist/docx/numberingReferenceNormalization.d.ts +14 -2
- package/dist/docx/numberingReferenceNormalization.js +51 -9
- package/dist/docx/paraIdRangeNormalization.d.ts +0 -19
- package/dist/docx/paragraphParser.js +69 -101
- package/dist/docx/paragraphPropertySource.js +1 -0
- package/dist/docx/paragraphTraversal.d.ts +37 -1
- package/dist/docx/paragraphTraversal.js +84 -1
- package/dist/docx/parseContext.d.ts +37 -0
- package/dist/docx/parseContext.js +67 -0
- package/dist/docx/parseWarningMessage.d.ts +6 -0
- package/dist/docx/parseWarningMessage.js +44 -0
- package/dist/docx/parser.js +86 -24
- package/dist/docx/relsParser.d.ts +28 -11
- package/dist/docx/relsParser.js +26 -13
- package/dist/docx/revisionIdNormalization.js +81 -7
- package/dist/docx/rezip.js +85 -27
- package/dist/docx/runConsolidator.js +1 -2
- package/dist/docx/runParser.d.ts +8 -1
- package/dist/docx/runParser.js +30 -48
- package/dist/docx/sectionParser.d.ts +2 -1
- package/dist/docx/sectionParser.js +21 -65
- package/dist/docx/serializer/borderSerializer.d.ts +1 -2
- package/dist/docx/serializer/commentSerializer.js +22 -9
- package/dist/docx/serializer/documentSerializer.d.ts +1 -5
- package/dist/docx/serializer/documentSerializer.js +6 -16
- package/dist/docx/serializer/headerFooterSerializer.js +5 -0
- package/dist/docx/serializer/markupRangeAttributes.d.ts +8 -0
- package/dist/docx/serializer/markupRangeAttributes.js +24 -0
- package/dist/docx/serializer/noteSerializer.js +5 -0
- package/dist/docx/serializer/paragraphSerializer.d.ts +1 -5
- package/dist/docx/serializer/paragraphSerializer.js +29 -35
- package/dist/docx/serializer/runSerializer.js +13 -7
- package/dist/docx/serializer/tableSerializer.js +28 -13
- package/dist/docx/serializer/textFormattingSerializer.d.ts +2 -3
- package/dist/docx/server/build.js +8 -1
- package/dist/docx/server/createBilingualDocument.js +15 -22
- package/dist/docx/server/extractDocxText.js +3 -4
- package/dist/docx/shadingParser.d.ts +6 -0
- package/dist/docx/shadingParser.js +32 -0
- package/dist/docx/shapeParser.js +3 -3
- package/dist/docx/styleParser.js +15 -89
- package/dist/docx/styleReferenceResolution.d.ts +36 -0
- package/dist/docx/styleReferenceResolution.js +51 -0
- package/dist/docx/tableLook.d.ts +57 -0
- package/dist/docx/tableLook.js +63 -0
- package/dist/docx/tableParser.d.ts +7 -9
- package/dist/docx/tableParser.js +64 -110
- package/dist/docx/textBoxParser.js +4 -4
- package/dist/docx/trackedMoveRangeNormalization.d.ts +3 -1
- package/dist/docx/trackedMoveRangeNormalization.js +11 -21
- package/dist/docx/transitionalSpelling.d.ts +13 -2
- package/dist/docx/transitionalSpelling.js +23 -1
- package/dist/docx/verbatimCapture.js +4 -11
- package/dist/docx/vmlImageParser.js +2 -2
- package/dist/docx/watermarkParser.js +2 -2
- package/dist/docx/xmlParser.d.ts +22 -32
- package/dist/docx/xmlParser.js +36 -21
- package/dist/index.d.ts +2 -2
- package/dist/internal/pageBreakRunSourceDescendantIndex.d.ts +2 -0
- package/dist/internal/pageBreakRunSourceDescendantIndex.js +9 -6
- package/dist/internal/paragraphFormattingSerialization.d.ts +2 -3
- package/dist/internal/paragraphFormattingSerialization.js +26 -6
- package/dist/layout-bridge/convert/footnoteLayout.js +2 -7
- package/dist/layout-bridge/convert/templatePreviewFlow.d.ts +19 -11
- package/dist/layout-bridge/convert/templatePreviewFlow.js +103 -38
- package/dist/layout-bridge/convert/toFlowBlocks.js +12 -3
- package/dist/layout-engine/index.d.ts +2 -2
- package/dist/layout-engine/index.js +2 -2
- package/dist/layout-engine/measure/measureBlocks.js +1 -6
- package/dist/layout-engine/types.d.ts +8 -2
- package/dist/layout-engine/types.js +35 -2
- package/dist/markdown/index.js +1 -1
- package/dist/markdown/internals.d.ts +6 -1
- package/dist/markdown/internals.js +14 -1
- package/dist/markdown/renderBlock.js +35 -21
- package/dist/markdown/renderParagraph.js +14 -5
- package/dist/markdown/renderRuns.js +4 -3
- package/dist/markdown/renderTable.js +4 -3
- package/dist/markdown/trailers.js +41 -7
- package/dist/markdown/types.d.ts +3 -7
- package/dist/prosemirror/attrs/index.js +2 -5
- package/dist/prosemirror/bookmarkBoundaryAttrs.d.ts +11 -1
- package/dist/prosemirror/bookmarkBoundaryAttrs.js +18 -3
- package/dist/prosemirror/commands/index.d.ts +3 -3
- package/dist/prosemirror/commands/index.js +2 -2
- package/dist/prosemirror/commands/pageBreak.js +12 -1
- package/dist/prosemirror/commands/paragraph.d.ts +3 -3
- package/dist/prosemirror/commands/paragraph.js +2 -2
- package/dist/prosemirror/commentIdAllocator.js +2 -7
- package/dist/prosemirror/conversion/fromProseDoc.js +131 -41
- package/dist/prosemirror/conversion/toProseDoc.d.ts +1 -14
- package/dist/prosemirror/conversion/toProseDoc.js +402 -328
- package/dist/prosemirror/extensions/core/ParagraphExtension.d.ts +14 -1
- package/dist/prosemirror/extensions/core/ParagraphExtension.js +11 -6
- package/dist/prosemirror/extensions/features/EmptyParagraphFormatExtension.js +3 -3
- package/dist/prosemirror/extensions/features/ListExtension.js +42 -4
- package/dist/prosemirror/extensions/features/PasteCleanupExtension.d.ts +4 -1
- package/dist/prosemirror/extensions/features/PasteCleanupExtension.js +6 -2
- package/dist/prosemirror/extensions/features/pastedHeadingStyles.d.ts +7 -0
- package/dist/prosemirror/extensions/features/pastedHeadingStyles.js +74 -0
- package/dist/prosemirror/extensions/marks/markUtils.d.ts +11 -3
- package/dist/prosemirror/extensions/marks/markUtils.js +98 -19
- package/dist/prosemirror/extensions/nodes/BookmarkBoundaryExtension.js +7 -3
- package/dist/prosemirror/extensions/nodes/ImageExtension.js +2 -1
- package/dist/prosemirror/extensions/nodes/ShapeExtension.js +1 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.js +15 -1
- package/dist/prosemirror/extensions/types.d.ts +2 -2
- package/dist/prosemirror/index.d.ts +3 -3
- package/dist/prosemirror/index.js +3 -3
- package/dist/prosemirror/insertOperations.d.ts +9 -2
- package/dist/prosemirror/insertOperations.js +9 -4
- package/dist/prosemirror/listMarker.js +2 -1
- package/dist/prosemirror/numberedRefFields.js +2 -1
- package/dist/prosemirror/pageBreakRunProjection.d.ts +11 -3
- package/dist/prosemirror/pageBreakRunProjection.js +16 -8
- package/dist/prosemirror/paragraphFormattingProvenance.d.ts +159 -0
- package/dist/prosemirror/paragraphFormattingProvenance.js +106 -0
- package/dist/prosemirror/plugins/documentStyles.d.ts +9 -1
- package/dist/prosemirror/plugins/documentStyles.js +11 -1
- package/dist/prosemirror/plugins/index.d.ts +2 -2
- package/dist/prosemirror/plugins/index.js +2 -2
- package/dist/prosemirror/plugins/revisionIds.d.ts +11 -2
- package/dist/prosemirror/plugins/revisionIds.js +21 -6
- package/dist/prosemirror/plugins/templatePreviewValues.d.ts +42 -1
- package/dist/prosemirror/plugins/templatePreviewValues.js +217 -14
- package/dist/prosemirror/runFormattingReconciliation.js +3 -2
- package/dist/prosemirror/runStyleFormatting.d.ts +1 -1
- package/dist/prosemirror/schema/nodes.d.ts +31 -0
- package/dist/prosemirror/styles/resolvedStyleAttrs.js +4 -1
- package/dist/prosemirror/styles/styleResolver.d.ts +9 -0
- package/dist/prosemirror/styles/styleResolver.js +15 -6
- package/dist/prosemirror/utils/visualLineNavigation.d.ts +22 -2
- package/dist/prosemirror/utils/visualLineNavigation.js +80 -63
- package/dist/style-engine/styleEngine.d.ts +4 -1
- package/dist/style-engine/styleEngine.js +3 -0
- package/dist/style-sets/extract.js +35 -11
- package/dist/style-sets/stellaStyle.js +46 -39
- package/dist/style-sets/styleSetNormalization.d.ts +19 -0
- package/dist/style-sets/styleSetNormalization.js +99 -0
- package/dist/types/content.d.ts +2 -2
- package/dist/utils/createDocument.js +145 -20
- package/dist/utils/headingCollector.d.ts +8 -5
- package/dist/utils/headingCollector.js +23 -25
- package/dist/utils/tableOfContentsStyle.js +9 -2
- package/package.json +3 -2
- package/dist/docx/textWhitespace.d.ts +0 -4
- package/dist/docx/textWhitespace.js +0 -4
- package/dist/layout-bridge/engine/tableWidthUtils.d.ts +0 -6
- package/dist/layout-bridge/engine/tableWidthUtils.js +0 -25
- package/dist/markdown/headings.d.ts +0 -13
- package/dist/markdown/headings.js +0 -20
|
@@ -4,7 +4,7 @@ import { isParagraphFrameTextBox } from "../paragraphFrame.js";
|
|
|
4
4
|
import { normalizeSectionBreakType } from "../section-breaks.js";
|
|
5
5
|
import { bandFragmentX, bandTopContentY, isPageFrameRelativeAnchor } from "../textBoxFlow.js";
|
|
6
6
|
import { getTextBoxGroupId } from "../textBoxGroup.js";
|
|
7
|
-
import { DEFAULT_TEXTBOX_MARGINS, floatingTextBoxReservesBand, floatingTextBoxWrapsText, resolveTableCellPadding, tableColumnsArePinned } from "../types.js";
|
|
7
|
+
import { DEFAULT_TEXTBOX_MARGINS, floatingTextBoxReservesBand, floatingTextBoxWrapsText, resolveTableCellPadding, resolveTableWidthPx, tableColumnsArePinned } from "../types.js";
|
|
8
8
|
import { getCachedParagraphMeasure, setCachedParagraphMeasure } from "./cache.js";
|
|
9
9
|
import { resolveFloatingTablePageX } from "./floatingTablePosition.js";
|
|
10
10
|
import { findClearLineY, measureParagraph } from "./measureParagraph.js";
|
|
@@ -59,11 +59,6 @@ function emuToPixels(emu) {
|
|
|
59
59
|
if (emu === void 0) return 0;
|
|
60
60
|
return Math.round(emu * 96 / 914400);
|
|
61
61
|
}
|
|
62
|
-
function resolveTableWidthPx(width, widthType, contentWidth) {
|
|
63
|
-
if (!width) return;
|
|
64
|
-
if (widthType === "pct") return contentWidth * width / 5e3;
|
|
65
|
-
if (widthType === "dxa" || !widthType || widthType === "auto") return Math.round(width / 20 * 1.333);
|
|
66
|
-
}
|
|
67
62
|
function measureTableBlock(tableBlock, contentWidth, fieldValues) {
|
|
68
63
|
let columnWidths = tableBlock.columnWidths ?? [];
|
|
69
64
|
const explicitWidthPx = resolveTableWidthPx(tableBlock.width, tableBlock.widthType, contentWidth);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OutlineStyleAttr } from "../types/documentEnumValues.js";
|
|
2
2
|
import { ImagePosition, ImageWrap, NumberFormat, SdtProperties, SdtType, ShapeTextBody, TableCellFormatting, TableWidthType, VerticalAlign } from "@stll/docx-core/model";
|
|
3
3
|
declare namespace types_d_exports {
|
|
4
|
-
export { BlockId, BorderStyle, CellBorderSpec, CellBorders, ColumnBreakBlock, ColumnBreakMeasure, ColumnLayout, DEFAULT_TEXTBOX_MARGINS, DEFAULT_TEXTBOX_WIDTH, DocumentPosition, FOOTNOTE_ENTRY_MARGIN_BOTTOM, FOOTNOTE_FALLBACK_LINE_HEIGHT, FOOTNOTE_SEPARATOR_HEIGHT, FieldRun, FloatingTablePosition, FlowBlock, FootnoteContent, Fragment, FragmentBase, HeaderFooterContent, HeaderFooterContentHeights, HeaderFooterLayout, HitTestResult, HyperlinkInfo, ImageBlock, ImageFragment, ImageMeasure, ImageRun, ImageRunPosition, Layout, LayoutOptions, LineBreakRun, ListMarkerFormatting, ListNumPr, MathRun, Measure, MeasuredLine, Page, PageBreakBlock, PageBreakMeasure, PageHeaderFooterRefs, PageMargins, ParagraphAttrs, ParagraphBlock, ParagraphBorders, ParagraphFragment, ParagraphIndent, ParagraphMeasure, ParagraphSpacing, RenderedPageBreakRun, Run, RunFormatting, SdtGroup, SectionBreakBlock, SectionBreakMeasure, SectionPageNumbering, TabAlignment, TabRun, TabStop, TableBlock, TableCell, TableCellMeasure, TableFragment, TableMeasure, TableRow, TableRowMeasure, TextBoxBlock, TextBoxFlowAttrs, TextBoxFragment, TextBoxMeasure, TextRun, floatingTextBoxReservesBand, floatingTextBoxWrapsText, getTableRowLeadingWidth, isFloatingImageRun, isFloatingTextBoxBlock, isTextWrappingFloatingImageRun, resolveTableCellPadding, tableColumnsArePinned };
|
|
4
|
+
export { BlockId, BorderStyle, CellBorderSpec, CellBorders, ColumnBreakBlock, ColumnBreakMeasure, ColumnLayout, DEFAULT_TEXTBOX_MARGINS, DEFAULT_TEXTBOX_WIDTH, DocumentPosition, FOOTNOTE_ENTRY_MARGIN_BOTTOM, FOOTNOTE_FALLBACK_LINE_HEIGHT, FOOTNOTE_SEPARATOR_HEIGHT, FieldRun, FloatingTablePosition, FlowBlock, FootnoteContent, Fragment, FragmentBase, HeaderFooterContent, HeaderFooterContentHeights, HeaderFooterLayout, HitTestResult, HyperlinkInfo, ImageBlock, ImageFragment, ImageMeasure, ImageRun, ImageRunPosition, Layout, LayoutOptions, LineBreakRun, ListMarkerFormatting, ListNumPr, MathRun, Measure, MeasuredLine, Page, PageBreakBlock, PageBreakMeasure, PageHeaderFooterRefs, PageMargins, ParagraphAttrs, ParagraphBlock, ParagraphBorders, ParagraphFragment, ParagraphIndent, ParagraphMeasure, ParagraphSpacing, RenderedPageBreakRun, Run, RunFormatting, SdtGroup, SectionBreakBlock, SectionBreakMeasure, SectionPageNumbering, TabAlignment, TabRun, TabStop, TableBlock, TableCell, TableCellMeasure, TableFragment, TableMeasure, TableRow, TableRowMeasure, TextBoxBlock, TextBoxFlowAttrs, TextBoxFragment, TextBoxMeasure, TextRun, floatingTextBoxReservesBand, floatingTextBoxWrapsText, getTableRowLeadingWidth, isFloatingImageRun, isFloatingTextBoxBlock, isTextWrappingFloatingImageRun, resolveTableCellPadding, resolveTableWidthPx, tableColumnsArePinned };
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Unique identifier for a block in the document.
|
|
@@ -1429,7 +1429,13 @@ declare function floatingTextBoxReservesBand(block: TextBoxFlowAttrs): boolean;
|
|
|
1429
1429
|
* and the painter both consult this so their line count and `white-space` agree.
|
|
1430
1430
|
*/
|
|
1431
1431
|
declare function tableColumnsArePinned(table: TableBlock): boolean;
|
|
1432
|
+
/**
|
|
1433
|
+
* Resolve a `w:tblW`/`w:tcW` pair to pixels. The single reader: measurement and
|
|
1434
|
+
* the footnote layout bridge both go through it so a table cannot be pinned in
|
|
1435
|
+
* one and autofitted in the other.
|
|
1436
|
+
*/
|
|
1437
|
+
declare function resolveTableWidthPx(width: number | undefined, widthType: TableWidthType | undefined, containerWidth: number): number | undefined;
|
|
1432
1438
|
/** Return the leading visual offset for a row with omitted grid columns. */
|
|
1433
1439
|
declare const getTableRowLeadingWidth: (row: TableRow, columnWidths: readonly number[]) => number;
|
|
1434
1440
|
//#endregion
|
|
1435
|
-
export { BlockId, BorderStyle, CellBorderSpec, CellBorders, ColumnBreakBlock, ColumnBreakMeasure, ColumnLayout, DEFAULT_TEXTBOX_MARGINS, DEFAULT_TEXTBOX_WIDTH, DocumentPosition, FOOTNOTE_ENTRY_MARGIN_BOTTOM, FOOTNOTE_FALLBACK_LINE_HEIGHT, FOOTNOTE_SEPARATOR_HEIGHT, FieldRun, FloatingTablePosition, FlowBlock, FootnoteContent, Fragment, FragmentBase, HeaderFooterContent, HeaderFooterContentHeights, HeaderFooterLayout, HitTestResult, HyperlinkInfo, ImageBlock, ImageFragment, ImageMeasure, ImageRun, ImageRunPosition, Layout, LayoutOptions, LineBreakRun, ListMarkerFormatting, ListNumPr, MathRun, Measure, MeasuredLine, Page, PageBreakBlock, PageBreakMeasure, PageHeaderFooterRefs, PageMargins, ParagraphAttrs, ParagraphBlock, ParagraphBorders, ParagraphFragment, ParagraphIndent, ParagraphMeasure, ParagraphSpacing, RenderedPageBreakRun, Run, RunFormatting, SdtGroup, SectionBreakBlock, SectionBreakMeasure, SectionPageNumbering, TabAlignment, TabRun, TabStop, TableBlock, TableCell, TableCellMeasure, TableFragment, TableMeasure, TableRow, TableRowMeasure, TextBoxBlock, TextBoxFlowAttrs, TextBoxFragment, TextBoxMeasure, TextRun, floatingTextBoxReservesBand, floatingTextBoxWrapsText, getTableRowLeadingWidth, isFloatingImageRun, isFloatingTextBoxBlock, isTextWrappingFloatingImageRun, resolveTableCellPadding, tableColumnsArePinned, types_d_exports };
|
|
1441
|
+
export { BlockId, BorderStyle, CellBorderSpec, CellBorders, ColumnBreakBlock, ColumnBreakMeasure, ColumnLayout, DEFAULT_TEXTBOX_MARGINS, DEFAULT_TEXTBOX_WIDTH, DocumentPosition, FOOTNOTE_ENTRY_MARGIN_BOTTOM, FOOTNOTE_FALLBACK_LINE_HEIGHT, FOOTNOTE_SEPARATOR_HEIGHT, FieldRun, FloatingTablePosition, FlowBlock, FootnoteContent, Fragment, FragmentBase, HeaderFooterContent, HeaderFooterContentHeights, HeaderFooterLayout, HitTestResult, HyperlinkInfo, ImageBlock, ImageFragment, ImageMeasure, ImageRun, ImageRunPosition, Layout, LayoutOptions, LineBreakRun, ListMarkerFormatting, ListNumPr, MathRun, Measure, MeasuredLine, Page, PageBreakBlock, PageBreakMeasure, PageHeaderFooterRefs, PageMargins, ParagraphAttrs, ParagraphBlock, ParagraphBorders, ParagraphFragment, ParagraphIndent, ParagraphMeasure, ParagraphSpacing, RenderedPageBreakRun, Run, RunFormatting, SdtGroup, SectionBreakBlock, SectionBreakMeasure, SectionPageNumbering, TabAlignment, TabRun, TabStop, TableBlock, TableCell, TableCellMeasure, TableFragment, TableMeasure, TableRow, TableRowMeasure, TextBoxBlock, TextBoxFlowAttrs, TextBoxFragment, TextBoxMeasure, TextRun, floatingTextBoxReservesBand, floatingTextBoxWrapsText, getTableRowLeadingWidth, isFloatingImageRun, isFloatingTextBoxBlock, isTextWrappingFloatingImageRun, resolveTableCellPadding, resolveTableWidthPx, tableColumnsArePinned, types_d_exports };
|
|
@@ -14,6 +14,7 @@ var types_exports = /* @__PURE__ */ __exportAll({
|
|
|
14
14
|
isFloatingTextBoxBlock: () => isFloatingTextBoxBlock,
|
|
15
15
|
isTextWrappingFloatingImageRun: () => isTextWrappingFloatingImageRun,
|
|
16
16
|
resolveTableCellPadding: () => resolveTableCellPadding,
|
|
17
|
+
resolveTableWidthPx: () => resolveTableWidthPx,
|
|
17
18
|
tableColumnsArePinned: () => tableColumnsArePinned
|
|
18
19
|
});
|
|
19
20
|
const DEFAULT_TABLE_CELL_PADDING = {
|
|
@@ -129,7 +130,39 @@ function floatingTextBoxReservesBand(block) {
|
|
|
129
130
|
*/
|
|
130
131
|
function tableColumnsArePinned(table) {
|
|
131
132
|
if (table.layout === "fixed") return true;
|
|
132
|
-
return table.widthType
|
|
133
|
+
return hasMeasuredTableWidth(table.widthType);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Whether `w:tblW`/`w:tcW`'s `w:w` is a measurement at all.
|
|
137
|
+
*
|
|
138
|
+
* Under `w:type="auto"` or `"nil"` (§17.18.87) the number is meaningless:
|
|
139
|
+
* `auto` asks the consumer to size the table to its content and `nil` declares
|
|
140
|
+
* no width, so both ignore `w:w` entirely. Word still writes a leftover value
|
|
141
|
+
* there, and reading it as twips pins a table that should autofit.
|
|
142
|
+
*/
|
|
143
|
+
function hasMeasuredTableWidth(widthType) {
|
|
144
|
+
switch (widthType) {
|
|
145
|
+
case "dxa":
|
|
146
|
+
case "pct": return true;
|
|
147
|
+
case "auto":
|
|
148
|
+
case "nil":
|
|
149
|
+
case void 0: return false;
|
|
150
|
+
default: return widthType;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const TWIPS_PER_INCH = 1440;
|
|
154
|
+
const PIXELS_PER_INCH = 96;
|
|
155
|
+
/** `w:type="pct"` measures in fiftieths of a percent, so 5000 is 100 %. */
|
|
156
|
+
const PERCENT_DENOMINATOR = 5e3;
|
|
157
|
+
/**
|
|
158
|
+
* Resolve a `w:tblW`/`w:tcW` pair to pixels. The single reader: measurement and
|
|
159
|
+
* the footnote layout bridge both go through it so a table cannot be pinned in
|
|
160
|
+
* one and autofitted in the other.
|
|
161
|
+
*/
|
|
162
|
+
function resolveTableWidthPx(width, widthType, containerWidth) {
|
|
163
|
+
if (width === void 0 || width <= 0 || !hasMeasuredTableWidth(widthType)) return;
|
|
164
|
+
if (widthType === "pct") return width / PERCENT_DENOMINATOR * containerWidth;
|
|
165
|
+
return width / TWIPS_PER_INCH * PIXELS_PER_INCH;
|
|
133
166
|
}
|
|
134
167
|
const tableRowOwnsNestedGrid = (row) => {
|
|
135
168
|
const cell = row.cells.length === 1 ? row.cells.at(0) : void 0;
|
|
@@ -142,4 +175,4 @@ const getTableRowLeadingWidth = (row, columnWidths) => {
|
|
|
142
175
|
return columnWidths.slice(0, row.gridBefore ?? 0).reduce((sum, columnWidth) => sum + columnWidth, 0);
|
|
143
176
|
};
|
|
144
177
|
//#endregion
|
|
145
|
-
export { DEFAULT_TEXTBOX_MARGINS, DEFAULT_TEXTBOX_WIDTH, FOOTNOTE_ENTRY_MARGIN_BOTTOM, FOOTNOTE_FALLBACK_LINE_HEIGHT, FOOTNOTE_SEPARATOR_HEIGHT, floatingTextBoxReservesBand, floatingTextBoxWrapsText, getTableRowLeadingWidth, isFloatingImageRun, isFloatingTextBoxBlock, isTextWrappingFloatingImageRun, resolveTableCellPadding, tableColumnsArePinned, types_exports };
|
|
178
|
+
export { DEFAULT_TEXTBOX_MARGINS, DEFAULT_TEXTBOX_WIDTH, FOOTNOTE_ENTRY_MARGIN_BOTTOM, FOOTNOTE_FALLBACK_LINE_HEIGHT, FOOTNOTE_SEPARATOR_HEIGHT, floatingTextBoxReservesBand, floatingTextBoxWrapsText, getTableRowLeadingWidth, isFloatingImageRun, isFloatingTextBoxBlock, isTextWrappingFloatingImageRun, resolveTableCellPadding, resolveTableWidthPx, tableColumnsArePinned, types_exports };
|
package/dist/markdown/index.js
CHANGED
|
@@ -19,7 +19,7 @@ function toMarkdownResult(doc, opts) {
|
|
|
19
19
|
return renderDocument(doc, opts);
|
|
20
20
|
}
|
|
21
21
|
function renderDocument(doc, opts = {}) {
|
|
22
|
-
const ctx = newContext(opts);
|
|
22
|
+
const ctx = newContext(opts, doc.package.styles);
|
|
23
23
|
const markdown = appendTrailers(ctx, doc, renderBlocks(ctx, doc.package, doc.package.document.content));
|
|
24
24
|
if (doc.warnings) ctx.warnings.unshift(...doc.warnings);
|
|
25
25
|
if (!markdown.trim()) ctx.warnings.push("document has no content");
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import { document_d_exports } from "../types/document.js";
|
|
1
2
|
import { MarkdownOptions, RenderContext } from "./types.js";
|
|
2
3
|
//#region src/markdown/internals.d.ts
|
|
3
4
|
/**
|
|
4
5
|
* Build a fresh `RenderContext` from caller options, applying defaults. The
|
|
5
6
|
* `footnotes` default is `"keep"` (folio addition over upstream #595).
|
|
7
|
+
*
|
|
8
|
+
* The document's styles are indexed once here: every paragraph asks the index
|
|
9
|
+
* whether it is a heading or a quote, so rebuilding it per paragraph would
|
|
10
|
+
* make the render quadratic.
|
|
6
11
|
*/
|
|
7
|
-
declare function newContext(opts?: MarkdownOptions): RenderContext;
|
|
12
|
+
declare function newContext(opts?: MarkdownOptions, styles?: document_d_exports.StyleDefinitions | undefined): RenderContext;
|
|
8
13
|
/**
|
|
9
14
|
* Push a warning into the context, deduplicating against existing entries so
|
|
10
15
|
* recurring messages appear at most once.
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
+
import { createBuiltInStyleIndex } from "../docx/builtInStyles.js";
|
|
1
2
|
//#region src/markdown/internals.ts
|
|
2
3
|
/**
|
|
4
|
+
* Internal helpers shared by the markdown converter: context construction and
|
|
5
|
+
* warning dedupe. Kept free of renderer imports so the renderers can import
|
|
6
|
+
* `pushWarning` without forming an import cycle (trailer emission, which needs
|
|
7
|
+
* `renderBlock`, lives in `trailers.ts`). Ported from eigenpal/docx-editor
|
|
8
|
+
* PR #595, trimmed to the sync continuous path.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
3
11
|
* Build a fresh `RenderContext` from caller options, applying defaults. The
|
|
4
12
|
* `footnotes` default is `"keep"` (folio addition over upstream #595).
|
|
13
|
+
*
|
|
14
|
+
* The document's styles are indexed once here: every paragraph asks the index
|
|
15
|
+
* whether it is a heading or a quote, so rebuilding it per paragraph would
|
|
16
|
+
* make the render quadratic.
|
|
5
17
|
*/
|
|
6
|
-
function newContext(opts = {}) {
|
|
18
|
+
function newContext(opts = {}, styles) {
|
|
7
19
|
return {
|
|
20
|
+
builtInStyles: createBuiltInStyleIndex(styles?.styles ?? [], styles?.docDefaults),
|
|
8
21
|
opts: {
|
|
9
22
|
annotations: opts.annotations ?? "html",
|
|
10
23
|
trackedChanges: opts.trackedChanges ?? "annotate",
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { cloneParagraphWithoutPropertySource } from "../docx/paragraphPropertySource.js";
|
|
2
2
|
import { renderParagraph } from "./renderParagraph.js";
|
|
3
3
|
import { renderTable } from "./renderTable.js";
|
|
4
|
+
import { panic } from "better-result";
|
|
4
5
|
//#region src/markdown/renderBlock.ts
|
|
5
6
|
/**
|
|
7
|
+
* Block-level dispatcher. Walks `BlockContent[]` and joins the rendered
|
|
8
|
+
* markdown for each block, suppressing redundant blank lines between list items
|
|
9
|
+
* of the same list. Ported from eigenpal/docx-editor PR #595.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
6
12
|
* In `trackedChanges: "clean"` mode every change is accepted. A paragraph whose
|
|
7
13
|
* end-of-paragraph mark is a pending deletion (`pPrMark.kind === "del"`) loses
|
|
8
14
|
* its break on accept and merges with the following paragraph. Word's join
|
|
@@ -34,30 +40,38 @@ function renderBlocks(ctx, pkg, blocks) {
|
|
|
34
40
|
const out = [];
|
|
35
41
|
let prevWasListItem = false;
|
|
36
42
|
const ordered = ctx.opts.trackedChanges === "clean" ? mergeAcceptedParagraphBreaks(blocks) : blocks;
|
|
37
|
-
for (const block of ordered)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
for (const block of ordered) switch (block.type) {
|
|
44
|
+
case "paragraph": {
|
|
45
|
+
const isListItem = !!block.listRendering && !block.listRendering.markerHidden;
|
|
46
|
+
const md = renderParagraph(ctx, pkg, block);
|
|
47
|
+
if (!md) {
|
|
48
|
+
prevWasListItem = false;
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (isListItem && prevWasListItem) out.push(md);
|
|
52
|
+
else if (out.length) out.push("", md);
|
|
53
|
+
else out.push(md);
|
|
54
|
+
prevWasListItem = isListItem;
|
|
55
|
+
break;
|
|
43
56
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
out.push(md);
|
|
57
|
+
case "table": {
|
|
58
|
+
const md = renderTable(ctx, pkg, block);
|
|
59
|
+
if (md) {
|
|
60
|
+
if (out.length) out.push("");
|
|
61
|
+
out.push(md);
|
|
62
|
+
}
|
|
63
|
+
prevWasListItem = false;
|
|
64
|
+
break;
|
|
53
65
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
case "blockSdt": {
|
|
67
|
+
const nested = renderBlocks(ctx, pkg, block.content);
|
|
68
|
+
if (nested) {
|
|
69
|
+
if (out.length) out.push("");
|
|
70
|
+
out.push(nested);
|
|
71
|
+
}
|
|
72
|
+
break;
|
|
60
73
|
}
|
|
74
|
+
default: panic(`Unsupported block content in markdown: ${JSON.stringify(block)}`);
|
|
61
75
|
}
|
|
62
76
|
return out.join("\n");
|
|
63
77
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { isQuoteStyle, resolveHeadingLevel } from "../docx/builtInStyles.js";
|
|
1
2
|
import { resolveListTemplate } from "../prosemirror/listMarker.js";
|
|
2
|
-
import { isHeadingStyle, parseHeadingLevel } from "./headings.js";
|
|
3
3
|
import { renderParagraphInline } from "./renderRuns.js";
|
|
4
4
|
//#region src/markdown/renderParagraph.ts
|
|
5
5
|
/**
|
|
@@ -8,7 +8,13 @@ import { renderParagraphInline } from "./renderRuns.js";
|
|
|
8
8
|
* marker preserved); plain prose → escaped inline content. Word's `Quote` /
|
|
9
9
|
* `IntenseQuote` styles become blockquotes. Ported from eigenpal/docx-editor
|
|
10
10
|
* PR #595.
|
|
11
|
+
*
|
|
12
|
+
* Which paragraphs those are is `builtInStyles`' decision, not this file's: the
|
|
13
|
+
* id `Nadpis1` and the id `Heading1` are the same heading, and `ClauseHeading1`
|
|
14
|
+
* is not one at all.
|
|
11
15
|
*/
|
|
16
|
+
/** Markdown has six heading levels; Word has nine. */
|
|
17
|
+
const MAX_MARKDOWN_HEADING_LEVEL = 6;
|
|
12
18
|
/**
|
|
13
19
|
* Render a paragraph and return the block text. No surrounding blank line: the
|
|
14
20
|
* caller joins blocks.
|
|
@@ -16,13 +22,16 @@ import { renderParagraphInline } from "./renderRuns.js";
|
|
|
16
22
|
function renderParagraph(ctx, pkg, para) {
|
|
17
23
|
const inline = renderParagraphInline(ctx, pkg, para.content, para.paraId);
|
|
18
24
|
const styleId = para.formatting?.styleId;
|
|
19
|
-
|
|
25
|
+
const headingLevel = resolveHeadingLevel({
|
|
26
|
+
outlineLevel: para.formatting?.outlineLevel,
|
|
27
|
+
styleId
|
|
28
|
+
}, ctx.builtInStyles);
|
|
29
|
+
if (headingLevel !== void 0) {
|
|
20
30
|
if (!inline) return "";
|
|
21
|
-
|
|
22
|
-
return `${"#".repeat(Math.max(1, Math.min(6, level)))} ${inline}`;
|
|
31
|
+
return `${"#".repeat(Math.min(MAX_MARKDOWN_HEADING_LEVEL, headingLevel + 1))} ${inline}`;
|
|
23
32
|
}
|
|
24
33
|
if (para.listRendering && !para.listRendering.markerHidden) return renderListItem(ctx, para.listRendering, inline);
|
|
25
|
-
if (styleId
|
|
34
|
+
if (isQuoteStyle(styleId, ctx.builtInStyles)) return inline.split("\n").map((line) => `> ${line}`).join("\n");
|
|
26
35
|
return escapeLeadingBlockMarker(inline);
|
|
27
36
|
}
|
|
28
37
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RELATIONSHIP_TYPES, resolveRelationshipIdOfType } from "../docx/relsParser.js";
|
|
1
2
|
import { decodeOoxmlSymbolCharacter } from "../utils/ooxmlSymbol.js";
|
|
2
3
|
import { wrapComment, wrapDeletion, wrapInsertion, wrapMoveFrom, wrapMoveTo } from "./annotations.js";
|
|
3
4
|
import { escapeAltText, escapeInline, escapeLinkUrl } from "./escape.js";
|
|
@@ -88,8 +89,8 @@ function renderRunContent(ctx, pkg, content, paraId) {
|
|
|
88
89
|
break;
|
|
89
90
|
}
|
|
90
91
|
case "drawing": {
|
|
91
|
-
const ref = pkg?.relationships
|
|
92
|
-
const media = ref ? pkg?.media?.get(ref.target) : void 0;
|
|
92
|
+
const ref = resolveRelationshipIdOfType(pkg?.relationships, item.image.rId, RELATIONSHIP_TYPES.image);
|
|
93
|
+
const media = ref.status === "resolved" ? pkg?.media?.get(ref.relationship.target) : void 0;
|
|
93
94
|
if (media) {
|
|
94
95
|
const reg = registerImage(ctx, media, item.image, paraId);
|
|
95
96
|
const alt = reg.alt ? escapeAltText(reg.alt) : "";
|
|
@@ -101,7 +102,7 @@ function renderRunContent(ctx, pkg, content, paraId) {
|
|
|
101
102
|
out += ``;
|
|
102
103
|
break;
|
|
103
104
|
}
|
|
104
|
-
pushWarning(ctx, `image rId=${item.image.rId} not resolvable`);
|
|
105
|
+
pushWarning(ctx, `image rId=${item.image.rId ?? "(absent)"} not resolvable`);
|
|
105
106
|
break;
|
|
106
107
|
}
|
|
107
108
|
case "shape":
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RELATIONSHIP_TYPES, resolveRelationshipIdOfType } from "../docx/relsParser.js";
|
|
1
2
|
import { decodeOoxmlSymbolCharacter } from "../utils/ooxmlSymbol.js";
|
|
2
3
|
import { escapeTableCell } from "./escape.js";
|
|
3
4
|
import { registerImage } from "./images.js";
|
|
@@ -185,8 +186,8 @@ function renderHtmlRun(ctx, pkg, run, paraId) {
|
|
|
185
186
|
break;
|
|
186
187
|
case "softHyphen": break;
|
|
187
188
|
case "drawing": {
|
|
188
|
-
const ref = pkg?.relationships
|
|
189
|
-
const media = ref ? pkg?.media?.get(ref.target) : void 0;
|
|
189
|
+
const ref = resolveRelationshipIdOfType(pkg?.relationships, item.image.rId, RELATIONSHIP_TYPES.image);
|
|
190
|
+
const media = ref.status === "resolved" ? pkg?.media?.get(ref.relationship.target) : void 0;
|
|
190
191
|
if (media) {
|
|
191
192
|
const reg = registerImage(ctx, media, item.image, paraId);
|
|
192
193
|
const alt = reg.alt ? escapeHtml(reg.alt) : "";
|
|
@@ -198,7 +199,7 @@ function renderHtmlRun(ctx, pkg, run, paraId) {
|
|
|
198
199
|
text += `<img src="${escapeHtml(item.image.src)}" alt="${alt}">`;
|
|
199
200
|
break;
|
|
200
201
|
}
|
|
201
|
-
pushWarning(ctx, `image rId=${item.image.rId} not resolvable`);
|
|
202
|
+
pushWarning(ctx, `image rId=${item.image.rId ?? "(absent)"} not resolvable`);
|
|
202
203
|
break;
|
|
203
204
|
}
|
|
204
205
|
case "footnoteRef":
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { escapeLinkUrl } from "./escape.js";
|
|
2
2
|
import { renderBlocks } from "./renderBlock.js";
|
|
3
|
+
import { panic } from "better-result";
|
|
3
4
|
//#region src/markdown/trailers.ts
|
|
4
5
|
/**
|
|
6
|
+
* Trailer sections appended after the document body: footnote definitions, the
|
|
7
|
+
* hyperlink reference list (`hyperlinks: "reference"`), and the comments
|
|
8
|
+
* sidecar (`comments: "sidecar"`). Split out of `internals` so the renderers
|
|
9
|
+
* can import `pushWarning` without pulling in `renderBlock` (which would form an
|
|
10
|
+
* import cycle). Ported from eigenpal/docx-editor PR #595.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
5
13
|
* Append footnote definitions, the hyperlink reference list (for
|
|
6
14
|
* `hyperlinks: "reference"`), and the comments sidecar block (for
|
|
7
15
|
* `comments: "sidecar"`). Each section is emitted only when its corresponding
|
|
@@ -41,13 +49,39 @@ function runText(run) {
|
|
|
41
49
|
/** Flatten paragraph inline content to plain text, recursing through wrappers. */
|
|
42
50
|
function inlineText(content) {
|
|
43
51
|
let out = "";
|
|
44
|
-
for (const item of content)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
for (const item of content) switch (item.type) {
|
|
53
|
+
case "run":
|
|
54
|
+
out += runText(item);
|
|
55
|
+
break;
|
|
56
|
+
case "hyperlink":
|
|
57
|
+
for (const child of item.children) if (child.type === "run") out += runText(child);
|
|
58
|
+
break;
|
|
59
|
+
case "complexField":
|
|
60
|
+
out += inlineText(item.fieldResult);
|
|
61
|
+
break;
|
|
62
|
+
case "simpleField":
|
|
63
|
+
case "insertion":
|
|
64
|
+
case "deletion":
|
|
65
|
+
case "moveFrom":
|
|
66
|
+
case "moveTo":
|
|
67
|
+
case "inlineSdt":
|
|
68
|
+
case "bidiWrapper":
|
|
69
|
+
out += inlineText(item.content);
|
|
70
|
+
break;
|
|
71
|
+
case "mathEquation":
|
|
72
|
+
out += item.plainText ?? "";
|
|
73
|
+
break;
|
|
74
|
+
case "bookmarkStart":
|
|
75
|
+
case "bookmarkEnd":
|
|
76
|
+
case "commentRangeStart":
|
|
77
|
+
case "commentRangeEnd":
|
|
78
|
+
case "commentReference":
|
|
79
|
+
case "moveFromRangeStart":
|
|
80
|
+
case "moveFromRangeEnd":
|
|
81
|
+
case "moveToRangeStart":
|
|
82
|
+
case "moveToRangeEnd": break;
|
|
83
|
+
default: panic(`Unsupported paragraph content in trailer text: ${JSON.stringify(item)}`);
|
|
84
|
+
}
|
|
51
85
|
return out;
|
|
52
86
|
}
|
|
53
87
|
//#endregion
|
package/dist/markdown/types.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
+
import { BuiltInStyleIndex } from "../docx/builtInStyles.js";
|
|
1
2
|
//#region src/markdown/types.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Types for the DOCX-document → Markdown converter (ported from eigenpal
|
|
4
|
-
* /docx-editor PR #595). This is folio's v1 surface: the synchronous,
|
|
5
|
-
* continuous (non-paged) `toMarkdown(Document)` path. The paged + async +
|
|
6
|
-
* image-handler variants from upstream are not ported (skills bodies have no
|
|
7
|
-
* images today); they can be added later if needed.
|
|
8
|
-
*/
|
|
9
3
|
/**
|
|
10
4
|
* Metadata describing a single image registration. Owned by the markdown
|
|
11
5
|
* module so its public surface is independent of the docx model's drawing
|
|
@@ -134,6 +128,8 @@ type RenderContext = {
|
|
|
134
128
|
listCounters: Map<number, number[]>;
|
|
135
129
|
/** `numId:level` pairs already seen, so a start override applies once. */
|
|
136
130
|
listSeenLevels: Set<string>;
|
|
131
|
+
/** The document's styles indexed by the built-in they are; classifies headings and quotes. */
|
|
132
|
+
builtInStyles: BuiltInStyleIndex;
|
|
137
133
|
};
|
|
138
134
|
//#endregion
|
|
139
135
|
export { ImageMeta, ImageRef, MarkdownOptions, MarkdownResult, RenderContext, ResolvedOptions };
|
|
@@ -292,11 +292,7 @@ const readSymbolAttrs = (node) => {
|
|
|
292
292
|
expectNodeType(node, "symbol", issues);
|
|
293
293
|
requiredString(attrs, "font", "symbol.attrs.font", issues);
|
|
294
294
|
requiredString(attrs, "char", "symbol.attrs.char", issues);
|
|
295
|
-
if (typeof attrs["
|
|
296
|
-
path: "symbol.attrs.font",
|
|
297
|
-
message: "Expected a non-empty font name."
|
|
298
|
-
});
|
|
299
|
-
if (typeof attrs["char"] === "string" && !isOoxmlSymbolCharacter(attrs["char"])) issues.push({
|
|
295
|
+
if (typeof attrs["char"] === "string" && attrs["char"] !== "" && !isOoxmlSymbolCharacter(attrs["char"])) issues.push({
|
|
300
296
|
path: "symbol.attrs.char",
|
|
301
297
|
message: "Expected exactly four hexadecimal digits."
|
|
302
298
|
});
|
|
@@ -1645,6 +1641,7 @@ const validateParagraphFormatting = (value, path, issues) => {
|
|
|
1645
1641
|
]) optionalNumber(value, key, `${path}.${key}`, issues);
|
|
1646
1642
|
optionalOneOf(value, "lineSpacingRule", `${path}.lineSpacingRule`, issues, LINE_SPACING_RULE_VALUES);
|
|
1647
1643
|
optionalString(value, "styleId", `${path}.styleId`, issues);
|
|
1644
|
+
optionalString(value, "numberingChangeXml", `${path}.numberingChangeXml`, issues);
|
|
1648
1645
|
optionalOneOf(value, "listNumFmt", `${path}.listNumFmt`, issues, NUMBER_FORMAT_VALUES);
|
|
1649
1646
|
optionalString(value, "listMarker", `${path}.listMarker`, issues);
|
|
1650
1647
|
optionalString(value, "listMarkerTemplate", `${path}.listMarkerTemplate`, issues);
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
import { document_d_exports } from "../types/document.js";
|
|
1
2
|
import { BookmarkBoundaryAttrs } from "./schema/nodes.js";
|
|
2
3
|
import { ReadProseMirrorAttrsResult } from "./attrs/index.js";
|
|
3
4
|
import { Node } from "prosemirror-model";
|
|
4
5
|
//#region src/prosemirror/bookmarkBoundaryAttrs.d.ts
|
|
6
|
+
declare const isDisplacedByCustomXml: (value: unknown) => value is document_d_exports.DisplacedByCustomXml;
|
|
7
|
+
/**
|
|
8
|
+
* A boundary's `w:displacedByCustomXml`, as a fragment to spread into the model
|
|
9
|
+
* content it rebuilds. Both a start and an end may carry it, so the callers
|
|
10
|
+
* that build either one share this rather than each remembering the attribute.
|
|
11
|
+
*/
|
|
12
|
+
declare const bookmarkBoundaryDisplacement: (attrs: BookmarkBoundaryAttrs) => {
|
|
13
|
+
displacedByCustomXml?: document_d_exports.DisplacedByCustomXml;
|
|
14
|
+
};
|
|
5
15
|
declare const readBookmarkBoundaryAttrs: (node: Node) => ReadProseMirrorAttrsResult<BookmarkBoundaryAttrs>;
|
|
6
16
|
declare const expectBookmarkBoundaryAttrs: (node: Node) => BookmarkBoundaryAttrs;
|
|
7
17
|
//#endregion
|
|
8
|
-
export { expectBookmarkBoundaryAttrs, readBookmarkBoundaryAttrs };
|
|
18
|
+
export { bookmarkBoundaryDisplacement, expectBookmarkBoundaryAttrs, isDisplacedByCustomXml, readBookmarkBoundaryAttrs };
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { panic } from "better-result";
|
|
2
2
|
//#region src/prosemirror/bookmarkBoundaryAttrs.ts
|
|
3
|
+
const isDisplacedByCustomXml = (value) => value === "next" || value === "prev";
|
|
3
4
|
const attrsCache = /* @__PURE__ */ new WeakMap();
|
|
5
|
+
/**
|
|
6
|
+
* A boundary's `w:displacedByCustomXml`, as a fragment to spread into the model
|
|
7
|
+
* content it rebuilds. Both a start and an end may carry it, so the callers
|
|
8
|
+
* that build either one share this rather than each remembering the attribute.
|
|
9
|
+
*/
|
|
10
|
+
const bookmarkBoundaryDisplacement = (attrs) => attrs.displacedByCustomXml === void 0 ? {} : { displacedByCustomXml: attrs.displacedByCustomXml };
|
|
4
11
|
const readBookmarkBoundaryAttrs = (node) => {
|
|
5
12
|
const issues = [];
|
|
6
13
|
if (node.type.name !== "bookmarkBoundary") issues.push({
|
|
@@ -32,10 +39,16 @@ const readBookmarkBoundaryAttrs = (node) => {
|
|
|
32
39
|
path: "bookmarkBoundary.attrs.colLast",
|
|
33
40
|
message: "Expected a non-negative integer."
|
|
34
41
|
});
|
|
42
|
+
const displaced = node.attrs["displacedByCustomXml"];
|
|
43
|
+
if (displaced !== void 0 && displaced !== null && !isDisplacedByCustomXml(displaced)) issues.push({
|
|
44
|
+
path: "bookmarkBoundary.attrs.displacedByCustomXml",
|
|
45
|
+
message: "Expected \"next\" or \"prev\"."
|
|
46
|
+
});
|
|
35
47
|
if (issues.length > 0 || typeof id !== "number") return {
|
|
36
48
|
ok: false,
|
|
37
49
|
issues
|
|
38
50
|
};
|
|
51
|
+
const displacement = isDisplacedByCustomXml(displaced) ? { displacedByCustomXml: displaced } : {};
|
|
39
52
|
if (type === "start" && typeof name === "string") return {
|
|
40
53
|
ok: true,
|
|
41
54
|
value: {
|
|
@@ -43,14 +56,16 @@ const readBookmarkBoundaryAttrs = (node) => {
|
|
|
43
56
|
id,
|
|
44
57
|
name,
|
|
45
58
|
...typeof colFirst === "number" ? { colFirst } : {},
|
|
46
|
-
...typeof colLast === "number" ? { colLast } : {}
|
|
59
|
+
...typeof colLast === "number" ? { colLast } : {},
|
|
60
|
+
...displacement
|
|
47
61
|
}
|
|
48
62
|
};
|
|
49
63
|
return {
|
|
50
64
|
ok: true,
|
|
51
65
|
value: {
|
|
52
66
|
type: "end",
|
|
53
|
-
id
|
|
67
|
+
id,
|
|
68
|
+
...displacement
|
|
54
69
|
}
|
|
55
70
|
};
|
|
56
71
|
};
|
|
@@ -63,4 +78,4 @@ const expectBookmarkBoundaryAttrs = (node) => {
|
|
|
63
78
|
return result.value;
|
|
64
79
|
};
|
|
65
80
|
//#endregion
|
|
66
|
-
export { expectBookmarkBoundaryAttrs, readBookmarkBoundaryAttrs };
|
|
81
|
+
export { bookmarkBoundaryDisplacement, expectBookmarkBoundaryAttrs, isDisplacedByCustomXml, readBookmarkBoundaryAttrs };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ResolvedStyleAttrs, getParagraphAlignment, getParagraphBidi, getStyleId } from "../extensions/core/ParagraphExtension.js";
|
|
1
|
+
import { GenerateTableOfContentsOptions, ResolvedStyleAttrs, getParagraphAlignment, getParagraphBidi, getStyleId } from "../extensions/core/ParagraphExtension.js";
|
|
2
2
|
import { BorderPreset, TableBorderPreset, TableContextInfo, getTableContext, isInTable as isInTableCell } from "../extensions/nodes/TableExtension.js";
|
|
3
3
|
import { AcceptSuggestionOptions, FolioSuggestion, SuggestionAppliedAs, SuggestionKind, acceptAIEditRevision, acceptAllChanges, acceptAllSuggestions, acceptChange, acceptSuggestion, addCommentMark, findAIEditRevisionRange, findNextChange, findPreviousChange, findSuggestionRange, getSuggestions, rejectAIEditRevision, rejectAllChanges, rejectAllSuggestions, rejectChange, rejectSuggestion, removeCommentMark } from "./comments.js";
|
|
4
4
|
import { CapturedTextFormatting, PAINTABLE_MARK_NAMES, applyFormatMarks, captureFormatMarks } from "./formatPainter.js";
|
|
@@ -6,8 +6,8 @@ import { clearFormatting, createRemoveMarkCommand, createSetMarkCommand, getMark
|
|
|
6
6
|
import { getHyperlinkAttrs, getSelectedText, isHyperlinkActive } from "../extensions/marks/HyperlinkExtension.js";
|
|
7
7
|
import { clearFontFamily, clearFontSize, clearHighlight, clearTextColor, insertHyperlink, removeHyperlink, setFontFamily, setFontSize, setHighlight, setHyperlink, setTextColor, setUnderlineStyle, toggleBold, toggleItalic, toggleStrike, toggleSubscript, toggleSuperscript, toggleUnderline } from "./formatting.js";
|
|
8
8
|
import { getListInfo, isInList } from "../extensions/features/ListExtension.js";
|
|
9
|
-
import { addTabStop, alignCenter, alignJustify, alignLeft, alignRight, applyStyle, clearStyle, decreaseIndent, decreaseListLevel, doubleSpacing,
|
|
9
|
+
import { addTabStop, alignCenter, alignJustify, alignLeft, alignRight, applyStyle, clearStyle, decreaseIndent, decreaseListLevel, doubleSpacing, generateTableOfContents, increaseIndent, increaseListLevel, oneAndHalfSpacing, removeList, removeTabStop, setAlignment, setIndentFirstLine, setIndentLeft, setIndentRight, setLineSpacing, setLtr, setRtl, setSpaceAfter, setSpaceBefore, singleSpacing, toggleBidi, toggleBulletList, toggleNumberedList } from "./paragraph.js";
|
|
10
10
|
import { addColumnLeft, addColumnRight, addRowAbove, addRowBelow, applyTableStyle, autoFitContents, deleteColumn, deleteRow, deleteTable, distributeColumns, insertTable, mergeCells, removeTableBorders, selectColumn, selectRow, selectTable, setAllTableBorders, setCellBorder, setCellFillColor, setCellMargins, setCellTextDirection, setCellVerticalAlign, setInsideTableBorders, setOutsideTableBorders, setRowHeight, setTableBorderColor, setTableBorderPreset, setTableBorderWidth, setTableBorders, setTableProperties, splitCell, toggleHeaderRow, toggleNoWrap } from "./table.js";
|
|
11
11
|
import { insertPageBreak } from "./pageBreak.js";
|
|
12
12
|
import { CLIPBOARD_READ_ERROR_EVENT, buildPlainTextSlice, pasteWithoutFormatting } from "./pastePlainText.js";
|
|
13
|
-
export { type AcceptSuggestionOptions, type BorderPreset, CLIPBOARD_READ_ERROR_EVENT, type CapturedTextFormatting, type FolioSuggestion, PAINTABLE_MARK_NAMES, type ResolvedStyleAttrs, type SuggestionAppliedAs, type SuggestionKind, type TableBorderPreset, type TableContextInfo, acceptAIEditRevision, acceptAllChanges, acceptAllSuggestions, acceptChange, acceptSuggestion, addColumnLeft, addColumnRight, addCommentMark, addRowAbove, addRowBelow, addTabStop, alignCenter, alignJustify, alignLeft, alignRight, applyFormatMarks, applyStyle, applyTableStyle, autoFitContents, buildPlainTextSlice, captureFormatMarks, clearFontFamily, clearFontSize, clearFormatting, clearHighlight, clearStyle, clearTextColor, createRemoveMarkCommand, createSetMarkCommand, decreaseIndent, decreaseListLevel, deleteColumn, deleteRow, deleteTable, distributeColumns, doubleSpacing, findAIEditRevisionRange, findNextChange, findPreviousChange, findSuggestionRange,
|
|
13
|
+
export { type AcceptSuggestionOptions, type BorderPreset, CLIPBOARD_READ_ERROR_EVENT, type CapturedTextFormatting, type FolioSuggestion, type GenerateTableOfContentsOptions, PAINTABLE_MARK_NAMES, type ResolvedStyleAttrs, type SuggestionAppliedAs, type SuggestionKind, type TableBorderPreset, type TableContextInfo, acceptAIEditRevision, acceptAllChanges, acceptAllSuggestions, acceptChange, acceptSuggestion, addColumnLeft, addColumnRight, addCommentMark, addRowAbove, addRowBelow, addTabStop, alignCenter, alignJustify, alignLeft, alignRight, applyFormatMarks, applyStyle, applyTableStyle, autoFitContents, buildPlainTextSlice, captureFormatMarks, clearFontFamily, clearFontSize, clearFormatting, clearHighlight, clearStyle, clearTextColor, createRemoveMarkCommand, createSetMarkCommand, decreaseIndent, decreaseListLevel, deleteColumn, deleteRow, deleteTable, distributeColumns, doubleSpacing, findAIEditRevisionRange, findNextChange, findPreviousChange, findSuggestionRange, generateTableOfContents, getHyperlinkAttrs, getListInfo, getMarkAttr, getParagraphAlignment, getParagraphBidi, getSelectedText, getStyleId, getSuggestions, getTableContext, increaseIndent, increaseListLevel, insertHyperlink, insertPageBreak, insertTable, isHyperlinkActive, isInList, isInTableCell as isInTable, isMarkActive, mergeCells, oneAndHalfSpacing, pasteWithoutFormatting, rejectAIEditRevision, rejectAllChanges, rejectAllSuggestions, rejectChange, rejectSuggestion, removeCommentMark, removeHyperlink, removeList, removeTabStop, removeTableBorders, selectColumn, selectRow, selectTable, setAlignment, setAllTableBorders, setCellBorder, setCellFillColor, setCellMargins, setCellTextDirection, setCellVerticalAlign, setFontFamily, setFontSize, setHighlight, setHyperlink, setIndentFirstLine, setIndentLeft, setIndentRight, setInsideTableBorders, setLineSpacing, setLtr, setOutsideTableBorders, setRowHeight, setRtl, setSpaceAfter, setSpaceBefore, setTableBorderColor, setTableBorderPreset, setTableBorderWidth, setTableBorders, setTableProperties, setTextColor, setUnderlineStyle, singleSpacing, splitCell, toggleBidi, toggleBold, toggleBulletList, toggleHeaderRow, toggleItalic, toggleNoWrap, toggleNumberedList, toggleStrike, toggleSubscript, toggleSuperscript, toggleUnderline };
|
|
@@ -7,7 +7,7 @@ import { acceptAIEditRevision, acceptAllChanges, acceptAllSuggestions, acceptCha
|
|
|
7
7
|
import { PAINTABLE_MARK_NAMES, applyFormatMarks, captureFormatMarks } from "./formatPainter.js";
|
|
8
8
|
import { clearFontFamily, clearFontSize, clearHighlight, clearTextColor, insertHyperlink, removeHyperlink, setFontFamily, setFontSize, setHighlight, setHyperlink, setTextColor, setUnderlineStyle, toggleBold, toggleItalic, toggleStrike, toggleSubscript, toggleSuperscript, toggleUnderline } from "./formatting.js";
|
|
9
9
|
import { insertPageBreak } from "./pageBreak.js";
|
|
10
|
-
import { addTabStop, alignCenter, alignJustify, alignLeft, alignRight, applyStyle, clearStyle, decreaseIndent, decreaseListLevel, doubleSpacing,
|
|
10
|
+
import { addTabStop, alignCenter, alignJustify, alignLeft, alignRight, applyStyle, clearStyle, decreaseIndent, decreaseListLevel, doubleSpacing, generateTableOfContents, increaseIndent, increaseListLevel, oneAndHalfSpacing, removeList, removeTabStop, setAlignment, setIndentFirstLine, setIndentLeft, setIndentRight, setLineSpacing, setLtr, setRtl, setSpaceAfter, setSpaceBefore, singleSpacing, toggleBidi, toggleBulletList, toggleNumberedList } from "./paragraph.js";
|
|
11
11
|
import { CLIPBOARD_READ_ERROR_EVENT, buildPlainTextSlice, pasteWithoutFormatting } from "./pastePlainText.js";
|
|
12
12
|
import { addColumnLeft, addColumnRight, addRowAbove, addRowBelow, applyTableStyle, autoFitContents, deleteColumn, deleteRow, deleteTable, distributeColumns, insertTable, mergeCells, removeTableBorders, selectColumn, selectRow, selectTable, setAllTableBorders, setCellBorder, setCellFillColor, setCellMargins, setCellTextDirection, setCellVerticalAlign, setInsideTableBorders, setOutsideTableBorders, setRowHeight, setTableBorderColor, setTableBorderPreset, setTableBorderWidth, setTableBorders, setTableProperties, splitCell, toggleHeaderRow, toggleNoWrap } from "./table.js";
|
|
13
|
-
export { CLIPBOARD_READ_ERROR_EVENT, PAINTABLE_MARK_NAMES, acceptAIEditRevision, acceptAllChanges, acceptAllSuggestions, acceptChange, acceptSuggestion, addColumnLeft, addColumnRight, addCommentMark, addRowAbove, addRowBelow, addTabStop, alignCenter, alignJustify, alignLeft, alignRight, applyFormatMarks, applyStyle, applyTableStyle, autoFitContents, buildPlainTextSlice, captureFormatMarks, clearFontFamily, clearFontSize, clearFormatting, clearHighlight, clearStyle, clearTextColor, createRemoveMarkCommand, createSetMarkCommand, decreaseIndent, decreaseListLevel, deleteColumn, deleteRow, deleteTable, distributeColumns, doubleSpacing, findAIEditRevisionRange, findNextChange, findPreviousChange, findSuggestionRange,
|
|
13
|
+
export { CLIPBOARD_READ_ERROR_EVENT, PAINTABLE_MARK_NAMES, acceptAIEditRevision, acceptAllChanges, acceptAllSuggestions, acceptChange, acceptSuggestion, addColumnLeft, addColumnRight, addCommentMark, addRowAbove, addRowBelow, addTabStop, alignCenter, alignJustify, alignLeft, alignRight, applyFormatMarks, applyStyle, applyTableStyle, autoFitContents, buildPlainTextSlice, captureFormatMarks, clearFontFamily, clearFontSize, clearFormatting, clearHighlight, clearStyle, clearTextColor, createRemoveMarkCommand, createSetMarkCommand, decreaseIndent, decreaseListLevel, deleteColumn, deleteRow, deleteTable, distributeColumns, doubleSpacing, findAIEditRevisionRange, findNextChange, findPreviousChange, findSuggestionRange, generateTableOfContents, getHyperlinkAttrs, getListInfo, getMarkAttr, getParagraphAlignment, getParagraphBidi, getSelectedText, getStyleId, getSuggestions, getTableContext, increaseIndent, increaseListLevel, insertHyperlink, insertPageBreak, insertTable, isHyperlinkActive, isInList, isInTableCell as isInTable, isMarkActive, mergeCells, oneAndHalfSpacing, pasteWithoutFormatting, rejectAIEditRevision, rejectAllChanges, rejectAllSuggestions, rejectChange, rejectSuggestion, removeCommentMark, removeHyperlink, removeList, removeTabStop, removeTableBorders, selectColumn, selectRow, selectTable, setAlignment, setAllTableBorders, setCellBorder, setCellFillColor, setCellMargins, setCellTextDirection, setCellVerticalAlign, setFontFamily, setFontSize, setHighlight, setHyperlink, setIndentFirstLine, setIndentLeft, setIndentRight, setInsideTableBorders, setLineSpacing, setLtr, setOutsideTableBorders, setRowHeight, setRtl, setSpaceAfter, setSpaceBefore, setTableBorderColor, setTableBorderPreset, setTableBorderWidth, setTableBorders, setTableProperties, setTextColor, setUnderlineStyle, singleSpacing, splitCell, toggleBidi, toggleBold, toggleBulletList, toggleHeaderRow, toggleItalic, toggleNoWrap, toggleNumberedList, toggleStrike, toggleSubscript, toggleSuperscript, toggleUnderline };
|
|
@@ -5,6 +5,17 @@ const UNSUPPORTED_PAGE_BREAK_RUN_ANCESTORS = /* @__PURE__ */ new Set([
|
|
|
5
5
|
"tableHeader",
|
|
6
6
|
"textBox"
|
|
7
7
|
]);
|
|
8
|
+
const hasTextBoxAnchorAtOrAfter = (paragraph, contentStart, position) => {
|
|
9
|
+
let found = false;
|
|
10
|
+
paragraph.descendants((descendant, offset) => {
|
|
11
|
+
if (descendant.type.name === "textBoxAnchor" && contentStart + offset >= position) {
|
|
12
|
+
found = true;
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
return !found;
|
|
16
|
+
});
|
|
17
|
+
return found;
|
|
18
|
+
};
|
|
8
19
|
/**
|
|
9
20
|
* Insert a page-break run at the current text cursor.
|
|
10
21
|
*
|
|
@@ -18,7 +29,7 @@ const insertPageBreak = (state, dispatch) => {
|
|
|
18
29
|
const { $from } = state.selection;
|
|
19
30
|
if (!pageBreakRunType || !state.selection.empty || !$from.parent.isTextblock) return false;
|
|
20
31
|
for (let depth = $from.depth; depth >= 0; depth--) if (UNSUPPORTED_PAGE_BREAK_RUN_ANCESTORS.has($from.node(depth).type.name)) return false;
|
|
21
|
-
if ($from.parent.type.name !== "paragraph" || pageBreakRunParagraphProjectionDisposition($from.parent).status === "unsupported") return false;
|
|
32
|
+
if ($from.parent.type.name !== "paragraph" || pageBreakRunParagraphProjectionDisposition($from.parent).status === "unsupported" || hasTextBoxAnchorAtOrAfter($from.parent, $from.start(), $from.pos)) return false;
|
|
22
33
|
if (dispatch) {
|
|
23
34
|
const pageBreak = pageBreakRunType.create();
|
|
24
35
|
dispatch(state.tr.replaceSelectionWith(pageBreak).scrollIntoView());
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { document_d_exports } from "../../types/document.js";
|
|
2
|
-
import { ResolvedStyleAttrs, getParagraphAlignment, getParagraphBidi, getParagraphTabs, getStyleId } from "../extensions/core/ParagraphExtension.js";
|
|
2
|
+
import { GenerateTableOfContentsOptions, ResolvedStyleAttrs, getParagraphAlignment, getParagraphBidi, getParagraphTabs, getStyleId } from "../extensions/core/ParagraphExtension.js";
|
|
3
3
|
import { getListInfo, isInList } from "../extensions/features/ListExtension.js";
|
|
4
4
|
import { Command } from "prosemirror-state";
|
|
5
5
|
//#region src/prosemirror/commands/paragraph.d.ts
|
|
@@ -33,6 +33,6 @@ declare function removeTabStop(position: number): Command;
|
|
|
33
33
|
declare const toggleBidi: Command;
|
|
34
34
|
declare const setRtl: Command;
|
|
35
35
|
declare const setLtr: Command;
|
|
36
|
-
declare const
|
|
36
|
+
declare const generateTableOfContents: (options: GenerateTableOfContentsOptions) => Command;
|
|
37
37
|
//#endregion
|
|
38
|
-
export { type ResolvedStyleAttrs, addTabStop, alignCenter, alignJustify, alignLeft, alignRight, applyStyle, clearStyle, decreaseIndent, decreaseListLevel, doubleSpacing,
|
|
38
|
+
export { type GenerateTableOfContentsOptions, type ResolvedStyleAttrs, addTabStop, alignCenter, alignJustify, alignLeft, alignRight, applyStyle, clearStyle, decreaseIndent, decreaseListLevel, doubleSpacing, generateTableOfContents, getListInfo, getParagraphAlignment, getParagraphBidi, getParagraphTabs, getStyleId, increaseIndent, increaseListLevel, insertSectionBreak, isInList, oneAndHalfSpacing, removeList, removeSectionBreak, removeTabStop, setAlignment, setIndentFirstLine, setIndentLeft, setIndentRight, setLineSpacing, setLtr, setRtl, setSpaceAfter, setSpaceBefore, singleSpacing, toggleBidi, toggleBulletList, toggleNumberedList };
|
|
@@ -59,6 +59,6 @@ function removeTabStop(position) {
|
|
|
59
59
|
const toggleBidi = cmds.requireCommand("toggleBidi")();
|
|
60
60
|
const setRtl = cmds.requireCommand("setRtl")();
|
|
61
61
|
const setLtr = cmds.requireCommand("setLtr")();
|
|
62
|
-
const
|
|
62
|
+
const generateTableOfContents = (options) => cmds.requireCommand("generateTOC")(options);
|
|
63
63
|
//#endregion
|
|
64
|
-
export { addTabStop, alignCenter, alignJustify, alignLeft, alignRight, applyStyle, clearStyle, decreaseIndent, decreaseListLevel, doubleSpacing,
|
|
64
|
+
export { addTabStop, alignCenter, alignJustify, alignLeft, alignRight, applyStyle, clearStyle, decreaseIndent, decreaseListLevel, doubleSpacing, generateTableOfContents, getListInfo, getParagraphAlignment, getParagraphBidi, getParagraphTabs, getStyleId, increaseIndent, increaseListLevel, insertSectionBreak, isInList, oneAndHalfSpacing, removeList, removeSectionBreak, removeTabStop, setAlignment, setIndentFirstLine, setIndentLeft, setIndentRight, setLineSpacing, setLtr, setRtl, setSpaceAfter, setSpaceBefore, singleSpacing, toggleBidi, toggleBulletList, toggleNumberedList };
|