diff --git a/frontend/src/pages/Play.jsx b/frontend/src/pages/Play.jsx index 1baa335..d09c76e 100644 --- a/frontend/src/pages/Play.jsx +++ b/frontend/src/pages/Play.jsx @@ -303,6 +303,22 @@ function ScriptsPanel({ advId }) { setScripts((prev) => prev.map((s) => (s.id === script.id ? updated : s))) } + // Download as an import-compatible bundle (matches /scripts export), so demo + // scripts can be forked into your own library via the Scripts page's Import. + const download = (s) => { + downloadJSON( + { + name: s.name, + description: s.description, + library: s.library_js, + input: s.input_js, + context: s.context_js, + output: s.output_js, + }, + `${(s.name || 'script').replace(/\W+/g, '-')}.json`, + ) + } + if (!scripts) return
Loading…
if (scripts.length === 0) { return ( @@ -324,9 +340,12 @@ function ScriptsPanel({ advId }) { toggle(s)} /> {s.name} - +
+ + +
{s.description &&
{s.description}
} {open && (