@basthon/console-react 0.5.0 → 0.5.2

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.js CHANGED
@@ -149,7 +149,7 @@ export default class GUI extends GUIBase {
149
149
  async runScript() {
150
150
  await this.loaded();
151
151
  const src = this.content();
152
- this._term?.launch(src, false);
152
+ await this._term?.launch(src, false);
153
153
  this._term?.focus();
154
154
  }
155
155
  /**
@@ -50,7 +50,7 @@ export default class Terminal {
50
50
  /**
51
51
  * Launch code in terminal.
52
52
  */
53
- launch(code: string, interactive?: boolean): void;
53
+ launch(code: string, interactive?: boolean): Promise<void>;
54
54
  /**
55
55
  * Give focus to terminal.
56
56
  */
@@ -103,7 +103,7 @@ export default class Terminal {
103
103
  else {
104
104
  this._term.set_prompt(this._kernel.ps1());
105
105
  this.resetBuffer();
106
- this.launch(source, true);
106
+ await this.launch(source, true);
107
107
  }
108
108
  }
109
109
  /**
@@ -176,19 +176,17 @@ export default class Terminal {
176
176
  /**
177
177
  * Launch code in terminal.
178
178
  */
179
- launch(code, interactive = true) {
179
+ async launch(code, interactive = true) {
180
180
  this._stopWaitInput();
181
+ await this._kernel.ready();
181
182
  if (!interactive)
182
183
  this.showScript(code);
183
184
  this.pause();
184
185
  this._term.set_prompt("");
185
- (async () => {
186
- await this._kernel.ready();
187
- this._kernel.dispatchEvent("eval.request", {
188
- code: code,
189
- interactive: interactive,
190
- });
191
- })();
186
+ this._kernel.dispatchEvent("eval.request", {
187
+ code: code,
188
+ interactive: interactive,
189
+ });
192
190
  }
193
191
  /**
194
192
  * Give focus to terminal.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basthon/console-react",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
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.78.0",
58
+ "@basthon/gui-react": "0.78.1",
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",