@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.
Files changed (183) hide show
  1. package/dist/cdn/js/kendo-editor-common.js +1 -1
  2. package/dist/cdn/main.js +1 -1
  3. package/dist/es/DOMSerializer.js +6 -7
  4. package/dist/es/align.js +3 -6
  5. package/dist/es/blockNode.js +11 -14
  6. package/dist/es/blockquote.js +2 -5
  7. package/dist/es/cleanFormatting.js +3 -6
  8. package/dist/es/config/align-rules.js +5 -7
  9. package/dist/es/config/commands.js +13 -9
  10. package/dist/es/config/constants.js +7 -9
  11. package/dist/es/config/indent-rules.js +3 -6
  12. package/dist/es/config/keymap.js +7 -10
  13. package/dist/es/config/list-settings.js +3 -5
  14. package/dist/es/config/schema.js +4 -6
  15. package/dist/es/find-replace.js +8 -10
  16. package/dist/es/flatten-spans.js +2 -5
  17. package/dist/es/image.js +2 -5
  18. package/dist/es/indent.js +11 -14
  19. package/dist/es/inline-style.js +10 -12
  20. package/dist/es/link.js +5 -8
  21. package/dist/es/listConvert.js +8 -9
  22. package/dist/es/lists.js +12 -15
  23. package/dist/es/main.js +34 -33
  24. package/dist/es/mark.js +16 -17
  25. package/dist/es/paste.js +10 -13
  26. package/dist/es/plugins/caret-color.js +5 -8
  27. package/dist/es/plugins/csp-fix.js +2 -5
  28. package/dist/es/plugins/highlight.js +3 -6
  29. package/dist/es/plugins/image-resize.js +8 -11
  30. package/dist/es/plugins/list-markers-styles.js +2 -5
  31. package/dist/es/plugins/placeholder.js +2 -5
  32. package/dist/es/plugins/resize-utils.js +2 -4
  33. package/dist/es/plugins/spaces-fix.js +1 -4
  34. package/dist/es/plugins/table-resize/column-resize.js +21 -24
  35. package/dist/es/plugins/table-resize/index.js +6 -9
  36. package/dist/es/plugins/table-resize/row-resize.js +23 -24
  37. package/dist/es/plugins/table-resize/table-resize.js +17 -20
  38. package/dist/es/plugins/table-resize/table-view.js +6 -9
  39. package/dist/es/plugins/table-resize/utils.js +10 -13
  40. package/dist/es/source.js +15 -18
  41. package/dist/es/table.js +15 -18
  42. package/dist/es/text.js +1 -3
  43. package/dist/es/types/active-marks.js +1 -0
  44. package/dist/es/types/command.js +1 -0
  45. package/dist/es/types/dispatchFn.js +1 -0
  46. package/dist/es/types/paste-cleanup-settings.js +1 -0
  47. package/dist/es/types/predicate.js +1 -0
  48. package/dist/es/utils.js +18 -21
  49. package/dist/npm/DOMSerializer.d.ts +35 -0
  50. package/dist/npm/DOMSerializer.js +10 -9
  51. package/dist/npm/align.d.ts +4 -7
  52. package/dist/npm/align.js +9 -10
  53. package/dist/npm/blockNode.d.ts +15 -12
  54. package/dist/npm/blockNode.js +28 -29
  55. package/dist/npm/blockquote.d.ts +2 -5
  56. package/dist/npm/blockquote.js +6 -7
  57. package/dist/npm/cleanFormatting.d.ts +3 -6
  58. package/dist/npm/cleanFormatting.js +7 -8
  59. package/dist/npm/config/align-rules.d.ts +6 -8
  60. package/dist/npm/config/align-rules.js +8 -13
  61. package/dist/npm/config/commands.d.ts +19 -11
  62. package/dist/npm/config/commands.js +16 -17
  63. package/dist/npm/config/constants.d.ts +7 -0
  64. package/dist/npm/config/constants.js +10 -17
  65. package/dist/npm/config/indent-rules.d.ts +4 -6
  66. package/dist/npm/config/indent-rules.js +8 -11
  67. package/dist/npm/config/keymap.d.ts +2 -5
  68. package/dist/npm/config/keymap.js +21 -22
  69. package/dist/npm/config/list-settings.d.ts +30 -0
  70. package/dist/npm/config/list-settings.js +10 -13
  71. package/dist/npm/config/schema.d.ts +2 -3
  72. package/dist/npm/config/schema.js +19 -20
  73. package/dist/npm/find-replace.d.ts +7 -10
  74. package/dist/npm/find-replace.js +20 -20
  75. package/dist/npm/flatten-spans.d.ts +1 -3
  76. package/dist/npm/flatten-spans.js +6 -7
  77. package/dist/npm/image.d.ts +3 -6
  78. package/dist/npm/image.js +5 -6
  79. package/dist/npm/indent.d.ts +9 -12
  80. package/dist/npm/indent.js +37 -38
  81. package/dist/npm/inline-style.d.ts +4 -7
  82. package/dist/npm/inline-style.js +28 -28
  83. package/dist/npm/link.d.ts +2 -4
  84. package/dist/npm/link.js +21 -22
  85. package/dist/npm/listConvert.d.ts +1 -3
  86. package/dist/npm/listConvert.js +13 -12
  87. package/dist/npm/lists.d.ts +8 -8
  88. package/dist/npm/lists.js +26 -27
  89. package/dist/npm/main.d.ts +34 -35
  90. package/dist/npm/main.js +214 -391
  91. package/dist/npm/mark.d.ts +17 -12
  92. package/dist/npm/mark.js +30 -29
  93. package/dist/npm/paste.d.ts +8 -11
  94. package/dist/npm/paste.js +19 -20
  95. package/dist/npm/plugins/caret-color.d.ts +2 -5
  96. package/dist/npm/plugins/caret-color.js +15 -17
  97. package/dist/npm/plugins/csp-fix.d.ts +1 -4
  98. package/dist/npm/plugins/csp-fix.js +8 -9
  99. package/dist/npm/plugins/highlight.d.ts +4 -7
  100. package/dist/npm/plugins/highlight.js +11 -13
  101. package/dist/npm/plugins/image-resize.d.ts +5 -7
  102. package/dist/npm/plugins/image-resize.js +35 -37
  103. package/dist/npm/plugins/list-markers-styles.d.ts +2 -5
  104. package/dist/npm/plugins/list-markers-styles.js +14 -16
  105. package/dist/npm/plugins/placeholder.d.ts +1 -4
  106. package/dist/npm/plugins/placeholder.js +10 -12
  107. package/dist/npm/plugins/resize-utils.d.ts +35 -0
  108. package/dist/npm/plugins/resize-utils.js +5 -7
  109. package/dist/npm/plugins/spaces-fix.d.ts +1 -4
  110. package/dist/npm/plugins/spaces-fix.js +9 -10
  111. package/dist/npm/plugins/table-resize/column-resize.d.ts +2 -0
  112. package/dist/npm/plugins/table-resize/column-resize.js +44 -46
  113. package/dist/npm/plugins/table-resize/index.d.ts +2 -5
  114. package/dist/npm/plugins/table-resize/index.js +13 -14
  115. package/dist/npm/plugins/table-resize/row-resize.d.ts +2 -0
  116. package/dist/npm/plugins/table-resize/row-resize.js +40 -40
  117. package/dist/npm/plugins/table-resize/table-resize.d.ts +18 -0
  118. package/dist/npm/plugins/table-resize/table-resize.js +51 -52
  119. package/dist/npm/plugins/table-resize/table-view.d.ts +28 -0
  120. package/dist/npm/plugins/table-resize/table-view.js +23 -24
  121. package/dist/npm/plugins/table-resize/utils.d.ts +17 -7
  122. package/dist/npm/plugins/table-resize/utils.js +24 -28
  123. package/dist/npm/source.d.ts +13 -16
  124. package/dist/npm/source.js +35 -36
  125. package/dist/npm/table.d.ts +9 -10
  126. package/dist/npm/table.js +33 -49
  127. package/dist/npm/text.d.ts +3 -6
  128. package/dist/npm/text.js +3 -3
  129. package/dist/npm/types/active-marks.d.ts +1 -4
  130. package/dist/npm/types/active-marks.js +2 -0
  131. package/dist/npm/types/command.d.ts +2 -5
  132. package/dist/npm/types/command.js +2 -0
  133. package/dist/npm/types/dispatchFn.d.ts +1 -4
  134. package/dist/npm/types/dispatchFn.js +2 -0
  135. package/dist/npm/types/paste-cleanup-settings.d.ts +1 -3
  136. package/dist/npm/types/paste-cleanup-settings.js +2 -0
  137. package/dist/npm/types/predicate.d.ts +1 -0
  138. package/dist/npm/types/predicate.js +2 -0
  139. package/dist/npm/utils.d.ts +33 -14
  140. package/dist/npm/utils.js +38 -39
  141. package/package.json +4 -51
  142. package/dist/es2015/DOMSerializer.js +0 -184
  143. package/dist/es2015/align.js +0 -43
  144. package/dist/es2015/blockNode.js +0 -180
  145. package/dist/es2015/blockquote.js +0 -26
  146. package/dist/es2015/cleanFormatting.js +0 -20
  147. package/dist/es2015/config/align-rules.js +0 -30
  148. package/dist/es2015/config/commands.js +0 -50
  149. package/dist/es2015/config/constants.js +0 -9
  150. package/dist/es2015/config/indent-rules.js +0 -42
  151. package/dist/es2015/config/keymap.js +0 -51
  152. package/dist/es2015/config/list-settings.js +0 -21
  153. package/dist/es2015/config/schema.js +0 -314
  154. package/dist/es2015/find-replace.js +0 -122
  155. package/dist/es2015/flatten-spans.js +0 -112
  156. package/dist/es2015/image.js +0 -10
  157. package/dist/es2015/indent.js +0 -105
  158. package/dist/es2015/inline-style.js +0 -177
  159. package/dist/es2015/link.js +0 -105
  160. package/dist/es2015/listConvert.js +0 -184
  161. package/dist/es2015/lists.js +0 -266
  162. package/dist/es2015/main.js +0 -44
  163. package/dist/es2015/mark.js +0 -239
  164. package/dist/es2015/node_modules/tslib/tslib.es6.js +0 -35
  165. package/dist/es2015/paste.js +0 -162
  166. package/dist/es2015/plugins/caret-color.js +0 -34
  167. package/dist/es2015/plugins/csp-fix.js +0 -51
  168. package/dist/es2015/plugins/highlight.js +0 -23
  169. package/dist/es2015/plugins/image-resize.js +0 -225
  170. package/dist/es2015/plugins/list-markers-styles.js +0 -104
  171. package/dist/es2015/plugins/placeholder.js +0 -27
  172. package/dist/es2015/plugins/resize-utils.js +0 -13
  173. package/dist/es2015/plugins/spaces-fix.js +0 -46
  174. package/dist/es2015/plugins/table-resize/column-resize.js +0 -267
  175. package/dist/es2015/plugins/table-resize/index.js +0 -12
  176. package/dist/es2015/plugins/table-resize/row-resize.js +0 -234
  177. package/dist/es2015/plugins/table-resize/table-resize.js +0 -278
  178. package/dist/es2015/plugins/table-resize/table-view.js +0 -128
  179. package/dist/es2015/plugins/table-resize/utils.js +0 -93
  180. package/dist/es2015/source.js +0 -251
  181. package/dist/es2015/table.js +0 -132
  182. package/dist/es2015/text.js +0 -5
  183. package/dist/es2015/utils.js +0 -289
@@ -1,10 +1,11 @@
1
- 'use strict';
2
-
3
- var prosemirrorCommands = require('prosemirror-commands');
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 prosemirrorCommands.wrapIn(state.schema.nodes.blockquote)(state, dispatch);
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 { NodeType, MarkType } from 'prosemirror-model';
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
- 'use strict';
2
-
3
- var blockNode = require('./blockNode.js');
4
- var mark = require('./mark.js');
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
- mark.cleanMarks(tr, { except });
14
- blockNode.cleanTextBlockFormatting(tr, { blocksInSelection, blockNodeType });
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
- 'use strict';
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
- const alignLeftRules = [
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
- const alignRightRules = [
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
- const alignCenterRules = [
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
- const alignJustifyRules = [
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
- const alignRemoveRules = [
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
- export { type InlineFormatOptions, type LinkOptions, bold, italic, link, strikethrough, subscript, superscript, underline };
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
- 'use strict';
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
- const bold = {
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
- const italic = {
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
- const underline = {
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
- const strikethrough = {
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
- const subscript = {
37
+ exports.subscript = {
37
38
  mark: 'sub'
38
39
  };
39
40
  /**
40
41
  * The object of the Superscript command.
41
42
  */
42
- const superscript = {
43
+ exports.superscript = {
43
44
  mark: 'sup'
44
45
  };
45
46
  /**
46
47
  * The object of the Link tool settings.
47
48
  */
48
- const link = {
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
- 'use strict';
2
-
3
- const rowTypeAttr = 'k-parent-node';
4
- const colgroupAttr = 'k-colgroup-data';
5
- const resizableAttr = 'k-resizable-node';
6
- const resizableWrap = 'k-editor-resize-wrap-element';
7
- const resizeHandle = 'k-editor-resize-handle';
8
- const dataResizeDirTable = 'data-dir-table-resize';
9
- const dataResizeDirImage = 'data-dir-image-resize';
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
- 'use strict';
2
-
3
- var listSettings = require('./list-settings.js');
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
- const indentRules = {
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: { ...listSettings.listsTypes }
22
+ listsTypes: { ...list_settings_1.listsTypes }
23
23
  };
24
24
  /**
25
25
  * The object of the Outdent tool settings.
26
26
  */
27
- const outdentRules = {
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: { ...listSettings.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 buildKeymap: (schema: Schema, options?: any) => any;
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
- 'use strict';
2
-
3
- var prosemirrorCommands = require('prosemirror-commands');
4
- var prosemirrorHistory = require('prosemirror-history');
5
- var prosemirrorInputrules = require('prosemirror-inputrules');
6
- var lists = require('../lists.js');
7
- var commands = require('./commands.js');
8
- var inlineStyle = require('../inline-style.js');
9
- var utils = require('../utils.js');
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'] = prosemirrorHistory.undo;
17
- keys['Shift-Mod-z'] = prosemirrorHistory.redo;
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 = prosemirrorCommands.chainCommands(prosemirrorInputrules.undoInputRule, prosemirrorCommands.deleteSelection, prosemirrorCommands.joinBackward, prosemirrorCommands.selectNodeBackward);
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 = prosemirrorCommands.chainCommands(prosemirrorCommands.newlineInCode, prosemirrorCommands.createParagraphNear, prosemirrorCommands.liftEmptyBlock, prosemirrorCommands.splitBlockKeepMarks);
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'] = prosemirrorHistory.redo;
23
+ keys['Mod-y'] = prosemirror_history_1.redo;
24
24
  }
25
25
  if (schema.marks.strong) {
26
- keys['Mod-b'] = utils.expandToWordWrap(inlineStyle.toggleInlineFormat, { ...commands.bold, applyToWord });
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'] = utils.expandToWordWrap(inlineStyle.toggleInlineFormat, { ...commands.italic, applyToWord });
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'] = utils.expandToWordWrap(inlineStyle.toggleInlineFormat, { ...commands.underline, applyToWord });
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 = prosemirrorCommands.chainCommands(prosemirrorCommands.exitCode, (state, dispatch) => {
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 = lists.splitListItemKeepMarks(schema.nodes.list_item);
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
- 'use strict';
2
-
3
- const listsTypes = {
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
- const orderedList = {
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
- const bulletList = {
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
- 'use strict';
2
-
3
- var prosemirrorModel = require('prosemirror-model');
4
- var prosemirrorTables = require('prosemirror-tables');
5
- var source = require('../source.js');
6
- var constants = require('./constants.js');
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 prosemirrorModel.Schema({ nodes: colgroupNodes, marks: {} });
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 = source.domToPmDoc(source.htmlToFragment(colgroup), colgroupSchema, { preserveWhitespace: false });
139
- const fragment = source.pmDocToFragment(doc);
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
- const tNodes = prosemirrorTables.tableNodes({ tableGroup: 'block', cellContent: 'block+', cellAttributes });
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([constants.rowTypeAttr, 'style', 'class', 'id'])
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', constants.colgroupAttr, constants.resizableAttr])
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, [constants.colgroupAttr, constants.resizableAttr]) : {};
157
+ const tableAttrs = hasAttrs(node.attrs) ? pmAttributes(node.attrs, [constants_1.colgroupAttr, constants_1.resizableAttr]) : {};
156
158
  let colgroup = null;
157
- if (node.attrs[constants.colgroupAttr] && !shouldSkipColgroup(node)) {
158
- const colgroupEl = parseStrColgroup(node.attrs[constants.colgroupAttr]);
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[constants.colgroupAttr] = colgroup.outerHTML;
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;