Migrating to v1.0
What changed in Flexiboards 1.0, and how to move a v0.4 project across.
Migrating from v0.3 or earlier? Apply v0.4 first.
What changed and why
Flexiboards 1.0 moves the Svelte library to @flexiboards/svelte and its shared engine to @flexiboards/core. Svelte projects must update the package name, replace removed props, and handle untyped exported entries. The sections below list the required changes.
Renamed packages
| v0.4 | v1.0 |
|---|---|
svelte-flexiboards | @flexiboards/svelte |
| Not in v0.4 | @flexiboards/core (types and helpers, re-exported by each adapter) |
npm uninstall svelte-flexiboards
npm install @flexiboards/svelteThen replace the import specifier:
- import { FlexiBoard, FlexiTarget, FlexiWidget } from 'svelte-flexiboards';
+ import { FlexiBoard, FlexiTarget, FlexiWidget } from '@flexiboards/svelte'; Every export from v0.4 is still exported from @flexiboards/svelte under the same name.
Accessibility selectors and coordinates
Replace [role="cell"] selectors with [data-flexi-widget] when styling or finding widgets in every interaction state. Placed widgets now use role="gridcell" inside accessible rows; a held widget temporarily uses role="group".
aria-colindex and aria-rowindex start at 1. Controller coordinates and stored layouts remain zero-based. For example, x: 0, y: 0 is exposed as column 1, row 1. Update tests that read these attributes directly; cellAt(0, 0) still finds the first model cell.
Changed helpers
| v0.4 | v1.0 | Notes |
|---|---|---|
simpleTransitionConfig() | cssTransitionConfig() | The old helper is deprecated and retains its original 150ms easing. |
Deprecations still honoured
simpleTransitionConfig()retains the original 150ms preset.cssTransitionConfig()now uses sine in-out moves and circ-out drops.
Removed
draggableon widgets and inwidgetDefaults, deprecated since v0.4. Usedraggability:'full'fortrue,'none'forfalse, or'movable'for a widget other widgets may push but the user cannot grab. The controller’sdraggablegetter stays, read-only, as shorthand fordraggability !== 'none'.widthandheightinwidgetDefaults. They never had an effect, so nothing changes at runtime; if you set them, TypeScript now flags the keys. Setwidthandheighton each widget instead.
The svelte-flexiboards package
svelte-flexiboards stops at 0.4.2. It stays on npm and keeps working, but it receives no further releases; every fix and feature from here lands in @flexiboards/svelte.
New in v1.0
Controller actions and interaction callbacks
You can change a board from its controllers:
- Call
delete()ormoveTo()on a widget. - Call
clear()on a target or board.
onLayoutChange now also reports changes made through these methods and createWidget(). It runs in a microtask before animations settle, batching changes made in the same turn. Debounce your save handler if you need to limit writes to storage.
The board configuration adds callbacks for each interaction:
onWidgetGrab,onWidgetDrop, andonWidgetCanceltrack a drag.onWidgetResizereports a committed resize;onWidgetDeletereports a deletion.onWidgetEnterTargetandonWidgetLeaveTargettrack movement between targets.
Use canDrop on the board or an individual target to reject a placement. See Controllers.
Layout exports
- Every exported widget has an
id. exportLayoutEnvelope()includes a format version alongside the layout for storage.- Widgets without a
typeare now included in exports.FlexiWidgetLayoutEntry.typeis optional, so code that reads it must handleundefined.
Component behavior
In Svelte, you can mount new FlexiWidget declarations after the target has loaded. Each one is added through the existing placement rules. A placement that cannot fit is rejected with a warning. See Adding widgets later.
Other additions
springTransitionConfig(), and thespring()andcssTransition()animation adapters. See Transitions.initialLayoutand thesuspensesnippet for server-rendered boards. See Server-Side Rendering.packingon free-form layouts. See Free-Form Grids.dropRejectedon widget and target controllers. See Widget Rendering.