@basthon/gui-base 0.36.6 → 0.36.10

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
@@ -16,7 +16,7 @@ export declare class GUIBase {
16
16
  /**
17
17
  * Kernel getter.
18
18
  */
19
- get kernel(): KernelBase | null;
19
+ get kernel(): KernelBase | undefined;
20
20
  /**
21
21
  * KernelLoader getter.
22
22
  */
@@ -40,10 +40,10 @@ export declare class GUIBase {
40
40
  /**
41
41
  * Ask the user to select a choice.
42
42
  */
43
- select(title: string, message: string, textCancel: string, choices: {
43
+ select(title: string, message: string, choices: {
44
44
  text: string;
45
45
  handler: () => void;
46
- }[]): void;
46
+ }[], textCancel: string, callbackCancel: (() => void)): void;
47
47
  /**
48
48
  * The error notification system.
49
49
  */
@@ -59,6 +59,10 @@ export declare class GUIBase {
59
59
  * init process, trying to do our best...
60
60
  */
61
61
  initCaller(func: () => Promise<any>, message: string, catchError: boolean): Promise<any>;
62
+ /**
63
+ * Get mode as a string (dark/light).
64
+ */
65
+ theme(): "dark" | "light" | undefined;
62
66
  /**
63
67
  * Restart the kernel.
64
68
  */
@@ -91,7 +95,7 @@ export declare class GUIBase {
91
95
  /**
92
96
  * Open an URL in a new tab or download a file.
93
97
  */
94
- static openURL(url: string, download?: string | null | undefined): void;
98
+ static openURL(url: string, download?: string): void;
95
99
  /**
96
100
  * Share content via URL.
97
101
  */
package/lib/main.js CHANGED
@@ -45,7 +45,7 @@ export class GUIBase {
45
45
  /**
46
46
  * Ask the user to select a choice.
47
47
  */
48
- select(title, message, textCancel, choices) { }
48
+ select(title, message, choices, textCancel, callbackCancel) { }
49
49
  /**
50
50
  * The error notification system.
51
51
  */
@@ -100,6 +100,10 @@ export class GUIBase {
100
100
  this.notifyError(error);
101
101
  }
102
102
  }
103
+ /**
104
+ * Get mode as a string (dark/light).
105
+ */
106
+ theme() { return; }
103
107
  /**
104
108
  * Restart the kernel.
105
109
  */
@@ -136,9 +140,9 @@ export class GUIBase {
136
140
  const reader = new FileReader();
137
141
  reader.readAsArrayBuffer(file);
138
142
  reader.onload = async (event) => {
139
- var _a, _b;
143
+ var _a, _b, _c;
140
144
  (_a = this.kernel) === null || _a === void 0 ? void 0 : _a.putRessource(file.name, reader.result);
141
- this.info("Fichier utilisable depuis ${this.kernel?.languageName()", `${file.name} est maintenant utilisable depuis ${(_b = this.kernel) === null || _b === void 0 ? void 0 : _b.languageName()}`);
145
+ 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()}`);
142
146
  resolve();
143
147
  };
144
148
  reader.onerror = reject;
@@ -195,7 +199,7 @@ export class GUIBase {
195
199
  /**
196
200
  * Open an URL in a new tab or download a file.
197
201
  */
198
- static openURL(url, download = null) {
202
+ static openURL(url, download) {
199
203
  let anchor = document.createElement("a");
200
204
  if (download != null)
201
205
  anchor.download = download;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basthon/gui-base",
3
- "version": "0.36.6",
3
+ "version": "0.36.10",
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.6",
29
- "@basthon/kernel-loader": "^0.36.6",
28
+ "@basthon/kernel-base": "^0.36.10",
29
+ "@basthon/kernel-loader": "^0.36.10",
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": "fb7ba80accf982becc0fd5f5d64e09b4e4c2096c"
43
+ "gitHead": "107f9cca4c8e93a4c8858b298369d945866b4694"
44
44
  }