Skip to content

Releases: nomcopter/react-mosaic

v.7.0.0

Choose a tag to compare

@Lonli-Lokli Lonli-Lokli released this 13 Jul 11:26

React Mosaic v7.0.0

v7 is a major release. The layout engine moves from a binary tree to an n-ary
tree, tabs become a first-class node type, and the library now targets React
16-19 with a full ESM + CJS build.

Coming from v6? Legacy trees keep working; they are auto-converted at render.
See Migration from v6.

New in 7.0.0 (since v7.0.0-beta0)

  • Rewritten add/remove tab API: mosaicActions.addTab(path, ...) now
    dispatches on the target node. It appends to a tab-group (and activates the
    new tab) or promotes a leaf into a two-tab group, and rejects on a split node
    or when createNode is unset. mosaicActions.removeTab(path, index) drops a
    tab, adjusts activeTabIndex, and normalizes the tree (a one-tab group
    collapses back to a leaf). A new exported DefaultAddTabButton is wired into
    the default tab toolbar.
  • Improved documentation website: the Docusaurus site ships an embedded,
    editable live demo and expanded guides, including a new custom-toolbar guide
    covering tab-bar customization.
  • Drag onRelease fix: see Bug Fixes. This resolves the beta0
    known issue.

Breaking Changes

Tree Structure: Binary to N-ary

Split nodes use a children array with a matching splitPercentages array, and
paths are numeric indices instead of 'first' / 'second' strings.

v6 (binary) v7 (n-ary)
{ direction, first, second } { type: 'split', direction, children: [...] }
splitPercentage: number splitPercentages: number[]
string paths, ['first', 'second'] numeric paths, [0, 1]
// v6
const tree = { direction: 'row', first: 'a', second: 'b', splitPercentage: 40 };

// v7
const tree = {
  type: 'split',
  direction: 'row',
  children: ['a', 'b'],
  splitPercentages: [40, 60],
};

Migration utility: convertLegacyToNary().

Type System (React 19)

  • JSX.ElementReact.JSX.Element
  • Removed React.ReactFragment (deprecated in React 19)
  • Explicit React imports now required in JSX files

Requirements

  • Node.js 18+ required
  • React peer dependency now 16 - 19 (expanded from v6's 16-18)

New Features

  • Tabbed windows: tabs are a real node type
    ({ type: 'tabs', tabs, activeTabIndex }), not a convention on top of splits.
    Drag a window onto another to create a tab group; drag tabs to reorder them or
    move them between groups; customize the tab bar with renderTabToolbar,
    renderTabToolbarControls, renderTabTitle, renderTabButton, and
    canClose. (The addTab / removeTab action API was finalized in 7.0.0; see
    above.)
  • N-ary tree structure: splits with any number of children, so richer
    layouts do not require deeply nested binary splits.
  • Full ESM module support: dual CommonJS/ESM output with a proper exports
    map.
  • Dependency updates: react-dnd-multi-backend upgraded to v9 for React 19
    compatibility.

Bug Fixes

  • onRelease timing: onRelease was firing at the start of a drag (and on
    drag cancel) instead of only when a change was committed. It now fires solely
    on an actual drop or resize, for both windows and tabs. Resolves the
    v7.0.0-beta0 known issue.
  • React 19 compatibility: fixed the TypeScript JSX-namespace errors and the
    element.ref deprecation warnings; removed deprecated React.ReactFragment
    usage.

Migration from v6

For most apps, no code changes are required. Mosaic runs convertLegacyToNary
on legacy input at render time. To migrate persisted trees explicitly:

import { convertLegacyToNary } from 'react-mosaic-component';

const naryTree = convertLegacyToNary(savedV6Tree);

If you read or build the tree by hand, update to the n-ary shape (table above),
switch splitPercentage to splitPercentages, and replace string paths with
numeric index paths.

Compatibility

React 16 - 19
Node.js 18+
TypeScript full types shipped
Modules ESM + CJS

Changelog (since v6.2.0)

  • refactor!: Sync repository, binary to n-ary tree migration (#240)
  • Replace demo app with a Docusaurus docs site (#243)
  • Enrich tab toolbar customization
  • Rewrite add/remove tab API
  • Fix: onRelease fired during drag start / cancel
  • Add Node version to the deployment workflow (#244)

Full diff: v6.2.0...v7.0.0

React Mosaic v7.0.0-beta0 Release Notes

Pre-release

Choose a tag to compare

@Lonli-Lokli Lonli-Lokli released this 13 Mar 15:50
c3fdf10

React Mosaic v7.0.0-beta0 Release Notes

Please leave your feedback/bugs here #241

Breaking Changes

  • Tree Structure Migration: Changed from binary to n-ary tree format

    • Old format: { first: node, second: node }
    • New format: { children: [node, node, ...] }
    • Use convertLegacyToNary() utility for automatic conversion of existing layouts
  • Type System Updates: All JSX element types updated for React 19 compatibility

    • JSX.Element changed to React.JSX.Element throughout
    • React.ReactFragment removed (deprecated in React 19)
    • Components now require explicit React import in files using JSX
  • Minimum Requirements: Node.js 18+ required

  • React Peer Dependency: Now supports React 16-19 (updated from v6's 16-18)

Features

Tabbed Windows Support (#50, #140)

  • Full tabbed window layout support alongside split layouts
  • Drag windows to create tabbed interfaces
  • Tab switching, rearrangement, and drag-and-drop between tabs and splits
  • Works seamlessly with existing mosaic features

N-ary Tree Structure

  • Flexible tree nodes with multiple children instead of binary structure
  • Enables more sophisticated layout configurations
  • Better support for future layout types

Full ESM Module Support (#193)

  • Complete ES modules build alongside CommonJS
  • Proper exports field configuration in package.json
  • Dual module outputs: index.mjs (ESM) and index.cjs (CJS)
  • Works with modern build tools: Next.js, Vite, Webpack 5+
  • Source maps included for both module formats

Dependency Updates (#234)

  • Updated react-dnd-multi-backend to v9 for React 19 compatibility
  • All drag-and-drop libraries aligned with latest React versions

Bug Fixes

React 19 Compatibility (#235, #225, #231)

  • Fixed TypeScript JSX namespace errors with React 19.1.0
  • Resolved element.ref deprecation warnings in console
  • Updated type definitions to use React.JSX.Element
  • Removed deprecated React.ReactFragment usage
  • Component renders no longer throw warnings with React 19

Package Updated Versions

  • react-dnd-multi-backend: 9.0.0 (was 8.0.0)
  • react-dnd: 16.0.1
  • react-dnd-html5-backend: 16.0.1
  • react-dnd-touch-backend: 16.0.1
  • TypeScript: 5.5.4
  • Nx: 21.5.2
  • tsup (build tool): 8.5.0
  • Vitest (test framework): 3.0.0

v6.1.1

Choose a tag to compare

@nomcopter nomcopter released this 20 Dec 16:37
  • Updates peerDeps to work for React v19 #217

v6.1.0

Choose a tag to compare

@nomcopter nomcopter released this 18 Sep 06:08

New Functionality

  • Make it possible to 'toggle' the additional controls toolbar and to disable the overlay while it is open (🎩 @ murat-encord) #209

v6.0.1

Choose a tag to compare

@nomcopter nomcopter released this 24 Apr 18:50

Bugfixes

  • Stop pulling all of lodash into the bundle #206 (🎩 @fvsch)

v6.0.0

Choose a tag to compare

@nomcopter nomcopter released this 14 Feb 02:26

Possibly breaking change

  • Upgrades react-dnd to ^16 as well as change some internally exported classes to make that possible #195 (🎩 @jtbandes)

Bugfixes

  • Removes an event.stopPropagation() call in Split.tsx #202

v5.3.0

Choose a tag to compare

@nomcopter nomcopter released this 03 Aug 16:30

New Functionality

  • Make it possible to pass an explicit dragAndDropManager to Mosaic (🎩 @cbeer) #146

v5.2.2

Choose a tag to compare

@nomcopter nomcopter released this 03 Aug 15:45

Bugfixes

  • Update to work with versions of npm that install peer dependencies automatically (7+) #175

v5.2.0

Choose a tag to compare

@nomcopter nomcopter released this 29 Jul 15:36

New Functionality

  • Make it possible to add an onAdditionalControlsToggle callback #180

Bugfixes

  • Update to work with @types/react 18 (🎩 @JR000) #184

v5.1.0

Choose a tag to compare

@nomcopter nomcopter released this 26 Mar 23:39

New Functionality

  • Make it possible to configure blueprintNamespace in order to support Blueprint v4 (🎩 @casperOne) #161 #181