Convert ES modules to plain scripts using window.NexusTerminal namespace

Replace ES module import/export with a global namespace pattern to avoid
silent failures in the Wails v2 WKWebView which does not reliably support
<script type="module"> tags.

- Remove all import/export statements from JS files
- Register each module's exports on window.NexusTerminal
- Destructure dependencies from window.NexusTerminal at file top
- Load all scripts in dependency order in index.html as plain <script> tags
This commit is contained in:
2026-04-15 00:00:00 +01:00
parent 909657a4b1
commit fca177c384
13 changed files with 145 additions and 101 deletions
+5 -2
View File
@@ -4,7 +4,7 @@
* in the top-right corner of the viewport.
*/
import { createElement, escapeHtml } from './utils.js';
const { createElement, escapeHtml } = window.NexusTerminal;
/** Map of notification type to SVG icon path data. */
const ICONS = {
@@ -14,7 +14,7 @@ const ICONS = {
info: 'M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z',
};
export class Notifications {
class Notifications {
constructor() {
/** @type {HTMLElement} */
this.container = document.getElementById('notifications');
@@ -122,3 +122,6 @@ export class Notifications {
}, 500);
}
}
window.NexusTerminal = window.NexusTerminal || {};
window.NexusTerminal.Notifications = Notifications;