Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
ba4e399
feat: introduce static drag-and-drop for reduced layout shift
chrisvxd Jul 10, 2026
d6510df
feat: allow the user to specify drag-and-drop behavior
chrisvxd Jul 10, 2026
cb8fae8
docs: clarify 'dnd.auto' behavior
FedericoBonel Aug 5, 2026
a4815be
chore: address comments
FedericoBonel Aug 5, 2026
9f44fb3
chore: format code
FedericoBonel Aug 5, 2026
7cae19d
chore: account for border in line preview positioning
FedericoBonel Aug 6, 2026
c3cc0f7
chore: protect division by 0 when mapping window position to frame po…
FedericoBonel Aug 6, 2026
cdc0f29
test: verify distance measurement to segments that fall outside their…
FedericoBonel Aug 6, 2026
dc8a6e7
chore: handle line preview positioning when best gap is not found
FedericoBonel Aug 6, 2026
9979fee
chore: correctly position line preview on empty zones with borders
FedericoBonel Aug 6, 2026
669656d
chore: streamline docs
FedericoBonel Aug 6, 2026
f35d4be
chore: dont default to fluid behavior for non found gaps
FedericoBonel Aug 6, 2026
5928f69
chore: rename --puck-color-insertion-indicator to --puck-color-line-p…
FedericoBonel Aug 6, 2026
9b78301
chore: add --puck-line-placeholder-width to theming
FedericoBonel Aug 6, 2026
b5f648b
chore: fix visual jittering during drops in safari
FedericoBonel Aug 7, 2026
0dbd986
chore: add lower opacity when using line previews to see the preview …
FedericoBonel Aug 7, 2026
ff2878d
chore: don't target transforms while dragging
FedericoBonel Aug 7, 2026
a27169b
chore: handle multicolumn/row layouts in line previews
FedericoBonel Aug 7, 2026
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
10 changes: 10 additions & 0 deletions apps/demo/app/[...puckPath]/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ export function Client({ path, isEdit }: { path: string; isEdit: boolean }) {
if (!isClient) return null;

const params = new URL(window.location.href).searchParams;
const requestedDndBehavior = params.get("dndBehavior");
const dndBehavior =
requestedDndBehavior === "auto" ||
requestedDndBehavior === "fluid" ||
requestedDndBehavior === "static"
? requestedDndBehavior
: undefined;

if (isEdit) {
return (
Expand All @@ -42,6 +49,9 @@ export function Client({ path, isEdit }: { path: string; isEdit: boolean }) {
iframe={{
enabled: params.get("disableIframe") === "true" ? false : true,
}}
dnd={{
behavior: dndBehavior,
}}
fieldTransforms={{
userField: ({ value }) => value, // Included to check types
}}
Expand Down
17 changes: 13 additions & 4 deletions apps/docs/pages/docs/api-reference/components/puck.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,19 @@ Configure drag-and-drop behavior.

#### dnd params

| Param | Example | Type | Status |
| ------------------------------------------- | -------------------------- | ------- | ------ |
| [`disableAutoScroll`](#disableautoscroll) | `disableAutoScroll: true` | boolean | - |
| [`disableOutlineDrag`](#disableoutlinedrag) | `disableOutlineDrag: true` | boolean | - |
| Param | Example | Type | Status |
| ------------------------------------------- | -------------------------- | ------------------------------- | ------ |
| [`behavior`](#behavior) | `behavior: "static"` | `"auto" \| "fluid" \| "static"` | - |
| [`disableAutoScroll`](#disableautoscroll) | `disableAutoScroll: true` | boolean | - |
| [`disableOutlineDrag`](#disableoutlinedrag) | `disableOutlineDrag: true` | boolean | - |

##### `behavior`

Control animation behavior while dragging. Defaults to `"auto"`.

- `"auto"` (default): Use fluid behavior within a slot, then switch to static behavior when dragging an item between slots or inserting a new component.
- `"fluid"`: Move the item during a drag, animating other items out of the way.
- `"static"`: Freeze the item in-place during a drag, showing a line placeholder at the drop destination.

##### `disableAutoScroll`

Expand Down
13 changes: 7 additions & 6 deletions apps/docs/pages/docs/api-reference/theming/global.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ CSS properties for theming the entire Puck user interface.
| `--puck-color-focus-ring` | <Color>#3479be</Color> | Keyboard focus outlines |
| `--puck-color-selection-bg` | <Color>color-mix(in srgb, #cfdff0 30%, transparent)</Color> | Slot, drop zone and selected overlay background |
| `--puck-color-selection-border` | <Color>#abc7e5</Color> | Selected and drop zone outline borders |
| `--puck-color-insertion-indicator` | <Color>#6499cf</Color> | Drag-and-drop insertion line in the outline |
| `--puck-color-line-placeholder` | <Color>#6499cf</Color> | Drag-and-drop insertion line |
| `--puck-color-highlight` | <Color>#d89aba</Color> | Accent color scale step, not currently consumed |
| `--puck-color-bg-disabled` | <Color>#ababab</Color> | Disabled button background |
| `--puck-color-text-disabled` | <Color>#404040</Color> | Disabled button text |
Expand Down Expand Up @@ -121,8 +121,9 @@ CSS properties for theming the entire Puck user interface.

## Functional

| Token | Default | Used for |
| --------------------------------- | -------------------------- | ------------------------------------- |
| `--puck-slot-min-empty-height` | `128px` | Minimum height of empty slots |
| `--puck-user-sidebar-left-width` | `186px–320px (responsive)` | User override for left sidebar width |
| `--puck-user-sidebar-right-width` | `186px–320px (responsive)` | User override for right sidebar width |
| Token | Default | Used for |
| --------------------------------- | -------------------------- | ----------------------------------------------------------- |
| `--puck-slot-min-empty-height` | `128px` | Minimum height of empty slots |
| `--puck-line-placeholder-width` | `2px` | Drag-and-drop insertion line thickness (canvas and outline) |
| `--puck-user-sidebar-left-width` | `186px–320px (responsive)` | User override for left sidebar width |
| `--puck-user-sidebar-right-width` | `186px–320px (responsive)` | User override for right sidebar width |
2 changes: 1 addition & 1 deletion apps/docs/pages/docs/api-reference/theming/outline.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Defaults shown as `var(--puck-...)` reference [global tokens](/docs/api-referenc
| `--puck-outline-color-border-hover` | `var(--puck-color-interactive-subtle)` | Layer border color on hover |
| `--puck-outline-color-bg-selected` | `var(--puck-color-interactive-subtle)` | Selected layer background |
| `--puck-outline-color-border-selected` | `var(--puck-color-selection-border)` | Selected layer border color |
| `--puck-outline-color-drop-indicator` | `var(--puck-color-insertion-indicator)` | Drag-and-drop line indicator color |
| `--puck-outline-color-drop-indicator` | `var(--puck-color-line-placeholder)` | Drag-and-drop line indicator color |
| `--puck-outline-border-width` | `var(--puck-border-width-regular)` | Layer border width |
| `--puck-outline-radius` | `var(--puck-radius-m)` | Layer border radius |
| `--puck-outline-font-size` | `var(--puck-font-size-xxxs)` | Layer label font size |
Expand Down
Loading
Loading