@progress/kendo-editor-common 1.12.2-develop.5 → 1.12.2-develop.7
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-editor-common.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/DOMSerializer.js +6 -7
- package/dist/es/align.js +3 -6
- package/dist/es/blockNode.js +11 -14
- package/dist/es/blockquote.js +2 -5
- package/dist/es/cleanFormatting.js +3 -6
- package/dist/es/config/align-rules.js +5 -7
- package/dist/es/config/commands.js +13 -9
- package/dist/es/config/constants.js +7 -9
- package/dist/es/config/indent-rules.js +3 -6
- package/dist/es/config/keymap.js +7 -10
- package/dist/es/config/list-settings.js +3 -5
- package/dist/es/config/schema.js +4 -6
- package/dist/es/find-replace.js +8 -10
- package/dist/es/flatten-spans.js +2 -5
- package/dist/es/image.js +2 -5
- package/dist/es/indent.js +11 -14
- package/dist/es/inline-style.js +10 -12
- package/dist/es/link.js +5 -8
- package/dist/es/listConvert.js +8 -9
- package/dist/es/lists.js +12 -15
- package/dist/es/main.js +34 -33
- package/dist/es/mark.js +16 -17
- package/dist/es/paste.js +10 -13
- package/dist/es/plugins/caret-color.js +5 -8
- package/dist/es/plugins/csp-fix.js +2 -5
- package/dist/es/plugins/highlight.js +3 -6
- package/dist/es/plugins/image-resize.js +8 -11
- package/dist/es/plugins/list-markers-styles.js +2 -5
- package/dist/es/plugins/placeholder.js +2 -5
- package/dist/es/plugins/resize-utils.js +2 -4
- package/dist/es/plugins/spaces-fix.js +1 -4
- package/dist/es/plugins/table-resize/column-resize.js +21 -24
- package/dist/es/plugins/table-resize/index.js +6 -9
- package/dist/es/plugins/table-resize/row-resize.js +23 -24
- package/dist/es/plugins/table-resize/table-resize.js +17 -20
- package/dist/es/plugins/table-resize/table-view.js +6 -9
- package/dist/es/plugins/table-resize/utils.js +10 -13
- package/dist/es/source.js +15 -18
- package/dist/es/table.js +15 -18
- package/dist/es/text.js +1 -3
- package/dist/es/types/active-marks.js +1 -0
- package/dist/es/types/command.js +1 -0
- package/dist/es/types/dispatchFn.js +1 -0
- package/dist/es/types/paste-cleanup-settings.js +1 -0
- package/dist/es/types/predicate.js +1 -0
- package/dist/es/utils.js +18 -21
- package/dist/npm/DOMSerializer.d.ts +35 -0
- package/dist/npm/DOMSerializer.js +10 -9
- package/dist/npm/align.d.ts +4 -7
- package/dist/npm/align.js +9 -10
- package/dist/npm/blockNode.d.ts +15 -12
- package/dist/npm/blockNode.js +28 -29
- package/dist/npm/blockquote.d.ts +2 -5
- package/dist/npm/blockquote.js +6 -7
- package/dist/npm/cleanFormatting.d.ts +3 -6
- package/dist/npm/cleanFormatting.js +7 -8
- package/dist/npm/config/align-rules.d.ts +6 -8
- package/dist/npm/config/align-rules.js +8 -13
- package/dist/npm/config/commands.d.ts +19 -11
- package/dist/npm/config/commands.js +16 -17
- package/dist/npm/config/constants.d.ts +7 -0
- package/dist/npm/config/constants.js +10 -17
- package/dist/npm/config/indent-rules.d.ts +4 -6
- package/dist/npm/config/indent-rules.js +8 -11
- package/dist/npm/config/keymap.d.ts +2 -5
- package/dist/npm/config/keymap.js +21 -22
- package/dist/npm/config/list-settings.d.ts +30 -0
- package/dist/npm/config/list-settings.js +10 -13
- package/dist/npm/config/schema.d.ts +2 -3
- package/dist/npm/config/schema.js +19 -20
- package/dist/npm/find-replace.d.ts +7 -10
- package/dist/npm/find-replace.js +20 -20
- package/dist/npm/flatten-spans.d.ts +1 -3
- package/dist/npm/flatten-spans.js +6 -7
- package/dist/npm/image.d.ts +3 -6
- package/dist/npm/image.js +5 -6
- package/dist/npm/indent.d.ts +9 -12
- package/dist/npm/indent.js +37 -38
- package/dist/npm/inline-style.d.ts +4 -7
- package/dist/npm/inline-style.js +28 -28
- package/dist/npm/link.d.ts +2 -4
- package/dist/npm/link.js +21 -22
- package/dist/npm/listConvert.d.ts +1 -3
- package/dist/npm/listConvert.js +13 -12
- package/dist/npm/lists.d.ts +8 -8
- package/dist/npm/lists.js +26 -27
- package/dist/npm/main.d.ts +34 -35
- package/dist/npm/main.js +214 -391
- package/dist/npm/mark.d.ts +17 -12
- package/dist/npm/mark.js +30 -29
- package/dist/npm/paste.d.ts +8 -11
- package/dist/npm/paste.js +19 -20
- package/dist/npm/plugins/caret-color.d.ts +2 -5
- package/dist/npm/plugins/caret-color.js +15 -17
- package/dist/npm/plugins/csp-fix.d.ts +1 -4
- package/dist/npm/plugins/csp-fix.js +8 -9
- package/dist/npm/plugins/highlight.d.ts +4 -7
- package/dist/npm/plugins/highlight.js +11 -13
- package/dist/npm/plugins/image-resize.d.ts +5 -7
- package/dist/npm/plugins/image-resize.js +35 -37
- package/dist/npm/plugins/list-markers-styles.d.ts +2 -5
- package/dist/npm/plugins/list-markers-styles.js +14 -16
- package/dist/npm/plugins/placeholder.d.ts +1 -4
- package/dist/npm/plugins/placeholder.js +10 -12
- package/dist/npm/plugins/resize-utils.d.ts +35 -0
- package/dist/npm/plugins/resize-utils.js +5 -7
- package/dist/npm/plugins/spaces-fix.d.ts +1 -4
- package/dist/npm/plugins/spaces-fix.js +9 -10
- package/dist/npm/plugins/table-resize/column-resize.d.ts +2 -0
- package/dist/npm/plugins/table-resize/column-resize.js +44 -46
- package/dist/npm/plugins/table-resize/index.d.ts +2 -5
- package/dist/npm/plugins/table-resize/index.js +13 -14
- package/dist/npm/plugins/table-resize/row-resize.d.ts +2 -0
- package/dist/npm/plugins/table-resize/row-resize.js +40 -40
- package/dist/npm/plugins/table-resize/table-resize.d.ts +18 -0
- package/dist/npm/plugins/table-resize/table-resize.js +51 -52
- package/dist/npm/plugins/table-resize/table-view.d.ts +28 -0
- package/dist/npm/plugins/table-resize/table-view.js +23 -24
- package/dist/npm/plugins/table-resize/utils.d.ts +17 -7
- package/dist/npm/plugins/table-resize/utils.js +24 -28
- package/dist/npm/source.d.ts +13 -16
- package/dist/npm/source.js +35 -36
- package/dist/npm/table.d.ts +9 -10
- package/dist/npm/table.js +33 -49
- package/dist/npm/text.d.ts +3 -6
- package/dist/npm/text.js +3 -3
- package/dist/npm/types/active-marks.d.ts +1 -4
- package/dist/npm/types/active-marks.js +2 -0
- package/dist/npm/types/command.d.ts +2 -5
- package/dist/npm/types/command.js +2 -0
- package/dist/npm/types/dispatchFn.d.ts +1 -4
- package/dist/npm/types/dispatchFn.js +2 -0
- package/dist/npm/types/paste-cleanup-settings.d.ts +1 -3
- package/dist/npm/types/paste-cleanup-settings.js +2 -0
- package/dist/npm/types/predicate.d.ts +1 -0
- package/dist/npm/types/predicate.js +2 -0
- package/dist/npm/utils.d.ts +33 -14
- package/dist/npm/utils.js +38 -39
- package/package.json +4 -51
- package/dist/es2015/DOMSerializer.js +0 -184
- package/dist/es2015/align.js +0 -43
- package/dist/es2015/blockNode.js +0 -180
- package/dist/es2015/blockquote.js +0 -26
- package/dist/es2015/cleanFormatting.js +0 -20
- package/dist/es2015/config/align-rules.js +0 -30
- package/dist/es2015/config/commands.js +0 -50
- package/dist/es2015/config/constants.js +0 -9
- package/dist/es2015/config/indent-rules.js +0 -42
- package/dist/es2015/config/keymap.js +0 -51
- package/dist/es2015/config/list-settings.js +0 -21
- package/dist/es2015/config/schema.js +0 -314
- package/dist/es2015/find-replace.js +0 -122
- package/dist/es2015/flatten-spans.js +0 -112
- package/dist/es2015/image.js +0 -10
- package/dist/es2015/indent.js +0 -105
- package/dist/es2015/inline-style.js +0 -177
- package/dist/es2015/link.js +0 -105
- package/dist/es2015/listConvert.js +0 -184
- package/dist/es2015/lists.js +0 -266
- package/dist/es2015/main.js +0 -44
- package/dist/es2015/mark.js +0 -239
- package/dist/es2015/node_modules/tslib/tslib.es6.js +0 -35
- package/dist/es2015/paste.js +0 -162
- package/dist/es2015/plugins/caret-color.js +0 -34
- package/dist/es2015/plugins/csp-fix.js +0 -51
- package/dist/es2015/plugins/highlight.js +0 -23
- package/dist/es2015/plugins/image-resize.js +0 -225
- package/dist/es2015/plugins/list-markers-styles.js +0 -104
- package/dist/es2015/plugins/placeholder.js +0 -27
- package/dist/es2015/plugins/resize-utils.js +0 -13
- package/dist/es2015/plugins/spaces-fix.js +0 -46
- package/dist/es2015/plugins/table-resize/column-resize.js +0 -267
- package/dist/es2015/plugins/table-resize/index.js +0 -12
- package/dist/es2015/plugins/table-resize/row-resize.js +0 -234
- package/dist/es2015/plugins/table-resize/table-resize.js +0 -278
- package/dist/es2015/plugins/table-resize/table-view.js +0 -128
- package/dist/es2015/plugins/table-resize/utils.js +0 -93
- package/dist/es2015/source.js +0 -251
- package/dist/es2015/table.js +0 -132
- package/dist/es2015/text.js +0 -5
- package/dist/es2015/utils.js +0 -289
package/dist/npm/blockquote.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.liftBlockquote = exports.blockquote = void 0;
|
|
4
|
+
const prosemirror_commands_1 = require("prosemirror-commands");
|
|
5
5
|
const blockquote = (state, dispatch) => {
|
|
6
|
-
return
|
|
6
|
+
return (0, prosemirror_commands_1.wrapIn)(state.schema.nodes.blockquote)(state, dispatch);
|
|
7
7
|
};
|
|
8
|
+
exports.blockquote = blockquote;
|
|
8
9
|
const liftBlockquote = (state, dispatch) => {
|
|
9
10
|
const { $from, $to } = state.selection;
|
|
10
11
|
const nodeType = state.schema.nodes.blockquote;
|
|
@@ -24,6 +25,4 @@ const liftBlockquote = (state, dispatch) => {
|
|
|
24
25
|
}
|
|
25
26
|
return result;
|
|
26
27
|
};
|
|
27
|
-
|
|
28
|
-
exports.blockquote = blockquote;
|
|
29
28
|
exports.liftBlockquote = liftBlockquote;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MarkType, NodeType } from 'prosemirror-model';
|
|
2
2
|
import { EditorState, Transaction } from 'prosemirror-state';
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
4
|
* A command which removes the inline formatting, class and style attributes of paragraph and heading elements in the selection.
|
|
6
5
|
*/
|
|
7
|
-
declare const cleanFormatting: (options?: CleanFormattingOptions) => (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean;
|
|
6
|
+
export declare const cleanFormatting: (options?: CleanFormattingOptions) => (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean;
|
|
8
7
|
/**
|
|
9
8
|
* The cleanFormatting command options.
|
|
10
9
|
* Defaults to `{ blocksInSelection: true }`.
|
|
11
10
|
*/
|
|
12
|
-
interface CleanFormattingOptions {
|
|
11
|
+
export interface CleanFormattingOptions {
|
|
13
12
|
/**
|
|
14
13
|
* If set to `true`, the command will skip the text-block nodes which are partially selected.
|
|
15
14
|
* This option affects the text-block nodes themselves(paragraph, heading) and does not affects marks cleaning.
|
|
@@ -26,5 +25,3 @@ interface CleanFormattingOptions {
|
|
|
26
25
|
*/
|
|
27
26
|
exceptMarks?: Array<MarkType>;
|
|
28
27
|
}
|
|
29
|
-
|
|
30
|
-
export { type CleanFormattingOptions, cleanFormatting };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cleanFormatting = void 0;
|
|
4
|
+
const blockNode_1 = require("./blockNode");
|
|
5
|
+
const mark_1 = require("./mark");
|
|
6
6
|
/**
|
|
7
7
|
* A command which removes the inline formatting, class and style attributes of paragraph and heading elements in the selection.
|
|
8
8
|
*/
|
|
@@ -10,13 +10,12 @@ const cleanFormatting = (options = { blocksInSelection: true }) => (state, dispa
|
|
|
10
10
|
const tr = state.tr;
|
|
11
11
|
const { blocksInSelection, blockNodeType, exceptMarks } = options;
|
|
12
12
|
const except = (exceptMarks || [state.schema.marks.link]).filter(Boolean);
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
(0, mark_1.cleanMarks)(tr, { except });
|
|
14
|
+
(0, blockNode_1.cleanTextBlockFormatting)(tr, { blocksInSelection, blockNodeType });
|
|
15
15
|
const result = tr.docChanged;
|
|
16
16
|
if (result && dispatch) {
|
|
17
17
|
dispatch(tr);
|
|
18
18
|
}
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
|
-
|
|
22
21
|
exports.cleanFormatting = cleanFormatting;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
interface AlignRule {
|
|
1
|
+
export interface AlignRule {
|
|
2
2
|
node: string;
|
|
3
3
|
style: Array<{
|
|
4
4
|
name: string;
|
|
5
5
|
value: string;
|
|
6
6
|
}>;
|
|
7
7
|
}
|
|
8
|
-
declare const alignLeftRules: Array<AlignRule>;
|
|
9
|
-
declare const alignRightRules: Array<AlignRule>;
|
|
10
|
-
declare const alignCenterRules: Array<AlignRule>;
|
|
11
|
-
declare const alignJustifyRules: Array<AlignRule>;
|
|
12
|
-
declare const alignRemoveRules: Array<AlignRule>;
|
|
13
|
-
|
|
14
|
-
export { type AlignRule, alignCenterRules, alignJustifyRules, alignLeftRules, alignRemoveRules, alignRightRules };
|
|
8
|
+
export declare const alignLeftRules: Array<AlignRule>;
|
|
9
|
+
export declare const alignRightRules: Array<AlignRule>;
|
|
10
|
+
export declare const alignCenterRules: Array<AlignRule>;
|
|
11
|
+
export declare const alignJustifyRules: Array<AlignRule>;
|
|
12
|
+
export declare const alignRemoveRules: Array<AlignRule>;
|
|
@@ -1,36 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.alignRemoveRules = exports.alignJustifyRules = exports.alignCenterRules = exports.alignRightRules = exports.alignLeftRules = void 0;
|
|
3
4
|
const style = (name, value) => {
|
|
4
5
|
return { name: name, value: value };
|
|
5
6
|
};
|
|
6
|
-
|
|
7
|
+
exports.alignLeftRules = [
|
|
7
8
|
{ node: 'paragraph', style: [style('text-align', 'left')] },
|
|
8
9
|
{ node: 'heading', style: [style('text-align', 'left')] },
|
|
9
10
|
{ node: 'table_caption_external', style: [style('text-align', 'left')] }
|
|
10
11
|
];
|
|
11
|
-
|
|
12
|
+
exports.alignRightRules = [
|
|
12
13
|
{ node: 'paragraph', style: [style('text-align', 'right')] },
|
|
13
14
|
{ node: 'heading', style: [style('text-align', 'right')] },
|
|
14
15
|
{ node: 'table_caption_external', style: [style('text-align', 'right')] }
|
|
15
16
|
];
|
|
16
|
-
|
|
17
|
+
exports.alignCenterRules = [
|
|
17
18
|
{ node: 'paragraph', style: [style('text-align', 'center')] },
|
|
18
19
|
{ node: 'heading', style: [style('text-align', 'center')] },
|
|
19
20
|
{ node: 'table_caption_external', style: [style('text-align', 'center')] }
|
|
20
21
|
];
|
|
21
|
-
|
|
22
|
+
exports.alignJustifyRules = [
|
|
22
23
|
{ node: 'paragraph', style: [style('text-align', 'justify')] },
|
|
23
24
|
{ node: 'heading', style: [style('text-align', 'justify')] },
|
|
24
25
|
{ node: 'table_caption_external', style: [style('text-align', 'justify')] }
|
|
25
26
|
];
|
|
26
|
-
|
|
27
|
+
exports.alignRemoveRules = [
|
|
27
28
|
{ node: 'paragraph', style: [style('text-align', '')] },
|
|
28
29
|
{ node: 'heading', style: [style('text-align', '')] },
|
|
29
30
|
{ node: 'table_caption_external', style: [style('text-align', '')] }
|
|
30
31
|
];
|
|
31
|
-
|
|
32
|
-
exports.alignCenterRules = alignCenterRules;
|
|
33
|
-
exports.alignJustifyRules = alignJustifyRules;
|
|
34
|
-
exports.alignLeftRules = alignLeftRules;
|
|
35
|
-
exports.alignRemoveRules = alignRemoveRules;
|
|
36
|
-
exports.alignRightRules = alignRightRules;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The inline-formatting options.
|
|
3
3
|
*/
|
|
4
|
-
interface InlineFormatOptions {
|
|
4
|
+
export interface InlineFormatOptions {
|
|
5
5
|
/**
|
|
6
6
|
* The mark which will be applied or stripped.
|
|
7
7
|
*/
|
|
@@ -27,36 +27,44 @@ interface InlineFormatOptions {
|
|
|
27
27
|
/**
|
|
28
28
|
* The object of the Bold command.
|
|
29
29
|
*/
|
|
30
|
-
declare const bold: InlineFormatOptions;
|
|
30
|
+
export declare const bold: InlineFormatOptions;
|
|
31
31
|
/**
|
|
32
32
|
* The object of the Italic command.
|
|
33
33
|
*/
|
|
34
|
-
declare const italic: InlineFormatOptions;
|
|
34
|
+
export declare const italic: InlineFormatOptions;
|
|
35
35
|
/**
|
|
36
36
|
* The object of the Underline command.
|
|
37
37
|
*/
|
|
38
|
-
declare const underline: InlineFormatOptions;
|
|
38
|
+
export declare const underline: InlineFormatOptions;
|
|
39
39
|
/**
|
|
40
40
|
* The object of the Strikethrough command.
|
|
41
41
|
*/
|
|
42
|
-
declare const strikethrough: InlineFormatOptions;
|
|
42
|
+
export declare const strikethrough: InlineFormatOptions;
|
|
43
43
|
/**
|
|
44
44
|
* The object of the Subscript command.
|
|
45
45
|
*/
|
|
46
|
-
declare const subscript: InlineFormatOptions;
|
|
46
|
+
export declare const subscript: InlineFormatOptions;
|
|
47
47
|
/**
|
|
48
48
|
* The object of the Superscript command.
|
|
49
49
|
*/
|
|
50
|
-
declare const superscript: InlineFormatOptions;
|
|
50
|
+
export declare const superscript: InlineFormatOptions;
|
|
51
51
|
/**
|
|
52
52
|
* The settings of the Link tool or dialog.
|
|
53
53
|
*/
|
|
54
|
-
interface LinkOptions {
|
|
54
|
+
export interface LinkOptions {
|
|
55
55
|
mark: string;
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* The object of the Link tool settings.
|
|
59
59
|
*/
|
|
60
|
-
declare const link: LinkOptions;
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
export declare const link: LinkOptions;
|
|
61
|
+
/**
|
|
62
|
+
* The settings of the Unlink tool.
|
|
63
|
+
*/
|
|
64
|
+
export interface UnlinkOptions {
|
|
65
|
+
mark: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The object of the Unlink tool settings.
|
|
69
|
+
*/
|
|
70
|
+
export declare const unlink: UnlinkOptions;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unlink = exports.link = exports.superscript = exports.subscript = exports.strikethrough = exports.underline = exports.italic = exports.bold = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* The object of the Bold command.
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
+
exports.bold = {
|
|
7
8
|
mark: 'strong',
|
|
8
9
|
altMarks: ['b'],
|
|
9
10
|
altStyle: { name: 'font-weight', value: /^(bold(er)?|[5-9]\d{2,})$/ }
|
|
@@ -11,7 +12,7 @@ const bold = {
|
|
|
11
12
|
/**
|
|
12
13
|
* The object of the Italic command.
|
|
13
14
|
*/
|
|
14
|
-
|
|
15
|
+
exports.italic = {
|
|
15
16
|
mark: 'em',
|
|
16
17
|
altMarks: ['i'],
|
|
17
18
|
altStyle: { name: 'font-style', value: /^italic$/i }
|
|
@@ -19,40 +20,38 @@ const italic = {
|
|
|
19
20
|
/**
|
|
20
21
|
* The object of the Underline command.
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
|
+
exports.underline = {
|
|
23
24
|
mark: 'u',
|
|
24
25
|
altStyle: { name: 'text-decoration', value: /^underline$/i }
|
|
25
26
|
};
|
|
26
27
|
/**
|
|
27
28
|
* The object of the Strikethrough command.
|
|
28
29
|
*/
|
|
29
|
-
|
|
30
|
+
exports.strikethrough = {
|
|
30
31
|
mark: 'del',
|
|
31
32
|
altStyle: { name: 'text-decoration', value: /^line-through$/i }
|
|
32
33
|
};
|
|
33
34
|
/**
|
|
34
35
|
* The object of the Subscript command.
|
|
35
36
|
*/
|
|
36
|
-
|
|
37
|
+
exports.subscript = {
|
|
37
38
|
mark: 'sub'
|
|
38
39
|
};
|
|
39
40
|
/**
|
|
40
41
|
* The object of the Superscript command.
|
|
41
42
|
*/
|
|
42
|
-
|
|
43
|
+
exports.superscript = {
|
|
43
44
|
mark: 'sup'
|
|
44
45
|
};
|
|
45
46
|
/**
|
|
46
47
|
* The object of the Link tool settings.
|
|
47
48
|
*/
|
|
48
|
-
|
|
49
|
+
exports.link = {
|
|
50
|
+
mark: 'link'
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* The object of the Unlink tool settings.
|
|
54
|
+
*/
|
|
55
|
+
exports.unlink = {
|
|
49
56
|
mark: 'link'
|
|
50
57
|
};
|
|
51
|
-
|
|
52
|
-
exports.bold = bold;
|
|
53
|
-
exports.italic = italic;
|
|
54
|
-
exports.link = link;
|
|
55
|
-
exports.strikethrough = strikethrough;
|
|
56
|
-
exports.subscript = subscript;
|
|
57
|
-
exports.superscript = superscript;
|
|
58
|
-
exports.underline = underline;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const rowTypeAttr = "k-parent-node";
|
|
2
|
+
export declare const colgroupAttr = "k-colgroup-data";
|
|
3
|
+
export declare const resizableAttr = "k-resizable-node";
|
|
4
|
+
export declare const resizableWrap = "k-editor-resize-wrap-element";
|
|
5
|
+
export declare const resizeHandle = "k-editor-resize-handle";
|
|
6
|
+
export declare const dataResizeDirTable = "data-dir-table-resize";
|
|
7
|
+
export declare const dataResizeDirImage = "data-dir-image-resize";
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
exports.colgroupAttr = colgroupAttr;
|
|
12
|
-
exports.dataResizeDirImage = dataResizeDirImage;
|
|
13
|
-
exports.dataResizeDirTable = dataResizeDirTable;
|
|
14
|
-
exports.resizableAttr = resizableAttr;
|
|
15
|
-
exports.resizableWrap = resizableWrap;
|
|
16
|
-
exports.resizeHandle = resizeHandle;
|
|
17
|
-
exports.rowTypeAttr = rowTypeAttr;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dataResizeDirImage = exports.dataResizeDirTable = exports.resizeHandle = exports.resizableWrap = exports.resizableAttr = exports.colgroupAttr = exports.rowTypeAttr = void 0;
|
|
4
|
+
exports.rowTypeAttr = 'k-parent-node';
|
|
5
|
+
exports.colgroupAttr = 'k-colgroup-data';
|
|
6
|
+
exports.resizableAttr = 'k-resizable-node';
|
|
7
|
+
exports.resizableWrap = 'k-editor-resize-wrap-element';
|
|
8
|
+
exports.resizeHandle = 'k-editor-resize-handle';
|
|
9
|
+
exports.dataResizeDirTable = 'data-dir-table-resize';
|
|
10
|
+
exports.dataResizeDirImage = 'data-dir-image-resize';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The setting of the IndentAction tool.
|
|
3
3
|
*/
|
|
4
|
-
interface IndentRule {
|
|
4
|
+
export interface IndentRule {
|
|
5
5
|
node: string;
|
|
6
6
|
style: string;
|
|
7
7
|
rtlStyle: string;
|
|
@@ -11,7 +11,7 @@ interface IndentRule {
|
|
|
11
11
|
/**
|
|
12
12
|
* The settings of the tool which applies indentation.
|
|
13
13
|
*/
|
|
14
|
-
interface IndentationRules {
|
|
14
|
+
export interface IndentationRules {
|
|
15
15
|
nodes: Array<IndentRule>;
|
|
16
16
|
/**
|
|
17
17
|
* The list node types of the Indent and Outdent tools.
|
|
@@ -25,10 +25,8 @@ interface IndentationRules {
|
|
|
25
25
|
/**
|
|
26
26
|
* The object of the Indent tool settings.
|
|
27
27
|
*/
|
|
28
|
-
declare const indentRules: IndentationRules;
|
|
28
|
+
export declare const indentRules: IndentationRules;
|
|
29
29
|
/**
|
|
30
30
|
* The object of the Outdent tool settings.
|
|
31
31
|
*/
|
|
32
|
-
declare const outdentRules: IndentationRules;
|
|
33
|
-
|
|
34
|
-
export { type IndentRule, type IndentationRules, indentRules, outdentRules };
|
|
32
|
+
export declare const outdentRules: IndentationRules;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.outdentRules = exports.indentRules = void 0;
|
|
4
|
+
const list_settings_1 = require("./list-settings");
|
|
5
5
|
/**
|
|
6
6
|
* The object of the Indent tool settings.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
exports.indentRules = {
|
|
9
9
|
nodes: [{
|
|
10
10
|
node: 'paragraph',
|
|
11
11
|
style: 'margin-left',
|
|
@@ -19,12 +19,12 @@ const indentRules = {
|
|
|
19
19
|
step: 30,
|
|
20
20
|
unit: 'px'
|
|
21
21
|
}],
|
|
22
|
-
listsTypes: { ...
|
|
22
|
+
listsTypes: { ...list_settings_1.listsTypes }
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
25
|
* The object of the Outdent tool settings.
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
exports.outdentRules = {
|
|
28
28
|
nodes: [{
|
|
29
29
|
node: 'paragraph',
|
|
30
30
|
style: 'margin-left',
|
|
@@ -38,8 +38,5 @@ const outdentRules = {
|
|
|
38
38
|
step: -30,
|
|
39
39
|
unit: 'px'
|
|
40
40
|
}],
|
|
41
|
-
listsTypes: { ...
|
|
41
|
+
listsTypes: { ...list_settings_1.listsTypes }
|
|
42
42
|
};
|
|
43
|
-
|
|
44
|
-
exports.indentRules = indentRules;
|
|
45
|
-
exports.outdentRules = outdentRules;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { Schema } from 'prosemirror-model';
|
|
2
|
-
|
|
3
|
-
declare const
|
|
4
|
-
declare const buildListKeymap: (schema: Schema) => any;
|
|
5
|
-
|
|
6
|
-
export { buildKeymap, buildListKeymap };
|
|
2
|
+
export declare const buildKeymap: (schema: Schema, options?: any) => any;
|
|
3
|
+
export declare const buildListKeymap: (schema: Schema) => any;
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildListKeymap = exports.buildKeymap = void 0;
|
|
4
|
+
const prosemirror_commands_1 = require("prosemirror-commands");
|
|
5
|
+
const prosemirror_history_1 = require("prosemirror-history");
|
|
6
|
+
const prosemirror_inputrules_1 = require("prosemirror-inputrules");
|
|
7
|
+
const lists_1 = require("../lists");
|
|
8
|
+
const commands_1 = require("./commands");
|
|
9
|
+
const inline_style_1 = require("./../inline-style");
|
|
10
|
+
const utils_1 = require("../utils");
|
|
11
11
|
const mac = typeof navigator !== 'undefined' ? /Mac/.test(navigator.platform) : false;
|
|
12
12
|
// https://github.com/ProseMirror/prosemirror-example-setup/blob/master/src/keymap.js
|
|
13
13
|
const buildKeymap = (schema, options) => {
|
|
14
14
|
const keys = {};
|
|
15
15
|
const applyToWord = (options && options.applyToWord) || false;
|
|
16
|
-
keys['Mod-z'] =
|
|
17
|
-
keys['Shift-Mod-z'] =
|
|
16
|
+
keys['Mod-z'] = prosemirror_history_1.undo;
|
|
17
|
+
keys['Shift-Mod-z'] = prosemirror_history_1.redo;
|
|
18
18
|
// tslint:disable-next-line:no-string-literal
|
|
19
|
-
keys.Backspace =
|
|
19
|
+
keys.Backspace = (0, prosemirror_commands_1.chainCommands)(prosemirror_inputrules_1.undoInputRule, prosemirror_commands_1.deleteSelection, prosemirror_commands_1.joinBackward, prosemirror_commands_1.selectNodeBackward);
|
|
20
20
|
// tslint:disable-next-line:no-string-literal
|
|
21
|
-
keys.Enter =
|
|
21
|
+
keys.Enter = (0, prosemirror_commands_1.chainCommands)(prosemirror_commands_1.newlineInCode, prosemirror_commands_1.createParagraphNear, prosemirror_commands_1.liftEmptyBlock, prosemirror_commands_1.splitBlockKeepMarks);
|
|
22
22
|
if (!mac) {
|
|
23
|
-
keys['Mod-y'] =
|
|
23
|
+
keys['Mod-y'] = prosemirror_history_1.redo;
|
|
24
24
|
}
|
|
25
25
|
if (schema.marks.strong) {
|
|
26
|
-
keys['Mod-b'] =
|
|
26
|
+
keys['Mod-b'] = (0, utils_1.expandToWordWrap)(inline_style_1.toggleInlineFormat, { ...commands_1.bold, applyToWord });
|
|
27
27
|
}
|
|
28
28
|
if (schema.marks.em) {
|
|
29
|
-
keys['Mod-i'] =
|
|
29
|
+
keys['Mod-i'] = (0, utils_1.expandToWordWrap)(inline_style_1.toggleInlineFormat, { ...commands_1.italic, applyToWord });
|
|
30
30
|
}
|
|
31
31
|
if (schema.marks.u) {
|
|
32
|
-
keys['Mod-u'] =
|
|
32
|
+
keys['Mod-u'] = (0, utils_1.expandToWordWrap)(inline_style_1.toggleInlineFormat, { ...commands_1.underline, applyToWord });
|
|
33
33
|
}
|
|
34
34
|
if (schema.nodes.hard_break) {
|
|
35
35
|
const br = schema.nodes.hard_break;
|
|
36
|
-
const cmd =
|
|
36
|
+
const cmd = (0, prosemirror_commands_1.chainCommands)(prosemirror_commands_1.exitCode, (state, dispatch) => {
|
|
37
37
|
dispatch(state.tr.replaceSelectionWith(br.create()).scrollIntoView());
|
|
38
38
|
return true;
|
|
39
39
|
});
|
|
@@ -41,14 +41,13 @@ const buildKeymap = (schema, options) => {
|
|
|
41
41
|
}
|
|
42
42
|
return keys;
|
|
43
43
|
};
|
|
44
|
+
exports.buildKeymap = buildKeymap;
|
|
44
45
|
const buildListKeymap = (schema) => {
|
|
45
46
|
const keys = {};
|
|
46
47
|
if (schema.nodes.list_item) {
|
|
47
48
|
// tslint:disable-next-line:no-string-literal
|
|
48
|
-
keys.Enter =
|
|
49
|
+
keys.Enter = (0, lists_1.splitListItemKeepMarks)(schema.nodes.list_item);
|
|
49
50
|
}
|
|
50
51
|
return keys;
|
|
51
52
|
};
|
|
52
|
-
|
|
53
|
-
exports.buildKeymap = buildKeymap;
|
|
54
53
|
exports.buildListKeymap = buildListKeymap;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The settings of the tool which toggles lists.
|
|
3
|
+
*/
|
|
4
|
+
export interface ListSettings {
|
|
5
|
+
/**
|
|
6
|
+
* The list type of the tool.
|
|
7
|
+
*/
|
|
8
|
+
listType: string;
|
|
9
|
+
/**
|
|
10
|
+
* The types of the list nodes that are used by the tool.
|
|
11
|
+
*/
|
|
12
|
+
types: {
|
|
13
|
+
orderedList: string;
|
|
14
|
+
bulletList: string;
|
|
15
|
+
listItem: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare const listsTypes: {
|
|
19
|
+
orderedList: string;
|
|
20
|
+
bulletList: string;
|
|
21
|
+
listItem: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The object of the OrderedList tool settings.
|
|
25
|
+
*/
|
|
26
|
+
export declare const orderedList: ListSettings;
|
|
27
|
+
/**
|
|
28
|
+
* The object of the UnorderedList tool settings.
|
|
29
|
+
*/
|
|
30
|
+
export declare const bulletList: ListSettings;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bulletList = exports.orderedList = exports.listsTypes = void 0;
|
|
4
|
+
exports.listsTypes = {
|
|
4
5
|
orderedList: 'ordered_list',
|
|
5
6
|
bulletList: 'bullet_list',
|
|
6
7
|
listItem: 'list_item'
|
|
@@ -8,18 +9,14 @@ const listsTypes = {
|
|
|
8
9
|
/**
|
|
9
10
|
* The object of the OrderedList tool settings.
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
-
listType: listsTypes.orderedList,
|
|
13
|
-
types: { ...listsTypes }
|
|
12
|
+
exports.orderedList = {
|
|
13
|
+
listType: exports.listsTypes.orderedList,
|
|
14
|
+
types: { ...exports.listsTypes }
|
|
14
15
|
};
|
|
15
16
|
/**
|
|
16
17
|
* The object of the UnorderedList tool settings.
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
|
-
listType: listsTypes.bulletList,
|
|
20
|
-
types: { ...listsTypes }
|
|
19
|
+
exports.bulletList = {
|
|
20
|
+
listType: exports.listsTypes.bulletList,
|
|
21
|
+
types: { ...exports.listsTypes }
|
|
21
22
|
};
|
|
22
|
-
|
|
23
|
-
exports.bulletList = bulletList;
|
|
24
|
-
exports.listsTypes = listsTypes;
|
|
25
|
-
exports.orderedList = orderedList;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { NodeSpec, MarkSpec } from 'prosemirror-model';
|
|
2
|
-
|
|
3
2
|
declare const marks: {
|
|
4
3
|
[mark: string]: MarkSpec;
|
|
5
4
|
};
|
|
5
|
+
export declare const parseStrColgroup: (colgroup: string) => HTMLTableColElement;
|
|
6
6
|
declare const nodes: {
|
|
7
7
|
[node: string]: NodeSpec;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
export { marks, nodes };
|
|
9
|
+
export { nodes, marks };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.marks = exports.nodes = exports.parseStrColgroup = void 0;
|
|
4
|
+
const prosemirror_model_1 = require("prosemirror-model");
|
|
5
|
+
const prosemirror_tables_1 = require("prosemirror-tables");
|
|
6
|
+
const source_1 = require("../source");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
8
8
|
const hole = 0;
|
|
9
9
|
const blockquoteDOM = ['blockquote', hole], hrDOM = ['hr'], preDOM = ['pre', ['code', hole]];
|
|
10
10
|
const olDOM = ['ol', 0], ulDOM = ['ul', 0], liDOM = ['li', 0];
|
|
@@ -89,6 +89,7 @@ const marks = {
|
|
|
89
89
|
},
|
|
90
90
|
...tagMark('u')
|
|
91
91
|
};
|
|
92
|
+
exports.marks = marks;
|
|
92
93
|
const cellAttribute = (name) => {
|
|
93
94
|
return {
|
|
94
95
|
[name]: {
|
|
@@ -120,7 +121,7 @@ const colgroupNodes = {
|
|
|
120
121
|
},
|
|
121
122
|
text: { inline: true, group: 'inline' }
|
|
122
123
|
};
|
|
123
|
-
const colgroupSchema = new
|
|
124
|
+
const colgroupSchema = new prosemirror_model_1.Schema({ nodes: colgroupNodes, marks: {} });
|
|
124
125
|
// will be removed when we implement our own columnResizing
|
|
125
126
|
const shouldSkipColgroup = (node) => {
|
|
126
127
|
let shouldSkip = false;
|
|
@@ -135,27 +136,28 @@ const shouldSkipColgroup = (node) => {
|
|
|
135
136
|
return shouldSkip;
|
|
136
137
|
};
|
|
137
138
|
const parseStrColgroup = (colgroup) => {
|
|
138
|
-
const doc =
|
|
139
|
-
const fragment =
|
|
139
|
+
const doc = (0, source_1.domToPmDoc)((0, source_1.htmlToFragment)(colgroup), colgroupSchema, { preserveWhitespace: false });
|
|
140
|
+
const fragment = (0, source_1.pmDocToFragment)(doc);
|
|
140
141
|
const colgroupEl = fragment.firstChild;
|
|
141
142
|
return colgroupEl;
|
|
142
143
|
};
|
|
143
|
-
|
|
144
|
+
exports.parseStrColgroup = parseStrColgroup;
|
|
145
|
+
const tNodes = (0, prosemirror_tables_1.tableNodes)({ tableGroup: 'block', cellContent: 'block+', cellAttributes });
|
|
144
146
|
tNodes.table_row.attrs = {
|
|
145
147
|
...tNodes.table_row.attrs,
|
|
146
|
-
...defaultAttrs([
|
|
148
|
+
...defaultAttrs([constants_1.rowTypeAttr, 'style', 'class', 'id'])
|
|
147
149
|
};
|
|
148
150
|
tNodes.table_row.toDOM = node => ['tr', pmAttributes(node.attrs), 0];
|
|
149
151
|
tNodes.table_row.parseDOM = [{ tag: 'tr', getAttrs: domAttributes }];
|
|
150
152
|
tNodes.table.attrs = {
|
|
151
153
|
...tNodes.table.attrs,
|
|
152
|
-
...defaultAttrs(['style', 'class', 'id',
|
|
154
|
+
...defaultAttrs(['style', 'class', 'id', constants_1.colgroupAttr, constants_1.resizableAttr])
|
|
153
155
|
};
|
|
154
156
|
tNodes.table.toDOM = (node) => {
|
|
155
|
-
const tableAttrs = hasAttrs(node.attrs) ? pmAttributes(node.attrs, [
|
|
157
|
+
const tableAttrs = hasAttrs(node.attrs) ? pmAttributes(node.attrs, [constants_1.colgroupAttr, constants_1.resizableAttr]) : {};
|
|
156
158
|
let colgroup = null;
|
|
157
|
-
if (node.attrs[
|
|
158
|
-
const colgroupEl = parseStrColgroup(node.attrs[
|
|
159
|
+
if (node.attrs[constants_1.colgroupAttr] && !shouldSkipColgroup(node)) {
|
|
160
|
+
const colgroupEl = (0, exports.parseStrColgroup)(node.attrs[constants_1.colgroupAttr]);
|
|
159
161
|
if (colgroupEl) {
|
|
160
162
|
const cols = Array.from(colgroupEl.children).map((c) => ['col', domAttributes(c)]);
|
|
161
163
|
colgroup = [
|
|
@@ -173,7 +175,7 @@ tNodes.table.parseDOM = [{
|
|
|
173
175
|
const attrs = domAttributes(node);
|
|
174
176
|
const colgroup = Array.from(node.childNodes).find(c => c.nodeName === 'COLGROUP');
|
|
175
177
|
if (colgroup) {
|
|
176
|
-
attrs[
|
|
178
|
+
attrs[constants_1.colgroupAttr] = colgroup.outerHTML;
|
|
177
179
|
}
|
|
178
180
|
return attrs;
|
|
179
181
|
}
|
|
@@ -375,7 +377,4 @@ const nodes = {
|
|
|
375
377
|
},
|
|
376
378
|
...tNodes
|
|
377
379
|
};
|
|
378
|
-
|
|
379
|
-
exports.marks = marks;
|
|
380
380
|
exports.nodes = nodes;
|
|
381
|
-
exports.parseStrColgroup = parseStrColgroup;
|