@syncfusion/ej2-richtexteditor 21.2.10 → 22.1.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/.eslintrc.json +1 -0
  2. package/CHANGELOG.md +18 -0
  3. package/dist/ej2-richtexteditor.min.js +2 -2
  4. package/dist/ej2-richtexteditor.umd.min.js +2 -2
  5. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-richtexteditor.es2015.js +1558 -186
  7. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  8. package/dist/es6/ej2-richtexteditor.es5.js +1571 -189
  9. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  10. package/dist/global/ej2-richtexteditor.min.js +2 -2
  11. package/dist/global/ej2-richtexteditor.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/package.json +12 -12
  14. package/src/common/config.js +2 -2
  15. package/src/common/constant.d.ts +6 -0
  16. package/src/common/constant.js +6 -0
  17. package/src/common/interface.d.ts +2 -2
  18. package/src/common/util.js +2 -0
  19. package/src/editor-manager/base/editor-manager.d.ts +4 -3
  20. package/src/editor-manager/base/editor-manager.js +6 -1
  21. package/src/editor-manager/base/interface.d.ts +44 -9
  22. package/src/editor-manager/plugin/clearformat.d.ts +1 -0
  23. package/src/editor-manager/plugin/clearformat.js +1 -0
  24. package/src/editor-manager/plugin/dom-node.js +10 -6
  25. package/src/editor-manager/plugin/emoji-picker-action.d.ts +8 -0
  26. package/src/editor-manager/plugin/emoji-picker-action.js +62 -0
  27. package/src/editor-manager/plugin/format-painter-actions.d.ts +19 -36
  28. package/src/editor-manager/plugin/format-painter-actions.js +224 -81
  29. package/src/editor-manager/plugin/inserthtml.js +6 -1
  30. package/src/editor-manager/plugin/link.js +1 -1
  31. package/src/editor-manager/plugin/ms-word-clean-up.d.ts +3 -0
  32. package/src/editor-manager/plugin/ms-word-clean-up.js +40 -7
  33. package/src/editor-manager/plugin/selection-commands.d.ts +2 -1
  34. package/src/editor-manager/plugin/selection-commands.js +48 -23
  35. package/src/editor-manager/plugin/table.js +2 -2
  36. package/src/editor-manager/plugin/toolbar-status.js +6 -0
  37. package/src/editor-manager/plugin/undo.d.ts +1 -0
  38. package/src/editor-manager/plugin/undo.js +26 -5
  39. package/src/editor-manager/plugin.d.ts +1 -0
  40. package/src/editor-manager/plugin.js +1 -0
  41. package/src/global.js +1 -1
  42. package/src/rich-text-editor/actions/base-quick-toolbar.js +8 -1
  43. package/src/rich-text-editor/actions/base-toolbar.js +3 -2
  44. package/src/rich-text-editor/actions/emoji-picker.d.ts +48 -0
  45. package/src/rich-text-editor/actions/emoji-picker.js +778 -0
  46. package/src/rich-text-editor/actions/enter-key.js +2 -2
  47. package/src/rich-text-editor/actions/execute-command-callback.js +3 -1
  48. package/src/rich-text-editor/actions/file-manager.js +1 -0
  49. package/src/rich-text-editor/actions/format-painter.d.ts +2 -2
  50. package/src/rich-text-editor/actions/format-painter.js +11 -9
  51. package/src/rich-text-editor/actions/full-screen.js +6 -0
  52. package/src/rich-text-editor/actions/html-editor.js +11 -2
  53. package/src/rich-text-editor/actions/paste-clean-up.js +1 -0
  54. package/src/rich-text-editor/actions/resize.js +1 -1
  55. package/src/rich-text-editor/actions.d.ts +1 -0
  56. package/src/rich-text-editor/actions.js +1 -0
  57. package/src/rich-text-editor/base/constant.d.ts +10 -0
  58. package/src/rich-text-editor/base/constant.js +10 -0
  59. package/src/rich-text-editor/base/enum.d.ts +0 -4
  60. package/src/rich-text-editor/base/interface.d.ts +44 -6
  61. package/src/rich-text-editor/base/rich-text-editor-model.d.ts +13 -7
  62. package/src/rich-text-editor/base/rich-text-editor.d.ts +27 -7
  63. package/src/rich-text-editor/base/rich-text-editor.js +42 -12
  64. package/src/rich-text-editor/base/util.js +2 -2
  65. package/src/rich-text-editor/formatter/formatter.js +7 -5
  66. package/src/rich-text-editor/models/default-locale.js +14 -2
  67. package/src/rich-text-editor/models/items.d.ts +2 -1
  68. package/src/rich-text-editor/models/items.js +188 -1
  69. package/src/rich-text-editor/models/toolbar-settings-model.d.ts +212 -9
  70. package/src/rich-text-editor/models/toolbar-settings.d.ts +209 -11
  71. package/src/rich-text-editor/models/toolbar-settings.js +23 -6
  72. package/src/rich-text-editor/renderer/audio-module.js +3 -3
  73. package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -1
  74. package/src/rich-text-editor/renderer/image-module.js +11 -6
  75. package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +2 -0
  76. package/src/rich-text-editor/renderer/toolbar-renderer.js +7 -2
  77. package/src/rich-text-editor/renderer/video-module.js +14 -9
  78. package/styles/bootstrap-dark.css +299 -137
  79. package/styles/bootstrap.css +305 -140
  80. package/styles/bootstrap4.css +304 -133
  81. package/styles/bootstrap5-dark.css +310 -165
  82. package/styles/bootstrap5.css +310 -165
  83. package/styles/fabric-dark.css +297 -136
  84. package/styles/fabric.css +294 -133
  85. package/styles/fluent-dark.css +311 -170
  86. package/styles/fluent.css +311 -170
  87. package/styles/highcontrast-light.css +289 -128
  88. package/styles/highcontrast.css +296 -135
  89. package/styles/material-dark.css +295 -129
  90. package/styles/material.css +300 -134
  91. package/styles/material3-dark.css +3082 -0
  92. package/styles/material3-dark.scss +3 -0
  93. package/styles/material3.css +3138 -0
  94. package/styles/material3.scss +3 -0
  95. package/styles/rich-text-editor/_bootstrap-dark-definition.scss +54 -12
  96. package/styles/rich-text-editor/_bootstrap-definition.scss +57 -13
  97. package/styles/rich-text-editor/_bootstrap4-definition.scss +50 -7
  98. package/styles/rich-text-editor/_bootstrap5-definition.scss +56 -13
  99. package/styles/rich-text-editor/_fabric-dark-definition.scss +53 -10
  100. package/styles/rich-text-editor/_fabric-definition.scss +52 -9
  101. package/styles/rich-text-editor/_fluent-definition.scss +56 -15
  102. package/styles/rich-text-editor/_fusionnew-definition.scss +46 -4
  103. package/styles/rich-text-editor/_highcontrast-definition.scss +52 -9
  104. package/styles/rich-text-editor/_highcontrast-light-definition.scss +48 -5
  105. package/styles/rich-text-editor/_layout.scss +280 -68
  106. package/styles/rich-text-editor/_material-dark-definition.scss +48 -5
  107. package/styles/rich-text-editor/_material-definition.scss +50 -6
  108. package/styles/rich-text-editor/_material3-dark-definition.scss +1 -0
  109. package/styles/rich-text-editor/_material3-definition.scss +262 -0
  110. package/styles/rich-text-editor/_tailwind-definition.scss +63 -23
  111. package/styles/rich-text-editor/_theme.scss +103 -19
  112. package/styles/rich-text-editor/bootstrap-dark.css +299 -137
  113. package/styles/rich-text-editor/bootstrap.css +305 -140
  114. package/styles/rich-text-editor/bootstrap4.css +304 -133
  115. package/styles/rich-text-editor/bootstrap5-dark.css +310 -165
  116. package/styles/rich-text-editor/bootstrap5.css +310 -165
  117. package/styles/rich-text-editor/fabric-dark.css +297 -136
  118. package/styles/rich-text-editor/fabric.css +294 -133
  119. package/styles/rich-text-editor/fluent-dark.css +311 -170
  120. package/styles/rich-text-editor/fluent.css +311 -170
  121. package/styles/rich-text-editor/highcontrast-light.css +289 -128
  122. package/styles/rich-text-editor/highcontrast.css +296 -135
  123. package/styles/rich-text-editor/icons/_bootstrap-dark.scss +1 -1
  124. package/styles/rich-text-editor/icons/_bootstrap.scss +1 -1
  125. package/styles/rich-text-editor/icons/_bootstrap4.scss +1 -1
  126. package/styles/rich-text-editor/icons/_bootstrap5.scss +1 -1
  127. package/styles/rich-text-editor/icons/_fabric-dark.scss +1 -1
  128. package/styles/rich-text-editor/icons/_fabric.scss +1 -1
  129. package/styles/rich-text-editor/icons/_fluent.scss +1 -1
  130. package/styles/rich-text-editor/icons/_fusionnew.scss +1 -1
  131. package/styles/rich-text-editor/icons/_highcontrast-light.scss +1 -1
  132. package/styles/rich-text-editor/icons/_highcontrast.scss +1 -1
  133. package/styles/rich-text-editor/icons/_material-dark.scss +1 -1
  134. package/styles/rich-text-editor/icons/_material.scss +1 -1
  135. package/styles/rich-text-editor/icons/_material3-dark.scss +1 -0
  136. package/styles/rich-text-editor/icons/_material3.scss +1 -1
  137. package/styles/rich-text-editor/icons/_tailwind.scss +1 -1
  138. package/styles/rich-text-editor/material-dark.css +295 -129
  139. package/styles/rich-text-editor/material.css +300 -134
  140. package/styles/rich-text-editor/material3-dark.css +3082 -0
  141. package/styles/rich-text-editor/material3-dark.scss +5 -0
  142. package/styles/rich-text-editor/material3.css +3138 -0
  143. package/styles/rich-text-editor/material3.scss +5 -0
  144. package/styles/rich-text-editor/tailwind-dark.css +313 -157
  145. package/styles/rich-text-editor/tailwind.css +313 -157
  146. package/styles/tailwind-dark.css +313 -157
  147. package/styles/tailwind.css +313 -157
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 21.2.10
3
+ * version : 22.1.34
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-richtexteditor@*",
3
- "_id": "@syncfusion/ej2-richtexteditor@21.2.9",
3
+ "_id": "@syncfusion/ej2-richtexteditor@21.8.0",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-ISaeZrVvp/ekmd+F2kcZWR/vVih9rcyg7p1tFl6Cf+AAiESStZ6jlkxWmPbb/wnZr65rdjbbkQoND0vjejQtow==",
5
+ "_integrity": "sha512-KKugUmllHAC97zgvz2Bo3y8SB95H4fuecSj40S5i6oXXbNLdkOsYoPr66a38Di+/igSY9RgzG7R9BedERFsMQg==",
6
6
  "_location": "/@syncfusion/ej2-richtexteditor",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -26,8 +26,8 @@
26
26
  "/@syncfusion/ej2-react-richtexteditor",
27
27
  "/@syncfusion/ej2-vue-richtexteditor"
28
28
  ],
29
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-21.2.9.tgz",
30
- "_shasum": "836aa3ae47ee1d0a5d0cd6657c5432fdef49dedd",
29
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-21.8.0.tgz",
30
+ "_shasum": "11fb16ec178e4100183ec60405ad3ed21c7b38e9",
31
31
  "_spec": "@syncfusion/ej2-richtexteditor@*",
32
32
  "_where": "/jenkins/workspace/elease-automation_release_21.1.1/packages/included",
33
33
  "author": {
@@ -38,13 +38,13 @@
38
38
  },
39
39
  "bundleDependencies": false,
40
40
  "dependencies": {
41
- "@syncfusion/ej2-base": "~21.2.9",
42
- "@syncfusion/ej2-buttons": "~21.2.10",
43
- "@syncfusion/ej2-filemanager": "~21.2.5",
44
- "@syncfusion/ej2-inputs": "~21.2.9",
45
- "@syncfusion/ej2-navigations": "~21.2.9",
46
- "@syncfusion/ej2-popups": "~21.2.10",
47
- "@syncfusion/ej2-splitbuttons": "~21.2.5"
41
+ "@syncfusion/ej2-base": "~22.1.34",
42
+ "@syncfusion/ej2-buttons": "~22.1.34",
43
+ "@syncfusion/ej2-filemanager": "~22.1.34",
44
+ "@syncfusion/ej2-inputs": "~22.1.34",
45
+ "@syncfusion/ej2-navigations": "~22.1.34",
46
+ "@syncfusion/ej2-popups": "~22.1.34",
47
+ "@syncfusion/ej2-splitbuttons": "~22.1.34"
48
48
  },
49
49
  "deprecated": false,
50
50
  "description": "Essential JS 2 RichTextEditor component",
@@ -70,6 +70,6 @@
70
70
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
71
71
  },
72
72
  "typings": "index.d.ts",
73
- "version": "21.2.10",
73
+ "version": "22.1.34",
74
74
  "sideEffects": false
75
75
  }
@@ -73,8 +73,8 @@ export var htmlKeyConfig = {
73
73
  'enter': '13',
74
74
  'tab': 'tab',
75
75
  'delete': '46',
76
- 'format-copy': 'ctrl+shift+c',
77
- 'format-paste': 'ctrl+shift+v'
76
+ 'format-copy': 'alt+shift+c',
77
+ 'format-paste': 'alt+shift+v'
78
78
  };
79
79
  /**
80
80
  * Default markdown key config for adapter
@@ -85,3 +85,9 @@ export declare const SPACE_ACTION: string;
85
85
  * @hidden
86
86
  */
87
87
  export declare const FORMAT_PAINTER_ACTIONS: string;
88
+ /**
89
+ * Emoji picker event constant
90
+ *
91
+ * @hidden
92
+ */
93
+ export declare const EMOJI_PICKER_ACTIONS: string;
@@ -85,3 +85,9 @@ export var SPACE_ACTION = 'actionBegin';
85
85
  * @hidden
86
86
  */
87
87
  export var FORMAT_PAINTER_ACTIONS = 'format_painter_actions';
88
+ /**
89
+ * Emoji picker event constant
90
+ *
91
+ * @hidden
92
+ */
93
+ export var EMOJI_PICKER_ACTIONS = 'emoji_picker_actions';
@@ -74,6 +74,6 @@ export interface IToolbarStatus {
74
74
  lowercase?: boolean;
75
75
  createlink?: boolean;
76
76
  insertcode?: boolean;
77
- numberFormatList?: string;
78
- bulletFormatList?: string;
77
+ numberFormatList?: string | boolean;
78
+ bulletFormatList?: string | boolean;
79
79
  }
@@ -147,6 +147,8 @@ export function getDefaultHtmlTbStatus() {
147
147
  strikethrough: false,
148
148
  orderedlist: false,
149
149
  unorderedlist: false,
150
+ numberFormatList: false,
151
+ bulletFormatList: false,
150
152
  underline: false,
151
153
  alignments: null,
152
154
  backgroundcolor: null,
@@ -1,5 +1,5 @@
1
1
  import { Observer } from '@syncfusion/ej2-base';
2
- import { ICommandModel } from './interface';
2
+ import { ICommandModel, IFormatPainterEditor } from './interface';
3
3
  import { EditorExecCommand as ExecCommand } from './types';
4
4
  import { Lists } from './../plugin/lists';
5
5
  import { NodeSelection } from './../../selection/index';
@@ -19,7 +19,7 @@ import { UndoRedoManager } from './../plugin/undo';
19
19
  import { MsWordPaste } from '../plugin/ms-word-clean-up';
20
20
  import { InsertTextExec } from '../plugin/insert-text';
21
21
  import { NodeCutter } from '../plugin/nodecutter';
22
- import { FormatPainterActions } from '../plugin/format-painter-actions';
22
+ import { EmojiPickerAction } from '../plugin/emoji-picker-action';
23
23
  /**
24
24
  * EditorManager internal component
25
25
  *
@@ -47,8 +47,9 @@ export declare class EditorManager {
47
47
  clearObj: ClearFormatExec;
48
48
  undoRedoManager: UndoRedoManager;
49
49
  msWordPaste: MsWordPaste;
50
- formatPaintetrObj: FormatPainterActions;
50
+ formatPainterEditor: IFormatPainterEditor;
51
51
  editableElement: Element;
52
+ emojiPickerObj: EmojiPickerAction;
52
53
  /**
53
54
  * Constructor for creating the component
54
55
  *
@@ -20,6 +20,7 @@ import * as EVENTS from './../../common/constant';
20
20
  import { InsertTextExec } from '../plugin/insert-text';
21
21
  import { NodeCutter } from '../plugin/nodecutter';
22
22
  import { FormatPainterActions } from '../plugin/format-painter-actions';
23
+ import { EmojiPickerAction } from '../plugin/emoji-picker-action';
23
24
  /**
24
25
  * EditorManager internal component
25
26
  *
@@ -56,7 +57,8 @@ var EditorManager = /** @class */ (function () {
56
57
  this.tableObj = new TableCommand(this);
57
58
  this.undoRedoManager = new UndoRedoManager(this, options.options);
58
59
  this.msWordPaste = new MsWordPaste(this);
59
- this.formatPaintetrObj = new FormatPainterActions(this, options.formatPainterSettings);
60
+ this.formatPainterEditor = new FormatPainterActions(this, options.formatPainterSettings);
61
+ this.emojiPickerObj = new EmojiPickerAction(this);
60
62
  this.wireEvents();
61
63
  }
62
64
  EditorManager.prototype.wireEvents = function () {
@@ -204,6 +206,9 @@ var EditorManager = /** @class */ (function () {
204
206
  case 'formatpainter':
205
207
  this.observer.notify(EVENTS.FORMAT_PAINTER_ACTIONS, { item: exeValue, subCommand: value, event: event, callBack: callBack });
206
208
  break;
209
+ case 'emojipicker':
210
+ this.observer.notify(EVENTS.EMOJI_PICKER_ACTIONS, { item: exeValue, subCommand: value, value: text,
211
+ event: event, callBack: callBack });
207
212
  }
208
213
  };
209
214
  return EditorManager;
@@ -123,12 +123,13 @@ export interface IHtmlItemArgs {
123
123
  insertElement?: Element;
124
124
  captionClass?: string;
125
125
  action?: string;
126
+ formatPainterAction?: IFormatPainterActionValue;
126
127
  }
127
128
  /**
128
129
 
129
130
  */
130
131
  export interface IHtmlUndoRedoData {
131
- text?: string;
132
+ text?: DocumentFragment;
132
133
  range?: NodeSelection;
133
134
  }
134
135
  /**
@@ -176,18 +177,52 @@ export interface IFormatPainterSettings {
176
177
  * @hidden
177
178
  *
178
179
  */
179
- export interface IFormatPainterActionArgs {
180
- name: string;
181
- event: MouseEvent | KeyboardEvent;
182
- item: IFormatPainterAction;
183
- subCommand: string;
180
+ export interface IFormatPainterAction {
181
+ formatPainterAction: IFormatPainterActionValue;
184
182
  }
185
183
  /**
184
+ * @private
185
+ * @hidden
186
186
  *
187
-
187
+ */
188
+ export interface IFormatPainterEditor {
189
+ destroy: Function;
190
+ }
191
+ /**
192
+ * @private
193
+ * @hidden
194
+ */
195
+ export interface FormatPainterCollection {
196
+ attrs: Attr[];
197
+ className: string;
198
+ styles: CSSPropCollection[];
199
+ tagName: string;
200
+ }
201
+ /**
202
+ * @private
188
203
  * @hidden
189
204
  *
190
205
  */
191
- export interface IFormatPainterAction {
192
- formatPainterAction: IFormatPainterActionValue;
206
+ export interface FormatPainterValue {
207
+ element: HTMLElement;
208
+ lastChild: HTMLElement;
209
+ }
210
+ /**
211
+ * @private
212
+ * @hidden
213
+ */
214
+ export interface DeniedFormatsCollection {
215
+ tag: string;
216
+ styles: string[];
217
+ attributes: string[];
218
+ classes: string[];
219
+ }
220
+ /**
221
+ * @private
222
+ * @hidden
223
+ */
224
+ export interface CSSPropCollection {
225
+ property: string;
226
+ value: string;
227
+ priority: string;
193
228
  }
@@ -12,6 +12,7 @@ export declare class ClearFormat {
12
12
  * @param {Node} endNode - specifies the end node
13
13
  * @param {string} enterAction - specifies the enter key action
14
14
  * @param {string} selector - specifies the string value
15
+ * @param {string} command - specifies the command value
15
16
  * @returns {void}
16
17
  * @hidden
17
18
 
@@ -18,6 +18,7 @@ var ClearFormat = /** @class */ (function () {
18
18
  * @param {Node} endNode - specifies the end node
19
19
  * @param {string} enterAction - specifies the enter key action
20
20
  * @param {string} selector - specifies the string value
21
+ * @param {string} command - specifies the command value
21
22
  * @returns {void}
22
23
  * @hidden
23
24
 
@@ -1,5 +1,5 @@
1
1
  import * as CONSTANT from './../base/constant';
2
- import { append, detach, createElement, isNullOrUndefined } from '@syncfusion/ej2-base';
2
+ import { append, detach, createElement, isNullOrUndefined as isNOU } from '@syncfusion/ej2-base';
3
3
  import { NodeSelection } from './../../selection/index';
4
4
  import { selfClosingTags } from '../../common/config';
5
5
  import { getLastTextNode } from '../../common/util';
@@ -451,8 +451,12 @@ var DOMNode = /** @class */ (function () {
451
451
  var end = this.parent.querySelector('.' + markerClassName.endSelection);
452
452
  var startTextNode;
453
453
  var endTextNode;
454
- if (start.textContent === '' && isNullOrUndefined(end) && action !== 'tab') {
455
- if (start.childNodes.length === 1 && start.childNodes[0].nodeName === 'BR') {
454
+ if (start.textContent === '' && isNOU(end) && action !== 'tab') {
455
+ if (isNOU(action) && save.range.startContainer.nodeType === 1 &&
456
+ save.range.startContainer.querySelectorAll('audio,video,image').length === 0) {
457
+ start.innerHTML = '<br>';
458
+ }
459
+ else if (start.childNodes.length === 1 && start.childNodes[0].nodeName === 'BR') {
456
460
  start.innerHTML = '&#65279;&#65279;<br>';
457
461
  }
458
462
  else {
@@ -541,7 +545,7 @@ var DOMNode = /** @class */ (function () {
541
545
  markerStart.appendChild(start);
542
546
  }
543
547
  else {
544
- if (start.nodeType !== 3 && start.nodeName !== '#text') {
548
+ if (start.nodeType !== 3 && start.nodeName !== '#text' && start.nodeName !== 'BR') {
545
549
  var marker = this.marker(markerClassName.startSelection, '');
546
550
  append([this.parseHTMLFragment(marker)], start);
547
551
  }
@@ -595,7 +599,7 @@ var DOMNode = /** @class */ (function () {
595
599
  if (start.textContent === '') {
596
600
  var tdNode = start.querySelectorAll('td');
597
601
  start = tdNode[tdNode.length - 1];
598
- start = !isNullOrUndefined(start.childNodes[0]) ? start.childNodes[0] : start;
602
+ start = !isNOU(start.childNodes[0]) ? start.childNodes[0] : start;
599
603
  }
600
604
  else {
601
605
  var lastNode = start.lastChild;
@@ -755,7 +759,7 @@ var DOMNode = /** @class */ (function () {
755
759
  }
756
760
  parentNode = this.blockParentNode(endNode);
757
761
  if (parentNode && this.ignoreTableTag(parentNode) && collectionNodes.indexOf(parentNode) < 0 &&
758
- (!isNullOrUndefined(parentNode.previousElementSibling) && parentNode.previousElementSibling.tagName !== 'IMG')) {
762
+ (!isNOU(parentNode.previousElementSibling) && parentNode.previousElementSibling.tagName !== 'IMG')) {
759
763
  collectionNodes.push(parentNode);
760
764
  }
761
765
  }
@@ -0,0 +1,8 @@
1
+ import { EditorManager } from './../base/editor-manager';
2
+ export declare class EmojiPickerAction {
3
+ private parent;
4
+ constructor(parent?: EditorManager);
5
+ private addEventListener;
6
+ private emojiInsert;
7
+ private beforeApplyFormat;
8
+ }
@@ -0,0 +1,62 @@
1
+ import * as EVENTS from './../../common/constant';
2
+ import { InsertHtml } from './inserthtml';
3
+ var EmojiPickerAction = /** @class */ (function () {
4
+ function EmojiPickerAction(parent) {
5
+ this.parent = parent;
6
+ this.addEventListener();
7
+ }
8
+ EmojiPickerAction.prototype.addEventListener = function () {
9
+ this.parent.observer.on(EVENTS.EMOJI_PICKER_ACTIONS, this.emojiInsert, this);
10
+ };
11
+ EmojiPickerAction.prototype.emojiInsert = function (args) {
12
+ var node = document.createTextNode(args.value);
13
+ var selection = window.getSelection();
14
+ var range = selection.getRangeAt(0);
15
+ var cursorPos = range.startOffset;
16
+ for (var i = cursorPos - 1; i >= cursorPos - 15; i--) {
17
+ var prevChar_1 = selection.focusNode.textContent.substring(i - 1, i);
18
+ var isPrevSpace_1 = /:$/.test(prevChar_1);
19
+ if (isPrevSpace_1) {
20
+ this.beforeApplyFormat(true);
21
+ break;
22
+ }
23
+ }
24
+ var colon = /:$/.test(selection.focusNode.textContent.charAt(cursorPos - 1));
25
+ var prevChar = selection.focusNode.textContent.charAt(cursorPos - 2);
26
+ var isPrevSpace = /\s/.test(prevChar);
27
+ if (colon && (isPrevSpace || selection.focusOffset === 1)) {
28
+ this.beforeApplyFormat(true);
29
+ }
30
+ InsertHtml.Insert(this.parent.currentDocument, node, this.parent.editableElement);
31
+ if (args.callBack) {
32
+ args.callBack({
33
+ requestType: args.subCommand,
34
+ editorMode: 'HTML',
35
+ event: args.event,
36
+ range: this.parent.nodeSelection.getRange(this.parent.currentDocument),
37
+ elements: this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)
38
+ });
39
+ }
40
+ };
41
+ EmojiPickerAction.prototype.beforeApplyFormat = function (isBlockFormat) {
42
+ var range1 = this.parent.nodeSelection.getRange(this.parent.currentDocument);
43
+ var node = this.parent.nodeSelection.getNodeCollection(range1)[0];
44
+ var blockNewLine = !(node.parentElement.innerHTML.replace(/&nbsp;|<br>/g, '').trim() === ':' || node.textContent.trim().indexOf('/') === 0);
45
+ var startNode = node;
46
+ if (blockNewLine && isBlockFormat) {
47
+ while (startNode !== this.parent.editableElement) {
48
+ startNode = startNode.parentElement;
49
+ }
50
+ }
51
+ var startPoint = range1.startOffset;
52
+ while (this.parent.nodeSelection.getRange(document).toString().indexOf(':') === -1) {
53
+ this.parent.nodeSelection.setSelectionText(document, node, node, startPoint, range1.endOffset);
54
+ startPoint--;
55
+ }
56
+ var range2 = this.parent.nodeSelection.getRange(this.parent.currentDocument);
57
+ var node2 = this.parent.nodeCutter.GetSpliceNode(range2, node);
58
+ node2.parentNode.removeChild(node2);
59
+ };
60
+ return EmojiPickerAction;
61
+ }());
62
+ export { EmojiPickerAction };
@@ -1,6 +1,7 @@
1
- import { IFormatPainterSettings } from '../base';
1
+ import { IFormatPainterEditor, IFormatPainterSettings } from '../base';
2
2
  import { EditorManager } from '../base';
3
- export declare class FormatPainterActions {
3
+ export declare class FormatPainterActions implements IFormatPainterEditor {
4
+ private INVALID_TAGS;
4
5
  private parent;
5
6
  private copyCollection;
6
7
  private deniedFormatsCollection;
@@ -9,7 +10,19 @@ export declare class FormatPainterActions {
9
10
  private settings;
10
11
  constructor(parent?: EditorManager, options?: IFormatPainterSettings);
11
12
  private addEventListener;
13
+ private onPropertyChanged;
14
+ private removeEventListener;
15
+ /**
16
+ * Destroys the format painter.
17
+ *
18
+ * @function destroy
19
+ * @returns {void}
20
+ * @hidden
21
+
22
+ */
23
+ destroy(): void;
12
24
  private actionHandler;
25
+ private callBack;
13
26
  private generateElement;
14
27
  private pasteAction;
15
28
  private removeDeniedFormats;
@@ -23,41 +36,11 @@ export declare class FormatPainterActions {
23
36
  private findCurrentContext;
24
37
  private insertFormatNode;
25
38
  private insertBlockNode;
39
+ private insertNewList;
40
+ private insertSameList;
41
+ private isSameListType;
26
42
  private cleanEmptyLists;
27
43
  private setDeniedFormats;
44
+ private detachEmptyBlockNodes;
28
45
  private makeDeniedFormatsCollection;
29
46
  }
30
- /**
31
- * @hidden
32
- */
33
- export interface FormatPainterCollection {
34
- attrs: Attr[];
35
- className: string;
36
- styles: CSSPropCollection[];
37
- tagName: string;
38
- }
39
- /**
40
- * @hidden
41
- *
42
- */
43
- export interface FormatPainterValue {
44
- element: HTMLElement;
45
- lastChild: HTMLElement;
46
- }
47
- /**
48
- * @hidden
49
- */
50
- export interface DeniedFormatsCollection {
51
- tag: string;
52
- styles: string[];
53
- attributes: string[];
54
- classes: string[];
55
- }
56
- /**
57
- * @hidden
58
- */
59
- export interface CSSPropCollection {
60
- property: string;
61
- value: string;
62
- priority: string;
63
- }