refactor(pdf): introduce createBaseTemplateStyles factory (~1,150 lines removed)

Move 14 identical style slots (text/heading/div/inline/link/small/bold/
richParagraph/richListItemRow/richListItemMarker/richListItemContent/
splitRow/alignEnd/picture) from all 15 template Page.tsx files into a
single createBaseTemplateStyles factory in templates/shared. Each template
now spreads …base and keeps only its real overrides. Resolved StyleSheet
values are identical to before. Update rtl-fixture and rich-text-template-
styles tests to guard the factory file rather than each template directly.

Claude-Session: https://claude.ai/code/session_012Bnvt1MghwHj4qQRxuQUGa
This commit is contained in:
Amruth Pillai
2026-07-04 20:13:42 +02:00
parent 0701f3b62a
commit f3a60432df
18 changed files with 207 additions and 1154 deletions
+2 -1
View File
@@ -20,7 +20,8 @@ describe("RTL PDF fixture", () => {
const source = readFileSync(pagePath, "utf8");
expect(source).toContain("createRtlStyleHelpers");
expect(source).toContain("alignEnd");
// ponytail: alignEnd moved to createBaseTemplateStyles factory; either direct or factory counts.
expect(source.includes("alignEnd") || source.includes("createBaseTemplateStyles")).toBe(true);
expect(source).not.toContain("alignRight");
expect(source).not.toContain('from "@reactive-resume/utils/locale"');
});