@basthon/kernel-base 0.78.4 → 0.78.5

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/kernel.d.ts CHANGED
@@ -14,6 +14,7 @@ export declare class KernelBase {
14
14
  protected _pendingInput?: PromiseDelegate<string>;
15
15
  private _listeners;
16
16
  protected _options: any;
17
+ protected _runningData: any;
17
18
  protected _files: Map<string, ArrayBuffer>;
18
19
  protected _modules: Map<string, ArrayBuffer>;
19
20
  constructor(options: any);
@@ -109,6 +110,10 @@ export declare class KernelBase {
109
110
  * inside the version number directory inside the assets directory.
110
111
  */
111
112
  basthonRoot(absolute?: boolean): string;
113
+ /**
114
+ * Set running data (introduced to manage user_seed in capytale).
115
+ */
116
+ setRunningData(data: any): Promise<void>;
112
117
  /**
113
118
  * Downloading data (bytes array or data URL) as filename
114
119
  * (opening browser dialog).
package/lib/kernel.js CHANGED
@@ -24,6 +24,7 @@ export class KernelBase {
24
24
  this._pendingInput = undefined;
25
25
  // a map to register wrapped listeners to allow later remove
26
26
  this._listeners = new Map();
27
+ this._runningData = {};
27
28
  this._files = new Map();
28
29
  this._modules = new Map();
29
30
  this._options = this.clone(options);
@@ -206,6 +207,12 @@ export class KernelBase {
206
207
  basthonRoot(absolute = false) {
207
208
  return (this.assetsURL(absolute) + "/" + this.version() + "/" + this.language());
208
209
  }
210
+ /**
211
+ * Set running data (introduced to manage user_seed in capytale).
212
+ */
213
+ async setRunningData(data) {
214
+ this._runningData = { ...this._runningData, ...data };
215
+ }
209
216
  /**
210
217
  * Downloading data (bytes array or data URL) as filename
211
218
  * (opening browser dialog).
package/lib/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.78.4";
1
+ export declare const VERSION = "0.78.5";
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.78.4";
1
+ export const VERSION = "0.78.5";
@@ -98,6 +98,7 @@ export class KernelMainBase extends KernelBase {
98
98
  */
99
99
  async _start() {
100
100
  await super._start();
101
+ await this.setRunningData(this._runningData);
101
102
  // kernel restart in legacy mode is lazy, not a full restart
102
103
  if (this.isLegacy() && this.remote != null) {
103
104
  await this.remote?.legacyStart();
@@ -152,7 +153,8 @@ export class KernelMainBase extends KernelBase {
152
153
  * Set running data in the kernel worker (introduced to manage user_seed in capytale).
153
154
  */
154
155
  async setRunningData(data) {
155
- return await this.remote?.setRunningData(data);
156
+ await super.setRunningData(data);
157
+ await this.remote?.setRunningData(this._runningData);
156
158
  }
157
159
  /**
158
160
  * Convert a canvas array buffer to a PNG data URL (base64 encoded).
@@ -74,6 +74,7 @@ declare class KernelWorkerBase {
74
74
  setEphemeralAPI(url: string): Promise<void>;
75
75
  /**
76
76
  * Set running data (introduced to manage user_seed in capytale).
77
+ * It is not updated but replaced with the new data.
77
78
  */
78
79
  setRunningData(data: any): Promise<void>;
79
80
  /**
@@ -118,9 +118,10 @@ class KernelWorkerBase {
118
118
  }
119
119
  /**
120
120
  * Set running data (introduced to manage user_seed in capytale).
121
+ * It is not updated but replaced with the new data.
121
122
  */
122
123
  async setRunningData(data) {
123
- this._runningData = { ...this._runningData, ...data };
124
+ this._runningData = data;
124
125
  }
125
126
  /**
126
127
  * Get running data.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basthon/kernel-base",
3
- "version": "0.78.4",
3
+ "version": "0.78.5",
4
4
  "description": "Basthon - Base Kernel",
5
5
  "homepage": "https://basthon.fr",
6
6
  "bugs": {