@syncfusion/ej2-richtexteditor 29.2.4-771571 → 29.2.4-803054
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/dist/ej2-richtexteditor.umd.min.js +1 -1
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +140 -18
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +162 -35
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/package.json +1 -1
- package/src/editor-manager/plugin/clearformat.js +53 -22
- package/src/rich-text-editor/actions/enter-key.js +25 -9
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +4 -0
- package/src/rich-text-editor/actions/paste-clean-up.js +79 -2
- package/src/rich-text-editor/base/rich-text-editor.js +4 -3
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +7 -0
- package/src/rich-text-editor/models/toolbar-settings.d.ts +6 -0
- package/src/rich-text-editor/models/toolbar-settings.js +3 -0
- package/styles/_all.bds.scss +1 -0
- package/styles/_all.bootstrap-dark.scss +1 -0
- package/styles/_all.bootstrap.scss +1 -0
- package/styles/_all.bootstrap4.scss +1 -0
- package/styles/_all.bootstrap5-dark.scss +1 -0
- package/styles/_all.bootstrap5.3.scss +1 -0
- package/styles/_all.bootstrap5.scss +1 -0
- package/styles/_all.fabric-dark.scss +1 -0
- package/styles/_all.fabric.scss +1 -0
- package/styles/_all.fluent-dark.scss +1 -0
- package/styles/_all.fluent.scss +1 -0
- package/styles/_all.fluent2.scss +1 -0
- package/styles/_all.highcontrast-light.scss +1 -0
- package/styles/_all.highcontrast.scss +1 -0
- package/styles/_all.material-dark.scss +1 -0
- package/styles/_all.material.scss +1 -0
- package/styles/_all.material3-dark.scss +1 -0
- package/styles/_all.material3.scss +1 -0
- package/styles/_all.scss +1 -1
- package/styles/_all.tailwind-dark.scss +1 -0
- package/styles/_all.tailwind.scss +1 -0
- package/styles/_all.tailwind3.scss +1 -0
- package/styles/bds-lite.css +239 -89
- package/styles/bds-lite.scss +3 -4
- package/styles/bds.css +347 -98
- package/styles/bds.scss +4 -5
- package/styles/bootstrap-dark-lite.css +206 -86
- package/styles/bootstrap-dark-lite.scss +3 -4
- package/styles/bootstrap-dark.css +299 -95
- package/styles/bootstrap-dark.scss +4 -5
- package/styles/bootstrap-lite.css +384 -86
- package/styles/bootstrap-lite.scss +3 -4
- package/styles/bootstrap.css +566 -95
- package/styles/bootstrap.scss +4 -5
- package/styles/bootstrap4-lite.css +565 -93
- package/styles/bootstrap4-lite.scss +3 -4
- package/styles/bootstrap4.css +850 -115
- package/styles/bootstrap4.scss +4 -5
- package/styles/bootstrap5-dark-lite.css +193 -87
- package/styles/bootstrap5-dark-lite.scss +3 -4
- package/styles/bootstrap5-dark.css +279 -96
- package/styles/bootstrap5-dark.scss +4 -5
- package/styles/bootstrap5-lite.css +187 -87
- package/styles/bootstrap5-lite.scss +4 -4
- package/styles/bootstrap5.3-lite.css +456 -108
- package/styles/bootstrap5.3-lite.scss +4 -4
- package/styles/bootstrap5.3.css +627 -118
- package/styles/bootstrap5.3.scss +5 -5
- package/styles/bootstrap5.css +273 -96
- package/styles/bootstrap5.scss +5 -5
- package/styles/fabric-dark-lite.css +193 -87
- package/styles/fabric-dark-lite.scss +4 -4
- package/styles/fabric-dark.css +279 -96
- package/styles/fabric-dark.scss +5 -5
- package/styles/fabric-lite.css +193 -87
- package/styles/fabric-lite.scss +4 -4
- package/styles/fabric.css +279 -96
- package/styles/fabric.scss +5 -5
- package/styles/fluent-dark-lite.css +195 -98
- package/styles/fluent-dark-lite.scss +4 -4
- package/styles/fluent-dark.css +281 -107
- package/styles/fluent-dark.scss +5 -5
- package/styles/fluent-lite.css +195 -89
- package/styles/fluent-lite.scss +4 -4
- package/styles/fluent.css +281 -98
- package/styles/fluent.scss +5 -5
- package/styles/fluent2-lite.css +519 -114
- package/styles/fluent2-lite.scss +4 -4
- package/styles/fluent2.css +703 -126
- package/styles/fluent2.scss +5 -5
- package/styles/highcontrast-light-lite.css +193 -87
- package/styles/highcontrast-light-lite.scss +4 -4
- package/styles/highcontrast-light.css +279 -96
- package/styles/highcontrast-light.scss +5 -5
- package/styles/highcontrast-lite.css +193 -87
- package/styles/highcontrast-lite.scss +4 -4
- package/styles/highcontrast.css +279 -96
- package/styles/highcontrast.scss +5 -5
- package/styles/material-dark-lite.css +192 -86
- package/styles/material-dark-lite.scss +4 -4
- package/styles/material-dark.css +278 -95
- package/styles/material-dark.scss +5 -5
- package/styles/material-lite.css +192 -86
- package/styles/material-lite.scss +3 -4
- package/styles/material.css +278 -95
- package/styles/material.scss +4 -5
- package/styles/material3-dark-lite.css +539 -105
- package/styles/material3-dark-lite.scss +4 -4
- package/styles/material3-dark.css +723 -130
- package/styles/material3-dark.scss +5 -7
- package/styles/material3-lite.css +459 -105
- package/styles/material3-lite.scss +4 -4
- package/styles/material3.css +645 -130
- package/styles/material3.scss +5 -7
- package/styles/rich-text-editor/_all.bds.scss +2 -0
- package/styles/rich-text-editor/_all.bootstrap-dark.scss +2 -0
- package/styles/rich-text-editor/_all.bootstrap.scss +2 -0
- package/styles/rich-text-editor/_all.bootstrap4.scss +2 -0
- package/styles/rich-text-editor/_all.bootstrap5-dark.scss +2 -0
- package/styles/rich-text-editor/_all.bootstrap5.3.scss +2 -0
- package/styles/rich-text-editor/_all.bootstrap5.scss +2 -0
- package/styles/rich-text-editor/_all.fabric-dark.scss +2 -0
- package/styles/rich-text-editor/_all.fabric.scss +2 -0
- package/styles/rich-text-editor/_all.fluent-dark.scss +2 -0
- package/styles/rich-text-editor/_all.fluent.scss +2 -0
- package/styles/rich-text-editor/_all.fluent2.scss +2 -0
- package/styles/rich-text-editor/_all.highcontrast-light.scss +2 -0
- package/styles/rich-text-editor/_all.highcontrast.scss +2 -0
- package/styles/rich-text-editor/_all.material-dark.scss +2 -0
- package/styles/rich-text-editor/_all.material.scss +2 -0
- package/styles/rich-text-editor/_all.material3-dark.scss +2 -0
- package/styles/rich-text-editor/_all.material3.scss +2 -0
- package/styles/rich-text-editor/_all.scss +2 -2
- package/styles/rich-text-editor/_all.tailwind-dark.scss +2 -0
- package/styles/rich-text-editor/_all.tailwind.scss +2 -0
- package/styles/rich-text-editor/_all.tailwind3.scss +2 -0
- package/styles/rich-text-editor/_bds-definition.scss +468 -27
- package/styles/rich-text-editor/_bigger.bds.scss +3 -0
- package/styles/rich-text-editor/_bigger.bootstrap-dark.scss +3 -0
- package/styles/rich-text-editor/_bigger.bootstrap.scss +3 -0
- package/styles/rich-text-editor/_bigger.bootstrap4.scss +3 -0
- package/styles/rich-text-editor/_bigger.bootstrap5-dark.scss +3 -0
- package/styles/rich-text-editor/_bigger.bootstrap5.3.scss +3 -0
- package/styles/rich-text-editor/_bigger.bootstrap5.scss +3 -0
- package/styles/rich-text-editor/_bigger.fabric-dark.scss +3 -0
- package/styles/rich-text-editor/_bigger.fabric.scss +3 -0
- package/styles/rich-text-editor/_bigger.fluent-dark.scss +3 -0
- package/styles/rich-text-editor/_bigger.fluent.scss +3 -0
- package/styles/rich-text-editor/_bigger.fluent2.scss +3 -0
- package/styles/rich-text-editor/_bigger.highcontrast-light.scss +3 -0
- package/styles/rich-text-editor/_bigger.highcontrast.scss +3 -0
- package/styles/rich-text-editor/_bigger.material-dark.scss +3 -0
- package/styles/rich-text-editor/_bigger.material.scss +3 -0
- package/styles/rich-text-editor/_bigger.material3-dark.scss +3 -0
- package/styles/rich-text-editor/_bigger.material3.scss +3 -0
- package/styles/rich-text-editor/_bigger.scss +152 -57
- package/styles/rich-text-editor/_bigger.tailwind-dark.scss +3 -0
- package/styles/rich-text-editor/_bigger.tailwind.scss +3 -0
- package/styles/rich-text-editor/_bigger.tailwind3.scss +3 -0
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +467 -26
- package/styles/rich-text-editor/_bootstrap-definition.scss +467 -26
- package/styles/rich-text-editor/_bootstrap4-definition.scss +473 -33
- package/styles/rich-text-editor/_bootstrap5-dark-definition.scss +709 -1
- package/styles/rich-text-editor/_bootstrap5-definition.scss +467 -27
- package/styles/rich-text-editor/_bootstrap5.3-definition.scss +469 -29
- package/styles/rich-text-editor/_fabric-dark-definition.scss +467 -27
- package/styles/rich-text-editor/_fabric-definition.scss +466 -27
- package/styles/rich-text-editor/_fluent-dark-definition.scss +710 -1
- package/styles/rich-text-editor/_fluent-definition.scss +470 -27
- package/styles/rich-text-editor/_fluent2-definition.scss +478 -33
- package/styles/rich-text-editor/_fusionnew-definition.scss +464 -26
- package/styles/rich-text-editor/_highcontrast-definition.scss +466 -26
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +466 -26
- package/styles/rich-text-editor/_layout.bds.scss +3 -0
- package/styles/rich-text-editor/_layout.bootstrap-dark.scss +3 -0
- package/styles/rich-text-editor/_layout.bootstrap.scss +3 -0
- package/styles/rich-text-editor/_layout.bootstrap4.scss +3 -0
- package/styles/rich-text-editor/_layout.bootstrap5-dark.scss +3 -0
- package/styles/rich-text-editor/_layout.bootstrap5.3.scss +3 -0
- package/styles/rich-text-editor/_layout.bootstrap5.scss +3 -0
- package/styles/rich-text-editor/_layout.fabric-dark.scss +3 -0
- package/styles/rich-text-editor/_layout.fabric.scss +3 -0
- package/styles/rich-text-editor/_layout.fluent-dark.scss +3 -0
- package/styles/rich-text-editor/_layout.fluent.scss +3 -0
- package/styles/rich-text-editor/_layout.fluent2.scss +3 -0
- package/styles/rich-text-editor/_layout.highcontrast-light.scss +3 -0
- package/styles/rich-text-editor/_layout.highcontrast.scss +3 -0
- package/styles/rich-text-editor/_layout.material-dark.scss +3 -0
- package/styles/rich-text-editor/_layout.material.scss +3 -0
- package/styles/rich-text-editor/_layout.material3-dark.scss +3 -0
- package/styles/rich-text-editor/_layout.material3.scss +3 -0
- package/styles/rich-text-editor/_layout.scss +448 -353
- package/styles/rich-text-editor/_layout.tailwind-dark.scss +3 -0
- package/styles/rich-text-editor/_layout.tailwind.scss +3 -0
- package/styles/rich-text-editor/_layout.tailwind3.scss +3 -0
- package/styles/rich-text-editor/_material-dark-definition.scss +466 -28
- package/styles/rich-text-editor/_material-definition.scss +466 -26
- package/styles/rich-text-editor/_material3-dark-definition.scss +714 -1
- package/styles/rich-text-editor/_material3-definition.scss +473 -30
- package/styles/rich-text-editor/_tailwind-dark-definition.scss +706 -1
- package/styles/rich-text-editor/_tailwind-definition.scss +468 -28
- package/styles/rich-text-editor/_tailwind3-definition.scss +474 -34
- package/styles/rich-text-editor/_theme-variables.bds.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.bootstrap-dark.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.bootstrap.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.bootstrap4.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.bootstrap5-dark.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.bootstrap5.3.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.bootstrap5.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.fabric-dark.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.fabric.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.fluent-dark.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.fluent.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.fluent2.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.highcontrast-light.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.highcontrast.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.material-dark.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.material.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.material3-dark.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.material3.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.tailwind-dark.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.tailwind.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.tailwind3.scss +1 -0
- package/styles/rich-text-editor/_theme.bds.scss +4 -0
- package/styles/rich-text-editor/_theme.bootstrap-dark.scss +4 -0
- package/styles/rich-text-editor/_theme.bootstrap.scss +4 -0
- package/styles/rich-text-editor/_theme.bootstrap4.scss +4 -0
- package/styles/rich-text-editor/_theme.bootstrap5-dark.scss +4 -0
- package/styles/rich-text-editor/_theme.bootstrap5.3.scss +4 -0
- package/styles/rich-text-editor/_theme.bootstrap5.scss +4 -0
- package/styles/rich-text-editor/_theme.fabric-dark.scss +4 -0
- package/styles/rich-text-editor/_theme.fabric.scss +4 -0
- package/styles/rich-text-editor/_theme.fluent-dark.scss +4 -0
- package/styles/rich-text-editor/_theme.fluent.scss +4 -0
- package/styles/rich-text-editor/_theme.fluent2.scss +4 -0
- package/styles/rich-text-editor/_theme.highcontrast-light.scss +4 -0
- package/styles/rich-text-editor/_theme.highcontrast.scss +4 -0
- package/styles/rich-text-editor/_theme.material-dark.scss +4 -0
- package/styles/rich-text-editor/_theme.material.scss +4 -0
- package/styles/rich-text-editor/_theme.material3-dark.scss +4 -0
- package/styles/rich-text-editor/_theme.material3.scss +4 -0
- package/styles/rich-text-editor/_theme.scss +65 -36
- package/styles/rich-text-editor/_theme.tailwind-dark.scss +4 -0
- package/styles/rich-text-editor/_theme.tailwind.scss +4 -0
- package/styles/rich-text-editor/_theme.tailwind3.scss +4 -0
- package/styles/rich-text-editor/bds.css +347 -98
- package/styles/rich-text-editor/bds.scss +5 -5
- package/styles/rich-text-editor/bootstrap-dark.css +299 -95
- package/styles/rich-text-editor/bootstrap-dark.scss +5 -5
- package/styles/rich-text-editor/bootstrap.css +566 -95
- package/styles/rich-text-editor/bootstrap.scss +5 -5
- package/styles/rich-text-editor/bootstrap4.css +850 -115
- package/styles/rich-text-editor/bootstrap4.scss +5 -5
- package/styles/rich-text-editor/bootstrap5-dark.css +279 -96
- package/styles/rich-text-editor/bootstrap5-dark.scss +5 -5
- package/styles/rich-text-editor/bootstrap5.3.css +627 -118
- package/styles/rich-text-editor/bootstrap5.3.scss +5 -5
- package/styles/rich-text-editor/bootstrap5.css +273 -96
- package/styles/rich-text-editor/bootstrap5.scss +5 -5
- package/styles/rich-text-editor/fabric-dark.css +279 -96
- package/styles/rich-text-editor/fabric-dark.scss +5 -5
- package/styles/rich-text-editor/fabric.css +279 -96
- package/styles/rich-text-editor/fabric.scss +5 -5
- package/styles/rich-text-editor/fluent-dark.css +281 -107
- package/styles/rich-text-editor/fluent-dark.scss +5 -5
- package/styles/rich-text-editor/fluent.css +281 -98
- package/styles/rich-text-editor/fluent.scss +5 -5
- package/styles/rich-text-editor/fluent2.css +703 -126
- package/styles/rich-text-editor/fluent2.scss +5 -5
- package/styles/rich-text-editor/highcontrast-light.css +279 -96
- package/styles/rich-text-editor/highcontrast-light.scss +5 -5
- package/styles/rich-text-editor/highcontrast.css +279 -96
- package/styles/rich-text-editor/highcontrast.scss +5 -5
- package/styles/rich-text-editor/icons/_bds.scss +7 -0
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +7 -0
- package/styles/rich-text-editor/icons/_bootstrap.scss +7 -0
- package/styles/rich-text-editor/icons/_bootstrap4.scss +7 -0
- package/styles/rich-text-editor/icons/_bootstrap5-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap5.3.scss +7 -0
- package/styles/rich-text-editor/icons/_bootstrap5.scss +7 -0
- package/styles/rich-text-editor/icons/_fabric-dark.scss +7 -0
- package/styles/rich-text-editor/icons/_fabric.scss +7 -0
- package/styles/rich-text-editor/icons/_fluent-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_fluent.scss +6 -0
- package/styles/rich-text-editor/icons/_fluent2.scss +7 -0
- package/styles/rich-text-editor/icons/_fusionnew.scss +7 -0
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +7 -0
- package/styles/rich-text-editor/icons/_highcontrast.scss +7 -0
- package/styles/rich-text-editor/icons/_material-dark.scss +7 -0
- package/styles/rich-text-editor/icons/_material.scss +7 -0
- package/styles/rich-text-editor/icons/_material3-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_material3.scss +7 -0
- package/styles/rich-text-editor/icons/_tailwind-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_tailwind.scss +7 -0
- package/styles/rich-text-editor/icons/_tailwind3.scss +7 -0
- package/styles/rich-text-editor/material-dark.css +278 -95
- package/styles/rich-text-editor/material-dark.scss +5 -5
- package/styles/rich-text-editor/material.css +278 -95
- package/styles/rich-text-editor/material.scss +5 -5
- package/styles/rich-text-editor/material3-dark.css +723 -130
- package/styles/rich-text-editor/material3-dark.scss +5 -6
- package/styles/rich-text-editor/material3.css +645 -130
- package/styles/rich-text-editor/material3.scss +5 -6
- package/styles/rich-text-editor/tailwind-dark.css +282 -99
- package/styles/rich-text-editor/tailwind-dark.scss +5 -5
- package/styles/rich-text-editor/tailwind.css +282 -99
- package/styles/rich-text-editor/tailwind.scss +5 -5
- package/styles/rich-text-editor/tailwind3.css +593 -115
- package/styles/rich-text-editor/tailwind3.scss +5 -5
- package/styles/tailwind-dark-lite.css +196 -90
- package/styles/tailwind-dark-lite.scss +4 -4
- package/styles/tailwind-dark.css +282 -99
- package/styles/tailwind-dark.scss +5 -5
- package/styles/tailwind-lite.css +196 -90
- package/styles/tailwind-lite.scss +4 -4
- package/styles/tailwind.css +282 -99
- package/styles/tailwind.scss +5 -5
- package/styles/tailwind3-lite.css +430 -104
- package/styles/tailwind3-lite.scss +4 -4
- package/styles/tailwind3.css +593 -115
- package/styles/tailwind3.scss +5 -5
package/package.json
CHANGED
|
@@ -166,54 +166,81 @@ var ClearFormat = /** @class */ (function () {
|
|
|
166
166
|
return parentNodes;
|
|
167
167
|
};
|
|
168
168
|
ClearFormat.unWrap = function (docElement, parentNodes, nodeCutter, nodeSelection) {
|
|
169
|
-
|
|
169
|
+
var _loop_1 = function (index1) {
|
|
170
170
|
parentNodes[index1] = (closest(parentNodes[index1], 'li') && parentNodes[index1].nodeName !== 'UL' && parentNodes[index1].nodeName !== 'OL')
|
|
171
171
|
? closest(parentNodes[index1], 'li')
|
|
172
172
|
: parentNodes[index1];
|
|
173
|
-
if (
|
|
173
|
+
if (this_1.NONVALID_TAGS.indexOf(parentNodes[index1].nodeName.toLowerCase()) > -1
|
|
174
174
|
&& parentNodes[index1].parentNode
|
|
175
|
-
&&
|
|
175
|
+
&& this_1.NONVALID_PARENT_TAGS.indexOf(parentNodes[index1].parentNode.nodeName.toLowerCase()) > -1) {
|
|
176
176
|
nodeSelection.setSelectionText(docElement, parentNodes[index1], parentNodes[index1], 0, parentNodes[index1].childNodes.length);
|
|
177
177
|
InsertMethods.unwrap(nodeCutter.GetSpliceNode(nodeSelection.getRange(docElement), parentNodes[index1].parentNode));
|
|
178
178
|
}
|
|
179
179
|
var blockquoteNode = closest(parentNodes[index1], 'blockquote');
|
|
180
180
|
if (parentNodes[index1].nodeName.toLocaleLowerCase() !== 'blockquote' && !isNullOrUndefined(blockquoteNode) && blockquoteNode.textContent === parentNodes[index1].textContent) {
|
|
181
|
-
var blockNodes =
|
|
182
|
-
|
|
181
|
+
var blockNodes = this_1.removeParent([blockquoteNode]);
|
|
182
|
+
this_1.unWrap(docElement, blockNodes, nodeCutter, nodeSelection);
|
|
183
183
|
}
|
|
184
184
|
if (parentNodes[index1].nodeName.toLocaleLowerCase() !== 'p') {
|
|
185
|
-
if (
|
|
185
|
+
if (this_1.NONVALID_PARENT_TAGS.indexOf(parentNodes[index1].nodeName.toLowerCase()) < 0
|
|
186
186
|
&& !((parentNodes[index1].nodeName.toLocaleLowerCase() === 'blockquote'
|
|
187
187
|
|| parentNodes[index1].nodeName.toLocaleLowerCase() === 'li')
|
|
188
|
-
&&
|
|
188
|
+
&& this_1.IGNORE_PARENT_TAGS.indexOf(parentNodes[index1].childNodes[0].nodeName.toLocaleLowerCase()) > -1)
|
|
189
189
|
&& !(parentNodes[index1].childNodes.length === 1
|
|
190
190
|
&& parentNodes[index1].childNodes[0].nodeName.toLocaleLowerCase() === 'p')) {
|
|
191
|
-
|
|
191
|
+
var target = parentNodes[index1];
|
|
192
|
+
if (['TABLE', 'TD', 'TH', 'TBODY', 'TR'].indexOf(target.nodeName) !== -1) {
|
|
193
|
+
if (target.hasAttribute('style')) {
|
|
194
|
+
target.removeAttribute('style'); // Remove style if present
|
|
195
|
+
}
|
|
196
|
+
if (target.hasAttribute('class')) {
|
|
197
|
+
var allowedClasses_1 = new Set(['e-rte-table', 'e-rte-paste-table', 'e-rte-custom-table']);
|
|
198
|
+
var filteredClasses = target.className
|
|
199
|
+
.split(/\s+/)
|
|
200
|
+
.filter(function (cls) { return allowedClasses_1.has(cls); });
|
|
201
|
+
if (filteredClasses.length > 0) {
|
|
202
|
+
target.className = filteredClasses.join(' ');
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
target.removeAttribute('class');
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
InsertMethods.Wrap(parentNodes[index1], docElement.createElement(this_1.defaultTag));
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
var childNodes = [];
|
|
214
|
+
if (parentNodes[index1].nodeName === 'TABLE' || parentNodes[index1].nodeName === 'TD' || parentNodes[index1].nodeName === 'TH' ||
|
|
215
|
+
parentNodes[index1].nodeName === 'TBODY' || parentNodes[index1].nodeName === 'TR') {
|
|
216
|
+
childNodes = Array.from(parentNodes[index1].childNodes);
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
childNodes = InsertMethods.unwrap(parentNodes[index1]);
|
|
192
220
|
}
|
|
193
|
-
var childNodes = InsertMethods.unwrap(parentNodes[index1]);
|
|
194
221
|
if (childNodes.length === 1
|
|
195
222
|
&& childNodes[0].parentNode.nodeName.toLocaleLowerCase() === 'p') {
|
|
196
|
-
InsertMethods.Wrap(parentNodes[index1], docElement.createElement(
|
|
223
|
+
InsertMethods.Wrap(parentNodes[index1], docElement.createElement(this_1.defaultTag));
|
|
197
224
|
InsertMethods.unwrap(parentNodes[index1]);
|
|
198
225
|
}
|
|
199
226
|
for (var index2 = 0; index2 < childNodes.length; index2++) {
|
|
200
|
-
if (
|
|
201
|
-
|
|
227
|
+
if (this_1.NONVALID_TAGS.indexOf(childNodes[index2].nodeName.toLowerCase()) > -1) {
|
|
228
|
+
this_1.unWrap(docElement, [childNodes[index2]], nodeCutter, nodeSelection);
|
|
202
229
|
}
|
|
203
|
-
else if (
|
|
230
|
+
else if (this_1.BLOCK_TAGS.indexOf(childNodes[index2].nodeName.toLocaleLowerCase()) > -1 &&
|
|
204
231
|
childNodes[index2].nodeName.toLocaleLowerCase() !== 'p') {
|
|
205
|
-
var blockNodes =
|
|
206
|
-
|
|
232
|
+
var blockNodes = this_1.removeParent([childNodes[index2]]);
|
|
233
|
+
this_1.unWrap(docElement, blockNodes, nodeCutter, nodeSelection);
|
|
207
234
|
}
|
|
208
|
-
else if (
|
|
235
|
+
else if (this_1.BLOCK_TAGS.indexOf(childNodes[index2].nodeName.toLocaleLowerCase()) > -1 &&
|
|
209
236
|
childNodes[index2].nodeName.toLocaleLowerCase() === 'p') {
|
|
210
237
|
if (childNodes[index2].parentNode.nodeName.toLocaleLowerCase() === 'p') {
|
|
211
238
|
InsertMethods.unwrap(childNodes[index2].parentNode);
|
|
212
239
|
}
|
|
213
|
-
InsertMethods.Wrap(childNodes[index2], docElement.createElement(
|
|
240
|
+
InsertMethods.Wrap(childNodes[index2], docElement.createElement(this_1.defaultTag));
|
|
214
241
|
InsertMethods.unwrap(childNodes[index2]);
|
|
215
242
|
}
|
|
216
|
-
else if (
|
|
243
|
+
else if (this_1.BLOCK_TAGS.indexOf(childNodes[index2].nodeName.toLocaleLowerCase()) > -1 &&
|
|
217
244
|
childNodes[index2].parentNode.nodeName.toLocaleLowerCase() ===
|
|
218
245
|
childNodes[index2].nodeName.toLocaleLowerCase()) {
|
|
219
246
|
InsertMethods.unwrap(childNodes[index2]);
|
|
@@ -221,9 +248,13 @@ var ClearFormat = /** @class */ (function () {
|
|
|
221
248
|
}
|
|
222
249
|
}
|
|
223
250
|
else {
|
|
224
|
-
InsertMethods.Wrap(parentNodes[index1], docElement.createElement(
|
|
251
|
+
InsertMethods.Wrap(parentNodes[index1], docElement.createElement(this_1.defaultTag));
|
|
225
252
|
InsertMethods.unwrap(parentNodes[index1]);
|
|
226
253
|
}
|
|
254
|
+
};
|
|
255
|
+
var this_1 = this;
|
|
256
|
+
for (var index1 = 0; index1 < parentNodes.length; index1++) {
|
|
257
|
+
_loop_1(index1);
|
|
227
258
|
}
|
|
228
259
|
};
|
|
229
260
|
ClearFormat.clearInlines = function (textNodes, nodes, range, nodeCutter,
|
|
@@ -259,10 +290,10 @@ var ClearFormat = /** @class */ (function () {
|
|
|
259
290
|
ClearFormat.BLOCK_TAGS = ['address', 'article', 'aside', 'blockquote',
|
|
260
291
|
'details', 'dd', 'div', 'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer',
|
|
261
292
|
'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'li', 'main', 'nav',
|
|
262
|
-
'noscript', 'ol', 'p', 'pre', 'section', 'ul'];
|
|
263
|
-
ClearFormat.NONVALID_PARENT_TAGS = ['thead', '
|
|
293
|
+
'noscript', 'ol', 'p', 'pre', 'section', 'ul', 'table', 'td', 'th', 'tbody', 'tr'];
|
|
294
|
+
ClearFormat.NONVALID_PARENT_TAGS = ['thead', 'ul', 'ol', 'tfoot'];
|
|
264
295
|
ClearFormat.IGNORE_PARENT_TAGS = ['ul', 'ol', 'table'];
|
|
265
|
-
ClearFormat.NONVALID_TAGS = ['thead', '
|
|
296
|
+
ClearFormat.NONVALID_TAGS = ['thead', 'figcaption', 'tr', 'tfoot', 'figcaption', 'li'];
|
|
266
297
|
ClearFormat.defaultTag = 'p';
|
|
267
298
|
return ClearFormat;
|
|
268
299
|
}());
|
|
@@ -304,7 +304,7 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
else if (nearBlockNode !== _this.parent.inputElement && nearBlockNode.textContent.length === 0 && !(!isNOU(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG' ||
|
|
307
|
-
(nearBlockNode.querySelectorAll('video').length > 0) || (nearBlockNode.querySelectorAll('audio').length > 0) || (nearBlockNode.querySelectorAll('img').length > 0))) {
|
|
307
|
+
(nearBlockNode.querySelectorAll('video').length > 0) || (nearBlockNode.querySelectorAll('.e-video-wrap').length > 0) || (nearBlockNode.querySelectorAll('audio').length > 0) || (nearBlockNode.querySelectorAll('img').length > 0))) {
|
|
308
308
|
if (!isNOU(nearBlockNode.children[0]) && nearBlockNode.children[0].tagName !== 'BR') {
|
|
309
309
|
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
|
|
310
310
|
_this.parent.formatter.editorManager.domNode.insertAfter(newElem, nearBlockNode);
|
|
@@ -320,7 +320,7 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
320
320
|
else if (_this.range.startContainer === _this.range.endContainer && _this.range.startContainer.nodeType !== Node.TEXT_NODE && ((_this.range.startContainer.nodeName === 'IMG' || _this.range.startContainer.querySelector('img')) ||
|
|
321
321
|
(_this.range.startContainer.nodeName === 'SPAN' && (_this.range.startContainer.classList.contains('e-video-wrap') ||
|
|
322
322
|
_this.range.startContainer.classList.contains('e-audio-wrap'))))) {
|
|
323
|
-
if (nearBlockNode.textContent.trim().length > 0) {
|
|
323
|
+
if (nearBlockNode.textContent.trim().length > 0 && !(nearBlockNode.querySelector('iframe') && nearBlockNode.textContent === '​')) {
|
|
324
324
|
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, true);
|
|
325
325
|
var audioVideoElem = !isNOU(newElem.previousSibling.querySelector('.e-video-wrap')) ?
|
|
326
326
|
newElem.previousSibling.querySelector('.e-video-wrap') : newElem.previousSibling.querySelector('.e-audio-wrap');
|
|
@@ -343,20 +343,32 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
343
343
|
}
|
|
344
344
|
detach(audioVideoElem);
|
|
345
345
|
}
|
|
346
|
+
else if (!isNOU(newElem) && !newElem.hasChildNodes()) {
|
|
347
|
+
var brElm = _this.parent.createElement('br');
|
|
348
|
+
newElem.appendChild(brElm);
|
|
349
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), newElem, 0);
|
|
350
|
+
}
|
|
346
351
|
}
|
|
347
352
|
else {
|
|
348
353
|
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, true);
|
|
349
354
|
var focusElem = newElem.hasChildNodes() ? newElem.previousSibling : newElem;
|
|
350
355
|
var imageElem = !isNOU(newElem.querySelector('img')) ?
|
|
351
356
|
newElem.querySelector('img') : null;
|
|
357
|
+
var videoElem = !isNOU(newElem.querySelector('.e-video-wrap')) ?
|
|
358
|
+
newElem.querySelector('.e-video-wrap') : null;
|
|
352
359
|
var insertElem = _this.createInsertElement(shiftKey_1);
|
|
353
|
-
if (!isNOU(imageElem)) {
|
|
360
|
+
if (!isNOU(imageElem) || !isNOU(videoElem)) {
|
|
354
361
|
if (isFocusedFirst) {
|
|
355
362
|
newElem.parentElement.insertBefore(insertElem, newElem);
|
|
356
363
|
focusElem = newElem.previousSibling;
|
|
357
364
|
}
|
|
358
365
|
else {
|
|
359
366
|
_this.parent.formatter.editorManager.domNode.insertAfter(insertElem, newElem);
|
|
367
|
+
var isVideoInfocusElem = videoElem && focusElem.nodeType === Node.ELEMENT_NODE && focusElem.children.length === 1 && focusElem.lastChild.classList.contains('e-video-wrap');
|
|
368
|
+
if (!isNOU(focusElem) && focusElem !== newElem && newElem.previousSibling === focusElem &&
|
|
369
|
+
isVideoInfocusElem) {
|
|
370
|
+
detach(focusElem);
|
|
371
|
+
}
|
|
360
372
|
focusElem = newElem.nextSibling;
|
|
361
373
|
}
|
|
362
374
|
}
|
|
@@ -491,11 +503,12 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
491
503
|
var isImageElement = (_this.range.startContainer.nodeName === 'IMG' || (_this.range.startContainer.childNodes.length > 0
|
|
492
504
|
&& !isNOU(_this.range.startContainer.childNodes[_this.range.startOffset]) && _this.range.startContainer.childNodes[_this.range.startOffset].nodeName === 'IMG') || (_this.range.startContainer.nodeType === 1 &&
|
|
493
505
|
_this.range.startContainer.querySelector('img') !== null));
|
|
506
|
+
var isImageWithWhiteSpace = _this.range.startContainer.nodeName === '#text' && _this.range.startContainer.textContent.trim() === '' && _this.range.startContainer.textContent.length === 1 && _this.range.startContainer.previousSibling && _this.range.startContainer.previousSibling.nodeName === 'IMG';
|
|
494
507
|
if (currentParent !== _this.parent.inputElement &&
|
|
495
508
|
_this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
|
|
496
509
|
_this.range.startOffset === _this.range.endOffset &&
|
|
497
510
|
(_this.range.startOffset === isLastNodeLength ||
|
|
498
|
-
(currentParent.textContent.trim().length === 0 && isImageElement))) {
|
|
511
|
+
(currentParent.textContent.trim().length === 0 && (isImageElement || isImageWithWhiteSpace)))) {
|
|
499
512
|
var focusBRElem = _this.parent.createElement('br');
|
|
500
513
|
if (_this.range.startOffset === 0 && _this.range.startContainer.nodeName === 'TABLE') {
|
|
501
514
|
_this.range.startContainer.parentElement.insertBefore(focusBRElem, _this.range.startContainer);
|
|
@@ -512,11 +525,17 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
512
525
|
else {
|
|
513
526
|
var lineBreakBRElem = _this.parent.createElement('br');
|
|
514
527
|
var parentElement = _this.range.startContainer.parentElement;
|
|
528
|
+
var startContainer = _this.range.startContainer;
|
|
529
|
+
var isImageInBlock = isImageElement && startContainer.nodeName !== 'IMG' && startContainer.childNodes[_this.range.startOffset - 1] &&
|
|
530
|
+
startContainer.childNodes[_this.range.startOffset - 1].nodeName === 'IMG';
|
|
515
531
|
var anchorElement = void 0;
|
|
516
532
|
if (parentElement && parentElement.nodeName === 'A' &&
|
|
517
533
|
parentElement.textContent.length === _this.range.startOffset) {
|
|
518
534
|
anchorElement = parentElement;
|
|
519
535
|
}
|
|
536
|
+
else if (isImageInBlock) {
|
|
537
|
+
anchorElement = startContainer.childNodes[_this.range.startOffset - 1];
|
|
538
|
+
}
|
|
520
539
|
else if (parentElement) {
|
|
521
540
|
var closestAnchor = parentElement.closest('a');
|
|
522
541
|
anchorElement = closestAnchor ? closestAnchor : _this.range.startContainer;
|
|
@@ -537,7 +556,7 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
537
556
|
if (currentParent.textContent.trim().length === 0 || (currentParent.textContent.trim().length === 1 &&
|
|
538
557
|
currentParent.textContent.charCodeAt(0) === 8203)) {
|
|
539
558
|
if ((currentParent.childElementCount > 0 && currentParent.lastElementChild.nodeName === 'IMG') || (currentParent.lastElementChild && currentParent.lastElementChild.nodeName === 'BR') || !isNOU(currentParent.firstElementChild) &&
|
|
540
|
-
(currentParent.querySelector('.e-video-wrap') || currentParent.querySelector('.e-audio-wrap'))) {
|
|
559
|
+
(currentParent.querySelector('.e-video-wrap') || currentParent.classList.contains('e-video-wrap') || currentParent.querySelector('.e-audio-wrap') || currentParent.classList.contains('e-audio-wrap'))) {
|
|
541
560
|
_this.insertBRElement();
|
|
542
561
|
}
|
|
543
562
|
else {
|
|
@@ -640,9 +659,6 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
640
659
|
}
|
|
641
660
|
else if (this.startNode.tagName === 'SPAN' && (this.startNode.classList.contains('e-video-wrap') || this.startNode.classList.contains('e-audio-wrap'))) {
|
|
642
661
|
this.startNode.parentElement.insertBefore(brElm, this.startNode);
|
|
643
|
-
var nearBlockNode = this.parent.formatter.editorManager.domNode.blockParentNode(this.startNode);
|
|
644
|
-
var newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, true);
|
|
645
|
-
detach(newElem.previousSibling.childNodes[1]);
|
|
646
662
|
isEmptyBrInserted = true;
|
|
647
663
|
}
|
|
648
664
|
else if (this.startNode.nodeType === Node.ELEMENT_NODE && this.startNode.childElementCount > 0 && this.startNode.lastElementChild.nodeName === 'IMG') {
|
|
@@ -655,7 +671,7 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
655
671
|
isEmptyBrInserted = true;
|
|
656
672
|
}
|
|
657
673
|
}
|
|
658
|
-
var isBRNextElement = ((!isNOU(brElm.nextSibling) && (brElm.nextSibling.textContent.length > 0 || brElm.nextSibling.nodeName !== '#text' && brElm.nextSibling.querySelectorAll('audio,video,table,img').length > 0)) || (!isNOU(brElm.nextElementSibling) && brElm.nextElementSibling.tagName === 'BR') || this.range.startContainer.nodeName === 'BR');
|
|
674
|
+
var isBRNextElement = ((!isNOU(brElm.nextSibling) && (brElm.nextSibling.textContent.length > 0 || brElm.nextSibling.nodeName !== '#text' && (brElm.nextSibling.querySelectorAll('audio,video,table,img').length > 0 || brElm.nextSibling.querySelectorAll('.e-video-wrap').length > 0))) || (!isNOU(brElm.nextElementSibling) && brElm.nextElementSibling.tagName === 'BR') || this.range.startContainer.nodeName === 'BR');
|
|
659
675
|
var isMediaElement = !isNOU(brElm.nextSibling) && (!isNOU(brElm.nextSibling.classList) && (brElm.nextSibling.classList.contains('e-video-wrap') || brElm.nextSibling.classList.contains('e-audio-wrap')));
|
|
660
676
|
if (isBRNextElement && (isEmptyBrInserted || (!isNOU(brElm.nextSibling) && brElm.nextSibling.nodeName === '#text' && brElm.nextSibling.textContent.trim().length === 0 && !isNOU(brElm.nextSibling.nextSibling) && brElm.nextSibling.nextSibling.textContent.trim().length > 0))) {
|
|
661
677
|
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), !isNOU(brElm.nextSibling) && isFocusTextNode &&
|
|
@@ -33,6 +33,10 @@ export declare class PasteCleanup {
|
|
|
33
33
|
private destroy;
|
|
34
34
|
private removeEventListener;
|
|
35
35
|
private pasteClean;
|
|
36
|
+
private findSource;
|
|
37
|
+
private extractImageSrcDOM;
|
|
38
|
+
private fetchImageWithMetadata;
|
|
39
|
+
private getFilenameFromUrl;
|
|
36
40
|
private splitBreakLine;
|
|
37
41
|
private makeSpace;
|
|
38
42
|
private imgUploading;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as events from '../base/constant';
|
|
2
2
|
import { Popup } from '@syncfusion/ej2-popups';
|
|
3
3
|
import { RadioButton } from '@syncfusion/ej2-buttons';
|
|
4
|
-
import { isNullOrUndefined as isNOU, isNullOrUndefined, detach, extend, addClass, removeClass } from '@syncfusion/ej2-base';
|
|
4
|
+
import { isNullOrUndefined as isNOU, isNullOrUndefined, detach, extend, addClass, removeClass, createElement } from '@syncfusion/ej2-base';
|
|
5
5
|
import { getUniqueID, Browser, closest } from '@syncfusion/ej2-base';
|
|
6
6
|
import { CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT } from '../base/classes';
|
|
7
7
|
import { CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT } from '../base/classes';
|
|
@@ -13,6 +13,7 @@ import { Uploader } from '@syncfusion/ej2-inputs';
|
|
|
13
13
|
import * as classes from '../base/classes';
|
|
14
14
|
import { sanitizeHelper, convertToBlob } from '../base/util';
|
|
15
15
|
import { scrollToCursor } from '../../common/util';
|
|
16
|
+
import { PASTE_SOURCE } from './../../editor-manager/base';
|
|
16
17
|
/**
|
|
17
18
|
* PasteCleanup module called when pasting content in RichTextEditor
|
|
18
19
|
*/
|
|
@@ -112,7 +113,12 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
112
113
|
}
|
|
113
114
|
if (e.args && value !== null && this.parent.editorMode === 'HTML') {
|
|
114
115
|
var file = void 0;
|
|
115
|
-
|
|
116
|
+
var files = e.args.clipboardData.files;
|
|
117
|
+
var elm = createElement('p');
|
|
118
|
+
elm.innerHTML = value;
|
|
119
|
+
var source = this.findSource(elm);
|
|
120
|
+
var extractedSRC = this.parent.insertImageSettings.uploadRemoteURLs ? this.extractImageSrcDOM(value) : null;
|
|
121
|
+
if (value.length === 0 || (!isNOU(files) && files.length > 0 && source === 'html')) {
|
|
116
122
|
var htmlRegex = new RegExp(/<\/[a-z][\s\S]*>/i);
|
|
117
123
|
value = e.args.clipboardData.getData('text/plain');
|
|
118
124
|
this.parent.trigger(events.beforePasteCleanup, { value: value });
|
|
@@ -155,6 +161,14 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
155
161
|
value = divElement.innerHTML;
|
|
156
162
|
}
|
|
157
163
|
}
|
|
164
|
+
else if (Array.isArray(extractedSRC) && extractedSRC.length &&
|
|
165
|
+
this.parent.insertImageSettings.saveUrl && this.parent.insertImageSettings.path) {
|
|
166
|
+
this.parent.trigger(events.beforePasteCleanup, { value: value });
|
|
167
|
+
for (var i = 0; i < extractedSRC.length; i++) {
|
|
168
|
+
var src = extractedSRC[i];
|
|
169
|
+
this.fetchImageWithMetadata(src);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
158
172
|
else if (value.length > 0) {
|
|
159
173
|
this.parent.trigger(events.beforePasteCleanup, { value: value });
|
|
160
174
|
this.parent.formatter.editorManager.observer.notify(EVENTS.MS_WORD_CLEANUP, {
|
|
@@ -211,6 +225,69 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
211
225
|
}
|
|
212
226
|
}
|
|
213
227
|
};
|
|
228
|
+
PasteCleanup.prototype.findSource = function (element) {
|
|
229
|
+
var metaNodes = element.querySelectorAll('meta');
|
|
230
|
+
for (var i = 0; i < metaNodes.length; i++) {
|
|
231
|
+
var metaNode = metaNodes[i];
|
|
232
|
+
var content = metaNode.getAttribute('content');
|
|
233
|
+
var name_1 = metaNode.getAttribute('name');
|
|
234
|
+
if (name_1 && name_1.toLowerCase().indexOf('generator') >= 0 && content && content.toLowerCase().indexOf('microsoft') >= 0) {
|
|
235
|
+
for (var j = 0; j < PASTE_SOURCE.length; j++) {
|
|
236
|
+
if (content.toLowerCase().indexOf(PASTE_SOURCE[j]) >= 0) {
|
|
237
|
+
return PASTE_SOURCE[j];
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return 'html';
|
|
243
|
+
};
|
|
244
|
+
PasteCleanup.prototype.extractImageSrcDOM = function (value) {
|
|
245
|
+
if (!value || typeof value !== 'string') {
|
|
246
|
+
return null;
|
|
247
|
+
}
|
|
248
|
+
var parser = new DOMParser();
|
|
249
|
+
var doc = parser.parseFromString(value, 'text/html');
|
|
250
|
+
var images = doc.querySelectorAll('img');
|
|
251
|
+
if (images.length === 0) {
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
var srcs = Array.from(images)
|
|
255
|
+
.map(function (img) { return img.getAttribute('src') || img.src || ''; })
|
|
256
|
+
.map(function (src) { return src.trim(); })
|
|
257
|
+
.filter(function (src) { return !!src; })
|
|
258
|
+
// Exclude base64/data URLs, blob URLs, and anything containing "id="
|
|
259
|
+
.filter(function (src) {
|
|
260
|
+
var s = src.toLowerCase();
|
|
261
|
+
return !s.startsWith('data:') && !s.includes('base64') && !s.startsWith('blob:') && !s.includes('id=');
|
|
262
|
+
});
|
|
263
|
+
return srcs.length ? srcs : null;
|
|
264
|
+
};
|
|
265
|
+
PasteCleanup.prototype.fetchImageWithMetadata = function (url) {
|
|
266
|
+
var _this = this;
|
|
267
|
+
fetch(url)
|
|
268
|
+
.then(function (response) {
|
|
269
|
+
if (!response.ok) {
|
|
270
|
+
console.warn("Fetch status " + response.status + " for: " + url);
|
|
271
|
+
return null;
|
|
272
|
+
}
|
|
273
|
+
return response.blob();
|
|
274
|
+
})
|
|
275
|
+
.then(function (blob) {
|
|
276
|
+
if (blob) {
|
|
277
|
+
var filename = _this.getFilenameFromUrl(url) || 'downloaded-image.jpg';
|
|
278
|
+
var mimeType = blob.type || 'image/jpeg';
|
|
279
|
+
var file = new File([blob], filename, { type: mimeType });
|
|
280
|
+
var imageElement = _this.parent.inputElement.querySelector("img[src=\"" + url + "\"]");
|
|
281
|
+
_this.uploadMethod(file, imageElement);
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
};
|
|
285
|
+
// Helper method to extract filename from URL
|
|
286
|
+
PasteCleanup.prototype.getFilenameFromUrl = function (url) {
|
|
287
|
+
var pathname = new URL(url).pathname;
|
|
288
|
+
var filename = pathname.substring(pathname.lastIndexOf('/') + 1);
|
|
289
|
+
return filename || 'image.jpg';
|
|
290
|
+
};
|
|
214
291
|
PasteCleanup.prototype.splitBreakLine = function (value) {
|
|
215
292
|
var enterSplitText = value.split('\r\n\r\n');
|
|
216
293
|
var finalText = '';
|
|
@@ -875,12 +875,13 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
875
875
|
if (!isNOU(this.placeholder)) {
|
|
876
876
|
this.setPlaceHolder();
|
|
877
877
|
}
|
|
878
|
-
if (!isNOU(e) && !isNOU(e.code) && (e.code === 'Backspace' || e.code === 'Delete')) {
|
|
878
|
+
if (!isNOU(e) && !isNOU(e.code) && (e.code === 'Backspace' || e.code === 'Delete' || e.code === 'KeyX')) {
|
|
879
879
|
var range = this.contentModule.getDocument().getSelection().getRangeAt(0);
|
|
880
880
|
var div = document.createElement('div');
|
|
881
881
|
div.appendChild(range.cloneContents());
|
|
882
882
|
var selectedHTML = div.innerHTML;
|
|
883
|
-
if (selectedHTML === this.inputElement.innerHTML
|
|
883
|
+
if (selectedHTML === this.inputElement.innerHTML || (range.commonAncestorContainer === this.inputElement &&
|
|
884
|
+
selectedHTML === this.inputElement.textContent.trim())) {
|
|
884
885
|
this.isCopyAll = true;
|
|
885
886
|
}
|
|
886
887
|
}
|
|
@@ -892,7 +893,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
892
893
|
RichTextEditor.prototype.keyUp = function (e) {
|
|
893
894
|
if (this.editorMode === 'HTML') {
|
|
894
895
|
var range = this.getRange();
|
|
895
|
-
if (!isNOU(e) && !isNOU(e.code) && (e.code === 'Backspace' || e.code === 'Delete')) {
|
|
896
|
+
if (!isNOU(e) && !isNOU(e.code) && (e.code === 'Backspace' || e.code === 'Delete' || e.code === 'KeyX')) {
|
|
896
897
|
// To prevent the reformatting the content removed browser behavior.
|
|
897
898
|
var currentRange = this.getRange();
|
|
898
899
|
var selection = this.iframeSettings.enable ? this.contentModule.getPanel().ownerDocument.getSelection() :
|
|
@@ -201,6 +201,12 @@ export declare class ImageSettings extends ChildProperty<ImageSettings> {
|
|
|
201
201
|
* @default false
|
|
202
202
|
*/
|
|
203
203
|
resizeByPercent: boolean;
|
|
204
|
+
/**
|
|
205
|
+
* Specifies whether to allow uploading remote image URLs.
|
|
206
|
+
*
|
|
207
|
+
* @default false
|
|
208
|
+
*/
|
|
209
|
+
uploadRemoteURLs: boolean;
|
|
204
210
|
}
|
|
205
211
|
/**
|
|
206
212
|
* Configures the audio settings of the RichTextEditor.
|
|
@@ -155,6 +155,9 @@ var ImageSettings = /** @class */ (function (_super) {
|
|
|
155
155
|
__decorate([
|
|
156
156
|
Property(false)
|
|
157
157
|
], ImageSettings.prototype, "resizeByPercent", void 0);
|
|
158
|
+
__decorate([
|
|
159
|
+
Property(false)
|
|
160
|
+
], ImageSettings.prototype, "uploadRemoteURLs", void 0);
|
|
158
161
|
return ImageSettings;
|
|
159
162
|
}(ChildProperty));
|
|
160
163
|
export { ImageSettings };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.bds' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.bootstrap-dark' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.bootstrap' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.bootstrap4' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.bootstrap5-dark' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.bootstrap5.3' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.bootstrap5' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.fabric-dark' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.fabric' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.fluent-dark' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.fluent' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.fluent2' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.highcontrast-light' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.highcontrast' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.material-dark' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.material' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.material3-dark' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.material3' as *;
|
package/styles/_all.scss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use 'rich-text-editor/all' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.tailwind-dark' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.tailwind' as *;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'rich-text-editor/all.tailwind3' as *;
|