@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/cjs/index.js
CHANGED
|
@@ -5677,7 +5677,7 @@ class History {
|
|
|
5677
5677
|
this.document = document;
|
|
5678
5678
|
this.session = new Session(0, '', this.timeGap);
|
|
5679
5679
|
this.records = [this.session];
|
|
5680
|
-
reaction(() => {
|
|
5680
|
+
this.disposer = reaction(() => {
|
|
5681
5681
|
return dataFn();
|
|
5682
5682
|
}, data => {
|
|
5683
5683
|
if (this.asleep) return;
|
|
@@ -5764,6 +5764,7 @@ class History {
|
|
|
5764
5764
|
}
|
|
5765
5765
|
destroy() {
|
|
5766
5766
|
this.records = [];
|
|
5767
|
+
this.disposer();
|
|
5767
5768
|
}
|
|
5768
5769
|
getState() {
|
|
5769
5770
|
const {
|
|
@@ -7785,6 +7786,7 @@ class Document {
|
|
|
7785
7786
|
return this.rootNode.export(stage);
|
|
7786
7787
|
}
|
|
7787
7788
|
remove() {
|
|
7789
|
+
this.history.destroy();
|
|
7788
7790
|
this.designer.postEvent(DOCUMENT_EVENT.REMOVE, {
|
|
7789
7791
|
id: this.id
|
|
7790
7792
|
});
|
|
@@ -8101,13 +8103,15 @@ class Project {
|
|
|
8101
8103
|
if (index < 0) {
|
|
8102
8104
|
return logger.warn('document not found', idOrDoc);
|
|
8103
8105
|
}
|
|
8104
|
-
document.remove();
|
|
8105
8106
|
this.documents.splice(index, 1);
|
|
8106
8107
|
this.documentsMap.delete(document.id);
|
|
8107
8108
|
}
|
|
8108
8109
|
getDocument(id) {
|
|
8109
8110
|
return this.documents.find(doc => doc.id === id);
|
|
8110
8111
|
}
|
|
8112
|
+
getDocumentByFileName(fileName) {
|
|
8113
|
+
return this.documents.find(doc => doc.fileName === fileName);
|
|
8114
|
+
}
|
|
8111
8115
|
open(idOrDoc) {
|
|
8112
8116
|
if (!idOrDoc) {
|
|
8113
8117
|
const got = this.documents.find(item => item.isBlank());
|