Image block: a Size (small, medium, large), centered

- image_size (101): blank the column's full width, else up to 20, 32
  or 48rem, centered and never wider than the column

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-11-12 05:58:49 -06:00
parent c26e662406
commit a0eb9d7e49
7 changed files with 39 additions and 2 deletions

View file

@ -179,6 +179,8 @@ export const blocksChild = (ownerKind) => ({
text("venue_id"),
// List blocks (092): null bold text, 'plain' the old look.
enumeration("list_style", ["plain"]),
// Image blocks (101): null full width, else a narrower size.
enumeration("image_size", ["small", "medium", "large"]),
// Organizations blocks (093): the kind listed when none are picked.
enumeration("org_kind", ["region", "group", "partner", "ministry"]),
// How it's presented (095): EventPresent.tsx.

View file

@ -0,0 +1,15 @@
-- ═══════════════════════════════════════════════════════════════
-- 101 AN IMAGE BLOCK'S SIZE
--
-- How wide an image block shows, centered in the column:
--
-- null the column's full width (as before)
-- small up to 20rem
-- medium up to 32rem
-- large up to 48rem
--
-- Never wider than the column. Other block types ignore it.
-- ═══════════════════════════════════════════════════════════════
ALTER TABLE content_blocks ADD COLUMN image_size TEXT
CHECK (image_size IN ('small', 'medium', 'large'));

View file

@ -87,7 +87,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
const blockRows = db
.prepare(
`SELECT id, owner_id, type, text, media, href, alt, cite, captions, team_id, venue_id,
word_motion, word_direction, word_seconds, list_style, org_kind,
word_motion, word_direction, word_seconds, list_style, image_size, org_kind,
present_show, present_text, present_map_split, present_map_no_list,
present_map_no_details, present_places, present_place_keys
FROM content_blocks
@ -112,6 +112,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
team_id: row.team_id,
venue_id: row.venue_id,
list_style: row.list_style,
image_size: row.image_size,
org_kind: row.org_kind,
// Its rotating words' motion (084), when it has its own.
words: row.word_motion || row.word_direction || row.word_seconds