Changeset 0.37.5 (#217)

Co-authored-by: gobha <jasafpro@gmail.com>
Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
2026-03-21 13:41:25 +00:00
committed by xcaliber
parent 05b5affdac
commit 74f3cb84e9
27 changed files with 2211 additions and 667 deletions

View File

@@ -237,6 +237,7 @@ export function createAuth() {
window.location.href = base + '/login';
},
_setAuth(data) { _setAuth(data); },
_setRestClient(client) { _restClient = client; },
_setEmit(fn) { _emit = fn; },
};

View File

@@ -93,10 +93,21 @@ export async function boot() {
sw.pipe = pipe;
sw.theme = theme;
// Shell helpers — imperative confirm/prompt backed by DialogStack
// Shell helpers — imperative confirm/prompt backed by primitives
sw.confirm = confirm;
sw.prompt = prompt;
// Toast — dynamic import to avoid module resolution issues
try {
const toastMod = await import('../primitives/toast.js');
sw.toast = toastMod.toast;
events.on('toast', ({ message, variant, duration }) => {
toastMod.toast(message, variant, duration);
});
} catch (e) {
console.warn('[sw] Toast import failed:', e.message);
}
// UserMenu render helper — surfaces call sw.userMenu(container, opts)
sw.userMenu = function (container, opts = {}) {
import('../shell/user-menu.js').then(({ UserMenu }) => {
@@ -106,7 +117,7 @@ export async function boot() {
};
// Marker for idempotency
sw._sdk = '0.37.4';
sw._sdk = '0.37.5';
// 8. Expose globally
window.sw = sw;
@@ -128,7 +139,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.4 ready');
console.log('[sw] SDK v0.37.5 ready');
return sw;
}