lakelib 0.1.4 → 0.1.5
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.min.js +2 -2
- package/dist/lake.min.js.map +1 -1
- package/lib/lake.js +12 -11
- package/lib/lake.js.map +1 -1
- package/lib/types/editor.d.ts +1 -1
- package/lib/types/types/object.d.ts +1 -1
- package/lib/types/ui/toolbar.d.ts +2 -2
- package/package.json +1 -1
package/lib/lake.js
CHANGED
|
@@ -3441,7 +3441,8 @@ function deleteContents(range) {
|
|
|
3441
3441
|
if (range.isCollapsed) {
|
|
3442
3442
|
return;
|
|
3443
3443
|
}
|
|
3444
|
-
range.
|
|
3444
|
+
range.adaptBox();
|
|
3445
|
+
range.adaptTable();
|
|
3445
3446
|
if (range.isInoperative) {
|
|
3446
3447
|
return;
|
|
3447
3448
|
}
|
|
@@ -4613,7 +4614,7 @@ class Dropdown {
|
|
|
4613
4614
|
}
|
|
4614
4615
|
}
|
|
4615
4616
|
|
|
4616
|
-
var version = "0.1.
|
|
4617
|
+
var version = "0.1.5";
|
|
4617
4618
|
|
|
4618
4619
|
// Inserts a box into the specified range.
|
|
4619
4620
|
function insertBox(range, boxName, boxValue) {
|
|
@@ -5210,7 +5211,7 @@ class Plugin {
|
|
|
5210
5211
|
}
|
|
5211
5212
|
|
|
5212
5213
|
const defaultConfig = {
|
|
5213
|
-
value: '<p><br
|
|
5214
|
+
value: '<p><br /></p>',
|
|
5214
5215
|
readonly: false,
|
|
5215
5216
|
spellcheck: false,
|
|
5216
5217
|
tabIndex: 0,
|
|
@@ -5221,7 +5222,7 @@ const defaultConfig = {
|
|
|
5221
5222
|
class Editor {
|
|
5222
5223
|
constructor(config) {
|
|
5223
5224
|
this.unsavedInputData = '';
|
|
5224
|
-
this.
|
|
5225
|
+
this.state = {
|
|
5225
5226
|
appliedItems: [],
|
|
5226
5227
|
disabledNameMap: new Map(),
|
|
5227
5228
|
selectedNameMap: new Map(),
|
|
@@ -5321,20 +5322,20 @@ class Editor {
|
|
|
5321
5322
|
}
|
|
5322
5323
|
}
|
|
5323
5324
|
}
|
|
5324
|
-
const
|
|
5325
|
+
const state = {
|
|
5325
5326
|
appliedItems,
|
|
5326
5327
|
disabledNameMap,
|
|
5327
5328
|
selectedNameMap,
|
|
5328
5329
|
selectedValuesMap,
|
|
5329
5330
|
};
|
|
5330
|
-
if (isEqual(
|
|
5331
|
+
if (isEqual(state, this.state)) {
|
|
5331
5332
|
return;
|
|
5332
5333
|
}
|
|
5333
5334
|
if (this.toolbar) {
|
|
5334
|
-
this.toolbar.updateState(
|
|
5335
|
+
this.toolbar.updateState(state);
|
|
5335
5336
|
}
|
|
5336
|
-
this.event.emit('statechange',
|
|
5337
|
-
this.
|
|
5337
|
+
this.event.emit('statechange', state);
|
|
5338
|
+
this.state = state;
|
|
5338
5339
|
}, 100, {
|
|
5339
5340
|
leading: false,
|
|
5340
5341
|
trailing: true,
|
|
@@ -6416,9 +6417,9 @@ class Toolbar {
|
|
|
6416
6417
|
});
|
|
6417
6418
|
}
|
|
6418
6419
|
// Updates state of each item such as disabled, selected.
|
|
6419
|
-
updateState(
|
|
6420
|
+
updateState(state) {
|
|
6420
6421
|
var _a;
|
|
6421
|
-
const { appliedItems, disabledNameMap, selectedNameMap, selectedValuesMap } =
|
|
6422
|
+
const { appliedItems, disabledNameMap, selectedNameMap, selectedValuesMap } = state;
|
|
6422
6423
|
for (const item of this.buttonItemList) {
|
|
6423
6424
|
const selectedClass = 'lake-button-selected';
|
|
6424
6425
|
const buttonNode = this.container.find(`button[name="${item.name}"]`);
|