feat(editor): harden updateBlocks + expose editor primitives (toe-ed-… - #52
Merged
Conversation
…01…13) Editor-DX pass: make the visual-editor write path safe and stop consumers re-implementing package internals. - toe-ed-01: updateBlocks now enforces the same structural validation as the single-block routes (root blockId guard, block-type existence, per-type property validation, placement), diff-scoped so created blocks validate strictly, updated/root use patch semantics, and unchanged blocks are skipped (a stale sibling can't brick an unrelated save). - toe-ed-02: normalize an incoming root node type 'root' -> collection type so a getBlockTree->updateBlocks round-trip is lossless (mirrors merges.ts). - toe-ed-09: apply property defaultValue to created blocks (defaults < template < caller) + export defaultPropertiesFor(); the field was declared + CLI-scaffolded but previously dead. - toe-ed-10: link targets require .min(1) so a required link with an empty target is rejected instead of silently passing. - toe-ed-04/06/07/11: export buildPlacementIndex + non-throwing isPlacementAllowed + allowedChildTypes + PlacementIndex; move isResolvedReference to a pure module exported from root (+toStoredReference); export RefMode; BlocksMap getCollection/ getComponents accessors; parameterize BlockComponentProps by RefMode. - toe-ed-05/08/12/13 docs: updateBlocks reference section + editor-guide notes (getTemplateDefaults prefill, blk_ id minting, runtime placement helpers). Adversarial review caught 2 real defects in the initial toe-ed-01 (root props bypassed validation; strict re-validation of untouched blocks could brick saves); fixed via diff-driven scoping + 3 regression tests. 1100 tests + tsc + lint + docs build + turbo build green.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Merged
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.
No description provided.