oasis-editor 0.0.227 → 0.0.228
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-CpKYMW3z.js +1 -0
- package/dist/app/controllers/EditorCommandsController.d.ts +6 -1
- package/dist/app/services/FindReplaceService.d.ts +6 -18
- package/dist/assets/{importDocxWorker-D9et8X0W.js → importDocxWorker-dPLECw5a.js} +197 -181
- package/dist/core/commands/builtinCommands.d.ts +1 -1
- package/dist/core/commands/dropCap.d.ts +23 -0
- package/dist/core/commands/fieldDate.d.ts +6 -0
- package/dist/core/commands/findReplace.d.ts +25 -0
- package/dist/core/commands/floatingAlignCommands.d.ts +98 -0
- package/dist/core/commands/floatingReorderCommands.d.ts +17 -0
- package/dist/core/commands/headerFooter.d.ts +17 -0
- package/dist/core/commands/horizontalLine.d.ts +3 -0
- package/dist/core/commands/hyphenation.d.ts +27 -0
- package/dist/core/commands/image.d.ts +45 -0
- package/dist/core/commands/noteOptions.d.ts +22 -0
- package/dist/core/commands/outlineStep.d.ts +13 -0
- package/dist/core/commands/pageSetup.d.ts +41 -1
- package/dist/core/commands/paragraphAdjustRightInd.d.ts +8 -0
- package/dist/core/commands/paragraphAlign.d.ts +10 -0
- package/dist/core/commands/paragraphAutoSpaceDE.d.ts +8 -0
- package/dist/core/commands/paragraphAutoSpaceDN.d.ts +8 -0
- package/dist/core/commands/paragraphBidi.d.ts +7 -0
- package/dist/core/commands/paragraphContextualSpacing.d.ts +7 -0
- package/dist/core/commands/paragraphKeepLinesTogether.d.ts +7 -0
- package/dist/core/commands/paragraphKeepWithNext.d.ts +7 -0
- package/dist/core/commands/paragraphKinsoku.d.ts +8 -0
- package/dist/core/commands/paragraphLineRule.d.ts +10 -0
- package/dist/core/commands/paragraphListLevel.d.ts +8 -0
- package/dist/core/commands/paragraphMirrorIndents.d.ts +7 -0
- package/dist/core/commands/paragraphMove.d.ts +8 -0
- package/dist/core/commands/paragraphOutlineLevel.d.ts +11 -0
- package/dist/core/commands/paragraphOverflowPunct.d.ts +8 -0
- package/dist/core/commands/paragraphPageBreakBefore.d.ts +7 -0
- package/dist/core/commands/paragraphReset.d.ts +9 -0
- package/dist/core/commands/paragraphSort.d.ts +7 -0
- package/dist/core/commands/paragraphSuppressAutoHyphens.d.ts +7 -0
- package/dist/core/commands/paragraphSuppressLineNumbers.d.ts +7 -0
- package/dist/core/commands/paragraphTabs.d.ts +28 -0
- package/dist/core/commands/paragraphTextDirection.d.ts +9 -0
- package/dist/core/commands/paragraphTopLinePunct.d.ts +7 -0
- package/dist/core/commands/paragraphWidowControl.d.ts +8 -0
- package/dist/core/commands/paragraphWordWrap.d.ts +8 -0
- package/dist/core/commands/publicCommandTypes.d.ts +189 -3
- package/dist/core/commands/selectUnit.d.ts +43 -0
- package/dist/core/commands/shape.d.ts +4 -0
- package/dist/core/commands/shapeFillCommands.d.ts +31 -0
- package/dist/core/commands/specialChar.d.ts +18 -0
- package/dist/core/commands/table/tableAlignmentCommands.d.ts +10 -0
- package/dist/core/commands/table/tableAutoFitCommands.d.ts +16 -0
- package/dist/core/commands/table/tableCellFitTextCommands.d.ts +7 -0
- package/dist/core/commands/table/tableCellMarginsCommands.d.ts +20 -0
- package/dist/core/commands/table/tableCellNoWrapCommands.d.ts +7 -0
- package/dist/core/commands/table/tableCellSpacingCommands.d.ts +9 -0
- package/dist/core/commands/table/tableColumnCommands.d.ts +10 -0
- package/dist/core/commands/table/tableDeleteCellsCommands.d.ts +16 -0
- package/dist/core/commands/table/tableDeleteCommands.d.ts +11 -0
- package/dist/core/commands/table/tableFormulaCommands.d.ts +34 -0
- package/dist/core/commands/table/tableIndentCommands.d.ts +9 -0
- package/dist/core/commands/table/tableRepeatHeaderCommands.d.ts +15 -0
- package/dist/core/commands/table/tableRowBreakAcrossPagesCommands.d.ts +9 -0
- package/dist/core/commands/table/tableRowCommands.d.ts +2 -0
- package/dist/core/commands/table/tableRowHeightCommands.d.ts +21 -0
- package/dist/core/commands/table/tableSelectionCommands.d.ts +18 -0
- package/dist/core/commands/table/tableSortCommands.d.ts +16 -0
- package/dist/core/commands/table/tableStyleCommands.d.ts +9 -0
- package/dist/core/commands/table.d.ts +15 -0
- package/dist/core/commands/text.d.ts +1 -1
- package/dist/core/commands/textBoxBodyCommands.d.ts +43 -0
- package/dist/core/commands/textFormatting.d.ts +15 -0
- package/dist/core/commands/zoneBlocks.d.ts +10 -0
- package/dist/core/engine.d.ts +3 -0
- package/dist/core/model/types/primitives.d.ts +10 -0
- package/dist/core/textStyle/textStyleKeys.d.ts +3 -3
- package/dist/core/transactionMergeKeys.d.ts +34 -0
- package/dist/defaultToolbar-Em7_omZA.js +1 -0
- package/dist/export/docx/docxTypes.d.ts +1 -0
- package/dist/i18n/locales/en.d.ts +16 -0
- package/dist/i18n/locales/pt-BR.d.ts +16 -0
- package/dist/layoutProjection/floatingObjects.d.ts +3 -0
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +1 -1
- package/dist/plugins/internal/essentialsCapabilities.d.ts +310 -2
- package/dist/plugins/internal/essentialsCommandBuilders.d.ts +2 -0
- package/dist/plugins/internal/essentialsCommandGroups/table.d.ts +3 -2
- package/dist/ui/app/createAppCommandsController.d.ts +12 -2
- package/dist/ui/app/createEditorCommandRuntime.d.ts +11 -1
- package/dist/ui/app/essentials/types.d.ts +2 -0
- package/dist/ui/components/Toolbar/marginPresets.d.ts +5 -9
- package/dist/ui/toolbarStyleState.d.ts +22 -3
- package/package.json +1 -1
- package/dist/OasisEditorApp-DyqrRigM.js +0 -1
- package/dist/defaultToolbar-Dq0iVC5E.js +0 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { EditorColumnsSettings, EditorDocumentDesign, EditorImageBorder, EditorPageBorder, EditorPageMargins, EditorPageNumbering, EditorWatermark, EditorMathExpression } from '../../core/model.js';
|
|
1
|
+
import { EditorColumnsSettings, EditorDocumentDesign, EditorImageBorder, EditorPageBorder, EditorPageMargins, EditorPageNumbering, EditorPosition, EditorSectionBreakType, EditorWatermark, EditorMathExpression, EditorTabStop } from '../../core/model.js';
|
|
2
2
|
import { SectionPageNumberFormat } from '../../core/commands/pageNumber.js';
|
|
3
3
|
import { CrossReferenceType } from '../../core/commands/crossReference.js';
|
|
4
4
|
import { DesignThemeId } from '../../core/commands/design.js';
|
|
5
5
|
import { ImageBorderPatch } from '../../core/commands/image.js';
|
|
6
6
|
import { TextCaseMode } from '../../core/commands/text.js';
|
|
7
|
+
import { SpecialCharacterKind } from '../../core/commands/specialChar.js';
|
|
8
|
+
import { ReplaceAllPayload } from '../../core/commands/publicCommandTypes.js';
|
|
7
9
|
import { ToolbarStyleState } from '../../ui/toolbarStyleState.js';
|
|
8
10
|
import { OasisBuiltinCommand } from '../../core/commands/builtinCommands.js';
|
|
9
|
-
import { TableBorderPreset } from '../../core/commands/table.js';
|
|
11
|
+
import { TableBorderPreset, TableCellMargins, TableRowHeight } from '../../core/commands/table.js';
|
|
10
12
|
export interface EssentialsFeatureGate {
|
|
11
13
|
isCommandEnabled: (commandName: OasisBuiltinCommand) => boolean;
|
|
12
14
|
}
|
|
@@ -24,7 +26,29 @@ export interface EssentialsHistoryCapability {
|
|
|
24
26
|
}
|
|
25
27
|
export interface EssentialsFormattingCapability {
|
|
26
28
|
selectAll: () => boolean;
|
|
29
|
+
selectWord: () => boolean;
|
|
30
|
+
selectSentence: () => boolean;
|
|
31
|
+
selectParagraph: () => boolean;
|
|
32
|
+
/** Collapse the selection to its start (or end when `end` is true). */
|
|
33
|
+
selectCollapse: (end?: boolean) => boolean;
|
|
34
|
+
/** Select the Nth occurrence of a search string (literal, case-insensitive). */
|
|
35
|
+
selectText: (text: string, occurrence?: number) => boolean;
|
|
36
|
+
/** Select an arbitrary range by anchor/focus positions (select.range). */
|
|
37
|
+
selectRange: (anchor: EditorPosition, focus: EditorPosition) => boolean;
|
|
27
38
|
insertFootnote: () => boolean;
|
|
39
|
+
/** Set document-wide footnote/endnote options (references.noteOptions). */
|
|
40
|
+
setNoteOptions: (options: {
|
|
41
|
+
kind: "footnote" | "endnote";
|
|
42
|
+
numberFormat?: string | null;
|
|
43
|
+
startAt?: number | null;
|
|
44
|
+
restart?: string | null;
|
|
45
|
+
}) => void;
|
|
46
|
+
/** Read the footnote or endnote options in effect. */
|
|
47
|
+
getNoteOptions: (kind: "footnote" | "endnote") => {
|
|
48
|
+
numberFormat?: string;
|
|
49
|
+
startAt?: number;
|
|
50
|
+
restart?: string;
|
|
51
|
+
};
|
|
28
52
|
insertTableOfContents: () => boolean;
|
|
29
53
|
updateTableOfContents: () => boolean;
|
|
30
54
|
/** True only when the active section contains an updateable TOC field. */
|
|
@@ -66,7 +90,22 @@ export interface EssentialsFormattingCapability {
|
|
|
66
90
|
bold: () => boolean;
|
|
67
91
|
italic: () => boolean;
|
|
68
92
|
underline: () => boolean;
|
|
93
|
+
doubleUnderline: () => boolean;
|
|
94
|
+
wordUnderline: () => boolean;
|
|
69
95
|
strike: () => boolean;
|
|
96
|
+
doubleStrike: () => boolean;
|
|
97
|
+
smallCaps: () => boolean;
|
|
98
|
+
allCaps: () => boolean;
|
|
99
|
+
hidden: () => boolean;
|
|
100
|
+
noProof: () => boolean;
|
|
101
|
+
webHidden: () => boolean;
|
|
102
|
+
specVanish: () => boolean;
|
|
103
|
+
contextualAlternates: () => boolean;
|
|
104
|
+
toggleCharacterBorder: () => boolean;
|
|
105
|
+
shadow: () => boolean;
|
|
106
|
+
emboss: () => boolean;
|
|
107
|
+
engrave: () => boolean;
|
|
108
|
+
outline: () => boolean;
|
|
70
109
|
superscript: () => boolean;
|
|
71
110
|
subscript: () => boolean;
|
|
72
111
|
alignLeft: () => boolean;
|
|
@@ -77,6 +116,7 @@ export interface EssentialsFormattingCapability {
|
|
|
77
116
|
bulletList: () => boolean;
|
|
78
117
|
find: () => boolean;
|
|
79
118
|
replace: () => boolean;
|
|
119
|
+
replaceAll: (payload: ReplaceAllPayload) => boolean;
|
|
80
120
|
toggleTrackChanges: () => boolean;
|
|
81
121
|
/** Reactive document view/state flags for Ribbon toggle feedback. */
|
|
82
122
|
isTrackChangesEnabled: () => boolean;
|
|
@@ -93,10 +133,16 @@ export interface EssentialsFormattingCapability {
|
|
|
93
133
|
lineBreak: () => boolean;
|
|
94
134
|
columnBreak: () => boolean;
|
|
95
135
|
splitBlock: () => boolean;
|
|
136
|
+
/** Insert a single special character (WordCraft `text.*` symbols). */
|
|
137
|
+
insertSpecialChar: (kind: SpecialCharacterKind) => boolean;
|
|
96
138
|
setFontFamily: (value: string | null) => boolean;
|
|
97
139
|
setFontSize: (value: number | null) => boolean;
|
|
98
140
|
increaseFontSize: () => boolean;
|
|
99
141
|
decreaseFontSize: () => boolean;
|
|
142
|
+
/** Nudge the selection font size up by exactly 1 point (format.growFont1). */
|
|
143
|
+
growFont1: () => boolean;
|
|
144
|
+
/** Nudge the selection font size down by exactly 1 point (format.shrinkFont1). */
|
|
145
|
+
shrinkFont1: () => boolean;
|
|
100
146
|
changeTextCase: (mode: TextCaseMode) => boolean;
|
|
101
147
|
clearFormatting: () => boolean;
|
|
102
148
|
setColor: (value: string | null) => boolean;
|
|
@@ -105,6 +151,27 @@ export interface EssentialsFormattingCapability {
|
|
|
105
151
|
setStyleId: (value: string) => boolean;
|
|
106
152
|
setCharacterStyleId: (value: string) => boolean;
|
|
107
153
|
setUnderlineStyle: (value: string | null) => void;
|
|
154
|
+
setUnderlineColor: (value: string | null) => boolean;
|
|
155
|
+
setCharacterScale: (value: number | null) => boolean;
|
|
156
|
+
setCharacterSpacing: (value: number | null) => boolean;
|
|
157
|
+
setBaselineShift: (value: number | null) => boolean;
|
|
158
|
+
setEmphasisMark: (value: string | null) => boolean;
|
|
159
|
+
/** Set the selected runs' text effect (w:effect/@w:val). */
|
|
160
|
+
setTextEffect: (value: string | null) => boolean;
|
|
161
|
+
/** Set kerning threshold in pt (character-level, w:kern). */
|
|
162
|
+
setKerning: (value: number | null) => boolean;
|
|
163
|
+
/** Set the selected runs' snap-to-grid flag (w:snapToGrid, defaults on). */
|
|
164
|
+
setRunSnapToGrid: (value: boolean | null) => boolean;
|
|
165
|
+
/** Set the selected runs' fit-text target width in pt (w:fitText). */
|
|
166
|
+
setFitText: (value: number | null) => boolean;
|
|
167
|
+
/** Set ligature style (character-level, w14:ligatures). */
|
|
168
|
+
setLigatures: (value: string | null) => boolean;
|
|
169
|
+
/** Set number spacing (default/proportional/tabular). */
|
|
170
|
+
setNumberSpacing: (value: string | null) => boolean;
|
|
171
|
+
/** Set number form (default/lining/oldStyle). */
|
|
172
|
+
setNumberForm: (value: string | null) => boolean;
|
|
173
|
+
/** Set stylistic set (1-20; character-level, w14:stylisticSets). */
|
|
174
|
+
setStylisticSet: (value: number | null) => boolean;
|
|
108
175
|
}
|
|
109
176
|
export interface EssentialsDocumentStyleDescriptor {
|
|
110
177
|
id: string;
|
|
@@ -140,6 +207,53 @@ export interface EssentialsDocumentCapability {
|
|
|
140
207
|
insertShape: (preset: string) => void;
|
|
141
208
|
openSymbolDialog: () => void;
|
|
142
209
|
openEquationDialog: () => void;
|
|
210
|
+
/** True when the active selection sits inside a table. */
|
|
211
|
+
hasActiveTable: () => boolean;
|
|
212
|
+
/** Opens the Table Properties dialog for the active table/cell. */
|
|
213
|
+
openTableProperties: (activeTab?: "table" | "cell") => void;
|
|
214
|
+
/** Set the selected shape's solid fill (`null` clears/transparent). */
|
|
215
|
+
setShapeFill: (fill: string | null) => void;
|
|
216
|
+
/** Set the selected shape's outline color (`null` removes it). */
|
|
217
|
+
setShapeOutline: (color: string | null) => void;
|
|
218
|
+
/** Set the selected shape's outline width in points. */
|
|
219
|
+
setShapeOutlineWidth: (widthPt: number) => void;
|
|
220
|
+
/** Align the selected floating object (image/text box) to the margin. */
|
|
221
|
+
alignFloatingObject: (align: "left" | "center" | "right") => void;
|
|
222
|
+
/** Bring the selected floating object to the front or behind the text. */
|
|
223
|
+
reorderFloatingObject: (move: "front" | "back") => void;
|
|
224
|
+
/** Nudge the selected floating object by a pixel delta. */
|
|
225
|
+
nudgeFloatingObject: (dx: number, dy: number) => void;
|
|
226
|
+
/** Set whether the selected floating object moves with text / is pinned to page. */
|
|
227
|
+
setFloatingFixedPosition: (fixed: boolean) => void;
|
|
228
|
+
/** Set the exact rotation (degrees, clockwise) of the selected floating object. */
|
|
229
|
+
setFloatingRotation: (degrees: number) => void;
|
|
230
|
+
/** Set the text-wrap preset of the selected floating object. */
|
|
231
|
+
setFloatingWrapPreset: (preset: "inline" | "square" | "tight" | "through" | "topAndBottom" | "behind" | "front") => void;
|
|
232
|
+
/** Set which side(s) of the selected Square/Tight/Through object text flows on. */
|
|
233
|
+
setFloatingWrapText: (side: "bothSides" | "left" | "right" | "largest") => void;
|
|
234
|
+
/** Move the selected floating object to a preset page position. */
|
|
235
|
+
setFloatingPositionPreset: (preset: "topLeft" | "topCenter" | "topRight" | "middleLeft" | "middleCenter" | "middleRight" | "bottomLeft" | "bottomCenter" | "bottomRight") => void;
|
|
236
|
+
/** Change the selected shape's DrawingML preset geometry. */
|
|
237
|
+
setShapePreset: (preset: string) => void;
|
|
238
|
+
/** Set the selected text box's text-direction flow. */
|
|
239
|
+
setTextBoxTextDirection: (dir: "horz" | "vert" | "vert270" | "wordArtVert") => void;
|
|
240
|
+
/** Set the selected text box's vertical text alignment. */
|
|
241
|
+
setTextBoxVerticalAlign: (anchor: "t" | "ctr" | "b") => void;
|
|
242
|
+
/** Set the selected text box's accessibility alt text. */
|
|
243
|
+
setTextBoxAlt: (alt: string | null) => void;
|
|
244
|
+
/** Rotate the selected text box left or right by a fixed step. */
|
|
245
|
+
rotateTextBox: (direction: "left" | "right") => void;
|
|
246
|
+
/** True when a text box is selected and can be resized. */
|
|
247
|
+
isTextBoxSelected: () => boolean;
|
|
248
|
+
/** The selected text box's displayed size in cm, or `null`. */
|
|
249
|
+
getTextBoxSizeCm: () => {
|
|
250
|
+
width: number;
|
|
251
|
+
height: number;
|
|
252
|
+
} | null;
|
|
253
|
+
/** Set the selected text box width (cm), keeping its height. */
|
|
254
|
+
setTextBoxWidthCm: (cm: number) => void;
|
|
255
|
+
/** Set the selected text box height (cm), keeping its width. */
|
|
256
|
+
setTextBoxHeightCm: (cm: number) => void;
|
|
143
257
|
}
|
|
144
258
|
export interface EssentialsLinkCapability {
|
|
145
259
|
prompt: () => void;
|
|
@@ -179,6 +293,18 @@ export interface EssentialsImageCapability {
|
|
|
179
293
|
getBorder: () => EditorImageBorder | null;
|
|
180
294
|
/** Merge a partial outline edit; `{ color: null }` removes the outline. */
|
|
181
295
|
setBorder: (patch: ImageBorderPatch) => void;
|
|
296
|
+
/** Flip the selected image about its horizontal or vertical axis. */
|
|
297
|
+
flip: (axis: "horizontal" | "vertical") => void;
|
|
298
|
+
/** Rotate the selected image left or right by a fixed step. */
|
|
299
|
+
rotate: (direction: "left" | "right") => void;
|
|
300
|
+
/** Transparency (0..1) of the selected picture, or `null` when unselected. */
|
|
301
|
+
getTransparency: () => number | null;
|
|
302
|
+
/** Set the selected picture's transparency (0..1); 0 restores full opacity. */
|
|
303
|
+
setTransparency: (transparency: number | null) => void;
|
|
304
|
+
/** Restore the selected picture to its original state (drops adjustments). */
|
|
305
|
+
reset: () => void;
|
|
306
|
+
/** True when a picture is selected and can be reset. */
|
|
307
|
+
canReset: () => boolean;
|
|
182
308
|
}
|
|
183
309
|
export interface EssentialsBrowserCapability {
|
|
184
310
|
cut: () => void;
|
|
@@ -193,8 +319,44 @@ export interface EssentialsBrowserCapability {
|
|
|
193
319
|
export interface EssentialsParagraphCapability {
|
|
194
320
|
togglePageBreakBefore: () => void;
|
|
195
321
|
toggleKeepWithNext: () => void;
|
|
322
|
+
toggleKeepLinesTogether: () => void;
|
|
323
|
+
toggleWidowControl: () => void;
|
|
196
324
|
setSpacingAfter: (value: number | null) => void;
|
|
197
325
|
setSpacingBefore: (value: number | null) => void;
|
|
326
|
+
/** Set the line spacing rule (auto/exact/atLeast, w:lineRule). */
|
|
327
|
+
setLineRule: (rule: "auto" | "exact" | "atLeast" | null) => void;
|
|
328
|
+
/** Set the paragraph text flow (w:textDirection, vertical text). */
|
|
329
|
+
setTextDirection: (direction: string | null) => void;
|
|
330
|
+
/** Set "Don't hyphenate" (w:suppressAutoHyphens). */
|
|
331
|
+
setSuppressAutoHyphens: (value: boolean | null) => void;
|
|
332
|
+
/** Set the paragraph's "Suppress line numbers" (w:suppressLineNumbers). */
|
|
333
|
+
setSuppressLineNumbers: (value: boolean | null) => void;
|
|
334
|
+
/** Set "Use kinsoku rules for East Asian line breaking" (w:kinsoku, default on). */
|
|
335
|
+
setKinsoku: (value: boolean | null) => void;
|
|
336
|
+
/** Set "Allow punctuation to overflow margin" (w:overflowPunct, default on). */
|
|
337
|
+
setOverflowPunct: (value: boolean | null) => void;
|
|
338
|
+
/** Set "Allow Latin text to wrap in the middle of a word" (w:wordWrap, default on). */
|
|
339
|
+
setWordWrap: (value: boolean | null) => void;
|
|
340
|
+
/** Set "Automatically adjust spacing between East Asian and Latin text" (w:autoSpaceDE, default on). */
|
|
341
|
+
setAutoSpaceDE: (value: boolean | null) => void;
|
|
342
|
+
/** Set "Automatically adjust spacing between East Asian text and numbers" (w:autoSpaceDN, default on). */
|
|
343
|
+
setAutoSpaceDN: (value: boolean | null) => void;
|
|
344
|
+
/** Set "Adjust right indent when grid is defined" (w:adjustRightInd, default on). */
|
|
345
|
+
setAdjustRightInd: (value: boolean | null) => void;
|
|
346
|
+
/** Set "Compress punctuation at start of a line" (w:topLinePunct). */
|
|
347
|
+
setTopLinePunct: (value: boolean | null) => void;
|
|
348
|
+
/** Set "Page break before" (w:pageBreakBefore). */
|
|
349
|
+
setPageBreakBefore: (value: boolean | null) => void;
|
|
350
|
+
/** Set "Keep with next" (w:keepNext). */
|
|
351
|
+
setKeepWithNext: (value: boolean | null) => void;
|
|
352
|
+
/** Set "Keep lines together" (w:keepLines). */
|
|
353
|
+
setKeepLinesTogether: (value: boolean | null) => void;
|
|
354
|
+
/** Set "Widow/Orphan control" (w:widowControl, default on). */
|
|
355
|
+
setWidowControl: (value: boolean | null) => void;
|
|
356
|
+
/** Set "Don't add space between paragraphs of the same style" (w:contextualSpacing). */
|
|
357
|
+
setContextualSpacing: (value: boolean | null) => void;
|
|
358
|
+
/** Set "Mirror indents" (w:mirrorIndents): swap left/right indents on facing pages. */
|
|
359
|
+
setMirrorIndents: (value: boolean | null) => void;
|
|
198
360
|
setIndentLeft: (value: number | null) => void;
|
|
199
361
|
setIndentRight: (value: number | null) => void;
|
|
200
362
|
setIndentFirstLine: (value: number | null) => void;
|
|
@@ -202,11 +364,52 @@ export interface EssentialsParagraphCapability {
|
|
|
202
364
|
setSpecialIndent: (kind: "none" | "firstLine" | "hanging", value?: number | null) => void;
|
|
203
365
|
setShading: (value: string | null) => void;
|
|
204
366
|
applyBorders: () => void;
|
|
367
|
+
/** Apply a horizontal line (single 1.5pt bottom border) to the selection. */
|
|
368
|
+
addHorizontalLine: () => void;
|
|
205
369
|
setLineHeight: (value: number | null) => void;
|
|
206
370
|
setListFormat: (format: string) => void;
|
|
207
371
|
setListStartAt: (value: number | null) => void;
|
|
372
|
+
/** Set the selected list paragraphs' explicit list level (0-8, WordCraft para.listLevel). */
|
|
373
|
+
setListLevel: (level: number) => void;
|
|
208
374
|
outdent: () => void;
|
|
209
375
|
indent: () => void;
|
|
376
|
+
/** Outline-step the click (WordCraft para.promote): heading up one level, body→preceding heading, list item one level up. */
|
|
377
|
+
promote: () => void;
|
|
378
|
+
/** Outline-step down (WordCraft para.demote): heading down one level, list item one level down; body text refused. */
|
|
379
|
+
demote: () => void;
|
|
380
|
+
/** Reset paragraph formatting (WordCraft para.reset): clear direct paragraph formatting, keeping the named style, list and drop cap. */
|
|
381
|
+
resetParagraphFormatting: () => void;
|
|
382
|
+
/** Edit the selected paragraphs' tab stops and default interval (WordCraft para.tabs). */
|
|
383
|
+
setTabStops: (change: {
|
|
384
|
+
tabs?: EditorTabStop[] | null;
|
|
385
|
+
set?: EditorTabStop[];
|
|
386
|
+
clear?: number[];
|
|
387
|
+
clearAll?: boolean;
|
|
388
|
+
default?: number | null;
|
|
389
|
+
}) => void;
|
|
390
|
+
/** Set the selected paragraphs' outline level (0-8, w:outlineLvl) or return to body text (null). */
|
|
391
|
+
setOutlineLevel: (level: number | null) => void;
|
|
392
|
+
/** Move the selected paragraphs one step up/down, if possible. */
|
|
393
|
+
moveParagraphsUp: () => void;
|
|
394
|
+
moveParagraphsDown: () => void;
|
|
395
|
+
/** True when the selected paragraph run can move in the given direction. */
|
|
396
|
+
canMoveParagraphsUp: () => boolean;
|
|
397
|
+
canMoveParagraphsDown: () => boolean;
|
|
398
|
+
/** Set the selected paragraphs' flow direction (w:bidi, right-to-left). */
|
|
399
|
+
setBidi: (enabled: boolean | null) => void;
|
|
400
|
+
/** Set the selected paragraphs' General › Alignment (w:jc/@w:val). */
|
|
401
|
+
setParagraphAlign: (value: "left" | "center" | "right" | "justify" | null) => void;
|
|
402
|
+
/** Sort the selected paragraph run (natural order), ascending unless descending. */
|
|
403
|
+
sortParagraphs: (descending?: boolean) => void;
|
|
404
|
+
/** Whether any selected paragraph carries a drop cap (insert.dropCap). */
|
|
405
|
+
hasDropCap: () => boolean;
|
|
406
|
+
/** Set/clear a drop cap on the selected paragraphs (insert.dropCap). */
|
|
407
|
+
setDropCap: (options: {
|
|
408
|
+
text?: string;
|
|
409
|
+
lines?: number;
|
|
410
|
+
type?: "drop" | "margin" | "none";
|
|
411
|
+
font?: string;
|
|
412
|
+
}) => void;
|
|
210
413
|
}
|
|
211
414
|
export interface EssentialsSectionCapability {
|
|
212
415
|
isLandscape: () => boolean;
|
|
@@ -222,6 +425,8 @@ export interface EssentialsSectionCapability {
|
|
|
222
425
|
breakNextColumn: () => void;
|
|
223
426
|
getMargins: () => EditorPageMargins | undefined;
|
|
224
427
|
setPageMargins: (margins: Partial<EditorPageMargins>) => void;
|
|
428
|
+
/** Apply a named page-margin preset (normal/narrow/moderate/wide/mirrored). */
|
|
429
|
+
setMarginsPreset: (presetId: string) => void;
|
|
225
430
|
getPageNumbering: () => EditorPageNumbering | undefined;
|
|
226
431
|
setPageNumbering: (numbering: {
|
|
227
432
|
start?: number;
|
|
@@ -242,6 +447,32 @@ export interface EssentialsSectionCapability {
|
|
|
242
447
|
space?: number;
|
|
243
448
|
separator?: boolean;
|
|
244
449
|
}) => void;
|
|
450
|
+
/** Read the active section's vertical justification (`w:vAlign`). */
|
|
451
|
+
getVerticalAlign: () => "top" | "center" | "both" | "bottom" | undefined;
|
|
452
|
+
/** Set the active section's vertical justification (`w:vAlign`). */
|
|
453
|
+
setVerticalAlign: (align: "top" | "center" | "both" | "bottom") => void;
|
|
454
|
+
/** Read the active section's start type (`w:type`, Page Setup › Section start). */
|
|
455
|
+
getSectionStart: () => EditorSectionBreakType | undefined;
|
|
456
|
+
/** Set the active section's start type (`w:type`, Page Setup › Section start). */
|
|
457
|
+
setSectionStart: (breakType: EditorSectionBreakType) => void;
|
|
458
|
+
/** Read the active section's right-to-left layout flag (`w:bidi`). */
|
|
459
|
+
getBidi: () => boolean | undefined;
|
|
460
|
+
/** Set the active section's right-to-left layout flag (`w:bidi`). */
|
|
461
|
+
setBidi: (enabled: boolean) => void;
|
|
462
|
+
/** Read the document's automatic hyphenation settings (layout.hyphenation). */
|
|
463
|
+
getHyphenation: () => {
|
|
464
|
+
value: boolean;
|
|
465
|
+
zone?: number;
|
|
466
|
+
caps?: boolean;
|
|
467
|
+
limit?: number;
|
|
468
|
+
};
|
|
469
|
+
/** Set the document's automatic hyphenation settings (layout.hyphenation). */
|
|
470
|
+
setHyphenation: (input: {
|
|
471
|
+
value?: boolean;
|
|
472
|
+
zone?: number;
|
|
473
|
+
caps?: boolean;
|
|
474
|
+
limit?: number;
|
|
475
|
+
}) => void;
|
|
245
476
|
}
|
|
246
477
|
export interface EssentialsHeaderFooterCapability {
|
|
247
478
|
/** Enter header editing for the active section's default header. */
|
|
@@ -268,6 +499,14 @@ export interface EssentialsHeaderFooterCapability {
|
|
|
268
499
|
exit: () => void;
|
|
269
500
|
/** Whether the caret currently edits a header or footer zone. */
|
|
270
501
|
isInHeaderFooter: () => boolean;
|
|
502
|
+
/** Whether the active section uses a different first-page header/footer. */
|
|
503
|
+
getDifferentFirstPage: () => boolean;
|
|
504
|
+
/** Set the active section's different-first-page header/footer flag. */
|
|
505
|
+
setDifferentFirstPage: (on: boolean) => void;
|
|
506
|
+
/** Whether the active section uses different odd & even pages. */
|
|
507
|
+
getDifferentOddEven: () => boolean;
|
|
508
|
+
/** Set the active section's different odd & even pages flag. */
|
|
509
|
+
setDifferentOddEven: (on: boolean) => void;
|
|
271
510
|
}
|
|
272
511
|
export interface BookmarkDescriptor {
|
|
273
512
|
id: string;
|
|
@@ -284,6 +523,8 @@ export interface EssentialsBookmarkCapability {
|
|
|
284
523
|
export interface EssentialsFieldsCapability {
|
|
285
524
|
/** Insert a DATE field at the active caret with the current date. */
|
|
286
525
|
insertDate: () => void;
|
|
526
|
+
/** Insert the current date as plain text (WordCraft `insert.dateTime`, update:false). */
|
|
527
|
+
insertDateTime: (dateFormat?: string) => void;
|
|
287
528
|
/**
|
|
288
529
|
* Insert a cross-reference (REF / PAGEREF) to the named bookmark at the
|
|
289
530
|
* caret. A no-op when the target bookmark is unknown.
|
|
@@ -325,6 +566,8 @@ export interface EssentialsTableCapability {
|
|
|
325
566
|
getLayout: () => "fixed" | "autofit" | null;
|
|
326
567
|
/** Toggle the selected table between fixed and autofit sizing. */
|
|
327
568
|
toggleAutoFit: () => void;
|
|
569
|
+
canSetAutoFit: () => boolean;
|
|
570
|
+
setAutoFit: (mode: "contents" | "window" | "fixed") => void;
|
|
328
571
|
/** Equalize the widths of every column in the selected table. */
|
|
329
572
|
distributeColumns: () => void;
|
|
330
573
|
/** Equalize the heights of every row in the selected table. */
|
|
@@ -345,6 +588,20 @@ export interface EssentialsTableCapability {
|
|
|
345
588
|
canSplitTableAtRow: () => boolean;
|
|
346
589
|
/** Word's Split Table: split the active table into two at the caret row. */
|
|
347
590
|
splitTableAtRow: () => void;
|
|
591
|
+
/** True when the active table's body rows can be reordered. */
|
|
592
|
+
canSortTable: () => boolean;
|
|
593
|
+
/** Word's Sort: reorder the table's body rows by the caret column. */
|
|
594
|
+
sortTable: (direction: "ascending" | "descending") => void;
|
|
595
|
+
/** True when the caret sits inside a table that can be deleted. */
|
|
596
|
+
canDeleteTable: () => boolean;
|
|
597
|
+
/** Word's Delete Table: remove the active table. */
|
|
598
|
+
deleteTable: () => void;
|
|
599
|
+
/** True when the caret sits inside a table whose header row can be repeated. */
|
|
600
|
+
canToggleRepeatHeaderRows: () => boolean;
|
|
601
|
+
/** True when the active table repeats its first row as a header. */
|
|
602
|
+
isRepeatHeaderRowsActive: () => boolean;
|
|
603
|
+
/** Word's Repeat Header Rows: toggle the active table's repeating header row. */
|
|
604
|
+
toggleRepeatHeaderRows: () => void;
|
|
348
605
|
merge: () => void;
|
|
349
606
|
split: () => void;
|
|
350
607
|
insertColumnBefore: () => void;
|
|
@@ -353,6 +610,8 @@ export interface EssentialsTableCapability {
|
|
|
353
610
|
insertRowBefore: () => void;
|
|
354
611
|
insertRowAfter: () => void;
|
|
355
612
|
deleteRow: () => void;
|
|
613
|
+
canDeleteCell: () => boolean;
|
|
614
|
+
deleteCell: () => void;
|
|
356
615
|
cellShading: (color: string | null) => void;
|
|
357
616
|
cellBorders: () => void;
|
|
358
617
|
cellNoBorders: () => void;
|
|
@@ -368,6 +627,55 @@ export interface EssentialsTableCapability {
|
|
|
368
627
|
setCellVerticalAlign: (value: "top" | "middle" | "bottom") => void;
|
|
369
628
|
setCellTextDirection: (value: "lrTb" | "tbRl" | "btLr" | "lrTbV" | "tbRlV") => void;
|
|
370
629
|
setCellWidth: (width: string) => void;
|
|
630
|
+
/** Word's cell "Wrap text": set the no-wrap flag on the selected/active cell. */
|
|
631
|
+
setCellNoWrap: (value: boolean | null) => void;
|
|
632
|
+
/** Word's cell "Fit text": set the fit-text flag on the selected/active cell. */
|
|
633
|
+
setCellFitText: (value: boolean | null) => void;
|
|
634
|
+
/** True when the caret sits inside a table row whose height can be changed. */
|
|
635
|
+
canSetActiveTableRowHeight: () => boolean;
|
|
636
|
+
/** Word's row height (Cell Size): set the height of the active row. */
|
|
637
|
+
setActiveTableRowHeight: (height: TableRowHeight) => void;
|
|
638
|
+
/** True when the caret sits inside a table row whose break setting can change. */
|
|
639
|
+
canSetActiveTableRowBreakAcrossPages: () => boolean;
|
|
640
|
+
/** Word's "Allow row to break across pages": set it on the active row. */
|
|
641
|
+
setActiveTableRowBreakAcrossPages: (allow: boolean | null) => void;
|
|
642
|
+
/** True when the caret sits inside a table row whose header flag can change. */
|
|
643
|
+
canSetActiveTableRowHeader: () => boolean;
|
|
644
|
+
/** Word's "Repeat as header row": set the header flag on the active row. */
|
|
645
|
+
setActiveTableRowHeader: (value: boolean | null) => void;
|
|
646
|
+
/** True when the caret sits inside a table column whose width can change. */
|
|
647
|
+
canSetActiveTableColumnWidth: () => boolean;
|
|
648
|
+
/** Word's column width (Cell Size): set the width of the active column. */
|
|
649
|
+
setActiveTableColumnWidth: (width: number | string | null) => void;
|
|
650
|
+
/** True when the caret sits inside a table whose preferred width can change. */
|
|
651
|
+
canSetActiveTableWidth: () => boolean;
|
|
652
|
+
/** Word's table preferred width (Table Properties): set it on the active table. */
|
|
653
|
+
setActiveTableWidth: (width: number | string | null) => void;
|
|
654
|
+
/** True when the caret sits inside a table whose cells can be re-margined. */
|
|
655
|
+
canSetCellMargins: () => boolean;
|
|
656
|
+
/** Word's Cell Margins: set per-edge padding on the selected cells. */
|
|
657
|
+
setCellMargins: (margins: TableCellMargins) => void;
|
|
658
|
+
/** True when the caret sits inside a table whose cell spacing can be set. */
|
|
659
|
+
canSetCellSpacing: () => boolean;
|
|
660
|
+
/** Word's Cell Spacing: set the gap between adjacent cells on the active table. */
|
|
661
|
+
setCellSpacing: (value: number | null) => void;
|
|
662
|
+
/** True when the caret sits inside a table whose indent can be set. */
|
|
663
|
+
canSetTableIndent: () => boolean;
|
|
664
|
+
/** Word's Indent from Left: set the horizontal offset of the active table. */
|
|
665
|
+
setTableIndent: (value: number | null) => void;
|
|
666
|
+
/** True when the caret sits inside a table whose alignment can be set. */
|
|
667
|
+
canSetTableAlignment: () => boolean;
|
|
668
|
+
/** Word's table Alignment: set the left/center/right position of the active table. */
|
|
669
|
+
setTableAlignment: (alignment: "left" | "center" | "right" | null) => void;
|
|
670
|
+
/** True when the caret sits inside a table cell that can hold a formula result. */
|
|
671
|
+
canEvaluateTableFormula: () => boolean;
|
|
672
|
+
/** Word's Formula: evaluate a supported aggregate over a direction and
|
|
673
|
+
* write the formatted result into the active cell. */
|
|
674
|
+
evaluateTableFormula: (formula: string) => void;
|
|
675
|
+
/** True when the caret sits inside a table that can be selected. */
|
|
676
|
+
canSelectTable: () => boolean;
|
|
677
|
+
/** Word's Select: expand the caret selection to a cell/row/column/table. */
|
|
678
|
+
selectTablePart: (kind: "cell" | "row" | "column" | "table") => void;
|
|
371
679
|
insert: (rows: number, cols: number) => void;
|
|
372
680
|
}
|
|
373
681
|
export interface EssentialsPluginDeps {
|
|
@@ -7,4 +7,6 @@ export type ActionCommandBuilder = (name: OasisBuiltinCommand, execute: (payload
|
|
|
7
7
|
export declare function createCommandBuilder(isCommandEnabled: CommandEnabledResolver): (name: OasisBuiltinCommand, execute: () => boolean, state?: () => Partial<CommandState>) => OasisCommand;
|
|
8
8
|
export declare function createValueCommandBuilder(isCommandEnabled: CommandEnabledResolver): (name: OasisBuiltinCommand, execute: (payload?: unknown) => boolean, value: () => unknown) => OasisCommand;
|
|
9
9
|
export declare function createActionCommandBuilder(isCommandEnabled: CommandEnabledResolver): (name: OasisBuiltinCommand, execute: (payload?: unknown) => void, state?: () => Partial<CommandState>) => OasisCommand;
|
|
10
|
+
export declare function boolOrNull(payload: unknown): boolean | null;
|
|
11
|
+
export declare function strOrNull(payload: unknown): string | null;
|
|
10
12
|
export declare function numOrNull(payload: unknown): number | null;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { OasisPlugin } from '../../../core/plugin.js';
|
|
2
|
-
import { ActionCommandBuilder } from '../essentialsCommandBuilders.js';
|
|
2
|
+
import { ActionCommandBuilder, ValueCommandBuilder } from '../essentialsCommandBuilders.js';
|
|
3
3
|
import { EssentialsFeatureGate, EssentialsTableCapability } from '../essentialsCapabilities.js';
|
|
4
4
|
interface TableGroupDeps {
|
|
5
5
|
gate: EssentialsFeatureGate;
|
|
6
6
|
table: EssentialsTableCapability;
|
|
7
7
|
actionCommand: ActionCommandBuilder;
|
|
8
|
+
valueCommand: ValueCommandBuilder;
|
|
8
9
|
}
|
|
9
|
-
export declare function buildTableCommands({ gate, table, actionCommand, }: TableGroupDeps): NonNullable<OasisPlugin["commands"]>;
|
|
10
|
+
export declare function buildTableCommands({ gate, table, actionCommand, valueCommand, }: TableGroupDeps): NonNullable<OasisPlugin["commands"]>;
|
|
10
11
|
export {};
|
|
@@ -42,11 +42,12 @@ export declare function createAppCommandsController(deps: AppCommandsControllerD
|
|
|
42
42
|
declare function createAppCommandsControllerImpl(deps: AppCommandsControllerDeps): {
|
|
43
43
|
commandsController: {
|
|
44
44
|
applyBooleanStyleCommand: (key: BooleanStyleKey) => void;
|
|
45
|
+
applyToggleCharacterBorderCommand: () => void;
|
|
45
46
|
applyValueStyleCommand: <K extends "styleId" | "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
|
|
46
47
|
applyChangeTextCaseCommand: (mode: import('../../core/commands/textCase').TextCaseMode) => void;
|
|
47
48
|
applyClearFormattingCommand: () => void;
|
|
48
49
|
applyParagraphStyleCommand: <K extends import('../toolbarStyleState.js').ParagraphStyleKey>(key: K, value: import('../../core/model.js').EditorParagraphStyle[K] | null) => void;
|
|
49
|
-
toggleParagraphFlagCommand: (key: "pageBreakBefore" | "keepWithNext") => void;
|
|
50
|
+
toggleParagraphFlagCommand: (key: "pageBreakBefore" | "keepWithNext" | "keepLinesTogether" | "widowControl") => void;
|
|
50
51
|
applyParagraphListCommand: (kind: NonNullable<import('../../core/model.js').EditorParagraphListStyle["kind"]>) => void;
|
|
51
52
|
handleListFormatChange: (format: import('../../core/model.js').EditorParagraphListStyle["format"]) => void;
|
|
52
53
|
handleListStartAtChange: (startAt: number | null) => void;
|
|
@@ -78,6 +79,10 @@ declare function createAppCommandsControllerImpl(deps: AppCommandsControllerDeps
|
|
|
78
79
|
applyImageCropFitCommand: () => void;
|
|
79
80
|
resetImageCropCommand: () => void;
|
|
80
81
|
applyImageBorderCommand: (patch: import('../../core/commands/image.js').ImageBorderPatch) => void;
|
|
82
|
+
flipImageCommand: (axis: "horizontal" | "vertical") => void;
|
|
83
|
+
rotateImageCommand: (direction: "left" | "right") => void;
|
|
84
|
+
applyImageTransparencyCommand: (transparency: number | null) => void;
|
|
85
|
+
resetImageCommand: () => void;
|
|
81
86
|
handleListTab: (direction: "indent" | "outdent") => boolean;
|
|
82
87
|
handleListEnter: () => boolean;
|
|
83
88
|
handleListBoundaryBackspace: (event: KeyboardEvent & {
|
|
@@ -86,11 +91,12 @@ declare function createAppCommandsControllerImpl(deps: AppCommandsControllerDeps
|
|
|
86
91
|
};
|
|
87
92
|
keyboardCommandsController: {
|
|
88
93
|
applyBooleanStyleCommand: (style: BooleanStyleKey) => void;
|
|
94
|
+
applyToggleCharacterBorderCommand: () => void;
|
|
89
95
|
applyValueStyleCommand: <K extends "styleId" | "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
|
|
90
96
|
applyChangeTextCaseCommand: (mode: import('../../core/commands/textCase').TextCaseMode) => void;
|
|
91
97
|
applyClearFormattingCommand: () => void;
|
|
92
98
|
applyParagraphStyleCommand: <K extends import('../toolbarStyleState.js').ParagraphStyleKey>(key: K, value: import('../../core/model.js').EditorParagraphStyle[K] | null) => void;
|
|
93
|
-
toggleParagraphFlagCommand: (key: "pageBreakBefore" | "keepWithNext") => void;
|
|
99
|
+
toggleParagraphFlagCommand: (key: "pageBreakBefore" | "keepWithNext" | "keepLinesTogether" | "widowControl") => void;
|
|
94
100
|
applyParagraphListCommand: (kind: NonNullable<import('../../core/model.js').EditorParagraphListStyle["kind"]>) => void;
|
|
95
101
|
handleListFormatChange: (format: import('../../core/model.js').EditorParagraphListStyle["format"]) => void;
|
|
96
102
|
handleListStartAtChange: (startAt: number | null) => void;
|
|
@@ -122,6 +128,10 @@ declare function createAppCommandsControllerImpl(deps: AppCommandsControllerDeps
|
|
|
122
128
|
applyImageCropFitCommand: () => void;
|
|
123
129
|
resetImageCropCommand: () => void;
|
|
124
130
|
applyImageBorderCommand: (patch: import('../../core/commands/image.js').ImageBorderPatch) => void;
|
|
131
|
+
flipImageCommand: (axis: "horizontal" | "vertical") => void;
|
|
132
|
+
rotateImageCommand: (direction: "left" | "right") => void;
|
|
133
|
+
applyImageTransparencyCommand: (transparency: number | null) => void;
|
|
134
|
+
resetImageCommand: () => void;
|
|
125
135
|
handleListTab: (direction: "indent" | "outdent") => boolean;
|
|
126
136
|
handleListEnter: () => boolean;
|
|
127
137
|
handleListBoundaryBackspace: (event: KeyboardEvent & {
|
|
@@ -7,6 +7,7 @@ import { createEditorDocumentRuntime } from './createEditorDocumentRuntime.js';
|
|
|
7
7
|
import { createEditorInteractionRuntime } from './createEditorInteractionRuntime.js';
|
|
8
8
|
import { EditorCommentComposer } from './createEditorCommentComposer.js';
|
|
9
9
|
import { OasisEditorAppDocumentProps, OasisEditorAppRuntimeProps } from '../OasisEditorAppProps.js';
|
|
10
|
+
import { TablePropertiesDialogInitialValues } from '../components/Dialogs/TablePropertiesDialog.js';
|
|
10
11
|
type DocumentRuntime = ReturnType<typeof createEditorDocumentRuntime>;
|
|
11
12
|
type InteractionRuntime = ReturnType<typeof createEditorInteractionRuntime>;
|
|
12
13
|
interface LinkDialogSetter {
|
|
@@ -52,6 +53,10 @@ export interface EditorCommandRuntimeDeps {
|
|
|
52
53
|
setSymbolDialog: (state: {
|
|
53
54
|
isOpen: boolean;
|
|
54
55
|
}) => void;
|
|
56
|
+
setTablePropertiesDialog: (state: {
|
|
57
|
+
isOpen: boolean;
|
|
58
|
+
initial: TablePropertiesDialogInitialValues;
|
|
59
|
+
}) => void;
|
|
55
60
|
setEquationDialog: (state: {
|
|
56
61
|
isOpen: boolean;
|
|
57
62
|
initial?: import('../../core/model.js').EditorMathExpression;
|
|
@@ -77,11 +82,12 @@ export declare function createEditorCommandRuntime(deps: EditorCommandRuntimeDep
|
|
|
77
82
|
declare function createEditorCommandRuntimeImpl(deps: EditorCommandRuntimeDeps): {
|
|
78
83
|
commandsController: {
|
|
79
84
|
applyBooleanStyleCommand: (key: BooleanStyleKey) => void;
|
|
85
|
+
applyToggleCharacterBorderCommand: () => void;
|
|
80
86
|
applyValueStyleCommand: <K extends "styleId" | "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
|
|
81
87
|
applyChangeTextCaseCommand: (mode: import('../../core/commands/textCase.js').TextCaseMode) => void;
|
|
82
88
|
applyClearFormattingCommand: () => void;
|
|
83
89
|
applyParagraphStyleCommand: <K extends import('../toolbarStyleState.js').ParagraphStyleKey>(key: K, value: import('../../core/model.js').EditorParagraphStyle[K] | null) => void;
|
|
84
|
-
toggleParagraphFlagCommand: (key: "pageBreakBefore" | "keepWithNext") => void;
|
|
90
|
+
toggleParagraphFlagCommand: (key: "pageBreakBefore" | "keepWithNext" | "keepLinesTogether" | "widowControl") => void;
|
|
85
91
|
applyParagraphListCommand: (kind: NonNullable<import('../../core/model.js').EditorParagraphListStyle["kind"]>) => void;
|
|
86
92
|
handleListFormatChange: (format: import('../../core/model.js').EditorParagraphListStyle["format"]) => void;
|
|
87
93
|
handleListStartAtChange: (startAt: number | null) => void;
|
|
@@ -113,6 +119,10 @@ declare function createEditorCommandRuntimeImpl(deps: EditorCommandRuntimeDeps):
|
|
|
113
119
|
applyImageCropFitCommand: () => void;
|
|
114
120
|
resetImageCropCommand: () => void;
|
|
115
121
|
applyImageBorderCommand: (patch: import('../../core/commands/image.js').ImageBorderPatch) => void;
|
|
122
|
+
flipImageCommand: (axis: "horizontal" | "vertical") => void;
|
|
123
|
+
rotateImageCommand: (direction: "left" | "right") => void;
|
|
124
|
+
applyImageTransparencyCommand: (transparency: number | null) => void;
|
|
125
|
+
resetImageCommand: () => void;
|
|
116
126
|
handleListTab: (direction: "indent" | "outdent") => boolean;
|
|
117
127
|
handleListEnter: () => boolean;
|
|
118
128
|
handleListBoundaryBackspace: (event: KeyboardEvent & {
|
|
@@ -35,6 +35,8 @@ export interface CreateEditorEssentialsPluginOptions {
|
|
|
35
35
|
newDocument: () => void;
|
|
36
36
|
openSymbolDialog: () => void;
|
|
37
37
|
openEquationDialog: () => void;
|
|
38
|
+
/** Opens the Table Properties dialog for the active table/cell. */
|
|
39
|
+
openTablePropertiesDialog: (activeTab?: "table" | "cell") => void;
|
|
38
40
|
importInputRef: () => HTMLInputElement | undefined;
|
|
39
41
|
imageInputRef: () => HTMLInputElement | undefined;
|
|
40
42
|
selectedImageRun: () => SelectedImageRun | null;
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { TranslationKey } from '../../../i18n/index.js';
|
|
2
|
+
import { MarginPreset as CoreMarginPreset } from '../../../core/commands/pageSetup.js';
|
|
2
3
|
/** Convert a centimetre measurement to a rounded pixel value. */
|
|
3
4
|
export declare function cmToPx(cm: number): number;
|
|
4
5
|
/** Convert pixels back to centimetres (for display in the custom form). */
|
|
5
6
|
export declare function pxToCm(px: number): number;
|
|
6
|
-
export interface MarginPreset {
|
|
7
|
-
id: string;
|
|
7
|
+
export interface MarginPreset extends CoreMarginPreset {
|
|
8
8
|
labelKey: TranslationKey;
|
|
9
|
-
/** Margins in centimetres, mirroring Word's presets. */
|
|
10
|
-
top: number;
|
|
11
|
-
bottom: number;
|
|
12
|
-
left: number;
|
|
13
|
-
right: number;
|
|
14
9
|
}
|
|
15
10
|
/**
|
|
16
|
-
* Word's built-in page-margin presets
|
|
17
|
-
*
|
|
11
|
+
* Word's built-in page-margin presets. The numeric values (cm) are owned by
|
|
12
|
+
* the core `pageSetup` command; this UI layer only adds the i18n label key so
|
|
13
|
+
* the exact numbers stay in one place (single source of truth).
|
|
18
14
|
*/
|
|
19
15
|
export declare const MARGIN_PRESETS: MarginPreset[];
|
|
20
16
|
/** Preset margins converted to the px units stored on the page settings. */
|