@codemirror/view 0.19.14 → 0.19.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/CHANGELOG.md +8 -0
- package/dist/index.cjs +12 -20
- package/dist/index.js +12 -20
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 0.19.15 (2021-11-09)
|
|
2
|
+
|
|
3
|
+
### Bug fixes
|
|
4
|
+
|
|
5
|
+
Fix a bug where the editor would think it was invisible when the document body was given screen height and scroll behavior.
|
|
6
|
+
|
|
7
|
+
Fix selection reading inside a shadow root on iOS.
|
|
8
|
+
|
|
1
9
|
## 0.19.14 (2021-11-07)
|
|
2
10
|
|
|
3
11
|
### Bug fixes
|
package/dist/index.cjs
CHANGED
|
@@ -252,19 +252,6 @@ function dispatchKey(elt, name, code) {
|
|
|
252
252
|
elt.dispatchEvent(up);
|
|
253
253
|
return down.defaultPrevented || up.defaultPrevented;
|
|
254
254
|
}
|
|
255
|
-
let _plainTextSupported = null;
|
|
256
|
-
function contentEditablePlainTextSupported() {
|
|
257
|
-
if (_plainTextSupported == null) {
|
|
258
|
-
_plainTextSupported = false;
|
|
259
|
-
let dummy = document.createElement("div");
|
|
260
|
-
try {
|
|
261
|
-
dummy.contentEditable = "plaintext-only";
|
|
262
|
-
_plainTextSupported = dummy.contentEditable == "plaintext-only";
|
|
263
|
-
}
|
|
264
|
-
catch (_) { }
|
|
265
|
-
}
|
|
266
|
-
return _plainTextSupported;
|
|
267
|
-
}
|
|
268
255
|
function getRoot(node) {
|
|
269
256
|
while (node) {
|
|
270
257
|
if (node && (node.nodeType == 9 || node.nodeType == 11 && node.host))
|
|
@@ -4402,18 +4389,20 @@ function visiblePixelRange(dom, paddingTop) {
|
|
|
4402
4389
|
let rect = dom.getBoundingClientRect();
|
|
4403
4390
|
let left = Math.max(0, rect.left), right = Math.min(innerWidth, rect.right);
|
|
4404
4391
|
let top = Math.max(0, rect.top), bottom = Math.min(innerHeight, rect.bottom);
|
|
4405
|
-
|
|
4392
|
+
let body = dom.ownerDocument.body;
|
|
4393
|
+
for (let parent = dom.parentNode; parent && parent != body;) {
|
|
4406
4394
|
if (parent.nodeType == 1) {
|
|
4407
|
-
let
|
|
4408
|
-
|
|
4395
|
+
let elt = parent;
|
|
4396
|
+
let style = window.getComputedStyle(elt);
|
|
4397
|
+
if ((elt.scrollHeight > elt.clientHeight || elt.scrollWidth > elt.clientWidth) &&
|
|
4409
4398
|
style.overflow != "visible") {
|
|
4410
|
-
let parentRect =
|
|
4399
|
+
let parentRect = elt.getBoundingClientRect();
|
|
4411
4400
|
left = Math.max(left, parentRect.left);
|
|
4412
4401
|
right = Math.min(right, parentRect.right);
|
|
4413
4402
|
top = Math.max(top, parentRect.top);
|
|
4414
4403
|
bottom = Math.min(bottom, parentRect.bottom);
|
|
4415
4404
|
}
|
|
4416
|
-
parent = style.position == "absolute" || style.position == "fixed" ?
|
|
4405
|
+
parent = style.position == "absolute" || style.position == "fixed" ? elt.offsetParent : elt.parentNode;
|
|
4417
4406
|
}
|
|
4418
4407
|
else if (parent.nodeType == 11) { // Shadow root
|
|
4419
4408
|
parent = parent.host;
|
|
@@ -4943,7 +4932,10 @@ const baseTheme = buildTheme("." + baseThemeID, {
|
|
|
4943
4932
|
wordWrap: "normal",
|
|
4944
4933
|
boxSizing: "border-box",
|
|
4945
4934
|
padding: "4px 0",
|
|
4946
|
-
outline: "none"
|
|
4935
|
+
outline: "none",
|
|
4936
|
+
"&[contenteditable=true]": {
|
|
4937
|
+
WebkitUserModify: "read-write-plaintext-only",
|
|
4938
|
+
}
|
|
4947
4939
|
},
|
|
4948
4940
|
".cm-lineWrapping": {
|
|
4949
4941
|
whiteSpace: "pre-wrap",
|
|
@@ -5925,7 +5917,7 @@ class EditorView {
|
|
|
5925
5917
|
autocorrect: "off",
|
|
5926
5918
|
autocapitalize: "off",
|
|
5927
5919
|
translate: "no",
|
|
5928
|
-
contenteditable: !this.state.facet(editable) ? "false" :
|
|
5920
|
+
contenteditable: !this.state.facet(editable) ? "false" : "true",
|
|
5929
5921
|
class: "cm-content",
|
|
5930
5922
|
style: `${browser.tabSize}: ${this.state.tabSize}`,
|
|
5931
5923
|
role: "textbox",
|
package/dist/index.js
CHANGED
|
@@ -249,19 +249,6 @@ function dispatchKey(elt, name, code) {
|
|
|
249
249
|
elt.dispatchEvent(up);
|
|
250
250
|
return down.defaultPrevented || up.defaultPrevented;
|
|
251
251
|
}
|
|
252
|
-
let _plainTextSupported = null;
|
|
253
|
-
function contentEditablePlainTextSupported() {
|
|
254
|
-
if (_plainTextSupported == null) {
|
|
255
|
-
_plainTextSupported = false;
|
|
256
|
-
let dummy = document.createElement("div");
|
|
257
|
-
try {
|
|
258
|
-
dummy.contentEditable = "plaintext-only";
|
|
259
|
-
_plainTextSupported = dummy.contentEditable == "plaintext-only";
|
|
260
|
-
}
|
|
261
|
-
catch (_) { }
|
|
262
|
-
}
|
|
263
|
-
return _plainTextSupported;
|
|
264
|
-
}
|
|
265
252
|
function getRoot(node) {
|
|
266
253
|
while (node) {
|
|
267
254
|
if (node && (node.nodeType == 9 || node.nodeType == 11 && node.host))
|
|
@@ -4396,18 +4383,20 @@ function visiblePixelRange(dom, paddingTop) {
|
|
|
4396
4383
|
let rect = dom.getBoundingClientRect();
|
|
4397
4384
|
let left = Math.max(0, rect.left), right = Math.min(innerWidth, rect.right);
|
|
4398
4385
|
let top = Math.max(0, rect.top), bottom = Math.min(innerHeight, rect.bottom);
|
|
4399
|
-
|
|
4386
|
+
let body = dom.ownerDocument.body;
|
|
4387
|
+
for (let parent = dom.parentNode; parent && parent != body;) {
|
|
4400
4388
|
if (parent.nodeType == 1) {
|
|
4401
|
-
let
|
|
4402
|
-
|
|
4389
|
+
let elt = parent;
|
|
4390
|
+
let style = window.getComputedStyle(elt);
|
|
4391
|
+
if ((elt.scrollHeight > elt.clientHeight || elt.scrollWidth > elt.clientWidth) &&
|
|
4403
4392
|
style.overflow != "visible") {
|
|
4404
|
-
let parentRect =
|
|
4393
|
+
let parentRect = elt.getBoundingClientRect();
|
|
4405
4394
|
left = Math.max(left, parentRect.left);
|
|
4406
4395
|
right = Math.min(right, parentRect.right);
|
|
4407
4396
|
top = Math.max(top, parentRect.top);
|
|
4408
4397
|
bottom = Math.min(bottom, parentRect.bottom);
|
|
4409
4398
|
}
|
|
4410
|
-
parent = style.position == "absolute" || style.position == "fixed" ?
|
|
4399
|
+
parent = style.position == "absolute" || style.position == "fixed" ? elt.offsetParent : elt.parentNode;
|
|
4411
4400
|
}
|
|
4412
4401
|
else if (parent.nodeType == 11) { // Shadow root
|
|
4413
4402
|
parent = parent.host;
|
|
@@ -4937,7 +4926,10 @@ const baseTheme = /*@__PURE__*/buildTheme("." + baseThemeID, {
|
|
|
4937
4926
|
wordWrap: "normal",
|
|
4938
4927
|
boxSizing: "border-box",
|
|
4939
4928
|
padding: "4px 0",
|
|
4940
|
-
outline: "none"
|
|
4929
|
+
outline: "none",
|
|
4930
|
+
"&[contenteditable=true]": {
|
|
4931
|
+
WebkitUserModify: "read-write-plaintext-only",
|
|
4932
|
+
}
|
|
4941
4933
|
},
|
|
4942
4934
|
".cm-lineWrapping": {
|
|
4943
4935
|
whiteSpace: "pre-wrap",
|
|
@@ -5919,7 +5911,7 @@ class EditorView {
|
|
|
5919
5911
|
autocorrect: "off",
|
|
5920
5912
|
autocapitalize: "off",
|
|
5921
5913
|
translate: "no",
|
|
5922
|
-
contenteditable: !this.state.facet(editable) ? "false" :
|
|
5914
|
+
contenteditable: !this.state.facet(editable) ? "false" : "true",
|
|
5923
5915
|
class: "cm-content",
|
|
5924
5916
|
style: `${browser.tabSize}: ${this.state.tabSize}`,
|
|
5925
5917
|
role: "textbox",
|