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.
This commit is contained in:
Doxa Maps 2026-10-01 08:52:21 +00:00
parent 2da7f15ec7
commit 0a4e539935
2 changed files with 29 additions and 22 deletions

View file

@ -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.
*/

View file

@ -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.<key>, 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'