devexpress-richedit 22.2.13 → 22.2.15
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/bin/gulpfile.js +2 -2
- package/bin/index-custom.js +2 -2
- package/bin/localization-builder.js +2 -2
- package/bin/nspell-index.js +2 -2
- package/bin/nspell.webpack.config.js +2 -2
- package/bin/webpack-externals.js +2 -2
- package/bin/webpack.config.js +2 -2
- package/dist/dx.richedit.d.ts +2 -2
- package/dist/dx.richedit.js +424 -401
- package/dist/dx.richedit.min.js +5 -5
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/lib/base/commands/fields/open-hyperlink-command.js +5 -2
- package/lib/base-utils/utils.d.ts +8 -0
- package/lib/base-utils/utils.js +22 -1
- package/lib/core/model/options/fields.js +1 -2
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DevExpress WebRichEdit (index.d.ts)
|
|
3
|
-
* Version: 22.2.
|
|
4
|
-
* Copyright (c) 2012 -
|
|
3
|
+
* Version: 22.2.15
|
|
4
|
+
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
|
|
5
5
|
* License: https://www.devexpress.com/Support/EULAs
|
|
6
6
|
*/
|
|
7
7
|
export * from './lib/client/public/all';
|
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DevExpress WebRichEdit (index.js)
|
|
3
|
-
* Version: 22.2.
|
|
4
|
-
* Copyright (c) 2012 -
|
|
3
|
+
* Version: 22.2.15
|
|
4
|
+
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
|
|
5
5
|
* License: https://www.devexpress.com/Support/EULAs
|
|
6
6
|
*/
|
|
7
7
|
"use strict";
|
|
@@ -8,6 +8,7 @@ var i_rich_edit_core_1 = require("../../interfaces/i-rich-edit-core");
|
|
|
8
8
|
var client_command_1 = require("../client-command");
|
|
9
9
|
var command_base_1 = require("../command-base");
|
|
10
10
|
var hyperlink_command_base_1 = require("./hyperlink-command-base");
|
|
11
|
+
var utils_1 = require("../../../base-utils/utils");
|
|
11
12
|
var OpenHyperlinkCommand = (function (_super) {
|
|
12
13
|
tslib_1.__extends(OpenHyperlinkCommand, _super);
|
|
13
14
|
function OpenHyperlinkCommand() {
|
|
@@ -35,8 +36,10 @@ var OpenHyperlinkCommand = (function (_super) {
|
|
|
35
36
|
if (hyperlinkInfo.anchor)
|
|
36
37
|
this.control.commandManager.getCommand(client_command_1.RichEditClientCommand.GoToBookmark)
|
|
37
38
|
.execute(this.control.commandManager.isPublicApiCall, new command_base_1.CommandSimpleOptions(this.control, hyperlinkInfo.anchor));
|
|
38
|
-
else
|
|
39
|
-
|
|
39
|
+
else {
|
|
40
|
+
var url = utils_1.UrlUtils.isValid(hyperlinkInfo.uri) ? hyperlinkInfo.uri : utils_1.UrlUtils.EmptyPage;
|
|
41
|
+
url_1.Url.navigate(url, "_blank");
|
|
42
|
+
}
|
|
40
43
|
return true;
|
|
41
44
|
};
|
|
42
45
|
OpenHyperlinkCommand.prototype.isEnabledInReadOnlyMode = function () {
|
|
@@ -10,4 +10,12 @@ export declare function searchTreeItem<T extends {
|
|
|
10
10
|
items?: T[];
|
|
11
11
|
}>(items: T[], comparer: (item: T) => boolean): SearchTreeItemResult<T> | null;
|
|
12
12
|
export declare function convertToFunction(func: any): any | null;
|
|
13
|
+
export interface IUrlValidationOptions {
|
|
14
|
+
allowRelativeUrl?: boolean;
|
|
15
|
+
allowedProtocols?: string[];
|
|
16
|
+
}
|
|
17
|
+
export declare class UrlUtils {
|
|
18
|
+
static EmptyPage: string;
|
|
19
|
+
static isValid(url: string): boolean;
|
|
20
|
+
}
|
|
13
21
|
//# sourceMappingURL=utils.d.ts.map
|
package/lib/base-utils/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertToFunction = exports.searchTreeItem = exports.SearchTreeItemResult = exports.rotatePoint = void 0;
|
|
3
|
+
exports.UrlUtils = exports.convertToFunction = exports.searchTreeItem = exports.SearchTreeItemResult = exports.rotatePoint = void 0;
|
|
4
4
|
var point_1 = require("@devexpress/utils/lib/geometry/point");
|
|
5
5
|
var list_1 = require("@devexpress/utils/lib/utils/list");
|
|
6
6
|
function rotatePoint(point, angle, center) {
|
|
@@ -61,3 +61,24 @@ function convertToFunction(func) {
|
|
|
61
61
|
return null;
|
|
62
62
|
}
|
|
63
63
|
exports.convertToFunction = convertToFunction;
|
|
64
|
+
var disallowedProtocols = [
|
|
65
|
+
'data',
|
|
66
|
+
'javascript'
|
|
67
|
+
];
|
|
68
|
+
var UrlUtils = (function () {
|
|
69
|
+
function UrlUtils() {
|
|
70
|
+
}
|
|
71
|
+
UrlUtils.isValid = function (url) {
|
|
72
|
+
var currentLocation = window.location.href;
|
|
73
|
+
try {
|
|
74
|
+
var resultUrl = new URL(url, currentLocation);
|
|
75
|
+
var protocol = resultUrl.protocol.slice(0, -1);
|
|
76
|
+
return !disallowedProtocols.includes(protocol);
|
|
77
|
+
}
|
|
78
|
+
catch (_a) { }
|
|
79
|
+
return false;
|
|
80
|
+
};
|
|
81
|
+
UrlUtils.EmptyPage = "about:blank";
|
|
82
|
+
return UrlUtils;
|
|
83
|
+
}());
|
|
84
|
+
exports.UrlUtils = UrlUtils;
|
|
@@ -30,9 +30,8 @@ var FieldsSettings = (function () {
|
|
|
30
30
|
this.openHyperlinkOnClick = obj.openHyperlinkOnClick;
|
|
31
31
|
if (common_1.isDefined(obj.keepHyperlinkResultForInvalidReference))
|
|
32
32
|
this.keepHyperlinkResultForInvalidReference = obj.keepHyperlinkResultForInvalidReference;
|
|
33
|
-
if (common_1.isDefined(obj.createHyperlinkTooltip) && obj.createHyperlinkTooltip !== '')
|
|
33
|
+
if (common_1.isDefined(obj.createHyperlinkTooltip) && obj.createHyperlinkTooltip !== '')
|
|
34
34
|
this.createHyperlinkTooltip = utils_1.convertToFunction(obj.createHyperlinkTooltip);
|
|
35
|
-
}
|
|
36
35
|
};
|
|
37
36
|
FieldsSettings.prototype.clone = function () {
|
|
38
37
|
var result = new FieldsSettings();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "devexpress-richedit",
|
|
3
|
-
"version": "22.2.
|
|
3
|
+
"version": "22.2.15",
|
|
4
4
|
"homepage": "https://www.devexpress.com/",
|
|
5
5
|
"bugs": "https://www.devexpress.com/support/",
|
|
6
6
|
"author": "Developer Express Inc.",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"build-nspell": "webpack --mode production --config=bin/nspell.webpack.config.js"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"devextreme": "22.2.
|
|
17
|
+
"devextreme": "22.2.15"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"jszip": "~3.7.0",
|