Repository navigation
Shapes in the palette, and a radio kind - #176
Merged
Merged
Conversation
lero62
requested review from
ChiefCreator,
SearheiParkhamchuk and
dogfrogfog
as code owners
October 9, 2026 02:36
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
🎉 This PR is included in version 1.5.0 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Both come from one need: a consumer wanted its own link — a page, an anchor and an address, with the right field showing at the right moment — and could only get it by typing json in Code mode at every use.
shapesA consumer registers ready-made subtrees by name:
They appear in the palette in a Custom group above the plain kinds. A pick drops the fields flat into the level you are standing in, under the names the schema declares — nothing to answer, no wrapper, and the keys the site reads are the same wherever an editor used it.
Each node carries
shape: '<name>', which is the whole mechanism:The rebuild runs where the shared-section one already runs, and works at any depth — inside groups, tabs and array rows.
/sharedgains builders —text,select,radio,group,arrayand the rest — so a schema in a consumer's config reads as a schema rather than as literal nodes.radioA leaf kind holding
valueandoptionsexactly asselectdoes, drawn as buttons in a row. Two-option choices lose something real when flattened into a dropdown, and that is the shape most of these links take.Worth knowing:
@payloadcms/uiexports a standalone input for checkbox, select, text, textarea, relationship and upload — but not for radio. OnlyRadioGroupFieldis public, and it readsuseField/useForm, so it cannot be driven by a value the builder holds. Its internalRadiois exactly the presentational component we need and is not exported. So the markup is reproduced here and rides on Payload's own classes — which means a rename on their side would move it silently. Worth a glance after a Payload upgrade.Also
JsonNode.tsxhad grown to 342 lines with the radio, the container branches and the whole input chain inlined. Split along the package's existing pattern — one component per file:Scope
No migration. A stored value only gains a
radionode or ashapemark once someone adds one, and an unknown kind already keeps a field in Code mode rather than breaking it.