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

Composable puck #265

Merged
merged 68 commits into from
Dec 11, 2023
Merged

Composable puck #265

merged 68 commits into from
Dec 11, 2023

Conversation

chrisvxd
Copy link
Member

@chrisvxd chrisvxd commented Nov 29, 2023

Merge blocked by #41, but ready for review regardless.

Description

This PR

  • adds compositional Puck via children
  • adds a usePuck hook for building custom components within compositional Puck
  • adds an overrides prop to override specific parts of the interface, replacing renderHeader and renderHeaderActions
  • adds a ui prop to set the initial UI state
  • adds an isDragging boolean in the UI state
  • makes onPublish optional
  • removes the renderComponentList prop (breaking change)
  • updates the plugin API to align with the overrides functionality (breaking change, but not listed as feat so won't appear in changelog - might want to revisit)

👉 See an example page with custom overrides 👈

Rather than reimplement the docs here, I suggest reading the new Extending Puck section in the docs.

Additional reading:

Tasks

  • Rename customUi to skin, outfit or theme?
  • Rename Puck.fields to Puck.form?
  • Document
  • Add children to overrides.headerActions for plugin currying
  • Ensure Plugin API supports customUi.fields
  • Consider adding an explicit feat for breaking the plugin API
  • Finalise naming for appState (vs state) in usePuck hook
  • Remove padding and border from Puck fields by default?
  • Add experimental warning to overrides?

Closes #224

Copy link

vercel bot commented Nov 29, 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 Dec 11, 2023 6:43pm
puck-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2023 6:43pm

@chrisvxd chrisvxd force-pushed the composable-puck branch 2 times, most recently from e3cd3c3 to bc50845 Compare December 1, 2023 17:50
@chrisvxd chrisvxd merged commit 10a6025 into main Dec 11, 2023
2 checks passed
@chrisvxd chrisvxd deleted the composable-puck branch December 11, 2023 18:45
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.

Make Puck more composable
2 participants