fix(editor): keep block values across pages, fit around panels, HTML blocks with CSS and JS variables - #16
Merged
Merged
Conversation
…blocks with CSS and JS variables - Blocks start from their saved values instead of their defaults. Going to the block editor and back remounted every block with its defaults, which were written over the saved values (position, size, text, code) before being read back; anything reading the store then (autosave, the shared selection box) could keep them. It also made a new code block show raw `<pre><code>` markup for a frame, and a code block lost a custom background because its theme effect ran again on mount. - Content-sized blocks no longer store a 0 × 0 size while the canvas is hidden during navigation. - A text block exported while selected or hovered no longer carries its blue outline into the image. - Zoom to fit and Zoom to 100% fit and center the canvas in the space the floating toolbar and properties panel leave free (with Agent open the canvas ended up under the properties panel). - HTML block scripts can build elements: the scoped `document` called page methods on the proxy, so `createElement` threw and lists rendered from a JS array stayed empty. One shared `createScopedDocument` replaces the two copies. A `// @var` value followed by a semicolon now parses. - Agent and MCP: every HTML block has html, css and js, with annotated `:root` variables and `// @var` JS variables (html-contract.ts). add_block, update_block and update_html_block refuse other code with what to fix (also a redeclared variable or a list that is not a JSON list of strings) and turn allow-scripts on. The guide, prompts, catalog and docs say so. - Property panel of HTML blocks: readable variable names in aligned rows, numbers with a typed value, lists edited item by item (reorder, remove, add; numbers no longer break editing), objects edited in place or as JSON, and a compact shadow editor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PQYEWDFg3DVAHPn4MuxJQS
… panel scrolls to its end - The properties panel could not scroll to its end: each tab's scroll area took the full height of the panel below its title (and the align bar of the Control tab), so the last ~100 px stayed hidden. Tabs are now a TabPage whose scroll area takes only the height left. - Project variables leave the Workspace tab for their own Variables tab. - The brand kit editor is one component (BrandKitEditor) shown in a new Brand kit tab; File → Brand kit… opens that tab in the editor and the dialog elsewhere. ui-store's selectedTab now switches to any panel tab. - Agent and MCP clients write the brand kit: update_brand_kit (name, palette, fonts by role checked against Google Fonts, logo names and uses, guidelines) and save_brand_logo (SVG markup cleaned of scripts, a data URL or an image block). The guide and prompts ask for it only when the user gives their brand or asks for a kit. - CHANGELOG: v2.0.0 is out, so the changes since then move to Unreleased. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PQYEWDFg3DVAHPn4MuxJQS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PQYEWDFg3DVAHPn4MuxJQS
…space settings Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PQYEWDFg3DVAHPn4MuxJQS
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
the block editor and back remounted every block with its defaults, which
were written over the saved values (position, size, text, code) before
being read back; anything reading the store then (autosave, the shared
selection box) could keep them. It also made a new code block show raw
<pre><code>markup for a frame, and a code block lost a custombackground because its theme effect ran again on mount.
hidden during navigation.
blue outline into the image.
floating toolbar and properties panel leave free (with Agent open the
canvas ended up under the properties panel).
documentcalled pagemethods on the proxy, so
createElementthrew and lists rendered from aJS array stayed empty. One shared
createScopedDocumentreplaces the twocopies. A
// @varvalue followed by a semicolon now parses.:rootvariables and// @varJS variables (html-contract.ts).add_block, update_block and update_html_block refuse other code with what
to fix (also a redeclared variable or a list that is not a JSON list of
strings) and turn allow-scripts on. The guide, prompts, catalog and docs
say so.
numbers with a typed value, lists edited item by item (reorder, remove,
add; numbers no longer break editing), objects edited in place or as
JSON, and a compact shadow editor.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01PQYEWDFg3DVAHPn4MuxJQS