@elliemae/ds-wysiwygeditor 2.0.0-alpha.9 → 2.0.0-next.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.
|
@@ -8,6 +8,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
8
8
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
9
9
|
|
|
10
10
|
const sanitizeProtocol = value => {
|
|
11
|
+
if (typeof value === 'boolean') return value;
|
|
11
12
|
let newVal = value;
|
|
12
13
|
|
|
13
14
|
if (!value.startsWith('http') && !value.startsWith('ftp') && !value.startsWith('mailto:') && !value.startsWith('{{')) {
|
|
@@ -49,7 +50,9 @@ class LinkFormat extends Link {
|
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
static formats(domNode) {
|
|
52
|
-
|
|
53
|
+
var _domNode$getAttribute;
|
|
54
|
+
|
|
55
|
+
return domNode === null || domNode === void 0 ? void 0 : (_domNode$getAttribute = domNode.getAttribute) === null || _domNode$getAttribute === void 0 ? void 0 : _domNode$getAttribute.call(domNode, 'href');
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
static sanitize(url) {
|
|
@@ -57,9 +60,11 @@ class LinkFormat extends Link {
|
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
format(name, value) {
|
|
60
|
-
const newVal = sanitizeProtocol(value);
|
|
63
|
+
const newVal = sanitizeProtocol(value); // Remove link case
|
|
61
64
|
|
|
62
|
-
if (name
|
|
65
|
+
if (name === 'link' && value === false) {
|
|
66
|
+
this.domNode.removeAttribute('href');
|
|
67
|
+
} else if (name !== this.statics.blotName || !newVal) {
|
|
63
68
|
super.format(name, newVal);
|
|
64
69
|
} else {
|
|
65
70
|
this.domNode.setAttribute('href', this.constructor.sanitize(newVal));
|
|
@@ -2,6 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
|
2
2
|
import { Quill } from 'react-quill';
|
|
3
3
|
|
|
4
4
|
const sanitizeProtocol = value => {
|
|
5
|
+
if (typeof value === 'boolean') return value;
|
|
5
6
|
let newVal = value;
|
|
6
7
|
|
|
7
8
|
if (!value.startsWith('http') && !value.startsWith('ftp') && !value.startsWith('mailto:') && !value.startsWith('{{')) {
|
|
@@ -43,7 +44,9 @@ class LinkFormat extends Link {
|
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
static formats(domNode) {
|
|
46
|
-
|
|
47
|
+
var _domNode$getAttribute;
|
|
48
|
+
|
|
49
|
+
return domNode === null || domNode === void 0 ? void 0 : (_domNode$getAttribute = domNode.getAttribute) === null || _domNode$getAttribute === void 0 ? void 0 : _domNode$getAttribute.call(domNode, 'href');
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
static sanitize(url) {
|
|
@@ -51,9 +54,11 @@ class LinkFormat extends Link {
|
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
format(name, value) {
|
|
54
|
-
const newVal = sanitizeProtocol(value);
|
|
57
|
+
const newVal = sanitizeProtocol(value); // Remove link case
|
|
55
58
|
|
|
56
|
-
if (name
|
|
59
|
+
if (name === 'link' && value === false) {
|
|
60
|
+
this.domNode.removeAttribute('href');
|
|
61
|
+
} else if (name !== this.statics.blotName || !newVal) {
|
|
57
62
|
super.format(name, newVal);
|
|
58
63
|
} else {
|
|
59
64
|
this.domNode.setAttribute('href', this.constructor.sanitize(newVal));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-wysiwygeditor",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-next.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - WYSIWYG Editor",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -84,11 +84,11 @@
|
|
|
84
84
|
"build": "node ../../scripts/build/build.js"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@elliemae/ds-basic": "2.0.0-
|
|
88
|
-
"@elliemae/ds-classnames": "2.0.0-
|
|
89
|
-
"@elliemae/ds-imagelibrarymodal": "2.0.0-
|
|
90
|
-
"@elliemae/ds-shared": "2.0.0-
|
|
91
|
-
"@elliemae/ds-uploader": "2.0.0-
|
|
87
|
+
"@elliemae/ds-basic": "2.0.0-next.0",
|
|
88
|
+
"@elliemae/ds-classnames": "2.0.0-next.0",
|
|
89
|
+
"@elliemae/ds-imagelibrarymodal": "2.0.0-next.0",
|
|
90
|
+
"@elliemae/ds-shared": "2.0.0-next.0",
|
|
91
|
+
"@elliemae/ds-uploader": "2.0.0-next.0",
|
|
92
92
|
"immutable": "4.0.0-rc.14",
|
|
93
93
|
"quill-blot-formatter": "~1.0.5",
|
|
94
94
|
"react-quill": "2.0.0-beta1"
|