Changeset 0.37.8 (#220)

Co-authored-by: gobha <jasafpro@gmail.com>
Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
2026-03-21 18:50:04 +00:00
committed by xcaliber
parent b6152fbf5e
commit 2695bb3bdc
18 changed files with 1151 additions and 299 deletions

View File

@@ -116,8 +116,19 @@ export async function boot() {
});
};
// ChatPane render helper — surfaces call sw.chatPane(container, opts)
// Returns Promise<imperative handle> for backward-compat with old ChatPane API.
sw.chatPane = function (container, opts = {}) {
return import('../components/chat-pane/index.js').then(({ ChatPane }) => {
const handleRef = { current: null };
const { render } = preact;
render(html`<${ChatPane} handleRef=${handleRef} ...${opts} />`, container);
return handleRef.current;
});
};
// Marker for idempotency
sw._sdk = '0.37.6';
sw._sdk = '0.37.8';
// 8. Expose globally
window.sw = sw;
@@ -139,7 +150,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.5 ready');
console.log('[sw] SDK v0.37.8 ready');
return sw;
}