@syncfusion/ej2-richtexteditor 20.1.59 → 20.2.36

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 (55) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/ej2-richtexteditor.umd.min.js +2 -2
  3. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-richtexteditor.es2015.js +429 -173
  5. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  6. package/dist/es6/ej2-richtexteditor.es5.js +417 -164
  7. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  8. package/dist/global/ej2-richtexteditor.min.js +2 -2
  9. package/dist/global/ej2-richtexteditor.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/helpers/e2e/index.js +8 -6
  12. package/helpers/e2e/rte-helper.js +80 -64
  13. package/package.json +12 -12
  14. package/src/common/util.js +7 -8
  15. package/src/editor-manager/plugin/inserthtml.d.ts +1 -0
  16. package/src/editor-manager/plugin/inserthtml.js +25 -3
  17. package/src/editor-manager/plugin/lists.js +12 -4
  18. package/src/editor-manager/plugin/ms-word-clean-up.js +1 -1
  19. package/src/markdown-parser/base/constant.d.ts +6 -0
  20. package/src/markdown-parser/base/constant.js +6 -0
  21. package/src/markdown-parser/base/markdown-parser.d.ts +2 -0
  22. package/src/markdown-parser/base/markdown-parser.js +6 -0
  23. package/src/markdown-parser/base/types.d.ts +1 -1
  24. package/src/markdown-parser/plugin/insert-text.d.ts +22 -0
  25. package/src/markdown-parser/plugin/insert-text.js +51 -0
  26. package/src/rich-text-editor/actions/color-picker.js +20 -4
  27. package/src/rich-text-editor/actions/resize.js +4 -3
  28. package/src/rich-text-editor/actions/toolbar.js +4 -2
  29. package/src/rich-text-editor/base/classes.d.ts +5 -0
  30. package/src/rich-text-editor/base/classes.js +5 -0
  31. package/src/rich-text-editor/base/constant.d.ts +40 -0
  32. package/src/rich-text-editor/base/constant.js +41 -1
  33. package/src/rich-text-editor/base/interface.d.ts +3 -0
  34. package/src/rich-text-editor/base/rich-text-editor.d.ts +6 -0
  35. package/src/rich-text-editor/base/rich-text-editor.js +27 -23
  36. package/src/rich-text-editor/base/util.js +3 -3
  37. package/src/rich-text-editor/formatter/formatter.js +1 -1
  38. package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -1
  39. package/src/rich-text-editor/renderer/image-module.js +42 -38
  40. package/src/rich-text-editor/renderer/link-module.js +16 -14
  41. package/src/rich-text-editor/renderer/markdown-renderer.js +2 -1
  42. package/src/rich-text-editor/renderer/table-module.d.ts +3 -0
  43. package/src/rich-text-editor/renderer/table-module.js +132 -55
  44. package/src/rich-text-editor/renderer/toolbar-renderer.js +11 -1
  45. package/src/rich-text-editor/renderer/view-source.js +1 -1
  46. package/styles/fluent-dark.css +1 -0
  47. package/styles/fluent.css +1 -0
  48. package/styles/rich-text-editor/_fluent-definition.scss +1 -0
  49. package/styles/rich-text-editor/_fusionnew-definition.scss +189 -0
  50. package/styles/rich-text-editor/_layout.scss +3 -0
  51. package/styles/rich-text-editor/_material3-definition.scss +189 -0
  52. package/styles/rich-text-editor/fluent-dark.css +1 -0
  53. package/styles/rich-text-editor/fluent.css +1 -0
  54. package/styles/rich-text-editor/icons/_fusionnew.scss +303 -0
  55. package/styles/rich-text-editor/icons/_material3.scss +303 -0
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 20.1.59
3
+ * version : 20.2.36
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
@@ -1,6 +1,8 @@
1
- "use strict";
2
- function __export(m) {
3
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
- }
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- __export(require("./rte-helper"));
1
+ define(["require", "exports", "./rte-helper"], function (require, exports, rte_helper_1) {
2
+ "use strict";
3
+ function __export(m) {
4
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
5
+ }
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ __export(rte_helper_1);
8
+ });
@@ -1,65 +1,81 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const e2e_1 = require("@syncfusion/ej2-base/helpers/e2e");
4
- class RichTextEditorHelper extends e2e_1.TestHelper {
5
- constructor(id, wrapperFn) {
6
- super();
7
- this.id = id;
8
- if (wrapperFn !== undefined) {
9
- this.wrapperFn = wrapperFn;
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ extendStatics(d, b);
10
+ function __() { this.constructor = d; }
11
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+ };
13
+ })();
14
+ define(["require", "exports", "@syncfusion/ej2-base/helpers/e2e"], function (require, exports, e2e_1) {
15
+ "use strict";
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ var RichTextEditorHelper = (function (_super) {
18
+ __extends(RichTextEditorHelper, _super);
19
+ function RichTextEditorHelper(id, wrapperFn) {
20
+ var _this = _super.call(this) || this;
21
+ _this.id = id;
22
+ if (wrapperFn !== undefined) {
23
+ _this.wrapperFn = wrapperFn;
24
+ }
25
+ return _this;
10
26
  }
11
- return this;
12
- }
13
- getElement() {
14
- return this.selector('#' + this.id);
15
- }
16
- getQuickToolbarElement() {
17
- return this.selector(".e-rte-quick-popup");
18
- }
19
- getToolbar() {
20
- return this.selector('#' + this.id + "_toolbar");
21
- }
22
- getCharCount() {
23
- return this.selector(".e-rte-character-count");
24
- }
25
- getTableDialog() {
26
- return this.selector('#' + this.id + "_tabledialog");
27
- }
28
- getImageDialog() {
29
- return this.selector('#' + this.id + "_defaultRTE_image");
30
- }
31
- getLinkDialog() {
32
- return this.selector('#' + this.id + "_rtelink");
33
- }
34
- getFontNamePopup() {
35
- return this.selector('#' + this.id + "_toolbar_FontName-popup");
36
- }
37
- getFontSizePopup() {
38
- return this.selector('#' + this.id + "_toolbar_FontSize-popup");
39
- }
40
- getFontColorPopup() {
41
- return this.selector('#' + this.id + "toolbar_FontColor-popup");
42
- }
43
- getBackgroundColorPopup() {
44
- return this.selector('#' + this.id + "toolbar_BackgroundColor-popup");
45
- }
46
- getFormatPopup() {
47
- return this.selector('#' + this.id + "toolbar_Formats-popup");
48
- }
49
- getAlignmentPopup() {
50
- return this.selector('#' + this.id + "toolbar_Alignments-popup");
51
- }
52
- getContent() {
53
- return this.selector(".e-rte-content");
54
- }
55
- getModel(property) {
56
- this.getModel(property);
57
- }
58
- setModel(property, value) {
59
- this.setModel(property, value);
60
- }
61
- invoke(fName, args) {
62
- this.invoke(fName, args);
63
- }
64
- }
65
- exports.RichTextEditorHelper = RichTextEditorHelper;
27
+ RichTextEditorHelper.prototype.getElement = function () {
28
+ return this.selector('#' + this.id);
29
+ };
30
+ RichTextEditorHelper.prototype.getQuickToolbarElement = function () {
31
+ return this.selector(".e-rte-quick-popup");
32
+ };
33
+ RichTextEditorHelper.prototype.getToolbar = function () {
34
+ return this.selector('#' + this.id + "_toolbar");
35
+ };
36
+ RichTextEditorHelper.prototype.getCharCount = function () {
37
+ return this.selector(".e-rte-character-count");
38
+ };
39
+ RichTextEditorHelper.prototype.getTableDialog = function () {
40
+ return this.selector('#' + this.id + "_tabledialog");
41
+ };
42
+ RichTextEditorHelper.prototype.getImageDialog = function () {
43
+ return this.selector('#' + this.id + "_defaultRTE_image");
44
+ };
45
+ RichTextEditorHelper.prototype.getLinkDialog = function () {
46
+ return this.selector('#' + this.id + "_rtelink");
47
+ };
48
+ RichTextEditorHelper.prototype.getFontNamePopup = function () {
49
+ return this.selector('#' + this.id + "_toolbar_FontName-popup");
50
+ };
51
+ RichTextEditorHelper.prototype.getFontSizePopup = function () {
52
+ return this.selector('#' + this.id + "_toolbar_FontSize-popup");
53
+ };
54
+ RichTextEditorHelper.prototype.getFontColorPopup = function () {
55
+ return this.selector('#' + this.id + "toolbar_FontColor-popup");
56
+ };
57
+ RichTextEditorHelper.prototype.getBackgroundColorPopup = function () {
58
+ return this.selector('#' + this.id + "toolbar_BackgroundColor-popup");
59
+ };
60
+ RichTextEditorHelper.prototype.getFormatPopup = function () {
61
+ return this.selector('#' + this.id + "toolbar_Formats-popup");
62
+ };
63
+ RichTextEditorHelper.prototype.getAlignmentPopup = function () {
64
+ return this.selector('#' + this.id + "toolbar_Alignments-popup");
65
+ };
66
+ RichTextEditorHelper.prototype.getContent = function () {
67
+ return this.selector(".e-rte-content");
68
+ };
69
+ RichTextEditorHelper.prototype.getModel = function (property) {
70
+ this.getModel(property);
71
+ };
72
+ RichTextEditorHelper.prototype.setModel = function (property, value) {
73
+ this.setModel(property, value);
74
+ };
75
+ RichTextEditorHelper.prototype.invoke = function (fName, args) {
76
+ this.invoke(fName, args);
77
+ };
78
+ return RichTextEditorHelper;
79
+ }(e2e_1.TestHelper));
80
+ exports.RichTextEditorHelper = RichTextEditorHelper;
81
+ });
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-richtexteditor@*",
3
- "_id": "@syncfusion/ej2-richtexteditor@20.1.58",
3
+ "_id": "@syncfusion/ej2-richtexteditor@19.10.1",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-qxEXYEGIaR0st9tRaWcOOpDp4IexL/rHxDx6XL/BnRjTE56hfHyn12zKW9i8FcCA2wFfDGRA8NUWcfqplZGtpg==",
5
+ "_integrity": "sha512-nRcvTjn8CJx6Jc+BsAL5C8zGWA/jIfS4UA+7uCE0CGxNvW74otn0hU1phz61DYDvsmWP/oVREomhY7do8ADZqg==",
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": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-20.1.58.tgz",
30
- "_shasum": "f3ebd6ff60aea3ee6079960ba07c001bd2bf12a4",
29
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-19.10.1.tgz",
30
+ "_shasum": "2368624db68c024864a84641dc195e8bb602dedd",
31
31
  "_spec": "@syncfusion/ej2-richtexteditor@*",
32
32
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
33
33
  "author": {
@@ -38,13 +38,13 @@
38
38
  },
39
39
  "bundleDependencies": false,
40
40
  "dependencies": {
41
- "@syncfusion/ej2-base": "~20.1.57",
42
- "@syncfusion/ej2-buttons": "~20.1.55",
43
- "@syncfusion/ej2-filemanager": "~20.1.59",
44
- "@syncfusion/ej2-inputs": "~20.1.59",
45
- "@syncfusion/ej2-navigations": "~20.1.58",
46
- "@syncfusion/ej2-popups": "~20.1.58",
47
- "@syncfusion/ej2-splitbuttons": "~20.1.57"
41
+ "@syncfusion/ej2-base": "~20.2.36",
42
+ "@syncfusion/ej2-buttons": "~20.2.36",
43
+ "@syncfusion/ej2-filemanager": "~20.2.36",
44
+ "@syncfusion/ej2-inputs": "~20.2.36",
45
+ "@syncfusion/ej2-navigations": "~20.2.36",
46
+ "@syncfusion/ej2-popups": "~20.2.36",
47
+ "@syncfusion/ej2-splitbuttons": "~20.2.36"
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": "20.1.59",
73
+ "version": "20.2.36",
74
74
  "sideEffects": false
75
75
  }
@@ -2,7 +2,6 @@
2
2
  * Defines common util methods used by Rich Text Editor.
3
3
  */
4
4
  import { isNullOrUndefined, Browser, createElement, detach } from '@syncfusion/ej2-base';
5
- import * as classes from '../rich-text-editor/base/classes';
6
5
  var inlineNode = ['a', 'abbr', 'acronym', 'audio', 'b', 'bdi', 'bdo', 'big', 'br', 'button',
7
6
  'canvas', 'cite', 'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'font', 'i', 'iframe', 'img', 'input',
8
7
  'ins', 'kbd', 'label', 'map', 'mark', 'meter', 'noscript', 'object', 'output', 'picture', 'progress',
@@ -95,18 +94,18 @@ export function updateTextNode(value) {
95
94
  tdElm[j].style.removeProperty('border');
96
95
  }
97
96
  }
98
- if (!tableElm[i].classList.contains(classes.CLS_TABLE)) {
99
- tableElm[i].classList.add(classes.CLS_TABLE);
97
+ if (!tableElm[i].classList.contains('e-rte-table')) {
98
+ tableElm[i].classList.add('e-rte-table');
100
99
  }
101
100
  }
102
101
  var imageElm = resultElm.querySelectorAll('img');
103
102
  for (var i = 0; i < imageElm.length; i++) {
104
- if (!imageElm[i].classList.contains(classes.CLS_RTE_IMAGE)) {
105
- imageElm[i].classList.add(classes.CLS_RTE_IMAGE);
103
+ if (!imageElm[i].classList.contains('e-rte-image')) {
104
+ imageElm[i].classList.add('e-rte-image');
106
105
  }
107
- if (!(imageElm[i].classList.contains(classes.CLS_IMGINLINE) ||
108
- imageElm[i].classList.contains(classes.CLS_IMGBREAK))) {
109
- imageElm[i].classList.add(classes.CLS_IMGINLINE);
106
+ if (!(imageElm[i].classList.contains('e-imginline') ||
107
+ imageElm[i].classList.contains('e-imgbreak'))) {
108
+ imageElm[i].classList.add('e-imginline');
110
109
  }
111
110
  }
112
111
  }
@@ -12,6 +12,7 @@ export declare class InsertHtml {
12
12
 
13
13
  */
14
14
  static inlineNode: string[];
15
+ static contentsDeleted: boolean;
15
16
  static Insert(docElement: Document, insertNode: Node | string, editNode?: Element, isExternal?: boolean): void;
16
17
  private static pasteInsertHTML;
17
18
  private static placeCursorEnd;
@@ -252,7 +252,9 @@ var InsertHtml = /** @class */ (function () {
252
252
  var isPreviousInlineElem = void 0;
253
253
  var paraElm = void 0;
254
254
  var previousParent = void 0;
255
- range.deleteContents();
255
+ if (!this.contentsDeleted) {
256
+ range.deleteContents();
257
+ }
256
258
  while (node.firstChild) {
257
259
  if (node.firstChild.nodeName === '#text' && node.firstChild.textContent.trim() === '') {
258
260
  detach(node.firstChild);
@@ -380,9 +382,28 @@ var InsertHtml = /** @class */ (function () {
380
382
  var nodeSelection = new NodeSelection();
381
383
  var currentNode = this.getNodeCollection(range, nodeSelection, node)[this.getNodeCollection(range, nodeSelection, node).length - 1];
382
384
  var splitedElm = void 0;
383
- if ((currentNode.nodeName === 'BR' || currentNode.nodeName === 'HR') && !isNOU(currentNode.parentElement) &&
384
- currentNode.parentElement.textContent.trim().length === 0) {
385
+ if ((currentNode.nodeName === 'BR' || currentNode.nodeName === 'HR' ||
386
+ (currentNode.nodeName === '#text' && !isNOU(currentNode.parentElement) && currentNode.parentElement.nodeName === 'LI')) &&
387
+ (!isNOU(currentNode.parentElement) && currentNode.parentElement.textContent.trim().length === 0)) {
388
+ splitedElm = currentNode;
389
+ if (currentNode.parentElement.nodeName === 'LI' && !isNOU(currentNode.nextSibling) &&
390
+ currentNode.nextSibling.nodeName === 'BR') {
391
+ detach(currentNode.nextSibling);
392
+ }
393
+ }
394
+ else if (currentNode.nodeName === '#text' && !isNOU(currentNode.parentElement) &&
395
+ currentNode.parentElement.nodeName === 'LI' && currentNode.parentElement.textContent.trim().length > 0) {
385
396
  splitedElm = currentNode;
397
+ if (currentNode.parentElement.nodeName === 'LI' && !isNOU(currentNode.nextSibling) &&
398
+ currentNode.nextSibling.nodeName === 'BR') {
399
+ detach(currentNode.nextSibling);
400
+ }
401
+ if (!range.collapsed) {
402
+ range.deleteContents();
403
+ }
404
+ range.insertNode(node);
405
+ this.contentsDeleted = true;
406
+ return;
386
407
  }
387
408
  else {
388
409
  splitedElm = nodeCutter.GetSpliceNode(range, blockNode);
@@ -469,6 +490,7 @@ var InsertHtml = /** @class */ (function () {
469
490
  'ins', 'kbd', 'label', 'map', 'mark', 'meter', 'noscript', 'object', 'output', 'picture', 'progress',
470
491
  'q', 'ruby', 's', 'samp', 'script', 'select', 'slot', 'small', 'span', 'strong', 'sub', 'sup', 'svg',
471
492
  'template', 'textarea', 'time', 'u', 'tt', 'var', 'video', 'wbr'];
493
+ InsertHtml.contentsDeleted = false;
472
494
  return InsertHtml;
473
495
  }());
474
496
  export { InsertHtml };
@@ -559,7 +559,7 @@ var Lists = /** @class */ (function () {
559
559
  };
560
560
  Lists.prototype.applyLists = function (elements, type, selector, item, e) {
561
561
  var isReverse = true;
562
- if (this.isRevert(elements, type) && isNOU(item)) {
562
+ if (this.isRevert(elements, type, item) && isNOU(item)) {
563
563
  this.revertList(elements, e);
564
564
  this.removeEmptyListElements();
565
565
  }
@@ -624,13 +624,14 @@ var Lists = /** @class */ (function () {
624
624
  }
625
625
  }
626
626
  };
627
- Lists.prototype.isRevert = function (nodes, tagName) {
627
+ Lists.prototype.isRevert = function (nodes, tagName, item) {
628
628
  var isRevert = true;
629
629
  for (var i = 0; i < nodes.length; i++) {
630
630
  if (nodes[i].tagName !== 'LI') {
631
631
  return false;
632
632
  }
633
- if (nodes[i].parentNode.tagName !== tagName) {
633
+ if (nodes[i].parentNode.tagName !== tagName ||
634
+ isNOU(item) && nodes[i].parentNode.style.listStyleType !== '') {
634
635
  isRevert = false;
635
636
  }
636
637
  }
@@ -653,6 +654,12 @@ var Lists = /** @class */ (function () {
653
654
  (nodes[i].tagName === 'LI' && node.tagName === tagName && nodesTemp.indexOf(node) < 0 && item !== null)) {
654
655
  nodesTemp.push(node);
655
656
  }
657
+ if (isNOU(item) && (node.tagName === tagName ||
658
+ ((node.tagName === 'UL' || node.tagName === 'OL') && node.hasAttribute('style')))) {
659
+ if (node.hasAttribute('style')) {
660
+ node.removeAttribute('style');
661
+ }
662
+ }
656
663
  }
657
664
  for (var j = nodesTemp.length - 1; j >= 0; j--) {
658
665
  var h = nodesTemp[j];
@@ -755,7 +762,8 @@ var Lists = /** @class */ (function () {
755
762
  }
756
763
  }
757
764
  if (element.parentNode.insertBefore(this.closeTag(parentNode.tagName), element),
758
- 'LI' === parentNode.parentNode.tagName) {
765
+ 'LI' === parentNode.parentNode.tagName || 'OL' === parentNode.parentNode.tagName ||
766
+ 'UL' === parentNode.parentNode.tagName) {
759
767
  element.parentNode.insertBefore(this.closeTag('LI'), element);
760
768
  }
761
769
  else {
@@ -111,7 +111,7 @@ var MsWordPaste = /** @class */ (function () {
111
111
  this.checkVShape(elm);
112
112
  var imgElem = elm.querySelectorAll('img');
113
113
  for (var i = 0; i < imgElem.length; i++) {
114
- if (!isNOU(imgElem[i].getAttribute('v:shapes')) && imgElem[i].getAttribute('v:shapes').indexOf('Picture') < 0) {
114
+ if (!isNOU(imgElem[i].getAttribute('v:shapes')) && imgElem[i].getAttribute('v:shapes').indexOf('Picture') < 0 && imgElem[i].getAttribute('v:shapes').indexOf('Image') < 0) {
115
115
  detach(imgElem[i]);
116
116
  }
117
117
  }
@@ -31,3 +31,9 @@ export declare const CLEAR_COMMAND: string;
31
31
  * @hidden
32
32
  */
33
33
  export declare const MD_TABLE: string;
34
+ /**
35
+ * insertText plugin events
36
+ *
37
+ * @hidden
38
+ */
39
+ export declare const INSERT_TEXT_COMMAND: string;
@@ -31,3 +31,9 @@ export var CLEAR_COMMAND = 'clear-commands';
31
31
  * @hidden
32
32
  */
33
33
  export var MD_TABLE = 'insert-table';
34
+ /**
35
+ * insertText plugin events
36
+ *
37
+ * @hidden
38
+ */
39
+ export var INSERT_TEXT_COMMAND = 'insert-text';
@@ -9,6 +9,7 @@ import { UndoRedoCommands } from './../plugin/undo';
9
9
  import { MDLink } from './../plugin/link';
10
10
  import { MDTable } from './../plugin/table';
11
11
  import { ClearFormat } from './../plugin/clearformat';
12
+ import { MDInsertText } from './../plugin/insert-text';
12
13
  /**
13
14
  * MarkdownParser internal component
14
15
  *
@@ -35,6 +36,7 @@ export declare class MarkdownParser {
35
36
  linkObj: MDLink;
36
37
  tableObj: MDTable;
37
38
  clearObj: ClearFormat;
39
+ insertTextObj: MDInsertText;
38
40
  /**
39
41
  * Constructor for creating the component
40
42
  *
@@ -11,6 +11,7 @@ import { MDLink } from './../plugin/link';
11
11
  import { MDTable } from './../plugin/table';
12
12
  import * as EVENTS from './../../common/constant';
13
13
  import { ClearFormat } from './../plugin/clearformat';
14
+ import { MDInsertText } from './../plugin/insert-text';
14
15
  /**
15
16
  * MarkdownParser internal component
16
17
  *
@@ -37,6 +38,7 @@ var MarkdownParser = /** @class */ (function () {
37
38
  this.linkObj = new MDLink(this);
38
39
  this.tableObj = new MDTable({ parent: this, syntaxTag: ({ Formats: this.formatTags, List: this.listTags }) });
39
40
  this.clearObj = new ClearFormat(this);
41
+ this.insertTextObj = new MDInsertText(this);
40
42
  this.wireEvents();
41
43
  }
42
44
  MarkdownParser.prototype.initialize = function () {
@@ -103,6 +105,10 @@ var MarkdownParser = /** @class */ (function () {
103
105
  case 'clear':
104
106
  this.observer.notify(CONSTANT.CLEAR_COMMAND, { subCommand: value, event: event, callBack: callBack });
105
107
  break;
108
+ case 'inserttext':
109
+ this.observer.notify(CONSTANT.INSERT_TEXT_COMMAND, { subCommand: value, event: event, callBack: callBack,
110
+ value: { text: exeValue } });
111
+ break;
106
112
  }
107
113
  };
108
114
  return MarkdownParser;
@@ -4,4 +4,4 @@
4
4
  * @hidden
5
5
 
6
6
  */
7
- export declare type MarkdownExecCommand = 'Indents' | 'Lists' | 'Formats' | 'Alignments' | 'Style' | 'Effects' | 'Casing' | 'Actions' | 'table' | 'Links' | 'Images' | 'Clear';
7
+ export declare type MarkdownExecCommand = 'Indents' | 'Lists' | 'Formats' | 'Alignments' | 'Style' | 'Effects' | 'Casing' | 'Actions' | 'table' | 'Links' | 'Images' | 'Clear' | 'Inserttext';
@@ -0,0 +1,22 @@
1
+ import { MarkdownParser } from './../base/markdown-parser';
2
+ /**
3
+ * Link internal component
4
+ *
5
+ * @hidden
6
+
7
+ */
8
+ export declare class MDInsertText {
9
+ private parent;
10
+ private selection;
11
+ /**
12
+ * Constructor for creating the insert text plugin
13
+ *
14
+ * @param {MarkdownParser} parent - specifies the parent element
15
+ * @hidden
16
+
17
+ */
18
+ constructor(parent: MarkdownParser);
19
+ private addEventListener;
20
+ private InsertTextExec;
21
+ private restore;
22
+ }
@@ -0,0 +1,51 @@
1
+ import * as CONSTANT from './../base/constant';
2
+ /**
3
+ * Link internal component
4
+ *
5
+ * @hidden
6
+
7
+ */
8
+ var MDInsertText = /** @class */ (function () {
9
+ /**
10
+ * Constructor for creating the insert text plugin
11
+ *
12
+ * @param {MarkdownParser} parent - specifies the parent element
13
+ * @hidden
14
+
15
+ */
16
+ function MDInsertText(parent) {
17
+ this.parent = parent;
18
+ this.selection = this.parent.markdownSelection;
19
+ this.addEventListener();
20
+ }
21
+ MDInsertText.prototype.addEventListener = function () {
22
+ this.parent.observer.on(CONSTANT.INSERT_TEXT_COMMAND, this.InsertTextExec, this);
23
+ };
24
+ MDInsertText.prototype.InsertTextExec = function (e) {
25
+ var textArea = this.parent.element;
26
+ textArea.focus();
27
+ var start = textArea.selectionStart;
28
+ var end = textArea.selectionEnd;
29
+ var text = e.value.text;
30
+ var startOffset = start + text.length;
31
+ var endOffset = end + text.length;
32
+ textArea.value = textArea.value.substr(0, start)
33
+ + text + textArea.value.substr(end, textArea.value.length);
34
+ this.parent.markdownSelection.setSelection(textArea, startOffset, endOffset);
35
+ this.restore(textArea, startOffset, endOffset, e);
36
+ };
37
+ MDInsertText.prototype.restore = function (textArea, start, end, event) {
38
+ this.selection.save(start, end);
39
+ this.selection.restore(textArea);
40
+ if (event && event.callBack) {
41
+ event.callBack({
42
+ requestType: event.subCommand,
43
+ selectedText: this.selection.getSelectedText(textArea),
44
+ editorMode: 'Markdown',
45
+ event: event.event
46
+ });
47
+ }
48
+ };
49
+ return MDInsertText;
50
+ }());
51
+ export { MDInsertText };
@@ -47,10 +47,18 @@ var ColorPickerInput = /** @class */ (function () {
47
47
  var fontNode = _this.parent.createElement('input');
48
48
  fontNode.id = targetID;
49
49
  fontNode.classList.add(classes.CLS_FONT_COLOR_TARGET);
50
+ if (!isNullOrUndefined(_this.parent.cssClass)) {
51
+ var allClassName = _this.parent.cssClass.split(' ');
52
+ for (var i = 0; i < allClassName.length; i++) {
53
+ if (allClassName[i].trim() !== '') {
54
+ fontNode.classList.add(allClassName[i]);
55
+ }
56
+ }
57
+ }
50
58
  document.body.appendChild(fontNode);
51
59
  options = {
52
60
  cssClass: _this.tools[item.toLocaleLowerCase()].icon
53
- + ' ' + classes.CLS_RTE_ELEMENTS + ' ' + classes.CLS_ICONS,
61
+ + ' ' + classes.CLS_RTE_ELEMENTS + ' ' + classes.CLS_ICONS + ' ' + _this.parent.cssClass,
54
62
  value: _this.tools[item.toLocaleLowerCase()].value,
55
63
  command: _this.tools[item.toLocaleLowerCase()].command,
56
64
  subCommand: _this.tools[item.toLocaleLowerCase()].subCommand,
@@ -66,10 +74,18 @@ var ColorPickerInput = /** @class */ (function () {
66
74
  var backNode = _this.parent.createElement('input');
67
75
  backNode.id = targetID;
68
76
  backNode.classList.add(classes.CLS_BACKGROUND_COLOR_TARGET);
77
+ if (!isNullOrUndefined(_this.parent.cssClass)) {
78
+ var allClassName = _this.parent.cssClass.split(' ');
79
+ for (var i = 0; i < allClassName.length; i++) {
80
+ if (allClassName[i].trim() !== '') {
81
+ backNode.classList.add(allClassName[i]);
82
+ }
83
+ }
84
+ }
69
85
  document.body.appendChild(backNode);
70
86
  options = {
71
87
  cssClass: _this.tools[item.toLocaleLowerCase()].icon
72
- + ' ' + classes.CLS_RTE_ELEMENTS + ' ' + classes.CLS_ICONS,
88
+ + ' ' + classes.CLS_RTE_ELEMENTS + ' ' + classes.CLS_ICONS + ' ' + _this.parent.cssClass,
73
89
  value: _this.tools[item.toLocaleLowerCase()].value,
74
90
  command: _this.tools[item.toLocaleLowerCase()].command,
75
91
  subCommand: _this.tools[item.toLocaleLowerCase()].subCommand,
@@ -142,8 +158,8 @@ var ColorPickerInput = /** @class */ (function () {
142
158
  dropDownObj.setProperties({ cssClass: (dropDownObj.cssClass + ' ' + e.cssClass).trim() });
143
159
  }
144
160
  else {
145
- colorPickerObj.setProperties({ cssClass: (colorPickerObj.cssClass.replace(e.oldCssClass, '').trim() + ' ' + e.cssClass).trim() });
146
- dropDownObj.setProperties({ cssClass: (dropDownObj.cssClass.replace(e.oldCssClass, '').trim() + ' ' + e.cssClass).trim() });
161
+ colorPickerObj.setProperties({ cssClass: (colorPickerObj.cssClass.replace(e.oldCssClass, '').replace(' ', ' ').trim() + ' ' + e.cssClass).trim() });
162
+ dropDownObj.setProperties({ cssClass: (dropDownObj.cssClass.replace(e.oldCssClass, '').replace(' ', ' ').trim() + ' ' + e.cssClass).trim() });
147
163
  }
148
164
  }
149
165
  };
@@ -17,9 +17,10 @@ var Resize = /** @class */ (function () {
17
17
  this.parent.on(events.destroy, this.destroy, this);
18
18
  };
19
19
  Resize.prototype.renderResizable = function () {
20
+ var enableRtlClass = (this.parent.enableRtl) ? classes.CLS_RTE_RES_WEST : classes.CLS_RTE_RES_EAST;
20
21
  this.resizer = this.parent.createElement('div', {
21
22
  id: this.parent.getID() + '-resizable', className: 'e-icons'
22
- + ' ' + classes.CLS_RTE_RES_HANDLE + ' ' + classes.CLS_RTE_RES_EAST
23
+ + ' ' + classes.CLS_RTE_RES_HANDLE + ' ' + enableRtlClass
23
24
  });
24
25
  this.parent.element.classList.add(classes.CLS_RTE_RES_CNT);
25
26
  this.parent.element.appendChild(this.resizer);
@@ -52,12 +53,12 @@ var Resize = /** @class */ (function () {
52
53
  var boundRect = this.parent.element.getBoundingClientRect();
53
54
  if (this.isMouseEvent(e)) {
54
55
  this.parent.element.style.height = e.clientY - boundRect.top + 'px';
55
- this.parent.element.style.width = e.clientX - boundRect.left + 'px';
56
+ this.parent.element.style.width = (!this.parent.enableRtl) ? e.clientX - boundRect.left + 'px' : boundRect.right - e.clientX + 'px';
56
57
  }
57
58
  else {
58
59
  var eventType = Browser.info.name !== 'msie' ? e.touches[0] : e;
59
60
  this.parent.element.style.height = eventType.clientY - boundRect.top + 'px';
60
- this.parent.element.style.width = eventType.clientX - boundRect.left + 'px';
61
+ this.parent.element.style.width = (!this.parent.enableRtl) ? e.clientX - boundRect.left + 'px' : boundRect.right - e.clientX + 'px';
61
62
  }
62
63
  if (!this.parent.toolbarSettings.enable) {
63
64
  this.parent.setContentHeight('', false);
@@ -105,7 +105,8 @@ var Toolbar = /** @class */ (function () {
105
105
  container: ((this.parent.inlineMode.enable) ? 'quick' : 'toolbar'),
106
106
  items: this.parent.toolbarSettings.items,
107
107
  mode: tBarMode,
108
- target: ele
108
+ target: ele,
109
+ cssClass: this.parent.cssClass
109
110
  });
110
111
  if (this.parent.toolbarSettings.type === ToolbarType.Expand) {
111
112
  addClass([ele], ['e-rte-tb-mobile']);
@@ -222,7 +223,8 @@ var Toolbar = /** @class */ (function () {
222
223
  container: 'toolbar',
223
224
  items: this.parent.toolbarSettings.items,
224
225
  mode: this.getToolbarMode(),
225
- target: this.tbElement
226
+ target: this.tbElement,
227
+ cssClass: this.parent.cssClass
226
228
  });
227
229
  if (!this.parent.inlineMode.enable) {
228
230
  if (this.parent.toolbarSettings.enableFloating) {
@@ -541,3 +541,8 @@ export declare const CLS_RTE_FIXED_TB_EXPAND: string;
541
541
 
542
542
  */
543
543
  export declare const CLS_RTE_TB_ENABLED: string;
544
+ /**
545
+ * @hidden
546
+
547
+ */
548
+ export declare const CLS_RTE_RES_WEST: string;