From 7bed2a6a3fd19958f1aabb8b383e56dea94b68a3 Mon Sep 17 00:00:00 2001
From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com>
Date: Tue, 2 Jun 2026 14:14:32 -0400
Subject: [PATCH] book(A2): Template-tab "Book" entry + mode switching
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Adds the Book button to the Template tab's layout picker
(alongside Case cover / Disc labels / Slide deck) and wires the
applyLayout('book') path so the user can switch into book mode.
- `mode-book` button + click binding via the existing applyLayout
loop (one-line list addition keeps every layout tab routed
through the same handler).
- `applyLayout('book')` calls `ensureBookState()` to lazy-init the
manifest the first time a user enters the mode.
- New `template-book` body class + CSS gating: the new
`#bookFieldset` sidebar block shows only in book mode, and the
cover / disc / deck / custom-art fieldsets hide in book mode so
the sidebar stays focused on the spec + masters affordances.
- `WORKFLOW_ORDER` learns the book column.
- `sheetW` / `sheetH` fall back to trim + bleed when
`templateMode === 'book'` so the canvas-host placeholder is
sized correctly (it stays blank in this phase; the actual Pages
overview + Cover view come in A4/A5).
- Sidebar fieldset shows a derived spec summary (trim, bleed,
paper thickness, derived spine width, page + master count)
rendered by a new `syncBookSidebarSummary()` hook into
`syncInputs()`. Book-state helpers (`bookPageCount`,
`bookSpineWidthInches`) are pure functions so future phases can
reuse them.
- Two placeholder buttons (Document settings… / Manage masters…)
are stubbed disabled with a hint pointing at the upcoming
phases, so users can see where the controls will land.
---
src/index.html | 83 ++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 81 insertions(+), 2 deletions(-)
diff --git a/src/index.html b/src/index.html
index 23431b7..3d2c3b4 100644
--- a/src/index.html
+++ b/src/index.html
@@ -500,6 +500,20 @@
body.template-deck #deckThemeFieldset { display: block; }
#deckSlideThemeWrap { display: none; margin-top: 10px; }
body.editing-deck-slide #deckSlideThemeWrap { display: block; }
+ /* Book Designer sidebar fieldset shows only in book mode. */
+ #bookFieldset { display: none; }
+ body.template-book #bookFieldset { display: block; }
+ /* Hide cover / disc / artwork panels that aren't relevant in book
+ mode (Phase A2 — book mode shows only its own fieldset + layers
+ + metadata + save). The Pages overview canvas-host comes in
+ Phase A4; until then the canvas-host remains blank. */
+ body.template-book #coverSizeFieldset,
+ body.template-book #coverArtworkFieldset,
+ body.template-book #discArtworkFieldset,
+ body.template-book #jewelArtworkFieldset,
+ body.template-book #customArtFieldset,
+ body.template-book #deckFieldset,
+ body.template-book #deckThemeFieldset { display: none !important; }
#layersFieldset { order: 40; }
#designerMetadataFieldset { order: 45; }
#exportFieldset { order: 50; }
@@ -3013,6 +3027,7 @@
+
@@ -3196,6 +3211,17 @@
Click a slide thumbnail to edit it. Drag thumbnails to reorder.