@sapui5/sap.ui.richtexteditor 1.143.1 → 1.145.0
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/package.json +1 -1
- package/src/sap/ui/richtexteditor/.library +2 -2
- package/src/sap/ui/richtexteditor/RTESplitButton.js +2 -2
- package/src/sap/ui/richtexteditor/RTESplitButtonRenderer.js +1 -1
- package/src/sap/ui/richtexteditor/RichTextEditor.js +25 -18
- package/src/sap/ui/richtexteditor/RichTextEditorFontFamily.js +2 -2
- package/src/sap/ui/richtexteditor/RichTextEditorRenderer.js +10 -4
- package/src/sap/ui/richtexteditor/ToolbarWrapper.js +121 -21
- package/src/sap/ui/richtexteditor/ToolbarWrapperRenderer.js +1 -1
- package/src/sap/ui/richtexteditor/library.js +5 -4
- package/src/sap/ui/richtexteditor/messagebundle_sl.properties +1 -1
- package/src/sap/ui/richtexteditor/themes/base/RichTextEditor.less +18 -19
- package/src/sap/ui/richtexteditor/themes/base/library.source.less +1 -1
- package/src/sap/ui/richtexteditor/themes/sap_belize/library.source.less +1 -1
- package/src/sap/ui/richtexteditor/themes/sap_belize_base/library.source.less +1 -1
- package/src/sap/ui/richtexteditor/themes/sap_belize_hcb/library.source.less +1 -1
- package/src/sap/ui/richtexteditor/themes/sap_belize_hcw/library.source.less +1 -1
- package/src/sap/ui/richtexteditor/themes/sap_belize_plus/library.source.less +1 -1
- package/src/sap/ui/richtexteditor/themes/sap_bluecrystal/library.source.less +1 -1
- package/src/sap/ui/richtexteditor/themes/sap_bluecrystal_base/library.source.less +1 -1
- package/src/sap/ui/richtexteditor/themes/sap_fiori_3/RichTextEditor.less +6 -6
- package/src/sap/ui/richtexteditor/themes/sap_fiori_3/library.source.less +1 -1
- package/src/sap/ui/richtexteditor/themes/sap_fiori_3_dark/RichTextEditor.less +6 -6
- package/src/sap/ui/richtexteditor/themes/sap_fiori_3_dark/library.source.less +1 -1
- package/src/sap/ui/richtexteditor/themes/sap_fiori_3_hcb/RichTextEditor.less +6 -6
- package/src/sap/ui/richtexteditor/themes/sap_fiori_3_hcb/library.source.less +1 -1
- package/src/sap/ui/richtexteditor/themes/sap_fiori_3_hcw/RichTextEditor.less +6 -6
- package/src/sap/ui/richtexteditor/themes/sap_fiori_3_hcw/library.source.less +1 -1
- package/src/sap/ui/richtexteditor/themes/sap_horizon/RichTextEditor.less +9 -9
- package/src/sap/ui/richtexteditor/themes/sap_horizon/library.source.less +1 -1
- package/src/sap/ui/richtexteditor/themes/sap_horizon_dark/RichTextEditor.less +6 -6
- package/src/sap/ui/richtexteditor/themes/sap_horizon_dark/library.source.less +1 -1
- package/src/sap/ui/richtexteditor/themes/sap_horizon_hcb/RichTextEditor.less +3 -3
- package/src/sap/ui/richtexteditor/themes/sap_horizon_hcb/library.source.less +1 -1
- package/src/sap/ui/richtexteditor/themes/sap_horizon_hcw/RichTextEditor.less +3 -3
- package/src/sap/ui/richtexteditor/themes/sap_horizon_hcw/library.source.less +1 -1
package/package.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<name>sap.ui.richtexteditor</name>
|
|
5
5
|
<vendor>SAP SE</vendor>
|
|
6
6
|
<copyright>SAPUI5
|
|
7
|
-
* (c) Copyright
|
|
8
|
-
<version>1.
|
|
7
|
+
* (c) Copyright 2026 SAP SE. All rights reserved.</copyright>
|
|
8
|
+
<version>1.145.0</version>
|
|
9
9
|
|
|
10
10
|
<documentation>A rich text editor (RTE) control. Requires installation of an additional rich text editor library.</documentation>
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright
|
|
3
|
+
* (c) Copyright 2026 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
// Provides control sap.ui.richtexteditor.RTESplitButton.
|
|
6
6
|
sap.ui.define([
|
|
@@ -24,7 +24,7 @@ sap.ui.define([
|
|
|
24
24
|
* @alias sap.ui.richtexteditor.RTESplitButton
|
|
25
25
|
*
|
|
26
26
|
* @author SAP SE
|
|
27
|
-
* @version 1.
|
|
27
|
+
* @version 1.145.0
|
|
28
28
|
*/
|
|
29
29
|
var RTESplitButton = SplitButton.extend("sap.ui.richtexteditor.RTESplitButton", {
|
|
30
30
|
metadata: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright
|
|
3
|
+
* (c) Copyright 2026 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
// Provides default renderer for control sap.ui.richtexteditor.RTESplitButton
|
|
6
6
|
sap.ui.define(['sap/m/SplitButtonRenderer', 'sap/ui/core/Renderer'],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright
|
|
3
|
+
* (c) Copyright 2026 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Provides control sap.ui.richtexteditor.RichTextEditor.
|
|
@@ -88,6 +88,7 @@ sap.ui.define([
|
|
|
88
88
|
*
|
|
89
89
|
* <b>Note: The <code>RichTextEditor</code> uses a third-party component and therefore
|
|
90
90
|
* some additional restrictions apply for its proper usage and support.
|
|
91
|
+
* Use the native third-party API cautiously. Ensure you migrate to newer versions within 12 months of deprecation. Unsupported third-party versions, once deprecated by us, may be removed without notice if critical vulnerabilities or other serious issues are discovered in their code.
|
|
91
92
|
* For more information see the Preamble section in {@link topic:d4f3f1598373452bb73f2120930c133c sap.ui.richtexteditor}.
|
|
92
93
|
* </b>
|
|
93
94
|
*
|
|
@@ -203,7 +204,8 @@ sap.ui.define([
|
|
|
203
204
|
* not an enumeration).
|
|
204
205
|
*
|
|
205
206
|
* <b>Notes:</b>
|
|
206
|
-
* <ul><li>
|
|
207
|
+
* <ul><li>Do not use TinyMCE versions that are no longer supported. We may remove such versions without notice in future releases if critical vulnerabilities or other serious issues are discovered in their code.</li>
|
|
208
|
+
* <li>Setting the property to <code>TinyMCE</code> loads the latest TinyMCE available.</li>
|
|
207
209
|
* <li>Any attempts to set this property after the first rendering will not
|
|
208
210
|
* have any effect.</li>
|
|
209
211
|
* <li>The default value of the property will always resolve to the recommended version by UI5. Due to the different support cycles, we will be constantly getting newer TinyMCE versions and update the default value accordingly.</li>
|
|
@@ -380,7 +382,7 @@ sap.ui.define([
|
|
|
380
382
|
_toolbarWrapper: {type: "sap.ui.richtexteditor.IToolbar", multiple: false, visibility : "hidden", defaultValue: null},
|
|
381
383
|
/**
|
|
382
384
|
* Custom buttons are meant to extend the <code>RichTextEditor</code>'s custom toolbar.
|
|
383
|
-
* Though type is set to sap.ui.Control, only sap.m.Button is allowed.
|
|
385
|
+
* Though type is set to sap.ui.core.Control, only sap.m.Button is allowed.
|
|
384
386
|
* <b>Note:</b> customButtons are available only when the <code>customToolbar</code> is enabled and all the requirements are fulfilled.
|
|
385
387
|
*
|
|
386
388
|
* @since 1.48
|
|
@@ -726,6 +728,8 @@ sap.ui.define([
|
|
|
726
728
|
* Returns the current editor's instance.
|
|
727
729
|
* CAUTION: using the native editor introduces a dependency to that editor and breaks the wrapping character of the RichTextEditor control, so it should only be done in justified cases.
|
|
728
730
|
*
|
|
731
|
+
* <b>Note: Use the native third-party API cautiously. Ensure you migrate to newer versions within 12 months of deprecation. Unsupported third-party versions, once deprecated by us, may be removed without notice if critical vulnerabilities or other serious issues are discovered in their code.</b>
|
|
732
|
+
*
|
|
729
733
|
* @returns {object} The native editor object (here: The TinyMCE editor instance)
|
|
730
734
|
* @public
|
|
731
735
|
*/
|
|
@@ -1283,8 +1287,6 @@ sap.ui.define([
|
|
|
1283
1287
|
this.setProperty("editorType", sEditorType);
|
|
1284
1288
|
sEditorType = this.getEditorType();
|
|
1285
1289
|
|
|
1286
|
-
this._setupToolbar();
|
|
1287
|
-
|
|
1288
1290
|
if (!oEditorMapping[sEditorType]) {
|
|
1289
1291
|
this.setProperty("editorType", RichTextEditor.EDITORTYPE_TINYMCE);
|
|
1290
1292
|
Log.error('Invalid editorType value set. Fallbacks to latest.');
|
|
@@ -1297,6 +1299,7 @@ sap.ui.define([
|
|
|
1297
1299
|
Log.error("TinyMCE version 6 is used as editor type. TinyMCE 6 is deprecated as of version 1.141.0 and will be removed from the code entirely in near future.");
|
|
1298
1300
|
}
|
|
1299
1301
|
|
|
1302
|
+
this._setupToolbar();
|
|
1300
1303
|
this.initTinyMCE();
|
|
1301
1304
|
} else {
|
|
1302
1305
|
Log.error(
|
|
@@ -1633,10 +1636,21 @@ sap.ui.define([
|
|
|
1633
1636
|
switch (this._tinyMCEStatus) {
|
|
1634
1637
|
case EditorStatus.Initial:
|
|
1635
1638
|
case EditorStatus.Initializing:
|
|
1639
|
+
if (this._pTinyMCEInitialized) {
|
|
1640
|
+
this._pTinyMCEInitialized.then(function() {
|
|
1641
|
+
if (this._tinyMCEStatus === EditorStatus.Ready) {
|
|
1642
|
+
this.setValueTinyMCE(sValue);
|
|
1643
|
+
}
|
|
1644
|
+
}.bind(this));
|
|
1645
|
+
}
|
|
1646
|
+
break;
|
|
1647
|
+
|
|
1636
1648
|
case EditorStatus.Loading:
|
|
1637
1649
|
// Ignored - value will be set when TinyMCE is ready
|
|
1638
1650
|
break;
|
|
1639
|
-
|
|
1651
|
+
case EditorStatus.Loaded:
|
|
1652
|
+
// Ignored - value will be set when TinyMCE is ready
|
|
1653
|
+
break;
|
|
1640
1654
|
case EditorStatus.Ready:
|
|
1641
1655
|
this._oEditor.setContent(sValue);
|
|
1642
1656
|
//Reset the undo manager
|
|
@@ -1875,17 +1889,11 @@ sap.ui.define([
|
|
|
1875
1889
|
sPluginsList = sPluginsList.replace(/(,powerpaste|powerpaste,)/gi, "");
|
|
1876
1890
|
}
|
|
1877
1891
|
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
if (bIsTinyMCE6or7) {
|
|
1882
|
-
sPluginsList = this.getPlugins().map(function(oPlugin) {
|
|
1883
|
-
return oPlugin.name;
|
|
1884
|
-
});
|
|
1885
|
-
}
|
|
1886
|
-
|
|
1892
|
+
sPluginsList = this.getPlugins().map(function(oPlugin) {
|
|
1893
|
+
return oPlugin.name;
|
|
1894
|
+
});
|
|
1887
1895
|
|
|
1888
|
-
if (
|
|
1896
|
+
if (!this.getEditable()) {
|
|
1889
1897
|
sPluginsList = sPluginsList.filter(function(oPlugin) {
|
|
1890
1898
|
return oPlugin !== "powerpaste";
|
|
1891
1899
|
});
|
|
@@ -1989,7 +1997,6 @@ sap.ui.define([
|
|
|
1989
1997
|
var oLocale = new Locale(Localization.getLanguage()),
|
|
1990
1998
|
sLanguage = oLocale.getLanguage(),
|
|
1991
1999
|
sRegion = oLocale.getRegion(),
|
|
1992
|
-
bIsTinyMCE6or7 = this.getEditorType() === RichTextEditor.EDITORTYPE_TINYMCE6 || this.getEditorType() === RichTextEditor.EDITORTYPE_TINYMCE || this.getEditorType() === RichTextEditor.EDITORTYPE_TINYMCE7,
|
|
1993
2000
|
sLangStr;
|
|
1994
2001
|
|
|
1995
2002
|
// Language mapping for old/fallback languages
|
|
@@ -1997,7 +2004,7 @@ sap.ui.define([
|
|
|
1997
2004
|
|
|
1998
2005
|
// Find default region, if region is not given
|
|
1999
2006
|
if (!sRegion) {
|
|
2000
|
-
sRegion =
|
|
2007
|
+
sRegion = RichTextEditor.SUPPORTED_LANGUAGES_DEFAULT_REGIONS_TINYMCE7[sLanguage];
|
|
2001
2008
|
}
|
|
2002
2009
|
|
|
2003
2010
|
sLangStr = sRegion ? sLanguage + "_" + sRegion.toUpperCase() : sLanguage;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright
|
|
3
|
+
* (c) Copyright 2026 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Provides control sap.ui.richtexteditor.RichTextEditorFontFamily.
|
|
@@ -22,7 +22,7 @@ sap.ui.define([
|
|
|
22
22
|
* @extends sap.ui.core.Element
|
|
23
23
|
*
|
|
24
24
|
* @author SAP SE
|
|
25
|
-
* @version 1.
|
|
25
|
+
* @version 1.145.0
|
|
26
26
|
*
|
|
27
27
|
* @public
|
|
28
28
|
* @alias sap.ui.richtexteditor.RichTextEditorFontFamily
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright
|
|
3
|
+
* (c) Copyright 2026 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
// Provides default renderer for control sap.ui.richtexteditor.RichTextEditor
|
|
6
6
|
sap.ui.define(["sap/ui/core/Lib"],
|
|
@@ -36,9 +36,15 @@ sap.ui.define(["sap/ui/core/Lib"],
|
|
|
36
36
|
if (oRichTextEditor.getRequired()) {
|
|
37
37
|
rm.class("sapUiRTEReq");
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated As of version 1.97.0
|
|
41
|
+
* @private
|
|
42
|
+
*/
|
|
43
|
+
(() => {
|
|
44
|
+
if (oRichTextEditor.getUseLegacyTheme()) {
|
|
45
|
+
rm.class("sapUiRTELegacyTheme");
|
|
46
|
+
}
|
|
47
|
+
})();
|
|
42
48
|
if (bCustomToolbar) {
|
|
43
49
|
rm.class("sapUiRTEWithCustomToolbar");
|
|
44
50
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright
|
|
3
|
+
* (c) Copyright 2026 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Provides control sap.ui.richtexteditor.ToolbarWrapper.
|
|
@@ -873,7 +873,7 @@ sap.ui.define([
|
|
|
873
873
|
var aDialogContent = oDialog && oDialog.getContent(),
|
|
874
874
|
oSelection, oSelectedNode, sURL, sDisplayText, sTitle,
|
|
875
875
|
bTarget, oSelectionNode, bLinkPartSelected, bSelection,
|
|
876
|
-
sUrlInputPrefixValue;
|
|
876
|
+
sUrlInputPrefixValue, bImageSelected;
|
|
877
877
|
|
|
878
878
|
if (!(aDialogContent instanceof Array) || !aDialogContent.length) {
|
|
879
879
|
return;
|
|
@@ -881,7 +881,15 @@ sap.ui.define([
|
|
|
881
881
|
|
|
882
882
|
oSelection = this.getEditor().getNativeApi().selection;
|
|
883
883
|
oSelectionNode = oSelection.getNode();
|
|
884
|
-
|
|
884
|
+
|
|
885
|
+
bImageSelected = oSelectionNode && oSelectionNode.tagName &&
|
|
886
|
+
oSelectionNode.tagName.toLowerCase() === "img";
|
|
887
|
+
|
|
888
|
+
if (bImageSelected) {
|
|
889
|
+
oSelectedNode = this._getImageAnchor(oSelectionNode);
|
|
890
|
+
} else {
|
|
891
|
+
oSelectedNode = this._getSelectionAnchor(oSelection);
|
|
892
|
+
}
|
|
885
893
|
|
|
886
894
|
if (!oSelectedNode) {
|
|
887
895
|
oSelectedNode = oSelectionNode.parentElement;
|
|
@@ -902,9 +910,17 @@ sap.ui.define([
|
|
|
902
910
|
this._bLinkPrefixChecked = oSelectedNode.getAttribute('data-sap-ui-rte-link-prefix') === "true";
|
|
903
911
|
}
|
|
904
912
|
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
913
|
+
if (bImageSelected) {
|
|
914
|
+
// For images, check if there's an existing link with title, otherwise use alt text
|
|
915
|
+
const oImageAnchor = this._getImageAnchor(oSelectionNode);
|
|
916
|
+
if (oImageAnchor && oImageAnchor.getAttribute('title')) {
|
|
917
|
+
sDisplayText = oImageAnchor.getAttribute('title');
|
|
918
|
+
} else {
|
|
919
|
+
sDisplayText = oSelectionNode.getAttribute('alt') || '';
|
|
920
|
+
}
|
|
921
|
+
} else if (!bSelection || bLinkPartSelected) {
|
|
922
|
+
// if there isn't a selection or a link is partly selected,
|
|
923
|
+
// the display text should be equal to the text of the selection node
|
|
908
924
|
sDisplayText = oSelectedNode.text;
|
|
909
925
|
} else {
|
|
910
926
|
// prevents displaying the whole anchor element as a display text
|
|
@@ -1143,13 +1159,15 @@ sap.ui.define([
|
|
|
1143
1159
|
|
|
1144
1160
|
/**
|
|
1145
1161
|
* Helper function for finding selected anchor HTML node
|
|
1162
|
+
* @param {object} oSelection TinyMCE selection object
|
|
1163
|
+
* @returns {HTMLAnchorElement|null} The selected anchor element or null
|
|
1146
1164
|
* @private
|
|
1147
1165
|
*/
|
|
1148
1166
|
ToolbarWrapper.prototype._getSelectionAnchor = function (oSelection) {
|
|
1149
1167
|
var oSelectionNode, oAnchor;
|
|
1150
1168
|
|
|
1151
1169
|
if (!oSelection) {
|
|
1152
|
-
return;
|
|
1170
|
+
return null;
|
|
1153
1171
|
}
|
|
1154
1172
|
|
|
1155
1173
|
oSelectionNode = oSelection.getNode();
|
|
@@ -1163,6 +1181,83 @@ sap.ui.define([
|
|
|
1163
1181
|
return oAnchor;
|
|
1164
1182
|
};
|
|
1165
1183
|
|
|
1184
|
+
/**
|
|
1185
|
+
* Helper function for finding anchor element that wraps an image
|
|
1186
|
+
* @param {HTMLImageElement} oImageElement The image element
|
|
1187
|
+
* @returns {HTMLAnchorElement|null} The wrapping anchor element or null
|
|
1188
|
+
* @private
|
|
1189
|
+
*/
|
|
1190
|
+
ToolbarWrapper.prototype._getImageAnchor = function (oImageElement) {
|
|
1191
|
+
const oParent = oImageElement && oImageElement.parentElement;
|
|
1192
|
+
return (oParent && oParent.tagName && oParent.tagName.toLowerCase() === "a") ? oParent : null;
|
|
1193
|
+
};
|
|
1194
|
+
|
|
1195
|
+
/**
|
|
1196
|
+
* Handles creating text links in the editor
|
|
1197
|
+
* @param {string} sText The text content for the link
|
|
1198
|
+
* @param {object} oLinkAttrs Link attributes (href, title, target)
|
|
1199
|
+
* @private
|
|
1200
|
+
*/
|
|
1201
|
+
ToolbarWrapper.prototype._handleTextLink = function (sText, oLinkAttrs) {
|
|
1202
|
+
const oNativeEditor = this.getEditor().getNativeApi();
|
|
1203
|
+
|
|
1204
|
+
if (sText !== this.sSelectionTextValue || sText === "") {
|
|
1205
|
+
oNativeEditor.insertContent(oNativeEditor.dom.createHTML('a', oLinkAttrs, oNativeEditor.dom.encode(sText)));
|
|
1206
|
+
} else {
|
|
1207
|
+
oNativeEditor.execCommand('mceInsertLink', false, oLinkAttrs);
|
|
1208
|
+
}
|
|
1209
|
+
};
|
|
1210
|
+
|
|
1211
|
+
/**
|
|
1212
|
+
* Handles wrapping an image with a link or updating an existing image link
|
|
1213
|
+
* @param {HTMLImageElement} oImageElement The image element to link
|
|
1214
|
+
* @param {object} oLinkAttrs Link attributes (href, title, target)
|
|
1215
|
+
* @private
|
|
1216
|
+
*/
|
|
1217
|
+
ToolbarWrapper.prototype._handleImageLink = function (oImageElement, oLinkAttrs) {
|
|
1218
|
+
const oNativeEditor = this.getEditor().getNativeApi();
|
|
1219
|
+
const oExistingAnchor = this._getImageAnchor(oImageElement);
|
|
1220
|
+
|
|
1221
|
+
if (!oExistingAnchor) {
|
|
1222
|
+
const oLinkElement = oNativeEditor.dom.create("a", oLinkAttrs);
|
|
1223
|
+
oNativeEditor.dom.insertAfter(oLinkElement, oImageElement);
|
|
1224
|
+
oLinkElement.appendChild(oImageElement);
|
|
1225
|
+
oNativeEditor.selection.select(oLinkElement);
|
|
1226
|
+
} else {
|
|
1227
|
+
this._updateImageLinkAttributes(oExistingAnchor, oLinkAttrs);
|
|
1228
|
+
}
|
|
1229
|
+
};
|
|
1230
|
+
|
|
1231
|
+
/**
|
|
1232
|
+
* Updates the attributes of an existing image link
|
|
1233
|
+
* @param {HTMLAnchorElement} oAnchorElement The anchor element to update
|
|
1234
|
+
* @param {object} oLinkAttrs Link attributes to update
|
|
1235
|
+
* @private
|
|
1236
|
+
*/
|
|
1237
|
+
ToolbarWrapper.prototype._updateImageLinkAttributes = function (oAnchorElement, oLinkAttrs) {
|
|
1238
|
+
if (oLinkAttrs.href) {
|
|
1239
|
+
oAnchorElement.setAttribute("href", oLinkAttrs.href);
|
|
1240
|
+
}
|
|
1241
|
+
if (oLinkAttrs.title) {
|
|
1242
|
+
oAnchorElement.setAttribute("title", oLinkAttrs.title);
|
|
1243
|
+
}
|
|
1244
|
+
if (oLinkAttrs.target) {
|
|
1245
|
+
oAnchorElement.setAttribute("target", oLinkAttrs.target);
|
|
1246
|
+
}
|
|
1247
|
+
};
|
|
1248
|
+
|
|
1249
|
+
/**
|
|
1250
|
+
* Removes the link wrapper from an image element
|
|
1251
|
+
* @param {HTMLImageElement} oImageElement The image element
|
|
1252
|
+
* @param {HTMLAnchorElement} oAnchorElement The anchor element wrapping the image
|
|
1253
|
+
* @private
|
|
1254
|
+
*/
|
|
1255
|
+
ToolbarWrapper.prototype._removeImageLink = function (oImageElement, oAnchorElement) {
|
|
1256
|
+
const oNativeEditor = this.getEditor().getNativeApi();
|
|
1257
|
+
oNativeEditor.dom.insertAfter(oImageElement, oAnchorElement);
|
|
1258
|
+
oNativeEditor.dom.remove(oAnchorElement);
|
|
1259
|
+
};
|
|
1260
|
+
|
|
1166
1261
|
/**
|
|
1167
1262
|
* Validates and sanitizes a user-provided link field (URL) for safe usage in HTML links.
|
|
1168
1263
|
* - Validates URL syntax and safety
|
|
@@ -1227,18 +1322,27 @@ sap.ui.define([
|
|
|
1227
1322
|
* @private
|
|
1228
1323
|
*/
|
|
1229
1324
|
ToolbarWrapper.prototype.createLink = function (oLinkAttrs, sText) {
|
|
1230
|
-
|
|
1325
|
+
const oNativeEditor = this.getEditor().getNativeApi();
|
|
1326
|
+
const oSelectedNode = oNativeEditor.selection.getNode();
|
|
1327
|
+
const bImageSelected = oSelectedNode && oSelectedNode.tagName &&
|
|
1328
|
+
oSelectedNode.tagName.toLowerCase() === "img";
|
|
1231
1329
|
|
|
1232
|
-
// if there is no url provided
|
|
1330
|
+
// if there is no url provided
|
|
1233
1331
|
if (oLinkAttrs.href === "") {
|
|
1332
|
+
// check if an image is already wrapped in a link and remove it
|
|
1333
|
+
if (bImageSelected) {
|
|
1334
|
+
const oExistingAnchor = this._getImageAnchor(oSelectedNode);
|
|
1335
|
+
if (oExistingAnchor) {
|
|
1336
|
+
this._removeImageLink(oSelectedNode, oExistingAnchor);
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1234
1339
|
return;
|
|
1235
1340
|
}
|
|
1236
1341
|
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
oNativeEditor.insertContent(oNativeEditor.dom.createHTML('a', oLinkAttrs, oNativeEditor.dom.encode(sText)));
|
|
1342
|
+
if (bImageSelected) {
|
|
1343
|
+
this._handleImageLink(oSelectedNode, oLinkAttrs);
|
|
1240
1344
|
} else {
|
|
1241
|
-
|
|
1345
|
+
this._handleTextLink(sText, oLinkAttrs);
|
|
1242
1346
|
}
|
|
1243
1347
|
};
|
|
1244
1348
|
|
|
@@ -1450,15 +1554,11 @@ sap.ui.define([
|
|
|
1450
1554
|
const iRows = Math.min(Math.max(oRowsInput.getValue(), iMinTableCells), iMaxTableCells);
|
|
1451
1555
|
const iCols = Math.min(Math.max(oColsInput.getValue(), iMinTableCells), iMaxTableCells);
|
|
1452
1556
|
|
|
1453
|
-
|
|
1454
|
-
oNativeAPI.execCommand('mceInsertTable', false, { rows: iRows, columns: iCols });
|
|
1557
|
+
oNativeAPI.execCommand('mceInsertTable', false, { rows: iRows, columns: iCols });
|
|
1455
1558
|
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
} else {
|
|
1460
|
-
oTableElm = oNativeAPI.plugins.table.insertTable(iCols, iRows);
|
|
1461
|
-
}
|
|
1559
|
+
oTableElm = oDomRef.getParents(oNativeAPI.selection.getNode()).find(function (element) {
|
|
1560
|
+
return element.tagName.toLowerCase() === "table";
|
|
1561
|
+
});
|
|
1462
1562
|
|
|
1463
1563
|
oDomRef.setStyle(oTableElm, 'width', oDimensionWidthInput.getValue() + "px");
|
|
1464
1564
|
oDomRef.setStyle(oTableElm, 'height', oDimensionHeightInput.getValue() + "px");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright
|
|
3
|
+
* (c) Copyright 2026 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -37,7 +37,7 @@ sap.ui.define([
|
|
|
37
37
|
"sap.ui.richtexteditor.RTESplitButton"
|
|
38
38
|
],
|
|
39
39
|
elements: [],
|
|
40
|
-
version: "1.
|
|
40
|
+
version: "1.145.0"
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
/**
|
|
@@ -52,6 +52,7 @@ sap.ui.define([
|
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* Determines which editor component should be used for editing the text.
|
|
55
|
+
* <b>Note: To ensure stability and to access the latest features, use the most current TinyMCE version supported by your SAPUI5 version by setting the property to <code>TinyMCE</code>. </br> Unsupported TinyMCE versions with critical vulnerabilities or other serious issues may be removed without notice.</b>
|
|
55
56
|
*
|
|
56
57
|
* @enum {string}
|
|
57
58
|
* @public
|
|
@@ -67,8 +68,8 @@ sap.ui.define([
|
|
|
67
68
|
|
|
68
69
|
/**
|
|
69
70
|
* Uses TinyMCE version 6 as editor
|
|
70
|
-
* TinyMCE 6 is no longer supported
|
|
71
|
-
* @
|
|
71
|
+
* @deprecated As of version 1.141, TinyMCE 6 is no longer supported. Use the {@link sap.ui.richtexteditor.EditorType.TinyMCE} instead.
|
|
72
|
+
* @public
|
|
72
73
|
*/
|
|
73
74
|
TinyMCE6: "TinyMCE6",
|
|
74
75
|
|
|
@@ -21,7 +21,7 @@ UNDERLINE_BUTTON_TOOLTIP=Pod\u010Drtano
|
|
|
21
21
|
STRIKETHROUGH_BUTTON_TOOLTIP=Pre\u010Drtano
|
|
22
22
|
|
|
23
23
|
#XTOL: Tooltip for text align menu button
|
|
24
|
-
TEXTALIGN_BUTTON_TOOLTIP=Poravnava
|
|
24
|
+
TEXTALIGN_BUTTON_TOOLTIP=Poravnava besedila
|
|
25
25
|
|
|
26
26
|
#XTOL: Tooltip for text formatBlock menu button
|
|
27
27
|
FORMAT_BUTTON_TOOLTIP=Oblika
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
/* ===================================================== */
|
|
2
|
+
/* CSS for control sap.ui.richtexteditor/RichTextEditor */
|
|
3
|
+
/* Base theme */
|
|
4
|
+
/* ===================================================== */
|
|
5
|
+
|
|
1
6
|
.sapUiRTE {
|
|
2
7
|
display: inline-block;
|
|
3
8
|
min-height: 200px;
|
|
4
|
-
|
|
5
9
|
}
|
|
6
10
|
|
|
7
11
|
.sapUiRTE {
|
|
8
12
|
--_sap_ui_richtexteditor__wrapper-border: 4px;
|
|
9
13
|
}
|
|
10
14
|
|
|
11
|
-
/*
|
|
15
|
+
/* Custom Toolbar */
|
|
12
16
|
|
|
13
17
|
.sapUiRTE.sapUiRTEWithCustomToolbar {
|
|
14
18
|
--_sap_ui_richtexteditor__toolbar_height: 2.75rem;
|
|
@@ -23,7 +27,7 @@
|
|
|
23
27
|
--_sap_ui_richtexteditor__toolbar_height: 2rem;
|
|
24
28
|
}
|
|
25
29
|
|
|
26
|
-
/*
|
|
30
|
+
/* Footer Toolbar */
|
|
27
31
|
|
|
28
32
|
.sapUiRTE .sapUiRTETextAreaWrapper.sapUiRTEFooter {
|
|
29
33
|
--_sap_ui_richtexteditor__footer_height: 2.75rem;
|
|
@@ -38,15 +42,9 @@
|
|
|
38
42
|
--_sap_ui_richtexteditor__footer_height: 2rem;
|
|
39
43
|
}
|
|
40
44
|
|
|
41
|
-
/* This fixes the focus of the split buttons in Edge */
|
|
42
|
-
html[data-sap-ui-browser^="ed"] {
|
|
43
|
-
.sapUiRTE.sapUiRTEWithCustomToolbar .sapUiRTECustomToolbar .sapMBtnBase.sapMSBText .sapMBtnFocusDiv {
|
|
44
|
-
right: 1px;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
45
|
.sapUiRTE .sapUiRteEditorContainer {
|
|
49
46
|
border-radius: 0;
|
|
47
|
+
|
|
50
48
|
.tox-editor-container
|
|
51
49
|
.tox-editor-header {
|
|
52
50
|
padding: 0;
|
|
@@ -62,10 +60,11 @@ html[data-sap-ui-browser^="ed"] {
|
|
|
62
60
|
}
|
|
63
61
|
|
|
64
62
|
.sapUiRTEWithCustomToolbar .sapUiRTETextAreaWrapper {
|
|
65
|
-
border: 1px solid
|
|
63
|
+
border: 1px solid var(--sapField_BorderColor);
|
|
66
64
|
}
|
|
67
65
|
|
|
68
66
|
.sapUiRTEWithCustomToolbar .sapUiRteEditorContainer {
|
|
67
|
+
|
|
69
68
|
.mce-container.mce-panel.mce-first,
|
|
70
69
|
.mce-container.mce-panel.mce-last {
|
|
71
70
|
border: none;
|
|
@@ -82,16 +81,16 @@ svg.rteFontColorIcon {
|
|
|
82
81
|
}
|
|
83
82
|
|
|
84
83
|
svg.rteFontColorIcon path {
|
|
85
|
-
fill:
|
|
84
|
+
fill: var(--sapContent_IconColor);
|
|
86
85
|
}
|
|
87
86
|
|
|
88
87
|
svg.rteFontColorIcon .outline {
|
|
89
88
|
stroke-width: 1.4px;
|
|
90
|
-
stroke
|
|
89
|
+
stroke:var(--sapContent_ForegroundBorderColor);
|
|
91
90
|
}
|
|
92
91
|
|
|
93
92
|
.sapMBtnActive > svg.rteFontColorIcon path {
|
|
94
|
-
fill:
|
|
93
|
+
fill: var(--sapButton_Active_TextColor);
|
|
95
94
|
}
|
|
96
95
|
|
|
97
96
|
.sapUiSizeCompact svg.rteFontColorIcon {
|
|
@@ -100,10 +99,10 @@ svg.rteFontColorIcon .outline {
|
|
|
100
99
|
|
|
101
100
|
.sapUiRTE .sapMSBText .sapMBtnIcon::before {
|
|
102
101
|
text-shadow:
|
|
103
|
-
-1px -1px 0
|
|
104
|
-
1px -1px 0
|
|
105
|
-
-1px 1px 0
|
|
106
|
-
1px 1px 0
|
|
102
|
+
-1px -1px 0 var(--sapContent_ForegroundBorderColor),
|
|
103
|
+
1px -1px 0 var(--sapContent_ForegroundBorderColor),
|
|
104
|
+
-1px 1px 0 var(--sapContent_ForegroundBorderColor),
|
|
105
|
+
1px 1px 0 var(--sapContent_ForegroundBorderColor);
|
|
107
106
|
}
|
|
108
107
|
|
|
109
108
|
.sapUiRTE .sapUiRTETextAreaWrapper {
|
|
@@ -117,4 +116,4 @@ svg.rteFontColorIcon .outline {
|
|
|
117
116
|
|
|
118
117
|
.sapUiRTE .sapUiRTEFooter .sapMIBar .sapMBarRight {
|
|
119
118
|
padding-right: 4px;
|
|
120
|
-
}
|
|
119
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/*
|
|
2
|
-
/* CSS for control sap.ui.richtexteditor
|
|
3
|
-
/*
|
|
4
|
-
/*
|
|
1
|
+
/* ===================================================== */
|
|
2
|
+
/* CSS for control sap.ui.richtexteditor/RichTextEditor */
|
|
3
|
+
/* Quartz Light theme */
|
|
4
|
+
/* ===================================================== */
|
|
5
5
|
|
|
6
6
|
.sapUiRTE {
|
|
7
7
|
--_sap_ui_richtexteditor__wrapper-border: 2px;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.sapUiRTEWithCustomToolbar .sapMTB.sapUiRTECustomToolbar {
|
|
11
|
-
|
|
12
|
-
}
|
|
11
|
+
border-bottom: none;
|
|
12
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/*
|
|
2
|
-
/* CSS for control sap.ui.richtexteditor
|
|
3
|
-
/*
|
|
4
|
-
/*
|
|
1
|
+
/* ===================================================== */
|
|
2
|
+
/* CSS for control sap.ui.richtexteditor/RichTextEditor */
|
|
3
|
+
/* Quartz Dark theme */
|
|
4
|
+
/* ===================================================== */
|
|
5
5
|
|
|
6
6
|
.sapUiRTE {
|
|
7
7
|
--_sap_ui_richtexteditor__wrapper-border: 2px;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.sapUiRTEWithCustomToolbar .sapMTB.sapUiRTECustomToolbar {
|
|
11
|
-
|
|
12
|
-
}
|
|
11
|
+
border-bottom: none;
|
|
12
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*
|
|
2
|
-
/* CSS for control sap.ui.richtexteditor
|
|
3
|
-
/* Quartz High Contrast Black theme
|
|
4
|
-
/*
|
|
1
|
+
/* ===================================================== */
|
|
2
|
+
/* CSS for control sap.ui.richtexteditor/RichTextEditor */
|
|
3
|
+
/* Quartz High Contrast Black theme */
|
|
4
|
+
/* ===================================================== */
|
|
5
5
|
|
|
6
6
|
.sapUiRTEWithCustomToolbar .sapMTB.sapUiRTECustomToolbar {
|
|
7
|
-
|
|
8
|
-
}
|
|
7
|
+
border-bottom: none;
|
|
8
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*
|
|
2
|
-
/* CSS for control sap.ui.richtexteditor
|
|
3
|
-
/* Quartz High Contrast White theme
|
|
4
|
-
/*
|
|
1
|
+
/* ===================================================== */
|
|
2
|
+
/* CSS for control sap.ui.richtexteditor/RichTextEditor */
|
|
3
|
+
/* Quartz High Contrast White theme */
|
|
4
|
+
/* ===================================================== */
|
|
5
5
|
|
|
6
6
|
.sapUiRTEWithCustomToolbar .sapMTB.sapUiRTECustomToolbar {
|
|
7
|
-
|
|
8
|
-
}
|
|
7
|
+
border-bottom: none;
|
|
8
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/*
|
|
2
|
-
/* CSS for control sap.ui.richtexteditor
|
|
3
|
-
/* Horizon theme
|
|
4
|
-
/*
|
|
1
|
+
/* ===================================================== */
|
|
2
|
+
/* CSS for control sap.ui.richtexteditor/RichTextEditor */
|
|
3
|
+
/* Morning Horizon theme */
|
|
4
|
+
/* ===================================================== */
|
|
5
5
|
|
|
6
6
|
.sapUiRTE.sapUiRTEWithCustomToolbar {
|
|
7
7
|
|
|
8
8
|
.sapUiRTETextAreaWrapper {
|
|
9
|
-
border:
|
|
9
|
+
border: var(--sapContent_FocusWidth) solid var(--sapField_Active_BorderColor);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.sapUiRTECustomToolbar.sapMTB.sapMTBStandard {
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
|
|
16
16
|
.sapMBtn:hover > .sapMBtnHoverable:not(.sapMToggleBtnPressed):not(.sapMBtnActive),
|
|
17
17
|
.sapMSB .sapMBtn:not(.sapMBtnDisabled):not(:focus):hover .sapMBtnInner.sapMBtnActive {
|
|
18
|
-
background:
|
|
19
|
-
border-color:
|
|
20
|
-
box-shadow:
|
|
18
|
+
background: var(--sapButton_Hover_Background);
|
|
19
|
+
border-color: var(--sapButton_Hover_BorderColor);
|
|
20
|
+
box-shadow: var(--sapContent_Interaction_Shadow);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.sapMSB .sapMBtn:hover ~ .sapMBtn:not(.sapMSBText) .sapMBtnInner.sapMBtnIconFirst::before {
|
|
@@ -27,4 +27,4 @@
|
|
|
27
27
|
.sapMBtn:not(.sapMSBArrow) .sapMBtnInner .sapMBtnIcon {
|
|
28
28
|
top: 0.0625rem;
|
|
29
29
|
}
|
|
30
|
-
}
|
|
30
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* ===================================================== */
|
|
2
|
-
/* CSS for control sap.ui.richtexteditor
|
|
2
|
+
/* CSS for control sap.ui.richtexteditor/RichTextEditor */
|
|
3
3
|
/* Evening Horizon theme */
|
|
4
4
|
/* ===================================================== */
|
|
5
5
|
|
|
6
6
|
.sapUiRTE.sapUiRTEWithCustomToolbar {
|
|
7
7
|
|
|
8
8
|
.sapUiRTETextAreaWrapper {
|
|
9
|
-
border:
|
|
9
|
+
border: var(--sapContent_FocusWidth) solid var(--sapField_Active_BorderColor);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.sapUiRTECustomToolbar.sapMTB.sapMTBStandard {
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
|
|
16
16
|
.sapMBtn:hover > .sapMBtnHoverable:not(.sapMToggleBtnPressed):not(.sapMBtnActive),
|
|
17
17
|
.sapMSB .sapMBtn:not(.sapMBtnDisabled):not(:focus):hover .sapMBtnInner.sapMBtnActive {
|
|
18
|
-
background:
|
|
19
|
-
border-color:
|
|
20
|
-
box-shadow:
|
|
18
|
+
background: var(--sapButton_Hover_Background);
|
|
19
|
+
border-color: var(--sapButton_Hover_BorderColor);
|
|
20
|
+
box-shadow: var(--sapContent_Interaction_Shadow);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.sapMSB .sapMBtn:hover ~ .sapMBtn:not(.sapMSBText) .sapMBtnInner.sapMBtnIconFirst::before {
|
|
@@ -27,4 +27,4 @@
|
|
|
27
27
|
.sapMBtn:not(.sapMSBArrow) .sapMBtnInner .sapMBtnIcon {
|
|
28
28
|
top: 0.0625rem;
|
|
29
29
|
}
|
|
30
|
-
}
|
|
30
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/* ===================================================== */
|
|
2
|
-
/* CSS for control sap.ui.richtexteditor
|
|
2
|
+
/* CSS for control sap.ui.richtexteditor/RichTextEditor */
|
|
3
3
|
/* Horizon High Contrast Black theme */
|
|
4
4
|
/* ===================================================== */
|
|
5
5
|
|
|
6
6
|
.sapUiRTE.sapUiRTEWithCustomToolbar {
|
|
7
7
|
|
|
8
8
|
.sapUiRTETextAreaWrapper {
|
|
9
|
-
border:
|
|
9
|
+
border: var(--sapContent_FocusWidth) solid var(--sapField_Active_BorderColor);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.sapUiRTECustomToolbar.sapMTB.sapMTBStandard {
|
|
13
13
|
border-bottom: none;
|
|
14
14
|
}
|
|
15
|
-
}
|
|
15
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/* ===================================================== */
|
|
2
|
-
/* CSS for control sap.ui.richtexteditor
|
|
2
|
+
/* CSS for control sap.ui.richtexteditor/RichTextEditor */
|
|
3
3
|
/* Horizon High Contrast White theme */
|
|
4
4
|
/* ===================================================== */
|
|
5
5
|
|
|
6
6
|
.sapUiRTE.sapUiRTEWithCustomToolbar {
|
|
7
7
|
|
|
8
8
|
.sapUiRTETextAreaWrapper {
|
|
9
|
-
border:
|
|
9
|
+
border: var(--sapContent_FocusWidth) solid var(--sapField_Active_BorderColor);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.sapUiRTECustomToolbar.sapMTB.sapMTBStandard {
|
|
13
13
|
border-bottom: none;
|
|
14
14
|
}
|
|
15
|
-
}
|
|
15
|
+
}
|