@easy-editor/core 0.0.12 → 0.0.13
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/cjs/index.development.js +6 -2
- package/dist/cjs/index.development.js.map +1 -1
- package/dist/cjs/index.js +6 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.production.js +6 -2
- package/dist/cjs/index.production.js.map +1 -1
- package/dist/document/history.d.ts +1 -0
- package/dist/esm/index.development.js +6 -2
- package/dist/esm/index.development.js.map +1 -1
- package/dist/esm/index.js +6 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.production.js +6 -2
- package/dist/esm/index.production.js.map +1 -1
- package/dist/index.js +6 -2
- package/dist/project/project.d.ts +1 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -5675,7 +5675,7 @@ class History {
|
|
|
5675
5675
|
this.document = document;
|
|
5676
5676
|
this.session = new Session(0, '', this.timeGap);
|
|
5677
5677
|
this.records = [this.session];
|
|
5678
|
-
reaction(() => {
|
|
5678
|
+
this.disposer = reaction(() => {
|
|
5679
5679
|
return dataFn();
|
|
5680
5680
|
}, data => {
|
|
5681
5681
|
if (this.asleep) return;
|
|
@@ -5762,6 +5762,7 @@ class History {
|
|
|
5762
5762
|
}
|
|
5763
5763
|
destroy() {
|
|
5764
5764
|
this.records = [];
|
|
5765
|
+
this.disposer();
|
|
5765
5766
|
}
|
|
5766
5767
|
getState() {
|
|
5767
5768
|
const {
|
|
@@ -7783,6 +7784,7 @@ class Document {
|
|
|
7783
7784
|
return this.rootNode.export(stage);
|
|
7784
7785
|
}
|
|
7785
7786
|
remove() {
|
|
7787
|
+
this.history.destroy();
|
|
7786
7788
|
this.designer.postEvent(DOCUMENT_EVENT.REMOVE, {
|
|
7787
7789
|
id: this.id
|
|
7788
7790
|
});
|
|
@@ -8099,13 +8101,15 @@ class Project {
|
|
|
8099
8101
|
if (index < 0) {
|
|
8100
8102
|
return logger.warn('document not found', idOrDoc);
|
|
8101
8103
|
}
|
|
8102
|
-
document.remove();
|
|
8103
8104
|
this.documents.splice(index, 1);
|
|
8104
8105
|
this.documentsMap.delete(document.id);
|
|
8105
8106
|
}
|
|
8106
8107
|
getDocument(id) {
|
|
8107
8108
|
return this.documents.find(doc => doc.id === id);
|
|
8108
8109
|
}
|
|
8110
|
+
getDocumentByFileName(fileName) {
|
|
8111
|
+
return this.documents.find(doc => doc.fileName === fileName);
|
|
8112
|
+
}
|
|
8109
8113
|
open(idOrDoc) {
|
|
8110
8114
|
if (!idOrDoc) {
|
|
8111
8115
|
const got = this.documents.find(item => item.isBlank());
|