v3 fixes and styling

This commit is contained in:
Andy Dixon
2026-06-16 15:43:25 +01:00
parent 493bfed599
commit 58e916ecf8
32 changed files with 1847 additions and 267 deletions
+28
View File
@@ -0,0 +1,28 @@
(function () {
const root = (window.NexusTerminal = window.NexusTerminal || {});
const directService = () => window.go?.api?.Service || null;
const unavailable = (name) =>
Promise.reject(new Error(`Wails service method is not available: ${String(name)}`));
root.wailsService = new Proxy(
{},
{
get(_target, prop) {
if (prop === "then") return undefined;
const service = directService();
const value = service?.[prop];
if (typeof value === "function") return value.bind(service);
if (value !== undefined) return value;
return () => unavailable(prop);
},
has(_target, prop) {
return prop in (directService() || {});
},
},
);
root.wailsServiceReady = Promise.resolve(root.wailsService);
root.hasWailsService = () =>
Boolean(root.wailsService && window.runtime && directService());
})();