Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Puck 0.18: The new drag-and-drop engine
Puck 0.18 launches our groundbreaking drag-and-drop engine for page building with advanced CSS layouts.
With native support for CSS grid and flexbox, Puck 0.18 enables powerful new paradigms for creating design-in-browser experiences directly within your Puck application.
Thanks to our contributors and sponsors for making this huge milestone possible.
New.DND.engine.mp4
TLDR
cmd+i
hotkey.position: fixed
: We've removed this pesky style from the default layout so it's easier to embed in your app.Highlights
New drag-and-drop engine
Our flagship feature is a new drag-and-drop engine for Puck with full CSS grid & flexbox support to enable advanced layouts. We call these fluid layouts, and the the change is fully backwards compatible.
Thanks to
@clauderic
at dnd-kit for all the support in making this possible, and the Puck community for all the feedback! 🙏Fluid layouts
To implement a fluid layout, add your display property of choice (e.g.
display: flex
) to your DropZone via thestyle
orclassName
props and off you go—Puck will gracefully handle drag-and-drop across all dimensions.See the Multi-column Layouts docs for the full documentation.
Remove wrapping elements
The new
inline
anddragRef
APIs enable you to remove the wrapping element from Puck components entirely, which can be useful if you need to treat your component as a direct descendant of its parent (such as if you need to use CSS properties likeflex-grow
).Here's an example implementing an advanced grid layout, where the children can specify their position using the
grid-column
andgrid-row
properties:Dragging between nested DropZones
The new engine makes it possible to drag between nested DropZones, which resolves one of the longest standing limitations of Puck's drag-and-drop experience.
Dynamic DropZone height
DropZones now shrink to the height of their children so that the preview is a faithful representation of the final output, with a new configurable height when empty.
The
<ActionBar.Label>
componentThe new
<ActionBar.Label>
component enables you to to label areas within a custom ActionBar:Parent selector
A new action allows you to quickly select the component's parent directly from the action bar. Tap the arrow to the left of the component label to jump to the parent.
Toggle interactive hotkey
Make your components interactive directly within Preview mode with the
cmd+i
(orctrl+i
on Windows) hotkey.This can be programatically set via the new
previewMode
parameter on the app state.No more
position:fixed
We've removed this pesky style from the default layout so it's easier to embed in your app. Not much to show here, but let's pour one out for
position:fixed
🥂Full changelog
Features
position: fixed;
from Puck layout (5deb774)Bug Fixes
New contributors