Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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: 0 additions & 5 deletions .changeset/core-drop-intent.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/docking-focus-rule.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/document-owned-drops.md

This file was deleted.

4 changes: 0 additions & 4 deletions .changeset/drag-import-guard.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/drag-root-in-layout-root.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/drop-intent-one-measurement.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/external-source-no-root-warning.md

This file was deleted.

4 changes: 0 additions & 4 deletions .changeset/float-gesture-decision.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/float-layer-drop-global.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/history-explicit-names.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/normalize-owns-selected.md

This file was deleted.

4 changes: 0 additions & 4 deletions .changeset/react-shallow-module-cleanup.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/reducer-structural-no-op.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/remove-document-machine.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/reserve-float-ids.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/responsive-layout-hook.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/selection-after-removal.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/shared-console-warnings.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/store-owns-persistence.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/trim-core-surface.md

This file was deleted.

29 changes: 29 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# @dashfoo/core

## 2.0.0

### Major Changes

- 9eec182: Give the history functions explicit names: `dispatch` is now `dispatchToHistory`, `undo` is `undoHistory`, `redo` is `redoHistory`, `canUndo` is `canUndoHistory` and `canRedo` is `canRedoHistory`. `createHistory` now normalizes the model it receives, so every history holds a canonical document.
- 9eec182: `normalize` clamps every tabset's `selected` into its strip. `tabsetNodeSchema` now checks shape only, so `tabsetNodeSchema.parse` and `dashfooSchema.parse` keep an out-of-range `selected` for `normalize` (and `parseModel`) to clamp. `tabsetNodeObjectSchema` is removed: `tabsetNodeSchema` has no transform left to bypass.
- 9eec182: Remove `dashfooMachine`. It had one state and mapped each event onto a history function, so it added indirection without a lifecycle. Hold a `History` from `createHistory` and step it with `dispatchToHistory`, `undoHistory` and `redoHistory`. `dragDockMachine` is unchanged.
- 9eec182: One responsive projection. `useResponsiveLayout(model, { maxWidth, orientation? })` measures the layout's own container and returns the compact view of the model plus the lock that goes with it (`restructurable: false`, which also disables floating, and `maximizable: false`). `DashfooLayout`'s `responsive` prop runs on the same hook, so a hand-built `Layout.Root` compacts exactly like the built-in layout, keeping row ancestors so nested widget state survives the breakpoint.

Breaking: `useResponsiveModel`, `useContainerWidth`, `matchBreakpoint`, `activeBreakpoint` and the `Breakpoint`, `ResponsiveModel` and `UseResponsiveModelOptions` types are removed from `@dashfoo/react`, and `stackModel` is removed from `@dashfoo/core`. Flattening reparented nested tabsets and remounted their content; use `useResponsiveLayout` instead.

- 9eec182: Remove exports nothing consumed: `findRootContaining`, the `TabContainer` alias (`TabLocation.container` is a `TabsetNode`), and the snap internals `snapSizes`, `resolveSnapTargets`, `DEFAULT_SNAP_THRESHOLD` and `SnapResult`. Snap through `resolveSnapGrid`, `decideSnap` and `settleSnap`.

### Minor Changes

- 9eec182: Add `resolveDropIntent` and `dropIndicator`: pure drop-intent resolution over a measured tabset. They decide self-drops from the drag subject, strip versus body, the insertion index and the `splitDock` override, and derive the insertion line or split zone from the same measurement.
- 86ae424: Bind internal drag subjects to their owning document and namespace draggable registrations and tab/panel accessibility IDs. Sibling and nested layouts sharing a provider reject foreign internal drops while main/float moves and external tab factories keep working. Internal `DragSubject` values now require `documentId`, and `COMMIT`/`dropAction` include the original subject for commit-time validation.

Enforce the resolved structural permission at both drop resolution and commit, preventing external widgets and gestures started before compact mode from bypassing its docking lock. Center-only docking remains available when split docking is disabled.

- 9eec182: Removing a tab from a strip keeps the selection on the tab that was selected; removing a tab before it used to shift the selection onto its neighbour. Core exports the rule as `fallbackSelectedIndex`, and the tab strip's drag preview uses it instead of its own copy.
- 6d86c96: Export `warn` and `warnOnce` from `@dashfoo/core`. Both packages now report degraded paths through them, so every developer-console warning carries the same `[dashfoo]` prefix, and a missing tab component warns once per component key across layouts.

### Patch Changes

- 9eec182: Every docking action now activates the tabset that received the moved content. `moveNode`, `moveTabset` and `addNode` onto a tabset's center used to leave focus where it was, so merging the active tabset away dropped focus to the first tabset. `addNode` with a tab id already in the layout is ignored with a `[dashfoo]` warning instead of creating a duplicate.
- 9eec182: The reducer detects a no-op once, by comparing the normalized result with its input, and returns the input object when they match. Maximizing a float's tabset or an unknown id, and re-sending an identical `min`, `max`, `snap` or `config`, no longer record an undo step or clear the redo stack.
- 86ae424: Reject occupied caller-supplied float IDs before detaching tabs or tabsets, leaving the document and undo history unchanged.

## 1.1.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dashfoo/core",
"version": "1.1.4",
"version": "2.0.0",
"description": "Headless docking-layout engine: model, actions, reducer, serialization, geometry, and the XState actor system. No React.",
"license": "MIT",
"author": "Pedro Filho <pedro@filho.me>",
Expand Down
38 changes: 38 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# @dashfoo/react

## 0.10.0

### Minor Changes

- 86ae424: Bind internal drag subjects to their owning document and namespace draggable registrations and tab/panel accessibility IDs. Sibling and nested layouts sharing a provider reject foreign internal drops while main/float moves and external tab factories keep working. Internal `DragSubject` values now require `documentId`, and `COMMIT`/`dropAction` include the original subject for commit-time validation.

Enforce the resolved structural permission at both drop resolution and commit, preventing external widgets and gestures started before compact mode from bypassing its docking lock. Center-only docking remains available when split docking is disabled.

- 9eec182: `Layout.Root` now mounts the drag root, so every layout gets exactly one drag manager and drag actor, shared by the main tree and its floats. Hand-built layouts with `Layout.FloatLayer` can now drag between floats and the main tree; before, each float mounted its own root and those drops failed silently. A root nested inside another (a layout under `DashfooDragProvider`, or a layout in a tab) reuses the outer one. `Layout.DragLayer` no longer mounts a root of its own: it must sit inside a `Layout.Root`, warns when it does not, and drops its undocumented `onCommit` and `splitDock` props in favour of the layout store.
- 9eec182: Remove the unused `global` prop from `Layout.FloatLayer`. Floating panels already inherit their capabilities from the layout above them; drop `global={...}` from any hand-built `<Layout.FloatLayer>`.
- 9eec182: One responsive projection. `useResponsiveLayout(model, { maxWidth, orientation? })` measures the layout's own container and returns the compact view of the model plus the lock that goes with it (`restructurable: false`, which also disables floating, and `maximizable: false`). `DashfooLayout`'s `responsive` prop runs on the same hook, so a hand-built `Layout.Root` compacts exactly like the built-in layout, keeping row ancestors so nested widget state survives the breakpoint.

Breaking: `useResponsiveModel`, `useContainerWidth`, `matchBreakpoint`, `activeBreakpoint` and the `Breakpoint`, `ResponsiveModel` and `UseResponsiveModelOptions` types are removed from `@dashfoo/react`, and `stackModel` is removed from `@dashfoo/core`. Flattening reparented nested tabsets and remounted their content; use `useResponsiveLayout` instead.

- 9eec182: `useDashfooStore` now owns the whole document lifecycle. It takes a `persist` option (the same `string | { key, storage?, debounceMs? }` that `DashfooLayout` accepts) that loads once after hydration, restores without an undo entry or a save, debounce-saves every change and flushes on page hide and unmount. The store also returns `reset()`, which clears the saved copy and restores `defaultModel`. Hand-built layouts get the same persistence as `DashfooLayout` from the hook alone.

Breaking: `usePersistence` and its `Persistence` and `PersistConfig` types are removed; pass `persist` to `useDashfooStore` instead. The persist input type is exported as `PersistInput`. With `persist` set, `setModel` now saves the replacement like any other change. The store no longer runs an XState actor.

### Patch Changes

- 9eec182: Drop intents and the dock indicator now come from one tab-strip measurement through `resolveDropIntent` and `dropIndicator` in `@dashfoo/core`, so the insertion index and the insertion line always mark the same slot. The index is measured against whole tab items (label plus close button), the item wrapper (`data-dashfoo="tab-item"`) carries `data-tab-id`, a layout nested in a tab no longer leaks its strip into the outer tabset's measurement, and only the layer that resolved a drop paints its indicator.
- 9eec182: `useExternalTabSource` warns once when it has no drag root above it instead of silently registering nothing.
- 9eec182: Removing a tab from a strip keeps the selection on the tab that was selected; removing a tab before it used to shift the selection onto its neighbour. Core exports the rule as `fallbackSelectedIndex`, and the tab strip's drag preview uses it instead of its own copy.
- 6d86c96: Export `warn` and `warnOnce` from `@dashfoo/core`. Both packages now report degraded paths through them, so every developer-console warning carries the same `[dashfoo]` prefix, and a missing tab component warns once per component key across layouts.
- Updated dependencies [9eec182]
- Updated dependencies [9eec182]
- Updated dependencies [86ae424]
- Updated dependencies [9eec182]
- Updated dependencies [9eec182]
- Updated dependencies [9eec182]
- Updated dependencies [9eec182]
- Updated dependencies [86ae424]
- Updated dependencies [9eec182]
- Updated dependencies [9eec182]
- Updated dependencies [6d86c96]
- Updated dependencies [9eec182]
- @dashfoo/core@2.0.0

## 0.9.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dashfoo/react",
"version": "0.9.1",
"version": "0.10.0",
"description": "Headless React layer for dashfoo: DashfooLayout, hooks, slots, and the react-resizable-panels + dnd-kit adapters.",
"license": "MIT",
"author": "Pedro Filho <pedro@filho.me>",
Expand Down
Loading