Guide

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.icon accepts any Element, so an <svg> icon no longer needs a cast to HTMLElement. It was already appended as-is at runtime.

Fixed

  • closeButton: true (and an object without icon) rendered the literal word “xmark” inside the close button. The default icon is now an inline SVG X drawn with currentColor and sized with the button’s font (1em). A custom icon string 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/browser and the classic script no longer have a default export. Use import { Drawer } from '@samline/drawer/browser' or the named functions; window.Drawer is unchanged.
  • The standalone script is now dist/browser/drawer.global.js, also exported as @samline/drawer/browser/global. dist/browser/global.global.js is 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.css stays as an alias of the same file.
  • The package installs with pnpm and runs its scripts with Bun. ./package.json is 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.
  • homepage is 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/bottom instead 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 with tabindex="-1", aria-hidden="true" and no aria-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 #e2e2e4 at 70% opacity (about 1.2:1 on white) to #8e8e93 (3.3:1 on white, 6.4:1 on black).

Added

  • --drawer-handle-color custom property for theming the built-in handle.
  • prefers-reduced-motion: reduce support in the package stylesheet: drawers, overlays and the scaled [data-drawer-wrapper] change state without animation or transitions.
  • The triggerText button now carries aria-haspopup="dialog" and an aria-expanded value that follows the open state.

Fixed

  • The triggerText button 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, so autoFocus on a control lower in a long body no longer opens the drawer scrolled past its heading.
  • The focus trap treated controls with a negative tabindex or 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>px on left/right drawers when a focused input triggered a viewport resize.
  • Visually hidden title/description slots ignored white-space: nowrap because the property was written with a camelCase name through setProperty; they also gain clip-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 run preserves 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 sharing default; explicit ids must be non-empty and unique. Duplicate registration throws. Use the owned controller’s update() 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, updateDrawer and destroyDrawer. Keep the factory’s controller, or use getDrawer(id) and its instance methods. destroyDrawers() remains whole-registry cleanup.

  • Removed the browser-only newDrawer, available and browser aliases. Use the same createDrawer() factory with native HTMLElement/template content and getDrawers() for inspection. The named/default Drawer namespace and individual exports remain on /browser; HTML/CDN still exposes window.Drawer.

  • Replaced patch() with one update() method on DOM and state-only controllers. DOM update() 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 mountElement option. Use container; null or omission mounts under document.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 overlay as an independent backdrop control. modal: false, overlay: true now supports local dismissible overlays without focus trapping, background isolation, or body scroll locking.

[4.1.0] - 2026-09-23

Added

  • Added a shared browser alias so bundler and IIFE consumers use the same Drawer singleton.
  • Added newDrawer({ id, html, options }) for trusted server-rendered HTML integrations.
  • Added a read-only available view 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; with autoFocus: 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/browser is now a real ESM/CJS namespace module. Classic scripts must keep using the explicit dist/browser/global.global.js IIFE URL.

Changed

  • Modal drawers now move focus inside, isolate background branches with inert and aria-hidden, restore trigger focus on close, and expose the snap handle as a named button.
  • @samline/drawer/browser is now a real ESM/CJS module namespace; the classic global remains available at dist/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)

  • teardownMount cleanup exception isolation (src/vanilla/dialog.ts). The state.cleanups for-loop, the state.cleanupDragGesture?.() call, and the state.cleanupBuiltInTrigger?.() call are each wrapped in their own try-catch. A thrown removeEventListener (e.g. on a null or detached element during a partial-teardown race: open → close → reopen inside the 600 ms removeDom safety window) used to abort the for-loop, skip the remaining cleanups, and prevent state.cleanups = [] from being written. The orphaned listeners (mouseup, pointerdown, click, resize, visualViewport.resize) held the per-mount state alive via closure capture until the next destroyDrawer or page reload. The fix logs a console.warn in dev and lets the teardown continue. Body scroll lock release, focus restoration, and history.scrollRestoration still 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 that teardownMount’s cleanup array and preventScrollMobileSafari’s removeEvents chain both depend on, so the isolation is applied at the source.
  • visualViewport.resize listener cleanup in the mobile-safari scroll-lock pipeline (src/runtime/scroll-lock.ts). The onFocus path that waits for the keyboard to appear now tracks each pending listener in a pendingViewportResizeCleanups array. 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) and trackScrollPosition() (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 public index.ts. The @internal JSDoc tag makes the intent explicit for IDE tooling and future audits.

Investigated, no change required

  • bindTriggerElement closure retention (src/runtime/registry.ts). Initial audit flagged the triggerElement capture in the external-trigger cleanup as a potential leak. Re-analysis showed the retention is redundant: runtime.options.triggerElement holds a strong reference to the same element via the options object. If the consumer does not call destroyDrawer, 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: call destroyDrawer when done. The normal update({ triggerElement: ... }) flow already nulls the old cleanup correctly.
  • Monotonically-increasing open-order counters (nextOpenOrder, fallbackOpenOrder). Bounded by Number.MAX_SAFE_INTEGER; no realistic overflow path.
  • drawerInstances Map growth. By design: the map is keyed by consumer-supplied ids and only destroyDrawer(id) removes entries. Consumers that create many dynamic ids are responsible for cleanup (or for calling destroyDrawers on 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, and ariaLabel are now all optional. When the consumer passes none of them, the runtime auto-assigns ariaLabel = id as a fallback, exposed on the dialog via aria-label. The title and description slots are only mounted when the consumer passes the corresponding title / description option — there is no empty proxy slot. When a slot exists, it carries the consumer-supplied text and is the aria-labelledby / aria-describedby target. When it does not, the corresponding ARIA reference is omitted entirely (no more aria-describedby pointing at an empty slot, no more aria-labelledby pointing at a hidden proxy). Consumers who used to pass title: '...', titleVisuallyHidden: true, description: '...', descriptionVisuallyHidden: true only 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 title is passed (escape hatch titleVisuallyHidden: true is preserved for retro-compat). The description slot is auto-hidden by default when an explicit description is passed (escape hatch descriptionVisuallyHidden: false is 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, html scroll 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 fadeFromIndex now 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; mountElement remains 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 without DOMMatrix.
  • 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.md and docs/ 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. Calls onDragChange(percentageDragged) while the drag is in progress and onReleaseChange(open) on release. Respects the data-drawer-no-drag opt-out and the 500 ms grace period after opening.
  • Phase B — snap points. When snapPoints is set, the dialog positions itself at the active snap’s offset on open, the drag interpolates between snaps via getSnapDragValue, and the release calls getSnapPointReleaseAction to close, snap, or noop. Honors fadeFromIndex (overlay fades at the configured snap), snapToSequentialPoint (one snap at a time on high velocity), and activeSnapPoint updates via the new onActiveSnapPointChange callback.
  • Phase C — shouldScaleBackground + setBackgroundColorOnScale. When shouldScaleBackground: true, the page wrapper ([data-drawer-wrapper]) scales down and shifts while the drag is in progress, using getBackgroundDragState and getBackgroundResetState from 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: true overlays 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 via getNextHandleState. At the last snap with dismissible: true, closes the drawer; with dismissible: false, cycles back to the first snap. New CommonDrawerOptions.preventCycle option disables the click-to-cycle behavior. Drag-in-progress suppresses the handle click.
  • Phase E — viewport keyboard + preventScrollRestoration. When repositionInputs: true or fixed: true, the dialog attaches a window.visualViewport.resize listener that calls getViewportDrivenDrawerLayout and applies style.bottom / style.height accordingly. preventScrollRestoration: true toggles window.history.scrollRestoration between 'manual' and 'auto' across the open/destroy lifecycle. The destroy path now also tears the dialog down via the new destroyVanillaDialog so the cleanup array is consumed on destroy (not just on close).

Added (tooling)

  • tsup.config.ts — 2 entries: index (ESM + CJS + d.ts) and browser/global (IIFE). Replaces the custom bunchee + esbuild + linkedom scripts (scripts/build.mjs, scripts/sync-dist.mjs).
  • vitest.config.ts — jsdom environment with url: 'http://localhost/'. Replaces the per-test vi.stubGlobal('window', ...) + linkedom boilerplate.
  • src/browser/global.ts (new) — the IIFE entry. Single source of truth for window.Drawer and globalThis.Drawer assignment.
  • src/browser/index.ts (rewritten) — pure module barrel, no globalThis side-effects. The sideEffects: false declaration on the root entrypoint is now honest.

Changed (tooling)

  • package.json:
    • sideEffects: false at the root entrypoint (the IIFE bundle stays side-effectful via ./browser).
    • engines.node >=20, publishConfig set, prepublishOnly script.
    • exports simplified to ., ./browser, ./styles.css. The react, vue, svelte, core subpaths are removed (the legacy core is reachable through tree-shaking on the root entry).
    • Scripts: clean, build, dev, typecheck, test, test:watch, format, format:check, prepublishOnly. bun is no longer the runtime; bunx vitest and bunx tsup replace the custom bun scripts/build.mjs workflow.
    • devDependencies updated: removed bunchee, esbuild, linkedom; added jsdom, tsup, vitest@^3.1.1, prettier@^3.3.0. Bumped typescript and @types/node to match forms and notify.
  • .github/workflows/tag-release.yml removed. The publish flow is now npm publish (manual), matching forms and notify.
  • .gitignore, .npmignore, .prettierrc.js ported to the forms / notify conventions. prettier@3 deprecation warnings resolved (dropped jsxBracketSameLine).
  • Browser bundle URL: dist/browser/index.js → dist/browser/global.global.js (tsup default). Unpkg URLs in docs/ updated accordingly.

Changed (cleanup)

  • src/browser-utils.ts (88 lines, unused) deleted.
  • src/types.ts (redundant DrawerDirection / DrawerSnapPoint / SnapPoint aliases) deleted.
  • src/helpers.ts reduced from 130 LoC to ~30 LoC. Removed isInView, reset, getTranslate, dampenValue, assignStyle, chain, and the cache WeakMap from set. Kept set and isVertical. The two @ts-ignore comments in getTranslate are gone with the function.
  • src/runtime/*.ts got 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#setOpen now calls renderVanillaDrawer(id) after notifyOpenStateChange. Previously a programmatic drawer.setOpen(true) updated the controller’s snapshot but never re-rendered the dialog DOM, leaving the data-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#teardownMount now removes the state.content element from the DOM (along with state.trigger and state.overlay). Previously the content node was retained across re-mounts, leaking DOM nodes and leaving the document.querySelector('[data-drawer]') consumers pointing at a detached, stale element. Verified by the new vanilla root entry > updates data-state on the dialog when opened programmatically test.
  • Browser bundle path corrected: dist/browser/global.global.js is the actual emitted file (was dist/browser/index.js under the bunchee pipeline).
  • docs/{api,browser}.md CDN URLs and version references swept from @3.0.0-beta to @3.0.0-beta.3. The dist/browser/index.js references in docs/api.md and docs/browser.md are replaced with dist/browser/global.global.js.

Removed

  • .github/workflows/tag-release.yml — auto-publish on tag push. The user publishes manually.
  • scripts/build.mjs and scripts/sync-dist.mjs — replaced by tsup.config.ts.
  • bun.lockb — binary lockfile. bun.lock (text) is the new lockfile when bun install is used.
  • Subpath exports ./react, ./vue, ./svelte from package.json#exports (the source for these was already deleted in v3.0.0-beta.0 but the exports and the docs/{react,vue,svelte}.md still promised them).

Internal — test coverage

  • 129 passed | 1 skipped (130) from bunx vitest run. The skipped test is the pre-existing it.skip('prevents built-in trigger focus on mouse down when modal focus release is required', ...) in test/browser.test.ts — jsdom does not enforce defaultPrevented semantics 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 a MockVisualViewport polyfill 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.3 working tree.

Fixed

  • Memory leak in the vanilla host: each createDrawer mounted a fresh <div data-drawer-vanilla-root> but destroyDrawer left the host orphaned. Added the explicit nextElement.parentNode.removeChild(nextElement) in renderVanillaHost when the host element changes.
  • CSS data-state="closed" animation got cut off because animation-fill-mode: forwards was missing. Applied to the five slideTo{Bottom,Top,Left,Right} and fadeOut rules.
  • A11y ids: [data-drawer-title] and [data-drawer-description] slots get a generated id when ariaLabelledBy / ariaDescribedBy is provided, so the aria-labelledby / aria-describedby attributes 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.2 working tree.

Changed

  • Version bumped to 3.0.0-beta.1 (no functional change over 3.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. The Drawer namespace mirrors the imperative surface in the browser bundle.
  • ESM + CJS + IIFE + .d.ts via bunchee + a custom scripts/sync-dist.mjs. dist/ ships index.js, index.cjs, browser/index.js, style.css, and matching .d.ts files.
  • sideEffects: false at the root entrypoint; consumers who want window.Drawer import @samline/drawer/browser instead.
  • Test suite rewritten in vitest under tests/ (15 files, 87 tests).
  • Docs reorganized: split docs/api.md into per-function pages under docs/api/, plus getting-started, options, recipes, css-styling, typescript. docs/browser.md rewritten for the IIFE bundle. (docs/{react,vue,svelte}.md were 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 — React DrawerContext.
  • src/noinfer.d.ts, src/scheduler-tracing.d.ts — React-only type shims.
  • src/runtime/index.ts — the useDrawerRuntime React hook (the runtime/* pure helpers stayed).
  • @radix-ui/react-dialog, react, react-dom, scheduler deps; react, react-dom, vue, svelte peerDeps from package.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.x before 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.