oasis-editor 0.0.227 → 0.0.229

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 (104) hide show
  1. package/dist/OasisEditorApp-Dkk2-Ed0.js +1 -0
  2. package/dist/app/controllers/EditorCommandsController.d.ts +6 -1
  3. package/dist/app/services/FindReplaceService.d.ts +6 -18
  4. package/dist/assets/{importDocxWorker-D9et8X0W.js → importDocxWorker-dPLECw5a.js} +197 -181
  5. package/dist/core/commands/builtinCommands.d.ts +1 -1
  6. package/dist/core/commands/dropCap.d.ts +23 -0
  7. package/dist/core/commands/fieldDate.d.ts +6 -0
  8. package/dist/core/commands/findReplace.d.ts +25 -0
  9. package/dist/core/commands/floatingAlignCommands.d.ts +98 -0
  10. package/dist/core/commands/floatingReorderCommands.d.ts +17 -0
  11. package/dist/core/commands/headerFooter.d.ts +17 -0
  12. package/dist/core/commands/horizontalLine.d.ts +3 -0
  13. package/dist/core/commands/hyphenation.d.ts +27 -0
  14. package/dist/core/commands/image.d.ts +45 -0
  15. package/dist/core/commands/noteOptions.d.ts +22 -0
  16. package/dist/core/commands/outlineStep.d.ts +13 -0
  17. package/dist/core/commands/pageSetup.d.ts +41 -1
  18. package/dist/core/commands/paragraphAdjustRightInd.d.ts +8 -0
  19. package/dist/core/commands/paragraphAlign.d.ts +10 -0
  20. package/dist/core/commands/paragraphAutoSpaceDE.d.ts +8 -0
  21. package/dist/core/commands/paragraphAutoSpaceDN.d.ts +8 -0
  22. package/dist/core/commands/paragraphBidi.d.ts +7 -0
  23. package/dist/core/commands/paragraphContextualSpacing.d.ts +7 -0
  24. package/dist/core/commands/paragraphKeepLinesTogether.d.ts +7 -0
  25. package/dist/core/commands/paragraphKeepWithNext.d.ts +7 -0
  26. package/dist/core/commands/paragraphKinsoku.d.ts +8 -0
  27. package/dist/core/commands/paragraphLineRule.d.ts +10 -0
  28. package/dist/core/commands/paragraphListLevel.d.ts +8 -0
  29. package/dist/core/commands/paragraphMirrorIndents.d.ts +7 -0
  30. package/dist/core/commands/paragraphMove.d.ts +8 -0
  31. package/dist/core/commands/paragraphOutlineLevel.d.ts +11 -0
  32. package/dist/core/commands/paragraphOverflowPunct.d.ts +8 -0
  33. package/dist/core/commands/paragraphPageBreakBefore.d.ts +7 -0
  34. package/dist/core/commands/paragraphReset.d.ts +9 -0
  35. package/dist/core/commands/paragraphSort.d.ts +7 -0
  36. package/dist/core/commands/paragraphSuppressAutoHyphens.d.ts +7 -0
  37. package/dist/core/commands/paragraphSuppressLineNumbers.d.ts +7 -0
  38. package/dist/core/commands/paragraphTabs.d.ts +28 -0
  39. package/dist/core/commands/paragraphTextDirection.d.ts +9 -0
  40. package/dist/core/commands/paragraphTopLinePunct.d.ts +7 -0
  41. package/dist/core/commands/paragraphWidowControl.d.ts +8 -0
  42. package/dist/core/commands/paragraphWordWrap.d.ts +8 -0
  43. package/dist/core/commands/publicCommandTypes.d.ts +189 -3
  44. package/dist/core/commands/selectUnit.d.ts +43 -0
  45. package/dist/core/commands/shape.d.ts +4 -0
  46. package/dist/core/commands/shapeFillCommands.d.ts +31 -0
  47. package/dist/core/commands/specialChar.d.ts +18 -0
  48. package/dist/core/commands/table/tableAlignmentCommands.d.ts +10 -0
  49. package/dist/core/commands/table/tableAutoFitCommands.d.ts +16 -0
  50. package/dist/core/commands/table/tableCellFitTextCommands.d.ts +7 -0
  51. package/dist/core/commands/table/tableCellMarginsCommands.d.ts +20 -0
  52. package/dist/core/commands/table/tableCellNoWrapCommands.d.ts +7 -0
  53. package/dist/core/commands/table/tableCellSpacingCommands.d.ts +9 -0
  54. package/dist/core/commands/table/tableColumnCommands.d.ts +10 -0
  55. package/dist/core/commands/table/tableDeleteCellsCommands.d.ts +16 -0
  56. package/dist/core/commands/table/tableDeleteCommands.d.ts +11 -0
  57. package/dist/core/commands/table/tableFormulaCommands.d.ts +34 -0
  58. package/dist/core/commands/table/tableIndentCommands.d.ts +9 -0
  59. package/dist/core/commands/table/tableRepeatHeaderCommands.d.ts +15 -0
  60. package/dist/core/commands/table/tableRowBreakAcrossPagesCommands.d.ts +9 -0
  61. package/dist/core/commands/table/tableRowCommands.d.ts +2 -0
  62. package/dist/core/commands/table/tableRowHeightCommands.d.ts +21 -0
  63. package/dist/core/commands/table/tableSelectionCommands.d.ts +18 -0
  64. package/dist/core/commands/table/tableSortCommands.d.ts +16 -0
  65. package/dist/core/commands/table/tableStyleCommands.d.ts +9 -0
  66. package/dist/core/commands/table.d.ts +15 -0
  67. package/dist/core/commands/text.d.ts +1 -1
  68. package/dist/core/commands/textBoxBodyCommands.d.ts +43 -0
  69. package/dist/core/commands/textFormatting.d.ts +15 -0
  70. package/dist/core/commands/zoneBlocks.d.ts +10 -0
  71. package/dist/core/engine.d.ts +3 -0
  72. package/dist/core/model/types/primitives.d.ts +10 -0
  73. package/dist/core/plugin.d.ts +4 -1
  74. package/dist/core/pluginUiTypes.d.ts +4 -1
  75. package/dist/core/textStyle/textStyleKeys.d.ts +3 -3
  76. package/dist/core/transactionMergeKeys.d.ts +34 -0
  77. package/dist/defaultToolbar-6IjbWowg.js +1 -0
  78. package/dist/export/docx/docxTypes.d.ts +1 -0
  79. package/dist/i18n/locales/en.d.ts +20 -0
  80. package/dist/i18n/locales/pt-BR.d.ts +20 -0
  81. package/dist/index.d.ts +1 -1
  82. package/dist/layoutProjection/floatingObjects.d.ts +3 -0
  83. package/dist/oasis-editor.css +1 -1
  84. package/dist/oasis-editor.js +1 -1
  85. package/dist/oasis-editor.umd.cjs +1 -1
  86. package/dist/plugins/internal/essentialsCapabilities.d.ts +310 -2
  87. package/dist/plugins/internal/essentialsCommandBuilders.d.ts +2 -0
  88. package/dist/plugins/internal/essentialsCommandGroups/table.d.ts +3 -2
  89. package/dist/ui/app/createAppCommandsController.d.ts +12 -2
  90. package/dist/ui/app/createEditorCommandRuntime.d.ts +11 -1
  91. package/dist/ui/app/essentials/types.d.ts +2 -0
  92. package/dist/ui/components/Toolbar/marginPresets.d.ts +5 -9
  93. package/dist/ui/components/Toolbar/primitives/SplitButton.d.ts +1 -0
  94. package/dist/ui/components/Toolbar/primitives/popoverBranch.d.ts +7 -0
  95. package/dist/ui/components/Toolbar/primitives/useDismiss.d.ts +3 -1
  96. package/dist/ui/components/Toolbar/ribbon/RibbonGroup.d.ts +2 -1
  97. package/dist/ui/components/Toolbar/ribbon/measureRibbonGroups.d.ts +8 -0
  98. package/dist/ui/components/Toolbar/ribbon/ribbonModel.d.ts +14 -1
  99. package/dist/ui/components/Toolbar/schema/items.d.ts +13 -4
  100. package/dist/ui/toolbarStyleState.d.ts +22 -3
  101. package/dist/ui/utils/IconManager.d.ts +3 -1
  102. package/package.json +7 -2
  103. package/dist/OasisEditorApp-DyqrRigM.js +0 -1
  104. package/dist/defaultToolbar-Dq0iVC5E.js +0 -1
@@ -0,0 +1,28 @@
1
+ import { EditorState, EditorTabStop } from '../model.js';
2
+ /** The most tab stops a paragraph keeps (WordCraft's `MAX_TABS`). */
3
+ export declare const MAX_TAB_STOPS = 64;
4
+ /** Positions are points within ±1584 (WordCraft's tab position limit). */
5
+ export declare const MAX_TAB_POSITION = 1584;
6
+ /** Distance (pt) below which two stop positions count as the same. */
7
+ export declare const TAB_POS_EPS = 0.000001;
8
+ export interface ParagraphTabStopsChange {
9
+ /**
10
+ * Replace the entire direct tab-stop list with these stops (`null` clears
11
+ * every direct stop). Omit to leave the current direct list unchanged.
12
+ */
13
+ tabs?: EditorTabStop[] | null;
14
+ /** Add or update these tab stops (a stop already at its position is replaced). */
15
+ set?: EditorTabStop[];
16
+ /** Remove the direct stops at these positions (pt); a `clear` stop is recorded where the named style declares one. */
17
+ clear?: number[];
18
+ /** Remove every direct stop (recording `clear` stops over style-declared positions). */
19
+ clearAll?: boolean;
20
+ /** Set the document default tab interval (pt); `null` restores it. */
21
+ default?: number | null;
22
+ }
23
+ /**
24
+ * Edit the selected paragraphs' tab stops and the document default tab
25
+ * interval, mirroring WordCraft's `para.tabs`. Returns the same state when
26
+ * nothing changes.
27
+ */
28
+ export declare function editParagraphTabStops(state: EditorState, change: ParagraphTabStopsChange): EditorState;
@@ -0,0 +1,9 @@
1
+ import { EditorState } from '../model.js';
2
+ /** Valid `w:textDirection/@w:val` values for a paragraph. */
3
+ export type ParagraphTextDirection = "lrTb" | "tbRl" | "btLr" | "lrTbV" | "tbRlV";
4
+ /**
5
+ * Set the text flow (`textDirection`) of every selected paragraph. Pass one of
6
+ * the five OOXML values to store it, or `null` to clear the key (default
7
+ * `lrTb`, omitted on export). Returns the same state when nothing changes.
8
+ */
9
+ export declare function setParagraphTextDirection(state: EditorState, direction: ParagraphTextDirection | null): EditorState;
@@ -0,0 +1,7 @@
1
+ import { EditorState } from '../model.js';
2
+ /**
3
+ * Set the top-line-punctuation flag (`topLinePunct`) of every selected
4
+ * paragraph. Pass `true`/`false` to store the state explicitly, or `null` to
5
+ * clear the key (default off). Returns the same state when nothing changes.
6
+ */
7
+ export declare function setParagraphTopLinePunct(state: EditorState, value: boolean | null): EditorState;
@@ -0,0 +1,8 @@
1
+ import { EditorState } from '../model.js';
2
+ /**
3
+ * Set the widow-control flag (`widowControl`) of every selected paragraph.
4
+ * Pass `true`/`false` to store the state explicitly, or `null` to clear the
5
+ * key (defaults to on and is omitted on export). Returns the same state when
6
+ * nothing changes.
7
+ */
8
+ export declare function setParagraphWidowControl(state: EditorState, value: boolean | null): EditorState;
@@ -0,0 +1,8 @@
1
+ import { EditorState } from '../model.js';
2
+ /**
3
+ * Set the word-wrap flag (`wordWrap`) of every selected paragraph. Pass
4
+ * `true`/`false` to store the state explicitly, or `null` to clear the key
5
+ * (defaults to on and is omitted on export). Returns the same state when
6
+ * nothing changes.
7
+ */
8
+ export declare function setParagraphWordWrap(state: EditorState, value: boolean | null): EditorState;
@@ -1,8 +1,8 @@
1
1
  import { CommandRef } from './CommandRef.js';
2
- import { EditorPageMargins, EditorMathExpression, EditorPageBorder, EditorWatermark } from '../model.js';
2
+ import { EditorPageMargins, EditorPosition, EditorMathExpression, EditorPageBorder, EditorTabStop, EditorWatermark } from '../model.js';
3
3
  import { SectionPageNumberFormat } from './pageNumber.js';
4
4
  import { TextCaseMode } from './text.js';
5
- import { TableBorderPreset } from './table.js';
5
+ import { TableBorderPreset, TableRowHeight } from './table.js';
6
6
  import { DesignThemeId } from './design.js';
7
7
  /** Payload for the `insertTable` command. */
8
8
  export interface InsertTablePayload {
@@ -21,7 +21,33 @@ export interface SetSpecialIndentPayload {
21
21
  kind: "none" | "firstLine" | "hanging";
22
22
  value?: number | null;
23
23
  }
24
- /** Payload for inserting text with an optional character font override. */
24
+ /** Payload for the `setParagraphTabStops` command (WordCraft para.tabs). */
25
+ export interface ParagraphTabStopsPayload {
26
+ /** Replace the entire direct tab-stop list (`null` clears every direct stop). */
27
+ tabs?: EditorTabStop[] | null;
28
+ /** Add or update these tab stops. */
29
+ set?: EditorTabStop[];
30
+ /** Remove the direct stops at these positions (pt); records a `clear` stop over a style-declared one. */
31
+ clear?: number[];
32
+ /** Remove every direct stop (recording `clear` stops over style-declared ones). */
33
+ clearAll?: boolean;
34
+ /** Set the document default tab interval (pt); `null` restores it. */
35
+ default?: number | null;
36
+ }
37
+ /** Payload for the `setNoteOptions` command (WordCraft references.noteOptions). */
38
+ export interface NoteOptionsPayload {
39
+ kind: "footnote" | "endnote";
40
+ numberFormat?: string | null;
41
+ startAt?: number | null;
42
+ restart?: string | null;
43
+ }
44
+ /** Payload for the `replaceAll` command (edit.replaceAll). */
45
+ export interface ReplaceAllPayload {
46
+ search: string;
47
+ replace: string;
48
+ matchCase?: boolean;
49
+ wholeWord?: boolean;
50
+ } /** Payload for inserting text with an optional character font override. */
25
51
  export interface InsertTextPayload {
26
52
  text: string;
27
53
  fontFamily?: string | null;
@@ -32,6 +58,20 @@ export interface InsertTextPayload {
32
58
  */
33
59
  export interface OasisCommandPayloads {
34
60
  selectAll: undefined;
61
+ selectWord: undefined;
62
+ selectSentence: undefined;
63
+ selectParagraph: undefined;
64
+ selectCollapse: {
65
+ end?: boolean;
66
+ } | undefined;
67
+ selectText: {
68
+ text: string;
69
+ occurrence?: number;
70
+ } | undefined;
71
+ selectRange: {
72
+ anchor: EditorPosition;
73
+ focus: EditorPosition;
74
+ } | undefined;
35
75
  insertFootnote: undefined;
36
76
  insertText: string | InsertTextPayload;
37
77
  insertEquation: EditorMathExpression;
@@ -49,7 +89,22 @@ export interface OasisCommandPayloads {
49
89
  bold: undefined;
50
90
  italic: undefined;
51
91
  underline: undefined;
92
+ doubleUnderline: undefined;
93
+ wordUnderline: undefined;
52
94
  strike: undefined;
95
+ doubleStrike: undefined;
96
+ smallCaps: undefined;
97
+ allCaps: undefined;
98
+ hidden: undefined;
99
+ noProof: undefined;
100
+ webHidden: undefined;
101
+ specVanish: undefined;
102
+ contextualAlternates: undefined;
103
+ characterBorder: undefined;
104
+ shadow: undefined;
105
+ emboss: undefined;
106
+ engrave: undefined;
107
+ outline: undefined;
53
108
  superscript: undefined;
54
109
  subscript: undefined;
55
110
  link: string | undefined;
@@ -60,8 +115,11 @@ export interface OasisCommandPayloads {
60
115
  alignJustify: undefined;
61
116
  orderedList: undefined;
62
117
  bulletList: undefined;
118
+ moveParagraphsUp: undefined;
119
+ moveParagraphsDown: undefined;
63
120
  find: undefined;
64
121
  replace: undefined;
122
+ replaceAll: ReplaceAllPayload;
65
123
  toggleTrackChanges: undefined;
66
124
  acceptRevisions: undefined;
67
125
  rejectRevisions: undefined;
@@ -87,10 +145,20 @@ export interface OasisCommandPayloads {
87
145
  lineBreak: undefined;
88
146
  columnBreak: undefined;
89
147
  splitBlock: undefined;
148
+ insertNonBreakingSpace: undefined;
149
+ insertNonBreakingHyphen: undefined;
150
+ insertOptionalHyphen: undefined;
151
+ insertEmDash: undefined;
152
+ insertEllipsis: undefined;
153
+ insertCopyright: undefined;
154
+ insertRegistered: undefined;
155
+ insertTrademark: undefined;
90
156
  setFontFamily: string | null;
91
157
  setFontSize: SetFontSizePayload | number | string | null;
92
158
  increaseFontSize: undefined;
93
159
  decreaseFontSize: undefined;
160
+ growFont1: undefined;
161
+ shrinkFont1: undefined;
94
162
  changeTextCase: TextCaseMode;
95
163
  clearFormatting: undefined;
96
164
  setColor: string | null;
@@ -99,6 +167,19 @@ export interface OasisCommandPayloads {
99
167
  setStyleId: string;
100
168
  setCharacterStyleId: string;
101
169
  setUnderlineStyle: string | null;
170
+ setUnderlineColor: string | null;
171
+ setCharacterScale: number | null;
172
+ setCharacterSpacing: number | null;
173
+ setRunSnapToGrid: boolean | null;
174
+ setFitText: number | null;
175
+ setBaselineShift: number | null;
176
+ setEmphasisMark: string | null;
177
+ setTextEffect: string | null;
178
+ setKerning: number | null;
179
+ setLigatures: string | null;
180
+ setNumberSpacing: string | null;
181
+ setNumberForm: string | null;
182
+ setStylisticSet: number | null;
102
183
  documentStyles: undefined;
103
184
  print: undefined;
104
185
  copy: undefined;
@@ -122,12 +203,46 @@ export interface OasisCommandPayloads {
122
203
  imageCropFill: undefined;
123
204
  imageCropFit: undefined;
124
205
  imageCropReset: undefined;
206
+ imageFlip: "horizontal" | "vertical";
207
+ imageRotate: "left" | "right";
208
+ imageTransparency: number | null;
209
+ resetImage: undefined;
125
210
  outdent: undefined;
126
211
  indent: undefined;
127
212
  togglePageBreakBefore: undefined;
128
213
  toggleKeepWithNext: undefined;
214
+ toggleKeepLinesTogether: undefined;
215
+ toggleWidowControl: undefined;
216
+ toggleParagraphBidi: undefined;
217
+ setParagraphBidi: boolean | null;
218
+ setParagraphAlign: "left" | "center" | "right" | "justify" | null;
219
+ sortParagraphs: {
220
+ descending?: boolean;
221
+ } | boolean | undefined;
222
+ promote: undefined;
223
+ demote: undefined;
224
+ resetParagraphFormatting: undefined;
225
+ setParagraphTabStops: ParagraphTabStopsPayload | undefined;
226
+ setOutlineLevel: number | null | undefined;
129
227
  setSpacingAfter: number | null;
130
228
  setSpacingBefore: number | null;
229
+ setContextualSpacing: boolean | null;
230
+ setMirrorIndents: boolean | null;
231
+ setLineRule: "auto" | "exact" | "atLeast" | null;
232
+ setTextDirection: string | null;
233
+ setSuppressAutoHyphens: boolean | null;
234
+ setSuppressLineNumbers: boolean | null;
235
+ setKinsoku: boolean | null;
236
+ setOverflowPunct: boolean | null;
237
+ setWordWrap: boolean | null;
238
+ setAutoSpaceDE: boolean | null;
239
+ setAutoSpaceDN: boolean | null;
240
+ setAdjustRightInd: boolean | null;
241
+ setTopLinePunct: boolean | null;
242
+ setPageBreakBefore: boolean | null;
243
+ setKeepWithNext: boolean | null;
244
+ setKeepLinesTogether: boolean | null;
245
+ setWidowControl: boolean | null;
131
246
  setIndentLeft: number | null;
132
247
  setIndentRight: number | null;
133
248
  setIndentFirstLine: number | null;
@@ -135,9 +250,17 @@ export interface OasisCommandPayloads {
135
250
  setSpecialIndent: SetSpecialIndentPayload;
136
251
  setParagraphShading: string | null;
137
252
  applyParagraphBorders: undefined;
253
+ applyHorizontalLine: undefined;
254
+ setDropCap: {
255
+ text?: string;
256
+ lines?: number;
257
+ type?: "drop" | "margin" | "none";
258
+ font?: string;
259
+ } | null;
138
260
  setLineHeight: number | null;
139
261
  setListFormat: string;
140
262
  setListStartAt: number | null;
263
+ setListLevel: number;
141
264
  toggleOrientation: undefined;
142
265
  setOrientation: "portrait" | "landscape";
143
266
  sectionBreakNextPage: undefined;
@@ -146,6 +269,7 @@ export interface OasisCommandPayloads {
146
269
  sectionBreakOddPage: undefined;
147
270
  sectionBreakNextColumn: undefined;
148
271
  setPageMargins: SetPageMarginsPayload;
272
+ setMarginsPreset: string;
149
273
  setSectionPageNumbering: {
150
274
  start?: number;
151
275
  format?: SectionPageNumberFormat;
@@ -161,6 +285,15 @@ export interface OasisCommandPayloads {
161
285
  separator?: boolean;
162
286
  };
163
287
  setColumnsPreset: string;
288
+ setSectionVerticalAlign: "top" | "center" | "both" | "bottom" | null;
289
+ setSectionStart: "nextPage" | "continuous" | "evenPage" | "oddPage" | "nextColumn" | null;
290
+ setSectionBidi: boolean | null;
291
+ setHyphenation: {
292
+ value?: boolean;
293
+ zone?: number;
294
+ caps?: boolean;
295
+ limit?: number;
296
+ } | null;
164
297
  editHeader: undefined;
165
298
  editFooter: undefined;
166
299
  editFirstPageHeader: undefined;
@@ -174,10 +307,16 @@ export interface OasisCommandPayloads {
174
307
  insertBookmark: string | undefined;
175
308
  removeBookmark: string;
176
309
  insertDateField: undefined;
310
+ insertDateTime: {
311
+ dateFormat?: string;
312
+ } | undefined;
177
313
  insertCrossReference: {
178
314
  type?: "REF" | "PAGEREF";
179
315
  bookmark: string;
180
316
  };
317
+ setNoteOptions: NoteOptionsPayload;
318
+ setDifferentFirstPage: boolean | null;
319
+ setDifferentOddEven: boolean | null;
181
320
  exitHeaderFooter: undefined;
182
321
  applyDocumentTheme: DesignThemeId;
183
322
  setDocumentColorScheme: string;
@@ -194,6 +333,7 @@ export interface OasisCommandPayloads {
194
333
  tableInsertColumnBefore: undefined;
195
334
  tableInsertColumnAfter: undefined;
196
335
  tableDeleteColumn: undefined;
336
+ tableDeleteCells: undefined;
197
337
  tableInsertRowBefore: undefined;
198
338
  tableInsertRowAfter: undefined;
199
339
  tableDeleteRow: undefined;
@@ -212,7 +352,28 @@ export interface OasisCommandPayloads {
212
352
  tableToText: undefined;
213
353
  textToTable: undefined;
214
354
  tableSplitAtRow: undefined;
355
+ tableSortAscending: undefined;
356
+ tableSortDescending: undefined;
357
+ tableDelete: undefined;
358
+ tableRepeatHeaderRows: undefined;
359
+ tableSetCellMargins: undefined;
360
+ tableSetCellSpacing: number | null;
361
+ tableSetTableIndent: number | null;
362
+ tableSetAlignment: "left" | "center" | "right" | null;
363
+ tableFormula: undefined;
364
+ tableSelectCell: undefined;
365
+ tableSelectRow: undefined;
366
+ tableSelectColumn: undefined;
367
+ tableSelectTable: undefined;
368
+ tableAutoFit: "contents" | "window" | "fixed";
369
+ tableSetRowHeight: TableRowHeight;
370
+ tableSetBreakAcrossPages: boolean | null;
371
+ tableSetHeaderRow: boolean | null;
372
+ tableSetColumnWidth: number | string | null;
373
+ tableSetTableWidth: number | string | null;
215
374
  tableSetCellWidth: string | number;
375
+ tableSetCellNoWrap: boolean | null;
376
+ tableSetCellFitText: boolean | null;
216
377
  tableToggleHeaderRow: undefined;
217
378
  tableToggleTotalRow: undefined;
218
379
  tableToggleBandedRows: undefined;
@@ -224,8 +385,33 @@ export interface OasisCommandPayloads {
224
385
  tableDistributeColumns: undefined;
225
386
  tableDistributeRows: undefined;
226
387
  insertTable: InsertTablePayload;
388
+ insertShape: string;
389
+ setShapeFill: string | null;
390
+ setShapeOutline: string | null;
391
+ setShapeOutlineWidth: number;
392
+ alignFloatingObject: "left" | "center" | "right";
393
+ reorderFloatingObject: "front" | "back";
394
+ nudgeFloatingObject: {
395
+ dx: number;
396
+ dy: number;
397
+ };
398
+ setFloatingFixedPosition: boolean;
399
+ setFloatingRotation: number;
400
+ setFloatingWrapPreset: "inline" | "square" | "tight" | "through" | "topAndBottom" | "behind" | "front";
401
+ setFloatingWrapText: "bothSides" | "left" | "right" | "largest";
402
+ setFloatingPositionPreset: "topLeft" | "topCenter" | "topRight" | "middleLeft" | "middleCenter" | "middleRight" | "bottomLeft" | "bottomCenter" | "bottomRight";
403
+ setShapePreset: string;
404
+ setTextBoxTextDirection: "horz" | "vert" | "vert270" | "wordArtVert";
405
+ setTextBoxVerticalAlign: "t" | "ctr" | "b";
406
+ editTextBoxAlt: string | null;
407
+ rotateTextBox: "left" | "right";
408
+ textBoxWidthCm: number | string | null;
409
+ textBoxHeightCm: number | string | null;
227
410
  openSymbolDialog: undefined;
228
411
  openEquationDialog: undefined;
412
+ tableProperties: {
413
+ activeTab?: "table" | "cell";
414
+ };
229
415
  }
230
416
  /** Maps commands to their typed return values. Commands not listed return `unknown`. */
231
417
  export interface OasisCommandResults {
@@ -0,0 +1,43 @@
1
+ import { EditorParagraphNode, EditorPosition, EditorState } from '../model.js';
2
+ /**
3
+ * Expand the selection to whole paragraphs: the anchor moves to the start of
4
+ * the first selected paragraph and the focus to the end of the last one. A
5
+ * collapsed caret selects its whole paragraph.
6
+ */
7
+ export declare function selectParagraph(state: EditorState): EditorState;
8
+ /**
9
+ * Expand the selection to the word around the focus position (Unicode
10
+ * letters/digits). A word is a maximal run of word characters; surrounding
11
+ * punctuation is treated as boundary.
12
+ */
13
+ export declare function selectWord(state: EditorState): EditorState;
14
+ /**
15
+ * Expand the selection to the sentence around the focus position, within the
16
+ * current paragraph. The sentence runs from just after the previous `.`/`!`/`?`
17
+ * (or paragraph start) up to and including the next terminator (or paragraph
18
+ * end). Sentence/word boundaries reset at paragraph breaks, matching the case
19
+ * transform in `textCase.ts`.
20
+ */
21
+ export declare function selectSentence(state: EditorState): EditorState;
22
+ /**
23
+ * Collapse the selection to one of its ends (`select.collapse`). When `end`
24
+ * is true the caret moves to the focus end; otherwise to the anchor end. The
25
+ * resulting selection is a single collapsed caret (no document mutation, so
26
+ * it's applied via `applyState` with no undo).
27
+ */
28
+ export declare function selectCollapse(state: EditorState, end?: boolean): EditorState;
29
+ /**
30
+ * Select the Nth occurrence of `text` in the document (`WordCraft select.text`:
31
+ * Word's "Select Text" navigation). Literal, case-insensitive matching; the
32
+ * `occurrence` count is 1-based (default 1). A no-op (same state) when the
33
+ * term is empty or the occurrence isn't found. Selection-only — never mutates
34
+ * the document, so it's applied via `applyState` with no undo.
35
+ */
36
+ export declare function selectTextOccurrence(state: EditorState, text: string, occurrence?: number): EditorState;
37
+ /**
38
+ * Select an arbitrary range (`select.range`): sets the selection to the given
39
+ * anchor/focus positions, clamped to valid offsets. Selection-only — never
40
+ * mutates the document, so it's applied via `applyState` with no undo.
41
+ */
42
+ export declare function selectRange(state: EditorState, anchor: EditorPosition, focus: EditorPosition): EditorState;
43
+ export type { EditorParagraphNode };
@@ -1,4 +1,8 @@
1
1
  import { EditorState } from '../model.js';
2
+ export * from './shapeFillCommands.js';
3
+ export * from './floatingAlignCommands.js';
4
+ export * from './floatingReorderCommands.js';
5
+ export * from './textBoxBodyCommands.js';
2
6
  /**
3
7
  * Inserts a basic shape (`wps:wsp` with preset geometry) at the current
4
8
  * selection. Modeled as an inline run carrying an {@link EditorTextBoxData}
@@ -0,0 +1,31 @@
1
+ import { EditorState, EditorTextBoxShape } from '../model.js';
2
+ /**
3
+ * True when a shape (text box) is selected and can be re-filled / re-outlined.
4
+ */
5
+ export declare function canStyleSelectedShape(state: EditorState): boolean;
6
+ /** The current appearance of the selected shape, or `null` when none. */
7
+ export declare function getSelectedShapeAppearance(state: EditorState): EditorTextBoxShape | null;
8
+ /**
9
+ * Word's "Shape Fill" / "Shape Outline": patches the selected shape's solid
10
+ * fill or outline. `{ fill: null }` clears the fill (transparent); `{ fill:
11
+ * "#RRGGBB" }` applies a solid color. A no-op when no shape is selected.
12
+ */
13
+ export declare function setSelectedShapeFill(state: EditorState, fill: string | null): EditorState;
14
+ /**
15
+ * Word's "Shape Outline": patches the selected shape's outline color.
16
+ * `{ borderColor: null }` removes the outline. A no-op when no shape is
17
+ * selected.
18
+ */
19
+ export declare function setSelectedShapeOutline(state: EditorState, borderColor: string | null): EditorState;
20
+ /**
21
+ * Word's "Shape Outline › Weight" (WordCraft `shape.outline` width): sets the
22
+ * selected shape's outline width in points (`borderWidthPt`, encoded in the
23
+ * model as EMU-derived points). A no-op when no shape is selected.
24
+ */
25
+ export declare function setSelectedShapeOutlineWidth(state: EditorState, widthPt: number): EditorState;
26
+ /**
27
+ * Word's "Change Shape" (WordCraft `shape.change`): swaps the selected shape's
28
+ * DrawingML preset geometry (e.g. "rect" → "ellipse"). A no-op when no shape
29
+ * is selected.
30
+ */
31
+ export declare function setSelectedShapePreset(state: EditorState, preset: string): EditorState;
@@ -0,0 +1,18 @@
1
+ import { EditorState } from '../model.js';
2
+ /** The Unicode characters the special-character commands insert. */
3
+ export declare const SPECIAL_CHARACTERS: {
4
+ readonly nbsp: " ";
5
+ readonly nbHyphen: "‑";
6
+ readonly optionalHyphen: "­";
7
+ readonly emDash: "—";
8
+ readonly ellipsis: "…";
9
+ readonly copyright: "©";
10
+ readonly registered: "®";
11
+ readonly trademark: "™";
12
+ };
13
+ export type SpecialCharacterKind = keyof typeof SPECIAL_CHARACTERS;
14
+ /**
15
+ * Insert a single special character at the selection. A no-op (same state)
16
+ * when the character is empty.
17
+ */
18
+ export declare function insertSpecialCharacter(state: EditorState, kind: SpecialCharacterKind): EditorState;
@@ -0,0 +1,10 @@
1
+ import { EditorState } from '../../model.js';
2
+ /** The valid `w:jc` table alignment values. */
3
+ export type TableAlignment = "left" | "center" | "right";
4
+ /** True when the caret sits inside a table whose alignment can be set. */
5
+ export declare function canSetActiveTableAlignment(state: EditorState): boolean;
6
+ /**
7
+ * Set the active table's alignment (`w:jc`) to `left`, `center` or `right`, or
8
+ * clear it with `null`. Returns the same state when the value is unchanged.
9
+ */
10
+ export declare function setActiveTableAlignment(state: EditorState, alignment: TableAlignment | null): EditorState;
@@ -0,0 +1,16 @@
1
+ import { EditorState } from '../../model.js';
2
+ /** The sizing modes WordCraft's "AutoFit" command accepts. */
3
+ export type TableAutoFitMode = "contents" | "window" | "fixed";
4
+ /**
5
+ * True when the caret sits inside a table that can be auto-fit.
6
+ */
7
+ export declare function canSetActiveTableAutoFit(state: EditorState): boolean;
8
+ /**
9
+ * Word's "AutoFit" command, matching WordCraft's `table.autofit` mode payload:
10
+ * - `contents`: size the table to fit its contents (`autofit` layout).
11
+ * - `window`: size the table to span the page (`autofit` layout, 100% width).
12
+ * - `fixed`: keep the current column widths (`fixed` layout).
13
+ *
14
+ * A no-op when the caret is outside a table.
15
+ */
16
+ export declare function setActiveTableAutoFit(state: EditorState, mode: TableAutoFitMode): EditorState;
@@ -0,0 +1,7 @@
1
+ import { EditorState } from '../../model.js';
2
+ /**
3
+ * Set the fit-text flag (`fitText`) of every selected cell. Pass
4
+ * `true`/`false` to store the state explicitly, or `null` to clear the key
5
+ * (default off). Returns the same state when the caret is outside a table.
6
+ */
7
+ export declare function setTableCellFitText(state: EditorState, value: boolean | null): EditorState;
@@ -0,0 +1,20 @@
1
+ import { EditorState } from '../../model.js';
2
+ /**
3
+ * Cell margins in points, applied as per-direction cell padding
4
+ * (`w:tcPr/w:tcMar/w:top|w:right|w:bottom|w:left`). Omitted directions are left
5
+ * untouched so callers can adjust a single edge without disturbing the others.
6
+ */
7
+ export interface TableCellMargins {
8
+ top?: number;
9
+ right?: number;
10
+ bottom?: number;
11
+ left?: number;
12
+ }
13
+ /** True when the caret sits inside a table whose cells can be re-margined. */
14
+ export declare function canSetTableCellMargins(state: EditorState): boolean;
15
+ /**
16
+ * Word's cell margins: set the padding of every resolved table cell. Only the
17
+ * provided edges are changed; any direction left `undefined` keeps its current
18
+ * value. A single transactional merge key keeps the whole change one undo step.
19
+ */
20
+ export declare function setActiveTableCellMargins(state: EditorState, margins: TableCellMargins): EditorState;
@@ -0,0 +1,7 @@
1
+ import { EditorState } from '../../model.js';
2
+ /**
3
+ * Set the no-wrap flag (`noWrap`) of every selected cell. Pass `true`/`false`
4
+ * to store the state explicitly, or `null` to clear the key (default off).
5
+ * Returns the same state when the caret is outside a table.
6
+ */
7
+ export declare function setTableCellNoWrap(state: EditorState, value: boolean | null): EditorState;
@@ -0,0 +1,9 @@
1
+ import { EditorState } from '../../model.js';
2
+ /** True when the caret sits inside a table whose cell spacing can be set. */
3
+ export declare function canSetActiveTableCellSpacing(state: EditorState): boolean;
4
+ /**
5
+ * Set the active table's cell spacing (`w:tblCellSpacing`) in points, or clear
6
+ * it with `null` (Word's default). Returns the same state when the value is
7
+ * unchanged.
8
+ */
9
+ export declare function setActiveTableCellSpacing(state: EditorState, value: number | null): EditorState;
@@ -1,4 +1,14 @@
1
1
  import { EditorState } from '../../model.js';
2
+ /** True when the caret sits in a table column whose width can change. */
3
+ export declare function canSetActiveTableColumnWidth(state: EditorState): boolean;
4
+ /**
5
+ * Word's table column width (Table Layout › Cell Size › Width). Resolves the
6
+ * innermost table under the caret, finds the visual column of the active cell,
7
+ * and applies the requested width through `setTableColumnWidths` (which writes
8
+ * the grid override and any single-spanning cell widths in one undoable step).
9
+ * A no-op when the caret is not inside a table column.
10
+ */
11
+ export declare function setActiveTableColumnWidth(state: EditorState, width: number | string | null): EditorState;
2
12
  export declare function setTableColumnWidths(state: EditorState, tableId: string, columnWidths: Record<number, number | string>, tableWidth?: number | string, tableIndentLeft?: number | string): EditorState;
3
13
  /**
4
14
  * Equalize the widths of every visual column in the active table (Word's
@@ -0,0 +1,16 @@
1
+ import { EditorState } from '../../model.js';
2
+ /**
3
+ * True when the caret sits inside a table, on a row that has more than one cell
4
+ * (so Word's "Delete Cells" would leave the row with at least one cell after
5
+ * removing the active one).
6
+ */
7
+ export declare function canDeleteActiveTableCell(state: EditorState): boolean;
8
+ /**
9
+ * Word's "Delete Cells": removes the active (innermost) cell from its row,
10
+ * shifting the cells to its right one cell left. A no-op when the caret is
11
+ * outside a table or the row has only one cell (Word leaves a single-celled row
12
+ * intact). The caret lands in the cell that now occupies the removed cell's
13
+ * position, or in the cell immediately to its left when the removed cell was
14
+ * the row's last one.
15
+ */
16
+ export declare function deleteActiveTableCell(state: EditorState): EditorState;
@@ -0,0 +1,11 @@
1
+ import { EditorState } from '../../model.js';
2
+ /** True when the caret sits inside a table that can be deleted. */
3
+ export declare function canDeleteActiveTable(state: EditorState): boolean;
4
+ /**
5
+ * Word's "Delete Table": removes the active (innermost) table, splicing the
6
+ * adjacent story back together. The caret lands in the paragraph that followed
7
+ * the table (or preceded it when the table was last). When the table was the
8
+ * only block in its story, it is replaced by a single empty paragraph. A no-op
9
+ * when the caret is outside a table.
10
+ */
11
+ export declare function deleteActiveTable(state: EditorState): EditorState;
@@ -0,0 +1,34 @@
1
+ import { EditorState } from '../../model.js';
2
+ /** Which cells a formula's range gathers its operands from. */
3
+ export type TableFormulaDirection = "ABOVE" | "BELOW" | "LEFT" | "RIGHT";
4
+ /** The functions this formula evaluator supports (Word's table formula set). */
5
+ export type TableFormulaFunction = "SUM" | "AVERAGE" | "COUNT" | "MIN" | "MAX";
6
+ /** The explicit, supported function scope. Anything else parses to null. */
7
+ export declare const SUPPORTED_TABLE_FORMULA_FUNCTIONS: readonly TableFormulaFunction[];
8
+ /** A parsed `=FUNCTION(DIRECTION)` formula. */
9
+ export interface ParsedTableFormula {
10
+ function: TableFormulaFunction;
11
+ direction: TableFormulaDirection;
12
+ }
13
+ /** True when the caret sits inside a table whose cells can be formula-targeted. */
14
+ export declare function canEvaluateActiveTableFormula(state: EditorState): boolean;
15
+ /**
16
+ * Parses a Word-style table formula such as `=SUM(ABOVE)`. Returns null when the
17
+ * text is not a formula with a supported function and direction.
18
+ */
19
+ export declare function parseTableFormula(raw: string): ParsedTableFormula | null;
20
+ /**
21
+ * Word's table "Formula": evaluate a `=FUNCTION(DIRECTION)` formula over the
22
+ * numeric values in the cells adjacent to the active cell (per `direction`),
23
+ * and write the result into the active cell. A no-op when the caret is outside
24
+ * a table or the formula/range has no numeric operands.
25
+ */
26
+ export declare function evaluateActiveTableFormula(state: EditorState, raw: string): EditorState;
27
+ /**
28
+ * Applies a supported table formula over `values` -> `number` result. SUM,
29
+ * AVERAGE, MIN, MAX require at least one value; COUNT always succeeds (0 for an
30
+ * empty set).
31
+ */
32
+ export declare function applyFormula(fn: TableFormulaFunction, values: readonly number[]): number;
33
+ /** Renders a formula result as text, trimming trailing fractional zeros. */
34
+ export declare function formatFormulaResult(result: number): string;
@@ -0,0 +1,9 @@
1
+ import { EditorState } from '../../model.js';
2
+ /** True when the caret sits inside a table whose indent can be set. */
3
+ export declare function canSetActiveTableIndent(state: EditorState): boolean;
4
+ /**
5
+ * Set the active table's indent from left (`w:tblInd`) in points, or clear it
6
+ * with `null` (Word's default). Returns the same state when the value is
7
+ * unchanged.
8
+ */
9
+ export declare function setActiveTableIndent(state: EditorState, value: number | null): EditorState;