@basthon/gui-base 0.50.7 → 0.50.9
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 +3 -4
- package/lib/main.js +6 -5
- package/package.json +5 -5
package/lib/main.d.ts
CHANGED
|
@@ -7,8 +7,7 @@ declare global {
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
export interface GUIOptions {
|
|
10
|
-
|
|
11
|
-
language: string;
|
|
10
|
+
kernelOptions: any;
|
|
12
11
|
uiName?: string;
|
|
13
12
|
noCheckpointsInit?: boolean;
|
|
14
13
|
}
|
|
@@ -104,7 +103,7 @@ export declare class GUIBase {
|
|
|
104
103
|
/**
|
|
105
104
|
* Get state from strorage.
|
|
106
105
|
*/
|
|
107
|
-
protected getState(state: string, def?:
|
|
106
|
+
protected getState(state: string, def?: any): Promise<any>;
|
|
108
107
|
/**
|
|
109
108
|
* Set state in storage.
|
|
110
109
|
*/
|
|
@@ -147,7 +146,7 @@ export declare class GUIBase {
|
|
|
147
146
|
/**
|
|
148
147
|
* Get mode as a string (dark/light).
|
|
149
148
|
*/
|
|
150
|
-
theme(): "dark" | "light" | undefined
|
|
149
|
+
theme(): Promise<"dark" | "light" | undefined>;
|
|
151
150
|
/**
|
|
152
151
|
* Restart the kernel.
|
|
153
152
|
*/
|
package/lib/main.js
CHANGED
|
@@ -6,6 +6,7 @@ import { KernelLoader } from "@basthon/kernel-loader";
|
|
|
6
6
|
*/
|
|
7
7
|
export class GUIBase {
|
|
8
8
|
constructor(options) {
|
|
9
|
+
var _a;
|
|
9
10
|
this._loaded = new PromiseDelegate();
|
|
10
11
|
this._maxCheckpoints = 10;
|
|
11
12
|
this._contentFilename = "content.txt";
|
|
@@ -13,13 +14,13 @@ export class GUIBase {
|
|
|
13
14
|
this._extensions = new Map();
|
|
14
15
|
/* console errors redirected to notification system */
|
|
15
16
|
this._console_error = console.error;
|
|
16
|
-
this._language = options.language;
|
|
17
|
-
this._loader = new KernelLoader(options.
|
|
17
|
+
this._language = (_a = options === null || options === void 0 ? void 0 : options.kernelOptions) === null || _a === void 0 ? void 0 : _a.language;
|
|
18
|
+
this._loader = new KernelLoader(options.kernelOptions);
|
|
18
19
|
// loading Basthon (errors are fatal)
|
|
19
20
|
this._loader.showLoader("Chargement de Basthon...", false, false);
|
|
20
21
|
/* per language checkpoints */
|
|
21
22
|
if (!options.noCheckpointsInit)
|
|
22
|
-
this._checkpoints = new CheckpointsManager(`${options.uiName}.${
|
|
23
|
+
this._checkpoints = new CheckpointsManager(`${options.uiName}.${this._language}`, this._maxCheckpoints);
|
|
23
24
|
/* globale states (not language specific) */
|
|
24
25
|
this._stateStorage = new Storage(`${options.uiName}.states`);
|
|
25
26
|
}
|
|
@@ -190,7 +191,7 @@ export class GUIBase {
|
|
|
190
191
|
/**
|
|
191
192
|
* Get state from strorage.
|
|
192
193
|
*/
|
|
193
|
-
async getState(state, def
|
|
194
|
+
async getState(state, def) {
|
|
194
195
|
var _a;
|
|
195
196
|
return (_a = await this._stateStorage.get(state)) !== null && _a !== void 0 ? _a : def;
|
|
196
197
|
}
|
|
@@ -320,7 +321,7 @@ export class GUIBase {
|
|
|
320
321
|
/**
|
|
321
322
|
* Get mode as a string (dark/light).
|
|
322
323
|
*/
|
|
323
|
-
theme() { return; }
|
|
324
|
+
async theme() { return; }
|
|
324
325
|
/**
|
|
325
326
|
* Restart the kernel.
|
|
326
327
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basthon/gui-base",
|
|
3
|
-
"version": "0.50.
|
|
3
|
+
"version": "0.50.9",
|
|
4
4
|
"description": "Basthon - Base GUI",
|
|
5
5
|
"homepage": "https://basthon.fr",
|
|
6
6
|
"bugs": {
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"clean": "rm -rf lib/"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@basthon/checkpoints": "0.50.
|
|
29
|
-
"@basthon/kernel-base": "0.50.
|
|
30
|
-
"@basthon/kernel-loader": "0.50.
|
|
28
|
+
"@basthon/checkpoints": "0.50.9",
|
|
29
|
+
"@basthon/kernel-base": "0.50.9",
|
|
30
|
+
"@basthon/kernel-loader": "0.50.9",
|
|
31
31
|
"js-base64": "^3.7.2",
|
|
32
32
|
"pako": "^2.0.4",
|
|
33
33
|
"promise-delegate": "^1.0.1"
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "29ccac6dc1ef4b33c62770b0d2c6c3c12de13ccf"
|
|
45
45
|
}
|