@syncfusion/ej2-richtexteditor 24.2.3 → 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.
- package/CHANGELOG.md +21 -5
- package/dist/ej2-richtexteditor.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +85 -43
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +80 -38
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +2 -2
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +7 -7
- package/src/common/util.d.ts +6 -0
- package/src/common/util.js +27 -0
- package/src/editor-manager/plugin/inserthtml.js +7 -2
- package/src/rich-text-editor/base/rich-text-editor.js +4 -4
- package/src/rich-text-editor/models/default-locale.js +6 -6
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -1
- package/src/rich-text-editor/renderer/video-module.d.ts +2 -0
- package/src/rich-text-editor/renderer/video-module.js +33 -26
- package/src/selection/selection.js +3 -0
- package/styles/material3-dark.css +7 -1
- package/styles/material3.css +7 -1
- package/styles/rich-text-editor/_layout.scss +3 -1
- package/styles/rich-text-editor/_theme.scss +3 -0
- package/styles/rich-text-editor/material3-dark.css +7 -1
- package/styles/rich-text-editor/material3.css +7 -1
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 24.2.
|
|
3
|
+
* version : 24.2.4
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-richtexteditor@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-richtexteditor@24.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@24.2.3",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-qjy4z7YGj17wCO4I5dW2kqGyRSaUxHXprYekBaF78kmtSAbFQjy8QFO9+15bOUEcNTPaTaPWHNvZ61Vm3+qOEw==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-richtexteditor",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"/@syncfusion/ej2-react-richtexteditor",
|
|
26
26
|
"/@syncfusion/ej2-vue-richtexteditor"
|
|
27
27
|
],
|
|
28
|
-
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-24.
|
|
29
|
-
"_shasum": "
|
|
28
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-24.2.3.tgz",
|
|
29
|
+
"_shasum": "c6180082b7903ea03940e96f5911e093ee6fab92",
|
|
30
30
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
31
31
|
"_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
|
|
32
32
|
"author": {
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"@syncfusion/ej2-base": "~24.2.3",
|
|
41
41
|
"@syncfusion/ej2-buttons": "~24.2.3",
|
|
42
42
|
"@syncfusion/ej2-filemanager": "~24.2.3",
|
|
43
|
-
"@syncfusion/ej2-inputs": "~24.2.
|
|
44
|
-
"@syncfusion/ej2-navigations": "~24.2.
|
|
43
|
+
"@syncfusion/ej2-inputs": "~24.2.4",
|
|
44
|
+
"@syncfusion/ej2-navigations": "~24.2.4",
|
|
45
45
|
"@syncfusion/ej2-popups": "~24.2.3",
|
|
46
46
|
"@syncfusion/ej2-splitbuttons": "~24.2.3"
|
|
47
47
|
},
|
|
@@ -69,6 +69,6 @@
|
|
|
69
69
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
70
70
|
},
|
|
71
71
|
"typings": "index.d.ts",
|
|
72
|
-
"version": "24.2.
|
|
72
|
+
"version": "24.2.4",
|
|
73
73
|
"sideEffects": false
|
|
74
74
|
}
|
package/src/common/util.d.ts
CHANGED
|
@@ -34,3 +34,9 @@ export declare function getDefaultHtmlTbStatus(): IToolbarStatus;
|
|
|
34
34
|
* @hidden
|
|
35
35
|
*/
|
|
36
36
|
export declare function getDefaultMDTbStatus(): IToolbarStatus;
|
|
37
|
+
/**
|
|
38
|
+
* @param {Range} range - specifies the range
|
|
39
|
+
* @returns {void}
|
|
40
|
+
* @hidden
|
|
41
|
+
*/
|
|
42
|
+
export declare function nestedListCleanUp(range: Range): void;
|
package/src/common/util.js
CHANGED
|
@@ -190,3 +190,30 @@ export function getDefaultMDTbStatus() {
|
|
|
190
190
|
formats: null
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* @param {Range} range - specifies the range
|
|
195
|
+
* @returns {void}
|
|
196
|
+
* @hidden
|
|
197
|
+
*/
|
|
198
|
+
export function nestedListCleanUp(range) {
|
|
199
|
+
if (range.startContainer.parentElement.closest('ol,ul') !== null && range.endContainer.parentElement.closest('ol,ul') !== null) {
|
|
200
|
+
range.extractContents();
|
|
201
|
+
while ((range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll('li :empty').length > 0 ||
|
|
202
|
+
(range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll('ol :empty').length > 0) {
|
|
203
|
+
var emptyLI = (range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll('li :empty');
|
|
204
|
+
if (emptyLI.length > 0) {
|
|
205
|
+
emptyLI.forEach(function (item) {
|
|
206
|
+
item.remove();
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
var liElem = (range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll("li");
|
|
211
|
+
if (liElem.length > 0) {
|
|
212
|
+
liElem.forEach(function (item) {
|
|
213
|
+
if (item.firstChild.nodeName === "OL" || item.firstChild.nodeName === "UL") {
|
|
214
|
+
item.style.listStyleType = "none";
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
@@ -3,7 +3,7 @@ import { NodeCutter } from './nodecutter';
|
|
|
3
3
|
import * as CONSTANT from './../base/constant';
|
|
4
4
|
import { detach, Browser, isNullOrUndefined as isNOU, createElement, closest } from '@syncfusion/ej2-base';
|
|
5
5
|
import { InsertMethods } from './insert-methods';
|
|
6
|
-
import { updateTextNode } from './../../common/util';
|
|
6
|
+
import { updateTextNode, nestedListCleanUp } from './../../common/util';
|
|
7
7
|
/**
|
|
8
8
|
* Insert a HTML Node or Text
|
|
9
9
|
*
|
|
@@ -82,7 +82,12 @@ var InsertHtml = /** @class */ (function () {
|
|
|
82
82
|
lasNode.textContent.length : lasNode.childNodes.length);
|
|
83
83
|
range = nodeSelection.getRange(docElement);
|
|
84
84
|
}
|
|
85
|
-
range.
|
|
85
|
+
if (range.startContainer.parentElement.closest('ol,ul') !== null && range.endContainer.parentElement.closest('ol,ul') !== null) {
|
|
86
|
+
nestedListCleanUp(range);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
range.extractContents();
|
|
90
|
+
}
|
|
86
91
|
if (insertNode.tagName === 'TABLE') {
|
|
87
92
|
this.removeEmptyElements(editNode);
|
|
88
93
|
}
|
|
@@ -1403,7 +1403,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1403
1403
|
if (this.valueContainer) {
|
|
1404
1404
|
this.valueContainer.value = (this.enableHtmlEncode) ? this.value : value;
|
|
1405
1405
|
}
|
|
1406
|
-
if (this.editorMode === 'HTML' && this.inputElement && this.inputElement.innerHTML.
|
|
1406
|
+
if (this.editorMode === 'HTML' && this.inputElement && this.inputElement.innerHTML.trim() !== value.trim()) {
|
|
1407
1407
|
this.inputElement.innerHTML = value;
|
|
1408
1408
|
}
|
|
1409
1409
|
else if (this.editorMode === 'Markdown' && this.inputElement
|
|
@@ -1424,9 +1424,6 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1424
1424
|
}
|
|
1425
1425
|
else {
|
|
1426
1426
|
this.inputElement.innerHTML = '<p><br/></p>';
|
|
1427
|
-
if (value === '' && this.formatter && this.inputElement) {
|
|
1428
|
-
this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), this.inputElement.firstElementChild, this.inputElement.firstElementChild.childElementCount);
|
|
1429
|
-
}
|
|
1430
1427
|
}
|
|
1431
1428
|
}
|
|
1432
1429
|
else {
|
|
@@ -2589,6 +2586,9 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2589
2586
|
if (item[j].classList.length === 0) {
|
|
2590
2587
|
item[j].removeAttribute('class');
|
|
2591
2588
|
}
|
|
2589
|
+
if (item[j].nodeName === 'IMG' && item[j].style.outline !== '') {
|
|
2590
|
+
item[j].style.outline = '';
|
|
2591
|
+
}
|
|
2592
2592
|
}
|
|
2593
2593
|
}
|
|
2594
2594
|
};
|
|
@@ -48,7 +48,7 @@ export var defaultLocale = {
|
|
|
48
48
|
'audioLayoutOption': 'Layout option',
|
|
49
49
|
'videoLayoutOption': 'Layout option',
|
|
50
50
|
'align': 'Align',
|
|
51
|
-
'caption': '
|
|
51
|
+
'caption': 'Caption',
|
|
52
52
|
'remove': 'Remove',
|
|
53
53
|
'insertLink': 'Insert Link',
|
|
54
54
|
'display': 'Display',
|
|
@@ -112,14 +112,14 @@ export var defaultLocale = {
|
|
|
112
112
|
'cellspacing': 'Cell Spacing',
|
|
113
113
|
'columns': 'Number of columns',
|
|
114
114
|
'rows': 'Number of rows',
|
|
115
|
-
'tableRows': '
|
|
116
|
-
'tableColumns': '
|
|
115
|
+
'tableRows': 'Row',
|
|
116
|
+
'tableColumns': 'Column',
|
|
117
117
|
'tableCellHorizontalAlign': 'Table Cell Horizontal Align',
|
|
118
|
-
'tableCellVerticalAlign': '
|
|
118
|
+
'tableCellVerticalAlign': 'Vertical Align',
|
|
119
119
|
'createTable': 'Create Table',
|
|
120
120
|
'removeTable': 'Remove Table',
|
|
121
|
-
'tableHeader': '
|
|
122
|
-
'tableRemove': '
|
|
121
|
+
'tableHeader': 'Header Row',
|
|
122
|
+
'tableRemove': 'Delete',
|
|
123
123
|
'tableCellBackground': 'Table Cell Background',
|
|
124
124
|
'tableEditProperties': 'Table Edit Properties',
|
|
125
125
|
'styles': 'Styles',
|
|
@@ -14,7 +14,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
import { ContentRender } from '../renderer/content-renderer';
|
|
15
15
|
import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
16
16
|
import { getEditValue } from '../base/util';
|
|
17
|
-
var IFRAMEHEADER = "\n<!DOCTYPE html> \n <html>\n <head>\n <meta charset='utf-8' /> \n <style>\n @charset \"UTF-8\";\n body {\n font-family: \"Roboto\", sans-serif;\n font-size: 14px;\n }\n html, body{height: 100%;margin: 0;}\n body.e-cursor{cursor:default}\n span.e-selected-node\t{background-color: #939393;color: white;}\n span.e-selected-node.e-highlight {background-color: #1d9dd8;}\n body{color:#333;word-wrap:break-word;padding: 8px;box-sizing: border-box;}\n .e-rte-image, .e-rte-audio, .e-rte-video {border: 0;cursor: pointer;display:\n block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imginline, .e-rte-audio.e-audio-inline, .e-rte-video.e-video-inline {display: inline-block;float: none;max-width: calc(100% - (2 * 5px));padding: 1px;vertical-align: bottom;}\n .e-rte-image.e-imgcenter, .e-rte-video.e-video-center {cursor: pointer;display: block;float: none;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imgright, .e-rte-video.e-video-right { float: right; margin: 0 auto;margin-left: 5px;text-align: right;}\n .e-rte-image.e-imgleft, .e-rte-video.e-video-left {float: left;margin: 0 auto;margin-right: 5px;text-align: left;}\n .e-img-caption { display: inline-block; float: none; margin: 5px auto; max-width: 100%;position: relative;}\n .e-img-caption.e-caption-inline {display: inline-block;float: none;\n margin: 5px auto;margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));\n position: relativetext-align: center;vertical-align: bottom;}\n .e-img-inner {box-sizing: border-box;display: block;font-size: 16px;font-weight: initial;\n margin: auto;opacity: .9;text-align: center;width: 100%;}\n .e-img-wrap {display: inline-block;margin: auto;padding: 0;text-align: center;width: 100%;}\n .e-imgleft, .e-video-left {float: left;margin: 0 5px 0 0;text-align: left;}\n .e-imgright, .e-video-right {float: right;margin: 0 0 0 5px;text-align: right;}\n .e-imgcenter, .e-video-center {cursor: pointer;display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-control img:not(.e-resize) {border: 2px solid transparent; z-index: 1000}\n .e-imginline , .e-audio-inline, .e-video-inline {display: inline-block;float: none;margin-left: 5px;margin-right: 5px;\n max-width: calc(100% - (2 * 5px));vertical-align: bottom;}\n .e-imgbreak, .e-audio-break, .e-video-break {border: 0;cursor: pointer;\n display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-img-focus:not(.e-resize), .e-audio-focus:not(.e-resize), .e-video-focus:not(.e-resize) {border: solid 2px #4a90e2;}\n img.e-img-focus::selection, audio.e-audio-focus::selection, .e-video-focus::selection { background: transparent;color: transparent;}\n span.e-rte-imageboxmark { width: 10px; height: 10px; position: absolute; display: block;\n background: #4a90e2; border: 1px solid #fff; z-index: 1000;}\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-mob-rte span.e-rte-imageboxmark { background: #fff; border: 1px solid #4a90e2;\n border-radius: 15px; height: 20px; width: 20px; }\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-rte-content .e-content img.e-resize, .e-rte-content .e-content video.e-resize { z-index: 1000; }\n .e-img-caption .e-img-inner { outline: 0; }\n .e-img-caption a:focus-visible { outline: none; }\n .e-img-caption .e-rte-image.e-imgright, .e-img-caption .e-rte-image.e-imgleft { float: none; margin: 0;}\n body{box-sizing: border-box;min-height: 100px;outline: 0 solid transparent;\n overflow-x: auto;padding: 16px;position: relative;text-align: inherit;z-index: 2;}\n p{margin: 0 0 10px;margin-bottom: 10px;}\n li{margin-bottom: 10px;}\n h1{font-size: 2.17em;font-weight: 400;line-height: 1;margin: 10px 0;}\n h2{font-size: 1.74em;font-weight: 400;margin: 10px 0;}\n h3{font-size: 1.31em;font-weight: 400;margin: 10px 0;}\n h4{font-size: 16px;font-weight: 400;line-height: 1.5;margin: 0;}\n h5{font-size: 00.8em;font-weight: 400;margin: 0;}\n h6{font-size: 00.65em;font-weight: 400;margin: 0;}\n blockquote{margin: 10px 0;margin-left: 0;padding-left: 5px;border-left: solid 2px #5c5c5c;}\n pre{background-color: inherit;border: 0;border-radius: 0;color: #333;\n font-size: inherit;line-height: inherit;margin: 0 0 10px;overflow: visible;padding: 0;\n white-space: pre-wrap;word-break: inherit;word-wrap: break-word;}\n strong, b{font-weight: 700;}\n a{text-decoration: none;user-select: auto;}\n a:hover{text-decoration: underline;};\n p:last-child, pre:last-child, blockquote:last-child{margin-bottom: 0;}\n h3+h4, h4+h5, h5+h6{margin-top: 00.6em;}\n ul:last-child{margin-bottom: 0;}\n table { border-collapse: collapse; empty-cells: show;}\n table td,table th {border: 1px solid #BDBDBD; height: 20px; padding: 2px 5px; vertical-align: middle;}\n table.e-alternate-border tbody tr:nth-child(2n) {background-color: #F5F5F5;}\n table th {background-color: #E0E0E0;}\n table.e-dashed-border td,table.e-dashed-border th { border: 1px dashed #BDBDBD} \n table .e-cell-select {border: 1px double #4a90e2;}\n span.e-table-box { cursor: nwse-resize; display: block; height: 10px; position: absolute; width: 10px; }\n span.e-table-box.e-rmob {height: 14px;width: 14px;}\n .e-row-resize, .e-column-resize { background-color: transparent; background-repeat: repeat;\n bottom: 0;cursor: col-resize;height: 1px;overflow: visible;position: absolute;width: 1px; }\n .e-row-resize { cursor: row-resize; height: 1px;}\n .e-table-rhelper { cursor: col-resize; opacity: .87;position: absolute;}\n .e-table-rhelper.e-column-helper { width: 1px; }\n .e-table-rhelper.e-row-helper {height: 1px;}\n .e-reicon::before { border-bottom: 6px solid transparent; border-right: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block; height: 0;\n position: absolute; right: 4px; top: 4px; width: 20px; }\n .e-reicon::after { border-bottom: 6px solid transparent; border-left: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block;\n height: 0; left: 4px; position: absolute; top: 4px; width: 20px; z-index: 3; }\n .e-row-helper.e-reicon::after { top: 10px; transform: rotate(90deg); }\n .e-row-helper.e-reicon::before { left: 4px; top: -20px; transform: rotate(90deg); }\n span.e-table-box { background-color: #ffffff; border: 1px solid #BDBDBD; }\n span.e-table-box.e-rbox-select { background-color: #BDBDBD; border: 1px solid #BDBDBD; }\n .e-table-rhelper { background-color: #4a90e2;}\n .e-rtl { direction: rtl; }\n .e-rte-placeholder::before { content: attr(placeholder); opacity: 0.54; overflow: hidden; padding-top: 16px; position: absolute; text-align: start; top: 0; z-index: 1; }\n </style>\n </head>";
|
|
17
|
+
var IFRAMEHEADER = "\n<!DOCTYPE html> \n <html>\n <head>\n <meta charset='utf-8' /> \n <style>\n @charset \"UTF-8\";\n body {\n font-family: \"Roboto\", sans-serif;\n font-size: 14px;\n }\n html, body{height: 100%;margin: 0;}\n body.e-cursor{cursor:default}\n span.e-selected-node\t{background-color: #939393;color: white;}\n span.e-selected-node.e-highlight {background-color: #1d9dd8;}\n body{color:#333;word-wrap:break-word;padding: 8px;box-sizing: border-box;}\n .e-rte-image, .e-rte-audio, .e-rte-video {border: 0;cursor: pointer;display:\n block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imginline, .e-rte-audio.e-audio-inline, .e-rte-video.e-video-inline {display: inline-block;float: none;max-width: calc(100% - (2 * 5px));padding: 1px;vertical-align: bottom;}\n .e-rte-image.e-imgcenter, .e-rte-video.e-video-center {cursor: pointer;display: block;float: none;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imgright, .e-rte-video.e-video-right { float: right; margin: 0 auto;margin-left: 5px;text-align: right;}\n .e-rte-image.e-imgleft, .e-rte-video.e-video-left {float: left;margin: 0 auto;margin-right: 5px;text-align: left;}\n .e-img-caption { display: inline-block; float: none; margin: 5px auto; max-width: 100%;position: relative;}\n .e-img-caption.e-caption-inline {display: inline-block;float: none;\n margin: 5px auto;margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));\n position: relativetext-align: center;vertical-align: bottom;}\n .e-img-inner {box-sizing: border-box;display: block;font-size: 16px;font-weight: initial;\n margin: auto;opacity: .9;text-align: center;width: 100%;}\n .e-img-wrap {display: inline-block;margin: auto;padding: 0;text-align: center;width: 100%;}\n .e-imgleft, .e-video-left {float: left;margin: 0 5px 0 0;text-align: left;}\n .e-imgright, .e-video-right {float: right;margin: 0 0 0 5px;text-align: right;}\n .e-imgcenter, .e-video-center {cursor: pointer;display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-control img:not(.e-resize) {border: 2px solid transparent; z-index: 1000}\n .e-imginline , .e-audio-inline, .e-video-inline {display: inline-block;float: none;margin-left: 5px;margin-right: 5px;\n max-width: calc(100% - (2 * 5px));vertical-align: bottom;}\n .e-imgbreak, .e-audio-break, .e-video-break {border: 0;cursor: pointer;\n display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-img-focus:not(.e-resize), .e-audio-focus:not(.e-resize), .e-video-focus:not(.e-resize) {border: solid 2px #4a90e2;}\n img.e-img-focus::selection, audio.e-audio-focus::selection, .e-video-focus::selection { background: transparent;color: transparent;}\n span.e-rte-imageboxmark, span.e-rte-videoboxmark { width: 10px; height: 10px; position: absolute; display: block;\n background: #4a90e2; border: 1px solid #fff; z-index: 1000;}\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark, .e-mob-rte.e-mob-span span.e-rte-videoboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-mob-rte span.e-rte-imageboxmark, .e-mob-rte span.e-rte-videoboxmark { background: #fff; border: 1px solid #4a90e2;\n border-radius: 15px; height: 20px; width: 20px; }\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark, .e-mob-rte.e-mob-span span.e-rte-videoboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-rte-content .e-content img.e-resize, .e-rte-content .e-content video.e-resize { z-index: 1000; }\n .e-img-caption .e-img-inner { outline: 0; }\n .e-img-caption a:focus-visible { outline: none; }\n .e-img-caption .e-rte-image.e-imgright, .e-img-caption .e-rte-image.e-imgleft { float: none; margin: 0;}\n body{box-sizing: border-box;min-height: 100px;outline: 0 solid transparent;\n overflow-x: auto;padding: 16px;position: relative;text-align: inherit;z-index: 2;}\n p{margin: 0 0 10px;margin-bottom: 10px;}\n li{margin-bottom: 10px;}\n h1{font-size: 2.17em;font-weight: 400;line-height: 1;margin: 10px 0;}\n h2{font-size: 1.74em;font-weight: 400;margin: 10px 0;}\n h3{font-size: 1.31em;font-weight: 400;margin: 10px 0;}\n h4{font-size: 16px;font-weight: 400;line-height: 1.5;margin: 0;}\n h5{font-size: 00.8em;font-weight: 400;margin: 0;}\n h6{font-size: 00.65em;font-weight: 400;margin: 0;}\n blockquote{margin: 10px 0;margin-left: 0;padding-left: 5px;border-left: solid 2px #5c5c5c;}\n pre{background-color: inherit;border: 0;border-radius: 0;color: #333;\n font-size: inherit;line-height: inherit;margin: 0 0 10px;overflow: visible;padding: 0;\n white-space: pre-wrap;word-break: inherit;word-wrap: break-word;}\n strong, b{font-weight: 700;}\n a{text-decoration: none;user-select: auto;}\n a:hover{text-decoration: underline;};\n p:last-child, pre:last-child, blockquote:last-child{margin-bottom: 0;}\n h3+h4, h4+h5, h5+h6{margin-top: 00.6em;}\n ul:last-child{margin-bottom: 0;}\n table { border-collapse: collapse; empty-cells: show;}\n table td,table th {border: 1px solid #BDBDBD; height: 20px; padding: 2px 5px; vertical-align: middle;}\n table.e-alternate-border tbody tr:nth-child(2n) {background-color: #F5F5F5;}\n table th {background-color: #E0E0E0;}\n table.e-dashed-border td,table.e-dashed-border th { border: 1px dashed #BDBDBD} \n table .e-cell-select {border: 1px double #4a90e2;}\n span.e-table-box { cursor: nwse-resize; display: block; height: 10px; position: absolute; width: 10px; }\n span.e-table-box.e-rmob {height: 14px;width: 14px;}\n .e-row-resize, .e-column-resize { background-color: transparent; background-repeat: repeat;\n bottom: 0;cursor: col-resize;height: 1px;overflow: visible;position: absolute;width: 1px; }\n .e-row-resize { cursor: row-resize; height: 1px;}\n .e-table-rhelper { cursor: col-resize; opacity: .87;position: absolute;}\n .e-table-rhelper.e-column-helper { width: 1px; }\n .e-table-rhelper.e-row-helper {height: 1px;}\n .e-reicon::before { border-bottom: 6px solid transparent; border-right: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block; height: 0;\n position: absolute; right: 4px; top: 4px; width: 20px; }\n .e-reicon::after { border-bottom: 6px solid transparent; border-left: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block;\n height: 0; left: 4px; position: absolute; top: 4px; width: 20px; z-index: 3; }\n .e-row-helper.e-reicon::after { top: 10px; transform: rotate(90deg); }\n .e-row-helper.e-reicon::before { left: 4px; top: -20px; transform: rotate(90deg); }\n span.e-table-box { background-color: #ffffff; border: 1px solid #BDBDBD; }\n span.e-table-box.e-rbox-select { background-color: #BDBDBD; border: 1px solid #BDBDBD; }\n .e-table-rhelper { background-color: #4a90e2;}\n .e-rtl { direction: rtl; }\n .e-rte-placeholder::before { content: attr(placeholder); opacity: 0.54; overflow: hidden; padding-top: 16px; position: absolute; text-align: start; top: 0; z-index: 1; }\n </style>\n </head>";
|
|
18
18
|
/**
|
|
19
19
|
* Content module is used to render Rich Text Editor content
|
|
20
20
|
*
|
|
@@ -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;
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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 = ((
|
|
438
|
-
|
|
433
|
+
var currentWidth = ((width / height * expectedY) +
|
|
434
|
+
width / height) <
|
|
439
435
|
(this.parent.inputElement.getBoundingClientRect().right - 32) ?
|
|
440
|
-
((
|
|
441
|
-
|
|
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 = (
|
|
442
|
+
var currentWidth = (width / height * expectedY) <
|
|
447
443
|
(this.parent.inputElement.getBoundingClientRect().right - 32) ?
|
|
448
|
-
(
|
|
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(((
|
|
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
|
-
|
|
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 = (
|
|
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
|
}
|
|
@@ -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
|
}
|
|
@@ -2566,7 +2566,9 @@
|
|
|
2566
2566
|
}
|
|
2567
2567
|
|
|
2568
2568
|
.e-rte-toolbar .e-rte-table-popup .e-insert-table-btn {
|
|
2569
|
-
|
|
2569
|
+
font-weight: 400;
|
|
2570
|
+
border: 1px solid rgba(var(--color-sf-outline));
|
|
2571
|
+
border-radius: 20px;
|
|
2570
2572
|
}
|
|
2571
2573
|
|
|
2572
2574
|
.e-dialog .e-dlg-header-content + .e-dlg-content {
|
|
@@ -3255,6 +3257,10 @@ span.e-table-box.e-rbox-select {
|
|
|
3255
3257
|
border-top-right-radius: 8px;
|
|
3256
3258
|
}
|
|
3257
3259
|
|
|
3260
|
+
.e-rte-toolbar .e-rte-table-popup .e-insert-table-btn {
|
|
3261
|
+
color: rgba(var(--color-sf-on-surface));
|
|
3262
|
+
}
|
|
3263
|
+
|
|
3258
3264
|
.e-richtexteditor.e-rte-tb-expand .e-rte-content-border {
|
|
3259
3265
|
border-bottom: 0;
|
|
3260
3266
|
}
|
package/styles/material3.css
CHANGED
|
@@ -2622,7 +2622,9 @@
|
|
|
2622
2622
|
}
|
|
2623
2623
|
|
|
2624
2624
|
.e-rte-toolbar .e-rte-table-popup .e-insert-table-btn {
|
|
2625
|
-
|
|
2625
|
+
font-weight: 400;
|
|
2626
|
+
border: 1px solid rgba(var(--color-sf-outline));
|
|
2627
|
+
border-radius: 20px;
|
|
2626
2628
|
}
|
|
2627
2629
|
|
|
2628
2630
|
.e-dialog .e-dlg-header-content + .e-dlg-content {
|
|
@@ -3311,6 +3313,10 @@ span.e-table-box.e-rbox-select {
|
|
|
3311
3313
|
border-top-right-radius: 8px;
|
|
3312
3314
|
}
|
|
3313
3315
|
|
|
3316
|
+
.e-rte-toolbar .e-rte-table-popup .e-insert-table-btn {
|
|
3317
|
+
color: rgba(var(--color-sf-on-surface));
|
|
3318
|
+
}
|
|
3319
|
+
|
|
3314
3320
|
.e-richtexteditor.e-rte-tb-expand .e-rte-content-border {
|
|
3315
3321
|
border-bottom: 0;
|
|
3316
3322
|
}
|
|
@@ -2018,7 +2018,9 @@
|
|
|
2018
2018
|
|
|
2019
2019
|
@if $skin-name == 'Material3' {
|
|
2020
2020
|
.e-rte-toolbar .e-rte-table-popup .e-insert-table-btn{
|
|
2021
|
-
|
|
2021
|
+
font-weight: $font-weight;
|
|
2022
|
+
border: 1px solid rgba($info-outline-border);
|
|
2023
|
+
border-radius: 20px;
|
|
2022
2024
|
}
|
|
2023
2025
|
.e-dialog .e-dlg-header-content + .e-dlg-content{
|
|
2024
2026
|
padding-top: 0;
|
|
@@ -822,6 +822,9 @@
|
|
|
822
822
|
.e-bigger .e-rtl .e-rte-toolbar .e-toolbar-items {
|
|
823
823
|
border-top-right-radius: $rte-border-top-right-radius;
|
|
824
824
|
}
|
|
825
|
+
.e-rte-toolbar .e-rte-table-popup .e-insert-table-btn{
|
|
826
|
+
color: $rte-content-color;
|
|
827
|
+
}
|
|
825
828
|
}
|
|
826
829
|
// Blazor styles start
|
|
827
830
|
.e-richtexteditor.e-rte-tb-expand .e-rte-content-border {
|
|
@@ -2566,7 +2566,9 @@
|
|
|
2566
2566
|
}
|
|
2567
2567
|
|
|
2568
2568
|
.e-rte-toolbar .e-rte-table-popup .e-insert-table-btn {
|
|
2569
|
-
|
|
2569
|
+
font-weight: 400;
|
|
2570
|
+
border: 1px solid rgba(var(--color-sf-outline));
|
|
2571
|
+
border-radius: 20px;
|
|
2570
2572
|
}
|
|
2571
2573
|
|
|
2572
2574
|
.e-dialog .e-dlg-header-content + .e-dlg-content {
|
|
@@ -3255,6 +3257,10 @@ span.e-table-box.e-rbox-select {
|
|
|
3255
3257
|
border-top-right-radius: 8px;
|
|
3256
3258
|
}
|
|
3257
3259
|
|
|
3260
|
+
.e-rte-toolbar .e-rte-table-popup .e-insert-table-btn {
|
|
3261
|
+
color: rgba(var(--color-sf-on-surface));
|
|
3262
|
+
}
|
|
3263
|
+
|
|
3258
3264
|
.e-richtexteditor.e-rte-tb-expand .e-rte-content-border {
|
|
3259
3265
|
border-bottom: 0;
|
|
3260
3266
|
}
|
|
@@ -2622,7 +2622,9 @@
|
|
|
2622
2622
|
}
|
|
2623
2623
|
|
|
2624
2624
|
.e-rte-toolbar .e-rte-table-popup .e-insert-table-btn {
|
|
2625
|
-
|
|
2625
|
+
font-weight: 400;
|
|
2626
|
+
border: 1px solid rgba(var(--color-sf-outline));
|
|
2627
|
+
border-radius: 20px;
|
|
2626
2628
|
}
|
|
2627
2629
|
|
|
2628
2630
|
.e-dialog .e-dlg-header-content + .e-dlg-content {
|
|
@@ -3311,6 +3313,10 @@ span.e-table-box.e-rbox-select {
|
|
|
3311
3313
|
border-top-right-radius: 8px;
|
|
3312
3314
|
}
|
|
3313
3315
|
|
|
3316
|
+
.e-rte-toolbar .e-rte-table-popup .e-insert-table-btn {
|
|
3317
|
+
color: rgba(var(--color-sf-on-surface));
|
|
3318
|
+
}
|
|
3319
|
+
|
|
3314
3320
|
.e-richtexteditor.e-rte-tb-expand .e-rte-content-border {
|
|
3315
3321
|
border-bottom: 0;
|
|
3316
3322
|
}
|