@basthon/console-react 0.4.8 → 0.5.0

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/lib/gui/gui.d.ts CHANGED
@@ -72,7 +72,7 @@ export default class GUI extends GUIBase {
72
72
  /**
73
73
  * RAZ function.
74
74
  */
75
- restart(): void;
75
+ restart(): Promise<void>;
76
76
  /**
77
77
  * Open *.py file by asking user what to do:
78
78
  * load in editor or put on (emulated) local filesystem.
package/lib/gui/gui.js CHANGED
@@ -155,8 +155,8 @@ export default class GUI extends GUIBase {
155
155
  /**
156
156
  * RAZ function.
157
157
  */
158
- restart() {
159
- this.kernelRestart();
158
+ async restart() {
159
+ await this.kernelRestart();
160
160
  this._term?.clear();
161
161
  this._graphics?.clean();
162
162
  }
@@ -85,6 +85,7 @@ export default class Terminal {
85
85
  this._buffer = [];
86
86
  }
87
87
  async _interpreter(command) {
88
+ await this._kernel.ready();
88
89
  // user answers to its program's input
89
90
  if (this._inputMode) {
90
91
  this._term.set_prompt("");
@@ -181,10 +182,13 @@ export default class Terminal {
181
182
  this.showScript(code);
182
183
  this.pause();
183
184
  this._term.set_prompt("");
184
- this._kernel.dispatchEvent("eval.request", {
185
- code: code,
186
- interactive: interactive,
187
- });
185
+ (async () => {
186
+ await this._kernel.ready();
187
+ this._kernel.dispatchEvent("eval.request", {
188
+ code: code,
189
+ interactive: interactive,
190
+ });
191
+ })();
188
192
  }
189
193
  /**
190
194
  * Give focus to terminal.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basthon/console-react",
3
- "version": "0.4.8",
3
+ "version": "0.5.0",
4
4
  "description": "Basthon - Console React Component",
5
5
  "homepage": "https://basthon.fr",
6
6
  "bugs": {
@@ -55,7 +55,7 @@
55
55
  "clean": "rimraf lib/"
56
56
  },
57
57
  "dependencies": {
58
- "@basthon/gui-react": "0.77.5",
58
+ "@basthon/gui-react": "0.78.0",
59
59
  "@fontsource/open-sans": "^5.2.7",
60
60
  "@fortawesome/fontawesome-svg-core": "7.3.0",
61
61
  "@fortawesome/free-regular-svg-icons": "7.3.0",