- Docs
- Changelog
Changelog
Verified release notes, including explicit breaking changes.
All notable changes to @samline/drawer are documented in this file. The format follows Keep a Changelog and the project adheres to Semantic Versioning.
[6.0.1] - 2026-11-17
Changed
- Internal: source uses arrow functions throughout, and clearing rendered content uses
replaceChildren(). No API or behavior change. closeButton.iconaccepts anyElement, so an<svg>icon no longer needs a cast toHTMLElement. It was already appended as-is at runtime.
Fixed
closeButton: true(and an object withouticon) rendered the literal word “xmark” inside the close button. The default icon is now an inline SVG X drawn withcurrentColorand sized with the button’s font (1em). A customiconstring or element works as before.
[6.0.0] - 2026-11-15
The browser bundle and stylesheet take the family names. The 5.x file names still ship as aliases.
Breaking changes
@samline/drawer/browserand the classic script no longer have adefaultexport. Useimport { Drawer } from '@samline/drawer/browser'or the named functions;window.Draweris unchanged.- The standalone script is now
dist/browser/drawer.global.js, also exported as@samline/drawer/browser/global.dist/browser/global.global.jsis still built as an identical alias, so pinned 5.x URLs that you bump to 6.0.0 keep working.
Changed
- The documented stylesheet import is
@samline/drawer/style.css;@samline/drawer/styles.cssstays as an alias of the same file. - The package installs with pnpm and runs its scripts with Bun.
./package.jsonis exported. - CDN snippets in the README, docs, skill and copied examples load from jsDelivr (
https://cdn.jsdelivr.net/npm/@samline/drawer@<version>/…) instead of unpkg. The files are the same. homepageis the canonical site URL with its trailing slash,https://samline.github.io/drawer/.
[5.1.2] - 2026-11-05
Fixed
- Closing a drawer restores focus to the trigger (or to another open drawer) with
preventScroll, so the page no longer jumps when the trigger is off-screen (#4).
[5.1.1] - 2026-11-05
Fixed
- Dismissing the soft keyboard restores the drawer’s authored inline
height/bottominstead of leaving the px values written while it was open (#3).
[5.1.0] - 2026-11-05
Behavior changes
- An overlay click dismisses only when the press both starts and ends on the overlay. Selecting text or dragging a control inside the panel and releasing over the backdrop no longer closes the drawer.
- Escape is ignored while an input method editor is composing text, so cancelling a composition no longer discards the drawer.
- The built-in handle is a named, focusable button only when it can cycle snap points. Without snap points, or with
preventCycle, it stays a pointer drag affordance withtabindex="-1",aria-hidden="true"and noaria-label. - Drag-to-close respects scrollable content on every edge. Top and left drawers no longer close while their list can still scroll toward the closing direction, and left/right drawers check horizontal rather than vertical scroll.
- The default handle color changed from
#e2e2e4at 70% opacity (about 1.2:1 on white) to#8e8e93(3.3:1 on white, 6.4:1 on black).
Added
--drawer-handle-colorcustom property for theming the built-in handle.prefers-reduced-motion: reducesupport in the package stylesheet: drawers, overlays and the scaled[data-drawer-wrapper]change state without animation or transitions.- The
triggerTextbutton now carriesaria-haspopup="dialog"and anaria-expandedvalue that follows the open state.
Fixed
- The
triggerTextbutton was removed and recreated on every open, so focus could not return to it after a modal close. It now persists across renders and receives focus back. - A structural
update()on an open modal drawer briefly focused the background trigger before refocusing the rebuilt panel; a rebuilt parent could also pull focus out of an open child drawer. - Initial modal focus uses
preventScroll, soautoFocuson a control lower in a long body no longer opens the drawer scrolled past its heading. - The focus trap treated controls with a negative
tabindexor inside a disabled fieldset as tab stops, letting Tab leave the dialog. - The keyboard viewport pipeline fed side-panel widths into its height math, writing
height: <width>pxon left/right drawers when a focused input triggered a viewport resize. - Visually hidden title/description slots ignored
white-space: nowrapbecause the property was written with a camelCase name throughsetProperty; they also gainclip-path: inset(50%). - Removed unused internal helpers (
reset,assignStyle,isInView,trackScrollPosition) and unused trigger callback plumbing. None was part of the public API.
[5.0.3] - 2026-10-28
Fixed
- Orient built-in left/right grips vertically while preserving horizontal top/bottom grips.
- Document and regression-test handleOnly precedence over explicit showHandle false, with lateral control-rail and accessible-title guidance.
- Update vulnerable Vitest tooling without relaxing CI audits. npm publication remains a separate maintainer action.
[5.0.2] - 2026-10-21
Fixed
- Local stylesheet aliases preserve Vite query suffixes such as
?inline, so clean-checkout and alternate-base builds do not depend on an already installed or built copy of Drawer.
Changed
- Separated Pages publication from the exhaustive CI workflow, following Ticker’s deployment model. All package, app, adaptation and browser checks remain in independent CI; publishing still validates the built site’s links, migration destinations and release evidence.
[5.0.1] - 2026-10-21
Fixed
- Website workspace scripts now work under both Bun and npm. Putting the workspace option before
runpreserves the owning app when Bun executes the parent validation script, fixing GitHub Pages validation without changing the runtime API.
[5.0.0] - 2026-10-21
Breaking changes
-
createDrawer()always creates an independent instance. Omitted ids are generated instead of sharingdefault; explicit ids must be non-empty and unique. Duplicate registration throws. Use the owned controller’supdate()for changes. -
Registry queries require an explicit id and return stable controller objects.
getDrawers()still returns a fresh keyed object, now containing those exact controllers. -
Destruction is terminal. Retained handles cannot recreate a drawer or control a new instance reusing the id.
getSnapshot(), options access, commands and subscriptions on destroyed handles throw; the id stays readable, element is null and repeated destroy is harmless. -
Removed
configureDrawer,openDrawer,closeDrawer,toggleDrawer,updateDraweranddestroyDrawer. Keep the factory’s controller, or usegetDrawer(id)and its instance methods.destroyDrawers()remains whole-registry cleanup. -
Removed the browser-only
newDrawer,availableandbrowseraliases. Use the samecreateDrawer()factory with native HTMLElement/template content andgetDrawers()for inspection. The named/defaultDrawernamespace and individual exports remain on/browser; HTML/CDN still exposeswindow.Drawer. -
Replaced
patch()with oneupdate()method on DOM and state-only controllers. DOMupdate()now returns the resulting snapshot, matching the other state commands, instead of another controller facade. Instance ids cannot be changed by updates. -
Removed the deprecated
mountElementoption. Usecontainer; null or omission mounts underdocument.body.
Added
- State-only controllers now support explicit, idempotent
destroy()to dispose subscriptions and reject later operations. - Regression coverage for generated ids, duplicate ids, stable identity, missing lookups, stale handles after id reuse and headless disposal.
Fixed
- Teardown from lifecycle callbacks or subscriptions stops further work for that instance, without scheduling orphan animation callbacks or affecting a replacement id.
- Failed content factories now roll back partial dialog DOM and registry ownership, allowing a clean explicit retry.
Changed
- Separated DOM content, modal focus/isolation, gesture listeners, snap geometry and background scaling from dialog lifecycle coordination. Existing pointer, nested, viewport, accessibility and animation capabilities are retained.
- Expanded the shared gallery to eighteen task-specific examples, including guided configuration, independent panels and a custom floating card; kept complete/split CDN and ESM files aligned.
- Consolidated repository maintenance notes and retired duplicate documentation stubs, unused inherited controls and obsolete vendored agent material. Public documentation routes and historical fragments remain available.
- Reorganized onboarding around one owned controller and optional registry inspection. Updated complete/split examples, framework/CMS integrations, documentation, metadata and agent guidance. Removed-method URLs are migration notes rather than active API navigation.
Migration
| v4 | v5 |
|---|---|
configureDrawer(options) |
createDrawer(options) for a new instance; drawer.update(options) for changes. |
openDrawer(id) / closeDrawer(id) |
getDrawer(id)?.setOpen(true/false); queries do not create. |
toggleDrawer(id) |
Read the owned controller’s current isOpen and pass its inverse to setOpen(). |
updateDrawer(id, options) / drawer.patch(options) |
drawer.update(options) or getDrawer(id)?.update(options). |
destroyDrawer(id) |
drawer.destroy() or getDrawer(id)?.destroy(). |
Drawer.available |
Drawer.getDrawers(). |
Drawer.newDrawer({html}) |
Drawer.createDrawer({ content: () => template.content.firstElementChild.cloneNode(true) }). |
import { browser } |
Ordinary root function imports, or import { Drawer } from '@samline/drawer/browser'. |
mountElement: element |
container: element. |
| Re-create to update the same id | Keep the existing controller or query it; duplicate creation now throws. |
[4.2.1] - 2026-09-28
Fixed
- Modeless overlays now settle at visible, interactive open-state styles and use package-scoped fade keyframes, preventing an invisible overlay from intercepting pointer events when application keyframes collide.
[4.2.0] - 2026-09-28
Added
- Added
overlayas an independent backdrop control.modal: false, overlay: truenow supports local dismissible overlays without focus trapping, background isolation, or body scroll locking.
[4.1.0] - 2026-09-23
Added
- Added a shared
browseralias so bundler and IIFE consumers use the sameDrawersingleton. - Added
newDrawer({ id, html, options })for trusted server-rendered HTML integrations. - Added a read-only
availableview derived from the package registry; it never creates a second source of truth.
[4.0.1] - 2026-09-20
Documentation completeness and accuracy release. There are no runtime or public API changes.
Documentation
- Rebuilt the Starlight getting-started path around installation, a complete visible drawer, styling, controller usage, lifecycle, and cleanup.
- Corrected the documented DOM and ARIA contract, including conditional slots, handle markup, body selectors, accessible-name fallbacks, and element ownership.
- Added complete controller, browser-module, IIFE, compatibility, update/remount, snapshot mutability, and stale-controller behavior references.
- Reorganized navigation and recipes by developer task, added complete bundler/CDN examples, and covered modal, accessibility, nested, snap-point, and headless-renderer scenarios.
- Fixed broken internal links, invalid TypeScript examples, edit-page URLs, contradictory guidance, and incomplete snippets.
[4.0.0] - 2026-09-10
Accessibility, package-entrypoint, and lifecycle-safety release. This is a major release because modal focus behavior, handle markup, and the @samline/drawer/browser module contract change.
Breaking changes
- Modal drawers now move initial focus inside the dialog. With
autoFocus: false, focus lands on the dialog container; withautoFocus: true, it lands on the first visible focusable descendant. - The built-in
[data-drawer-handle]is now a<button>instead of a<div>. CSS selectors based on the data attribute continue to work, but element-name selectors must be updated. @samline/drawer/browseris now a real ESM/CJS namespace module. Classic scripts must keep using the explicitdist/browser/global.global.jsIIFE URL.
Changed
- Modal drawers now move focus inside, isolate background branches with
inertandaria-hidden, restore trigger focus on close, and expose the snap handle as a named button. @samline/drawer/browseris now a real ESM/CJS module namespace; the classic global remains available atdist/browser/global.global.js.- Parent relationships reject direct and indirect cycles before mutating the registry.
- CI now verifies formatting, types, build output, tests, dependency advisories, and package contents.
Fixed
- Preserved the CSS and global IIFE as package side effects so bundlers do not tree-shake them.
- Updated vulnerable development dependencies and added a reproducible lockfile for the documentation site.
[3.1.0] - 2026-07-31
Memory hygiene hardening release. No public API change. No behavioral change for the happy path. All fixes are defensive: cleanup callbacks that throw are isolated so the teardown completes its downstream responsibilities, and event listeners that depend on a one-shot contract are now also reachable from the explicit teardown path.
Fixed (F18 — memory hygiene)
teardownMountcleanup exception isolation (src/vanilla/dialog.ts). Thestate.cleanupsfor-loop, thestate.cleanupDragGesture?.()call, and thestate.cleanupBuiltInTrigger?.()call are each wrapped in their own try-catch. A thrownremoveEventListener(e.g. on a null or detached element during a partial-teardown race: open → close → reopen inside the 600 msremoveDomsafety window) used to abort the for-loop, skip the remaining cleanups, and preventstate.cleanups = []from being written. The orphaned listeners (mouseup,pointerdown,click,resize,visualViewport.resize) held the per-mount state alive via closure capture until the nextdestroyDraweror page reload. The fix logs aconsole.warnin dev and lets the teardown continue. Body scroll lock release, focus restoration, andhistory.scrollRestorationstill run after a thrown cleanup.chain()exception isolation (src/helpers.ts). The for-loop that runs each callback is wrapped in a try-catch with the same dev-warn + swallow pattern. This is the underlying primitive thatteardownMount’s cleanup array andpreventScrollMobileSafari’sremoveEventschain both depend on, so the isolation is applied at the source.visualViewport.resizelistener cleanup in the mobile-safari scroll-lock pipeline (src/runtime/scroll-lock.ts). TheonFocuspath that waits for the keyboard to appear now tracks each pending listener in apendingViewportResizeCleanupsarray. The previous implementation used{ once: true }and relied on the listener self-removing when fired — but if the visual viewport never resizes (desktop, or the keyboard already closed), the listener never fired and was never removed, holding the focused input via closure. The teardown chain drains the array on close.
Documentation
- Marked
reset()(src/helpers.ts) andtrackScrollPosition()(src/runtime/scroll-lock.ts) as@internal. Both are exported only for the test suite (verifying the G6 cache contract and the scroll listener cleanup) and are not re-exported from the publicindex.ts. The@internalJSDoc tag makes the intent explicit for IDE tooling and future audits.
Investigated, no change required
bindTriggerElementclosure retention (src/runtime/registry.ts). Initial audit flagged thetriggerElementcapture in the external-trigger cleanup as a potential leak. Re-analysis showed the retention is redundant:runtime.options.triggerElementholds a strong reference to the same element via the options object. If the consumer does not calldestroyDrawer, both the options and the cleanup hold the element — fixing the cleanup alone would not change the lifetime. The actual fix is the consumer contract: calldestroyDrawerwhen done. The normalupdate({ triggerElement: ... })flow already nulls the old cleanup correctly.- Monotonically-increasing open-order counters (
nextOpenOrder,fallbackOpenOrder). Bounded byNumber.MAX_SAFE_INTEGER; no realistic overflow path. drawerInstancesMap growth. By design: the map is keyed by consumer-supplied ids and onlydestroyDrawer(id)removes entries. Consumers that create many dynamic ids are responsible for cleanup (or for callingdestroyDrawerson page unload).
Tests
319 tests passing (+14 new across test/cleanup-exception-safety.test.ts, test/visual-viewport-listener-cleanup.test.ts, and the new chain cases in test/helpers.test.ts).
[3.0.0] - 2026-07-28
First stable release of the v3 vanilla line. Closes the long-running beta series by promoting the 3.0.0-beta.4 surface with two consumer-facing simplifications.
Changed
- Default props — accessibility wiring without boilerplate.
title,description, andariaLabelare now all optional. When the consumer passes none of them, the runtime auto-assignsariaLabel = idas a fallback, exposed on the dialog viaaria-label. The title and description slots are only mounted when the consumer passes the correspondingtitle/descriptionoption — there is no empty proxy slot. When a slot exists, it carries the consumer-supplied text and is thearia-labelledby/aria-describedbytarget. When it does not, the corresponding ARIA reference is omitted entirely (no morearia-describedbypointing at an empty slot, no morearia-labelledbypointing at a hidden proxy). Consumers who used to passtitle: '...', titleVisuallyHidden: true, description: '...', descriptionVisuallyHidden: trueonly to silence a11y warnings can now drop all four props. - HTML tree — fewer wrappers, simpler custom drawers. Removed the inner
[data-drawer-vanilla-node]wrapper. The[data-drawer-vanilla-body]wrapper was renamed to[data-drawer-body]. The title and description slots (when present) live inside[data-drawer-body], in that order, before the consumer content. The optional close button is still appended to[data-drawer]after the body. Consumers targeting these slots in CSS should update their selectors accordingly. - Default visibility. The title slot renders visibly by default when an explicit
titleis passed (escape hatchtitleVisuallyHidden: trueis preserved for retro-compat). The description slot is auto-hidden by default when an explicitdescriptionis passed (escape hatchdescriptionVisuallyHidden: falseis preserved for retro-compat).
[3.0.0-beta.4] - 2026-07-28
The fourth beta hardens the vanilla renderer after the Vaul parity audits. It focuses on presence, gesture intent, multi-drawer ownership, Safari/iOS restoration, and documentation that describes the shipped vanilla behavior without claiming package-wide 1:1 parity.
Added
- Lazy visual presence: a closed drawer keeps only its per-id host and optional trigger. Overlay, content, handle, and slots mount on open, remain through the exit transition, and are then removed.
- Logical open-order tracking for Escape handling, focus restoration, nested drawers, reentrant opens, and multiple drawers that share a custom container.
- Shared ownership for background scaling, body colors, modal scroll locks,
htmlscroll behavior, Safari fixed-body positioning, and optional history scroll restoration. - Regression coverage for multi-drawer lifecycle, Safari/iOS side-effect restoration, snap entrance, and the built IIFE contract. The suite now covers 44 files and 297 passing tests, with one pre-existing intentional skip.
Changed
- Pointer capture now waits until dominant-axis intent and drag permission are confirmed. Perpendicular gestures remain available to page scrolling, and teardown releases capture and ignores secondary pointer ids.
- Programmatic and drag-release closes start from the currently rendered transform, including an entrance, snap-back, or snap transition already in progress.
- A missing
fadeFromIndexnow resolves to the final snap index when snap points are configured. Snap strings remain pixel values; numeric values remain container-relative fractions. - Every drawer owns a private host even when several drawers use the same
container;mountElementremains a deprecated nullish fallback. - The vanilla runtime no longer writes
document.body.style.pointerEvents. Overlay hit testing is owned by the stylesheet, while existing application or modal-library body styles remain untouched.
Fixed
- Corrected drag behavior across all four directions, including
handleOnly,dismissible: false, empty snap arrays, handle cycling, scrollable descendants, pointer cancellation, and computed-transform parsing withoutDOMMatrix. - Prevented stale close timers, viewport listeners, pointer capture, scale transitions, and snap resets from mutating a reopened, remounted, or destroyed drawer.
- Made shared wrapper/body effects composable across multiple drawers and restored original inline values plus CSS priorities only after the final owner releases them.
- Preserved Safari fixed-body offsets, scroll positions, negative margins, style priorities, and initial-open compensation without allowing one drawer to unlock another.
- Corrected focus trapping and restoration for stacked drawers, topmost-only Escape handling, ARIA ids containing selector-special characters, and duplicate custom title/description targets.
- Kept controller snapshots and runtime options synchronized for active snap changes, option patches, and no-op state writes.
Documentation
- Rebuilt
README.mdanddocs/around the current module, browser-global, lifecycle, options, CSS, TypeScript, recipes, and per-method API contracts. - Populated the Starlight site under
example/src/content/docs/with the same beta.4 behavior and exact CDN entrypoints. - Recorded the deliberate vanilla API differences and corrected the historical audit reports so scoped Vaul comparisons are not presented as package-wide parity guarantees.
Versioning note
3.0.0-beta.4 remains a pre-release. Automated coverage runs in Vitest/jsdom; final interaction validation in real Chrome, Firefox, Safari, and iOS browsers remains part of the stable-release checklist.
[3.0.0-beta.3] - 2026-07-25
The third beta of the v3.0.0 line. This release focuses on completing the drag pipeline that was deferred during the React→vanilla refactor (v3.0.0-beta.0), plus a tooling and cleanup pass to align with the @samline/forms and @samline/notify conventions.
Added (drag pipeline)
- Phase A — drag-to-dismiss. Wired the pointer-event pipeline (
pointerdown/pointermove/pointerup) on the dialog content element. Honors the close threshold (default 25 % of the drawer dimension) and the velocity threshold (default 0.4) to decide between close and reset. CallsonDragChange(percentageDragged)while the drag is in progress andonReleaseChange(open)on release. Respects thedata-drawer-no-dragopt-out and the 500 ms grace period after opening. - Phase B — snap points. When
snapPointsis set, the dialog positions itself at the active snap’s offset on open, the drag interpolates between snaps viagetSnapDragValue, and the release callsgetSnapPointReleaseActionto close, snap, or noop. HonorsfadeFromIndex(overlay fades at the configured snap),snapToSequentialPoint(one snap at a time on high velocity), andactiveSnapPointupdates via the newonActiveSnapPointChangecallback. - Phase C — shouldScaleBackground + setBackgroundColorOnScale. When
shouldScaleBackground: true, the page wrapper ([data-drawer-wrapper]) scales down and shifts while the drag is in progress, usinggetBackgroundDragStateandgetBackgroundResetStatefrom the runtime math. Resets to the normal state on close-release, and to the open-state rest on reset-release. Direction-aware viewport size.setBackgroundColorOnScale: trueoverlays a translucent black background on the wrapper during the drag. - Phase D — handle cycle. Clicking the built-in
[data-drawer-handle]advances the active snap point viagetNextHandleState. At the last snap withdismissible: true, closes the drawer; withdismissible: false, cycles back to the first snap. NewCommonDrawerOptions.preventCycleoption disables the click-to-cycle behavior. Drag-in-progress suppresses the handle click. - Phase E — viewport keyboard + preventScrollRestoration. When
repositionInputs: trueorfixed: true, the dialog attaches awindow.visualViewport.resizelistener that callsgetViewportDrivenDrawerLayoutand appliesstyle.bottom/style.heightaccordingly.preventScrollRestoration: truetoggleswindow.history.scrollRestorationbetween'manual'and'auto'across the open/destroy lifecycle. The destroy path now also tears the dialog down via the newdestroyVanillaDialogso the cleanup array is consumed on destroy (not just on close).
Added (tooling)
tsup.config.ts— 2 entries:index(ESM + CJS + d.ts) andbrowser/global(IIFE). Replaces the custom bunchee + esbuild + linkedom scripts (scripts/build.mjs,scripts/sync-dist.mjs).vitest.config.ts—jsdomenvironment withurl: 'http://localhost/'. Replaces the per-testvi.stubGlobal('window', ...)+linkedomboilerplate.src/browser/global.ts(new) — the IIFE entry. Single source of truth forwindow.DrawerandglobalThis.Drawerassignment.src/browser/index.ts(rewritten) — pure module barrel, noglobalThisside-effects. ThesideEffects: falsedeclaration on the root entrypoint is now honest.
Changed (tooling)
package.json:sideEffects: falseat the root entrypoint (the IIFE bundle stays side-effectful via./browser).engines.node >=20,publishConfigset,prepublishOnlyscript.exportssimplified to.,./browser,./styles.css. Thereact,vue,svelte,coresubpaths are removed (the legacycoreis reachable through tree-shaking on the root entry).- Scripts:
clean,build,dev,typecheck,test,test:watch,format,format:check,prepublishOnly.bunis no longer the runtime;bunx vitestandbunx tsupreplace the custombun scripts/build.mjsworkflow. devDependenciesupdated: removedbunchee,esbuild,linkedom; addedjsdom,tsup,vitest@^3.1.1,prettier@^3.3.0. Bumpedtypescriptand@types/nodeto matchformsandnotify.
.github/workflows/tag-release.ymlremoved. The publish flow is nownpm publish(manual), matchingformsandnotify..gitignore,.npmignore,.prettierrc.jsported to theforms/notifyconventions.prettier@3deprecation warnings resolved (droppedjsxBracketSameLine).- Browser bundle URL:
dist/browser/index.js→dist/browser/global.global.js(tsup default). Unpkg URLs indocs/updated accordingly.
Changed (cleanup)
src/browser-utils.ts(88 lines, unused) deleted.src/types.ts(redundantDrawerDirection/DrawerSnapPoint/SnapPointaliases) deleted.src/helpers.tsreduced from 130 LoC to ~30 LoC. RemovedisInView,reset,getTranslate,dampenValue,assignStyle,chain, and thecacheWeakMap fromset. KeptsetandisVertical. The two@ts-ignorecomments ingetTranslateare gone with the function.src/runtime/*.tsgot module-level docstrings explaining what each pure-math helper does and whether it is currently wired into the dialog. No signature changes.- Comments mentioning the legacy React build are removed from the source (the
data-drawer-vanilla-*data-attribute contract is no longer framed as a “replacement for Radix”; it is the contract).
Fixed
runtime/registry.ts#setOpennow callsrenderVanillaDrawer(id)afternotifyOpenStateChange. Previously a programmaticdrawer.setOpen(true)updated the controller’s snapshot but never re-rendered the dialog DOM, leaving thedata-state="closed"attribute stale until the next user-driven event. The trigger-click path still re-renders correctly; the programmatic path now matches.vanilla/dialog.ts#teardownMountnow removes thestate.contentelement from the DOM (along withstate.triggerandstate.overlay). Previously the content node was retained across re-mounts, leaking DOM nodes and leaving thedocument.querySelector('[data-drawer]')consumers pointing at a detached, stale element. Verified by the newvanilla root entry > updates data-state on the dialog when opened programmaticallytest.- Browser bundle path corrected:
dist/browser/global.global.jsis the actual emitted file (wasdist/browser/index.jsunder the bunchee pipeline). docs/{api,browser}.mdCDN URLs and version references swept from@3.0.0-betato@3.0.0-beta.3. Thedist/browser/index.jsreferences indocs/api.mdanddocs/browser.mdare replaced withdist/browser/global.global.js.
Removed
.github/workflows/tag-release.yml— auto-publish on tag push. The user publishes manually.scripts/build.mjsandscripts/sync-dist.mjs— replaced bytsup.config.ts.bun.lockb— binary lockfile.bun.lock(text) is the new lockfile whenbun installis used.- Subpath exports
./react,./vue,./sveltefrompackage.json#exports(the source for these was already deleted inv3.0.0-beta.0but the exports and thedocs/{react,vue,svelte}.mdstill promised them).
Internal — test coverage
129 passed | 1 skipped (130)frombunx vitest run. The skipped test is the pre-existingit.skip('prevents built-in trigger focus on mouse down when modal focus release is required', ...)intest/browser.test.ts— jsdom does not enforcedefaultPreventedsemantics on synthetic events, and the runtime ships a separate focus model; the skip is intentional.- New tests:
test/drag-pipeline-integration.test.ts— 6 tests (Phase A).test/drag-snap-points-integration.test.ts— 8 tests (Phase B).test/drag-scale-background-integration.test.ts— 8 tests (Phase C).test/drag-handle-cycle-integration.test.ts— 8 tests (Phase D).test/drag-viewport-keyboard-integration.test.ts— 9 tests (Phase E, plus aMockVisualViewportpolyfill for jsdom).test/vanilla-entry.test.ts > updates data-state on the dialog when opened programmatically— the regression test for the two bugs above.
Versioning note
3.0.0-beta.3 is a pre-release of the v3.0.0 line. The previous 3.0.0-beta.0 (React→vanilla baseline, af932e3), 3.0.0-beta.1 (version bump on the pre-Phase-A vanilla build, e1b91fa), and 3.0.0-beta.2 (memory-leak / CSS / a11y fixes, 6e2dc55) are all retroactive tags that were not published to npm. 3.0.0-beta.4 later superseded the planned direct jump from beta.3 to stable.
[3.0.0-beta.2] - 2026-07-15
Retroactive tag. Never published to npm. Captures the pre-
3.0.0-beta.3working tree.
Fixed
- Memory leak in the vanilla host: each
createDrawermounted a fresh<div data-drawer-vanilla-root>butdestroyDrawerleft the host orphaned. Added the explicitnextElement.parentNode.removeChild(nextElement)inrenderVanillaHostwhen the host element changes. - CSS
data-state="closed"animation got cut off becauseanimation-fill-mode: forwardswas missing. Applied to the fiveslideTo{Bottom,Top,Left,Right}andfadeOutrules. - A11y ids:
[data-drawer-title]and[data-drawer-description]slots get a generatedidwhenariaLabelledBy/ariaDescribedByis provided, so thearia-labelledby/aria-describedbyattributes point to a real target.
Versioning note
3.0.0-beta.2 never bumped the drawer id position; the slot id format is ${drawer.id}-title / ${drawer.id}-description, unique per instance.
[3.0.0-beta.1] - 2026-07-14
Retroactive tag. Never published to npm. Captures the pre-
3.0.0-beta.2working tree.
Changed
- Version bumped to
3.0.0-beta.1(no functional change over3.0.0-beta.0; this was a placeholder bump while the pre-existing React build was being torn out).
[3.0.0-beta.0] - 2026-07-13
Retroactive tag. Never published to npm. Captures the React→vanilla refactor.
Changed
Major rewrite of @samline/drawer. The package is now a framework-agnostic, vanilla-only drawer runtime with a single root entrypoint and a window.Drawer browser bundle. All previous multi-framework subpaths (react, vue, svelte) are removed.
- Single public surface:
createDrawer,configureDrawer,getDrawer,getDrawers,getParentDrawer,getChildDrawers,updateDrawer,openDrawer,closeDrawer,toggleDrawer,destroyDrawer,destroyDrawers,createDrawerController. TheDrawernamespace mirrors the imperative surface in the browser bundle. - ESM + CJS + IIFE +
.d.tsviabunchee+ a customscripts/sync-dist.mjs.dist/shipsindex.js,index.cjs,browser/index.js,style.css, and matching.d.tsfiles. sideEffects: falseat the root entrypoint; consumers who wantwindow.Drawerimport@samline/drawer/browserinstead.- Test suite rewritten in vitest under
tests/(15 files, 87 tests). - Docs reorganized: split
docs/api.mdinto per-function pages underdocs/api/, plusgetting-started,options,recipes,css-styling,typescript.docs/browser.mdrewritten for the IIFE bundle. (docs/{react,vue,svelte}.mdwere also removed; this CHANGELOG entry covers the deletion.) - The CSS contract is unchanged: every element the stylesheet reads uses a
data-drawer*attribute. The visual treatment is identical to the React build.
Removed
src/react/,src/vue/,src/svelte/— all wrapper code.src/use-*.ts— all six React hooks (composedRefs,controllableState,positionFixed,preventScroll,scaleBackground,snapPoints).src/context.ts— ReactDrawerContext.src/noinfer.d.ts,src/scheduler-tracing.d.ts— React-only type shims.src/runtime/index.ts— theuseDrawerRuntimeReact hook (theruntime/*pure helpers stayed).@radix-ui/react-dialog,react,react-dom,schedulerdeps;react,react-dom,vue,sveltepeerDeps frompackage.json.
Internal — runtime helpers (kept)
The pure math helpers survived the refactor unchanged. They live under src/runtime/ and were the seed for the Phase A–E drag pipeline that ships in 3.0.0-beta.3:
runtime/drag.ts—getDragDirectionMultiplier,getDraggedDistance,isDraggingTowardExpandedState,getDragPercentage,isReleaseTowardExpandedState,shouldCloseDrawerOnRelease.runtime/snap-points.ts—getActiveSnapPointIndex,getShouldFade,getSnapPointOffset,getSnapPointsOffset,getSnapDragValue,getClosestSnapPoint,getSnapPointPercentageDragged.runtime/transforms.ts—getAxisAwareTranslate,getScaleTranslateTransform,getNestedDrawerTransform,getNestedDragTransform,getBackgroundDragState,getBackgroundResetState.runtime/release.ts—shouldPreventFocusOnRelease,getReleaseAction,getDismissibleReleaseResult,getSnapPointReleaseAction.runtime/handle.ts—getNextHandleState.runtime/pointer.ts—getSwipeIntent.runtime/drag-policy.ts—getDragTargetMetadata,getDragPermission.runtime/viewport.ts—getKeyboardOpenState,getViewportDrivenDrawerLayout.runtime/nested.ts—getParentNestedVisualState.
All were unit-tested in v3.0.0-beta.0 and remained the contract for the drag pipeline wired in 3.0.0-beta.3.
Versioning note
3.0.0-beta.0 is a deliberate reset, not a minor bump. The pre-3.0.0 series was the multi-framework build. Anything that imported @samline/drawer/react, /vue, or /svelte must migrate to the vanilla API.
[2.0.8] - 2026-07-09
Pre-vanilla-release. The last
2.0.xbefore the React→vanilla refactor.
The 2.0.x line carried the React/Vue/Svelte wrappers. Tagged but not retroactively detailed here. See the v2.0.8 git tag for the diff.