@easy-editor/core 0.0.12 → 0.0.14

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.
@@ -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());
@@ -8438,6 +8442,9 @@ class Simulator {
8438
8442
  get enableStrictNotFoundMode() {
8439
8443
  return this.editor.get('enableStrictNotFoundMode') ?? false;
8440
8444
  }
8445
+ get excuteLifeCycleInDesignMode() {
8446
+ return this.editor.get('excuteLifeCycleInDesignMode') ?? false;
8447
+ }
8441
8448
  get notFoundComponent() {
8442
8449
  return this.editor.get('notFoundComponent') ?? null;
8443
8450
  }
@@ -10063,6 +10070,10 @@ class SettingField extends SettingPropEntry {
10063
10070
  }
10064
10071
  super.setValue(val, isHotValue, extraOptions);
10065
10072
  }
10073
+ clearValue() {
10074
+ this.hotValue = null;
10075
+ super.clearValue();
10076
+ }
10066
10077
  getHotValue() {
10067
10078
  if (this.hotValue) {
10068
10079
  return this.hotValue;
@@ -10078,13 +10089,15 @@ class SettingField extends SettingPropEntry {
10078
10089
  const value = data;
10079
10090
  if (options) {
10080
10091
  options.fromSetHotValue = true;
10092
+ options.forceHotValue = true;
10081
10093
  } else {
10082
10094
  options = {
10083
- fromSetHotValue: true
10095
+ fromSetHotValue: true,
10096
+ forceHotValue: true
10084
10097
  };
10085
10098
  }
10086
- if (this.isUseVariable()) {
10087
- const oldValue = this.getValue();
10099
+ if (this.isUseVariable() || options?.forceHotValue) {
10100
+ const oldValue = this.getValue() || {};
10088
10101
  if (isJSExpression(value)) {
10089
10102
  this.setValue({
10090
10103
  type: 'JSExpression',