Add block selector UI for toggle block controls#39
Open
jeremyfelt wants to merge 2 commits intotrunkfrom
Open
Conversation
Replace the raw "Controls ID" text input with a browser that lists every block in the current post. Selecting a block sets its anchor as the toggle target and auto-generates one when the block has no anchor yet. Manual ID entry is kept as a fallback for targets that live outside the post.
|
Changed files were detected after build. Please run project build workflows and check You may need to update your local NPM configuration if different than below:
|
1 similar comment
|
Changed files were detected after build. Please run project build workflows and check You may need to update your local NPM configuration if different than below:
|
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
Replaces the simple text input for specifying toggle controls with a comprehensive block selector component that allows users to browse and select blocks from the current post.
Key Changes
New BlockSelector component (
src/toggle-block/block-selector.js): A React component that provides:Updated toggle block editor (
src/toggle-block/index.js): Replaced the simpleTextControlfor "Controls ID" with the newBlockSelectorcomponent, passing required props (clientId,controlsId,setAttributes)Styling (
src/toggle-block/index.cssandbuild/toggle-block/index.css): Added comprehensive CSS for the block selector UI including:Implementation Details
useSelect,useDispatch) for block managementhttps://claude.ai/code/session_016vxYXqA2br4AMfkRY4L4GZ