0.3.0
Release notes for 0.3.0.
Released: 2026-06-22
Features
Multi-instance support.
configurePanel(config)now returns aPanelInstanceHandleand supports multiple independent panel instances on one page. Calling it with a distinctstoragePrefixregisters a new instance (independent storage keys, DOM root, toggle event, apply target). Calling it again with the same prefix and structurally-equal config is a no-op that returns the same handle (covers Astro view-transition reruns). Calling it with the same prefix but a structurally-different config throws immediately (RECONFIGURE_RULE = 'reject-with-error'); callhandle.destroy()first to re-configure a prefix. Additive and backward-compatible — single-panel hosts observe no change. (#353)PanelInstanceHandle.configurePanelnow returns a handle with{ instanceId, open(), close(), toggle(), destroy() }.instanceIdequalsstoragePrefix.destroy()deregisters the instance, unmounts its Preact tree, removes its DOM root, and unbinds its toggle-event listener — freeing the prefix for re-configuration. (#353)Per-instance toggle events. The default instance (the historical
storagePrefix) keepstoggle-design-token-panelunchanged. Any instance with a non-default prefix listens onconfig.toggleEventwhen supplied, ortoggle-${storagePrefix}by default — giving each instance its own independent toggle channel.PanelConfig.toggleEvent?: stringis a new optional field. (#354)PanelConfig.applySink. An optional{ apply(pairs), clear(names) }sink routes this instance's CSS-var writes and clears through a caller-supplied object instead ofdocument.documentElement. Useful for shadow DOM, iframe, or test-spy contexts.apply= upsert;clear= remove. Reset sends the full token-name set for the instance tosink.clearso the sink target is completely cleaned. Sink errors are non-fatal (console.warn). The host owns the sink target's lifecycle.applySinkcarries function references and must not be passed through the Astro inline JSON config. (#355)