diff --git a/.changeset/playground-design-system-blocks.md b/.changeset/playground-design-system-blocks.md new file mode 100644 index 00000000..05ea8f61 --- /dev/null +++ b/.changeset/playground-design-system-blocks.md @@ -0,0 +1,5 @@ +--- +"@styleframe/theme": patch +--- + +Simplify field-group recipe selector: consolidate `.input`, `.select`, `.textarea` flex-grow rules into a single joined selector. diff --git a/apps/playground/AGENTS.md b/apps/playground/AGENTS.md index baf23529..507bd111 100644 --- a/apps/playground/AGENTS.md +++ b/apps/playground/AGENTS.md @@ -1,11 +1,12 @@ # Styleframe Playground -Interactive client-side playground for Styleframe. Users edit three files in CodeMirror; an iframe renders the live result. +Interactive client-side playground for Styleframe. Users edit an arbitrary set of files (React `tsx` components + a `styleframe.config.ts`) in CodeMirror; an iframe renders the live result. ## Package - **Name:** `@styleframe/playground` -- **Build tool:** Vite 7 + Vue 3 +- **Shell:** Vite + Vue 3 (the playground UI is a Vue app; it is invisible to users) +- **Preview:** React 19 + `tsx`, bundled in the browser with `esbuild-wasm` - **Runs:** fully client-side — no server, no auth, no persistence. - **Not published to npm.** @@ -14,42 +15,35 @@ Interactive client-side playground for Styleframe. Users edit three files in Cod ``` apps/playground/ ├── styleframe.config.ts # shell: theme presets + #app / html selectors -├── vite.config.ts # Styleframe Vite plugin + vue() +├── vite.config.ts # Styleframe Vite plugin (minify:false) + vue() + React vendoring ├── index.html ├── src/ -│ ├── App.vue # playground shell root +│ ├── App.vue # playground shell root (Editor │ Output │ Tree) │ ├── main.ts # imports virtual:styleframe.css, mounts App -│ ├── recipes/ # playground-local recipes (pg-*) -│ │ ├── useTabRecipe.ts -│ │ ├── useTabListRecipe.ts -│ │ ├── useSplitPaneRecipe.ts -│ │ ├── useEditorShellRecipe.ts -│ │ ├── useErrorBannerRecipe.ts -│ │ ├── useToolbarRecipe.ts -│ │ ├── index.ts # barrel +│ ├── recipes/ # playground-local recipes (pg-*), incl. useFileTreeRecipe │ │ └── playground.styleframe.ts # registers recipes into the shell instance │ ├── components/ -│ │ ├── SplitPane.vue -│ │ ├── TabList.vue -│ │ ├── EditorPane.vue # 3-tab editor (config, App, Component) -│ │ ├── OutputPane.vue # 3-tab output (Preview, CSS, JS) -│ │ ├── CodeOutput.vue # read-only CodeMirror +│ │ ├── SplitPane.vue # Editor │ Output split +│ │ ├── FileTree.vue # project tree (far right): create / rename / delete +│ │ ├── EditorPane.vue # dynamic, path-keyed CodeMirror editors + tabs +│ │ ├── OutputPane.vue # Preview / CSS / JS tabs │ │ ├── PreviewFrame.vue # iframe + postMessage listener │ │ └── ErrorBanner.vue │ ├── editor/ -│ │ ├── codemirror.ts # createEditor({parent, doc, language, onChange}) -│ │ └── theme.ts # CodeMirror theme extension +│ │ ├── codemirror.ts # createEditor(...) + languageForPath() (ts / tsx / css) +│ │ └── theme.ts │ ├── pipeline/ │ │ ├── esbuild.ts # lazy esbuild-wasm init (single instance) -│ │ ├── transformTs.ts -│ │ ├── evalUserConfig.ts # rewrites imports, runs via new Function +│ │ ├── transformTs.ts # strips TS from the config before eval +│ │ ├── evalUserConfig.ts # rewrites imports, runs config via new Function +│ │ ├── scanAndRegisterUtilities.ts │ │ ├── transpileStyleframe.ts -│ │ ├── compileVueSfc.ts -│ │ ├── buildSrcdoc.ts +│ │ ├── bundlePreview.ts # esbuild-wasm bundle of all user files → one ESM module +│ │ ├── buildSrcdoc.ts # CSS + React vendor + bundle → srcdoc │ │ └── pipeline.ts # orchestrator + debounce + PipelineResult -│ ├── samples/ # default file contents, imported as ?raw +│ ├── samples/ # default file contents (.tsx + config), imported as ?raw │ └── state/ -│ └── playground.ts # reactive { files, output, error, active* } +│ └── playground.ts # reactive { files, output, error, active* } + file actions └── test/ # Vitest specs for pipeline units ``` @@ -60,36 +54,45 @@ apps/playground/ | Context | Compiled by | Where CSS lives | Runtime | |---|---|---|---| | Shell UI | `@styleframe/plugin/vite` at dev/build time | `
- - + + +