Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/clipboard-create-copy-to-clipboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solid-primitives/clipboard": minor
---

Add `createCopyToClipboard`: copy with a transient, auto-resetting `copied`/`error` status (copy-button helper).
9 changes: 9 additions & 0 deletions .changeset/dismissable-layer-stack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@solid-primitives/dismissable": minor
---

New package: `@solid-primitives/dismissable`

Dismissable layers with a shared layer stack. `makeDismissableLayer` / `createDismissableLayer` handle Escape, outside pointer presses and outside focus (reusing `makeInteractOutside` from `@solid-primitives/interaction`), report a reason (`escape`, `outside-pointer`, `outside-focus`, `programmatic`), and only let the topmost non-persistent layer react so nested layers close one at a time. Supports `dismissible` + `onDismissAttempt`, `exclude`, `persistent` layers, `parent` registration for portaled children and `disableOutsidePointerEvents`. `getLayerStack`, `useLayerStack`, `getTopLayer` and `isTopLayer` expose the stack.

An outside press and the focus move it causes are one interaction (no double `onDismiss` / `onDismissAttempt` for a layer that stays registered), and a touch tap dismisses the layer that was on top when the press began even if the tapped trigger opened a new layer.
5 changes: 5 additions & 0 deletions .changeset/focus-roving-scope-press-keeps-focus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solid-primitives/focus": minor
---

Add `makeRovingScope` / `createRovingScope` (roving tabindex for container items with orientation, loop, RTL, disabled skipping, MutationObserver tracking, remembered active item and independent nested scopes) and `makePressKeepsFocus` / `createPressKeepsFocus` (pressing non-text controls does not steal focus from the focused element). Existing APIs are unchanged.
7 changes: 7 additions & 0 deletions .changeset/interaction-inert-others.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@solid-primitives/interaction": minor
---

Add `makeInertOthers` and `createInertOthers`: mark every subtree outside one or more modal layer elements as `aria-hidden` and/or `inert`, with restoration of previous attribute values, ref-counted stacking of layers, an `ignore` list, live-region protection and a `MutationObserver` that also covers nodes added later. Their shared state lives on `globalThis`, so duplicate copies of the package stay consistent. Protected elements inside a target no longer get their siblings hidden, a root equal to a target is handled, live regions added later inside hidden branches are re-evaluated, and `createInertOthers` keeps its stack position when its inputs change (stacking order is opening order: re-enabling a layer puts it on top). `aria-hidden` is deferred on nodes that contain the focused element until focus leaves them, because Chrome ignores it there, and when every target is removed the layer keeps what it holds until it is updated or closed. `ariaHideOutside` and `createHideOutside` are unchanged.

`makeInteractOutside` (and `createInteractOutside` / `interactOutside`) no longer leave a touch press armed after it turns into a scroll or drag: the pending touch is dropped on `pointercancel` / `touchcancel`, on movement beyond 10px, on a key press and after a short timeout, and the click must match the stored press.
9 changes: 9 additions & 0 deletions .changeset/keyboard-shortcut-registry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@solid-primitives/keyboard": minor
---

Add `createShortcuts` and `makeShortcutRegistry`: register many keyboard shortcuts through a single keydown/keyup listener pair, with dynamic registration, per-shortcut `enabled`/`ignoreInputs`/`requireReset`/`preventDefault`, an optional scope element, and a deterministic conflict policy (most recently registered eligible shortcut wins). `createShortcut` is unchanged.

Fix pressed-key tracking: keys are now released by the value recorded at keydown per physical key (`event.code`), so releasing Shift before a digit (`!` -> `1`) no longer leaves a stuck key in `useKeyDownList`, `createShortcut` and the registry. A scoped registry now also tracks key releases on `window` and resets when focus leaves the scope, so Tab moving focus out no longer leaves a stuck key. A scope that is not an ancestor of `window` in the event path (a bare `EventTarget`) also listens for keyup on itself, so its releases are seen too.

Key releases are now always tracked on `window` in the capture phase in `useKeyDownList`, `createShortcut` and the registry, so an app handler calling `stopPropagation()` on keyup no longer leaves keys stuck. `CapsLock`, `NumLock` and `ScrollLock` are ignored (macOS sends only one of keydown/keyup for CapsLock, which broke every shortcut afterwards). `ignoreWithinInputs` / `ignoreInputs` now work for inputs inside iframes and open shadow roots, and a registry scope may be an iframe document.
5 changes: 5 additions & 0 deletions .changeset/new-floating-package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solid-primitives/floating": minor
---

Initial release of `@solid-primitives/floating`: `computePosition` and `computePositionFromRects` (placement, offset, flip, shift, size, arrow, RTL, boundaries), `makeAutoUpdate`, the reactive `createFloating`, and size CSS variable helpers. `computePosition` handles transformed containing blocks for `strategy: "fixed"` and scaled offset parents. Containing-block detection covers `offset-path`, `content-visibility`, `transform-style: preserve-3d` and exact `will-change` tokens (`filter` is ignored on `html`), a positioned `html` is honoured for `"absolute"`, top-layer elements (popover, modal dialog, fullscreen) ignore ancestor transforms, slotted elements find their containing block across shadow roots, and an RTL scrollbar on the left is excluded from the viewport boundary.
7 changes: 7 additions & 0 deletions .changeset/post-message-initial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@solid-primitives/post-message": minor
---

Initial release of `@solid-primitives/post-message`: `makePostMessage` and `createPostMessage` for window, iframe and `MessagePort` messaging with `allowedOrigins`, explicit `targetOrigin`, source filtering, type-narrowing validators and namespaced channels.

Target detection is cross-origin safe: a `Window` is recognised first via the cross-origin-accessible `window` property, so `iframe.contentWindow`, `window.opener` and `window.parent` of another origin work without throwing a `SecurityError`.
5 changes: 5 additions & 0 deletions .changeset/presence-animation-aware.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solid-primitives/presence": minor
---

Add opt-in animation-aware transitions: `animations: true` waits for `element.getAnimations({ subtree: true })` to settle (CSS transitions, CSS animations, Web Animations) instead of the fixed duration, falling back to the timer when no element is known or `getAnimations` is unavailable. The element comes from the new `element` option or the returned `ref`. Also returns `attrs()` with `data-starting-style` / `data-ending-style` for styling hooks. Fully backward compatible.
5 changes: 5 additions & 0 deletions .changeset/resize-observer-visual-viewport.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solid-primitives/resize-observer": minor
---

Add `getVisualViewport`, `makeVisualViewportListener`, `createVisualViewport` and `useVisualViewport` for tracking `window.visualViewport` (size, offsets, pinch-zoom scale) with a `window.innerWidth/innerHeight` fallback and SSR/hydration-safe defaults.
5 changes: 5 additions & 0 deletions .changeset/scroll-raf-throttle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solid-primitives/scroll": minor
---

Add opt-in `requestAnimationFrame` throttling: `createScrollPosition(target, { throttle: "raf" })`, a non-reactive `makeScrollPositionListener`, and `useWindowScrollPositionRaf`. Default behavior is unchanged.
5 changes: 5 additions & 0 deletions .changeset/timer-pausable-timer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solid-primitives/timer": minor
---

Add `makePausableTimer` and `createPausableTimer`: one-shot timeouts that track remaining time across pause/resume, with a reactive delay, signal accessors (`remaining`, `isActive`, `isPaused`) and an opt-in `pauseWhenHidden` option.
5 changes: 5 additions & 0 deletions .changeset/virtual-variable-row-heights.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solid-primitives/virtual": minor
---

Support variable row heights: `rowHeight` can now be a `(index) => number` function, and an opt-in measured mode (`estimatedRowHeight` plus `measureElement`, using `ResizeObserver`) records real heights. `createVirtualList` returns a third `helpers` tuple element (`getRowOffset`, `getRowHeight`, `measureElement`, `unmeasureElement`, `resetMeasurements`, `scrollToIndex`) and the state gains `offsets`. The fixed-height path is unchanged.
Loading
Loading