Skip to content

Releases: janosh/svelte-widgets

v1.2.0

Choose a tag to compare

@janosh janosh released this 30 Jul 16:44

30 July 2026

  • Add three accessible components: Sheet for portalled edge panels, snippet-driven Tabs with automatic/manual activation and Accordion with single/multiple expansion
  • Add file_drop attachment with accept filtering, directory expansion and explicit drop errors
  • Add hover/focus triggers and open/close delays to Popover
  • Add rich snippet bodies and validated ask_prompt() requests to the queued dialog API
  • Extract headless theme helpers (apply_theme_mode, resolve_theme_mode, system_preference, shared theme state) to svelte-widgets/theme, so CommandMenu / PageSearch actions can set the theme without duplicating ThemeToggle's localStorage + data-theme logic, and the toggle icon stays in sync
  • Add svelte-widgets/katex with katex_preprocess(), a before/after preprocessor pair that hides rendered KaTeX behind collision-safe placeholders around mdsvex so markdown cannot mangle the math HTML
  • Drive draggable / resizable with pointer events (pointerId filtering, pointercancel, setPointerCapture) so touch works and a gesture over an iframe or stolen focus still ends cleanly; resize hit-testing is now edge strips that cover the border box
  • Harden dismiss_on: 'release': ignore clicks whose primary press started inside, and add backdrop_dismiss for modal ::backdrop vs padding. Wire dismiss_on through MultiSelect / Popover / DraggablePane (pane defaults to release, plus an element-only inside prop)
  • Add FullscreenButton placement="corner" and optional per-page icons on SubpageGrid
  • Make text search match NFC/NFD-equivalent Unicode and skip hidden form-control text
  • Breaking: Unify build-time heading IDs, runtime heading anchors and Toc on the same Unicode-preserving slugger and collision allocator, and make heading parsing tolerate > inside quoted attributes while ignoring comments and code/script/style containers. This changes generated IDs containing punctuation or non-ASCII text and changes duplicate suffixes from the old Toc slugger
  • Document every headless subpath and attachment, including the lower-level backdrop and outside-press dismissal primitives

Full Changelog: v1.1.0...v1.2.0

v1.1.0

Choose a tag to compare

@janosh janosh released this 28 Jul 17:27

27 July 2026

  • Add eight components consolidated from downstream repos: ButtonGroup (a segmented control, generalized from the hand-rolled ones those repos each grew), Toast, ConfirmDialog, DraggablePane, FullscreenButton, Footer, ContributorList and LiteYouTubeEmbed
  • Add portal, contrast_color and forward_window_keydown attachments, bringing the total to thirteen
  • Add headless modules behind their own subpaths: svelte-widgets/toast-queue, /dialogs, /fullscreen, /clipboard, /print, /file-drop and /text-search, the last matching across inline markup where highlight_matches walks text nodes one at a time. It skips script, style and noscript so a find-in-page never steps onto text that renders nowhere, and treats text either side of one as continuous
  • Add shortcut rebinding for "customize shortcuts" UIs: event_to_combo, normalize_combo and sanitize_shortcut_overrides turn a keydown into a canonical combo and resolve collisions
  • Add sections to ContextMenu: actions accepts CmdSection entries rendered as an ARIA group of menuitemradio items with a selected value per section
  • Add a create_highlighter(grammars) factory and a svelte-widgets/live-examples/create-highlighter subpath, so consumers can pick their own grammars without the barrel's eager top-level await of 34 grammars
  • Consolidate icon_data from 25 to 143 entries using matterviz's curated paths. Icon now supports fill/stroke glyphs and multi-element SVG markup. The name lookup still ships the full 56 kB raw map with any icon, so tree-shaking remains worth revisiting
  • Add a toggle snippet to DraggablePane, so a consumer can put any icon in the toggle button while the component keeps the button and its anchor geometry. open_icon/closed_icon are typed to the bundled IconNames, which left no route to an icon this package doesn't ship, and icon_style sizes the bundled one without reaching for the snippet at all. The pane carries toc-exclude now, keeping headings in floating chrome out of a page's Toc, and pane-open while it is open, which is what a page needs to style around a pane it does not own
  • Add an option_suffix snippet to ButtonGroup, rendered as a sibling of each button rather than inside it, so an option can carry a trailing link without nesting interactive content in a <button>. The wrapper element only appears when the snippet is supplied, so existing .options > button selectors keep matching. Adds --btn-group-justify-content, --btn-group-btn-cursor, --btn-group-btn-hover-color, --btn-group-btn-hover-transform and --btn-group-btn-transition, and tooltip_options for consumers whose option tooltips are rich text
  • Add dismiss and trigger to ContextMenu. dismiss merges over the default { escape: true } and reaches the whole click_outside config, so a trigger that toggles can ask for dismiss_on: 'release' instead of being closed by its own press. trigger: 'none' installs no right-click handler at all, for a consumer driving at itself
  • Add root, on_escape and recapture to focus_trap. root follows click_outside's scope shape and is resolved per keystroke, so a trap can cover an inner dialog while a sibling backdrop stays out of the Tab cycle. on_escape registers on the existing layer stack, so a trap inside a modal closes only itself. All three are opt-in
  • Add a configurable priority ladder to the toast queue: create_toast_queue({ priorities }) takes an ordered list and every type is generic over it, so a consumer's own tiers rank correctly instead of falling below everything. An unknown priority now throws rather than ranking -1, and create_toast_queue takes an options object instead of a bare max_pending
  • Add sideEffects to the manifest, listing only dist/index.js, which patches Element.prototype.scrollIntoViewIfNeeded on import. Every other module is pure, so a bundler can now drop the components a consumer never imports instead of keeping the whole barrel
  • Add an svelte-widgets/icons subpath and re-export icon_data and IconName from the root. IconName types the public props of Icon, ButtonGroup, DraggablePane and FullscreenButton, but no export let a consumer name it
  • Drop vite-plus from peerDependencies. It appears in no emitted JavaScript, only as two import type lines in vite-config.d.ts, and the sole thing referencing it is svelte-widgets/vite-config, which nobody can use without already depending on vite-plus
  • Fix parse_shortcut never resolving the mod token, which made matches_shortcut(event, 'mod+z') match a bare z with no modifier held. Only run_hotkeys was unaffected, since it pre-resolved at the call site. This also makes space matchable for the first time
  • Fix highlight_matches and highlight_ranges overwriting each other when they share a CSS highlight name. They keep one store now, so the name holds the union of their ranges until the last owner releases
  • Fix svelte-widgets/Toast.svelte failing to resolve its store when installed from npm: the packaging step rewrote .ts import specifiers in .js and .d.ts files but not in .svelte files
  • Fix MultiSelect, Masonry, Popover, ContextMenu, LiteYouTubeEmbed and Nav rendering class="[object Object]" when handed a class. Svelte types the attribute as a ClassValue, so an array or a { active: true } object is legal, but these interpolated it into a string. They pass it to Svelte's own clsx pass now
  • Fix Masonry silently dropping its virtualization when a consumer passes onscroll: the prop spread sat after the component's own handler and replaced it, leaving the rendered window frozen at the top of the list however far down the user scrolled. LiteYouTubeEmbed had the mirror image, spreading first and so discarding a consumer's onclick. Both chain the two handlers now
  • Full Changelog: v1.0.0...v1.1.0

v1.0.0

Choose a tag to compare

@janosh janosh released this 27 Jul 14:30

27 July 2026

  • Breaking: Deprecate svelte-toc and svelte-bricks. Replace import Toc from 'svelte-toc' with import { Toc } from 'svelte-widgets' and import Masonry from 'svelte-bricks' with import { Masonry } from 'svelte-widgets'. Their console warnings now name the component (Toc received invalid …, Masonry: …) rather than the old package
  • Breaking: Rename CmdPalette to CommandMenu and PagefindPalette to PageSearch. The old names are removed #428
  • Breaking: click_outside dismisses on pointerdown rather than click, exclude/include merge into inside, trigger becomes dismiss_on: press | release, the outside-click event becomes dismiss, and callback gains a { focus_inside, via, event } detail #431
  • Add Popover and ContextMenu components plus float, focus_trap and hotkey attachments, with Escape closing one layer at a time #431
  • Absorb svelte-toc and svelte-bricks: Toc and Masonry ship here now, with their test suites and svelte-widgets/Toc.svelte / svelte-widgets/Masonry.svelte subpath exports
  • Add Pagefind-powered PageSearch and expand CommandMenu with async action loading, navigation and match highlighting #428
  • Add rangeSelect for Shift-click and Shift+Arrow range selection, an onrangeSelect event and a selectAllScope of visible or matching #429
  • Pass an AbortSignal to loadOptions and abort superseded searches #429
  • Speed up hot paths: 2.4x option filtering on 2000 labels, 7.0x hotkey matching on 500 actions, 3.9x syntax-highlight HTML #430
  • Chain consumer event handlers instead of letting props clobber them, so onclick/onkeydown/onclose no longer disable CopyButton, ThemeToggle, FileDetails, CodeExample, CommandMenu and Nav internals #429
  • Ignore modifier-free CommandMenu hotkeys while focus sits in a text field #430
  • Fix the dropdown portal refusing to activate inside a shadow root and throwing NotFoundError on teardown #429
  • Validate OptionStyle objects even when no style key is passed #429
  • Add a svelte-widgets/types subpath export #428
  • Strengthen tests that could not fail across the vitest suite 79625e0
  • Breaking: Rename the package from svelte-multiselect to svelte-widgets, restarting versioning at v1.0.0. MultiSelect is now one of 19 components, so imports become svelte-widgets and subpaths like svelte-widgets/attachments. Everything below v1.0.0 in this changelog was released as svelte-multiselect

Full Changelog: v11.8.0...v1.0.0

v11.8.0

Choose a tag to compare

@janosh janosh released this 09 Jul 13:31

What's Changed

  • Add async oncreate support: return a Promise (or thenable) to persist user-created options before they're added; spinner + aria-busy while pending, rejections abort the add #427
  • Add virtualList prop for windowed dropdown rendering of large flat option lists (tunable itemHeight/overscan) #427
  • Add portal placement param: auto (new default) flips the dropdown above the input when it would overflow the viewport bottom #427
  • Fix 19 bugs across MultiSelect, attachments, CmdPalette, CodeExample, and heading-anchors, incl. falsy options (0) unselectable via keyboard, foreign drag-drops corrupting selected, keyboard nav escaping maxOptions, group deselect bypassing minSelect, missing IME composition guard, duplicate options crashing the keyed each, sortable destroying header markup, cross-instance tooltip clearing, and Unicode highlight offsets #427
  • Give tooltips a visible theme-aware default border and audit the test suite (~58 redundant tests removed, ~50 regression tests added) #427
  • Fix schemeless-page tooltip readability and support partial OptionStyle objects #426
  • Fix tooltip, focus, and shortcut edge cases #425
  • Fix retain-focus dropdown behavior #424
  • Clean up Svelte formatting, types, and low-value tests #422
  • Simplify Vite/Svelte setup and tighten tests #421

Full Changelog: v11.7.2...v11.8.0

v11.7.2

Choose a tag to compare

@janosh janosh released this 11 Jun 10:10

What's Changed

  • Harden components, add CmdPalette frecency feature, and expand test coverage #418
  • Add expandIconPosition prop, beforeInput snippet, and expand icon dropdown toggle #420
  • Fix command palette dialog positioning 2fa2ade
  • Tighten lint rules and fix violations d081170

Full Changelog: v11.7.1...v11.7.2

v11.7.1

Choose a tag to compare

@janosh janosh released this 14 May 21:42

What's Changed

  • Add editable input dropdown mode #416
  • Fix loadOptions scrollbar absence with small batchSize #413
  • Improve MultiSelect, CmdPalette, and Nav accessibility; add package smoke coverage in CI #417
  • Breaking: Remove attachments from the main package export. Import them from svelte-multiselect/attachments instead c50fb7f
  • Breaking: Make tooltip HTML rendering opt-in via allow_html: true and treat tooltip content as plain text by default #417

Full Changelog: v11.7.0...v11.7.1

v11.7.0

Choose a tag to compare

@janosh janosh released this 14 May 21:42

What's Changed

  • Add parse_paste prop, fix shortcut defaults and select-all UX #407
  • Add oncreate reject/transform, onparsed_paste event, selectAllDisabledTitle i18n #408
  • Reject whitespace-only input in allowUserOptions mode #410
  • Fix whitespace guards, falsy value sync, paste reporting, sortable bugs, and type safety #411
  • Block option creation during loadOptions debounce window #404
  • Fix tooltip background not inheriting page theme #405

Full Changelog: v11.6.4...v11.7.0

v11.6.4

Choose a tag to compare

@janosh janosh released this 14 May 21:42

What's Changed

  • Suppress user messages during async loading #403
  • Add left/right arrow key navigation between selected items #402
  • Replace pre-commit/prek with vp staged, enable pedantic linting category 6317a47
  • Enable type-aware linting and fix all 168 errors 3fd9b2c
  • Migrate project tooling to vite-plus and align CI/test commands 9bfac33
  • Fix spurious onopen/onclose events and vite plugin HMR reload 0ad83f8
  • Add theme toggle and demo overview navigation pages 351baf9
  • Replace svelte-preprocess with acorn, update deps, harden test assertions 6fe18c2

Full Changelog: v11.6.3...v11.6.4

v11.6.3

Choose a tag to compare

@janosh janosh released this 08 Mar 15:11

What's Changed

  • Tooltip: suppress native title, auto-flip placement, sync arrow by @janosh in #398
  • Fix live example CSS resolution during SSR by @janosh in #399
  • Enrich snippet props and event callback payloads by @janosh in #400

Full Changelog: v11.6.1...v11.6.3

v11.6.2

Choose a tag to compare

@janosh janosh released this 19 Feb 08:10
  • add CopyButton disabled/reset/callback support with demo page by @janosh in #397
  • fix hidden dropdown scroll height and dynamic createOptionMsg support by @janosh in #396

Full Changelog: v11.6.1...v11.6.2