oasis-editor 0.0.33 → 0.0.34
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/app/controllers/EditorCommandRegistry.d.ts +1 -1
- package/dist/app/controllers/EditorKeyboardDeps.d.ts +49 -0
- package/dist/app/controllers/documentIO/DocumentImporter.d.ts +1 -1
- package/dist/app/controllers/documentIO/importProgress.d.ts +14 -0
- package/dist/app/controllers/useEditorDocumentIO.d.ts +2 -7
- package/dist/app/controllers/useEditorKeyboard.d.ts +2 -42
- package/dist/plugins/internal/createEssentialsPlugin.d.ts +2 -151
- package/dist/plugins/internal/essentialsCapabilities.d.ts +152 -0
- package/dist/plugins/internal/essentialsCommandGroups.d.ts +1 -1
- package/dist/ui/components/Dialogs/FontDialogModel.d.ts +1 -3
- package/dist/ui/components/Dialogs/font-dialog/FontDialogTypes.d.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { EditorDocument, EditorPosition, EditorState } from '../../core/model.js';
|
|
2
|
+
import { BooleanStyleKey } from '../../ui/toolbarStyleState.js';
|
|
3
|
+
import { SelectedImageRun } from '../../core/commands/image.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The capability surface the keyboard controller and key bindings operate on.
|
|
7
|
+
* Extracted to its own leaf module so `EditorCommandRegistry` (which references
|
|
8
|
+
* it from key-binding signatures) and `useEditorKeyboard` (which implements the
|
|
9
|
+
* controller) can both depend on it without forming an import cycle.
|
|
10
|
+
*/
|
|
11
|
+
export interface EditorKeyboardDeps {
|
|
12
|
+
state: () => EditorState;
|
|
13
|
+
isReadOnly: () => boolean;
|
|
14
|
+
clearPreferredColumn: () => void;
|
|
15
|
+
resetTransactionGrouping: () => void;
|
|
16
|
+
applyState: (state: EditorState) => void;
|
|
17
|
+
applyTransactionalState: (transform: (state: EditorState) => EditorState) => void;
|
|
18
|
+
applyTableAwareParagraphEdit: (state: EditorState, edit: (state: EditorState) => EditorState) => EditorState;
|
|
19
|
+
applySelectionAwareParagraphCommand: (command: (state: EditorState) => EditorState) => void;
|
|
20
|
+
focusInput: () => void;
|
|
21
|
+
commandsController: {
|
|
22
|
+
promptForImageAlt: () => void;
|
|
23
|
+
promptForLink: () => void;
|
|
24
|
+
applyBooleanStyleCommand: (style: BooleanStyleKey) => void;
|
|
25
|
+
applyParagraphListCommand: (style: "bullet" | "ordered") => void;
|
|
26
|
+
applyInsertFootnoteCommand: () => void;
|
|
27
|
+
handleListEnter: () => boolean;
|
|
28
|
+
handleListBoundaryBackspace: (event: KeyboardEvent & {
|
|
29
|
+
currentTarget: HTMLTextAreaElement;
|
|
30
|
+
}) => boolean;
|
|
31
|
+
handleListTab: (direction: "indent" | "outdent") => boolean;
|
|
32
|
+
};
|
|
33
|
+
selectedImageRun: () => SelectedImageRun | null;
|
|
34
|
+
setForcePlainTextPaste: (value: boolean) => void;
|
|
35
|
+
moveSelectionByWord: (direction: "left" | "right", extend: boolean) => boolean;
|
|
36
|
+
moveSelectionToDocumentBoundary: (boundary: "start" | "end", extend: boolean) => boolean;
|
|
37
|
+
moveSelectionToParagraphBoundary: (boundary: "start" | "end", extend: boolean) => boolean;
|
|
38
|
+
moveSelectedImageByParagraph: (direction: -1 | 1) => boolean;
|
|
39
|
+
performUndo: () => void;
|
|
40
|
+
performRedo: () => void;
|
|
41
|
+
moveVerticalSelection: (direction: -1 | 1, extend: boolean) => boolean;
|
|
42
|
+
moveVerticalByBlock: (direction: -1 | 1) => boolean;
|
|
43
|
+
resolveAdjacentTableCellPosition: (document: EditorDocument, paragraphId: string, delta: -1 | 1) => EditorPosition | null;
|
|
44
|
+
applySelectionPreservingStructure: (selection: EditorState["selection"]) => void;
|
|
45
|
+
toggleFindReplace: (open?: boolean) => void;
|
|
46
|
+
toggleReplace: (open?: boolean) => void;
|
|
47
|
+
executeCommand?: (commandName: string, payload?: unknown) => unknown;
|
|
48
|
+
canExecuteCommand?: (commandName: string, payload?: unknown) => boolean;
|
|
49
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EditorState } from '../../../core/model.js';
|
|
2
2
|
import { EditorLogger } from '../../../utils/logger.js';
|
|
3
|
-
import { ImportProgressPhase } from '
|
|
3
|
+
import { ImportProgressPhase } from './importProgress.js';
|
|
4
4
|
|
|
5
5
|
export interface DocumentImporterDeps {
|
|
6
6
|
applyState: (state: EditorState) => void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ImportStage } from '../../../import/DocumentFormatImporter.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Import progress vocabulary shared by the document IO hook and the
|
|
5
|
+
* `DocumentImporter` it drives. Kept in its own leaf module so the importer can
|
|
6
|
+
* reference the phase type without importing the hook (which imports the
|
|
7
|
+
* importer), avoiding a cycle.
|
|
8
|
+
*/
|
|
9
|
+
export type ImportProgressPhase = "reading-file" | ImportStage | "applying-editor-state" | "stabilizing-layout" | "done" | "error";
|
|
10
|
+
export interface ImportProgressState {
|
|
11
|
+
phase: ImportProgressPhase;
|
|
12
|
+
progress: number;
|
|
13
|
+
subProgress?: number;
|
|
14
|
+
}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { EditorState, EditorPosition } from '../../core/model.js';
|
|
2
|
-
import { ImportStage } from '../../import/DocumentFormatImporter.js';
|
|
3
2
|
import { EditorLogger } from '../../utils/logger.js';
|
|
3
|
+
import { ImportProgressState } from './documentIO/importProgress.js';
|
|
4
4
|
|
|
5
|
-
export type ImportProgressPhase
|
|
6
|
-
export interface ImportProgressState {
|
|
7
|
-
phase: ImportProgressPhase;
|
|
8
|
-
progress: number;
|
|
9
|
-
subProgress?: number;
|
|
10
|
-
}
|
|
5
|
+
export type { ImportProgressPhase, ImportProgressState, } from './documentIO/importProgress.js';
|
|
11
6
|
export interface UseEditorDocumentIOProps {
|
|
12
7
|
state: () => EditorState;
|
|
13
8
|
applyState: (state: EditorState) => void;
|
|
@@ -1,47 +1,7 @@
|
|
|
1
|
-
import { EditorDocument, EditorPosition, EditorState } from '../../core/model.js';
|
|
2
|
-
import { BooleanStyleKey } from '../../ui/toolbarStyleState.js';
|
|
3
1
|
import { EditorCommandRegistry } from './EditorCommandRegistry.js';
|
|
4
|
-
import {
|
|
2
|
+
import { EditorKeyboardDeps } from './EditorKeyboardDeps.js';
|
|
5
3
|
|
|
6
|
-
export
|
|
7
|
-
state: () => EditorState;
|
|
8
|
-
isReadOnly: () => boolean;
|
|
9
|
-
clearPreferredColumn: () => void;
|
|
10
|
-
resetTransactionGrouping: () => void;
|
|
11
|
-
applyState: (state: EditorState) => void;
|
|
12
|
-
applyTransactionalState: (transform: (state: EditorState) => EditorState) => void;
|
|
13
|
-
applyTableAwareParagraphEdit: (state: EditorState, edit: (state: EditorState) => EditorState) => EditorState;
|
|
14
|
-
applySelectionAwareParagraphCommand: (command: (state: EditorState) => EditorState) => void;
|
|
15
|
-
focusInput: () => void;
|
|
16
|
-
commandsController: {
|
|
17
|
-
promptForImageAlt: () => void;
|
|
18
|
-
promptForLink: () => void;
|
|
19
|
-
applyBooleanStyleCommand: (style: BooleanStyleKey) => void;
|
|
20
|
-
applyParagraphListCommand: (style: "bullet" | "ordered") => void;
|
|
21
|
-
applyInsertFootnoteCommand: () => void;
|
|
22
|
-
handleListEnter: () => boolean;
|
|
23
|
-
handleListBoundaryBackspace: (event: KeyboardEvent & {
|
|
24
|
-
currentTarget: HTMLTextAreaElement;
|
|
25
|
-
}) => boolean;
|
|
26
|
-
handleListTab: (direction: "indent" | "outdent") => boolean;
|
|
27
|
-
};
|
|
28
|
-
selectedImageRun: () => SelectedImageRun | null;
|
|
29
|
-
setForcePlainTextPaste: (value: boolean) => void;
|
|
30
|
-
moveSelectionByWord: (direction: "left" | "right", extend: boolean) => boolean;
|
|
31
|
-
moveSelectionToDocumentBoundary: (boundary: "start" | "end", extend: boolean) => boolean;
|
|
32
|
-
moveSelectionToParagraphBoundary: (boundary: "start" | "end", extend: boolean) => boolean;
|
|
33
|
-
moveSelectedImageByParagraph: (direction: -1 | 1) => boolean;
|
|
34
|
-
performUndo: () => void;
|
|
35
|
-
performRedo: () => void;
|
|
36
|
-
moveVerticalSelection: (direction: -1 | 1, extend: boolean) => boolean;
|
|
37
|
-
moveVerticalByBlock: (direction: -1 | 1) => boolean;
|
|
38
|
-
resolveAdjacentTableCellPosition: (document: EditorDocument, paragraphId: string, delta: -1 | 1) => EditorPosition | null;
|
|
39
|
-
applySelectionPreservingStructure: (selection: EditorState["selection"]) => void;
|
|
40
|
-
toggleFindReplace: (open?: boolean) => void;
|
|
41
|
-
toggleReplace: (open?: boolean) => void;
|
|
42
|
-
executeCommand?: (commandName: string, payload?: unknown) => unknown;
|
|
43
|
-
canExecuteCommand?: (commandName: string, payload?: unknown) => boolean;
|
|
44
|
-
}
|
|
4
|
+
export type { EditorKeyboardDeps } from './EditorKeyboardDeps.js';
|
|
45
5
|
export declare function createEditorKeyboardController(deps: EditorKeyboardDeps): {
|
|
46
6
|
handleKeyDown: (event: KeyboardEvent & {
|
|
47
7
|
currentTarget: HTMLTextAreaElement;
|
|
@@ -1,154 +1,5 @@
|
|
|
1
1
|
import { OasisPlugin } from '../../core/plugin.js';
|
|
2
|
-
import {
|
|
3
|
-
import { TextCaseMode } from '../../core/commands/text.js';
|
|
4
|
-
import { ToolbarStyleState } from '../../ui/toolbarStyleState.js';
|
|
2
|
+
import { EssentialsPluginDeps } from './essentialsCapabilities.js';
|
|
5
3
|
|
|
6
|
-
export
|
|
7
|
-
isCommandEnabled: (commandName: string) => boolean;
|
|
8
|
-
}
|
|
9
|
-
export interface EssentialsStyleCapability {
|
|
10
|
-
state: () => ToolbarStyleState;
|
|
11
|
-
}
|
|
12
|
-
export interface EssentialsSelectionCapability {
|
|
13
|
-
isCollapsed: () => boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface EssentialsHistoryCapability {
|
|
16
|
-
canUndo: () => boolean;
|
|
17
|
-
canRedo: () => boolean;
|
|
18
|
-
undo: () => boolean;
|
|
19
|
-
redo: () => boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface EssentialsFormattingCapability {
|
|
22
|
-
selectAll: () => boolean;
|
|
23
|
-
insertFootnote: () => boolean;
|
|
24
|
-
pastePlainText: () => boolean;
|
|
25
|
-
bold: () => boolean;
|
|
26
|
-
italic: () => boolean;
|
|
27
|
-
underline: () => boolean;
|
|
28
|
-
strike: () => boolean;
|
|
29
|
-
superscript: () => boolean;
|
|
30
|
-
subscript: () => boolean;
|
|
31
|
-
alignLeft: () => boolean;
|
|
32
|
-
alignCenter: () => boolean;
|
|
33
|
-
alignRight: () => boolean;
|
|
34
|
-
alignJustify: () => boolean;
|
|
35
|
-
orderedList: () => boolean;
|
|
36
|
-
bulletList: () => boolean;
|
|
37
|
-
find: () => boolean;
|
|
38
|
-
replace: () => boolean;
|
|
39
|
-
toggleTrackChanges: () => boolean;
|
|
40
|
-
acceptRevisions: () => boolean;
|
|
41
|
-
rejectRevisions: () => boolean;
|
|
42
|
-
toggleShowMargins: () => boolean;
|
|
43
|
-
toggleShowParagraphMarks: () => boolean;
|
|
44
|
-
togglePreciseFonts: () => boolean;
|
|
45
|
-
pageBreak: () => boolean;
|
|
46
|
-
lineBreak: () => boolean;
|
|
47
|
-
splitBlock: () => boolean;
|
|
48
|
-
setFontFamily: (value: string | null) => boolean;
|
|
49
|
-
setFontSize: (value: number | null) => boolean;
|
|
50
|
-
increaseFontSize: () => boolean;
|
|
51
|
-
decreaseFontSize: () => boolean;
|
|
52
|
-
changeTextCase: (mode: TextCaseMode) => boolean;
|
|
53
|
-
clearFormatting: () => boolean;
|
|
54
|
-
setColor: (value: string | null) => boolean;
|
|
55
|
-
setHighlight: (value: string | null) => boolean;
|
|
56
|
-
setTextShading: (value: string | null) => boolean;
|
|
57
|
-
setStyleId: (value: string) => boolean;
|
|
58
|
-
setUnderlineStyle: (value: string | null) => void;
|
|
59
|
-
}
|
|
60
|
-
export interface EssentialsDocumentStyleDescriptor {
|
|
61
|
-
id: string;
|
|
62
|
-
name: string;
|
|
63
|
-
fontFamily?: string;
|
|
64
|
-
fontSize?: number;
|
|
65
|
-
}
|
|
66
|
-
export interface EssentialsDocumentCapability {
|
|
67
|
-
documentStyles: () => EssentialsDocumentStyleDescriptor[];
|
|
68
|
-
exportDocx: () => void;
|
|
69
|
-
exportPdf: () => void;
|
|
70
|
-
importDocument: () => void;
|
|
71
|
-
insertImage: () => void;
|
|
72
|
-
insertShape: (preset: string) => void;
|
|
73
|
-
}
|
|
74
|
-
export interface EssentialsLinkCapability {
|
|
75
|
-
prompt: () => void;
|
|
76
|
-
remove: () => void;
|
|
77
|
-
canPrompt: () => boolean;
|
|
78
|
-
}
|
|
79
|
-
export interface EssentialsImageCapability {
|
|
80
|
-
promptAlt: () => void;
|
|
81
|
-
promptCaption: () => void;
|
|
82
|
-
isSelected: () => boolean;
|
|
83
|
-
}
|
|
84
|
-
export interface EssentialsBrowserCapability {
|
|
85
|
-
print: () => void;
|
|
86
|
-
copy: () => void;
|
|
87
|
-
}
|
|
88
|
-
export interface EssentialsParagraphCapability {
|
|
89
|
-
togglePageBreakBefore: () => void;
|
|
90
|
-
toggleKeepWithNext: () => void;
|
|
91
|
-
setSpacingAfter: (value: number | null) => void;
|
|
92
|
-
setSpacingBefore: (value: number | null) => void;
|
|
93
|
-
setIndentLeft: (value: number | null) => void;
|
|
94
|
-
setIndentRight: (value: number | null) => void;
|
|
95
|
-
setIndentFirstLine: (value: number | null) => void;
|
|
96
|
-
setIndentHanging: (value: number | null) => void;
|
|
97
|
-
setSpecialIndent: (kind: "none" | "firstLine" | "hanging", value?: number | null) => void;
|
|
98
|
-
setShading: (value: string | null) => void;
|
|
99
|
-
applyBorders: () => void;
|
|
100
|
-
setLineHeight: (value: number | null) => void;
|
|
101
|
-
setListFormat: (format: string) => void;
|
|
102
|
-
setListStartAt: (value: number | null) => void;
|
|
103
|
-
outdent: () => void;
|
|
104
|
-
indent: () => void;
|
|
105
|
-
}
|
|
106
|
-
export interface EssentialsSectionCapability {
|
|
107
|
-
isLandscape: () => boolean;
|
|
108
|
-
toggleOrientation: () => void;
|
|
109
|
-
setOrientation: (orientation: "portrait" | "landscape") => void;
|
|
110
|
-
breakNextPage: () => void;
|
|
111
|
-
breakContinuous: () => void;
|
|
112
|
-
getMargins: () => EditorPageMargins | undefined;
|
|
113
|
-
setPageMargins: (margins: Partial<EditorPageMargins>) => void;
|
|
114
|
-
}
|
|
115
|
-
export interface EssentialsTableCapability {
|
|
116
|
-
insideTable: () => boolean;
|
|
117
|
-
selectionLabel: () => string | null;
|
|
118
|
-
canMerge: () => boolean;
|
|
119
|
-
canSplit: () => boolean;
|
|
120
|
-
canEditColumn: () => boolean;
|
|
121
|
-
canEditRow: () => boolean;
|
|
122
|
-
merge: () => void;
|
|
123
|
-
split: () => void;
|
|
124
|
-
insertColumnBefore: () => void;
|
|
125
|
-
insertColumnAfter: () => void;
|
|
126
|
-
deleteColumn: () => void;
|
|
127
|
-
insertRowBefore: () => void;
|
|
128
|
-
insertRowAfter: () => void;
|
|
129
|
-
deleteRow: () => void;
|
|
130
|
-
cellShading: (color: string | null) => void;
|
|
131
|
-
cellBorders: () => void;
|
|
132
|
-
cellNoBorders: () => void;
|
|
133
|
-
width100: () => void;
|
|
134
|
-
alignLeft: () => void;
|
|
135
|
-
alignCenter: () => void;
|
|
136
|
-
alignRight: () => void;
|
|
137
|
-
setCellWidth: (width: string) => void;
|
|
138
|
-
insert: (rows: number, cols: number) => void;
|
|
139
|
-
}
|
|
140
|
-
export interface EssentialsPluginDeps {
|
|
141
|
-
gate: EssentialsFeatureGate;
|
|
142
|
-
style: EssentialsStyleCapability;
|
|
143
|
-
selection: EssentialsSelectionCapability;
|
|
144
|
-
history: EssentialsHistoryCapability;
|
|
145
|
-
formatting: EssentialsFormattingCapability;
|
|
146
|
-
document: EssentialsDocumentCapability;
|
|
147
|
-
link: EssentialsLinkCapability;
|
|
148
|
-
image: EssentialsImageCapability;
|
|
149
|
-
browser: EssentialsBrowserCapability;
|
|
150
|
-
paragraph: EssentialsParagraphCapability;
|
|
151
|
-
section: EssentialsSectionCapability;
|
|
152
|
-
table: EssentialsTableCapability;
|
|
153
|
-
}
|
|
4
|
+
export type { EssentialsFeatureGate, EssentialsStyleCapability, EssentialsSelectionCapability, EssentialsHistoryCapability, EssentialsFormattingCapability, EssentialsDocumentStyleDescriptor, EssentialsDocumentCapability, EssentialsLinkCapability, EssentialsImageCapability, EssentialsBrowserCapability, EssentialsParagraphCapability, EssentialsSectionCapability, EssentialsTableCapability, EssentialsPluginDeps, } from './essentialsCapabilities.js';
|
|
154
5
|
export declare function createEssentialsPlugin(deps: EssentialsPluginDeps): OasisPlugin;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { EditorPageMargins } from '../../core/model.js';
|
|
2
|
+
import { TextCaseMode } from '../../core/commands/text.js';
|
|
3
|
+
import { ToolbarStyleState } from '../../ui/toolbarStyleState.js';
|
|
4
|
+
|
|
5
|
+
export interface EssentialsFeatureGate {
|
|
6
|
+
isCommandEnabled: (commandName: string) => boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface EssentialsStyleCapability {
|
|
9
|
+
state: () => ToolbarStyleState;
|
|
10
|
+
}
|
|
11
|
+
export interface EssentialsSelectionCapability {
|
|
12
|
+
isCollapsed: () => boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface EssentialsHistoryCapability {
|
|
15
|
+
canUndo: () => boolean;
|
|
16
|
+
canRedo: () => boolean;
|
|
17
|
+
undo: () => boolean;
|
|
18
|
+
redo: () => boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface EssentialsFormattingCapability {
|
|
21
|
+
selectAll: () => boolean;
|
|
22
|
+
insertFootnote: () => boolean;
|
|
23
|
+
pastePlainText: () => boolean;
|
|
24
|
+
bold: () => boolean;
|
|
25
|
+
italic: () => boolean;
|
|
26
|
+
underline: () => boolean;
|
|
27
|
+
strike: () => boolean;
|
|
28
|
+
superscript: () => boolean;
|
|
29
|
+
subscript: () => boolean;
|
|
30
|
+
alignLeft: () => boolean;
|
|
31
|
+
alignCenter: () => boolean;
|
|
32
|
+
alignRight: () => boolean;
|
|
33
|
+
alignJustify: () => boolean;
|
|
34
|
+
orderedList: () => boolean;
|
|
35
|
+
bulletList: () => boolean;
|
|
36
|
+
find: () => boolean;
|
|
37
|
+
replace: () => boolean;
|
|
38
|
+
toggleTrackChanges: () => boolean;
|
|
39
|
+
acceptRevisions: () => boolean;
|
|
40
|
+
rejectRevisions: () => boolean;
|
|
41
|
+
toggleShowMargins: () => boolean;
|
|
42
|
+
toggleShowParagraphMarks: () => boolean;
|
|
43
|
+
togglePreciseFonts: () => boolean;
|
|
44
|
+
pageBreak: () => boolean;
|
|
45
|
+
lineBreak: () => boolean;
|
|
46
|
+
splitBlock: () => boolean;
|
|
47
|
+
setFontFamily: (value: string | null) => boolean;
|
|
48
|
+
setFontSize: (value: number | null) => boolean;
|
|
49
|
+
increaseFontSize: () => boolean;
|
|
50
|
+
decreaseFontSize: () => boolean;
|
|
51
|
+
changeTextCase: (mode: TextCaseMode) => boolean;
|
|
52
|
+
clearFormatting: () => boolean;
|
|
53
|
+
setColor: (value: string | null) => boolean;
|
|
54
|
+
setHighlight: (value: string | null) => boolean;
|
|
55
|
+
setTextShading: (value: string | null) => boolean;
|
|
56
|
+
setStyleId: (value: string) => boolean;
|
|
57
|
+
setUnderlineStyle: (value: string | null) => void;
|
|
58
|
+
}
|
|
59
|
+
export interface EssentialsDocumentStyleDescriptor {
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
fontFamily?: string;
|
|
63
|
+
fontSize?: number;
|
|
64
|
+
}
|
|
65
|
+
export interface EssentialsDocumentCapability {
|
|
66
|
+
documentStyles: () => EssentialsDocumentStyleDescriptor[];
|
|
67
|
+
exportDocx: () => void;
|
|
68
|
+
exportPdf: () => void;
|
|
69
|
+
importDocument: () => void;
|
|
70
|
+
insertImage: () => void;
|
|
71
|
+
insertShape: (preset: string) => void;
|
|
72
|
+
}
|
|
73
|
+
export interface EssentialsLinkCapability {
|
|
74
|
+
prompt: () => void;
|
|
75
|
+
remove: () => void;
|
|
76
|
+
canPrompt: () => boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface EssentialsImageCapability {
|
|
79
|
+
promptAlt: () => void;
|
|
80
|
+
promptCaption: () => void;
|
|
81
|
+
isSelected: () => boolean;
|
|
82
|
+
}
|
|
83
|
+
export interface EssentialsBrowserCapability {
|
|
84
|
+
print: () => void;
|
|
85
|
+
copy: () => void;
|
|
86
|
+
}
|
|
87
|
+
export interface EssentialsParagraphCapability {
|
|
88
|
+
togglePageBreakBefore: () => void;
|
|
89
|
+
toggleKeepWithNext: () => void;
|
|
90
|
+
setSpacingAfter: (value: number | null) => void;
|
|
91
|
+
setSpacingBefore: (value: number | null) => void;
|
|
92
|
+
setIndentLeft: (value: number | null) => void;
|
|
93
|
+
setIndentRight: (value: number | null) => void;
|
|
94
|
+
setIndentFirstLine: (value: number | null) => void;
|
|
95
|
+
setIndentHanging: (value: number | null) => void;
|
|
96
|
+
setSpecialIndent: (kind: "none" | "firstLine" | "hanging", value?: number | null) => void;
|
|
97
|
+
setShading: (value: string | null) => void;
|
|
98
|
+
applyBorders: () => void;
|
|
99
|
+
setLineHeight: (value: number | null) => void;
|
|
100
|
+
setListFormat: (format: string) => void;
|
|
101
|
+
setListStartAt: (value: number | null) => void;
|
|
102
|
+
outdent: () => void;
|
|
103
|
+
indent: () => void;
|
|
104
|
+
}
|
|
105
|
+
export interface EssentialsSectionCapability {
|
|
106
|
+
isLandscape: () => boolean;
|
|
107
|
+
toggleOrientation: () => void;
|
|
108
|
+
setOrientation: (orientation: "portrait" | "landscape") => void;
|
|
109
|
+
breakNextPage: () => void;
|
|
110
|
+
breakContinuous: () => void;
|
|
111
|
+
getMargins: () => EditorPageMargins | undefined;
|
|
112
|
+
setPageMargins: (margins: Partial<EditorPageMargins>) => void;
|
|
113
|
+
}
|
|
114
|
+
export interface EssentialsTableCapability {
|
|
115
|
+
insideTable: () => boolean;
|
|
116
|
+
selectionLabel: () => string | null;
|
|
117
|
+
canMerge: () => boolean;
|
|
118
|
+
canSplit: () => boolean;
|
|
119
|
+
canEditColumn: () => boolean;
|
|
120
|
+
canEditRow: () => boolean;
|
|
121
|
+
merge: () => void;
|
|
122
|
+
split: () => void;
|
|
123
|
+
insertColumnBefore: () => void;
|
|
124
|
+
insertColumnAfter: () => void;
|
|
125
|
+
deleteColumn: () => void;
|
|
126
|
+
insertRowBefore: () => void;
|
|
127
|
+
insertRowAfter: () => void;
|
|
128
|
+
deleteRow: () => void;
|
|
129
|
+
cellShading: (color: string | null) => void;
|
|
130
|
+
cellBorders: () => void;
|
|
131
|
+
cellNoBorders: () => void;
|
|
132
|
+
width100: () => void;
|
|
133
|
+
alignLeft: () => void;
|
|
134
|
+
alignCenter: () => void;
|
|
135
|
+
alignRight: () => void;
|
|
136
|
+
setCellWidth: (width: string) => void;
|
|
137
|
+
insert: (rows: number, cols: number) => void;
|
|
138
|
+
}
|
|
139
|
+
export interface EssentialsPluginDeps {
|
|
140
|
+
gate: EssentialsFeatureGate;
|
|
141
|
+
style: EssentialsStyleCapability;
|
|
142
|
+
selection: EssentialsSelectionCapability;
|
|
143
|
+
history: EssentialsHistoryCapability;
|
|
144
|
+
formatting: EssentialsFormattingCapability;
|
|
145
|
+
document: EssentialsDocumentCapability;
|
|
146
|
+
link: EssentialsLinkCapability;
|
|
147
|
+
image: EssentialsImageCapability;
|
|
148
|
+
browser: EssentialsBrowserCapability;
|
|
149
|
+
paragraph: EssentialsParagraphCapability;
|
|
150
|
+
section: EssentialsSectionCapability;
|
|
151
|
+
table: EssentialsTableCapability;
|
|
152
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OasisPlugin } from '../../core/plugin.js';
|
|
2
2
|
import { ActionCommandBuilder, CommandBuilder, ValueCommandBuilder } from './essentialsCommandBuilders.js';
|
|
3
|
-
import { EssentialsBrowserCapability, EssentialsDocumentCapability, EssentialsFeatureGate, EssentialsFormattingCapability, EssentialsHistoryCapability, EssentialsImageCapability, EssentialsLinkCapability, EssentialsParagraphCapability, EssentialsSectionCapability, EssentialsSelectionCapability, EssentialsStyleCapability, EssentialsTableCapability } from './
|
|
3
|
+
import { EssentialsBrowserCapability, EssentialsDocumentCapability, EssentialsFeatureGate, EssentialsFormattingCapability, EssentialsHistoryCapability, EssentialsImageCapability, EssentialsLinkCapability, EssentialsParagraphCapability, EssentialsSectionCapability, EssentialsSelectionCapability, EssentialsStyleCapability, EssentialsTableCapability } from './essentialsCapabilities.js';
|
|
4
4
|
|
|
5
5
|
interface CoreFormattingGroupDeps {
|
|
6
6
|
gate: EssentialsFeatureGate;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { EditorLigatures, EditorNumberForm, EditorNumberSpacing } from '../../../core/model.js';
|
|
2
|
-
import { FontTabValues, AdvancedTabValues, FontDialogInitialValues, FontDialogApplyValues } from './font-dialog/FontDialogTypes.js';
|
|
2
|
+
import { FontTabValues, AdvancedTabValues, FontDialogInitialValues, FontDialogApplyValues, FontDialogSpacingMode, FontDialogPositionMode } from './font-dialog/FontDialogTypes.js';
|
|
3
3
|
|
|
4
|
-
export type FontDialogSpacingMode = "normal" | "expanded" | "condensed";
|
|
5
|
-
export type FontDialogPositionMode = "normal" | "raised" | "lowered";
|
|
6
4
|
export type FontFaceStyle = "regular" | "italic" | "bold" | "boldItalic";
|
|
7
5
|
export declare function parsePositiveNumber(value: string): number | null;
|
|
8
6
|
export declare function parseNonNegativeNumber(value: string): number | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EditorLigatures, EditorNumberForm, EditorNumberSpacing, EditorUnderlineStyle } from '../../../../core/model.js';
|
|
2
|
-
import { FontDialogSpacingMode, FontDialogPositionMode } from '../FontDialogModel.js';
|
|
3
2
|
|
|
3
|
+
export type FontDialogSpacingMode = "normal" | "expanded" | "condensed";
|
|
4
|
+
export type FontDialogPositionMode = "normal" | "raised" | "lowered";
|
|
4
5
|
export declare const DEFAULT_COLOR = "#111827";
|
|
5
6
|
export declare const DEFAULT_HIGHLIGHT = "#fef08a";
|
|
6
7
|
export declare const DEFAULT_SHADING = "#fef3c7";
|