oasis-editor 0.0.90 → 0.0.92
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/{OasisEditorApp-2b7y3aGj.js → OasisEditorApp-C_Ao4zIF.js} +114 -40
- package/dist/assets/{importDocxWorker-BN5o1geV.js → importDocxWorker-DAbfLHtp.js} +1 -1
- package/dist/core/engine.d.ts +16 -0
- package/dist/core/model/index.d.ts +2 -2
- package/dist/core/model/types/document.d.ts +10 -0
- package/dist/core/model/types/layout.d.ts +9 -0
- package/dist/core/model/types/nodes.d.ts +15 -43
- package/dist/core/model/types/styles.d.ts +39 -2
- package/dist/core/tableStyleResolver.d.ts +2 -1
- package/dist/export/docx/docxPackageXml.d.ts +7 -1
- package/dist/import/docx/settings.d.ts +5 -0
- package/dist/import/docx/tableConditionalFormatting.d.ts +0 -30
- package/dist/import/docx/tableProperties.d.ts +7 -0
- package/dist/import/docx/xmlHelpers.d.ts +5 -0
- package/dist/{index-DcElQi6c.js → index-BQEtsRa0.js} +712 -139
- package/dist/layoutProjection/paragraphPagination.d.ts +2 -1
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/ui/textMeasurement/hyphenation.d.ts +33 -0
- package/dist/ui/textMeasurement/types.d.ts +9 -2
- package/package.json +4 -1
package/dist/core/engine.d.ts
CHANGED
|
@@ -14,6 +14,21 @@ export interface FloatingExclusionRect {
|
|
|
14
14
|
y: number;
|
|
15
15
|
}>;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Automatic-hyphenation configuration resolved from `EditorDocument.settings`
|
|
19
|
+
* (`w:autoHyphenation` and friends). Threaded to the composer so words can break
|
|
20
|
+
* at line ends with a rendered trailing hyphen.
|
|
21
|
+
*/
|
|
22
|
+
export interface HyphenationLayoutOptions {
|
|
23
|
+
/** `w:autoHyphenation`: master switch. */
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
/** `w:hyphenationZone`: min trailing gap (points) before hyphenating. */
|
|
26
|
+
zone?: number;
|
|
27
|
+
/** `w:consecutiveHyphenLimit`: max consecutive hyphenated lines (0/undefined = unlimited). */
|
|
28
|
+
consecutiveLimit?: number;
|
|
29
|
+
/** `w:doNotHyphenateCaps`: skip all-caps words. */
|
|
30
|
+
doNotHyphenateCaps?: boolean;
|
|
31
|
+
}
|
|
17
32
|
export interface TextMeasureOptions {
|
|
18
33
|
paragraph: EditorParagraphNode;
|
|
19
34
|
fragments: EditorLayoutFragment[];
|
|
@@ -21,6 +36,7 @@ export interface TextMeasureOptions {
|
|
|
21
36
|
contentWidth?: number;
|
|
22
37
|
defaultTabStop?: number;
|
|
23
38
|
exclusions?: FloatingExclusionRect[];
|
|
39
|
+
hyphenation?: HyphenationLayoutOptions;
|
|
24
40
|
}
|
|
25
41
|
export interface ITextMeasurer {
|
|
26
42
|
composeMeasuredParagraphLines(options: TextMeasureOptions): EditorLayoutLine[];
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* re-export in `src/core/model.ts`.
|
|
8
8
|
*/
|
|
9
9
|
export type { EditorUnderlineStyle, EditorLigatures, EditorNumberSpacing, EditorNumberForm, EditorTextLanguage, EditorBorderStyle, EditorEmphasisMark, EditorTabStop, EditorParagraphListStyle, EditorImageCrop, EditorImageFillMode, EditorImageFloatingPosition, EditorImageFloatingLayout, EditorImageRunData, EditorWrapPolygonPoint, EditorFieldData, EditorFieldChar, EditorFootnoteReferenceData, EditorEndnoteReferenceData, EditorRevision, EditorRevisionMetadata, EditorStructuralRevision, EditorPropertyRevision, EditorAsset, EditorFootnoteNumberFormat, EditorFootnoteRestart, EditorDocxWidthValue, EditorTableLayout, EditorTableRowHeightRule, } from './types/primitives.js';
|
|
10
|
-
export type { EditorTextStyle, EditorParagraphStyle, EditorTableStyle, EditorTableFloatingLayout, EditorTableConditionalFormat, EditorConditionalRowStyle, EditorTableConditionalType, EditorTableConditionalFlags, EditorNamedStyle, } from './types/styles.js';
|
|
11
|
-
export type { EditorRunBase, EditorTextRun, EditorTextBoxShape, EditorTextBoxBody, EditorTextBoxData, EditorDropCap, EditorParagraphNode,
|
|
10
|
+
export type { EditorTextStyle, EditorParagraphStyle, EditorTableStyle, EditorTableFloatingLayout, EditorTableConditionalFormat, EditorConditionalRowStyle, EditorTableConditionalType, EditorTableConditionalFlags, EditorTableCellStyle, EditorNamedStyle, } from './types/styles.js';
|
|
11
|
+
export type { EditorRunBase, EditorTextRun, EditorTextBoxShape, EditorTextBoxBody, EditorTextBoxData, EditorDropCap, EditorParagraphNode, EditorTableCellNode, EditorTableRowStyle, EditorTableRowNode, EditorTableNode, EditorBlockNode, } from './types/nodes.js';
|
|
12
12
|
export type { RunKind, RunOfKind, RunVisitor } from './runKind.js';
|
|
13
13
|
export { getRunKind, isInlineObjectRun, visitRun, getRunImage, getRunTextBox, getRunField, getRunFieldChar, getRunFieldInstruction, getRunFootnoteReference, getRunEndnoteReference, getRunSym, } from './runKind.js';
|
|
14
14
|
export type { EditorFootnote } from './types/documentFootnotes.js';
|
|
@@ -86,6 +86,16 @@ export interface EditorDocument {
|
|
|
86
86
|
styles?: Record<string, EditorNamedStyle>;
|
|
87
87
|
settings?: {
|
|
88
88
|
defaultTabStop?: number;
|
|
89
|
+
/** `w:allowSpaceOfSameStyleInTable`: contextual spacing applies in table cells. */
|
|
90
|
+
allowSpaceOfSameStyleInTable?: boolean;
|
|
91
|
+
/** `w:autoHyphenation`: automatically hyphenate words at line ends. */
|
|
92
|
+
autoHyphenation?: boolean;
|
|
93
|
+
/** `w:consecutiveHyphenLimit`: max consecutive lines ending with a hyphen (0 = unlimited). */
|
|
94
|
+
consecutiveHyphenLimit?: number;
|
|
95
|
+
/** `w:hyphenationZone`: min trailing gap (points) before a word is hyphenated. */
|
|
96
|
+
hyphenationZone?: number;
|
|
97
|
+
/** `w:doNotHyphenateCaps`: do not hyphenate all-caps words. */
|
|
98
|
+
doNotHyphenateCaps?: boolean;
|
|
89
99
|
};
|
|
90
100
|
/**
|
|
91
101
|
* Out-of-band asset registry. Image runs reference entries here using
|
|
@@ -37,6 +37,15 @@ export interface EditorLayoutLine {
|
|
|
37
37
|
slots: EditorCaretSlot[];
|
|
38
38
|
fragments: EditorLayoutFragment[];
|
|
39
39
|
availableWidth?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Set when the line ends mid-word due to automatic hyphenation. Renderers draw
|
|
42
|
+
* a trailing hyphen glyph after the last fragment; it is not part of the text
|
|
43
|
+
* model (no caret slot/offset), so caret and selection logic ignore it.
|
|
44
|
+
*/
|
|
45
|
+
trailingHyphen?: boolean;
|
|
46
|
+
/** Advance (px) reserved/drawn for the trailing hyphen; the single source of
|
|
47
|
+
* truth shared by alignment and the canvas/PDF renderers. */
|
|
48
|
+
trailingHyphenWidth?: number;
|
|
40
49
|
}
|
|
41
50
|
export interface EditorLayoutParagraph {
|
|
42
51
|
paragraphId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EditorParagraphStyle, EditorTableStyle, EditorTableConditionalFlags, EditorTextStyle } from './styles.js';
|
|
1
|
+
import { EditorDocxWidthValue, EditorEndnoteReferenceData, EditorFieldChar, EditorFieldData, EditorFootnoteReferenceData, EditorImageFloatingLayout, EditorImageRunData, EditorParagraphListStyle, EditorRevision, EditorPropertyRevision, EditorStructuralRevision, EditorTableRowHeightRule } from './primitives.js';
|
|
2
|
+
import { EditorParagraphStyle, EditorTableCellStyle, EditorTableStyle, EditorTableConditionalFlags, EditorTextStyle } from './styles.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Geometry/appearance of a text box shape (`wps:spPr`). All values are
|
|
@@ -153,44 +153,6 @@ export interface EditorParagraphNode {
|
|
|
153
153
|
/** Drop cap that body text in this paragraph wraps around, when present. */
|
|
154
154
|
dropCap?: EditorDropCap;
|
|
155
155
|
}
|
|
156
|
-
export interface EditorTableCellStyle {
|
|
157
|
-
shading?: string;
|
|
158
|
-
width?: number | string;
|
|
159
|
-
borderTop?: EditorBorderStyle;
|
|
160
|
-
borderRight?: EditorBorderStyle;
|
|
161
|
-
borderBottom?: EditorBorderStyle;
|
|
162
|
-
borderLeft?: EditorBorderStyle;
|
|
163
|
-
/** Bidi-aware leading/trailing borders (`w:start` / `w:end`). */
|
|
164
|
-
borderStart?: EditorBorderStyle;
|
|
165
|
-
borderEnd?: EditorBorderStyle;
|
|
166
|
-
/** Diagonal cell borders (`w:tl2br` / `w:tr2bl`). */
|
|
167
|
-
borderTopLeftToBottomRight?: EditorBorderStyle;
|
|
168
|
-
borderTopRightToBottomLeft?: EditorBorderStyle;
|
|
169
|
-
padding?: number;
|
|
170
|
-
paddingTop?: number;
|
|
171
|
-
paddingRight?: number;
|
|
172
|
-
paddingBottom?: number;
|
|
173
|
-
paddingLeft?: number;
|
|
174
|
-
/** Bidi-aware leading/trailing margins (`w:start` / `w:end`). */
|
|
175
|
-
paddingStart?: number;
|
|
176
|
-
paddingEnd?: number;
|
|
177
|
-
verticalAlign?: "top" | "middle" | "bottom";
|
|
178
|
-
horizontalAlign?: "left" | "center" | "right" | "justify";
|
|
179
|
-
/** `w:tcPr/w:textDirection/@w:val`: cell text flow direction (vertical text). */
|
|
180
|
-
textDirection?: "lrTb" | "tbRl" | "btLr" | "lrTbV" | "tbRlV" | null;
|
|
181
|
-
/** `w:noWrap`: prevent normal wrapping inside the cell. */
|
|
182
|
-
noWrap?: boolean;
|
|
183
|
-
/** `w:tcFitText`: request Word-style text fitting within the cell width. */
|
|
184
|
-
fitText?: boolean;
|
|
185
|
-
/** `w:hideMark`: hide the cell-end marker for layout. */
|
|
186
|
-
hideMark?: boolean;
|
|
187
|
-
/** `w:headers/@w:val`: semantic header cell references. */
|
|
188
|
-
headers?: string;
|
|
189
|
-
/** Structural `cellIns`/`cellDel`/`cellMerge` revision. */
|
|
190
|
-
revision?: EditorStructuralRevision;
|
|
191
|
-
/** Previous cell properties from `w:tcPrChange`. */
|
|
192
|
-
propertyRevision?: EditorPropertyRevision<EditorTableCellStyle>;
|
|
193
|
-
}
|
|
194
156
|
export interface EditorTableCellNode {
|
|
195
157
|
id: string;
|
|
196
158
|
blocks: EditorParagraphNode[];
|
|
@@ -201,6 +163,8 @@ export interface EditorTableCellNode {
|
|
|
201
163
|
conditionalStyle?: EditorTableConditionalFlags;
|
|
202
164
|
/** Exact pre-change cell grid retained while a tracked merge/split is pending. */
|
|
203
165
|
mergeRevisionState?: EditorTableMergeRevisionState;
|
|
166
|
+
/** Extension attributes (e.g. `w14:paraId`) preserved for round-trip. */
|
|
167
|
+
extAttributes?: Record<string, string>;
|
|
204
168
|
}
|
|
205
169
|
export interface EditorTableMergeRevisionState {
|
|
206
170
|
revisionId: string;
|
|
@@ -217,6 +181,8 @@ export interface EditorTableRowStyle {
|
|
|
217
181
|
gridAfter?: number;
|
|
218
182
|
widthBefore?: EditorDocxWidthValue;
|
|
219
183
|
widthAfter?: EditorDocxWidthValue;
|
|
184
|
+
/** `w:jc` in `w:trPr`: horizontal alignment of the row within the table width. */
|
|
185
|
+
align?: "left" | "center" | "right";
|
|
220
186
|
/** `w:cantSplit`: keep this row together during pagination. */
|
|
221
187
|
cantSplit?: boolean;
|
|
222
188
|
/** `w:hidden`: do not display this row in normal view. */
|
|
@@ -235,10 +201,16 @@ export interface EditorTableRowNode {
|
|
|
235
201
|
style?: EditorTableRowStyle;
|
|
236
202
|
conditionalStyle?: EditorTableConditionalFlags;
|
|
237
203
|
/**
|
|
238
|
-
*
|
|
239
|
-
*
|
|
204
|
+
* `w:tblPrEx` — per-row table property exceptions. These override the table's
|
|
205
|
+
* own properties (borders, cell margins, cell spacing, indent, width, layout,
|
|
206
|
+
* alignment) for the cells in this row. Applied during cell formatting
|
|
207
|
+
* resolution and re-serialized before `w:trPr` on export.
|
|
240
208
|
*/
|
|
241
|
-
|
|
209
|
+
propertyExceptions?: EditorTableStyle;
|
|
210
|
+
/** Raw `<w:tblPrExChange ...>` XML preserved for DOCX round-trip. */
|
|
211
|
+
tblPrExChangeXml?: string;
|
|
212
|
+
/** Extension attributes (e.g. `w14:paraId`, `w15:*`) preserved for round-trip. */
|
|
213
|
+
extAttributes?: Record<string, string>;
|
|
242
214
|
}
|
|
243
215
|
export interface EditorTableNode {
|
|
244
216
|
id: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { EditorBorderStyle, EditorDocxWidthValue, EditorEmphasisMark, EditorLigatures, EditorNumberForm, EditorNumberSpacing, EditorPropertyRevision, EditorTabStop, EditorTextLanguage, EditorUnderlineStyle } from './primitives.js';
|
|
2
|
-
import { EditorTableCellStyle } from './nodes.js';
|
|
1
|
+
import { EditorBorderStyle, EditorDocxWidthValue, EditorEmphasisMark, EditorLigatures, EditorNumberForm, EditorNumberSpacing, EditorPropertyRevision, EditorStructuralRevision, EditorTabStop, EditorTextLanguage, EditorUnderlineStyle } from './primitives.js';
|
|
3
2
|
|
|
4
3
|
export interface EditorTextStyle {
|
|
5
4
|
styleId?: string;
|
|
@@ -100,6 +99,44 @@ export interface EditorConditionalRowStyle {
|
|
|
100
99
|
cantSplit?: boolean;
|
|
101
100
|
hidden?: boolean;
|
|
102
101
|
}
|
|
102
|
+
export interface EditorTableCellStyle {
|
|
103
|
+
shading?: string;
|
|
104
|
+
width?: number | string;
|
|
105
|
+
borderTop?: EditorBorderStyle;
|
|
106
|
+
borderRight?: EditorBorderStyle;
|
|
107
|
+
borderBottom?: EditorBorderStyle;
|
|
108
|
+
borderLeft?: EditorBorderStyle;
|
|
109
|
+
/** Bidi-aware leading/trailing borders (`w:start` / `w:end`). */
|
|
110
|
+
borderStart?: EditorBorderStyle;
|
|
111
|
+
borderEnd?: EditorBorderStyle;
|
|
112
|
+
/** Diagonal cell borders (`w:tl2br` / `w:tr2bl`). */
|
|
113
|
+
borderTopLeftToBottomRight?: EditorBorderStyle;
|
|
114
|
+
borderTopRightToBottomLeft?: EditorBorderStyle;
|
|
115
|
+
padding?: number;
|
|
116
|
+
paddingTop?: number;
|
|
117
|
+
paddingRight?: number;
|
|
118
|
+
paddingBottom?: number;
|
|
119
|
+
paddingLeft?: number;
|
|
120
|
+
/** Bidi-aware leading/trailing margins (`w:start` / `w:end`). */
|
|
121
|
+
paddingStart?: number;
|
|
122
|
+
paddingEnd?: number;
|
|
123
|
+
verticalAlign?: "top" | "middle" | "bottom";
|
|
124
|
+
horizontalAlign?: "left" | "center" | "right" | "justify";
|
|
125
|
+
/** `w:tcPr/w:textDirection/@w:val`: cell text flow direction (vertical text). */
|
|
126
|
+
textDirection?: "lrTb" | "tbRl" | "btLr" | "lrTbV" | "tbRlV" | null;
|
|
127
|
+
/** `w:noWrap`: prevent normal wrapping inside the cell. */
|
|
128
|
+
noWrap?: boolean;
|
|
129
|
+
/** `w:tcFitText`: request Word-style text fitting within the cell width. */
|
|
130
|
+
fitText?: boolean;
|
|
131
|
+
/** `w:hideMark`: hide the cell-end marker for layout. */
|
|
132
|
+
hideMark?: boolean;
|
|
133
|
+
/** `w:headers/@w:val`: semantic header cell references. */
|
|
134
|
+
headers?: string;
|
|
135
|
+
/** Structural `cellIns`/`cellDel`/`cellMerge` revision. */
|
|
136
|
+
revision?: EditorStructuralRevision;
|
|
137
|
+
/** Previous cell properties from `w:tcPrChange`. */
|
|
138
|
+
propertyRevision?: EditorPropertyRevision<EditorTableCellStyle>;
|
|
139
|
+
}
|
|
103
140
|
export interface EditorTableConditionalFormat {
|
|
104
141
|
shading?: string;
|
|
105
142
|
/** Run formatting (bold/color) from the conditional's `w:rPr`. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { EditorNamedStyle, EditorParagraphStyle, EditorTableCellStyle,
|
|
1
|
+
import { EditorNamedStyle, EditorParagraphStyle, EditorTableCellStyle, EditorTableStyle, EditorTextStyle } from './model/types/styles.js';
|
|
2
|
+
import { EditorTableNode, EditorTableRowStyle } from './model/types/nodes.js';
|
|
2
3
|
|
|
3
4
|
export interface ResolvedTableCellFormatting {
|
|
4
5
|
tableStyle: EditorTableStyle;
|
|
@@ -4,5 +4,11 @@ import { DocContext, PartDefinition } from './docxTypes.js';
|
|
|
4
4
|
export declare function buildContentTypesXml(hasNumbering: boolean, imageExtensions: Iterable<string>, hasSettings: boolean, parts: PartDefinition[], hasFootnotes: boolean, hasEndnotes: boolean, hasStyles: boolean, hasComments: boolean): string;
|
|
5
5
|
export declare function buildRootRelationshipsXml(): string;
|
|
6
6
|
export declare function buildDocumentRelationshipsXml(hasNumbering: boolean, hasSettings: boolean, images: DocContext["images"], hyperlinks: DocContext["hyperlinks"], parts: PartDefinition[], hasFootnotes: boolean, hasEndnotes: boolean, hasStyles: boolean, hasComments: boolean): string;
|
|
7
|
-
export
|
|
7
|
+
export interface HyphenationSettingsXml {
|
|
8
|
+
autoHyphenation?: boolean;
|
|
9
|
+
consecutiveHyphenLimit?: number;
|
|
10
|
+
hyphenationZone?: number;
|
|
11
|
+
doNotHyphenateCaps?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function buildSettingsXml(hasEvenAndOddHeaders: boolean, defaultTabStop?: number, footnoteSettings?: EditorFootnoteSettings, endnoteSettings?: EditorFootnoteSettings, allowSpaceOfSameStyleInTable?: boolean, hyphenation?: HyphenationSettingsXml): string;
|
|
8
14
|
export declare function buildPartRelationshipsXml(images: DocContext["images"], hyperlinks: DocContext["hyperlinks"]): string;
|
|
@@ -2,7 +2,12 @@ import { EditorFootnoteSettings, EditorEndnoteSettings } from '../../core/model.
|
|
|
2
2
|
|
|
3
3
|
export interface DocxSettings {
|
|
4
4
|
adjustLineHeightInTable: boolean;
|
|
5
|
+
allowSpaceOfSameStyleInTable?: boolean;
|
|
5
6
|
defaultTabStop?: number;
|
|
7
|
+
autoHyphenation?: boolean;
|
|
8
|
+
consecutiveHyphenLimit?: number;
|
|
9
|
+
hyphenationZone?: number;
|
|
10
|
+
doNotHyphenateCaps?: boolean;
|
|
6
11
|
footnoteSettings?: EditorFootnoteSettings;
|
|
7
12
|
endnoteSettings?: EditorEndnoteSettings;
|
|
8
13
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Element as XmlElement } from '@xmldom/xmldom';
|
|
2
|
-
import { EditorNamedStyle, EditorParagraphNode, EditorParagraphStyle, EditorTableConditionalFormat, EditorTextStyle } from '../../core/model.js';
|
|
3
2
|
|
|
4
3
|
export interface TableLook {
|
|
5
4
|
firstRow: boolean;
|
|
@@ -17,32 +16,3 @@ export interface TableLook {
|
|
|
17
16
|
* on.
|
|
18
17
|
*/
|
|
19
18
|
export declare function parseTableLook(tblPr: XmlElement | null): TableLook;
|
|
20
|
-
/**
|
|
21
|
-
* Returns the table-style conditional-format keys that apply to a cell at the
|
|
22
|
-
* given position, ordered low→high precedence (later entries override earlier
|
|
23
|
-
* ones). Mirrors Word's resolution order: whole table < bands < first/last col
|
|
24
|
-
* < first/last row < corner cells. Banding and first/last row/col are gated by
|
|
25
|
-
* `tblLook`; banding parity is computed over the "body" rows/cols that remain
|
|
26
|
-
* after excluding the special first/last row/col.
|
|
27
|
-
*/
|
|
28
|
-
export declare function resolveCellConditionalKeys(rowIndex: number, colIndex: number, rowCount: number, colCount: number, look: TableLook, rowBandSize: number, colBandSize: number): string[];
|
|
29
|
-
/** Merges resolved conditional formats (low→high precedence) into one. */
|
|
30
|
-
export declare function mergeConditionalFormats(keys: string[], conditionals: Record<string, EditorTableConditionalFormat> | undefined): EditorTableConditionalFormat;
|
|
31
|
-
/**
|
|
32
|
-
* Applies a conditional run text style (bold/color from the table style)
|
|
33
|
-
* beneath each run's own style, so explicit run formatting still wins.
|
|
34
|
-
*/
|
|
35
|
-
export declare function applyConditionalTextStyle(paragraphs: EditorParagraphNode[], textStyle: EditorTextStyle | undefined): void;
|
|
36
|
-
/**
|
|
37
|
-
* Filter a table style's paragraph properties (its `<w:pPr>`) so they sit at the
|
|
38
|
-
* correct OOXML precedence for a given cell paragraph.
|
|
39
|
-
*
|
|
40
|
-
* Per ECMA-376 §17.7.2 the order (low → high) is:
|
|
41
|
-
* docDefaults < table style < paragraph style < direct formatting.
|
|
42
|
-
* So any property the paragraph's own (named) style explicitly defines must win
|
|
43
|
-
* over the table style. We strip those keys from the inherited table-style pPr;
|
|
44
|
-
* what remains only fills gaps the paragraph style leaves open. Without this, a
|
|
45
|
-
* table style like `TableGrid` (which sets `spacing after="0"`) would wrongly
|
|
46
|
-
* override Normal's `after="120"` and collapse cell row height vs Word.
|
|
47
|
-
*/
|
|
48
|
-
export declare function tableStyleParagraphInheritance(tableStylePPr: EditorParagraphStyle | undefined, paragraphStyleId: string | undefined, styles: Record<string, EditorNamedStyle> | undefined): EditorParagraphStyle | undefined;
|
|
@@ -8,6 +8,13 @@ export declare function parseTableStyle(tblPr: XmlElement | null, tableStyleId?:
|
|
|
8
8
|
export declare function parseTableRowStyle(rowProperties: XmlElement | null): EditorTableRowStyle | undefined;
|
|
9
9
|
export declare function getTableCellColSpan(cellProperties: XmlElement | null): number;
|
|
10
10
|
export declare function getTableCellVMerge(cellProperties: XmlElement | null): "restart" | "continue" | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Legacy horizontal merge marker (`w:hMerge`). Like `w:vMerge`, `restart`
|
|
13
|
+
* begins a merged run and an omitted/`continue` value continues it. Modern Word
|
|
14
|
+
* uses `w:gridSpan` instead; on import we collapse `hMerge` runs into the
|
|
15
|
+
* anchor cell's colspan so both representations render identically.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getTableCellHMerge(cellProperties: XmlElement | null): "restart" | "continue" | undefined;
|
|
11
18
|
export declare function parseTableCellStyle(cellProperties: XmlElement | null, tableDefaultMargins?: EditorTableStyle["defaultCellMargins"]): EditorTableCellStyle | undefined;
|
|
12
19
|
export declare function isTableHeaderRow(rowNode: XmlElement): boolean;
|
|
13
20
|
/**
|
|
@@ -11,6 +11,11 @@ export declare function parseTextDirection(value: string | null | undefined): Do
|
|
|
11
11
|
export declare function getFirstChildByTagNameNS(element: XmlElement | null | undefined, namespace: string, localName: string): XmlElement | null;
|
|
12
12
|
export declare function getAttributeValue(element: XmlElement | null, localName: string): string | null;
|
|
13
13
|
export declare function findElementDeep(element: XmlElement, localName: string): XmlElement | null;
|
|
14
|
+
/**
|
|
15
|
+
* Collects non-WORD_NS extension attributes (e.g. `w14:paraId`, `w15:*`) from
|
|
16
|
+
* a table/row/cell element for round-trip preservation.
|
|
17
|
+
*/
|
|
18
|
+
export declare function collectExtAttributes(element: XmlElement): Record<string, string> | undefined;
|
|
14
19
|
export declare function isWordTrue(value: string | null | undefined): boolean;
|
|
15
20
|
export declare function parseOnOffProperty(parent: XmlElement, localName: string): boolean | undefined;
|
|
16
21
|
export declare function parseStyleIdProperty(parent: XmlElement | null, localName: "pStyle" | "rStyle"): string | undefined;
|