@syncfusion/ej2-richtexteditor 20.2.50 → 20.3.47

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 (150) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/ej2-richtexteditor.min.js +10 -0
  3. package/dist/ej2-richtexteditor.umd.min.js +2 -2
  4. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-richtexteditor.es2015.js +3799 -402
  6. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  7. package/dist/es6/ej2-richtexteditor.es5.js +3759 -333
  8. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  9. package/dist/global/ej2-richtexteditor.min.js +2 -2
  10. package/dist/global/ej2-richtexteditor.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +13 -13
  13. package/src/common/config.js +2 -0
  14. package/src/common/types.d.ts +4 -0
  15. package/src/editor-manager/base/classes.d.ts +16 -0
  16. package/src/editor-manager/base/classes.js +16 -0
  17. package/src/editor-manager/base/constant.d.ts +2 -0
  18. package/src/editor-manager/base/constant.js +2 -0
  19. package/src/editor-manager/base/editor-manager.d.ts +4 -0
  20. package/src/editor-manager/base/editor-manager.js +14 -0
  21. package/src/editor-manager/base/interface.d.ts +2 -0
  22. package/src/editor-manager/plugin/audio.d.ts +32 -0
  23. package/src/editor-manager/plugin/audio.js +133 -0
  24. package/src/editor-manager/plugin/dom-node.js +1 -1
  25. package/src/editor-manager/plugin/image.js +1 -1
  26. package/src/editor-manager/plugin/inserthtml.js +1 -1
  27. package/src/editor-manager/plugin/lists.js +10 -8
  28. package/src/editor-manager/plugin/ms-word-clean-up.js +18 -18
  29. package/src/editor-manager/plugin/nodecutter.d.ts +1 -1
  30. package/src/editor-manager/plugin/nodecutter.js +7 -5
  31. package/src/editor-manager/plugin/selection-commands.js +3 -2
  32. package/src/editor-manager/plugin/table.js +3 -2
  33. package/src/editor-manager/plugin/undo.js +2 -1
  34. package/src/editor-manager/plugin/video.d.ts +34 -0
  35. package/src/editor-manager/plugin/video.js +249 -0
  36. package/src/editor-manager/plugin.d.ts +2 -0
  37. package/src/editor-manager/plugin.js +2 -0
  38. package/src/global.js +1 -1
  39. package/src/rich-text-editor/actions/base-quick-toolbar.js +3 -1
  40. package/src/rich-text-editor/actions/base-toolbar.js +1 -1
  41. package/src/rich-text-editor/actions/dropdown-buttons.d.ts +2 -2
  42. package/src/rich-text-editor/actions/dropdown-buttons.js +14 -11
  43. package/src/rich-text-editor/actions/enter-key.d.ts +1 -0
  44. package/src/rich-text-editor/actions/enter-key.js +157 -103
  45. package/src/rich-text-editor/actions/html-editor.d.ts +1 -1
  46. package/src/rich-text-editor/actions/html-editor.js +57 -9
  47. package/src/rich-text-editor/actions/paste-clean-up.js +2 -1
  48. package/src/rich-text-editor/actions/quick-toolbar.d.ts +2 -0
  49. package/src/rich-text-editor/actions/quick-toolbar.js +52 -6
  50. package/src/rich-text-editor/actions/resize.js +11 -1
  51. package/src/rich-text-editor/actions/toolbar-action.js +2 -1
  52. package/src/rich-text-editor/actions/xhtml-validation.js +1 -1
  53. package/src/rich-text-editor/audio.d.ts +4 -0
  54. package/src/rich-text-editor/audio.js +4 -0
  55. package/src/rich-text-editor/base/classes.d.ts +50 -0
  56. package/src/rich-text-editor/base/classes.js +50 -0
  57. package/src/rich-text-editor/base/constant.d.ts +69 -14
  58. package/src/rich-text-editor/base/constant.js +71 -16
  59. package/src/rich-text-editor/base/enum.d.ts +10 -2
  60. package/src/rich-text-editor/base/enum.js +10 -2
  61. package/src/rich-text-editor/base/interface.d.ts +86 -2
  62. package/src/rich-text-editor/base/interface.js +8 -0
  63. package/src/rich-text-editor/base/rich-text-editor-model.d.ts +130 -29
  64. package/src/rich-text-editor/base/rich-text-editor.d.ts +150 -30
  65. package/src/rich-text-editor/base/rich-text-editor.js +196 -6
  66. package/src/rich-text-editor/formatter/formatter.js +7 -2
  67. package/src/rich-text-editor/models/default-locale.js +46 -4
  68. package/src/rich-text-editor/models/items.d.ts +3 -0
  69. package/src/rich-text-editor/models/items.js +100 -3
  70. package/src/rich-text-editor/models/toolbar-settings-model.d.ts +169 -1
  71. package/src/rich-text-editor/models/toolbar-settings.d.ts +143 -1
  72. package/src/rich-text-editor/models/toolbar-settings.js +88 -0
  73. package/src/rich-text-editor/renderer/audio-module.d.ts +76 -0
  74. package/src/rich-text-editor/renderer/audio-module.js +875 -0
  75. package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -1
  76. package/src/rich-text-editor/renderer/image-module.js +9 -6
  77. package/src/rich-text-editor/renderer/link-module.js +2 -1
  78. package/src/rich-text-editor/renderer/table-module.d.ts +2 -0
  79. package/src/rich-text-editor/renderer/table-module.js +32 -7
  80. package/src/rich-text-editor/renderer/video-module.d.ts +105 -0
  81. package/src/rich-text-editor/renderer/video-module.js +1422 -0
  82. package/src/rich-text-editor/renderer/view-source.js +1 -0
  83. package/src/rich-text-editor/renderer.d.ts +2 -0
  84. package/src/rich-text-editor/renderer.js +2 -0
  85. package/src/rich-text-editor/video.d.ts +4 -0
  86. package/src/rich-text-editor/video.js +4 -0
  87. package/styles/_all.scss +1 -2
  88. package/styles/bootstrap-dark.css +220 -70
  89. package/styles/bootstrap.css +220 -70
  90. package/styles/bootstrap4.css +220 -70
  91. package/styles/bootstrap5-dark.css +220 -70
  92. package/styles/bootstrap5.css +220 -70
  93. package/styles/fabric-dark.css +220 -70
  94. package/styles/fabric.css +222 -72
  95. package/styles/fluent-dark.css +222 -72
  96. package/styles/fluent.css +222 -72
  97. package/styles/highcontrast-light.css +222 -72
  98. package/styles/highcontrast.css +222 -72
  99. package/styles/material-dark.css +220 -70
  100. package/styles/material.css +220 -70
  101. package/styles/rich-text-editor/_all.scss +1 -1
  102. package/styles/rich-text-editor/_bootstrap-dark-definition.scss +3 -0
  103. package/styles/rich-text-editor/_bootstrap-definition.scss +2 -1
  104. package/styles/rich-text-editor/_bootstrap4-definition.scss +5 -3
  105. package/styles/rich-text-editor/_bootstrap5-definition.scss +8 -3
  106. package/styles/rich-text-editor/_fabric-dark-definition.scss +3 -0
  107. package/styles/rich-text-editor/_fabric-definition.scss +2 -0
  108. package/styles/rich-text-editor/_fluent-definition.scss +8 -3
  109. package/styles/rich-text-editor/_fusionnew-definition.scss +8 -3
  110. package/styles/rich-text-editor/_highcontrast-definition.scss +2 -0
  111. package/styles/rich-text-editor/_highcontrast-light-definition.scss +2 -0
  112. package/styles/rich-text-editor/_layout.scss +116 -74
  113. package/styles/rich-text-editor/_material-dark-definition.scss +3 -0
  114. package/styles/rich-text-editor/_material-definition.scss +2 -0
  115. package/styles/rich-text-editor/_material3-definition.scss +8 -3
  116. package/styles/rich-text-editor/_tailwind-definition.scss +7 -2
  117. package/styles/rich-text-editor/_theme.scss +74 -15
  118. package/styles/rich-text-editor/bootstrap-dark.css +220 -70
  119. package/styles/rich-text-editor/bootstrap.css +220 -70
  120. package/styles/rich-text-editor/bootstrap4.css +220 -70
  121. package/styles/rich-text-editor/bootstrap5-dark.css +220 -70
  122. package/styles/rich-text-editor/bootstrap5.css +220 -70
  123. package/styles/rich-text-editor/fabric-dark.css +220 -70
  124. package/styles/rich-text-editor/fabric.css +222 -72
  125. package/styles/rich-text-editor/fluent-dark.css +222 -72
  126. package/styles/rich-text-editor/fluent.css +222 -72
  127. package/styles/rich-text-editor/highcontrast-light.css +222 -72
  128. package/styles/rich-text-editor/highcontrast.css +222 -72
  129. package/styles/rich-text-editor/icons/_bootstrap-dark.scss +20 -4
  130. package/styles/rich-text-editor/icons/_bootstrap.scss +20 -4
  131. package/styles/rich-text-editor/icons/_bootstrap4.scss +20 -4
  132. package/styles/rich-text-editor/icons/_bootstrap5.scss +20 -4
  133. package/styles/rich-text-editor/icons/_fabric-dark.scss +20 -4
  134. package/styles/rich-text-editor/icons/_fabric.scss +20 -4
  135. package/styles/rich-text-editor/icons/_fluent.scss +20 -4
  136. package/styles/rich-text-editor/icons/_fusionnew.scss +20 -4
  137. package/styles/rich-text-editor/icons/_highcontrast-light.scss +20 -4
  138. package/styles/rich-text-editor/icons/_highcontrast.scss +20 -4
  139. package/styles/rich-text-editor/icons/_material-dark.scss +20 -4
  140. package/styles/rich-text-editor/icons/_material.scss +20 -4
  141. package/styles/rich-text-editor/icons/_material3.scss +20 -4
  142. package/styles/rich-text-editor/icons/_tailwind.scss +20 -4
  143. package/styles/rich-text-editor/material-dark.css +220 -70
  144. package/styles/rich-text-editor/material.css +220 -70
  145. package/styles/rich-text-editor/tailwind-dark.css +220 -70
  146. package/styles/rich-text-editor/tailwind.css +220 -70
  147. package/styles/tailwind-dark.css +220 -70
  148. package/styles/tailwind.css +220 -70
  149. package/.eslintrc.json +0 -244
  150. package/tslint.json +0 -111
@@ -44,7 +44,7 @@ import { RendererFactory } from '../services/renderer-factory';
44
44
  import { RenderType, ToolbarType, DialogType } from './enum';
45
45
  import { ExecCommandCallBack } from '../actions/execute-command-callback';
46
46
  import { KeyboardEvents } from '../actions/keyboard';
47
- import { ToolbarSettings, ImageSettings, QuickToolbarSettings, FontFamily, FontSize, Format, NumberFormatList, BulletFormatList } from '../models/toolbar-settings';
47
+ import { ToolbarSettings, ImageSettings, AudioSettings, VideoSettings, QuickToolbarSettings, FontFamily, FontSize, Format, NumberFormatList, BulletFormatList } from '../models/toolbar-settings';
48
48
  import { FileManagerSettings } from '../models/toolbar-settings';
49
49
  import { TableSettings, PasteCleanupSettings } from '../models/toolbar-settings';
50
50
  import { FontColor, BackgroundColor } from '../models/toolbar-settings';
@@ -110,6 +110,14 @@ var RichTextEditor = /** @class */ (function (_super) {
110
110
  if (this.editorMode === 'HTML') {
111
111
  modules.push({ member: 'htmlEditor', args: [this, this.serviceLocator] });
112
112
  modules.push({ member: 'pasteCleanup', args: [this, this.serviceLocator] });
113
+ modules.push({
114
+ member: 'audio',
115
+ args: [this, this.serviceLocator]
116
+ });
117
+ modules.push({
118
+ member: 'video',
119
+ args: [this, this.serviceLocator]
120
+ });
113
121
  }
114
122
  if (this.fileManagerSettings.enable) {
115
123
  modules.push({ member: 'fileManager', args: [this, this.serviceLocator] });
@@ -418,6 +426,64 @@ var RichTextEditor = /** @class */ (function (_super) {
418
426
  }
419
427
  break;
420
428
  }
429
+ case 'insertAudio': {
430
+ var wrapTemp = this.createElement('audio', {
431
+ attrs: {
432
+ controls: ''
433
+ }
434
+ });
435
+ var temp = this.createElement('source', {
436
+ attrs: {
437
+ src: value.url,
438
+ type: value.url && value.url.split('.').length > 0
439
+ ? 'audio/' + value.url.split('.')[value.url.split('.').length - 1] : ''
440
+ }
441
+ });
442
+ wrapTemp.appendChild(temp);
443
+ var audioValue = wrapTemp.outerHTML;
444
+ if (this.enableHtmlSanitizer) {
445
+ audioValue = this.htmlEditorModule.sanitizeHelper(wrapTemp.outerHTML);
446
+ }
447
+ var url = (audioValue !== '' && (this.createElement('div', {
448
+ innerHTML: audioValue
449
+ }).firstElementChild.firstElementChild).getAttribute('src')) || null;
450
+ url = !isNOU(url) ? url : '';
451
+ value.url = url;
452
+ break;
453
+ }
454
+ case 'insertVideo': {
455
+ var wrapTemp = this.createElement('video', {
456
+ attrs: {
457
+ controls: ''
458
+ }
459
+ });
460
+ var temp = this.createElement('source', {
461
+ attrs: {
462
+ src: value.url,
463
+ type: value.url && value.url.split('.').length > 0
464
+ ? 'video/' + value.url.split('.')[value.url.split('.').length - 1] : ''
465
+ }
466
+ });
467
+ wrapTemp.appendChild(temp);
468
+ var audioValue = wrapTemp.outerHTML;
469
+ if (this.enableHtmlSanitizer) {
470
+ audioValue = this.htmlEditorModule.sanitizeHelper(temp.outerHTML);
471
+ }
472
+ var url = (audioValue !== '' && (this.createElement('div', {
473
+ innerHTML: audioValue
474
+ }).firstElementChild).getAttribute('src')) || null;
475
+ url = !isNOU(url) ? url : '';
476
+ value.url = url;
477
+ if (isNOU(value.width)) {
478
+ value.width = { minWidth: this.insertVideoSettings.minWidth,
479
+ maxWidth: this.insertVideoSettings.maxWidth, width: this.insertVideoSettings.width };
480
+ }
481
+ if (isNOU(value.height)) {
482
+ value.height = { minHeight: this.insertVideoSettings.minHeight,
483
+ maxHeight: this.insertVideoSettings.maxHeight, height: this.insertVideoSettings.height };
484
+ }
485
+ break;
486
+ }
421
487
  case 'createLink': {
422
488
  var tempNode = this.createElement('a', {
423
489
  attrs: {
@@ -478,9 +544,67 @@ var RichTextEditor = /** @class */ (function (_super) {
478
544
  // eslint-disable-next-line
479
545
  (!this.enabled) ? this.unWireEvents() : this.eventInitializer();
480
546
  this.notify(events.bindCssClass, { cssClass: this.cssClass });
547
+ this.addAudioVideoWrapper();
481
548
  this.notify(events.tableclass, {});
482
549
  this.renderComplete();
483
550
  };
551
+ /**
552
+ * addAudioVideoWrapper method
553
+ *
554
+ * @returns {void}
555
+ * @hidden
556
+
557
+ */
558
+ RichTextEditor.prototype.addAudioVideoWrapper = function () {
559
+ var _this = this;
560
+ var insertElem;
561
+ var audioElm = this.element.querySelectorAll('audio');
562
+ for (var i = 0; i < audioElm.length; i++) {
563
+ if (!audioElm[i].classList.contains('e-rte-audio')) {
564
+ audioElm[i].classList.add('e-rte-audio');
565
+ audioElm[i].classList.add(classes.CLS_AUDIOINLINE);
566
+ }
567
+ if (!audioElm[i].parentElement.classList.contains(classes.CLS_CLICKELEM) && !audioElm[i].parentElement.classList.contains(classes.CLS_AUDIOWRAP)) {
568
+ var audioWrapElem = this.createElement('span', { className: classes.CLS_AUDIOWRAP });
569
+ audioWrapElem.contentEditable = 'false';
570
+ var audioInnerWrapElem = this.createElement('span', { className: classes.CLS_CLICKELEM });
571
+ audioWrapElem.appendChild(audioInnerWrapElem);
572
+ audioElm[i].parentNode.insertBefore(audioWrapElem, audioElm[i].nextSibling);
573
+ audioInnerWrapElem.appendChild(audioElm[i]);
574
+ if (audioWrapElem.nextElementSibling === null) {
575
+ insertElem = this.createElement('br');
576
+ audioWrapElem.parentNode.insertBefore(insertElem, audioWrapElem.nextSibling);
577
+ }
578
+ }
579
+ }
580
+ var videoElm = this.element.querySelectorAll('video');
581
+ for (var i = 0; i < videoElm.length; i++) {
582
+ if (!videoElm[i].classList.contains('e-rte-video')) {
583
+ videoElm[i].classList.add('e-rte-video');
584
+ videoElm[i].classList.add(classes.CLS_VIDEOINLINE);
585
+ }
586
+ if (!videoElm[i].parentElement.classList.contains(classes.CLS_CLICKELEM) && !videoElm[i].parentElement.classList.contains(classes.CLS_VIDEOWRAP)) {
587
+ var videoWrapElem = this.createElement('span', { className: classes.CLS_VIDEOWRAP });
588
+ videoWrapElem.contentEditable = 'false';
589
+ videoElm[i].parentNode.insertBefore(videoWrapElem, videoElm[i].nextSibling);
590
+ videoWrapElem.appendChild(videoElm[i]);
591
+ if (videoWrapElem.nextElementSibling === null) {
592
+ insertElem = this.createElement('br');
593
+ videoWrapElem.parentNode.insertBefore(insertElem, videoWrapElem.nextSibling);
594
+ }
595
+ }
596
+ if (Browser.userAgent.indexOf('Firefox') !== -1) {
597
+ videoElm[i].addEventListener('play', function (args) {
598
+ _this.notify(events.mouseDown, { args: args });
599
+ _this.notify('editAreaClick', { args: args });
600
+ });
601
+ videoElm[i].addEventListener('pause', function (args) {
602
+ _this.notify(events.mouseDown, { args: args });
603
+ _this.notify('editAreaClick', { args: args });
604
+ });
605
+ }
606
+ }
607
+ };
484
608
  /**
485
609
  * For internal use only - Initialize the event handler
486
610
  *
@@ -505,7 +629,7 @@ var RichTextEditor = /** @class */ (function (_super) {
505
629
  if (!isNOU(closestLI) && endNode.textContent.length === range.endOffset &&
506
630
  !range.collapsed && isNOU(endNode.nextElementSibling)) {
507
631
  for (var i = 0; i < closestLI.childNodes.length; i++) {
508
- if (closestLI.childNodes[i].nodeName === "#text" && closestLI.childNodes[i].textContent.trim().length === 0) {
632
+ if (closestLI.childNodes[i].nodeName === '#text' && closestLI.childNodes[i].textContent.trim().length === 0) {
509
633
  detach(closestLI.childNodes[i]);
510
634
  i--;
511
635
  }
@@ -603,9 +727,9 @@ var RichTextEditor = /** @class */ (function (_super) {
603
727
  this.autoResize();
604
728
  };
605
729
  RichTextEditor.prototype.keyUp = function (e) {
606
- if (this.editorMode === "HTML") {
730
+ if (this.editorMode === 'HTML') {
607
731
  var range = this.getRange();
608
- if (Browser.userAgent.indexOf('Firefox') != -1 && range.startContainer.nodeName === '#text' &&
732
+ if (Browser.userAgent.indexOf('Firefox') !== -1 && range.startContainer.nodeName === '#text' &&
609
733
  range.startContainer.parentElement === this.inputElement && this.enterKey !== 'BR') {
610
734
  var range_1 = this.getRange();
611
735
  var tempElem = this.createElement(this.enterKey);
@@ -615,6 +739,9 @@ var RichTextEditor = /** @class */ (function (_super) {
615
739
  }
616
740
  }
617
741
  this.notify(events.keyUp, { member: 'keyup', args: e });
742
+ if (e.keyCode == 39 || e.keyCode == 37) {
743
+ this.notify(events.tableModulekeyUp, { member: 'tableModulekeyUp', args: e });
744
+ }
618
745
  if (e.code === 'KeyX' && e.which === 88 && e.keyCode === 88 && e.ctrlKey && (this.inputElement.innerHTML === '' ||
619
746
  this.inputElement.innerHTML === '<br>')) {
620
747
  this.inputElement.innerHTML = getEditValue(getDefaultValue(this), this);
@@ -698,7 +825,11 @@ var RichTextEditor = /** @class */ (function (_super) {
698
825
  clientX: touch.clientX, clientY: touch.clientY }
699
826
  });
700
827
  if (this.inputElement && ((this.editorMode === 'HTML' && this.inputElement.textContent.length !== 0) ||
701
- (this.editorMode === 'Markdown' && this.inputElement.value.length !== 0))) {
828
+ (this.editorMode === 'Markdown' && this.inputElement.value.length !== 0)) || (e.target && (e.target.nodeName === 'VIDEO'
829
+ || e.target.querySelectorAll('.' + classes.CLS_VIDEOWRAP).length > 0) || (e.target && e.target.nodeName !== 'BR' &&
830
+ (e.target.classList.contains(classes.CLS_AUDIOWRAP) ||
831
+ e.target.classList.contains(classes.CLS_CLICKELEM) ||
832
+ e.target.classList.contains(classes.CLS_VID_CLICK_ELEM))))) {
702
833
  this.notify(events.toolbarRefresh, { args: e });
703
834
  }
704
835
  this.triggerEditArea(e);
@@ -1062,6 +1193,7 @@ var RichTextEditor = /** @class */ (function (_super) {
1062
1193
  if (this.showCharCount) {
1063
1194
  this.countModule.refresh();
1064
1195
  }
1196
+ this.addAudioVideoWrapper();
1065
1197
  break;
1066
1198
  }
1067
1199
  case 'valueTemplate':
@@ -1276,7 +1408,7 @@ var RichTextEditor = /** @class */ (function (_super) {
1276
1408
  });
1277
1409
  }
1278
1410
  this.placeHolderWrapper.innerHTML = this.placeholder;
1279
- if (this.inputElement.textContent.length === 0 && !isNOU(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
1411
+ if (this.inputElement.textContent.length === 0 && this.inputElement.childNodes.length < 2 && !isNOU(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
1280
1412
  ((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !isNOU(this.inputElement.firstChild.firstChild) &&
1281
1413
  this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
1282
1414
  this.placeHolderWrapper.style.display = 'block';
@@ -1560,6 +1692,25 @@ var RichTextEditor = /** @class */ (function (_super) {
1560
1692
  parseFloat(eleStyle.marginLeft.split('px')[0]) + parseFloat(eleStyle.marginRight.split('px')[0]));
1561
1693
  return isNOU(maxWidth) ? editEleMaxWidth : maxWidth;
1562
1694
  };
1695
+ /**
1696
+ * Video max width calculation method
1697
+ *
1698
+ * @returns {void}
1699
+ * @hidden
1700
+
1701
+ */
1702
+ RichTextEditor.prototype.getInsertVidMaxWidth = function () {
1703
+ var maxWidth = this.insertVideoSettings.maxWidth;
1704
+ // eslint-disable-next-line
1705
+ var vidPadding = 12;
1706
+ var vidResizeBorder = 2;
1707
+ var editEle = this.contentModule.getEditPanel();
1708
+ var eleStyle = window.getComputedStyle(editEle);
1709
+ var editEleMaxWidth = editEle.offsetWidth - (vidPadding + vidResizeBorder +
1710
+ parseFloat(eleStyle.paddingLeft.split('px')[0]) + parseFloat(eleStyle.paddingRight.split('px')[0]) +
1711
+ parseFloat(eleStyle.marginLeft.split('px')[0]) + parseFloat(eleStyle.marginRight.split('px')[0]));
1712
+ return isNOU(maxWidth) ? editEleMaxWidth : maxWidth;
1713
+ };
1563
1714
  /**
1564
1715
  * setContentHeight method
1565
1716
  *
@@ -1688,6 +1839,12 @@ var RichTextEditor = /** @class */ (function (_super) {
1688
1839
  else if (type === DialogType.InsertImage) {
1689
1840
  this.notify(events.showImageDialog, {});
1690
1841
  }
1842
+ else if (type === DialogType.InsertAudio) {
1843
+ this.notify(events.showAudioDialog, {});
1844
+ }
1845
+ else if (type === DialogType.InsertVideo) {
1846
+ this.notify(events.showVideoDialog, {});
1847
+ }
1691
1848
  else if (type === DialogType.InsertTable) {
1692
1849
  this.notify(events.showTableDialog, {});
1693
1850
  }
@@ -1706,6 +1863,12 @@ var RichTextEditor = /** @class */ (function (_super) {
1706
1863
  else if (type === DialogType.InsertImage) {
1707
1864
  this.notify(events.closeImageDialog, {});
1708
1865
  }
1866
+ else if (type === DialogType.InsertAudio) {
1867
+ this.notify(events.closeAudioDialog, {});
1868
+ }
1869
+ else if (type === DialogType.InsertVideo) {
1870
+ this.notify(events.closeVideoDialog, {});
1871
+ }
1709
1872
  else if (type === DialogType.InsertTable) {
1710
1873
  this.notify(events.closeTableDialog, {});
1711
1874
  }
@@ -2225,6 +2388,12 @@ var RichTextEditor = /** @class */ (function (_super) {
2225
2388
  __decorate([
2226
2389
  Complex({}, ImageSettings)
2227
2390
  ], RichTextEditor.prototype, "insertImageSettings", void 0);
2391
+ __decorate([
2392
+ Complex({}, AudioSettings)
2393
+ ], RichTextEditor.prototype, "insertAudioSettings", void 0);
2394
+ __decorate([
2395
+ Complex({}, VideoSettings)
2396
+ ], RichTextEditor.prototype, "insertVideoSettings", void 0);
2228
2397
  __decorate([
2229
2398
  Complex({}, TableSettings)
2230
2399
  ], RichTextEditor.prototype, "tableSettings", void 0);
@@ -2390,6 +2559,27 @@ var RichTextEditor = /** @class */ (function (_super) {
2390
2559
  __decorate([
2391
2560
  Event()
2392
2561
  ], RichTextEditor.prototype, "afterImageDelete", void 0);
2562
+ __decorate([
2563
+ Event()
2564
+ ], RichTextEditor.prototype, "fileSelected", void 0);
2565
+ __decorate([
2566
+ Event()
2567
+ ], RichTextEditor.prototype, "beforeFileUpload", void 0);
2568
+ __decorate([
2569
+ Event()
2570
+ ], RichTextEditor.prototype, "fileUploading", void 0);
2571
+ __decorate([
2572
+ Event()
2573
+ ], RichTextEditor.prototype, "fileUploadSuccess", void 0);
2574
+ __decorate([
2575
+ Event()
2576
+ ], RichTextEditor.prototype, "fileUploadFailed", void 0);
2577
+ __decorate([
2578
+ Event()
2579
+ ], RichTextEditor.prototype, "fileRemoving", void 0);
2580
+ __decorate([
2581
+ Event()
2582
+ ], RichTextEditor.prototype, "afterMediaDelete", void 0);
2393
2583
  __decorate([
2394
2584
  Event()
2395
2585
  ], RichTextEditor.prototype, "created", void 0);
@@ -37,6 +37,8 @@ var Formatter = /** @class */ (function () {
37
37
  && args.item.command !== 'Links'
38
38
  && args.item.command !== 'Images'
39
39
  && args.item.command !== 'Files'
40
+ && args.item.command !== 'Audios'
41
+ && args.item.command !== 'Videos'
40
42
  && range
41
43
  && !(self.contentModule.getEditPanel().contains(this.getAncestorNode(range.commonAncestorContainer))
42
44
  || self.contentModule.getEditPanel() === range.commonAncestorContainer
@@ -48,7 +50,7 @@ var Formatter = /** @class */ (function () {
48
50
  if (args.item.command === 'Links') {
49
51
  currentInsertContentLength = value.text.length === 0 ? value.url.length : value.text.length;
50
52
  }
51
- if (args.item.command === 'Images' || args.item.command === 'Table' || args.item.command === 'Files') {
53
+ if (args.item.command === 'Images' || args.item.command === 'Videos' || args.item.command === 'Table' || args.item.command === 'Files') {
52
54
  currentInsertContentLength = 1;
53
55
  }
54
56
  var currentLength = self.getText().trim().length;
@@ -170,7 +172,7 @@ var Formatter = /** @class */ (function () {
170
172
  }
171
173
  self.trigger(CONSTANT.actionComplete, events, function (callbackArgs) {
172
174
  self.setPlaceHolder();
173
- if ((callbackArgs.requestType === 'Images' || callbackArgs.requestType === 'Links') && self.editorMode === 'HTML') {
175
+ if ((callbackArgs.requestType === 'Images' || callbackArgs.requestType === 'Links' || callbackArgs.requestType === 'Audios' || callbackArgs.requestType === 'Videos') && self.editorMode === 'HTML') {
174
176
  var args = callbackArgs;
175
177
  if (callbackArgs.requestType === 'Links' && callbackArgs.event &&
176
178
  callbackArgs.event.type === 'keydown' &&
@@ -182,6 +184,9 @@ var Formatter = /** @class */ (function () {
182
184
  elements: args.elements
183
185
  });
184
186
  }
187
+ if (callbackArgs.requestType === 'VideosPlayPause') {
188
+ self.notify('editAreaClick', { args: event });
189
+ }
185
190
  self.autoResize();
186
191
  });
187
192
  };
@@ -34,7 +34,19 @@ export var defaultLocale = {
34
34
  'editLink': 'Edit Link',
35
35
  'removeLink': 'Remove Link',
36
36
  'image': 'Insert Image',
37
+ 'audio': 'Insert Audio',
38
+ 'video': 'Insert Video',
37
39
  'replace': 'Replace',
40
+ 'numberFormatList': 'Number Format List',
41
+ 'bulletFormatList': 'Bullet Format List',
42
+ 'audioReplace': 'Replace',
43
+ 'videoReplace': 'Replace',
44
+ 'videoAlign': 'Align',
45
+ 'videoDimension': 'Dimension',
46
+ 'audioRemove': 'Remove',
47
+ 'videoRemove': 'Remove',
48
+ 'audioLayoutOption': 'Layout option',
49
+ 'videoLayoutOption': 'Layout option',
38
50
  'align': 'Align',
39
51
  'caption': 'Image Caption',
40
52
  'remove': 'Remove',
@@ -49,8 +61,6 @@ export var defaultLocale = {
49
61
  'upperCase': 'Upper Case',
50
62
  'print': 'Print',
51
63
  'formats': 'Formats',
52
- 'numberFormatList': 'Number Format List',
53
- 'bulletFormatList': 'Bullet Format List',
54
64
  'sourcecode': 'Code View',
55
65
  'preview': 'Preview',
56
66
  'viewside': 'ViewSide',
@@ -66,18 +76,34 @@ export var defaultLocale = {
66
76
  'dialogCancel': 'Cancel',
67
77
  'dialogUpdate': 'Update',
68
78
  'imageHeader': 'Insert Image',
79
+ 'audioHeader': 'Insert Audio',
80
+ 'videoHeader': 'Insert Video',
69
81
  'imageLinkHeader': 'You can also provide a link from the web',
82
+ 'audioLinkHeader': 'You can also provide a link from the web',
83
+ 'videoLinkHeader': 'Web URL',
84
+ 'embedVideoLinkHeader': 'Media Embed URL',
70
85
  'mdimageLink': 'Please provide a URL for your image',
71
86
  'imageUploadMessage': 'Drop image here or browse to upload',
87
+ 'audioUploadMessage': 'Drop an audio file or browse to upload',
88
+ 'videoUploadMessage': 'Drop a video file or browse to upload',
72
89
  'imageDeviceUploadMessage': 'Click here to upload',
90
+ 'audioDeviceUploadMessage': 'Click here to upload',
91
+ 'videoDeviceUploadMessage': 'Click here to upload',
73
92
  'imageAlternateText': 'Alternate Text',
74
93
  'alternateHeader': 'Alternative Text',
75
94
  'browse': 'Browse',
76
95
  'imageUrl': 'http://example.com/image.png',
96
+ 'audioUrl': 'http://example.com/audio.mp3',
97
+ 'videoUrl': 'http://example.com/video.mp3',
98
+ 'webUrl': 'Web URL',
99
+ 'embedUrl': 'Embed Code',
77
100
  'imageCaption': 'Caption',
78
101
  'imageSizeHeader': 'Image Size',
102
+ 'videoSizeHeader': 'Video Size',
79
103
  'imageHeight': 'Height',
80
104
  'imageWidth': 'Width',
105
+ 'videoHeight': 'Height',
106
+ 'videoWidth': 'Width',
81
107
  'textPlaceholder': 'Enter Text',
82
108
  'inserttablebtn': 'Insert Table',
83
109
  'tabledialogHeader': 'Insert Table',
@@ -108,12 +134,18 @@ export var defaultLocale = {
108
134
  'TableColText': 'Col',
109
135
  'imageInsertLinkHeader': 'Insert Link',
110
136
  'editImageHeader': 'Edit Image',
137
+ 'editAudioHeader': 'Edit Audio',
138
+ 'editVideoHeader': 'Edit Video',
111
139
  "alignmentsDropDownLeft": 'Align Left',
112
140
  "alignmentsDropDownCenter": 'Align Center',
113
141
  "alignmentsDropDownRight": 'Align Right',
114
142
  "alignmentsDropDownJustify": 'Align Justify',
115
143
  "imageDisplayDropDownInline": 'Inline',
116
144
  "imageDisplayDropDownBreak": 'Break',
145
+ "audioLayoutOptionDropDownInline": 'Inline',
146
+ "audioLayoutOptionDropDownBreak": 'Break',
147
+ "videoLayoutOptionDropDownInline": 'Inline',
148
+ "videoLayoutOptionDropDownBreak": 'Break',
117
149
  "tableInsertRowDropDownBefore": 'Insert row before',
118
150
  "tableInsertRowDropDownAfter": 'Insert row after',
119
151
  "tableInsertRowDropDownDelete": 'Delete row',
@@ -183,6 +215,8 @@ export var toolsLocale = {
183
215
  'orderedlist': 'orderedList',
184
216
  'indent': 'indent',
185
217
  'outdent': 'outdent',
218
+ 'numberformatlist': 'numberFormatList',
219
+ 'bulletformatlist': 'bulletFormatList',
186
220
  'undo': 'undo',
187
221
  'redo': 'redo',
188
222
  'superscript': 'superscript',
@@ -195,7 +229,17 @@ export var toolsLocale = {
195
229
  'editimagelink': 'editLink',
196
230
  'removeimagelink': 'removeLink',
197
231
  'image': 'image',
232
+ 'audio': 'audio',
233
+ 'video': 'video',
198
234
  'replace': 'replace',
235
+ 'audioreplace': 'audioReplace',
236
+ 'videoreplace': 'videoReplace',
237
+ 'videoalign': 'videoAlign',
238
+ 'videodimension': 'videoDimension',
239
+ 'audioremove': 'audioRemove',
240
+ 'videoremove': 'videoRemove',
241
+ 'audiolayoutoption': 'audioLayoutOption',
242
+ 'videolayoutoption': 'videoLayoutOption',
199
243
  'align': 'align',
200
244
  'caption': 'caption',
201
245
  'remove': 'remove',
@@ -210,8 +254,6 @@ export var toolsLocale = {
210
254
  'uppercase': 'upperCase',
211
255
  'print': 'print',
212
256
  'formats': 'formats',
213
- 'numberformatlist': 'numberFormatList',
214
- 'bulletformatlist': 'bulletFormatList',
215
257
  'sourcecode': 'sourcecode',
216
258
  'preview': 'preview',
217
259
  'viewside': 'viewside',
@@ -8,7 +8,10 @@ export declare let tools: {
8
8
  };
9
9
  export declare let alignmentItems: IDropDownItemModel[];
10
10
  export declare let imageAlignItems: IDropDownItemModel[];
11
+ export declare let videoAlignItems: IDropDownItemModel[];
11
12
  export declare let imageDisplayItems: IDropDownItemModel[];
13
+ export declare let audioLayoutOptionItems: IDropDownItemModel[];
14
+ export declare let videoLayoutOptionItems: IDropDownItemModel[];
12
15
  export declare let tableCellItems: IDropDownItemModel[];
13
16
  export declare let tableRowsItems: IDropDownItemModel[];
14
17
  export declare let tableColumnsItems: IDropDownItemModel[];
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * Export items model
4
4
  */
5
- export var templateItems = ['alignments', 'formats', 'fontname', 'fontsize', 'fontcolor', 'backgroundcolor', 'align', 'display', 'tablerows', 'tablecolumns', 'tablecell', 'tablecellhorizontalalign', 'tablecellverticalalign', 'styles', 'numberformatlist', 'bulletformatlist'];
5
+ export var templateItems = ['alignments', 'formats', 'fontname', 'fontsize', 'fontcolor', 'backgroundcolor', 'align', 'display', 'audiolayoutoption', 'videolayoutoption', 'videoalign', 'tablerows', 'tablecolumns', 'tablecell', 'tablecellhorizontalalign', 'tablecellverticalalign', 'styles', 'numberformatlist', 'bulletformatlist'];
6
6
  export var tools = {
7
7
  'alignments': {
8
8
  'id': 'Alignments',
@@ -237,6 +237,20 @@ export var tools = {
237
237
  'command': 'Images',
238
238
  'subCommand': 'Image'
239
239
  },
240
+ 'audio': {
241
+ 'id': 'Audio',
242
+ 'icon': 'e-audio',
243
+ 'tooltip': 'Insert Audio',
244
+ 'command': 'Audios',
245
+ 'subCommand': 'Audio'
246
+ },
247
+ 'video': {
248
+ 'id': 'Video',
249
+ 'icon': 'e-video',
250
+ 'tooltip': 'Insert Video',
251
+ 'command': 'Videos',
252
+ 'subCommand': 'Video'
253
+ },
240
254
  'filemanager': {
241
255
  'id': 'FileManager',
242
256
  'icon': 'e-rte-file-manager',
@@ -265,6 +279,62 @@ export var tools = {
265
279
  'command': 'Images',
266
280
  'subCommand': 'Replace'
267
281
  },
282
+ 'audioreplace': {
283
+ 'id': 'AudioReplace',
284
+ 'icon': 'e-audio-replace',
285
+ 'tooltip': 'Audio Replace',
286
+ 'command': 'Audios',
287
+ 'subCommand': 'AudioReplace'
288
+ },
289
+ 'audioremove': {
290
+ 'id': 'AudioRemove',
291
+ 'icon': 'e-audio-remove',
292
+ 'tooltip': 'Audio Remove',
293
+ 'command': 'Audios',
294
+ 'subCommand': 'AudioRemove'
295
+ },
296
+ 'audiolayoutoption': {
297
+ 'id': 'AudioLayoutOption',
298
+ 'icon': 'e-audio-display',
299
+ 'tooltip': 'Audio LayoutOption',
300
+ 'command': 'Audios',
301
+ 'subCommand': 'AudioLayoutOption'
302
+ },
303
+ 'videoreplace': {
304
+ 'id': 'VideoReplace',
305
+ 'icon': 'e-video-replace',
306
+ 'tooltip': 'Video Replace',
307
+ 'command': 'Videos',
308
+ 'subCommand': 'VideoReplace'
309
+ },
310
+ 'videoalign': {
311
+ 'id': 'VideoAlign',
312
+ 'icon': 'e-video-align',
313
+ 'tooltip': 'Video Align',
314
+ 'command': 'Videos',
315
+ 'subCommand': 'VideoAlign'
316
+ },
317
+ 'videoremove': {
318
+ 'id': 'VideoRemove',
319
+ 'icon': 'e-video-remove',
320
+ 'tooltip': 'Video Remove',
321
+ 'command': 'Videos',
322
+ 'subCommand': 'VideoRemove'
323
+ },
324
+ 'videolayoutoption': {
325
+ 'id': 'VideoLayoutOption',
326
+ 'icon': 'e-video-display',
327
+ 'tooltip': 'Video LayoutOption',
328
+ 'command': 'Videos',
329
+ 'subCommand': 'VideoLayoutOption'
330
+ },
331
+ 'videodimension': {
332
+ 'id': 'VideoDimension',
333
+ 'icon': 'e-video-dimension',
334
+ 'tooltip': 'Video Dimension',
335
+ 'command': 'Videos',
336
+ 'subCommand': 'VideoDimension'
337
+ },
268
338
  'align': {
269
339
  'id': 'Align',
270
340
  'icon': 'e-align',
@@ -500,14 +570,35 @@ export var imageAlignItems = [
500
570
  { iconCss: 'e-icons e-justify-center', command: 'Images', subCommand: 'JustifyCenter' },
501
571
  { iconCss: 'e-icons e-justify-right', command: 'Images', subCommand: 'JustifyRight' },
502
572
  ];
573
+ export var videoAlignItems = [
574
+ { iconCss: 'e-icons e-justify-left', command: 'Videos', subCommand: 'JustifyLeft' },
575
+ { iconCss: 'e-icons e-justify-center', command: 'Videos', subCommand: 'JustifyCenter' },
576
+ { iconCss: 'e-icons e-justify-right', command: 'Videos', subCommand: 'JustifyRight' },
577
+ ];
503
578
  var displayLocale = [
504
- { locale: 'imageDisplayDropDownInline', value: 'Inline' },
505
- { locale: 'imageDisplayDropDownBreak', value: 'Break' }
579
+ { locale: 'imageLayoutOptionDropDownInline', value: 'Inline' },
580
+ { locale: 'imageLayoutOptionDropDownBreak', value: 'Break' }
581
+ ];
582
+ var audioLayoutOptionLocale = [
583
+ { locale: 'audioLayoutOptionDropDownInline', value: 'Inline' },
584
+ { locale: 'audioLayoutOptionDropDownBreak', value: 'Break' }
585
+ ];
586
+ var videoLayoutOptionLocale = [
587
+ { locale: 'videoLayoutOptionDropDownInline', value: 'Inline' },
588
+ { locale: 'videoLayoutOptionDropDownBreak', value: 'Break' }
506
589
  ];
507
590
  export var imageDisplayItems = [
508
591
  { text: 'Inline', cssClass: 'e-inline', command: 'Images', subCommand: 'Inline' },
509
592
  { text: 'Break', cssClass: 'e-break', command: 'Images', subCommand: 'Break' },
510
593
  ];
594
+ export var audioLayoutOptionItems = [
595
+ { text: 'Inline', cssClass: 'e-audio-inline', command: 'Audios', subCommand: 'Inline' },
596
+ { text: 'Break', cssClass: 'e-audio-break', command: 'Audios', subCommand: 'Break' },
597
+ ];
598
+ export var videoLayoutOptionItems = [
599
+ { text: 'Inline', cssClass: 'e-video-inline', command: 'Videos', subCommand: 'Inline' },
600
+ { text: 'Break', cssClass: 'e-video-break', command: 'Videos', subCommand: 'Break' },
601
+ ];
511
602
  export var tableCellItems = [
512
603
  { iconCss: 'e-icons e-cell-merge', text: 'Merge cells', command: 'Table', subCommand: 'Merge' },
513
604
  { iconCss: 'e-icons e-cell-horizontal-split', text: 'Horizontal split', command: 'Table', subCommand: 'HorizontalSplit' },
@@ -630,6 +721,12 @@ export function updateDropDownLocale(self) {
630
721
  imageDisplayItems.forEach(function (item, i) {
631
722
  imageDisplayItems[i].text = getLocale(self, displayLocale, imageDisplayItems[i]);
632
723
  });
724
+ audioLayoutOptionItems.forEach(function (item, i) {
725
+ audioLayoutOptionItems[i].text = getLocale(self, audioLayoutOptionLocale, audioLayoutOptionItems[i]);
726
+ });
727
+ videoLayoutOptionItems.forEach(function (item, i) {
728
+ videoLayoutOptionItems[i].text = getLocale(self, videoLayoutOptionLocale, videoLayoutOptionItems[i]);
729
+ });
633
730
  tableRowsItems.forEach(function (item, i) {
634
731
  tableRowsItems[i].text = getLocale(self, tableRowLocale, tableRowsItems[i]);
635
732
  });