@syncfusion/ej2-richtexteditor 24.1.47 → 24.2.4

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 (106) hide show
  1. package/CHANGELOG.md +30 -2
  2. package/dist/ej2-richtexteditor.min.js +2 -2
  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 +832 -209
  6. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  7. package/dist/es6/ej2-richtexteditor.es5.js +835 -203
  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 +12 -12
  13. package/src/common/constant.d.ts +6 -0
  14. package/src/common/constant.js +6 -0
  15. package/src/common/util.d.ts +6 -0
  16. package/src/common/util.js +58 -20
  17. package/src/editor-manager/base/constant.d.ts +6 -0
  18. package/src/editor-manager/base/constant.js +6 -0
  19. package/src/editor-manager/base/editor-manager.d.ts +5 -0
  20. package/src/editor-manager/base/editor-manager.js +59 -0
  21. package/src/editor-manager/base/interface.d.ts +8 -0
  22. package/src/editor-manager/plugin/dom-node.js +3 -1
  23. package/src/editor-manager/plugin/format-painter-actions.js +1 -1
  24. package/src/editor-manager/plugin/inserthtml.js +7 -2
  25. package/src/editor-manager/plugin/ms-word-clean-up.d.ts +2 -0
  26. package/src/editor-manager/plugin/ms-word-clean-up.js +39 -10
  27. package/src/editor-manager/plugin/selection-commands.js +16 -0
  28. package/src/editor-manager/plugin/table.d.ts +0 -1
  29. package/src/editor-manager/plugin/table.js +14 -26
  30. package/src/editor-manager/plugin/undo.d.ts +1 -0
  31. package/src/editor-manager/plugin/undo.js +21 -1
  32. package/src/rich-text-editor/actions/base-quick-toolbar.js +3 -0
  33. package/src/rich-text-editor/actions/base-toolbar.js +8 -4
  34. package/src/rich-text-editor/actions/count.js +1 -1
  35. package/src/rich-text-editor/actions/dropdown-buttons.js +21 -2
  36. package/src/rich-text-editor/actions/emoji-picker.js +1 -1
  37. package/src/rich-text-editor/actions/full-screen.js +1 -0
  38. package/src/rich-text-editor/actions/html-editor.d.ts +2 -0
  39. package/src/rich-text-editor/actions/html-editor.js +88 -4
  40. package/src/rich-text-editor/actions/keyboard.js +3 -1
  41. package/src/rich-text-editor/actions/paste-clean-up.d.ts +1 -0
  42. package/src/rich-text-editor/actions/paste-clean-up.js +32 -4
  43. package/src/rich-text-editor/actions/toolbar.d.ts +2 -1
  44. package/src/rich-text-editor/base/constant.d.ts +25 -0
  45. package/src/rich-text-editor/base/constant.js +194 -0
  46. package/src/rich-text-editor/base/interface.d.ts +6 -1
  47. package/src/rich-text-editor/base/rich-text-editor.d.ts +1 -0
  48. package/src/rich-text-editor/base/rich-text-editor.js +34 -64
  49. package/src/rich-text-editor/base/util.d.ts +4 -0
  50. package/src/rich-text-editor/base/util.js +35 -1
  51. package/src/rich-text-editor/formatter/formatter.js +15 -4
  52. package/src/rich-text-editor/models/default-locale.js +17 -17
  53. package/src/rich-text-editor/models/items.js +2 -2
  54. package/src/rich-text-editor/renderer/audio-module.d.ts +1 -0
  55. package/src/rich-text-editor/renderer/audio-module.js +13 -0
  56. package/src/rich-text-editor/renderer/dialog-renderer.d.ts +2 -0
  57. package/src/rich-text-editor/renderer/dialog-renderer.js +7 -0
  58. package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -1
  59. package/src/rich-text-editor/renderer/image-module.d.ts +1 -0
  60. package/src/rich-text-editor/renderer/image-module.js +20 -2
  61. package/src/rich-text-editor/renderer/link-module.js +10 -1
  62. package/src/rich-text-editor/renderer/table-module.d.ts +2 -0
  63. package/src/rich-text-editor/renderer/table-module.js +22 -2
  64. package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +1 -0
  65. package/src/rich-text-editor/renderer/toolbar-renderer.js +25 -3
  66. package/src/rich-text-editor/renderer/video-module.d.ts +3 -0
  67. package/src/rich-text-editor/renderer/video-module.js +54 -30
  68. package/src/selection/selection.js +3 -0
  69. package/styles/bootstrap-dark.css +44 -6
  70. package/styles/bootstrap.css +44 -6
  71. package/styles/bootstrap4.css +44 -6
  72. package/styles/bootstrap5-dark.css +44 -6
  73. package/styles/bootstrap5.css +44 -6
  74. package/styles/fabric-dark.css +44 -6
  75. package/styles/fabric.css +44 -6
  76. package/styles/fluent-dark.css +44 -6
  77. package/styles/fluent.css +44 -6
  78. package/styles/highcontrast-light.css +44 -6
  79. package/styles/highcontrast.css +44 -6
  80. package/styles/material-dark.css +44 -6
  81. package/styles/material.css +44 -6
  82. package/styles/material3-dark.css +58 -14
  83. package/styles/material3.css +58 -14
  84. package/styles/rich-text-editor/_layout.scss +39 -2
  85. package/styles/rich-text-editor/_material-definition.scss +0 -1
  86. package/styles/rich-text-editor/_material3-definition.scss +7 -7
  87. package/styles/rich-text-editor/_theme.scss +12 -5
  88. package/styles/rich-text-editor/bootstrap-dark.css +44 -6
  89. package/styles/rich-text-editor/bootstrap.css +44 -6
  90. package/styles/rich-text-editor/bootstrap4.css +44 -6
  91. package/styles/rich-text-editor/bootstrap5-dark.css +44 -6
  92. package/styles/rich-text-editor/bootstrap5.css +44 -6
  93. package/styles/rich-text-editor/fabric-dark.css +44 -6
  94. package/styles/rich-text-editor/fabric.css +44 -6
  95. package/styles/rich-text-editor/fluent-dark.css +44 -6
  96. package/styles/rich-text-editor/fluent.css +44 -6
  97. package/styles/rich-text-editor/highcontrast-light.css +44 -6
  98. package/styles/rich-text-editor/highcontrast.css +44 -6
  99. package/styles/rich-text-editor/material-dark.css +44 -6
  100. package/styles/rich-text-editor/material.css +44 -6
  101. package/styles/rich-text-editor/material3-dark.css +58 -14
  102. package/styles/rich-text-editor/material3.css +58 -14
  103. package/styles/rich-text-editor/tailwind-dark.css +44 -6
  104. package/styles/rich-text-editor/tailwind.css +44 -6
  105. package/styles/tailwind-dark.css +44 -6
  106. package/styles/tailwind.css +44 -6
@@ -386,12 +386,20 @@ var Link = /** @class */ (function () {
386
386
  }
387
387
  var target = (this.selfLink.checkBoxObj.checked) ? '_blank' : null;
388
388
  var linkLabel = (this.selfLink.checkBoxObj.checked) ? this.selfLink.i10n.getConstant('linkAriaLabel') : null;
389
+ if (this.selfLink.parent.editorMode === 'Markdown' && linkUrl === '') {
390
+ linkUrl = 'http://';
391
+ }
389
392
  if (linkUrl === '') {
390
393
  this.selfLink.checkUrl(true);
391
394
  return;
392
395
  }
393
396
  if (!this.selfLink.isUrl(linkUrl)) {
394
- linkText = (linkText === '') ? linkUrl : linkText;
397
+ if (this.selfLink.parent.editorMode === 'Markdown') {
398
+ linkText = (linkText !== '') ? linkText : '';
399
+ }
400
+ else {
401
+ linkText = (linkText === '') ? linkUrl : linkText;
402
+ }
395
403
  if (!this.selfLink.parent.enableAutoUrl) {
396
404
  linkUrl = linkUrl.indexOf('http') > -1 ? linkUrl : 'http://' + linkUrl;
397
405
  }
@@ -532,6 +540,7 @@ var Link = /** @class */ (function () {
532
540
  this.parent.inlineMode.enable && !closest(target, '#' + this.dialogObj.element.id)) &&
533
541
  !closest(target, '#' + this.parent.getID() + '_toolbar_CreateLink') &&
534
542
  !target.querySelector('#' + this.parent.getID() + '_toolbar_CreateLink')))) {
543
+ this.parent.notify(events.documentClickClosedBy, { closedBy: "outside click" });
535
544
  this.dialogObj.hide({ returnValue: true });
536
545
  EventHandler.remove(this.parent.element.ownerDocument, 'mousedown', this.onDocumentClick);
537
546
  this.parent.isBlur = true;
@@ -46,6 +46,7 @@ export declare class Table {
46
46
  private UpdateCells;
47
47
  private keyUp;
48
48
  private keyDown;
49
+ private handleSelectAll;
49
50
  private tableModulekeyUp;
50
51
  private openDialog;
51
52
  private showDialog;
@@ -120,4 +121,5 @@ export declare class Table {
120
121
  * @returns {void}
121
122
  */
122
123
  private getModuleName;
124
+ private afterKeyDown;
123
125
  }
@@ -47,6 +47,7 @@ var Table = /** @class */ (function () {
47
47
  this.parent.on(events.bindCssClass, this.setCssClass, this);
48
48
  this.parent.on(events.destroy, this.destroy, this);
49
49
  this.parent.on(events.moduleDestroy, this.moduleDestroy, this);
50
+ this.parent.on(events.afterKeyDown, this.afterKeyDown, this);
50
51
  };
51
52
  Table.prototype.removeEventListener = function () {
52
53
  if (this.parent.isDestroyed) {
@@ -72,6 +73,7 @@ var Table = /** @class */ (function () {
72
73
  this.parent.off(events.bindCssClass, this.setCssClass);
73
74
  this.parent.off(events.destroy, this.destroy);
74
75
  this.parent.off(events.moduleDestroy, this.moduleDestroy);
76
+ this.parent.off(events.afterKeyDown, this.afterKeyDown);
75
77
  if (!Browser.isDevice && this.parent.tableSettings.resize) {
76
78
  EventHandler.remove(this.contentModule.getEditPanel(), 'mouseover', this.resizeHelper);
77
79
  }
@@ -229,6 +231,14 @@ var Table = /** @class */ (function () {
229
231
  }
230
232
  }
231
233
  }
234
+ if (event.ctrlKey && event.key === 'a') {
235
+ this.handleSelectAll();
236
+ }
237
+ };
238
+ Table.prototype.handleSelectAll = function () {
239
+ this.cancelResizeAction();
240
+ var selectedCells = this.parent.inputElement.querySelectorAll('.' + classes.CLS_TABLE_SEL);
241
+ removeClass(selectedCells, classes.CLS_TABLE_SEL);
232
242
  };
233
243
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
234
244
  Table.prototype.tableModulekeyUp = function (e) {
@@ -262,7 +272,6 @@ var Table = /** @class */ (function () {
262
272
  name: !isInternal ? 'showDialog' : null
263
273
  };
264
274
  this.insertTableDialog({ self: this, args: args, selection: selection });
265
- this.parent.formatter.editorManager.nodeSelection.restore();
266
275
  }
267
276
  };
268
277
  Table.prototype.showDialog = function () {
@@ -607,7 +616,7 @@ var Table = /** @class */ (function () {
607
616
  return;
608
617
  }
609
618
  var target = e.target || e.targetTouches[0].target;
610
- var closestTable = closest(target, 'table.e-rte-table');
619
+ var closestTable = closest(target, 'table.e-rte-table, table.e-rte-paste-table');
611
620
  if (!isNOU(this.curTable) && !isNOU(closestTable) && closestTable !== this.curTable &&
612
621
  this.parent.contentModule.getEditPanel().contains(closestTable)) {
613
622
  this.removeResizeElement();
@@ -1247,6 +1256,7 @@ var Table = /** @class */ (function () {
1247
1256
  this.popupObj.hide();
1248
1257
  }
1249
1258
  if (this.editdlgObj) {
1259
+ this.parent.notify(events.documentClickClosedBy, { closedBy: "outside click" });
1250
1260
  this.editdlgObj.hide();
1251
1261
  }
1252
1262
  this.parent.isBlur = true;
@@ -1557,6 +1567,16 @@ var Table = /** @class */ (function () {
1557
1567
  Table.prototype.getModuleName = function () {
1558
1568
  return 'table';
1559
1569
  };
1570
+ Table.prototype.afterKeyDown = function (e) {
1571
+ var _this = this;
1572
+ if (this.curTable) {
1573
+ setTimeout(function () {
1574
+ var mouseOverEvent = document.createEvent('MouseEvents');
1575
+ mouseOverEvent.initEvent('mouseover', true, true);
1576
+ _this.curTable.dispatchEvent(mouseOverEvent);
1577
+ }, 1);
1578
+ }
1579
+ };
1560
1580
  return Table;
1561
1581
  }());
1562
1582
  export { Table };
@@ -21,6 +21,7 @@ export declare class ToolbarRenderer implements IRenderer {
21
21
  private currentDropdown;
22
22
  private tooltip;
23
23
  private l10n;
24
+ private dropdownTooltip;
24
25
  /**
25
26
  * Constructor for toolbar renderer module
26
27
  *
@@ -63,6 +63,7 @@ var ToolbarRenderer = /** @class */ (function () {
63
63
  };
64
64
  ToolbarRenderer.prototype.dropDownSelected = function (args) {
65
65
  this.parent.notify(events.dropDownSelect, args);
66
+ this.destroyTooltip();
66
67
  };
67
68
  ToolbarRenderer.prototype.beforeDropDownItemRender = function (args) {
68
69
  if (this.parent.readonly || !this.parent.enabled) {
@@ -90,12 +91,20 @@ var ToolbarRenderer = /** @class */ (function () {
90
91
  if (args.element.parentElement.getAttribute('id').indexOf('TableCell') > -1 && !isNOU(args.element.parentElement.querySelector('.e-cell-merge')) &&
91
92
  (!isNOU(args.element.parentElement.querySelector('.e-cell-horizontal-split')) || !isNOU(args.element.parentElement.querySelector('.e-cell-vertical-split')))) {
92
93
  var listEle = args.element.querySelectorAll('li');
93
- if (this.parent.inputElement.querySelectorAll('.e-cell-select').length === 1) {
94
+ var selectedEles_1 = this.parent.inputElement.querySelectorAll('.e-cell-select');
95
+ if (selectedEles_1.length === 1) {
94
96
  addClass([listEle[0]], 'e-disabled');
95
97
  removeClass([listEle[1], listEle[2]], 'e-disabled');
96
98
  }
97
- else if (this.parent.inputElement.querySelectorAll('.e-cell-select').length > 1) {
98
- removeClass([listEle[0]], 'e-disabled');
99
+ else if (selectedEles_1.length > 1) {
100
+ if (!Array.from(selectedEles_1).every(function (element) {
101
+ return element.tagName.toLowerCase() === selectedEles_1[0].tagName.toLowerCase();
102
+ })) {
103
+ addClass([listEle[0]], 'e-disabled');
104
+ }
105
+ else {
106
+ removeClass([listEle[0]], 'e-disabled');
107
+ }
99
108
  addClass([listEle[1], listEle[2]], 'e-disabled');
100
109
  }
101
110
  }
@@ -143,6 +152,19 @@ var ToolbarRenderer = /** @class */ (function () {
143
152
  });
144
153
  this.tooltip.appendTo(args.target);
145
154
  }
155
+ if (this.parent.showTooltip) {
156
+ this.dropdownTooltip = new Tooltip({
157
+ target: '[aria-owns="' + this.parent.getID() + '"].e-rte-elements [title]',
158
+ showTipPointer: true,
159
+ openDelay: 400,
160
+ opensOn: 'Hover',
161
+ beforeRender: this.tooltipBeforeRender.bind(this),
162
+ cssClass: this.parent.getCssClass(),
163
+ windowCollision: true,
164
+ position: 'BottomCenter'
165
+ });
166
+ this.dropdownTooltip.appendTo(document.body);
167
+ }
146
168
  };
147
169
  /**
148
170
  * renderDropDownButton method
@@ -23,6 +23,7 @@ export declare class Video {
23
23
  private isAllowedTypes;
24
24
  private pageX;
25
25
  private pageY;
26
+ private mouseX;
26
27
  private dialogRenderObj;
27
28
  private deletedVid;
28
29
  private changedWidthValue;
@@ -51,6 +52,7 @@ export declare class Video {
51
52
  private vidResizePos;
52
53
  private calcPos;
53
54
  private setAspectRatio;
55
+ private updateVidEleWidth;
54
56
  private pixToPerc;
55
57
  private vidDupMouseMove;
56
58
  private resizing;
@@ -59,6 +61,7 @@ export declare class Video {
59
61
  private resizeBtnInit;
60
62
  private onToolbarAction;
61
63
  private onKeyDown;
64
+ private handleSelectAll;
62
65
  private openDialog;
63
66
  private showDialog;
64
67
  private closeDialog;
@@ -13,6 +13,7 @@ var Video = /** @class */ (function () {
13
13
  this.isAllowedTypes = true;
14
14
  this.pageX = null;
15
15
  this.pageY = null;
16
+ this.mouseX = null;
16
17
  this.deletedVid = [];
17
18
  this.parent = parent;
18
19
  this.rteID = parent.element.id;
@@ -412,62 +413,50 @@ var Video = /** @class */ (function () {
412
413
  if (isNullOrUndefined(vidEleStyle)) {
413
414
  return;
414
415
  }
415
- // eslint-disable-next-line
416
+ /* eslint-disable */
416
417
  var width = vidEleStyle.width !== '' ? vidEleStyle.width.match(/^\d+(\.\d*)?%$/g) ? parseFloat(vidEleStyle.width) :
417
418
  parseInt(vidEleStyle.width, 10) : vid.style.width !== '' ? vid.style.width : vid.width;
418
419
  var height = vidEleStyle.height !== '' ? parseInt(vidEleStyle.height, 10) : vid.style.height !== '' ? vid.style.height : vid.height;
420
+ width = width.toString().match(/\b\d+(\.\d*)?(%|$)\b/g) ? parseFloat(width.toString()) : parseInt(width.toString(), 10);
421
+ height = height.toString().match(/\b\d+(\.\d*)?(%|$)\b/g) ? parseFloat(height.toString()) : parseInt(height.toString(), 10);
422
+ /* eslint-enable */
419
423
  if (width > height) {
420
424
  vid.style.minWidth = this.parent.insertVideoSettings.minWidth === 0 ? '200px' : formatUnit(this.parent.insertVideoSettings.minWidth);
421
425
  vid.style.minHeight = this.parent.insertVideoSettings.minHeight === 0 ? '90px' : formatUnit(this.parent.insertVideoSettings.minHeight);
422
426
  if (this.parent.insertVideoSettings.resizeByPercent) {
423
- if (parseInt('' + vid.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
424
- var percentageValue = this.pixToPerc((parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY), (vid.previousElementSibling || vid.parentElement));
425
- vid.style.width = Math.min(Math.round((percentageValue / vid.getBoundingClientRect().width) * expectedX * 100) / 100, 100) + '%';
426
- }
427
- else {
428
- vid.style.width = this.pixToPerc(parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY, (vid.previousElementSibling || vid.parentElement)) + '%';
429
- }
430
- vid.style.height = null;
431
- vid.removeAttribute('height');
427
+ this.updateVidEleWidth(vid, width, height, expectedX, expectedY);
432
428
  }
433
429
  else if ((vid.style.width === '' && vid.style.height !== '') || (vidEleStyle.width === '' && vidEleStyle.height !== '')) {
434
430
  vid.style.height = expectedY + 'px';
435
431
  }
436
432
  else if ((vid.style.width !== '' && vid.style.height === '') || (vidEleStyle.width !== '' && vidEleStyle.height === '')) {
437
- var currentWidth = ((parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY) +
438
- parseInt(width.toString(), 10) / parseInt(height.toString(), 10)) <
433
+ var currentWidth = ((width / height * expectedY) +
434
+ width / height) <
439
435
  (this.parent.inputElement.getBoundingClientRect().right - 32) ?
440
- ((parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY) +
441
- parseInt(width.toString(), 10) / parseInt(height.toString(), 10)) :
436
+ ((width / height * expectedY) +
437
+ width / height) :
442
438
  (this.parent.inputElement.getBoundingClientRect().right - 32);
443
439
  vid.style.width = currentWidth.toString() + 'px';
444
440
  }
445
441
  else if (vid.style.width !== '' || vidEleStyle.width !== '') {
446
- var currentWidth = (parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY) <
442
+ var currentWidth = (width / height * expectedY) <
447
443
  (this.parent.inputElement.getBoundingClientRect().right - 32) ?
448
- (parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY) :
444
+ (width / height * expectedY) :
449
445
  (this.parent.inputElement.getBoundingClientRect().right - 32);
450
446
  vid.style.width = currentWidth + 'px';
451
447
  vid.style.height = expectedY + 'px';
452
448
  }
453
449
  else {
454
- vid.setAttribute('width', (parseInt(((parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY) + parseInt(width.toString(), 10) / parseInt(height.toString(), 10)).toString(), 10)).toString());
450
+ vid.setAttribute('width', (parseInt(((width / height * expectedY) + width / height).toString(), 10)).toString());
455
451
  }
456
452
  }
457
453
  else if (height > width) {
458
454
  if (this.parent.insertVideoSettings.resizeByPercent) {
459
- if (parseInt('' + vid.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
460
- vid.style.width = Math.min(Math.round((parseInt(width.toString(), 10) / vid.getBoundingClientRect().width) * expectedX * 100) / 100, 100) + '%';
461
- }
462
- else {
463
- vid.style.width = this.pixToPerc((expectedX / parseInt(height.toString(), 10) * expectedY), (vid.previousElementSibling || vid.parentElement)) + '%';
464
- }
465
- vid.style.height = null;
466
- vid.removeAttribute('height');
455
+ this.updateVidEleWidth(vid, width, height, expectedX, expectedY);
467
456
  }
468
457
  else if (vid.style.width !== '' || vidEleStyle.width !== '') {
469
458
  vid.style.width = expectedX + 'px';
470
- vid.style.height = (parseInt(height.toString(), 10) / parseInt(width.toString(), 10) * expectedX) + 'px';
459
+ vid.style.height = (height / width * expectedX) + 'px';
471
460
  }
472
461
  else {
473
462
  vid.setAttribute('width', this.resizeBtnStat.botRight ? (this.getPointX(e.event) - vid.getBoundingClientRect().left).toString() : expectedX.toString());
@@ -485,6 +474,23 @@ var Video = /** @class */ (function () {
485
474
  }
486
475
  }
487
476
  };
477
+ Video.prototype.updateVidEleWidth = function (vid, width, height, expectedX, expectedY) {
478
+ if (parseInt('' + vid.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
479
+ var original = vid.offsetWidth + this.mouseX;
480
+ var finalWidthByPerc = (original / vid.offsetWidth) * (parseFloat(vid.style.width).toString() === 'NaN' ? (vid.offsetWidth / (parseFloat(getComputedStyle(this.parent.element).width)) * 100) : parseFloat(vid.style.width));
481
+ vid.style.width = ((finalWidthByPerc > 3) ? finalWidthByPerc : 3) + '%';
482
+ }
483
+ else {
484
+ if (width > height) {
485
+ vid.style.width = this.pixToPerc(width / height * expectedY, (vid.previousElementSibling || vid.parentElement)) + '%';
486
+ }
487
+ else {
488
+ vid.style.width = this.pixToPerc((expectedX / height * expectedY), (vid.previousElementSibling || vid.parentElement)) + '%';
489
+ }
490
+ }
491
+ vid.style.height = null;
492
+ vid.removeAttribute('height');
493
+ };
488
494
  Video.prototype.pixToPerc = function (expected, parentEle) {
489
495
  return expected / parseFloat(getComputedStyle(parentEle).width) * 100;
490
496
  };
@@ -526,6 +532,7 @@ var Video = /** @class */ (function () {
526
532
  var height = parseInt(this.vidDupPos.height, 10) + mouseY;
527
533
  this.pageX = pageX;
528
534
  this.pageY = pageY;
535
+ this.mouseX = mouseX;
529
536
  if (this.resizeBtnStat.botRight) {
530
537
  this.vidDupMouseMove(width + 'px', height + 'px', e);
531
538
  }
@@ -692,6 +699,14 @@ var Video = /** @class */ (function () {
692
699
  originalEvent.preventDefault();
693
700
  break;
694
701
  }
702
+ if (originalEvent.ctrlKey && originalEvent.key === 'a') {
703
+ this.handleSelectAll();
704
+ }
705
+ };
706
+ Video.prototype.handleSelectAll = function () {
707
+ this.cancelResizeAction();
708
+ var videoFocusNodes = this.parent.inputElement.querySelectorAll('.' + classes.CLS_VID_FOCUS);
709
+ removeClass(videoFocusNodes, classes.CLS_VID_FOCUS);
695
710
  };
696
711
  Video.prototype.openDialog = function (isInternal, event, selection, ele, parentEle) {
697
712
  var range;
@@ -869,6 +884,7 @@ var Video = /** @class */ (function () {
869
884
  if (e.offsetX > e.target.clientWidth || e.offsetY > e.target.clientHeight) {
870
885
  }
871
886
  else {
887
+ this.parent.notify(events.documentClickClosedBy, { closedBy: "outside click" });
872
888
  this.dialogObj.hide({ returnValue: true });
873
889
  this.parent.isBlur = true;
874
890
  dispatchEvent(this.parent.element, 'focusout');
@@ -1158,6 +1174,15 @@ var Video = /** @class */ (function () {
1158
1174
  }
1159
1175
  }
1160
1176
  });
1177
+ if (e.selectNode && ((e.selectNode[0] && e.selectNode[0].nodeType !== 3 &&
1178
+ e.selectNode[0].nodeName !== 'BR' &&
1179
+ (e.selectNode[0].classList &&
1180
+ e.selectNode[0].classList.contains(classes.CLS_VID_CLICK_ELEM))) ||
1181
+ e.selectNode[0].nodeName === 'IFRAME' || e.selectNode[0].nodeName === 'VIDEO')) {
1182
+ var regex = new RegExp(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi);
1183
+ var sourceElement = e.selectNode[0].querySelector('source');
1184
+ this.inputUrl.value = sourceElement.src.match(regex) ? sourceElement.src : '';
1185
+ }
1161
1186
  var embedUrlBtn = new RadioButton({
1162
1187
  label: this.i10n.getConstant('embeddedCode'),
1163
1188
  checked: true,
@@ -1167,7 +1192,6 @@ var Video = /** @class */ (function () {
1167
1192
  },
1168
1193
  change: function () {
1169
1194
  urlContent.innerHTML = '';
1170
- _this.inputUrl.value = '';
1171
1195
  urlContent.appendChild(_this.embedInputUrl);
1172
1196
  }
1173
1197
  });
@@ -1177,7 +1201,6 @@ var Video = /** @class */ (function () {
1177
1201
  name: 'URL',
1178
1202
  change: function () {
1179
1203
  urlContent.innerHTML = '';
1180
- _this.embedInputUrl.value = '';
1181
1204
  urlContent.appendChild(_this.inputUrl);
1182
1205
  }
1183
1206
  });
@@ -1369,10 +1392,11 @@ var Video = /** @class */ (function () {
1369
1392
  this.selection = proxy.parent.formatter.editorManager.nodeSelection.save(range, proxy.contentModule.getDocument());
1370
1393
  this.selectParent = proxy.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
1371
1394
  }
1372
- var name_1 = url !== '' ? url.split('/')[url.split('/').length - 1] : embedUrl;
1395
+ var webUrlBtn = document.getElementById('webURL');
1396
+ var name_1 = webUrlBtn.checked ? url.split('/')[url.split('/').length - 1] : embedUrl;
1373
1397
  var value = {
1374
1398
  cssClass: (proxy.parent.insertVideoSettings.layoutOption === 'Inline' ? classes.CLS_VIDEOINLINE : classes.CLS_VIDEOBREAK),
1375
- url: url, selection: this.selection, fileName: name_1, isEmbedUrl: embedUrl !== '' ? true : false,
1399
+ url: url, selection: this.selection, fileName: name_1, isEmbedUrl: !webUrlBtn.checked,
1376
1400
  selectParent: this.selectParent, width: {
1377
1401
  width: proxy.parent.insertVideoSettings.width, minWidth: proxy.parent.insertVideoSettings.minWidth,
1378
1402
  maxWidth: proxy.parent.getInsertImgMaxWidth()
@@ -90,6 +90,9 @@ var NodeSelection = /** @class */ (function () {
90
90
  || this.isChildNode(nodeCollection, startNode))) {
91
91
  return null;
92
92
  }
93
+ if (startNode.nodeType === 3 && startNode.previousSibling === endNode && endNode.nodeName === 'IMG') {
94
+ return null;
95
+ }
93
96
  if (nodeCollection.indexOf(startNode.firstChild) === -1 && startNode.firstChild && !this.isChildNode(nodeCollection, startNode)) {
94
97
  return startNode.firstChild;
95
98
  }
@@ -995,6 +995,34 @@
995
995
  .e-richtexteditor .e-toolbar.e-extended-toolbar .e-toolbar-extended.e-toolbar-pop .e-toolbar-item .e-tbar-btn {
996
996
  font-size: 16px;
997
997
  }
998
+ .e-richtexteditor .e-clickelem::after,
999
+ .e-richtexteditor .e-video-clickelem::after {
1000
+ left: 0;
1001
+ right: 0;
1002
+ z-index: 1;
1003
+ }
1004
+ .e-richtexteditor .e-clickelem::before,
1005
+ .e-richtexteditor .e-video-clickelem::before {
1006
+ left: 0;
1007
+ right: 0;
1008
+ z-index: 1;
1009
+ }
1010
+ .e-richtexteditor .e-clickelem::before {
1011
+ bottom: 70%;
1012
+ top: 0;
1013
+ }
1014
+ .e-richtexteditor .e-clickelem::after {
1015
+ bottom: 0;
1016
+ top: 70%;
1017
+ }
1018
+ .e-richtexteditor .e-video-clickelem::before {
1019
+ bottom: 85%;
1020
+ top: 0;
1021
+ }
1022
+ .e-richtexteditor .e-video-clickelem::after {
1023
+ bottom: 0;
1024
+ top: 90%;
1025
+ }
998
1026
 
999
1027
  .e-rte-linkcontent .e-rte-label {
1000
1028
  padding-top: 20px;
@@ -1244,7 +1272,6 @@
1244
1272
  height: 20px;
1245
1273
  min-width: 20px;
1246
1274
  padding: 2px 5px;
1247
- vertical-align: middle;
1248
1275
  }
1249
1276
 
1250
1277
  .e-rte-table.e-dashed-border td,
@@ -1287,6 +1314,14 @@
1287
1314
  padding-top: 0;
1288
1315
  }
1289
1316
 
1317
+ .e-rte-video-dialog .e-rte-label {
1318
+ padding-top: 20px;
1319
+ }
1320
+
1321
+ .e-rte-video-dialog .e-rte-label:first-child {
1322
+ padding-top: 0;
1323
+ }
1324
+
1290
1325
  .e-rte-table-resize.e-row-resize,
1291
1326
  .e-rte-table-resize.e-column-resize {
1292
1327
  background-color: transparent;
@@ -2825,15 +2860,18 @@
2825
2860
  .e-richtexteditor .e-clickelem::after,
2826
2861
  .e-richtexteditor .e-video-clickelem::after {
2827
2862
  background: transparent;
2828
- bottom: 0;
2829
2863
  content: "";
2830
2864
  cursor: default;
2831
2865
  display: block;
2832
- left: 0;
2833
2866
  position: absolute;
2834
- right: 0;
2835
- top: 0;
2836
- z-index: 1;
2867
+ }
2868
+ .e-richtexteditor .e-clickelem::before,
2869
+ .e-richtexteditor .e-video-clickelem::before {
2870
+ background: transparent;
2871
+ content: "";
2872
+ cursor: default;
2873
+ display: block;
2874
+ position: absolute;
2837
2875
  }
2838
2876
  .e-richtexteditor .e-videoheader,
2839
2877
  .e-richtexteditor .e-embed-videoheader,
@@ -1136,6 +1136,34 @@
1136
1136
  .e-richtexteditor .e-toolbar.e-extended-toolbar .e-toolbar-extended.e-toolbar-pop .e-toolbar-item .e-tbar-btn {
1137
1137
  font-size: 16px;
1138
1138
  }
1139
+ .e-richtexteditor .e-clickelem::after,
1140
+ .e-richtexteditor .e-video-clickelem::after {
1141
+ left: 0;
1142
+ right: 0;
1143
+ z-index: 1;
1144
+ }
1145
+ .e-richtexteditor .e-clickelem::before,
1146
+ .e-richtexteditor .e-video-clickelem::before {
1147
+ left: 0;
1148
+ right: 0;
1149
+ z-index: 1;
1150
+ }
1151
+ .e-richtexteditor .e-clickelem::before {
1152
+ bottom: 70%;
1153
+ top: 0;
1154
+ }
1155
+ .e-richtexteditor .e-clickelem::after {
1156
+ bottom: 0;
1157
+ top: 70%;
1158
+ }
1159
+ .e-richtexteditor .e-video-clickelem::before {
1160
+ bottom: 85%;
1161
+ top: 0;
1162
+ }
1163
+ .e-richtexteditor .e-video-clickelem::after {
1164
+ bottom: 0;
1165
+ top: 90%;
1166
+ }
1139
1167
 
1140
1168
  .e-rte-linkcontent .e-rte-label {
1141
1169
  padding-top: 20px;
@@ -1385,7 +1413,6 @@
1385
1413
  height: 20px;
1386
1414
  min-width: 20px;
1387
1415
  padding: 2px 5px;
1388
- vertical-align: middle;
1389
1416
  }
1390
1417
 
1391
1418
  .e-rte-table.e-dashed-border td,
@@ -1428,6 +1455,14 @@
1428
1455
  padding-top: 0;
1429
1456
  }
1430
1457
 
1458
+ .e-rte-video-dialog .e-rte-label {
1459
+ padding-top: 20px;
1460
+ }
1461
+
1462
+ .e-rte-video-dialog .e-rte-label:first-child {
1463
+ padding-top: 0;
1464
+ }
1465
+
1431
1466
  .e-rte-table-resize.e-row-resize,
1432
1467
  .e-rte-table-resize.e-column-resize {
1433
1468
  background-color: transparent;
@@ -2971,15 +3006,18 @@
2971
3006
  .e-richtexteditor .e-clickelem::after,
2972
3007
  .e-richtexteditor .e-video-clickelem::after {
2973
3008
  background: transparent;
2974
- bottom: 0;
2975
3009
  content: "";
2976
3010
  cursor: default;
2977
3011
  display: block;
2978
- left: 0;
2979
3012
  position: absolute;
2980
- right: 0;
2981
- top: 0;
2982
- z-index: 1;
3013
+ }
3014
+ .e-richtexteditor .e-clickelem::before,
3015
+ .e-richtexteditor .e-video-clickelem::before {
3016
+ background: transparent;
3017
+ content: "";
3018
+ cursor: default;
3019
+ display: block;
3020
+ position: absolute;
2983
3021
  }
2984
3022
  .e-richtexteditor .e-videoheader,
2985
3023
  .e-richtexteditor .e-embed-videoheader,
@@ -1231,6 +1231,34 @@
1231
1231
  .e-richtexteditor .e-toolbar.e-extended-toolbar .e-toolbar-extended.e-toolbar-pop .e-toolbar-item .e-tbar-btn {
1232
1232
  font-size: 16px;
1233
1233
  }
1234
+ .e-richtexteditor .e-clickelem::after,
1235
+ .e-richtexteditor .e-video-clickelem::after {
1236
+ left: 0;
1237
+ right: 0;
1238
+ z-index: 1;
1239
+ }
1240
+ .e-richtexteditor .e-clickelem::before,
1241
+ .e-richtexteditor .e-video-clickelem::before {
1242
+ left: 0;
1243
+ right: 0;
1244
+ z-index: 1;
1245
+ }
1246
+ .e-richtexteditor .e-clickelem::before {
1247
+ bottom: 70%;
1248
+ top: 0;
1249
+ }
1250
+ .e-richtexteditor .e-clickelem::after {
1251
+ bottom: 0;
1252
+ top: 70%;
1253
+ }
1254
+ .e-richtexteditor .e-video-clickelem::before {
1255
+ bottom: 85%;
1256
+ top: 0;
1257
+ }
1258
+ .e-richtexteditor .e-video-clickelem::after {
1259
+ bottom: 0;
1260
+ top: 90%;
1261
+ }
1234
1262
 
1235
1263
  .e-rte-linkcontent .e-rte-label {
1236
1264
  padding-top: 14px;
@@ -1480,7 +1508,6 @@
1480
1508
  height: 20px;
1481
1509
  min-width: 20px;
1482
1510
  padding: 2px 5px;
1483
- vertical-align: middle;
1484
1511
  }
1485
1512
 
1486
1513
  .e-rte-table.e-dashed-border td,
@@ -1523,6 +1550,14 @@
1523
1550
  padding-top: 0;
1524
1551
  }
1525
1552
 
1553
+ .e-rte-video-dialog .e-rte-label {
1554
+ padding-top: 14px;
1555
+ }
1556
+
1557
+ .e-rte-video-dialog .e-rte-label:first-child {
1558
+ padding-top: 0;
1559
+ }
1560
+
1526
1561
  .e-rte-table-resize.e-row-resize,
1527
1562
  .e-rte-table-resize.e-column-resize {
1528
1563
  background-color: transparent;
@@ -3053,15 +3088,18 @@
3053
3088
  .e-richtexteditor .e-clickelem::after,
3054
3089
  .e-richtexteditor .e-video-clickelem::after {
3055
3090
  background: transparent;
3056
- bottom: 0;
3057
3091
  content: "";
3058
3092
  cursor: default;
3059
3093
  display: block;
3060
- left: 0;
3061
3094
  position: absolute;
3062
- right: 0;
3063
- top: 0;
3064
- z-index: 1;
3095
+ }
3096
+ .e-richtexteditor .e-clickelem::before,
3097
+ .e-richtexteditor .e-video-clickelem::before {
3098
+ background: transparent;
3099
+ content: "";
3100
+ cursor: default;
3101
+ display: block;
3102
+ position: absolute;
3065
3103
  }
3066
3104
  .e-richtexteditor .e-videoheader,
3067
3105
  .e-richtexteditor .e-embed-videoheader,