Feat v0.6.17 bugfixes (#52)
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #52.
This commit is contained in:
@@ -193,7 +193,24 @@ export async function boot() {
|
||||
events.connect(BASE + '/ws');
|
||||
}
|
||||
|
||||
// 10. Signal ready
|
||||
// 10. Mount imperative hosts (Toast, DialogStack) if not already present.
|
||||
// Core surfaces mount these via AppShell; extension surfaces need SDK to do it.
|
||||
try {
|
||||
const hostId = 'sw-imperative-hosts';
|
||||
if (!document.getElementById(hostId)) {
|
||||
const mount = document.createElement('div');
|
||||
mount.id = hostId;
|
||||
document.body.appendChild(mount);
|
||||
const { ToastContainer } = await import('../primitives/toast.js');
|
||||
const { DialogStack } = await import('../shell/dialog-stack.js');
|
||||
const { render } = preact;
|
||||
render(html`<${ToastContainer} /><${DialogStack} />`, mount);
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('[sw] Imperative host mount failed:', e.message);
|
||||
}
|
||||
|
||||
// 11. Signal ready
|
||||
events.emit('sdk.ready', {}, { localOnly: true });
|
||||
document.dispatchEvent(new CustomEvent('sw:ready', { detail: { sw } }));
|
||||
console.log(`[sw] SDK v${sw._sdk} ready`);
|
||||
|
||||
Reference in New Issue
Block a user