the lead photograph gets Shape
The same framing a media block has had since it existed, so a template wanting a letterbox lead can ask for one. It was in PLACES_ONLY — the list of blocks that hold nothing — which was true until it held a ratio. Shape and only Shape. Not the media block's other controls: there is no file to choose, because the picture is the carousel's first item, and no crop to set, because the crop belongs to the carousel item. Two crops for one placement is two answers able to disagree. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -44,8 +44,12 @@ const PLACES_ONLY: string[] = [
|
|||||||
'collections',
|
'collections',
|
||||||
'pieces',
|
'pieces',
|
||||||
'collabs',
|
'collabs',
|
||||||
// The subject blocks hold nothing either: what they draw is the row the URL names.
|
/*
|
||||||
'subject-cover',
|
The subject blocks hold nothing either: what they draw is the row the URL names.
|
||||||
|
|
||||||
|
`subject-cover` is the exception and stays OUT of this list — it holds a `ratio`, which is a real
|
||||||
|
stored value and needs a settings panel to set it. Everything else here genuinely holds nothing.
|
||||||
|
*/
|
||||||
'subject-title',
|
'subject-title',
|
||||||
'subject-description',
|
'subject-description',
|
||||||
'subject-specs',
|
'subject-specs',
|
||||||
@@ -820,6 +824,38 @@ export const PageBuilderPanel = () => {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{/*
|
||||||
|
The lead photograph gets Shape, and only Shape.
|
||||||
|
|
||||||
|
The same framing the media block has had since it existed — a template wanting a letterbox
|
||||||
|
lead had no way to ask for one. Not the rest of that block's controls: there is no file to
|
||||||
|
choose, because the picture is the carousel's first item, and no crop to set, because the
|
||||||
|
crop belongs to the carousel item and two crops for one placement is two answers able to
|
||||||
|
disagree.
|
||||||
|
*/}
|
||||||
|
{block.kind === 'subject-cover' && (
|
||||||
|
<div className="mt-3 flex flex-col gap-1">
|
||||||
|
<label className="text-xs">Shape</label>
|
||||||
|
<select
|
||||||
|
value={shapeOf({ content: { url: 'x.png', ratio: block.content?.ratio } }) ?? ''}
|
||||||
|
onChange={(event) => {
|
||||||
|
const chosen = SHAPES.find((one) => one.value === event.currentTarget.value);
|
||||||
|
void handlersRef.current.setContent(block, {
|
||||||
|
...block.content,
|
||||||
|
ratio: chosen?.ratio ?? undefined,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
className="h-8 rounded-md border border-input bg-transparent px-2 text-xs"
|
||||||
|
>
|
||||||
|
{SHAPES.map((one) => (
|
||||||
|
<option key={one.value || 'own'} value={one.value}>
|
||||||
|
{one.label}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{(block.kind === 'media' || block.kind === 'video') && (
|
{(block.kind === 'media' || block.kind === 'video') && (
|
||||||
<div className="flex flex-col gap-3">
|
<div className="flex flex-col gap-3">
|
||||||
{/*
|
{/*
|
||||||
|
|||||||
Reference in New Issue
Block a user