From 0a4e539935e8db8398ce56307a998671217b5cf1 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Thu, 1 Oct 2026 08:52:21 +0000 Subject: [PATCH] Bible Posters: consume the shared poster size table Replace the temporary local size mirror with the shared ladder (library/constants/posterSizes.js via resolvePosterSize): the plugin selects its five keys (paper, 36x36, 36x60, 66x66, 60x96), mapping widthIn/heightIn from the entry's inches and the panel count from its sheets, and keeps its own locale-neutral dimension labels until the shared picker lands. One remaining comment reference is neutralized. --- .../bible-posters/src/biblePoster.js | 2 +- plugin-designs/bible-posters/src/sizes.js | 49 +++++++++++-------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/plugin-designs/bible-posters/src/biblePoster.js b/plugin-designs/bible-posters/src/biblePoster.js index cea19e91b..688cbd9b0 100644 --- a/plugin-designs/bible-posters/src/biblePoster.js +++ b/plugin-designs/bible-posters/src/biblePoster.js @@ -10,7 +10,7 @@ * screen, ~7-10 words per line, JUSTIFIED, the whole book visible at once. RTL scripts flow right-to-left. * * ⚠ This is a MODEL of the layout (character-advance estimates), not a measurement of the rendered page. - * A headless plan proves the arithmetic; only a browser (rega) proves the page. Every number the model + * A headless plan proves the arithmetic; only a browser check proves the page. Every number the model * uses is named here so a rendered measurement can correct the constants. */ diff --git a/plugin-designs/bible-posters/src/sizes.js b/plugin-designs/bible-posters/src/sizes.js index e07ede17f..1871e2403 100644 --- a/plugin-designs/bible-posters/src/sizes.js +++ b/plugin-designs/bible-posters/src/sizes.js @@ -1,28 +1,35 @@ /** - * sizes.js — the poster size ladder for Bible Posters. + * sizes.js — the poster size ladder for Bible Posters, taken from the SHARED table. * - * ⚠ TEMPORARY, DO NOT LET IT DIVERGE. studio OWNS the shared size table + picker - * (library/constants/posterSizes.js) and the approved SIZE KEYS - * (the approved SIZE KEYS): - * paper · 36x36 · 36x60 · 66x66 · 60x96, portrait only. As of development ce930476 the shared table - * still holds the OLD US/ISO presets, so this mirrors the APPROVED keys locally to unblock the build. - * REPLACE this with `import { ... } from '@map/constants/posterSizes.js'` (and the shared picker) as - * soon as studio lands the new ladder — request it from studio; never edit the shared file here. + * Consumes the centrally-owned ladder (library/constants/posterSizes.js, imported as + * '@map/constants/posterSizes.js'); this plugin only SELECTS its subset of keys and keeps its own + * locale-neutral dimension labels until the shared picker (with localized names) lands. The size table + * is never edited here. * - * A book is laid out on the FINISHED poster (width × height, portrait). `sheets` records the panel plan - * for the large sizes (glued print); the multi-panel PRINT path reuses library panelSheets.js and is a - * milestone-2 follow-up — the fit MODEL uses the finished dimensions. + * A book is laid out on the FINISHED poster (width × height, portrait). `sheets` is the shared entry's + * panel count; the multi-panel PRINT path (reusing library panelSheets.js) is a later milestone — the + * fit MODEL uses the finished dimensions. */ -// Labels are locale-neutral DIMENSIONS (in/ft are unit symbols, like cm) so no English word leaks into a -// non-English UI. When studio's shared table lands its localized names (poster.size., e.g. "Standard -// paper"), switch the picker to those; request the change from studio, never edit the shared file here. -export const BIBLE_POSTER_SIZES = [ - { id: 'paper', key: 'paper', label: '8.5 × 11 in', widthIn: 8.5, heightIn: 11, sheets: 1 }, - { id: '36x36', key: '36x36', label: '3 × 3 ft', widthIn: 36, heightIn: 36, sheets: 1 }, - { id: '36x60', key: '36x60', label: '3 × 5 ft', widthIn: 36, heightIn: 60, sheets: 1 }, - { id: '66x66', key: '66x66', label: '5.5 × 5.5 ft', widthIn: 66, heightIn: 66, sheets: 2 }, - { id: '60x96', key: '60x96', label: '5 × 8 ft', widthIn: 60, heightIn: 96, sheets: 3 }, -] +import { POSTER_LADDER, resolvePosterSize } from '@map/constants/posterSizes.js' + +// The 5 ladder keys this plugin offers (portrait; a whole book needs the large ones). 'paper' carries +// Letter inches in the shared table; sizing it to A4 for an A4 reader (via paperFor) is a later refinement. +const BIBLE_KEYS = ['paper', '36x36', '36x60', '66x66', '60x96'] + +// Locale-neutral DIMENSION labels (in/ft are unit symbols, like cm) so no English word leaks into a +// non-English UI. Swap for the shared picker's localized names when it lands. +const LABELS = { + paper: '8.5 × 11 in', + '36x36': '3 × 3 ft', + '36x60': '3 × 5 ft', + '66x66': '5.5 × 5.5 ft', + '60x96': '5 × 8 ft', +} + +export const BIBLE_POSTER_SIZES = BIBLE_KEYS.map((k) => { + const e = resolvePosterSize(k) || POSTER_LADDER[k] + return { id: k, key: k, label: LABELS[k], widthIn: e.inches.w, heightIn: e.inches.h, sheets: e.sheets.count } +}) export const SIZE_BY_ID = Object.fromEntries(BIBLE_POSTER_SIZES.map((s) => [s.id, s])) export const DEFAULT_SIZE_ID = '36x60'