lakelib 0.1.9 → 0.1.11
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/dist/lake.css +7 -2
- package/dist/lake.min.js +9 -9
- package/dist/lake.min.js.map +1 -1
- package/lib/lake.css +7 -2
- package/lib/lake.js +29 -12
- package/lib/lake.js.map +1 -1
- package/package.json +1 -1
package/lib/lake.css
CHANGED
|
@@ -872,6 +872,8 @@ lake-box[name="image"] .lake-box-selected .lake-image-error {
|
|
|
872
872
|
box-sizing: content-box;
|
|
873
873
|
border: 1px solid transparent;
|
|
874
874
|
border-radius: 4px;
|
|
875
|
+
cursor: default;
|
|
876
|
+
user-select: none;
|
|
875
877
|
}
|
|
876
878
|
.lake-file .lake-file-info {
|
|
877
879
|
display: flex;
|
|
@@ -888,10 +890,13 @@ lake-box[name="image"] .lake-box-selected .lake-image-error {
|
|
|
888
890
|
color: var(--link-color);
|
|
889
891
|
}
|
|
890
892
|
lake-box[name="file"] .lake-box-hovered .lake-file {
|
|
891
|
-
|
|
893
|
+
background-color: var(--box-background-color);
|
|
894
|
+
}
|
|
895
|
+
lake-box[name="file"] .lake-box-selected .lake-file {
|
|
896
|
+
background-color: var(--selection-background-color);
|
|
892
897
|
}
|
|
893
898
|
lake-box[name="file"] .lake-box-focused .lake-file {
|
|
894
|
-
|
|
899
|
+
background-color: var(--selection-background-color);
|
|
895
900
|
}
|
|
896
901
|
/* uploading status */
|
|
897
902
|
.lake-file-uploading .lake-progress {
|
package/lib/lake.js
CHANGED
|
@@ -2718,18 +2718,14 @@ function nodeAndView(node) {
|
|
|
2718
2718
|
if (container.length > 0) {
|
|
2719
2719
|
const viewport = container.closestScroller();
|
|
2720
2720
|
if (viewport.length > 0) {
|
|
2721
|
-
const containerWrapper = container.parent();
|
|
2722
|
-
if (containerWrapper.length > 0) {
|
|
2723
|
-
const nativeContainerWrapper = containerWrapper.get(0);
|
|
2724
|
-
const offsetLeft = nativeContainerWrapper.offsetLeft - window.scrollX;
|
|
2725
|
-
const offsetTop = nativeContainerWrapper.offsetTop - window.scrollY;
|
|
2726
|
-
left -= offsetLeft;
|
|
2727
|
-
right -= offsetLeft;
|
|
2728
|
-
top -= offsetTop;
|
|
2729
|
-
bottom -= offsetTop;
|
|
2730
|
-
}
|
|
2731
2721
|
const nativeViewport = viewport.get(0);
|
|
2732
2722
|
const viewportRect = nativeViewport.getBoundingClientRect();
|
|
2723
|
+
const offsetLeft = viewportRect.x;
|
|
2724
|
+
const offsetTop = viewportRect.y;
|
|
2725
|
+
left -= offsetLeft;
|
|
2726
|
+
right -= offsetLeft;
|
|
2727
|
+
top -= offsetTop;
|
|
2728
|
+
bottom -= offsetTop;
|
|
2733
2729
|
viewportWidth = viewportRect.width;
|
|
2734
2730
|
viewportHeight = viewportRect.height;
|
|
2735
2731
|
}
|
|
@@ -3686,7 +3682,8 @@ function setBlocks(range, value) {
|
|
|
3686
3682
|
return;
|
|
3687
3683
|
}
|
|
3688
3684
|
if (range.isCollapsed) {
|
|
3689
|
-
|
|
3685
|
+
const boxNode = range.commonAncestor.closest('lake-box');
|
|
3686
|
+
if (boxNode.isBlockBox) {
|
|
3690
3687
|
return;
|
|
3691
3688
|
}
|
|
3692
3689
|
}
|
|
@@ -4791,7 +4788,7 @@ class Dropdown {
|
|
|
4791
4788
|
}
|
|
4792
4789
|
}
|
|
4793
4790
|
|
|
4794
|
-
var version = "0.1.
|
|
4791
|
+
var version = "0.1.11";
|
|
4795
4792
|
|
|
4796
4793
|
// Inserts a box into the specified range.
|
|
4797
4794
|
function insertBox(range, boxName, boxValue) {
|
|
@@ -8346,6 +8343,7 @@ var list = (editor) => {
|
|
|
8346
8343
|
}
|
|
8347
8344
|
}
|
|
8348
8345
|
editor.history.save();
|
|
8346
|
+
editor.selection.sync();
|
|
8349
8347
|
},
|
|
8350
8348
|
});
|
|
8351
8349
|
editor.container.on('click', event => {
|
|
@@ -9681,6 +9679,12 @@ var backspaceKey = (editor) => {
|
|
|
9681
9679
|
range.shrinkAfter(prevNode);
|
|
9682
9680
|
return;
|
|
9683
9681
|
}
|
|
9682
|
+
if (prevNode.isText && prevNode.text().length === 1) {
|
|
9683
|
+
event.preventDefault();
|
|
9684
|
+
prevNode.remove();
|
|
9685
|
+
editor.history.save();
|
|
9686
|
+
return;
|
|
9687
|
+
}
|
|
9684
9688
|
range.adaptBox();
|
|
9685
9689
|
}
|
|
9686
9690
|
if (range.isBox) {
|
|
@@ -9706,6 +9710,19 @@ var backspaceKey = (editor) => {
|
|
|
9706
9710
|
editor.history.save();
|
|
9707
9711
|
return;
|
|
9708
9712
|
}
|
|
9713
|
+
if (prevNode.isText && prevNode.text().length === 1) {
|
|
9714
|
+
event.preventDefault();
|
|
9715
|
+
const block = prevNode.closestBlock();
|
|
9716
|
+
range.setStartBefore(prevNode);
|
|
9717
|
+
range.collapseToStart();
|
|
9718
|
+
prevNode.remove();
|
|
9719
|
+
if (block.isEmpty) {
|
|
9720
|
+
appendDeepest(block, query('<br />'));
|
|
9721
|
+
range.shrinkAfter(block);
|
|
9722
|
+
}
|
|
9723
|
+
editor.history.save();
|
|
9724
|
+
return;
|
|
9725
|
+
}
|
|
9709
9726
|
if (prevNode.name === 'br' && prevNode.prev().length > 0) {
|
|
9710
9727
|
event.preventDefault();
|
|
9711
9728
|
range.setStartBefore(prevNode);
|