@basthon/gui-base 0.36.10 → 0.37.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/main.d.ts CHANGED
@@ -17,6 +17,7 @@ export declare class GUIBase {
17
17
  * Kernel getter.
18
18
  */
19
19
  get kernel(): KernelBase | undefined;
20
+ get kernelSafe(): KernelBase | null;
20
21
  /**
21
22
  * KernelLoader getter.
22
23
  */
package/lib/main.js CHANGED
@@ -22,6 +22,7 @@ export class GUIBase {
22
22
  * Kernel getter.
23
23
  */
24
24
  get kernel() { return this._loader.kernel; }
25
+ get kernelSafe() { return this._loader.kernelSafe; }
25
26
  /**
26
27
  * KernelLoader getter.
27
28
  */
@@ -107,7 +108,7 @@ export class GUIBase {
107
108
  /**
108
109
  * Restart the kernel.
109
110
  */
110
- kernelRestart() { var _a; (_a = this.kernel) === null || _a === void 0 ? void 0 : _a.restart(); }
111
+ kernelRestart() { var _a; (_a = this.kernelSafe) === null || _a === void 0 ? void 0 : _a.restart(); }
111
112
  /**
112
113
  * Load ressources from URL (common part to files and modules).
113
114
  */
@@ -141,7 +142,7 @@ export class GUIBase {
141
142
  reader.readAsArrayBuffer(file);
142
143
  reader.onload = async (event) => {
143
144
  var _a, _b, _c;
144
- (_a = this.kernel) === null || _a === void 0 ? void 0 : _a.putRessource(file.name, reader.result);
145
+ (_a = this.kernelSafe) === null || _a === void 0 ? void 0 : _a.putRessource(file.name, reader.result);
145
146
  this.info(`Fichier utilisable depuis ${(_b = this.kernel) === null || _b === void 0 ? void 0 : _b.languageName()}`, `${file.name} est maintenant utilisable depuis ${(_c = this.kernel) === null || _c === void 0 ? void 0 : _c.languageName()}`);
146
147
  resolve();
147
148
  };
@@ -152,17 +153,17 @@ export class GUIBase {
152
153
  * Load auxiliary files submited via URL (aux= parameter) (async).
153
154
  */
154
155
  async loadURLAux() {
155
- if (this.kernel == null)
156
+ if (this.kernelSafe == null)
156
157
  return;
157
- await this._loadFromURL('aux', this.kernel.putFile.bind(this.kernel));
158
+ await this._loadFromURL('aux', this.kernelSafe.putFile.bind(this.kernelSafe));
158
159
  }
159
160
  /**
160
161
  * Load modules submited via URL (module= parameter) (async).
161
162
  */
162
163
  async loadURLModules() {
163
- if (this.kernel == null)
164
+ if (this.kernelSafe == null)
164
165
  return;
165
- await this._loadFromURL('module', this.kernel.putModule.bind(this.kernel));
166
+ await this._loadFromURL('module', this.kernelSafe.putModule.bind(this.kernelSafe));
166
167
  }
167
168
  /**
168
169
  * Opening file: If it has ext as extension, loading it in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basthon/gui-base",
3
- "version": "0.36.10",
3
+ "version": "0.37.0",
4
4
  "description": "Basthon - Base GUI",
5
5
  "homepage": "https://basthon.fr",
6
6
  "bugs": {
@@ -25,8 +25,8 @@
25
25
  "clean": "rm -rf lib/"
26
26
  },
27
27
  "dependencies": {
28
- "@basthon/kernel-base": "^0.36.10",
29
- "@basthon/kernel-loader": "^0.36.10",
28
+ "@basthon/kernel-base": "^0.37.0",
29
+ "@basthon/kernel-loader": "^0.37.0",
30
30
  "js-base64": "^3.7.2",
31
31
  "pako": "^2.0.4",
32
32
  "promise-delegate": "^1.0.1"
@@ -40,5 +40,5 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "107f9cca4c8e93a4c8858b298369d945866b4694"
43
+ "gitHead": "bdafd1d07f6280d24e7b879d035c342c8fe7d61e"
44
44
  }