From 2d71dde79e2781316aeda9c6713a3ae2d9bb9452 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Fri, 19 Jun 2026 10:33:30 -0400 Subject: refactor(theme-studio): extract per-package previews into previews.js The ~28 renderXxxPreview functions plus ofs/os/previewLines were ~460 lines of bespoke sample content sitting in the middle of the controller. I moved them to a new previews.js, spliced into the page through a PREVIEWS_J token the same way the other inlined libs are, and left the PACKAGE_PREVIEWS registry and dispatcher in app.js. app.js drops from 1233 to 759 lines, and the sample data now lives apart from the table/control machinery. --- scripts/theme-studio/generate.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts/theme-studio/generate.py') diff --git a/scripts/theme-studio/generate.py b/scripts/theme-studio/generate.py index 347a21976..3d8eae68d 100644 --- a/scripts/theme-studio/generate.py +++ b/scripts/theme-studio/generate.py @@ -37,6 +37,9 @@ COLORMATH_BODY=strip_exports(read_text('colormath.js')) # (MAP_J, PALETTE_J, COLORMATH_J, ...); those are filled after it is spliced in. STYLES=read_text('styles.css') APP_BODY=read_text('app.js') +# Bespoke per-package preview renderers, spliced into the page