@progress/kendo-react-editor 5.5.0-dev.202206271315 → 5.5.0
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/cdn/js/kendo-react-editor.js +1 -1
- package/dist/es/Editor.d.ts +1 -2
- package/dist/es/EditorProps.d.ts +0 -1
- package/dist/es/dialogs/FindReplace.d.ts +2 -2
- package/dist/es/dialogs/FindReplace.js +4 -1
- package/dist/es/dialogs/insertImage.js +4 -2
- package/dist/es/main.d.ts +45 -40
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/tools/indent.js +6 -5
- package/dist/es/tools/insertTable/tool.js +2 -1
- package/dist/es/tools/outdent.js +4 -3
- package/dist/es/utils/index.d.ts +30 -31
- package/dist/es/utils/index.js +2 -2
- package/dist/es/utils/props-key.d.ts +1 -1
- package/dist/npm/Editor.d.ts +1 -2
- package/dist/npm/EditorProps.d.ts +0 -1
- package/dist/npm/dialogs/FindReplace.d.ts +2 -2
- package/dist/npm/dialogs/FindReplace.js +4 -1
- package/dist/npm/dialogs/insertImage.js +4 -2
- package/dist/npm/main.d.ts +45 -40
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/tools/indent.js +6 -5
- package/dist/npm/tools/insertTable/tool.js +2 -1
- package/dist/npm/tools/outdent.js +4 -3
- package/dist/npm/utils/index.d.ts +30 -31
- package/dist/npm/utils/index.js +2 -2
- package/dist/npm/utils/props-key.d.ts +1 -1
- package/dist/systemjs/kendo-react-editor.js +1 -1
- package/package.json +13 -13
package/dist/npm/main.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/// <reference types="prosemirror-model" />
|
|
2
1
|
import { Editor } from './Editor';
|
|
3
2
|
import { EditorProps, EditorMountEvent, EditorPasteEvent, EditorChangeEvent, EditorExecuteEvent, EditorFocusEvent, EditorBlurEvent } from './EditorProps';
|
|
4
3
|
import { EditorTools } from './tools/main';
|
|
5
4
|
import { EditorToolsSettings } from './config/toolsSettings';
|
|
6
5
|
import { EditorUtils } from './utils';
|
|
7
6
|
import { EditorDialogs } from './dialogs/main';
|
|
8
|
-
import { Selection, SelectionRange, TextSelection, NodeSelection, AllSelection, EditorState, Plugin, PluginKey, Transaction, Decoration, DecorationSet, EditorView, Node, ResolvedPos, NodeRange, Fragment, Slice, ReplaceError, Mark, Schema, NodeType, MarkType, ContentMatch, DOMParser, DOMSerializer, Transform, Step, StepResult, joinPoint, canJoin, canSplit, insertPoint, dropPoint, liftTarget, findWrapping, StepMap, MapResult, Mapping, AddMarkStep, RemoveMarkStep, ReplaceStep, ReplaceAroundStep, replaceStep,
|
|
7
|
+
import { Selection, SelectionRange, TextSelection, NodeSelection, AllSelection, EditorState, Plugin, PluginKey, Transaction, Decoration, DecorationSet, EditorView, Node, ResolvedPos, NodeRange, Fragment, Slice, ReplaceError, Mark, MarkSpec, Schema, NodeType, NodeSpec, MarkType, ContentMatch, DOMParser, DOMSerializer, Transform, Step, StepResult, joinPoint, canJoin, canSplit, insertPoint, dropPoint, liftTarget, findWrapping, StepMap, MapResult, Mapping, AddMarkStep, RemoveMarkStep, ReplaceStep, ReplaceAroundStep, replaceStep, wrapIn, setBlockType, toggleMark, autoJoin, chainCommands, history, undoDepth, redoDepth, InputRule, inputRules, wrappingInputRule, textblockTypeInputRule, keymap, keydownHandler, addListNodes, wrapInList, splitListItem, liftListItem, sinkListItem, dropCursor, gapCursor, tableEditing, fixTables, cellAround, isInTable, selectionCell, moveCellForward, inSameTable, findCell, colCount, nextCell, removeColSpan, addColSpan, columnIsHeader, tableNodes, tableNodeTypes, CellSelection, TableMap, columnResizing, updateColumnsOnResize, selectedRect, addColumn, addColumnBefore, addColumnAfter, deleteColumn, rowIsHeader, addRow, deleteRow, mergeCells, splitCell, splitCellWithType, setCellAttr, toggleHeader, toggleHeaderRow, toggleHeaderColumn, toggleHeaderCell, goToNextCell, deleteTable } from '@progress/kendo-editor-common';
|
|
9
8
|
export { Shortcuts } from './config/shortcuts';
|
|
10
9
|
export { PasteCleanupSettings } from './config/pasteSettings';
|
|
11
10
|
/**
|
|
@@ -68,52 +67,58 @@ export declare const ProseMirror: {
|
|
|
68
67
|
ReplaceStep: typeof ReplaceStep;
|
|
69
68
|
ReplaceAroundStep: typeof ReplaceAroundStep;
|
|
70
69
|
replaceStep: typeof replaceStep;
|
|
71
|
-
deleteSelection:
|
|
72
|
-
joinBackward:
|
|
73
|
-
selectNodeBackward:
|
|
74
|
-
joinForward:
|
|
75
|
-
selectNodeForward:
|
|
76
|
-
joinUp:
|
|
77
|
-
joinDown:
|
|
78
|
-
lift:
|
|
79
|
-
newlineInCode:
|
|
80
|
-
exitCode:
|
|
81
|
-
createParagraphNear:
|
|
82
|
-
liftEmptyBlock:
|
|
83
|
-
splitBlock:
|
|
84
|
-
splitBlockKeepMarks:
|
|
85
|
-
selectParentNode:
|
|
86
|
-
selectAll:
|
|
70
|
+
deleteSelection: import("prosemirror-state").Command;
|
|
71
|
+
joinBackward: import("prosemirror-state").Command;
|
|
72
|
+
selectNodeBackward: import("prosemirror-state").Command;
|
|
73
|
+
joinForward: import("prosemirror-state").Command;
|
|
74
|
+
selectNodeForward: import("prosemirror-state").Command;
|
|
75
|
+
joinUp: import("prosemirror-state").Command;
|
|
76
|
+
joinDown: import("prosemirror-state").Command;
|
|
77
|
+
lift: import("prosemirror-state").Command;
|
|
78
|
+
newlineInCode: import("prosemirror-state").Command;
|
|
79
|
+
exitCode: import("prosemirror-state").Command;
|
|
80
|
+
createParagraphNear: import("prosemirror-state").Command;
|
|
81
|
+
liftEmptyBlock: import("prosemirror-state").Command;
|
|
82
|
+
splitBlock: import("prosemirror-state").Command;
|
|
83
|
+
splitBlockKeepMarks: import("prosemirror-state").Command;
|
|
84
|
+
selectParentNode: import("prosemirror-state").Command;
|
|
85
|
+
selectAll: import("prosemirror-state").Command;
|
|
87
86
|
wrapIn: typeof wrapIn;
|
|
88
87
|
setBlockType: typeof setBlockType;
|
|
89
88
|
toggleMark: typeof toggleMark;
|
|
90
89
|
autoJoin: typeof autoJoin;
|
|
91
90
|
chainCommands: typeof chainCommands;
|
|
92
|
-
pcBaseKeymap:
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
pcBaseKeymap: {
|
|
92
|
+
[key: string]: import("prosemirror-state").Command;
|
|
93
|
+
};
|
|
94
|
+
macBaseKeymap: {
|
|
95
|
+
[key: string]: import("prosemirror-state").Command;
|
|
96
|
+
};
|
|
97
|
+
baseKeymap: {
|
|
98
|
+
[key: string]: import("prosemirror-state").Command;
|
|
99
|
+
};
|
|
95
100
|
history: typeof history;
|
|
96
|
-
undo:
|
|
97
|
-
redo:
|
|
101
|
+
undo: import("prosemirror-state").Command;
|
|
102
|
+
redo: import("prosemirror-state").Command;
|
|
98
103
|
undoDepth: typeof undoDepth;
|
|
99
104
|
redoDepth: typeof redoDepth;
|
|
100
105
|
InputRule: typeof InputRule;
|
|
101
106
|
inputRules: typeof inputRules;
|
|
102
|
-
undoInputRule:
|
|
103
|
-
emDash: InputRule
|
|
104
|
-
ellipsis: InputRule
|
|
105
|
-
openDoubleQuote: InputRule
|
|
106
|
-
closeDoubleQuote: InputRule
|
|
107
|
-
openSingleQuote: InputRule
|
|
108
|
-
closeSingleQuote: InputRule
|
|
109
|
-
smartQuotes: InputRule
|
|
107
|
+
undoInputRule: import("prosemirror-state").Command;
|
|
108
|
+
emDash: InputRule;
|
|
109
|
+
ellipsis: InputRule;
|
|
110
|
+
openDoubleQuote: InputRule;
|
|
111
|
+
closeDoubleQuote: InputRule;
|
|
112
|
+
openSingleQuote: InputRule;
|
|
113
|
+
closeSingleQuote: InputRule;
|
|
114
|
+
smartQuotes: readonly InputRule[];
|
|
110
115
|
wrappingInputRule: typeof wrappingInputRule;
|
|
111
116
|
textblockTypeInputRule: typeof textblockTypeInputRule;
|
|
112
117
|
keymap: typeof keymap;
|
|
113
118
|
keydownHandler: typeof keydownHandler;
|
|
114
|
-
orderedList:
|
|
115
|
-
bulletList:
|
|
116
|
-
listItem:
|
|
119
|
+
orderedList: NodeSpec;
|
|
120
|
+
bulletList: NodeSpec;
|
|
121
|
+
listItem: NodeSpec;
|
|
117
122
|
addListNodes: typeof addListNodes;
|
|
118
123
|
wrapInList: typeof wrapInList;
|
|
119
124
|
splitListItem: typeof splitListItem;
|
|
@@ -123,7 +128,7 @@ export declare const ProseMirror: {
|
|
|
123
128
|
gapCursor: typeof gapCursor;
|
|
124
129
|
tableEditing: typeof tableEditing;
|
|
125
130
|
fixTables: typeof fixTables;
|
|
126
|
-
fixTablesKey: PluginKey<any
|
|
131
|
+
fixTablesKey: PluginKey<any>;
|
|
127
132
|
cellAround: typeof cellAround;
|
|
128
133
|
isInTable: typeof isInTable;
|
|
129
134
|
selectionCell: typeof selectionCell;
|
|
@@ -139,9 +144,9 @@ export declare const ProseMirror: {
|
|
|
139
144
|
tableNodeTypes: typeof tableNodeTypes;
|
|
140
145
|
CellSelection: typeof CellSelection;
|
|
141
146
|
TableMap: typeof TableMap;
|
|
142
|
-
tableEditingKey: PluginKey<any
|
|
147
|
+
tableEditingKey: PluginKey<any>;
|
|
143
148
|
columnResizing: typeof columnResizing;
|
|
144
|
-
columnResizingPluginKey: PluginKey<any
|
|
149
|
+
columnResizingPluginKey: PluginKey<any>;
|
|
145
150
|
updateColumnsOnResize: typeof updateColumnsOnResize;
|
|
146
151
|
selectedRect: typeof selectedRect;
|
|
147
152
|
addColumn: typeof addColumn;
|
|
@@ -150,8 +155,8 @@ export declare const ProseMirror: {
|
|
|
150
155
|
deleteColumn: typeof deleteColumn;
|
|
151
156
|
rowIsHeader: typeof rowIsHeader;
|
|
152
157
|
addRow: typeof addRow;
|
|
153
|
-
addRowBefore: (state: EditorState
|
|
154
|
-
addRowAfter: (state: EditorState
|
|
158
|
+
addRowBefore: (state: EditorState, dispatch?: ((tr: Transaction) => void) | undefined) => boolean;
|
|
159
|
+
addRowAfter: (state: EditorState, dispatch?: ((tr: Transaction) => void) | undefined) => boolean;
|
|
155
160
|
deleteRow: typeof deleteRow;
|
|
156
161
|
mergeCells: typeof mergeCells;
|
|
157
162
|
splitCell: typeof splitCell;
|
|
@@ -164,4 +169,4 @@ export declare const ProseMirror: {
|
|
|
164
169
|
goToNextCell: typeof goToNextCell;
|
|
165
170
|
deleteTable: typeof deleteTable;
|
|
166
171
|
};
|
|
167
|
-
export { Editor, EditorProps, EditorMountEvent, EditorPasteEvent, EditorChangeEvent, EditorExecuteEvent, EditorFocusEvent, EditorBlurEvent, EditorTools, EditorToolsSettings, EditorUtils, EditorDialogs };
|
|
172
|
+
export { Editor, EditorProps, EditorMountEvent, EditorPasteEvent, EditorChangeEvent, EditorExecuteEvent, EditorFocusEvent, EditorBlurEvent, EditorTools, EditorToolsSettings, EditorUtils, EditorDialogs, NodeSpec, MarkSpec };
|
|
@@ -8,7 +8,7 @@ exports.packageMetadata = {
|
|
|
8
8
|
name: '@progress/kendo-react-editor',
|
|
9
9
|
productName: 'KendoReact',
|
|
10
10
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
11
|
-
publishDate:
|
|
11
|
+
publishDate: 1656667756,
|
|
12
12
|
version: '',
|
|
13
13
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
14
14
|
};
|
package/dist/npm/tools/indent.js
CHANGED
|
@@ -60,24 +60,25 @@ var IndentToolNS;
|
|
|
60
60
|
}
|
|
61
61
|
IndentTool.prototype.render = function () {
|
|
62
62
|
var _a = this.props, view = _a.view, render = _a.render, buttonProps = __rest(_a, ["view", "render"]);
|
|
63
|
+
var dir = buttonProps.dir;
|
|
63
64
|
var state = view && view.state;
|
|
64
65
|
var nodes = state && state.schema.nodes;
|
|
65
66
|
var listItem = nodes && nodes[settings.listsTypes.listItem];
|
|
66
67
|
var actions = settings.actions;
|
|
67
|
-
var canIndented = !!state &&
|
|
68
|
-
((0, kendo_editor_common_1.isIndented)(state, actions,
|
|
69
|
-
actions.some(function (a) { return nodes[a.node] && (0, kendo_editor_common_1.hasNode)(state, nodes[a.node]); })) &&
|
|
68
|
+
var canIndented = !!state && !!listItem &&
|
|
69
|
+
((0, kendo_editor_common_1.isIndented)(state, actions, dir) ||
|
|
70
|
+
actions.some(function (a) { return nodes && nodes[a.node] && (0, kendo_editor_common_1.hasNode)(state, nodes[a.node]); })) &&
|
|
70
71
|
!(0, kendo_editor_common_1.hasNode)(state, listItem);
|
|
71
72
|
var canListIndent = !!state && (0, kendo_editor_common_1.canIndentAsListItem)(state, listItem);
|
|
72
73
|
var canIndent = canIndented || canListIndent;
|
|
73
74
|
var localization = (0, kendo_react_intl_1.provideLocalizationService)(this);
|
|
74
75
|
var titleKey = settings.messages.title;
|
|
75
76
|
var button = (React.createElement(kendo_react_buttons_1.Button, __assign({ onClick: function () {
|
|
76
|
-
if (view && canListIndent) {
|
|
77
|
+
if (view && canListIndent && listItem) {
|
|
77
78
|
(0, kendo_editor_common_1.sinkListItem)(listItem)(view.state, view.dispatch);
|
|
78
79
|
}
|
|
79
80
|
else if (view && canIndented) {
|
|
80
|
-
(0, kendo_editor_common_1.indentBlocks)(actions, settings.commandName,
|
|
81
|
+
(0, kendo_editor_common_1.indentBlocks)(actions, settings.commandName, dir)(view.state, view.dispatch);
|
|
81
82
|
}
|
|
82
83
|
}, title: localization.toLanguageString(titleKey, messages_1.messages[titleKey]), disabled: !canIndent }, utils_1.onDownPreventDefault, settings.props, buttonProps)));
|
|
83
84
|
return render ? render.call(undefined, button, { view: view }) : button;
|
|
@@ -77,7 +77,8 @@ var InsertTableToolNS;
|
|
|
77
77
|
if (!view) {
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
var
|
|
80
|
+
var _a = view.state.schema.nodes, table = _a.table, table_row = _a.table_row, table_cell = _a.table_cell;
|
|
81
|
+
var newTable = (0, kendo_editor_common_1.createTable)({ table: table, table_row: table_row, table_cell: table_cell }, row, col);
|
|
81
82
|
if (newTable) {
|
|
82
83
|
(0, kendo_editor_common_1.insertNode)(newTable, true)(view.state, view.dispatch);
|
|
83
84
|
}
|
|
@@ -61,18 +61,19 @@ var OutdentToolNS;
|
|
|
61
61
|
OutdentTool.prototype.render = function () {
|
|
62
62
|
var _a = this.props, view = _a.view, render = _a.render, buttonProps = __rest(_a, ["view", "render"]);
|
|
63
63
|
var state = view && view.state;
|
|
64
|
-
var
|
|
64
|
+
var dir = buttonProps.dir;
|
|
65
|
+
var indented = !!state && (0, kendo_editor_common_1.isIndented)(state, settings.actions, dir);
|
|
65
66
|
var listItem = state && state.schema.nodes[settings.listsTypes.listItem];
|
|
66
67
|
var canListOutdent = !!state && (0, kendo_editor_common_1.canOutdentAsListItem)(state, { nodes: settings.actions, listsTypes: settings.listsTypes });
|
|
67
68
|
var canOutdent = indented || canListOutdent;
|
|
68
69
|
var localization = (0, kendo_react_intl_1.provideLocalizationService)(this);
|
|
69
70
|
var titleKey = settings.messages.title;
|
|
70
71
|
var button = (React.createElement(kendo_react_buttons_1.Button, __assign({ onClick: function () {
|
|
71
|
-
if (view && canListOutdent) {
|
|
72
|
+
if (view && canListOutdent && listItem) {
|
|
72
73
|
(0, kendo_editor_common_1.liftListItem)(listItem)(view.state, view.dispatch);
|
|
73
74
|
}
|
|
74
75
|
else if (view && indented) {
|
|
75
|
-
(0, kendo_editor_common_1.indentBlocks)(settings.actions, settings.commandName,
|
|
76
|
+
(0, kendo_editor_common_1.indentBlocks)(settings.actions, settings.commandName, dir)(view.state, view.dispatch);
|
|
76
77
|
}
|
|
77
78
|
}, title: localization.toLanguageString(titleKey, messages_1.messages[titleKey]), disabled: !canOutdent }, utils_1.onDownPreventDefault, settings.props, buttonProps)));
|
|
78
79
|
return render ? render.call(undefined, button, { view: view }) : button;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="prosemirror-model" />
|
|
2
1
|
import * as shortcuts from './../config/shortcuts';
|
|
3
2
|
import { ImageResizeOptions as ImageResizeOptionsCommon, Schema, NodeSpec, MarkSpec, Node, NodeType, Mark, MarkType, ParseOptions, EditorView, EditorState, Transaction, Plugin, PluginKey } from '@progress/kendo-editor-common';
|
|
4
3
|
import { EditorToolsSettings } from './../config/toolsSettings';
|
|
@@ -12,13 +11,13 @@ export declare namespace EditorUtils {
|
|
|
12
11
|
*
|
|
13
12
|
* @returns {boolean}—If alignment is applied to any of the elements, returns `true`.
|
|
14
13
|
*/
|
|
15
|
-
function alignBlocks(view: EditorView
|
|
14
|
+
function alignBlocks(view: EditorView, actions: EditorToolsSettings.AlignAction[], command?: EditorToolsSettings.Command): boolean;
|
|
16
15
|
/**
|
|
17
16
|
* Wraps the selection in a `span` element with inline styles.
|
|
18
17
|
*
|
|
19
18
|
* @returns {boolean}—If a style is applied to any of the elements, returns `true`.
|
|
20
19
|
*/
|
|
21
|
-
function applyInlineStyle(view: EditorView
|
|
20
|
+
function applyInlineStyle(view: EditorView, options: {
|
|
22
21
|
style: string;
|
|
23
22
|
value: string;
|
|
24
23
|
}, command?: EditorToolsSettings.Command): boolean;
|
|
@@ -36,7 +35,7 @@ export declare namespace EditorUtils {
|
|
|
36
35
|
*
|
|
37
36
|
* @returns {boolean}
|
|
38
37
|
*/
|
|
39
|
-
function canIndentList(state: EditorState
|
|
38
|
+
function canIndentList(state: EditorState, nodeType: NodeType): boolean;
|
|
40
39
|
/**
|
|
41
40
|
* Checks if a node can be inserted in the current selection.
|
|
42
41
|
*
|
|
@@ -44,13 +43,13 @@ export declare namespace EditorUtils {
|
|
|
44
43
|
* @param {NodeType} nodeType—The type of the node that will be inserted.
|
|
45
44
|
* @returns {boolean}—The node of this type can be inserted in the current selection.
|
|
46
45
|
*/
|
|
47
|
-
function canInsert(state: EditorState
|
|
46
|
+
function canInsert(state: EditorState, nodeType: NodeType): boolean;
|
|
48
47
|
/**
|
|
49
48
|
* Checks if any of the `list` elements in the selection can be outdented.
|
|
50
49
|
*
|
|
51
50
|
* @returns {boolean}
|
|
52
51
|
*/
|
|
53
|
-
function canOutdentList(state: EditorState
|
|
52
|
+
function canOutdentList(state: EditorState, listsTypes: {
|
|
54
53
|
listItem: string;
|
|
55
54
|
orderedList: string;
|
|
56
55
|
bulletList: string;
|
|
@@ -70,14 +69,14 @@ export declare namespace EditorUtils {
|
|
|
70
69
|
* @param {ParseOptions} parseOptions—The HTML parsing options. Defaults to `{ preserveWhitespace: 'full' }`.
|
|
71
70
|
* @returns {Node}—The `document` object of the Editor.
|
|
72
71
|
*/
|
|
73
|
-
function createDocument(schema: Schema<any, any>, html: string, parseOptions?: ParseOptions
|
|
72
|
+
function createDocument(schema: Schema<any, any>, html: string, parseOptions?: ParseOptions): Node;
|
|
74
73
|
/**
|
|
75
74
|
* Creates a table.
|
|
76
75
|
*
|
|
77
76
|
* @param {object} tableTypes—An object which contains `table`, `table_row`, and `table_cell` node types.
|
|
78
77
|
* @param {number} rows—The number of rows.
|
|
79
78
|
* @param {number} columns—The number of columns.
|
|
80
|
-
* @returns {Node
|
|
79
|
+
* @returns {Node}—The generated table.
|
|
81
80
|
*
|
|
82
81
|
* @example
|
|
83
82
|
* ```jsx-no-run
|
|
@@ -91,22 +90,22 @@ export declare namespace EditorUtils {
|
|
|
91
90
|
* ```
|
|
92
91
|
*/
|
|
93
92
|
function createTable(tableTypes: {
|
|
94
|
-
table: NodeType
|
|
95
|
-
table_row: NodeType
|
|
96
|
-
table_cell: NodeType
|
|
97
|
-
}, rows: number, columns: number): Node
|
|
93
|
+
table: NodeType;
|
|
94
|
+
table_row: NodeType;
|
|
95
|
+
table_cell: NodeType;
|
|
96
|
+
}, rows: number, columns: number): Node;
|
|
98
97
|
/**
|
|
99
98
|
* Formats the paragraph and heading nodes in the selection.
|
|
100
99
|
*
|
|
101
100
|
* @returns {boolean}—If an element is formatted, returns `true`.
|
|
102
101
|
*/
|
|
103
|
-
function formatBlockElements(view: EditorView
|
|
102
|
+
function formatBlockElements(view: EditorView, value: 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6', commandName?: EditorToolsSettings.Command): boolean;
|
|
104
103
|
/**
|
|
105
104
|
* Returns the paragraph and heading nodes in the selection.
|
|
106
105
|
*
|
|
107
106
|
* @returns {string[]}
|
|
108
107
|
*/
|
|
109
|
-
function getBlockFormats(state: EditorState
|
|
108
|
+
function getBlockFormats(state: EditorState): string[];
|
|
110
109
|
/**
|
|
111
110
|
* Gets the HTML from the `EditorState` object.
|
|
112
111
|
*
|
|
@@ -114,41 +113,41 @@ export declare namespace EditorUtils {
|
|
|
114
113
|
*—{ doc: value, schema: value.types.schema } where the `value` variable is the editor's value prop.
|
|
115
114
|
* @returns {string}—The HTML content.
|
|
116
115
|
*/
|
|
117
|
-
function getHtml(state: EditorState
|
|
116
|
+
function getHtml(state: EditorState | {
|
|
118
117
|
doc: Node;
|
|
119
118
|
schema: Schema;
|
|
120
119
|
}): string;
|
|
121
120
|
/**
|
|
122
121
|
* @returns {string[]}—An array of matched styles that are found in the selection.
|
|
123
122
|
*/
|
|
124
|
-
function getInlineStyles(state: EditorState
|
|
123
|
+
function getInlineStyles(state: EditorState, style: {
|
|
125
124
|
name: string;
|
|
126
125
|
value: RegExp;
|
|
127
126
|
}): string[];
|
|
128
127
|
/**
|
|
129
128
|
* Returns a mark of the specified type from the nodes in selection.
|
|
130
129
|
*
|
|
131
|
-
* @returns {Mark
|
|
130
|
+
* @returns {Mark}
|
|
132
131
|
*/
|
|
133
|
-
function getMark(state: EditorState
|
|
132
|
+
function getMark(state: EditorState, markType: MarkType): Mark | undefined;
|
|
134
133
|
/**
|
|
135
134
|
* Checks if according to the specified `InlineFormatOptions` a node in the selection is present.
|
|
136
135
|
*
|
|
137
136
|
* @returns {boolean}
|
|
138
137
|
*/
|
|
139
|
-
function hasMark(state: EditorState
|
|
138
|
+
function hasMark(state: EditorState, options: EditorToolsSettings.InlineFormatOptions): boolean;
|
|
140
139
|
/**
|
|
141
140
|
* Checks if the selection contains a specific type of node.
|
|
142
141
|
*
|
|
143
142
|
* @returns {boolean}
|
|
144
143
|
*/
|
|
145
|
-
function hasNode(state: EditorState
|
|
144
|
+
function hasNode(state: EditorState, nodeType: NodeType): boolean;
|
|
146
145
|
/**
|
|
147
146
|
* Indents the block elements in the selection.
|
|
148
147
|
*
|
|
149
148
|
* @returns {boolean}—If indentation is applied to any of the elements, returns `true`.
|
|
150
149
|
*/
|
|
151
|
-
function indentBlocks(view: EditorView
|
|
150
|
+
function indentBlocks(view: EditorView, actions: EditorToolsSettings.IndentAction[], command?: EditorToolsSettings.Command, dir?: string): boolean;
|
|
152
151
|
/**
|
|
153
152
|
* Adds new lines after block elements and hard breaks.
|
|
154
153
|
*
|
|
@@ -164,16 +163,16 @@ export declare namespace EditorUtils {
|
|
|
164
163
|
* @param {boolean} scrollIntoView—An optional parameter.
|
|
165
164
|
* Defines if the content element will be scrolled to the current selection.
|
|
166
165
|
*/
|
|
167
|
-
function insertNode(view: EditorView
|
|
168
|
-
state: EditorState
|
|
169
|
-
dispatch: (tr: Transaction
|
|
170
|
-
}, node: Node
|
|
166
|
+
function insertNode(view: EditorView | {
|
|
167
|
+
state: EditorState;
|
|
168
|
+
dispatch: (tr: Transaction) => void;
|
|
169
|
+
}, node: Node, scrollIntoView?: boolean | undefined): void;
|
|
171
170
|
/**
|
|
172
171
|
* Checks if any of the block elements in the selection is aligned.
|
|
173
172
|
*
|
|
174
173
|
* @returns {boolean}
|
|
175
174
|
*/
|
|
176
|
-
function isAligned(state: EditorState
|
|
175
|
+
function isAligned(state: EditorState, actions: EditorToolsSettings.AlignAction[]): boolean;
|
|
177
176
|
/**
|
|
178
177
|
* Checks if any of the block elements in the selection is indented.
|
|
179
178
|
*
|
|
@@ -297,22 +296,22 @@ export declare namespace EditorUtils {
|
|
|
297
296
|
* @param {ParseOptions} parseOptions—An optional parameter.
|
|
298
297
|
* Defines the options that will be used for parsing the HTML. Defaults to `{ preserveWhitespace: 'full' }`.
|
|
299
298
|
*/
|
|
300
|
-
function setHtml(view: EditorView
|
|
299
|
+
function setHtml(view: EditorView, html: string, command?: EditorToolsSettings.Command, parseOptions?: ParseOptions): void;
|
|
301
300
|
/**
|
|
302
301
|
* Toggles the inline element formatting according to the `InlineFormatOptions` and `markAttrs` settings.
|
|
303
302
|
*
|
|
304
303
|
* @returns {boolean}
|
|
305
304
|
*/
|
|
306
305
|
function toggleInlineFormat(view: {
|
|
307
|
-
state: EditorState
|
|
308
|
-
dispatch: (tr: Transaction
|
|
309
|
-
}, options: EditorToolsSettings.InlineFormatOptions, transaction?: Transaction
|
|
306
|
+
state: EditorState;
|
|
307
|
+
dispatch: (tr: Transaction) => void;
|
|
308
|
+
}, options: EditorToolsSettings.InlineFormatOptions, transaction?: Transaction, markAttrs?: any): boolean;
|
|
310
309
|
/**
|
|
311
310
|
* Toggles a list of the specified type.
|
|
312
311
|
*
|
|
313
312
|
* @returns {boolean}
|
|
314
313
|
*/
|
|
315
|
-
function toggleList(view: EditorView
|
|
314
|
+
function toggleList(view: EditorView, types: {
|
|
316
315
|
listType: string;
|
|
317
316
|
orderedList: string;
|
|
318
317
|
bulletList: string;
|
package/dist/npm/utils/index.js
CHANGED
|
@@ -105,7 +105,7 @@ var EditorUtils;
|
|
|
105
105
|
* @param {object} tableTypes—An object which contains `table`, `table_row`, and `table_cell` node types.
|
|
106
106
|
* @param {number} rows—The number of rows.
|
|
107
107
|
* @param {number} columns—The number of columns.
|
|
108
|
-
* @returns {Node
|
|
108
|
+
* @returns {Node}—The generated table.
|
|
109
109
|
*
|
|
110
110
|
* @example
|
|
111
111
|
* ```jsx-no-run
|
|
@@ -161,7 +161,7 @@ var EditorUtils;
|
|
|
161
161
|
/**
|
|
162
162
|
* Returns a mark of the specified type from the nodes in selection.
|
|
163
163
|
*
|
|
164
|
-
* @returns {Mark
|
|
164
|
+
* @returns {Mark}
|
|
165
165
|
*/
|
|
166
166
|
function getMark(state, markType) {
|
|
167
167
|
return (0, kendo_editor_common_1.getMark)(state, markType);
|