Repository navigation
Shapes in the palette, and a radio kind - #176
Conversation
|
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 PR is included in version 1.11.3 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 0.16.0 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.10.2 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.1.1 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.4.0 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
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.