lakelib 0.1.3 → 0.1.4
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 +1 -1
- package/dist/lake.min.js +2 -2
- package/dist/lake.min.js.map +1 -1
- package/lib/lake.css +1 -1
- package/lib/lake.js +9 -10
- package/lib/lake.js.map +1 -1
- package/lib/types/editor.d.ts +1 -1
- package/lib/types/types/toolbar.d.ts +2 -2
- package/package.json +1 -1
package/lib/lake.css
CHANGED
package/lib/lake.js
CHANGED
|
@@ -4613,7 +4613,7 @@ class Dropdown {
|
|
|
4613
4613
|
}
|
|
4614
4614
|
}
|
|
4615
4615
|
|
|
4616
|
-
var version = "0.1.
|
|
4616
|
+
var version = "0.1.4";
|
|
4617
4617
|
|
|
4618
4618
|
// Inserts a box into the specified range.
|
|
4619
4619
|
function insertBox(range, boxName, boxValue) {
|
|
@@ -5470,13 +5470,13 @@ class Editor {
|
|
|
5470
5470
|
this.emitChangeEvent(value);
|
|
5471
5471
|
});
|
|
5472
5472
|
}
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5473
|
+
// Returns a boolean value indicating whether the editor has focus.
|
|
5474
|
+
get hasFocus() {
|
|
5475
|
+
const activeElement = document.activeElement;
|
|
5476
|
+
if (!activeElement) {
|
|
5477
|
+
return false;
|
|
5478
|
+
}
|
|
5479
|
+
return query(activeElement).closest('.lake-container').get(0) === this.container.get(0);
|
|
5480
5480
|
}
|
|
5481
5481
|
// Returns translation functions by the specified lang.
|
|
5482
5482
|
get locale() {
|
|
@@ -5595,7 +5595,6 @@ class Editor {
|
|
|
5595
5595
|
this.container.append(fragment);
|
|
5596
5596
|
Editor.plugin.loadAll(this);
|
|
5597
5597
|
if (!this.readonly) {
|
|
5598
|
-
this.bindFocusEvents();
|
|
5599
5598
|
this.selection.synByBookmark();
|
|
5600
5599
|
this.history.save();
|
|
5601
5600
|
}
|
|
@@ -9255,7 +9254,7 @@ var escapeKey = (editor) => {
|
|
|
9255
9254
|
selection.addRangeToNativeSelection();
|
|
9256
9255
|
return;
|
|
9257
9256
|
}
|
|
9258
|
-
if (editor.
|
|
9257
|
+
if (editor.hasFocus) {
|
|
9259
9258
|
event.preventDefault();
|
|
9260
9259
|
editor.blur();
|
|
9261
9260
|
}
|