Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorder array items #143

Merged
merged 9 commits into from
Oct 17, 2023
Merged

Reorder array items #143

merged 9 commits into from
Oct 17, 2023

Conversation

chrisvxd
Copy link
Member

@chrisvxd chrisvxd commented Oct 10, 2023

Please merge #154 first.

Closes #69.

Description

This PR primarily:

  • Enables drag-and-drop of array fields
  • Refreshes the UI for array fields

It also:

  • Reverts Fix: position: fixed; elements escape editor #140, since this is messing with drag position (preserved fix: type so we can spot for de-dupe on release)
  • Refactors InputOrGroup into smaller files
  • Adds missing default item props to the ButtonGroup demo
  • Prevents style pollution for select fields
  • Introduces a new internal Draggable component
  • Introduces a new internal DragIcon component, which should be ported to the ComponentList (along with other UI refresh)

Example

Kapture.2023-10-10.at.18.34.49.mp4

Testing

  1. Go to demo deployment
  2. Create a new page
  3. Add a ButtonGroup
  4. Add a new button by clicking the "+"
  5. Try reordering the buttons, changing the values and deleting them
  6. Test again with undo/redo

@chrisvxd chrisvxd requested a review from monospaced October 10, 2023 17:37
@vercel
Copy link

vercel bot commented Oct 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
puck-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 0:04am

packages/core/components/Puck/index.tsx Outdated Show resolved Hide resolved
@chrisvxd chrisvxd force-pushed the store-entire-history branch from ff726a2 to 1211315 Compare October 17, 2023 11:59
Base automatically changed from store-entire-history to main October 17, 2023 12:00
@chrisvxd chrisvxd force-pushed the reorder-array-items branch from 990f325 to fbfb555 Compare October 17, 2023 12:01
@chrisvxd chrisvxd merged commit ca4f4be into main Oct 17, 2023
2 checks passed
@chrisvxd chrisvxd deleted the reorder-array-items branch October 17, 2023 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to reorder array items
2 participants