lexxy 0.8.6.beta → 0.9.0.beta
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.
- checksums.yaml +4 -4
- data/app/assets/javascript/lexxy.js +23 -7
- data/app/assets/javascript/lexxy.js.br +0 -0
- data/app/assets/javascript/lexxy.js.gz +0 -0
- data/app/assets/javascript/lexxy.js.map +1 -1
- data/app/assets/javascript/lexxy.min.js +1 -1
- data/app/assets/javascript/lexxy.min.js.br +0 -0
- data/app/assets/javascript/lexxy.min.js.gz +0 -0
- data/lib/lexxy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fb166e590d74646ee8cbb992f3dd36774f5cfc84f4552f1ed13b08acad1ad383
|
|
4
|
+
data.tar.gz: dc6638a1acae7c2ff1289790621f80bab042d9f77fe301df34960010878cc23e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1056b0125923bf36c8114a01e39295d42de1e26aeb207cac301ee974e7183655e4025ca430a4b40c1d5418f9ce38cd9e7fd2fec549d24eeb49f4c0bed7aa856a
|
|
7
|
+
data.tar.gz: 3230d626e983c5bff9727515ddf2af0f2037bb2351241821975011601911758721a0aa5df042cf63934ccaaaddabe9609a847c18a1012d5d645b5e900a956600
|
|
@@ -10711,7 +10711,8 @@ class Contents {
|
|
|
10711
10711
|
}
|
|
10712
10712
|
|
|
10713
10713
|
#splitParagraphsAtLineBreaks(selection) {
|
|
10714
|
-
const
|
|
10714
|
+
const anchorKey = selection.anchor.getNode().getKey();
|
|
10715
|
+
const focusKey = selection.focus.getNode().getKey();
|
|
10715
10716
|
const topLevelElements = this.#topLevelElementsInSelection(selection);
|
|
10716
10717
|
|
|
10717
10718
|
for (const element of topLevelElements) {
|
|
@@ -10720,6 +10721,14 @@ class Contents {
|
|
|
10720
10721
|
const children = element.getChildren();
|
|
10721
10722
|
if (!children.some(Zn)) continue
|
|
10722
10723
|
|
|
10724
|
+
// Check whether this paragraph needs splitting: skip only if neither
|
|
10725
|
+
// selection endpoint is inside it (meaning it's a middle paragraph
|
|
10726
|
+
// fully between anchor and focus with no partial lines to split off).
|
|
10727
|
+
const hasEndpoint = children.some(child =>
|
|
10728
|
+
child.getKey() === anchorKey || child.getKey() === focusKey
|
|
10729
|
+
);
|
|
10730
|
+
if (!hasEndpoint) continue
|
|
10731
|
+
|
|
10723
10732
|
const groups = [ [] ];
|
|
10724
10733
|
for (const child of children) {
|
|
10725
10734
|
if (Zn(child)) {
|
|
@@ -10730,8 +10739,6 @@ class Contents {
|
|
|
10730
10739
|
}
|
|
10731
10740
|
}
|
|
10732
10741
|
|
|
10733
|
-
if (groups.every(group => group.some(child => selectedNodeKeys.has(child.getKey())))) continue
|
|
10734
|
-
|
|
10735
10742
|
for (const group of groups) {
|
|
10736
10743
|
if (group.length === 0) continue
|
|
10737
10744
|
const paragraph = Vi();
|
|
@@ -11019,7 +11026,9 @@ class Clipboard {
|
|
|
11019
11026
|
return true
|
|
11020
11027
|
}
|
|
11021
11028
|
|
|
11022
|
-
|
|
11029
|
+
const handled = this.#handlePastedFiles(clipboardData);
|
|
11030
|
+
if (handled) event.preventDefault();
|
|
11031
|
+
return handled
|
|
11023
11032
|
}
|
|
11024
11033
|
|
|
11025
11034
|
#isPlainTextOrURLPasted(clipboardData) {
|
|
@@ -11117,14 +11126,21 @@ class Clipboard {
|
|
|
11117
11126
|
return true
|
|
11118
11127
|
}
|
|
11119
11128
|
|
|
11120
|
-
if (html) {
|
|
11129
|
+
if (html && !this.#isLexicalClipboardData(clipboardData)) {
|
|
11121
11130
|
this.contents.insertHtml(html, { tag: Jn });
|
|
11122
11131
|
return true
|
|
11123
11132
|
}
|
|
11124
11133
|
|
|
11125
|
-
|
|
11134
|
+
if (files.length) {
|
|
11135
|
+
this.#uploadFilesPreservingScroll(files);
|
|
11136
|
+
return true
|
|
11137
|
+
}
|
|
11138
|
+
|
|
11139
|
+
return false
|
|
11140
|
+
}
|
|
11126
11141
|
|
|
11127
|
-
|
|
11142
|
+
#isLexicalClipboardData(clipboardData) {
|
|
11143
|
+
return Array.from(clipboardData.types).includes("application/x-lexical-editor")
|
|
11128
11144
|
}
|
|
11129
11145
|
|
|
11130
11146
|
#isCopiedImageHTML(html) {
|
|
Binary file
|
|
Binary file
|