@uxf/wysiwyg 11.45.1 → 11.47.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/wysiwyg",
3
- "version": "11.45.1",
3
+ "version": "11.47.0",
4
4
  "description": "UXF Wysiwyg editor",
5
5
  "author": "Robin Dvorak <dvorak@uxf.cz>",
6
6
  "homepage": "https://gitlab.com/uxf-npm/wysiwyg",
@@ -25,9 +25,9 @@
25
25
  "@udecode/plate-reset-node": "20.7.2",
26
26
  "@udecode/plate-select": "20.7.2",
27
27
  "@udecode/plate-trailing-block": "20.7.2",
28
- "@uxf/core": "11.45.0",
29
- "@uxf/core-react": "11.45.0",
30
- "@uxf/ui": "11.45.1",
28
+ "@uxf/core": "11.47.0",
29
+ "@uxf/core-react": "11.47.0",
30
+ "@uxf/ui": "11.47.0",
31
31
  "slate": "0.90.0",
32
32
  "slate-history": "0.86.0",
33
33
  "slate-hyperscript": "0.77.0",
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const url_helper_1 = require("./url-helper");
4
+ describe("UrlHelper", () => {
5
+ describe("hasProtocol", () => {
6
+ it("should return true for valid URLs with http or https protocols", () => {
7
+ expect(url_helper_1.UrlHelper.hasProtocol("https://example.com")).not.toBeNull();
8
+ expect(url_helper_1.UrlHelper.hasProtocol("http://example.com")).not.toBeNull();
9
+ });
10
+ it("should return true for tel protocol", () => {
11
+ expect(url_helper_1.UrlHelper.hasProtocol("tel:+1234567890")).not.toBeNull();
12
+ });
13
+ it("should return true for mailto protocol", () => {
14
+ expect(url_helper_1.UrlHelper.hasProtocol("mailto:test@example.com")).toBeNull();
15
+ });
16
+ it("should return false for invalid URLs", () => {
17
+ expect(url_helper_1.UrlHelper.hasProtocol("example.com")).toBeNull();
18
+ expect(url_helper_1.UrlHelper.hasProtocol("ftp://example.com")).toBeNull();
19
+ expect(url_helper_1.UrlHelper.hasProtocol("")).toBeNull();
20
+ });
21
+ });
22
+ describe("isValid", () => {
23
+ it("should return true for valid URLs", () => {
24
+ expect(url_helper_1.UrlHelper.isValid("https://example.com")).toBe(true);
25
+ expect(url_helper_1.UrlHelper.isValid("http://example.com")).toBe(true);
26
+ expect(url_helper_1.UrlHelper.isValid("example.com")).toBe(true);
27
+ expect(url_helper_1.UrlHelper.isValid("tel:+1234567890")).toBe(true);
28
+ expect(url_helper_1.UrlHelper.isValid("mailto:test@example.com")).toBe(true);
29
+ expect(url_helper_1.UrlHelper.isValid("#section")).toBe(true);
30
+ });
31
+ it("should return false for invalid URLs", () => {
32
+ expect(url_helper_1.UrlHelper.isValid("ftp://example.com")).toBe(false);
33
+ expect(url_helper_1.UrlHelper.isValid("mailto:invalid-email")).toBe(false);
34
+ expect(url_helper_1.UrlHelper.isValid("")).toBe(false);
35
+ });
36
+ });
37
+ });