prosemirror-view 1.20.3 → 1.21.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/CHANGELOG.md +10 -0
- package/dist/index.es.js +4 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/browser.js +1 -1
- package/src/index.js +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prosemirror-view",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"description": "ProseMirror's view component",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"ist": "^1.0.0",
|
|
27
|
-
"mocha": "^
|
|
27
|
+
"mocha": "^9.1.2",
|
|
28
28
|
"moduleserve": "^0.7.0",
|
|
29
29
|
"prosemirror-test-builder": "^1.0.0",
|
|
30
30
|
"rollup": "^2.26.3",
|
package/src/browser.js
CHANGED
|
@@ -6,7 +6,6 @@ if (typeof navigator != "undefined" && typeof document != "undefined") {
|
|
|
6
6
|
const ie_upto10 = /MSIE \d/.test(navigator.userAgent)
|
|
7
7
|
const ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent)
|
|
8
8
|
|
|
9
|
-
result.mac = /Mac/.test(navigator.platform)
|
|
10
9
|
let ie = result.ie = !!(ie_upto10 || ie_11up || ie_edge)
|
|
11
10
|
result.ie_version = ie_upto10 ? document.documentMode || 6 : ie_11up ? +ie_11up[1] : ie_edge ? +ie_edge[1] : null
|
|
12
11
|
result.gecko = !ie && /gecko\/(\d+)/i.test(navigator.userAgent)
|
|
@@ -17,6 +16,7 @@ if (typeof navigator != "undefined" && typeof document != "undefined") {
|
|
|
17
16
|
// Is true for both iOS and iPadOS for convenience
|
|
18
17
|
result.safari = !ie && /Apple Computer/.test(navigator.vendor)
|
|
19
18
|
result.ios = result.safari && (/Mobile\/\w+/.test(navigator.userAgent) || navigator.maxTouchPoints > 2)
|
|
19
|
+
result.mac = result.ios || /Mac/.test(navigator.platform)
|
|
20
20
|
result.android = /Android \d/.test(navigator.userAgent)
|
|
21
21
|
result.webkit = "webkitFontSmoothing" in document.documentElement.style
|
|
22
22
|
result.webkit_version = result.webkit && +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1]
|
package/src/index.js
CHANGED
|
@@ -404,6 +404,9 @@ function computeDocDeco(view) {
|
|
|
404
404
|
if (value) for (let attr in value) {
|
|
405
405
|
if (attr == "class")
|
|
406
406
|
attrs.class += " " + value[attr]
|
|
407
|
+
if (attr == "style") {
|
|
408
|
+
attrs.style = (attrs.style ? attrs.style + ";" : "") + value[attr]
|
|
409
|
+
}
|
|
407
410
|
else if (!attrs[attr] && attr != "contenteditable" && attr != "nodeName")
|
|
408
411
|
attrs[attr] = String(value[attr])
|
|
409
412
|
}
|