feat: download and copy-as-code for generated components#56
Open
GeneralJerel wants to merge 1 commit intomainfrom
Open
feat: download and copy-as-code for generated components#56GeneralJerel wants to merge 1 commit intomainfrom
GeneralJerel wants to merge 1 commit intomainfrom
Conversation
Add the ability to download any generated visualization as a standalone HTML file (with animations preserved) and copy the source code to clipboard. This addresses the artifact export story needed for the upcoming component gallery. - New export-utils.ts with assembleStandaloneHtml (widgets), chartToStandaloneHtml (bar/pie charts), and triggerDownload - Download and copy buttons added to SaveTemplateOverlay, visible on all generated components (widgets, bar charts, pie charts) - Export SVG_CLASSES_CSS and FORM_STYLES_CSS from widget-renderer - Update demo-gallery plan with Variant-style layout and #55 context Closes #14 Closes #42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
New:
apps/app/src/components/generative-ui/export-utils.tsassembleStandaloneHtml()— wraps widget HTML in a full document with theme CSS, import maps, and stubbed bridge functionschartToStandaloneHtml()— generates standalone Chart.js HTML from structured chart datatriggerDownload()— browser file download via Blob + object URLslugify()— filename helperModified:
apps/app/src/components/generative-ui/save-template-overlay.tsxModified:
apps/app/src/components/generative-ui/widget-renderer.tsxSVG_CLASSES_CSSandFORM_STYLES_CSSconstants (needed by export-utils)Updated:
.chalk/plans/demo-gallery.mdCloses
Test plan
🤖 Generated with Claude Code