@moonbase.sh/gorilla-engine 0.2.1 → 0.3.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/README.md +1 -1
- package/dist/index.cjs +660 -148
- package/dist/index.d.cts +31 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +660 -148
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -13,6 +13,27 @@ interface DownloadState {
|
|
|
13
13
|
upgradeUrl: string | null;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
declare const ICON_PATHS: {
|
|
17
|
+
readonly check: "M4.5 12.75l6 6 9-13.5";
|
|
18
|
+
readonly cross: "M6 18 18 6M6 6l12 12";
|
|
19
|
+
readonly lock: "M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25z";
|
|
20
|
+
readonly back: "M15.75 19.5 8.25 12l7.5-7.5";
|
|
21
|
+
readonly chevron: "m8.25 4.5 7.5 7.5-7.5 7.5";
|
|
22
|
+
readonly signal: "M9.348 14.652a3.75 3.75 0 010-5.304m5.304 0a3.75 3.75 0 010 5.304m-7.425 2.121a6.75 6.75 0 010-9.546m9.546 0a6.75 6.75 0 010 9.546M5.106 18.894c-3.808-3.807-3.808-9.98 0-13.788m13.788 0c3.808 3.807 3.808 9.98 0 13.788M12 12h.008v.008H12V12z";
|
|
23
|
+
readonly computer: "M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25";
|
|
24
|
+
readonly fileDown: "M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m.75 12 3 3m0 0 3-3m-3 3v-6m-1.5-9H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9z";
|
|
25
|
+
readonly upload: "M7.5 7.5h-.75A2.25 2.25 0 0 0 4.5 9.75v7.5a2.25 2.25 0 0 0 2.25 2.25h7.5a2.25 2.25 0 0 0 2.25-2.25v-7.5a2.25 2.25 0 0 0-2.25-2.25h-.75m-6 3.75 3-3m0 0 3 3m-3-3v11.25m6-2.25h.75a2.25 2.25 0 0 0 2.25-2.25v-7.5a2.25 2.25 0 0 0-2.25-2.25h-.75";
|
|
26
|
+
readonly okCircle: "M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z";
|
|
27
|
+
readonly warning: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z";
|
|
28
|
+
readonly blocked: "M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636";
|
|
29
|
+
readonly copy: "M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375";
|
|
30
|
+
readonly download: "M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3";
|
|
31
|
+
readonly puzzle: "M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.4 48.4 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.04 48.04 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.4 48.4 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0z";
|
|
32
|
+
readonly external: "M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25";
|
|
33
|
+
readonly sparkles: "M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09Z";
|
|
34
|
+
};
|
|
35
|
+
type IconName = keyof typeof ICON_PATHS;
|
|
36
|
+
|
|
16
37
|
/** An open or save dialog, as Gorilla Engine's `openFileChooser` takes it. */
|
|
17
38
|
interface FileDialogOptions {
|
|
18
39
|
allowMultiple?: boolean;
|
|
@@ -203,6 +224,9 @@ declare class MoonbaseGorillaEngine extends ActivationController {
|
|
|
203
224
|
private readonly aborts;
|
|
204
225
|
/** Where Moonbase's mark was written, null when it couldn't be, undefined before it was asked for. */
|
|
205
226
|
private markFile;
|
|
227
|
+
/** Each icon's file, by name, colour, size and stroke; null when it couldn't be written. */
|
|
228
|
+
private readonly iconFiles;
|
|
229
|
+
private iconsFailed;
|
|
206
230
|
constructor(options: MoonbaseGorillaEngineOptions);
|
|
207
231
|
/**
|
|
208
232
|
* Validate the stored license, start watching it, and bring the overlay up
|
|
@@ -225,6 +249,13 @@ declare class MoonbaseGorillaEngine extends ActivationController {
|
|
|
225
249
|
* for. Null when it can't be written, and the footer goes without it.
|
|
226
250
|
*/
|
|
227
251
|
moonbaseMark(): string | null;
|
|
252
|
+
/**
|
|
253
|
+
* One of the overlay's icons, in a colour (`AARRGGBB`) and size (points), as
|
|
254
|
+
* an image file, with its `@2x`: drawn the first time it is asked for, into
|
|
255
|
+
* `moonbase-icons` beside the license, for the same reason as the mark. Null
|
|
256
|
+
* when it can't be written, and the overlay goes without it.
|
|
257
|
+
*/
|
|
258
|
+
icon(name: IconName, colour: string, size: number, stroke?: number): string | null;
|
|
228
259
|
/**
|
|
229
260
|
* Hand a failure to `onError`: the overlay does with every action that
|
|
230
261
|
* fails, and the module with the host's.
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,27 @@ interface DownloadState {
|
|
|
13
13
|
upgradeUrl: string | null;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
declare const ICON_PATHS: {
|
|
17
|
+
readonly check: "M4.5 12.75l6 6 9-13.5";
|
|
18
|
+
readonly cross: "M6 18 18 6M6 6l12 12";
|
|
19
|
+
readonly lock: "M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25z";
|
|
20
|
+
readonly back: "M15.75 19.5 8.25 12l7.5-7.5";
|
|
21
|
+
readonly chevron: "m8.25 4.5 7.5 7.5-7.5 7.5";
|
|
22
|
+
readonly signal: "M9.348 14.652a3.75 3.75 0 010-5.304m5.304 0a3.75 3.75 0 010 5.304m-7.425 2.121a6.75 6.75 0 010-9.546m9.546 0a6.75 6.75 0 010 9.546M5.106 18.894c-3.808-3.807-3.808-9.98 0-13.788m13.788 0c3.808 3.807 3.808 9.98 0 13.788M12 12h.008v.008H12V12z";
|
|
23
|
+
readonly computer: "M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25";
|
|
24
|
+
readonly fileDown: "M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m.75 12 3 3m0 0 3-3m-3 3v-6m-1.5-9H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9z";
|
|
25
|
+
readonly upload: "M7.5 7.5h-.75A2.25 2.25 0 0 0 4.5 9.75v7.5a2.25 2.25 0 0 0 2.25 2.25h7.5a2.25 2.25 0 0 0 2.25-2.25v-7.5a2.25 2.25 0 0 0-2.25-2.25h-.75m-6 3.75 3-3m0 0 3 3m-3-3v11.25m6-2.25h.75a2.25 2.25 0 0 0 2.25-2.25v-7.5a2.25 2.25 0 0 0-2.25-2.25h-.75";
|
|
26
|
+
readonly okCircle: "M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z";
|
|
27
|
+
readonly warning: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z";
|
|
28
|
+
readonly blocked: "M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636";
|
|
29
|
+
readonly copy: "M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375";
|
|
30
|
+
readonly download: "M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3";
|
|
31
|
+
readonly puzzle: "M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.4 48.4 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.04 48.04 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.4 48.4 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0z";
|
|
32
|
+
readonly external: "M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25";
|
|
33
|
+
readonly sparkles: "M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09Z";
|
|
34
|
+
};
|
|
35
|
+
type IconName = keyof typeof ICON_PATHS;
|
|
36
|
+
|
|
16
37
|
/** An open or save dialog, as Gorilla Engine's `openFileChooser` takes it. */
|
|
17
38
|
interface FileDialogOptions {
|
|
18
39
|
allowMultiple?: boolean;
|
|
@@ -203,6 +224,9 @@ declare class MoonbaseGorillaEngine extends ActivationController {
|
|
|
203
224
|
private readonly aborts;
|
|
204
225
|
/** Where Moonbase's mark was written, null when it couldn't be, undefined before it was asked for. */
|
|
205
226
|
private markFile;
|
|
227
|
+
/** Each icon's file, by name, colour, size and stroke; null when it couldn't be written. */
|
|
228
|
+
private readonly iconFiles;
|
|
229
|
+
private iconsFailed;
|
|
206
230
|
constructor(options: MoonbaseGorillaEngineOptions);
|
|
207
231
|
/**
|
|
208
232
|
* Validate the stored license, start watching it, and bring the overlay up
|
|
@@ -225,6 +249,13 @@ declare class MoonbaseGorillaEngine extends ActivationController {
|
|
|
225
249
|
* for. Null when it can't be written, and the footer goes without it.
|
|
226
250
|
*/
|
|
227
251
|
moonbaseMark(): string | null;
|
|
252
|
+
/**
|
|
253
|
+
* One of the overlay's icons, in a colour (`AARRGGBB`) and size (points), as
|
|
254
|
+
* an image file, with its `@2x`: drawn the first time it is asked for, into
|
|
255
|
+
* `moonbase-icons` beside the license, for the same reason as the mark. Null
|
|
256
|
+
* when it can't be written, and the overlay goes without it.
|
|
257
|
+
*/
|
|
258
|
+
icon(name: IconName, colour: string, size: number, stroke?: number): string | null;
|
|
228
259
|
/**
|
|
229
260
|
* Hand a failure to `onError`: the overlay does with every action that
|
|
230
261
|
* fails, and the module with the host's.
|