oasis-editor 0.0.87 → 0.0.89

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.
Files changed (46) hide show
  1. package/dist/{OasisEditorApp-CE15GH_N.js → OasisEditorApp-cKm4OFIF.js} +1383 -179
  2. package/dist/app/controllers/EditorCommandsController.d.ts +1 -1
  3. package/dist/app/controllers/useEditorStyle.d.ts +1 -1
  4. package/dist/assets/{importDocxWorker-C94l6-O5.js → importDocxWorker-DVDyiqYf.js} +1 -1
  5. package/dist/core/commands/builtinCommands.d.ts +1 -1
  6. package/dist/core/commands/publicCommandTypes.d.ts +1 -0
  7. package/dist/core/commands/table/tableCommandUtils.d.ts +2 -1
  8. package/dist/core/commands/table/tableFloatingCommands.d.ts +5 -0
  9. package/dist/core/commands/table.d.ts +1 -0
  10. package/dist/core/model/index.d.ts +2 -2
  11. package/dist/core/model/types/layout.d.ts +4 -0
  12. package/dist/core/model/types/nodes.d.ts +23 -7
  13. package/dist/core/model/types/primitives.d.ts +17 -0
  14. package/dist/core/model/types/styles.d.ts +51 -6
  15. package/dist/core/model.d.ts +1 -0
  16. package/dist/core/tableStyleResolver.d.ts +20 -0
  17. package/dist/core/textStyle/textStyleKeys.d.ts +1 -1
  18. package/dist/export/docx/tableXml.d.ts +1 -0
  19. package/dist/export/pdf/draw/drawFragment.d.ts +13 -1
  20. package/dist/export/pdf/draw/drawTextBoxShape.d.ts +1 -0
  21. package/dist/i18n/locales/en.d.ts +18 -0
  22. package/dist/i18n/locales/pt-BR.d.ts +18 -0
  23. package/dist/import/docx/tableProperties.d.ts +2 -1
  24. package/dist/import/docx/tables.d.ts +1 -1
  25. package/dist/{index-DFKc0jbc.js → index-BICQTKCZ.js} +1657 -896
  26. package/dist/index.d.ts +3 -1
  27. package/dist/layoutProjection/floatingObjects.d.ts +15 -1
  28. package/dist/layoutProjection/paginationTrack.d.ts +2 -0
  29. package/dist/layoutProjection/paragraphPagination.d.ts +2 -2
  30. package/dist/oasis-editor.css +1 -1
  31. package/dist/oasis-editor.js +50 -49
  32. package/dist/oasis-editor.umd.cjs +4 -4
  33. package/dist/plugins/internal/essentialsCapabilities.d.ts +10 -0
  34. package/dist/ui/app/createAppCommandsController.d.ts +2 -2
  35. package/dist/ui/app/createEditorCommandRuntime.d.ts +1 -1
  36. package/dist/ui/app/createEditorInteractionRuntime.d.ts +1 -1
  37. package/dist/ui/canvas/CanvasLayoutSnapshot.d.ts +1 -1
  38. package/dist/ui/canvas/CanvasTableLayout.d.ts +7 -1
  39. package/dist/ui/canvas/canvasBorders.d.ts +2 -0
  40. package/dist/ui/canvas/canvasSnapshotTypes.d.ts +12 -0
  41. package/dist/ui/components/Dialogs/TablePropertiesDialog.d.ts +22 -1
  42. package/dist/ui/components/Toolbar/StyleGallery.d.ts +9 -0
  43. package/dist/ui/components/Toolbar/schema/items.d.ts +17 -1
  44. package/dist/ui/editorUiTypes.d.ts +1 -1
  45. package/dist/ui/toolbarStyleState.d.ts +2 -1
  46. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- export declare const OASIS_BUILTIN_COMMANDS: readonly ["selectAll", "insertFootnote", "insertTableOfContents", "updateTableOfContents", "pastePlainText", "bold", "italic", "underline", "strike", "superscript", "subscript", "link", "unlink", "alignLeft", "alignCenter", "alignRight", "alignJustify", "orderedList", "bulletList", "find", "replace", "toggleTrackChanges", "acceptRevisions", "rejectRevisions", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "splitBlock", "setFontFamily", "setFontSize", "increaseFontSize", "decreaseFontSize", "changeTextCase", "clearFormatting", "setColor", "setHighlight", "setTextShading", "setStyleId", "setUnderlineStyle", "documentStyles", "print", "copy", "exportDocx", "exportPdf", "importDocument", "insertImage", "editImageAlt", "insertImageCaption", "outdent", "indent", "togglePageBreakBefore", "toggleKeepWithNext", "setSpacingAfter", "setSpacingBefore", "setIndentLeft", "setIndentRight", "setIndentFirstLine", "setIndentHanging", "setSpecialIndent", "setParagraphShading", "applyParagraphBorders", "setLineHeight", "setListFormat", "setListStartAt", "toggleOrientation", "setOrientation", "sectionBreakNextPage", "sectionBreakContinuous", "setPageMargins", "tableContext", "tableMerge", "tableSplit", "tableInsertColumnBefore", "tableInsertColumnAfter", "tableDeleteColumn", "tableInsertRowBefore", "tableInsertRowAfter", "tableDeleteRow", "tableCellShading", "tableCellBorders", "tableCellNoBorders", "tableWidth100", "tableAlignLeft", "tableAlignCenter", "tableAlignRight", "tableSetCellWidth", "insertTable"];
1
+ export declare const OASIS_BUILTIN_COMMANDS: readonly ["selectAll", "insertFootnote", "insertTableOfContents", "updateTableOfContents", "pastePlainText", "bold", "italic", "underline", "strike", "superscript", "subscript", "link", "unlink", "alignLeft", "alignCenter", "alignRight", "alignJustify", "orderedList", "bulletList", "find", "replace", "toggleTrackChanges", "acceptRevisions", "rejectRevisions", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "splitBlock", "setFontFamily", "setFontSize", "increaseFontSize", "decreaseFontSize", "changeTextCase", "clearFormatting", "setColor", "setHighlight", "setTextShading", "setStyleId", "setCharacterStyleId", "setUnderlineStyle", "documentStyles", "print", "copy", "exportDocx", "exportPdf", "importDocument", "insertImage", "editImageAlt", "insertImageCaption", "outdent", "indent", "togglePageBreakBefore", "toggleKeepWithNext", "setSpacingAfter", "setSpacingBefore", "setIndentLeft", "setIndentRight", "setIndentFirstLine", "setIndentHanging", "setSpecialIndent", "setParagraphShading", "applyParagraphBorders", "setLineHeight", "setListFormat", "setListStartAt", "toggleOrientation", "setOrientation", "sectionBreakNextPage", "sectionBreakContinuous", "setPageMargins", "tableContext", "tableMerge", "tableSplit", "tableInsertColumnBefore", "tableInsertColumnAfter", "tableDeleteColumn", "tableInsertRowBefore", "tableInsertRowAfter", "tableDeleteRow", "tableCellShading", "tableCellBorders", "tableCellNoBorders", "tableWidth100", "tableAlignLeft", "tableAlignCenter", "tableAlignRight", "tableSetCellWidth", "insertTable"];
2
2
  export type OasisBuiltinCommand = (typeof OASIS_BUILTIN_COMMANDS)[number];
@@ -56,6 +56,7 @@ export interface OasisCommandPayloads {
56
56
  setHighlight: string | null;
57
57
  setTextShading: string | null;
58
58
  setStyleId: string;
59
+ setCharacterStyleId: string;
59
60
  setUnderlineStyle: string | null;
60
61
  documentStyles: undefined;
61
62
  print: undefined;
@@ -1,4 +1,4 @@
1
- import { EditorBlockNode, EditorDocument, EditorEditingZone, EditorState, EditorTableNode, TableLocation } from '../../model.js';
1
+ import { EditorBlockNode, EditorDocument, EditorEditingZone, EditorState, EditorTableNode, TableLocation, EditorRevisionMetadata } from '../../model.js';
2
2
 
3
3
  export type StylePatchValue<T, K extends keyof T> = T[K] | null;
4
4
  export interface ActiveTableLocation {
@@ -7,6 +7,7 @@ export interface ActiveTableLocation {
7
7
  zone: EditorEditingZone;
8
8
  };
9
9
  }
10
+ export declare function createTableRevisionMetadata(): EditorRevisionMetadata;
10
11
  export declare function patchStyleValue<T extends object, K extends keyof T>(style: T | undefined, key: K, value: StylePatchValue<T, K>): T | undefined;
11
12
  export declare function updateStateSections(state: EditorState, updateBlocks: (blocks: EditorBlockNode[]) => EditorBlockNode[]): EditorState;
12
13
  export declare function updateTablesInBlocks(blocks: EditorBlockNode[], updateTable: (table: EditorTableNode) => EditorTableNode): EditorBlockNode[];
@@ -0,0 +1,5 @@
1
+ import { EditorState, EditorTableFloatingLayout } from '../../model.js';
2
+
3
+ export declare function setSelectedTableFloatingLayout(state: EditorState, floating: EditorTableFloatingLayout | null): EditorState;
4
+ export declare function setActiveTableFloatingLayout(state: EditorState, tableId: string, floating: EditorTableFloatingLayout | null): EditorState;
5
+ export declare function moveActiveFloatingTable(state: EditorState, tableId: string, deltaXPoints: number, deltaYPoints: number): EditorState;
@@ -3,3 +3,4 @@ export * from './table/tableStyleCommands.js';
3
3
  export * from './table/tableRowCommands.js';
4
4
  export * from './table/tableColumnCommands.js';
5
5
  export * from './table/insertTableCommand.js';
6
+ export * from './table/tableFloatingCommands.js';
@@ -6,8 +6,8 @@
6
6
  * statements that pointed there continue to work via the barrel
7
7
  * re-export in `src/core/model.ts`.
8
8
  */
9
- export type { EditorUnderlineStyle, EditorLigatures, EditorNumberSpacing, EditorNumberForm, EditorTextLanguage, EditorBorderStyle, EditorTabStop, EditorParagraphListStyle, EditorImageCrop, EditorImageFillMode, EditorImageFloatingPosition, EditorImageFloatingLayout, EditorImageRunData, EditorWrapPolygonPoint, EditorFieldData, EditorFieldChar, EditorFootnoteReferenceData, EditorEndnoteReferenceData, EditorRevision, EditorAsset, EditorFootnoteNumberFormat, EditorFootnoteRestart, EditorDocxWidthValue, EditorTableLayout, EditorTableRowHeightRule, } from './types/primitives.js';
10
- export type { EditorTextStyle, EditorParagraphStyle, EditorTableStyle, EditorTableConditionalFormat, EditorConditionalRowStyle, EditorNamedStyle, } from './types/styles.js';
9
+ export type { EditorUnderlineStyle, EditorLigatures, EditorNumberSpacing, EditorNumberForm, EditorTextLanguage, EditorBorderStyle, 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
11
  export type { EditorRunBase, EditorTextRun, EditorTextBoxShape, EditorTextBoxBody, EditorTextBoxData, EditorDropCap, EditorParagraphNode, EditorTableCellStyle, 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';
@@ -53,6 +53,10 @@ export interface EditorLayoutBlock {
53
53
  paragraphId?: string;
54
54
  globalIndex: number;
55
55
  estimatedHeight: number;
56
+ /** Measured visual height for a zero-flow-height floating table. */
57
+ floatingTableHeight?: number;
58
+ /** Runtime collision displacement for `w:tblOverlap="never"`. */
59
+ floatingTableOffsetY?: number;
56
60
  layout?: EditorLayoutParagraph;
57
61
  tableSegment?: {
58
62
  startRowIndex: number;
@@ -1,5 +1,5 @@
1
- import { EditorBorderStyle, EditorDocxWidthValue, EditorEndnoteReferenceData, EditorFieldChar, EditorFieldData, EditorFootnoteReferenceData, EditorImageFloatingLayout, EditorImageRunData, EditorParagraphListStyle, EditorRevision, EditorTableRowHeightRule } from './primitives.js';
2
- import { EditorParagraphStyle, EditorTableStyle, EditorTextStyle } from './styles.js';
1
+ import { EditorBorderStyle, EditorDocxWidthValue, EditorEndnoteReferenceData, EditorFieldChar, EditorFieldData, EditorFootnoteReferenceData, EditorImageFloatingLayout, EditorImageRunData, EditorParagraphListStyle, EditorRevision, EditorPropertyRevision, EditorStructuralRevision, EditorTableRowHeightRule } from './primitives.js';
2
+ import { EditorParagraphStyle, EditorTableStyle, EditorTableConditionalFlags, EditorTextStyle } from './styles.js';
3
3
 
4
4
  /**
5
5
  * Geometry/appearance of a text box shape (`wps:spPr`). All values are
@@ -186,8 +186,10 @@ export interface EditorTableCellStyle {
186
186
  hideMark?: boolean;
187
187
  /** `w:headers/@w:val`: semantic header cell references. */
188
188
  headers?: string;
189
- /** Preservation-only table-cell revision/property XML children. */
190
- revisionXml?: string[];
189
+ /** Structural `cellIns`/`cellDel`/`cellMerge` revision. */
190
+ revision?: EditorStructuralRevision;
191
+ /** Previous cell properties from `w:tcPrChange`. */
192
+ propertyRevision?: EditorPropertyRevision<EditorTableCellStyle>;
191
193
  }
192
194
  export interface EditorTableCellNode {
193
195
  id: string;
@@ -196,8 +198,19 @@ export interface EditorTableCellNode {
196
198
  rowSpan?: number;
197
199
  vMerge?: "restart" | "continue";
198
200
  style?: EditorTableCellStyle;
201
+ conditionalStyle?: EditorTableConditionalFlags;
202
+ /** Exact pre-change cell grid retained while a tracked merge/split is pending. */
203
+ mergeRevisionState?: EditorTableMergeRevisionState;
204
+ }
205
+ export interface EditorTableMergeRevisionState {
206
+ revisionId: string;
207
+ orientation: "horizontal" | "vertical";
208
+ /** Number of cells occupying the changed horizontal range in current markup. */
209
+ currentCellCount: number;
210
+ previousCells: EditorTableCellNode[];
199
211
  }
200
212
  export interface EditorTableRowStyle {
213
+ isHeader?: boolean;
201
214
  height?: number | string;
202
215
  heightRule?: EditorTableRowHeightRule;
203
216
  gridBefore?: number;
@@ -210,14 +223,17 @@ export interface EditorTableRowStyle {
210
223
  hidden?: boolean;
211
224
  /** Row-level cell spacing override (`w:trPr/w:tblCellSpacing`). */
212
225
  cellSpacing?: EditorDocxWidthValue;
213
- /** Preservation-only row revision/property XML children. */
214
- revisionXml?: string[];
226
+ /** Structural row `w:ins`/`w:del` revision. */
227
+ revision?: EditorStructuralRevision;
228
+ /** Previous row properties from `w:trPrChange`. */
229
+ propertyRevision?: EditorPropertyRevision<EditorTableRowStyle>;
215
230
  }
216
231
  export interface EditorTableRowNode {
217
232
  id: string;
218
233
  cells: EditorTableCellNode[];
219
234
  isHeader?: boolean;
220
235
  style?: EditorTableRowStyle;
236
+ conditionalStyle?: EditorTableConditionalFlags;
221
237
  /**
222
238
  * Raw w:tblPrEx XML (per-row table property exceptions), serialized verbatim
223
239
  * before w:trPr. Preserved for DOCX round-trip fidelity only; not editable.
@@ -231,6 +247,6 @@ export interface EditorTableNode {
231
247
  gridCols?: number[];
232
248
  style?: EditorTableStyle;
233
249
  /** Preservation-only `w:tblGridChange` XML. */
234
- tblGridChangeXml?: string;
250
+ gridRevision?: EditorPropertyRevision<number[]>;
235
251
  }
236
252
  export type EditorBlockNode = EditorParagraphNode | EditorTableNode;
@@ -136,6 +136,23 @@ export interface EditorRevision {
136
136
  author: string;
137
137
  date: number;
138
138
  }
139
+ export interface EditorRevisionMetadata {
140
+ id: string;
141
+ author: string;
142
+ date: number;
143
+ }
144
+ export interface EditorStructuralRevision extends EditorRevisionMetadata {
145
+ type: "insert" | "delete" | "merge";
146
+ previous?: {
147
+ colSpan?: number;
148
+ rowSpan?: number;
149
+ vMerge?: "restart" | "continue";
150
+ };
151
+ }
152
+ export interface EditorPropertyRevision<T> extends EditorRevisionMetadata {
153
+ type: "property" | "grid";
154
+ previous: T;
155
+ }
139
156
  export interface EditorAsset {
140
157
  id: string;
141
158
  url: string;
@@ -1,4 +1,5 @@
1
- import { EditorBorderStyle, EditorDocxWidthValue, EditorLigatures, EditorNumberForm, EditorNumberSpacing, EditorTabStop, EditorTextLanguage, EditorUnderlineStyle } from './primitives.js';
1
+ import { EditorBorderStyle, EditorDocxWidthValue, EditorLigatures, EditorNumberForm, EditorNumberSpacing, EditorPropertyRevision, EditorTabStop, EditorTextLanguage, EditorUnderlineStyle } from './primitives.js';
2
+ import { EditorTableCellStyle } from './nodes.js';
2
3
 
3
4
  export interface EditorTextStyle {
4
5
  styleId?: string;
@@ -73,6 +74,7 @@ export interface EditorParagraphStyle {
73
74
  }
74
75
  /** Row properties from a conditional format's `w:trPr`. */
75
76
  export interface EditorConditionalRowStyle {
77
+ isHeader?: boolean;
76
78
  height?: number | string;
77
79
  heightRule?: "auto" | "exact" | "atLeast";
78
80
  cantSplit?: boolean;
@@ -93,6 +95,32 @@ export interface EditorTableConditionalFormat {
93
95
  paragraphStyle?: EditorParagraphStyle;
94
96
  /** Row properties from the conditional's `w:trPr`. */
95
97
  rowStyle?: EditorConditionalRowStyle;
98
+ /** Full cell properties from conditional `w:tcPr`. */
99
+ cellStyle?: EditorTableCellStyle;
100
+ /** Conditional table properties from `w:tblPr`. */
101
+ tableStyle?: EditorTableStyle;
102
+ }
103
+ export type EditorTableConditionalType = "wholeTable" | "band1Horz" | "band2Horz" | "band1Vert" | "band2Vert" | "firstCol" | "lastCol" | "firstRow" | "lastRow" | "nwCell" | "neCell" | "swCell" | "seCell";
104
+ export type EditorTableConditionalFlags = Partial<Record<EditorTableConditionalType, boolean>>;
105
+ /** Typed `w:tblpPr` positioning for a table whose text wrapping is "around". */
106
+ export interface EditorTableFloatingLayout {
107
+ /** Horizontal positioning reference (`w:horzAnchor`). */
108
+ horizontalAnchor?: "margin" | "page" | "text";
109
+ /** Vertical positioning reference (`w:vertAnchor`). */
110
+ verticalAnchor?: "margin" | "page" | "text";
111
+ /** Explicit horizontal offset in points (`w:tblpX`, originally twips). */
112
+ x?: number;
113
+ /** Explicit vertical offset in points (`w:tblpY`, originally twips). */
114
+ y?: number;
115
+ /** Aligned horizontal position (`w:tblpXSpec`). */
116
+ xAlign?: "left" | "center" | "right" | "inside" | "outside";
117
+ /** Aligned vertical position (`w:tblpYSpec`). */
118
+ yAlign?: "top" | "center" | "bottom" | "inside" | "outside";
119
+ /** Text-wrap distances in points. */
120
+ distanceTop?: number;
121
+ distanceRight?: number;
122
+ distanceBottom?: number;
123
+ distanceLeft?: number;
96
124
  }
97
125
  export interface EditorTableStyle {
98
126
  styleId?: string;
@@ -101,11 +129,19 @@ export interface EditorTableStyle {
101
129
  indentLeft?: EditorDocxWidthValue;
102
130
  layout?: "fixed" | "autofit";
103
131
  cellSpacing?: EditorDocxWidthValue;
132
+ borders?: {
133
+ borderTop?: EditorBorderStyle;
134
+ borderRight?: EditorBorderStyle;
135
+ borderBottom?: EditorBorderStyle;
136
+ borderLeft?: EditorBorderStyle;
137
+ borderInsideH?: EditorBorderStyle;
138
+ borderInsideV?: EditorBorderStyle;
139
+ };
104
140
  pageBreakBefore?: boolean;
105
141
  /** `w:bidiVisual`: visually order table columns right-to-left. */
106
142
  bidiVisual?: boolean;
107
143
  /** `w:tblOverlap/@w:val`: floating-table overlap behavior. */
108
- tblOverlap?: string;
144
+ tblOverlap?: "overlap" | "never";
109
145
  /** `w:tblCellMar`: default margins for cells unless overridden by `w:tcMar`. */
110
146
  defaultCellMargins?: {
111
147
  top?: number;
@@ -115,14 +151,14 @@ export interface EditorTableStyle {
115
151
  start?: number;
116
152
  end?: number;
117
153
  };
118
- /** Raw `w:tblpPr` attributes for floating table round-trip preservation. */
119
- floating?: Record<string, string>;
154
+ /** Typed `w:tblpPr` floating-table position and wrap distances. */
155
+ floating?: EditorTableFloatingLayout;
120
156
  /** Table alt text title, corresponding to Word's table properties Alt Text title. */
121
157
  altTitle?: string;
122
158
  /** Table alt text description, corresponding to Word's table properties Alt Text description. */
123
159
  altDescription?: string;
124
- /** Preservation-only table revision/property XML children. */
125
- revisionXml?: string[];
160
+ /** Previous table properties from `w:tblPrChange`. */
161
+ revision?: EditorPropertyRevision<EditorTableStyle>;
126
162
  /** `w:tblStyleRowBandSize` — rows per horizontal band (default 1). */
127
163
  rowBandSize?: number;
128
164
  /** `w:tblStyleColBandSize` — columns per vertical band (default 1). */
@@ -143,8 +179,17 @@ export interface EditorNamedStyle {
143
179
  id: string;
144
180
  name: string;
145
181
  type: "paragraph" | "character" | "table";
182
+ isDefault?: boolean;
146
183
  basedOn?: string;
147
184
  nextStyle?: string;
185
+ /** Word quick-style gallery metadata (`w:qFormat`). */
186
+ qFormat?: boolean;
187
+ /** Lower values appear earlier in Word's quick-style gallery. */
188
+ uiPriority?: number;
189
+ /** Hide the style from style-selection user interfaces. */
190
+ semiHidden?: boolean;
191
+ /** Reveal a semi-hidden style after it is used by document content. */
192
+ unhideWhenUsed?: boolean;
148
193
  paragraphStyle?: EditorParagraphStyle;
149
194
  textStyle?: EditorTextStyle;
150
195
  tableStyle?: EditorTableStyle;
@@ -8,3 +8,4 @@
8
8
  * without any change.
9
9
  */
10
10
  export * from './model/index.js';
11
+ export * from './tableStyleResolver.js';
@@ -0,0 +1,20 @@
1
+ import { EditorNamedStyle, EditorParagraphStyle, EditorTableCellStyle, EditorTableNode, EditorTableRowStyle, EditorTableStyle, EditorTextStyle } from './model.js';
2
+
3
+ export interface ResolvedTableCellFormatting {
4
+ tableStyle: EditorTableStyle;
5
+ rowStyle: EditorTableRowStyle;
6
+ cellStyle: EditorTableCellStyle;
7
+ paragraphStyle?: EditorParagraphStyle;
8
+ textStyle?: EditorTextStyle;
9
+ conditionalKeys: string[];
10
+ }
11
+ export declare function resolveEffectiveTableStyle(table: EditorTableNode, styles?: Record<string, EditorNamedStyle>): EditorTableStyle;
12
+ export declare function resolveTableParagraphInheritance(tableStyle: EditorParagraphStyle | undefined, paragraphStyleId: string | undefined, styles: Record<string, EditorNamedStyle> | undefined): EditorParagraphStyle | undefined;
13
+ export declare function resolveEffectiveTableCellFormatting(options: {
14
+ table: EditorTableNode;
15
+ rowIndex: number;
16
+ cellIndex: number;
17
+ visualColumnIndex: number;
18
+ columnCount: number;
19
+ styles?: Record<string, EditorNamedStyle>;
20
+ }): ResolvedTableCellFormatting;
@@ -1,6 +1,6 @@
1
1
  import { EditorParagraphListStyle } from '../model.js';
2
2
 
3
3
  export type ToggleableTextStyleKey = "bold" | "italic" | "underline" | "strike" | "doubleStrike" | "superscript" | "subscript" | "smallCaps" | "allCaps" | "hidden" | "noProof" | "webHidden" | "specVanish" | "contextualAlternates";
4
- export type ValueTextStyleKey = "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle" | "underlineColor" | "characterScale" | "characterSpacing" | "baselineShift" | "kerningThreshold" | "ligatures" | "numberSpacing" | "numberForm" | "stylisticSet";
4
+ export type ValueTextStyleKey = "styleId" | "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle" | "underlineColor" | "characterScale" | "characterSpacing" | "baselineShift" | "kerningThreshold" | "ligatures" | "numberSpacing" | "numberForm" | "stylisticSet";
5
5
  export type ValueParagraphStyleKey = "styleId" | "align" | "spacingBefore" | "spacingAfter" | "lineHeight" | "indentLeft" | "indentRight" | "indentFirstLine" | "indentHanging" | "shading" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "tabs" | "pageBreakBefore" | "keepWithNext";
6
6
  export type ParagraphListKind = EditorParagraphListStyle["kind"];
@@ -1,6 +1,7 @@
1
1
  import { EditorParagraphNode, EditorTableCellNode, EditorTableNode, EditorTableRowStyle } from '../../core/model.js';
2
2
 
3
3
  export type SerializeTableParagraphXml = (paragraph: EditorParagraphNode, cell: EditorTableCellNode) => string;
4
+ export declare function serializeTableCellStyleXml(style: EditorTableCellNode["style"]): string;
4
5
  /**
5
6
  * Serializes the core row style properties into `<w:trPr>` inner XML.
6
7
  * Used for style definitions (styles.xml) as well as per-row serialization.
@@ -1,8 +1,20 @@
1
- import { EditorDocument, EditorLayoutFragment, EditorLayoutLine, EditorParagraphNode, EditorTextStyle } from '../../../core/model.js';
1
+ import { EditorDocument, EditorLayoutFragment, EditorLayoutLine, EditorParagraphNode, EditorTextStyle, EditorPageSettings } from '../../../core/model.js';
2
2
  import { PdfFontRegistry } from '../fonts/PdfFontRegistry.js';
3
3
  import { BlockDrawers } from './blockDrawers.js';
4
4
  import { OasisPdfWriter } from '../OasisPdfWriter.js';
5
5
 
6
+ export declare function drawFloatingImagesForParagraph(options: {
7
+ writer: OasisPdfWriter;
8
+ pageIndex: number;
9
+ lines: EditorLayoutLine[];
10
+ document: EditorDocument;
11
+ pageSettings: EditorPageSettings;
12
+ contentLeft: number;
13
+ contentTop: number;
14
+ contentWidth: number;
15
+ paragraphTop: number;
16
+ layer: "behind" | "front";
17
+ }): Promise<void>;
6
18
  export declare function drawFragmentHighlight(writer: OasisPdfWriter, pageIndex: number, line: EditorLayoutLine, fragment: EditorLayoutFragment, originX: number, originY: number, styles: Required<EditorTextStyle>): void;
7
19
  export declare function drawFragmentShading(writer: OasisPdfWriter, pageIndex: number, line: EditorLayoutLine, fragment: EditorLayoutFragment, originX: number, originY: number, styles: Required<EditorTextStyle>): void;
8
20
  export declare function drawFragmentDecoration(writer: OasisPdfWriter, pageIndex: number, line: EditorLayoutLine, fragment: EditorLayoutFragment, originX: number, originY: number, styles: Required<EditorTextStyle>, kind: "underline" | "strike" | "doubleStrike"): void;
@@ -32,5 +32,6 @@ export declare function drawFloatingTextBoxesForParagraph(options: {
32
32
  contentWidth: number;
33
33
  paragraphTop: number;
34
34
  drawers: BlockDrawers;
35
+ layer?: "behind" | "front";
35
36
  }): Promise<void>;
36
37
  export {};
@@ -204,6 +204,24 @@ export declare const en: {
204
204
  "table.wrapAround": string;
205
205
  "table.positioning": string;
206
206
  "table.positioningReadOnly": string;
207
+ "table.horizontalAnchor": string;
208
+ "table.verticalAnchor": string;
209
+ "table.anchorMargin": string;
210
+ "table.anchorPage": string;
211
+ "table.anchorText": string;
212
+ "table.positionX": string;
213
+ "table.positionY": string;
214
+ "table.horizontalAlignment": string;
215
+ "table.explicitOffset": string;
216
+ "table.distanceTop": string;
217
+ "table.distanceRight": string;
218
+ "table.distanceBottom": string;
219
+ "table.distanceLeft": string;
220
+ "table.allowOverlap": string;
221
+ "table.borderStart": string;
222
+ "table.borderEnd": string;
223
+ "table.borderTlBr": string;
224
+ "table.borderTrBl": string;
207
225
  "table.rowHeight": string;
208
226
  "table.rowHeightRule": string;
209
227
  "table.rowAuto": string;
@@ -204,6 +204,24 @@ export declare const ptBR: {
204
204
  "table.wrapAround": string;
205
205
  "table.positioning": string;
206
206
  "table.positioningReadOnly": string;
207
+ "table.horizontalAnchor": string;
208
+ "table.verticalAnchor": string;
209
+ "table.anchorMargin": string;
210
+ "table.anchorPage": string;
211
+ "table.anchorText": string;
212
+ "table.positionX": string;
213
+ "table.positionY": string;
214
+ "table.horizontalAlignment": string;
215
+ "table.explicitOffset": string;
216
+ "table.distanceTop": string;
217
+ "table.distanceRight": string;
218
+ "table.distanceBottom": string;
219
+ "table.distanceLeft": string;
220
+ "table.allowOverlap": string;
221
+ "table.borderStart": string;
222
+ "table.borderEnd": string;
223
+ "table.borderTlBr": string;
224
+ "table.borderTrBl": string;
207
225
  "table.rowHeight": string;
208
226
  "table.rowHeightRule": string;
209
227
  "table.rowAuto": string;
@@ -1,8 +1,9 @@
1
1
  import { Element as XmlElement } from '@xmldom/xmldom';
2
- import { EditorParagraphNode, EditorTableCellStyle, EditorTableRowNode, EditorTableRowStyle, EditorTableStyle } from '../../core/model.js';
2
+ import { EditorParagraphNode, EditorTableCellStyle, EditorTableRowNode, EditorTableRowStyle, EditorTableStyle, EditorTableConditionalFlags } from '../../core/model.js';
3
3
  import { EditorTableBorders } from './borders.js';
4
4
  import { ParagraphAutospacingFlags } from './paragraphStyle.js';
5
5
 
6
+ export declare function parseTableConditionalFlags(properties: XmlElement | null): EditorTableConditionalFlags | undefined;
6
7
  export declare function parseTableStyle(tblPr: XmlElement | null, tableStyleId?: string): EditorTableStyle | undefined;
7
8
  export declare function parseTableRowStyle(rowProperties: XmlElement | null): EditorTableRowStyle | undefined;
8
9
  export declare function getTableCellColSpan(cellProperties: XmlElement | null): number;
@@ -6,4 +6,4 @@ import { DocxImportTheme } from './theme.js';
6
6
  import { NumberingMaps } from './numbering.js';
7
7
  import { ParseNestedBlocks } from './runs/types.js';
8
8
 
9
- export declare function parseTableNode(tableNode: XmlElement, numberingMaps: NumberingMaps, zip: JSZip, relsMap: Map<string, string>, assets: AssetRegistry, theme: DocxImportTheme, parseNestedBlocks: ParseNestedBlocks, styles?: Record<string, EditorNamedStyle>): Promise<EditorTableNode>;
9
+ export declare function parseTableNode(tableNode: XmlElement, numberingMaps: NumberingMaps, zip: JSZip, relsMap: Map<string, string>, assets: AssetRegistry, theme: DocxImportTheme, parseNestedBlocks: ParseNestedBlocks, _styles?: Record<string, EditorNamedStyle>): Promise<EditorTableNode>;