Changeset 0.37.4 (#216)

Co-authored-by: gobha <jasafpro@gmail.com>
Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
2026-03-21 01:15:09 +00:00
committed by xcaliber
parent fc43618501
commit 05b5affdac
7 changed files with 294 additions and 4 deletions

View File

@@ -18,6 +18,8 @@ import { createDomains } from './api-domains.js';
import { createEvents } from './events.js';
import { createPipe } from './pipe.js';
import { createTheme } from './theme.js';
import { confirm } from '../primitives/confirm.js';
import { prompt } from '../primitives/prompt.js';
/**
* Boot the SDK. Assembles modules, loads auth state, connects WebSocket.
@@ -91,8 +93,20 @@ export async function boot() {
sw.pipe = pipe;
sw.theme = theme;
// Shell helpers — imperative confirm/prompt backed by DialogStack
sw.confirm = confirm;
sw.prompt = prompt;
// UserMenu render helper — surfaces call sw.userMenu(container, opts)
sw.userMenu = function (container, opts = {}) {
import('../shell/user-menu.js').then(({ UserMenu }) => {
const { render } = preact;
render(html`<${UserMenu} ...${opts} />`, container);
});
};
// Marker for idempotency
sw._sdk = '0.37.3';
sw._sdk = '0.37.4';
// 8. Expose globally
window.sw = sw;
@@ -114,7 +128,7 @@ export async function boot() {
// 10. Signal ready
events.emit('sdk.ready', {}, { localOnly: true });
document.dispatchEvent(new CustomEvent('sw:ready', { detail: { sw } }));
console.log('[sw] SDK v0.37.3 ready');
console.log('[sw] SDK v0.37.4 ready');
return sw;
}