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 CHANGED
@@ -1,3 +1,13 @@
1
+ ## 1.21.0 (2021-10-29)
2
+
3
+ ### Bug fixes
4
+
5
+ Fix issue where recent Mobile Safari versions weren't treated as Mac platforms.
6
+
7
+ ### New features
8
+
9
+ Multiple `style` properties provided through the `attributes` prop are now merged. Adjust mac detection for recent changes to navigator.platform on iOS
10
+
1
11
  ## 1.20.3 (2021-10-13)
2
12
 
3
13
  ### Bug fixes
package/dist/index.es.js CHANGED
@@ -9,7 +9,6 @@ if (typeof navigator != "undefined" && typeof document != "undefined") {
9
9
  var ie_upto10 = /MSIE \d/.test(navigator.userAgent);
10
10
  var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
11
11
 
12
- result.mac = /Mac/.test(navigator.platform);
13
12
  var ie = result.ie = !!(ie_upto10 || ie_11up || ie_edge);
14
13
  result.ie_version = ie_upto10 ? document.documentMode || 6 : ie_11up ? +ie_11up[1] : ie_edge ? +ie_edge[1] : null;
15
14
  result.gecko = !ie && /gecko\/(\d+)/i.test(navigator.userAgent);
@@ -20,6 +19,7 @@ if (typeof navigator != "undefined" && typeof document != "undefined") {
20
19
  // Is true for both iOS and iPadOS for convenience
21
20
  result.safari = !ie && /Apple Computer/.test(navigator.vendor);
22
21
  result.ios = result.safari && (/Mobile\/\w+/.test(navigator.userAgent) || navigator.maxTouchPoints > 2);
22
+ result.mac = result.ios || /Mac/.test(navigator.platform);
23
23
  result.android = /Android \d/.test(navigator.userAgent);
24
24
  result.webkit = "webkitFontSmoothing" in document.documentElement.style;
25
25
  result.webkit_version = result.webkit && +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1];
@@ -5185,6 +5185,9 @@ function computeDocDeco(view) {
5185
5185
  if (value) { for (var attr in value) {
5186
5186
  if (attr == "class")
5187
5187
  { attrs.class += " " + value[attr]; }
5188
+ if (attr == "style") {
5189
+ attrs.style = (attrs.style ? attrs.style + ";" : "") + value[attr];
5190
+ }
5188
5191
  else if (!attrs[attr] && attr != "contenteditable" && attr != "nodeName")
5189
5192
  { attrs[attr] = String(value[attr]); }
5190
5193
  } }